Commit cab04a4d by lixiaomin

修改订单退款

parent 81d8474f
......@@ -73,7 +73,7 @@
</el-form-item>
</el-col>
</el-row>
<el-table :data="goodsList" @selection-change="handleSelectionChange">
<el-table :data="goodsList" @selection-change="handleSelectionChange" >
<el-table-column label="商品名称" align="center" prop="goodsName" />
<el-table-column label="缩略图" align="center">
<template slot-scope="scope">
......@@ -89,7 +89,7 @@
<el-table-column label="折扣价" align="center" prop="realAmount" />
<el-table-column label="实付" align="center" prop="realAmount" />
<el-table-column label="数量" align="center" prop="num" />
<el-table-column type="selection" width="55"/>
<el-table-column type="selection" width="55" :selectable="checkSelectable"/>
</el-table>
</el-form>
<div v-show="refundTag" style="margin-top: 20px;" >
......@@ -165,7 +165,8 @@ export default {
refundForm: {
refundAmount:"",
desc:"",
orderId:""
orderId:"",
orderDetailIds:[]
},
rules: {
refundAmount: [
......@@ -176,13 +177,17 @@ export default {
]
},
activeName:"first",
logList: []
logList: [],
ids:[],
};
},
created() {
},
methods: {
checkSelectable(row,index){
return row.refundId==null
},
getProvince(province){
let list=this.piovince;
for(let i=0;i<list.length;i++){
......@@ -274,6 +279,7 @@ export default {
//提交退款
refundSubmit(){
this.refundForm.orderId=this.orderId;
this.refundForm.orderDetailIds=this.ids;
this.$refs["refundForm"].validate((valid) => {
if (valid) {
refund(this.refundForm).then(response => {
......@@ -305,9 +311,9 @@ export default {
if(response.data.orderDetails.length>0){
let list=response.data.orderDetails;
for(let i=0;i<list.length;i++){
this.goodsList.push({"goodsName":list[i].goods.name,"pics":list[i].goods.pics,
this.goodsList.push({"id":list[i].id,"refundId":list[i].refundId,"goodsName":list[i].goods.name,"pics":list[i].goods.pics,
"categoryName":list[i].goods.categoryName,"price":list[i].goods.price,"discount":list[i].goods.discount,
"realAmount":list[i].realAmount,"num":list[i].num,"amount":list[i].amount})
"realAmount":list[i].realAmount,"num":list[i].num,"amount":list[i].amount});
}
}
}
......@@ -325,9 +331,11 @@ export default {
},
handleSelectionChange(selectList){
let sum=null;
this.ids=[];
if(selectList.length>0){
for(let i=0;i<selectList.length;i++){
sum+=selectList[i].realAmount;
this.ids.push(selectList[i].id);
}
}
this.refundForm.refundAmount=sum;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment