|
|
@@ -36,17 +36,63 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="refund-item-list" v-if="Number(orderInfo.packCost)>0||Number(orderInfo.sendCost)>0">
|
|
|
+ <div class="refund-label">其他可退:</div>
|
|
|
+ <div>
|
|
|
+ <div class="list" v-if="Number(orderInfo.packCost)>0">
|
|
|
+ <div class="flex list-title" >
|
|
|
+ <span class="product-name">打包费</span>
|
|
|
+ <span class="product-num">{{ orderInfo.packCost?parseFloat(orderInfo.packCost):0 }}元</span>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="flex list-val" style="font-size:17px;font-weight:bold;">
|
|
|
+ <input type="digit" placeholder="金额" v-model="orderInfo.refundPackCostAmount" placeholder-style="color:#CCCCCC" />
|
|
|
+ <span style="margin-left:10px;">元</span>
|
|
|
+ <span style="color:green;margin-left:20px;">可退{{parseFloat((Number(orderInfo.packCost)-Number(orderInfo.refundPackCost)).toFixed(2))}}元</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="list" v-if="Number(orderInfo.sendCost)>0">
|
|
|
+ <div class="flex list-title" >
|
|
|
+ <span class="product-name">运费</span>
|
|
|
+ <span class="product-num">{{ orderInfo.sendCost?parseFloat(orderInfo.sendCost):0 }}元</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex list-val" style="font-size:17px;font-weight:bold;">
|
|
|
+ <input type="digit" placeholder="金额" v-model="orderInfo.refundSendCostAmount" placeholder-style="color:#CCCCCC" />
|
|
|
+ <span style="margin-left:10px;">元</span>
|
|
|
+ <span style="color:green;margin-left:20px;">可退{{parseFloat((Number(orderInfo.sendCost)-Number(orderInfo.refundSendCost)).toFixed(2))}}元</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <div class="accounts-list">
|
|
|
+ 退款原因
|
|
|
+ <div class="accounts-center">
|
|
|
+ <div v-if="cause==0">
|
|
|
+ <el-button type="primary" size="small" @click="cause=0">质量问题</el-button>
|
|
|
+ <el-button @click="cause=1" size="small" style="margin-left:20px;">多开错开</el-button>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-button @click="cause=0" size="small">质量问题</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="cause=1" style="margin-left:20px;">多开错开</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="accounts-list">
|
|
|
订单金额
|
|
|
<div class="accounts-center">
|
|
|
- ¥{{parseFloat(orderInfo.orderPrice)||0}}
|
|
|
+ ¥{{orderInfo.orderPrice ? parseFloat(orderInfo.orderPrice):0}}
|
|
|
<span style="margin-left:15px;font-size:18px;color:green;font-weight:bold;" v-if="Number(orderInfo.tkPrice)>0">已退¥{{orderInfo.tkPrice ? parseFloat(orderInfo.tkPrice) : 0}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="accounts-list">
|
|
|
可退金额
|
|
|
- <div class="accounts-center">¥{{ couldRefundPrice }}</div>
|
|
|
+ <div class="accounts-center">¥{{couldRefundPrice}}</div>
|
|
|
</div>
|
|
|
<div class="accounts-list">
|
|
|
预计退款
|
|
|
@@ -55,7 +101,7 @@
|
|
|
<div class="accounts-list">
|
|
|
实际退款
|
|
|
<div class="accounts-center">
|
|
|
- <el-input v-model="refundMoney" placeholder="输入金额" style="width:120px;"></el-input>
|
|
|
+ <el-input v-model="refundMoney" placeholder="输入金额" style="width:120px;" @focus="refundMoney=''"></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="accounts-list">
|
|
|
@@ -65,12 +111,28 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div style="padding:20upx 0 20upx 0;font-size:30upx;font-weight:bold;margin-left:70px;">
|
|
|
+ <span v-if="orderInfo.onlinePay == 2" style="color:green;">此单线上付款,提交后,钱会原路自动退回给客户</span>
|
|
|
+ <template v-else>
|
|
|
+ <span v-if="Number(orderInfo.debtPrice)>0" style="color:#3385ff;">
|
|
|
+ 此单为欠款单,提交后,欠款金额会自动减少
|
|
|
+ </span>
|
|
|
+ <span v-else style="color:red;">此单线下付款,提交后钱不会原路退回,请线下转账给客户</span>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div style="margin-left:80px;margin-top:20px;">
|
|
|
<el-button @click="closeOpen" style="margin-left:120px;">取消</el-button>
|
|
|
<el-popconfirm title="确认退款?" @confirm="confirmRefund()" @onConfirm="confirmRefund()" style="margin-left:180px;">
|
|
|
<el-button type="primary" slot="reference">确认</el-button>
|
|
|
</el-popconfirm>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div style="font-size:20px;z-index:9999;color:red;text-align:center;font-weight:bold;margin-bottom:30px;" v-if="!$util.isEmpty(unClear)">
|
|
|
+ <span>有一个待结账单 ¥{{unClear.actPrice?parseFloat(unClear.actPrice):0}}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
</div>
|
|
|
@@ -95,7 +157,7 @@ export default {
|
|
|
remark:'',
|
|
|
orderInfo:{},
|
|
|
couldRefundPrice:0,
|
|
|
- unClear:[]
|
|
|
+ unClear:{}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -124,8 +186,85 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
confirmRefund(){
|
|
|
+ let hasError = false
|
|
|
+ let product = []
|
|
|
+ let that = this
|
|
|
+ this.product.forEach(ele=>{
|
|
|
+ let currentRefundCont = ele.refundCount ? Number(ele.refundCount) :0
|
|
|
+ let currentNum = ele.xhNum ? Number(ele.xhNum) : 0
|
|
|
+ let hasRefundNum = ele.refundNum ? Number(ele.refundNum) : 0
|
|
|
+ let couldRefundNum = Number(currentNum) - Number(hasRefundNum)
|
|
|
+ if(Number(currentRefundCont) > Number(couldRefundNum)){
|
|
|
+ this.$message.error(ele.name+'超过可退数量')
|
|
|
+ hasError = true;
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(Number(ele.refundCount)>0){
|
|
|
+ product.push({
|
|
|
+ productId:ele.productId,
|
|
|
+ num:ele.refundCount,
|
|
|
+ unitType:ele.unitType,
|
|
|
+ unitName:ele.xhUnitName,
|
|
|
+ unitType:ele.xhUnitType,
|
|
|
+ unitPrice:ele.xhUnitPrice
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(hasError){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.$util.isEmpty(product)&&this.refundType==1){
|
|
|
+ this.$message.error('请选择商品')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(Number(this.orderInfo.refundPackCostAmount)>0){
|
|
|
+ let couldRefundPackCost = parseFloat((Number(this.orderInfo.packCost)-Number(this.orderInfo.refundPackCost)).toFixed(2))
|
|
|
+ if(Number(this.orderInfo.refundPackCostAmount)>Number(couldRefundPackCost)){
|
|
|
+ this.$message.error('打包费超出可退金额')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(Number(this.orderInfo.refundSendCostAmount)>0){
|
|
|
+ let couldRefundSendCost = parseFloat((Number(this.orderInfo.sendCost)-Number(this.orderInfo.refundSendCost)).toFixed(2))
|
|
|
+ if(Number(this.orderInfo.refundSendCostAmount)>Number(couldRefundSendCost)){
|
|
|
+ this.$message.error('运费超出可退金额')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let refundParams = {
|
|
|
+ id:this.currentRefundData.id,
|
|
|
+ product:JSON.stringify(product),
|
|
|
+ price:this.refundMoney,
|
|
|
+ remark:this.remark,
|
|
|
+ refundType:this.refundType,
|
|
|
+ getOriginalItem:1,
|
|
|
+ cause:this.cause,
|
|
|
+ refundSendCost:this.orderInfo.refundSendCostAmount,
|
|
|
+ refundPackCost:this.orderInfo.refundPackCostAmount
|
|
|
+ };
|
|
|
+ this.$service.refund.refund(refundParams).then(data => {
|
|
|
+ if(data.error && data.error == 'hasUnClearOrder'){
|
|
|
+ that.needCancelRemind(data.clearId)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.$message.success('售后成功')
|
|
|
+ that.closeOpen()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ needCancelRemind(id){
|
|
|
+ this.$message.error('有结账单取消了才能退款');
|
|
|
},
|
|
|
init() {
|
|
|
+
|
|
|
+ this.product=[]
|
|
|
+ this.refundMoney=0
|
|
|
+ this.refundType=1
|
|
|
+ this.cause=0
|
|
|
+ this.remark=''
|
|
|
+ this.orderInfo={}
|
|
|
+ this.couldRefundPrice=0
|
|
|
+ this.unClear={}
|
|
|
+
|
|
|
this.showDtail = true
|
|
|
this.$service.order.detail({id:this.currentRefundData.id,getOriginalItem:1}).then(data => {
|
|
|
this.orderInfo = {...data,refundPackCostAmount:'',refundSendCostAmount:''}
|
|
|
@@ -141,7 +280,7 @@ export default {
|
|
|
|
|
|
let customId = data.customId ? data.customId : 0
|
|
|
if(Number(customId)>0){
|
|
|
- getUnClear({customId:customId}).then(result=>{
|
|
|
+ this.$service.clear.getUnClear({customId:customId}).then(result=>{
|
|
|
this.unClear = result.info
|
|
|
})
|
|
|
}
|
|
|
@@ -240,7 +379,7 @@ export default {
|
|
|
.list-title{
|
|
|
height: 20px;
|
|
|
padding-bottom:20px;
|
|
|
- font-size:18px;
|
|
|
+ font-size:16px;
|
|
|
font-weight:bold;
|
|
|
.product-name{
|
|
|
overflow: hidden;
|