wxy 4 mesi fa
parent
commit
1e6a7edd77

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

@@ -26,7 +26,7 @@ export function cardIssue(param) {
 // ----------------------------订单管理---------------------------------
 // 订单管理
 export function orderList(param) {
-  return service.post("/admin/sim/orderList", param);
+  return service.post("/admin/sim/cardInfoUpdate", param);
 }
 
 

+ 21 - 15
src/views/lotCard/cardList/config.js

@@ -1,16 +1,22 @@
 export const columns = [
-  { title: window.$t('lotCard.iccid'), dataIndex: 'iccid', align: 'center', width: 200 },
-  { title: window.$t('lotCard.status'), dataIndex: 'statusName', align: 'center', width: 100 },
-  { title: window.$t('lotCard.created_at'), dataIndex: 'createdAt', align: 'center', width: 200 },
-  // { title: window.$t('lotCard.deleted_at'), dataIndex: 'deleted_at', align: 'center', width: 200 },
-  { title: window.$t('lotCard.updated_at'), dataIndex: 'updatedAt', align: 'center', width: 200 },
-  { title: window.$t('lotCard.msisdn'), dataIndex: 'msisdn', align: 'center', width: 200 },
-  { title: window.$t('lotCard.source'), dataIndex: 'sourceName', align: 'center', width: 200 },
-  { title: window.$t('lotCard.ExpireTime'), dataIndex: 'expireTime', align: 'center', width: 200 },
-  { title: window.$t('lotCard.UserId'), dataIndex: 'userId', align: 'center', width: 200 },
-  { title: window.$t('lotCard.tariff'), dataIndex: 'tariff', align: 'center', width: 200 },
-  { title: window.$t('lotCard.ServiceUsageMode'), dataIndex: 'serviceName', align: 'center', width: 200 },
-  { title: window.$t('lotCard.LastModifyTime'), dataIndex: 'lastModifyTime', align: 'center', width: 200 },
+  { title: window.$t('lotCard.iccid'), dataIndex: 'iccid', align: 'center',  ellipsis:true },
+  { title: window.$t('lotCard.source'), dataIndex: 'source', align: 'center',  ellipsis:true },
+  { title: 'IMSI', dataIndex: 'account', align: 'center', ellipsis:true},
+  { title: 'SIM绑定的IMSI', dataIndex: 'currentImsi', align: 'center', ellipsis:true  },
+  { title: 'SIM货币余额', dataIndex: 'moneyBalances', align: 'center', ellipsis:true  },
+  { title: 'SIM生成日期', dataIndex: 'createTime', align: 'center',  ellipsis:true },
+  { title: '支付方式', dataIndex: 'payType', align: 'center', ellipsis:true  },
+  { title: 'SIM状态', dataIndex: 'expireTime', align: 'center', ellipsis:true  },
+  { title: '已使用总流量', dataIndex: 'dataUsageTotal', align: 'center',  ellipsis:true },
+  { title: '语音呼入分钟数', dataIndex: 'voiceMtTotal', align: 'center', ellipsis:true  },
+  { title: '语音呼出分钟数', dataIndex: 'voiceMoTotal', align: 'center', ellipsis:true  },
+  { title: '总语音分钟数', dataIndex: 'voiceTotal', align: 'center',  ellipsis:true },
+  { title: '发短信数', dataIndex: 'smsTotal', align: 'center',  ellipsis:true },
+  { title: 'SIM有效期(月)', dataIndex: 'validMonth', align: 'center', ellipsis:true  },
+  { title: 'SIM关闭日期', dataIndex: 'closeTime', align: 'center', ellipsis:true  },
+  { title: 'SIM激活日期', dataIndex: 'activeTime', align: 'center',  ellipsis:true },
+  { title: 'IMSI所属供应商名称', dataIndex: 'currentImsiProvider', align: 'center',  ellipsis:true },
+  { title: '流量包', dataIndex: 'dataPackage', align: 'center',  ellipsis:true },
   {
     title: window.$t('global.common.operations'),
     dataIndex: 'id',
@@ -22,9 +28,9 @@ export const columns = [
 ]
 
 export const columnsTrafficUse = [
-  { title: window.$t('lotCard.appName'), dataIndex: 'appName', align: 'center', width: 200 },
+  { title: window.$t('lotCard.appName'), dataIndex: 'appName', align: 'center',   },
   { title: window.$t('lotCard.mcc'), dataIndex: 'mcc', align: 'center', width: 100 },
-  { title: window.$t('lotCard.qtaconsumption'), dataIndex: 'qtaconsumption', align: 'center', width: 200 },
-  { title: window.$t('lotCard.time'), dataIndex: 'time', align: 'center', width: 200 },
+  { title: window.$t('lotCard.qtaconsumption'), dataIndex: 'qtaconsumption', align: 'center',   },
+  { title: window.$t('lotCard.time'), dataIndex: 'time', align: 'center',   },
 ]
 

+ 35 - 75
src/views/lotCard/cardList/index.vue

@@ -5,7 +5,7 @@
       <span>{{ route.meta.title }} </span>
       <span class="head-title-right">
         <a-popconfirm :content="$t('form.ImportConfirm')" :ok-text="$t('form.Confirm')" :cancel-text="$t('form.Cancel')"
-                      @ok="handleImport()">
+          @ok="handleImport()">
           <!-- <a-button class="m-r-10" type="primary"> {{ $t('form.Import') }}</a-button> -->
         </a-popconfirm>
       </span>
@@ -15,27 +15,27 @@
     <div class="search-section">
       <a-form :model="searchForm" ref="formRef" layout="inline">
         <a-form-item field="iccid" :label="$t('lotCard.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="iccid" :label="$t('lotCard.iccidType')">
-          <a-select v-model="value" :style="{width:'240px'}" :placeholder="$t('lotCard.iccidTypeName')">
-            <a-option v-for="item of statusList" :value="item.id" :label="item.label"/>
+          <a-select v-model="value" :style="{ width: '240px' }" :placeholder="$t('lotCard.iccidTypeName')">
+            <a-option v-for="item of statusList" :value="item.id" :label="item.label" />
           </a-select>
         </a-form-item>
         <!--        来源-->
         <a-form-item field="iccid" :label="$t('lotCard.sourceCard')">
-          <a-select v-model="value" :style="{width:'240px'}" :placeholder="$t('lotCard.sourceCardType')">
-            <a-option v-for="item of sourceList" :value="item.id" :label="item.label"/>
+          <a-select v-model="value" :style="{ width: '240px' }" :placeholder="$t('lotCard.sourceCardType')">
+            <a-option v-for="item of sourceList" :value="item.id" :label="item.label" />
           </a-select>
         </a-form-item>
         <!--        创建时间-->
         <a-form-item field="iccid" :label="$t('lotCard.statrt_time')">
-          <a-date-picker style="width: 200px;" ::placeholder="$t('lotCard.statrt_timeType')"/>
+          <a-date-picker style="width: 200px;" ::placeholder="$t('lotCard.statrt_timeType')" />
         </a-form-item>
         <!--        更新时间-->
         <a-form-item field="iccid" :label="$t('lotCard.Renewal_time')">
-          <a-date-picker style="width: 200px;" ::placeholder="$t('lotCard.Renewal_timeType')"/>
+          <a-date-picker style="width: 200px;" ::placeholder="$t('lotCard.Renewal_timeType')" />
         </a-form-item>
         <a-form-item>
 
@@ -47,33 +47,29 @@
       </a-form>
     </div>
 
-    <a-table row-key="iccid" :data="dataSource" :columns="columns" :pagination="pagination"
-             :row-selection="rowSelection" v-model:selectedKeys="selectedKeys" :scroll="{ x: 'auto' }"
-             :expandable="expandable"
-             @page-change="evChangePage">
+    <a-table row-key="iccid" :data="dataSource" :columns="columns" :pagination="pagination" :scroll="{ x: 'auto' }"
+      :expandable="expandable" @page-change="evChangePage">
       <template #id="{ record }">
         <!-- 查看流量消耗 -->
-        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handletrafficUseDialog(record)">{{
-            $t('lotCard.trafficUse')
-          }}</a>
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handletrafficUseDialog(record)">详情</a>
       </template>
 
     </a-table>
     <!-- 查看流量消耗 -->
-    <trafficUseDialog ref="trafficUseDialogRef"/>
+    <trafficUseDialog ref="trafficUseDialogRef" />
   </div>
 </template>
 
 <script setup>
-import {onMounted, ref, reactive, getCurrentInstance, h} from "vue";
-import {useRoute} from "vue-router";
-import {columns} from "./config";
-import {Message, Notification} from '@arco-design/web-vue'
-import {cardInfoList, cardInfoImport, orderList, orderFlowData} from "@/api/path/lotCard.api"
+import { onMounted, ref, reactive, getCurrentInstance, h } from "vue";
+import { useRoute } from "vue-router";
+import { columns } from "./config";
+import { Message, Notification } from '@arco-design/web-vue'
+import { cardInfoList, cardInfoImport, orderList, orderFlowData } from "@/api/path/lotCard.api"
 import trafficUseDialog from "./trafficUseDialog.vue";
 import list from "./list.vue";
-import {Getdictionary} from '@/mixins/index.js'
-const {proxy} = getCurrentInstance()
+import { Getdictionary } from '@/mixins/index.js'
+const { proxy } = getCurrentInstance()
 const formRef = ref()
 const searchForm = ref({
   "iccid": "",
@@ -90,13 +86,6 @@ const pagination = ref({
   current: 1,
 })
 
-const rowSelection = reactive({
-  type: 'checkbox',
-  showCheckedAll: true,
-  onlyCurrent: false,
-});
-const selectedKeys = ref([])
-
 const trafficUseDialogRef = ref()
 
 
@@ -106,49 +95,21 @@ const intData = async () => {
     size: pagination.value.pageSize,
     ...searchForm.value,
   }
-  const {data} = await cardInfoList(param)
-  dataSource.value = (data.records || []).map((item) => {
-    // 卡下级信息
-    let orderArr = []
-    orderList({current: 1, size: 999, ICCID: item.iccid}).then(res => {
-
-      res.data.records?.forEach(async (orderItem, index) => {
-        // const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-        // const orderType = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
-        const params = {
-          iccid: orderItem.ICCID,
-          childOrderId: orderItem.id,
-          subscriptionKey: orderItem.subscription_key,
-        }
-
-        let trafficList = []
-
-        // if (item.iccid == '89852342022040149139' && index < 5 || !(item.iccid == '89852342022040149139')) {
-        //   const { data } = await orderFlowData(params)
-        //   trafficList = data.historyData || []
-        //   orderArr.push({
-        //     ...orderItem,
-        //     trafficList
-        //   })
-        // }
-        orderArr.push({
-          ...orderItem,
-        })
-      })
-    })
+  const { data } = await cardInfoList(param)
 
-    // 处理卡列表信息
-    const sourceName = sourceList.value.find(sourceItem => sourceItem.value == item.source)?.label || ''
-    const serviceName = serviceList.value.find(serviceItem => serviceItem.value == item.service_usage_mode)?.label || ''
-    const statusName = statusList.value.find(statusItem => statusItem.value == item.status)?.label || ''
+  const soureName = await Getdictionary('supplierSource')
+
+  dataSource.value = (data.records || []).map((item) => {
+    const payType = item.payType == 0 ? 'Prepay' : 'Postpay';
+    const dataPackage = item.Info.dataPackage.map(res => res.productName).join(',');
+    const soure = soureName.find(val => val.value == item.source)?.label
     return {
       ...item,
-      sourceName,
-      serviceName,
-      statusName,
-      orderArr
+      ...item.Info,
+      payType: payType,
+      dataPackage: dataPackage,
+      source: soure
     }
-
   })
   pagination.value.total = data.total
 }
@@ -179,7 +140,7 @@ const expandable = {
   expandedRowRender: (record) => {
     if (record.orderArr && Array.isArray(record.orderArr) && record.orderArr.length > 0) {
       return h('div', {}, [
-        h(list, {'data': record.orderArr})
+        h(list, { 'data': record.orderArr })
       ]);
     }
     return h('div', {}, '暂无数据')
@@ -200,7 +161,7 @@ const handleImport = async () => {
       iccid: item
     }
   })
-  const {code, data} = await cardInfoImport({iccidList})
+  const { code, data } = await cardInfoImport({ iccidList })
   if (code == 200) {
     Message.success({
       content: data,
@@ -213,8 +174,7 @@ const handleImport = async () => {
 
 // 查看当前流量消耗详情
 const handletrafficUseDialog = (data) => {
-  console.log(data.iccid, "data.iccid")
-  trafficUseDialogRef.value.open(data.iccid)
+  trafficUseDialogRef.value.open(data)
 }
 
 
@@ -234,8 +194,8 @@ const handleSearch = () => {
 // 获取字典
 const handleDictValue = async () => {
   sourceList.value = await Getdictionary('source')
-  statusList.value =  await Getdictionary('mainCardStatus')
-  serviceList.value =  await Getdictionary('activationPackageMethod')
+  statusList.value = await Getdictionary('mainCardStatus')
+  serviceList.value = await Getdictionary('activationPackageMethod')
 }
 
 const resetSearch = () => {

+ 114 - 153
src/views/lotCard/cardList/trafficUseDialog.vue

@@ -1,74 +1,117 @@
 <template>
-    <a-modal width="800px" :visible="visible" :title="$t('lotCard.trafficUse')" :hide-cancel='true'
-        :ok-text="$t('lotCard.close')" @ok="handleSubmit" @cancel="handleCancel">
-        <!-- 搜索条件区 -->
-        <!-- <div class="search-section">
-            <a-form :model="formData" ref="formRef" layout="inline">
-                <a-form-item field="iccid" :label="$t('lotCard.iccid')" :validate-trigger="['change', 'input', 'blur']"
-                    :rules="[{ required: true, message: $t('lotCard.please') + $t('lotCard.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="$t('lotCard.himsi')">
-                    <a-input v-model="formData.hImsi" :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="columnsTrafficUse" :scroll="{ x: 'auto' }" @page-change="evChangePage">
-        </a-table> -->
-
-        <!-- 订单列表-查看订单流量明细 -->
-        <div class="trafficUse">
-            <ul class="order_list_box">
-                <li class="list_box_item" v-for="(item, index) in dataSource" key="index">
-                    <div class="list_item_left"></div>
-                    <div class="list_item_right">
-                        <p>
-                            <span class="list_item_right_span">订单ID:{{ item.orderId }}</span>
-                            <span class="list_item_right_span">订单状态:正常</span>
-                            <span>更新时间:{{ item.updated_at }}</span>
-                        </p>
-                        <template v-if="item.trafficList">
-                            <p v-for="trafficVal in item.trafficList" :key="trafficVal.id">
-                                <span class="list_item_right_span"> 流量总量:{{ trafficVal.qtaconsumption }}</span>
-                                <span class="list_item_right_span">流量使用时间:{{ trafficVal.time }}</span>
-                                <span>国家:中国</span>
-                            </p>
-                        </template>
-
-                    </div>
-                </li>
-            </ul>
-        </div>
+    <a-modal width="60%" :visible="visible" :title="'卡详情' + Card_info.iccid" :hide-cancel='true'
+        :ok-text="$t('lotCard.close')" @ok="handleSubmit" @cancel="handleCancel" >
+        <!-- 卡片信息 -->
+        <a-row class="grid-demo" :gutter="24">
+            <a-col :span="12">
+                <a-form :model="Card_info" auto-label-width label-align="left" class="toal_Form">
+                    <a-row :gutter="10">
+                        <a-col :span="12">
+                            <a-form-item  label="ICCID" >
+                                {{ Card_info.iccid }}
+                            </a-form-item>
+                        </a-col>
+                        
+                        <a-col :span="12">
+                            <a-form-item  label="IMSI" >
+                                {{ Card_info.account }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="SIM绑定的IMSI" >
+                                {{ Card_info.currentImsi }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="SIM货币余额" >
+                                {{ Card_info.moneyBalances }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="激活日期" >
+                                {{ Card_info.activeTime }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="到期日期" >
+                                {{ Card_info.closeTime }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="有效期" >
+                                {{ Card_info.validMonth }}月
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="供应商" >
+                                {{ Card_info.currentImsiProvider }}
+                            </a-form-item>
+                        </a-col>
+                    </a-row>
+                </a-form>
+                <p>当前套餐信息</p>
+                <a-form :model="Card_info" auto-label-width label-align="left" class="toal_Form">
+                    <a-row :gutter="10">
+                        <a-col :span="12">
+                            <a-form-item  label="套餐名称" >
+                                {{ Card_info.iccid }}
+                            </a-form-item>
+                        </a-col>
+                        
+                        <a-col :span="12">
+                            <a-form-item  label="IMSI" >
+                                {{ Card_info.account }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="SIM绑定的IMSI" >
+                                {{ Card_info.currentImsi }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="SIM货币余额" >
+                                {{ Card_info.moneyBalances }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="激活日期" >
+                                {{ Card_info.activeTime }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="到期日期" >
+                                {{ Card_info.closeTime }}
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="有效期" >
+                                {{ Card_info.validMonth }}月
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">
+                            <a-form-item  label="供应商" >
+                                {{ Card_info.currentImsiProvider }}
+                            </a-form-item>
+                        </a-col>
+                    </a-row>
+                </a-form>
+            </a-col>
+            <a-col :span="12">
+                <div>col - 12</div>
+            </a-col>
+        </a-row>
     </a-modal>
 </template>
 <script setup>
 import { onMounted, ref, getCurrentInstance } from "vue";
-import { columnsTrafficUse } from "./config";
-import { Message, Notification } from '@arco-design/web-vue'
 import { orderFlowData, orderList } from '@/api/path/lotCard.api'
-
+import { Getdictionary } from '@/mixins/index.js'
 
 const props = defineProps({
 });
 
 const emit = defineEmits(['submit']);
-
-const { proxy } = getCurrentInstance()
-const formRef = ref()
-const formData = ref({
-    "iccid": "",
-    "imsi": "454120387374989",
-});
-const ICCID = ref({})
-
+const Card_info = ref({})
 const dataSource = ref([]);
 const pagination = ref({
     total: 0,
@@ -83,56 +126,22 @@ const open = (data) => {
         return
     }
     dataSource.value = []
-    ICCID.value = data
+    Card_info.value = {...data,...data.Info,...data.Info.dataPackage}
+    delete Card_info.value.Info
+    console.log(Card_info.value);
+    
     intData()
-
+    visible.value = true
 }
 
 const intData = async () => {
 
-    const { data: orderData } = await orderList({ current: 1, size: 999, ICCID: ICCID.value })
-    orderData.records?.forEach(async (orderItem) => {
-
-        const params = {
-            // iccid: orderItem.ICCID,
-            iccid: '89852342022040149139',
-            childOrderId: orderItem.id,
-            subscriptionKey: "1824754463183432097",
-        }
-
-        let trafficList = []
-        const { data } = await orderFlowData(params)
-        trafficList = data.historyData || []
-
-        dataSource.value.push({
-            ...orderItem,
-            trafficList
-        })
-    })
-    console.log(dataSource.value, "dataSource.value")
-    visible.value = true
 }
 
 const evChangePage = (page) => {
     pagination.value.current = page
 }
 
-
-
-
-
-const resetSearch = () => {
-    proxy.$refs.formRef.resetFields()
-}
-
-const handleSearch = () => {
-    formRef.value.validate((errors) => {
-        if (!errors) {
-            intData()
-        }
-    });
-}
-
 const handleSubmit = () => {
     emit('submit', { ...formData });
     visible.value = false
@@ -142,65 +151,17 @@ const handleCancel = () => {
     visible.value = false
 };
 
-
-
 defineExpose({ open })
 
-
 </script>
 
 <style scoped lang="less">
-ul,
-li,
-p,
-span {
-    margin: 0;
-    padding: 0;
-    line-height: 1.5;
-}
-
-
-.order_list_box {
-    list-style: none;
-    height: 700px;
-    overflow-y: scroll;
-    margin: auto;
-    padding: 0 20px;
+.toal_Form{
+    padding-bottom: 10px;
+    border-bottom: 1px solid #ccc ;
 }
-
-.list_box_item {
-    display: flex;
-    align-items: center;
-    margin-bottom: 10px;
-
-    .list_item_left {
-        width: 50px;
-        height: 50px;
-        background: gainsboro;
-        margin-right: 10px;
-    }
-
-    .list_item_right {
-        p {
-            display: flex;
-            align-items: center;
-            margin: 5px 0;
-        }
-
-        span {
-            display: flex;
-            align-items: center;
-
-        }
-
-        .list_item_right_span::after {
-            content: "";
-            display: inline-block;
-            width: 1px;
-            height: 20px;
-            background-color: gray;
-            margin: 0 10px;
-        }
-    }
+p{
+    font-size: 20px;
+    color: black;
 }
 </style>

+ 24 - 21
src/views/supplier/trafficList/config.js

@@ -1,26 +1,29 @@
 export const columns = [
   { title: window.$t('dataPackage.id'), dataIndex: 'id', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.superiorId'), dataIndex: 'superiorId', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.typePackage'), dataIndex: 'typePackage', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.statusPackage'), dataIndex: 'statusPackage', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.period'), dataIndex: 'periodName', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.periodType'), dataIndex: 'periodTypeName', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.lastModifyTime'), dataIndex: 'lastModifyTime', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.activationMode'), dataIndex: 'activationModeName', align: 'center', width: 300 },
-  { title: window.$t('dataPackage.packageCode'), dataIndex: 'packageCode', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.packageName'), dataIndex: 'packageName', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.operatorName'), dataIndex: 'sourceName', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.packageSize'), dataIndex: 'packageSize', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.standardPrice'), dataIndex: 'standardPrice', align: 'center', width: 200 },
-  // { title: window.$t('dataPackage.statusName'), dataIndex: 'statusName', align: 'center', width: 200 },
-  {
-    title: window.$t('global.common.operations'),
-    dataIndex: 'id',
-    slotName: 'id',
-    align: 'center',
-    width: 180,
-    fixed: "right",
-  }
+  { title: '来源', dataIndex: 'source', align: 'center', width: 200 },
+  { title: '流量包名称', dataIndex: 'productName', align: 'center', width: 200 },
+  { title: '地区名称', dataIndex: 'dataZoneName', align: 'center', width: 200 },
+  { title: '套餐有效天数', dataIndex: 'validDays', align: 'center', width: 200 },
+  { title: '套餐可用流量', dataIndex: 'total', align: 'center', width: 200 },
+  { title: '语音呼入流量', dataIndex: 'voiceMt', align: 'center', width: 200 },
+  { title: '语音呼出流量', dataIndex: 'voiceMo', align: 'center', width: 300 },
+  { title: '短信总条数', dataIndex: 'smsTotal', align: 'center', width: 200 },
+  { title: '默认限速', dataIndex: 'dataSpeedDefault', align: 'center', width: 200 },
+  { title: '单词请求可用流量', dataIndex: 'dataQuota', align: 'center', width: 200 },
+  { title:'有效期类型', dataIndex: 'validDayType', align: 'center', width: 200 },
+  { title: '费率组名称', dataIndex: 'rateGroupName', align: 'center', width: 200 },
+  { title: '语音呼出地区名称', dataIndex: 'zoneVoiceMtName', align: 'center', width: 200 },
+  { title: '语音呼入地区名称', dataIndex: 'zoneVoiceMoName', align: 'center', width: 200 },
+  { title: '流量使用地区名称', dataIndex: 'zoneDataName', align: 'center', width: 200 },
+  { title: '短信使用地区名称', dataIndex: 'zoneSmsName', align: 'center', width: 200 },
+  // {
+  //   title: window.$t('global.common.operations'),
+  //   dataIndex: 'id',
+  //   slotName: 'id',
+  //   align: 'center',
+  //   width: 180,
+  //   fixed: "right",
+  // }
 ]
 
 

+ 80 - 119
src/views/supplier/trafficList/index.vue

@@ -23,55 +23,51 @@
         </a-form-item>
       </a-form>
     </div> -->
-    <div class="audit-btn">
+    <!-- <div class="audit-btn">
       <a-button @click="showNewDataPackageForm" type="text">
         <template #icon>
           <icon-plus-circle/>
         </template>
-        <template #default>{{ $t('form.Add') }}</template>
-      </a-button>
-    </div>
+<template #default>{{ $t('form.Add') }}</template>
+</a-button>
+</div> -->
 
     <a-table :data="dataSource" :columns="columns" :pagination="pagination" :scroll="{ x: 'auto' }"
-             @page-change="evChangePage">
+      @page-change="evChangePage">
       <template #id="{ record }">
-        <a-button type="text" size="small" @click="handleEdit(record)">{{ $t('global.common.edit') }}</a-button>
-        <a-button type="text" size="small" @click="handleDelete(record)">{{ $t('global.common.delete') }}</a-button>
-
-
+        <!-- <a-button type="text" size="small" @click="handleEdit(record)">{{ $t('global.common.edit') }}</a-button>
+        <a-button type="text" size="small" @click="handleDelete(record)">{{ $t('global.common.delete') }}</a-button> -->
       </template>
-
     </a-table>
 
 
-    <new-data-package-form v-model:visible="newDataPackageFormVisible" :editMode="editMode" :editData="editData"
-                           @submit="handleNewDataPackageSubmit"/>
+    <!-- <new-data-package-form v-model:visible="newDataPackageFormVisible" :editMode="editMode" :editData="editData"
+                           @submit="handleNewDataPackageSubmit"/> -->
   </div>
 </template>
 
 <script setup>
-import {onMounted, ref, getCurrentInstance} from "vue";
-import {useRoute} from "vue-router";
-import {columns} from "./config";
-import {Message, Notification} from '@arco-design/web-vue'
-import {getDataPlanList} from "@/api/path/lotCard.api"
+import { onMounted, ref, getCurrentInstance } from "vue";
+import { useRoute } from "vue-router";
+import { columns } from "./config";
+import { Message, Notification } from '@arco-design/web-vue'
+import { getDataPlanList } from "@/api/path/lotCard.api"
 import NewDataPackageForm from './NewDataPackageForm.vue';
-import {useI18n} from 'vue-i18n';
-import {enum_dict} from "@/hooks/enum";
-import {Getdictionary} from '@/mixins/index.js'
-
+import { useI18n } from 'vue-i18n';
+import { enum_dict } from "@/hooks/enum";
+import { Getdictionary } from '@/mixins/index.js'
 
-const {t} = useI18n();
-const {proxy} = getCurrentInstance()
-const formRef = ref()
+const { t } = useI18n();
+const { proxy } = getCurrentInstance()
+// const formRef = ref()
 const searchForm = ref({
   "status": "",
   "periodType": "",
 });
 
-const sourceList = ref([]);
-const statusList = ref([]);
-const typeList = ref([]);
+// const sourceList = ref([]);
+// const statusList = ref([]);
+// const typeList = ref([]);
 const dataSource = ref([]);
 const route = useRoute();
 const pagination = ref({
@@ -80,54 +76,21 @@ const pagination = ref({
   current: 1,
 })
 
-// 运营商
-const operatorTypeOptions = [
-  {value: '1', label: t('dataPackage.operatorTypes.chinamobile')},
-  {value: '2', label: t('dataPackage.operatorTypes.chinaunicom')},
-  {value: '3', label: t('dataPackage.operatorTypes.chinatelecom')},
-  {value: '4', label: t('dataPackage.operatorTypes.international')},
-  {value: '5', label: t('dataPackage.operatorTypes.foreign_local')},
-];
-
-
 const intData = async () => {
   const param = {
     current: pagination.value.current,
     size: pagination.value.pageSize,
     ...searchForm.value,
   }
-  const {data} = await getDataPlanList(param)
-  const one = await Getdictionary('flowPeriod')
-  const two = await Getdictionary('cycleType')
-  const tree = await Getdictionary('activateMethod')
+  const { data } = await getDataPlanList(param)
+  const soureName = await Getdictionary('supplierSource')
   dataSource.value = (data?.records || []).map((item, index) => {
-
-    const periodName = (one.filter((dicVal) => dicVal.typeKey == 'flowPeriod') || []).find(val => val.value == item.period)?.label
-    const periodTypeName = (two.filter((dicVal) => dicVal.typeKey == 'cycleType') || []).find(val => val.value == item.period_type)?.label
-    const activationModeName = (tree.filter((dicVal) => dicVal.typeKey == 'activateMethod') || []).find(val => val.value == item.activation_mode)?.label
-
-
-    const sourceName = sourceList.value.find(val => val.value == item.source)?.label
-    const typePackage = typeList.value.find(val => val.value == item.type)?.label
-    const statusPackage = statusList.value.find(val => val.value == item.status)?.label
+    const soure = soureName.find(val => val.value == item.source)?.label
+    const total = item.dataTotal == -1 ? '无限流量' : item.dataTotal + "MB"
     return {
       ...item,
-      packageCode: "NR0" + (index + 1),
-      packageName: '监控1G月租',
-      providerName: '泰国AIS',
-      packageType: '定向',
-      billingType: '流量',
-      billingPeriod: '按月',
-      packageSize: '1',
-      packageUnit: 'G',
-      standardPrice: '150',
-      typePackage,
-      sourceName,
-      statusPackage,
-      periodName,
-      activationModeName,
-      periodTypeName
-
+      total: total,
+      source: soure
     }
   })
   pagination.value.total = data.total
@@ -139,64 +102,62 @@ const evChangePage = (page) => {
   intData()
 }
 
+// const resetSearch = () => {
+//   proxy.$refs.formRef.resetFields()
+//   intData()
+// }
 
-const resetSearch = () => {
-  proxy.$refs.formRef.resetFields()
-  intData()
-}
-
-const handleSearch = () => {
-  intData()
-}
-
+// const handleSearch = () => {
+//   intData()
+// }
 
-// 弹窗-----------------------------------------------------
-// const showModel = ref(false)
-// const handleModal = () => {
-//   showModel.value = true
+// // 弹窗-----------------------------------------------------
+// // const showModel = ref(false)
+// // const handleModal = () => {
+// //   showModel.value = true
+// // }
+// const newDataPackageFormVisible = ref(false);
+// const editMode = ref(false);
+// const editData = ref(null);
+
+
+// const showNewDataPackageForm = () => {
+//   editMode.value = false;
+//   editData.value = null;
+//   newDataPackageFormVisible.value = true;
+// };
+// const handleEdit = (record) => {
+//   editMode.value = true;
+//   record.packageSize = Number(record.packageSize)
+//   record.standardPrice = Number(record.standardPrice)
+//   editData.value = {...record};
+//   newDataPackageFormVisible.value = true;
+// };
+// const handleDelete = (record) => {
+//   // Implement delete logic
+//   Message.success(t('dataPackage.packageDeleted', {name: record.packageName}));
+// };
+
+// const handleNewDataPackageSubmit = (formData) => {
+//   if (editMode.value) {
+//     // Implement update logic
+//     Message.success(t('dataPackage.packageUpdated', {name: formData.packageName}));
+//   } else {
+//     // Implement add logic
+//     Message.success(t('dataPackage.packageAdded', {name: formData.packageName}));
+//   }
+//   newDataPackageFormVisible.value = false;
+// };
+// // -----------------------------------------------------
+// // 获取字典
+// const handleDictValue = async () => {
+//   sourceList.value = await Getdictionary('source')
+//   statusList.value = await Getdictionary('trafficPacketStatus')
+//   typeList.value = await Getdictionary('trafficUsageType')
 // }
-const newDataPackageFormVisible = ref(false);
-const editMode = ref(false);
-const editData = ref(null);
-
-
-const showNewDataPackageForm = () => {
-  editMode.value = false;
-  editData.value = null;
-  newDataPackageFormVisible.value = true;
-};
-const handleEdit = (record) => {
-  editMode.value = true;
-  record.packageSize = Number(record.packageSize)
-  record.standardPrice = Number(record.standardPrice)
-  editData.value = {...record};
-  newDataPackageFormVisible.value = true;
-};
-const handleDelete = (record) => {
-  // Implement delete logic
-  Message.success(t('dataPackage.packageDeleted', {name: record.packageName}));
-};
-
-const handleNewDataPackageSubmit = (formData) => {
-  if (editMode.value) {
-    // Implement update logic
-    Message.success(t('dataPackage.packageUpdated', {name: formData.packageName}));
-  } else {
-    // Implement add logic
-    Message.success(t('dataPackage.packageAdded', {name: formData.packageName}));
-  }
-  newDataPackageFormVisible.value = false;
-};
-// -----------------------------------------------------
-// 获取字典
-const handleDictValue = async () => {
-  sourceList.value = await Getdictionary('source')
-  statusList.value = await Getdictionary('trafficPacketStatus')
-  typeList.value = await Getdictionary('trafficUsageType')
-}
 
 onMounted(() => {
-  handleDictValue()
+  // handleDictValue()
   intData()
 })
 </script>

+ 26 - 28
src/views/system/dict/index.vue

@@ -3,8 +3,8 @@
     <div class="head-title">
       <span> 字典管理 </span>
       <div class="form-row">
-        <a-input v-model="formData.typeLabel" style="margin: 0 0.6rem" placeholder="请输入字典名称"/>
-        <a-input v-model="formData.typeKey" style="margin: 0 0.6rem" placeholder="请输入字典类型"/>
+        <a-input v-model="formData.typeLabel" style="margin: 0 0.6rem" placeholder="请输入字典名称" />
+        <a-input v-model="formData.typeKey" style="margin: 0 0.6rem" placeholder="请输入字典类型" />
         <a-button type="primary" style="margin: 0 0.6rem" @click="intData">查询</a-button>
         <a-button style="margin: 0 0.6rem 0 0" @click="resetSelectData">重置</a-button>
         <a-button type="primary" @click="dictShowModel(1, null)">添加字典</a-button>
@@ -12,11 +12,10 @@
     </div>
 
     <a-table :data="dataSource" row-key="typeKey" :columns="columns" :scroll="{ x: 'auto' }" :pagination="pageData"
-             @page-change="evChangePage" @expanded-change="expandTableIds">
+      @page-change="evChangePage" @expanded-change="expandTableIds">
       <template #operation="{ record }">
         <a class="a-link" href="javascript:;" style="margin: 0 1rem;" @click="dictShowModel(2, record)">修改</a>
-        <a-popconfirm :content="`是否确认删除字典编号为 ${record.id} 的数据项?`" @ok="deleteChange(record.id)"
-                      type="warning">
+        <a-popconfirm :content="`是否确认删除字典编号为 ${record.id} 的数据项?`" @ok="deleteChange(record.id)" type="warning">
           <a class="a-link" href="javascript:;" style="color: red;">删除</a>
         </a-popconfirm>
 
@@ -24,24 +23,23 @@
     </a-table>
 
     <!-- 弹框 -->
-    <a-modal :title="typeCurrent == 1 ? '添加字典' : '修改字典'" v-model:visible="visible" @onCancel="resetForm"
-             centered
-             :maskClosable="false" :footer="null">
+    <a-modal :title="typeCurrent == 1 ? '添加字典' : '修改字典'" v-model:visible="visible" @onCancel="resetForm" centered
+      :maskClosable="false" :footer="null">
       <a-form ref="formRef" :rules="rules" :model="formState" @submit="handleSubmit">
         <a-form-item label="字典名称" field="typeLabel">
-          <a-input v-model="formState.typeLabel"/>
+          <a-input v-model="formState.typeLabel" />
         </a-form-item>
         <a-form-item label="字典类型" field="typeKey">
-          <a-input v-model="formState.typeKey"/>
+          <a-input v-model="formState.typeKey" />
         </a-form-item>
         <a-form-item label="数据标签" field="label">
-          <a-input v-model="formState.label"/>
+          <a-input v-model="formState.label" />
         </a-form-item>
         <a-form-item label="数据键值" field="value">
-          <a-input v-model="formState.value"/>
+          <a-input v-model="formState.value" />
         </a-form-item>
         <a-form-item label="备注" field="remark">
-          <a-textarea v-model="formState.remark"/>
+          <a-textarea v-model="formState.remark" />
         </a-form-item>
         <a-form-item>
           <a-button type="primary" html-type="submit" style="margin-right: 10px;">确定</a-button>
@@ -53,8 +51,8 @@
 </template>
 
 <script setup>
-import {onMounted, ref, reactive} from "vue";
-import {dictionaryList, dictionaryAdd, dictionaryDelete, dictionaryUpdate, dictionaryDeleteAll} from '@/api/path/dict';
+import { onMounted, ref, reactive } from "vue";
+import { dictionaryList, dictionaryAdd, dictionaryDelete, dictionaryUpdate, dictionaryDeleteAll } from '@/api/path/dict';
 
 const visible = ref(false);
 const typeCurrent = ref(null);
@@ -67,9 +65,9 @@ const formData = ref({
 const columns = ref([
 
   // {title: '数据标签', dataIndex: 'label', align: 'center', width: 120},
-  {title: '字典名称', dataIndex: 'typeLabel', align: 'center', width: 120},
-  {title: '字典类型', dataIndex: 'typeKey', align: 'center', width: 150},
-  {title: '数据键值', dataIndex: 'value', align: 'center', width: 120},
+  { title: '字典名称', dataIndex: 'typeLabel', align: 'center', width: 120 },
+  { title: '字典类型', dataIndex: 'typeKey', align: 'center', width: 150 },
+  { title: '数据键值', dataIndex: 'value', align: 'center', width: 120 },
   // {
   //   title: '备注',
   //   dataIndex: 'remark',
@@ -87,7 +85,7 @@ const columns = ref([
   }
 ])
 const rules = {
-  label: [{required: true, trigger: 'change',}],
+  label: [{ required: true, trigger: 'change', }],
   value: [
     {
       required: true,
@@ -124,7 +122,7 @@ const formState = reactive({
 
 const pageData = ref({
   total: 0,
-  pageSize: 25,
+  pageSize: 10,
   current: 1,
 })
 const dataSource = ref([]);
@@ -136,15 +134,16 @@ const intData = async () => {
     size: pageData.value.pageSize,
     ...formData.value
   }
-  const {data} = await dictionaryList(param)
-  dataSource.value = data.map(res => ({
+  const res = await dictionaryList(param)
+  dataSource.value = res.data.map(res => ({
     ...res,
     children: []
   }))
-  pageData.value.total = data.total;
+  pageData.value.total = res.total;
+  
 }
 // 提交
-const handleSubmit = async ({values, errors}) => {
+const handleSubmit = async ({ values, errors }) => {
   const submitData = {
     label: formState.label,
     value: formState.value,
@@ -153,8 +152,7 @@ const handleSubmit = async ({values, errors}) => {
     remark: formState.remark,
     id: typeCurrent.value == 1 ? undefined : dicId.value
   }
-  let res =  typeCurrent.value === 1 ? await dictionaryAdd(submitData) : await dictionaryUpdate(submitData)
-  console.log(res)
+  let res = typeCurrent.value === 1 ? await dictionaryAdd(submitData) : await dictionaryUpdate(submitData)
   if (res.code === 200) {
     intData();
     resetForm();
@@ -162,7 +160,7 @@ const handleSubmit = async ({values, errors}) => {
 }
 // 删除
 const deleteChange = (e) => {
-  dictionaryDelete({id: e}).then(res => {
+  dictionaryDelete({ id: e }).then(res => {
     intData();
   })
 }
@@ -207,7 +205,7 @@ const resetSelectData = () => {
 
 const expandTableIds = async (e) => {
   if (e.length === 0) return
-  let res = await dictionaryDeleteAll({typeKey: e[0]});
+  let res = await dictionaryDeleteAll({ typeKey: e[0] });
   if (res.code === 200) {
     dataSource.value.forEach((item) => {
       // 检查 item.typeKey 是否包含 e 中的任意一个值

+ 2 - 2
src/views/tariffManagement/index.vue

@@ -309,7 +309,6 @@ const methodList = ref([])
 const settlementCycleMap = ref([])
 
 const formState = ref({
-  id: "",
   // 资费名称(必填)
   "label": "",
   // 流量包ID(必填)
@@ -422,6 +421,7 @@ const dictShowModel = (type, data) => {
         formState.value[key] = data[key]
       }
     })
+    formState.value.id = formState.value.data.id
     formState.value.simDataPlanId = Number(formState.value.simDataPlanId)
     formState.value.userId = Number(formState.value.userId)
     if (data.pricing !== '') {
@@ -463,7 +463,7 @@ const resetForm = () => {
   Object.keys(formState.value).forEach(key => {
       formState.value[key] = ''
   })
-
+  delete formState.value.id
   formState.value.settlementCycleMap = {
     starTime:'',
     endTime:''