|
@@ -21,11 +21,24 @@
|
|
|
<template slot="menuLeft">
|
|
|
</template>
|
|
|
|
|
|
+ <template slot-scope="scope" slot="menu">
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.orderState == 6 || scope.row.orderState == 6"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="refund(scope.row)"
|
|
|
+ >退款
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template slot="orderStateDesc" slot-scope="scope" >
|
|
|
<el-tag v-if="scope.row.orderState === 1">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
<el-tag v-else-if="scope.row.orderState === 2" type="warning">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
- <el-tag v-else-if="scope.row.orderState === 4"type="success">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
- <el-tag v-else-if="scope.row.orderState === 5"type="danger">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.orderState === 3" type="warning">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.orderState === 4" type="success">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.orderState === 5" type="danger">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.orderState === 6" type="danger">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.orderState === 7" type="danger">{{scope.row.orderStateDesc}}</el-tag>
|
|
|
</template>
|
|
|
|
|
|
</avue-crud>
|
|
@@ -33,7 +46,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {getList, getDetail, add, update, remove} from "@/api/finance/order";
|
|
|
+ import {getList, getDetail, add, update, remove, refund} from "@/api/finance/order";
|
|
|
import {mapGetters} from "vuex";
|
|
|
|
|
|
export default {
|
|
@@ -56,7 +69,7 @@
|
|
|
searchMenuSpan: 6,
|
|
|
searchIcon: true,
|
|
|
searchIndex: 3,
|
|
|
- menuWidth: 100,
|
|
|
+ menuWidth: 130,
|
|
|
border: true,
|
|
|
viewBtn: true,
|
|
|
editBtn: false,
|
|
@@ -350,6 +363,30 @@
|
|
|
this.loading = false;
|
|
|
this.selectionClear();
|
|
|
});
|
|
|
+ },
|
|
|
+ refund(row) {
|
|
|
+ this.$confirm("确定对该订单退款?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '退款中...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ refund(row.id).then(res => {
|
|
|
+ loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "退款成功!"
|
|
|
+ });
|
|
|
+ this.refreshChange();
|
|
|
+ }).catch(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|