吴sir пре 4 месеци
родитељ
комит
3bf91f45d6

+ 11 - 6
src/App.vue

@@ -39,12 +39,17 @@ onMounted(async () => {
   }
 
   if (systemStore?.token) {
-    const { code, data } = await dictionaryList({
-      size: 99999,
-      current: 1,
-    })
-    if (code == 200) {
-      window.localStorage.setItem('dictList', JSON.stringify(data.records))
+    try {
+      const res = await dictionaryList({
+        size: 99999,
+        current: 1,
+      })
+      if (res.code == 200) {
+        window.localStorage.setItem('dictList', JSON.stringify(res.data.records))
+      }
+    }
+    catch (error){
+      console.error(error)
     }
   }
 })

+ 1 - 0
src/components/upload/index.vue

@@ -6,6 +6,7 @@
       :file-list="fileList"
       :limit="minx"
       @before-remove="beforeRemove"
+      image-preview
   />
 </template>
 

+ 18 - 17
src/hooks/enum.js

@@ -1,27 +1,28 @@
 // 字典类型枚举值
 export const enum_dict = {
-    TRAFFIC_PACKET_STATUS: "traffic_packet _status", // 流量包状态
-    SUBSCRIPTION_RELATIONSHIP_STATUS: "subscription _relationship_status", // 订阅关系状态
-    MAIN_CARD_STATUS: "main_card_status", // 主卡状态
-    PACKAGE_TRIFF_PLAN_STATUS: "package_tariff_plan_status", // 套餐资费计划判断状态
-    SUPPLIER_SOURCE: "supplier_source", // 来源(订单管理列表-运营商)
+    TRAFFIC_PACKET_STATUS: "trafficPacketStatus", // 流量包状态
+    SUBSCRIPTION_RELATIONSHIP_STATUS: "subscriptionRelationshipStatus", // 订阅关系状态
+    MAIN_CARD_STATUS: "mainCardStatus", // 主卡状态
+    PACKAGE_TRIFF_PLAN_STATUS: "packageTariffPlanStatus", // 套餐资费计划判断状态
+    SUPPLIER_SOURCE: "supplierSource", // 来源(订单管理列表-运营商)
     TRAFFI_CTYPE: "TrafficType", // 流量类型
     SOURCE: "source", // 来源(资费列表)
-    CARD_TYPE: "card_type", // 卡类型
-    GROUP_POOL: "group_pool", // 组池
-    SILENCE: "silence_of", // 沉默期
+    CARD_TYPE: "cardType", // 卡类型
+    GROUP_POOL: "groupPool", // 组池
+    SILENCE: "silenceOf", // 沉默期
     BILLING_CYCLE: "Billingcycle", // 计费周期
     BILLING_TYPE: "BillingType", // 计费分类
     BILLING_METHOD: "billingMethod", // 计费方式
     SETTLEMENT_CYCLE: "settlementCycle", // 结算周期
     TRAFFIC_POOL_TYPE: "trafficPoolType", // 流量池类型
-    TRAFFIC_USAGE_TYPE: "traffic_usage_type", // 流量使用限制类型
-    CYCLE_TYPE: "cycle_type", // 周期类型
-    ACTIVATION_PACKAGE: "activation_package_method", // 激活卡套餐方法
-    FLOW_PACKET_TYPE: "flow_packet_type", // 流量包类型
-    DEDUCTION_MODEL: "deduction_model", // 套餐收费方式
-    FLOW_PERIOD: "flow_period", // 流量包套餐时长
-    ACTIVATE_METHOD: "activate_method", // 激活方式-激活计费方式
-    ORDER_AUDIT_STATUS: "order_audit_status", // 订单审核状态
-    ORDER_TYPE: "order_type", // 订单状态
+    TRAFFIC_USAGE_TYPE: "trafficUsageType", // 流量使用限制类型
+    CYCLE_TYPE: "cycleType", // 周期类型
+    ACTIVATION_PACKAGE: "activationPackageMethod", // 激活卡套餐方法
+    FLOW_PACKET_TYPE: "flowPacketType", // 流量包类型
+    DEDUCTION_MODEL: "deductionModel", // 套餐收费方式
+    FLOW_PERIOD: "flowPeriod", // 流量包套餐时长
+    ACTIVATE_METHOD: "activateMethod", // 激活方式-激活计费方式
+    ORDER_AUDIT_STATUS: "orderAuditStatus", // 订单审核状态
+    ORDER_TYPE: "orderType", // 订单状态
+    CURRENCY_TYPE:'currencyType', // 币种
 };

+ 10 - 10
src/views/flowPool/config.js

@@ -1,18 +1,18 @@
 export const columns = [
     { title: window.$t('flowPool.poolNumber'), dataIndex: 'poolNumber', align: 'center', width: 200 },
     { title: window.$t('flowPool.label'), dataIndex: 'label', align: 'center', width: 200 },
-    { title: window.$t('flowPool.userId'), dataIndex: 'user_id', align: 'center', width: 200 },
-    { title: window.$t('flowPool.trafficPoolType'), dataIndex: 'trafficPoolType', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.userId'), dataIndex: 'user_id', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.trafficPoolType'), dataIndex: 'trafficPoolType', align: 'center', width: 200 },
     { title: window.$t('flowPool.trafficPoolStatus'), dataIndex: 'trafficPoolStatus', align: 'center', width: 200 },
-    { title: window.$t('flowPool.cardFlow'), dataIndex: 'cardFlow', align: 'center', width: 200 },
-    { title: window.$t('flowPool.UsedMonth'), dataIndex: 'UsedMonth', align: 'center', width: 200 },
-    { title: window.$t('flowPool.surplusFlow'), dataIndex: 'surplusFlow', align: 'center', width: 200 },
-    { title: window.$t('flowPool.exceededFlow'), dataIndex: 'exceededFlow', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.cardFlow'), dataIndex: 'cardFlow', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.UsedMonth'), dataIndex: 'UsedMonth', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.surplusFlow'), dataIndex: 'surplusFlow', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.exceededFlow'), dataIndex: 'exceededFlow', align: 'center', width: 200 },
     { title: window.$t('flowPool.source'), dataIndex: 'sourceName', align: 'center', width: 200 },
-    { title: window.$t('flowPool.cardRariffName'), dataIndex: 'cardRariffName', align: 'center', width: 200 },
-    { title: window.$t('flowPool.cardNum'), dataIndex: 'cardNum', align: 'center', width: 200 },
-    { title: window.$t('flowPool.totalFlow'), dataIndex: 'totalFlow', align: 'center', width: 200 },
-    { title: window.$t('flowPool.updated_at'), dataIndex: 'updated_at', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.cardRariffName'), dataIndex: 'cardRariffName', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.cardNum'), dataIndex: 'cardNum', align: 'center', width: 200 },
+    // { title: window.$t('flowPool.totalFlow'), dataIndex: 'totalFlow', align: 'center', width: 200 },
+    { title: window.$t('flowPool.updated_at'), dataIndex: 'updatedAt', align: 'center', width: 200 },
     {
         title: window.$t('global.common.operations'),
         dataIndex: 'id',

+ 3 - 3
src/views/flowPool/customerFlowPool/index.vue

@@ -136,9 +136,9 @@ const resetSearch = () => {
 // 获取字典
 const handleDictValue = () => {
     const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-    sourceList.value = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
-    trafficList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_PACKET_STATUS)
-    typeList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_POOL_TYPE)
+    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)
 }
 
 

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

@@ -357,7 +357,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 {
@@ -366,13 +366,13 @@ const intData = async () => {
       trafficPoolType,
       trafficPoolStatus,
       poolNumber: "NR0" + (index + 1),
-      cardRariffName: "监控1G月租",
-      cardFlow: "1G/月",
-      cardNum: "11/100",
-      UsedMonth: "1.00G",
-      surplusFlow: "99.0G",
-      totalFlow: "100.0G",
-      exceededFlow: "--",
+      // cardRariffName: "监控1G月租",
+      // cardFlow: "1G/月",
+      // cardNum: "11/100",
+      // UsedMonth: "1.00G",
+      // surplusFlow: "99.0G",
+      // totalFlow: "100.0G",
+      // exceededFlow: "--",
     }
   })
   pagination.value.total = data.total
@@ -667,9 +667,10 @@ const handleCancel = () => {
 // 获取字典
 const handleDictValue = () => {
   const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
-  trafficList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_PACKET_STATUS)
-  typeList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_POOL_TYPE)
+  sourceList.value = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
+  trafficList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_PACKET_STATUS)
+  console.log(trafficList.value)
+  typeList.value = dictList.filter((item) => item.typeKey == enum_dict.TRAFFIC_POOL_TYPE)
 }
 
 onMounted(() => {

+ 3 - 3
src/views/flowPool/rearFlowPool/index.vue

@@ -677,9 +677,9 @@ const handleCancel = () => {
 // 获取字典
 const handleDictValue = () => {
   const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
-  trafficList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_PACKET_STATUS)
-  typeList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_POOL_TYPE)
+  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)
 }
 
 

+ 5 - 5
src/views/lotCard/cardList/config.js

@@ -1,16 +1,16 @@
 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: 'created_at', align: 'center', width: 200 },
+  { 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: 'updated_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: 'expire_time', align: 'center', width: 200 },
-  { title: window.$t('lotCard.UserId'), dataIndex: 'user_id', 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: 'last_modify_time', align: 'center', width: 200 },
+  { title: window.$t('lotCard.LastModifyTime'), dataIndex: 'lastModifyTime', align: 'center', width: 200 },
   {
     title: window.$t('global.common.operations'),
     dataIndex: 'id',

+ 4 - 4
src/views/lotCard/cardList/index.vue

@@ -115,7 +115,7 @@ const intData = async () => {
 
       res.data.records?.forEach(async (orderItem, index) => {
         // const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-        // const orderType = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
+        // const orderType = dictList.filter((item) => item.typeKey == enum_dict.SOURCE)
         const params = {
           iccid: orderItem.ICCID,
           childOrderId: orderItem.id,
@@ -235,9 +235,9 @@ const handleSearch = () => {
 // 获取字典
 const handleDictValue = () => {
   const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
-  statusList.value = dictList.filter((item) => item.type_key == enum_dict.MAIN_CARD_STATUS)
-  serviceList.value = dictList.filter((item) => item.type_key == enum_dict.ACTIVATION_PACKAGE)
+  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 resetSearch = () => {

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

@@ -120,8 +120,8 @@ const intData = async () => {
     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.type_key == enum_dict.SUBSCRIPTION_RELATIONSHIP_STATUS) || []).find(val => val.value == item.status)?.label
-        const sourceName = (dictList.filter((dicVal) => dicVal.type_key == enum_dict.SOURCE) || []).find(val => val.value == item.source)?.label
+        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,

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

@@ -259,8 +259,8 @@ const columns = [
   { title: '订阅状态', dataIndex: 'statusName', align: 'center' },
   { title: '审核状态', dataIndex: 'orderTypeName', align: 'center' },
   { title: '采购数量', dataIndex: 'quantity', align: 'center' },
-  { title: '支付金额', dataIndex: 'payment_amount', align: 'center' },
-  { title: '下单时间', dataIndex: 'created_at', align: 'center' },
+  { title: '支付金额', dataIndex: 'paymentAmount', align: 'center' },
+  { title: '下单时间', dataIndex: 'createdAt', align: 'center' },
   { title: '操作', slotName: 'operate', align: 'center' }
 ];
 const columnsDetail = [{ title: 'ICCID', dataIndex: 'iccid' },
@@ -339,10 +339,11 @@ const showAudit = ref(false);
 
 const handleDictValue = () => {
   const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
-  orderType.value = dictList.filter((item) => item.type_key == enum_dict.CARD_TYPE)
-  flowPoolData.value = dictList.filter((item) => item.type_key == enum_dict.GROUP_POOL)
-  silenceOptions.value = dictList.filter((item) => item.type_key == enum_dict.SILENCE)
+  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 intData = () => {
@@ -353,8 +354,8 @@ const intData = () => {
   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.type_key == enum_dict.SUBSCRIPTION_RELATIONSHIP_STATUS)?.find(val => item.status == val.value)?.label
-      const orderTypeName = dictList.filter((item) => item.type_key == enum_dict.ORDER_AUDIT_STATUS)?.find(val => item.status == val.value)?.label
+      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
 
       return {
         ...item,

+ 4 - 4
src/views/order/ReturnCard/index.vue

@@ -330,10 +330,10 @@ const intData = () => {
   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.type_key == enum_dict.SOURCE)?.find(val => item.source == val.value)?.label
-      const cardTypeName = dictList.filter((item) => item.type_key == enum_dict.CARD_TYPE)?.find(val => item.card_type == val.value)?.label
-      const statusName = dictList.filter((item) => item.type_key == enum_dict.SUBSCRIPTION_RELATIONSHIP_STATUS)?.find(val => item.status == val.value)?.label
-      const moderationStatusName = dictList.filter((item) => item.type_key == enum_dict.ORDER_AUDIT_STATUS)?.find(val => item.moderation_status == val.value)?.label
+      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
 
       return {
         ...item,

+ 2 - 2
src/views/supplier/trafficList/config.js

@@ -1,11 +1,11 @@
 export const columns = [
   { title: window.$t('dataPackage.id'), dataIndex: 'id', align: 'center', width: 200 },
-  { title: window.$t('dataPackage.superiorId'), dataIndex: 'superior_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: 'last_modify_time', 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 },

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

@@ -100,9 +100,9 @@ const intData = async () => {
   const { data } = await getDataPlanList(param)
   dataSource.value = (data?.records || []).map((item, index) => {
     const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-    const periodName = (dictList.filter((dicVal) => dicVal.type_key == enum_dict.FLOW_PERIOD) || []).find(val => val.value == item.period)?.label
-    const periodTypeName = (dictList.filter((dicVal) => dicVal.type_key == enum_dict.CYCLE_TYPE) || []).find(val => val.value == item.period_type)?.label
-    const activationModeName = (dictList.filter((dicVal) => dicVal.type_key == enum_dict.ACTIVATE_METHOD) || []).find(val => val.value == item.activation_mode)?.label
+    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 sourceName = sourceList.value.find(val => val.value == item.source)?.label
@@ -190,9 +190,9 @@ const handleNewDataPackageSubmit = (formData) => {
 // 获取字典
 const handleDictValue = () => {
   const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
-  statusList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_PACKET_STATUS)
-  typeList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_USAGE_TYPE)
+  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)
 }
 
 onMounted(() => {

+ 13 - 13
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.type_label" style="margin: 0 0.6rem" placeholder="请输入字典名称"/>
-        <a-input v-model="formData.type_key" 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>
@@ -62,15 +62,15 @@ const formRef = ref();
 const dicId = ref(null);
 
 const formData = ref({
-  type_key: '',
-  type_label: '',
+  typeKey: '',
+  typeLabel: '',
 
 });
 const columns = ref([
   {title: '数据键值', dataIndex: 'value', align: 'center', width: 120},
   {title: '数据标签', dataIndex: 'label', align: 'center', width: 120},
-  {title: '字典名称', dataIndex: 'type_label', align: 'center', width: 120},
-  {title: '字典类型', dataIndex: 'type_key', align: 'center', width: 150},
+  {title: '字典名称', dataIndex: 'typeLabel', align: 'center', width: 120},
+  {title: '字典类型', dataIndex: 'typeKey', align: 'center', width: 150},
   {
     title: '备注',
     dataIndex: 'remark',
@@ -139,16 +139,16 @@ const intData = async () => {
   }
   const {data} = await dictionaryList(param)
   dataSource.value = data.records.reduce((acc, res) => {
-    let existingItem = acc.find(item => item.type_key === res.type_key);
+    let existingItem = acc.find(item => item.typeKey === res.typeKey);
 
     if (existingItem) {
-      // 如果已经存在相同type_key的项,将当前项添加到其children数组中
+      // 如果已经存在相同typeKey的项,将当前项添加到其children数组中
       if (!existingItem.children) {
         existingItem.children = [];
       }
       existingItem.children.push(res);
     } else {
-      // 如果不存在相同type_key的项,直接添加到结果数组acc中
+      // 如果不存在相同typeKey的项,直接添加到结果数组acc中
       acc.push(res);
     }
 
@@ -197,8 +197,8 @@ const dictShowModel = (type, data) => {
     dicId.value = data.id;
     formState.label = data.label;
     formState.value = data.value;
-    formState.typeKey = data.type_key;
-    formState.typeLabel = data.type_label;
+    formState.typeKey = data.typeKey;
+    formState.typeLabel = data.typeLabel;
     formState.remark = data.remark;
   }
 }
@@ -223,8 +223,8 @@ const evChangePage = (page) => {
 
 // 重置
 const resetSelectData = () => {
-  formData.value.type_key = "";
-  formData.value.type_label = "";
+  formData.value.typeKey = "";
+  formData.value.typeLabel = "";
   intData();
 }
 

+ 101 - 91
src/views/tariffManagement/index.vue

@@ -9,6 +9,7 @@
     </div>
     <!-- 搜索条件区 -->
     <div class="search-section">
+
       <a-form :model="searchForm" layout="inline">
         <!--        资费名称-->
         <a-form-item field="label" :label="$t('tariffManagement.label')">
@@ -67,7 +68,6 @@
         <template #default>{{ $t('form.Add') }}</template>
       </a-button>
     </div>
-
     <a-table row-key="id" :data="dataSource" :columns="role.getRole == 1 ? columns : columnsCustomer"
              :pagination="pagination" :scroll="{ x: 'auto' }" @page-change="evChangePage">
       <template #id="{ record }">
@@ -87,6 +87,7 @@
     </a-table>
 
 
+
     <!--资费 弹框 -->
     <a-modal :title="typeCurrent == 1 ? $t('form.Add') : $t('form.Edit')" v-model:visible="visible"
              @onCancel="resetForm" centered :maskClosable="false" :footer="null">
@@ -101,8 +102,8 @@
           </a-select>
         </a-form-item>
         <template v-if="formState.source">
-          <a-form-item :label="$t('tariffManagement.simDataPlanId')" field="sim_data_plan_id">
-            <a-select v-model="formState.sim_data_plan_id">
+          <a-form-item :label="$t('tariffManagement.simDataPlanId')" field="simDataPlanId">
+            <a-select v-model="formState.simDataPlanId">
               <a-option v-for=" item in planList" :key="item.superior_id" :value="item.id"> 流量包{{
                   item.id
                 }}
@@ -111,72 +112,78 @@
           </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>
-<!--        <a-form-item :label="$t('tariffManagement.userId')" field="user_id">-->
-<!--          <a-select v-model="formState.user_id">-->
-<!--            <a-option v-for=" item in userIdList" :key="item.id" :value="item.id">{{-->
-<!--                item.name-->
-<!--              }}-->
-<!--            </a-option>-->
-<!--          </a-select>-->
-<!--        </a-form-item>-->
-        <a-form-item :label="$t('tariffManagement.trafficType')" field="traffic_type">
-          <a-select v-model="formState.traffic_type">
+        <a-form-item :label="$t('tariffManagement.userId')" field="userId">
+          <a-select v-model="formState.userId">
+            <a-option v-for=" item in userIdList" :key="item.id" :value="item.id">{{
+                item.name
+              }}
+            </a-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item :label="$t('tariffManagement.trafficType')" field="trafficType">
+          <a-select v-model="formState.trafficType">
             <a-option v-for=" item in trafficList" :key="item.id" :value="item.value">{{
                 item.label
               }}
             </a-option>
           </a-select>
         </a-form-item>
-        <a-form-item :label="$t('tariffManagement.billingType')" field="billing_type">
-          <a-select v-model="formState.billing_type">
+        <a-form-item :label="$t('tariffManagement.billingType')" field="billingType">
+          <a-select v-model="formState.billingType">
             <a-option v-for=" item in typeList" :key="item.id" :value="item.value">{{
                 item.label
               }}
             </a-option>
           </a-select>
         </a-form-item>
-        <!-- <a-form-item :label="$t('tariffManagement.bagSize')" field="bag_size">
-            <a-input v-model="formState.bag_size" />
+        <!-- <a-form-item :label="$t('tariffManagement.bagSize')" field="bagSize">
+            <a-input v-model="formState.bagSize" />
         </a-form-item>
-        <a-form-item :label="$t('tariffManagement.billingCycle')" field="billing_cycle">
-            <a-select v-model="formState.billing_cycle">
+        <a-form-item :label="$t('tariffManagement.billingCycle')" field="billingCycle">
+            <a-select v-model="formState.billingCycle">
                 <a-option v-for=" item in cycleist" :key="item.id" :value="item.value">{{ item.label
                     }}</a-option>
             </a-select>
         </a-form-item>
-        <a-form-item :label="$t('tariffManagement.billingMethod')" field="billing_method">
-            <a-select v-model="formState.billing_method">
-                <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.settlementCycle')" field="settlement_cycle">
-            <a-select v-model="formState.settlement_cycle">
+
+        <a-form-item :label="$t('tariffManagement.settlementCycle')" field="settlementCycle">
+            <a-select v-model="formState.settlementCycle">
                 <a-option v-for=" item in settlementCycleMap" :key="item.id" :value="item.value">{{ item.label
                     }}</a-option>
             </a-select>
         </a-form-item>
         <a-form-item :label="$t('tariffManagement.pricing')" field="pricing">
             <a-input v-model="formState.pricing" />
+        </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-select>
         </a-form-item>
         <a-form-item :label="$t('tariffManagement.currency')" field="currency">
-            <a-input v-model="formState.currency" />
-        </a-form-item> -->
+          <a-select v-model="formState.billingType">
+            <a-option v-for=" item in currency" :key="item.id" :value="item.value">{{
+                item.label
+              }}
+            </a-option>
+          </a-select>
+        </a-form-item> 
         <div class="formTitle">计费信息</div>
-        <a-form-item field="billing_cycle" :label="$t('tariffManagement.billingCycle')" required>
-          <a-radio-group v-model="formState.billing_cycle">
+        <a-form-item field="billingCycle" :label="$t('tariffManagement.billingCycle')" required>
+          <a-radio-group v-model="formState.billingCycle">
             <a-radio value="1">按天</a-radio>
             <a-radio value="2">按月</a-radio>
           </a-radio-group>
         </a-form-item>
-        <a-form-item field="bag_size" :label="$t('tariffManagement.bagSize')">
-          <a-input v-model="formState.bag_size" :placeholder="$t('tariffManagement.bagSize')"/>
+        <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>
@@ -210,20 +217,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,12 +287,15 @@ import {useSystemStore} from '@/store/modules/systemStore'
 const role = useSystemStore()
 
 
+
 const {proxy} = getCurrentInstance()
 const formRef = ref()
 const searchForm = ref({
   "label": "",
 });
 
+const currency = ref([])
+
 
 const dataSource = ref([]);
 const route = useRoute();
@@ -313,10 +323,10 @@ const intData = async () => {
   const {data} = await tariffList(param)
   dataSource.value = (data.records || []).map((item, index) => {
     const sourceName = sourceList.value.find(val => val.value == item.source)?.label
-    const trafficTypeName = trafficList.value.find(val => val.value == item.traffic_type)?.label
-    const billingTypeName = typeList.value.find(val => val.value == item.billing_type)?.label
-    const billingCycleName = cycleist.value.find(val => val.value == item.billing_cycle)?.label
-    // const methodName = methodList.value.find(val => val.value == item.billing_method)?.label
+    const trafficTypeName = trafficList.value.find(val => val.value == item.trafficType)?.label
+    const billingTypeName = typeList.value.find(val => val.value == item.billingType)?.label
+    const billingCycleName = cycleist.value.find(val => val.value == item.billingCycle)?.label
+    const methodName = methodList.value.find(val => val.value == item.billingMethod)?.label
     return {
       ...item,
       sourceName,
@@ -376,23 +386,23 @@ const formState = ref({
   // 资费名称(必填)
   "label": "",
   // 流量包ID(必填)
-  "sim_data_plan_id": null,
+  "simDataPlanId": null,
   // 用户ID(必填)
-  // "user_id": null,
+  "userId": null,
   // 来源(必填)
   "source": "",
   // 流量类型(必填)
-  "traffic_type": "",
+  "trafficType": "",
   // 计费类型(必填)
-  "billing_type": "",
+  "billingType": "",
   // 流量包Size(必填)
-  "bag_size": "",
+  "bagSize": "",
   // 计费周期(必填)
-  "billing_cycle": "",
+  "billingCycle": "",
   // 计费方式(必填)
-  "billing_method": "1",
+  "billingMethod": "",
   // 结算周期(必填)
-  "settlement_cycle": "",
+  "settlementCycle": "",
   // 价格(必填)
   "pricing": "",
   // 币种(必填)
@@ -410,14 +420,14 @@ const formState = ref({
 
 const rules = {
   label: [{required: true, trigger: 'change',}],
-  sim_data_plan_id: [{required: true, trigger: 'change',}],
-  // user_id: [{required: true, trigger: 'change',}],
+  simDataPlanId: [{required: true, trigger: 'change',}],
+  userId: [{required: true, trigger: 'change',}],
   source: [{required: true, trigger: 'change',}],
-  traffic_type: [{required: true, trigger: 'change',}],
-  billing_type: [{required: true, trigger: 'change',}],
-  bag_size: [{required: true, trigger: 'change',}],
-  billing_cycle: [{required: true, trigger: 'change',}],
-  billing_method: [{required: true, trigger: 'change',}],
+  trafficType: [{required: true, trigger: 'change',}],
+  billingType: [{required: true, trigger: 'change',}],
+  bagSize: [{required: true, trigger: 'change',}],
+  billingCycle: [{required: true, trigger: 'change',}],
+  billingMethod: [{required: true, trigger: 'change',}],
   // pricing: [{ required: true, trigger: 'change', }],
   currency: [{required: true, trigger: 'change',}],
 };
@@ -433,18 +443,18 @@ const handleSubmit = ({values, errors}) => {
       delete formVal.pricingUnit
 
       formVal.currency = '1'
-      formVal.user_id = Number(values.user_id)
-      formVal.sim_data_plan_id = String(values.sim_data_plan_id)
+      formVal.userId = Number(values.userId)
+      formVal.simDataPlanId = String(values.simDataPlanId)
       if (values.settlementCycleMap.starTime && values.settlementCycleMap.starTime) {
-        formVal.settlement_cycle = values.settlementCycleMap.starTime + '~' + values.settlementCycleMap.endTime
+        formVal.settlementCycle = values.settlementCycleMap.starTime + '~' + values.settlementCycleMap.endTime
       } else {
         Message.warning({
           content: "请选择订购周期!",
           duration: 2000,
         })
       }
-      if (values.bag_size && values.bagSizeUnit) {
-        values.bag_size = values.bag_size + values.bagSizeUnit
+      if (values.bagSize && values.bagSizeUnit) {
+        values.bagSize = values.bagSize + values.bagSizeUnit
       }
       if (values.pricingUnit) {
         values.pricing = values.pricing + '元/' + values.pricingUnit
@@ -486,19 +496,19 @@ const dictShowModel = (type, data) => {
   // 编辑
   if (type == 2) {
     Object.assign(formState.value, data);
-    formState.value.sim_data_plan_id = Number(formState.value.sim_data_plan_id)
-    formState.value.user_id = Number(formState.value.user_id)
-    if (data.bag_size) {
-      formState.value.bagSizeUnit = data.bag_size.replace(/\d/g, '')
-      formState.value.bag_size = data.bag_size.match(/\d+/)[0]
+    formState.value.simDataPlanId = Number(formState.value.simDataPlanId)
+    formState.value.userId = Number(formState.value.userId)
+    if (data.bagSize) {
+      formState.value.bagSizeUnit = data.bagSize.replace(/\d/g, '')
+      formState.value.bagSize = data.bagSize.match(/\d+/)[0]
     }
     if (data.pricing) {
       formState.value.pricingUnit = data.pricing.split('/')[1] || ''
       formState.value.pricing = data.pricing.match(/\d+/)[0] || ''
     }
-    if (data.settlement_cycle) {
-      formState.value.settlementCycleMap.starTime = data.settlement_cycle.split('~')[0] || ''
-      formState.value.settlementCycleMap.endTime = data.settlement_cycle.split('~')[1] || ''
+    if (data.settlementCycle) {
+      formState.value.settlementCycleMap.starTime = data.settlementCycle.split('~')[0] || ''
+      formState.value.settlementCycleMap.endTime = data.settlementCycle.split('~')[1] || ''
     }
   }
   nextTick(() => {
@@ -513,7 +523,7 @@ const handleModelId = async () => {
     size: 999,
   }
   userList(param).then(res => {
-    userIdList.value = (res.data.records || []).filter((item) => item.user_type == '2')
+    userIdList.value = (res.data.records || []).filter((item) => item.userType == '2')
   })
 }
 const handleDataPlan = async () => {
@@ -557,7 +567,7 @@ const handleCancel = () => {
 }
 const handleSubmitPlan = () => {
   if (selectedKeysPlan.value.length > 0) {
-    formState.value.sim_data_plan_id = String(selectedKeysPlan.value[0])
+    formState.value.simDataPlanId = String(selectedKeysPlan.value[0])
     planVisible.value = false
   }
 
@@ -578,13 +588,13 @@ watch(
 // 获取字典
 const handleDictValue = () => {
   const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
-  sourceList.value = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
-  console.log(sourceList.value)
-  trafficList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFI_CTYPE)
-  cycleist.value = dictList.filter((item) => item.type_key == enum_dict.BILLING_CYCLE)
-  typeList.value = dictList.filter((item) => item.type_key == enum_dict.BILLING_TYPE)
-  methodList.value = dictList.filter((item) => item.type_key == enum_dict.BILLING_METHOD)
-  settlementCycleMap.value = dictList.filter((item) => item.type_key == enum_dict.SETTLEMENT_CYCLE)
+  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.billingCycle)
+  typeList.value = dictList.filter((item) => item.typeKey == enum_dict.billingType)
+  methodList.value = dictList.filter((item) => item.typeKey == enum_dict.BILLING_METHOD)
+  settlementCycleMap.value = dictList.filter((item) => item.typeKey == enum_dict.settlementCycle)
+  currency.value = dictList.filter(item=>item.typeKey == enum_dict.CURRENCY_TYPE)
 }