Commit dcb938f4 by 前端

Merge branch 'wuwx_dev_v2.7.0' into 'v2.7.0'

Wuwx dev v2.7.0

See merge request !269
2 parents 1952ec13 ece1a919
This diff could not be displayed because it is too large.
...@@ -57,9 +57,6 @@ export default { ...@@ -57,9 +57,6 @@ export default {
this.formatPhone() this.formatPhone()
}, },
formatPhone() { formatPhone() {
this.$nextTick(() => {
setTimeout(() => {
console.log('phones',this.phones);
let phoneLists = this.phones.split('\n') let phoneLists = this.phones.split('\n')
phoneLists = [...new Set(phoneLists)] phoneLists = [...new Set(phoneLists)]
// let phoneLists = this.phones.split(/[\n|\s|,|,]/) // let phoneLists = this.phones.split(/[\n|\s|,|,]/)
...@@ -77,10 +74,7 @@ export default { ...@@ -77,10 +74,7 @@ export default {
}) })
}) })
this.phoneLists = arr.filter(item => item.tel) this.phoneLists = arr.filter(item => item.tel)
console.log('phoneLists',this.phoneLists);
this.$emit('changePhoneList', this.phoneLists) this.$emit('changePhoneList', this.phoneLists)
},100)
})
}, },
} }
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</div> </div>
<div class="approval" slot="approvalSlot"> <div class="approval" slot="approvalSlot">
<!-- <el-radio :disabled="routeInfo.receivedStock" v-model="editForm.approveFlag" :label="1">赠送前需审批</el-radio> --> <!-- <el-radio :disabled="routeInfo.receivedStock" v-model="editForm.approveFlag" :label="1">赠送前需审批</el-radio> -->
<el-radio disabled v-model="editForm.approveFlag" :label="1">赠送前需审批</el-radio> <el-radio v-model="editForm.approveFlag" :label="1">赠送前需审批</el-radio>
<p class="approval-tip" style="margin-bottom:12px;">员工在赠送时需提交赠送申请,审批通过后才可赠送</p> <p class="approval-tip" style="margin-bottom:12px;">员工在赠送时需提交赠送申请,审批通过后才可赠送</p>
<el-radio :disabled="routeInfo.receivedStock" v-model="editForm.approveFlag" :label="2">无需审批</el-radio> <el-radio :disabled="routeInfo.receivedStock" v-model="editForm.approveFlag" :label="2">无需审批</el-radio>
<p class="approval-tip">无需审批,可直接赠送给客户</p> <p class="approval-tip">无需审批,可直接赠送给客户</p>
...@@ -79,10 +79,12 @@ ...@@ -79,10 +79,12 @@
</el-tag> </el-tag>
</div> </div>
</div> </div>
<div class="approval" slot="cardHolder"> <div class="approval" slot="grantType">
<el-radio :disabled="routeInfo.addOrEdit == 'edit'" v-model="editForm.cardHolder" :label="1">否</el-radio> <el-radio :disabled="routeInfo.addOrEdit == 'edit'" v-model="editForm.grantType" :label="1">否</el-radio>
<el-radio :disabled="routeInfo.addOrEdit == 'edit'" v-model="editForm.cardHolder" :label="2">是</el-radio> <el-radio :disabled="routeInfo.addOrEdit == 'edit'" v-model="editForm.grantType" :label="2">是</el-radio>
<p class="cardHolder-tip">(根据手机号将礼包中的优惠券直接发放到小程序对应账户的卡包中)</p> <p class="grantType-tip">(根据手机号将礼包中的优惠券直接发放到小程序对应账户的卡包中)</p>
</div>
<div class="approval" slot="receiveDetails">
<phoneArea :phones="phones" :phoneLists="phoneLists" ref="phoneArea" placeholder="请输入领取手机号,多个手机号以换行隔开" /> <phoneArea :phones="phones" :phoneLists="phoneLists" ref="phoneArea" placeholder="请输入领取手机号,多个手机号以换行隔开" />
</div> </div>
</glsx-combi-form> </glsx-combi-form>
...@@ -120,7 +122,6 @@ export default { ...@@ -120,7 +122,6 @@ export default {
return { return {
phones:'', phones:'',
phoneLists:[], phoneLists:[],
arrs:'18952120000,18952120001,18952120002,18952120003,18952120004,18952120005,18952120006,18952120007,18952120008,18952120009,',
phone: '', phone: '',
arr:[], arr:[],
isLoaded: true, isLoaded: true,
...@@ -160,9 +161,9 @@ export default { ...@@ -160,9 +161,9 @@ export default {
// 优惠券状态(status):1:未生效,2:生效中,3:已失效 // 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList: [], couponList: [],
stock: 1, stock: 1,
approveFlag: 2, approveFlag: 1,
receiveRule: 1, receiveRule: 1,
cardHolder: 1, grantType: 1,
}, },
totalEstimatedCost: '', totalEstimatedCost: '',
orderShow: ['service', 'cash', 'discount', 'exchange'], orderShow: ['service', 'cash', 'discount', 'exchange'],
...@@ -221,7 +222,16 @@ export default { ...@@ -221,7 +222,16 @@ export default {
], ],
approveFlag: [{ required: true, message: '请选择审批要求', trigger: 'change' }], approveFlag: [{ required: true, message: '请选择审批要求', trigger: 'change' }],
receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }], receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }],
cardHolder: [{ required: true, message: '', trigger: 'change' }] grantType: [{ required: true, message: '', trigger: 'change' }],
receiveDetails: [
{
required: true,
validator: (rule, value, callback) => {
return this.$refs.phoneArea.phones ? callback() : callback(new Error('请输入用户手机号'))
},
trigger: 'change'
}
]
// receiveDetails: [ // receiveDetails: [
// { required: true, message: '请输入领取条件', trigger: 'change' }, // { required: true, message: '请输入领取条件', trigger: 'change' },
// { // {
...@@ -273,12 +283,9 @@ export default { ...@@ -273,12 +283,9 @@ export default {
}, },
{ {
label: '发放到小程序卡包', label: '发放到小程序卡包',
name: 'cardHolder', name: 'grantType',
isDisabled: false, isDisabled: false,
addHtml: 'cardHolder', addHtml: 'grantType'
// style: {
// 'margin-left': '10px'
// }
}, },
{ {
label: '库存数量', label: '库存数量',
...@@ -307,7 +314,6 @@ export default { ...@@ -307,7 +314,6 @@ export default {
{ {
confId: 2, confId: 2,
confName: '员工赠送时指定', confName: '员工赠送时指定',
isDisabled: true
}, },
{ {
confId: 3, confId: 3,
...@@ -362,6 +368,12 @@ export default { ...@@ -362,6 +368,12 @@ export default {
addHtml: 'staffListBlock' addHtml: 'staffListBlock'
}, },
{ {
label: '用户手机号',
name: 'receiveDetails',
addHtml: 'receiveDetails',
isHide: true
},
{
label: '赠送原因', label: '赠送原因',
name: 'giveReason', name: 'giveReason',
type: 'input', type: 'input',
...@@ -404,14 +416,15 @@ export default { ...@@ -404,14 +416,15 @@ export default {
this.isChangePeople = this.judgeAddOrDel(val, this.currentPeople, 'staffUUID') this.isChangePeople = this.judgeAddOrDel(val, this.currentPeople, 'staffUUID')
} }
}, },
'editForm.cardHolder'(newValue) { 'editForm.grantType'(newValue) {
console.log('newValue',newValue);
let idx = this.editFormData.findIndex(item => item.name == 'staffList') let idx = this.editFormData.findIndex(item => item.name == 'staffList')
let idxx = this.editFormData.findIndex(item => item.name == 'approveFlag') let idxx = this.editFormData.findIndex(item => item.name == 'approveFlag')
let idxxx = this.editFormData.findIndex(item => item.name == 'receiveRule') let idxxx = this.editFormData.findIndex(item => item.name == 'receiveRule')
let idxxxx = this.editFormData.findIndex(item => item.name == 'receiveDetails')
this.editFormData[idx].isHide = newValue == 2 this.editFormData[idx].isHide = newValue == 2
this.editFormData[idxx].isHide = newValue == 2 this.editFormData[idxx].isHide = newValue == 2
this.editFormData[idxxx].isHide = newValue == 2 this.editFormData[idxxx].isHide = newValue == 2
this.editFormData[idxxxx].isHide = newValue == 1
}, },
}, },
computed: { computed: {
...@@ -490,15 +503,17 @@ export default { ...@@ -490,15 +503,17 @@ export default {
this.approvalStatus = res.data.approveStatus - 1 this.approvalStatus = res.data.approveStatus - 1
this.editForm = res.data this.editForm = res.data
this.curStock = res.data.stock this.curStock = res.data.stock
this.editForm.grantType = res.data.grantType || 1
this.receiveWay = res.data.receiveWay || 1 this.receiveWay = res.data.receiveWay || 1
if (res.data && res.data.receiveDetails) { if (res.data && res.data.receiveDetails && res.data.grantType == 1) {
this.phone = res.data.receiveDetails.replaceAll(',', '\n') this.phone = res.data.receiveDetails.replaceAll(',', '\n')
this.formatPhone() this.formatPhone()
} }
if(this.arrs) { if(res.data.receiveDetails && res.data.grantType == 2) {
this.editForm.cardHolder = 1 this.phones = res.data.receiveDetails.replaceAll(',','\n')
this.phones = this.arrs.replaceAll(',','\n') setTimeout(() => {
this.$refs.phoneArea.formatPhone() this.$refs.phoneArea.formatPhone()
},50)
} }
this.recoveryCoupon() this.recoveryCoupon()
this.recoveryTotalPrice() this.recoveryTotalPrice()
...@@ -635,15 +650,16 @@ export default { ...@@ -635,15 +650,16 @@ export default {
}, },
handleConfirm() { handleConfirm() {
if(this.arrs) {
setTimeout(() => {
console.log('phoneLists',this.$refs.phoneArea.phoneLists);
},100)
}
let validItem = this.phoneList.find(item => !item.valid) let validItem = this.phoneList.find(item => !item.valid)
if (validItem && validItem.tel) { if (validItem && validItem.tel) {
return this.$message.error(`${this.receiveWay == 1 ? '手机号' : '车架号'}${validItem.tel}格式错误,请修改!`) return this.$message.error(`${this.receiveWay == 1 ? '手机号' : '车架号'}${validItem.tel}格式错误,请修改!`)
} }
if(this.editForm.grantType == 2){
let validItems = this.$refs.phoneArea.phoneLists.find(item => !item.valid)
if (validItems && validItems.tel) {
return this.$message.error(`手机号格式错误,请修改!`)
}
}
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
...@@ -652,7 +668,7 @@ export default { ...@@ -652,7 +668,7 @@ export default {
params.couponCreateRequests.forEach(item => { params.couponCreateRequests.forEach(item => {
item.couponId = item.id item.couponId = item.id
}) })
if (this.editForm.receiveRule == 1) { if (this.editForm.receiveRule == 1 && this.editForm.grantType == 1) {
params.receiveDetailList = this.phoneList.map(item => item.tel) params.receiveDetailList = this.phoneList.map(item => item.tel)
let maxLength = 500 let maxLength = 500
if(params.receiveDetailList && params.receiveDetailList.length > maxLength){ if(params.receiveDetailList && params.receiveDetailList.length > maxLength){
...@@ -664,12 +680,17 @@ export default { ...@@ -664,12 +680,17 @@ export default {
delete params.couponList delete params.couponList
if (this.routeInfo.addOrEdit == 'edit') { if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id params.id = this.routeInfo.id
if (this.editForm.receiveRule == 2) { if (this.editForm.receiveRule == 2 && this.editForm.grantType == 1) {
let telArr = [] let telArr = []
this.editForm.receiveDetails && (telArr = this.editForm.receiveDetails.split(',')) this.editForm.receiveDetails && (telArr = this.editForm.receiveDetails.split(','))
params.receiveDetailList = [...telArr] params.receiveDetailList = [...telArr]
} }
} }
if(this.editForm.grantType == 2) {
let phoneLists = this.$refs.phoneArea.phoneLists
params.receiveDetailList = phoneLists.map(item => item.tel)
params.receiveWay = this.receiveWay
}
params.requestSource = 1 params.requestSource = 1
// 插入判断是否存在审批模板 // 插入判断是否存在审批模板
// const { session } = this.$globalState // const { session } = this.$globalState
...@@ -978,7 +999,7 @@ export default { ...@@ -978,7 +999,7 @@ export default {
} }
} }
} }
.cardHolder-tip { .grantType-tip {
display: inline; display: inline;
font-size: 12px; font-size: 12px;
color: #999; color: #999;
......
...@@ -102,18 +102,34 @@ ...@@ -102,18 +102,34 @@
<p class="edit-tips">最多支持6张banner,图片格式仅支持JPG,PNG格式</p> <p class="edit-tips">最多支持6张banner,图片格式仅支持JPG,PNG格式</p>
<p class="edit-tips">建议尺寸660*270px,大小10M以内</p> <p class="edit-tips">建议尺寸660*270px,大小10M以内</p>
</div> </div>
<div class="approval" slot="configureStore"> <!-- banner管理配置门店 -->
<el-radio v-model="editForm.configureStore" :label="1">否</el-radio> <div class="approval" slot="bannerToSubMerchant">
<el-radio v-model="editForm.configureStore" :label="2">是</el-radio> <el-radio v-model="editForm.bannerToSubMerchant" :label="'N'">否</el-radio>
<el-button v-show="editForm.configureStore == 2" type="default" @click="handleRelateStoreClose(scope)">{{ editForm.merchantList.length ? '更换门店' : '+选择门店' }}</el-button> <el-radio v-model="editForm.bannerToSubMerchant" :label="'Y'">是</el-radio>
<el-button v-show="editForm.bannerToSubMerchant == 'Y'" type="default" @click="handleRelateStoreClose(scope)">{{ editForm.bannerMerchantList.length ? '更换门店' : '+选择门店' }}</el-button>
</div> </div>
<div slot="merchantTable" class="merchantTable" v-show="editForm.configureStore == 2"> <!-- 公告管理配置门店 -->
<GLTable v-show="editForm.merchantList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList"> <div class="approval" slot="noticeToSubMerchant">
<el-radio v-model="editForm.noticeToSubMerchant" :label="'N'">否</el-radio>
<el-radio v-model="editForm.noticeToSubMerchant" :label="'Y'">是</el-radio>
<el-button v-show="editForm.noticeToSubMerchant == 'Y'" type="default" @click="handleRelateStoreCloses(scope)">{{ editForm.noticeMerchantList.length ? '更换门店' : '+选择门店' }}</el-button>
</div>
<!-- banner管理配置门店 -->
<div slot="merchantTable" class="merchantTable" v-show="editForm.bannerToSubMerchant == 'Y'">
<GLTable v-show="editForm.bannerMerchantList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.bannerMerchantList">
<span slot="auth-button" slot-scope="scope"> <span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleMerchantDelete(scope)">删除</el-button> <el-button type="text" @click="handleMerchantDelete(scope)">删除</el-button>
</span> </span>
</GLTable> </GLTable>
</div> </div>
<!-- 公告管理配置门店 -->
<div slot="noticeMerchantTable" class="merchantTable" v-show="editForm.noticeToSubMerchant == 'Y'">
<GLTable v-show="editForm.noticeMerchantList.length" :hasPage="false" :tableParams="tableParamss" :tableData="editForm.noticeMerchantList">
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleMerchantDeletes(scope)">删除</el-button>
</span>
</GLTable>
</div>
<!-- 金刚区管理 --> <!-- 金刚区管理 -->
<div slot="clueBlock"> <div slot="clueBlock">
<el-checkbox-group v-model="editForm.clueList" @change="handleChange"> <el-checkbox-group v-model="editForm.clueList" @change="handleChange">
...@@ -128,15 +144,15 @@ ...@@ -128,15 +144,15 @@
<GLTable v-show="editForm.customerServerUserId" :hasPage="false" :tableParams="tableParams" :tableData="customerServerList"></GLTable> <GLTable v-show="editForm.customerServerUserId" :hasPage="false" :tableParams="tableParams" :tableData="customerServerList"></GLTable>
</div> --> </div> -->
<div class="approval" slot="customerServerUserId"> <div class="approval" slot="customerServerUserId">
<el-radio v-model="editForm.customerServer" :label="1"> <el-radio v-model="editForm.customerServerType" :label="1">
<el-select style="width: 320px" v-model="editForm.customerServerUserId" :disabled="editForm.customerServer == 2" :clearable="true" :placeholder="'请选择在线客服'" :no-data-text="'无数据'" @change="selectAddAttr"> <el-select style="width: 320px" v-model="editForm.customerServerUserId" :disabled="editForm.customerServerType == 2" :clearable="true" :placeholder="'请选择在线客服'" :no-data-text="'无数据'" @change="selectAddAttr">
<el-option v-for="value in baseData.consultantList" :key="value.userOneid" :label="value.staffName" :value="value.userOneid"></el-option> <el-option v-for="value in baseData.consultantList" :key="value.userOneid" :label="value.staffName" :value="value.userOneid"></el-option>
</el-select> </el-select>
</el-radio> </el-radio>
<el-button v-show="!baseData.consultantList.length" type="text"></el-button> <el-button v-show="!baseData.consultantList.length" type="text"></el-button>
<p style="color: #5850ff;margin-left: 22px;" @click="handleNoServer">请在首页-跟进专员模块里添加类型为“在线客服”的跟进专员</p> <p style="color: #5850ff;margin-left: 22px;" @click="handleNoServer">请在首页-跟进专员模块里添加类型为“在线客服”的跟进专员</p>
<el-radio v-model="editForm.customerServer" v-if="!showGh" :label="2"> <el-radio v-model="editForm.customerServerType" v-if="showGh" :label="2">
<el-input style="width: 320px" placeholder="请输入链接" :disabled="editForm.customerServer == 1" v-model="editForm.customerServerUserId" clearable></el-input> <el-input style="width: 320px" placeholder="请输入链接" :disabled="editForm.customerServerType == 1" v-model="editForm.customerServerUrl" clearable></el-input>
</el-radio> </el-radio>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
...@@ -189,6 +205,7 @@ ...@@ -189,6 +205,7 @@
</video> </video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" /> <img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</el-dialog> </el-dialog>
<!-- banner管理配置门店 -->
<relate-store-dialog v-if="relateStoreVisible" ref="relateStore" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"> <relate-store-dialog v-if="relateStoreVisible" ref="relateStore" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose">
<el-row slot> <el-row slot>
<el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px"> <el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px">
...@@ -204,6 +221,22 @@ ...@@ -204,6 +221,22 @@
</el-form> </el-form>
</el-row> </el-row>
</relate-store-dialog> </relate-store-dialog>
<!-- 公告管理配置门店 -->
<relate-store-dialog v-if="relateStoreVisibles" ref="relateStores" :relateStoreVisible="relateStoreVisibles" :storeApi="storeApi" :storeSearchForm="storeSearchForms" :storeSelected="selectedLists" @handleRelateStoreConfirm="handleRelateStoreConfirms" @handleRelateStoreClose="handleRelateStoreCloses">
<el-row slot>
<el-form :model="storeSearchForms" ref="relate" :inline="true" label-width="90px">
<el-form-item label="商户ID:" prop="merchantId">
<el-input :size="size" v-model.trim="storeSearchForms.merchantId" placeholder="请输入商户ID" clearable></el-input>
</el-form-item>
<el-form-item label="门店名称:" prop="merchantName">
<el-input :size="size" v-model.trim="storeSearchForms.merchantName" placeholder="请输入门店名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearchStores">搜索</el-button>
</el-form-item>
</el-form>
</el-row>
</relate-store-dialog>
</div> </div>
</template> </template>
...@@ -248,12 +281,18 @@ export default { ...@@ -248,12 +281,18 @@ export default {
// }, // },
// 选择门店 // 选择门店
relateStoreVisible: false, relateStoreVisible: false,
relateStoreVisibles: false,
storeApi: this.$apis.common.getSimpleMerchantList, storeApi: this.$apis.common.getSimpleMerchantList,
storeSearchForm: { storeSearchForm: {
merchantId: '', merchantId: '',
merchantName: '' merchantName: ''
}, },
storeSearchForms: {
merchantId: '',
merchantName: ''
},
selectedList: [], selectedList: [],
selectedLists: [],
// 门店表格 // 门店表格
tableParams: { tableParams: {
tableOption: true, tableOption: true,
...@@ -264,6 +303,15 @@ export default { ...@@ -264,6 +303,15 @@ export default {
} }
] ]
}, },
tableParamss: {
tableOption: true,
tableColumns: [
{
label: '门店名称',
prop: 'merchantName'
}
]
},
// 表单 // 表单
editForm: { editForm: {
merchantQrcode: '', merchantQrcode: '',
...@@ -272,9 +320,12 @@ export default { ...@@ -272,9 +320,12 @@ export default {
clueList: [], clueList: [],
customerServerUserId: '', customerServerUserId: '',
bannerList: [], bannerList: [],
configureStore: 1, bannerToSubMerchant: 'N',
merchantList: [], noticeToSubMerchant: 'N',
customerServer: 1 bannerMerchantList: [],
noticeMerchantList: [],
customerServerType: 1,
customerServerUrl: ''
}, },
bannerItem: { bannerItem: {
bannerImg: '', bannerImg: '',
...@@ -323,8 +374,8 @@ export default { ...@@ -323,8 +374,8 @@ export default {
}, },
{ {
label: '一键配置门店', label: '一键配置门店',
name: 'configureStore', name: 'bannerToSubMerchant',
addHtml: 'configureStore', addHtml: 'bannerToSubMerchant',
isHide: false isHide: false
}, },
{ {
...@@ -343,6 +394,16 @@ export default { ...@@ -343,6 +394,16 @@ export default {
rows: '4', rows: '4',
inputType: 'textarea', inputType: 'textarea',
maxlength: '50' maxlength: '50'
},
{
label: '一键配置门店',
name: 'noticeToSubMerchant',
addHtml: 'noticeToSubMerchant',
isHide: false
},
{
name: '',
addHtml: 'noticeMerchantTable'
} }
] ]
}, },
...@@ -446,8 +507,11 @@ export default { ...@@ -446,8 +507,11 @@ export default {
// 非集团账号隐藏配置门店 // 非集团账号隐藏配置门店
if(!this.$isGroupUp){ if(!this.$isGroupUp){
let idx = this.externalFormList.findIndex(item => item.title == 'Banner管理') let idx = this.externalFormList.findIndex(item => item.title == 'Banner管理')
let idxx = this.externalFormList[idx].editFormData.findIndex(item => item.name == 'configureStore') let idxx = this.externalFormList[idx].editFormData.findIndex(item => item.name == 'bannerToSubMerchant')
let idxxx = this.externalFormList.findIndex(item => item.title == '公告管理')
let idxxxx = this.externalFormList[idxxx].editFormData.findIndex(item => item.name == 'noticeToSubMerchant')
this.externalFormList[idx].editFormData[idxx].isHide = true this.externalFormList[idx].editFormData[idxx].isHide = true
this.externalFormList[idxxx].editFormData[idxxxx].isHide = true
} }
let href = window.location.host let href = window.location.host
this.showGh = href.indexOf('cgacar') != -1 this.showGh = href.indexOf('cgacar') != -1
...@@ -483,6 +547,10 @@ export default { ...@@ -483,6 +547,10 @@ export default {
this.editForm.clueList = res.clueList.map(k => k.clueId) this.editForm.clueList = res.clueList.map(k => k.clueId)
this.editForm.preferentialPolicy = res.preferentialPolicy this.editForm.preferentialPolicy = res.preferentialPolicy
this.editForm.customerServerUserId = '' this.editForm.customerServerUserId = ''
this.editForm.customerServerType = +res.customerServerType
this.editForm.customerServerUrl = res.customerServerUrl
this.editForm.bannerToSubMerchant = res.bannerToSubMerchant || 'N'
this.editForm.noticeToSubMerchant = res.noticeToSubMerchant || 'N'
// 在线客服 // 在线客服
this.customerServerList = [] this.customerServerList = []
if (res.customerServerUserId) { if (res.customerServerUserId) {
...@@ -521,21 +589,43 @@ export default { ...@@ -521,21 +589,43 @@ export default {
this.editForm.bannerList.push(params) this.editForm.bannerList.push(params)
}) })
} }
// banner管理配置门店
this.editForm.bannerMerchantList = res.bannerMerchantList
this.editForm.bannerMerchantList.forEach(item => {
item.merchantNo = item.merchantId
})
// 公告管理配置门店
this.editForm.noticeMerchantList = res.noticeMerchantList
this.editForm.noticeMerchantList.forEach(item => {
item.merchantNo = item.merchantId
})
}) })
}, },
// 选择门店 // 选择门店
handleRelateStoreClose() { handleRelateStoreClose() {
this.selectedList = this.$common.utils.deepClone(this.editForm.merchantList) this.selectedList = this.$common.utils.deepClone(this.editForm.bannerMerchantList)
this.relateStoreVisible = !this.relateStoreVisible this.relateStoreVisible = !this.relateStoreVisible
}, },
handleRelateStoreCloses() {
this.selectedLists = this.$common.utils.deepClone(this.editForm.noticeMerchantList)
this.relateStoreVisibles = !this.relateStoreVisibles
},
handleRelateStoreConfirm(selectedData) { handleRelateStoreConfirm(selectedData) {
this.editForm.merchantList = selectedData this.editForm.bannerMerchantList = selectedData
this.selectedList = selectedData this.selectedList = selectedData
this.handleRelateStoreClose() this.handleRelateStoreClose()
}, },
handleRelateStoreConfirms(selectedData) {
this.editForm.noticeMerchantList = selectedData
this.selectedLists = selectedData
this.handleRelateStoreCloses()
},
handleSearchStore() { handleSearchStore() {
this.$refs.relateStore.handleCurrentChange(1) this.$refs.relateStore.handleCurrentChange(1)
}, },
handleSearchStores() {
this.$refs.relateStores.handleCurrentChange(1)
},
handleMerchantDelete(obj) { handleMerchantDelete(obj) {
this.$messageBox.confirm('是否删除该门店?', '删除', { this.$messageBox.confirm('是否删除该门店?', '删除', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -543,8 +633,21 @@ export default { ...@@ -543,8 +633,21 @@ export default {
// type: 'error', // type: 'error',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
var idx = this.editForm.merchantList.findIndex(item => item.merchantNo == obj.scope.merchantNo) var idx = this.editForm.bannerMerchantList.findIndex(item => item.merchantNo == obj.scope.merchantNo)
this.editForm.merchantList.splice(idx, 1) this.editForm.bannerMerchantList.splice(idx, 1)
}
}
})
},
handleMerchantDeletes(obj) {
this.$messageBox.confirm('是否删除该门店?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
// type: 'error',
callback: action => {
if (action == 'confirm') {
var idx = this.editForm.noticeMerchantList.findIndex(item => item.merchantNo == obj.scope.merchantNo)
this.editForm.noticeMerchantList.splice(idx, 1)
} }
} }
}) })
...@@ -752,6 +855,28 @@ export default { ...@@ -752,6 +855,28 @@ export default {
params.bannerList[idx].bannerType = 0 params.bannerList[idx].bannerType = 0
} }
}) })
// banner管理配置门店
params.bannerMerchantList = []
if(this.editForm.bannerToSubMerchant == 'Y') {
this.editForm.bannerMerchantList.forEach(item => {
params.bannerMerchantList.push({
merchantId: item.merchantNo,
merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel
})
})
}
// 公告管理配置门店
params.noticeMerchantList = []
if(this.editForm.noticeToSubMerchant == 'Y') {
this.editForm.noticeMerchantList.forEach(item => {
params.noticeMerchantList.push({
merchantId: item.merchantNo,
merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel
})
})
}
// 金刚区管理 // 金刚区管理
params.clueList = this.editForm.clueList.length params.clueList = this.editForm.clueList.length
? this.editForm.clueList.map(k => { ? this.editForm.clueList.map(k => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!