Răsfoiți Sursa

修改资费字段

wxy 4 luni în urmă
părinte
comite
93edf98d4c

+ 2 - 1
src/i18n/zh/tariffManagement.js

@@ -44,5 +44,6 @@ export default {
     PackageTermMonth:'套餐期限(月)',
     PackagePrice:'套餐价格',
     Currency:'币种',
-    AddPackage:'添加套餐'
+    AddPackage:'添加套餐',
+    endDate:'有效期'
 }

+ 28 - 4
src/views/order/BuyCard/detaile.vue

@@ -75,7 +75,7 @@
             </div>
         </div>
         <div class="detail-table">
-            <a-table :columns="columnsDetail" :data="dataDetail" />
+            <a-table :columns="columnsDetail" @page-change="evChangePage" :data="dataDetail" :pagination="pagination" />
         </div>
 
         <template #footer>
@@ -124,7 +124,15 @@ const state = ref({
 const { tariffForm, showCard, res1, res2, res3, userType } = toRefs(state.value)
 const columnsDetail = [{ title: 'ICCID', dataIndex: 'iccid' }, { title: t('order.CardStatus'), dataIndex: 'status' }, { title: t('order.CreationTime'), dataIndex: 'createdAt' }
 ]
+// 初始数据
+const tableDataList = ref([])
+// 处理后的数据
 const dataDetail = ref([])
+const pagination = ref({
+    current: 1,
+    pageSize: 10,
+    total: 0
+})
 
 // 分配卡号
 const customRequest = (options) => {
@@ -134,9 +142,13 @@ const customRequest = (options) => {
     DistributionCard(formData).then(res => {
         if (res.code == 200) {
             Message.success(res.message)
-            res.data[0].forEach(val => [
-                dataDetail.value.push({ iccid: val })
-            ])
+            // 更新完整数据
+            tableDataList.value = res.data[0];
+
+            // 更新总条目数
+            pagination.value.total = res.data[0].length;
+
+            updatePageData(); 
         }
     })
 }
@@ -164,6 +176,18 @@ watch(() => FormDataList.value, val => {
     })
 }, { deep: true })
 
+const evChangePage = (page) => {
+    pagination.value.current = page
+    updatePageData(); 
+}
+
+// 更新分页数据方法
+const updatePageData = () => {
+  const startIndex = (pagination.value.current - 1) * pagination.value.pageSize;
+  const endIndex = startIndex + pagination.value.pageSize; // 每次切 10 条
+  dataDetail.value = tableDataList.value.slice(startIndex, endIndex);
+};
+
 onMounted(async () => {
     res1.value = await Getdictionary('Billingcycle')
     res2.value = await Getdictionary('billingMethod')

+ 1 - 1
src/views/tariffManagement/config.js

@@ -10,7 +10,7 @@ export let columns = [
     // { title: window.$t('tariffManagement.bagSize'), dataIndex: 'bagSize', align: 'center', width: 200 },
     { title: window.$t('tariffManagement.pricing'), dataIndex: 'pricingName', align: 'center', width: 200, ellipsis: true },
     // { title: window.$t('tariffManagement.billingMethod'), dataIndex: 'billing_method', align: 'center', width: 200 },
-    { title: window.$t('tariffManagement.settlementCycleLabel'), dataIndex: 'settlementCycle', align: 'center', width: 200, ellipsis: true },
+    { title: window.$t('tariffManagement.endDate'), dataIndex: 'endDate', align: 'center', width: 200, ellipsis: true },
     { title: window.$t('tariffManagement.ActivatedNames'), dataIndex: 'Activated', align: 'center', width: 200, ellipsis: true },
     { title: window.$t('tariffManagement.feeStatus'), dataIndex: 'status', align: 'center', width: 200, ellipsis: true },
     { title: window.$t('tariffManagement.MRCName'), dataIndex: 'mrcAmount', align: 'center', width: 200, ellipsis: true },