|
@@ -54,12 +54,12 @@
|
|
@onCancel="resetForm" centered :maskClosable="false" :footer="null">
|
|
@onCancel="resetForm" centered :maskClosable="false" :footer="null">
|
|
<a-form ref="formRef" :rules="rules" :model="formState" @submit="handleSubmit">
|
|
<a-form ref="formRef" :rules="rules" :model="formState" @submit="handleSubmit">
|
|
<div class="formTitle">基本信息</div>
|
|
<div class="formTitle">基本信息</div>
|
|
|
|
+
|
|
<a-form-item :label="$t('tariffManagement.simDataPlanId')" field="sim_data_plan_id">
|
|
<a-form-item :label="$t('tariffManagement.simDataPlanId')" field="sim_data_plan_id">
|
|
- <a-input v-model="formState.sim_data_plan_id">
|
|
|
|
- <template #append>
|
|
|
|
- <a-button class="m-r-10" @click="handlePlan()">选择流量包</a-button>
|
|
|
|
- </template>
|
|
|
|
- </a-input>
|
|
|
|
|
|
+ <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>
|
|
</a-form-item>
|
|
<a-form-item :label="$t('tariffManagement.feeCode')" field="feeCode" required="">
|
|
<a-form-item :label="$t('tariffManagement.feeCode')" field="feeCode" required="">
|
|
<a-input v-model="formState.feeCode" />
|
|
<a-input v-model="formState.feeCode" />
|
|
@@ -68,7 +68,10 @@
|
|
<a-input v-model="formState.label" />
|
|
<a-input v-model="formState.label" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item :label="$t('tariffManagement.userId')" field="user_id">
|
|
<a-form-item :label="$t('tariffManagement.userId')" field="user_id">
|
|
- <a-input v-model="formState.user_id" />
|
|
|
|
|
|
+ <a-select v-model="formState.user_id">
|
|
|
|
+ <a-option v-for=" item in userIdList" :key="item.id" :value="item.id">{{ item.name
|
|
|
|
+ }}</a-option>
|
|
|
|
+ </a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item :label="$t('tariffManagement.source')" field="source">
|
|
<a-form-item :label="$t('tariffManagement.source')" field="source">
|
|
<a-select v-model="formState.source">
|
|
<a-select v-model="formState.source">
|
|
@@ -218,6 +221,8 @@ import { columns, planColumns } from "./config";
|
|
import { Message, Notification } from '@arco-design/web-vue'
|
|
import { Message, Notification } from '@arco-design/web-vue'
|
|
import { deleteTariff, updateTariff, addTariff, tariffList } from "@/api/path/tariffManagement.api"
|
|
import { deleteTariff, updateTariff, addTariff, tariffList } from "@/api/path/tariffManagement.api"
|
|
import { dataPlanList } from "@/api/path/lotCard.api"
|
|
import { dataPlanList } from "@/api/path/lotCard.api"
|
|
|
|
+import { userList } from '@/api/path/system.api'
|
|
|
|
+
|
|
import { enum_dict } from "@/hooks/enum";
|
|
import { enum_dict } from "@/hooks/enum";
|
|
import { useSystemStore } from '@/store/modules/systemStore'
|
|
import { useSystemStore } from '@/store/modules/systemStore'
|
|
|
|
|
|
@@ -305,6 +310,10 @@ const resetSearch = () => {
|
|
|
|
|
|
|
|
|
|
// -------------------弹窗数据------------------------------------
|
|
// -------------------弹窗数据------------------------------------
|
|
|
|
+const planList = ref([])
|
|
|
|
+const userIdList = ref([])
|
|
|
|
+
|
|
|
|
+
|
|
const visible = ref(false);
|
|
const visible = ref(false);
|
|
const typeCurrent = ref(null);
|
|
const typeCurrent = ref(null);
|
|
const sourceList = ref([])
|
|
const sourceList = ref([])
|
|
@@ -349,9 +358,6 @@ const formState = ref({
|
|
// 流量包大小类型
|
|
// 流量包大小类型
|
|
"bagSizeUnit": "KB",
|
|
"bagSizeUnit": "KB",
|
|
"pricingUnit": "月",
|
|
"pricingUnit": "月",
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
});
|
|
});
|
|
|
|
|
|
const rules = {
|
|
const rules = {
|
|
@@ -373,10 +379,16 @@ const rules = {
|
|
const handleSubmit = ({ values, errors }) => {
|
|
const handleSubmit = ({ values, errors }) => {
|
|
formRef.value.validate(async (errors) => {
|
|
formRef.value.validate(async (errors) => {
|
|
if (!errors) {
|
|
if (!errors) {
|
|
- values.user_id = Number(values.user_id)
|
|
|
|
- values.currency = '1'
|
|
|
|
|
|
+ const formVal = JSON.parse(JSON.stringify(values))
|
|
|
|
+ delete formVal.settlementCycleMap
|
|
|
|
+ delete formVal.bagSizeUnit
|
|
|
|
+ delete formVal.pricingUnit
|
|
|
|
+
|
|
|
|
+ formVal.currency = '1'
|
|
|
|
+ formVal.user_id = Number(values.user_id)
|
|
|
|
+ formVal.sim_data_plan_id = String(values.sim_data_plan_id)
|
|
if (values.settlementCycleMap.starTime && values.settlementCycleMap.starTime) {
|
|
if (values.settlementCycleMap.starTime && values.settlementCycleMap.starTime) {
|
|
- values.settlement_cycle = values.settlementCycleMap.starTime + '~' + values.settlementCycleMap.endTime
|
|
|
|
|
|
+ formVal.settlement_cycle = values.settlementCycleMap.starTime + '~' + values.settlementCycleMap.endTime
|
|
} else {
|
|
} else {
|
|
Message.warning({
|
|
Message.warning({
|
|
content: "请选择订购周期!",
|
|
content: "请选择订购周期!",
|
|
@@ -390,7 +402,7 @@ const handleSubmit = ({ values, errors }) => {
|
|
values.pricing = values.pricing + '元/' + values.pricingUnit
|
|
values.pricing = values.pricing + '元/' + values.pricingUnit
|
|
}
|
|
}
|
|
if (formState.value.id) {
|
|
if (formState.value.id) {
|
|
- const { code, data } = await updateTariff(values)
|
|
|
|
|
|
+ const { code, data } = await updateTariff(formVal)
|
|
|
|
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
Message.success({
|
|
Message.success({
|
|
@@ -401,7 +413,7 @@ const handleSubmit = ({ values, errors }) => {
|
|
intData()
|
|
intData()
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- const { code, data } = await addTariff(values)
|
|
|
|
|
|
+ const { code, data } = await addTariff(formVal)
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
Message.success({
|
|
Message.success({
|
|
content: "添加成功!",
|
|
content: "添加成功!",
|
|
@@ -417,15 +429,17 @@ const handleSubmit = ({ values, errors }) => {
|
|
}
|
|
}
|
|
// 弹框
|
|
// 弹框
|
|
const dictShowModel = (type, data) => {
|
|
const dictShowModel = (type, data) => {
|
|
|
|
+ handleModelId()
|
|
formRef.value.resetFields();
|
|
formRef.value.resetFields();
|
|
formState.value.settlementCycleMap.starTime = ''
|
|
formState.value.settlementCycleMap.starTime = ''
|
|
formState.value.settlementCycleMap.endTime = ''
|
|
formState.value.settlementCycleMap.endTime = ''
|
|
typeCurrent.value = type;
|
|
typeCurrent.value = type;
|
|
- visible.value = true;
|
|
|
|
|
|
+
|
|
// 编辑
|
|
// 编辑
|
|
if (type == 2) {
|
|
if (type == 2) {
|
|
-
|
|
|
|
Object.assign(formState.value, data);
|
|
Object.assign(formState.value, data);
|
|
|
|
+ formState.value.sim_data_plan_id = Number(formState.value.sim_data_plan_id)
|
|
|
|
+ formState.value.user_id = Number(formState.value.user_id)
|
|
if (data.bag_size) {
|
|
if (data.bag_size) {
|
|
formState.value.bagSizeUnit = data.bag_size.replace(/\d/g, '')
|
|
formState.value.bagSizeUnit = data.bag_size.replace(/\d/g, '')
|
|
formState.value.bag_size = data.bag_size.match(/\d+/)[0]
|
|
formState.value.bag_size = data.bag_size.match(/\d+/)[0]
|
|
@@ -439,6 +453,22 @@ const dictShowModel = (type, data) => {
|
|
formState.value.settlementCycleMap.endTime = data.settlement_cycle.split('~')[1] || ''
|
|
formState.value.settlementCycleMap.endTime = data.settlement_cycle.split('~')[1] || ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ visible.value = true;
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+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 resetForm = () => {
|
|
const resetForm = () => {
|
|
@@ -451,7 +481,7 @@ const resetForm = () => {
|
|
// 资费弹窗------------------------------------------------
|
|
// 资费弹窗------------------------------------------------
|
|
const planVisible = ref(false)
|
|
const planVisible = ref(false)
|
|
const formData = ref({})
|
|
const formData = ref({})
|
|
-const planList = ref([])
|
|
|
|
|
|
+// const planList = ref([])
|
|
const selectedKeysPlan = ref([])
|
|
const selectedKeysPlan = ref([])
|
|
const rowSelectionPlan = reactive({
|
|
const rowSelectionPlan = reactive({
|
|
type: 'radio',
|
|
type: 'radio',
|
|
@@ -462,8 +492,8 @@ const rowSelectionPlan = reactive({
|
|
const handlePlan = async () => {
|
|
const handlePlan = async () => {
|
|
planVisible.value = true
|
|
planVisible.value = true
|
|
const param = {
|
|
const param = {
|
|
- current: pagination.value.current,
|
|
|
|
- size: pagination.value.pageSize,
|
|
|
|
|
|
+ current: 1,
|
|
|
|
+ size: 10,
|
|
...formData.value,
|
|
...formData.value,
|
|
}
|
|
}
|
|
const { data } = await dataPlanList(param)
|
|
const { data } = await dataPlanList(param)
|
|
@@ -477,7 +507,6 @@ const handlePlan = async () => {
|
|
bag_size: "2.0MB"
|
|
bag_size: "2.0MB"
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- pagination.value.total = data.total
|
|
|
|
|
|
|
|
}
|
|
}
|
|
const resetSearchPlan = () => {
|
|
const resetSearchPlan = () => {
|