index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <div class="padding-20">
  3. <div class="search-box">
  4. <el-form
  5. ref="form"
  6. :inline="true"
  7. :model="searchForm"
  8. clearable
  9. label-width="80px"
  10. class="mt-10">
  11. <el-form-item label="姓名:">
  12. <el-input v-model="searchForm.user_name" placeholder="请输入姓名" clearable></el-input>
  13. </el-form-item>
  14. <el-form-item
  15. class="key-word"
  16. label="关键词:">
  17. <el-input v-model="searchForm.key_word" placeholder="请输入手机号后4位或身份证后6位" clearable></el-input>
  18. </el-form-item>
  19. <el-form-item label="申请时间:">
  20. <el-date-picker
  21. :editable="false"
  22. v-model="time"
  23. @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}"
  24. type="daterange"
  25. value-format="yyyy-MM-dd"
  26. start-placeholder="开始时间"
  27. end-placeholder="结束时间"
  28. ></el-date-picker>
  29. </el-form-item>
  30. <el-form-item class="ml-10">
  31. <el-button
  32. icon="el-icon-search"
  33. type="primary"
  34. @click="searchSubmit">查询
  35. </el-button>
  36. </el-form-item>
  37. </el-form>
  38. </div>
  39. <el-table
  40. :data="tableData"
  41. stripe
  42. v-loading="tableLoading"
  43. fit
  44. class="marginT-10 order-table"
  45. border
  46. :max-height="vheight">
  47. <el-table-column label="农户编号" prop="user_id"></el-table-column>
  48. <el-table-column label="农户姓名" prop="user_name"></el-table-column>
  49. <el-table-column label="身份证号" prop="user_card"></el-table-column>
  50. <el-table-column label="手机号" prop="shop_phone"></el-table-column>
  51. <el-table-column label="村信息" prop="country_msg" show-overflow-tooltip></el-table-column>
  52. <el-table-column label="详细地址" prop="shop_address" show-overflow-tooltip>
  53. <template slot-scope="scope">
  54. {{ scope.row.shop_address.address_name }}{{ scope.row.shop_address.name }}
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="农户类型" prop="shop_type">
  58. <template slot-scope="scope">{{ getShopTypeText(scope.row.shop_type) }}</template>
  59. </el-table-column>
  60. <el-table-column label="农户状态" prop="shop_status" show-overflow-tooltip>
  61. <template slot-scope="scope">{{ getShopStatusText(scope.row.shop_status) }}</template>
  62. </el-table-column>
  63. <el-table-column label="入驻时间" prop="shop_check_at"></el-table-column>
  64. <el-table-column label="操作">
  65. <template slot-scope="scope">
  66. <el-button type="text" @click="edit(scope.row)">操作</el-button>
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. <el-pagination
  71. class="marginT-20"
  72. @size-change="handleSizeChange"
  73. @current-change="handleCurrentChange"
  74. :hide-on-single-page="true"
  75. :current-page="page"
  76. :page-size="page_size"
  77. :page-sizes="[10, 20, 100, 200, 300, 400]"
  78. background
  79. layout="total, sizes, prev, pager, next, jumper"
  80. :total="totalCount"/>
  81. <detail
  82. v-if="detailsDialog.show"
  83. v-model="detailsDialog.show"
  84. :exData="detailsDialog.exData"
  85. @success="init"></detail>
  86. </div>
  87. </template>
  88. <script>
  89. import page from '@/mixin/page'
  90. import detail from './details'
  91. export default {
  92. mixins: [page],
  93. components: {
  94. detail
  95. },
  96. data() {
  97. return {
  98. detailsDialog: {
  99. show: true,
  100. exData: {}
  101. },
  102. time: [],
  103. searchForm: {},
  104. tableData: [],
  105. tableUrl: '/api/admin/shop/list'
  106. }
  107. },
  108. computed: {
  109. // 店铺类型
  110. shopType() {
  111. return [
  112. {
  113. name: '普通',
  114. value: '0'
  115. },
  116. {
  117. name: '优秀',
  118. value: '1'
  119. }
  120. ]
  121. },
  122. arrShopStatus() {
  123. return [
  124. {
  125. name: '审核中',
  126. value: '0'
  127. },
  128. {
  129. name: '审核通过',
  130. value: '1'
  131. },
  132. {
  133. name: '未通过',
  134. value: '2'
  135. }
  136. ]
  137. }
  138. },
  139. methods: {
  140. edit(row) {
  141. this.detailsDialog.exData = row
  142. this.detailsDialog.show = true
  143. },
  144. getShopStatusText(val) {
  145. const index = this.arrShopStatus.findIndex(item => item.value === val + '')
  146. if (index > -1) {
  147. return this.arrShopStatus[index].name
  148. }
  149. return ''
  150. },
  151. getShopTypeText(val) {
  152. const index = this.shopType.findIndex(item => item.value === val + '')
  153. if (index > -1) {
  154. return this.shopType[index].name
  155. }
  156. return ''
  157. }
  158. },
  159. mounted() {
  160. this.init()
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .key-word {
  166. ::v-deep .el-form-item__content {
  167. width: 260px;
  168. }
  169. }
  170. </style>