Commit 99a64011 by 李伟康

修复

1 parent f0ac2135
......@@ -39,9 +39,9 @@
slot="cover"
class="edit-tips"
>图片大小10M</div>
<template #endTimeType>
<template #endTimeLimit>
<div
v-if="configForm.endTimeType == 1"
v-if="configForm.endTimeLimit == 1"
class="item-box"
>
<el-date-picker
......@@ -64,7 +64,7 @@
:picker-options="afterRangePickerOptions"
value-format="yyyy-MM-dd HH:mm:ss"
class="end-time"
:disabled="(configForm.endTimeType == 1 && !configForm.endTime) || disabled "
:disabled="(configForm.endTimeLimit == 1 && !configForm.endTime) || disabled "
>
</el-date-picker>
</template>
......@@ -143,7 +143,7 @@ export default {
numLimit: 9,
numType: 1,
numWin: 0,
endTimeType: 0,
endTimeLimit: 0,
endTime: '',
lotteryTime: '',
groupLimitOpen: false,
......@@ -183,9 +183,12 @@ export default {
})
},
'configForm.groupLimitOpen' (n) {
if (n == 1 && !this.configForm.merchantId) {
this.configForm.groupLimitOpen = false
this.showError()
const { merchantId } = this.configForm
if (n == 1) {
if (!merchantId) {
this.configForm.groupLimitOpen = false
this.showError()
} else this.getMerchantWechatGroupList([merchantId])
}
},
'configForm.numWin' (n) {
......@@ -229,15 +232,11 @@ export default {
confName: data.merchantName
}]
let description = data.description,
endTimeType = 0,
numWin = data.numWin,
endTime = data.endTime,
groupLimitList = []
this.$refs.formRef.$refs.descriptionTextBox[0].setEdit(description)
if (endTime) {
if (endTime != data.lotteryTime) endTimeType = 1
endTime = dayjs(endTime).format('YYYY/MM/DD HH:mm:ss')
}
if (endTime) endTime = dayjs(endTime).format('YYYY/MM/DD HH:mm:ss')
if (data.numType == 1) numWin = 0
if (data.groupLimitOpen) {
data.groupLimits.map(e => {
......@@ -251,7 +250,7 @@ export default {
title: data.title,
cover: data.cover,
numLimit: data.numLimit,
endTimeType,
endTimeLimit: data.endTimeLimit,
lotteryTime: dayjs(data.lotteryTime).format('YYYY/MM/DD HH:mm:ss'),
groupLimitOpen: data.groupLimitOpen,
groupLimitList,
......@@ -281,8 +280,7 @@ export default {
const params = JSON.parse(JSON.stringify(this.configForm)),
{ relayLotteryId } = this
if (params.numType == 1) delete params.numWin
if (params.endTimeType == 0) {
delete params.endTimeType
if (params.endTimeLimit == 0) {
delete params.endTime
}
this.$loading()
......
......@@ -112,7 +112,7 @@ export const formData = that => {
{
label: '接龙结束时间',
type: 'radio',
name: 'endTimeType',
name: 'endTimeLimit',
optionList: [
{
text: '无限制',
......@@ -125,7 +125,7 @@ export const formData = that => {
],
optionId: 'id',
optionLabel: 'text',
suffixSlot: 'endTimeType',
suffixSlot: 'endTimeLimit',
isDisabled: false
},
{
......@@ -170,7 +170,7 @@ export const rule = that => {
cover: [{ required, message: '请上传卡片封面', trigger }],
numLimit: [{ required }],
numWin: [{ required }],
endTimeType: [{
endTimeLimit: [{
required,
validator: (rule, value, callback) => {
if (that.disabled) callback()
......@@ -195,7 +195,7 @@ export const rule = that => {
if (!value) throw '请选择接龙开奖时间'
else {
const valueTimestamp = dayjs(value).valueOf()
if (that.configForm.endTimeType != 1) {
if (that.configForm.endTimeLimit != 1) {
if (valueTimestamp < dayjs().valueOf()) throw '接龙开奖时间需大于当前时间'
} else {
if (valueTimestamp < dayjs(that.configForm.endTime).valueOf()) throw '接龙开奖时间需大于或等于接龙结束时间'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!