Commit fd4cc342 by 徐忆琳

Merge branch 'v3.19.0_10' into 'v3.19.0'

联调完成

See merge request !2
2 parents aac37e94 2dcd1ebd
...@@ -18,7 +18,7 @@ import { http, http_tag } from '@/main' ...@@ -18,7 +18,7 @@ import { http, http_tag } from '@/main'
const getListApi = params => { const getListApi = params => {
// params.method = '/sop/sopTpls' // params.method = '/sop/sopTpls'
return http({ return http({
url: '/process/sop/api/sopTpls', url: '/process/sop/api/sopInsts',
method: 'get', method: 'get',
data: params, data: params,
sign: true sign: true
...@@ -46,18 +46,30 @@ const getSOPDetailsApi = (params) => { ...@@ -46,18 +46,30 @@ const getSOPDetailsApi = (params) => {
}) })
} }
const getInsDetailsApi = (params) => {
// params.method = '/sop/sopTpls'
return http({
url: '/process/sop/api/sopInsts/' + params.instId,
method: 'GET',
data: params,
sign: true
})
}
const sopInstsApi = (params) => { const sopInstsApi = (params) => {
return http({ return http({
url: '/process/sop/api/sopInsts', url: '/process/sop/api/sopInsts',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: false,
noNeed:true
}) })
} }
export default { export default {
getListApi, getListApi,
getSOPDetailsApi, getSOPDetailsApi,
getInsDetailsApi,
getTplList, getTplList,
sopInstsApi sopInstsApi
} }
...@@ -13,6 +13,7 @@ import { Http } from 'glsx-common' ...@@ -13,6 +13,7 @@ import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(common) { export const fetchConfig = function(common) {
let params = { moduleName: 'peregrination', mockUrl: 'https://oss-config.glsx.com.cn/mock/63c12a2e28a427953783403b/peregrination/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } } let params = { moduleName: 'peregrination', mockUrl: 'https://oss-config.glsx.com.cn/mock/63c12a2e28a427953783403b/peregrination/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
console.log(common.utils.getConfig(params))
return common.utils.getConfig(params) return common.utils.getConfig(params)
} }
export const config = { export const config = {
......
...@@ -22,7 +22,7 @@ Vue.use(ElementUI) ...@@ -22,7 +22,7 @@ Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
export async function bootstrap({history, common, messenger, globalState}) { export async function bootstrap({history, common, messenger, globalState}) {
const {response, request, sign, secret, sign_common, request_common, request_merchant} = await fetchConfig(common) const {response, request, sign, secret, sign_common, request_common, request_merchant,response_sop} = await fetchConfig(common)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -30,7 +30,7 @@ export async function bootstrap({history, common, messenger, globalState}) { ...@@ -30,7 +30,7 @@ export async function bootstrap({history, common, messenger, globalState}) {
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ Vue.prototype.$http = new common.Http({
response, response:response_sop,
request, request,
sign, sign,
secret, secret,
......
...@@ -142,15 +142,19 @@ export default { ...@@ -142,15 +142,19 @@ export default {
} }
}, },
mounted() { mounted() {
const query = this.$route.query || 'XBLC' // this.$bus.$off('whetherToProceedNext')
this.$bus.$on('whetherToProceedNext', (data) => {
const query = data.tplId
this.getDetail(query) this.getDetail(query)
})
}, },
methods: { methods: {
changeIndex(currentInex) { changeIndex(currentInex) {
this.currentIndex = currentInex this.currentIndex = currentInex
}, },
getDetail(val) { getDetail(val) {
this.$apis.journeyConfig.getSOPDetailsApi({tplId: 'XBLC'}).then(res => { this.$apis.journeyConfig.getSOPDetailsApi({tplId: val}).then(res => {
const stages = JSON.parse(res.tplParamDef).stages.defaultValue const stages = JSON.parse(res.tplParamDef).stages.defaultValue
const nodes = res.nodes const nodes = res.nodes
...@@ -174,7 +178,7 @@ export default { ...@@ -174,7 +178,7 @@ export default {
sopList sopList
}) })
} }
console.log(configList, 'configList') // console.log(configList, 'configList')
this.configList = configList this.configList = configList
}) })
}, },
...@@ -224,7 +228,8 @@ export default { ...@@ -224,7 +228,8 @@ export default {
changeNode(val){ changeNode(val){
console.log(val) console.log(val)
} }
} },
} }
</script> </script>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<template> <template>
<div class="border-content"> <div class="border-content">
<div class="journey-step-info" v-for="(stepItem, k) in configList" :key="k"> <div class="journey-step-info" v-for="(stepItem, k) in configList" :key="k">
<div v-if="stepItem.sopList.flat(Initify).length>0">
<div :class="{ 'collapse-item': true, 'is-active': stepItem.isExpaned }"> <div :class="{ 'collapse-item': true, 'is-active': stepItem.isExpaned }">
<div class="collapse-item-tab flex-column-center pl20"> <div class="collapse-item-tab flex-column-center pl20">
<i class="el-icon-caret-bottom" v-show="stepItem.isExpaned" @click="handleExpand(stepItem)"></i> <i class="el-icon-caret-bottom" v-show="stepItem.isExpaned" @click="handleExpand(stepItem)"></i>
...@@ -52,15 +53,15 @@ ...@@ -52,15 +53,15 @@
</div> </div>
<div class="task-item-content bg-fff"> <div class="task-item-content bg-fff">
<div class="step-item" v-for="(v, k) in stepItem.sopList" :key="k"> <div class="step-item" v-for="(v, k) in stepItem.sopList" :key="k">
<div class="step-item-day"> <div class="step-item-day" v-if="v.length > 0">
<img src="@/assets/config/step-border.png"/> <img src="@/assets/config/step-border.png"/>
<span>第{{ v[0].day }}天</span> <span v-if="v[0].day">第{{ v[0].day }}天</span>
</div> </div>
<div class="step-item-content"> <div class="step-item-content">
<div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center"> <div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center">
<div style="width: 100%"> <div style="width: 100%">
<div class="step-item-desc"> <div class="step-item-desc">
<span>[{{ value.time }}]发送 | {{ stage[value.taskType] }} |{{ <span>[ 9:00 ]发送 | {{ stage[value.taskType] }} |{{
des[value.taskType] des[value.taskType]
}}</span> }}</span>
<el-switch <el-switch
...@@ -72,6 +73,7 @@ ...@@ -72,6 +73,7 @@
active-value="0" active-value="0"
inactive-value="1" inactive-value="1"
:disabled="isDisabled" :disabled="isDisabled"
v-if="!isDisabled"
> >
</el-switch> </el-switch>
</div> </div>
...@@ -98,18 +100,18 @@ ...@@ -98,18 +100,18 @@
<el-popover placement="top-start" width="100" trigger="click"> <el-popover placement="top-start" width="100" trigger="click">
<div class="popover-panel" v-for="(t, pkey) in v" :key="pkey"> <div class="popover-panel" v-for="(t, pkey) in v" :key="pkey">
<div class="flex-column-center"> <div class="flex-column-center">
<span>{{ t.time }}</span> <span> 9:00 </span>
<div :class="['stage-icon', `stage-${t.taskType}`]"></div> <div :class="['stage-icon', `stage-${t.taskType}`]"></div>
</div> </div>
<div class="stage-desc">{{ stage[t.taskType] }}</div> <div class="stage-desc">{{ stage[t.taskType] }}</div>
</div> </div>
<div slot="reference" class="flex-column-center" v-if="v.length <= 2"> <div slot="reference" class="flex-column-center" v-if="v.length <= 2">
<span>{{ value.time }}</span> <span>9:00 </span>
<div :class="['stage-icon', `stage-${value.taskType}`]"></div> <div :class="['stage-icon', `stage-${value.taskType}`]"></div>
</div> </div>
<div slot="reference" class="flex-column-center" v-if="v.length > 2 && key == 0"> <div slot="reference" class="flex-column-center" v-if="v.length > 2 && key == 0">
<span>3条内容</span> <span>{{v.length}}个任务</span>
</div> </div>
</el-popover> </el-popover>
</div> </div>
...@@ -125,6 +127,7 @@ ...@@ -125,6 +127,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -172,7 +175,8 @@ export default { ...@@ -172,7 +175,8 @@ export default {
Array.from(item.sopList, sub => Array.from(item.sopList, sub =>
Array.from(sub, subItem => ({nodeId: subItem.nodeId, nodeSkip: subItem.nodeSkipable})) Array.from(sub, subItem => ({nodeId: subItem.nodeId, nodeSkip: subItem.nodeSkipable}))
) )
); )
;
this.computedSopSet = JSON.parse(JSON.stringify(sopList)) this.computedSopSet = JSON.parse(JSON.stringify(sopList))
sopList = sopList.flat(Infinity) sopList = sopList.flat(Infinity)
this.$bus.$emit('sopListSet', {sopList}) this.$bus.$emit('sopListSet', {sopList})
...@@ -498,13 +502,16 @@ export default { ...@@ -498,13 +502,16 @@ export default {
.stage-7 { .stage-7 {
background: url('../../../assets/config/calendar-icon.png') -10px -166px; background: url('../../../assets/config/calendar-icon.png') -10px -166px;
} }
::v-deep .el-switch{
::v-deep .el-switch {
float: right; float: right;
right: 10px; right: 10px;
} }
::v-deep .el-switch__core{
::v-deep .el-switch__core {
width: 50px !important; width: 50px !important;
} }
::v-deep .el-switch__label { ::v-deep .el-switch__label {
position: absolute; position: absolute;
display: none; display: none;
......
...@@ -69,10 +69,14 @@ export default { ...@@ -69,10 +69,14 @@ export default {
sopTplGrants:this.sopTplGrants, sopTplGrants:this.sopTplGrants,
nodes:this.nodes nodes:this.nodes
} }
console.log(params)
if (this.isNext){ if (this.isNext){
this.$apis.journeyConfig.sopInstsApi(params).then(res=>{ this.$apis.journeyConfig.sopInstsApi(params).then(res=>{
console.log(res) if (res == 'success'){
this.$message.success('创建模板成功')
this.$router.back()
}
}).catch(err => {
console.log(err)
}) })
} }
} }
......
...@@ -45,6 +45,9 @@ export default { ...@@ -45,6 +45,9 @@ export default {
getTplList() { getTplList() {
this.$apis.journeyConfig.getTplList().then(res => { this.$apis.journeyConfig.getTplList().then(res => {
this.templateArr = res this.templateArr = res
if (res.length == 1){
this.tplList.tplId = res[0].tplId
}
}) })
} }
} }
......
...@@ -2,47 +2,51 @@ const tableConfig = { ...@@ -2,47 +2,51 @@ const tableConfig = {
data() { data() {
return { return {
getListApi: this.$apis.journeyConfig.getListApi, getListApi: this.$apis.journeyConfig.getListApi,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'}, pageConf: {pageSize: 'pageSize', pageNum: 'pageNumber', totalCount: 'total'},
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '模板ID', label: '模板ID',
prop: 'accountName', prop: 'instId',
}, },
{ {
label: '旅程模板名称', label: '旅程模板名称',
prop: '', prop: 'instName',
}, },
{ {
label: '旅程阶段', label: '旅程阶段',
prop: '', prop: 'instRemark',
addHtml: 'instRemark',
width:250
}, },
{ {
label: '分发门店数', label: '门店名称',
prop: '', prop: 'sopTplGrant',
formatter: cellValue => {
return cellValue.sopTplGrant.groupName
}
}, },
{ {
label: '创建时间', label: '创建时间',
prop: '', prop: 'createTime',
}, },
{ {
label: '修改时间', label: '修改时间',
prop: '', prop: 'updateTime',
} }
], ],
}, },
tableButtonList: [ tableButtonList: [
{ {
type: 'el-button', type: 'el-button',
name: '模板详情', name: '模板实例详情',
attrs: { attrs: {
type: 'text' type: 'text'
}, },
listeners: { listeners: {
click: row =>this.gotoDetails(row.tplId) click: row => this.gotoDetails(row.instId)
} }
} }
......
...@@ -21,112 +21,116 @@ export default { ...@@ -21,112 +21,116 @@ export default {
data() { data() {
return { return {
configList: [ configList: [
{ // {
label: '可报价', // label: '可报价',
isExpaned: false, // isExpaned: false,
taskList: [ // taskList: [
{ // {
status: [1, 2], // status: [1, 2],
name: '进入条件', // name: '进入条件',
desc: '描述用户触发何种条件后,将自动变更为该旅程阶', // desc: '描述用户触发何种条件后,将自动变更为该旅程阶',
progressList: [ // progressList: [
{ // {
name: '33' // name: '33'
}, // },
{ // {
name: '33' // name: '33'
}, // },
{ // {
name: '33' // name: '33'
} // }
] // ]
} // }
] // ]
}, // },
{ // {
label: '有意向', // label: '有意向',
isExpaned: false, // isExpaned: false,
taskList: [ // taskList: [
{ // {
status: [1, 2], // status: [1, 2],
name: '进入条件', // name: '进入条件',
desc: '描述用户触发何种条件后,将自动变更为该旅程阶', // desc: '描述用户触发何种条件后,将自动变更为该旅程阶',
progressList: [ // progressList: [
{ // {
name: '33' // name: '33'
} // }
], // ],
sopList: [ // sopList: [
{ // {
day: '第一天', // day: '第一天',
times: [ // times: [
{ // {
time: '7:00', // time: '7:00',
process: 1 // process: 1
}, // },
{ // {
time: '8:00', // time: '8:00',
process: 2 // process: 2
}, // },
{ // {
time: '9:00', // time: '9:00',
process: 3 // process: 3
} // }
] // ]
}, // },
{ // {
day: '第二天', // day: '第二天',
times: [ // times: [
{ // {
time: '7:00', // time: '7:00',
process: 1 // process: 1
}, // },
{ // {
time: '8:00', // time: '8:00',
process: 2 // process: 2
} // }
] // ]
}, // },
{ // {
day: '第三天' // day: '第三天'
}, // },
{ // {
day: '第四天' // day: '第四天'
}, // },
{ // {
day: '第五天' // day: '第五天'
} // }
] // ]
} // }
] // ]
} // }
], ],
isDisabled: true isDisabled: true
} }
}, },
mounted() { mounted() {
const query = this.$route.query || 'XBLC' const query = this.$route.query || ''
this.getDetail(query) this.getDetail(query.id)
}, },
methods: { methods: {
getDetail(val) { getDetail(val) {
this.$apis.journeyConfig.getSOPDetailsApi({tplId: 'XBLC'}).then(res => { this.$apis.journeyConfig.getInsDetailsApi({instId: val}).then(res => {
const stages = JSON.parse(res.instParam).stages.defaultValue
const stages = JSON.parse(res.tplParamDef).stages.defaultValue
const nodes = res.nodes const nodes = res.nodes
const configList = [] const configList = []
for (let k in stages) { for (let k in stages) {
let list = [] let list = []
for (let v of nodes) { for (let v of nodes) {
if (v.nodeParamDef && JSON.parse(v.nodeParamDef).stage == stages[k].value) { if (v.nodeParam && JSON.parse(v.nodeParam).stage == stages[k].value) {
list.push({...JSON.parse(v.nodeParamDef), nodeSkipable: v.nodeSkipable, nodeId: v.nodeId}) list.push({...JSON.parse(v.nodeParam), nodeSkipable: v.nodeSkip, nodeId: v.nodeId})
} }
} }
list = list.filter(item => item.day) list = list.filter(item => item.day)
list.sort((a, b) => { list.sort((a, b) => {
return a.day - b.day return a.day - b.day
}) })
const sopList = this.groupBy(list, 'day') let sopList = this.groupBy(list, 'day')
sopList = sopList.map(function(arr) {
return arr.filter(function(obj) {
return obj.nodeSkipable == 0;
});
});
configList.push({ configList.push({
label: stages[k].value, label: stages[k].value,
isExpaned: false, isExpaned: false,
...@@ -150,6 +154,7 @@ export default { ...@@ -150,6 +154,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.setHeight { .setHeight {
height: calc(100vh - 120px); min-height: calc(100vh - 120px);
padding-bottom: 20px;
} }
</style> </style>
...@@ -15,18 +15,41 @@ ...@@ -15,18 +15,41 @@
</GLCombiForm> </GLCombiForm>
<div class="operate-wrap"> <div class="operate-wrap">
<span class="table-title">旅程列表</span> <span class="table-title">旅程模板实例列表</span>
<div> <div>
<el-button class="operate-btn" type="primary" size="small" @click="createJourneyTemplate" plain>创建 <el-button class="operate-btn" type="primary" size="small" @click="createJourneyTemplate" plain>创建
</el-button> </el-button>
<div @click="gotoDetails">详情</div>
</div> </div>
</div> </div>
<GLTable ref="memberCenterRef" @setTableFinishFun="setTableFinishFun" :searchForm="tableSearchForm" <GLTable ref="memberCenterRef" @setTableFinishFun="setTableFinishFun" :searchForm="tableSearchForm"
:tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"> :beforeSearchFn="beforeSearchFn">
<!-- <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>--> <div slot="instRemark" slot-scope="scope" style="display:flex">
<div v-for="(item,index) in handleStage(scope)" :key="index">
<div v-if="index <= 4">
{{ item.name }}
{{ getCommaSeparator('less', index, scope) }}
</div>
<div v-if="index > 4">
<el-popover placement="top" width="600" trigger="hover"
content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<span slot="reference">...</span>
<div class="entmicro-hover" style="display:flex">
<div v-for="(item,index) in handleStage(scope)" :key="index">
<div style="display:flex">
{{ item.name }}
{{ getCommaSeparator('more', index, scope) }}
</div>
</div>
</div>
</el-popover>
</div>
</div>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable> </GLTable>
</div> </div>
...@@ -59,6 +82,20 @@ export default { ...@@ -59,6 +82,20 @@ export default {
handleReset() { handleReset() {
this.tableSearchForm = {}, this.tableSearchForm = {},
this.$refs.memberCenterRef.refreshTable() this.$refs.memberCenterRef.refreshTable()
},
getCommaSeparator(lessOrMore, index, scope) {
return lessOrMore == 'less' ? index < this.handleStage(scope).length - 1 && index !== 3 ? '、' : '' : index < this.handleStage(scope).length - 1 ? '、' : ''
},
handleStage(scope) {
let stages = JSON.parse(scope.scope.instParam).stages.defaultValue
let list = []
for (let k in stages) {
list.push({
name: stages[k].value
})
}
return list
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!