Commit 5b91a263 by 李伟康

修复BUG

1 parent d7f1a8e3
......@@ -16,6 +16,7 @@
:tableParams="tableParams"
:tableTotal="tableTotal"
:pageConf="pageConf"
@refreshTable="refreshTable"
ref="listRef"
>
</GLTable>
......
......@@ -12,6 +12,30 @@
:formData="formData"
:formRules="rule"
>
<template #merchantId>
<el-select
v-model="configForm.merchantId"
placeholder="请选择"
filterable
remote
:remote-method="remoteMethod"
v-reachbottom="onReachBottom"
@focus="selectFocus"
:loading="loading"
:disabled="disabled"
@change="change"
>
<el-option
v-for="item in merchantObj.data"
:key="item.confId"
:label="item.confName"
:value="item.confId"
></el-option>
<template v-if="merchantObj.nothing">
<div class="select-nothing">到底了!</div>
</template>
</el-select>
</template>
<div
slot="cover"
class="edit-tips"
......@@ -101,9 +125,10 @@
import dayjs from 'dayjs'
import { formData, rule, afterRangePickerOptions } from './addJS/add.js'
import PrizeBox from './components/PrizeBox.vue'
import { getMerchantListMixin } from '@/mixins'
export default {
components: { PrizeBox },
mixins: [getMerchantListMixin],
name: '',
data () {
return {
......@@ -133,18 +158,24 @@ export default {
groupLimitList: [],
relayLotteryId: '',
isEdit: false,
disabled: false
disabled: false,
merchantObj: {
nothing: false,
data: [],
currentPage: 1,
name: '',
loading: false,
total: 0
}
}
},
watch: {
'configForm.merchantId' (n) {
const { optionList } = this.formData.find(e => e.name == 'merchantId'),
{ disabled } = this
optionList.map(e => {
if (e.confId == n) this.configForm.merchantName = e.confName
})
this.getMerchantWechatGroupList([n])
const { disabled } = this,
{ groupLimitOpen } = this.configForm
this.configForm.merchantName = this.merchantObj.data.find(e => e.confId == n).confName
if (groupLimitOpen) this.getMerchantWechatGroupList([n])
if (!disabled) {
this.$refs.prizeRef.reset()
this.configForm.groupLimitList = []
......@@ -187,6 +218,9 @@ export default {
}
},
methods: {
changt (id) {
},
showError (message) {
this.$message.error(message || '请先选择所属渠道!')
},
......@@ -198,13 +232,11 @@ export default {
console.log(data)
this.formData.map(e => {
e.isDisabled = disabled
// if (disabled && e.name == 'description') this.$refs.formRef.forbidEdit(e)
if (e.name == 'merchantId') e.optionList = [{
confId: data.merchantId,
confName: data.merchantName
}]
})
this.merchantObj.data = [{
confId: data.merchantId,
confName: data.merchantName
}]
let description = decodeURIComponent(data.description),
endTimeType = 0,
numWin = data.numWin,
......@@ -245,30 +277,6 @@ export default {
}
},
async getMerchantList (merchantName = '') {
if (!merchantName) return
this.$loading()
try {
const { list } = await this.$apis.redenvelope.getRedEnvelopeMerchantList({
currentPage: 1,
merchantName,
pageSize: 999
}),
data = []
list && list.map(e => {
data.push({
confId: e.merchantNo,
confName: e.merchantName,
})
})
this.formData.find(e => e.name == 'merchantId').optionList = data
this.$loading().close()
} catch (error) {
console.log(error)
this.$loading().close()
}
},
choose ({ rewardId, rewardName, rewardType }) {
this.configForm.rewardId = rewardId
this.configForm.rewardType = rewardType
......@@ -369,12 +377,12 @@ export default {
border-color: #f56c6c !important;
}
}
/deep/.text-box-disabled{
/deep/.text-box-disabled {
.w-e-toolbar,
.w-e-text-container{
.w-e-text-container {
background-color: #eee !important;
border-color: #e4e7ed !important;
&:hover{
&:hover {
cursor: not-allowed;
}
}
......
......@@ -12,19 +12,19 @@ export const formData = that => {
{
label: '所属渠道',
name: 'merchantId',
type: 'select',
width: '432px',
attrs: {
'filter-method': (e) => {
that.getMerchantList(e)
},
remote: true
},
noFilter: false,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false
addHtml: 'merchantId'
// attrs: {
// 'filter-method': (e) => {
// that.getMerchantList(e)
// },
// remote: true
// },
// noFilter: false,
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confName',
// isDisabled: false
},
{
label: '群接龙种类',
......@@ -173,7 +173,7 @@ export const rule = that => {
endTimeType: [{
required,
validator: (rule, value, callback) => {
if(that.disabled) callback()
if (that.disabled) callback()
try {
if (value == 1) {
if (!that.configForm.endTime) throw '请选择接龙结束时间'
......@@ -191,7 +191,7 @@ export const rule = that => {
required, trigger,
validator: (rule, value, callback) => {
try {
if(that.disabled) callback()
if (that.disabled) callback()
if (!value) throw '请选择接龙开奖时间'
else {
const valueTimestamp = dayjs(value).valueOf()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!