wxy 4 сар өмнө
parent
commit
1c649f0f28

+ 5 - 0
src/api/path/tariffManagement.api.js

@@ -38,4 +38,9 @@ export function UpdateTariffTtems(data) {
 // 删除资费商品
 export function DeleteTariffItems(params) {
     return service.get('/admin/platform/deleteTariffProduct', { params })
+}
+
+// 查询客户下的流量池
+export function ExampleQueryTrafficPool() {
+    return service.get('/admin/platform/customerTrafficPool')
 }

+ 2 - 2
src/views/flowPool/customerFlowPool/config.js

@@ -10,10 +10,10 @@ export const columns = [
     // { 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.tariffName'), dataIndex: 'simTariffName', align: 'center', width: 200 },
-    { title: window.$t('flowPool.ActivatedName'),dataIndex:'Activated', align: 'center', width: 200 },
+    { title: window.$t('flowPool.ActivatedName'), dataIndex: 'Activated', align: 'center', width: 200 },
     { title: window.$t('flowPool.HaveBeenUsedName'), dataIndex: 'HaveBeenUsed', 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 },
-]
+]

+ 10 - 17
src/views/flowPool/customerFlowPool/index.vue

@@ -34,8 +34,6 @@
             </template>
 
         </a-table>
-
-
     </div>
 </template>
 
@@ -43,16 +41,12 @@
 import { onMounted, ref, reactive, getCurrentInstance } from "vue";
 import { useRoute } from "vue-router";
 import { columns } from "./config";
-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()
+import { lotCatdList } from "@/api/path/flowPool.api"
+import { Getdictionary } from '@/mixins/index.js'
+
 const formRef = ref()
 const searchForm = ref({
     "label": "",
-    "trafficPoolType": ""
 });
 
 const typeList = ref([]);
@@ -73,16 +67,18 @@ const intData = async () => {
         size: pagination.value.pageSize,
         ...searchForm.value,
     }
-    const { data } = await trafficPoolList(param)
+    const { data } = await lotCatdList(param)
     dataSource.value = (data.records || []).map((item, index) => {
-        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
+        const Activated = 0 + '/' + item.iccids?.length
+        const HaveBeenUsed = 0 + '/' + item.size + item.sizeType
         return {
             ...item,
             sourceName,// 运营商名称
-            trafficPoolType,
             trafficPoolStatus,
+            Activated: Activated,
+            HaveBeenUsed: HaveBeenUsed,
         }
     })
     pagination.value.total = data.total
@@ -102,8 +98,8 @@ const resetSearch = () => {
 }
 
 const handleDictValue = async () => {
-  sourceList.value = await Getdictionary('source')
-
+    sourceList.value = await Getdictionary('source')
+    trafficList.value = await Getdictionary('trafficPacketStatus')
 }
 
 
@@ -111,9 +107,6 @@ onMounted(async () => {
     await handleDictValue()
     await intData()
 })
-
-
-
 </script>
 
 <style scoped lang="less">

+ 1 - 1
src/views/flowPool/index.vue

@@ -136,7 +136,6 @@ const intData = async () => {
     // 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(sourceName);
     const Activated = 0 + '/' + item.iccids?.length
     const HaveBeenUsed = 0 + '/' + item.size + item.sizeType
     return {
@@ -188,6 +187,7 @@ const handelForewring = (item) => {
 
 const handleDictValue = async () => {
   sourceList.value = await Getdictionary('source')
+  trafficList.value = await Getdictionary('trafficPacketStatus')
 }
 
 onMounted(async () => {

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

@@ -1,45 +1,45 @@
 export const columns = [
-  { title: window.$t('lotCard.iccid'), dataIndex: 'iccid', align: 'center',  ellipsis:true },
-  { title: window.$t('lotCard.source'), dataIndex: 'sourceName', align: 'center',  ellipsis:true },
-  { title: 'IMSI', dataIndex: 'account', align: 'center', ellipsis:true},
-  { title: 'SIM绑定的IMSI', dataIndex: 'currentImsi', align: 'center', ellipsis:true  },
-  // { title: 'SIM货币余额', dataIndex: 'moneyBalances', align: 'center', ellipsis:true  },
-  { title: 'SIM生成日期', dataIndex: 'createTime', align: 'center',  ellipsis:true },
-  { title: '支付方式', dataIndex: 'payType', align: 'center', ellipsis:true  },
-  { title: 'SIM状态', dataIndex: 'accountStatus', align: 'center', ellipsis:true  },
-  { title: '预警状态', dataIndex: 'accountStatus', align: 'center', ellipsis:true  },
-  { title: '已使用总流量', dataIndex: 'dataUsageTotal', align: 'center',  ellipsis:true },
-  { title: '语音呼入分钟数', dataIndex: 'voiceMtTotal', align: 'center', ellipsis:true  },
-  { title: '语音呼出分钟数', dataIndex: 'voiceMoTotal', align: 'center', ellipsis:true  },
-  { title: '总语音分钟数', dataIndex: 'voiceTotal', align: 'center',  ellipsis:true },
-  { title: '发短信数', dataIndex: 'smsTotal', align: 'center',  ellipsis:true },
-  { title: 'SIM有效期(月)', dataIndex: 'validMonth', align: 'center', ellipsis:true  },
-  { title: 'SIM关闭日期', dataIndex: 'closeTime', align: 'center', ellipsis:true  },
-  { title: 'SIM激活日期', dataIndex: 'activeTime', align: 'center',  ellipsis:true },
-  { title: 'IMSI所属供应商名称', dataIndex: 'currentImsiProvider', align: 'center',  ellipsis:true },
-  { title: '卡套餐', dataIndex: 'dataPackageName', align: 'center',  ellipsis:true },
-  { title: '预警状态', dataIndex: 'forewarningStatus', align: 'center', width: 200 ,ellipsis:true},
-  { title: '历史用量', dataIndex: 'HistoricalUsage', align: 'center', width: 200 ,ellipsis:true},
-  { title: '池名称/编号', dataIndex: 'poolNum', align: 'center', width: 200 ,ellipsis:true},
-  { title: '沉默期到期时间', dataIndex: 'SilenceEndtime', align: 'center', width: 200 ,ellipsis:true},
-  { title: '已用(套餐流量)', dataIndex: 'usedFlowrate', align: 'center', width: 200 ,ellipsis:true},
-  { title: '可用(套餐流量)', dataIndex: 'usableFlowrate', align: 'center', width: 200 ,ellipsis:true},
-  { title: '已用(加油包流量)', dataIndex: 'usedBg', align: 'center', width: 200 ,ellipsis:true},
-  { title: '可用(加油包流量)', dataIndex: 'usableBg', align: 'center', width: 200 ,ellipsis:true},
-  {
-    title: window.$t('global.common.operations'),
-    dataIndex: 'id',
-    slotName: 'id',
-    align: 'center',
-    width: 200,
-    fixed: "right",
-  }
+    { title: window.$t('lotCard.iccid'), dataIndex: 'iccid', align: 'center', ellipsis: true },
+    { title: window.$t('lotCard.source'), dataIndex: 'sourceName', align: 'center', ellipsis: true },
+    { title: '客户名称', dataIndex: 'userName', align: 'center', ellipsis: true },
+    { title: 'IMSI', dataIndex: 'account', align: 'center', ellipsis: true },
+    { title: 'SIM绑定的IMSI', dataIndex: 'currentImsi', align: 'center', ellipsis: true },
+    // { title: 'SIM货币余额', dataIndex: 'moneyBalances', align: 'center', ellipsis:true  },
+    { title: 'SIM生成日期', dataIndex: 'createTime', align: 'center', ellipsis: true },
+    { title: '支付方式', dataIndex: 'payType', align: 'center', ellipsis: true },
+    { title: 'SIM状态', dataIndex: 'accountStatus', align: 'center', ellipsis: true },
+    { title: '预警状态', dataIndex: 'accountStatus', align: 'center', ellipsis: true },
+    { title: '已使用总流量', dataIndex: 'dataUsageTotal', align: 'center', ellipsis: true },
+    { title: '语音呼入分钟数', dataIndex: 'voiceMtTotal', align: 'center', ellipsis: true },
+    { title: '语音呼出分钟数', dataIndex: 'voiceMoTotal', align: 'center', ellipsis: true },
+    { title: '总语音分钟数', dataIndex: 'voiceTotal', align: 'center', ellipsis: true },
+    { title: '发短信数', dataIndex: 'smsTotal', align: 'center', ellipsis: true },
+    { title: 'SIM有效期(月)', dataIndex: 'validMonth', align: 'center', ellipsis: true },
+    { title: 'SIM关闭日期', dataIndex: 'closeTime', align: 'center', ellipsis: true },
+    { title: 'SIM激活日期', dataIndex: 'activeTime', align: 'center', ellipsis: true },
+    { title: 'IMSI所属供应商名称', dataIndex: 'currentImsiProvider', align: 'center', ellipsis: true },
+    { title: '卡套餐', dataIndex: 'dataPackageName', align: 'center', ellipsis: true },
+    { title: '预警状态', dataIndex: 'forewarningStatus', align: 'center', width: 200, ellipsis: true },
+    { title: '历史用量', dataIndex: 'HistoricalUsage', align: 'center', width: 200, ellipsis: true },
+    { title: '池名称/编号', dataIndex: 'poolNum', align: 'center', width: 200, ellipsis: true },
+    { title: '沉默期到期时间', dataIndex: 'SilenceEndtime', align: 'center', width: 200, ellipsis: true },
+    { title: '已用(套餐流量)', dataIndex: 'usedFlowrate', align: 'center', width: 200, ellipsis: true },
+    { title: '可用(套餐流量)', dataIndex: 'usableFlowrate', align: 'center', width: 200, ellipsis: true },
+    { title: '已用(加油包流量)', dataIndex: 'usedBg', align: 'center', width: 200, ellipsis: true },
+    { title: '可用(加油包流量)', dataIndex: 'usableBg', align: 'center', width: 200, ellipsis: true },
+    {
+        title: window.$t('global.common.operations'),
+        dataIndex: 'id',
+        slotName: 'id',
+        align: 'center',
+        width: 200,
+        fixed: "right",
+    }
 ]
 
 export const columnsTrafficUse = [
-  { title: window.$t('lotCard.appName'), dataIndex: 'appName', align: 'center',   },
-  { title: window.$t('lotCard.mcc'), dataIndex: 'mcc', align: 'center', width: 100 },
-  { title: window.$t('lotCard.qtaconsumption'), dataIndex: 'qtaconsumption', align: 'center',   },
-  { title: window.$t('lotCard.time'), dataIndex: 'time', align: 'center',   },
-]
-
+    { title: window.$t('lotCard.appName'), dataIndex: 'appName', align: 'center', },
+    { title: window.$t('lotCard.mcc'), dataIndex: 'mcc', align: 'center', width: 100 },
+    { title: window.$t('lotCard.qtaconsumption'), dataIndex: 'qtaconsumption', align: 'center', },
+    { title: window.$t('lotCard.time'), dataIndex: 'time', align: 'center', },
+]

+ 1 - 1
src/views/lotCard/cardList/trafficUseDialog.vue

@@ -171,7 +171,7 @@ const option = ref({
   },
   series: [
     {
-      data: [120, 200, 150, 80, 70, 110, 130],
+      data: [],
       type: 'bar',
     }
   ],

+ 26 - 13
src/views/order/BuyCard/Card.vue

@@ -33,9 +33,9 @@
                     </template>
                 </a-radio-group>
             </a-form-item>
-            <a-form-item label="流量池" v-if="formState.isTrafficPool==1">
-                <a-select v-model="formState.periodOfSilence" :style="{ width: '380px' }" placeholder="请选择流量池">
-                    <a-option v-for="item of silenceOptions" :value="item.value" :label="item.label" />
+            <a-form-item label="流量池" v-if="formState.isTrafficPool == 1">
+                <a-select v-model="formState.poolId" :style="{ width: '380px' }" placeholder="请选择流量池">
+                    <a-option v-for="item of FlowPool" :value="item.id" :label="item.label" />
                 </a-select>
             </a-form-item>
             <a-form-item label="购卡数量" field="num">
@@ -51,9 +51,9 @@
 
 <script setup>
 import { ref, toRefs, defineProps, watch, toRef } from 'vue';
-import { tariffList } from "@/api/path/tariffManagement.api";
+import { tariffList, ExampleQueryTrafficPool } from "@/api/path/tariffManagement.api";
 import { Getdictionary } from '@/mixins/index.js'
-import {CardPurchase} from '@/api/path/order'
+import { CardPurchase } from '@/api/path/order'
 import { Message } from '@arco-design/web-vue';
 const props = defineProps({
     modelValue: {
@@ -75,16 +75,18 @@ const state = ref({
         periodOfSilence: "", // 静默期
         isTrafficPool: "", // 是否是流量池 1:是 2:否
         quantity: null, // 采购数量
-        simType: "" // 卡类型
+        simType: "" ,// 卡类型
+        poolId: null,
     },
     sourceList: [],
     silenceOptions: [], // 沉默期
     orderType: [], // 卡类型
     flowPoolData: [], // 组池
-    tariffData:[]
+    tariffData: [],
+    FlowPool: [], // 流量池
 })
 
-const { showAudit, formState, sourceList, silenceOptions, orderType, flowPoolData, userName, userType ,tariffData,formRef} = toRefs(state.value)
+const { showAudit, formState, sourceList, silenceOptions, orderType, flowPoolData, userName, userType, tariffData, formRef, FlowPool } = toRefs(state.value)
 
 const rules = {
     source: [{ required: true, trigger: 'change', }],
@@ -118,6 +120,12 @@ const rules = {
             trigger: 'change',
         },
     ],
+    poolId: [
+        {
+            required: true,
+            trigger: 'change',
+        },
+    ],
 };
 
 const handleDictValue = async () => {
@@ -156,7 +164,8 @@ const submitPurchase = ({ values, errors }) => {
                 quantity: Number(formState.value.quantity),
                 simType: formState.value.simType,
                 periodOfSilence: String(formState.value.periodOfSilence),
-                isTrafficPool: formState.value.isTrafficPool
+                isTrafficPool: formState.value.isTrafficPool,
+                poolId: formState.value.poolId,
             }
             CardPurchase(data).then(res => {
                 Message.success(res.message)
@@ -174,11 +183,15 @@ const closeModal = (val) => {
     })
 }
 // 流量池
-watch(()=>formState.value?.isTrafficPool,val=>{
-    console.log(val);
+watch(() => formState.value?.isTrafficPool, val => {
+    if (val == 1) {
+        ExampleQueryTrafficPool().then(res => {
+            FlowPool.value = res.data
+        })
+    }
 })
-watch(()=>modelValue.value,val=>{
-    if(val){
+watch(() => modelValue.value, val => {
+    if (val) {
         handleDictValue()
     }
 })

+ 25 - 14
src/views/tariffManagement/Management/meal.vue

@@ -5,24 +5,28 @@
             <a-table :columns="columns" :data="wanberFloter" style="margin-top: 20px" :pagination="false"
                 :scroll="{ y: 'auto' }">
                 <template #period="{ record, rowIndex }">
-                    <a-input v-model="record.period" :disabled="role.getRole !== 1"/>
+                    <a-input v-model="record.period" :disabled="role.getRole !== 1" />
                 </template>
                 <template #price="{ record, rowIndex }">
                     <a-input v-model="record.price" />
                 </template>
                 <template #currency="{ record, rowIndex }">
-                    <a-select v-model="record.currency" :style="{ width: '300px' }" placeholder="请选择币种" :disabled="role.getRole !== 1">
+                    <a-select v-model="record.currency" :style="{ width: '300px' }" placeholder="请选择币种"
+                        :disabled="role.getRole !== 1">
                         <a-option v-for="res of Pricing" :value="res.value" :label="res.label" />
                     </a-select>
                 </template>
+                <template #label="{ record, rowIndex }">
+                    <a-input v-model="record.label" v-if="role.getRole !== 1" />
+                </template>
                 <template #setting="{ record }">
-                    <a class="a-link" href="javascript:;" style="margin-right: 1rem"
-                        @click="addUpate(record)">{{ record.id == '' ? '添加' : '修改' }}</a>
+                    <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="addUpate(record)">{{
+                        record.id == '' ? '添加' : '修改' }}</a>
                     <a-popconfirm :content="$t('form.Delete')" :ok-text="$t('form.Confirm')"
                         :cancel-text="$t('form.Cancel')" @ok="deletaMeal(record.id)">
                         <a class="a-link" href="javascript:;" v-if="role.getRole == 1">{{
                             $t('form.Delete')
-                            }}</a>
+                        }}</a>
                     </a-popconfirm>
                 </template>
             </a-table>
@@ -43,7 +47,7 @@ const props = defineProps({
     },
     traffIds: {
         type: [String, Number],
-        default: null
+        default: undefined
     }
 })
 const role = useSystemStore()
@@ -70,6 +74,11 @@ const columns = [{
     slotName: 'currency',
     ellipsis: true,
     align: 'center',
+}, {
+    title: '套餐名称',
+    slotName: 'label',
+    ellipsis: true,
+    align: 'center',
 }, {
     title: '操作',
     slotName: 'setting',
@@ -78,7 +87,7 @@ const columns = [{
 }];
 const state = ref({
     wanberFloter: [
-        { id: '', period: '', price: '', currency: '' }
+        { id: '', period: '', price: '', currency: '', label: '' }
     ],
     formRef: null,
     Pricing: []
@@ -95,7 +104,7 @@ const addUpate = async (item) => {
     item.period = Number(item.period)
     let res;
     if (item.id == '') {
-        res = await addTariffPackage({ TrafficId: traffIds.value, price: item.price, currency: item.currency, period: item.period })
+        res = await addTariffPackage({ TrafficId: traffIds.value, price: item.price, currency: item.currency, period: item.period, label: item.label })
     } else {
         res = await UpdateTariffTtems(item)
     }
@@ -108,11 +117,12 @@ const addUpate = async (item) => {
 const handleCancel = () => {
     emit('update:modelValue', false)
     wanberFloter.value = [
-        { id: '', period: '', price: '', currency: '' }
+        { id: '', period: '', price: '', currency: '', label: '' }
     ]
+    traffIds.value = undefined
 }
 const addMeal = () => {
-    wanberFloter.value.push({ id: '', period: '', price: '', currency: '' })
+    wanberFloter.value.push({ id: '', period: '', price: '', currency: '', label: '' })
 }
 // 删除
 const deletaMeal = async (ids) => {
@@ -136,10 +146,11 @@ const getList = () => {
     })
 }
 
-watch(() => traffIds.value, async val => {
-    if (!val) return
-    await getList()
-})
+watch(() => modelValue.value, async (val, newVal) => {
+    if (val) {
+        await getList()
+    }
+}, { deep: true })
 
 onMounted(() => {
     handeDict()