|
@@ -9,10 +9,16 @@
|
|
|
size="80%">
|
|
|
<div slot="title">
|
|
|
<div class="flex-align-center">
|
|
|
- <p class="inline-16"><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥ {{tool.formatAmount(data.amount,2)}}</b></span></p>
|
|
|
+ <p ><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥ {{tool.formatAmount(data.defaultamount,2)}}</b></span></p>
|
|
|
<!-- <label style="font-size:14px;margin-left:10px" for="">备注:</label>
|
|
|
<input class="order__note__input" v-model="defaultData.remarks" type="text" placeholder="请输入订单备注"> -->
|
|
|
- <p>运费:{{data.amount > data.freefreightamount >= 0?'当前订单免运费':`订单满${data.freefreightamount}元免运费,当前还差${data.freefreightamount - data.amount}元`}}</p>
|
|
|
+<!-- <p>运费:{{data.amount > data.freefreightamount >= 0?'当前订单免运费':`订单满${data.freefreightamount}元免运费,当前还差${data.freefreightamount - data.amount}元`}}</p>-->
|
|
|
+ </div>
|
|
|
+ <div class="flex-align-center">
|
|
|
+<!-- <p ><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥ {{tool.formatAmount(data.amount,2)}}</b></span></p>-->
|
|
|
+ <!-- <label style="font-size:14px;margin-left:10px" for="">备注:</label>
|
|
|
+ <input class="order__note__input" v-model="defaultData.remarks" type="text" placeholder="请输入订单备注"> -->
|
|
|
+ <p style="font-size: 13px !important;color: #8888;font-weight: normal">{{data.amount > freefreightamount?'当前订单免运费':`订单满${freefreightamount}元免运费,当前还差${freefreightamount - data.amount}元`}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="drawer__panel">
|
|
@@ -32,14 +38,15 @@
|
|
|
<div class="flex-align-center">
|
|
|
<p class="inline-16"><small>账户余额: </small><b>¥{{tool.formatAmount(defaultData.accountclass.balance?defaultData.accountclass.balance:0,2)}}</b></p>
|
|
|
<p class="inline-16"><small>账户名称: </small>{{defaultData.accountclass.accountname?defaultData.accountclass.accountname:'未选择账户'}}</p>
|
|
|
- <p><small>本单金额: </small>{{tool.formatAmount(data.amount - rebateamount,2)}}</p>
|
|
|
+ <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="checked" :true-label="1" :false-label="0">使用返利金</el-checkbox>
|
|
|
- <div v-if="checked" class="flex-align-center">
|
|
|
- <p class="inline-16"><b>返利金余额:{{tool.formatAmount(defaultData.rebatebalance,2)}}</b></p>
|
|
|
- <el-input class="inline-16" size="mini" style="width:150px" v-model="rebateamount" @blur="useRebate" placeholder="输入使用金额"></el-input>
|
|
|
- <small>(返利金最高使用比例{{data.order_rebate_userate}},本单上限:{{tool.formatAmount(data.amount * data.order_rebate_userate / 100,2)}})</small>
|
|
|
+ <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">
|
|
|
+ <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>
|
|
|
+<!-- <small>(返利金最高使用比例{{data.order_rebate_userate}},本单上限:{{tool.formatAmount(data.amount * data.order_rebate_userate / 100,2)}})</small>-->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -92,14 +99,16 @@
|
|
|
<div class="reveive__panel normal-margin">
|
|
|
<p><small>抬头: </small><span class="inline-16"><b>{{defaultData.fin_info.enterprisename}}</b></span></p>
|
|
|
<div class="flex-align-center">
|
|
|
- <p class="inline-16"><small>开票地址: </small>{{defaultData.fin_info.address?defaultData.fin_info.address:'--'}}</p>
|
|
|
- <p><small>开户行: </small> {{defaultData.fin_info.bank}}  <small>开户账号: </small> {{defaultData.fin_info.bankcardno}}</p>
|
|
|
+ <p class="inline-16"><small>开票地址: {{defaultData.fin_info.address?defaultData.fin_info.address:'--'}}</small></p>
|
|
|
+
|
|
|
</div>
|
|
|
+ <p><small>开户行: {{defaultData.fin_info.bank}}  </small></p>
|
|
|
+ <p><small>开户账号: {{defaultData.fin_info.bankcardno}}</small></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="flex:1;">
|
|
|
<div class="mt-10">
|
|
|
- <p class="normal-title inline-16">收货信息</p>
|
|
|
+ <p class="normal-title inline-16" >收货信息</p>
|
|
|
<el-popover
|
|
|
placement="bottom"
|
|
|
title="选择地址"
|
|
@@ -139,8 +148,10 @@
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
<div class="reveive__panel normal-margin">
|
|
|
- <p><span class="inline-16"><b>{{defaultData.re_info.name}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
|
|
|
- <small>{{defaultData.re_info.province?defaultData.re_info.province:'--'}}{{defaultData.re_info.city}}{{defaultData.re_info.county}}{{defaultData.re_info.address?defaultData.re_info.address:''}}</small>
|
|
|
+ <p><span class="inline-16"><b>{{defaultData.re_info.name}}</b></span></p>
|
|
|
+ <p><small>{{defaultData.re_info.phonenumber}}</small></p>
|
|
|
+ <p><small>{{defaultData.re_info.province?defaultData.re_info.province:'--'}}{{defaultData.re_info.city}}{{defaultData.re_info.county}}{{defaultData.re_info.address?defaultData.re_info.address:''}}</small></p>
|
|
|
+ <p style="height: 35px"></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -173,7 +184,7 @@
|
|
|
<div class="mt-10">
|
|
|
<div>
|
|
|
<p class="normal-title inline-16">订单产品</p>
|
|
|
- <el-button type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button>
|
|
|
+ <!-- <el-button type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button> -->
|
|
|
</div>
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="setcol">
|
|
@@ -239,10 +250,20 @@ export default {
|
|
|
rebateamount:null,
|
|
|
isusedrebate:0,
|
|
|
signbackstatus:'不需要',
|
|
|
- saletype:""
|
|
|
+ saletype:"",
|
|
|
+ freefreightamount:''
|
|
|
}
|
|
|
},
|
|
|
+ created () {
|
|
|
+ this.queryBasicInfo()
|
|
|
+ },
|
|
|
methods:{
|
|
|
+ async queryBasicInfo () {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id":20220920084001,"content":{},
|
|
|
+ })
|
|
|
+ this.freefreightamount = res.data.freefreightamount
|
|
|
+ },
|
|
|
onShow () {
|
|
|
this.initPage()
|
|
|
},
|
|
@@ -257,7 +278,11 @@ export default {
|
|
|
this.selectOptions()
|
|
|
|
|
|
this.checked = this.data.rebate_used
|
|
|
- this.rebateamount = this.data.rebateamount
|
|
|
+ if (this.data.rebateamount > this.data.defaultamount) {
|
|
|
+ this.rebateamount = this.tool.formatAmount(+this.data.defaultamount / 2)
|
|
|
+ } else {
|
|
|
+ this.rebateamount = this.data.rebateamount
|
|
|
+ }
|
|
|
},
|
|
|
// 收货信息:合作企业联系人
|
|
|
async receiveAddress (fn) {
|
|
@@ -309,7 +334,7 @@ export default {
|
|
|
"pay_enterpriseid":this.data.pay_enterpriseid,
|
|
|
"tradefield":this.data.tradefield,
|
|
|
"saletype":this.saletype,
|
|
|
- "rebate_used":this.checked,//默认0,是否使用返利金
|
|
|
+ "rebate_used":this.data.rebate_used,//默认0,是否使用返利金
|
|
|
"signbacknum":'',
|
|
|
"sa_promotionid":this.data.sa_promotionid,
|
|
|
"billdate":this.data.billdate
|
|
@@ -318,13 +343,14 @@ export default {
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
this.$emit('onSuccess')
|
|
|
if (this.data.type === '标准订单' || this.data.type === '特殊订单') {
|
|
|
- this.isusedrebate === 1?this.useRebate():""
|
|
|
+ this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
|
|
|
}
|
|
|
this.drawer = false
|
|
|
})
|
|
|
},
|
|
|
onEditSuccess () {
|
|
|
this.$refs.addpro.listData()
|
|
|
+ this.$emit('onSuccess')
|
|
|
},
|
|
|
addMoreProduct () {
|
|
|
this.setcol === 12?this.setcol = 24 : this.setcol = 12
|
|
@@ -353,31 +379,33 @@ export default {
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
},
|
|
|
- async useRebate () {
|
|
|
+ async useRebate (e) {
|
|
|
let that = this
|
|
|
- if (this.rebateamount > this.defaultData.rebatebalance ||this.rebateamount > (this.data.amount * this.data.order_rebate_userate / 100) ) return this.$message({
|
|
|
- message:`余额不足或已超过可用上限!`,
|
|
|
- type:function () {
|
|
|
- that.rebateamount = 0
|
|
|
- return 'error'
|
|
|
- }()
|
|
|
- })
|
|
|
- if (this.rebateamount == null) return this.$message({
|
|
|
- message:"返利金不能为空",
|
|
|
- type:'error'
|
|
|
- })
|
|
|
+ /* 修改返利金 */
|
|
|
+ let rebateamount = e;
|
|
|
+ let amount = this.data.order_rebate_userate * this.data.defaultamount;//最大可用金额
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20230218225002,
|
|
|
- "content": {
|
|
|
- "sa_orderid": this.data.sa_orderid, //订单金额
|
|
|
- "isused": this.checked, //是否使用
|
|
|
- "rebateamount": this.rebateamount //返利金使用金额
|
|
|
- },
|
|
|
- })
|
|
|
- if (res.code === 0) this.$message({
|
|
|
- message:`使用返利金失败!${res.msg}`,
|
|
|
- type:'error'
|
|
|
- })
|
|
|
+ "id":20230218225002,
|
|
|
+ "content":{
|
|
|
+ "sa_orderid":this.data.sa_orderid,//订单金额
|
|
|
+ "isused":1,//是否使用
|
|
|
+ "rebateamount":rebateamount>amount?amount:rebateamount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(res.data=='成功'){
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ this.initPage()
|
|
|
+ if(rebateamount>amount){
|
|
|
+ this.data.rebateamount=amount
|
|
|
+ this.$message({
|
|
|
+ message: '返利金最大可用值'+ amount,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
// 查询站点是否使用返利金
|
|
|
async queryUsedrebate () {
|
|
@@ -405,6 +433,27 @@ export default {
|
|
|
async selectOptions () {
|
|
|
const res = await this.$store.dispatch('optiontypeselect','saletype')
|
|
|
this.saleroptions = res.data
|
|
|
+ },
|
|
|
+ async rebateUsedChange(){
|
|
|
+ console.log(this.data)
|
|
|
+
|
|
|
+
|
|
|
+ if(this.data.status != '新建') return 1
|
|
|
+
|
|
|
+
|
|
|
+ let amount = parseInt(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 //返利金使用金额
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(res)
|
|
|
+ this.data.rebate_used = res.msg !== '成功' ? this.data.rebate_used == 0?1:0:this.data.rebate_used
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
}
|