index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div class="pdl">
  3. <!-- 选项卡 -->
  4. <el-tabs v-model="activeName" @tab-click="handleClick">
  5. <el-tab-pane label="待处理" name="0" />
  6. <el-tab-pane label="已通过" name="1" />
  7. <el-tab-pane label="已拒绝" name="2" />
  8. </el-tabs>
  9. <!-- 搜索 -->
  10. <div class="formSearch">
  11. <el-form :inline="true" :model="formInline">
  12. <el-form-item label="商家名称">
  13. <el-input v-model="formInline.shopName" maxlength="20" placeholder="请输入商家名称" />
  14. </el-form-item>
  15. <el-form-item label="注册手机号">
  16. <el-input v-model="formInline.shopPhone" maxlength="11" placeholder="请输入注册手机号" />
  17. </el-form-item>
  18. <el-form-item label="店铺类型">
  19. <el-select v-model="formInline.authenType" clearable placeholder="请选择">
  20. <el-option label="个人" value="1" />
  21. <el-option label="个体工商户" value="2" />
  22. <el-option label="企业" value="3" />
  23. <el-option label="其他组织" value="4" />
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="申请时间">
  27. <el-date-picker
  28. v-model="formInline.dates" type="datetimerange" value-format="yyyy-MM-dd" range-separator="至"
  29. start-placeholder="开始日期" end-placeholder="结束日期"
  30. />
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button type="primary" plain @click="search">查询</el-button>
  34. </el-form-item>
  35. </el-form>
  36. </div>
  37. <!-- 表格 -->
  38. <div class="tableBox">
  39. <el-table
  40. ref="multipleTable" :data="tableData" border
  41. :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%"
  42. >
  43. <el-table-column label="商家名称" width="220">
  44. <template slot-scope="scope">{{ scope.row.shopName }}</template>
  45. </el-table-column>
  46. <el-table-column label="店铺类型">
  47. <template slot-scope="scope">
  48. <span v-if="scope.row.authenType == 1">个人</span>
  49. <span v-if="scope.row.authenType == 2">个体工商户</span>
  50. <span v-if="scope.row.authenType == 3">企业</span>
  51. <span v-if="scope.row.authenType == 4">其他组织</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="shopPhone" label="注册手机号" />
  55. <el-table-column prop="createTime" label="申请时间" />
  56. <el-table-column label="操作" show-overflow-tooltip>
  57. <template slot-scope="scope">
  58. <div class="btnList">
  59. <el-button v-if="activeName == 0" type="text" @click="handleDel(scope.row)">
  60. 处理
  61. </el-button>
  62. <el-button v-if="activeName == 1 || activeName == 2" type="text" @click="handleDel(scope.row)">
  63. 查看
  64. </el-button>
  65. <el-button v-if="activeName == 1 || activeName == 2" type="text" @click="delet(scope.row)">
  66. 删除
  67. </el-button>
  68. </div>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <div class="fenye">
  73. <el-pagination
  74. :current-page="formInline.page" :page-sizes="[10, 20, 50, 100]" :page-size="10"
  75. layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
  76. @current-change="handleCurrentChange"
  77. />
  78. </div>
  79. </div>
  80. <el-dialog
  81. :title="'商家入驻审核'" :visible.sync="addVisible" top="5vh" width="70%"
  82. center :show-close="false"
  83. :close-on-click-modal="false"
  84. >
  85. <AddSettlement v-loading="loading" :business-data="form" @cancel="cleanForm" @search="search" />
  86. </el-dialog>
  87. </div>
  88. </template>
  89. <script>
  90. import AddSettlement from '@/views/business/settlement/addSettlement'
  91. import {
  92. settlementGetAll,
  93. settlementDelete
  94. } from '@/api/business'
  95. import {
  96. settlementGetById
  97. } from '@/api/business'
  98. export default {
  99. components: {
  100. AddSettlement
  101. },
  102. data() {
  103. // 这里存放数据
  104. return {
  105. activeName: '0',
  106. formInline: {
  107. shopName: '', // 商家名称
  108. shopPhone: '', // 注册手机号
  109. authenType: '', // 店铺类型 1-个人 2-个体工商户 3-企业 4-其他组织
  110. dates: [], // 时间数组
  111. checkState: '0', // 入驻处理状态 0-未处理 1-通过 2-拒绝
  112. page: 1,
  113. pageSize: 10,
  114. shopType: 1
  115. },
  116. total: 10,
  117. tableData: [],
  118. addVisible: false,
  119. loading: false,
  120. form: {}
  121. }
  122. },
  123. mounted() {
  124. this.getAll(this.formInline)
  125. },
  126. // 方法集合
  127. methods: {
  128. handleSizeChange(val) {
  129. this.formInline.pageSize = val
  130. this.getAll(this.formInline)
  131. },
  132. handleCurrentChange(val) {
  133. this.formInline.page = val
  134. this.getAll(this.formInline)
  135. },
  136. handleClick(tab, event) {
  137. this.formInline.checkState = tab.index
  138. this.getAll(this.formInline)
  139. },
  140. // 查询
  141. search() {
  142. this.total = 1
  143. this.formInline.page = 1
  144. this.getAll(this.formInline)
  145. },
  146. // 处理
  147. handleDel(row) {
  148. this.addVisible = true
  149. this.getFormData(row.shopId)
  150. },
  151. getFormData(shopId) {
  152. this.loading = true
  153. // 查询店铺详情
  154. settlementGetById({ shopId })
  155. .then((res) => {
  156. this.loading = false
  157. this.form = res.data
  158. })
  159. .catch((err) => {
  160. this.loading = false
  161. console.log(err)
  162. })
  163. },
  164. cleanForm() {
  165. this.addVisible = false
  166. },
  167. // 删除
  168. async delet(row) {
  169. const res = await settlementDelete({ checkId: row.checkId })
  170. if (res.code === '') {
  171. this.$message({
  172. message: '删除成功',
  173. type: 'success'
  174. })
  175. this.getAll(this.formInline)
  176. }
  177. },
  178. // 初始化查询所有数据
  179. async getAll(formInline) {
  180. const res = await settlementGetAll(formInline)
  181. this.tableData = res.data.list
  182. this.total = res.data.total
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang='scss' scoped>
  188. //@import url(); 引入公共css类
  189. @import url("../../../styles/elDialog.scss");
  190. .pdl {
  191. padding-left: 20px;
  192. }
  193. </style>