From 37ec774348d687dd8602ae1e9900271dab7d0c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=90=8C=E5=AD=A6?= <2495967527@qq.com> Date: Tue, 15 Oct 2024 18:02:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B6=E8=A1=8C=E5=8D=A1=E7=A7=81=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/common.js | 2 +- .../modules/bank-card/popup/add-or-update.vue | 354 ++++++++++++++---- src/views/modules/product/index.vue | 2 + .../modules/product/popup/add-or-update.vue | 2 + 4 files changed, 291 insertions(+), 69 deletions(-) diff --git a/src/api/modules/common.js b/src/api/modules/common.js index 930cbe0..0d5c907 100644 --- a/src/api/modules/common.js +++ b/src/api/modules/common.js @@ -15,7 +15,7 @@ export const password = (password, newPassword) => { // 退出登录 export const logout = () => { return $http({ - url: '/auth/logout', + url: '/merchant-api/auth/logout', method: 'post', data: $http.adornData() }) diff --git a/src/views/modules/bank-card/popup/add-or-update.vue b/src/views/modules/bank-card/popup/add-or-update.vue index 17f1a18..0fa56a6 100644 --- a/src/views/modules/bank-card/popup/add-or-update.vue +++ b/src/views/modules/bank-card/popup/add-or-update.vue @@ -9,7 +9,47 @@ > @@ -486,7 +635,7 @@ export default { bankLicense: "", handIdCardFront: "", handIdCardBack: "", - bankAcctType: "", + bankAcctType: 1, licenseNumber: "", }; this.$refs.modal.resetFields(); @@ -500,8 +649,7 @@ export default { }, init(row) {}, handleChange(e) { - console.log(e); - // this.modalData.prov = e.join("-"); + this.modalData.prov = e.join("-"); }, handleAvatarSuccess(res) { console.log(res); @@ -527,42 +675,112 @@ export default { console.log(res); this.modalData.handIdCardBack = res.data; }, + handleChange(e) { + if (e == 1) { + this.modalData = { + linkId: JSON.parse(sessionStorage.getItem("userInfo")).managerId + ? JSON.parse(sessionStorage.getItem("userInfo")).managerId + : JSON.parse(sessionStorage.getItem("userInfo")).merchantId, + bankType: "", + name: "", + prov: "", + area: "", + socialCreditCode: "", + socialCreditCodeExpires: "", + businessScope: "", + legalPerson: "", + legalCertId: "", + legalCertIdExpires: "", + legalMp: "", + address: "", + bankCode: "", + cardNo: "", + cardName: "", + licensePicture: "", + idCardFront: "", + idCardBack: "", + bankLicense: "", + handIdCardFront: "", + handIdCardBack: "", + bankAcctType: 1, + licenseNumber: "", + }; + console.log(e); + } else { + this.modalData = { + linkId: JSON.parse(sessionStorage.getItem("userInfo")).managerId + ? JSON.parse(sessionStorage.getItem("userInfo")).managerId + : JSON.parse(sessionStorage.getItem("userInfo")).merchantId, + bankType: "", + cardId: "", + cardName: "", + certId: "", + telNo: "", + idCardFront: "", + idCardBack: "", + bankAcctType: 2, + }; + } + }, }, computed: { modalHandles() { - return [ - { - label: "取消", - handle: () => { - this.toggle(); + if (this.modalData.bankAcctType == 1) { + return [ + { + label: "取消", + handle: () => { + this.toggle(); + }, }, - }, - { - label: "上一步", - type: "primary", - disabled: () => this.process == 1, - handle: () => { - console.log(this.modalData); - this.process = 1; + { + label: "上一步", + type: "primary", + disabled: () => this.process == 1, + handle: () => { + console.log(this.modalData); + this.process = 1; + }, }, - }, - { - label: this.process == 1 ? "下一步" : "确认添加", - type: "primary", - handle: () => { - if (this.process == 1) { - this.process = 2; - } else { + { + label: this.process == 1 ? "下一步" : "确认添加", + type: "primary", + handle: () => { + if (this.process == 1) { + this.process = 2; + } else { + console.log(this.modalData); + this.$api.mer_admin.bankCardAdd(this.modalData).then((res) => { + console.log(res); + this.$emit("queryList"); + this.toggle(); + }); + } + }, + }, + ]; + } else { + return [ + { + label: "取消", + handle: () => { + this.toggle(); + }, + }, + { + label: "确认添加", + type: "primary", + handle: () => { console.log(this.modalData); this.$api.mer_admin.bankCardAdd(this.modalData).then((res) => { console.log(res); this.$emit("queryList"); this.toggle(); }); - } + }, }, - }, - ]; + ]; + } }, }, asyncComputed: {}, diff --git a/src/views/modules/product/index.vue b/src/views/modules/product/index.vue index 928ce5d..bf23e1a 100644 --- a/src/views/modules/product/index.vue +++ b/src/views/modules/product/index.vue @@ -288,6 +288,8 @@ export default { width: "340px", render: ({ row }) => { let edit = () => { + console.log(row); + this.$refs.addOrUpdate.toggle(row).update(); }; let priceAdjustment = () => { diff --git a/src/views/modules/product/popup/add-or-update.vue b/src/views/modules/product/popup/add-or-update.vue index fc0c9f1..0fdf68a 100644 --- a/src/views/modules/product/popup/add-or-update.vue +++ b/src/views/modules/product/popup/add-or-update.vue @@ -208,6 +208,8 @@ export default { }); this.isAdd = true; + console.log('112233'); + }, update: () => { this.modalConfig.title = "编辑商品";