فهرست منبع

增加资费操作记录 && 修改流量池编辑回显问题

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

+ 1 - 1
src/components/Search/index.vue

@@ -105,7 +105,7 @@ watch(
             }
         }
         // 如果当前长度超过5条就需要折叠展开
-        if (SearchForm.value.length >= 6) {
+        if (SearchForm.value.length >= 5) {
             show.value = true;
         }
         // 初始化切割数组,使用原始SearchForm数据的副本进行操作

+ 28 - 31
src/views/OperationRecord/TariffRecord/index.vue

@@ -3,33 +3,25 @@
   <div class="container">
     <!-- 搜索条件区 -->
     <div class="search-section">
-      <Search :SearchForm="trafficSearchFrom" @query="intData" @reset="reset"/>
-    </div>
-    <div class="audit-btn">
-      <a-button type="text" @click="dictShowModel(1, null)" v-if="role.getRole == 1">
-        <template #icon>
-          <icon-plus-circle />
-        </template>
-        <template #default>{{ $t('form.Add') }}</template>
-      </a-button>
+      <Search :SearchForm="trafficSearchFrom" @query="intData" @reset="reset" />
     </div>
     <a-table row-key="id" :data="dataSource" :columns="columns" :pagination="pagination" :scroll="{ x: 'auto' }"
       @page-change="evChangePage">
+      <template #id="{ record }">
+        <a-button type="text" @click="detaile(record)">详情</a-button>
+      </template>
     </a-table>
   </div>
 </template>
 
 <script setup>
 import { onMounted, ref, toRefs } from "vue";
-import { columns, planColumns ,trafficSearchFrom} from "../config";
+import { columns, planColumns, trafficSearchFrom } from "../config";
 import { tariffList } from "@/api/path/tariffManagement.api"
 import { Getdictionary } from '@/mixins/index.js'
-import { useSystemStore } from '@/store/modules/systemStore'
 import Search from '@/components/Search/index.vue'
-const role = useSystemStore()
 const state = ref({
   searchForm: {},
-  FormDataList: {},
   currency: [],
   dataSource: [],
   pagination: {
@@ -37,28 +29,22 @@ const state = ref({
     pageSize: 10,
     current: 1,
   },
-  visible: false,
-  typeCurrent: null,
   sourceList: [],
   cycleist: [],
-  methodList: []
+  methodList: [],
 })
 const {
   searchForm,
-  FormDataList,
   currency,
   dataSource,
   pagination,
-  visible,
-  typeCurrent,
   sourceList,
   cycleist,
-  ids,
   methodList
 } = toRefs(state.value);
 
 const intData = async (item) => {
-  if(item){
+  if (item) {
     searchForm.value = item
   }
   const param = {
@@ -80,6 +66,23 @@ const intData = async (item) => {
     } else if (item.billingMethod == 2) {
       pricingName = item.pricing + pricingCurrty
     }
+
+    item.children = item.children?.map(res => {
+      return {
+        ...res,
+        userName: item.userName,
+        sourceName,
+        pricingName,
+        billingCycleName,
+        Activated: Activated,
+        status: "正常",
+        bagSize,
+        billingMethodName,
+        Number: index + 1,
+        metadataPackagesName:item.metadataPackagesName,
+        testMetadataPackagesName:item.testMetadataPackagesName,
+      }
+    })
     return {
       ...item,
       sourceName,
@@ -89,15 +92,14 @@ const intData = async (item) => {
       status: "正常",
       bagSize,
       billingMethodName,
-      Number: index + 1
+      Number: index + 1,
     }
   })
-  console.log(dataSource.value);
   pagination.value.total = data.total
 }
 
-const reset = (item)=>{
-  searchForm.value = item 
+const reset = (item) => {
+  searchForm.value = item
   pagination.value.current = 1
   intData()
 }
@@ -107,12 +109,6 @@ const evChangePage = (page) => {
   intData()
 }
 
-// 弹框
-const dictShowModel = (type, data) => {
-  FormDataList.value = type == 1 ? {} : data
-  typeCurrent.value = type;
-  visible.value = true;
-}
 
 const handleDictValue = async () => {
   sourceList.value = await Getdictionary('source')
@@ -121,6 +117,7 @@ const handleDictValue = async () => {
   methodList.value = await Getdictionary('billingMethod')
 }
 
+
 onMounted(async () => {
   await handleDictValue()
   await intData()

+ 0 - 8
src/views/OperationRecord/config.js

@@ -102,14 +102,6 @@ export let columns = [
     width: 200,
     ellipsis: true,
   },
-  // {
-  //   title: window.$t("global.common.operations"),
-  //   dataIndex: "id",
-  //   slotName: "id",
-  //   align: "center",
-  //   width: 180,
-  //   fixed: "right",
-  // },
 ];
 // 资费套餐
 export const planColumns = [

+ 7 - 36
src/views/flowPool/components/add.vue

@@ -143,54 +143,25 @@ const handleDictValue = async () => {
   typeList.value = await Getdictionary('trafficPoolType')
 }
 
-
-// const selectChange = (val) => {
-//   updateCardList({ id: val }).then(res => {
-//     if (res.code === 200) {
-//       formState.value.iccids = []
-//       card.value = res.data
-//     }
-//   })
-// }
-
-watch(() => record.value, val => {
-  const datas = JSON.parse(JSON.stringify(val))
+const recordVal = (item) => {
+  const datas = JSON.parse(JSON.stringify(item))
   if (props.typeCurrent == 2) {
     formState.value = datas
-    // formState.value.iccids = []
-    // updateCardList({ id: val.simTariffId }).then(res => {
-    //   if (res.code === 200) {
-    //     val.iccids.forEach(res => {
-    //       formState.value.iccids.push(res.iccid)
-    //     })
-    //     card.value = res.data
-    //   }
-    // })
   }
-}, { deep: true })
+}
 
 watch(() => modelValue.value, val => {
   if (val) {
     handleDictValue()
     handleTariff()
+    recordVal(record.value)
   }
 })
 
-
-// const changeAll = (e)=>{
-//   SelectAll.value = e
-//   if (e) {
-//     formState.value.iccids = card.value.map(res => res.iccid)
-//   } else {
-//     formState.value.iccids = []
-//   }
-// }
-
-
 </script>
 
 <template>
-  <a-modal :render-to-body="false"
+  <a-modal :render-to-body="false" unmount-on-close
     :title="typeCurrent == 1 ? $t('form.Add') : typeCurrent == 2 ? $t('form.Edit') : $t('flowPool.Detail')"
     v-model:visible="modelValue" @cancel="resetForm" centered :maskClosable="false" :footer="null" width="55%">
     <a-tabs v-model:active-key="activeKey">
@@ -236,8 +207,8 @@ watch(() => modelValue.value, val => {
                   <a-checkbox v-model="SelectAll" @change="changeAll">全选</a-checkbox>
                 </div>
               </template>
-            </a-select>
-          </a-form-item> -->
+</a-select>
+</a-form-item> -->
           <a-form-item :label="$t('flowPool.expireTime')" field="expireTime">
             <a-date-picker v-model="formState.expireTime" show-time :time-picker-props="{ defaultValue: '09:09:06' }"
               format="YYYY-MM-DD HH:mm:ss" />

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

@@ -181,6 +181,7 @@ const dictShowModel = (type, data) => {
   typeCurrent.value = type
   record.value = data
   showAdd.value = true
+  console.log(record.value);
 }
 
 const handelForewring = (item) => {