فهرست منبع

修改资费体验流量包字段

wxy 3 ماه پیش
والد
کامیت
fa83e4366e

+ 16 - 5
src/views/order/BuyCard/detaile.vue

@@ -120,8 +120,9 @@ const state = ref({
     userType: JSON.parse(localStorage.getItem('user_login_information'))?.userType, // 1平台 2用户
     show: false,
     schedule: 0,// 进度
+    ids: null
 })
-const { tariffForm, showCard, res1, res2, res3, userType, show, schedule } = toRefs(state.value)
+const { tariffForm, showCard, res1, res2, res3, userType, show, schedule, ids } = toRefs(state.value)
 const columnsDetail = [{ title: 'ICCID', dataIndex: 'iccid' }, { title: t('order.CardStatus'), dataIndex: 'status' }, { title: t('order.CreationTime'), dataIndex: 'createdAt' }
 ]
 const dataDetail = ref([])
@@ -152,6 +153,7 @@ const closeModal = () => {
 
 watch(() => FormDataList.value, val => {
     if (Object.keys(val).length === 0) return
+    ids.value = val.id
     AcquireOrdertariff({ id: val.trafficId }).then(res => {
         tariffForm.value = res.data
         tariffForm.value.billingcycleName = res1.value.filter(val => val.value == res.data.billingCycle)[0]?.label;
@@ -174,7 +176,12 @@ 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;
+        if (res.data !== 100) {
+            schedule.value = res.data;
+            clearSchedule(schedule.value)
+        }else if(res.data==0){
+            
+        }
     }
 }
 // 监听导卡进度
@@ -186,8 +193,8 @@ watch(() => modelValue.value, val => {
     }
 }, { immediate: true })
 
-watch(() => schedule.value, val => {
-    // 清除旧的定时器(如果存在)
+
+function clearSchedule(val) {
     if (timer) {
         clearInterval(timer);
     }
@@ -195,9 +202,13 @@ watch(() => schedule.value, val => {
         CardProgress();
         if (val === 100) {
             clearInterval(timer);
+            ReturntheOrderCard({ id: ids.value }).then(res => {
+                dataDetail.value = (res.data || []).map(res => ({ ...res, status: res.status == 1 ? t('order.normal') : t('order.unsubscribe') }))
+            })
         }
     }, 10000);
-})
+}
+
 
 onMounted(async () => {
     res1.value = await Getdictionary('Billingcycle')

+ 4 - 4
src/views/tariffManagement/Management/add.vue

@@ -24,8 +24,8 @@
                 </a-form-item>
             </template>
             <template v-if="formState.source">
-                <a-form-item :label="$t('tariffManagement.TestFlowPacket')" field="testsimDataPlanId">
-                    <a-select v-model="formState.testsimDataPlanId" :disabled="typeIndexSet !== 1">
+                <a-form-item :label="$t('tariffManagement.TestFlowPacket')" field="productId">
+                    <a-select v-model="formState.productId" :disabled="typeIndexSet !== 1">
                         <a-option v-for=" (item, index) in planList" :key="item.id" :value="item.id">{{
                             $t('tariffManagement.TestFlowPacket') }} {{
                                 item.productName
@@ -185,7 +185,7 @@ const state = ref({
         // 网络接入费
         "networkAccessFee": '',
         "endDate": '',
-        "testsimDataPlanId": null
+        "productId": null
     },
     sourceList: [],
     userIdList: [],
@@ -213,7 +213,7 @@ const rules = {
     mrcAmount: [{ required: true, trigger: 'change', }],
     networkAccessFee: [{ required: true, trigger: 'change', }],
     endDate: [{ required: true, trigger: 'change', }],
-    testsimDataPlanId: [{ required: true, trigger: 'change', }],
+    productId: [{ required: true, trigger: 'change', }],
 };
 
 // 提交

+ 46 - 6
src/views/tariffManagement/SetMeal/index.vue

@@ -5,7 +5,7 @@
     </div>
 
     <div class="addSetMeal">
-      <a-button type="primary">新增套餐计划</a-button>
+      <a-button type="primary" @click="visibleSetMeal = true">新增套餐计划</a-button>
     </div>
 
     <div class="table">
@@ -14,7 +14,7 @@
         <template #Controls="{ record }">
           <a-space>
             <a-button type="text">设置套餐</a-button>
-            <a-button type="text" @click="visibleQrCode=true">充值二维码</a-button>
+            <a-button type="text" @click="visibleQrCode = true">充值二维码</a-button>
             <a-button type="text">下架</a-button>
           </a-space>
         </template>
@@ -23,12 +23,31 @@
 
     <a-modal v-model:visible="visibleQrCode" width="700px" @cancel="visibleQrCode = false" title="充值二维码">
       <div class="code">
-        <qrcode-vue :value="codeUrl" size="150" level="H" ></qrcode-vue>
+        <qrcode-vue :value="codeUrl" size="150" level="H"></qrcode-vue>
       </div>
       <template #footer>
         <a-button @click="visibleQrCode = false">关闭</a-button>
       </template>
     </a-modal>
+
+    <a-modal v-model:visible="visibleSetMeal" width="600px" @cancel="visibleSetMeal = false" title="新增套餐计划">
+      <div class="Form">
+        <a-form ref="formRef" :rules="rules" :model="Form" @submit="handleSubmit">
+          <a-form-item label="套餐计划名称" field="source">
+            <a-input placeholder="请输入套餐计划名称"></a-input>
+          </a-form-item>
+          <a-form-item label="选择所属客户" field="source">
+            <a-select :style="{ width: '320px' }" placeholder="请选择所属客户">
+              <a-option v-for="(item,index) in userList" :value="item.id">{{ item.name}}</a-option>
+            </a-select>
+          </a-form-item>
+        </a-form>
+      </div>
+      <template #footer>
+        <a-button @click="visibleSetMeal = false">取消</a-button>
+        <a-button type="primary" @click="visibleSetMeal = false">确定</a-button>
+      </template>
+    </a-modal>
   </div>
 </template>
 
@@ -36,6 +55,7 @@
 import { ref, onMounted, toRefs } from 'vue';
 import Search from '@/components/Search/index.vue'
 import { SetMealSearchForm, columnsSetMeal } from '../config.js'
+import { getMessUserList } from '@/api/customer.js';
 import QrcodeVue from 'qrcode.vue'
 const state = ref({
   data: [{ labelName: '666', ID: '4884', userName: '张总', time: '2024', status: '正常' }],
@@ -45,16 +65,36 @@ const state = ref({
     current: 1,
   },
   visibleQrCode: false,
-  codeUrl:'https://baidu.com'
+  codeUrl: 'https://baidu.com',
+  visibleSetMeal: false,
+  Form: {
+
+  },
+  userList:[]
+})
+const { data, pagination, visibleQrCode, codeUrl, visibleSetMeal ,userList} = toRefs(state.value)
+
+const fetchCustomerList = async (item) => {
+    const response = await getMessUserList({
+      current: 1, 
+      pageSize: 99999,
+    });
+    if (response.code === 200 && response.data) {
+      userList.value = response.data.records
+    }
+};
+
+onMounted(()=>{
+  fetchCustomerList()
 })
-const { data, pagination, visibleQrCode ,codeUrl} = toRefs(state.value)
 </script>
 <style lang="less" scoped>
 .search,
 .table {
   margin-top: 1rem;
 }
-.code{
+
+.code {
   justify-content: center;
   display: flex;
 }

+ 2 - 2
vite.config.js

@@ -62,8 +62,8 @@ export default defineConfig({
         proxy: {
             "/api": {
                 // target: "http://sim.nanodreamtech.com",
-                // target: "http://127.0.0.1:3001",
-                target: "http://sim.ainets.net",
+                target: import.meta.env.VITE_API_URL,
+                // target: "http://sim.ainets.net",
                 changeOrigin: true,
                 ws: true,
                 secure: true,