From 843054ad54941c65cb44a217452b2f858afe2b76 Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Mon, 26 Jul 2021 11:56:19 +0800 Subject: [PATCH] junkai.xie --- src/views/order/AddOrder.vue | 39 ++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index 5606f04..6524edb 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -233,7 +233,7 @@ @@ -241,7 +241,7 @@ @@ -918,19 +918,34 @@ export default { }) this.form.orderAmount = arr.reduce((a,b)=>a+b) }, - // 总金额--计算账号,或者市场价 + + // 总金额触发--计算账号或市场价 allAmountChange(val,row){ - if(val){ - let all = val*10000 + console.log(val,row,'kankan'); + if(row.totalAmount){ + let all = row.totalAmount if(row.accountNum){// 若有账号 - row.finalPrice = all/row.accountNum + row.finalPrice = Math.round(all/row.accountNum).toFixed(2) } - if(row.finalPrice){ - row.accountNum = all/row.finalPrice + if(row.finalPrice){// 若有市场价 + row.accountNum = Math.floor(all/row.finalPrice) } console.log(val,row); } }, + // 计算成交总额 + dealComputers(e,row){ + if(row.finalPrice&&row.accountNum){ + row.totalAmount = Math.round((row.finalPrice)*(row.accountNum)).toFixed(2); + } + this.allAmount() + }, + // 计算成交价 + dealBargain(e,row){ + if(row.accountNum&&row.totalAmount){ + row.finalPrice = Math.round(row.totalAmount/row.accountNum).toFixed(2) + } + }, // 权限switch切换--计算天数 formSwitch (e,row) { if(this.editDisabled){ @@ -982,13 +997,7 @@ export default { console.log(Date.parse(endYear),nowYear,date1,date2,days,'剩余期限'); row.remainingPeriod = days }, - // 计算成交总额 - dealComputers(e,row){ - if(row.finalPrice&&row.accountNum){ - row.totalAmount = Math.floor(((row.finalPrice*100)*(row.accountNum*100))/10000).toFixed(2); - } - this.allAmount() - }, + // 删除数据平台产品 delDataForm(index){ this.$confirm('确定要删除吗?', '提示', {