LAPTOP-FO2T5SIU\35838 5 kuukautta sitten
vanhempi
commit
af33693530

+ 31 - 5
src/views/customerManagement/intentionalDeposit/addIntentionalDeposit.vue

@@ -216,18 +216,40 @@ export default {
         this.username = username
     },
     methods: {
-        initData(data) {
+        initData(data, fromAddress) {
             this.getBankOptions()
             this.customerManagementId = data.id
             this.intentionalDepositId = data.intentionalDepositId
             this.initDict(this.dc_key).then(res => {
-                this.getByCustomerManagementId(data)
-                this.getCustomerById(this.customerManagementId)
+                // this.getByCustomerManagementId(data)
+                this.getCustomerById(this.customerManagementId, fromAddress)
             })
         },
         handleChange(value) {
 
         },
+        getById(val) {
+            const data = {
+                id: val
+            }
+            this.baseRequest('getById', data).then(res => {
+                if (res.data) {
+                    this.form = res.data
+                    this.serialNumber = this.form.serialNumber
+                    this.form.paymentMethod = this.form.paymentMethod + ''
+                    if (this.form.fileList) {
+                        this.fileList = JSON.parse(this.form.fileList)
+                    }
+                    this.dateStr = this.form.createdAt
+                    this.username = this.form.createdName
+                    this.form.bankName = res.data.bankName == null ? '' : res.data.bankName
+                    this.form.bankBranchName = res.data.bankBranchName == null ? '' : res.data.bankBranchName
+                    this.form.bankNumber = res.data.bankNumber == null ? '' : res.data.bankNumber
+                    this.bankObject = this.form.bankName + this.form.bankBranchName + this.form.bankNumber
+                }
+            })
+        },
+
         getByCustomerManagementId(val) {
             const data = {
                 customerManagementId: val.id
@@ -270,7 +292,7 @@ export default {
                 if (valid) {
                     let soaUrl = 'add'
                     // 已收取状态
-                    if (_this.intentionalDepositId) {
+                    if (_this.intentionalDepositId || _this.customerForm.intentionalDepositId) {
                         soaUrl = 'edit'
                         _this.form.id = _this.intentionalDepositId
                     }
@@ -363,10 +385,14 @@ export default {
                 }
             })
         },
-        getCustomerById(val) {
+        getCustomerById(val, fromAddress) {
             this.customerForm = {}
             this.baseCustomerRequest('getById', { id: val }).then(res => {
                 this.customerForm = res.data
+                if (fromAddress === 'customer') {
+                    this.intentionalDepositId = res.data.intentionalDepositId
+                }
+                this.getById(this.intentionalDepositId)
             }).catch((err) => {
             })
         },

+ 1 - 1
src/views/customerManagement/numberManagement/index.vue

@@ -499,7 +499,7 @@ export default {
             this.dialogIntentionalVisible = true
             // 新vue时调用的方法
             this.$nextTick(() => {
-                this.$refs.addIntentionalDeposit.initData(val)
+                this.$refs.addIntentionalDeposit.initData(val, 'customer')
             })
         },
         handleView(val) {

+ 1 - 1
src/views/receiveRefundsManagement/intentionalDepositManagement/index.vue

@@ -226,7 +226,7 @@ export default {
             }
             // 新vue时调用的方法
             this.$nextTick(() => {
-                this.$refs.addIntentionalDeposit.initData(postData)
+                this.$refs.addIntentionalDeposit.initData(postData, 'intentionalDeposit')
             })
         },
         handleView(val) {