From 13f18d8194ada4aa0e7895b92895f61e52471ed6 Mon Sep 17 00:00:00 2001 From: "wangxubin@yeah.net" Date: Fri, 9 Sep 2022 16:21:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 2 +- src/pages/eashier/service/service.vue | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/config/index.js b/config/index.js index eb173e0..411c9e3 100644 --- a/config/index.js +++ b/config/index.js @@ -46,7 +46,7 @@ module.exports = { } }, // Various Dev Server settingsss - host: "192.168.31.193", // can be overwritten by process.env.HOST + host: "192.168.31.194", // can be overwritten by process.env.HOST port: 3000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, diff --git a/src/pages/eashier/service/service.vue b/src/pages/eashier/service/service.vue index a1b4192..807f4f6 100644 --- a/src/pages/eashier/service/service.vue +++ b/src/pages/eashier/service/service.vue @@ -389,6 +389,7 @@ export default { rowRecList: [], copyPayList: [], routeNumber: null, + copyAccountList:[] }; }, methods: { @@ -664,10 +665,22 @@ export default { this.sumAmont(); }, openRec(row) { - this.recForm = JSON.parse(JSON.stringify(row)); - this.rowRecList = JSON.parse(JSON.stringify(row.rechargeAccountList)); - this.editProIndex = row.index; - //conslole.log( this.editProIndex) +   /* +       第二次进来row.rechargeAccountList会被不知名清空 +       第一次进来的时候给copyAccountList赋值,因为具有缓存效果不会被清空,当row.rechargeAccountList为空数组的时候,将copyAccountList赋值给rowRecList +      */ +      if(!this.copyAccountList.length){ +        this.copyAccountList = row.rechargeAccountList +      } +      this.recForm = JSON.parse(JSON.stringify(row)); +      if(!row.rechargeAccountList.length){ +        // 数据为空,重新赋值浅拷贝一份 +        this.rowRecList = [...this.copyAccountList] +      }else{ +        // 数组存在直接赋值 +        this.rowRecList = JSON.parse(JSON.stringify(row.rechargeAccountList)); +      } +      this.editProIndex = row.index; }, recashData(v) { this.list = v.list;