|
|
@@ -41,8 +41,8 @@
|
|
|
<p><small>本单金额: </small>{{data.rebate_used ? tool.formatAmount(data.defaultamount - rebateamount,2) : data.defaultamount}}</p>
|
|
|
</div>
|
|
|
<div v-if="(data.type === '标准订单' || data.type === '特殊订单') && isusedrebate === 1">
|
|
|
- <el-checkbox v-model="data.rebate_used" :true-label="1" :false-label="0" @change="rebateUsedChange">使用返利金</el-checkbox>
|
|
|
- <div v-if="data.rebate_used" class="flex-align-center">
|
|
|
+ <el-checkbox v-model="checked" :true-label="1" :false-label="0" @change="rebateUsedChange">使用返利金</el-checkbox>
|
|
|
+ <div v-if="checked" class="flex-align-center">
|
|
|
<p class="inline-16"><b>返利金余额:{{tool.formatAmount(data.rebatebalance,2)}}</b></p>
|
|
|
<el-input class="inline-16" size="mini" style="width:150px" v-model="data.rebateamount" @blur="useRebate(data.rebateamount)" placeholder="输入使用金额"></el-input>
|
|
|
<small>(返利金最高使用比例{{data.order_rebate_userate}})</small>
|
|
|
@@ -121,7 +121,7 @@
|
|
|
v-model="addressparam.content.where.condition"
|
|
|
placeholder="请输入搜索内容"
|
|
|
style="width:150px"
|
|
|
- @keyup.enter.native="receiveAddress(addressparam.content.pageNumber = 1)" @clear="receiveAddress(addressparam.content.pageNumber = 1)" clearable></el-input>
|
|
|
+ @keyup.enter.native="receiveAddress(addressparam.content.pageNumber = 1)" @clear="receiveAddress(addressparam.content.pageNumber = 1)" clearable></el-input>
|
|
|
<addAddressInfo @onAddSuccess="receiveAddress()" :mainData="{sys_enterpriseid:data.sys_enterpriseid}"/>
|
|
|
</div>
|
|
|
<el-table
|
|
|
@@ -416,9 +416,9 @@ export default {
|
|
|
},
|
|
|
async useRebate (e) {
|
|
|
let that = this
|
|
|
- /* 修改返利金 */
|
|
|
- let rebateamount = e;
|
|
|
- let amount = this.data.order_rebate_userate * this.data.defaultamount;//最大可用金额
|
|
|
+ /* 修改返利金 */
|
|
|
+ let rebateamount = e;
|
|
|
+ let amount = this.data.order_rebate_userate * this.data.defaultamount;//最大可用金额
|
|
|
const res = await this.$api.requested({
|
|
|
"id":20230218225002,
|
|
|
"content":{
|
|
|
@@ -471,23 +471,18 @@ export default {
|
|
|
},
|
|
|
async rebateUsedChange(){
|
|
|
console.log(this.data)
|
|
|
-
|
|
|
-
|
|
|
- if(this.data.status != '新建') return 1
|
|
|
-
|
|
|
-
|
|
|
- let amount = this.data.order_rebate_userate * this.data.defaultamount; //最大可用金额
|
|
|
- let rebatebalance = this.data.rebatebalance; //返利金账户余额
|
|
|
+ if(this.data.status != '新建') return 1
|
|
|
+ let amount=this.data.order_rebate_userate*this.data.defaultamount;//最大可用金额
|
|
|
+ let rebatebalance = this.data.rebatebalance;//返利金账户余额
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20230218225002,
|
|
|
- "content": {
|
|
|
- "sa_orderid": this.data.sa_orderid, //订单金额
|
|
|
- "isused": this.data.rebate_used == 1 ? 0 : 1, //是否使用
|
|
|
- "rebateamount": rebatebalance > amount ? amount : rebatebalance //返利金使用金额
|
|
|
+ "id": 20230218225002,
|
|
|
+ "content": {
|
|
|
+ "sa_orderid": this.data.sa_orderid,//订单金额
|
|
|
+ "isused": this.checked,//是否使用
|
|
|
+ "rebateamount":rebatebalance > amount ? amount : rebatebalance//返利金使用金额
|
|
|
}
|
|
|
})
|
|
|
- console.log(res)
|
|
|
- this.data.rebate_used = res.msg !== '成功' ? this.data.rebate_used == 0?1:0:this.data.rebate_used
|
|
|
+ // this.data.rebate_used = res.msg !== '成功' ? this.data.rebate_used == 0?1:0:this.data.rebate_used
|
|
|
|
|
|
}
|
|
|
},
|