|
|
|
@ -233,7 +233,7 @@ |
|
|
|
|
<el-table-column label="账号数" align="center" width="150"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input :disabled="disabled||editDisabled" @change="dealComputers($event,scope.row)" v-model="scope.row.accountNum" placeholder="请输入"type="text"></el-input> |
|
|
|
|
<el-input :disabled="disabled||editDisabled" @change="[dealComputers($event,scope.row),dealBargain($event,scope.row)]" v-model="scope.row.accountNum" placeholder="请输入"type="text"></el-input> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
@ -241,7 +241,7 @@ |
|
|
|
|
<el-table-column label="总金额(元)" align="center" width="180"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input :disabled="disabled||editDisabled" @change="[allAmount($event,scope.row),allAmountChange($event,scope.row)]" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="scope.row.totalAmount" placeholder="请输入"type="text"></el-input> |
|
|
|
|
<el-input :disabled="disabled||editDisabled" @blur="[allAmount($event,scope.row),allAmountChange($event,scope.row)]" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="scope.row.totalAmount" placeholder="请输入"type="text"></el-input> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
@ -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('确定要删除吗?', '提示', { |
|
|
|
|