|
@@ -30,6 +30,7 @@ const props = defineProps<{
|
|
}>();
|
|
}>();
|
|
// 表单数据
|
|
// 表单数据
|
|
const UpdateForm: any = ref({
|
|
const UpdateForm: any = ref({
|
|
|
|
+ id: null, //ID
|
|
prizeName: "", //奖励名称
|
|
prizeName: "", //奖励名称
|
|
prizePercent: "", //奖励比例
|
|
prizePercent: "", //奖励比例
|
|
prizeAmount: "", //奖励固定金额
|
|
prizeAmount: "", //奖励固定金额
|
|
@@ -40,9 +41,14 @@ const UpdateForm: any = ref({
|
|
});
|
|
});
|
|
// 条件模式选项数据
|
|
// 条件模式选项数据
|
|
const conditionModeOptionList = [
|
|
const conditionModeOptionList = [
|
|
|
|
+ { id: 'all', label: '全部满足' },
|
|
|
|
+ { id: 'one', label: '一个满足' },
|
|
]
|
|
]
|
|
// 奖励内容选项数据
|
|
// 奖励内容选项数据
|
|
const prizeContentOptionList = [
|
|
const prizeContentOptionList = [
|
|
|
|
+ { id: 'cash', label: '现金' },
|
|
|
|
+ { id: 'recyc', label: '循环资格' },
|
|
|
|
+ { id: 'coupon', label: '机具券' },
|
|
]
|
|
]
|
|
|
|
|
|
// 表单实例
|
|
// 表单实例
|
|
@@ -72,6 +78,7 @@ const submit = async (formEl) => {
|
|
type: "success"
|
|
type: "success"
|
|
});
|
|
});
|
|
UpdateForm.value = {
|
|
UpdateForm.value = {
|
|
|
|
+ id: null, //ID
|
|
prizeName: "", //奖励名称
|
|
prizeName: "", //奖励名称
|
|
prizePercent: "", //奖励比例
|
|
prizePercent: "", //奖励比例
|
|
prizeAmount: "", //奖励固定金额
|
|
prizeAmount: "", //奖励固定金额
|
|
@@ -104,6 +111,9 @@ const submit = async (formEl) => {
|
|
|
|
|
|
// 表单校验规则
|
|
// 表单校验规则
|
|
const rules = reactive({
|
|
const rules = reactive({
|
|
|
|
+ id: [
|
|
|
|
+ { required: true, message: '请输入ID', trigger: 'blur' },
|
|
|
|
+ ],
|
|
prizeName: [
|
|
prizeName: [
|
|
{ required: true, message: '请输入奖励名称', trigger: 'blur' },
|
|
{ required: true, message: '请输入奖励名称', trigger: 'blur' },
|
|
],
|
|
],
|
|
@@ -128,6 +138,7 @@ const openVisible = async () => {
|
|
// 关闭弹窗回调函数
|
|
// 关闭弹窗回调函数
|
|
const closeUpdatePriListVisible = () => {
|
|
const closeUpdatePriListVisible = () => {
|
|
UpdateForm.value = {
|
|
UpdateForm.value = {
|
|
|
|
+ id: null, //ID
|
|
prizeName: "", //奖励名称
|
|
prizeName: "", //奖励名称
|
|
prizePercent: "", //奖励比例
|
|
prizePercent: "", //奖励比例
|
|
prizeAmount: "", //奖励固定金额
|
|
prizeAmount: "", //奖励固定金额
|
|
@@ -147,14 +158,17 @@ const isFullscreen = ref(false)
|
|
.main
|
|
.main
|
|
el-dialog(v-model='props.editVisible' draggable width="50%" :fullscreen="isFullscreen" title="修改" @close="closeUpdatePriListVisible" @open="openVisible")
|
|
el-dialog(v-model='props.editVisible' draggable width="50%" :fullscreen="isFullscreen" title="修改" @close="closeUpdatePriListVisible" @open="openVisible")
|
|
el-form(:model='UpdateForm' label-position="right" ref="ruleFormRef" :rules="rules" label-width="100px")
|
|
el-form(:model='UpdateForm' label-position="right" ref="ruleFormRef" :rules="rules" label-width="100px")
|
|
|
|
+ el-form-item(label='ID' prop="id")
|
|
|
|
+ el-input-number(v-model='UpdateForm.id' :min="0" :max="1000"
|
|
|
|
+ placeholder="请输入ID")
|
|
el-form-item(label='奖励名称' prop="prizeName")
|
|
el-form-item(label='奖励名称' prop="prizeName")
|
|
el-input(v-model='UpdateForm.prizeName' autocomplete='off'
|
|
el-input(v-model='UpdateForm.prizeName' autocomplete='off'
|
|
placeholder="请输入奖励名称")
|
|
placeholder="请输入奖励名称")
|
|
el-form-item(label='奖励比例' prop="prizePercent")
|
|
el-form-item(label='奖励比例' prop="prizePercent")
|
|
- el-input-number(v-model='UpdateForm.prizePercent' :min="1" :max="1000"
|
|
|
|
|
|
+ el-input-number(v-model='UpdateForm.prizePercent' :min="0" :max="1000"
|
|
placeholder="请输入奖励比例")
|
|
placeholder="请输入奖励比例")
|
|
el-form-item(label='奖励固定金额' prop="prizeAmount")
|
|
el-form-item(label='奖励固定金额' prop="prizeAmount")
|
|
- el-input-number(v-model='UpdateForm.prizeAmount' :min="1" :max="1000"
|
|
|
|
|
|
+ el-input-number(v-model='UpdateForm.prizeAmount' :min="0" :max="1000"
|
|
placeholder="请输入奖励固定金额")
|
|
placeholder="请输入奖励固定金额")
|
|
el-form-item(label="条件模式", prop="conditionMode")
|
|
el-form-item(label="条件模式", prop="conditionMode")
|
|
el-select(
|
|
el-select(
|