Ver código fonte

经销商盲票订单新增取消订单

DELL 3 anos atrás
pai
commit
9d0c8a409b
2 arquivos alterados com 44 adições e 6 exclusões
  1. 9 0
      src/api/business/order.js
  2. 35 6
      src/views/order/channel/index.vue

+ 9 - 0
src/api/business/order.js

@@ -128,3 +128,12 @@ export function channelOrderExport(data) {
     data
   })
 }
+
+// 经销商取消订单
+export function removeChannelOrder(data) {
+  return request({
+    url: '/api/v1/mp/admin/channel/order/order/cancel',
+    method: 'post',
+    data
+  })
+}

+ 35 - 6
src/views/order/channel/index.vue

@@ -194,15 +194,18 @@
               v-hasPermi="['order:channel:query']"
               type="text"
               @click="getDetail(row)"
-              >查看详情</el-button
-            >
+            >查看详情</el-button>
+            <el-button
+              v-if="row.status.value === 1"
+              type="text"
+              @click="cancellationOrder(row)"
+            >取消订单</el-button>
             <el-button
               v-if="row.status.value === 1"
               v-hasPermi="['order:channel:ship']"
               type="text"
               @click="toGoods(row)"
-              >发货</el-button
-            >
+              >发货</el-button>
           </div>
         </template>
       </el-table-column>
@@ -227,7 +230,7 @@
   </div>
 </template>
 <script>
-import { getOrderList, companyList, boxList, channelOrderExport} from "@/api/business/order";
+import { getOrderList, companyList, boxList, channelOrderExport, removeChannelOrder} from "@/api/business/order";
 import { listAllSaleSite} from "@/api/admin/salesite";
 import { publicFileGetUrl } from "@/api/common";
 import SendGoods from "./components/SendGoods";
@@ -270,7 +273,7 @@ export default {
       // 盲票组下拉列表
       boxData: [],
       siteList:[],
-      siteCopyList:[]
+      siteCopyList:[],
     };
   },
   mounted() {
@@ -395,6 +398,29 @@ export default {
       this.getBoxList(row);
     },
 
+    //取消订单
+    cancellationOrder(row){
+      this.$confirm('确定要取消订单吗?取消后实付金额将原路返回', '取消订单', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log(row)
+        let data = {
+          orderId:row.orderId
+        }
+        return  removeChannelOrder(data)
+      }).then(()=>{
+        this.getList()
+        this.$message({
+          type: 'success',
+          message: '取消订单成功!'
+        })
+      }).catch(() => {
+
+      });
+    },
+
     // 关闭发货弹框
     close() {
       this.goodsShow = false;
@@ -431,4 +457,7 @@ export default {
 ::v-deep .el-tabs--border-card > .el-tabs__content {
   padding: 0;
 }
+.el-button {
+  margin-left: 0;
+}
 </style>