Parcourir la source

线下票停售

lsx il y a 2 ans
Parent
commit
f44dc1aa78
2 fichiers modifiés avec 40 ajouts et 1 suppressions
  1. 10 0
      src/api/business/ticket.js
  2. 30 1
      src/views/business/ticket/index.vue

+ 10 - 0
src/api/business/ticket.js

@@ -92,6 +92,16 @@ export function ticketBoxPut(data) {
   })
 }
 
+
+// 线下票停售
+export function ticketBoxStop(data) {
+  return request({
+    url: '/api/v1/mp/admin/ticket/box/stop',
+    method: 'post',
+    data
+  })
+}
+
 // 删除
 export function ticketBoxRemove(data) {
   return request({

+ 30 - 1
src/views/business/ticket/index.vue

@@ -207,7 +207,7 @@
               @click="getDetail(scope.row)"
               >查看</el-button
             >
-            <el-button
+            <el-button v-show="scope.row.status.value != 'stop'"
               v-hasPermi="['business:ticket:edit']"
               type="text"
               @click="setDetail(scope.row)"
@@ -230,6 +230,13 @@
               @click="setStatus(scope.row, 'off')"
               >下架</el-button
             >
+            <el-button
+              v-show="(scope.row.status.value === 'on' || scope.row.status.value === 'off') && scope.row.type.value === 'offline'"
+              v-hasPermi="['business:ticket:on']"
+              type="text"
+              @click="setStop(scope.row)"
+              >停售</el-button
+            >
             <el-button
               v-show="scope.row.status.value === 'done'"
               v-hasPermi="['business:ticket:remove']"
@@ -265,6 +272,7 @@ import {
   exportTicket,
   exportDraw,
   ticketBoxPut,
+  ticketBoxStop,
   ticketBoxRemove, setListData
 } from "@/api/business/ticket";
 import { publicFileGetUrl } from "@/api/common";
@@ -377,6 +385,27 @@ export default {
       });
     },
 
+    setStop(item) {
+      this.$confirm(
+        `确认停售盲票 “${item.title}” 吗?`,
+        `停售盲票`,
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      ).then(() => {
+        ticketBoxStop({
+          boxId: item.boxId,
+        }).then((res) => {
+          if (res.code === 0) {
+            this.$message.success("操作已完成!");
+            this.getList();
+          }
+        });
+      });
+    },
+
     del(item) {
       this.$confirm(`确认删除盲票 “${item.title}” 吗?`, "删除盲票", {
         confirmButtonText: "确定",