zory před 3 týdny
rodič
revize
822a996a7b

+ 7 - 0
src/api/model/merOrder.js

@@ -79,6 +79,13 @@ export default {
             return await http.post(this.url, params);
         },
     },
+    refundCanacel: {
+        url: `${config.API_URL}/merchant/order/audit/cancel`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
     black: {
         url: `${config.API_URL}/merchant/order/black`,
         name: "-",

+ 22 - 1
src/views/service/order/refund/components/table.vue

@@ -170,8 +170,9 @@
             <template #default="scope">
                 <el-button-group>
                     <el-button size="small" text @click="table_view(scope.row)">详情</el-button>
-                    <el-button type="danger" size="small" text @click="table_refund(scope.row)" v-if="scope.row.status==8">同意退款</el-button>
+                    <el-button type="warning" size="small" text @click="table_refund(scope.row)" v-if="scope.row.status==8">同意退款</el-button>
                     <el-button type="danger" size="small" text @click="refund_detail(scope.row)" v-if="scope.row.status==9">处理退款</el-button>
+                    <el-button type="danger" size="small" text @click="table_refund_cancel(scope.row)">取消退款</el-button>
                 </el-button-group>
             </template>
         </el-table-column>
@@ -204,6 +205,26 @@ export default {
         }
     },
     methods: {
+        table_refund_cancel(data){
+            var state = "履约中";
+            if (data.status == 9) {
+                state = "已完成";
+            }
+            this.$confirm(`取消退款申请后,订单将恢复到【${state}】状态,用户可二次申请`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var loading = this.$loading();
+                var resp = await this.$API.merOrder.refundCanacel.post({"order":data.out_order_no,});
+                loading.close();
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$refs.table.refresh()
+            }).catch(() => {
+
+            })
+        },
         refund_detail(data){
             this.$nextTick(() => {
                 this.$refs.refundMain.open().setData(data)

+ 4 - 0
src/views/service/order/refund/index.vue

@@ -39,6 +39,10 @@ export default {
 		this.userInfo = userInfo;
     },
     methods: {
+        handleSuccess(data){
+            this.searchKey = data;
+            this.$refs.tablePage.upData(data)
+        },
         tabChange(event) {
             this.activeName = event;
             if (event == 'no'){