diff --git a/src/pages/eashier/raiseReatment/components/index.vue b/src/pages/eashier/raiseReatment/components/index.vue index e1bdf29..d19c9f3 100644 --- a/src/pages/eashier/raiseReatment/components/index.vue +++ b/src/pages/eashier/raiseReatment/components/index.vue @@ -37,7 +37,6 @@ @click='openPro(1)'>添加 -
总金额 : {{ outMoneys }}
撤销 -
总金额 : {{ inMoneys }}
+
成交金额 : {{ inMoneys }}
+
转入金额 : {{ outMoneys }}
+
现付金额 : {{ payMoneys }}
+
欠款金额金额 : {{ debtMoney }}
- - + @@ -135,12 +136,20 @@ {{ scope.row.payMoney }} - +
+ +
合计
+
+
现付金额为:
+
{{ payMoneys }}
+
+ + @@ -194,11 +203,13 @@ export default { }, }, projectDialogVisible: false, + shows: false, recDateShow: false, activeName: "现付", outMoneyIndex: -1, inNumberIndex: -1, inNumberIndexs: -1, + payMoneys: 0, proForm: { additionDate: null, manageStaffName: null, @@ -393,21 +404,16 @@ export default { if (this.openProText == 0) { (form.priceMember * form.minumumTimes).toFixed(2) * 1; form.prices = form.priceMember - form.changeInTime = form.minumumTimes; + form.changeInTime = 0; form.projectId = form.id; form.debtMoney = 0; form.transactionMoney = form.changeInMoney; form.changeInMoneyShow = false; form.debtMoneyShow = false; form.changeInCaseTimeShow = false; - let num = 0; - this.outList.forEach((item) => { - num = num + item.changeOutMoney - }); - form.changeInMoney = num - form.changeInMoney if (this.inList.length < 1) { this.inList.push(form); + this.inMoneys = 0; } else { this.$alert("只能选择一个项目进行转入", "提示", { confirmButtonText: "确定", @@ -428,8 +434,9 @@ export default { form.changeOutTimeShow = false; form.accountId = form.id; this.outList.push(form); + this.sumMoney(); } - this.sumMoney(); + // }, //查询会员信息 memberOne() { @@ -471,12 +478,6 @@ export default { //选择金额. editPay(row, index) { - // if (this.debtMoney < 0) { - // this.$message.error({ - // message: "支付金额已超出 , 无需进行现付 !", - // }); - // } else { - console.log(row) var form = { ...row, @@ -485,21 +486,36 @@ export default { var payLists = [...this.proForm.payLists]; payLists[index] = form; form.isShow = true; - form.payMoney = (this.debtMoney + form.payMoney).toFixed(2) * 1; this.proForm.payLists = []; this.proForm.payLists = payLists; + console.log(this.proForm.payLists) this.sumMoney() // } }, endEdit(row) { - console.log(row); - console.log(this.inList); - if (row.payMoney) { + + if (row.payMoney && row.payMoney <= this.debtMoney) { row.payMoney = row.payMoney * 1; } else { - row.payMoney = 0; + if (row.payMoney > this.debtMoney) { + this.$alert("现付金额大于需付金额,已将金额调整适合金额", "提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => { }, + }); + } + row.payMoney = this.debtMoney; } row.isShow = false; + this.shows = false; + // this.endEditTimes() + this.sumMoney() + }, + endEdits() { + this.shows = true, + this.sumMoney() }, openPro(num) { this.openProText = num; @@ -596,9 +612,9 @@ export default { num = num + item.changeOutMoney }); this.outMoneys = num; - if(this.outList.length!=0){ - this.inList[0].changeInMoney=num - } + // if(this.outList.length!=0){ + // this.inList[0].changeInMoney=num + // } }, openOutMoney(row, index) { @@ -638,6 +654,19 @@ export default { row.transactionMoney = row.changeInMoney; this.inNumberIndex = -1; this.sumMoney(); + if (this.outMoneys > row.changeInMoney) { + this.$alert("成交金额不能小于转入金额: ", "提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => { }, + }); + this.inList[0].changeInTime = 0 + this.inList[0].transactionMoney = 0 + this.sumMoney(); + } + }, endEditprices(row, index) { // if (row.changeInTime < row.minumumTimes) { @@ -646,10 +675,41 @@ export default { // }); // row.changeInTime = row.minumumTimes; // } + if (row.minumumPriceMember > row.prices) { + this.$alert("单价不可以低于最低单价: ", "提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => { }, + + }); + row.prices = row.minumumPriceMember + } else if (row.priceMember < row.prices) { + this.$alert("单价不可以高于标准单价: ", "提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => { }, + }); + row.prices = row.priceMember + } + row.changeInMoney = (row.prices * row.changeInTime).toFixed(2) * 1; row.transactionMoney = row.changeInMoney; this.inNumberIndexs = -1; this.sumMoney(); + if (this.outMoneys > row.changeInMoney) { + this.$alert("成交金额不能小于转入金额,请修改单价或者转入次数: ", "提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => { }, + }); + this.sumMoney(); + } }, projectRadio(row) { if (row) { @@ -674,6 +734,7 @@ export default { }); this.outMoneys = outMoneys.toFixed(2) * 1; this.inMoneys = inMoneys.toFixed(2) * 1; + this.payMoneys = payMoneys.toFixed(2) * 1; if (inMoneys != 0) { this.debtMoney = (inMoneys - outMoneys - payMoneys - debtMoney).toFixed(2) * 1; diff --git a/src/pages/eashier/service/detail/detail.vue b/src/pages/eashier/service/detail/detail.vue index 9d9c00a..784538c 100644 --- a/src/pages/eashier/service/detail/detail.vue +++ b/src/pages/eashier/service/detail/detail.vue @@ -135,6 +135,7 @@ export default { partten.https + res.data.filePath + "/" + res.data.fileName; } this.$refs.printform.show(this.printForm); + console.log(this.printForm) }); }, handleSizeChange(v) { diff --git a/src/pages/eashier/service/detail/printform.vue b/src/pages/eashier/service/detail/printform.vue index 47e9d93..4e201a1 100644 --- a/src/pages/eashier/service/detail/printform.vue +++ b/src/pages/eashier/service/detail/printform.vue @@ -1,5 +1,6 @@ - - - + + + + - + + @@ -221,15 +263,15 @@
- 现付金额: + 总付金额: - {{form.cashAmount}} + {{ form.cashAmount }}
- 实付金额: + 现付金额: - {{form.collectionCashAmount}} + {{ form.collectionCashAmounts }}
@@ -244,7 +286,7 @@
添加项目 收银列表 - {{isAddition==1?'收银':'补单'}} + {{ isAddition == 1 ? '收银' : '补单' }} 清空页面
确认收银 @@ -317,6 +359,7 @@ export default { rowList: [], form: { collectionCashAmount: 0, + collectionCashAmounts: 0, cashAmount: 0, debtMoney: 0, }, @@ -350,6 +393,9 @@ export default { }; }, methods: { + selectindex(row) { + console.log(row) + }, changeMember() { if (this.cashNumber == 1) { Object.assign(this.$data, this.$options.data.call(this)); @@ -362,32 +408,28 @@ export default { openList() { this.$refs.orders.show(); }, - + clear(row, text) { - console.log(text); + //console.log(text); let form = { ...row }; form[text] = []; - console.log(form); + //console.log(form); this.list.splice(row.index, 1, form); }, //修改卡付金额 editcard(row, index) { this.recIndex = index; + console.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(debtMoney); + console.log(form) + //console.log(debtMoney);//套餐价格 if (debtMoney > 0) { - // let cardMoney = - // (form.offsetMoney + form.offsetGiftMoney).toFixed(2) * 1; - // if (cardMoney < debtMoney) { - // form.spendMoney = form.cardOver; - // form.giftSpendMoney = form.giftConsumeMoney; - // form.discoutMoney = form.offsetMoney; - // form.discoutGiftMoney = form.offsetGiftMoney; - // } else { - console.log(form.type); - console.log(this.useRecharge); if (form.type == 2 || form.type == 0) { if (this.useRecharge == 2) { //先用充值再用赠送 @@ -399,7 +441,7 @@ export default { form.spendMoney = form.cardOver; form.discoutMoney = (form.cardOver * (form.discount / 100)).toFixed(2) * 1; - + form.giftSpendMoney = ( (debtMoney - form.discoutMoney) * @@ -423,47 +465,35 @@ export default { } else { //按比例使用 let sunRatio = - (form.cardRestMoney + form.cardGiftOvers).toFixed(2) * 1; - let recRatio = (form.cardRestMoney / sunRatio).toFixed(2) * 1; - let recGiftRatio = (form.cardGiftOvers / sunRatio).toFixed(2) * 1; - console.log(form.cardRestMoney); - console.log(form.cardGiftOvers); - console.log(sunRatio); - if (form.offsetMoney > debtMoney * recRatio) { + (form.cardRestMoney + form.cardGiftOvers).toFixed(2) * 1;///可用余额+赠送余额 + let recRatio = (form.cardRestMoney / sunRatio).toFixed(2) * 1;//可用余额比例 + let recGiftRatio = (form.cardGiftOvers / sunRatio).toFixed(2) * 1;//赠送余额比例 + if (form.offsetMoney > debtMoney * recRatio) {// if (this.recForm.noDiscount == 0) { - form.spendMoney = - (debtMoney * recRatio * (form.discount / 100)).toFixed(2) * 1; - form.discoutMoney = (debtMoney * recRatio).toFixed(2) * 1; - form.giftSpendMoney = - ( - debtMoney * - recGiftRatio * - (form.discountFreeAmount / 100) - ).toFixed(2) * 1; - form.discoutGiftMoney = - (debtMoney * recGiftRatio).toFixed(2) * 1; + 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) + form.discoutGiftMoney =//赠送卡支付的钱 + (form.giftSpendMoney / (form.discountFreeAmount / 100)).toFixed(2) * 1; + //console.log(form.discoutGiftMoney) } else { - console.log(debtMoney); + //console.log(debtMoney); form.spendMoney = (debtMoney * recRatio).toFixed(2) * 1; form.discoutMoney = (debtMoney * recRatio).toFixed(2) * 1; form.giftSpendMoney = (debtMoney * recGiftRatio).toFixed(2) * 1; form.discoutGiftMoney = (debtMoney * recGiftRatio).toFixed(2) * 1; } + } else { form.spendMoney = form.cardOver; form.discoutMoney = - (form.cardOver / (form.discount / 100)).toFixed(2) * 1; - form.giftSpendMoney = - debtMoney * recRatio - - form.discoutMoney + - (debtMoney * recGiftRatio).toFixed(2) * 1; - form.discoutGiftMoney = - ( - debtMoney * recRatio - - form.discoutMoney + - (debtMoney * recGiftRatio) / (form.discountFreeAmount / 100) - ).toFixed(2) * 1; + ((form.spendMoney * 1) * (form.discount / 100)).toFixed(2) * 1; + form.giftSpendMoney = ((form.spendMoney * 1) / recRatio * recGiftRatio).toFixed(2) * 1; + console.log("这个是赠送金额" + form.giftSpendMoney) + form.discoutGiftMoney =//赠送卡支付的钱 + (form.giftSpendMoney * (form.discount / 100)).toFixed(2) * 1; } } if (form.spendMoney == 0) { @@ -474,71 +504,100 @@ export default { } else { if (this.recForm.noDiscount == 0) { // 可以打折 - form.spendMoney = - ((debtMoney * form.discount) / 100).toFixed(2) * 1; + + form.discoutMoney = + ((form.spendMoney * form.discount) / 100).toFixed(2) * 1; } else { - // 不可以打折 - form.spendMoney = debtMoney; + 不可以打折 + form.discoutMoney = form.spendMoney; } - form.discoutMoney = debtMoney; + form.discoutGiftMoney=0 + } + if (form.discoutGiftMoney + form.discoutMoney > this.list[this.editProIndex].amount) { + this.$message.info({ + message: "卡付金额不能大于套餐金额", + }); + form.spendMoney = 0 + form.discoutMoney = 0 + form.discoutGiftMoney = 0 + form.giftSpendMoney = 0 } } else { form.spendMoney = 0; form.giftSpendMoney = 0; + if (0 <= row.spendMoney * 1 > row.cardOver * 1) { + this.$message.info({ + message: "支付金额不能大于可用金额!", + }); + } } if (form.spendMoney > form.cardOver) { form.spendMoney = form.cardOver; form.giftSpendMoney = form.cardGiftOvers; } + this.rowRecList.splice(index, 1, form); - }, - endEditcard(row, index) { - if (!row.spendMoney) { - row.spendMoney = 0; - } - row.spendMoney = row.spendMoney * 1; - - if (0 <= row.spendMoney * 1 > row.cardOver * 1) { - this.$message.info({ - message: "支付金额不能大于可用金额!", - }); - } else { - this.recIndex = -1; - if (row.spendMoney * 1 < 0) { - } else { - if (this.recForm.noDiscount == 0) { - row.discoutMoney = - ((row.spendMoney * 1) / ((row.discount * 1) / 100)).toFixed(2) * - 1; - } else { - row.discoutMoney = row.spendMoney; - } - row.cardOvers = - (row.cardOver * 1 - row.spendMoney * 1).toFixed(2) * 1; - row.cardGiftOvers = - (row.giftConsumeMoney * 1 - row.giftSpendMoney * 1).toFixed(2) * 1; - } - if (row.spendMoney == 0) { - row.discoutGiftMoney = 0; - } - } - let res = { ...row }; - this.rowRecList.splice(index, 1, res); + this.list[this.editProIndex].collectionCashAmounts = this.list[this.editProIndex].amount - (form.discoutMoney + form.discoutGiftMoney) + //console.log(this.list) + //console.log('这是index'+index) + let num = 0; + this.list.forEach((item) => { + // //console.log("这个是"+item.collectionCashAmounts) + num = num + item.collectionCashAmounts + }); + //console.log(num) + this.form.collectionCashAmounts = num; this.sumNum(); + // this.rowRecList.splice(index, 1, form); + + // --------------------------------------------------------------------------------------------------------------- + // if (!row.spendMoney) { + // row.spendMoney = 0; + // } + // row.spendMoney = row.spendMoney * 1; + + // if (0 <= row.spendMoney * 1 > row.cardOver * 1) { + // this.$message.info({ + // message: "支付金额不能大于可用金额!", + // }); + // } else { + // this.recIndex = -1; + // if (row.spendMoney * 1 < 0) { + // } else { + // if (this.recForm.noDiscount == 0) { + // row.discoutMoney = + // ((row.spendMoney * 1) / ((row.discount * 1) / 100)).toFixed(2) * 1; + // } else { + // row.discoutMoney = row.spendMoney; + // } + // row.cardOvers = + // (row.cardOver * 1 - row.spendMoney * 1).toFixed(2) * 1; + // row.cardGiftOvers = + // (row.giftConsumeMoney * 1 - row.giftSpendMoney * 1).toFixed(2) * 1; + // } + // if (row.spendMoney == 0) { + // row.discoutGiftMoney = 0; + // } + // } + // let res = { ...row }; + // this.rowRecList.splice(index, 1, res); + // this.sumNum(); }, sumNum() { let spendMoney = 0; let spendNumber = 0; + //console.log(this.rowRecList) this.rowRecList.forEach((item) => { - console.log(item.discoutMoney); - console.log(item.discoutGiftMoney); spendMoney += (item.discoutMoney + item.discoutGiftMoney) * 1; spendNumber += (item.spendMoney * 1 + item.giftSpendMoney) * 1; + //console.log(item.discoutMoney); + //console.log(item.discoutGiftMoney); }); - console.log(spendMoney); + //console.log(spendMoney); + this.recForm.collectionRechargeAmount = spendNumber.toFixed(2) * 1; this.recForm.collRecAmonnt = spendMoney.toFixed(2) * 1; - + //console.log(this.recForm.collectionRechargeAmount) this.recForm.cashAmount = ( this.recForm.collectionCashAmount + @@ -555,6 +614,11 @@ export default { this.recForm.collectionCashAmount + this.recForm.collectionIntegralAmount ).toFixed(2) * 1; + this.recForm.collectionAmounts = + ( + spendMoney + ).toFixed(2) * 1; + //console.log(this.recForm.collectionAmount) this.recForm.rechargeAmount = spendNumber; this.list.splice(this.recForm.index, 1, this.recForm); let rList = []; @@ -564,7 +628,7 @@ export default { JSON.stringify(item.rechargeAccountList) ); rechargeAccountList.forEach((item) => { - console.log(item); + //console.log(item); item.cardOver = item.cardOvers; item.giftConsumeMoney = item.cardGiftOvers; item.giftSpendMoney = 0; @@ -573,17 +637,18 @@ export default { }); } }); - + this.recListCopy = JSON.parse(JSON.stringify(rList)); - + this.list.forEach((item) => { if (item.index != this.editProIndex) { - console.log(this.setRecList(item)); + //console.log(this.setRecList(item)); let recArr = this.setRecList(item); item.rechargeAccountList.forEach((item, index) => { if (item.spendMoney > 0) { + this.sumAmont(); } else { - console.log(item); + //console.log(item); item.cardOver = recArr[index].cardOvers; item.cardOvers = recArr[index].cardOvers; item.giftConsumeMoney = recArr[index].cardGiftOvers; @@ -592,14 +657,15 @@ export default { }); } }); - console.log(rList); - console.log(this.list); + //console.log(rList); + //console.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) }, recashData(v) { this.list = v.list; @@ -607,7 +673,7 @@ export default { let recList = v.form.rechargeAccountList; this.list.forEach((item, index) => { if (Vindex < index) { - console.log("大于当前, 卡包变"); + //console.log("大于当前, 卡包变"); recList.forEach((rec, recIndex) => { if (rec.spendMoney > 0) { item.rechargeAccountList[recIndex].cardOver = rec.cardOvers; @@ -649,23 +715,23 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); } }, - + openAddMember() { this.$refs.addmember.show("添加"); }, getRowKeys(row) { return row.index; }, - + endEditMoney(row) { let form = { ...row }; - console.log(row); + //console.log(row); if (this.cashNumber == 1) { if ( form.topPriceMember < form.transactionPrice * 1 || @@ -700,7 +766,7 @@ export default { this.sumAmont(); }, handleChange(data, row, text) { - console.log("行号", row.index); + //console.log("行号", row.index); let form = { ...row }; if (text == "managerList") { this.managerOptions.forEach((item, index) => { @@ -723,7 +789,7 @@ export default { } else { this.options.forEach((item, index) => { if (item.id == data) { - console.log("返回数据:", item); + //console.log("返回数据:", item); item.ratio = 100; form[text] = []; form[text].push(item); @@ -760,7 +826,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); this.cashNumber = 0; } @@ -772,6 +838,7 @@ export default { }, passcodeData(v) { if (v != null) { + console.log(v) this.formData.append("file", v); } this.addCashConfirm(); @@ -788,7 +855,7 @@ export default { this.$refs.project.show(this.memberForm); }, projectData(v) { - console.log(v); + //console.log(v); if (!v.courseAccountId) { v.courseAccountId = null; v.courseProjectId = v.id; @@ -861,7 +928,7 @@ export default { numberTimes: 1, minumumTimes: res.data.minumumTimes, }; - console.log(form); + //console.log(form); this.setRecList(form); if (this.cashNumber == 1) { if (row.courseAccountId == null) { @@ -885,16 +952,17 @@ export default { } form.memberName = this.memberForm.memberName; form.mobilePhone = this.memberForm.mobilePhone; - + if (form.courseAccountId == null) { form.cashAmount = 0; form.collectionAmount = 0; } else { form.cashAmount = form.amount; form.collectionAmount = form.cashAmount; + //console.log("1") } if (this.list.length > 0) { - console.log(this.list.length); + //console.log(this.list.length); if (!this.list[0].projectName) { this.proIndex = 0; } @@ -923,7 +991,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); @@ -956,7 +1024,7 @@ export default { 2 ) * 1; } - console.log(item); + //console.log(item); } else { item.offsetMoney = item.giftConsumeMoney + item.cardConsumeMoney; item.offsetGiftMoney = 0; @@ -973,7 +1041,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); flag = false; } @@ -998,11 +1066,11 @@ export default { // flag = false; // } }); - + if ( this.balance <= - (this.form.collectionCashAmount - sumMoney).toFixed(2) * 1 || - (this.form.collectionCashAmount - sumMoney).toFixed(2) * 1 < 0 + (this.form.collectionCashAmounts - sumMoney).toFixed(2) * 1 || + (this.form.collectionCashAmounts - sumMoney).toFixed(2) * 1 < 0 ) { flag = false; this.$alert("实付金额不等于项目金额", "提示", { @@ -1010,7 +1078,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } if (this.isAddition == 1 && !this.additionDate) { @@ -1020,7 +1088,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } if (flag) { @@ -1067,7 +1135,7 @@ export default { item.collectionCashAmount ).toFixed(2) * 1; } - + item.isAddition = this.isAddition; if (this.isAddition == 1) { item.additionDate = this.additionDate; @@ -1109,17 +1177,26 @@ export default { item.rechargeAccountList = rechargeAccountList; if (item.courseAccountId != null) { item.collectionAmount = item.amount; + //console.log("2") } if (item.projectId) { list.push(item); } }); + console.log(list) + + list.forEach((item) => { + item.collectionAmount = item.collectionAmounts + + }) + console.log(list) this.formData.append("cashListRequestList", JSON.stringify(list)); addCash(this.formData).then((res) => { if (res.code == "000000") { this.$message.success({ message: "验证成功 , 收银" + res.message, }); + this.formData = new FormData() this.notData(); } else { this.payLists = this.payListsCopy; @@ -1131,16 +1208,22 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); + this.formData = new FormData() } }); }, openStaffRatio(row, index, text) { this.editIndex = index; + console.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) let form = this.list[this.editIndex]; let texts = v.text + "s"; form[v.text] = v.list; @@ -1159,36 +1242,44 @@ export default { payLists: this.payLists, rechargeAccountList: [], //卡付列表 }; - + this.list.push(list); }, delPro(row) { - this.czRecList(row); + // this.czRecList(row); this.list.splice(row.index, 1); - }, - czRecList(row) { - let list = []; - row.rechargeAccountList.forEach((item) => { - if (item.spendMoney > 0) { - list.push(item); - } - }); - this.recListCopy.forEach((item) => { - list.forEach((items) => { - if (item.id == items.id) { - console.log(item); - console.log(item.giftConsumeMoney); - console.log(item.giftSpendMoney); - item.cardOver = (item.cardOver + items.spendMoney).toFixed(2) * 1; - item.cardOvers = (item.cardOvers + items.spendMoney).toFixed(2) * 1; - item.cardGiftOvers = - (item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1; - item.giftConsumeMoney = - (item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1; - } - }); + //console.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 + this.payLists.forEach((item) => { + item.payMoney = 0 }); + this.sumAmont() }, + // czRecList(row) { + // let list = []; + // row.rechargeAccountList.forEach((item) => { + // if (item.spendMoney > 0) { + // list.push(item); + // } + // }); + // this.recListCopy.forEach((item) => { + // list.forEach((items) => { + // if (item.id == items.id) { + // //console.log(item); + // //console.log(item.giftConsumeMoney); + // //console.log(item.giftSpendMoney); + // item.cardOver = (item.cardOver + items.spendMoney).toFixed(2) * 1; + // item.cardOvers = (item.cardOvers + items.spendMoney).toFixed(2) * 1; + // item.cardGiftOvers = + // (item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1; + // item.giftConsumeMoney = + // (item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1; + // } + // }); + // }); + // }, //打开选择会员弹窗 openMember() { this.cashNumber = 1; @@ -1196,16 +1287,16 @@ export default { }, //选中会员返回方法 memberData(v) { - console.log(v); + //console.log(v); this.memberForm.mobilePhone = v.mobilePhone; this.inputMember(); }, - reccardData(v) {}, + reccardData(v) { }, courseData(v) { this.setProOne(v); }, paymentData(v) { - console.log(v); + //console.log(v); this.form = v.form; this.payLists = v.list; this.sumAmont(); @@ -1213,7 +1304,7 @@ export default { rowClassName({ row, rowIndex }) { row.index = rowIndex; }, - + expandSelect: function (row, expandedRows) { var that = this; this.expandedRows = JSON.parse(JSON.stringify(expandedRows)); @@ -1228,7 +1319,7 @@ export default { }, //点击选中 rowClick(row) { - console.log(row); + //console.log(row); this.$refs.list.toggleRowExpansion(row); }, close() { @@ -1278,7 +1369,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } //查询当前会员下的所有项目疗程 如果有相对应的项目 就给courseAccountId赋值 没有的话 就是卡付现付 @@ -1307,10 +1398,10 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } - + let list = []; this.list.forEach((itemList, index) => { var itemLists = { @@ -1374,7 +1465,7 @@ export default { itemList.cardAchievementTechnician, cardAchievementZhonggong: itemList.cardAchievementZhonggong, }; - + if (itemLists.courseAccountId == null) { itemLists.cashAmount = 0; itemLists.collectionAmount = 0; @@ -1382,6 +1473,7 @@ export default { } else { itemLists.cashAmount = itemLists.amount; itemLists.collectionAmount = itemLists.amount; + //console.log(3) itemLists.courseMoney = itemLists.transactionPrice; } list.push(itemLists); @@ -1514,7 +1606,7 @@ export default { } }); }, - + goBack() { if (this.isAddition == 0) { this.orderNumber = 1; @@ -1542,7 +1634,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); @@ -1556,7 +1648,7 @@ export default { item.ratio = 100; delete item.state; }); - + this.adminOptions = res.rows; } else { this.$alert(res.message, "加载员工提示", { @@ -1564,7 +1656,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); @@ -1582,7 +1674,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); @@ -1600,7 +1692,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); @@ -1633,7 +1725,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); @@ -1654,17 +1746,22 @@ export default { item.collectionIntegralAmount + item.collectionCashAmount ).toFixed(2) * 1; + //console.log(4) } else { item.collectionAmount = ( item.collectionIntegralAmount + item.collectionCashAmount ).toFixed(2) * 1; } + //console.log(5) }); } + let collectionRechargeAmountg = 0; this.list.forEach((item) => { let debtMoney = 0; + if (item.amount && item.courseAccountId == null) { + debtMoney = ( item.amount - @@ -1674,8 +1771,13 @@ export default { ).toFixed(2) * 1; money += debtMoney; } + collectionRechargeAmountg += (item.collectionRechargeAmount).toFixed(2) * 1; }); - this.form.cashAmount = money.toFixed(2) * 1; + + 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) this.list.forEach((item) => { if ( this.form.cashAmount == this.form.collectionCashAmount && @@ -1695,11 +1797,15 @@ export default { item.collectionIntegralAmount + item.collectionCashAmount ).toFixed(2) * 1; + //console.log(6) + //console.log( item.collectionAmount) + } else { item.collectionAmount = (item.collectionIntegralAmount + item.collectionCashAmount).toFixed( 2 ) * 1; + //console.log(7) } }); this.form.debtMoney = @@ -1707,6 +1813,7 @@ export default { var that = this; setTimeout(() => { that.$nextTick(() => { + console.log(that.form) that.$refs.payment.show(that.form, that.payLists); }); }, 500); @@ -1770,7 +1877,7 @@ export default { activated() { this.setPage(); }, - created() {}, + created() { }, }; @@ -1778,14 +1885,17 @@ export default { .el-icon-edit-outline { padding-left: 5px; } + .imgss { width: 160px; height: 60px; border: 1px solid #333; } + .esign { border: #333 1px solid; } + .el-form-item { margin-bottom: 5px; } diff --git a/src/pages/eashier/service/staffratio.vue b/src/pages/eashier/service/staffratio.vue index 10659ea..e6063a9 100644 --- a/src/pages/eashier/service/staffratio.vue +++ b/src/pages/eashier/service/staffratio.vue @@ -1,5 +1,6 @@