Commit 53642354 by 前端

Merge branch 'chenwq_dev_v2.0.0' into 'v2.0.0'

第一轮bug修复

See merge request !55
2 parents 5dfbe16c 582165c9
...@@ -134,14 +134,14 @@ export default { ...@@ -134,14 +134,14 @@ export default {
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' }],
customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }] customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }]
}, },
isEdit: true, isEdit: true,
editFormData: [ editFormData: [
{ {
label: 'sop名称', label: 'SOP名称',
name: 'sopName', name: 'sopName',
type: 'input', type: 'input',
maxlength: 20, maxlength: 20,
...@@ -189,6 +189,7 @@ export default { ...@@ -189,6 +189,7 @@ export default {
return { return {
// add-新增;edit-编辑;look-查看 // add-新增;edit-编辑;look-查看
addOrEdit: 'add', addOrEdit: 'add',
fromPage: 'index',
id: '' id: ''
} }
} }
...@@ -497,7 +498,7 @@ export default { ...@@ -497,7 +498,7 @@ export default {
}, },
cancelJump() { cancelJump() {
this.$router.push({ this.$router.push({
path: '/sop/index' path: '/sop/' + this.routeInfo.fromPage
}) })
}, },
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span> <span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span>
{{ item.labelGroup.name }} {{ item.labelGroup.name }}
<el-tag :size="size">{{ item.labelType }}</el-tag> <el-tag :size="size">{{ item.labelType }}</el-tag>
<el-radio-group class="tag-group" v-model="item.tagChecked" v-show="item.checked"> <el-radio-group class="tag-group" v-model="item.tagChecked" v-show="item.checked" @change="handleCheckedTag">
<div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag"> <div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag">
<el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8"> <el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8">
<el-radio class="radio-text" :label="itm">{{ itm.name }}</el-radio> <el-radio class="radio-text" :label="itm">{{ itm.name }}</el-radio>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<div class="tag-select-box"> <div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div> <div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }"> <div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRets"> <template v-for="item in labelTreeRetSelect">
<el-tag :title="item.tagChecked.name" v-if="item.tagChecked" type="info" class="tag-selected-item" :key="item.tagChecked" closable :disable-transitions="false" @close="remove(item, idx)"> <el-tag :title="item.tagChecked.name" v-if="item.tagChecked" type="info" class="tag-selected-item" :key="item.tagChecked" closable :disable-transitions="false" @close="remove(item, idx)">
{{ item.tagChecked.name }} {{ item.tagChecked.name }}
</el-tag> </el-tag>
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
labelGroupName: '', labelGroupName: '',
selectNum: 0, selectNum: 0,
searchStatus: false, searchStatus: false,
labelTreeRetSelect: [],
labelTreeRets: [ labelTreeRets: [
// { // {
// labelGroup: { id: '109', name: '湖口123' }, // labelGroup: { id: '109', name: '湖口123' },
...@@ -100,19 +101,42 @@ export default { ...@@ -100,19 +101,42 @@ export default {
selectCustomer selectCustomer
}, },
watch: { watch: {
labelTreeRets: { labelTreeRetSelect: {
handler() { handler() {
this.selectNum = 0 this.selectNum = 0
this.labelTreeRets.forEach(item => { this.labelType = []
console.log(new Date())
this.labelTreeRetSelect.forEach(item => {
if (item.tagChecked) { if (item.tagChecked) {
this.selectNum++ this.selectNum++
if (!this.labelType.includes(item.labelType)) {
this.labelType.push(item.labelType)
}
} }
}) })
this.$nextTick(() => {
console.log(new Date())
})
}, },
deep: true deep: true
} }
}, },
methods: { methods: {
// 选择标签
handleCheckedTag() {
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(tag => {
if (tag.labelGroup.id == item.labelGroup.id && item.tagChecked) {
let labelId = item.tagChecked ? item.tagChecked.id : ''
let index = tag.labelList.findIndex(iem => iem.id == labelId)
tag.tagChecked = tag.labelList[index]
}
})
})
},
isLabelType(label) {
return this.labelType.length > 0 && !this.labelType.includes(label)
},
jumpUrl() { jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index') util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false this.dialogVisible = false
...@@ -170,7 +194,7 @@ export default { ...@@ -170,7 +194,7 @@ export default {
} }
}) })
}) })
console.log(this.labelTreeRets) this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
} else { } else {
// this.labelTreeRets = res.labelTreeRets.map(item => { // this.labelTreeRets = res.labelTreeRets.map(item => {
// return { // return {
...@@ -197,24 +221,43 @@ export default { ...@@ -197,24 +221,43 @@ export default {
} }
}) })
// console.log(labelTreeRets) // console.log(labelTreeRets)
labelTreeRets.forEach(item => { this.labelTreeRetSelect.forEach(item => {
this.labelTreeRets.forEach(tag => { this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) { if (tag.labelGroup.id == item.labelGroup.id && item.tagChecked) {
let labelId = item.tagChecked ? item.tagChecked.id : '' let labelId = item.tagChecked ? item.tagChecked.id : ''
let index = tag.labelList.findIndex(iem => iem.id == labelId) let index = tag.labelList.findIndex(iem => iem.id == labelId)
tag.tagChecked = tag.labelList[index] tag.tagChecked = tag.labelList[index]
// }
} }
}) })
}) })
if (this.labelTreeRetSelect.length == 0) {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
}
} }
}) })
}, },
remove(item, idx) { remove(item, idx) {
item.tagChecked = null item.tagChecked = null
this.labelTreeRetSelect.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (tag.labelGroup.id == item.labelGroup.id) {
if (item.tagChecked) {
let labelId = item.tagChecked ? item.tagChecked.id : ''
let index = tag.labelList.findIndex(iem => iem.id == labelId)
tag.tagChecked = tag.labelList[index]
} else {
tag.tagChecked = null
}
// }
}
})
})
}, },
//选中 //选中
handleSelect() { handleSelect() {
this.selectedLabelList = this.labelTreeRets this.selectedLabelList = this.labelTreeRetSelect
.map(item => { .map(item => {
if (item.tagChecked) { if (item.tagChecked) {
return { return {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div slot="eventContent" class="content"> <div slot="eventContent" class="content">
<div class="content-bg"> <div class="content-bg">
<!-- <wTextarea ref="textContent" v-model="textValue" @updateText="updateText"></wTextarea> --> <!-- <wTextarea ref="textContent" v-model="textValue" @updateText="updateText"></wTextarea> -->
<el-input type="textarea" :disabled="editForm.object.additionalType == '4'" :rows="9" maxlength="280" show-word-limit v-model="editForm.eventContent" @input="textInput" style="-webkit-user-modify: read-write-plaintext-only !important; width: 656px" placeholder="请输入营销文案"></el-input> <el-input type="textarea" :disabled="editForm.object ? editForm.object.additionalType == '4' : false" :rows="9" maxlength="280" show-word-limit v-model="editForm.eventContent" @input="textInput" style="-webkit-user-modify: read-write-plaintext-only !important; width: 656px" placeholder="请输入营销文案"></el-input>
<div v-for="(itm, index) in previewList" :key="itm.id"> <div v-for="(itm, index) in previewList" :key="itm.id">
<!-- additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板) --> <!-- additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板) -->
<div v-if="itm.additionalType" class="welcome-file"> <div v-if="itm.additionalType" class="welcome-file">
...@@ -469,12 +469,7 @@ export default { ...@@ -469,12 +469,7 @@ export default {
getInfo() { getInfo() {
this.editForm.eventStartDate = moment(this.editForm.eventStartDate).format('YYYY-MM-DD') this.editForm.eventStartDate = moment(this.editForm.eventStartDate).format('YYYY-MM-DD')
this.editForm.eventEndDate = moment(this.editForm.eventEndDate).format('YYYY-MM-DD') this.editForm.eventEndDate = moment(this.editForm.eventEndDate).format('YYYY-MM-DD')
this.previewList = [ this.previewList = this.editForm.object ? [{ attContent: JSON.parse(JSON.stringify(this.editForm.object)), additionalType: this.editForm.object.additionalType }] : []
{
attContent: JSON.parse(JSON.stringify(this.editForm.object)),
additionalType: this.editForm.object.additionalType
}
]
this.recoveryRepeat() this.recoveryRepeat()
this.recoveryEndTime() this.recoveryEndTime()
}, },
...@@ -625,7 +620,7 @@ export default { ...@@ -625,7 +620,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => { })
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
<GLButton :size="size" type="default" class="default-blue-btn" fn="管理SOP" @click="handleJump('sopList')">管理全部SOP</GLButton> <GLButton :size="size" type="default" class="default-blue-btn" fn="管理SOP" @click="handleJump('sopList')">管理全部SOP</GLButton>
</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', 'padding-right': sopList.length ? '0' : '20px' }">
<div class="chart-box sop-flex" v-show="sopList.length"> <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 class="sop-name">{{ item.sopName }}</p>
<div :id="'sopPie' + item.id" class="chart-pie"></div> <div :id="'sopPie' + item.id" class="chart-pie"></div>
<p>{{ item.dateRange }}</p> <p>{{ item.dateRange }}</p>
<div class="sop-btns"> <div class="sop-btns">
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
handleJump(path, row = {}) { handleJump(path, row = {}) {
this.$router.push({ this.$router.push({
path: '/sop/' + path, path: '/sop/' + path,
query: row ? { id: row.id } : '' query: row ? { id: row.id, fromPage: 'index' } : ''
}) })
}, },
...@@ -192,14 +192,15 @@ export default { ...@@ -192,14 +192,15 @@ export default {
// 结束 // 结束
handleEnd(row) { handleEnd(row) {
this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id }) this.secondConfirm('结束', '结束SOP后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id })
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建sop' : '编辑sop') fromPage: 'index',
$title: encodeURI(addOrEdit == 'add' ? '新建SOP' : '编辑SOP')
} }
addOrEdit != 'add' && (params.id = row.id) addOrEdit != 'add' && (params.id = row.id)
this.$router.push({ this.$router.push({
...@@ -245,7 +246,7 @@ export default { ...@@ -245,7 +246,7 @@ export default {
.chart-item { .chart-item {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
width: calc((100% - 68px) / 4); width: calc((100% - 80px) / 4);
min-width: 270px; min-width: 270px;
height: 184px; height: 184px;
text-align: center; text-align: center;
...@@ -257,6 +258,9 @@ export default { ...@@ -257,6 +258,9 @@ export default {
height: 104px; height: 104px;
margin: 8px 0; margin: 8px 0;
} }
.sop-name {
font-weight: 600;
}
.sop-btns { .sop-btns {
display: none; display: none;
box-sizing: border-box; box-sizing: border-box;
...@@ -277,9 +281,9 @@ export default { ...@@ -277,9 +281,9 @@ export default {
} }
} }
} }
.chart-item:nth-child(4n + 0) { // .chart-item:nth-child(4n + 0) {
margin-right: 0px; // margin-right: 0px;
} // }
.chart-item:hover .sop-btns { .chart-item:hover .sop-btns {
display: block; display: block;
} }
......
...@@ -27,7 +27,8 @@ export default { ...@@ -27,7 +27,8 @@ export default {
activeName: 'compleList', activeName: 'compleList',
size: 'small', size: 'small',
routeInfo: { routeInfo: {
id: '' id: '',
fromPage: 'index'
} }
} }
}, },
...@@ -43,10 +44,10 @@ export default { ...@@ -43,10 +44,10 @@ export default {
}, },
methods: { methods: {
handleTabClick() {}, handleTabClick() { },
handleBack() { handleBack() {
this.$router.push({ this.$router.push({
path: '/sop/index' path: '/sop/' + this.routeInfo.fromPage
}) })
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<div class="marketing p-t-20"> <div class="marketing p-t-20">
<div class="m-b-20"> <div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit('add')">新建sop</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit('add')">新建SOP</el-button>
<!-- <GLButton :size="size" type="primary" fn="新建sop" class="el-icon-plus" @click="handleEdit(1)">新建sop</GLButton> --> <!-- <GLButton :size="size" type="primary" fn="新建sop" class="el-icon-plus" @click="handleEdit(1)">新建sop</GLButton> -->
</div> </div>
<div class="container"> <div class="container">
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="sopListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="sopListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.sopStatus != 1" type="text" @click="handleJump('sopAnalysisList', scope.scope)">sop分析</el-button> <el-button v-if="scope.scope.sopStatus != 1" type="text" @click="handleJump('sopAnalysisList', scope.scope)">SOP分析</el-button>
<el-button v-if="scope.scope.sopStatus == 2" type="text" @click="handleEnd(scope.scope)">结束</el-button> <el-button v-if="scope.scope.sopStatus == 2" type="text" @click="handleEnd(scope.scope)">结束</el-button>
<el-button v-if="scope.scope.sopStatus != 3" type="text" @click="handleEdit('edit', scope.scope)">编辑</el-button> <el-button v-if="scope.scope.sopStatus != 3" type="text" @click="handleEdit('edit', scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.sopStatus == 1" type="text" @click="handleDelete(scope.scope)">删除</el-button> <el-button v-if="scope.scope.sopStatus == 1" type="text" @click="handleDelete(scope.scope)">删除</el-button>
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
handleJump(path, row = {}) { handleJump(path, row = {}) {
this.$router.push({ this.$router.push({
path: '/sop/' + path, path: '/sop/' + path,
query: row ? { id: row.id } : '' query: row ? { id: row.id, fromPage: 'sopList' } : ''
}) })
}, },
// getParams() { // getParams() {
...@@ -182,7 +182,8 @@ export default { ...@@ -182,7 +182,8 @@ export default {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id) // addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建sop' : '编辑sop') fromPage: 'sopList',
$title: encodeURI(addOrEdit == 'add' ? '新建SOP' : '编辑SOP')
} }
addOrEdit != 'add' && (params.id = row.id) addOrEdit != 'add' && (params.id = row.id)
this.$router.push({ this.$router.push({
...@@ -193,11 +194,11 @@ export default { ...@@ -193,11 +194,11 @@ export default {
// 结束 // 结束
handleEnd(row) { handleEnd(row) {
this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id }) this.secondConfirm('结束', '结束SOP后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id })
}, },
handleDelete(row) { handleDelete(row) {
this.secondConfirm('删除', 'sop删除后,不可恢复。是否确定删除?', 'sop', 'deleteSopEventApi', { sopId: row.id }) this.secondConfirm('删除', 'SOP删除后,不可恢复。是否确定删除?', 'sop', 'deleteSopEventApi', { sopId: row.id })
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!