Commit 52257343 by 王志慧

喜报配置

1 parent 0ede34d7
...@@ -35,6 +35,15 @@ const updateClueReportConfig = params => { ...@@ -35,6 +35,15 @@ const updateClueReportConfig = params => {
returnAll: true returnAll: true
}) })
} }
// 根据ID获取线索喜报配置信息
const getClueDetailById = params => {
export default { getMerchantList, getClueReportList, updateClueReportConfig } params.method = `scrm.api.shopmall.clueReportConfig.getById`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
export default { getMerchantList, getClueReportList, updateClueReportConfig,getClueDetailById }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="config-wrap gl-form-page"> <div class="config-wrap gl-form-page">
<el-form ref="battleRef" :model="config" label-width="154px" :rules="rules"> <el-form ref="battleRef" :model="config" label-width="154px" :rules="rules">
<el-form-item label="门店信息:" prop="merchantId"> <el-form-item label="门店信息:" prop="merchantId">
<el-button type="default" class="el-icon-plus" @click="handleRelateStoreClose">选择门店</el-button> <el-button type="default" class="el-icon-plus" @click="handleRelateStoreClose" :disabled="id!=''">选择门店</el-button>
<div class="merchantNameLabel" v-if="config.merchantName"> <div class="merchantNameLabel" v-if="config.merchantName">
<p>所属门店</p> <p>所属门店</p>
<div class="merchantName ellipsis-1">{{ config.merchantName }}</div> <div class="merchantName ellipsis-1">{{ config.merchantName }}</div>
...@@ -87,10 +87,10 @@ export default { ...@@ -87,10 +87,10 @@ export default {
}, },
data() { data() {
return { return {
id: this.$route.query.id ? this.$route.query.id : '',
selectGroupName: [], selectGroupName: [],
isDialogVisible: false, isDialogVisible: false,
relateStoreVisible: false, // 选择门店 relateStoreVisible: false, // 选择门店
paramsData: this.$route.query,
dialogComponent: '', dialogComponent: '',
merchantList: [], merchantList: [],
automaticData: [], automaticData: [],
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
}, },
rules: { rules: {
merchantId: [{ required: true, message: '请选择门店信息', trigger: 'change' }], merchantId: [{ required: true, message: '请选择门店信息', trigger: 'change' }],
groupMerchantId: [{ required: true, message: '请选择所属企业', trigger: 'change' }], groupMerchantId: { required: true, message: '请选择所属企业', trigger: ['blur', 'change'], type: 'number' },
staffId: [{ required: true, message: '请选择推送人', trigger: 'change' }] staffId: [{ required: true, message: '请选择推送人', trigger: 'change' }]
}, },
groupCofListInput: { groupCofListInput: {
...@@ -149,10 +149,9 @@ export default { ...@@ -149,10 +149,9 @@ export default {
} }
}, },
mounted() { mounted() {
let { data } = this.paramsData this.getMerchantList()
this.getMerchantList(data)
this.getDepartmentTree() this.getDepartmentTree()
if (data) this.handlebattleOn(data) if (this.id) this.getClueDetailById()
}, },
methods: { methods: {
// 选择门店 // 选择门店
...@@ -193,10 +192,9 @@ export default { ...@@ -193,10 +192,9 @@ export default {
getMerchantList(sign) { getMerchantList(sign) {
this.$apis.battle.getMerchantList({}).then(res => { this.$apis.battle.getMerchantList({}).then(res => {
this.merchantList = res this.merchantList = res
if (!sign) { if (!this.id) {
this.config.groupMerchantId = res[0]?.merchantId this.config.groupMerchantId = res[0]?.merchantId
this.config.groupMerchantName = res[0]?.merchantName this.config.groupMerchantName = res[0]?.merchantName
console.log(this.config)
} }
}) })
}, },
...@@ -208,26 +206,22 @@ export default { ...@@ -208,26 +206,22 @@ export default {
this.hideSelect() this.hideSelect()
this.config.automaticName = data.name this.config.automaticName = data.name
this.config.staffId = data.staffId this.config.staffId = data.staffId
this.idBefEncryption = data.idBefEncryption this.idBefEncryption = data.idBefEncryption?data.idBefEncryption:'1688855154413617'
this.$refs.battleRef.clearValidate('staffId') this.$refs.battleRef.clearValidate('staffId')
this.$apis.battle.activityreportWorktool({ cloudId: 1688855154413617 }).then(res => { this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
this.selectGroupName = res.data.result || [] this.selectGroupName = res.data.result || []
this.groupCofListInput = { clewWordReportValue: [{ name: '' }] } this.groupCofListInput = { clewWordReportValue: [{ name: '' }] }
}) })
}, },
//编辑回显 //编辑回显
handlebattleOn(data, sign) { getClueDetailById() {
this.config = {
staffId: '',
automaticName: ''
}
this.groupCofListInput = { this.groupCofListInput = {
// xiReportValue: [], // xiReportValue: [],
clewWordReportValue: [] clewWordReportValue: []
} }
this.battleVisible = true this.$apis.clewOrder.getClueDetailById({ id: this.id }).then(res => {
// 编辑 let data = res.data
if (sign) { // 编辑
this.config.staffId = data.staffId this.config.staffId = data.staffId
this.config.automaticName = data.staffName this.config.automaticName = data.staffName
this.config.merchantId = data.merchantId this.config.merchantId = data.merchantId
...@@ -236,7 +230,8 @@ export default { ...@@ -236,7 +230,8 @@ export default {
this.config.groupMerchantName = data.groupMerchantName this.config.groupMerchantName = data.groupMerchantName
this.config.content = data.content this.config.content = data.content
data.groupConfigList.forEach(item => { data.groupConfigList.forEach(item => {
let groupHideAttr = this.groupToType.find(k => k.type == item.actionReportType)?.attr // let groupHideAttr = this.groupToType.find(k => k.type == item.actionReportType)?.attr
let groupHideAttr = 'clewWordReport'
if (!groupHideAttr) return if (!groupHideAttr) return
if (item.groupId) { if (item.groupId) {
if (item.groupId.split('_R:')[1] && item.groupId.split('_R:')[1] == item.groupName) { if (item.groupId.split('_R:')[1] && item.groupId.split('_R:')[1] == item.groupName) {
...@@ -262,16 +257,12 @@ export default { ...@@ -262,16 +257,12 @@ export default {
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => { this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
this.selectGroupName = res.data.result || [] this.selectGroupName = res.data.result || []
}) })
} else {
this.groupCofListInput = { this.getDepartmentTree()
clewWordReportValue: [{ name: '' }] })
}
}
this.getDepartmentTree()
}, },
//所属企业 //所属企业
handleMerchatChange(val) { handleMerchatChange(val) {
console.log(val)
this.getDepartmentTree() this.getDepartmentTree()
this.merchantList.forEach(item => { this.merchantList.forEach(item => {
item.merchantId == val ? (this.config.groupMerchantName = item.merchantName) : '' item.merchantId == val ? (this.config.groupMerchantName = item.merchantName) : ''
...@@ -364,13 +355,15 @@ export default { ...@@ -364,13 +355,15 @@ export default {
groupConfigList: [], groupConfigList: [],
content: this.config.content content: this.config.content
} }
if(this.id) params.id =this.id
Object.keys(this.groupCofList).map(item => { Object.keys(this.groupCofList).map(item => {
if (this.groupCofList[item].length) { if (this.groupCofList[item].length) {
this.groupCofList[item].forEach(k => { this.groupCofList[item].forEach(k => {
params.groupConfigList.push({ params.groupConfigList.push({
groupId: k.groupId, groupId: k.groupId,
groupName: k.roomName, groupName: k.roomName,
groupMerchantId: this.config.groupMerchantId groupMerchantId: this.config.groupMerchantId,
groupMerchantName: this.config.groupMerchantName
}) })
}) })
} else if (this.groupCofListInput[item + 'Value'].length) { } else if (this.groupCofListInput[item + 'Value'].length) {
...@@ -378,7 +371,8 @@ export default { ...@@ -378,7 +371,8 @@ export default {
params.groupConfigList.push({ params.groupConfigList.push({
groupId: this.idBefEncryption + '_R:' + k.name, groupId: this.idBefEncryption + '_R:' + k.name,
groupName: k.name, groupName: k.name,
groupMerchantId: this.config.groupMerchantId groupMerchantId: this.config.groupMerchantId,
groupMerchantName: this.config.groupMerchantName
}) })
}) })
} }
......
...@@ -80,12 +80,10 @@ export default { ...@@ -80,12 +80,10 @@ export default {
} }
} }
}, },
watch: { created() {
content(val) { this.$nextTick(() => {
this.$nextTick(() => { this.$refs.verbalRef && this.$refs.verbalRef.update(this.content)
this.$refs.verbalRef && this.$refs.verbalRef.update(val)
}) })
}
}, },
methods: { methods: {
handlebattleConfirm() { handlebattleConfirm() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!