From 0fbefe5800d7ea310c46a5b11f13718f28b1e9d5 Mon Sep 17 00:00:00 2001 From: "wangxubin@yeah.net" Date: Fri, 9 Sep 2022 11:19:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=94=B6=E9=93=B6bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/staffList/staff/index.vue | 2 + src/layout/components/asider.vue | 8 +- src/pages/eashier/service/service.vue | 127 ++++++++++--------- src/pages/eashier/within/components/edit.vue | 6 +- src/pages/eashier/within/within.vue | 1 + 5 files changed, 78 insertions(+), 66 deletions(-) diff --git a/src/components/staffList/staff/index.vue b/src/components/staffList/staff/index.vue index ccca912..08cd11b 100644 --- a/src/components/staffList/staff/index.vue +++ b/src/components/staffList/staff/index.vue @@ -217,7 +217,9 @@ export default { }; list.push(items); }); + this.$emit("staffslesData", list); + console.log("🚀 ~ file: index.vue ~ line 222 ~ confirm ~ list", list) }, //改变员工 去除未选择员工列表中的员工 changeStaff() { diff --git a/src/layout/components/asider.vue b/src/layout/components/asider.vue index 63cf137..8edaa74 100644 --- a/src/layout/components/asider.vue +++ b/src/layout/components/asider.vue @@ -935,28 +935,28 @@ export default { name: "优惠券", index: "100", icon: "el-icon-s-ticket", - number: "1000", + number: "800", menuLists: [ { name: "建立", icon: "el-icon-s-promotion", route: "/couponIssue", index: "couponIssue", - number: "1000100", + number: "800100", }, { name: "管理", icon: "el-icon-s-operation", route: "/couponMane", index: "couponMane", - number: "1000200", + number: "800200", }, { name: "领取消费", icon: "el-icon-time", route: "/couponRecord", index: "couponRecord", - number: "1000300", + number: "800300", }, ], }, diff --git a/src/pages/eashier/service/service.vue b/src/pages/eashier/service/service.vue index 5aa3ff6..df2bcdb 100644 --- a/src/pages/eashier/service/service.vue +++ b/src/pages/eashier/service/service.vue @@ -381,7 +381,7 @@ export default { editProIndex: -1, isAddition: 0, additionDate: null, - transactionPrice: null, + transactionPrice: 0, options: [], //员工下拉选择列表 adminOptions: [], //管理员下拉选择列表 managerOptions: [], //高管下拉选择列表 @@ -394,7 +394,7 @@ export default { }, methods: { selectindex(row) { - console.log(row) + //conslole.log(row) }, changeMember() { if (this.cashNumber == 1) { @@ -410,25 +410,26 @@ export default { }, clear(row, text) { - //console.log(text); + ////conslole.log(text); let form = { ...row }; form[text] = []; - //console.log(form); + ////conslole.log(form); this.list.splice(row.index, 1, form); }, //修改卡付金额 editcard(row, index) { this.recIndex = index; - console.log(index) + //conslole.log(index) }, endEditcard(row, index) { - console.log(index) + //conslole.log(index) let debtMoney = (this.recForm.amount * 1 - this.recForm.cashAmount * 1).toFixed(2) * 1; - console.log(this.recForm) + //conslole.log(this.recForm) let form = { ...row }; - console.log(form) - //console.log(debtMoney);//套餐价格 + + //conslole.log(form) + ////conslole.log(debtMoney);//套餐价格 if (debtMoney > 0) { if (form.type == 2 || form.type == 0) { if (this.useRecharge == 2) { @@ -473,12 +474,12 @@ export default { form.discoutMoney =//充值卡支付的钱 ((form.spendMoney * 1) / (form.discount / 100)).toFixed(2) * 1; form.giftSpendMoney = ((form.spendMoney * 1) / recRatio * recGiftRatio).toFixed(2) * 1; - console.log("这个是赠送金额" + form.giftSpendMoney) + //conslole.log("这个是赠送金额" + form.giftSpendMoney) form.discoutGiftMoney =//赠送卡支付的钱 (form.giftSpendMoney / (form.discountFreeAmount / 100)).toFixed(2) * 1; - //console.log(form.discoutGiftMoney) + ////conslole.log(form.discoutGiftMoney) } else { - //console.log(debtMoney); + ////conslole.log(debtMoney); form.spendMoney = (debtMoney * recRatio).toFixed(2) * 1; form.discoutMoney = (debtMoney * recRatio).toFixed(2) * 1; form.giftSpendMoney = (debtMoney * recGiftRatio).toFixed(2) * 1; @@ -491,7 +492,7 @@ export default { form.discoutMoney = ((form.spendMoney * 1) * (form.discount / 100)).toFixed(2) * 1; form.giftSpendMoney = ((form.spendMoney * 1) / recRatio * recGiftRatio).toFixed(2) * 1; - console.log("这个是赠送金额" + form.giftSpendMoney) + //conslole.log("这个是赠送金额" + form.giftSpendMoney) form.discoutGiftMoney =//赠送卡支付的钱 (form.giftSpendMoney * (form.discount / 100)).toFixed(2) * 1; } @@ -536,16 +537,16 @@ export default { } this.rowRecList.splice(index, 1, form); - this.list[this.editProIndex].collectionCashAmounts = this.list[this.editProIndex].amount - (form.discoutMoney + form.discoutGiftMoney) - //console.log(this.list) - //console.log('这是index'+index) + this.list[this.editProIndex].collectionCashAmounts = (this.list[this.editProIndex].amount - (form.discoutMoney + form.discoutGiftMoney)).toFixed(2) * 1; + ////conslole.log(this.list) + ////conslole.log('这是index'+index) let num = 0; this.list.forEach((item) => { - // //console.log("这个是"+item.collectionCashAmounts) num = num + item.collectionCashAmounts }); - //console.log(num) + ////conslole.log(num) this.form.collectionCashAmounts = num; + this.form.cashAmount = (num*1+(form.spendMoney*1)).toFixed(2) * 1; this.sumNum(); // this.rowRecList.splice(index, 1, form); @@ -585,18 +586,18 @@ export default { sumNum() { let spendMoney = 0; let spendNumber = 0; - //console.log(this.rowRecList) + ////conslole.log(this.rowRecList) this.rowRecList.forEach((item) => { spendMoney += (item.discoutMoney + item.discoutGiftMoney) * 1; spendNumber += (item.spendMoney * 1 + item.giftSpendMoney) * 1; - //console.log(item.discoutMoney); - //console.log(item.discoutGiftMoney); + ////conslole.log(item.discoutMoney); + ////conslole.log(item.discoutGiftMoney); }); - //console.log(spendMoney); + ////conslole.log(spendMoney); this.recForm.collectionRechargeAmount = spendNumber.toFixed(2) * 1; this.recForm.collRecAmonnt = spendMoney.toFixed(2) * 1; - //console.log(this.recForm.collectionRechargeAmount) + ////conslole.log(this.recForm.collectionRechargeAmount) this.recForm.cashAmount = ( this.recForm.collectionCashAmount + @@ -617,7 +618,7 @@ export default { ( spendMoney ).toFixed(2) * 1; - //console.log(this.recForm.collectionAmount) + ////conslole.log(this.recForm.collectionAmount) this.recForm.rechargeAmount = spendNumber; this.list.splice(this.recForm.index, 1, this.recForm); let rList = []; @@ -627,7 +628,7 @@ export default { JSON.stringify(item.rechargeAccountList) ); rechargeAccountList.forEach((item) => { - //console.log(item); + ////conslole.log(item); item.cardOver = item.cardOvers; item.giftConsumeMoney = item.cardGiftOvers; item.giftSpendMoney = 0; @@ -641,13 +642,13 @@ export default { this.list.forEach((item) => { if (item.index != this.editProIndex) { - //console.log(this.setRecList(item)); + ////conslole.log(this.setRecList(item)); let recArr = this.setRecList(item); item.rechargeAccountList.forEach((item, index) => { if (item.spendMoney > 0) { this.sumAmont(); } else { - //console.log(item); + ////conslole.log(item); item.cardOver = recArr[index].cardOvers; item.cardOvers = recArr[index].cardOvers; item.giftConsumeMoney = recArr[index].cardGiftOvers; @@ -656,15 +657,15 @@ export default { }); } }); - //console.log(rList); - //console.log(this.list); + ////conslole.log(rList); + ////conslole.log(this.list); this.sumAmont(); }, openRec(row) { this.recForm = JSON.parse(JSON.stringify(row)); this.rowRecList = JSON.parse(JSON.stringify(row.rechargeAccountList)); this.editProIndex = row.index; - console.log( this.editProIndex) + //conslole.log( this.editProIndex) }, recashData(v) { this.list = v.list; @@ -672,7 +673,7 @@ export default { let recList = v.form.rechargeAccountList; this.list.forEach((item, index) => { if (Vindex < index) { - //console.log("大于当前, 卡包变"); + ////conslole.log("大于当前, 卡包变"); recList.forEach((rec, recIndex) => { if (rec.spendMoney > 0) { item.rechargeAccountList[recIndex].cardOver = rec.cardOvers; @@ -730,7 +731,7 @@ export default { endEditMoney(row) { let form = { ...row }; - //console.log(row); + ////conslole.log(row); if (this.cashNumber == 1) { if ( form.topPriceMember < form.transactionPrice * 1 || @@ -765,7 +766,7 @@ export default { this.sumAmont(); }, handleChange(data, row, text) { - //console.log("行号", row.index); + ////conslole.log("行号", row.index); let form = { ...row }; if (text == "managerList") { this.managerOptions.forEach((item, index) => { @@ -788,7 +789,7 @@ export default { } else { this.options.forEach((item, index) => { if (item.id == data) { - //console.log("返回数据:", item); + ////conslole.log("返回数据:", item); item.ratio = 100; form[text] = []; form[text].push(item); @@ -837,7 +838,7 @@ export default { }, passcodeData(v) { if (v != null) { - console.log(v) + //conslole.log(v) this.formData.append("file", v); } this.addCashConfirm(); @@ -854,7 +855,7 @@ export default { this.$refs.project.show(this.memberForm); }, projectData(v) { - //console.log(v); + ////conslole.log(v); if (!v.courseAccountId) { v.courseAccountId = null; v.courseProjectId = v.id; @@ -927,7 +928,7 @@ export default { numberTimes: 1, minumumTimes: res.data.minumumTimes, }; - //console.log(form); + ////conslole.log(form); this.setRecList(form); if (this.cashNumber == 1) { if (row.courseAccountId == null) { @@ -958,10 +959,10 @@ export default { } else { form.cashAmount = form.amount; form.collectionAmount = form.cashAmount; - //console.log("1") + ////conslole.log("1") } if (this.list.length > 0) { - //console.log(this.list.length); + ////conslole.log(this.list.length); if (!this.list[0].projectName) { this.proIndex = 0; } @@ -1023,7 +1024,7 @@ export default { 2 ) * 1; } - //console.log(item); + ////conslole.log(item); } else { item.offsetMoney = item.giftConsumeMoney + item.cardConsumeMoney; item.offsetGiftMoney = 0; @@ -1176,19 +1177,19 @@ export default { item.rechargeAccountList = rechargeAccountList; if (item.courseAccountId != null) { item.collectionAmount = item.amount; - //console.log("2") + ////conslole.log("2") } if (item.projectId) { list.push(item); } }); - console.log(list) + //conslole.log(list) list.forEach((item) => { item.collectionAmount = item.collectionAmounts }) - console.log(list) + //conslole.log(list) this.formData.append("cashListRequestList", JSON.stringify(list)); addCash(this.formData).then((res) => { if (res.code == "000000") { @@ -1215,14 +1216,14 @@ export default { }, openStaffRatio(row, index, text) { this.editIndex = index; - console.log(row) + //conslole.log(row) this.$refs.staffratio.show(row, text); this.$refs.staffratio.showdetele(); localStorage.setItem("row",JSON.stringify(row)) localStorage.setItem("text",text) }, staffratioData(v) { - console.log(v) + //conslole.log(v) let form = this.list[this.editIndex]; let texts = v.text + "s"; form[v.text] = v.list; @@ -1240,14 +1241,16 @@ export default { adminList: [], payLists: this.payLists, rechargeAccountList: [], //卡付列表 + collectionCashAmounts:0, }; this.list.push(list); + //conslole.log("🚀 ~ file: service.vue ~ line 1246 ~ addPro ~ list", this.list) }, delPro(row) { // this.czRecList(row); this.list.splice(row.index, 1); - //console.log(row) + ////conslole.log(row) this.form.cashAmount = this.form.cashAmount - row.amount + row.cashAmount this.form.collectionCashAmounts = this.form.cashAmount - row.amount + row.cashAmount this.form.collectionCashAmount = this.form.collectionCashAmounts @@ -1266,9 +1269,9 @@ export default { // this.recListCopy.forEach((item) => { // list.forEach((items) => { // if (item.id == items.id) { - // //console.log(item); - // //console.log(item.giftConsumeMoney); - // //console.log(item.giftSpendMoney); + // ////conslole.log(item); + // ////conslole.log(item.giftConsumeMoney); + // ////conslole.log(item.giftSpendMoney); // item.cardOver = (item.cardOver + items.spendMoney).toFixed(2) * 1; // item.cardOvers = (item.cardOvers + items.spendMoney).toFixed(2) * 1; // item.cardGiftOvers = @@ -1286,7 +1289,7 @@ export default { }, //选中会员返回方法 memberData(v) { - //console.log(v); + ////conslole.log(v); this.memberForm.mobilePhone = v.mobilePhone; this.inputMember(); }, @@ -1295,7 +1298,7 @@ export default { this.setProOne(v); }, paymentData(v) { - //console.log(v); + ////conslole.log(v); this.form = v.form; this.payLists = v.list; this.sumAmont(); @@ -1318,7 +1321,7 @@ export default { }, //点击选中 rowClick(row) { - //console.log(row); + ////conslole.log(row); this.$refs.list.toggleRowExpansion(row); }, close() { @@ -1472,7 +1475,7 @@ export default { } else { itemLists.cashAmount = itemLists.amount; itemLists.collectionAmount = itemLists.amount; - //console.log(3) + ////conslole.log(3) itemLists.courseMoney = itemLists.transactionPrice; } list.push(itemLists); @@ -1745,14 +1748,14 @@ export default { item.collectionIntegralAmount + item.collectionCashAmount ).toFixed(2) * 1; - //console.log(4) + ////conslole.log(4) } else { item.collectionAmount = ( item.collectionIntegralAmount + item.collectionCashAmount ).toFixed(2) * 1; } - //console.log(5) + ////conslole.log(5) }); } let collectionRechargeAmountg = 0; @@ -1775,8 +1778,10 @@ export default { this.form.cashAmount = (money.toFixed(2) * 1) + (collectionRechargeAmountg.toFixed(2) * 1) this.form.collectionCashAmounts = (money.toFixed(2) * 1) - console.log(this.form.collectionCashAmounts) - console.log(this.form.cashAmount) + // console.log("🚀 ~ file: service.vue ~ line 1780 ~ sumAmont ~ this.form.collectionCashAmounts", this.form.collectionCashAmounts) + // //conslole.log(this.form.collectionCashAmounts) + // //conslole.log(this.form.cashAmount) + // console.log("🚀 ~ file: service.vue ~ line 1782 ~ sumAmont ~ this.form.cashAmount", this.form.cashAmount) this.list.forEach((item) => { if ( this.form.cashAmount == this.form.collectionCashAmount && @@ -1796,15 +1801,15 @@ export default { item.collectionIntegralAmount + item.collectionCashAmount ).toFixed(2) * 1; - //console.log(6) - //console.log( item.collectionAmount) + ////conslole.log(6) + ////conslole.log( item.collectionAmount) } else { item.collectionAmount = (item.collectionIntegralAmount + item.collectionCashAmount).toFixed( 2 ) * 1; - //console.log(7) + ////conslole.log(7) } }); this.form.debtMoney = @@ -1812,7 +1817,7 @@ export default { var that = this; setTimeout(() => { that.$nextTick(() => { - console.log(that.form) + //conslole.log(that.form) that.$refs.payment.show(that.form, that.payLists); }); }, 500); diff --git a/src/pages/eashier/within/components/edit.vue b/src/pages/eashier/within/components/edit.vue index f7d4405..23cd6c7 100644 --- a/src/pages/eashier/within/components/edit.vue +++ b/src/pages/eashier/within/components/edit.vue @@ -292,7 +292,7 @@ export default { addRechargeCardTransition(this.form) .then((res) => { if (res.code == "000000") { - this.$emit("editData"); + this.$emit("editData",this.form.staffList); this.dialogFormVisible = false; this.$message.success({ message: "数据添加成功!", @@ -311,7 +311,11 @@ export default { //console.log(err); }); } else { + + this.form.staffLists = this.staffList; + console.log("🚀 ~ file: edit.vue ~ line 316 ~ updateRechargeCardTransition ~ this.form", this.form) updateRechargeCardTransition(this.form).then((res) => { + if (res.code == "000000") { this.$emit("editData"); this.dialogFormVisible = false; diff --git a/src/pages/eashier/within/within.vue b/src/pages/eashier/within/within.vue index cd4841b..6f8616d 100644 --- a/src/pages/eashier/within/within.vue +++ b/src/pages/eashier/within/within.vue @@ -144,6 +144,7 @@ export default { }, //修改返回方法 editData(v) { + this.radioRowValueList=v this.getData(); }, //明细返回方法 From 86e2d02cfdbc478c000bb7fe937d540384224bfa Mon Sep 17 00:00:00 2001 From: "wangxubin@yeah.net" Date: Fri, 9 Sep 2022 15:55:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=94=B6=E9=93=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/asider.vue | 1 + src/pages/eashier/service/service.vue | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/layout/components/asider.vue b/src/layout/components/asider.vue index 0beef5b..1a14b36 100644 --- a/src/layout/components/asider.vue +++ b/src/layout/components/asider.vue @@ -107,6 +107,7 @@ export default { icon: "el-icon-files", route: "/baseProject", index: "baseProject", + number: "400500", id:"2002002", }, { diff --git a/src/pages/eashier/service/service.vue b/src/pages/eashier/service/service.vue index b3a6d02..a1b4192 100644 --- a/src/pages/eashier/service/service.vue +++ b/src/pages/eashier/service/service.vue @@ -421,14 +421,11 @@ export default { //conslole.log(index) }, endEditcard(row, index) { - //conslole.log(index) let debtMoney = (this.recForm.amount * 1 - this.recForm.cashAmount * 1).toFixed(2) * 1; - //conslole.log(this.recForm) let form = { ...row }; - - //conslole.log(form) - ////conslole.log(debtMoney);//套餐价格 + console.log("🚀 ~ file: service.vue ~ line 427 ~ endEditcard ~ form", form) + console.log("🚀 ~ file: service.vue ~ line 429 ~ endEditcard ~ this.recForm.noDiscount", this.recForm.noDiscount) if (debtMoney > 0) { if (form.type == 2 || form.type == 0) { if (this.useRecharge == 2) { @@ -507,9 +504,11 @@ export default { form.discoutMoney = (form.spendMoney /( form.discount / 100)).toFixed(2) * 1; } else { - 不可以打折 + //不可以打折 form.discoutMoney = form.spendMoney; + console.log("🚀 ~ file: service.vue ~ line 511 ~ endEditcard ~ nihao", form.spendMoney) } + form.discoutGiftMoney=0 } if (form.discoutGiftMoney + form.discoutMoney > this.list[this.editProIndex].amount) { @@ -587,12 +586,15 @@ export default { let spendNumber = 0; ////conslole.log(this.rowRecList) this.rowRecList.forEach((item) => { - spendMoney += (item.discoutMoney + item.discoutGiftMoney) * 1; - spendNumber += (item.spendMoney * 1 + item.giftSpendMoney) * 1; + spendMoney += (item.discoutMoney* 1 + item.discoutGiftMoney* 1) * 1; + + + spendNumber += (item.spendMoney * 1 + item.giftSpendMoney* 1) * 1; ////conslole.log(item.discoutMoney); ////conslole.log(item.discoutGiftMoney); }); - ////conslole.log(spendMoney); + // conslole.log(spendMoney); + console.log("🚀 ~ file: service.vue ~ line 595 ~ sumNum ~ spendMoney", spendMoney) this.recForm.collectionRechargeAmount = spendNumber.toFixed(2) * 1; this.recForm.collRecAmonnt = spendMoney.toFixed(2) * 1; @@ -617,6 +619,7 @@ export default { ( spendMoney ).toFixed(2) * 1; + console.log("🚀 ~ file: service.vue ~ line 616 ~ sumNum ~ this.recForm.collectionAmounts", this.recForm.collectionAmounts) ////conslole.log(this.recForm.collectionAmount) this.recForm.rechargeAmount = spendNumber; this.list.splice(this.recForm.index, 1, this.recForm); @@ -967,9 +970,9 @@ export default { } } if (this.proIndex != -1) { - if (this.list[this.proIndex].projectName) { - this.czRecList(this.list[this.proIndex]); - } + // if (this.list[this.proIndex].projectName) { + // this.czRecList(this.list[this.proIndex]); + // } form.index = this.proIndex; this.list.splice(this.proIndex, 1, form); this.expand.push(this.proIndex); From 13f18d8194ada4aa0e7895b92895f61e52471ed6 Mon Sep 17 00:00:00 2001 From: "wangxubin@yeah.net" Date: Fri, 9 Sep 2022 16:21:03 +0800 Subject: [PATCH 3/3] =?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;