订单计算

dev
e 3 years ago
parent ffc608c5b7
commit a3597db605
  1. 26
      src/views/order/AddOrder.vue

@ -136,7 +136,7 @@
<el-table-column label="成交价 " align="center">
<template slot-scope="scope">
<div class="small">
<el-input @change="discount($event,scope.row)" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input>
<el-input @change="calculateDiscount($event,scope.row)" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input>
<span></span>
</div>
</template>
@ -218,7 +218,7 @@
<el-table-column label="成交价" align="center" width="185">
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.finalPrice&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @change="[dealComputers($event,scope.row),discount($event,scope.row),userAmount($event,scope.row)]" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input>
<el-input :class="!scope.row.finalPrice&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @change="[dealComputers($event,scope.row),calculateDiscount($event,scope.row),userAmount($event,scope.row)]" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input>
<span>&nbsp;/&nbsp; </span>
</div>
</template>
@ -233,7 +233,7 @@
<el-table-column label="账号数" align="center" width="150">
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.accountNum&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" @change="[dealComputers($event,scope.row),dealBargain($event,scope.row)]" v-model="scope.row.accountNum" placeholder="请输入"type="text"></el-input>
<el-input :class="!scope.row.accountNum&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" @change="[dealComputers($event,scope.row),dealBargain($event,scope.row),calculateDiscount($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 :class="!scope.row.totalAmount&&whetherSubmit?'red':''" :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>
<el-input :class="!scope.row.totalAmount&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" @blur="[allAmount($event,scope.row),allAmountChange($event,scope.row),calculateDiscount($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>
@ -938,10 +938,9 @@ export default {
this.addDataJurisdiction();
},
//
discount(val,row){
if(val){
row.discountRate = Math.floor(val/row.marketValue*100).toFixed(2)+'%'
}
calculateDiscount(val,row){
if(row.finalPrice)
row.discountRate = (row.finalPrice/row.marketValue*100).toFixed(2)+'%'
},
//
userAmount(val,row){
@ -997,11 +996,8 @@ export default {
// --
deliverGoods (e,row) {
if(this.editDisabled){
// this.$post(this.api.ship+"?id="+`${row.dataOrCourseId}`).then(res=>{
this.$post(this.api.ship,{id:4}).then(res=>{
console.log(res);
})
this.$post(this.api.ship+"?id="+`${row.dataOrCourseId}`).then(res=>{ })
// this.$post(this.api.ship,{id:4}).then(res=>{
}
},
// 使
@ -1024,7 +1020,9 @@ export default {
let renewM = arr.shift()/* 月 */
let renewD = arr.shift()/* 日 */
console.log(renewY,renewM,renewD,'拆分时间');
let endYear = +renewY + (parseInt((+renewM+(+e))/12)===0?0:parseInt((+renewM+(+e))/12))+ char + completeDate((+renewM+(+e))%12) + char + renewD;
let endYear = +renewY + (parseInt((+renewM+(+e))/13)===0?0:parseInt((+renewM+(+e))/12))+ char + completeDate((+renewM+(+e))%12) + char + renewD;
// console.log((parseInt((+renewM(+e))/12)===0?0:parseInt((+renewM+(+e))/12)),renewY,'', +renewY + (parseInt((+renewM+(+e))/12)===0?0:parseInt((+renewM+(+e))/12)));
console.log(parseInt((+renewM+(+e))/13),'计算整除的年份',12/13,'+renewM+(+e)');
row.endTime = endYear
//

Loading…
Cancel
Save