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/components/staffList/staff/index.vue b/src/components/staffList/staff/index.vue index 034cf92..ac821f7 100644 --- a/src/components/staffList/staff/index.vue +++ b/src/components/staffList/staff/index.vue @@ -228,7 +228,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 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 ae5d5c9..18a2c43 100644 --- a/src/pages/eashier/service/service.vue +++ b/src/pages/eashier/service/service.vue @@ -383,7 +383,7 @@ export default { editProIndex: -1, isAddition: 0, additionDate: null, - transactionPrice: null, + transactionPrice: 0, options: [], //员工下拉选择列表 adminOptions: [], //管理员下拉选择列表 managerOptions: [], //高管下拉选择列表 @@ -392,10 +392,12 @@ export default { rowRecList: [], copyPayList: [], routeNumber: null, + copyAccountList:[] }; }, methods: { selectindex(row) { + //conslole.log(row) }, changeMember() { if (this.cashNumber == 1) { @@ -411,25 +413,23 @@ 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) let debtMoney = (this.recForm.amount * 1 - this.recForm.cashAmount * 1).toFixed(2) * 1; - console.log(this.recForm) let form = { ...row }; - console.log(form) - //console.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) { @@ -474,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; @@ -492,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; } @@ -508,9 +508,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) { @@ -537,33 +539,36 @@ 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(); }, 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); + spendMoney += (item.discoutMoney* 1 + item.discoutGiftMoney* 1) * 1; + + + spendNumber += (item.spendMoney * 1 + item.giftSpendMoney* 1) * 1; + ////conslole.log(item.discoutMoney); + ////conslole.log(item.discoutGiftMoney); }); - //console.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; - //console.log(this.recForm.collectionRechargeAmount) + ////conslole.log(this.recForm.collectionRechargeAmount) this.recForm.cashAmount = ( this.recForm.collectionCashAmount + @@ -584,7 +589,8 @@ export default { ( spendMoney ).toFixed(2) * 1; - //console.log(this.recForm.collectionAmount) + 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); let rList = []; @@ -594,7 +600,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; @@ -608,13 +614,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; @@ -623,14 +629,23 @@ 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; +      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; @@ -638,7 +653,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; @@ -696,7 +711,7 @@ export default { endEditMoney(row) { let form = { ...row }; - //console.log(row); + ////conslole.log(row); if (this.cashNumber == 1) { if ( form.topPriceMember < form.transactionPrice * 1 || @@ -731,7 +746,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) => { @@ -754,7 +769,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); @@ -803,7 +818,7 @@ export default { }, passcodeData(v) { if (v != null) { - console.log(v) + //conslole.log(v) this.formData.append("file", v); } this.addCashConfirm(); @@ -820,7 +835,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; @@ -924,18 +939,18 @@ 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; } } 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); @@ -989,7 +1004,7 @@ export default { 2 ) * 1; } - //console.log(item); + ////conslole.log(item); } else { item.offsetMoney = item.giftConsumeMoney + item.cardConsumeMoney; item.offsetGiftMoney = 0; @@ -1133,19 +1148,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)); console.log(this.formData) addCash(this.formData).then((res) => { @@ -1173,14 +1188,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; @@ -1198,15 +1213,17 @@ 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) { console.log('会执行到这里吗'); // 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 @@ -1222,7 +1239,7 @@ export default { }, //选中会员返回方法 memberData(v) { - //console.log(v); + ////conslole.log(v); this.memberForm.mobilePhone = v.mobilePhone; this.inputMember(); }, @@ -1231,7 +1248,7 @@ export default { this.setProOne(v); }, paymentData(v) { - //console.log(v); + ////conslole.log(v); this.form = v.form; this.payLists = v.list; this.sumAmont(); @@ -1254,7 +1271,7 @@ export default { }, //点击选中 rowClick(row) { - //console.log(row); + ////conslole.log(row); this.$refs.list.toggleRowExpansion(row); }, close() { @@ -1408,7 +1425,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); @@ -1682,14 +1699,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; @@ -1732,15 +1749,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 = @@ -1748,7 +1765,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(); }, //明细返回方法