Commit f6c575b2 by chenwq Committed by 杨北旺

编辑sop

1 parent 1e81ea35
...@@ -44,4 +44,14 @@ const insertOrUpdateSopApi = params => { ...@@ -44,4 +44,14 @@ const insertOrUpdateSopApi = params => {
}) })
} }
export default { getCustomerByTagListApi, getSopInfoListApi, parseEventCountApi, insertOrUpdateSopApi } const getSopInfoDetailApi = params => {
params.method = 'scrm.api.sop.sopInfo.getDetailBySopId'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getCustomerByTagListApi, getSopInfoListApi, parseEventCountApi, insertOrUpdateSopApi, getSopInfoDetailApi }
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
editEvent editEvent
}, },
mounted() { created() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
}, },
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<div class="container m-b-20"> <div class="container m-b-20">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="customerList"> <div slot="customerInfoList">
<el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button> <el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button>
<el-button :size="size" @click="handleResetCustomer">重置客户</el-button> <el-button :size="size" @click="handleResetCustomer">重置客户</el-button>
<div v-show="editForm.customerList.length != 0" class="customer-box m-t-10"> <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10">
<div class="customer-title">{{ condLimitObj.hasQw ? '已加' : '没加' }}企微/{{ condLimitObj.hasPhone ? '有' : '没有' }}手机号:{{ editForm.customerList.length }}人</div> <div class="customer-title">{{ condLimitObj.hasQw ? '已加' : '没加' }}企微/{{ condLimitObj.hasPhone ? '有' : '没有' }}手机号:{{ editForm.customerInfoList.length }}人</div>
<div :key="key" class="el-input-tag input-tag-wrapper"> <div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag v-for="(item, idx) in editForm.customerList" :key="idx" :size="size" type="info" closable :disable-transitions="false" @close="handleDeleteCustomer(idx)"> <el-tag v-for="(item, idx) in editForm.customerInfoList" :key="idx" :size="size" type="info" closable :disable-transitions="false" @close="handleDeleteCustomer(idx)">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ item.customerName }} {{ item.customerName }}
</el-tag> </el-tag>
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
<div class="container edit-container"> <div class="container edit-container">
<div class="edit-title flex" style="align-items: center;"> <div class="edit-title flex" style="align-items: center;">
<p>营销事件设置</p> <p>营销事件设置</p>
<el-tooltip :disabled="!(!editForm.customerList.length || !editForm.sopName)" effect="dark" content="请先完善sop名称和营销对象" placement="top"> <el-tooltip :disabled="!(!editForm.customerInfoList.length || !editForm.sopName)" effect="dark" content="请先完善sop名称和营销对象" placement="top">
<div> <div>
<el-button class="m-r-20" :disabled="!editForm.customerList.length || !editForm.sopName" :size="size" type="primary" @click="handleEventEdit('add')">添加事件</el-button> <el-button class="m-r-20" :disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size" type="primary" @click="handleEventEdit('add')">添加事件</el-button>
</div> </div>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</template> </template>
<script> <script>
import url from "@/assets/empty.png" import url from '@/assets/empty.png'
import SelectLabel from './components/selectLabel.vue' import SelectLabel from './components/selectLabel.vue'
export default { export default {
name: 'baseInfo', name: 'baseInfo',
...@@ -90,14 +90,14 @@ export default { ...@@ -90,14 +90,14 @@ export default {
sopName: '', sopName: '',
sopTime: '2022-01-01', sopTime: '2022-01-01',
// tagging: [], // tagging: [],
customerList: [], customerInfoList: [],
customerIds: [], customerIds: [],
eventList: [] eventList: []
}, },
editRule: { editRule: {
sopName: [{ required: true, message: '请输入sop名称', trigger: 'change' }], sopName: [{ required: true, message: '请输入sop名称', trigger: 'change' }],
sopTime: [{ required: true, message: '请选择营销时间', trigger: 'change' }], sopTime: [{ required: true, message: '请选择营销时间', trigger: 'change' }],
customerList: [{ required: true, message: '请选择营销对象', trigger: 'change' }], customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }],
}, },
isEdit: true, isEdit: true,
editFormData: [ editFormData: [
...@@ -114,8 +114,8 @@ export default { ...@@ -114,8 +114,8 @@ export default {
}, },
{ {
label: '营销对象', label: '营销对象',
name: 'customerList', name: 'customerInfoList',
addHtml: 'customerList' addHtml: 'customerInfoList'
} }
], ],
baseData: { baseData: {
...@@ -166,24 +166,27 @@ export default { ...@@ -166,24 +166,27 @@ export default {
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
// console.log(this.routeInfo.addOrEdit) console.log(this.routeInfo)
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : '' this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
}, },
methods: { methods: {
getInfo() { getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => { this.$apis.sop.getSopInfoDetailApi({ sopId: this.routeInfo.id }).then(res => {
// this.editForm.sopName = res.sopName // this.editForm.sopName = res.sopName
// this.$nextTick(() => { console.log(res)
// this.editStatus = false this.editForm = res
// }) this.editForm.customerInfoList = this.editForm.customerInfoList || []
// }) this.$nextTick(() => {
this.editStatus = false
})
})
}, },
// 选择标签 // 选择标签
handleSelect(obj) { handleSelect(obj) {
this.tagging = obj.selectedLabelList this.tagging = obj.selectedLabelList
this.editForm.customerList = obj.selectedCustomerList this.editForm.customerInfoList = obj.selectedCustomerList
this.condLimitObj = obj.condLimitObj this.condLimitObj = obj.condLimitObj
let arr = [] let arr = []
this.tagging.forEach(item => { this.tagging.forEach(item => {
...@@ -202,24 +205,24 @@ export default { ...@@ -202,24 +205,24 @@ export default {
// this.taggingList = obj // this.taggingList = obj
console.log(obj, '1') console.log(obj, '1')
this.key = new Date() this.key = new Date()
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerList') this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
// console.log(this.tagging, '2') // console.log(this.tagging, '2')
}, },
handleSelectCustomer() { handleSelectCustomer() {
this.isTagVisible = !this.isTagVisible this.isTagVisible = !this.isTagVisible
this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: this.tagging, customerList: this.editForm.customerList }) this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: this.tagging, customerInfoList: this.editForm.customerInfoList })
// console.log(this.isTagVisible) // console.log(this.isTagVisible)
}, },
handleResetCustomer() { handleResetCustomer() {
this.editForm.customerList = [] this.editForm.customerInfoList = []
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerList') this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
}, },
handleDeleteCustomer(idx) { handleDeleteCustomer(idx) {
this.editForm.customerList.splice(idx, 1) this.editForm.customerInfoList.splice(idx, 1)
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerList') this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
}, },
handleEventDelete(idx) { handleEventDelete(idx) {
...@@ -245,11 +248,13 @@ export default { ...@@ -245,11 +248,13 @@ export default {
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)
params.customerIds = this.editForm.customerInfoList.map(item => item.id)
delete params.customerInfoList
if (this.routeInfo.addOrEdit == 'edit') { if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id params.id = this.routeInfo.id
} }
// console.log(params) console.log(params)
this.$apis.zoneList.insertZoneApi(params).then(res => { this.$apis.sop.insertOrUpdateSopApi(params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
......
...@@ -43,8 +43,8 @@ export default { ...@@ -43,8 +43,8 @@ export default {
tableParams: { tableParams: {
listName: 'data', listName: 'data',
// 行数据的key // 行数据的key
mutiSelectUniqueKey: 'oneId', mutiSelectUniqueKey: 'id',
checkSelectKey: 'oneId', checkSelectKey: 'id',
checkSelectVal: [], checkSelectVal: [],
// 多选ref的名称 // 多选ref的名称
mutiSelectName: 'list', mutiSelectName: 'list',
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
recoverySelected() { recoverySelected() {
this.selectedCustomerList.forEach(row => { this.selectedCustomerList.forEach(row => {
var idx = this.tableList.findIndex(k => k.oneId == row.oneId) var idx = this.tableList.findIndex(k => k.id == row.id)
if (idx != -1) { if (idx != -1) {
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true) this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true)
} }
...@@ -194,7 +194,7 @@ export default { ...@@ -194,7 +194,7 @@ export default {
if (this.selectedCustomerList.length) { if (this.selectedCustomerList.length) {
this.tableList.forEach((row, idx) => { this.tableList.forEach((row, idx) => {
if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) { if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) {
this.tableParams.checkSelectVal.push(row.oneId) this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false) this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
} }
}) })
......
...@@ -121,7 +121,7 @@ export default { ...@@ -121,7 +121,7 @@ export default {
this.labelGroupName = '' this.labelGroupName = ''
this.dialogVisible = true this.dialogVisible = true
this.activeName = 'tag' this.activeName = 'tag'
this.selectedCustomerList = JSON.parse(JSON.stringify(item.customerList)) this.selectedCustomerList = item.customerInfoList ? JSON.parse(JSON.stringify(item.customerInfoList)) : ''
this.condLimitObj = JSON.parse(JSON.stringify(item.condLimitObj)) this.condLimitObj = JSON.parse(JSON.stringify(item.condLimitObj))
this.querylabeltree(item.tagList) this.querylabeltree(item.tagList)
}, },
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</div> </div>
</div> </div>
<div class="sop-box" :style="{ 'padding-bottom': sopList.length ? '2px' : '12px' }"> <div class="sop-box" :style="{ 'padding-bottom': sopList.length ? '2px' : '12px' }">
<div class="chart-box sop-flex"> <div class="chart-box sop-flex" v-show="sopList.length">
<div class="chart-item" v-for="item in sopList" :key="item.id"> <div class="chart-item" v-for="item in sopList" :key="item.id">
<p>{{ item.sopName }}</p> <p>{{ item.sopName }}</p>
<div :id="'sopPie' + item.id" class="chart-pie"></div> <div :id="'sopPie' + item.id" class="chart-pie"></div>
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
</div> </div>
</div> </div>
</div> </div>
<div v-show="!sopList.length" class="txt-center">
<img src="@/assets/empty.png" />
<p class="m-t-10">暂无数据</p>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -154,9 +158,9 @@ export default { ...@@ -154,9 +158,9 @@ export default {
.replace(/-/g, '.') + .replace(/-/g, '.') +
(item.endDate (item.endDate
? '-' + ? '-' +
moment(item.endDate) moment(item.endDate)
.format('YYYY-MM-DD') .format('YYYY-MM-DD')
.replace(/-/g, '.') .replace(/-/g, '.')
: '') : '')
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!