Commit 2dcd1ebd by 前端

联调完成

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