|
@@ -22,6 +22,9 @@
|
|
|
<a-button type="text" @click="unmount(record)">{{ record.status == 1 ? '下架' : '上架' }}</a-button>
|
|
|
</a-space>
|
|
|
</template>
|
|
|
+ <template #isRecharge="{ record }">
|
|
|
+ {{ filterDict(SetMealList, record.isRecharge) }}
|
|
|
+ </template>
|
|
|
</a-table>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -35,7 +38,7 @@
|
|
|
</template>
|
|
|
</a-modal>
|
|
|
|
|
|
- <a-modal v-model:visible="visibleSetMeal" width="600px" @cancel="visibleSetMeal = false" title="新增套餐计划">
|
|
|
+ <a-modal v-model:visible="visibleSetMeal" width="600px" @cancel="handelCancel" title="新增套餐计划">
|
|
|
<div class="Form">
|
|
|
<a-form ref="formRef" :rules="rules" :model="Form">
|
|
|
<a-form-item label="套餐计划名称" field="label" validate-trigger="blur">
|
|
@@ -46,6 +49,15 @@
|
|
|
<a-option v-for="(item, index) in userList" :value="item.id">{{ item.name }}</a-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
+ <a-form-item label="套餐计划类型" field="isRecharge">
|
|
|
+ <a-radio-group v-model="Form.isRecharge" :options="SetMealList" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="充值绑定资费" field="defaultTrafficId" validate-trigger="blur">
|
|
|
+ <a-select v-model="Form.defaultTrafficId">
|
|
|
+ <a-option v-for="item in tariffListData" :value="item.id" :key="item.id">{{ item.label
|
|
|
+ }}</a-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
<template #footer>
|
|
@@ -54,7 +66,7 @@
|
|
|
</template>
|
|
|
</a-modal>
|
|
|
<!-- 新增套餐计划 -->
|
|
|
- <AddSetMeal v-if="!AddSet" :id="pid"/>
|
|
|
+ <AddSetMeal v-if="!AddSet" :id="pid" @break="AddSet = true" />
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
@@ -64,7 +76,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 { PackageSchedule, addTariffSchedule, PackageTakedown } from '@/api/path/tariffManagement.api.js'
|
|
|
+import { PackageSchedule, addTariffSchedule, PackageTakedown, tariffList } from '@/api/path/tariffManagement.api.js'
|
|
|
import QrcodeVue from 'qrcode.vue'
|
|
|
import { Getdictionary, tableFunction, filterDict } from '@/mixins/index.js'
|
|
|
import { Message, Modal } from '@arco-design/web-vue';
|
|
@@ -93,12 +105,16 @@ const state = ref({
|
|
|
Form: {
|
|
|
userId: null,
|
|
|
label: null,
|
|
|
+ isRecharge: null,
|
|
|
+ defaultTrafficId: null
|
|
|
},
|
|
|
userList: [],
|
|
|
+ SetMealList: [],
|
|
|
+ tariffListData: [],
|
|
|
AddSet: true,
|
|
|
pid: null
|
|
|
})
|
|
|
-const { pagination, visibleQrCode, codeUrl, visibleSetMeal, userList, Form, AddSet, pid } = toRefs(state.value)
|
|
|
+const { pagination, visibleQrCode, codeUrl, visibleSetMeal, userList, Form, AddSet, pid, SetMealList, tariffListData } = toRefs(state.value)
|
|
|
|
|
|
|
|
|
const { tableData, evChangePage, initData, reset } = tableFunction(pagination.value, PackageSchedule)
|
|
@@ -117,6 +133,7 @@ const fetchCustomerList = async (item) => {
|
|
|
const handleSubmit = ({ values, errors }) => {
|
|
|
formRef.value.validate(async (values, errors) => {
|
|
|
if (!errors) {
|
|
|
+ Form.value.isRecharge = Number(Form.value.isRecharge)
|
|
|
const response = await addTariffSchedule(Form.value)
|
|
|
if (response.code === 200) {
|
|
|
Message.success('添加成功')
|
|
@@ -148,7 +165,25 @@ const SetUpPackage = (item) => {
|
|
|
AddSet.value = false
|
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
+const handelCancel = () => {
|
|
|
+ Object.keys(Form.value).forEach(res => {
|
|
|
+ Form.value[res] = null
|
|
|
+ })
|
|
|
+ visibleSetMeal.value = false
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ SetMealList.value = await Getdictionary('setMeal')
|
|
|
+ let res = await tariffList({ current: 1, size: 99999 })
|
|
|
+ if (res.code === 200) {
|
|
|
+ tariffListData.value = (res.data.records || []).map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ value: item.id,
|
|
|
+ label: item.label + '---' + item.userName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
initData()
|
|
|
fetchCustomerList()
|
|
|
})
|