Commit 52b99bb5 by chenwq Committed by 杨北旺

sop首页;新增

1 parent b28b4126
import { http } from '@/main' import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.' // 标签获取客户列表
const getCustomerByTagListApi = params => { const getCustomerByTagListApi = params => {
params.method = 'entmicro.api.customer.getCustomerPageByTag' params.method = 'entmicro.api.customer.getCustomerPageByTag'
params.source = 'scrm-home' params.source = 'scrm-home'
...@@ -13,4 +12,36 @@ const getCustomerByTagListApi = params => { ...@@ -13,4 +12,36 @@ const getCustomerByTagListApi = params => {
}) })
} }
export default { getCustomerByTagListApi } const getSopInfoListApi = params => {
params.method = 'scrm.api.sop.sopInfo.listWithPage'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop营销事件次数分析
const parseEventCountApi = params => {
params.method = 'scrm.api.sop.sopEvent.parseEventCount'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
const insertOrUpdateSopApi = params => {
params.method = 'scrm.api.sop.sopInfo.insertOrUpdate'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getCustomerByTagListApi, getSopInfoListApi, parseEventCountApi, insertOrUpdateSopApi }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<el-date-picker class="m-r-20" v-model="editForm[scope.scope.name]" :placeholder="scope.scope.placeholder" :value-format="scope.scope.valueFormat" :clearable="scope.scope.isClear" :picker-options="scope.scope.customPickerOptions" @change="scope.scope.change"></el-date-picker> <el-date-picker class="m-r-20" v-model="editForm[scope.scope.name]" :placeholder="scope.scope.placeholder" :value-format="scope.scope.valueFormat" :clearable="scope.scope.isClear" :picker-options="scope.scope.customPickerOptions" @change="scope.scope.change"></el-date-picker>
</div> </div>
<div slot="eventTime" slot-scope="scope"> <div slot="eventTime" slot-scope="scope">
<el-time-picker v-model="editForm[scope.scope.name]" value-format="HH:mm:ss" :placeholder="scope.scope.placeholder"></el-time-picker> <el-time-picker v-model="editForm[scope.scope.name]" value-format="HH:mm" format="HH:mm" :placeholder="scope.scope.placeholder"></el-time-picker>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
<glsx-combi-form ref="editFormRefRepeat" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataRepeat" :formRules="editRule"></glsx-combi-form> <glsx-combi-form ref="editFormRefRepeat" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataRepeat" :formRules="editRule"></glsx-combi-form>
...@@ -497,27 +497,36 @@ export default { ...@@ -497,27 +497,36 @@ export default {
}, },
// 计算事件重复次数 // 计算事件重复次数
dealRepeatEventTotal() { // dealRepeatEventTotal() {
console.log(moment(this.editForm.eventStartDate).weeksInYear()) // console.log(moment(this.editForm.eventStartDate).weeksInYear())
if (this.editForm.repeatFlag == 'Y') { // if (this.editForm.repeatFlag == 'Y') {
switch (this.editForm.repeatMode) { // switch (this.editForm.repeatMode) {
// 按天 // // 按天
case '1': // case '1':
this.editForm.eventCount = (new Date(this.editForm.eventEndDate) - new Date(this.editForm.eventStartDate)) / (24 * 60 * 60 * 1000) + 1 // this.editForm.eventCount = (new Date(this.editForm.eventEndDate) - new Date(this.editForm.eventStartDate)) / (24 * 60 * 60 * 1000) + 1
break // break
// 按周 // // 按周
case '2': // case '2':
break // break
case '3': // case '3':
break // break
} // }
} // }
console.log(this.editForm.eventCount) // console.log(this.editForm.eventCount)
}, // },
handleConfirm() { handleConfirm() {
console.log(this.editForm) console.log(this.editForm)
this.dealRepeatEventTotal() // this.dealRepeatEventTotal()
var countParams = {
eventStartDate: this.editForm.eventStartDate,
eventEndDate: this.editForm.eventEndDate,
eventTime: this.editForm.eventTime,
repeatFlag: this.editForm.repeatFlag,
repeatMode: this.editForm.repeatMode,
repeatTime: this.editForm.repeatTime
}
if (this.submit) { if (this.submit) {
return true return true
} }
...@@ -539,29 +548,12 @@ export default { ...@@ -539,29 +548,12 @@ export default {
this.submit = false this.submit = false
return true return true
} }
this.$emit('handleInfoConfirm', { baseInfo: this.editForm }) this.$apis.sop.parseEventCountApi(countParams).then(res => {
// this.$refs.editFormRefDate.$refs[this.editChildRef].validate(valid => { this.editForm.eventCount = res.eventStatistics.eventCount
// if (valid) { this.$emit('handleInfoConfirm', { baseInfo: this.editForm })
// var params = this.$common.utils.deepClone(this.editForm) })
// if (this.eventObj.addOrEdit == 'edit') {
// params.id = this.eventObj.id
// }
// this.$apis.zoneList.insertZoneApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.cancelJump()
// }
// })
// }
// })
}, },
cancelJump() { cancelJump() {
// this.$router.push({
// path: '/sop/index'
// })
this.$emit('handleTabChange', { activeName: 'baseInfo' }) this.$emit('handleTabChange', { activeName: 'baseInfo' })
}, },
handleCancel() { handleCancel() {
......
...@@ -90,60 +90,12 @@ export default { ...@@ -90,60 +90,12 @@ export default {
} }
] ]
}, },
sopList: [ sopList: []
{
id: '1',
sopName: 'sop的名称1',
// 1-未开始;2-进行中;3-已结束
sopStatus: '2',
sopStatistics: {
finishEventCount: 10,
eventCount: 100
}
},
{
id: '2',
sopName: 'sop的名称2',
sopStatus: '2',
sopStatistics: {
finishEventCount: 22,
eventCount: 100
}
},
{
id: '3',
sopName: 'sop的名称3',
sopStatus: '2',
sopStatistics: {
finishEventCount: 100,
eventCount: 100
}
},
{
id: '4',
sopName: 'sop的名称4',
sopStatus: '2',
sopStatistics: {
finishEventCount: 59,
eventCount: 100
}
},
{
id: '5',
sopName: 'sop的名称5',
sopStatus: '2',
sopStatistics: {
finishEventCount: 13,
eventCount: 100
}
}
]
} }
}, },
mounted() { mounted() {
this.dealListData() this.getList()
this.drawPie()
}, },
methods: { methods: {
...@@ -168,7 +120,7 @@ export default { ...@@ -168,7 +120,7 @@ export default {
}) })
if (res.code == '0') { if (res.code == '0') {
fn && fn() fn && fn()
// this.handleSearch() this.getList()
} }
}) })
} }
...@@ -176,6 +128,21 @@ export default { ...@@ -176,6 +128,21 @@ export default {
}) })
}, },
getList() {
var params = {
pageNum: 1,
pageSize: 999999
}
this.$apis.sop.getSopInfoListApi(params).then(res => {
console.log(res)
this.sopList = res.list
this.dealListData()
this.$nextTick(() => {
this.drawPie()
})
})
},
// 数据处理 // 数据处理
dealListData() { dealListData() {
this.sopList.forEach(item => { this.sopList.forEach(item => {
...@@ -184,12 +151,13 @@ export default { ...@@ -184,12 +151,13 @@ export default {
}, },
drawPie() { drawPie() {
console.log(this.sopList)
this.sopList.forEach(item => { this.sopList.forEach(item => {
let chartDom = document.getElementById('sopPie' + item.id) let chartDom = document.getElementById('sopPie' + item.id)
let myChart = echarts.init(chartDom) let myChart = echarts.init(chartDom)
let option = JSON.parse(JSON.stringify(this.pieOption)) let option = JSON.parse(JSON.stringify(this.pieOption))
// option.title.text = item.completedPercent == '100' ? '√' : item.completedPercent + '%' option.title.text = item.completedPercent == '100' ? '√' : item.completedPercent + '%'
option.title.text = item.completedPercent + '%' option.title.text = item.completedPercent + '%'
option.series[0].name = item.sopName option.series[0].name = item.sopName
option.series[0].data = [ option.series[0].data = [
...@@ -199,7 +167,7 @@ export default { ...@@ -199,7 +167,7 @@ export default {
}, },
{ {
value: item.sopStatistics.eventCount - item.sopStatistics.finishEventCount, value: item.sopStatistics.eventCount - item.sopStatistics.finishEventCount,
name: '总营销事件' name: '未触发的营销事件'
} }
] ]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!