index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div class="padding-20">
  3. <div class="search-box">
  4. <el-form ref="form" :inline="true" :model="searchForm" clearable label-width="100px" class="mt-10">
  5. <el-form-item label="姓名:">
  6. <el-input v-model="searchForm.department_name" placeholder="请输入姓名" clearable></el-input>
  7. </el-form-item>
  8. <el-form-item label="手机号:">
  9. <el-input v-model="searchForm.department_name" placeholder="请输入手机号后4位" clearable></el-input>
  10. </el-form-item>
  11. <el-form-item label="身份证:">
  12. <el-input v-model="searchForm.department_name" placeholder="请输入身份证后6位" clearable></el-input>
  13. </el-form-item>
  14. <el-form-item label="申请时间:">
  15. <el-date-picker
  16. :editable="false"
  17. v-model="time"
  18. @change="timearr => {timearr ? (searchForm.start_time = timearr[0] + ' 00:00:00', searchForm.end_time = timearr[1] + ' 23:59:59') : searchForm.start_time = searchForm.end_time = undefined}"
  19. type="daterange"
  20. value-format="yyyy-MM-dd"
  21. start-placeholder="开始时间"
  22. end-placeholder="结束时间"
  23. ></el-date-picker>
  24. </el-form-item>
  25. <el-form-item class="ml-10">
  26. <el-button icon="el-icon-search" type="primary" @click="searchSubmit">查询</el-button>
  27. </el-form-item>
  28. </el-form>
  29. </div>
  30. <el-table
  31. :data="tableData"
  32. stripe
  33. v-loading="tableLoading"
  34. fit
  35. class="marginT-10 order-table"
  36. border
  37. :max-height="vheight">
  38. <el-table-column label="农户姓名" prop="id"></el-table-column>
  39. <el-table-column label="身份证号" prop="created_at"></el-table-column>
  40. <el-table-column label="手机号" prop="department_name"></el-table-column>
  41. <el-table-column label="村信息" prop="department_desc" show-overflow-tooltip></el-table-column>
  42. <el-table-column label="微信号" prop="department_project_name" show-overflow-tooltip></el-table-column>
  43. <el-table-column label="个人二维码" prop="department_project_name">
  44. <template slot-scope="scope">
  45. <el-image
  46. style="display: block;width: 80px; height: 80px;font-size: 0;"
  47. :src="scope.row.element_img_url"
  48. :preview-src-list="[]">
  49. </el-image>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="详细地址" prop="department_project_name" show-overflow-tooltip></el-table-column>
  53. <el-table-column label="备注" prop="department_project_name" show-overflow-tooltip></el-table-column>
  54. <el-table-column label="申请时间" prop="department_project_name"></el-table-column>
  55. <el-table-column label="状态" prop="department_project_name"></el-table-column>
  56. <el-table-column label="操作">
  57. <template slot-scope="scope">
  58. <el-button type="text" @click="edit(scope.row)">操作</el-button>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <el-pagination
  63. class="marginT-20"
  64. @size-change="handleSizeChange"
  65. @current-change="handleCurrentChange"
  66. :hide-on-single-page="true"
  67. :current-page="page"
  68. :page-size="page_size"
  69. :page-sizes="[10, 20, 100, 200, 300, 400]"
  70. background
  71. layout="total, sizes, prev, pager, next, jumper"
  72. :total="totalCount"/>
  73. <detail
  74. v-if="detailsDialog.show"
  75. v-model="detailsDialog.show"
  76. :exData="detailsDialog.exData"
  77. @success="init"></detail>
  78. </div>
  79. </template>
  80. <script>
  81. import page from '@/mixin/page'
  82. import detail from './details'
  83. export default {
  84. mixins: [page],
  85. components: {
  86. detail
  87. },
  88. data() {
  89. return {
  90. detailsDialog: {
  91. show: false,
  92. exData: {}
  93. },
  94. time: [],
  95. searchForm: {},
  96. tableData: [],
  97. tableUrl: '/api/admin/shop/apply/list'
  98. }
  99. },
  100. methods: {
  101. add() {
  102. this.detailsDialog.exData = {}
  103. this.detailsDialog.show = true
  104. },
  105. edit(row) {
  106. this.detailsDialog.exData = row
  107. this.detailsDialog.show = true
  108. },
  109. del(row) {
  110. this.$confirm('确定要删除吗', '确认', {
  111. confirmButtonText: '确定',
  112. cancelButtonText: '取消',
  113. type: 'warning'
  114. }).then(async () => {
  115. const data = await this.$fetch('/api/auth/department/del', { id: row.id })
  116. if (data.code === 200) {
  117. this.$message.success('删除成功')
  118. this.init()
  119. }
  120. }).catch(() => {})
  121. }
  122. },
  123. mounted() {
  124. this.init()
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. </style>