Commit cab04a4d by lixiaomin

修改订单退款

parent 81d8474f
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </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" prop="goodsName" />
<el-table-column label="缩略图" align="center"> <el-table-column label="缩略图" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -89,7 +89,7 @@ ...@@ -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="realAmount" /> <el-table-column label="实付" align="center" prop="realAmount" />
<el-table-column label="数量" align="center" prop="num" /> <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-table>
</el-form> </el-form>
<div v-show="refundTag" style="margin-top: 20px;" > <div v-show="refundTag" style="margin-top: 20px;" >
...@@ -165,7 +165,8 @@ export default { ...@@ -165,7 +165,8 @@ export default {
refundForm: { refundForm: {
refundAmount:"", refundAmount:"",
desc:"", desc:"",
orderId:"" orderId:"",
orderDetailIds:[]
}, },
rules: { rules: {
refundAmount: [ refundAmount: [
...@@ -176,13 +177,17 @@ export default { ...@@ -176,13 +177,17 @@ export default {
] ]
}, },
activeName:"first", activeName:"first",
logList: [] logList: [],
ids:[],
}; };
}, },
created() { created() {
}, },
methods: { methods: {
checkSelectable(row,index){
return row.refundId==null
},
getProvince(province){ getProvince(province){
let list=this.piovince; let list=this.piovince;
for(let i=0;i<list.length;i++){ for(let i=0;i<list.length;i++){
...@@ -274,6 +279,7 @@ export default { ...@@ -274,6 +279,7 @@ export default {
//提交退款 //提交退款
refundSubmit(){ refundSubmit(){
this.refundForm.orderId=this.orderId; this.refundForm.orderId=this.orderId;
this.refundForm.orderDetailIds=this.ids;
this.$refs["refundForm"].validate((valid) => { this.$refs["refundForm"].validate((valid) => {
if (valid) { if (valid) {
refund(this.refundForm).then(response => { refund(this.refundForm).then(response => {
...@@ -305,9 +311,9 @@ export default { ...@@ -305,9 +311,9 @@ export default {
if(response.data.orderDetails.length>0){ if(response.data.orderDetails.length>0){
let list=response.data.orderDetails; let list=response.data.orderDetails;
for(let i=0;i<list.length;i++){ 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, "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 { ...@@ -325,9 +331,11 @@ export default {
}, },
handleSelectionChange(selectList){ handleSelectionChange(selectList){
let sum=null; let sum=null;
this.ids=[];
if(selectList.length>0){ if(selectList.length>0){
for(let i=0;i<selectList.length;i++){ for(let i=0;i<selectList.length;i++){
sum+=selectList[i].realAmount; sum+=selectList[i].realAmount;
this.ids.push(selectList[i].id);
} }
} }
this.refundForm.refundAmount=sum; 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