wxy 4 ماه پیش
والد
کامیت
180dfdd487
4فایلهای تغییر یافته به همراه94 افزوده شده و 117 حذف شده
  1. 5 0
      src/api/path/flowPool.api.js
  2. 3 1
      src/i18n/zh/flowPool.js
  3. 48 37
      src/views/flowPool/index.vue
  4. 38 79
      src/views/flowPool/rearFlowPool/index.vue

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

@@ -22,4 +22,9 @@ export function deleteTrafficPool(params) {
 // 卡信息列表
 export  function  getCardList (data) {
     return service.post('admin/sim/cardInfoList',data)
+}
+
+// 获取资费下卡列表
+export  function  updateCardList (params) {
+    return service.get('admin/platform/getTariffCard',{params})
 }

+ 3 - 1
src/i18n/zh/flowPool.js

@@ -43,5 +43,7 @@ export default {
     operator:'运营商名称',
     operatorName:'请选择运营商名称',
     start_time:'更新时间',
-    start_timeName:'请选择更新时间'
+    start_timeName:'请选择更新时间',
+    ICCIDlabel:'ICCID',
+    ICCIDName:'请选择ICCID',
 }

+ 48 - 37
src/views/flowPool/index.vue

@@ -72,9 +72,9 @@
             }}</a>
         </a-popconfirm>
         <!-- 导卡 -->
-        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="dictShowModel(3, record)">{{
-            $t('flowPool.exportCard')
-          }}</a>
+        <!--        <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="dictShowModel(3, record)">{{-->
+        <!--            $t('flowPool.exportCard')-->
+        <!--          }}</a>-->
       </template>
 
     </a-table>
@@ -126,9 +126,18 @@
                 </a-option>
               </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"/>
+            <a-form-item :label="$t('flowPool.ICCIDlabel')" field="simTariffId" v-if="formState.simTariffId!==null">
+              <a-select v-model="formState.iccids"  multiple
+                        :placeholder="$t('flowPool.ICCIDName')">
+                <a-option v-for=" item in card" :key="item.iccid" :value="item.iccid">{{
+                    item.iccid
+                  }}
+                </a-option>
+              </a-select>
+            </a-form-item>
+            <a-form-item>
+            <a-date-picker v-model="formState.expireTime" show-time
+                           :time-picker-props="{ defaultValue: '09:09:06' }" format="YYYY-MM-DD HH:mm:ss"/>
             </a-form-item>
             <a-form-item>
               <a-button type="primary" html-type="submit" style="margin-right: 10px;">{{
@@ -257,24 +266,25 @@
             批量导入
           </div>
           <div class="box-item-content">
-            <div class="item-txt">
-              <div class="item-txt-title">标题</div>
-              <div class="item-txt-text">联通流量卡</div>
-            </div>
-            <div class="item-txt">
-              <div class="item-txt-title">标题</div>
-              <div class="item-txt-text">联通流量卡</div>
-            </div>
-            <div class="item-txt">
-              <div class="item-txt-title"></div>
-              <div class="item-txt-text">
-                <a-upload action="/">
-                  <template #upload-button>
-                    <a-button type="primary">导入</a-button>
-                  </template>
-                </a-upload>
-              </div>
-            </div>
+            <a-form :model="searchForm">
+              <a-form-item field="label" :label="$t('flowPool.label')">
+                <a-input v-model="searchForm.label" :placeholder="$t('lotCard.please') + $t('flowPool.label')"
+                         allow-clear/>
+              </a-form-item>
+              <a-form-item field="label" :label="$t('flowPool.status')">
+                <a-select v-model="value" :style="{width:'240px'}" :placeholder="$t('flowPool.flowPoolStatus')">
+                  <a-option v-for="item of trafficList" :value="item.id" :label="item.label"/>
+                </a-select>
+              </a-form-item>
+              <a-form-item field="label" :label="$t('flowPool.operator')">
+                <a-select v-model="value" :style="{width:'240px'}" :placeholder="$t('flowPool.operatorName')">
+                  <a-option v-for="item of sourceList" :value="item.id" :label="item.label"/>
+                </a-select>
+              </a-form-item>
+              <a-form-item field="label" :label="$t('flowPool.start_time')">
+                <a-date-picker style="width: 200px;" :placeholder="$t('flowPool.start_timeName')"/>
+              </a-form-item>
+            </a-form>
           </div>
         </div>
         <div class="export-box-item" style="margin-top:20px;">
@@ -311,7 +321,7 @@
 </template>
 
 <script setup>
-import {onMounted, ref, reactive, getCurrentInstance, nextTick} from "vue";
+import {onMounted, ref, reactive, getCurrentInstance, nextTick, watch} from "vue";
 import {useRoute} from "vue-router";
 import {columns} from "./config";
 import {Message, Notification} from '@arco-design/web-vue'
@@ -320,7 +330,8 @@ import {
   addTrafficPool,
   updateTrafficPool,
   trafficPoolList,
-  getCardList
+  getCardList,
+  updateCardList
 } from "@/api/path/flowPool.api"
 import {tariffList} from "@/api/path/tariffManagement.api"
 import {useSystemStore} from "@/store/modules/systemStore"
@@ -416,7 +427,7 @@ const sourceList = ref([])
 const trafficList = ref([])
 const typeList = ref([])
 const tariffIdList = ref([])
-
+const card = ref([])
 // 详情---------------------------
 const openExport = ref(false);
 const columnsExport = [
@@ -458,7 +469,7 @@ const formState = ref({
   // 过期时间
   "expireTime": "",
   // ICCID列表
-  "iccids": ["89852342022040149139", "89852342022060861597"]
+  "iccids": []
 });
 const formWarning = reactive({
   // 总用量占比
@@ -487,19 +498,11 @@ const formWarning = reactive({
 
 const rules = {
   label: [{required: true, trigger: 'change',}],
-  sim_data_plan_id: [{required: true, trigger: 'change',}],
   source: [{required: true, trigger: 'change',}],
   status: [{required: true, trigger: 'change',}],
-  traffic_type: [{required: true, trigger: 'change',}],
-  billing_type: [{required: true, trigger: 'change',}],
-  bag_size: [{required: true, trigger: 'change',}],
-  billing_cycle: [{required: true, trigger: 'change',}],
-  // trafficPoolType: [{required: true, trigger: 'change',}],
-  settlement_cycle: [{required: true, trigger: 'change',}],
   simTariffId: [{required: true, trigger: 'change',}],
   expireTime: [{required: true, trigger: 'change',}],
-  // pricing: [{ required: true, trigger: 'change', }],
-  // currency: [{ required: true, trigger: 'change', }],
+  iccids: [{required: true, trigger: 'change',}],
 };
 
 // 提交
@@ -595,6 +598,14 @@ const handleDictValue = async () => {
   typeList.value = await Getdictionary('trafficPoolType')
 }
 
+
+watch(() => formState.value.simTariffId, val => {
+  updateCardList({id: val}).then(res => {
+    if (res.code === 200) {
+      card.value = res.data
+    }
+  })
+})
 onMounted(async () => {
   await handleDictValue()
   await intData()

+ 38 - 79
src/views/flowPool/rearFlowPool/index.vue

@@ -73,7 +73,8 @@
         </a-popconfirm>
         <!-- 导卡 -->
         <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="dictShowModel(3, record)">{{
-            $t('flowPool.exportCard') }}</a>
+            $t('flowPool.exportCard')
+          }}</a>
       </template>
 
     </a-table>
@@ -125,13 +126,22 @@
                 </a-option>
               </a-select>
             </a-form-item>
+            <a-form-item :label="$t('flowPool.ICCIDlabel')" field="simTariffId" v-if="formState.simTariffId!==null">
+              <a-select v-model="formState.iccids" multiple
+                        :placeholder="$t('flowPool.ICCIDName')">
+                <a-option v-for=" item in card" :key="item.iccid" :value="item.iccid">{{
+                    item.iccid
+                  }}
+                </a-option>
+              </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"/>
             </a-form-item>
             <a-form-item :label="$t('flowPool.poolSize')" field="size">
               <a-input v-model="formState.size" :placeholder="$t('flowPool.poolSize')"/>
-              <a-select v-model="formState.sizeTpye" style="width: 80px; margin-left: 8px;">
+              <a-select v-model="formState.sizeType" style="width: 80px; margin-left: 8px;">
                 <a-option value="KB">KB</a-option>
                 <a-option value="MB">MB</a-option>
                 <a-option value="GB">GB</a-option>
@@ -318,11 +328,17 @@
 </template>
 
 <script setup>
-import {onMounted, ref, reactive, getCurrentInstance, nextTick} from "vue";
+import {onMounted, ref, reactive, getCurrentInstance, nextTick, watch} from "vue";
 import {useRoute} from "vue-router";
 import {columns} from "../config";
 import {Message, Notification} from '@arco-design/web-vue'
-import {deleteTrafficPool, addTrafficPool, updateTrafficPool, trafficPoolList} from "@/api/path/flowPool.api"
+import {
+  deleteTrafficPool,
+  addTrafficPool,
+  updateTrafficPool,
+  trafficPoolList,
+  updateCardList
+} from "@/api/path/flowPool.api"
 import {tariffList} from "@/api/path/tariffManagement.api"
 import {orderCancel} from "@/api/path/lotCard.api"
 import {enum_dict} from "@/hooks/enum";
@@ -331,7 +347,7 @@ import {Getdictionary} from '@/mixins/index.js'
 
 const systemStore = useSystemStore()
 const role = ref(systemStore.getRole)
-
+const card = ref([])
 
 const {proxy} = getCurrentInstance()
 const formRef = ref()
@@ -348,14 +364,6 @@ const pagination = ref({
 })
 
 
-const rowSelection = reactive({
-  type: 'checkbox',
-  showCheckedAll: true,
-  onlyCurrent: false,
-});
-const selectedKeys = ref([])
-
-
 const intData = async () => {
   const param = {
     current: pagination.value.current,
@@ -492,10 +500,10 @@ const formState = ref({
   // 过期时间
   "expireTime": "",
   // ICCID列表
-  "iccids": ["89852342022040149139", "89852342022060861597"],
+  "iccids": [],
 
   "size": null,
-  "sizeTpye": ''
+  "sizeType": ''
 });
 const formWarning = reactive({
   // 总用量占比
@@ -524,73 +532,21 @@ const formWarning = reactive({
 
 const rules = {
   label: [{required: true, trigger: 'change',}],
-  sim_data_plan_id: [{required: true, trigger: 'change',}],
-  // user_id: [{required: true, trigger: 'change',}],
   source: [{required: true, trigger: 'change',}],
-  traffic_type: [{required: true, trigger: 'change',}],
-  billing_type: [{required: true, trigger: 'change',}],
-  bag_size: [{required: true, trigger: 'change',}],
-  billing_cycle: [{required: true, trigger: 'change',}],
-  trafficPoolType: [{required: true, trigger: 'change',}],
-  settlement_cycle: [{required: true, trigger: 'change',}],
+  status: [{required: true, trigger: 'change',}],
   simTariffId: [{required: true, trigger: 'change',}],
   expireTime: [{required: true, trigger: 'change',}],
-  // pricing: [{ required: true, trigger: 'change', }],
-  // currency: [{ required: true, trigger: 'change', }],
+  iccids: [{required: true, trigger: 'change',}],
   size: [{required: true, trigger: 'change',}],
   sizeType: [{required: true, trigger: 'change',}],
 };
 
-const earlyList = [
-  {value: 1, label: '手工停机'},
-
-];
-
-// 退订
-const handleUnsubscribeDialog = async (record) => {
-  // 订阅关系状态
-  // 1:未激活
-  // 2: 已过期
-  // 3: 已激活99:已退款
-  let param = {}
-  let statusFlag = true
-  if (selectedKeys.value.length > 0) {
-    statusFlag = false
-    param = {
-      ids: selectedKeys.value
-    }
-  }
-  if (record && record.id) {
-    statusFlag = false
-    param = {
-      ids: [record.id]
-    }
-  }
-
-  console.log(param, "param")
-  if (!statusFlag) {
-
-    const {code, data} = await orderCancel(param)
-
-    if (code == 200) {
-      Message.success({
-        content: data,
-        duration: 2000,
-      })
-    }
-  } else {
-    Message.warning({
-      content: $t('lotCard.tipsOrder'),
-      duration: 2000,
-    })
-  }
-};
 
 // 提交
 const handleSubmit = ({values, errors}) => {
   formRef.value.validate(async (errors) => {
     if (!errors) {
-      // values.user_id = Number(values.user_id)
+      values.size = Number(values.size)
       if (formState.value.id) {
         const {code, data} = await updateTrafficPool(values)
 
@@ -667,12 +623,6 @@ const resetForm = () => {
   delete formState.value.id
 }
 
-// 卡详情
-
-const handleOk = () => {
-}
-const handleCancel = () => {
-}
 // --------------------------------------------------------
 // 获取字典
 const handleDictValue = async () => {
@@ -681,10 +631,19 @@ const handleDictValue = async () => {
   typeList.value = await Getdictionary('trafficPoolType')
 }
 
+watch(() => formState.value.simTariffId, val => {
+  if (val === null) return
+  updateCardList({id: val}).then(res => {
+    if (res.code === 200) {
+      card.value = res.data
+    }
+  })
+})
+
 
-onMounted(() => {
-  handleDictValue()
-  intData()
+onMounted(async () => {
+  await handleDictValue()
+  await intData()
 })