Răsfoiți Sursa

sim七个接口对接

wanghairong 5 luni în urmă
părinte
comite
3090af7ca6

+ 6 - 1
src/api/path/lotCard.api.js

@@ -41,7 +41,12 @@ export function cardInfoList(param) {
   return service.post('/admin/simCard/cardInfoList', param)
 }
 
-// 卡信息
+// 卡信息
 export function cardInfoImport(param) {
   return service.post('/admin/simCard/cardInfoImport', param)
+}
+
+// 卡-下发用户
+export function cardIssue(param) {
+  return service.post('/admin/simCard/cardIssue', param)
 }

+ 10 - 2
src/i18n/zh/lotCard.js

@@ -43,7 +43,15 @@ export default {
     price:"订单价格",
     deductionModel:"套餐收费方式",
 
-    // 弹窗流量包
-    titleTraffic:"查询卡",
+    // 弹窗查询卡
+    titleSim:"查询卡",
+    cardHlrId:"主卡HLR标记",
+    cardOtaId:"主卡的OTA设备",
+    realRuleListName:"实名制对象",
+    serviceUsageMode:"激活卡套餐",
+    statusSim:"主卡状态",
+
+    titleIssued:"下发用户",
+    titleOrder:"订购套餐",
 
 }  

+ 123 - 0
src/views/lotCard/cardList/cardDialog.vue

@@ -0,0 +1,123 @@
+<template>
+    <a-modal width="70%" :visible="visible" :title="$t('lotCard.titleSim')" @ok="handleSubmit" @cancel="handleCancel">
+        <!-- 搜索条件区 -->
+        <div class="search-section">
+            <a-form :model="formData" layout="inline">
+                <a-form-item field="iccid" label="ICCID">
+                    <a-input v-model="formData.iccid" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')"
+                        allow-clear />
+                </a-form-item>
+                <a-form-item field="hImsi" label="HIMSI">
+                    <a-input v-model="formData.cardNumber" :placeholder="$t('lotCard.please') + $t('lotCard.himsi')"
+                        allow-clear />
+                </a-form-item>
+                <a-form-item>
+                    <a-space>
+                        <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
+                        <a-button @click="resetSearch">{{ $t('form.Reset') }}</a-button>
+                    </a-space>
+                </a-form-item>
+            </a-form>
+        </div>
+        <a-table :data="dataSource" :columns="dialogColumns" :scroll="{ x: 'auto' }" @page-change="evChangePage"
+            @page-size-change="evChangePageSize">
+            <template #id="{ record }">
+                <!-- <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="evEdit(record)">编辑</a>
+            <a-popconfirm content="确认删除该信息?" ok-text="确定" cancel-text="取消" @ok="evDelete(record.id)">
+              <a href="javascript:;" class="a-link">删除</a>
+            </a-popconfirm> -->
+            </template>
+
+        </a-table>
+    </a-modal>
+</template>
+<script setup>
+import { onMounted, ref, h } from "vue";
+import { dialogColumns } from "./config";
+import { Message, Notification } from '@arco-design/web-vue'
+import { simInfo } from "@/api/path/lotCard.api"
+
+const props = defineProps({
+});
+
+const emit = defineEmits(['submit']);
+
+const formRef = ref(null);
+const formData = ref({
+    "iccid": "",
+    "imsi": "454120387374989",
+});
+const tableList = ref([])
+
+const dataSource = ref([]);
+const pagination = ref({
+    total: 0,
+    pageSize: 10,
+    current: 1,
+})
+
+const visible = ref(false)
+
+const open = (data) => {
+    if (data.length == 0) {
+        return
+    }
+    visible.value = true
+    tableList.value = data.map(item => {
+        return {
+            iccid: item,
+            current: pagination.value.current,
+            size: pagination.value.pageSize,
+        }
+    })
+    intData(tableList.value)
+}
+
+const intData = async (param) => {
+    const { data } = await simInfo(param)
+    dataSource.value = (data || []).map(item => {
+        const realRuleListName = (item.realRuleList.map(item => item.name) || []).join(',')
+        return {
+            ...item,
+            realRuleListName
+        }
+    })
+    pagination.value.total = data.length
+}
+
+const evChangePage = (page) => {
+    pagination.value.current = page
+}
+
+const evChangePageSize = (pageSize) => {
+    pagination.value.pageSize = pageSize
+}
+
+
+
+const resetSearch = () => {
+
+}
+
+const handleSearch = () => {
+}
+
+const handleSubmit = () => {
+    formRef.value.validate((errors) => {
+        if (!errors) {
+            emit('submit', { ...formData });
+            visible.value = false
+        } else {
+            console.error('Validation failed', errors);
+        }
+    });
+};
+
+const handleCancel = () => {
+    visible.value = false
+};
+
+defineExpose({ open })
+
+
+</script>

+ 24 - 1
src/views/lotCard/cardList/config.js

@@ -9,6 +9,29 @@ export const columns = [
   { title: window.$t('lotCard.source'), dataIndex: 'source', align: 'center', width:200 },
   { title: window.$t('lotCard.ExpireTime'), dataIndex: 'expire_time', align: 'center', width:200 },
   { title: window.$t('lotCard.UserId'), dataIndex: 'user_id', align: 'center', width:200 },
+  {
+    title: window.$t('global.common.operations'),
+    dataIndex: 'id',
+    slotName: 'id',
+    align: 'center',
+    width: 380,
+    fixed: "right",
+  }
+]
+
+
+export const dialogColumns = [
+  { title: window.$t('lotCard.cardHlrId'), dataIndex: 'cardHlrId', align: 'center', width:200   },
+  { title: window.$t('lotCard.cardHlrId'), dataIndex: 'cardHlrId', align: 'center', width:200   },
+  { title: window.$t('lotCard.CreateTime'), dataIndex: 'createTime', align: 'center', width:200 },
+  { title: window.$t('lotCard.lastModifyTime'), dataIndex: 'lastModifyTime', align: 'center', width:200 },
+  { title: window.$t('lotCard.ExpireTime'), dataIndex: 'expireTime', align: 'center', width:200 },
+  { title: window.$t('lotCard.himsi'), dataIndex: 'himsi', align: 'center', width:200 },
+  { title: window.$t('lotCard.iccid'), dataIndex: 'iccid', align: 'center', width:200 },
+  { title: window.$t('lotCard.msisdn'), dataIndex: 'msisdn', align: 'center', width:200 },
+  { title: window.$t('lotCard.realRuleListName'), dataIndex: 'realRuleListName', align: 'center', width:200 },
+  { title: window.$t('lotCard.serviceUsageMode'), dataIndex: 'serviceUsageMode', align: 'center', width:200 },
+  { title: window.$t('lotCard.statusSim'), dataIndex: 'status', align: 'center', width:200 },
   {
     title: window.$t('global.common.operations'),
     dataIndex: 'id',
@@ -17,4 +40,4 @@ export const columns = [
     width: 180,
     fixed: "right",
   }
-]
+]

+ 105 - 63
src/views/lotCard/cardList/index.vue

@@ -1,109 +1,151 @@
 <template>
-    <div class="container">
-        <div class="head-title">
-          <span>{{  route.meta.title }} </span>
-      </div>
-      <!-- 搜索条件区 -->
+  <div class="container">
+    <div class="head-title">
+      <span>{{ route.meta.title }} </span>
+      <a-button type="primary" @click="handleDialog({})">查看卡</a-button>
+      <a-button type="primary" @click="handleIssuedDialog({})">下发用户</a-button>
+    </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-input v-model="searchForm.iccid" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')" 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')" allow-clear />
+          <a-input v-model="searchForm.cardNumber" :placeholder="$t('lotCard.please') + $t('lotCard.himsi')"
+            allow-clear />
         </a-form-item>
         <a-form-item>
           <a-space>
-            <a-button type="primary" @click="handleSearch">{{$t('form.Search')}}</a-button>
-            <a-button @click="resetSearch">{{$t('form.Reset')}}</a-button>
+            <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
+            <a-button @click="resetSearch">{{ $t('form.Reset') }}</a-button>
           </a-space>
         </a-form-item>
       </a-form>
     </div>
-        
-      <a-table  :data="dataSource" :columns="columns" :pagination="pagination"  :scroll="{ x: 'auto' }" > 
-        <template #id="{ record }">
-          <!-- <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="evEdit(record)">编辑</a>
-          <a-popconfirm content="确认删除该信息?" ok-text="确定" cancel-text="取消" @ok="evDelete(record.id)">
-            <a href="javascript:;" class="a-link">删除</a>
-          </a-popconfirm> -->
-        </template>
-
-      </a-table>
+
+    <a-table row-key="iccid" :data="dataSource" :columns="columns" :pagination="pagination"
+      :row-selection="rowSelection" v-model:selectedKeys="selectedKeys" :scroll="{ x: 'auto' }">
+      <template #id="{ record }">
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handleDialog(record)">查看卡</a>
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handleOrderDialog(record)">订购套餐</a>
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handleIssuedDialog(record)">下发用户</a>
+      </template>
+
+    </a-table>
+    <cardDialog ref="dialogRef" />
+    <!-- 下发用户 -->
+    <issuedDialog ref="issuedDialogRef" />
+    <!-- 下发用户 -->
+    <orderDialog ref="orderDialogRef" />
   </div>
-  </template>
-  
-  <script setup>
-  import { onMounted, ref, h } from "vue";
-  import { useRoute } from "vue-router";
-  import { columns } from "./config";
-  import { Message, Notification } from '@arco-design/web-vue'
-  import { cardInfoList } from "@/api/path/lotCard.api"
-  const searchForm = ref({
-    "iccid": "",
-    "imsi" : "",
-  });
-
-  const dataSource = ref([]);
-  const route = useRoute();
-  const pagination = ref({
+</template>
+
+<script setup>
+import { onMounted, ref, reactive } from "vue";
+import { useRoute } from "vue-router";
+import { columns } from "./config";
+import { Message, Notification } from '@arco-design/web-vue'
+import { cardInfoList } from "@/api/path/lotCard.api"
+import cardDialog from "./cardDialog.vue";
+import issuedDialog from "./issuedDialog.vue";
+import orderDialog from "./orderDialog.vue";
+const searchForm = ref({
+  "iccid": "",
+  "imsi": "",
+});
+
+const dataSource = ref([]);
+const route = useRoute();
+const pagination = ref({
   total: 0,
   pageSize: 10,
   current: 1,
-})  
+})
+
+const rowSelection = reactive({
+  type: 'checkbox',
+  showCheckedAll: true,
+  onlyCurrent: false,
+});
+const selectedKeys = ref([])
+
+const dialogRef = ref()
+const issuedDialogRef = ref()
+const orderDialogRef = ref()
 
 const cardStatusOptions = [
   { label: '正常', value: 'normal' },
   { label: '停机', value: 'suspended' },
 ];
-  
-  const intData = async () => {
+
+const intData = async () => {
   const param = {
-    current:  pagination.value.current,
-    size:  pagination.value.pageSize,
+    current: pagination.value.current,
+    size: pagination.value.pageSize,
     ...searchForm.value,
   }
   const { data } = await cardInfoList(param)
-  dataSource.value = data.records ||[]
+  dataSource.value = data.records || []
   pagination.value.total = data.total
 }
 
+const handleDialog = (data) => {
+  if (selectedKeys.value.length > 0) {
+    dialogRef.value.open(selectedKeys.value)
+    return
+  }
+  dialogRef.value.open([data.iccid])
+};
+
+const handleIssuedDialog = (data) => {
+  if (selectedKeys.value.length > 0) {
+    issuedDialogRef.value.open(selectedKeys.value)
+    return
+  }
+  issuedDialogRef.value.open([data.iccid])
+}
+
+const handleOrderDialog = (data) => {
+  orderDialogRef.value.open(data)
+}
+
 const handleSearch = () => {
 }
 const resetSearch = () => {
- 
+
 }
-  
+
 onMounted(() => {
   intData()
 })
-  </script>
-  
-  <style scoped lang="less">
+</script>
 
+<style scoped lang="less">
 .search-section {
   margin-top: 20px;
   margin-bottom: 20px;
 }
 
-  .container {
-    .head-title {
-      display: flex;
-      justify-content: space-between;
-    }
-    .form-row {
+.container {
+  .head-title {
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .form-row {
+    display: flex;
+
+    .form-row-col {
+      width: 25%;
       display: flex;
-      .form-row-col{
-          width: 25%;
-          display: flex;
-          align-items: center;        
-          .form-row-label{
-              width: 120px;
-              text-align: right;
-          }
+      align-items: center;
+
+      .form-row-label {
+        width: 120px;
+        text-align: right;
       }
     }
   }
-  
-  </style>
-  
+}
+</style>

+ 144 - 0
src/views/lotCard/cardList/issuedDialog.vue

@@ -0,0 +1,144 @@
+<template>
+    <a-modal width="70%" :visible="visible" :title="$t('lotCard.titleIssued')" :hide-cancel='true' ok-text="关闭"
+        @ok="handleSubmit" @cancel="handleCancel">
+        <!-- 搜索条件区 -->
+        <div class="search-section">
+            <a-form :model="formData" layout="inline">
+                <a-form-item field="iccid" label="ICCID">
+                    <a-input v-model="formData.iccid" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')"
+                        allow-clear />
+                </a-form-item>
+                <a-form-item field="hImsi" label="HIMSI">
+                    <a-input v-model="formData.cardNumber" :placeholder="$t('lotCard.please') + $t('lotCard.himsi')"
+                        allow-clear />
+                </a-form-item>
+                <a-form-item>
+                    <a-space>
+                        <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
+                        <a-button @click="resetSearch">{{ $t('form.Reset') }}</a-button>
+                    </a-space>
+                </a-form-item>
+            </a-form>
+        </div>
+        <a-table :data="dataSource" :columns="columns" :scroll="{ x: 'auto' }" @page-change="evChangePage"
+            @page-size-change="evChangePageSize">
+            <template #roleList="{ record }">
+                <a-tag v-for="item in record.roleList" :key="item.id" style="margin:0 0 2px 4px;">{{ item.name
+                    }}</a-tag>
+            </template>
+            <template #state="{ record }">
+                <a-switch v-model="record.state" disabled style="pointer-events: none" checked-value="1"
+                    unchecked-value="0" />
+            </template>
+            <template #id="{ record }">
+                <a-popconfirm content="确认下发用户?" ok-text="确定" cancel-text="取消" @ok="evIssuedDialog(record.id)">
+                    <a href="javascript:;" class="a-link">下发用户</a>
+                </a-popconfirm>
+            </template>
+
+        </a-table>
+    </a-modal>
+</template>
+<script setup>
+import { onMounted, ref, h } from "vue";
+import { columns } from "../../system/user/config";
+import { Message, Notification } from '@arco-design/web-vue'
+import { userList, systemFindRoleList } from '@/api/path/system.api'
+import { cardIssue } from '@/api/path/lotCard.api'
+
+
+const props = defineProps({
+});
+
+const emit = defineEmits(['submit']);
+
+const formRef = ref(null);
+const formData = ref({
+    "iccid": "",
+    "imsi": "454120387374989",
+});
+const tableList = ref([])
+
+const dataSource = ref([]);
+const pagination = ref({
+    total: 0,
+    pageSize: 10,
+    current: 1,
+})
+
+const visible = ref(false)
+
+const open = (data) => {
+    if (data.length == 0) {
+        return
+    }
+    visible.value = true
+    tableList.value = data
+    intData()
+}
+
+const intData = async () => {
+    const param = {
+        current: pagination.value.current,
+        size: pagination.value.pageSize,
+        ...formData.value
+    }
+    const { data } = await userList(param)
+    const { data: roleList } = await systemFindRoleList({})
+    dataSource.value = (data.records || []).map(item => {
+        item.roleList = roleList.filter(cItem => {
+            return item.roleIds.includes(cItem.id)
+        })
+        return item
+    })
+    pagination.value.total = data.total
+}
+
+const evChangePage = (page) => {
+    pagination.value.current = page
+}
+
+const evChangePageSize = (pageSize) => {
+    pagination.value.pageSize = pageSize
+}
+
+
+
+const resetSearch = () => {
+
+}
+
+const handleSearch = () => {
+}
+
+const handleSubmit = () => {
+    emit('submit', { ...formData });
+    visible.value = false
+};
+
+const handleCancel = () => {
+    visible.value = false
+};
+
+// 下发用户
+const evIssuedDialog = async (issueUserId) => {
+    const param = {
+        issueUserId,
+        iccid: tableList.value
+    }
+    const { code, data } = await cardIssue(param)
+    if (code == 200) {
+        Message.success({
+            content: data,
+            duration: 2000,
+        })
+    }
+};
+
+
+
+
+defineExpose({ open })
+
+
+</script>

+ 142 - 0
src/views/lotCard/cardList/orderDialog.vue

@@ -0,0 +1,142 @@
+<template>
+    <a-modal width="70%" :visible="visible" :title="$t('lotCard.titleOrder')" :hide-cancel='true' ok-text="关闭"
+        @ok="handleSubmit" @cancel="handleCancel">
+        <!-- 搜索条件区 -->
+        <div class="search-section">
+            <a-form :model="formData" layout="inline">
+                <a-form-item field="iccid" label="ICCID">
+                    <a-input v-model="formData.iccid" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')"
+                        allow-clear />
+                </a-form-item>
+                <a-form-item field="hImsi" label="HIMSI">
+                    <a-input v-model="formData.cardNumber" :placeholder="$t('lotCard.please') + $t('lotCard.himsi')"
+                        allow-clear />
+                </a-form-item>
+                <a-form-item>
+                    <a-space>
+                        <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
+                        <a-button @click="resetSearch">{{ $t('form.Reset') }}</a-button>
+                    </a-space>
+                </a-form-item>
+            </a-form>
+        </div>
+        <a-table :data="dataSource" :columns="columns" :scroll="{ x: 'auto' }" @page-change="evChangePage"
+            @page-size-change="evChangePageSize">
+            <template #roleList="{ record }">
+                <a-tag v-for="item in record.roleList" :key="item.id" style="margin:0 0 2px 4px;">{{ item.name
+                    }}</a-tag>
+            </template>
+            <template #state="{ record }">
+                <a-switch v-model="record.state" disabled style="pointer-events: none" checked-value="1"
+                    unchecked-value="0" />
+            </template>
+            <template #id="{ record }">
+                <a-popconfirm content="确认下发用户?" ok-text="确定" cancel-text="取消" @ok="evOrderDialog(record)">
+                    <a href="javascript:;" class="a-link">{{ $t('lotCard.titleOrder') }}</a>
+                </a-popconfirm>
+            </template>
+
+        </a-table>
+    </a-modal>
+</template>
+<script setup>
+import { onMounted, ref, h } from "vue";
+import { columns } from "../trafficList/config";
+import { Message, Notification } from '@arco-design/web-vue'
+import { packageInfo, orderSync } from '@/api/path/lotCard.api'
+
+
+const props = defineProps({
+});
+
+const emit = defineEmits(['submit']);
+
+const formRef = ref(null);
+const formData = ref({
+    "iccid": "",
+    "imsi": "454120387374989",
+});
+const tableObj = ref({})
+
+const dataSource = ref([]);
+const pagination = ref({
+    total: 0,
+    pageSize: 10,
+    current: 1,
+})
+
+const visible = ref(false)
+
+const open = (data) => {
+    if (data.length == 0) {
+        return
+    }
+    visible.value = true
+    tableObj.value = data
+    intData()
+}
+
+const intData = async () => {
+    const param = {
+        current: pagination.value.current,
+        size: pagination.value.pageSize,
+        ...formData.value
+    }
+    const { data } = await packageInfo(param)
+    dataSource.value = data || []
+    pagination.value.total = dataSource.value.length
+}
+
+const evChangePage = (page) => {
+    pagination.value.current = page
+}
+
+const evChangePageSize = (pageSize) => {
+    pagination.value.pageSize = pageSize
+}
+
+
+
+const resetSearch = () => {
+
+}
+
+const handleSearch = () => {
+}
+
+const handleSubmit = () => {
+    emit('submit', { ...formData });
+    visible.value = false
+};
+
+const handleCancel = () => {
+    visible.value = false
+};
+
+// 下发用户
+const evOrderDialog = async (record) => {
+    const param = {
+        "includeCard": 1,
+        "is_Refuel": "1",//是否为附加包
+        refuelingId: "",//is_Refuel为0需要附加包
+        "dataBundleId": record.id,// 流量包id
+        "quantity": 1, // 采购数量
+        "ICCID": tableObj.value.iccid,
+        "sendLang": "3", // 发送购买短信语言
+    }
+    const { code, data } = await orderSync(param)
+    if (code == 200) {
+        Message.success({
+            content: message,
+            duration: 2000,
+        })
+    }
+};
+
+
+
+
+defineExpose({ open })
+
+
+</script>

+ 1 - 0
src/views/lotCard/packageMange/index.vue

@@ -27,6 +27,7 @@ const formData = ref({
   username: '',
   "iccid": "89852342022040149139",
   "hImsi": "454120387374989",
+  "language": "0",
 });
 
 const dataSource = ref([]);

+ 1 - 0
src/views/lotCard/trafficList/config.js

@@ -18,4 +18,5 @@ export const columns = [
     }
   ]
 
+
   

+ 50 - 7
src/views/lotCard/trafficList/index.vue

@@ -26,22 +26,24 @@
     <a-table :data="dataSource" :columns="columns" :pagination="pagination" :scroll="{ x: 'auto' }"
       @page-change="evChangePage" @page-size-change="evChangePageSize">
       <template #id="{ record }">
-        <!-- <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="evEdit(record)">编辑</a>
-          <a-popconfirm content="确认删除该信息?" ok-text="确定" cancel-text="取消" @ok="evDelete(record.id)">
-            <a href="javascript:;" class="a-link">删除</a>
-          </a-popconfirm> -->
+        <!-- <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>
+    <trafficDialog ref="dialogRef" />
   </div>
 </template>
 
 <script setup>
 import { onMounted, ref, h } from "vue";
 import { useRoute } from "vue-router";
-import { columns } from "../packageMange/config";
+import { columns } from "./config";
 import { Message, Notification } from '@arco-design/web-vue'
-import { packageInfo } from "@/api/path/lotCard.api"
+import { packageInfo, unsubscribe, release } from "@/api/path/lotCard.api"
+import trafficDialog from "./trafficDialog.vue";
 const searchForm = ref({
   "iccid": "",
   "imsi": "",
@@ -55,6 +57,8 @@ const pagination = ref({
   current: 1,
 })
 
+const dialogRef = ref()
+
 const cardStatusOptions = [
   { label: '正常', value: 'normal' },
   { label: '停机', value: 'suspended' },
@@ -81,12 +85,51 @@ const evChangePageSize = (pageSize) => {
 }
 
 const resetSearch = () => {
- 
+
 }
 
 const handleSearch = () => {
 }
 
+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(() => {
   intData()

+ 44 - 17
src/views/lotCard/trafficList/trafficForm.vue → src/views/lotCard/trafficList/trafficDialog.vue

@@ -1,5 +1,23 @@
 <template>
-  <a-modal :visible="visible" :title="$t('lotCard.titleTraffic')" @ok="handleSubmit" @cancel="handleCancel">
+  <a-modal :visible="visible" :title="$t('lotCard.titleSim')" @ok="handleSubmit" @cancel="handleCancel">
+    <!-- 搜索条件区 -->
+    <div class="search-section">
+      <a-form :model="formData" layout="inline">
+        <a-form-item field="iccid" label="ICCID">
+          <a-input v-model="formData.iccid" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')" allow-clear />
+        </a-form-item>
+        <a-form-item field="hImsi" label="HIMSI">
+          <a-input v-model="formData.cardNumber" :placeholder="$t('lotCard.please') + $t('lotCard.himsi')"
+            allow-clear />
+        </a-form-item>
+        <a-form-item>
+          <a-space>
+            <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
+            <a-button @click="resetSearch">{{ $t('form.Reset') }}</a-button>
+          </a-space>
+        </a-form-item>
+      </a-form>
+    </div>
     <a-table :data="dataSource" :columns="columns" :scroll="{ x: 'auto' }" @page-change="evChangePage"
       @page-size-change="evChangePageSize">
       <template #id="{ record }">
@@ -14,24 +32,20 @@
 </template>
 <script setup>
 import { onMounted, ref, h } from "vue";
-import { columns } from "./config";
+import { columns } from "../packageMange/config";
 import { Message, Notification } from '@arco-design/web-vue'
 import { simInfo } from "@/api/path/lotCard.api"
 
 const props = defineProps({
-  visible: {
-    type: Boolean,
-    required: true,
-  },
-  editMode: {
-    type: Boolean,
-    default: false,
-  },
 });
 
-const emit = defineEmits(['update:visible', 'submit']);
+const emit = defineEmits(['submit']);
 
 const formRef = ref(null);
+const formData = ref({
+  "iccid": "",
+  "imsi": "454120387374989",
+});
 
 const dataSource = ref([]);
 const pagination = ref({
@@ -40,13 +54,21 @@ const pagination = ref({
   current: 1,
 })
 
+const visible = ref(false)
+
+const open = (data = {}) => {
+  visible.value = true
+  formData.value.iccid = data.iccid
+  intData()
+}
+
 const intData = async () => {
   const param = {
     current: pagination.value.current,
     size: pagination.value.pageSize,
     ...formData.value,
   }
-  const { data } = await simInfo(param)
+  const { data } = await simInfo([param])
   dataSource.value = (data || []).map(item => {
     return {
       ...item,
@@ -65,16 +87,19 @@ const evChangePageSize = (pageSize) => {
 }
 
 
-onMounted(() => {
-  intData()
-})
 
+const resetSearch = () => {
+
+}
+
+const handleSearch = () => {
+}
 
 const handleSubmit = () => {
   formRef.value.validate((errors) => {
     if (!errors) {
       emit('submit', { ...formData });
-      emit('update:visible', false);
+      visible.value = false
     } else {
       console.error('Validation failed', errors);
     }
@@ -82,8 +107,10 @@ const handleSubmit = () => {
 };
 
 const handleCancel = () => {
-  emit('update:visible', false);
+  visible.value = false
 };
 
+defineExpose({ open })
+
 
 </script>