|
@@ -1,11 +1,16 @@
|
|
|
<template>
|
|
|
<el-card shadow="always" :body-style="{ padding: '20px' }">
|
|
|
+ <template #header>
|
|
|
+ <div class="card-header">
|
|
|
+ <span>{{ props.primary ? '编辑' : '添加' }}充值模板</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<el-form :model="dataForm" label-width="120px" ref="form" v-loading="loading" class="pr-6">
|
|
|
<el-form-item label="模板名称" prop="name"
|
|
|
:rules="[{ required: true, message: '模板名称必须填写' }, { max: 20, message: '至多输入20个字符', trigger: 'blur' },]">
|
|
|
<el-input :disabled="props.primary" class="item" v-model="dataForm.name" clearable />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="充值档位" prop="options" :rules="[{ required: true, message: '请选择通知类型' }]">
|
|
|
+ <el-form-item label="充值档位" prop="options" :rules="[{ required: true, message: '请添加充值档位' }]">
|
|
|
<el-card class="w-full" shadow="never">
|
|
|
<div class="pt-5 pl-2">
|
|
|
<Add @click="openGears(null, null)" />
|
|
@@ -52,7 +57,7 @@
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<Dialog v-model="visibleGears" :title="title" width="40%" destroy-on-close>
|
|
|
- <createGears @close="gearsClose" @success="success" :data="tableData" :primary="gearsData" :ismulSet="ismulSet" />
|
|
|
+ <createGears @close="gearsClose" @success="success" :data="tableData" :primary="gearsData" />
|
|
|
</Dialog>
|
|
|
</el-card>
|
|
|
</template>
|
|
@@ -62,7 +67,8 @@ import { onMounted, ref } from 'vue';
|
|
|
import {
|
|
|
channelPaytemplateShow,
|
|
|
channelPaytemplateStore,
|
|
|
- channelPaytemplateUpdate
|
|
|
+ channelPaytemplateUpdate,
|
|
|
+ channelPaytemplateOptionTypeList
|
|
|
} from '@/api/charge/index'
|
|
|
import { FormInstance } from 'element-plus';
|
|
|
import createGears from './createGears.vue'
|
|
@@ -72,11 +78,13 @@ const gearsData = ref()
|
|
|
const tableData = ref([])
|
|
|
const form = ref()
|
|
|
const emit = defineEmits(['close']);
|
|
|
-const dataForm = ref({})
|
|
|
-import {
|
|
|
- channelPaytemplateOptionTypeList,
|
|
|
- channelPaytemplateOptionOptionSequence
|
|
|
-} from '@/api/charge/index'
|
|
|
+const dataForm = ref({ status: 1 })
|
|
|
+
|
|
|
+const title = computed(() =>
|
|
|
+ gearsData.value ?
|
|
|
+ '编辑充值档位' : '添加充值档位'
|
|
|
+)
|
|
|
+
|
|
|
const optionTypeList = ref([]);
|
|
|
const props = defineProps({
|
|
|
primary: String | Number | Object,
|
|
@@ -128,8 +136,6 @@ const success = (e) => {
|
|
|
} else {
|
|
|
tableData.value.push(data)
|
|
|
}
|
|
|
-
|
|
|
- // emit('close')
|
|
|
}
|
|
|
const cancel = () => {
|
|
|
emit('close')
|
|
@@ -157,14 +163,11 @@ const submitFormChange = (formEl: FormInstance | undefined) => {
|
|
|
console.log(params, 'paramsparams');
|
|
|
if (props.primary) {
|
|
|
channelPaytemplateUpdate(dataForm.value.id, params).then(res => {
|
|
|
- console.log(res, 'channelPaytemplateUpdatechannelPaytemplateUpdatechannelPaytemplateUpdate');
|
|
|
loading.value = false;
|
|
|
emit('close')
|
|
|
})
|
|
|
-
|
|
|
} else {
|
|
|
channelPaytemplateStore(params).then(res => {
|
|
|
- console.log(res, 'channelPaytemplateStorechannelPaytemplateStorechannelPaytemplateStore');
|
|
|
loading.value = false;
|
|
|
emit('close')
|
|
|
})
|