Commit 0ede34d7 by 王志慧

七月份喜报1.4需求开发

1 parent d2afcda2
import { http } from '@/main'
const url1 = '/rop-scrm-entmicro/router'
const url = '/rop-scrm-shopmall/router'
//门店号选择服务
const getMerchantList = params => {
params.method = 'entmicro.api.merchant.listDepartmentTree.select.merchant'
return http({
url: url1,
method: 'post',
data: params,
sign: true
})
}
//分页查询线索喜报配置信息
const getClueReportList = params => {
params.method = `scrm.api.shopmall.clueReportConfig.page`
return http({
url,
method: 'post',
data: params,
sign: true
})
}
// 新增或修改喜报配置
const updateClueReportConfig = params => {
params.method = `scrm.api.shopmall.clueReportConfig.insertOrUpdate`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
export default { getMerchantList, getClueReportList, updateClueReportConfig }
......@@ -19,8 +19,8 @@ export const fetchConfig = function(isEnv = true) {
// return Promise.resolve(cfg)
// }
//return window.fetch('https://', {}).then(res => res.json())
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/6345096902322627d6b83e83/battles/config')
return new Http().get('https://oss-config.glsx.com.cn/mock/635fc7a254298ae78614407a/battles/config')
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/6345096902322627d6b83e83/battles/config')
// return new Http().get('https://oss-config.glsx.com.cn/mock/635fc7a254298ae78614407a/battles/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -6,17 +6,18 @@
<!-- <span class="weight-5 color6 font-14 ml12" v-if="merchantName">{{ merchantName }}</span> -->
</div>
<div class="config-wrap gl-form-page">
<el-form ref="form" :model="form" label-width="154px">
<el-form-item label="门店信息:">
<el-form ref="battleRef" :model="config" label-width="154px" :rules="rules">
<el-form-item label="门店信息:" prop="merchantId">
<el-button type="default" class="el-icon-plus" @click="handleRelateStoreClose">选择门店</el-button>
<div class="merchantNameLabel" v-if="config.merchantName">
<p>所属门店</p>
<div class="merchantName ellipsis-1">{{ config.merchantName }}</div>
</div>
<div class="el-form-item__error mrt5" v-if="merchantFlag">请选择门店</div>
<!-- <div class="el-form-item__error mrt5" v-if="merchantFlag">请选择所属门店</div> -->
</el-form-item>
<el-form-item label="所属企业:">
<el-select v-model="config.merchantId" placeholder="请选择" @change="handleMerchatChange">
<!-- 所属企业-->
<el-form-item label="所属企业:" prop="groupMerchantId">
<el-select v-model="config.groupMerchantId" placeholder="请选择" @change="handleMerchatChange">
<el-option v-for="item in merchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId"></el-option>
</el-select>
</el-form-item>
......@@ -25,8 +26,8 @@
<div class="common el-form-item__content">
<div class="el-input" ref="automaticRef">
<div class="el-input__inner" @click="openAutomatic">
<span v-if="wechat.automaticName == ''" class="placeholder">选择成员</span>
{{ wechat.automaticName }}
<span v-if="config.automaticName == ''" class="placeholder">选择成员</span>
{{ config.automaticName }}
</div>
<span class="el-input__suffix" @click="openAutomatic">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', isAutomatic ? 'is-reverse' : '']"></i></span>
......@@ -70,7 +71,7 @@
<el-button @click="handlebattleClose" size="medium">取消</el-button>
<el-button type="primary" @click="handlebattleConfirm" size="medium" :loading="loading">保存</el-button>
</GLFooter>
<component :is="dialogComponent" ref="componentRef" v-if="isDialogVisible" :isDialogVisible="isDialogVisible" :switchList="switchList" @handlePreview="handlePreview" @handleClose="handleClose"></component>
<component :is="dialogComponent" ref="componentRef" v-if="isDialogVisible" :isDialogVisible="isDialogVisible" :content="config.content" @handlePreview="handlePreview" @handleClose="handleClose"></component>
<select-store v-if="relateStoreVisible" ref="relateStore" :dialogVisible="relateStoreVisible" :storeSelected="selectedList" :merchantInfo="config.merchantId" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"></select-store>
</div>
</template>
......@@ -89,7 +90,6 @@ export default {
selectGroupName: [],
isDialogVisible: false,
relateStoreVisible: false, // 选择门店
merchantFlag: false,
paramsData: this.$route.query,
dialogComponent: '',
merchantList: [],
......@@ -101,23 +101,27 @@ export default {
},
config: {
merchantId: '',
merchantName: '流程测试4s店'
merchantName: '',
staffId: '',
automaticName: '',
groupMerchantId: ''
},
isAutomatic: true,
filterText: '',
wechat: {
staffId: '',
automaticName: ''
// roomName: ''
},
groupCofList: {
clewWordReport: []
},
switchList: {
clewWordReport: [{ switchType: 701, switchStatus: 'Y', actionReportType: 7, switchText: '' }]
rules: {
merchantId: [{ required: true, message: '请选择门店信息', trigger: 'change' }],
groupMerchantId: [{ required: true, message: '请选择所属企业', trigger: 'change' }],
staffId: [{ required: true, message: '请选择推送人', trigger: 'change' }]
},
groupCofListInput: {
clewWordReportValue: [],
clewWordReportValue: [
{
name: ''
}
]
},
groupToType: [
{
......@@ -137,9 +141,6 @@ export default {
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
roomName(val) {
this.filterRoomName(val)
}
},
computed: {
......@@ -148,10 +149,10 @@ export default {
}
},
mounted() {
let { data, sign } = this.paramsData
this.merchantName = data.merchantName + data.merchantId
this.getMerchantList(sign)
this.handlebattleOn(data, sign)
let { data } = this.paramsData
this.getMerchantList(data)
this.getDepartmentTree()
if (data) this.handlebattleOn(data)
},
methods: {
// 选择门店
......@@ -159,14 +160,14 @@ export default {
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreConfirm(selectedData) {
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate('merchantId')
selectedData.merchantId && (this.config.merchantId = selectedData.merchantId)
selectedData.merchantName && ((this.config.merchantName = selectedData.merchantName), (this.merchantFlag = false))
selectedData.merchantName && (this.config.merchantName = selectedData.merchantName)
this.$refs.battleRef.clearValidate('merchantId')
this.handleRelateStoreClose()
},
handlePreview(params) {
let { key, data } = params
this.switchList[key] = data
let { data } = params
this.config.content = data
this.isDialogVisible = false
},
handleClose() {
......@@ -193,8 +194,9 @@ export default {
this.$apis.battle.getMerchantList({}).then(res => {
this.merchantList = res
if (!sign) {
this.config.merchantId = res[0]?.merchantId
this.config.merchantName = res[0]?.merchantName
this.config.groupMerchantId = res[0]?.merchantId
this.config.groupMerchantName = res[0]?.merchantName
console.log(this.config)
}
})
},
......@@ -204,33 +206,18 @@ export default {
},
handleNodeClick(data) {
this.hideSelect()
this.wechat.automaticName = data.name
this.wechat.staffId = data.staffId
this.config.automaticName = data.name
this.config.staffId = data.staffId
this.idBefEncryption = data.idBefEncryption
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
this.$refs.battleRef.clearValidate('staffId')
this.$apis.battle.activityreportWorktool({ cloudId: 1688855154413617 }).then(res => {
this.selectGroupName = res.data.result || []
this.groupCofListInput = { clewWordReportValue: [{ name: '' }] }
})
},
// 弹窗数据回显
initswitchList(switchList) {
switchList.forEach(item => {
this.groupToType.find(v => {
if (v.type == item.actionReportType) {
this.switchList[v.attr].push({
actionReportType: item.actionReportType,
switchStatus: item.switchStatus,
switchText: item.switchText,
switchType: item.switchType
})
}
})
})
},
//编辑回显
handlebattleOn(data, sign) {
this.setectList = []
this.setectList.push(data)
this.wechat = {
this.config = {
staffId: '',
automaticName: ''
}
......@@ -241,11 +228,13 @@ export default {
this.battleVisible = true
// 编辑
if (sign) {
this.wechat.staffId = data.staffId
this.wechat.automaticName = data.staffName
this.config.merchantId = data.enterpriseMerchantId
this.config.merchantName = data.enterpriseMerchantName
this.initswitchList(data.switchList)
this.config.staffId = data.staffId
this.config.automaticName = data.staffName
this.config.merchantId = data.merchantId
this.config.merchantName = data.merchantName
this.config.groupMerchantId = data.groupMerchantId
this.config.groupMerchantName = data.groupMerchantName
this.config.content = data.content
data.groupConfigList.forEach(item => {
let groupHideAttr = this.groupToType.find(k => k.type == item.actionReportType)?.attr
if (!groupHideAttr) return
......@@ -273,7 +262,6 @@ export default {
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
this.selectGroupName = res.data.result || []
})
this.getGroupList(this.wechat.staffId)
} else {
this.groupCofListInput = {
clewWordReportValue: [{ name: '' }]
......@@ -281,44 +269,18 @@ export default {
}
this.getDepartmentTree()
},
getGroupList(id, isReset = false) {
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => {
if (res.code == 0) {
this.groupList = res.data
if (isReset) {
this.groupCofList = {
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: [],
clewWordReport: []
}
}
}
})
},
//所属企业
handleMerchatChange(val) {
console.log(val)
this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.config.merchantName = item.merchantName) : ''
item.merchantId == val ? (this.config.groupMerchantName = item.merchantName) : ''
})
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: [],
clewWordReport: []
}
this.config.staffId = ''
this.config.automaticName = ''
},
async getDepartmentTree() {
let params = { addChildrensFlag: true, queryMerchantId: this.config.merchantId, loginStatus: 1 }
let params = { addChildrensFlag: true, queryMerchantId: this.config.groupMerchantId, loginStatus: 1 }
let data = await this.$apis.saasOrder.getlistDepartmentTree(params)
this.ids = []
this.automaticData = data
......@@ -368,98 +330,70 @@ export default {
})
},
clearData() {
this.setectList = []
this.$refs.battleRef.clearMutiSelect()
this.config.merchantId = this.merchantList[0]?.merchantId
this.wechat = {
// this.$refs.battleRef.clearMutiSelect()
//所属企业默认选择第一个
this.config.groupMerchantId = this.merchantList[0]?.merchantId
this.config = {
staffId: '',
automaticName: ''
}
this.hideSelect()
},
handlebattleConfirm() {
if (!this.editForm.merchantName) {
this.merchantFlag = true
return
}
if (!this.wechat.staffId) {
this.$message({
message: '请选择推送人',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
let isGroupEmpty = Object.keys(this.groupCofList)
.map(item => this.groupCofList[item].length)
.every(item => item == 0)
let isGroupEmptyInput = Object.keys(this.groupCofListInput)
.map(item => this.groupCofListInput[item].length)
.every(item => item == 0)
if (isGroupEmpty && isGroupEmptyInput) {
this.$message({
message: '推送配置必须配置至少一项',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
var params = {
enterpriseMerchantId: this.config.merchantId,
enterpriseMerchantName: this.config.merchantName,
staffId: this.wechat.staffId,
staffName: this.wechat.automaticName,
groupMerchantId: this.config.merchantId,
updatedBy: this.$globalState.session.accountName,
yqMerchantIdList: [],
groupConfigList: [],
merchantId: this.setectList[0]?.merchantId,
scene: 1
}
let switchList = []
let reportParams = ['saReport', 'zhanReport', 'orderReport', 'saPerReport', 'scheduleReport', 'clewWordReport']
reportParams.forEach(item => {
switchList.push(...this.switchList[item])
})
switchList.map(item => (item.switchStatus = item.switchStatus ? 'Y' : 'N'))
params.switchList = switchList
this.setectList.forEach(item => {
params.yqMerchantIdList.push(item.yqMerchantId)
})
Object.keys(this.groupCofList).map(item => {
let type = this.groupToType.find(k => k.attr == item).type
if (this.groupCofList[item].length) {
this.groupCofList[item].forEach(k => {
params.groupConfigList.push({
groupId: k.groupId,
groupName: k.roomName,
groupMerchantId: this.config.merchantId,
actionReportType: type
this.$refs.battleRef.validate(valid => {
if (valid) {
let isGroupEmpty = Object.keys(this.groupCofList)
.map(item => this.groupCofList[item].length)
.every(item => item == 0)
let isGroupEmptyInput = Object.keys(this.groupCofListInput)
.map(item => this.groupCofListInput[item].length)
.every(item => item == 0)
if (isGroupEmpty && isGroupEmptyInput) {
this.$message({
message: '推送配置必须配置至少一项',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
var params = {
merchantId: this.config.merchantId,
merchantName: this.config.merchantName,
staffId: this.config.staffId,
staffName: this.config.automaticName,
groupConfigList: [],
content: this.config.content
}
Object.keys(this.groupCofList).map(item => {
if (this.groupCofList[item].length) {
this.groupCofList[item].forEach(k => {
params.groupConfigList.push({
groupId: k.groupId,
groupName: k.roomName,
groupMerchantId: this.config.groupMerchantId
})
})
} else if (this.groupCofListInput[item + 'Value'].length) {
this.groupCofListInput[item + 'Value'].forEach(k => {
params.groupConfigList.push({
groupId: this.idBefEncryption + '_R:' + k.name,
groupName: k.name,
groupMerchantId: this.config.groupMerchantId
})
})
}
})
} else if (this.groupCofListInput[item + 'Value'].length) {
this.groupCofListInput[item + 'Value'].forEach(k => {
params.groupConfigList.push({
groupId: this.idBefEncryption + '_R:' + k.name,
groupName: k.name,
groupMerchantId: this.config.merchantId,
actionReportType: type
this.$apis.clewOrder.updateClueReportConfig(params).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.$router.go(-1)
}
})
}
})
console.log(params, 'params---')
this.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.$router.go(-1)
}
})
},
handlebattleClose() {
this.$router.go(-1)
......
......@@ -3,23 +3,18 @@
<div class="activity">
<!-- 表格区域 开始 -->
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex-between title">
<div class="title-text">专员列表</div>
<!-- <el-button :size="size"
type="primary"
class="battle-set-btn"
@click="battleSetHandle">批量配置专员</el-button> -->
<div class="title-text">喜报列表</div>
<el-button :size="size" type="primary" class="battle-set-btn" @click="handlebattleOn()">新增</el-button>
</div>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="battleRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" @selectionTable="selectionTable">
<div slot="activityTime" slot-scope="scope">{{ dateFormatFun(scope.scope.startTime) }}-{{ dateFormatFun(scope.scope.endTime) }}</div>
<div slot="content" slot-scope="scope">
<div v-for="(item, index) in formatterContent(scope.scope)" :key="index">{{ item }}</div>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" v-if="!scope.scope.staffId" @click="handlebattleOn(scope.scope)">配置</el-button>
<el-button type="text" v-else @click="handlebattleOn(scope.scope, 'edit')">编辑</el-button>
<el-button type="text" @click="handlebattleOn(scope.scope, 'edit')">编辑</el-button>
</div>
</GLTable>
</div>
......@@ -459,35 +454,38 @@ export default {
// }],
// 搜索
searchForm: {
yqMerchantId: '',
yqMerchantName: '',
enterpriseMerchantId: '',
scene: 1
merchantId: '',
merchantName: '',
groupMerchantName: ''
},
searchFormData: [
{
label: '园区店',
name: 'yqMerchantName',
label: '4S店',
name: 'merchantName',
type: 'input',
maxlength: 128
},
{
label: '商户号',
name: 'unionMerchantId',
name: 'merchantId',
type: 'input',
maxlength: 11
},
{
label: '4S店',
name: 'merchantName',
type: 'input',
maxlength: 128
label: '企微名称',
name: 'groupMerchantName',
type: 'select',
width: '215px',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'merchantList'
}
],
// 表格
// userList: [],
selectArray: [],
getListApi: this.$apis.saasOrder.getYqReportlist,
getListApi: this.$apis.clewOrder.getClueReportList,
tableParams: {
listName: 'list',
tableOption: true,
......@@ -649,10 +647,9 @@ export default {
},
handleReset() {
this.searchForm = {
yqMerchantId: '',
yqMerchantName: '',
enterpriseMerchantId: '',
scene: 1
merchantId: '',
merchantName: '',
groupMerchantName: ''
}
this.handleSearch()
},
......@@ -793,99 +790,10 @@ export default {
handlestaffbattleClose() {
this.battlestaffVisible = false
},
handlebattleConfirm() {
if (!this.wechat.staffId) {
this.$message({
message: '请选择推送人',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
let isGroupEmpty = Object.keys(this.groupCofList)
.map(item => this.groupCofList[item].length)
.every(item => item == 0)
let isGroupEmptyInput = Object.keys(this.groupCofListInput)
.map(item => this.groupCofListInput[item].length)
.every(item => item == 0)
if (isGroupEmpty && isGroupEmptyInput) {
this.$message({
message: '推送配置必须配置至少一项',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
var params = {
enterpriseMerchantId: this.config.merchantId,
enterpriseMerchantName: this.config.merchantName,
staffId: this.wechat.staffId,
staffName: this.wechat.automaticName,
// groupId: this.wechat.groupId,
// groupName: this.wechat.roomName,
groupMerchantId: this.config.merchantId,
updatedBy: this.$globalState.session.accountName,
yqMerchantIdList: [],
groupConfigList: [],
merchantId: this.setectList[0]?.merchantId,
scene: 1
}
this.setectList.forEach(item => {
params.yqMerchantIdList.push(item.yqMerchantId)
})
Object.keys(this.groupCofList).map(item => {
// console.log(this.groupCofList[item])
let type = this.groupToType.find(k => k.attr == item).type
if (this.groupCofList[item].length) {
this.groupCofList[item].forEach(k => {
params.groupConfigList.push({
groupId: k.groupId,
groupName: k.roomName,
groupMerchantId: this.config.merchantId,
actionReportType: type
})
})
} else if (this.groupCofListInput[item + 'Value'].length) {
this.groupCofListInput[item + 'Value'].forEach(k => {
params.groupConfigList.push({
groupId: this.idBefEncryption + '_R:' + k.name,
groupName: k.name,
groupMerchantId: this.config.merchantId,
actionReportType: type
})
})
}
})
console.log(params, 'params---')
this.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.battleVisible = false
this.handleSearch()
this.clearData()
}
})
},
handlebattleClose() {
this.battleVisible = false
this.clearData()
},
handleDetails() {},
addGroup(group) {
group.push({ name: '' })
},
delGroup(group, i) {
group.splice(i, 1)
},
handlebattleOn(data, sign) {
let params = {
data: data,
sign: sign ? sign : ''
data: data
}
this.$router.push({
path: '/bulletin/addClewConfig',
......@@ -957,23 +865,6 @@ export default {
// }
// this.getDepartmentTree()
},
getGroupList(id, isReset = false) {
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => {
if (res.code == 0) {
this.groupList = res.data
if (isReset) {
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: []
}
}
}
})
},
handleSetting() {
this.drawer = true
},
......
......@@ -34,16 +34,17 @@
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
props: {
content: {
type: String,
default: ''
},
isDialogVisible: Boolean
},
data() {
return {
mode: 'big',
wordType: {
switchType: 701,
switchText: ''
},
btnList: [
{
type: 1,
......@@ -70,39 +71,31 @@ export default {
name: '浏览时长'
}
],
params: ['wordType'],
mapList: {
销售顾问: '${employeeName}',
客户姓名: '${customerName}',
车型: '${carType}',
订单总金额: '${totalPrice}',
阳光激励费: '${sunshineInspiration}',
商品名称: '${goodsNames}'
手机号: '${employeeName}',
线索来源: '${source}',
具体线索: '${clue}',
浏览时长: '${browseTime}'
}
}
},
methods: {
initData() {
this.switchList.wordReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = this.$common.utils.deepClone(i)
}
})
})
watch: {
content(val) {
this.$nextTick(() => {
this.$refs.verbalRef && this.$refs.verbalRef.update(this.wordType.switchText)
this.$refs.verbalRef && this.$refs.verbalRef.update(val)
})
},
}
},
methods: {
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
if (data == 'wordType') this[data].switchText = this.$refs.verbalRef.getTextValue()
switchList.push(this[data])
})
this.$emit('handlePreview', { key: 'wordReport', data: switchList })
let content = this.$refs.verbalRef.getTextValue()
this.$emit('handlePreview', { data: content })
},
handlebattleClose() {
this.$emit('handleClose')
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!