瀏覽代碼

fix:购卡订单对接

duanyan 5 月之前
父節點
當前提交
ae7b3cd727
共有 1 個文件被更改,包括 33 次插入8 次删除
  1. 33 8
      src/views/order/BuyCard/index.vue

+ 33 - 8
src/views/order/BuyCard/index.vue

@@ -30,14 +30,26 @@
     <a-table :data="tableData" :pagination="pageData" :columns="columns" @page-change="evChangePage"
       :scroll="{ x: '100%', y: '800px' }">
       <template #status="{ record }">
-        {{ record.status == 1 ? "未激活" : record.status == 2 ? "已过期" : record.status == 3 ? "已激活" : "已退款" }}
+        {{ record.status }}
       </template>
       <template #moderation_status="{ record }">
         {{ record.moderation_status }}
       </template>
       <template #operate="{ record }">
-        <a-button @click="platformCancel" type="text" v-if="userType == 1">退订</a-button>
-        <a-button @click="adminCancel" type="text" v-if="userType == 2">退订</a-button>
+        <div v-if="userType == 1 && record.moderation_status == 1">
+          <a-popconfirm :content="`是否通过?`" type="warning" @ok="platformCancel(record, 2)">
+            <a-button type="text">通过</a-button>
+          </a-popconfirm>
+          <a-popconfirm :content="`是否驳回`" type="warning" @ok="platformCancel(record, 3)">
+            <a-button type="text">驳回</a-button>
+          </a-popconfirm>
+        </div>
+        <div v-if="userType == 2">
+          <a-popconfirm :content="`是否确认退订?`" type="warning" @ok="adminCancel(record)">
+            <a-button type="text">退订</a-button>
+          </a-popconfirm>
+        </div>
+
         <!-- <a-button @click="openDetail(record, 2)" type="text">查看</a-button> -->
       </template>
     </a-table>
@@ -273,7 +285,7 @@ const dataDetail = ref([{
   status: '沉默期'
 },])
 const userName = ref('')
-const userType = ref(''); // 1 平台 2用户
+const userType = ref(''); // 1平台 2用户
 const tableData = ref([]);
 const formRef = ref(null);
 const currentIndex = ref(null);
@@ -391,13 +403,26 @@ const cancelPurchase = () => {
   });
 }
 // 平台退订
-const platformCancel = () => {
-  platformUpdate().then(res => { })
+const platformCancel = (data, type) => {
+  const param = {
+    id: data.id,
+    status: type
+  }
+  platformUpdate(param).then(res => {
+    intData();
+  })
 }
 // 用户退订
-const adminCancel = () => {
-  adminUpdate().then(res => { })
+const adminCancel = (data) => {
+  const param = {
+    id: data.id,
+    status: data.status
+  }
+  adminUpdate(param).then(res => {
+    intData();
+  })
 }
+
 // 
 const tariffChange = (e) => {
   formState.value.tariffId = e;