wxy пре 3 месеци
родитељ
комит
4ea96259cf

+ 0 - 1
src/i18n/zh/lotCard.js

@@ -178,7 +178,6 @@ export default {
      TotalVoiceMinutes:'总语音分钟数',
      NumberTextMessagesSent:'发短信数',
      ClosingDate:'SIM关闭日期',
-     SupplierName:'所属供应商名称',
      CardPackage:'卡套餐',
      EarlyWarningState:'预警状态',
      PoolName_Number:'池名称/编号',

+ 1 - 1
src/views/financialManagement/appPuy/index.vue

@@ -72,7 +72,7 @@ const getTopUpRecordListFc = async (item) => {
     let puyType = await Getdictionary('puyType')
     res = await getAdiroePuyList(param)
     tableData.value = (res.data?.records || []).map(res => {
-        res.payStatus = puyType.filter(item => item.code == res.puyType)[0]?.label
+        res.payStatus = puyType.filter(item => item.value == res.payStatus)[0]?.label
         return res
     })
     pagination.value.total = res.data.total;

+ 190 - 0
src/views/flowPool/components/GuideCard.vue

@@ -0,0 +1,190 @@
+<template>
+    <a-modal v-model:visible="modelValue" @ok="handleOk" @cancel="handleCancel" width="1200px" title="导卡">
+        <div class="card_item_header">
+            <a-button type="primary" @click="showCard=true" :disabled="show">分配卡号</a-button>
+            <a-button type="primary" @click="DownloadSampleFile">下载示例文件</a-button>
+        </div>
+        
+        <div class="search">
+           <Search :SearchForm="CardSearchForm"></Search>
+        </div>
+
+        <div class="detail-table" v-if="!show">
+            <a-table :columns="columnsExport" :data="dataExport" />
+        </div>
+
+        <div class="progress" v-if="show">
+            <div class="cusrte">
+                <a-progress type="circle" :percent="(schedule / 100)" size="large" />
+            </div>
+        </div>
+    </a-modal>
+
+    <a-modal v-model:visible="showCard" :title="$t('order.AllocationCardNumber')"
+        @cancel="closeModal(showCard, FormDataList)" @before-ok="showCard = false" :okText="$t('form.Confirm')"
+        :cancelText="$t('form.Cancel')">
+        <div style="display: flex;justify-content: space-between;">
+            <div>
+                <Upload listType="" minx="1" accept=".xlsx" :handelUpload="customRequest" :showRemoveButton="false">
+                </Upload>
+                <span style="color: #ccc;margin-top: 10px;display: inline-block;">请上传.xlsx文件</span>
+            </div>
+            <div>
+                <a-button type="primary" @click="DownloadSampleFile">下载示例文件</a-button>
+            </div>
+        </div>
+    </a-modal>
+</template>
+
+<script setup>
+import { ref, onMounted, toRefs, toRef, watch } from 'vue';
+import { downloadFile } from '@/utils/xlsx.js'
+import {DistributionCard} from '@/api/path/order'
+import Search from '@/components/Search/index.vue'
+
+const props = defineProps({
+    modelValue: {
+        type: Boolean,
+        default: false
+    },
+})
+
+const modelValue = toRef(props, 'modelValue')
+const emit = defineEmits(['update:modelValue', 'submit'])
+// 定时器ID
+let timer;
+const columnsExport = [
+    { title: 'ICCID', dataIndex: 'iccid', align: 'center' },
+    {
+        title: '卡状态',
+        dataIndex: 'name',
+    },
+    {
+        title: '创建时间',
+        dataIndex: 'exportTime',
+    },
+];
+
+const CardSearchForm = [
+{
+    type: "input",
+    label: "ICCID",
+    field: "iccid",
+    value: "", // 双向绑定的值
+  },
+  {
+    type: "select",
+    label: "卡状态",
+    field: "status",
+    options: [], 
+    dict: "trafficPacketStatus",
+    value: "", // 双向绑定的值
+    width: "200",
+  },
+  {
+    type: "date-picker",
+    label: "下单时间",
+    field: "createdAt",
+    value: "", // 双向绑定的值
+    width: "200",
+  },
+]
+
+const state = ref({
+    dataExport: [],
+    paginationCard: {
+        total: 0,
+        pageSize: 10,
+        current: 1,
+    },
+    searchForm: {
+        "label": "",
+        "trafficPoolType": "1"
+    },
+    showCard:false,
+    show: false,
+    schedule: 0,// 进度
+})
+
+const { dataExport, paginationCard, searchForm ,show,schedule} = toRefs(state.value)
+
+
+// 卡信息
+const evChangePageCard = (page) => {
+    paginationCard.value.current = page
+    intData()
+}
+
+// 导卡进度
+const CardProgress = async () => {
+    let res = await GuideCardProgress({ id: FormDataList.value.id })
+    if (res.code === 200) {
+        show.value = res.data !== 0 && res.data !== 100;
+        schedule.value = res.data;
+    }
+}
+
+// 导卡
+// 分配卡号
+const customRequest = (options) => {
+    const formData = new FormData();
+    formData.append('file', options.fileItem.file);  // 这里将文件添加到 FormDataList 中
+    formData.append('orderId', FormDataList.value.id);
+    DistributionCard(formData).then(res => {
+        if (res.code == 200) {
+            Message.success(res.message)
+            showCard.value = false
+            CardProgress()
+        }
+    })
+}
+
+const handleCancel = () => {
+    emit('update:modelValue', false)
+}
+
+// 下载示例文件
+const DownloadSampleFile = () => {
+    // 下载示例文件
+    downloadFile(['ICCID'], [['8968099000011939']])
+}
+
+
+// 监听导卡进度
+// watch(() => modelValue.value, val => {
+//     if (val) {
+//         CardProgress()
+//     } else {
+//         clearInterval(timer);
+//     }
+// }, { immediate: true })
+
+// watch(() => schedule.value, val => {
+//     // 清除旧的定时器(如果存在)
+//     if (timer) {
+//         clearInterval(timer);
+//     }
+//     timer = setInterval(() => {
+//         CardProgress();
+//         if (val === 100) {
+//             clearInterval(timer);
+//         }
+//     }, 10000);
+// })
+</script>
+<style scoped lang="less">
+.card_item_header{
+    display: flex;
+    justify-content: space-between;
+}
+
+.detail-table,.search{
+    margin-top: 1.5rem;
+}
+
+.progress {
+    margin: 1.5rem auto;
+    display: flex;
+    justify-content: center;
+}
+</style>

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

@@ -27,6 +27,7 @@
           }}</a>
         <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handelForewring(record)"
           v-if="role == 1">{{ $t('flowPool.Waring') }}</a>
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handelgetCard(record)">导卡</a>
         <!-- 删除 -->
         <a-popconfirm :content="$t('form.Delete')" :ok-text="$t('form.Confirm')" :cancel-text="$t('form.Cancel')"
           @ok="handleDel(record.id)">
@@ -37,7 +38,8 @@
       </template>
 
       <template #status="{ record }">
-        <a-tag :color="record.status==1?'#00b42a':'#f53f3f'">{{ trafficList.find(val => val.value == record.status)?.label }}</a-tag>
+        <a-tag :color="record.status == 1 ? '#00b42a' : '#f53f3f'">{{ trafficList.find(val => val.value ==
+          record.status)?.label }}</a-tag>
       </template>
 
     </a-table>
@@ -46,14 +48,14 @@
 
     <add v-model:model-value="showAdd" status="1" :typeCurrent="typeCurrent" :record="record" @submit="intData()"></add>
     <Forewarning v-model:modelValue="visibleForewarning" ref="forewarning" @submit="intData()" />
-    <openExport v-model:model-value="ShowOpenExport" />
+    <GuideCard v-model:model-value="ShowOpenExport" />
 
   </div>
 </template>
 
 <script setup>
 import { onMounted, ref, getCurrentInstance, toRefs } from "vue";
-import { columns ,SearchFormList} from "./config";
+import { columns, SearchFormList } from "./config";
 import { Message } from '@arco-design/web-vue'
 import {
   deleteTrafficPool,
@@ -63,7 +65,7 @@ import { useSystemStore } from "@/store/modules/systemStore"
 import { Getdictionary } from '@/mixins/index.js'
 import Forewarning from "./components/forewarning.vue";
 import add from './components/add.vue'
-import openExport from "./components/openExport.vue"
+import GuideCard from "./components/GuideCard.vue"
 import { useI18n } from 'vue-i18n'
 const { t } = useI18n();
 const systemStore = useSystemStore()
@@ -87,7 +89,7 @@ const state = ref({
   typeCurrent: 1,
   record: {},
   dataSource: [],
-  forewarning:null
+  forewarning: null
 })
 const {
   role,
@@ -106,7 +108,7 @@ const {
 const { proxy } = getCurrentInstance()
 
 const intData = async (item) => {
-  if(item){
+  if (item) {
     searchForm.value = item
   }
   const param = {
@@ -170,6 +172,10 @@ const handleDictValue = async () => {
   trafficList.value = await Getdictionary('trafficPacketStatus')
 }
 
+const handelgetCard = (item) => {
+  ShowOpenExport.value = true
+}
+
 onMounted(async () => {
   await handleDictValue()
 

+ 28 - 51
src/views/flowPool/rearFlowPool/index.vue

@@ -17,76 +17,47 @@
       </a-button>
     </div>
 
-    <a-table
-      row-key="id"
-      :data="dataSource"
-      :columns="columnsAfter"
-      :pagination="pagination"
-      :scroll="{ x: 'auto' }"
-      @page-change="evChangePage"
-    >
+    <a-table row-key="id" :data="dataSource" :columns="columnsAfter" :pagination="pagination" :scroll="{ x: 'auto' }"
+      @page-change="evChangePage">
       <template #id="{ record }">
         <!-- 修改 -->
-        <a
-          class="a-link"
-          href="javascript:;"
-          style="margin-right: 1rem"
-          @click="dictShowModel(2, record)"
-          v-if="role == 1"
-          >{{ $t("form.Edit") }}</a
-        >
-        <a
-          class="a-link"
-          href="javascript:;"
-          style="margin-right: 1rem"
-          @click="handelForewring(record)"
-          v-if="role == 1"
-          >{{ $t('flowPool.Waring') }}</a
-        >
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="dictShowModel(2, record)"
+          v-if="role == 1">{{ $t("form.Edit") }}</a>
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handelForewring(record)"
+          v-if="role == 1">{{ $t('flowPool.Waring') }}</a>
+        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handelgetCard(record)">导卡</a>
         <!-- 删除 -->
-        <a-popconfirm
-          :content="$t('form.Delete')"
-          :ok-text="$t('form.Confirm')"
-          :cancel-text="$t('form.Cancel')"
-          @ok="handleDel(record.id)"
-          v-if="role == 1"
-        >
+        <a-popconfirm :content="$t('form.Delete')" :ok-text="$t('form.Confirm')" :cancel-text="$t('form.Cancel')"
+          @ok="handleDel(record.id)" v-if="role == 1">
           <a class="a-link" href="javascript:;" style="margin-right: 1rem">{{
             $t("form.Delete")
           }}</a>
         </a-popconfirm>
       </template>
       <template #status="{ record }">
-        <a-tag :color="record.status==1?'#00b42a':'#f53f3f'">{{ trafficList.find(val => val.value == record.status)?.label }}</a-tag>
+        <a-tag :color="record.status == 1 ? '#00b42a' : '#f53f3f'">{{ trafficList.find(val => val.value ==
+          record.status)?.label }}</a-tag>
       </template>
     </a-table>
-    <add
-      v-model:modelValue="showAdd"
-      status="2"
-      :typeCurrent="typeCurrent"
-      :record="record"
-      @submit="intData()"
-    ></add>
-    <Forewarning
-      v-model:modelValue="visibleForewarning"
-      ref="forewarning"
-      @submit="intData()"
-    />
+    <add v-model:modelValue="showAdd" status="2" :typeCurrent="typeCurrent" :record="record" @submit="intData()"></add>
+    <Forewarning v-model:modelValue="visibleForewarning" ref="forewarning" @submit="intData()" />
+    <GuideCard v-model:model-value="ShowOpenExport" />
   </div>
 </template>
 
 <script setup>
 import { onMounted, reactive, toRefs } from "vue";
-import { columnsAfter,SearchFormList } from "../config";
+import { columnsAfter, SearchFormList } from "../config";
 import { Message } from "@arco-design/web-vue";
 import { deleteTrafficPool, lotCatdList } from "@/api/path/flowPool.api";
 import { useSystemStore } from "@/store/modules/systemStore";
 import add from "../components/add.vue";
 import Forewarning from "../components/forewarning.vue";
 import { Getdictionary } from "@/mixins/index.js";
-import {useI18n} from 'vue-i18n'
+import { useI18n } from 'vue-i18n'
 import Search from '@/components/Search/index.vue'
-const {t} = useI18n();
+import GuideCard from '../components/GuideCard.vue'
+const { t } = useI18n();
 const systemStore = useSystemStore();
 const state = reactive({
   dataSource: [],
@@ -103,7 +74,8 @@ const state = reactive({
   sourceList: [],
   trafficList: [],
   showAdd: false,
-  forewarning:null
+  forewarning: null,
+  ShowOpenExport: false
 });
 
 const {
@@ -117,11 +89,12 @@ const {
   sourceList,
   trafficList,
   showAdd,
-  forewarning
+  forewarning,
+  ShowOpenExport
 } = toRefs(state);
 
 const intData = async (item) => {
-  if(item){
+  if (item) {
     searchForm.value = item
   }
   const param = {
@@ -149,7 +122,7 @@ const intData = async (item) => {
       Activated: Activated,
       HaveBeenUsed: HaveBeenUsed,
       trafficPoolStatus,
-      size:item.size+'/'+item.sizeType
+      size: item.size + '/' + item.sizeType
     };
   });
   pagination.value.total = data.total;
@@ -195,6 +168,10 @@ const handleDictValue = async () => {
   trafficList.value = await Getdictionary("trafficPacketStatus");
 };
 
+const handelgetCard = (item)=>{
+  ShowOpenExport.value = true;
+}
+
 onMounted(async () => {
   await handleDictValue();
   await intData();

+ 2 - 8
src/views/lotCard/cardList/config.js

@@ -6,7 +6,7 @@ export const columns = [
     ellipsis: true,
   },
   {
-    title: window.$t("lotCard.source"),
+    title: window.$t("lotCard.sourcePlan"),
     dataIndex: "source",
     align: "center",
     ellipsis: true,
@@ -98,12 +98,6 @@ export const columns = [
     align: "center",
     ellipsis: true,
   },
-  {
-    title: "IMSI" + window.$t("lotCard.SupplierName"),
-    dataIndex: "currentImsiProvider",
-    align: "center",
-    ellipsis: true,
-  },
   {
     title: window.$t("lotCard.CardPackage"),
     dataIndex: "tariffName",
@@ -127,7 +121,7 @@ export const columns = [
   },
   {
     title: window.$t("lotCard.TheExpirationTime"),
-    dataIndex: "SilenceEndtime",
+    dataIndex: "periodOfSilence",
     align: "center",
     width: 200,
     ellipsis: true,