Commit eef4ce17 by zhangxw

督导管理需求开发

1 parent d34f6dee
...@@ -32,6 +32,8 @@ const request = ( ...@@ -32,6 +32,8 @@ const request = (
apiName = "riskmanage" apiName = "riskmanage"
} else if (params.method.includes("dj.api.strategy")) { } else if (params.method.includes("dj.api.strategy")) {
apiName = "strategy" apiName = "strategy"
} else if (params.method.includes("dj.api.supervisor")) {
apiName = "supervisor"
} else { } else {
// console.log(params.method.split(".api")) // console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0] apiName = params.method.split(".api")[0]
...@@ -55,7 +57,8 @@ const request = ( ...@@ -55,7 +57,8 @@ const request = (
script: "axios7", script: "axios7",
staff: "axios9", staff: "axios9",
riskmanage: "axios10", riskmanage: "axios10",
strategy: 'axios_strategy' strategy: 'axios_strategy',
supervisor: 'axios_supervisor'
} }
const baseApiName = mappingName[apiName] const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName") // console.log(baseApiName, "baseApiName")
......
...@@ -689,3 +689,43 @@ export function getCommissionListApi(data = {}) { ...@@ -689,3 +689,43 @@ export function getCommissionListApi(data = {}) {
data.method = "dj.staff.api.staff.performance.commission.list"; data.method = "dj.staff.api.staff.performance.commission.list";
return request(data, "post"); return request(data, "post");
} }
// 获取督导管理列表数据
export function getSupervisorListApi(data = {}) {
data.method = ""
return request(data, "post");
}
// 获取督导管理汇总数据
export function getSupervisorSummaryApi(data = {}) {
data.method = "dj.api.supervisor.manage.summary";
return request(data, "post");
}
// 获取督导详情数据
export function getSupervisorDetailApi(data = {}) {
data.method = ""
return request(data, "post");
}
// 获取督导任务列表数据
export function getSupervisorTaskListApi(data = {}) {
data.method = "dj.api.supervisor.page.task"
return request(data, "post");
}
// 获取督导任务汇总数据
export function getSupervisorTaskSummaryApi(data = {}) {
data.method = "dj.api.supervisor.get.task.summary"
return request(data, "post");
}
// 获取督导任务详情数据
export function getSupervisorTaskDetailApi(data = {}) {
data.method = "dj.api.supervisor.getTaskDetailById"
return request(data, "post");
}
// 获取督导录音复盘列表数据
export function getSupervisorRecordListApi(data = {}) {
data.method = "dj.api.supervisor.page.audioReview"
return request(data, "post");
}
// 获取最近三年所有周数据
export function getRecentWeekListApi(data = {}) {
data.method = "dj.api.supervisor.get.generateWeeklyRanges"
return request(data, "post");
}
...@@ -907,6 +907,14 @@ export const downloadReportManage_reportType = [ ...@@ -907,6 +907,14 @@ export const downloadReportManage_reportType = [
{ {
confId: "salesDailyMonthlySummaryTable", confId: "salesDailyMonthlySummaryTable",
confValue: "销售日报月汇总表" confValue: "销售日报月汇总表"
},
{
confId: "",
confValue: "BI数据分析表"
},
{
confId: "",
confValue: "技师报表"
} }
] ]
...@@ -1950,3 +1958,30 @@ export const contractOrgOpt = [ ...@@ -1950,3 +1958,30 @@ export const contractOrgOpt = [
{ confId: "hzglsk", confValue: "惠州广联" }, { confId: "hzglsk", confValue: "惠州广联" },
{ confId: "szyjzh", confValue: "优加" } { confId: "szyjzh", confValue: "优加" }
] ]
// 督导任务类型
export const superviseTaskTypeOpt = [
{
confName: "录音复盘",
confId: 3
},
{
confName: "人员带教",
confId: 5
},
{
confName: "督导日报",
confId: 0
},
{
confName: "本周复盘",
confId: 1
},
{
confName: "督导月度计划",
confId: 2
},
{
confName: "专项任务",
confId: 4
}
]
\ No newline at end of file \ No newline at end of file
...@@ -1340,4 +1340,78 @@ export const routerName = { ...@@ -1340,4 +1340,78 @@ export const routerName = {
}, },
component: _import("residentManage/warningBaseLine/index"), component: _import("residentManage/warningBaseLine/index"),
}, },
91224: {
path: "/supervisionManagement",
name: "supervisionManagement",
meta: {
title: "督导管理",
authId: "91224",
parentId: "912",
cache: false,
},
component: _import("residentManage/supervisionManagement/supervision/index"),
auth: [
{
authId: "9122401",
parentId: "91224",
label: "查看详情",
handle: "handleDetail",
addRoutePath: [
{
authId: "912240101",
name: "查看详情",
parentId: "91224",
}
],
}
]
},
912240101: {
path: "/supervisionDetail",
name: "supervisionDetail",
meta: {
title: "查看详情",
authId: "9122401",
parentId: "91224",
activePath: "/supervisionManagement",
},
component: _import("residentManage/supervisionManagement/supervision/detail"),
},
91225: {
path: "/supervisionMissionManagement",
name: "supervisionMissionManagement",
meta: {
title: "督导任务管理",
authId: "91225",
parentId: "912",
cache: false
},
auth: [
{
authId: "9122501",
parentId: "91225",
label: "详情",
handle: "handleDetail",
addRoutePath: [
{
authId: "912250101",
name: "详情",
parentId: "91225",
}
],
}
],
component: _import("residentManage/supervisionManagement/mission/index")
},
912250101: {
path: "/supervisionMissionDetail",
name: "supervisionMissionDetail",
meta: {
title: "详情",
authId: "9122501",
parentId: "91225",
activePath: "/supervisionMissionManagement",
},
component: _import("residentManage/supervisionManagement/mission/detail"),
}
}; };
...@@ -9,37 +9,9 @@ ...@@ -9,37 +9,9 @@
:search-form="searchForm" :search-form="searchForm"
:form-data="showFormData" :form-data="showFormData"
> >
<div slot="firstClassify"> <template slot="phone">
<el-select <el-input v-model="searchForm.phone" maxlength="11" placeholder="请输入手机号" @input="handlePhoneInput"></el-input>
v-model="searchForm.firstClassify" </template>
clearable
placeholder="请选择"
@change="changeClassify"
>
<el-option
v-for="item in baseData.firstClassifyList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</div>
<div slot="secondClassify">
<el-select
v-model="searchForm.secondClassify"
clearable
placeholder="请选择"
>
<el-option
v-for="item in baseData.secondClassifyList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</div>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary"> <el-button @click="handleSearch" size="small" type="primary">
...@@ -81,27 +53,21 @@ export default { ...@@ -81,27 +53,21 @@ export default {
data() { data() {
return { return {
searchForm: { searchForm: {
firstClassify: "", supervisionName: "",
secondClassify: "", phone: ""
content: ""
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [ showFormData: [
{ {
label: "话术内容", label: "督导姓名",
name: "content", name: "supervisionName",
type: "input", type: "input",
isClear: true isClear: true
}, },
{ {
label: "一级分类", label: "手机号",
name: "firstClassify", name: "phone",
addHtml: "firstClassify" addHtml: "phone"
},
{
label: "二级分类",
name: "secondClassify",
addHtml: "secondClassify"
} }
], ],
getListApi: conversationPointPage, getListApi: conversationPointPage,
...@@ -111,42 +77,33 @@ export default { ...@@ -111,42 +77,33 @@ export default {
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: "话术内容", label: "督导姓名",
prop: "content", prop: "content",
width: "550px",
addHtml: "content",
align:'left'
}, },
{ {
label: "一级分类", label: "手机号",
prop: "firstClassify" prop: "firstClassify"
}, },
{ {
label: "一级权重", label: "入职日期",
prop: "firstWeight" prop: "firstWeight"
}, },
{ {
label: "二级分类", label: "团队人员",
prop: "secondClassify" prop: "secondClassify"
}, },
{ {
label: "二级权重", label: "管理门店",
prop: "secondWeight" prop: "secondWeight"
}, },
{ {
label: "更新时间", label: "产值",
prop: "updatedDate", prop: "updatedDate",
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.updatedDate return cellValue.updatedDate ? `¥${cellValue.updatedDate}` : '-'
? Util.dateFormate(cellValue.updatedDate, "YYYY-MM-DD HH:mm:ss")
: ""
} }
} }
] ]
},
baseData: {
firstClassifyList: [],
secondClassifyList: []
} }
} }
}, },
...@@ -155,24 +112,9 @@ export default { ...@@ -155,24 +112,9 @@ export default {
}, },
methods: { methods: {
formatSrt(str) { handlePhoneInput(e) {
return str let newValue = e.replace(/[^\d.]/g, '')
// return str.replace(/\n/g, "<br/>") this.searchForm.phone = newValue
},
getPointCategory() {
this.classifyMap = new Map()
getPointCategory().then((res) => {
this.baseData.firstClassifyList = Object.keys(res)
for (const item in res) {
this.classifyMap.set(item, res[item])
}
})
},
changeClassify() {
this.searchForm.secondClassify = ""
this.baseData.secondClassifyList = this.classifyMap.get(
this.searchForm.firstClassify
)
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
...@@ -180,40 +122,25 @@ export default { ...@@ -180,40 +122,25 @@ export default {
resolve() resolve()
}) })
}, },
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
handleSearch() { handleSearch() {
this.$refs.pointTable.refreshTable(true, true) this.$refs.pointTable.refreshTable(true, true)
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
firstClassify: "", // 质检日期 supervisionName: "",
secondClassify: "", phone: ""
content: ""
} }
this.baseData.secondClassifyList = []
this.$refs.pointTable.refreshTable() this.$refs.pointTable.refreshTable()
},
handleDetail(data) {
this.close({ tagName: "/orderDetail" })
this.$router.push({
name: "orderDetail",
query: {
detail: JSON.stringify(data.row)
}
})
} }
} }
} }
......
<template>
<div class="recording-detail">
<div class="header">
<div class="left">
<span class="title">录音复盘</span>
<span>提交人:{{ pageQuery.updatedBy }}</span>
</div>
<div>提交时间:{{ pageQuery.createTime }}</div>
</div>
<d2-table
ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<template slot="tag" slot-scope="scope">
<el-tooltip class="item"
:content="scope.scope.reviewTarget"
placement="top">
<span>
{{
scope.scope.reviewTarget
? scope.scope.reviewTarget.length > 10
? `${scope.scope.reviewTarget.substring(0, 10)}...`
: scope.scope.reviewTarget
: "-"
}}
</span>
</el-tooltip>
</template>
<template slot="review" slot-scope="scope">
<el-tooltip class="item"
:content="scope.scope.reviewContent"
placement="top">
<span>
{{
scope.scope.reviewContent
? scope.scope.reviewContent.length > 10
? `${scope.scope.reviewContent.substring(0, 10)}...`
: scope.scope.reviewContent
: "-"
}}
</span>
</el-tooltip>
</template>
</d2-table>
</div>
</template>
<script>
import page from "@/store/modules/d2admin/modules/page";
import { getSupervisorRecordListApi } from "@api/resident"
import { mount } from "sortablejs";
export default {
name: "RecordingDetail",
data() {
return {
getListApi: getSupervisorRecordListApi,
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "驻店销售",
prop: "employeeName",
},
{
label: "接待日期",
prop: "staticDate"
},
{
label: "接待门店",
prop: "merchantName"
},
{
label: "质检评分",
prop: "qualityCheckScore"
},
{
label: "攻防评分",
prop: "avgDefence"
},
{
label: "客户类型",
prop: "customerType"
},
{
label: "车型",
prop: "carModel"
},
{
label: "标签",
prop: "reviewTarget",
addHtml: 'tag'
},
{
label: "复盘",
prop: "reviewContent",
addHtml: 'review'
}
]
}
}
},
mounted() {
this.pageQuery = this.$route.query
},
methods: {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = { id: this.pageQuery.id }
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
.recording-detail {
.header {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
background: #FFFFFF;
padding: 14px 20px;
color: #666666;
font-size: 14px;
.title {
color: #333333;
font-weight: 500;
font-size: 16px;
margin-right: 10px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="review-detail">
<div class="header">{{ missionTypeOptions[detailInfo.taskType] }}</div>
<div class="content">
<div class="item">
<div class="label">提交人:</div>
<div class="value">{{ detailInfo.updatedBy }}</div>
</div>
<div class="item">
<div class="label">提交时间:</div>
<div class="value">{{ detailInfo.createTime }}</div>
</div>
<div class="item" v-if="[0, 5].includes(detailInfo.taskType)">
<div class="label">督导门店:</div>
<div class="value">{{ detailInfo.merchantName }}</div>
</div>
<template v-if="detailInfo.taskType == '5'">
<div class="item" >
<div class="label">带教人员:</div>
<div class="value">{{ detailInfo.storeManagerName }}</div>
</div>
<div class="item">
<div class="label">带教记录:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
<div class="item">
<div class="label">推送课程:</div>
<div class="value">
<el-table
:data="detailInfo.taskCourseList"
style="width: 450px"
border
class="store-table"
>
<el-table-column
label="序号"
align="center"
type="index"
width="64px"
/>
<el-table-column
prop="bcCourseName"
label="课程名称"
align="center"
/>
</el-table>
</div>
</div>
</template>
<div class="item" v-if="[0, 5].includes(detailInfo.taskType)">
<div class="label">督导记录:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
<template v-if="[0, 5].includes(detailInfo.taskType)">
<div class="item">
<div class="label">门店照片:</div>
<div class="value">
<img v-for="(item, index) in detailInfo.taskImageList" :key="index" class="img-item" :src="item" alt="" @click="handleImg(item)">
</div>
</div>
</template>
<template v-if="detailInfo.taskType == '3'">
<div class="item">
<div class="label">复盘人员:</div>
<div class="value">{{ detailInfo.storeManagerName }}</div>
</div>
<div class="item">
<div class="label">复盘记录:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
<div class="item">
<div class="label">会议截图:</div>
<div class="value">
<img v-for="(item, index) in detailInfo.taskImageList" :key="index" class="img-item" :src="item" alt="" @click="handleImg(item)">
</div>
</div>
</template>
<template v-if="detailInfo.taskType == '2'">
<div class="item">
<div class="label">月度计划:</div>
<div class="value"></div>
</div>
</template>
<template v-if="detailInfo.taskType == '4'">
<div class="item">
<div class="label">门店名称:</div>
<div class="value">{{ detailInfo.merchantName }}</div>
</div>
<div class="item">
<div class="label">事项描述:</div>
<div class="value">{{ detailInfo.taskDesc }}</div>
</div>
<div class="item">
<div class="label">创建时间:</div>
<div class="value">{{ detailInfo.createTime }}</div>
</div>
<div class="item">
<div class="label">专项任务:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
</template>
</div>
<el-image-viewer v-if="imgVisible" :on-close="closeImgViewer" :url-list="detailInfo.taskImageList" :initial-index="initialIndex" />
</div>
</template>
<script>
import { getSupervisorTaskDetailApi } from "@api/resident"
import dayjs from "dayjs"
export default {
name: "ReviewDetail",
components: {
"el-image-viewer": () =>
import("element-ui/packages/image/src/image-viewer")
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(val) {
console.log(val, 'detail')
if (val.id) {
this.getDetail(val.id)
}
},
deep: true
},
},
data() {
return {
missionTypeOptions: {
'5': '人员带教',
'0': '督导日报',
'1': '本周复盘',
'2': '督导月度计划',
'4': '专项任务'
},
detailInfo: {},
imgVisible: false,
initialIndex: 0
}
},
mounted() {
},
methods: {
getDetail(id) {
getSupervisorTaskDetailApi({ id }).then(res => {
res.createTime = res.createTime ? dayjs(res.createTime).format("YYYY-MM-DD HH:mm:ss") : ""
res.taskImageList = res.taskImageList?.map(val => {return val.imageUrl}) || []
this.detailInfo = res || {}
})
},
handleImg() {
this.imgVisible = !this.imgVisible
this.initialIndex = 0
},
closeImgViewer() {
this.imgVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.review-detail {
background: #FFFFFF;
.header {
font-size: 16px;
color: #333333;
font-weight: 500;
padding: 14px 20px;
border-bottom: 1px solid #E5E5E5;
}
.content {
padding: 20px;
.item {
display: flex;
font-size: 14px;
margin-bottom: 20px;
.label {
flex-shrink: 0;
color: #666666;
width: 150px;
text-align: right;
}
.value {
color: #333333;
.img-item {
width: 36px;
height: 36px;
margin-right: 8px;
}
}
&:last-child {
margin-bottom: 0;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 督导任务详情 -->
<template>
<div class="mission-detail">
<d2-container>
<div v-if="detail.taskType == '3'">
<recording :detail="detail"/>
</div>
<div v-else>
<reviewDetail :detail="detail"/>
</div>
<div class="footer-btn">
<el-button class="cancel-btn" @click="handleBack"> 关闭 </el-button>
</div>
</d2-container>
</div>
</template>
<script>
import recording from "./components/recording.vue"
import reviewDetail from "./components/reviewDetail.vue"
import { mapActions } from "vuex"
export default {
name: "MissionDetail",
components: {
recording,
reviewDetail
},
data() {
return {
detail: {}
}
},
mounted() {
console.log(this.$route.query.detail, 'detail')
this.detail = JSON.parse(this.$route.query.detail)
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
handleBack() {
this.close({ tagName: "/supervisionMissionManagement" })
this.$router.push({
name: "supervisionMissionManagement"
})
}
}
}
</script>
<style lang="scss" scoped>
.footer-btn {
display: flex;
justify-content: center;
margin-top: 20px;
.cancel-btn {
width: 100px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 督导任务管理 -->
<template>
<d2-container>
<div class="detail-content">
<div class="content-box">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabList"
:key="item.key"
:label="item.name"
:name="item.key">
</el-tab-pane>
<div class="container">
<div slot="header"
class="header"
style="padding: 10px 20px">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm">
</d2-search>
<div class="up-btns">
<el-button size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
<div class="table-box">
<div class="date-select">
<dateSelectPicker :tab-key="activeName" @change="onDateChange"></dateSelectPicker>
</div>
<div class="view">
<div class="view-item">
<div class="label">
总人数
</div>
<div class="value">
<span class="orange">{{ staticsData.totalCount }}</span>
</div>
</div>
<div class="view-item">
<div class="label">
提交任务人数
</div>
<div class="value">
<span class="green">{{ staticsData.submittedCount }}</span>
</div>
</div>
<div class="view-item">
<div class="label">
提交任务数
</div>
<div class="value">
<span class="red">{{ staticsData.submittedTaskCount }}</span>
</div>
</div>
</div>
<d2-table ref="supervisionTaskTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #auth-button="scope">
<div>
<auth-button :data="scope.scope"
:show-btn-ids="['9122501']" />
</div>
</template>
</d2-table>
</div>
</div>
</el-tabs>
</div>
</div>
</d2-container>
</template>
<script>
import { getSupervisorTaskListApi, getSupervisorTaskSummaryApi } from "@api/resident";
import { mapActions } from "vuex";
import { superviseTaskTypeOpt } from "@/common/constants";
import { deepClone, Util } from "@/common/util";
import dateSelectPicker from "../components/dateSelectPicker.vue";
export default {
name: "SupervisionDetail",
components: {
dateSelectPicker
},
data() {
return {
tabList: [{
name: "今日任务",
key: "day"
}, {
name: "本周任务",
key: "week"
}, {
name: "月度任务",
key: "month"
}, {
name: "专项任务",
key: "special"
}],
getListApi: getSupervisorTaskListApi,
showFormData: [
{
label: "任务类型",
name: "searchTaskTypeList",
type: "select",
optionId: "confId",
optionLabel: "confName",
optionList: [],
optionsName: "superviseTaskTypeOpt",
},
{
label: "提交人",
name: "updatedBy",
type: "input",
isClear: true,
},
],
activeName: "day",
searchForm: {
searchTaskTypeList: "",
updatedBy: "",
},
searchFormSearch: {},
staticsData: {},
tableParams: {
btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: "list",
tableOption: { width: "100px" },
tableColumns: [
{
label: "任务类型",
prop: "taskType",
formatter: (cellValue) => {
const type = superviseTaskTypeOpt.find(item => item.confId == cellValue.taskType);
return type ? type.confName : "-";
},
},
{
label: "任务提交时间",
prop: "createTime",
},
{
label: "提交人",
prop: "updatedBy",
},
],
},
};
},
created() {
this.updateTaskTypeOptionsByTab(this.tabList[0]?.name || "")
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
updateTaskTypeOptionsByTab(tabName) {
const allowMap = {
"今日任务": [3, 0, 5],
"本周任务": [1],
"月度任务": [2],
"专项任务": [4]
}
const allowIds = allowMap[tabName] || [];
const optById = new Map(superviseTaskTypeOpt.map(i => [i.confId, i]))
const filtered = allowIds
.map((id) => optById.get(id))
.filter(Boolean)
.map((i) => (i.confId === 2 ? { ...i, confName: "月度计划" } : i))
const optionList = [{ confId: "", confName: "全部" }].concat(filtered)
this.$set(this.showFormData[0], "optionList", optionList)
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
const allowMap = {
"day": [3, 0, 5],
"week": [1],
"month": [2],
"special": [4]
}
const allowIds = allowMap[this.tabList.find(i => i.key == this.activeName)?.key] || [];
delete this.searchFormSearch.searchTaskTypeList;
this.searchFormSearch.taskTypeList = this.searchFormSearch.searchTaskTypeList ? [this.searchFormSearch.searchTaskTypeList] : allowIds;
resolve();
});
},
getStaticsData() {
let params = this.getParams();
getSupervisorTaskSummaryApi(params).then((res) => {
this.staticsData = res || {};
});
},
getParams() {
const allowMap = {
"day": [3, 0, 5],
"week": [1],
"month": [2],
"special": [4]
}
const allowIds = allowMap[this.tabList.find(i => i.key === this.activeName)?.key] || [];
const params = Util.deepClone(this.searchForm);
params.taskTypeList = params.searchTaskTypeList ? [params.searchTaskTypeList] : allowIds;
delete params.searchTaskTypeList;
return params;
},
handleClick(event) {
this.activeName = event.paneName;
this.updateTaskTypeOptionsByTab(event.label || "");
},
handleSearch() {
this.$refs.supervisionTaskTable?.refreshTable();
this.getStaticsData();
},
handleReset() {
this.searchForm.searchTaskTypeList = "";
this.searchForm.updatedBy = "";
this.$refs.supervisionTaskTable?.refreshTable(true, true);
this.getStaticsData();
},
onDateChange(e) {
this.searchForm.startDate = e.startTime?.replace(/\//g, "-");
this.searchForm.endDate = e.endTime?.replace(/\//g, "-");
this.$refs.supervisionTaskTable?.refreshTable();
this.getStaticsData();
},
handleDetail(data) {
console.log(data, 'data')
this.close({ tagName: "/supervisionMissionDetail" });
this.$router.push({
name: "supervisionMissionDetail",
query: {
detail: JSON.stringify(data),
},
});
},
},
};
</script>
<style lang="scss" scoped>
.detail-content {
::v-deep .el-tabs__nav-wrap {
padding-left: 20px;
}
.content-box {
::v-deep .el-tabs__header {
background: #ffffff;
margin-bottom: 0;
}
.table-box {
margin-top: 18px;
background: #ffffff;
padding: 12px 20px;
}
.date-select {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 16px;
}
.view {
display: flex;
gap: 16px;
margin-bottom: 16px;
.view-item {
flex: 1;
background: #f8faff;
border-radius: 4px;
padding: 12px 20px;
.label {
font-size: 14px;
color: #333333;
}
.value {
font-size: 20px;
font-weight: 500;
margin-top: 4px;
color: #1d1d1d;
}
}
}
}
}
</style>
<!-- 督导管理详情 -->
<template>
<d2-container>
<div class="detail-content">
<div class="user-info"><span class="name">{{ '凉凉' }}</span><span>15622545578</span></div>
<div class="content-box">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabList" :key="item.id" :label="item.name" :name="item.id">
</el-tab-pane>
<div class="container">
<div class="date-select">
<dateSelectPicker :tab-key="activeName" @change="onDateChange"></dateSelectPicker>
</div>
<div class="view">
<div class="view-item">
<div class="label">
团队人员
</div>
<div class="value">
<span class="orange">{{ staticsData.totalCount }}</span>
</div>
</div>
<div class="view-item">
<div class="label">产值</div>
<div class="value">
<span class="green">{{ staticsData.finishCount }}</span>万元
</div>
</div>
<div class="view-item">
<div class="label">
转化率
</div>
<div class="value">
<span class="red">{{ staticsData.undoCount }}</span>
</div>
</div>
<div class="view-item">
<div class="label">
客单价
</div>
<div class="value">
<span class="red">{{ staticsData.undoCount }}</span>
</div>
</div>
</div>
<d2-table
ref="supervisionDetailTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
</d2-table>
</div>
</el-tabs>
</div>
</div>
</d2-container>
</template>
<script>
import { conversationPointPage } from "@api/resident"
import { Util, deepClone } from "@/common/util"
import dateSelectPicker from "../components/dateSelectPicker.vue";
export default {
name: "SupervisionDetail",
components: {
dateSelectPicker
},
data() {
return {
tabList: [{
name: '全场景',
id: ''
}, {
name: '延保',
id: '1'
}, {
name: '权益',
id: '2'
}, {
name: '轻改',
id: '3'
}],
getListApi: conversationPointPage,
activeName: '',
detail: {},
searchForm: {
scene: "",
date: ""
},
searchFormSearch: {},
staticsData: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "驻店销售",
prop: "content",
},
{
label: "归属业务",
prop: "firstClassify"
},
{
label: "产值",
prop: "firstWeight"
},
{
label: "转化率",
prop: "secondClassify"
},
{
label: "客单价",
prop: "secondWeight",
formatter: (cellValue) => {
return cellValue.updatedDate ? `¥${cellValue.updatedDate}` : '-'
}
}
]
}
}
},
created() {
this.detail = JSON.parse(this.$route.query.detail)
},
methods: {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
handleClick(event) {
this.activeName = event.paneName
this.searchForm.scene = event.paneName || ''
},
onDateChange(e) {
this.searchForm.startTime = e.startTime?.replace(/\//g, "-") + " 00:00:00"
this.searchForm.endTime = e.endTime?.replace(/\//g, "-") + " 23:59:59"
this.$refs.supervisionDetailTable.refreshTable()
}
}
}
</script>
<style lang="scss" scoped>
.detail-content {
.user-info {
display: flex;
align-items: center;
font-size: 14px;
padding: 0 20px;
color: #666666;
height: 52px;
line-height: 52px;
background: #FFFFFF;
.name {
font-size: 16px;
color: #333333;
font-weight: 500;
margin-right: 8px;
}
}
::v-deep .el-tabs__nav-wrap {
padding-left: 20px;
}
.content-box {
margin-top: 12px;
background: #FFFFFF;
.container {
padding: 0 20px;
}
.date-select {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 16px;
}
.view {
display: flex;
gap: 16px;
margin-bottom: 16px;
.view-item {
flex: 1;
background: #f8faff;
border-radius: 4px;
padding: 12px 20px;
.label {
font-size: 14px;
color: #333333;
}
.value {
font-size: 20px;
font-weight: 500;
margin-top: 4px;
color: #1D1D1D;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 督导管理 -->
<template>
<div>
<d2-container>
<div class="header" slot="header" style="padding: 10px 20px">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
>
<template slot="phone">
<el-input v-model="searchForm.phone" maxlength="11" placeholder="请输入手机号" @input="handlePhoneInput"></el-input>
</template>
</d2-search>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="view">
<div class="view-item">
<div class="label">
总人数
</div>
<div class="value">
<span class="orange">{{ staticsData.totalCount }}</span>
</div>
</div>
<div class="view-item">
<div class="label">本月总产值</div>
<div class="value">
<span class="green">{{ staticsData.monthlyOutput }}</span>万元
</div>
</div>
<div class="view-item">
<div class="label">
管理门店
</div>
<div class="value">
<span class="red">{{ staticsData.managedStoreCount }}</span>
</div>
</div>
</div>
<div class="theader">
<h2>人员列表</h2>
</div>
<d2-table
ref="supervisionTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<div slot="auth-button" slot-scope="scope">
<auth-button :data="scope.scope"
:show-btn-ids="['9122401']" />
</div>
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { conversationPointPage, getSupervisorSummaryApi } from "@api/resident"
import { mapActions } from "vuex"
export default {
name: "InspectionPoint",
data() {
return {
searchForm: {
supervisionName: "",
phone: ""
},
searchFormSearch: {},
staticsData: {},
showFormData: [
{
label: "督导姓名",
name: "supervisionName",
type: "input",
isClear: true
},
{
label: "手机号",
name: "phone",
addHtml: "phone"
}
],
getListApi: conversationPointPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: { width: "100px" },
tableColumns: [
{
label: "督导姓名",
prop: "content",
},
{
label: "手机号",
prop: "firstClassify"
},
{
label: "入职日期",
prop: "firstWeight"
},
{
label: "团队人员",
prop: "secondClassify"
},
{
label: "管理门店",
prop: "secondWeight"
},
{
label: "产值",
prop: "updatedDate",
formatter: (cellValue) => {
return cellValue.updatedDate ? `¥${cellValue.updatedDate}` : '-'
}
}
]
}
}
},
mounted() {
this.getStaticsData()
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
handlePhoneInput(e) {
let newValue = e.replace(/[^\d.]/g, '')
this.searchForm.phone = newValue
},
getStaticsData() {
let params = this.getParams()
getSupervisorSummaryApi(params).then(res => {
this.staticsData = res
})
},
getParams() {
const params = Util.deepClone(this.searchForm)
return params
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
handleSearch() {
this.$refs.supervisionTable.refreshTable()
},
handleReset() {
this.searchForm = {
supervisionName: "",
phone: ""
}
this.$refs.supervisionTable.refreshTable(true, true)
},
handleDetail(data) {
this.close({ tagName: "/supervisionDetail" })
this.$router.push({
name: "supervisionDetail",
query: {
detail: JSON.stringify(data)
}
})
}
}
}
</script>
<style scoped lang="scss">
.view {
display: flex;
gap: 16px;
.view-item {
flex: 1;
background: #f8faff;
border-radius: 4px;
padding: 12px 20px;
.label {
font-size: 14px;
color: #333333;
}
.value {
font-size: 20px;
font-weight: 500;
margin-top: 4px;
color: #1D1D1D;
}
}
}
.theader {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
h2 {
font-weight: 600;
font-size: 16px;
color: #333333;
}
span {
font-size: 14px;
color: #999999;
margin-right: 10px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!