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