|
@@ -24,7 +24,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="audit-btn">
|
|
|
- <a-button type="text" @click="dictShowModel(1, null)">
|
|
|
+ <a-button type="text" @click="dictShowModel(1, null)" v-if="role.getRole == 1">
|
|
|
<template #icon>
|
|
|
<icon-plus-circle />
|
|
|
</template>
|
|
@@ -32,8 +32,8 @@
|
|
|
</a-button>
|
|
|
</div>
|
|
|
|
|
|
- <a-table row-key="id" :data="dataSource" :columns="columns" :pagination="pagination"
|
|
|
- :row-selection="rowSelection" v-model:selectedKeys="selectedKeys" :scroll="{ x: 'auto' }">
|
|
|
+ <a-table row-key="id" :data="dataSource" :columns="role.getRole == 1 ? columns : columnsCustomer"
|
|
|
+ :pagination="pagination" :scroll="{ x: 'auto' }" @page-change="evChangePage">
|
|
|
<template #id="{ record }">
|
|
|
<!-- 修改 -->
|
|
|
<a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="dictShowModel(2, record)">{{
|
|
@@ -54,13 +54,21 @@
|
|
|
@onCancel="resetForm" centered :maskClosable="false" :footer="null">
|
|
|
<a-form ref="formRef" :rules="rules" :model="formState" @submit="handleSubmit">
|
|
|
<div class="formTitle">基本信息</div>
|
|
|
-
|
|
|
- <a-form-item :label="$t('tariffManagement.simDataPlanId')" field="sim_data_plan_id">
|
|
|
- <a-select v-model="formState.sim_data_plan_id">
|
|
|
- <a-option v-for=" item in planList" :key="item.superior_id" :value="item.id"> 流量包{{ item.id
|
|
|
+ <a-form-item :label="$t('tariffManagement.source')" field="source">
|
|
|
+ <a-select v-model="formState.source">
|
|
|
+ <a-option v-for=" item in sourceList" :key="item.id" :value="item.value">{{ item.label
|
|
|
}}</a-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
+ <template v-if="formState.source">
|
|
|
+ <a-form-item :label="$t('tariffManagement.simDataPlanId')" field="sim_data_plan_id">
|
|
|
+ <a-select v-model="formState.sim_data_plan_id">
|
|
|
+ <a-option v-for=" item in planList" :key="item.superior_id" :value="item.id"> 流量包{{ item.id
|
|
|
+ }}</a-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </template>
|
|
|
+
|
|
|
<a-form-item :label="$t('tariffManagement.feeCode')" field="feeCode" required="">
|
|
|
<a-input v-model="formState.feeCode" />
|
|
|
</a-form-item>
|
|
@@ -73,12 +81,6 @@
|
|
|
}}</a-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
- <a-form-item :label="$t('tariffManagement.source')" field="source">
|
|
|
- <a-select v-model="formState.source">
|
|
|
- <a-option v-for=" item in sourceList" :key="item.id" :value="item.value">{{ item.label
|
|
|
- }}</a-option>
|
|
|
- </a-select>
|
|
|
- </a-form-item>
|
|
|
<a-form-item :label="$t('tariffManagement.trafficType')" field="traffic_type">
|
|
|
<a-select v-model="formState.traffic_type">
|
|
|
<a-option v-for=" item in trafficList" :key="item.id" :value="item.value">{{ item.label
|
|
@@ -215,16 +217,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, planColumns } from "./config";
|
|
|
+import { columns, columnsCustomer, planColumns } from "./config";
|
|
|
import { Message, Notification } from '@arco-design/web-vue'
|
|
|
import { deleteTariff, updateTariff, addTariff, tariffList } from "@/api/path/tariffManagement.api"
|
|
|
-import { dataPlanList } from "@/api/path/lotCard.api"
|
|
|
+import { getDataPlanList } from "@/api/path/lotCard.api"
|
|
|
import { userList } from '@/api/path/system.api'
|
|
|
|
|
|
import { enum_dict } from "@/hooks/enum";
|
|
|
import { useSystemStore } from '@/store/modules/systemStore'
|
|
|
+const role = useSystemStore()
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
@@ -296,7 +299,10 @@ const handleDel = async (id) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-//
|
|
|
+const evChangePage = (page) => {
|
|
|
+ pagination.value.current = page
|
|
|
+ intData()
|
|
|
+}
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
intData()
|
|
@@ -458,18 +464,26 @@ const dictShowModel = (type, data) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 获取id数组
|
|
|
const handleModelId = async () => {
|
|
|
const param = {
|
|
|
current: 1,
|
|
|
size: 999,
|
|
|
}
|
|
|
- dataPlanList(param).then(res => {
|
|
|
- planList.value = res.data.records || []
|
|
|
- })
|
|
|
userList(param).then(res => {
|
|
|
userIdList.value = (res.data.records || []).filter((item) => item.user_type == '2')
|
|
|
})
|
|
|
}
|
|
|
+const handleDataPlan = async () => {
|
|
|
+ const param = {
|
|
|
+ current: 1,
|
|
|
+ size: 999,
|
|
|
+ source: formState.value.source
|
|
|
+ }
|
|
|
+ getDataPlanList(param).then(res => {
|
|
|
+ planList.value = res.data.records || []
|
|
|
+ })
|
|
|
+}
|
|
|
// 取消
|
|
|
const resetForm = () => {
|
|
|
visible.value = false;
|
|
@@ -489,26 +503,7 @@ const rowSelectionPlan = reactive({
|
|
|
onlyCurrent: false,
|
|
|
});
|
|
|
|
|
|
-const handlePlan = async () => {
|
|
|
- planVisible.value = true
|
|
|
- const param = {
|
|
|
- current: 1,
|
|
|
- size: 10,
|
|
|
- ...formData.value,
|
|
|
- }
|
|
|
- const { data } = await dataPlanList(param)
|
|
|
- planList.value = (data.records || []).map((item, index) => {
|
|
|
- const sourceName = sourceList.value.find(val => val.value == item.source)?.label
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- sourceName,
|
|
|
- label: "资费" + (index + 1),
|
|
|
- feeCode: "NR0" + (index + 1),
|
|
|
- bag_size: "2.0MB"
|
|
|
- }
|
|
|
- })
|
|
|
|
|
|
-}
|
|
|
const resetSearchPlan = () => {
|
|
|
|
|
|
}
|
|
@@ -525,6 +520,18 @@ const handleSubmitPlan = () => {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => formState.value.source,
|
|
|
+ (newValue, oldValue) => {
|
|
|
+
|
|
|
+ if (newValue != oldValue) {
|
|
|
+ handleDataPlan()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { immediate: true }
|
|
|
+);
|
|
|
+
|
|
|
// -------------------------------------------------------
|
|
|
// 获取字典
|
|
|
const handleDictValue = () => {
|