فهرست منبع

增加导卡进度查询`

wxy 3 ماه پیش
والد
کامیت
801b329bb2
4فایلهای تغییر یافته به همراه121 افزوده شده و 23 حذف شده
  1. 5 0
      src/api/path/order.js
  2. 59 2
      src/views/OperationRecord/FlowpoolRecord/index.vue
  3. 55 19
      src/views/order/BuyCard/detaile.vue
  4. 2 2
      vite.config.js

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

@@ -48,4 +48,9 @@ export function ReturntheOrderCard(params) {
 // 设置金额
 export function SettingPricing(data) {
     return service.post('/admin/sim/setAmount', data)
+}
+
+// 获取导卡进度
+export function GuideCardProgress(params){
+    return service.get('/admin/sim/assignProgress', { params});
 }

+ 59 - 2
src/views/OperationRecord/FlowpoolRecord/index.vue

@@ -1,12 +1,69 @@
 <template>
   <div>
-     
+    <div class="Search">
+      <Search></Search>
+    </div>
+
+    <div class="table">
+      <a-table :columns="columns" :data="data" :pagination="pageData" @page-change="evChangePage" />
+    </div>
   </div>
 </template>
 
 <script setup>
 import { ref, onMounted, toRefs } from 'vue';
+import Search from '@/components/Search/index.vue'
+const columns = [
+  {
+    title: 'Name',
+    dataIndex: 'name',
+    ellipsis: true,
+    tooltip: true,
+    align: 'center'
+  },
+  {
+    title: 'Salary',
+    dataIndex: 'salary',
+    ellipsis: true,
+    tooltip: true,
+    align: 'center'
+  },
+  {
+    title: 'Address',
+    dataIndex: 'address',
+    ellipsis: true,
+    tooltip: true,
+    align: 'center'
+  },
+  {
+    title: 'Email',
+    dataIndex: 'email',
+    ellipsis: true,
+    tooltip: true,
+    align: 'center'
+  },
+];
+
+
+const state = ref({
+  pageData: {
+    total: 10,
+    size: 10,
+    current: 1,
+  },
+  data: []
+})
+
+const { pageData, data } = toRefs(state.value)
+
+// 分页
+const evChangePage = (page) => {
+  pageData.value.current = page
+}
 </script>
 <style scoped>
-
+.Search,
+.table {
+  margin-top: 20px;
+}
 </style>

+ 55 - 19
src/views/order/BuyCard/detaile.vue

@@ -48,24 +48,31 @@
             <div class="detail-item-box">
                 <div class="detail-item">
                     <div class="item-label">{{ $t('order.CardNum') }}</div>
-                    <div class="item-content">{{ tableDataList.length==0?dataDetail.length:tableDataList.length }}
-                        <a-button type="primary" @click="showCard = true" style="margin-left:10px;"
+                    <div class="item-content">{{ tableDataList.length == 0 ? dataDetail.length : tableDataList.length }}
+                        <a-button type="primary" :disabled="show" @click="showCard = true" style="margin-left:10px;"
                             v-if="userType == 1 && FormDataList.moderationStatus == 2">{{
                                 $t('order.AllocationCardNumber') }}</a-button>
                     </div>
                 </div>
             </div>
         </div>
-        <div class="detail-table">
+        <div class="detail-table" v-if="!show">
             <a-table :columns="columnsDetail" @page-change="evChangePage" :data="dataDetail"
                 :pagination="dataDetail.length == 10 ? pagination : false" />
         </div>
 
+        <div class="progress" v-if="show">
+            <div class="cusrte">
+                <a-progress type="circle" :percent="(schedule / 100)" size="large" />
+            </div>
+        </div>
+
         <template #footer>
             <a-button @click="cancel">{{ $t('form.Cancel') }}</a-button>
         </template>
     </a-modal>
 
+
     <!-- 分配卡号 -->
     <a-modal v-model:visible="showCard" :title="$t('order.AllocationCardNumber')"
         @cancel="closeModal(showCard, FormDataList)" @before-ok="showCard = false" :okText="$t('form.Confirm')"
@@ -85,7 +92,7 @@
 
 <script setup>
 import { ref, onMounted, toRefs, toRef, watch } from 'vue';
-import { AcquireOrdertariff, DistributionCard, ReturntheOrderCard } from '@/api/path/order'
+import { AcquireOrdertariff, DistributionCard, ReturntheOrderCard,GuideCardProgress } from '@/api/path/order'
 import { Message } from '@arco-design/web-vue';
 import Upload from "@/components/upload/index.vue";
 import { Getdictionary } from '@/mixins/index.js'
@@ -112,8 +119,10 @@ const state = ref({
     res2: [],
     res3: [],
     userType: JSON.parse(localStorage.getItem('user_login_information'))?.userType, // 1平台 2用户
+    show: false,
+    schedule: 0,// 进度
 })
-const { tariffForm, showCard, res1, res2, res3, userType } = toRefs(state.value)
+const { tariffForm, showCard, res1, res2, res3, userType, show, schedule } = toRefs(state.value)
 const columnsDetail = [{ title: 'ICCID', dataIndex: 'iccid' }, { title: t('order.CardStatus'), dataIndex: 'status' }, { title: t('order.CreationTime'), dataIndex: 'createdAt' }
 ]
 // 初始数据
@@ -126,6 +135,9 @@ const pagination = ref({
     total: 0
 })
 
+// 定时器ID
+let timer;
+
 // 分配卡号
 const customRequest = (options) => {
     const formData = new FormData();
@@ -134,19 +146,8 @@ const customRequest = (options) => {
     DistributionCard(formData).then(res => {
         if (res.code == 200) {
             Message.success(res.message)
-            if (res.data[0].length <= 10) {
-                res.data[0].forEach(val => {
-                    dataDetail.value.push({ iccid: val, status: val.status == 1 ? t('order.normal') : t('order.unsubscribe') })
-                })
-            } else {
-                // 更新完整数据
-                tableDataList.value = res.data[0];
-
-                // 更新总条目数
-                pagination.value.total = res.data[0].length;
-
-                updatePageData();
-            }
+            showCard.value = false
+            CardProgress()
         }
     })
 }
@@ -175,7 +176,6 @@ watch(() => FormDataList.value, val => {
     })
     dataDetail.value = []
     ReturntheOrderCard({ id: val.id }).then(res => {
-        console.log(res);
         if (res.data.length <= 10) {
             dataDetail.value.push(...res.data.map(val => ({ ...val, status: val.status == 1 ? t('order.normal') : t('order.unsubscribe') })))
         } else {
@@ -207,6 +207,36 @@ const DownloadSampleFile = () => {
     downloadFile(['ICCID'], [['8968099000011939']])
 }
 
+// 导卡进度
+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;
+    }
+}
+// 监听导卡进度
+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);
+})
+
 onMounted(async () => {
     res1.value = await Getdictionary('Billingcycle')
     res2.value = await Getdictionary('billingMethod')
@@ -214,6 +244,12 @@ onMounted(async () => {
 })
 </script>
 <style scoped lang="less">
+.progress {
+    margin: 30px auto;
+    display: flex;
+    justify-content: center;
+}
+
 .detail-box {
     .detail-item-box {
         display: flex;

+ 2 - 2
vite.config.js

@@ -61,8 +61,8 @@ export default defineConfig({
         hmr: true,
         proxy: {
             "/api": {
-                // target: "http://sim.nanodreamtech.com",
-                target:"http://192.168.0.78:3001",// 果本地端口
+                target: "http://sim.nanodreamtech.com",
+                // target:"http://192.168.0.78:3001",// 果本地端口
                 // target: "http://127.0.0.1:3001",
                 // target: "http://sim.ainets.net",
                 changeOrigin: true,