dadaVerify.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
  4. <el-form-item label="门店名称" prop="name">
  5. <el-input
  6. v-model="queryParams.name"
  7. placeholder="请输入门店名称"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item label="门店手机号" prop="mobile">
  13. <el-input
  14. v-model="queryParams.mobile"
  15. placeholder="请输入门店手机号"
  16. clearable
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="所属配送商" prop="dadaDspId" v-if="userType == 1 || userType == 3">
  21. <el-select v-model="queryParams.dadaDspId" placeholder="请选择" filterable clearable >
  22. <el-option v-for="item in listDadaDsp" :key="item.id" :value="item.id" :label="item.name"/>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item label="状态" prop="status">
  26. <el-select v-model="queryParams.status" placeholder="请选择" filterable clearable >
  27. <el-option v-for="item in statusOption" :key="item.id" :value="item.id" :label="item.name"/>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item>
  31. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  32. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  33. </el-form-item>
  34. </el-form>
  35. <el-table v-loading="loading" :data="shopVerifyList" @selection-change="handleSelectionChange" stripe border highlight-current-row style="width: 100%">
  36. <el-table-column label="门店名称" align="center" prop="name" />
  37. <el-table-column label="商家编号" align="center" prop="thirdShopId" />
  38. <el-table-column label="门店编号" align="center" prop="dadaShopNo" />
  39. <el-table-column label="所属配送商" align="center" prop="dadaDspName" />
  40. <el-table-column label="状态" align="center" prop="status">
  41. <template slot-scope="scope">
  42. <el-tag type="warning" v-if="scope.row.status == 0">未绑定</el-tag>
  43. <el-tag type="success" v-if="scope.row.status == 1">绑定</el-tag>
  44. <el-tag v-if="scope.row.status == 2">审核中</el-tag>
  45. <el-tag type="danger" v-if="scope.row.status == 3">审核失败</el-tag>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="余额" align="center" prop="balance"/>
  49. <el-table-column label="创建时间" align="center" prop="createTime" />
  50. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  51. <template slot-scope="scope">
  52. <el-button
  53. v-if="(userType == 4 || userType == 5 || userType == 1 || userType == 3) && scope.row.status != 1"
  54. size="mini"
  55. type="text"
  56. icon="el-icon-edit"
  57. @click="handleUpdate(scope.row)"
  58. >编辑资料</el-button>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <pagination
  63. v-show="total>0"
  64. :total="total"
  65. :page.sync="queryParams.pageNum"
  66. :limit.sync="queryParams.pageSize"
  67. @pagination="getList"
  68. />
  69. <!-- 添加或修改商家门店对话框 -->
  70. <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
  71. <el-form ref="form" :model="form" :rules="rules" label-width="130px">
  72. <el-form-item label="商户编号" prop="thirdShopId">
  73. <el-input style="width:500px" v-model="form.thirdShopId" placeholder="请输入商户编号" :disabled="this.oldThirdShopId != undefined && form.status != 3" />
  74. </el-form-item>
  75. <el-form-item label="门店编号" prop="dadaShopNo">
  76. <el-input style="width:500px" v-model="form.dadaShopNo" placeholder="请输入门店编号" />
  77. </el-form-item>
  78. <el-form-item label="联系电话" prop="account">
  79. <el-input style="width:500px" v-model="form.account" placeholder="请输入联系电话" />
  80. </el-form-item>
  81. </el-form>
  82. <div slot="footer" class="dialog-footer">
  83. <el-button type="primary" @click="submitForm">确 定</el-button>
  84. <el-button @click="cancel">取 消</el-button>
  85. </div>
  86. </el-dialog>
  87. </div>
  88. </template>
  89. <script>
  90. import { listShopVerify, updateDadaVerify } from "@/api/module/merchant"
  91. import { getDadaDspList } from "@/api/module/dadaDsp";
  92. import user from '@/store/modules/user'
  93. export default {
  94. name: "dadaVerify",
  95. components: {
  96. },
  97. data() {
  98. return {
  99. statusOption: [
  100. {
  101. id: 1,
  102. name: "绑定"
  103. },{
  104. id: 0,
  105. name: "未绑定"
  106. },{
  107. id: 2,
  108. name: "审核中"
  109. },{
  110. id: 3,
  111. name: "拒绝"
  112. },{
  113. id: 4,
  114. name: "待完善资料"
  115. }
  116. ],
  117. user: {},
  118. // 配送商
  119. listDadaDsp: [],
  120. // 遮罩层
  121. loading: true,
  122. oldThirdShopId: undefined,
  123. // 非单个禁用
  124. single: true,
  125. // 非多个禁用
  126. multiple: true,
  127. // 显示搜索条件
  128. showSearch: true,
  129. // 总条数
  130. total: 0,
  131. // 商家门店表格数据
  132. shopVerifyList: [],
  133. // 弹出层标题
  134. title: "",
  135. // 是否显示弹出层
  136. open: false,
  137. // 登录用户类型
  138. userType: undefined,
  139. // 查询参数
  140. queryParams: {
  141. pageNum: 1,
  142. pageSize: 10,
  143. name: undefined,
  144. mobile: undefined,
  145. dadaDspId: undefined,
  146. status: undefined
  147. },
  148. // 表单参数
  149. form: {},
  150. // 表单校验
  151. rules: {
  152. thirdShopId: [
  153. { required: true, message: "商家编号不能为空", trigger: "blur" }
  154. ],
  155. dadaShopNo: [
  156. { required: true, message: "门店编号不能为空", trigger: "blur" }
  157. ],
  158. account: [
  159. { required: true, message: "注册手机号不能为空", trigger: "blur" }
  160. ],
  161. }
  162. };
  163. },
  164. created() {
  165. this.user = user.actions.getSysUser()
  166. this.userType = localStorage.getItem("SYS_USER_TYPE")
  167. this.getList();
  168. getDadaDspList().then(response => {
  169. this.listDadaDsp = response.data
  170. });
  171. },
  172. methods: {
  173. /** 查询商家门店列表 */
  174. getList() {
  175. this.loading = true;
  176. listShopVerify(this.queryParams).then(response => {
  177. this.shopVerifyList = response.data.data;
  178. this.total = response.data.totalNums;
  179. this.loading = false;
  180. });
  181. },
  182. // 取消按钮
  183. cancel() {
  184. this.open = false;
  185. this.reset();
  186. },
  187. // 表单重置
  188. reset() {
  189. this.form = {
  190. thirdShopId: undefined,
  191. dadaShopNo: undefined,
  192. mobile: undefined,
  193. account: undefined,
  194. status: undefined
  195. };
  196. this.resetForm("form");
  197. },
  198. /** 搜索按钮操作 */
  199. handleQuery() {
  200. this.getList();
  201. },
  202. /** 重置按钮操作 */
  203. resetQuery() {
  204. this.resetForm("queryForm");
  205. this.handleQuery();
  206. },
  207. // 多选框选中数据
  208. handleSelectionChange(selection) {
  209. this.ids = selection.map(item => item.id)
  210. this.single = selection.length!==1
  211. this.multiple = !selection.length
  212. },
  213. /** 新增按钮操作 */
  214. handleAdd() {
  215. this.reset();
  216. this.open = true;
  217. this.title = "添加商家门店";
  218. },
  219. /** 修改按钮操作 */
  220. handleUpdate(row) {
  221. console.log('达达信息', row)
  222. this.reset();
  223. this.form.id = row.id
  224. this.oldThirdShopId = row.thirdShopId
  225. this.form.thirdShopId = row.thirdShopId
  226. this.form.account = row.account
  227. this.form.status = row.status
  228. this.open = true;
  229. this.title = "修改达达门店资料";
  230. },
  231. /** 提交按钮 */
  232. submitForm() {
  233. this.$refs["form"].validate(valid => {
  234. if (valid) {
  235. if (this.form.id != null) {
  236. updateDadaVerify(this.form).then(response => {
  237. this.msgSuccess("修改成功");
  238. this.open = false;
  239. this.getList();
  240. });
  241. }
  242. }
  243. });
  244. },
  245. }
  246. };
  247. </script>