wxy 4 ماه پیش
والد
کامیت
e9432290cf

+ 10 - 0
src/mixins/index.js

@@ -0,0 +1,10 @@
+import {dictionaryDeleteAll} from '@/api/path/dict.js'
+
+
+// 获取字典
+export function Getdictionary(params) {
+    // 返回 Promise
+    return dictionaryDeleteAll({ typeKey: params }).then(res => {
+        return res.data; // 将响应数据返回
+    });
+}

+ 3 - 3
src/views/customer/NewCustomerForm.vue

@@ -325,14 +325,14 @@ const generatePassword = () => {
 
 
 const getDistList = async () => {
-  let code = ['invoice_vat', 'user_type'];
+  let code = ['invoiceVat', 'userType'];
 
   for (let i = 0; i < code.length; i++) {
     let res = await dictionaryDetail({ typeKey: code[i] });
     if (res.code === 200) {
-      if (code[i] === 'invoice_vat') {
+      if (code[i] === 'invoiceVat') {
         invoiceList.value = res.data;
-      } else if (code[i] === 'user_type') {
+      } else if (code[i] === 'userType') {
         userTypeList.value = res.data;
       }
     }

+ 4 - 4
src/views/customer/index.vue

@@ -89,9 +89,9 @@ const columns = computed(() => [
   {title: t('customer.customerStatus'), slotName: 'state'},
   // {title: t('customer.validPeriod'), dataIndex: 'validPeriod'},
   // {title: t('customer.activeCards'), dataIndex: 'activeCards'},
-  {title: t('customer.userTypeName'), slotName: 'user_type'},
-  {title: t('customer.startTime'), dataIndex: 'created_at'},
-  {title: t('customer.updateTime'), dataIndex: 'updated_at'},
+  {title: t('customer.userTypeName'), dataIndex: 'userType'},
+  {title: t('customer.startTime'), dataIndex: 'createdAt'},
+  {title: t('customer.updateTime'), dataIndex: 'updatedAt'},
   {title: t('global.common.operations'), slotName: 'operation', width: 250},
 ]);
 
@@ -115,7 +115,7 @@ const fetchCustomerList = async () => {
       operatorType: searchForm.operatorType,
     });
     if (response.code === 200 && response.data) {
-      tableData.value = response.data.records;
+      tableData.value = response.data.records.map(res=>({...res,userType:res.userType==1?'平台':'客户'}))
       pagination.total = response.data.total;
       pagination.current = response.data.current;
       pagination.pageSize = response.data.size;

+ 11 - 16
src/views/flowPool/customerFlowPool/index.vue

@@ -13,8 +13,8 @@
                     <a-input v-model="searchForm.label" :placeholder="$t('lotCard.please') + $t('flowPool.label')"
                         allow-clear />
                 </a-form-item>
-                <a-form-item field="traffic_pool_type" :label="$t('flowPool.trafficPoolType')">
-                    <a-select v-model="searchForm.traffic_pool_type" style="width: 200px;"
+                <a-form-item field="trafficPoolType" :label="$t('flowPool.trafficPoolType')">
+                    <a-select v-model="searchForm.trafficPoolType" style="width: 200px;"
                         :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.trafficPoolType')">
                         <a-option v-for=" item in typeList" :key="item.id" :value="item.value">{{ item.label
                             }}</a-option>
@@ -40,24 +40,20 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
+import { onMounted, ref, reactive, getCurrentInstance } from "vue";
 import { useRoute } from "vue-router";
 import { columns } from "./config";
-import { Message, Notification } from '@arco-design/web-vue'
-import { deleteTrafficPool, addTrafficPool, updateTrafficPool, trafficPoolList } from "@/api/path/flowPool.api"
-import { tariffList } from "@/api/path/tariffManagement.api"
-import { orderCancel } from "@/api/path/lotCard.api"
-import { enum_dict } from "@/hooks/enum";
+import { trafficPoolList } from "@/api/path/flowPool.api"
 import { useSystemStore } from "@/store/modules/systemStore"
 
-
+import {Getdictionary} from '@/mixins/index.js'
 const systemStore = useSystemStore()
 const role = ref(systemStore.getRole)
 const { proxy } = getCurrentInstance()
 const formRef = ref()
 const searchForm = ref({
     "label": "",
-    "traffic_pool_type": ""
+    "trafficPoolType": ""
 });
 
 const typeList = ref([]);
@@ -92,7 +88,7 @@ const intData = async () => {
     }
     const { data } = await trafficPoolList(param)
     dataSource.value = (data.records || []).map((item, index) => {
-        const trafficPoolType = typeList.value.find(val => val.value == item.traffic_pool_type)?.label
+        const trafficPoolType = typeList.value.find(val => val.value == item.trafficPoolType)?.label
         const trafficPoolStatus = trafficList.value.find(val => val.value == item.status)?.label
         const sourceName = sourceList.value.find(val => val.value == item.source)?.label
         console.log(item, "item-------------------------");
@@ -134,11 +130,10 @@ const resetSearch = () => {
 
 // --------------------------------------------------------
 // 获取字典
-const handleDictValue = () => {
-    const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-    sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
-    trafficList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_PACKET_STATUS)
-    typeList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_POOL_TYPE)
+const handleDictValue = async () => {
+  sourceList.value = await Getdictionary('source')
+  trafficList.value = await Getdictionary('trafficPacketStatus')
+  typeList.value = await Getdictionary('trafficPoolType')
 }
 
 

+ 12 - 13
src/views/flowPool/index.vue

@@ -91,7 +91,7 @@
               <a-input v-model="formState.label"
                        :placeholder="$t('form.PleaseEnterThe') + $t('flowPool.label')"/>
             </a-form-item>
-            <a-form-item :label="$t('flowPool.source')" field="source" >
+            <a-form-item :label="$t('flowPool.source')" field="source">
               <a-select v-model="formState.source"
                         :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.source')">
                 <a-option v-for=" item in sourceList" :key="item.id" :value="item.value">{{
@@ -109,8 +109,8 @@
                 </a-option>
               </a-select>
             </a-form-item>
-            <!-- <a-form-item :label="$t('flowPool.trafficPoolType')" field="traffic_pool_type">
-                <a-select v-model="formState.traffic_pool_type" disabled
+            <!-- <a-form-item :label="$t('flowPool.trafficPoolType')" field="trafficPoolType">
+                <a-select v-model="formState.trafficPoolType" disabled
                     :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.trafficPoolType')">
                     <a-option v-for=" item in typeList" :key="item.id" :value="item.value">{{ item.label
                         }}</a-option>
@@ -320,7 +320,7 @@ import {enum_dict} from "@/hooks/enum";
 import {useSystemStore} from "@/store/modules/systemStore"
 
 
-
+import {Getdictionary} from '@/mixins/index.js'
 
 const systemStore = useSystemStore()
 const role = ref(systemStore.getRole)
@@ -328,7 +328,7 @@ const {proxy} = getCurrentInstance()
 const formRef = ref()
 const searchForm = ref({
   "label": "",
-  "traffic_pool_type": "1"
+  "trafficPoolType": "1"
 });
 
 const dataSource = ref([]);
@@ -353,7 +353,7 @@ const intData = async () => {
     current: pagination.value.current,
     size: pagination.value.pageSize,
     ...searchForm.value,
-    type:1
+    type: 1
   }
   const {data} = await trafficPoolList(param)
   dataSource.value = (data.records || []).map((item, index) => {
@@ -521,7 +521,7 @@ const rules = {
   billing_type: [{required: true, trigger: 'change',}],
   bag_size: [{required: true, trigger: 'change',}],
   billing_cycle: [{required: true, trigger: 'change',}],
-  // traffic_pool_type: [{required: true, trigger: 'change',}],
+  // trafficPoolType: [{required: true, trigger: 'change',}],
   settlement_cycle: [{required: true, trigger: 'change',}],
   simTariffId: [{required: true, trigger: 'change',}],
   expireTime: [{required: true, trigger: 'change',}],
@@ -650,7 +650,7 @@ const handleTariff = async () => {
 const resetForm = () => {
   visible.value = false;
   Object.keys(formState.value).forEach(key => {
-    if(key!='trafficPoolType' && key!='iccids'){
+    if (key != 'trafficPoolType' && key != 'iccids') {
       formState.value[key] = ''
     }
   })
@@ -665,11 +665,10 @@ const handleCancel = () => {
 }
 // --------------------------------------------------------
 // 获取字典
-const handleDictValue = () => {
-  const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
-  trafficList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_PACKET_STATUS)
-  typeList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_POOL_TYPE)
+const handleDictValue = async () => {
+  sourceList.value = await Getdictionary('source')
+  trafficList.value = await Getdictionary('trafficPacketStatus')
+  typeList.value = await Getdictionary('trafficPoolType')
 }
 
 onMounted(() => {

+ 9 - 10
src/views/flowPool/rearFlowPool/index.vue

@@ -109,8 +109,8 @@
                 </a-option>
               </a-select>
             </a-form-item>
-            <!-- <a-form-item :label="$t('flowPool.trafficPoolType')" field="traffic_pool_type">
-                <a-select v-model="formState.traffic_pool_type"
+            <!-- <a-form-item :label="$t('flowPool.trafficPoolType')" field="trafficPoolType">
+                <a-select v-model="formState.trafficPoolType"
                     :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.trafficPoolType')">
                     <a-option v-for=" item in typeList" :key="item.id" :value="item.value">{{ item.label
                         }}</a-option>
@@ -327,7 +327,7 @@ import {tariffList} from "@/api/path/tariffManagement.api"
 import {orderCancel} from "@/api/path/lotCard.api"
 import {enum_dict} from "@/hooks/enum";
 import {useSystemStore} from "@/store/modules/systemStore"
-
+import {Getdictionary} from '@/mixins/index.js'
 
 const systemStore = useSystemStore()
 const role = ref(systemStore.getRole)
@@ -365,7 +365,7 @@ const intData = async () => {
   }
   const {data} = await trafficPoolList(param)
   dataSource.value = (data.records || []).map((item, index) => {
-    const trafficPoolType = typeList.value.find(val => val.value == item.traffic_pool_type)?.label
+    const trafficPoolType = typeList.value.find(val => val.value == item.trafficPoolType)?.label
     const trafficPoolStatus = trafficList.value.find(val => val.value == item.status)?.label
     const sourceName = sourceList.value.find(val => val.value == item.source)?.label
     return {
@@ -531,7 +531,7 @@ const rules = {
   billing_type: [{required: true, trigger: 'change',}],
   bag_size: [{required: true, trigger: 'change',}],
   billing_cycle: [{required: true, trigger: 'change',}],
-  traffic_pool_type: [{required: true, trigger: 'change',}],
+  trafficPoolType: [{required: true, trigger: 'change',}],
   settlement_cycle: [{required: true, trigger: 'change',}],
   simTariffId: [{required: true, trigger: 'change',}],
   expireTime: [{required: true, trigger: 'change',}],
@@ -675,11 +675,10 @@ const handleCancel = () => {
 }
 // --------------------------------------------------------
 // 获取字典
-const handleDictValue = () => {
-  const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
-  trafficList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_PACKET_STATUS)
-  typeList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_POOL_TYPE)
+const handleDictValue = async () => {
+  sourceList.value = await Getdictionary('source')
+  trafficList.value = await Getdictionary('trafficPacketStatus')
+  typeList.value = await Getdictionary('trafficPoolType')
 }
 
 

+ 1 - 42
src/views/login/login-form.vue

@@ -79,21 +79,7 @@ const handleSubmit = async () => {
   router.push({
     path: "/",
   })
-
-  if (systemStore?.token) {
-    try {
-      const res = await dictionaryList({
-        size: 99999,
-        current: 1,
-      })
-      if (res.code == 200) {
-        processDataAndSave(res)
-
-      }
-    } catch (error) {
-      console.error(error)
-    }
-  }
+  
 }
 
 const setRememberPassword = (e) => {
@@ -102,33 +88,6 @@ const setRememberPassword = (e) => {
   }
 }
 
-// 调用所有字典
-const processDataAndSave = async (res) => {
-  try {
-    // 遍历 res.data 并收集所有异步操作的 Promise
-    const promises = res.data.map((item) =>
-        dictionaryDeleteAll({ typeKey: item.typeKey }).then(response => {
-          // 如果成功返回结果,将返回数据合并
-          if (response.code === 200) {
-            return response.data; // 假设 response.data 是需要的部分
-          } else {
-            console.error(`处理失败: typeKey=${item.typeKey}`, response.message);
-            return []; // 返回空数组避免错误
-          }
-        })
-    );
-
-    // 等待所有异步操作完成并合并所有返回数据
-    const results = await Promise.all(promises);
-    const mergedData = results.flat(); // 合并所有结果为一个数组
-
-    // 将合并后的数据存储到 localStorage
-    window.localStorage.setItem('dictList', JSON.stringify(mergedData));
-    console.log("所有操作完成,数据已存储到 localStorage");
-  } catch (error) {
-    console.error("处理过程中发生错误:", error);
-  }
-};
 
 </script>
 

+ 5 - 7
src/views/lotCard/cardList/index.vue

@@ -71,9 +71,8 @@ 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 {enum_dict} from "@/hooks/enum";
 import list from "./list.vue";
-
+import {Getdictionary} from '@/mixins/index.js'
 const {proxy} = getCurrentInstance()
 const formRef = ref()
 const searchForm = ref({
@@ -233,11 +232,10 @@ const handleSearch = () => {
 
 
 // 获取字典
-const handleDictValue = () => {
-  const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
-  statusList.value = dictList.filter((item) => item.typeKey == enum_dict.MAIN_CARD_STATUS)
-  serviceList.value = dictList.filter((item) => item.typeKey == enum_dict.ACTIVATION_PACKAGE)
+const handleDictValue = async () => {
+  sourceList.value = await Getdictionary('source')
+  statusList.value =  await Getdictionary('mainCardStatus')
+  serviceList.value =  await Getdictionary('activationPackageMethod')
 }
 
 const resetSearch = () => {

+ 205 - 205
src/views/lotCard/orderMange/index.vue

@@ -1,110 +1,113 @@
 <template>
-    <!-- 订单管理 -->
-    <div class="container">
-        <div class="head-title">
-            <span>{{ route.meta.title }} </span>
-            <span class="head-title-right">
+  <!-- 订单管理 -->
+  <div class="container">
+    <div class="head-title">
+      <span>{{ route.meta.title }} </span>
+      <span class="head-title-right">
                 <a-popconfirm :content="$t('lotCard.confirmTitleOrder')" :ok-text="$t('form.Confirm')"
-                    :cancel-text="$t('form.Cancel')" @ok="handleOrderDialog(record)">
+                              :cancel-text="$t('form.Cancel')" @ok="handleOrderDialog(record)">
                     <!-- <a-button class="m-r-10" type="primary">{{ $t('lotCard.titleOrder') }}</a-button> -->
                 </a-popconfirm>
                 <a-popconfirm :content="$t('lotCard.confirmTitleCancelOrder')" :ok-text="$t('form.Confirm')"
-                    :cancel-text="$t('form.Cancel')" @ok="handleUnsubscribeDialog(record)">
+                              :cancel-text="$t('form.Cancel')" @ok="handleUnsubscribeDialog(record)">
                     <!-- <a-button type="primary">{{ $t('lotCard.titleCancelOrder') }}</a-button> -->
                 </a-popconfirm>
             </span>
-        </div>
-        <!-- 搜索条件区 -->
-        <div class="search-section">
-            <a-form :model="searchForm" 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="searchForm.ICCID" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')"
-                        allow-clear />
-                </a-form-item> -->
-                <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-form-item>
-                <a-form-item field="dataBundleId" :label="$t('lotCard.dataBundleId')">
-                    <a-input v-model="searchForm.cardNumber"
-                        :placeholder="$t('lotCard.please') + $t('lotCard.dataBundleId')" 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 row-key="id" :data="dataSource" :columns="columns" :pagination="pagination"
-            :row-selection="rowSelection" v-model:selectedKeys="selectedKeys" :scroll="{ x: 'auto' }"
-            @page-change="evChangePage">
-            <template #id="{ record }">
-                <!-- 获取流量包数据 -->
-                <a-popconfirm :content="$t('lotCard.confirmTitleOrder')" :ok-text="$t('form.Confirm')"
-                    :cancel-text="$t('form.Cancel')" @ok="handleOrderDialog(record)">
-                    <a class="a-link" v-if="!(record.status == 1 || record.status == 3)" href="javascript:;"
-                        style="margin-right: 1rem">{{
-                            $t('lotCard.titleOrder') }}</a>
-                </a-popconfirm>
-                <!-- 查看订单日志 -->
-
-                <a-popconfirm :content="$t('lotCard.confirmTitleCancelOrder')" :ok-text="$t('form.Confirm')"
-                    :cancel-text="$t('form.Cancel')" @ok="handleUnsubscribeDialog(record)">
-                    <a class="a-link" v-if="record.status == 1 || record.status == 3" href="javascript:;"
-                        style="margin-right: 1rem">{{ $t('lotCard.titleCancelOrder')
-                        }}</a>
-                </a-popconfirm>
-            </template>
-
-        </a-table>
     </div>
+    <!-- 搜索条件区 -->
+    <div class="search-section">
+      <a-form :model="searchForm" 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="searchForm.ICCID" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')"
+                allow-clear />
+        </a-form-item> -->
+        <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-form-item>
+        <a-form-item field="dataBundleId" :label="$t('lotCard.dataBundleId')">
+          <a-input v-model="searchForm.cardNumber"
+                   :placeholder="$t('lotCard.please') + $t('lotCard.dataBundleId')" 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 row-key="id" :data="dataSource" :columns="columns" :pagination="pagination"
+             :row-selection="rowSelection" v-model:selectedKeys="selectedKeys" :scroll="{ x: 'auto' }"
+             @page-change="evChangePage">
+      <template #id="{ record }">
+        <!-- 获取流量包数据 -->
+        <a-popconfirm :content="$t('lotCard.confirmTitleOrder')" :ok-text="$t('form.Confirm')"
+                      :cancel-text="$t('form.Cancel')" @ok="handleOrderDialog(record)">
+          <a class="a-link" v-if="!(record.status == 1 || record.status == 3)" href="javascript:;"
+             style="margin-right: 1rem">{{
+              $t('lotCard.titleOrder')
+            }}</a>
+        </a-popconfirm>
+        <!-- 查看订单日志 -->
+
+        <a-popconfirm :content="$t('lotCard.confirmTitleCancelOrder')" :ok-text="$t('form.Confirm')"
+                      :cancel-text="$t('form.Cancel')" @ok="handleUnsubscribeDialog(record)">
+          <a class="a-link" v-if="record.status == 1 || record.status == 3" href="javascript:;"
+             style="margin-right: 1rem">{{
+              $t('lotCard.titleCancelOrder')
+            }}</a>
+        </a-popconfirm>
+      </template>
+
+    </a-table>
+  </div>
 </template>
 
 <script setup>
-import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
-import { useRoute } from "vue-router";
-import { columns } from "./config";
-import { Message, Notification } from '@arco-design/web-vue'
-import { getOrderLogsList, setOrderDataPlan, orderCancel } from "@/api/path/lotCard.api"
-import { enum_dict } from "@/hooks/enum";
-import { useSystemStore } from '@/store/modules/systemStore'
+import {onMounted, ref, reactive, getCurrentInstance, nextTick} from "vue";
+import {useRoute} from "vue-router";
+import {columns} from "./config";
+import {Message, Notification} from '@arco-design/web-vue'
+import {getOrderLogsList, setOrderDataPlan, orderCancel} from "@/api/path/lotCard.api"
+import {enum_dict} from "@/hooks/enum";
+import {useSystemStore} from '@/store/modules/systemStore'
+import {Getdictionary} from '@/mixins/index.js'
 
 const useSystem = useSystemStore()
 
-const { proxy } = getCurrentInstance()
+const {proxy} = getCurrentInstance()
 const formRef = ref()
 const searchForm = ref({
-    "orderId": "",
-    "is_Refuel": "",
-    "refuelingId": "",
-    "dataBundleId": "",
-    "quantity": 0,
-    "ICCID": "",
-    "sendLang": "",
-    "price": "",
-    "totalAmount": "",
-    "currency": "",
-    "userId": 0,
-    "current": 1,
-    "size": 10
+  "orderId": "",
+  "is_Refuel": "",
+  "refuelingId": "",
+  "dataBundleId": "",
+  "quantity": 0,
+  "ICCID": "",
+  "sendLang": "",
+  "price": "",
+  "totalAmount": "",
+  "currency": "",
+  "userId": 0,
+  "current": 1,
+  "size": 10
 });
 
 const dataSource = ref([]);
 const route = useRoute();
 const pagination = ref({
-    total: 0,
-    pageSize: 10,
-    current: 1,
+  total: 0,
+  pageSize: 10,
+  current: 1,
 })
 
 const rowSelection = reactive({
-    type: 'checkbox',
-    showCheckedAll: true,
-    onlyCurrent: false,
+  type: 'checkbox',
+  showCheckedAll: true,
+  onlyCurrent: false,
 });
 const selectedKeys = ref([])
 
@@ -112,172 +115,169 @@ const dialogRef = ref()
 
 
 const intData = async () => {
-    const param = {
-        current: pagination.value.current,
-        size: pagination.value.pageSize,
-        // ...searchForm.value,
+  const param = {
+    current: pagination.value.current,
+    size: pagination.value.pageSize,
+    // ...searchForm.value,
+  }
+  const {data} = await getOrderLogsList(param)
+  const res1 = await  Getdictionary('subscriptionRelationshipStatus')
+  const res2 = await  Getdictionary('source')
+  dataSource.value = (data.records || []).map(item => {
+    const statusName = (res1.filter((dicVal) => dicVal.typeKey == 'subscriptionRelationshipStatus') || []).find(val => val.value == item.status)?.label
+    const sourceName = (res2.filter( (dicVal) => dicVal.typeKey =='source') || []).find(val => val.value == item.source)?.label
+    return {
+      ...item,
+      sourceName,
+      statusName
     }
-    const { data } = await getOrderLogsList(param)
-    dataSource.value = (data.records || []).map(item => {
-        const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-        const statusName = (dictList.filter((dicVal) => dicVal.typeKey == enum_dict.SUBSCRIPTION_RELATIONSHIP_STATUS) || []).find(val => val.value == item.status)?.label
-        const sourceName = (dictList.filter((dicVal) => dicVal.typeKey == enum_dict.SOURCE) || []).find(val => val.value == item.source)?.label
-        return {
-            ...item,
-            sourceName,
-            statusName
-        }
-    })
-    pagination.value.total = data.total
+  })
+  pagination.value.total = data.total
 }
 
 
-
-
 // 订购生成订单
 const handleOrderDialog = async (info) => {
-    let paramList = []
-    if (selectedKeys.value.length > 0) {
-        const list = dataSource.value.filter(item => selectedKeys.value.some(item2 => item.id === item2))
-
-        paramList = list.map(item => {
-            return {
-                ICCID: item.ICCID,
-                dataBundleId: item.dataBundleId,
-                source: item.source,
-                quantity: 1
-            }
-        })
-    }
-    if (info && Object.keys(info).length > 0) {
-        paramList = [{
-            ICCID: info.ICCID,
-            dataBundleId: info.dataBundleId,
-            source: info.source,
-            quantity: 1
-        }]
-    }
-
-
-    if (selectedKeys.value.length > 0 || info && Object.keys(info).length > 0) {
-
-        const { code, data } = await setOrderDataPlan(paramList)
-
-        if (code == 200) {
-            Message.success({
-                content: data,
-                duration: 2000,
-            })
-        }
-    } else {
-        Message.warning({
-            content: $t('lotCard.tipsOrder'),
-            duration: 2000,
-        })
+  let paramList = []
+  if (selectedKeys.value.length > 0) {
+    const list = dataSource.value.filter(item => selectedKeys.value.some(item2 => item.id === item2))
+
+    paramList = list.map(item => {
+      return {
+        ICCID: item.ICCID,
+        dataBundleId: item.dataBundleId,
+        source: item.source,
+        quantity: 1
+      }
+    })
+  }
+  if (info && Object.keys(info).length > 0) {
+    paramList = [{
+      ICCID: info.ICCID,
+      dataBundleId: info.dataBundleId,
+      source: info.source,
+      quantity: 1
+    }]
+  }
+
+
+  if (selectedKeys.value.length > 0 || info && Object.keys(info).length > 0) {
+
+    const {code, data} = await setOrderDataPlan(paramList)
+
+    if (code == 200) {
+      Message.success({
+        content: data,
+        duration: 2000,
+      })
     }
+  } else {
+    Message.warning({
+      content: $t('lotCard.tipsOrder'),
+      duration: 2000,
+    })
+  }
 }
 
 // 退订
 const handleUnsubscribeDialog = async (record) => {
-    // 订阅关系状态
-    // 1:未激活
-    // 2: 已过期
-    // 3: 已激活99:已退款
-    let param = {}
-    let statusFlag = true
-    if (selectedKeys.value.length > 0) {
-        const list = dataSource.value.filter(item => selectedKeys.value.some(item2 => item.id === item2))
-        list.forEach(item => {
-            if (!(item.status == 1 || item.status == 3)) statusFlag = false
-        })
-        param = {
-            ids: selectedKeys.value
-        }
+  // 订阅关系状态
+  // 1:未激活
+  // 2: 已过期
+  // 3: 已激活99:已退款
+  let param = {}
+  let statusFlag = true
+  if (selectedKeys.value.length > 0) {
+    const list = dataSource.value.filter(item => selectedKeys.value.some(item2 => item.id === item2))
+    list.forEach(item => {
+      if (!(item.status == 1 || item.status == 3)) statusFlag = false
+    })
+    param = {
+      ids: selectedKeys.value
     }
-    if (record && record.id && !(record.status == 1 || record.status == 3)) {
-        statusFlag = false
-        param = {
-            ids: [record.id]
-        }
+  }
+  if (record && record.id && !(record.status == 1 || record.status == 3)) {
+    statusFlag = false
+    param = {
+      ids: [record.id]
     }
+  }
 
 
-    if ((selectedKeys.value.length > 0 || record && record.id) && statusFlag) {
+  if ((selectedKeys.value.length > 0 || record && record.id) && statusFlag) {
 
-        const { code, data } = await orderCancel(param)
+    const {code, data} = await orderCancel(param)
 
-        if (code == 200) {
-            Message.success({
-                content: data,
-                duration: 2000,
-            })
-        }
-    } else {
-        Message.warning({
-            content: $t('lotCard.tipsOrder'),
-            duration: 2000,
-        })
+    if (code == 200) {
+      Message.success({
+        content: data,
+        duration: 2000,
+      })
     }
+  } else {
+    Message.warning({
+      content: $t('lotCard.tipsOrder'),
+      duration: 2000,
+    })
+  }
 };
 
 //
 
 const evChangePage = (current) => {
-    pagination.value.current = current
-    intData()
+  pagination.value.current = current
+  intData()
 }
 const handleSearch = () => {
-    formRef.value.validate((errors) => {
-        if (!errors) {
-            intData()
-        }
-    });
+  formRef.value.validate((errors) => {
+    if (!errors) {
+      intData()
+    }
+  });
 }
 const resetSearch = () => {
-    proxy.$refs.formRef.resetFields()
-    intData()
+  proxy.$refs.formRef.resetFields()
+  intData()
 }
 
 
-
-
 onMounted(() => {
-    intData()
+  intData()
 })
 </script>
 
 <style scoped lang="less">
 .head-title-right {
-    .m-r-10 {
-        margin-right: 10px;
-    }
+  .m-r-10 {
+    margin-right: 10px;
+  }
 
 }
 
 .search-section {
-    margin-top: 20px;
-    margin-bottom: 20px;
+  margin-top: 20px;
+  margin-bottom: 20px;
 }
 
 .container {
-    .head-title {
-        display: flex;
-        justify-content: space-between;
-    }
-
-    .form-row {
-        display: flex;
-
-        .form-row-col {
-            width: 25%;
-            display: flex;
-            align-items: center;
-
-            .form-row-label {
-                width: 120px;
-                text-align: right;
-            }
-        }
+  .head-title {
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .form-row {
+    display: flex;
+
+    .form-row-col {
+      width: 25%;
+      display: flex;
+      align-items: center;
+
+      .form-row-label {
+        width: 120px;
+        text-align: right;
+      }
     }
+  }
 }
 </style>

+ 59 - 58
src/views/order/BuyCard/index.vue

@@ -21,14 +21,14 @@
     <div class="audit-btn">
       <a-button @click="openAudit" type="text">
         <template #icon>
-          <icon-plus-circle />
+          <icon-plus-circle/>
         </template>
         <template #default>购卡</template>
       </a-button>
     </div>
     <!-- 数据表格 -->
     <a-table :data="tableData" :pagination="pageData" :columns="columns" @page-change="evChangePage"
-      :scroll="{ x: '100%', y: '800px' }">
+             :scroll="{ x: '100%', y: '800px' }">
       <!-- <template #status="{ record }">
         {{ record.status }}
       </template>
@@ -54,7 +54,7 @@
       </template>
     </a-table>
     <a-modal v-model:visible="uploadContract" title="上传合同" @cancel="handleCancel" @before-ok="handleBeforeOk"
-      okText="保存" cancelText="关闭">
+             okText="保存" cancelText="关闭">
       <a-form :model="formContract" auto-label-width>
         <a-form-item field="orderNumber" label="单号">
           <!-- <a-input v-model="formContract.orderNumber" disabled placeholder="请输入单号" /> -->
@@ -65,14 +65,14 @@
           <div class="audit-txt" style="color:#418035;">{{ formContract.customerName }}</div>
         </a-form-item>
         <a-form-item field="fileList" label="销售合同">
-          <a-upload action="/" :default-file-list="formContract.fileList" />
+          <a-upload action="/" :default-file-list="formContract.fileList"/>
         </a-form-item>
       </a-form>
     </a-modal>
 
     <!-- 创建 -->
     <a-modal v-model:visible="showAudit" title="购卡" width="600px" @cancel="cancelPurchase" centered
-      :maskClosable="false" okText="确定" cancelText="关闭" :footer="null">
+             :maskClosable="false" okText="确定" cancelText="关闭" :footer="null">
       <a-form ref="formRef" :rules="rules" :model="formState" @submit="submitPurchase">
         <a-form-item field="customerName" label="客户名称">
           <!-- <a-input v-model="formAudit.customerName" placeholder="请输入客户" /> -->
@@ -80,13 +80,13 @@
         </a-form-item>
         <a-form-item label="运营商" field="source">
           <a-select v-model="formState.source" :style="{ width: '380px' }" placeholder="请选择运营商">
-            <a-option v-for="item of sourceList" :value="item.id" :label="item.label" />
+            <a-option v-for="item of sourceList" :value="item.id" :label="item.label"/>
           </a-select>
         </a-form-item>
         <a-form-item label="资费名称" field="tariffId">
           <a-select v-model="formState.tariffId" :style="{ width: '380px' }" @change="tariffChange"
-            placeholder="请选择资费ID">
-            <a-option v-for="item of tariffData" :value="item.value" :label="item.label" />
+                    placeholder="请选择资费ID">
+            <a-option v-for="item of tariffData" :value="item.value" :label="item.label"/>
           </a-select>
         </a-form-item>
         <!-- <a-form-item label="资费详情" v-if="formState.tariffId">
@@ -107,14 +107,14 @@
         </a-form-item> -->
         <a-form-item label="卡类型" field="cardType">
           <a-select v-model="formState.cardType" :style="{ width: '380px' }" placeholder="请选择卡类型">
-            <a-option v-for="item of orderType" :value="item.value" :label="item.label" />
+            <a-option v-for="item of orderType" :value="item.value" :label="item.label"/>
           </a-select>
         </a-form-item>
 
 
         <a-form-item label="沉默期">
           <a-select v-model="formState.silencePeriod" :style="{ width: '380px' }" placeholder="请选择沉默期">
-            <a-option v-for="item of silenceOptions" :value="item.value" :label="item.label" />
+            <a-option v-for="item of silenceOptions" :value="item.value" :label="item.label"/>
           </a-select>
         </a-form-item>
         <a-form-item label="流量池" field="flowPool">
@@ -125,7 +125,7 @@
           </a-radio-group>
         </a-form-item>
         <a-form-item label="购卡数量" field="num">
-          <a-input v-model="formState.num" placeholder="请输入购卡数量" />
+          <a-input v-model="formState.num" placeholder="请输入购卡数量"/>
         </a-form-item>
         <a-form-item>
           <a-button type="primary" html-type="submit" style="margin-right: 10px;">确定</a-button>
@@ -136,7 +136,7 @@
 
     <!-- 详情 -->
     <a-modal v-model:visible="showDetail" width="800px" :title="currentIndex == 1 ? '退卡详情' : '查看'"
-      @cancel="showDetail = false" :footer="null">
+             @cancel="showDetail = false" :footer="null">
       <div class="detail-box">
         <div class="detail-item-box">
           <div class="detail-item">
@@ -220,7 +220,7 @@
         </div>
       </div>
       <div class="detail-table">
-        <a-table :columns="columnsDetail" :data="dataDetail" />
+        <a-table :columns="columnsDetail" :data="dataDetail"/>
       </div>
       <div style="text-align: right;margin-top: 20px;">
         <a-button type="primary" html-type="submit" style="margin-right: 10px;" @click="operateHandle">确定</a-button>
@@ -238,11 +238,12 @@
 </template>
 
 <script setup>
-import { ref, reactive, onMounted } from 'vue';
-import { Message } from '@arco-design/web-vue';
-import { enum_dict } from "@/hooks/enum";
-import { tariffList } from "@/api/path/tariffManagement.api";
-import { purchaseOrderList, addPurchaseOrder, platformUpdate, adminUpdate } from '@/api/path/purchase';
+import {ref, reactive, onMounted} from 'vue';
+import {Message} from '@arco-design/web-vue';
+import {enum_dict} from "@/hooks/enum";
+import {tariffList} from "@/api/path/tariffManagement.api";
+import {purchaseOrderList, addPurchaseOrder, platformUpdate, adminUpdate} from '@/api/path/purchase';
+import {Getdictionary} from '@/mixins/index.js'
 
 const selectedKeys = ref([]);
 const rowSelection = reactive({
@@ -256,44 +257,44 @@ const searchForm = reactive({
 });
 
 const columns = [
-  { title: '订单编号', dataIndex: 'id', align: 'center', width: 300 },
-  { title: '客户名称', dataIndex: 'user_id', align: 'center' },
-  { title: '订阅状态', dataIndex: 'statusName', align: 'center' },
-  { title: '审核状态', dataIndex: 'orderTypeName', align: 'center' },
-  { title: '采购数量', dataIndex: 'quantity', align: 'center' },
-  { title: '支付金额', dataIndex: 'paymentAmount', align: 'center' },
-  { title: '下单时间', dataIndex: 'createdAt', align: 'center' },
-  { title: '操作', slotName: 'operate', align: 'center' }
+  {title: '订单编号', dataIndex: 'id', align: 'center', width: 300},
+  {title: '客户名称', dataIndex: 'user_id', align: 'center'},
+  {title: '订阅状态', dataIndex: 'statusName', align: 'center'},
+  {title: '审核状态', dataIndex: 'orderTypeName', align: 'center'},
+  {title: '采购数量', dataIndex: 'quantity', align: 'center'},
+  {title: '支付金额', dataIndex: 'paymentAmount', align: 'center'},
+  {title: '下单时间', dataIndex: 'createdAt', align: 'center'},
+  {title: '操作', slotName: 'operate', align: 'center'}
 ];
-const columnsDetail = [{ title: 'ICCID', dataIndex: 'iccid' },
-{ title: '池名称及编号', dataIndex: 'nameAndId' },
-{ title: '卡状态', dataIndex: 'status' },
+const columnsDetail = [{title: 'ICCID', dataIndex: 'iccid'},
+  {title: '池名称及编号', dataIndex: 'nameAndId'},
+  {title: '卡状态', dataIndex: 'status'},
 ]
 const dataDetail = ref([{
   iccid: '8986061800002054589N',
   nameAndId: '泰国监控40G共享/53357981207',
   status: '沉默期'
 },
-{
-  iccid: '8986061800002054588N',
-  nameAndId: '泰国监控40G共享/53357981207',
-  status: '沉默期'
-}, {
-  iccid: '8986061800002054587N',
-  nameAndId: '泰国监控40G共享/53357981207',
-  status: '沉默期'
-}, {
-  iccid: '8986061800002054586N',
-  nameAndId: '泰国监控40G共享/53357981207',
-  status: '沉默期'
-},])
+  {
+    iccid: '8986061800002054588N',
+    nameAndId: '泰国监控40G共享/53357981207',
+    status: '沉默期'
+  }, {
+    iccid: '8986061800002054587N',
+    nameAndId: '泰国监控40G共享/53357981207',
+    status: '沉默期'
+  }, {
+    iccid: '8986061800002054586N',
+    nameAndId: '泰国监控40G共享/53357981207',
+    status: '沉默期'
+  },])
 const userName = ref('')
 const userType = ref(''); // 1平台 2用户
 const tableData = ref([]);
 const formRef = ref(null);
 const currentIndex = ref(null);
 const rules = {
-  source: [{ required: true, trigger: 'change', }],
+  source: [{required: true, trigger: 'change',}],
   tariffId: [
     {
       required: true,
@@ -339,25 +340,26 @@ const orderType = ref([]); // 卡类型
 const flowPoolData = ref([]); // 组池
 const showAudit = ref(false);
 
-const handleDictValue = () => {
-  const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
-  orderType.value = dictList.filter((item) => item.typeKey == enum_dict.CARD_TYPE)
-  flowPoolData.value = dictList.filter((item) => item.typeKey == enum_dict.GROUP_POOL)
-  console.log(flowPoolData.value)
-  silenceOptions.value = dictList.filter((item) => item.typeKey == enum_dict.SILENCE)
+const handleDictValue = async () => {
+  let one = await Getdictionary('source')
+  let two = await Getdictionary('cardType')
+  let tree = await Getdictionary('silenceOf')
+  sourceList.value = one.filter( (item) => item.typeKey == 'source')
+  orderType.value = two.filter( (item) => item.typeKey == 'cardType')
+  silenceOptions.value = tree.filter( (item) => item.typeKey == 'silenceOf')
 }
 // 订单列表
-const intData = () => {
+const intData = async () => {
   const param = {
     current: pageData.value.current,
     size: pageData.value.size,
   }
+  let res1 = await Getdictionary('subscriptionRelationshipStatus')
+  let res2 = await Getdictionary('orderAuditStatus')
   purchaseOrderList(param).then(res => {
     tableData.value = (res.data.records || []).map(item => {
-      const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-      const statusName = dictList.filter((item) => item.typeKey == enum_dict.SUBSCRIPTION_RELATIONSHIP_STATUS)?.find(val => item.status == val.value)?.label
-      const orderTypeName = dictList.filter((item) => item.typeKey == enum_dict.ORDER_AUDIT_STATUS)?.find(val => item.status == val.value)?.label
+      const statusName = res1.filter( (item) => item.typeKey == 'subscriptionRelationshipStatus')?.find(val => item.status == val.value)?.label
+      const orderTypeName = res2.filter( (item) => item.typeKey == 'orderAuditStatus')?.find(val => item.status == val.value)?.label
 
       return {
         ...item,
@@ -384,7 +386,7 @@ const getTariff = () => {
   })
 }
 // 确认购卡
-const submitPurchase = ({ values, errors }) => {
+const submitPurchase = ({values, errors}) => {
   formRef.value.validate(async (errors) => {
     if (!errors) {
       const data = {
@@ -392,8 +394,8 @@ const submitPurchase = ({ values, errors }) => {
         tariff_id: formState.value.tariffId,
         quantity: Number(formState.value.num),
         card_type: formState.value.cardType,
-        period_of_silence: String(formState.value.silencePeriod),
-        is_traffic_pool: formState.value.flowPool
+        periodOfSilence: String(formState.value.silencePeriod),
+        isTrafficPool: formState.value.flowPool
       }
       addPurchaseOrder(data).then(res => {
         intData();
@@ -469,7 +471,6 @@ onMounted(() => {
 // 上传合同的弹框
 const uploadContract = ref(false);
 const openContract = (item) => {
-  console.log(item, '???')
   uploadContract.value = true;
   formContract.customerName = item.customerName;
   formContract.orderNumber = item.cardNumber;

+ 56 - 48
src/views/order/ReturnCard/index.vue

@@ -5,10 +5,10 @@
     <div class="search-section">
       <a-form :model="searchForm" layout="inline">
         <a-form-item field="cardNumber" label="订单编号">
-          <a-input v-model="searchForm.orderNumber" placeholder="请输入订单编号" allow-clear />
+          <a-input v-model="searchForm.orderNumber" placeholder="请输入订单编号" allow-clear/>
         </a-form-item>
         <a-form-item field="customerName" label="客户">
-          <a-input v-model="searchForm.customerName" placeholder="请输入客户名称" allow-clear />
+          <a-input v-model="searchForm.customerName" placeholder="请输入客户名称" allow-clear/>
         </a-form-item>
         <a-form-item>
           <a-space>
@@ -21,7 +21,7 @@
     <div class="audit-btn">
       <a-button @click="openAudit" type="text">
         <template #icon>
-          <icon-plus-circle />
+          <icon-plus-circle/>
         </template>
         <template #default>审核</template>
       </a-button>
@@ -32,8 +32,9 @@
         <a-button @click="openDetail(record)" type="text">订单详情</a-button>
       </template>
     </a-table>
-    <a-modal v-model:visible="showAudit" title="审核" @cancel="showAudit = false" @before-ok="submitAudit" okText="确定审核"
-      cancelText="关闭">
+    <a-modal v-model:visible="showAudit" title="审核" @cancel="showAudit = false" @before-ok="submitAudit"
+             okText="确定审核"
+             cancelText="关闭">
       <a-form :model="formAudit" auto-label-width>
         <a-form-item field="customerName" label="客户">
           <!-- <a-input v-model="formAudit.customerName" placeholder="请输入客户" /> -->
@@ -41,24 +42,27 @@
         </a-form-item>
         <a-form-item field="cardType" label="卡类型">
           <!-- <a-input v-model="formAudit.cardType" placeholder="请输入单号" /> -->
-          <div class="audit-txt">普通卡切卡普通卡MP1,1元/涨<div class="audit-tag">共1张卡</div>
+          <div class="audit-txt">普通卡切卡普通卡MP1,1元/涨
+            <div class="audit-tag">共1张卡</div>
           </div>
         </a-form-item>
         <a-form-item field="money" label="资费">
           <!-- <a-input v-model="formAudit.money" placeholder="请输入单号" /> -->
-          <div class="audit-txt">“移动100M月包” <div class="audit-tag">订购12个月</div>
+          <div class="audit-txt">“移动100M月包”
+            <div class="audit-tag">订购12个月</div>
           </div>
         </a-form-item>
         <a-form-item field="orderStatus" label="订单状态">
           <!-- <a-input v-model="formAudit.orderStatus" placeholder="请输入单号" /> -->
-          <a-radio-group v-model="formAudit.orderStatus" :options="options" />
+          <a-radio-group v-model="formAudit.orderStatus" :options="options"/>
         </a-form-item>
         <a-form-item field="auditOpinion" label="审核意见">
           <!-- <a-input v-model="formAudit.auditOpinion" placeholder="请输入单号" /> -->
-          <a-textarea placeholder="您填写的审核意见会直接投送给用户,请认真填写!" v-model="formAudit.auditOpinion" allow-clear />
+          <a-textarea placeholder="您填写的审核意见会直接投送给用户,请认真填写!" v-model="formAudit.auditOpinion"
+                      allow-clear/>
         </a-form-item>
         <a-form-item field="fileList" label="销售合同">
-          <a-upload action="/" :default-file-list="formAudit.fileList" />
+          <a-upload action="/" :default-file-list="formAudit.fileList"/>
         </a-form-item>
       </a-form>
     </a-modal>
@@ -139,17 +143,19 @@
         </div>
       </div>
       <div class="detail-table">
-        <a-table :columns="columnsDetail" :data="dataDetail" />
+        <a-table :columns="columnsDetail" :data="dataDetail"/>
       </div>
     </a-modal>
   </div>
 </template>
 
 <script setup>
-import { ref, reactive, onMounted } from 'vue';
-import { Message } from '@arco-design/web-vue';
-import { cancelOrderList } from '@/api/path/purchase';
-import { enum_dict } from "@/hooks/enum";
+import {ref, reactive, onMounted} from 'vue';
+import {Message} from '@arco-design/web-vue';
+import {cancelOrderList} from '@/api/path/purchase';
+import {enum_dict} from "@/hooks/enum";
+import {Getdictionary} from "@/mixins/index.js";
+
 const selectedKeys = ref([]);
 const rowSelection = reactive({
   type: 'checkbox',
@@ -162,7 +168,7 @@ const searchForm = reactive({
 });
 
 const columns = [
-  { title: '序号', dataIndex: 'index', align: 'center', render: ({ rowIndex }) => rowIndex + 1 },
+  {title: '序号', dataIndex: 'index', align: 'center', render: ({rowIndex}) => rowIndex + 1},
   {
     title: '订单ID', dataIndex: 'source_order_id', ellipsis: true,
     tooltip: true,
@@ -173,40 +179,40 @@ const columns = [
     tooltip: true,
     width: 100
   },
-  { title: '订单审核状态', dataIndex: 'moderationStatusName' },
-  { title: '订阅关系状态', dataIndex: 'statusName' },
-  { title: '卡类型', dataIndex: 'cardTypeName' },
+  {title: '订单审核状态', dataIndex: 'moderationStatusName'},
+  {title: '订阅关系状态', dataIndex: 'statusName'},
+  {title: '卡类型', dataIndex: 'cardTypeName'},
   {
     title: '供应商名称', dataIndex: 'sourceName', ellipsis: true,
     tooltip: true,
     width: 150
   },
-  { title: '退卡张数', dataIndex: 'quantity' },
-  { title: '剩余时长', dataIndex: 'period_of_silence' },
-  { title: '返回金额', dataIndex: 'payment_amount' },
+  {title: '退卡张数', dataIndex: 'quantity'},
+  {title: '剩余时长', dataIndex: 'period_of_silence'},
+  {title: '返回金额', dataIndex: 'payment_amount'},
 ];
-const columnsDetail = [{ title: 'ICCID', dataIndex: 'iccid' },
-{ title: '池名称及编号', dataIndex: 'nameAndId' },
-{ title: '卡状态', dataIndex: 'status' },
+const columnsDetail = [{title: 'ICCID', dataIndex: 'iccid'},
+  {title: '池名称及编号', dataIndex: 'nameAndId'},
+  {title: '卡状态', dataIndex: 'status'},
 ]
 const dataDetail = ref([{
   iccid: '8986061800002054589N',
   nameAndId: '泰国监控40G共享/53357981207',
   status: '沉默期'
 },
-{
-  iccid: '8986061800002054588N',
-  nameAndId: '泰国监控40G共享/53357981207',
-  status: '沉默期'
-}, {
-  iccid: '8986061800002054587N',
-  nameAndId: '泰国监控40G共享/53357981207',
-  status: '沉默期'
-}, {
-  iccid: '8986061800002054586N',
-  nameAndId: '泰国监控40G共享/53357981207',
-  status: '沉默期'
-},])
+  {
+    iccid: '8986061800002054588N',
+    nameAndId: '泰国监控40G共享/53357981207',
+    status: '沉默期'
+  }, {
+    iccid: '8986061800002054587N',
+    nameAndId: '泰国监控40G共享/53357981207',
+    status: '沉默期'
+  }, {
+    iccid: '8986061800002054586N',
+    nameAndId: '泰国监控40G共享/53357981207',
+    status: '沉默期'
+  },])
 const tableData = ref([
   {
     cardNumber: '13800138000',
@@ -290,8 +296,8 @@ const resetSearch = () => {
 };
 // 订单状态
 const options = [
-  { label: '发货', value: '1' },
-  { label: '退回', value: '2' },
+  {label: '发货', value: '1'},
+  {label: '退回', value: '2'},
 ];
 // 审核
 const showAudit = ref(false);
@@ -318,22 +324,24 @@ const detailCancel = () => {
 }
 
 
-
-
 // 列表-------------------------------------
 // 订单列表
-const intData = () => {
+const intData = async () => {
   const param = {
     current: pagination.value.current,
     size: pagination.value.size,
   }
+  const one = await Getdictionary('source')
+  const two = await Getdictionary('cardType')
+  const tree = await Getdictionary('subscriptionRelationshipStatus')
+  const tive = await Getdictionary('orderAuditStatus')
   cancelOrderList(param).then(res => {
     tableData.value = (res.data.records || []).map(item => {
-      const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-      const sourceName = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)?.find(val => item.source == val.value)?.label
-      const cardTypeName = dictList.filter((item) => item.typeKey == enum_dict.CARD_TYPE)?.find(val => item.card_type == val.value)?.label
-      const statusName = dictList.filter((item) => item.typeKey == enum_dict.SUBSCRIPTION_RELATIONSHIP_STATUS)?.find(val => item.status == val.value)?.label
-      const moderationStatusName = dictList.filter((item) => item.typeKey == enum_dict.ORDER_AUDIT_STATUS)?.find(val => item.moderation_status == val.value)?.label
+
+      const sourceName = one.filter((item) => item.typeKey == enum_dict.SOURCE)?.find(val => item.source == val.value)?.label
+      const cardTypeName = two.filter((item) => item.typeKey == enum_dict.CARD_TYPE)?.find(val => item.card_type == val.value)?.label
+      const statusName = tree.filter((item) => item.typeKey == enum_dict.SUBSCRIPTION_RELATIONSHIP_STATUS)?.find(val => item.status == val.value)?.label
+      const moderationStatusName = tive.filter((item) => item.typeKey == enum_dict.ORDER_AUDIT_STATUS)?.find(val => item.moderation_status == val.value)?.label
 
       return {
         ...item,

+ 34 - 34
src/views/supplier/trafficList/index.vue

@@ -26,14 +26,14 @@
     <div class="audit-btn">
       <a-button @click="showNewDataPackageForm" type="text">
         <template #icon>
-          <icon-plus-circle />
+          <icon-plus-circle/>
         </template>
         <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>
@@ -44,26 +44,25 @@
     </a-table>
 
 
-
     <new-data-package-form v-model:visible="newDataPackageFormVisible" :editMode="editMode" :editData="editData"
-      @submit="handleNewDataPackageSubmit" />
+                           @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 {useI18n} from 'vue-i18n';
+import {enum_dict} from "@/hooks/enum";
+import {Getdictionary} from '@/mixins/index.js'
 
 
-const { t } = useI18n();
-const { proxy } = getCurrentInstance()
+const {t} = useI18n();
+const {proxy} = getCurrentInstance()
 const formRef = ref()
 const searchForm = ref({
   "status": "",
@@ -83,11 +82,11 @@ const pagination = ref({
 
 // 运营商
 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') },
+  {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')},
 ];
 
 
@@ -97,12 +96,15 @@ const intData = async () => {
     size: pagination.value.pageSize,
     ...searchForm.value,
   }
-  const { data } = await getDataPlanList(param)
+  const {data} = await getDataPlanList(param)
+  const one = await Getdictionary('flowPeriod')
+  const two = await Getdictionary('cycleType')
+  const tree = await Getdictionary('activateMethod')
   dataSource.value = (data?.records || []).map((item, index) => {
-    const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-    const periodName = (dictList.filter((dicVal) => dicVal.typeKey == enum_dict.FLOW_PERIOD) || []).find(val => val.value == item.period)?.label
-    const periodTypeName = (dictList.filter((dicVal) => dicVal.typeKey == enum_dict.CYCLE_TYPE) || []).find(val => val.value == item.period_type)?.label
-    const activationModeName = (dictList.filter((dicVal) => dicVal.typeKey == enum_dict.ACTIVATE_METHOD) || []).find(val => val.value == item.activation_mode)?.label
+
+    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
@@ -138,7 +140,6 @@ const evChangePage = (page) => {
 }
 
 
-
 const resetSearch = () => {
   proxy.$refs.formRef.resetFields()
   intData()
@@ -168,31 +169,30 @@ const handleEdit = (record) => {
   editMode.value = true;
   record.packageSize = Number(record.packageSize)
   record.standardPrice = Number(record.standardPrice)
-  editData.value = { ...record };
+  editData.value = {...record};
   newDataPackageFormVisible.value = true;
 };
 const handleDelete = (record) => {
   // Implement delete logic
-  Message.success(t('dataPackage.packageDeleted', { name: record.packageName }));
+  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 }));
+    Message.success(t('dataPackage.packageUpdated', {name: formData.packageName}));
   } else {
     // Implement add logic
-    Message.success(t('dataPackage.packageAdded', { name: formData.packageName }));
+    Message.success(t('dataPackage.packageAdded', {name: formData.packageName}));
   }
   newDataPackageFormVisible.value = false;
 };
 // -----------------------------------------------------
 // 获取字典
-const handleDictValue = () => {
-  const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
-  statusList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_PACKET_STATUS)
-  typeList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_USAGE_TYPE)
+const handleDictValue = async () => {
+  sourceList.value = await Getdictionary('source')
+  statusList.value = await Getdictionary('trafficPacketStatus')
+  typeList.value = await Getdictionary('trafficUsageType')
 }
 
 onMounted(() => {

+ 28 - 15
src/views/system/user/form.vue

@@ -93,34 +93,47 @@ const editStateComputed = computed(()=>{
 
 // 用户新增与编辑
 const handleSubmit = async (values) => {
+  let res; // 用于存储接口返回值
   if (props.data.id) {
+    // 编辑用户
     const param = {
       id: props.data.id,
       username: values.username,
       state: values.state,
       roleIds: values.roleIds,
-     
-      name: values.name
+      name: values.name,
+    };
+    if (values.password !== '') {
+      param.password = encryptByDES(values.password);
     }
-    if (values.password !== '') param.password =  encryptByDES(values.password)
-    await updateUserItem(param)
+    res = await updateUserItem(param); // 调用更新接口
   } else {
+    // 新增用户
     const param = {
-      password:  encryptByDES(values.password),
+      password: encryptByDES(values.password),
       username: values.username,
       state: values.state,
       roleIds: values.roleIds,
-   
-      name: values.name
-    }
-    await userAdd(param)
+      name: values.name,
+    };
+    res = await userAdd(param); // 调用新增接口
   }
-  Message.success({
-    content: '操作成功',
-    duration: 2000,
-  })
-  evSwitch()
-}
+
+  // 根据接口返回值判断是否继续
+  if (res && res.code === 200) {
+    Message.success({
+      content: '操作成功',
+      duration: 2000,
+    });
+    evSwitch(); // 触发回调函数
+  } else {
+    Message.error({
+      content: '操作失败,请重试!',
+      duration: 2000,
+    });
+  }
+};
+
 
 const getRoleList = async () => {
   const { data } = await systemFindRoleList({})

+ 51 - 52
src/views/tariffManagement/index.vue

@@ -43,14 +43,14 @@
             </a-option>
           </a-select>
         </a-form-item>
-<!--        计费周期-->
-<!--        <a-form-item field="label" :label="$t('tariffManagement.ChargingCycle')">-->
-<!--          <a-select v-model="formState.pricingUnit" style="width: 140px; margin-left: 8px;"  :placeholder="$t('lotCard.ChargingCycleName')">-->
-<!--            <a-option value="天">天</a-option>-->
-<!--            <a-option value="年">年</a-option>-->
-<!--            <a-option value="月">月</a-option>-->
-<!--          </a-select>-->
-<!--        </a-form-item>-->
+        <!--        计费周期-->
+        <!--        <a-form-item field="label" :label="$t('tariffManagement.ChargingCycle')">-->
+        <!--          <a-select v-model="formState.pricingUnit" style="width: 140px; margin-left: 8px;"  :placeholder="$t('lotCard.ChargingCycleName')">-->
+        <!--            <a-option value="天">天</a-option>-->
+        <!--            <a-option value="年">年</a-option>-->
+        <!--            <a-option value="月">月</a-option>-->
+        <!--          </a-select>-->
+        <!--        </a-form-item>-->
         <a-form-item>
           <a-space>
             <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
@@ -87,7 +87,6 @@
     </a-table>
 
 
-
     <!--资费 弹框 -->
     <a-modal :title="typeCurrent == 1 ? $t('form.Add') : $t('form.Edit')" v-model:visible="visible"
              @onCancel="resetForm" centered :maskClosable="false" :footer="null">
@@ -112,9 +111,9 @@
           </a-form-item>
         </template>
 
-<!--        <a-form-item :label="$t('tariffManagement.feeCode')" field="feeCode" required="">-->
-<!--          <a-input v-model="formState.feeCode"/>-->
-<!--        </a-form-item>-->
+        <!--        <a-form-item :label="$t('tariffManagement.feeCode')" field="feeCode" required="">-->
+        <!--          <a-input v-model="formState.feeCode"/>-->
+        <!--        </a-form-item>-->
         <a-form-item :label="$t('tariffManagement.label')" field="label">
           <a-input v-model="formState.label"/>
         </a-form-item>
@@ -163,8 +162,10 @@
         </a-form-item> -->
         <a-form-item :label="$t('tariffManagement.billingMethod')" field="billingMethod">
           <a-select v-model="formState.billingMethod">
-            <a-option v-for=" item in methodList" :key="item.id" :value="item.value">{{ item.label
-              }}</a-option>
+            <a-option v-for=" item in methodList" :key="item.id" :value="item.value">{{
+                item.label
+              }}
+            </a-option>
           </a-select>
         </a-form-item>
         <a-form-item :label="$t('tariffManagement.currency')" field="currency">
@@ -174,7 +175,7 @@
               }}
             </a-option>
           </a-select>
-        </a-form-item> 
+        </a-form-item>
         <div class="formTitle">计费信息</div>
         <a-form-item field="billingCycle" :label="$t('tariffManagement.billingCycle')" required>
           <a-radio-group v-model="formState.billingCycle">
@@ -184,11 +185,11 @@
         </a-form-item>
         <a-form-item field="bagSize" :label="$t('tariffManagement.bagSize')">
           <a-input v-model="formState.bagSize" :placeholder="$t('tariffManagement.bagSize')"/>
-<!--          <a-select v-model="formState.bagSizeUnit" style="width: 80px; margin-left: 8px;">-->
-<!--            <a-option value="KB">KB</a-option>-->
-<!--            <a-option value="MB">MB</a-option>-->
-<!--            <a-option value="GB">GB</a-option>-->
-<!--          </a-select>-->
+          <!--          <a-select v-model="formState.bagSizeUnit" style="width: 80px; margin-left: 8px;">-->
+          <!--            <a-option value="KB">KB</a-option>-->
+          <!--            <a-option value="MB">MB</a-option>-->
+          <!--            <a-option value="GB">GB</a-option>-->
+          <!--          </a-select>-->
         </a-form-item>
         <a-form-item field="pricing" :label="$t('tariffManagement.pricing')" required>
           <a-input v-model="formState.pricing" :placeholder="$t('tariffManagement.pricing')">
@@ -196,11 +197,11 @@
             </template>
           </a-input>
-<!--          <a-select v-model="formState.pricingUnit" style="width: 80px; margin-left: 8px;" placeholder="周期分类">-->
-<!--            <a-option value="天">天</a-option>-->
-<!--            <a-option value="年">年</a-option>-->
-<!--            <a-option value="月">月</a-option>-->
-<!--          </a-select>-->
+          <!--          <a-select v-model="formState.pricingUnit" style="width: 80px; margin-left: 8px;" placeholder="周期分类">-->
+          <!--            <a-option value="天">天</a-option>-->
+          <!--            <a-option value="年">年</a-option>-->
+          <!--            <a-option value="月">月</a-option>-->
+          <!--          </a-select>-->
         </a-form-item>
         <a-form-item field="settlementCycle" :label="$t('tariffManagement.cycleBuy')">
           <a-input v-model="formState.settlementCycleMap.starTime">
@@ -217,20 +218,20 @@
             </template>
           </a-input>
         </a-form-item>
-<!--        <a-form-item field="number" label="连接数">-->
-<!--          <a-input v-model="formState.number">-->
-<!--            <template #append>-->
-<!--              次-->
-<!--            </template>-->
-<!--          </a-input>-->
-<!--        </a-form-item>-->
-<!--        <a-form-item field="voice" label="语音被叫">-->
-<!--          <a-input v-model="formState.voice">-->
-<!--            <template #append>-->
-<!--              元/分-->
-<!--            </template>-->
-<!--          </a-input>-->
-<!--        </a-form-item>-->
+        <!--        <a-form-item field="number" label="连接数">-->
+        <!--          <a-input v-model="formState.number">-->
+        <!--            <template #append>-->
+        <!--              次-->
+        <!--            </template>-->
+        <!--          </a-input>-->
+        <!--        </a-form-item>-->
+        <!--        <a-form-item field="voice" label="语音被叫">-->
+        <!--          <a-input v-model="formState.voice">-->
+        <!--            <template #append>-->
+        <!--              元/分-->
+        <!--            </template>-->
+        <!--          </a-input>-->
+        <!--        </a-form-item>-->
         <a-form-item field="voice" label="计费函数">
           <a-input v-model="formState.billingFuc" placeholder="自动生成" :disabled="true"/>
 
@@ -280,14 +281,13 @@ import {Message, Notification} from '@arco-design/web-vue'
 import {deleteTariff, updateTariff, addTariff, tariffList} from "@/api/path/tariffManagement.api"
 import {getDataPlanList} from "@/api/path/lotCard.api"
 import {userList} from '@/api/path/system.api'
-
+import {Getdictionary} from '@/mixins/index.js'
 import {enum_dict} from "@/hooks/enum";
 import {useSystemStore} from '@/store/modules/systemStore'
 
 const role = useSystemStore()
 
 
-
 const {proxy} = getCurrentInstance()
 const formRef = ref()
 const searchForm = ref({
@@ -586,21 +586,20 @@ watch(
 
 // -------------------------------------------------------
 // 获取字典
-const handleDictValue = () => {
-  const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
-  trafficList.value = dictList.filter((item) => item.typeKey == enum_dict.BILLING_TYPE) // 计费分类
-  cycleist.value = dictList.filter((item) => item.typeKey == enum_dict.BILLING_CYCLE)
-  typeList.value = dictList.filter((item) => item.typeKey == enum_dict.BILLING_CYCLE)
-  methodList.value = dictList.filter((item) => item.typeKey == enum_dict.BILLING_METHOD)
+const handleDictValue = async () => {
+  sourceList.value = await Getdictionary('source')
+  trafficList.value = await Getdictionary('BillingType')
+  cycleist.value = await Getdictionary('Billingcycle')
+  typeList.value = await Getdictionary('Billingcycle')
+  methodList.value = await Getdictionary('billingMethod')
   // settlementCycleMap.value = dictList.filter((item) => item.typeKey == enum_dict.settlementCycle)
-  currency.value = dictList.filter(item=>item.typeKey == enum_dict.CURRENCY_TYPE)
+  currency.value = await Getdictionary('currencyType')
 }
 
 
-onMounted(() => {
-  handleDictValue()
-  intData()
+onMounted(async () => {
+  await intData()
+  await handleDictValue()
 })