Browse Source

流量列表

wanghairong 5 months ago
parent
commit
6a0d6393c2
1 changed files with 23 additions and 52 deletions
  1. 23 52
      src/views/lotCard/trafficList/index.vue

+ 23 - 52
src/views/lotCard/trafficList/index.vue

@@ -6,12 +6,14 @@
     </div>
     <!-- 搜索条件区 -->
     <div class="search-section">
-      <a-form :model="searchForm" layout="inline">
-        <a-form-item field="iccid" label="ICCID">
-          <a-input v-model="searchForm.iccid" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')" allow-clear />
+      <a-form :model="searchForm" ref="formRef" layout="inline">
+        <a-form-item field="status" :label="$t('lotCard.statusTraffic')" :validate-trigger="['change', 'input', 'blur']"
+          :rules="[{ required: true, message: $t('lotCard.please') + $t('lotCard.statusTraffic') }]">
+          <a-input v-model="searchForm.status" :placeholder="$t('lotCard.please') + $t('lotCard.statusTraffic')"
+            allow-clear />
         </a-form-item>
-        <a-form-item field="hImsi" label="HIMSI">
-          <a-input v-model="searchForm.cardNumber" :placeholder="$t('lotCard.please') + $t('lotCard.himsi')"
+        <a-form-item field="periodType" :label="$t('lotCard.periodType')">
+          <a-input v-model="searchForm.periodType" :placeholder="$t('lotCard.please') + $t('lotCard.periodType')"
             allow-clear />
         </a-form-item>
         <a-form-item>
@@ -27,9 +29,7 @@
       @page-change="evChangePage" @page-size-change="evChangePageSize">
       <template #id="{ record }">
         <!-- <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handleDialog(record)">查看卡</a> -->
-        <a-popconfirm content="确认结束套餐?" ok-text="确定" cancel-text="取消" @ok="handleUnsubscribeDialog(record)">
-          <a class="a-link" href="javascript:;" style="margin-right: 1rem">结束套餐</a>
-        </a-popconfirm>
+
       </template>
 
     </a-table>
@@ -38,15 +38,19 @@
 </template>
 
 <script setup>
-import { onMounted, ref, h } from "vue";
+import { onMounted, ref, getCurrentInstance } from "vue";
 import { useRoute } from "vue-router";
 import { columns } from "./config";
 import { Message, Notification } from '@arco-design/web-vue'
-import { packageInfo, unsubscribe, release } from "@/api/path/lotCard.api"
+import { packageInfo } from "@/api/path/lotCard.api"
 import trafficDialog from "./trafficDialog.vue";
+import lotCard from "@/i18n/zh/lotCard";
+
+const { proxy } = getCurrentInstance()
+const formRef = ref()
 const searchForm = ref({
-  "iccid": "",
-  "imsi": "",
+  "status": "",
+  "periodType": "",
 });
 
 const dataSource = ref([]);
@@ -59,10 +63,6 @@ const pagination = ref({
 
 const dialogRef = ref()
 
-const cardStatusOptions = [
-  { label: '正常', value: 'normal' },
-  { label: '停机', value: 'suspended' },
-];
 
 const intData = async () => {
   const param = {
@@ -85,50 +85,21 @@ const evChangePageSize = (pageSize) => {
 }
 
 const resetSearch = () => {
-
+  proxy.$refs.formRef.resetFields()
+  intData()
 }
 
 const handleSearch = () => {
+  formRef.value.validate((errors) => {
+    if (!errors) {
+      intData()
+    }
+  });
 }
 
 const handleDialog = (data) => {
   dialogRef.value.open({ "iccid": "89852342022040149139" })
 };
-const handleUnsubscribeDialog = async (data) => {
-  // 订阅关系状态
-  // 1:未激活
-  // 2: 已过期
-  // 3: 已激活99:已退款
-  let info = {}
-  let param = {}
-  // TODO 入参获取不到,结束套餐可能位置存在错误
-  if (data.status == 1) {
-    param = {
-      "orderId": "12410291340347056782",
-      "thirdOrderId": "1848992146566851025"
-    }
-    info = await unsubscribe(param)
-  }
-  if (data.status == 3) {
-    param = {
-      "iccidPackageList": [
-        {
-          "iccid": "1845700383613420930",
-          "imsi": "454120387374989",
-          "packageid": "1851137028516811138"
-        }
-      ]
-    }
-    info = await release(param)
-
-  }
-  if (info.code == 200) {
-    Message.success({
-      content: data.msg,
-      duration: 2000,
-    });
-  }
-};
 
 
 onMounted(() => {