Commit 3f88eedd by 李伟康

提交

1 parent 9d7aae1e
......@@ -47,4 +47,15 @@ const exportExcel = params => {
sign: false
})
}
export default { getCustomersList, getCustomersDetail, stageUpdate, exportExcel }
/**
* 状态刷新
*/
const refreshInst = params => {
return http_sop({
url: `http://gateway.platform.dev.glsx.com.cn/process/sop/inst/refresh`,
method: 'get',
data: params,
sign: false
})
}
export default { getCustomersList, getCustomersDetail, stageUpdate, exportExcel, refreshInst }
......@@ -148,7 +148,42 @@ const stateList = [{
confName: '已下架'
},
]
function getExplorer () {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
function exportFn (url) {
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
}
export {
limitPrice,
orderManageStatusList,
......@@ -159,5 +194,7 @@ export {
memberTypeList,
stateList,
orderTypesList,
orderStatusList
orderStatusList,
exportFn,
getExplorer
}
\ No newline at end of file
......@@ -16,7 +16,7 @@
<div class="btns">
<el-button
type="default"
@click="handleRefresh"
@click="refreshInst"
plain
>状态刷新</el-button>
<el-button
......@@ -73,6 +73,7 @@
import { combiFormConfig } from './index/config'
import journeyTable from './index/table.vue'
import dataView from './index/dataView.vue'
import { exportFn } from '@/common/constant'
export default {
mixins: [combiFormConfig],
components: {
......@@ -82,14 +83,13 @@ export default {
name: '',
data () {
return {
viewType: 11,
viewType: 1,
journeyList: [],
FormKey: Date.now()
}
},
mounted () {
this.getList()
this.getCustomersList();
},
methods: {
getList () {
......@@ -115,7 +115,7 @@ export default {
this.handleSearch()
})
},
changeTab(val){
changeTab (val) {
this.searchForm.sopJourneyStage = val
this.handleSearch()
},
......@@ -141,11 +141,22 @@ export default {
},
handleExport () {
this.$apis.journey.exportExcel({ ...this.searchForm, pageSize: 10000, pageNumber: 1 }).then(res => {
console.log(res)
if (res.url) exportFn(res.url)
})
},
changeViewType () {
this.viewType = this.viewType == 1 ? 0 : 1
},
/**状态刷新 */
async refreshInst () {
const { sopJourneyId } = this.tableSearchForm,
{ refreshTime } = this
if (refreshTime && Date.now() - refreshTime < 1e4) return this.$message('数据正在刷新中,请勿频繁提交')
const res = await this.$apis.journey.refreshInst({
instId: sopJourneyId
})
this.refreshTime = Date.now()
this.handleSearch()
}
}
}
......@@ -172,7 +183,8 @@ export default {
text-align: center;
cursor: pointer;
}
.active,.tab:hover {
.active,
.tab:hover {
background-color: #fff;
color: #5850ff;
}
......
......@@ -10,6 +10,7 @@ export default {
},
data () {
return {
refreshTime: '',
searchForm: {
...defaultFormData
},
......
......@@ -45,21 +45,21 @@
>
<div class="top flex">
<div class="icon">
<template v-if="item.icon">
<img :src="item.icon" />
<template v-if="item.wechatAvatarUrl">
<img :src="item.wechatAvatarUrl" />
</template>
<template v-else>
<img src="@/assets/icon/default-avatar.png" />
</template>
</div>
<div class="text">
<div class="name">微信昵称</div>
18888888888
<div class="name">{{ item.wechatNickname}}</div>
{{ item.customerPhone }}
</div>
</div>
<div class="bottom flex">
<div class="left text-hide">进入该阶段:第1天</div>
<div class="right text-hide">跟进人:姓名啊</div>
<div class="left text-hide">进入该阶段:第{{ item.day }}天</div>
<div class="right text-hide">跟进人:{{ item.sopFollowUpPersonName }}</div>
</div>
</div>
</template>
......@@ -95,7 +95,7 @@
</template>
<script type="text/ecmascript-6">
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
......@@ -125,6 +125,7 @@ export default {
},
methods: {
async refreshTable () {
console.log(dayjs)
function splitArrayIntoChunks (arr, chunkSize) {
const weight = 1 / arr.length
return arr.reduce((result, item, index) => {
......@@ -143,18 +144,18 @@ export default {
const stageList = this.stageList,
arr = []
for (let k of stageList) {
if (k.value) {
params.sopJourneyStage = k.value
const { list } = await this.$apis.journey.getCustomersList(params)
arr.push({
title: k.label,
list
})
}
// if (k.value) {
params.sopJourneyStage = k.value
const { list } = await this.$apis.journey.getCustomersList(params)
list.length && list.map(e => e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime), 'day'))
arr.push({
title: k.label,
list
})
// }
}
this.viewList = splitArrayIntoChunks(arr, 4)
this.dataViewLoading = false
},
}
}
......
<template>
<div class="journey-table">
<GLTable ref="tableRef" :noDataImg="url" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" @refreshTable="refreshTable" :tableTotal="tableTotal">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope"></GLTableButton>
<GLTable
ref="tableRef"
:noDataImg="url"
:tableParams="tableParams"
:tableData="tableData"
:pageConf="pageConf"
@refreshTable="refreshTable"
:tableTotal="tableTotal"
>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
></GLTableButton>
</div>
</GLTable>
<el-drawer :visible.sync="showDrawer" direction="rtl" size="720px">
<el-drawer
:visible.sync="showDrawer"
direction="rtl"
size="720px"
>
<template #title>
<div class="drawer-title">编辑客户旅程</div>
</template>
......@@ -28,8 +47,15 @@
<div class="label">旅程阶段:</div>
<template v-for="(i, index) in stageList">
<template>
<div :key="index" class="tags-item flex">
<el-button :class="['text', { active: index == stageIndex }]" :disabled="index < stageIndex" @click="editStage(index)">{{ i.label }}</el-button>
<div
:key="index"
class="tags-item flex"
>
<el-button
:class="['text', { active: index == stageIndex }]"
:disabled="index < stageIndex"
@click="editStage(index)"
>{{ i.label }}</el-button>
<div class="arrow"></div>
</div>
</template>
......@@ -44,7 +70,10 @@
</div>
<template v-for="(i, index) in fileObject">
<template>
<div :key="index" class="file-item flex">
<div
:key="index"
class="file-item flex"
>
<div class="label">{{ i.label }}:</div>
<div class="value">{{ userInfo.carMaintenanceInsurances[0][i.key] }}</div>
</div>
......@@ -53,8 +82,14 @@
</div>
</div>
<div class="footer flex">
<el-button type="default" @click="showDrawer = false">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button
type="default"
@click="showDrawer = false"
>取消</el-button>
<el-button
type="primary"
@click="handleConfirm"
>确定</el-button>
</div>
</el-drawer>
</div>
......@@ -62,6 +97,7 @@
<script type="text/ecmascript-6">
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
......@@ -77,7 +113,7 @@ export default {
data () {
return {
userInfo: {
carMaintenanceInsurances:[{}]
carMaintenanceInsurances: [{}]
},
tableSearchForm: {},
tableData: [],
......@@ -107,19 +143,27 @@ export default {
},
{
label: '旅程',
prop: 'orderCode',
minWidth: '100px'
prop: 'sopJourneyStage',
minWidth: '100px',
formatter: cell => {
const { journeyList } = this.$parent
return journeyList.find(e => e.instId == cell.sopJourneyId).instName
}
},
{
label: '进入旅程时间',
prop: 'sopJourneyEnterTime',
minWidth: '160px'
minWidth: '160px',
formatter: cell => {
return `${dayjs(cell.sopJourneyEnterTime).format('YYYY/MM/DD')}`
}
},
{
label: '所处旅程天数',
prop: 'orderCode',
minWidth: '160px'
minWidth: '160px',
formatter: cell => {
return `${dayjs().diff(dayjs(cell.sopJourneyEnterTime), 'day')}天`
}
},
{
label: '旅程阶段',
......@@ -128,8 +172,10 @@ export default {
},
{
label: '所处旅程阶段天数',
prop: 'orderCode',
minWidth: '160px'
minWidth: '160px',
formatter: cell => {
return `${dayjs().diff(dayjs(cell.sopJourneyStageEnterTime), 'day')}天`
}
}
]
},
......@@ -152,7 +198,7 @@ export default {
},
],
showDrawer: false,
stageIndex:'',
stageIndex: '',
fileObject: [
{
label: '车牌号',
......@@ -194,39 +240,39 @@ export default {
// })
// },
refreshTable () {
this.$nextTick(()=>{
this.$nextTick(() => {
console.log(this.$refs)
const params = {
...JSON.parse(JSON.stringify(this.params)),
pageSize: this.$refs.tableRef.page.pageSize,
pageNumber: this.$refs.tableRef.page.pageNumber
}
this.loading = true
this.$apis.journey.getCustomersList(params).then(res => {
this.loading = false
if (res) {
this.tableData = res.list
this.tableTotal = res.total || 0
...JSON.parse(JSON.stringify(this.params)),
pageSize: this.$refs.tableRef.page.pageSize,
pageNumber: this.$refs.tableRef.page.pageNumber
}
})
this.loading = true
this.$apis.journey.getCustomersList(params).then(res => {
this.loading = false
if (res) {
this.tableData = res.list
this.tableTotal = res.total || 0
}
})
})
},
getCustomersDetail(row) {
this.$apis.journey.getCustomersDetail({oneId:row.oneId,sopJourneyId:row.sopJourneyId,orgId:row.orgId}).then(res => {
getCustomersDetail (row) {
this.$apis.journey.getCustomersDetail({ oneId: row.oneId, sopJourneyId: row.sopJourneyId, orgId: row.orgId }).then(res => {
this.userInfo = res
this.stageIndex = this.stageList.findIndex(i=>i.label == this.userInfo.sopJourneyStage)
this.stageIndex = this.stageList.findIndex(i => i.label == this.userInfo.sopJourneyStage)
console.log(this.stageIndex)
})
},
editStage(index) {
editStage (index) {
this.stageIndex = index
this.userInfo.sopJourneyStage = this.stageList[index].label
},
handleConfirm () {
const {oneId,sopJourneyId,orgId,sopJourneyStage} = this.userInfo
this.$apis.journey.stageUpdate({oneId,sopJourneyId,orgId,sopJourneyStage,oprBy:this.$globalState.session.accountName}).then(res=>{
const { oneId, sopJourneyId, orgId, sopJourneyStage } = this.userInfo
this.$apis.journey.stageUpdate({ oneId, sopJourneyId, orgId, sopJourneyStage, oprBy: this.$globalState.session.accountName }).then(res => {
this.showDrawer = false
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!