Commit 018327ef by 前端

Merge branch 'SAAS+V4.49.0-0121' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.49.0-0121
2 parents 31b8f167 16ae2256
Showing 82 changed files with 3022 additions and 479 deletions
This diff could not be displayed because it is too large.
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
"md5": "^2.3.0", "md5": "^2.3.0",
"postcss-preset-env": "^7.7.2", "postcss-preset-env": "^7.7.2",
"postcss-px-to-viewport": "^1.1.1", "postcss-px-to-viewport": "^1.1.1",
"sass": "^1.62.0", "sass": "~1.62.0",
"sass-loader": "^7.3.1", "sass-loader": "^7.3.1",
"script-loader": "^0.7.2", "script-loader": "^0.7.2",
"vue-template-compiler": "^2.5.21", "vue-template-compiler": "^2.5.21",
......
...@@ -4,61 +4,207 @@ import RequestMethods from "./request.methods" ...@@ -4,61 +4,207 @@ import RequestMethods from "./request.methods"
const path = "dj.api.smartcarlife." const path = "dj.api.smartcarlife."
// 查询员工预警列表 // 查询员工预警列表
export function staffWarningMsgListWithPage(data) { export function staffWarningMsgListWithPage (data) {
data.method = `${path}warningmsg.staffWarningMsgListWithPage` data.method = `${path}warningmsg.staffWarningMsgListWithPage`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 预警明细 // 预警明细
export function warningMsgDetailListWithPage(data) { export function warningMsgDetailListWithPage (data) {
data.method = `${path}warningmsg.warningMsgDetailListWithPage` data.method = `${path}warningmsg.warningMsgDetailListWithPage`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 查询枚举 Type 1.预警类型 2.预警事项 // 查询枚举 Type 1.预警类型 2.预警事项
export function findAllData(data) { export function findAllData (data) {
data.method = `${path}warningmsg.findAllData` data.method = `${path}warningmsg.findAllData`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 查询相关警情的所有督导或销售 1.督导 2.销售 // 查询相关警情的所有督导或销售 1.督导 2.销售
export function findAllPersonRelations(data) { export function findAllPersonRelations (data) {
data.method = `${path}warningmsg.findAllPersonRelations` data.method = `${path}warningmsg.findAllPersonRelations`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 根据预警id查询预警的跟进信息 // 根据预警id查询预警的跟进信息
export function findByMsgId(data) { export function findByMsgId (data) {
data.method = `${path}warningmsg.findByMsgId` data.method = `${path}warningmsg.findByMsgId`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 保存跟进记录 // 保存跟进记录
export function saveFollowRecord(data) { export function saveFollowRecord (data) {
data.method = `${path}warningmsg.saveFollowRecord` data.method = `${path}warningmsg.saveFollowRecord`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 导出预警明细 // 导出预警明细
export function warningMsgDetailListWithPageExport(data) { export function warningMsgDetailListWithPageExport (data) {
data.method = `${path}warningmsg.warningMsgDetailListWithPageExport` data.method = `${path}warningmsg.warningMsgDetailListWithPageExport`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 查询门店预警列表 // 查询门店预警列表
export function merchantWarningMsgListWithPage(data) { export function merchantWarningMsgListWithPage (data) {
data.method = `${path}warningmsg.merchantWarningMsgListWithPage` data.method = `${path}warningmsg.merchantWarningMsgListWithPage`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 店效盯防首页 // 店效盯防首页
export function getShopGuardIndexBoard(data) { export function getShopGuardIndexBoard (data) {
data.method = 'dj.api.smartcarlife.risk.manage.home.page' data.method = 'dj.api.smartcarlife.risk.manage.home.page'
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
/**
* 店效盯防-更新数据配置 */
export function saveOrUpdateDataConfig (data) {
data.method = 'dj.api.smartcarlife.risk.manage.target.data.config.save.or.update'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-数据配置查询
*/
export function getDataConfig (data) {
data.method = 'dj.api.smartcarlife.risk.manage.target.data.config.query'
return request(data, RequestMethods.POST)
}
/** 店效盯防-风险榜 */ /** 店效盯防-风险榜 */
export function getMerchantPerformanceList(data) { export function getMerchantPerformanceList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.merchant.performance.page' data.method = 'dj.api.smartcarlife.risk.manage.merchant.performance.page'
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
}
/**
* 店效盯防-风险榜-导出
*/
export function exportMerchantPerformanceList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.merchant.performance.export'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-门店基础信息
*/
export function getMerchantBaseInfo (data) {
data.method = 'dj.api.smartcarlife.risk.manage.merchant.base.detail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-门店产值信息
*/
export function getMerchantBaseDetail (data) {
data.method = 'dj.api.smartcarlife.risk.manage.merchant.performance.detail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-产值详情
*/
export function getMerchantOutputDetail (data) {
data.method = 'dj.api.smartcarlife.risk.manage.output.detail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-人效指标-分页查询质检批次列表
*
*/
export function getReceptionDetailPage (data) {
data.method = 'dj.api.smartcarlife.inspection.receptionDetailPage'
return request(data, RequestMethods.POST)
}
/**
* / 查询质检批次列表导出
*/
export function getReceptionDetailReport (data) {
data.method = 'dj.api.smartcarlife.inspection.receptionDetailReport'
return request(data, RequestMethods.POST)
}
/**
* 预警驻店人员
*
*/
export function getWarningMsgStaffList (data) {
data.method = 'dj.api.smartcarlife.warningmsg.warningMsgStaffList'
return request(data, RequestMethods.POST)
}
/**
* 接待明细驻店人员
*
*/
export function getReceptionStaffList (data) {
data.method = 'dj.api.smartcarlife.inspection.receptionStaffList'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-品销指标
*/
export function getProductOutputtrend (data) {
data.method = 'dj.riskmanage.api.productefficiency.outputtrend'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-品销指标-获取员工列表
*/
export function getProductStaffList (data) {
data.method = 'dj.riskmanage.api.productefficiency.getstafflist'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-人效指标-产值分析-获取产品列表
*/
export function getPersonGoodsList (data) {
data.method = 'dj.riskmanage.api.personefficiency.getgoodslist'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-人效指标-产值分析-获取员工列表
*/
export function getPersonStaffList (data) {
data.method = 'dj.riskmanage.api.personefficiency.getstaffs'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-人效指标-产值分析-员工基本信息
*/
export function getPersonBaseInfo (data) {
data.method = 'dj.riskmanage.api.personefficiency.baseinfo'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-人效指标-产值分析-员工产值趋势
*/
export function getPersonOutputtrend (data) {
data.method = 'dj.riskmanage.api.personefficiency.outputtrend'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-人效指标-接待分析-查询员工接待信息
*/
export function getPersonStaffReception (data) {
data.method = 'dj.riskmanage.api.personefficiency.staffreception'
return request(data, RequestMethods.POST)
}
/**
*
*/
/**
* 店效盯防-门店详情-人效指标-接待分析-查询员工接待明细
*/
export function getPersonStaffReceptionList (data) {
data.method = 'dj.riskmanage.api.personefficiency.staffreceptiondetail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-人效指标-行为分析-查询员工预警状态看板
*/
export function getPersonStaffWarning (data) {
data.method = 'dj.riskmanage.api.personefficiency.staffwarning'
return request(data, RequestMethods.POST)
} }
\ No newline at end of file \ No newline at end of file
...@@ -71,3 +71,9 @@ export function getProductInfo(data) { ...@@ -71,3 +71,9 @@ export function getProductInfo(data) {
data.method = `${path}goodsinfo.get.byId` data.method = `${path}goodsinfo.get.byId`
return request(data, "post") return request(data, "post")
} }
// 获取三级全部类目
export function getAllCategory(data) {
data.method = `${path}goodsCategoryConfiguration.page.new`
return request(data, "post")
}
...@@ -127,13 +127,21 @@ export function reportTrack(data) { ...@@ -127,13 +127,21 @@ export function reportTrack(data) {
// 获取门店工资绩效列表 // 获取门店工资绩效列表
export function getStoreSalaryListApi(data) { export function getStoreSalaryListApi(data) {
data.method = `${path2}merchantPerformanceConfig.page` data.method = `${path2}merchantPerformanceConfig.pageByMerchant`
// data.method = `${path2}merchantPerformanceConfig.page`
return request(data, "post")
}
// 编辑进入页面获取最新配置的绩效数据
export function getStoreLastDetailApi(data) {
data.method = `${path2}merchantPerformanceConfig.getLatestConfigDetailByMerchantId`
return request(data, "post") return request(data, "post")
} }
// 禁用/启用门店工资绩效 // 禁用/启用门店工资绩效
export function editStoreSalaryStatusApi(data) { export function editStoreSalaryStatusApi(data) {
data.method = `${path2}merchantPerformanceConfig.updateStatus` // data.method = `${path2}merchantPerformanceConfig.updateStatus`
data.method = `${path2}merchantPerformanceConfig.updateStatusByMerchant`
return request(data, "post") return request(data, "post")
} }
...@@ -257,6 +265,12 @@ export function editStaffApi(data) { ...@@ -257,6 +265,12 @@ export function editStaffApi(data) {
return request(data, "post") return request(data, "post")
} }
// 编辑员工扣款项配置数据
export function editStaffDeductionApi(data) {
data.method = `${path2}staffConfig.update`
return request(data, "post")
}
// 员工分配门店账号 // 员工分配门店账号
export function assignStoreAccountApi(data) { export function assignStoreAccountApi(data) {
data.method = `${path2}staffBaseInfo.account.other.add` data.method = `${path2}staffBaseInfo.account.other.add`
...@@ -310,3 +324,105 @@ export function getSalaryDetailApi(data) { ...@@ -310,3 +324,105 @@ export function getSalaryDetailApi(data) {
data.method = `${path2}staffMonthSalary.detail` data.method = `${path2}staffMonthSalary.detail`
return request(data, "post") return request(data, "post")
} }
// 查询日报模板类型列表
export function getTemplateList(data = {}) {
data.method = 'dj.api.smartcarlife.digital.management.template.type.list'
return request(data, 'post')
}
// 督导
export function getStaffList(data) {
data.method = 'dj.api.smartcarlife.digital.management.template.staff.ref.list'
return request(data, 'post')
}
// 分页查询日报列表,表格数据
export function getRecordPage(data) {
data.method = 'dj.api.smartcarlife.digital.management.record.page'
return request(data, 'post')
}
// 查询模板详情, 表头数据
export function getTemplateDetail(data) {
data.method = 'dj.api.smartcarlife.digital.management.template.detail'
return request(data, 'post')
}
// 查询日报统计总览
export function getSummary(data) {
data.method = 'dj.api.smartcarlife.digital.management.record.summary'
return request(data, 'post')
}
// 查询未提交明细列表
export function getSummaryStaff(data) {
data.method = 'dj.api.smartcarlife.digital.management.record.staff.summary'
return request(data, 'post')
}
// 更新模版绑定员工
export function updateStaff(data) {
data.method = 'dj.api.smartcarlife.digital.management.template.staff.ref.update'
return request(data, 'post')
}
// 导出未提交明细列表
export function exportSummary(data) {
data.method = 'dj.api.smartcarlife.digital.management.record.staff.summary.export'
return request(data, 'post')
}
// 所有督导
export function getAllStaff(data) {
data.method = 'dj.api.smartcarlife.staff.specificBusinessRolePerson.areaSupervision.pageConfigured'
return request(data, 'post')
}
// 收入测算-白名单员工分页
export function getWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.list'
return request(data, 'post')
}
// 收入测算-查询收入测算配置开关
export function getSwitchConfig(data = {}) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.switch.config.get'
return request(data, 'post')
}
// 收入测算-添加白名单员工
export function addWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.add'
return request(data, 'post')
}
// 收入测算配置开关更新
export function addSwitchConfig(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.switch.config.add'
return request(data, 'post')
}
// 收入测算-删除白名单员工
export function delWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.del'
return request(data, 'post')
}
// 查询员工详情
export function getStaffInfo(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.staff.info.get'
return request(data, 'post')
}
// 职级介绍配置查询
export function getRankConfig(data) {
data.method = 'dj.smartcarlife.api.job.rank.config.get'
return request(data, 'post')
}
// 职级介绍配置更新
export function addRankConfig(data) {
data.method = 'dj.smartcarlife.api.job.rank.config.add'
return request(data, 'post')
}
\ No newline at end of file \ No newline at end of file
...@@ -338,4 +338,13 @@ $prefix: d2; ...@@ -338,4 +338,13 @@ $prefix: d2;
.remark-popper-class{ .remark-popper-class{
width: 50%; width: 50%;
}
.shop-tooltip {
max-width: 236px;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
\ No newline at end of file \ No newline at end of file
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
:before-close="handleClose" :before-close="handleClose"
:close-on-click-modal="false" :close-on-click-modal="false"
:width="width" :width="width"
:append-to-body="appendToBody"> :append-to-body="appendToBody"
:fullscreen="fullscreen">
<span slot="title"> <span slot="title">
{{ title }} {{ title }}
<span class="dialog-sub-title"> <span class="dialog-sub-title">
...@@ -70,7 +71,8 @@ export default { ...@@ -70,7 +71,8 @@ export default {
// 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置 // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
type: Boolean, type: Boolean,
default: false default: false
} },
fullscreen:Boolean
}, },
methods: { methods: {
......
...@@ -212,7 +212,7 @@ export default { ...@@ -212,7 +212,7 @@ export default {
data: [], data: [],
// 页码 // 页码
page: { page: {
pageSize: 10, pageSize: 3,
currentPage: 1 currentPage: 1
}, },
total: 10, total: 10,
...@@ -374,7 +374,12 @@ export default { ...@@ -374,7 +374,12 @@ export default {
sortChange ({ column, prop, order }) { sortChange ({ column, prop, order }) {
this.sortColum = order ? prop : "" this.sortColum = order ? prop : ""
this.sort = order this.sort = order
this.refreshTable(true, true) if (this.getListApi) {
this.refreshTable(true, true)
} else {
// this.$emit('sortChange', this.sortObj[this.sortColum][this.sort], this.sortColum)
this.$emit('sortChange', this.sortObj, this.sortColum, this.sort)
}
}, },
// 多选 // 多选
...@@ -411,6 +416,7 @@ export default { ...@@ -411,6 +416,7 @@ export default {
// params.sortColum = this.sortColum // params.sortColum = this.sortColum
// params.sort = this.sort === 'descending' ? 1 : 0 // params.sort = this.sort === 'descending' ? 1 : 0
params.orderByType = this.sortObj[this.sortColum][this.sort] params.orderByType = this.sortObj[this.sortColum][this.sort]
// params.orderByKey = this.sortColum
} }
this.getListApi(params) this.getListApi(params)
.then((res) => { .then((res) => {
......
...@@ -637,9 +637,9 @@ export const routerName = { ...@@ -637,9 +637,9 @@ export const routerName = {
handle: "handleToEdit", handle: "handleToEdit",
addRoutePath: [ addRoutePath: [
{ {
authId: "912070101", authId: "912120101",
name: "编辑", name: "编辑",
parentId: "91207" parentId: "91212"
} }
] ]
}, },
...@@ -655,11 +655,13 @@ export const routerName = { ...@@ -655,11 +655,13 @@ export const routerName = {
label: "启用", label: "启用",
handle: "handleEnableOrDisable", handle: "handleEnableOrDisable",
ruleObj: { ruleObj: {
attr: "status", attr: "minPerformConfigStatus",
rule: { rule: {
null: '启用',
2: "启用", 2: "启用",
1: "禁用" 1: "禁用"
} },
disabledStatusList: [null]
} }
}, },
{ {
...@@ -697,7 +699,15 @@ export const routerName = { ...@@ -697,7 +699,15 @@ export const routerName = {
parentId: "91212", parentId: "91212",
label: "明细", label: "明细",
handle: "handleDetail" handle: "handleDetail"
} },
{
authId: "9121210",
parentId: "91212",
label: "导入绩效方案",
category: "Button",
type: "primary",
handle: "handleImport"
},
], ],
component: _import("residentManage/salaryPerformance/index") component: _import("residentManage/salaryPerformance/index")
}, },
...@@ -819,5 +829,38 @@ export const routerName = { ...@@ -819,5 +829,38 @@ export const routerName = {
} }
], ],
component: _import("residentManage/growUpGrade/indexControl") component: _import("residentManage/growUpGrade/indexControl")
},
91215: {
path: "/dailyPaperManagement",
name: "dailyPaperManagement",
meta: {
title: "日报管理",
authId: "91215",
parentId: "912",
cache: false
},
component: _import("residentManage/dailyPaperManagement/index")
},
91216: {
path: "/measurement",
name: "measurement",
meta: {
title: "收入测算配置",
authId: "91216",
parentId: "912",
cache: false
},
component: _import("residentManage/measurement/index")
},
91217: {
path: "/promotionAndDmotion",
name: "promotionAndDmotion",
meta: {
title: "晋升/降级配置",
authId: "91217",
parentId: "912",
cache: false
},
component: _import("residentManage/promotionAndDmotion/index")
} }
} }
<template>
<baseDialog
:is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
class="dialog"
@handleClick="handleClick"
>
<div class="dialog-content">
<div class="month">
<div class="label">指定月份:</div>
<el-date-picker
v-model="targetDate"
type="month"
placeholder="选择月份"
:picker-options="monthPickerOptions"
size="small"
:clearable="false"
@change="changeDate"
value-format="yyyy-MM"
>
</el-date-picker>
</div>
<el-table
:data="tableData"
border
ref="table"
>
<el-table-column
label="序号"
type="index"
width="60"
align="center"
>
</el-table-column>
<template v-for="(item,index) in tableParams.tableColumns">
<el-table-column
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
align="center"
:key="index"
>
<template slot-scope="scope">
<div
v-if="item.addHtml"
:key="tableKey"
class="input-box"
>
<template v-if="scope.row.isEdit">
<el-input
v-model="scope.row[item.addHtml]"
:maxlength="item.maxlength"
:placeholder="item.placeholder"
:ref="`${scope.row.id}`"
size="mini"
:class="scope.row.className"
@blur="handleInput($event, scope.row, item)"
></el-input>
</template>
<template v-else>
{{ scope.row[item.addHtml]?scope.row[item.addHtml].toLocaleString() : ''}}
</template>
<template v-if="item.unit">
<div class="unit">{{item.unit}}</div>
</template>
</div>
<template v-else-if="item.formatter">
<span
v-if="item.html"
v-html="item.formatter(scope.row)"
/>
<template v-if="!item.html">
<span :class="item.className ? item.className(scope.row) : ''" />
<span v-text="item.formatter(scope.row)" />
</template>
</template>
<span v-else>{{ scope.row[item.prop] || "-" }}</span>
</template>
</el-table-column>
</template>
<el-table-column
label="操作"
fixed="right"
:align="tableParams.tableOption.align || 'center'"
:width="tableParams.tableOption.width || 'auto'"
:key="tableKey"
>
<template slot-scope="scope">
<template v-if="!scope.row.isEdit">
<el-button
:class="[{'is-disabled':isEditStatus}]"
type="text"
@click="edit(scope)"
:disabled="isEditStatus"
>编辑</el-button>
</template>
<template v-if="scope.row.isEdit">
<el-button
type="text"
@click="save(scope.row)"
>保存</el-button>
<el-button
type="text"
@click="cancel(scope.row)"
>取消</el-button>
</template>
</template>
</el-table-column>
</el-table>
</div>
</baseDialog>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
import { getDataConfig, saveOrUpdateDataConfig } from '@api/earlyWarningManager'
export default {
name: '',
props: {
show: Boolean
},
data () {
return {
dialogShow: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: true,
btnList: [],
isShowFooter: true,
confirm_name: '确定',
cancel_name: '取消'
},
config: {
title: "数据配置",
width: "720px"
}
},
targetDate: dayjs().format('YYYY-MM'),
monthPickerOptions: {
disabledDate: date => {
let next = dayjs().add(1, 'month').valueOf(),
prev = dayjs().subtract(1, 'month').valueOf(),
now = dayjs().valueOf()
return date != now && (date > next || date < prev)
}
},
tableData: [
{
businessType: 4,
outputTarget: '',
grossProfit: '',
grossMargin: ''
},
{
businessType: 3,
outputTarget: '',
grossProfit: '',
grossMargin: ''
},
{
businessType: 2,
outputTarget: '',
grossProfit: '',
grossMargin: ''
}
],
tableParams: {
tableOption: {
width: '100'
},
tableColumns: [
{
label: '业务类型',
minWidth: 110,
formatter: (cellValue) => {
return {
2: '轻改',
3: '权益',
4: '延保'
}[cellValue.businessType]
},
},
{
label: '产值目标',
addHtml: 'outputTarget',
minWidth: 135,
maxlength: 10,
placeholder: '请输入',
max: 9999999999
},
{
label: '毛利润',
addHtml: 'grossProfit',
minWidth: 135,
maxlength: 10,
placeholder: '请输入',
max: 9999999999
},
{
label: '毛利润率',
addHtml: 'grossMargin',
unit: '%',
minWidth: 135,
maxlength: 5,
placeholder: '请输入',
max: 100,
decimals: true
},
]
},
tableKey: Date.now(),
isEditStatus: false
}
},
watch: {
show (n) {
this.dialogShow = n
if (n) {
this.targetDate = this.$options.data.call(this).targetDate
this.init()
}
},
dialogShow (n) {
this.$emit('update:show', n)
}
},
mounted () {
},
methods: {
init () {
this.isEditStatus = false
this.tableData = this.$options.data.call(this).tableData
this.getDataConfig()
},
async getDataConfig () {
const { targetDate } = this
const res = await getDataConfig({
targetDate
})
if (res && res.length) {
this.tableData = res
}
},
edit (e) {
let { row } = e
if (this.isEditStatus) return
row.origin_outputTarget = row.outputTarget
row.origin_grossProfit = row.grossProfit
row.origin_grossMargin = row.grossMargin
row.isEdit = true
this.isEditStatus = true
this.tableKey = Date.now()
},
save (row) {
this.isEditStatus = false
delete row.origin_outputTarget
delete row.origin_grossProfit
delete row.origin_grossMargin
delete row.isEdit
this.tableKey = Date.now()
},
cancel (row) {
this.isEditStatus = false
row.isEdit = false
row.outputTarget = row.origin_outputTarget
row.grossProfit = row.origin_grossProfit
row.grossMargin = row.origin_grossMargin
this.tableKey = Date.now()
},
handleInput (event, row, item) {
let value = event.target.value
if (value.length == 0) return
value = String(value).match(/\d*\.?\d+/)
if (!value) value = 0
value = Number(value) > item.max ? item.max : value
if (item.decimals) {
if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1')
value = Number(String(value).replace(/^0+/, ''))
} else value = parseInt(value)
row[item.addHtml] = Math.abs(Number(value))
this.tableKey = Date.now()
},
async handleClick () {
try {
let { tableData } = this,
{ targetDate } = this
tableData.map(e => {
if (e.isEdit) {
e.outputTarget = e.origin_outputTarget
e.grossProfit = e.origin_grossProfit
e.grossMargin = e.origin_grossMargin
}
e.targetDate = targetDate
})
const res = await saveOrUpdateDataConfig({
targetConfigList: tableData
})
if (res) {
this.$message.success('保存成功')
this.dialogShow = false
this.$emit('update')
}
} catch (error) {
if (error) this.$message.error(error)
}
},
changeDate () {
this.init()
}
}
}
</script>
<style scoped lang='scss'>
.dialog {
&-content {
padding: 5px 0;
.month {
display: flex;
align-items: center;
margin-bottom: 32px;
.label {
color: #333333;
font-size: 14px;
width: 150px;
display: flex;
align-items: center;
justify-content: flex-end;
&::before {
content: "*";
color: #eb4e4e;
display: block;
margin-right: 6px;
}
}
}
}
.input-box {
padding: 4px 10px;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -36,14 +36,22 @@ ...@@ -36,14 +36,22 @@
class="data-config" class="data-config"
v-if="hasConfig" v-if="hasConfig"
> >
<el-button size="small"><i class="el-icon-setting"></i>数据配置</el-button> <el-button
size="small"
@click="dialogShow = true"
><i class="el-icon-setting"></i>数据配置</el-button>
</div> </div>
<config-dialog :show.sync="dialogShow" @update="$emit('update')" />
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import ConfigDialog from './ConfigDialog.vue'
export default { export default {
components: {
ConfigDialog
},
name: '', name: '',
props: { props: {
hasConfig: { hasConfig: {
...@@ -66,6 +74,7 @@ export default { ...@@ -66,6 +74,7 @@ export default {
{ name: '本月', value: 'month' }, { name: '本月', value: 'month' },
{ name: '全年', value: 'year' }, { name: '全年', value: 'year' },
], ],
dialogShow: false
} }
}, },
mounted () { mounted () {
...@@ -126,17 +135,20 @@ export default { ...@@ -126,17 +135,20 @@ export default {
dateType dateType
} } = this, } } = this,
params = { params = {
allYear: dateType == 'year'
} }
if (e == 'dateType') this.date = [] if (e == 'dateType') this.date = []
if (dateType == 'year') { let { startDate, endDate } = dateGroup.find(i => i.value == dateType)
params.allYear = true params.startDate = startDate
} else { params.endDate = endDate
let { startDate, endDate } = dateGroup.find(i => i.value == dateType) // this.$emit('search', {
params.startDate = startDate // allYear: false,
params.endDate = endDate // startDate: '2024-10-01',
} // endDate: '2024-12-31'
// })
this.$emit('search', params) this.$emit('search', params)
}, },
} }
} }
</script> </script>
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import SearchBox from '../SearchBox' import SearchBox from '../SearchBox'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { getMerchantOutputDetail } from '@api/earlyWarningManager'
import dayjs from 'dayjs'
import { tooltipConfig } from '../chartConfig'
export default { export default {
components: { components: {
SearchBox SearchBox
...@@ -29,48 +32,64 @@ export default { ...@@ -29,48 +32,64 @@ export default {
}, },
data () { data () {
return { return {
chart: null chart: null,
searchTime: {},
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
async getBoardData (params) { async getBoardData (params) {
this.searchTime = params
this.getMerchantOutputDetail()
},
async getMerchantOutputDetail () {
let { businessType, queryType } = this.pageData,
{ searchTime } = this
const res = await getMerchantOutputDetail({
businessType,
queryType,
...searchTime
})
console.log(params)
this.chart = echarts.init(document.getElementById(this.pageData.pageId)) this.chart = echarts.init(document.getElementById(this.pageData.pageId))
this.drawChart() this.drawChart(res, queryType)
}, },
drawChart () { drawChart (list, queryType) {
let { pageData } = this let { pageData } = this,
let base = +new Date(2001, 0, 1); data = [],
let oneDay = 1000 * 3600 * 24; //1-产值,2-客单价,3-订单数,4-引流率,5-转化率,6-展业门店数,7-店均产值,8-交车数,9-触客数)
let data = [[base, Math.random() * 300]]; queryKey = {
for (let i = 1; i < 5000; i++) { 1: 'output',
let now = new Date((base += oneDay)); 6: 'storeNum',
data.push([+now, Math.round((Math.random() - 0.5) * 20 + data[i - 1][1])]); 2: 'customerPrice',
} 7: 'storeAverageOutput',
8: 'deliveryNumber',
9: 'touchCustomers'
}[queryType]
list.map(e => {
// if (!e[queryKey]) e[queryKey] = Math.round(Math.random() * 10000)
data.push([dayjs(e.countDate).format("YYYY-MM-DD"), e[queryKey] || 0])
})
let option = { let option = {
tooltip: { tooltip: {
trigger: 'axis', ...tooltipConfig,
position: function (point, params, dom, rect, size) { // 解决tooltip在最右侧时部分被遮挡
let obj = {};
if (point[0] > size.viewSize[0] / 2) { // 鼠标位置位于echarts容器的一半位置右侧时,提示框显示在左侧
obj['left'] = point[0] - size.contentSize[0] - 20;
} else {
obj['right'] = size.viewSize[0] - size.contentSize[0] * 2;
}
if (point[1] > size.viewSize[1] / 2) { // 鼠标位置位于echarts容器的一半位置下侧时,提示框显示在上侧
obj['top'] = point[1] - size.contentSize[1] - 20;
} else {
obj['bottom'] = size.viewSize[1] - size.contentSize[1] * 2;
}
return obj;
},
formatter: params => { formatter: params => {
// console.log(params) let [item] = params,
let str = ''; { allYear } = this.searchTime
return str; if (!item) return
let { dataIndex, axisValue } = item,
{ output, customerPrice, orderNumber, drainageRate, conversionRate } = list[dataIndex]
return `
${dayjs(axisValue).format(allYear ? 'YYYY-MM' : 'YYYY-MM-DD')}<br>
<div class="tooltips">
<i class="circle"></i>产值:${output?.toLocaleString() || 0}<br>
客单价:${customerPrice?.toLocaleString() || 0}<br>
订单数:${orderNumber || 0}<br>
触客率:${drainageRate || 0}%<br>
转化率:${conversionRate || 0}%</div>`;
} }
}, },
title: { title: {
...@@ -78,22 +97,35 @@ export default { ...@@ -78,22 +97,35 @@ export default {
text: `${pageData.name}趋势图` text: `${pageData.name}趋势图`
}, },
grid: { grid: {
left: '50', left: '80',
right: '30' right: '60',
bottom: '80'
}, },
xAxis: { xAxis: {
type: 'time', type: 'time',
boundaryGap: false boundaryGap: false,
splitLine: {
show: false
},
axisLabel: {
showMaxLabel: true,
formatter: function (value, index) {
return dayjs(value).format('MM/DD')
}
}
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
boundaryGap: [0, '100%'] boundaryGap: [0, '100%'],
axisLine: {
show: false
}
}, },
dataZoom: [ dataZoom: [
{ {
type: 'inside', type: 'inside',
start: 0, start: 0,
end: 20 end: 100
}, },
{ {
start: 0, start: 0,
...@@ -102,10 +134,12 @@ export default { ...@@ -102,10 +134,12 @@ export default {
], ],
series: [ series: [
{ {
name: 'Fake Data',
type: 'line', type: 'line',
symbol: 'none', symbol: 'none',
data: data data: data,
lineStyle: {
color: '#185EFE'
}
} }
] ]
}; };
...@@ -130,6 +164,21 @@ export default { ...@@ -130,6 +164,21 @@ export default {
.line-chart { .line-chart {
width: 100%; width: 100%;
height: 393px; height: 393px;
::v-deep.tooltips {
padding-left: 20px;
position: relative;
}
::v-deep.circle {
position: absolute;
top: 7px;
left: 6px;
width: 6px;
height: 6px;
border: 1px solid #ffffff;
background: #2a58ad;
display: block;
border-radius: 100%;
}
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
export const tooltipConfig = {
trigger: 'axis',
borderColor: '#fff',
backgroundColor: '#fff',
padding:8,
textStyle: {
color: '#656565',
fontSize: 12
},
extraCssText: 'box-shadow: 0 2px 8px 0 #00000026;',
// position: function (point, params, dom, rect, size) { // 解决tooltip在最右侧时部分被遮挡
// let obj = {};
// if (point[0] > size.viewSize[0] / 2) { // 鼠标位置位于echarts容器的一半位置右侧时,提示框显示在左侧
// obj['left'] = point[0] - size.contentSize[0] - 20;
// } else {
// obj['right'] = size.viewSize[0] - size.contentSize[0] * 2;
// }
// if (point[1] > size.viewSize[1] / 2) { // 鼠标位置位于echarts容器的一半位置下侧时,提示框显示在上侧
// obj['top'] = point[1] - size.contentSize[1] - 20;
// } else {
// obj['bottom'] = size.viewSize[1] - size.contentSize[1] * 2;
// }
// return obj;
// }
}
\ No newline at end of file \ No newline at end of file
<template>
<div class="behavior-layout">
<el-carousel
:autoplay="false"
indicator-position="none"
:loop="false"
class="staff-list"
:height="'209px'"
v-if="staffList.length"
>
<template v-for="(item,index) in staffList">
<el-carousel-item
:key="index"
class="staff-flex"
>
<template v-for="(i,ind) in item">
<div
:key="ind"
class="staff-item"
>
<div
class="new"
v-if="i.isNewemployee"
>新人</div>
<div class="name-box">
<div class="name text-hide">{{i.staffName || '-'}}</div>
<div class="join">{{i.entryTime}}</div>
</div>
<template v-for="(e,eind) in stageList">
<div
:key="eind"
class="stage-list"
>
<div class="stage-title">{{`第${eind + 1}阶段`}}</div>
<div class="stage-box">
<template v-for="(k,kind) in e">
<div
class="stage-item"
:key="`${eind}_${k.key}`"
>
<div class="stage-label">{{k.label}}</div>
<div
class="stage-value"
@click="fastSearch(i.staffId, eind, kind )"
>{{formatStageValue(i[k.key] || 0)}}</div>
</div>
</template>
</div>
</div>
</template>
</div>
</template>
</el-carousel-item>
</template>
</el-carousel>
<div class="table">
<div class="table-title">行为预警明细</div>
<behavior-table
v-if="initStatus"
:searchTime="searchTime"
:pageData="pageData"
ref="behaviorTable"
/>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import BehaviorTable from './BehaviorTable.vue'
import { getPersonStaffWarning } from '@api/earlyWarningManager'
import onShowMixin from '../onShowMixin'
import dayjs from 'dayjs'
export default {
mixins: [onShowMixin],
components: {
BehaviorTable
},
name: '',
data () {
return {
staffList: [],
stageList: this.generateStageList(2)
}
},
mounted () {
},
methods: {
async getData () {
this.staffList = []
let { businessType, merchantId } = this.pageData
const res = await getPersonStaffWarning({
...this.searchTime,
merchantId,
businessType
})
if (res && res.length) {
res.map(e => {
e.entryTime = e.entryTime ? `${dayjs(e.entryTime).format('YYYY-MM')}入职` : '-'
})
this.staffList = this.chunkArray(res)
}
},
chunkArray (array, size = 4) {
const result = [];
for (let i = 0; i < array.length; i += size) {
const chunk = array.slice(i, i + size);
result.push(chunk);
}
return result;
},
generateStageList (numStages) {
const labels = ['待处理', '预约处理', '已完成'];
const stages = [];
for (let i = 1; i <= numStages; i++) {
const stage = labels.map((label, index) => ({
label,
key: `stage${i}${index === 0 ? 'todo' : index === 1 ? 'prebook' : 'finished'}`
}));
stages.push(stage);
}
return stages;
},
formatStageValue (val) {
if (val > 99) val = '99+'
return val
},
fastSearch (staffId, stage, statusList) {
this.$refs.behaviorTable.searchForm.staffId = staffId
this.$refs.behaviorTable.searchForm.stage = stage + 1
this.$refs.behaviorTable.searchForm.statusList = [statusList + 1]
this.$refs.behaviorTable.keyDowmGetList()
}
}
}
</script>
<style scoped lang='scss'>
.behavior-layout {
.staff-list {
padding: 0 20px;
::v-deep.el-carousel__arrow {
width: 30px;
height: 30px;
background: #fff;
color: #333;
opacity: 1;
box-shadow: 0 2px 6px 0 #10101014;
}
::v-deep.el-carousel__arrow--left {
left: 0;
// &::after {
// position: absolute;
// left: 0;
// top: 50%;
// transform: translateY(-50%);
// content: '';
// width: 17px;
// height: 209px;
// border-radius: 8px;
// opacity: 1;
// background: linear-gradient(to left, #20202000 0%, #20202026 100%);
// }
}
::v-deep.el-carousel__arrow--right {
right: 0;
}
.staff-flex {
display: flex;
gap: 0 16px;
.staff-item {
width: 25%;
height: 100%;
background: #fafafa;
border-radius: 4px;
position: relative;
padding: 20px;
box-sizing: border-box;
.stage-list {
padding-top: 24px;
.stage-title {
opacity: 0.5;
color: #202020;
font-size: 12px;
line-height: 15px;
margin-bottom: 8px;
}
.stage-box {
display: flex;
align-items: center;
gap: 0 12px;
justify-content: space-between;
}
.stage-item {
display: flex;
align-items: center;
.stage-label {
color: #202020;
font-size: 14px;
}
.stage-value {
color: #2a58ad;
font-size: 14px;
font-weight: 700;
margin-left: 4px;
cursor: pointer;
}
}
}
.new {
position: absolute;
width: 40px;
height: 20px;
background: #e8ffea;
top: 20px;
right: 20px;
font-size: 12px;
color: #00b42a;
line-height: 20px;
text-align: center;
}
.name-box {
display: flex;
align-items: flex-end;
.name {
max-width: 120px;
color: inherit;
font-size: 20px;
font-weight: 700;
line-height: 29px;
}
.join {
color: #20202080;
font-size: 12px;
line-height: 15px;
margin-left: 8px;
}
}
}
}
}
.table {
box-sizing: border-box;
padding: 32px 20px 0;
&-title {
color: #000000d9;
font-size: 14px;
font-weight: 500;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="behavior-layout">
<el-carousel
:autoplay="false"
indicator-position="none"
:loop="false"
class="staff-list"
:height="'253px'"
v-if="staffList.length"
>
<template v-for="(i,index) in staffList">
<el-carousel-item
:key="index"
class="staff-flex"
>
<template v-for="(i,ind) in i">
<div
:key="ind"
class="staff-item"
>
<div
class="new"
v-if="i.isNewemployee"
>新人</div>
<div class="name-box">
<div class="name text-hide">{{i.staffName || '-'}}</div>
<div class="join">{{i.entryTime}}</div>
</div>
<template v-for="(e,eind) in infoList">
<div
class="info-box"
:key="eind"
>
<template v-for="k in e">
<div
class="info-item"
:key="`${eind}_${k.key}`"
>
<div class="info-label">{{k.label}}</div>
<div class="info-value">{{i[k.key] || 0}}{{k.keyUnit||''}}</div>
<div :class="['info-percent',`${percentColor(i[k.percentSJ])}`]">
环比<span>{{i[k.percent] ? formatted(i[k.percent]) : '-'}}</span>
<template v-if="i[k.percent] && i[k.percent] != '-'">
<div :class="['icon',`${percentClass(i[k.percentSJ])}`]"></div>
</template>
</div>
</div>
</template>
</div>
</template>
</div>
</template>
</el-carousel-item>
</template>
</el-carousel>
<div class="table">
<div class="table-title">接待明细</div>
<reception-table
v-if="initStatus"
:searchTime="searchTime"
:pageData="pageData"
:show="show"
@openReceptionDialog="$emit('openReceptionDialog',$event)"
/>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import ReceptionTable from './ReceptionTable.vue'
import { getPersonStaffReception } from '@api/earlyWarningManager'
import onShowMixin from '../onShowMixin'
import dayjs from 'dayjs'
export default {
mixins: [onShowMixin],
components: {
ReceptionTable
},
name: '',
data () {
return {
staffList: [],
infoList: [
[
{
label: '接待数',
key: 'receptionNum',
percent: 'receptionNumhb',
percentSJ: 'receptionNumhbsj'
},
{
label: '成交数',
key: 'succeedNum',
percent: 'succeedNumhb',
percentSJ: 'succeedNumhbsj'
},
{
label: '转化率',
key: 'zhuanhuanlv',
keyUnit:'%',
percent: 'zhuanhuanlvhb',
percentSJ: 'zhuanhuanlvhbsj'
}
],
[
{
label: '质检平均分',
key: 'avgzj',
percent: 'avgzjhb',
percentSJ: 'avgzjhbsj'
},
{
label: '攻防平均分',
key: 'avggf',
percent: 'avggfhb',
percentSJ: 'avggfhbsj'
},
]
]
}
},
mounted () {
},
methods: {
async getData () {
this.staffList = []
let { businessType, merchantId } = this.pageData
const res = await getPersonStaffReception({
...this.searchTime,
merchantId,
businessType
})
if (res && res.length) {
res.map(e => {
e.entryTime = e.entryTime ? `${dayjs(e.entryTime).format('YYYY-MM')}入职` : '-'
})
this.staffList = this.chunkArray(res)
}
},
chunkArray (array, size = 4) {
const result = [];
for (let i = 0; i < array.length; i += size) {
const chunk = array.slice(i, i + size);
result.push(chunk);
}
return result;
},
formatted (num) {
return num != '-' ? num + '%' : '-'
},
percentClass (num) {
if (num > 0) {
return 'el-icon-caret-top'
} else if (num == 0) {
return 'minus'
} else if (num < 0) {
return 'el-icon-caret-bottom'
} else {
return ''
}
},
percentColor (num) {
if (num > 0) {
return 'red'
} else if (num < 0) {
return 'green'
} else {
return ''
}
}
}
}
</script>
<style scoped lang='scss'>
.behavior-layout {
.staff-list {
padding: 0 20px;
::v-deep.el-carousel__arrow {
width: 30px;
height: 30px;
background: #fff;
color: #333;
opacity: 1;
box-shadow: 0 2px 6px 0 #10101014;
}
::v-deep.el-carousel__arrow--left {
left: 0;
}
::v-deep.el-carousel__arrow--right {
right: 0;
}
.staff-flex {
display: flex;
gap: 0 16px;
.staff-item {
width: 25%;
height: 100%;
background: #fafafa;
border-radius: 4px;
position: relative;
padding: 20px;
box-sizing: border-box;
.new {
position: absolute;
width: 40px;
height: 20px;
background: #e8ffea;
top: 20px;
right: 20px;
font-size: 12px;
color: #00b42a;
line-height: 20px;
text-align: center;
}
.name-box {
display: flex;
align-items: flex-end;
.name {
max-width: 120px;
color: inherit;
font-size: 20px;
font-weight: 700;
line-height: 29px;
}
.join {
color: #20202080;
font-size: 12px;
line-height: 15px;
margin-left: 8px;
}
}
.info-box {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 24px;
.info-label,
.info-percent {
color: #20202080;
font-size: 12px;
line-height: 15px;
display: flex;
align-items: center;
}
.info-value {
color: #202020;
font-size: 16px;
font-weight: 700;
line-height: 19px;
margin: 8px 0;
}
}
}
}
}
.table {
box-sizing: border-box;
padding: 32px 20px 0;
&-title {
color: #000000d9;
font-size: 14px;
font-weight: 500;
}
}
.green {
span,
.icon {
color: #43cf7c;
}
}
.red {
span,
.icon {
color: #eb4e4e;
}
}
.minus {
width: 7.5px;
height: 2.5px;
border-radius: 0.6px;
background: #20202080;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 预警明细 -->
<template>
<!-- <div> -->
<div>
<div class="header">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
label-width="100px"
/>
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>
查询
</el-button>
<el-button
size="small"
@click="handleReset"
>
重置
</el-button>
</div>
</div>
<!-- </div> -->
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table
ref="recepDetail"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
>
<div
slot="auth-button"
slot-scope="scope"
>
<el-button
type="text"
@click="handleDetail(scope.scope)"
>接待详情</el-button>
</div>
</d2-table>
</div>
</div>
<!-- </div> -->
</template>
<script>
import { downLoadFile } from '@/common/util'
import { getReceptionDetailPage, getReceptionDetailReport, getReceptionStaffList } from '@api/earlyWarningManager'
export default {
name: 'Details',
props: {
searchTime: {
type: Object,
default: () => { }
},
pageData: {
type: Object,
default: () => { }
},
show: Boolean
},
watch: {
show: {
async handler (newVal) {
if (newVal) {
if (!this.initStatus || this.searchTimeStatus) {
if (!this.initStatus) await this.getReceptionStaffList()
if (this.searchTimeStatus) this.timerSearch()
this.initStatus = true
}
}
},
immediate: true,
deep: true
},
searchTime (n) {
if (this.initStatus) {
if (this.show) this.timerSearch()
else this.searchTimeStatus = true
}
}
},
data () {
return {
initStatus: false,
searchTimeStatus: false,
searchForm: {
orderFinishFlag: null,
staffUUid: null
},
showFormData: [{
label: '驻店人员',
name: 'staffUUid',
type: 'select',
isClear: true,
optionList: [],
optionId: 'staffId',
optionLabel: 'staffName',
}, {
label: '成交结果',
name: 'orderFinishFlag',
type: 'select',
isClear: true,
optionList: [
{
confId: null,
confValue: '全部'
},
{
confId: '1',
confValue: '是'
},
{
confId: '0',
confValue: '否'
}
],
optionId: 'confId',
optionLabel: 'confValue',
}],
getListApi: getReceptionDetailPage,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// tableOption: true,
tableOption: { width: '150px' },
tableColumns: [
{
label: '驻店人员',
prop: 'employeeName',
width: '150'
}, {
label: '接待日期',
prop: 'receptionDate',
width: '100'
}, {
label: '客户姓名',
prop: 'customerName',
}, {
label: '车型',
prop: 'carModel',
}, {
label: 'APP接待结果',
width: '130',
formatter (row) {
let result = {
1: "成交",
0: "战败"
}[row.receptionStatus]
return result || "-"
}
}, {
label: '关联订单成交',
prop: 'orderFinishFlag',
width: '130',
formatter (row) {
return row.orderFinishFlag ? '成交' : '战败'
}
}, {
label: '质检评分',
prop: "score",
}, {
label: '攻防评分',
prop: "defencePoint",
}, {
label: '客户类型识别',
prop: "customerTypeName",
width: '130',
}, {
label: '开始接待时间',
width: '150',
prop: "startTime"
}, {
label: '结束接待时间',
width: '150',
prop: "endTime"
}, {
label: '接待时长',
width: '130',
prop: "seconds",
}, {
label: '安心包是否开口',
prop: "axbOpenFlag",
width: 130,
formatter (row) {
return row.axbOpenFlag ? "是" : "否"
}
},
{
label: '安心包是否成交',
prop: "isFinishFlag",
width: 130,
formatter (row) {
return row.finishFlag ? "是" : "否"
}
}
]
},
}
},
computed: {
},
mounted () {
},
methods: {
timerSearch () {
this.searchForm.staffUUid = ''
this.getReceptionStaffList()
this.$refs.detailListTable.refreshTable()
this.searchTimeStatus = false
},
async getReceptionStaffList () {
await this.beforeSearchFn()
let params = JSON.parse(JSON.stringify(this.searchForm))
delete params.staffUUid
delete params.orderFinishFlag
const res = await getReceptionStaffList({
currentPage: 1,
pageSize: 99999,
...params
})
this.showFormData[0].optionList = res
},
beforeSearchFn () {
return new Promise(resolve => {
let { startDate, endDate } = this.searchTime,
{ businessType, merchantId } = this.pageData
this.searchForm.startTime = startDate
this.searchForm.endTime = endDate
//业务场景 1.延保 2.轻改 3.权益
this.searchForm.bussinessType = {
2: 2,
3: 3,
4: 1
}[businessType]//传过来的businessType 归属业务(2-轻改,3-权益,4-延保)
this.searchForm.merchantNo = merchantId
resolve()
})
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.$refs.detailListTable.refreshTable()
},
async handleExport () {
await this.beforeSearchFn()
let params = this.searchForm
console.log(params)
getReceptionDetailReport(params).then((res) => {
res && downLoadFile(res)
})
},
handleDetail (row) {
const list = this.$refs.recepDetail.data,
currentNum = list.findIndex((e) => e.id == row.id)
this.$emit('openReceptionDialog', {
qualityDetailList: list,
isQualityVisible: true,
currentNum
})
},
closeDialog () {
// this.$refs.qualityDetail.onPageHide()
this.isQualityVisible = false
// this.onPageShow()
},
}
}
</script>
<style lang="scss" scoped>
.m-t-40 {
margin-top: 40px;
}
@mixin priorityBase {
// margin-left: auto;
width: 32px;
border-radius: 239px;
font-size: 14px;
text-align: center;
margin-right: 8px;
display: inline-block;
}
.priority-one {
@include priorityBase();
border: 1px solid #eb4e4e;
color: #eb4e4e;
}
.priority-two {
@include priorityBase();
border: 1px solid #ff8d1a;
color: #ff8d1a;
}
.priority-three {
@include priorityBase();
border: 1px solid #ffc300;
color: #ffc300;
}
@mixin stageBase {
width: 80px;
border-radius: 239px;
font-size: 14px;
text-align: center;
display: inline-block;
}
.stage-one {
@include stageBase();
border: 1px solid #ff8d1a;
background: #ff8d1a1a;
color: #ff8d1a;
}
.stage-two {
@include stageBase();
border: 1px solid #eb4e4e;
background: #eb4e4e1a;
color: #eb4e4e;
}
@mixin typeBase {
width: 52px;
border-radius: 239px;
opacity: 1;
font-size: 14px;
text-align: center;
line-height: 24px;
display: inline-block;
}
.type-yellow {
@include typeBase();
background: #ff8d1a1a;
color: #ff8d1a;
}
.type-blue {
@include typeBase();
background: #5850ff1a;
color: #5850ff;
}
.type-green {
@include typeBase();
background: #43cf7c1a;
color: #43cf7c;
}
.d2-container-content {
padding-bottom: 16px;
&::before {
height: 16px;
background: #eff3f6;
content: "";
display: block;
width: calc(100% + 40px);
margin-left: -20px;
}
}
.dialog {
width: 100vw;
height: 100vh;
}
</style>
...@@ -10,8 +10,11 @@ ...@@ -10,8 +10,11 @@
:key="i.id" :key="i.id"
:is="i.componentName" :is="i.componentName"
v-show="activeName == i.id" v-show="activeName == i.id"
:show="activeName == i.id" :show="activeName == i.id && show"
:pageId="`human-${pageId}`" :pageId="`human-${pageId}`"
:searchTime="searchTime"
:pageData="pageData"
@openReceptionDialog="$emit('openReceptionDialog',$event)"
/> />
</template> </template>
</div> </div>
...@@ -20,17 +23,30 @@ ...@@ -20,17 +23,30 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import Tab from '../Tab' import Tab from '../Tab'
import Output from './Output.vue' import Output from './Output.vue'
import Behavior from './Behavior.vue'
import Reception from './Reception.vue'
export default { export default {
components: { components: {
Tab, Tab,
Output Output,
Behavior,
Reception
}, },
props: { props: {
pageId: { pageId: {
type: String, type: String,
default: '' default: ''
}, },
show: Boolean show: Boolean,
searchTime: {
type: Object,
default: () => { }
},
pageData: {
type: Object,
default: () => { }
},
}, },
name: '', name: '',
watch: { watch: {
...@@ -49,19 +65,19 @@ export default { ...@@ -49,19 +65,19 @@ export default {
}, },
{ {
label: '行为分析', label: '行为分析',
componentName: 'OutputLine', componentName: 'Behavior',
id: '2', id: '2',
}, },
{ {
label: '接待分析', label: '接待分析',
componentName: 'OutputLine', componentName: 'Reception',
id: '3', id: '3',
}, },
{ // {
label: '人员变动', // label: '人员变动',
componentName: 'OutputLine', // componentName: 'OutputLine',
id: '4', // id: '4',
}, // },
] ]
} }
}, },
......
...@@ -9,14 +9,15 @@ ...@@ -9,14 +9,15 @@
<el-form-item label="驻店人员:"> <el-form-item label="驻店人员:">
<el-select <el-select
class="select" class="select"
v-model="form.staffId" v-model="form.staffIds"
@change="change" @change="getProductOutputtrend"
clearable
> >
<el-option <el-option
v-for="item in staffList" v-for="item in staffList"
:key="item.value" :key="item.staffid"
:label="item.name" :label="item.staffName"
:value="item.value" :value="item.staffid"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -31,46 +32,81 @@ ...@@ -31,46 +32,81 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { getProductOutputtrend, getProductStaffList } from '@api/earlyWarningManager'
import onShowMixin from '../onShowMixin'
import { tooltipConfig } from '../../chartConfig'
export default { export default {
mixins: [onShowMixin],
name: '', name: '',
props: {
pageId: {
type: String,
default: ''
},
show: Boolean
},
data () { data () {
return { return {
form: {}, form: {
staffIds: ''
},
staffList: [] staffList: []
} }
}, },
watch: {
show (val) {
if (val) {
this.chart = echarts.init(document.getElementById(this.pageId))
this.drawChart()
}
}
},
mounted () { mounted () {
}, },
methods: { methods: {
change () { }, async getData () {
drawChart () { this.form = this.$options.data.call(this).form
const dataCount = 20; this.getProductOutputtrend()
const data = generateData(dataCount); this.getProductStaffList()
},
async getProductStaffList () {
let { businessType, merchantId } = this.pageData
const res = await getProductStaffList({
merchantId,
businessType,
...this.searchTime
})
this.staffList = res || []
},
async getProductOutputtrend () {
let { businessType, merchantId } = this.pageData
const res = await getProductOutputtrend({
merchantId,
businessType,
...this.form,
...this.searchTime
})
this.$nextTick(() => {
if (!this.chart) this.chart = echarts.init(document.getElementById(this.pageId))
this.drawChart(res)
})
},
drawChart (list) {
this.chart.clear()
let categoryData = [],
valueData = []
list.map(e => {
categoryData.push(e.goodsname)
valueData.push(e.output || 0)
})
let data = {
categoryData,
valueData
}
let option = { let option = {
title: { title: {
text: '销售额趋势', text: '销售额趋势',
left: 20 left: 20
}, },
tooltip: { tooltip: {
trigger: 'axis', ...tooltipConfig,
axisPointer: { formatter: params => {
type: 'shadow' let [item] = params
if (!item) return
let { dataIndex, axisValue } = item,
{ output, atv, ordernum } = list[dataIndex]
return `
${axisValue}<br>
<div class="tooltips">
<i class="circle"></i>产值:${output?.toLocaleString() || 0}<br>
客单价:${atv?.toLocaleString() || 0}<br>
订单数:${ordernum || 0}`;
} }
}, },
grid: { grid: {
...@@ -94,11 +130,17 @@ export default { ...@@ -94,11 +130,17 @@ export default {
}, },
splitArea: { splitArea: {
show: false show: false
},
axisLabel: {
showMaxLabel: true
} }
}, },
yAxis: { yAxis: {
splitArea: { splitArea: {
show: false show: false
},
axisLine: {
show: false
} }
}, },
series: [ series: [
...@@ -109,32 +151,6 @@ export default { ...@@ -109,32 +151,6 @@ export default {
} }
] ]
}; };
function generateData (count) {
let baseValue = Math.random() * 1000;
let time = +new Date(2011, 0, 1);
let smallBaseValue;
function next (idx) {
smallBaseValue =
idx % 30 === 0
? Math.random() * 700
: smallBaseValue + Math.random() * 500 - 250;
baseValue += Math.random() * 20 - 10;
return Math.max(0, Math.round(baseValue + smallBaseValue) + 3000);
}
const categoryData = [];
const valueData = [];
for (let i = 0; i < count; i++) {
categoryData.push(
echarts.format.formatTime('yyyy-MM-dd\nhh:mm:ss', time, false)
);
valueData.push(next(i).toFixed(2));
time += 1000;
}
return {
categoryData: categoryData,
valueData: valueData
};
}
option && this.chart.setOption(option) option && this.chart.setOption(option)
} }
...@@ -152,6 +168,21 @@ export default { ...@@ -152,6 +168,21 @@ export default {
.line-chart { .line-chart {
width: 100%; width: 100%;
height: 348px; height: 348px;
::v-deep.tooltips {
padding-left: 20px;
position: relative;
}
::v-deep.circle {
position: absolute;
top: 7px;
left: 6px;
width: 6px;
height: 6px;
border: 1px solid #ffffff;
background: #2a58ad;
display: block;
border-radius: 100%;
}
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
:key="i.id" :key="i.id"
:is="i.componentName" :is="i.componentName"
v-show="activeName == i.id" v-show="activeName == i.id"
:show="activeName == i.id" :show="activeName == i.id && show"
:pageId="`product-${pageId}`" :pageId="`product-${pageId}`"
:searchTime="searchTime"
:pageData="pageData"
/> />
</template> </template>
</div> </div>
...@@ -30,6 +32,14 @@ export default { ...@@ -30,6 +32,14 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
pageData: {
type: Object,
default: () => { }
},
searchTime: {
type: Object,
default: () => { }
},
show: Boolean show: Boolean
}, },
name: '', name: '',
......
<template>
<div :class="i.class">
<div class="title">
{{ i.title
}}<span>
<template v-if="i.class == 'arrow'">
{{ boardData[i.valueKey] }}%
</template>
<template v-else>
<template v-if="i.abnormalKey">
({{
{
0: "正常",
1: "异常"
}[boardData[i.abnormalKey]]
}})
</template>
</template>
</span>
</div>
<template v-if="i.class == 'block'">
<div class="value">
{{ boardData[i.valueKey]}}<template v-if="i.lastValueKey"><span>({{ boardData[i.lastValueKey] }})</span></template>
</div>
</template>
<div class="percent">
环比<span>{{ boardData[i.percentKey] }}%</span>
<template v-if="boardData[i.percentKey] && boardData[i.percentKey] != '-'">
<div :class="['icon',`${percentClass(boardData[i.percentKey])}`]"></div>
</template>
</div>
<template v-if="i.hasAdd">
<div class="add">
</div>
</template>
<template v-if="i.hasEqual">
<div class="equal">
</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
export default {
props: {
i: {
type: Object,
default: () => { }
},
boardData: {
type: Object,
default: () => { }
}
},
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
percentClass (num) {
if (num > 0) {
return 'el-icon-top'
} else if (num == 0) {
return 'minus'
} else if (num < 0) {
return 'el-icon-bottom'
} else {
return ''
}
},
}
}
</script>
<style scoped lang="scss">
.block {
position: relative;
width: 100%;
height: 68px;
border-radius: 8px;
background: rgb(246, 252, 254);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.title {
line-height: 17px;
font-size: 12px;
color: #5a5e66;
display: flex;
align-items: center;
margin-bottom: 2px;
span {
font-size: 10px;
}
}
.value {
color: rgb(52, 123, 255);
font-size: 16px;
font-weight: 500;
line-height: 16px;
display: flex;
align-items: center;
margin-bottom: 3px;
span {
font-size: 12px;
font-weight: 400;
line-height: 12px;
color: #f24724b3;
}
}
.percent {
color: #999ea8;
font-size: 10px;
font-weight: 500;
line-height: 14px;
span {
font-size: 12px;
font-weight: 400;
line-height: 12px;
}
}
}
.arrow {
position: relative;
width: 54.33%;
height: 54px;
background-image: url("@/assets/funnel-arrow.png");
background-size: 100% 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.title {
color: #347bff;
font-size: 10px;
font-weight: 500;
line-height: 14px;
display: flex;
align-items: center;
span {
font-size: 12px;
line-height: 12px;
}
}
.percent {
color: #999ea8;
font-size: 10px;
font-weight: 500;
line-height: 14px;
span {
font-size: 12px;
font-weight: 400;
line-height: 12px;
}
}
}
.add {
position: absolute;
top: 50%;
left: -9.24%;
transform: translateY(-50%);
width: 9.24%;
aspect-ratio: 1/1;
background-image: url("@/assets/funnel+.png");
background-size: 100% 100%;
}
.equal {
position: absolute;
top: 50%;
left: -9.24%;
transform: translateY(-50%);
width: 9.24%;
aspect-ratio: 1/1;
background-image: url("@/assets/funnel=.png");
background-size: 100% 100%;
}
.minus {
width: 7.5px;
height: 2.5px;
border-radius: 0.6px;
background: #F24724;
}
.el-icon-top{
color: #F24724;
}
.el-icon-bottom{
color: #35C376;
}
</style>
<template>
<baseDialog
:is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
class="dialog"
>
<div
class="dialog-content"
v-html="businessType == 2 ? content[1] : content[0]"
>
</div>
</baseDialog>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
props: {
show: Boolean,
businessType: [String, Number]
},
data () {
return {
dialogShow: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: true,
},
config: {
title: "帮助",
width: "720px"
}
},
content: [
`渗透率:当前门店+业务+统计周期下,总成交数/新车交付数。<br>
新车交付数:当前门店+业务+统计周期下,全部新车交付数之和。<br>
引流率:当前门店+业务+统计周期下,触客数(售前)/新车交付数。<br>
触客数(售前):当前门店+业务+统计周期下,全部触客数(售前)之和。<br>
触客数(售后):当前门店+业务+统计周期下,全部触客数(售后)之和。<br>
总触客数:当前门店+业务+统计周期下,全部触客数之和。<br>
成交数(售前):当前门店+业务+统计周期下,售前流量成交的订单数。<br>
成交数(售后):当前门店+业务+统计周期下,售后流量成交的订单数。<br>
总成交数:当前门店+业务+统计周期下,成交的总订单数。<br>
售前转化率:当前门店+业务+统计周期下,成交数(售前)/触客数(售前)。<br>
售后转化率:当前门店+业务+统计周期下,成交数(售后)/触客数(售后)。<br>
转化率:当前门店+业务+统计周期下,总成交数/总触客数。`,
`新车交付数:当前门店+业务+统计周期下,全部新车交付数之和。<br>
引流率:当前门店+业务+统计周期下,触客台次/新车交付数。<br>
触客台次:当前门店+业务+统计周期下,全部触客台次之和。<br>
转化率:当前门店+业务+统计周期下,总成交数/触客台次。<br>
总成交量:当前门店+业务+统计周期下,成交的总订单数`
]
}
},
watch: {
show (n) {
this.dialogShow = n
},
dialogShow (n) {
this.$emit('update:show', n)
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.dialog {
&-content {
padding: 5px 0;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -11,81 +11,90 @@ ...@@ -11,81 +11,90 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import dayjs from 'dayjs'
import {tooltipConfig} from '../../chartConfig'
export default { export default {
name: '', name: '',
props: { props: {
pageId: { pageId: {
type: String, type: String,
default: '' default: ''
} },
outputTrend: {
type: Array,
default: () => []
},
show: Boolean
}, },
data () { data () {
return { return {
chart: null chart: null
} }
}, },
watch: {
outputTrend: {
immediate: true,
handler (newval) {
if (!this.show) return
this.chart = echarts.init(document.getElementById(this.pageId))
this.drawChart(newval)
}
}
},
mounted () { mounted () {
this.chart = echarts.init(document.getElementById(this.pageId))
this.drawChart()
}, },
methods: { methods: {
drawChart () { drawChart (list) {
let base = +new Date(2001, 0, 1); let data = []
let oneDay = 1000 * 3600 * 24; list.map(e => {
let data = [[base, Math.random() * 300]]; // if (!e.output) e.output = Math.round(Math.random() * 10000)
for (let i = 1; i < 5000; i++) { data.push([dayjs(e.countDate).format("YYYY-MM-DD"), e.output || 0])
let now = new Date((base += oneDay)); })
data.push([+now, Math.round((Math.random() - 0.5) * 20 + data[i - 1][1])]);
}
let option = { let option = {
tooltip: { tooltip: {
trigger: 'axis', ...tooltipConfig,
position: function (point, params, dom, rect, size) { // 解决tooltip在最右侧时部分被遮挡
let obj = {};
if (point[0] > size.viewSize[0] / 2) { // 鼠标位置位于echarts容器的一半位置右侧时,提示框显示在左侧
obj['left'] = point[0] - size.contentSize[0] - 20;
} else {
obj['right'] = size.viewSize[0] - size.contentSize[0] * 2;
}
if (point[1] > size.viewSize[1] / 2) { // 鼠标位置位于echarts容器的一半位置下侧时,提示框显示在上侧
obj['top'] = point[1] - size.contentSize[1] - 20;
} else {
obj['bottom'] = size.viewSize[1] - size.contentSize[1] * 2;
}
return obj;
},
formatter: params => { formatter: params => {
// console.log(params) let [item] = params
let str = ''; if (!item) return
return str; let { dataIndex } = item,
{ output, customerPrice, orderNumber, drainageRate, conversionRate } = list[dataIndex]
return `
产值:${output?.toLocaleString() || 0}<br>
客单价:${customerPrice?.toLocaleString() || 0}<br>
订单数:${orderNumber || 0}<br>
触客率:${drainageRate || 0}%<br>
转化率:${conversionRate || 0}%`;
} }
}, },
grid: { grid: {
left: '70', left: '70',
right: '50' right: '50',
bottom: '80'
}, },
xAxis: { xAxis: {
type: 'time', type: 'time',
boundaryGap: false boundaryGap: false,
splitLine: {
show: false
},
axisLabel: {
showMaxLabel: true,
formatter: function (value) {
return dayjs(value).format('MM/DD')
}
}
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
boundaryGap: [0, '100%'] boundaryGap: [0, '100%'],
}, axisLine: {
dataZoom: [ show: false
{
type: 'inside',
start: 0,
end: 20
},
{
start: 0,
end: 20
} }
], },
series: [ series: [
{ {
name: 'Fake Data', // name: 'Fake Data',
type: 'line', type: 'line',
symbol: 'none', symbol: 'none',
areaStyle: { areaStyle: {
...@@ -100,11 +109,13 @@ export default { ...@@ -100,11 +109,13 @@ export default {
} }
]) ])
}, },
data: data data: data,
lineStyle: {
color: '#185EFE'
}
} }
] ]
}; };
option && this.chart.setOption(option) option && this.chart.setOption(option)
} }
} }
......
...@@ -12,14 +12,23 @@ ...@@ -12,14 +12,23 @@
</template> </template>
</div> </div>
</div> </div>
<div class="store-chart"> <div class="store-chart">
<div class="funnel"> <div class="funnel">
<funnel /> <funnel
:businessType="pageData.businessType"
:boardData="boardData"
/>
</div> </div>
<div class="line"> <div class="line">
<line-chart :pageId="`store-${pageId}`" /> <line-chart
:pageId="`store-${pageId}`"
:outputTrend="boardData.outputTrend"
:show="show"
/>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
...@@ -27,22 +36,21 @@ ...@@ -27,22 +36,21 @@
import BoardItem from '../../shopGuardIndex/BoardItem' import BoardItem from '../../shopGuardIndex/BoardItem'
import Funnel from './Funnel' import Funnel from './Funnel'
import LineChart from './LineChart' import LineChart from './LineChart'
import { getMerchantBaseDetail } from '@/api/earlyWarningManager'
import onShowMixin from '../onShowMixin'
export default { export default {
mixins: [onShowMixin],
components: { components: {
BoardItem, BoardItem,
Funnel, Funnel,
LineChart LineChart
}, },
props: {
pageId: {
type: String,
default: ''
}
},
name: '', name: '',
data () { data () {
return { return {
boardData: {}, boardData: {
outputTrend: []
},
boardList: [ boardList: [
{ {
name: '总产值', name: '总产值',
...@@ -64,21 +72,34 @@ export default { ...@@ -64,21 +72,34 @@ export default {
}, },
{ {
name: '触客数', name: '触客数',
value: 'touchNum', value: 'touchCustomers',
percent: 'touchNumRatio', percent: 'touchCustomersRatio',
}, },
{ {
name: '转化数', name: '转化数',
value: 'touchNum', value: 'conversionNum',
percent: 'touchNumRatio', percent: 'conversionNumRatio',
}, },
] ],
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
async getData () {
const { merchantId, businessType } = this.pageData,
{ searchTime } = this
const res = await getMerchantBaseDetail({
merchantId,
businessType,
...searchTime
})
Object.keys(res).map(key => {
if (res[key] == null) res[key] = '-'
})
this.boardData = res
}
} }
} }
</script> </script>
......
...@@ -52,10 +52,12 @@ export default { ...@@ -52,10 +52,12 @@ export default {
color: #666666; color: #666666;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
transition: all .15s;
} }
.item-active { .item-active {
background-color: #fff; background-color: #fff;
color: #185efe; color: #2A58AD;
border-radius: 3px;
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -4,18 +4,54 @@ ...@@ -4,18 +4,54 @@
<div class="icon"></div> <div class="icon"></div>
<div class="info"> <div class="info">
<div class="merchant-name flex"> <div class="merchant-name flex">
恒河猴 {{baseInfo.merchantName}}
<div class="tag">自营</div> <div :class="['tag',{'grey':baseInfo.directSale == 0}]">{{
{
0:'非直营',
1:'直营'
}[baseInfo.directSale] }}</div>
</div> </div>
<div class="text flex"> <div class="text flex">
<div class="merchant-id">4456</div> <div class="merchant-id">{{baseInfo.merchantId}}</div>
<div class="year">2024.5展业</div> <div class="year">{{baseInfo.startBusiness}}</div>
<div class="supervision-name"> <div class="supervision-name flex">
<div class="supervision-icon"></div> <div class="supervision-icon"></div>
嚯嚯嚯 {{baseInfo.supervisionName}}
</div> </div>
</div> </div>
</div> </div>
<template v-if="pageData.showTips">
<div class="label-box">
<div class="label-tab flex">
<template v-for="(i,index) in labelList">
<div
:key="index"
:class="['label-tab-item flex',{active: index == labelIndex}]"
@click="labelIndex = index"
>
{{i.label}}
</div>
</template>
</div>
<div class="label-title flex">
<i class="el-icon-warning"></i>
异常{{labelList[labelIndex].label}}
</div>
<el-tooltip
placement="bottom-end"
popper-class="shop-tooltip"
>
<div
slot="content"
v-html="pageData[labelList[labelIndex].key]"
></div>
<div
class="two-line"
v-html="pageData[labelList[labelIndex].key]"
></div>
</el-tooltip>
</div>
</template>
</div> </div>
<div class="tab"> <div class="tab">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
...@@ -29,7 +65,7 @@ ...@@ -29,7 +65,7 @@
</div> </div>
<div class="search-component"> <div class="search-component">
<search-box <search-box
@search="getBoardData" @search="searchTime = $event"
:hasConfig="false" :hasConfig="false"
/> />
</div> </div>
...@@ -40,12 +76,23 @@ ...@@ -40,12 +76,23 @@
:key="i.id" :key="i.id"
:is="i.componentName" :is="i.componentName"
v-show="activeName == i.id" v-show="activeName == i.id"
:show="activeName == i.id" :show="activeName == i.id && show"
@openWindow="$emit('openWindow',$event)" @openWindow="$emit('openWindow',$event)"
:pageId="`${pageData.pageId}_${i.id}`" :pageId="`${pageData.pageId}_${i.id}`"
:pageData="pageData"
:searchTime="searchTime"
@openReceptionDialog="openReceptionDialog"
/> />
</template> </template>
</div> </div>
<quality-detail
v-if="isQualityVisible"
:is-quality-visible="isQualityVisible"
:currentNum="currentNum"
:qualityDetailList="qualityDetailList"
@closeDialog="closeDialog"
ref="qualityDetail"
></quality-detail>
</div> </div>
</template> </template>
...@@ -54,18 +101,22 @@ import Store from './Store/index' ...@@ -54,18 +101,22 @@ import Store from './Store/index'
import Human from './Human/index' import Human from './Human/index'
import Product from './Product/index' import Product from './Product/index'
import SearchBox from '../SearchBox' import SearchBox from '../SearchBox'
import { getMerchantBaseInfo } from '@api/earlyWarningManager'
import dayjs from 'dayjs'
import QualityDetail from "@/views/residentManage/components/qualityDetail.vue"
export default { export default {
components: { Store, Human, Product, SearchBox }, components: { Store, Human, Product, SearchBox, QualityDetail },
name: '', name: '',
props: { props: {
pageData: { pageData: {
type: Object, type: Object,
default: () => { } default: () => { }
} },
show: Boolean
}, },
data () { data () {
return { return {
activeName: '1', activeName: '',
tabList: [ tabList: [
{ {
label: '店效指标', label: '店效指标',
...@@ -82,14 +133,53 @@ export default { ...@@ -82,14 +133,53 @@ export default {
componentName: 'Product', componentName: 'Product',
id: '3' id: '3'
} }
] ],
baseInfo: {},
labelList: [
{
label: '事件标签',
key: 'eventLabel'
},
{
label: '店效标签',
key: 'shopEfficiencyLabel'
}
],
labelIndex: 0,
searchTime: {},
isQualityVisible: false,
qualityDetailList: [],
currentNum: 0,
} }
}, },
mounted () { mounted () {
this.getMerchantBaseInfo()
this.activeName = this.tabList[0].id
}, },
methods: { methods: {
getBoardData (params) { getMerchantBaseInfo () {
console.log(params) let { merchantId, businessType } = this.pageData,
startDate = dayjs().startOf('month').format("YYYY-MM-DD"),
endDate = dayjs().startOf('month').format("YYYY-MM-DD"),
supervisionName = []
getMerchantBaseInfo({ merchantId, businessType, startDate, endDate }).then(res => {
res.startBusiness = res.startBusiness ? `${dayjs(res.startBusiness).format("YYYY-MM")}展业` : '-'
res.supervisionList.map(item => {
supervisionName.push(item.supervisionName)
})
res.supervisionName = supervisionName.join('、')
this.baseInfo = res
})
},
openReceptionDialog (e) {
this.qualityDetailList = e.qualityDetailList,
this.isQualityVisible = e.isQualityVisible
this.currentNum = e.currentNum
},
closeDialog () {
this.isQualityVisible = false
this.qualityDetailList = []
this.currentNum = 0
} }
} }
} }
...@@ -105,20 +195,83 @@ export default { ...@@ -105,20 +195,83 @@ export default {
} }
padding: 0 20px; padding: 0 20px;
.shop-info { .shop-info {
height: 104px; min-height: 104px;
background-color: #fff; background-color: #fff;
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
padding: 16px 20px; padding: 16px 20px;
position: relative;
.label-box {
position: absolute;
width: 556px;
height: 80px;
background: #f47f131a;
top: 16px;
right: 16px;
box-sizing: border-box;
padding: 8px;
.label-title {
color: #888888;
font-size: 12px;
font-weight: 500;
line-height: 20px;
.el-icon-warning {
margin: 0 8px 0 3px;
font-size: 14px;
color: #f47f13;
}
}
.two-line {
color: #888888;
font-size: 12px;
line-height: 20px;
padding-left: 25px;
display: -webkit-box;
-webkit-box-orient: vertical;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
cursor: pointer;
width: fit-content;
}
.label-tab {
width: 124px;
height: 24px;
border-radius: 2px;
background: #f9fafb;
position: absolute;
top: 0;
right: 0;
box-sizing: border-box;
border: 2px solid #f9fafb;
&-item {
width: 60px;
height: 20px;
color: #666666;
font-size: 11px;
justify-content: center;
cursor: pointer;
}
.active {
background: #fff;
color: #2A58AD;
}
}
}
.icon { .icon {
width: 48px; width: 48px;
height: 48px; height: 48px;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
margin-right: 16px; margin-right: 16px;
background-color: #096; background: url("@/assets/d+.png");
background-size: 100% 100%;
} }
.info { .info {
width: 45%;
.merchant-name { .merchant-name {
color: #1d2129; color: #1d2129;
font-size: 16px; font-size: 16px;
...@@ -136,6 +289,10 @@ export default { ...@@ -136,6 +289,10 @@ export default {
font-size: 12px; font-size: 12px;
margin-left: 16px; margin-left: 16px;
} }
.grey {
color: #a8a8a8;
background: #f6f6f6;
}
} }
.text { .text {
color: #888888; color: #888888;
...@@ -148,15 +305,22 @@ export default { ...@@ -148,15 +305,22 @@ export default {
opacity: 1; opacity: 1;
background: #e8f3ff; background: #e8f3ff;
padding: 0 8px; padding: 0 8px;
color: #185efe; color: #2A58AD;
font-size: 12px; font-size: 12px;
margin-right: 16px; margin-right: 16px;
flex-shrink: 0;
} }
.year { .year {
margin-right: 16px; margin-right: 16px;
flex-shrink: 0;
} }
.supervision-icon { .supervision-icon {
margin-right: 4px; margin-right: 4px;
flex-shrink: 0;
width: 14px;
height: 14px;
background: url("@/assets/supervision-icon.png");
background-size: 100% 100%;
} }
} }
} }
...@@ -183,8 +347,8 @@ export default { ...@@ -183,8 +347,8 @@ export default {
z-index: 2; z-index: 2;
width: fit-content; width: fit-content;
margin-left: auto; margin-left: auto;
.search-box{ .search-box {
padding:0 10px 20px 0; padding: 0 10px 20px 0;
} }
} }
} }
......
export default {
data () {
return {
initStatus: false,
searchTimeStatus: false
}
},
props: {
show: Boolean,
searchTime: {
type: Object,
default: () => { }
},
pageId: {
type: String,
default: ''
},
pageData: {
type: Object,
default: () => { }
},
},
mounted () {
let getData = this.getData
this.getData = function () {
getData.apply(this, arguments), this.searchTimeStatus = false
}
},
watch: {
show: {
async handler (newVal) {
if (newVal) {
if (!this.initStatus || this.searchTimeStatus) {
await this.getData()
this.initStatus = true
}
}
},
immediate: true,
deep: true
},
searchTime (n) {
if (this.initStatus) {
if (this.show) this.getData()
else this.searchTimeStatus = true
}
}
},
methods: {
}
}
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,11 @@ ...@@ -21,7 +21,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<search-box @search="setTimeData" /> <search-box
class="search-box"
@search="setTimeData"
@update="getBoardData"
/>
</div> </div>
<div class="board-content"> <div class="board-content">
<div class="left-board flex-box"> <div class="left-board flex-box">
...@@ -41,7 +45,7 @@ ...@@ -41,7 +45,7 @@
class="board-item" class="board-item"
:item="item" :item="item"
:data="boardData" :data="boardData"
@click="$emit('openWindow',item)" @click="openWindow(item)"
/> />
</template> </template>
</div> </div>
...@@ -92,38 +96,43 @@ export default { ...@@ -92,38 +96,43 @@ export default {
name: '产值', name: '产值',
value: 'output', value: 'output',
percent: 'outputRatio', percent: 'outputRatio',
unit: '(元)' unit: '(元)',
queryType: 1
}, },
{ {
name: '展业门店数', name: '展业门店数',
value: 'storeNum', value: 'storeNum',
percent: 'storeNumRatio', percent: 'storeNumRatio',
queryType: 6
}, },
{ {
name: '客单价', name: '客单价',
value: 'customerUnitPrice', value: 'customerUnitPrice',
percent: 'customerUnitPriceRatio', percent: 'customerUnitPriceRatio',
unit: '(元)' unit: '(元)',
queryType: 2
}, },
{ {
name: '店均产值', name: '店均产值',
value: 'storeAverageOutput', value: 'storeAverageOutput',
percent: 'storeAverageOutputRatio', percent: 'storeAverageOutputRatio',
unit: '(元)' unit: '(元)',
queryType: 7
}, },
{ {
name: '交车数', name: '交车数',
value: 'deliveryNum', value: 'deliveryNum',
percent: 'deliveryNumRatio', percent: 'deliveryNumRatio',
queryType: 8
}, },
{ {
name: '触客数', name: '触客数',
value: 'touchNum', value: 'touchNum',
percent: 'touchNumRatio', percent: 'touchNumRatio',
queryType: 9
}, },
], ],
timeObject:{} timeObject: {}
} }
}, },
mounted () { mounted () {
...@@ -146,18 +155,23 @@ export default { ...@@ -146,18 +155,23 @@ export default {
} }
const res = await getShopGuardIndexBoard(params) const res = await getShopGuardIndexBoard(params)
Object.keys(res).map(key => { Object.keys(res).map(key => {
if (res[key]) { if (res[key] != null) {
if (key == 'outputCompletionProgress' || key == 'grossProfitMargin') res[key] = res[key] + '%' if (key == 'outputCompletionProgress' || key == 'grossProfitMargin') res[key] = res[key] + '%'
else res[key] = res[key].toLocaleString()
if (key == 'budget') res[key] = '¥' + res[key] if (key == 'budget') res[key] = '¥' + res[key]
} } else res[key] = '-'
res[key] = res[key]
}) })
this.boardData = res this.boardData = res
}, },
changeBusinessType () { changeBusinessType () {
this.getBoardData() this.getBoardData()
this.$emit('changeBusinessType', this.businessType) this.$emit('changeBusinessType', this.businessType)
},
openWindow (e) {
let { businessType } = this
this.$emit('openWindow', {
...e,
businessType
})
} }
} }
} }
...@@ -170,10 +184,19 @@ export default { ...@@ -170,10 +184,19 @@ export default {
.board-search-box { .board-search-box {
display: flex; display: flex;
align-items: center; align-items: center;
::v-deep.el-form-item__content {
height: 32px;
}
.el-form-item--small.el-form-item { .el-form-item--small.el-form-item {
margin: 0 !important; margin: 0 !important;
::v-deep.el-input {
height: 32px !important;
}
} }
} }
.search-box {
flex: 1;
}
.board-content { .board-content {
padding: 0 20px 20px; padding: 0 20px 20px;
display: flex; display: flex;
......
...@@ -7,18 +7,19 @@ ...@@ -7,18 +7,19 @@
<template v-if="item.unit">{{item.unit}}</template> <template v-if="item.unit">{{item.unit}}</template>
</div> </div>
<div class="value"> <div class="value">
{{data[item.value] || '--'}} {{data[item.value] || '-'}}
<!-- toLocaleString() -->
</div> </div>
<div :class="['percent',`${percentColor(data[item.percent])}`]"> <div :class="['percent',`${percentColor(data[item.percent])}`]">
环比<div class="percent-value">{{formatted(data[item.percent])}}</div> 环比<div class="percent-value">{{data[item.percent] ? formatted(data[item.percent]) : '-'}}</div>
<template v-if="data[item.percent]"> <template v-if="data[item.percent] && data[item.percent] != '-'">
<div :class="['icon',`${percentClass(data[item.percent])}`]"></div> <div :class="['icon',`${percentClass(data[item.percent])}`]"></div>
</template> </template>
</div> </div>
<template v-if="item.tips"> <template v-if="item.tips">
<div class="tips"> <div class="tips">
{{item.tips}} {{item.tips}}
<div class="tips-value">{{data[item.tipsValue] || '--'}}</div> <div class="tips-value">{{data[item.tipsValue]}}</div>
</div> </div>
</template> </template>
</div> </div>
...@@ -45,11 +46,13 @@ export default { ...@@ -45,11 +46,13 @@ export default {
}, },
methods: { methods: {
formatted (num) { formatted (num) {
return num ? Math.abs(num) + '%' : '--' return num != '-' ? num + '%' : '-'
}, },
percentClass (num) { percentClass (num) {
if (num > 0) { if (num > 0) {
return 'el-icon-caret-top' return 'el-icon-caret-top'
} else if (num == 0) {
return 'minus'
} else if (num < 0) { } else if (num < 0) {
return 'el-icon-caret-bottom' return 'el-icon-caret-bottom'
} else { } else {
...@@ -117,6 +120,12 @@ export default { ...@@ -117,6 +120,12 @@ export default {
.icon { .icon {
margin-left: 6px; margin-left: 6px;
} }
.minus {
width: 7.5px;
height: 2.5px;
border-radius: 0.6px;
background: #888888;
}
} }
.red { .red {
.percent-value, .percent-value,
......
...@@ -38,10 +38,7 @@ export default { ...@@ -38,10 +38,7 @@ export default {
storeWarn storeWarn
}, },
props:{ props:{
businessType: { businessType: [String, Number]
type: String,
default: ''
}
}, },
data () { data () {
return { return {
......
...@@ -15,17 +15,7 @@ ...@@ -15,17 +15,7 @@
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@click="handleSearch" @click="handleExport"
>查询</el-button>
<el-button
size="mini"
plain
type="info"
@click="handleReset"
>重置</el-button>
<el-button
size="mini"
type="primary"
>导出</el-button> >导出</el-button>
</div> </div>
<div class="table-box"> <div class="table-box">
...@@ -52,10 +42,9 @@ ...@@ -52,10 +42,9 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { deepClone } from "@/common/util" import { deepClone, downLoadFile } from "@/common/util"
import FilterItem from './FilterItem.vue' import FilterItem from './FilterItem.vue'
import { getMerchantPerformanceList } from '@api/earlyWarningManager' import { getMerchantPerformanceList, exportMerchantPerformanceList } from '@api/earlyWarningManager'
import { getListApi } from "@api/publicAccount"
export default { export default {
components: { components: {
FilterItem FilterItem
...@@ -66,10 +55,7 @@ export default { ...@@ -66,10 +55,7 @@ export default {
type: String, type: String,
default: '1' default: '1'
}, },
businessType: { businessType: [String, Number],
type: String,
default: ''
},
show: Boolean show: Boolean
}, },
data () { data () {
...@@ -100,8 +86,7 @@ export default { ...@@ -100,8 +86,7 @@ export default {
searchForm: { searchForm: {
countDate: dayjs().subtract(1, 'month').format("YYYY-MM") countDate: dayjs().subtract(1, 'month').format("YYYY-MM")
}, },
// getListApi: getMerchantPerformanceList, getListApi: getMerchantPerformanceList,
getListApi,
searchFormSearch: {}, searchFormSearch: {},
tableParams: { tableParams: {
listName: "list", listName: "list",
...@@ -129,11 +114,21 @@ export default { ...@@ -129,11 +114,21 @@ export default {
}, },
] ]
}, },
initStatus: false,
searchStatus: false
} }
}, },
watch: { watch: {
businessType (n) { businessType (n) {
this.handleSearch() if (this.initStatus) {
if (this.show) this.handleSearch()
else this.searchStatus = true
}
},
show (newVal) {
if (newVal) {
if (!this.initStatus || this.searchStatus) this.handleSearch()
}
} }
}, },
created () { created () {
...@@ -155,9 +150,11 @@ export default { ...@@ -155,9 +150,11 @@ export default {
this.clearSort(orderBy) this.clearSort(orderBy)
this.searchForm.orderBy = orderBy this.searchForm.orderBy = orderBy
this.searchForm.asc = asc this.searchForm.asc = asc
this.handleSearch()
} }
}, },
handleSearch () { handleSearch () {
this.searchStatus = false
this.$refs.tableRef.refreshTable(true, true) this.$refs.tableRef.refreshTable(true, true)
}, },
handleReset () { handleReset () {
...@@ -168,7 +165,10 @@ export default { ...@@ -168,7 +165,10 @@ export default {
beforeSearchFn () { beforeSearchFn () {
return new Promise((resolve) => { return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.getParams()) this.searchFormSearch = deepClone(this.getParams())
resolve() if (this.show) {
this.initStatus = true
resolve()
}
}) })
}, },
getParams () { getParams () {
...@@ -182,9 +182,18 @@ export default { ...@@ -182,9 +182,18 @@ export default {
...e, ...e,
pageId: `merchant-${e.merchantId}`, pageId: `merchant-${e.merchantId}`,
componentName: 'shop-detail', componentName: 'shop-detail',
tabTitle: `${e.merchantName}门店详情` tabTitle: `${e.merchantName}门店详情`,
showTips: true,
businessType: this.businessType
}) })
} },
async handleExport () {
let params = this.getParams(),
{ page } = this.$refs.tableRef
exportMerchantPerformanceList({ ...params, ...page }).then((res) => {
res && downLoadFile(res)
})
},
} }
} }
</script> </script>
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
name: '', name: '',
data () { data () {
return { return {
businessType: '' businessType: 4
} }
}, },
mounted () { mounted () {
......
...@@ -114,12 +114,19 @@ export default { ...@@ -114,12 +114,19 @@ export default {
methods: { methods: {
preventBack () { preventBack () {
if (this.windowId !== -1) { if (this.windowId !== -1) {
this.windowId = -1 const [recep] = this.$refs[`page-${this.windowId}`]
if (recep && recep.isQualityVisible) recep.closeDialog()
else this.windowId = -1
history.pushState(null, null, document.URL) history.pushState(null, null, document.URL)
} else this.$router.go(-1) } else this.$router.go(-1)
}, },
openWindow (data) { openWindow (data) {
console.log(data) // console.log(data)
// data.merchantId = 44211895
// data.merchantId = 44210895
// data.merchantId = 44209510
// data.businessType = 4
let id = data.pageId, let id = data.pageId,
windowList = [...this.tab, ...this.dropdownList], windowList = [...this.tab, ...this.dropdownList],
windowItem = windowList.find((e) => e.id == id) windowItem = windowList.find((e) => e.id == id)
......
<template> <template>
<div> <div>
<baseDialog :is-show.sync="dialogShow" <baseDialog
:config="dialogConfig.setting" :is-show.sync="dialogShow"
:dialog-config="dialogConfig.config" :config="dialogConfig.setting"
@closeDialog="handleDetailClose" :dialog-config="dialogConfig.config"
class="detail-content-warn"> @closeDialog="handleDetailClose"
class="detail-content-warn"
>
<div v-loading="loading"> <div v-loading="loading">
<div class="form_div"> <div class="form_div">
<div class="div-title">员工信息</div> <div class="div-title">员工信息</div>
<el-form class="edit-sub-block" <el-form
label-width="150px" class="edit-sub-block"
:inline="true"> label-width="150px"
:inline="true"
>
<div class="itemDiv"> <div class="itemDiv">
<el-form-item label="员工姓名:" <el-form-item
class="halfItem"> label="员工姓名:"
class="halfItem"
>
{{ paramsObj.staffName ? paramsObj.staffName : "-" }} {{ paramsObj.staffName ? paramsObj.staffName : "-" }}
</el-form-item> </el-form-item>
<el-form-item label="手机号:" <el-form-item
class="halfItem"> label="手机号:"
class="halfItem"
>
{{ paramsObj.staffPhone {{ paramsObj.staffPhone
? paramsObj.staffPhone ? paramsObj.staffPhone
: "-" }} : "-" }}
</el-form-item> </el-form-item>
</div> </div>
<div class="itemDiv"> <div class="itemDiv">
<el-form-item label="所属门店:" <el-form-item
class="halfItem"> label="所属门店:"
class="halfItem"
>
{{ paramsObj.merchantName4s ? paramsObj.merchantName4s : "-" }} {{ paramsObj.merchantName4s ? paramsObj.merchantName4s : "-" }}
</el-form-item> </el-form-item>
<el-form-item label="所属业务:" <el-form-item
class="halfItem"> label="所属业务:"
class="halfItem"
>
{{ {{
paramsObj.bussinessTypeName ? paramsObj.bussinessTypeName : "-" paramsObj.bussinessTypeName ? paramsObj.bussinessTypeName : "-"
}} }}
</el-form-item> </el-form-item>
</div> </div>
<div class="itemDiv"> <div class="itemDiv">
<el-form-item label="所属督导:" <el-form-item
class="halfItem" label="所属督导:"
:title="paramsObj.supervisor"> class="halfItem"
:title="paramsObj.supervisor"
>
{{ paramsObj.supervisor ? (paramsObj.supervisor.length > 15 ? (paramsObj.supervisor.slice(0, 15) + '...') : paramsObj.supervisor) : '' }} {{ paramsObj.supervisor ? (paramsObj.supervisor.length > 15 ? (paramsObj.supervisor.slice(0, 15) + '...') : paramsObj.supervisor) : '' }}
</el-form-item> </el-form-item>
<el-form-item label="所属销售:" <el-form-item
class="halfItem" label="所属销售:"
:title="paramsObj.salesperson"> class="halfItem"
:title="paramsObj.salesperson"
>
{{ paramsObj.salesperson ? (paramsObj.salesperson.length > 15 ? (paramsObj.salesperson.slice(0, 15) + '...') : paramsObj.salesperson) : '' }} {{ paramsObj.salesperson ? (paramsObj.salesperson.length > 15 ? (paramsObj.salesperson.slice(0, 15) + '...') : paramsObj.salesperson) : '' }}
</el-form-item> </el-form-item>
</div> </div>
<div class="itemDiv"> <div class="itemDiv">
<el-form-item label="盯防负责人:" <el-form-item
class="halfItem" label="盯防负责人:"
:title="paramsObj.storePerson"> class="halfItem"
:title="paramsObj.storePerson"
>
{{ paramsObj.storePerson ? (paramsObj.storePerson.length > 15 ? (paramsObj.storePerson.slice(0, 15) + '...') : paramsObj.storePerson) : '' }} {{ paramsObj.storePerson ? (paramsObj.storePerson.length > 15 ? (paramsObj.storePerson.slice(0, 15) + '...') : paramsObj.storePerson) : '' }}
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<div class="div-title">预警信息</div> <div class="div-title">预警信息</div>
<el-form class="edit-sub-block" <el-form
label-width="150px" class="edit-sub-block"
:inline="true"> label-width="150px"
:inline="true"
>
<div class="itemDiv"> <div class="itemDiv">
<el-form-item label="预警类型:" <el-form-item
class="halfItem"> label="预警类型:"
class="halfItem"
>
{{ paramsObj.ruleType ? paramsObj.ruleType : "-" }} {{ paramsObj.ruleType ? paramsObj.ruleType : "-" }}
</el-form-item> </el-form-item>
<el-form-item label="预警事项:" <el-form-item
class="halfItem"> label="预警事项:"
class="halfItem"
>
{{ {{
paramsObj.rule ? paramsObj.rule : "-" paramsObj.rule ? paramsObj.rule : "-"
}} }}
</el-form-item> </el-form-item>
</div> </div>
<div class="itemDiv"> <div class="itemDiv">
<el-form-item label="预警周期:" <el-form-item
class="halfItem"> label="预警周期:"
class="halfItem"
>
{{ cycleShow ? cycleShow : "-" }} {{ cycleShow ? cycleShow : "-" }}
</el-form-item> </el-form-item>
<el-form-item label="优先级:" <el-form-item
class="halfItem"> label="优先级:"
class="halfItem"
>
{{ {{
paramsObj.priorityLevel ? priorityShowText[paramsObj.priorityLevel] : "-" paramsObj.priorityLevel ? priorityShowText[paramsObj.priorityLevel] : "-"
}} }}
</el-form-item> </el-form-item>
</div> </div>
<div class="itemDiv"> <div class="itemDiv">
<el-form-item label="预警阶段:" <el-form-item
class="halfItem"> label="预警阶段:"
class="halfItem"
>
{{ paramsObj.stageName ? paramsObj.stageName : "-" }} {{ paramsObj.stageName ? paramsObj.stageName : "-" }}
</el-form-item> </el-form-item>
<el-form-item label="创建时间:" <el-form-item
class="halfItem"> label="创建时间:"
class="halfItem"
>
{{ {{
createTimeShow ? createTimeShow : "-" createTimeShow ? createTimeShow : "-"
}} }}
...@@ -98,12 +130,14 @@ ...@@ -98,12 +130,14 @@
</el-form> </el-form>
<div class="div-title">跟进记录</div> <div class="div-title">跟进记录</div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table ref="recordTable" <d2-table
:has-page="false" ref="recordTable"
:table-data="tableData" :has-page="false"
:search-form="searchFormSearch" :table-data="tableData"
:table-params="tableParams" :search-form="searchFormSearch"
:before-search-fn="beforeSearchFn"> :table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
</d2-table> </d2-table>
</div> </div>
</div> </div>
...@@ -133,26 +167,26 @@ export default { ...@@ -133,26 +167,26 @@ export default {
}, },
computed: { computed: {
dialogShow: { dialogShow: {
get() { get () {
return this.visible return this.visible
}, },
set(val) { set (val) {
this.$emit("update:visible", val) this.$emit("update:visible", val)
} }
} }
}, },
mounted() { mounted () {
this.dataProcess() this.dataProcess()
this.getList() this.getList()
this.loading = true this.loading = true
}, },
data() { data () {
return { return {
dialogConfig: { dialogConfig: {
setting: { setting: {
showClose: true, showClose: true,
appendToBody: false, appendToBody: true,
btnList: [] btnList: [],
}, },
config: { config: {
title: "详细信息", title: "详细信息",
...@@ -218,21 +252,21 @@ export default { ...@@ -218,21 +252,21 @@ export default {
} }
}, },
methods: { methods: {
beforeSearchFn() { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.searchForm.msgId = this.paramsObj.id this.searchForm.msgId = this.paramsObj.id
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
resolve() resolve()
}) })
}, },
getList() { getList () {
var params = { msgId: this.paramsObj.id } var params = { msgId: this.paramsObj.id }
findByMsgId(params).then(res => { findByMsgId(params).then(res => {
this.tableData = res this.tableData = res
this.loading = false this.loading = false
}) })
}, },
dataProcess() { dataProcess () {
if (this.paramsObj) { if (this.paramsObj) {
if (this.paramsObj.starDate) { if (this.paramsObj.starDate) {
this.cycleShow += Util.dateFormate(this.paramsObj.starDate, 'YYYY-MM-DD') this.cycleShow += Util.dateFormate(this.paramsObj.starDate, 'YYYY-MM-DD')
...@@ -247,7 +281,7 @@ export default { ...@@ -247,7 +281,7 @@ export default {
} }
} }
}, },
handleDetailClose() { handleDetailClose () {
this.dialogShow = false this.dialogShow = false
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<template> <template>
<baseDialog :dialog-config="dialogConfig" <baseDialog :dialog-config="dialogConfig"
:is-show.sync="dialogShow" :is-show.sync="dialogShow"
:config="config"
class="accountDailog" class="accountDailog"
@handleClick="handleAddConfirm"> @handleClick="handleAddConfirm">
<div class="add-dialog"> <div class="add-dialog">
...@@ -57,6 +58,12 @@ export default { ...@@ -57,6 +58,12 @@ export default {
name: 'HandleDialog', name: 'HandleDialog',
data() { data() {
return { return {
config: {
appendToBody: true,
isShowFooter: true,
confirm_name: '确定',
cancel_name: '取消'
},
pickerOption: { pickerOption: {
afterPickerOptions_timeChoose: afterPickerOptions_timeChoose afterPickerOptions_timeChoose: afterPickerOptions_timeChoose
}, },
......
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
dialogConfig: { dialogConfig: {
setting: { setting: {
showClose: true, showClose: true,
appendToBody: false, appendToBody: true,
btnList: [] btnList: []
}, },
config: { config: {
......
<!-- 预警处理 --> <!-- 预警处理 -->
<template> <template>
<baseDialog :dialog-config="dialogConfig" <baseDialog
:is-show.sync="dialogShow" :dialog-config="dialogConfig"
class="accountDailog" :is-show.sync="dialogShow"
@handleClick="handleAddConfirm"> :config="config"
class="accountDailog"
@handleClick="handleAddConfirm"
>
<div class="add-dialog"> <div class="add-dialog">
<glsx-combi-form class="edit-form-container" <glsx-combi-form
ref="editFormRef" class="edit-form-container"
label-width="150px" ref="editFormRef"
default-width="400px" label-width="150px"
:form-ref="handleFormRef" default-width="400px"
:form-obj="infoForm" :form-ref="handleFormRef"
:form-data="editFormData" :form-obj="infoForm"
:form-rules="formRules"> :form-data="editFormData"
<div slot="followStatusHtml" :form-rules="formRules"
slot-scope="scope" >
style="width:400px"> <div
<el-radio-group v-model="infoForm.followStatus" slot="followStatusHtml"
@change="followStatusChange"> slot-scope="scope"
<el-radio v-for="item in baseData.followStatusOptions" style="width:400px"
:label="item.confId">{{ item.confValue }}</el-radio> >
<el-radio-group
v-model="infoForm.followStatus"
@change="followStatusChange"
>
<el-radio
v-for="item in baseData.followStatusOptions"
:label="item.confId"
>{{ item.confValue }}</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div slot="nextFollowerTimeHtml" <div
slot-scope="scope" slot="nextFollowerTimeHtml"
style="width:400px"> slot-scope="scope"
<el-date-picker v-model="infoForm.nextFollowerTime" style="width:400px"
type="datetime" >
format="yyyy-MM-dd HH:mm" <el-date-picker
value-format="yyyy-MM-dd HH:mm" v-model="infoForm.nextFollowerTime"
popper-class="no-atTheMoment" type="datetime"
placeholder="选择日期时间" format="yyyy-MM-dd HH:mm"
:picker-options="pickerOption['afterPickerOptions_timeChoose']"> value-format="yyyy-MM-dd HH:mm"
popper-class="no-atTheMoment"
placeholder="选择日期时间"
:picker-options="pickerOption['afterPickerOptions_timeChoose']"
>
</el-date-picker> </el-date-picker>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
<div class="div-title">跟进记录</div> <div class="div-title">跟进记录</div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table ref="recordTable" <d2-table
:has-page="false" ref="recordTable"
:table-data="tableData" :has-page="false"
:search-form="searchFormSearch" :table-data="tableData"
:table-params="tableParams"> :search-form="searchFormSearch"
:table-params="tableParams"
>
</d2-table> </d2-table>
</div> </div>
</div> </div>
...@@ -55,8 +72,14 @@ import { findMerchantStaffList } from '@api/index' ...@@ -55,8 +72,14 @@ import { findMerchantStaffList } from '@api/index'
import { afterPickerOptions_timeChoose } from '@/common/format' import { afterPickerOptions_timeChoose } from '@/common/format'
export default { export default {
name: 'HandleDialog', name: 'HandleDialog',
data() { data () {
return { return {
config: {
appendToBody: true,
isShowFooter: true,
confirm_name: '确定',
cancel_name: '取消'
},
pickerOption: { pickerOption: {
afterPickerOptions_timeChoose: afterPickerOptions_timeChoose afterPickerOptions_timeChoose: afterPickerOptions_timeChoose
}, },
...@@ -185,16 +208,16 @@ export default { ...@@ -185,16 +208,16 @@ export default {
}, },
computed: { computed: {
dialogShow: { dialogShow: {
get() { get () {
return this.visible return this.visible
}, },
set(newVal) { set (newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'visible' }) this.$emit('dialogClose', { flag: newVal, attrName: 'visible' })
} }
} }
}, },
mounted() { mounted () {
this.findMerchantStaffList() this.findMerchantStaffList()
if (this.paramsObj.status) { if (this.paramsObj.status) {
this.infoForm.followStatus = this.paramsObj.status this.infoForm.followStatus = this.paramsObj.status
...@@ -205,7 +228,7 @@ export default { ...@@ -205,7 +228,7 @@ export default {
}, },
methods: { methods: {
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList (formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle) var index = this[formName].findIndex(k => k.name == refreshSigle)
...@@ -231,7 +254,7 @@ export default { ...@@ -231,7 +254,7 @@ export default {
} }
}, },
showOrHideAttr(formName, label, isHide) { showOrHideAttr (formName, label, isHide) {
const idx = this[formName].findIndex(item => item.label == label) const idx = this[formName].findIndex(item => item.label == label)
console.log('idx', idx) console.log('idx', idx)
console.log('this[formName][idx].isHide', this[formName][idx].isHide) console.log('this[formName][idx].isHide', this[formName][idx].isHide)
...@@ -239,7 +262,7 @@ export default { ...@@ -239,7 +262,7 @@ export default {
}, },
// 获取全部员工 过滤出服务商负责人可选数据 // 获取全部员工 过滤出服务商负责人可选数据
findMerchantStaffList() { findMerchantStaffList () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
findMerchantStaffList({ merchantId: -1 }).then(res => { findMerchantStaffList({ merchantId: -1 }).then(res => {
// 服务商负责人(根据角色名过滤) // 服务商负责人(根据角色名过滤)
...@@ -258,7 +281,7 @@ export default { ...@@ -258,7 +281,7 @@ export default {
}) })
}, },
followStatusChange(val) { followStatusChange (val) {
console.log('val', val) console.log('val', val)
if (val == 1) { if (val == 1) {
this.showOrHideAttr('editFormData', '下次跟进人', false) this.showOrHideAttr('editFormData', '下次跟进人', false)
...@@ -272,7 +295,7 @@ export default { ...@@ -272,7 +295,7 @@ export default {
} }
}, },
handleAddConfirm() { handleAddConfirm () {
this.$refs.editFormRef.$refs[this.handleFormRef].validate(valid => { this.$refs.editFormRef.$refs[this.handleFormRef].validate(valid => {
if (valid) { if (valid) {
var params = deepClone(this.infoForm) var params = deepClone(this.infoForm)
...@@ -291,11 +314,11 @@ export default { ...@@ -291,11 +314,11 @@ export default {
}, },
// 找到在formList的位置,通过name来匹配 // 找到在formList的位置,通过name来匹配
findFormIdx(name) { findFormIdx (name) {
return this.editFormData.findIndex(item => item.name === name) return this.editFormData.findIndex(item => item.name === name)
}, },
getList() { getList () {
var params = { msgId: this.paramsObj.id } var params = { msgId: this.paramsObj.id }
findByMsgId(params).then(res => { findByMsgId(params).then(res => {
this.tableData = res this.tableData = res
......
...@@ -4,21 +4,29 @@ ...@@ -4,21 +4,29 @@
<d2-container class="m-t-40"> <d2-container class="m-t-40">
<!-- <div class="d2-container-content" <!-- <div class="d2-container-content"
style="padding: 10px 20px;"> --> style="padding: 10px 20px;"> -->
<div class="header" <div
slot="header"> class="header"
<d2-search ref="showSearch" slot="header"
class="show-search" >
:search-form="searchForm" <d2-search
:form-data="showFormData" ref="showSearch"
label-width="100px" /> class="show-search"
:search-form="searchForm"
:form-data="showFormData"
label-width="100px"
/>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" <el-button
size="small" :id="tableParams.btnId"
type="primary"> size="small"
type="primary"
>
查询 查询
</el-button> </el-button>
<el-button size="small" <el-button
@click="handleReset"> size="small"
@click="handleReset"
>
重置 重置
</el-button> </el-button>
</div> </div>
...@@ -28,54 +36,78 @@ ...@@ -28,54 +36,78 @@
<d2-table-header> <d2-table-header>
<auth-button category="Button" /> <auth-button category="Button" />
</d2-table-header> </d2-table-header>
<d2-table ref="detailListTable" <d2-table
:search-form="searchForm" ref="detailListTable"
:table-params="tableParams" :search-form="searchForm"
:get-list-api="getListApi" :table-params="tableParams"
:before-search-fn="beforeSearchFn"> :get-list-api="getListApi"
<template slot="priorityHtml" :before-search-fn="beforeSearchFn"
slot-scope="scope"> >
<template
slot="priorityHtml"
slot-scope="scope"
>
<span :class="baseData.priorityShowClass[scope.scope.priorityLevel]"> <span :class="baseData.priorityShowClass[scope.scope.priorityLevel]">
{{ baseData.priorityShowText[scope.scope.priorityLevel] }} {{ baseData.priorityShowText[scope.scope.priorityLevel] }}
</span> </span>
</template> </template>
<template slot="stageHtml" <template
slot-scope="scope"> slot="stageHtml"
slot-scope="scope"
>
<span :class="baseData.stageShowClass[scope.scope.stage]"> <span :class="baseData.stageShowClass[scope.scope.stage]">
{{ scope.scope.stageName }} {{ scope.scope.stageName }}
</span> </span>
</template> </template>
<template slot="typeHtml" <template
slot-scope="scope"> slot="typeHtml"
slot-scope="scope"
>
<span :class="baseData.businessOptShowClass[scope.scope.businessType]"> <span :class="baseData.businessOptShowClass[scope.scope.businessType]">
{{ scope.scope.bussinessTypeName }} {{ scope.scope.bussinessTypeName }}
</span> </span>
</template> </template>
<div slot="auth-button" <div
slot-scope="scope"> slot="auth-button"
slot-scope="scope"
>
<!-- 查看 --> <!-- 查看 -->
<span style="margin-right: 10px;"> <span style="margin-right: 10px;">
<auth-button :data="scope.scope" <auth-button
:show-btn-ids="['9150202']" /> :data="scope.scope"
:show-btn-ids="['9150202']"
/>
</span> </span>
<!-- 处理 --> <!-- 处理 -->
<span style="margin-right: 10px;" <span
v-if="scope.scope.status == 1 || scope.scope.status == 2"> style="margin-right: 10px;"
<auth-button :data="scope.scope" v-if="scope.scope.status == 1 || scope.scope.status == 2"
:show-btn-ids="['9150203']" /> >
<auth-button
:data="scope.scope"
:show-btn-ids="['9150203']"
/>
</span> </span>
<el-button
type="text"
@click="openWindow(scope.scope)"
>门店档案</el-button>
</div> </div>
</d2-table> </d2-table>
</div> </div>
<!-- 详细信息 --> <!-- 详细信息 -->
<detail-dialog :visible.sync="detailVisible" <detail-dialog
v-if="detailVisible" :visible.sync="detailVisible"
:params-obj="recordInfo" /> v-if="detailVisible"
:params-obj="recordInfo"
/>
<!-- 处理 --> <!-- 处理 -->
<handle-dialog :visible.sync="handleVisible" <handle-dialog
v-if="handleVisible" :visible.sync="handleVisible"
:params-obj="recordInfo" v-if="handleVisible"
@dialogClose="closeHandleDialog" /> :params-obj="recordInfo"
@dialogClose="closeHandleDialog"
/>
</d2-container> </d2-container>
<!-- </div> --> <!-- </div> -->
</template> </template>
...@@ -94,7 +126,7 @@ export default { ...@@ -94,7 +126,7 @@ export default {
default: {} default: {}
} }
}, },
data() { data () {
return { return {
searchForm: { searchForm: {
monitorType: 2, // 预警数据 1.员工 2.门店 monitorType: 2, // 预警数据 1.员工 2.门店
...@@ -379,7 +411,7 @@ export default { ...@@ -379,7 +411,7 @@ export default {
}, },
computed: { computed: {
}, },
mounted() { mounted () {
console.log('this.paramsObj', this.paramsObj) console.log('this.paramsObj', this.paramsObj)
if (this.paramsObj) { if (this.paramsObj) {
this.params_obj = deepClone(this.paramsObj) this.params_obj = deepClone(this.paramsObj)
...@@ -392,7 +424,7 @@ export default { ...@@ -392,7 +424,7 @@ export default {
methods: { methods: {
async getBaseData() { async getBaseData () {
this.findAllData(2) this.findAllData(2)
// 督导 // 督导
this.findAllPersonRelations(1) this.findAllPersonRelations(1)
...@@ -403,7 +435,7 @@ export default { ...@@ -403,7 +435,7 @@ export default {
this.getOptionsList() this.getOptionsList()
}, },
beforeSearchFn() { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
if (this.searchForm.warnCycle) { if (this.searchForm.warnCycle) {
this.searchForm.warningStartDate = Util.dateFormate(this.searchForm.warnCycle[0], 'YYYY-MM-DD') this.searchForm.warningStartDate = Util.dateFormate(this.searchForm.warnCycle[0], 'YYYY-MM-DD')
...@@ -422,10 +454,10 @@ export default { ...@@ -422,10 +454,10 @@ export default {
resolve() resolve()
}) })
}, },
keyDowmGetList() { keyDowmGetList () {
this.$refs.detailListTable.refreshTable() this.$refs.detailListTable.refreshTable()
}, },
handleReset() { handleReset () {
this.searchForm = { this.searchForm = {
monitorType: 2, // 预警数据 1.员工 2.门店 monitorType: 2, // 预警数据 1.员工 2.门店
ruleType: '', ruleType: '',
...@@ -446,7 +478,7 @@ export default { ...@@ -446,7 +478,7 @@ export default {
this.getOptionsList() this.getOptionsList()
this.$refs.detailListTable.refreshTable() this.$refs.detailListTable.refreshTable()
}, },
getOptionsList() { getOptionsList () {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if ( if (
...@@ -466,7 +498,7 @@ export default { ...@@ -466,7 +498,7 @@ export default {
}) })
}, },
findAllData(type) { findAllData (type) {
const params = { type: type } const params = { type: type }
findAllData(params).then((res) => { findAllData(params).then((res) => {
console.log(res) console.log(res)
...@@ -482,7 +514,7 @@ export default { ...@@ -482,7 +514,7 @@ export default {
}) })
}, },
findAllPersonRelations(sourceType) { findAllPersonRelations (sourceType) {
const params = { sourceType: sourceType } const params = { sourceType: sourceType }
findAllPersonRelations(params).then((res) => { findAllPersonRelations(params).then((res) => {
if (sourceType == 1) { // 督导 if (sourceType == 1) { // 督导
...@@ -496,28 +528,39 @@ export default { ...@@ -496,28 +528,39 @@ export default {
}) })
}, },
handleExport() { handleExport () {
var params = this.searchForm var params = this.searchForm
warningMsgDetailListWithPageExport(params).then((res) => { warningMsgDetailListWithPageExport(params).then((res) => {
res && downLoadFile(res) res && downLoadFile(res)
}) })
}, },
handleDetail(row) { handleDetail (row) {
this.recordInfo = row this.recordInfo = row
this.detailVisible = true this.detailVisible = true
}, },
handleDeal(row) { handleDeal (row) {
this.recordInfo = row this.recordInfo = row
this.handleVisible = true this.handleVisible = true
}, },
closeHandleDialog(obj) { closeHandleDialog (obj) {
this.handleVisible = !this.handleVisible this.handleVisible = !this.handleVisible
if (obj.flag) { if (obj.flag) {
this.$refs.detailListTable.refreshTable() this.$refs.detailListTable.refreshTable()
} }
},
openWindow (e) {
console.log(e)
this.$emit('openWindow', {
...e,
pageId: `merchant-${e.merchantId4s}`,
componentName: 'shop-detail',
tabTitle: `${e.merchantName4s}门店详情`,
merchantId: e.merchantId4s,
})
} }
} }
} }
......
<!-- 门店预警管理 --> <!-- 门店预警管理 -->
<template> <template>
<div class="staffWarn"> <div class="staffWarn">
<div class="header" <div
slot="header"> class="header"
<el-tabs v-model="activeName" slot="header"
@tab-click="handleClickTabs"> >
<el-tab-pane label="预警看板" <el-tabs
name="noticeBoard" /> v-model="activeName"
<el-tab-pane label="预警明细" @tab-click="handleClickTabs"
name="details" /> >
<el-tab-pane
label="预警看板"
name="noticeBoard"
/>
<el-tab-pane
label="预警明细"
name="details"
/>
</el-tabs> </el-tabs>
<div> <div v-if="initStatus">
<notice-board v-if="activeName === 'noticeBoard'" <notice-board
@gotoDetail="gotoDetail" /> v-if="activeName === 'noticeBoard'"
<staff-detail v-if="activeName === 'details'" @gotoDetail="gotoDetail"
:params-obj="recordInfo" /> />
<staff-detail
v-if="activeName === 'details'"
:params-obj="recordInfo"
@openWindow="$emit('openWindow',$event)"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -25,28 +38,35 @@ import noticeBoard from './noticeBoard' ...@@ -25,28 +38,35 @@ import noticeBoard from './noticeBoard'
import staffDetail from './details' import staffDetail from './details'
export default { export default {
name: 'StaffIndex', name: 'StaffIndex',
data() { data () {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
activeName: 'noticeBoard', activeName: 'noticeBoard',
recordInfo: {} recordInfo: {},
initStatus: false
} }
}, },
props: {
show: Boolean
},
components: { components: {
noticeBoard, noticeBoard,
staffDetail staffDetail
}, },
watch: {
mounted() { show (val) {
if (val) this.initStatus = true
}
},
mounted () {
}, },
methods: { methods: {
handleClickTabs() { handleClickTabs () {
this.recordInfo = {} this.recordInfo = {}
}, },
gotoDetail(params) { gotoDetail (params) {
this.activeName = 'details' this.activeName = 'details'
this.recordInfo = params this.recordInfo = params
console.log(params) console.log(params)
......
...@@ -674,6 +674,7 @@ export default { ...@@ -674,6 +674,7 @@ export default {
_formData.positionNamesArr = _positionNamesArr _formData.positionNamesArr = _positionNamesArr
_formData.goodsName = _valueObj?.goodsName _formData.goodsName = _valueObj?.goodsName
_formData.goodsTypeName = _valueObj?.goodsTypeName _formData.goodsTypeName = _valueObj?.goodsTypeName
_formData.tempGoodsTypeName = _valueObj?.tempGoodsTypeName
_formData.goodsType = _valueObj?.goodsType _formData.goodsType = _valueObj?.goodsType
_formData.serviceItemNames = _valueObj?.serviceItemNames _formData.serviceItemNames = _valueObj?.serviceItemNames
_formData.productType = [] // 切换上架商品 将服务类型清空 _formData.productType = [] // 切换上架商品 将服务类型清空
......
...@@ -74,7 +74,7 @@ export const packageGoodsForm = [{ ...@@ -74,7 +74,7 @@ export const packageGoodsForm = [{
value: 'goodsName' value: 'goodsName'
}, { }, {
label: '所属分类', label: '所属分类',
value: 'goodsTypeName' value: 'tempGoodsTypeName'
}, { }, {
label: '商品ID', label: '商品ID',
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
......
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
value: 'goodsName' value: 'goodsName'
}, { }, {
label: '所属分类', label: '所属分类',
value: 'goodsTypeName' value: 'tempGoodsTypeName'
}, { }, {
label: '商品ID', label: '商品ID',
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
...@@ -292,6 +292,10 @@ export default { ...@@ -292,6 +292,10 @@ export default {
this.allPages = res.pages this.allPages = res.pages
const resArr = [] const resArr = []
res.list && res.list.forEach(val => { res.list && res.list.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
val.upgradeGoodsList.forEach(v => { val.upgradeGoodsList.forEach(v => {
resArr.push({ resArr.push({
confId: v.id, confId: v.id,
...@@ -301,6 +305,7 @@ export default { ...@@ -301,6 +305,7 @@ export default {
upgradeGoodsName: v?.upgradeGoodsName, upgradeGoodsName: v?.upgradeGoodsName,
goodsName: val?.goodsInfo?.goodsName, goodsName: val?.goodsInfo?.goodsName,
goodsTypeName: val?.goodsInfo?.goodsTypeName, goodsTypeName: val?.goodsInfo?.goodsTypeName,
tempGoodsTypeName: result,
upgradePrice: v?.upgradePrice, upgradePrice: v?.upgradePrice,
purchasePrice: v?.purchasePrice, purchasePrice: v?.purchasePrice,
type: v?.type, type: v?.type,
...@@ -363,10 +368,15 @@ export default { ...@@ -363,10 +368,15 @@ export default {
const positionNamesArr = deepClone(this.positionTypeList)?.filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList)?.filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || []
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
res.productType = productType // 产品类型 res.productType = productType // 产品类型
res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价 res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价
res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位 res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
res.positionNamesArr = positionNamesArr res.positionNamesArr = positionNamesArr
res.tempGoodsTypeName = result // 所属分类
res.purchasePrice = res.upgradeGoods?.purchasePrice // 采购价价 res.purchasePrice = res.upgradeGoods?.purchasePrice // 采购价价
res.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID res.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID
res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限 res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限
......
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
value: 'goodsName' value: 'goodsName'
}, { }, {
label: '所属分类', label: '所属分类',
value: 'goodsTypeName' value: 'tempGoodsTypeName'
}, { }, {
label: '商品ID', label: '商品ID',
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
...@@ -183,6 +183,10 @@ export default { ...@@ -183,6 +183,10 @@ export default {
const productType = [] const productType = []
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
const productTypeTextArr = [] const productTypeTextArr = []
// 太阳膜/延保类回显部位 // 太阳膜/延保类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || []
...@@ -200,6 +204,7 @@ export default { ...@@ -200,6 +204,7 @@ export default {
if (res.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高) if (res.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList arr = upgradeSupplyModeList
} }
res.tempGoodsTypeName = result // 所属分类
res.productTypeStr = productTypeTextArr?.length ? productTypeTextArr.join(';') : '-' res.productTypeStr = productTypeTextArr?.length ? productTypeTextArr.join(';') : '-'
res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-' res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-'
res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || '' res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || ''
......
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
:label-width="'100px'" :label-width="'100px'"
:form-data="showFormData" :form-data="showFormData"
@handleChangeSelect="handleChangeSelect"> @handleChangeSelect="handleChangeSelect">
<template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;"
v-model="tempGoodsType" :placeholder="'请选择'"
@change="selectAddAttr($event)"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }" :show-all-levels="false">
</el-cascader>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" <el-button :id="tableParams.btnId"
...@@ -188,7 +195,7 @@ ...@@ -188,7 +195,7 @@
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { getProductTypeBySceneId, getList } from '@api/product' import { getList, getAllCategory } from '@api/product'
import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus, batchUpdateBatchCopy, batchSetValidMinSellPrice, groundingImport } from '@api/grounding' import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus, batchUpdateBatchCopy, batchSetValidMinSellPrice, groundingImport } from '@api/grounding'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { sceneCodeList, sceneList, BaseData } from '@/common/constants.js' import { sceneCodeList, sceneList, BaseData } from '@/common/constants.js'
...@@ -212,12 +219,15 @@ export default { ...@@ -212,12 +219,15 @@ export default {
sceneType: '', sceneType: '',
goodsCode: '', goodsCode: '',
goodsType: '', goodsType: '',
secondaryGoodsType: '',
thirdLevelGoodsType: '',
goodsAlias: '', goodsAlias: '',
status: '', status: '',
yqMerchantId: '', yqMerchantId: '',
goodsSource: 0, goodsSource: 0,
financeCheckFlag: '' financeCheckFlag: ''
}, },
tempGoodsType: [],
getListApi: getGroundingManageList, getListApi: getGroundingManageList,
drawerDetailVisible: false, drawerDetailVisible: false,
showFormData: [{ showFormData: [{
...@@ -251,11 +261,7 @@ export default { ...@@ -251,11 +261,7 @@ export default {
}, { }, {
label: '所属分类', label: '所属分类',
name: 'goodsType', name: 'goodsType',
type: 'select', addHtml: 'goodsCascader'
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}, { }, {
label: '所属系列', label: '所属系列',
name: 'goodsCode', name: 'goodsCode',
...@@ -464,7 +470,14 @@ export default { ...@@ -464,7 +470,14 @@ export default {
label: '所属分类', label: '所属分类',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
prop: 'goodsTypeName', prop: 'goodsTypeName',
width: 140 formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
return result
},
width: 170
}, { }, {
label: '上架部位', label: '上架部位',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
...@@ -594,9 +607,8 @@ export default { ...@@ -594,9 +607,8 @@ export default {
this.getOptionsList() this.getOptionsList()
}) })
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
getProductTypeBySceneId({ categoryTypeList: this.selfBuildGoodsType }).then(res => { getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
this.baseData.productTypeList = res this.baseData.productTypeList = res?.list || []
this.getOptionsList()
}) })
// 获取全部素材 素材商品来源(0嘀加,1自建商品) // 获取全部素材 素材商品来源(0嘀加,1自建商品)
getList({ currentPage: 1, pageSize: 9999, goodsSource: 0 }).then(res => { getList({ currentPage: 1, pageSize: 9999, goodsSource: 0 }).then(res => {
...@@ -626,6 +638,11 @@ export default { ...@@ -626,6 +638,11 @@ export default {
}), }),
...mapMutations('d2admin/user', ['setUpdateRefesh']), ...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
selectAddAttr(value) {
this.searchForm.goodsType = value?.[0]
this.searchForm.secondaryGoodsType = value?.[1]
this.searchForm.thirdLevelGoodsType = value?.[2]
},
async getBaseData() { async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList) this.positionTypeList = await this.get(BaseData.positionTypeList)
}, },
...@@ -784,12 +801,15 @@ export default { ...@@ -784,12 +801,15 @@ export default {
sceneType: '', sceneType: '',
goodsCode: '', goodsCode: '',
goodsType: '', goodsType: '',
secondaryGoodsType: '',
thirdLevelGoodsType: '',
goodsAlias: '', goodsAlias: '',
status: '', status: '',
yqMerchantId: '', yqMerchantId: '',
goodsSource: 0, goodsSource: 0,
financeCheckFlag: '' financeCheckFlag: ''
} }
this.tempGoodsType = []
// 重新查询 // 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true) this.$refs.groundingIndexTable.refreshTable(true, true)
}, },
......
...@@ -725,6 +725,7 @@ export default { ...@@ -725,6 +725,7 @@ export default {
_formData.positionNamesArr = _positionNamesArr _formData.positionNamesArr = _positionNamesArr
_formData.goodsName = _valueObj?.goodsName _formData.goodsName = _valueObj?.goodsName
_formData.goodsTypeName = _valueObj?.goodsTypeName _formData.goodsTypeName = _valueObj?.goodsTypeName
_formData.tempGoodsTypeName = _valueObj?.tempGoodsTypeName
_formData.goodsType = _valueObj?.goodsType _formData.goodsType = _valueObj?.goodsType
_formData.serviceItemNames = _valueObj?.serviceItemNames _formData.serviceItemNames = _valueObj?.serviceItemNames
_formData.upgradeSupplyMode = '' // 切换上架商品 将升级/产品供货模式清空 _formData.upgradeSupplyMode = '' // 切换上架商品 将升级/产品供货模式清空
......
...@@ -248,6 +248,10 @@ export default { ...@@ -248,6 +248,10 @@ export default {
this.allPages = res.pages this.allPages = res.pages
const resArr = [] const resArr = []
res.list && res.list.forEach(val => { res.list && res.list.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
val.upgradeGoodsList.forEach(v => { val.upgradeGoodsList.forEach(v => {
resArr.push({ resArr.push({
confId: v.id, confId: v.id,
...@@ -257,6 +261,7 @@ export default { ...@@ -257,6 +261,7 @@ export default {
upgradeGoodsName: v?.upgradeGoodsName, upgradeGoodsName: v?.upgradeGoodsName,
goodsName: val?.goodsInfo?.goodsName, goodsName: val?.goodsInfo?.goodsName,
goodsTypeName: val?.goodsInfo?.goodsTypeName, goodsTypeName: val?.goodsInfo?.goodsTypeName,
tempGoodsTypeName: result,
upgradePrice: v?.upgradePrice, upgradePrice: v?.upgradePrice,
purchasePrice: v?.purchasePrice, purchasePrice: v?.purchasePrice,
type: v?.type, type: v?.type,
...@@ -307,6 +312,10 @@ export default { ...@@ -307,6 +312,10 @@ export default {
res.groundingGoodsList = [] res.groundingGoodsList = []
const defaultSelect = [] // 上架商品 默认选中项 const defaultSelect = [] // 上架商品 默认选中项
res?.merchantGoodsInfoList?.forEach(val => { res?.merchantGoodsInfoList?.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
const positionNamesArr = deepClone(this.positionTypeList)?.filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList)?.filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
res.groundingGoodsList.push({ res.groundingGoodsList.push({
id: val.id, id: val.id,
...@@ -315,6 +324,7 @@ export default { ...@@ -315,6 +324,7 @@ export default {
upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称 upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称
goodsAlias: val?.goodsAlias, // 商品别名 goodsAlias: val?.goodsAlias, // 商品别名
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目 goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result, // 商品所属类目
upgradePrice: val?.upgradeGoods?.upgradePrice, // 参考售价 upgradePrice: val?.upgradeGoods?.upgradePrice, // 参考售价
position: val?.position, // 上架部位 position: val?.position, // 上架部位
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称 positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称
......
...@@ -150,6 +150,10 @@ export default { ...@@ -150,6 +150,10 @@ export default {
if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高) if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList arr = upgradeSupplyModeList
} }
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
this.editForm[1].formBlock.push(packageGoodsDetail) this.editForm[1].formBlock.push(packageGoodsDetail)
// 太阳膜类回显部位 // 太阳膜类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
...@@ -159,6 +163,7 @@ export default { ...@@ -159,6 +163,7 @@ export default {
upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称 upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称
goodsAlias: val?.goodsAlias || '-', // 商品别名 goodsAlias: val?.goodsAlias || '-', // 商品别名
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目 goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result, // 商品所属类目
// upgradePrice: val?.upgradePrice, // 参考售价 // upgradePrice: val?.upgradePrice, // 参考售价
positionStr: deepClone(this.positionTypeList)?.filter(subVal => val?.position == subVal.position)[0]?.confName || '', // 上架部位 positionStr: deepClone(this.positionTypeList)?.filter(subVal => val?.position == subVal.position)[0]?.confName || '', // 上架部位
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称 positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<p class="item_class"> <p class="item_class">
<span class="label">类目:</span> <span class="label">类目:</span>
<span class="value">{{ $$(commodityInfo.goodsInfo,'goodsTypeName') }}</span> <span class="value">{{ $$(commodityInfo.goodsInfo,'goodsTypeName') }}</span>
<span class="value" v-if="$$(commodityInfo.goodsInfo,'secondaryGoodsTypeName')">-{{ $$(commodityInfo.goodsInfo,'secondaryGoodsTypeName') }}</span>
<span class="value" v-if="$$(commodityInfo.goodsInfo,'thirdLevelGoodsTypeName')">-{{ $$(commodityInfo.goodsInfo,'thirdLevelGoodsTypeName') }}</span>
</p> </p>
<p class="item_class"> <p class="item_class">
<span class="label">品牌方:</span> <span class="label">品牌方:</span>
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
v-if=" v-if="
item.type === 'input' || item.type === 'input' ||
item.type === 'select' || item.type === 'select' ||
item.type === 'special-select' item.type === 'special-select' ||
item.type === 'cascader'
" "
> >
<el-input <el-input
...@@ -172,6 +173,12 @@ ...@@ -172,6 +173,12 @@
</div> </div>
</div> </div>
</el-select> </el-select>
<!-- 级联选择器 -->
<el-cascader v-else-if="item.type === 'cascader'" :style="{ width: item.width || formItemWidth }" :options="item.optionList"
v-model="formData[item.name]" :placeholder="'请选择' + item.label"
@change="selectAddAttr($event, item)" aria-hidden="false"
:props="{ checkStrictly: true, label: item.optionLabel, value: item.optionId }" :show-all-levels="false">
</el-cascader>
</el-form-item> </el-form-item>
</div> </div>
<!-- 膜类配置字段 1太阳膜 14改色膜 6改色膜(众筹)12车衣 4车衣(众筹)--> <!-- 膜类配置字段 1太阳膜 14改色膜 6改色膜(众筹)12车衣 4车衣(众筹)-->
...@@ -607,6 +614,7 @@ export default { ...@@ -607,6 +614,7 @@ export default {
data() { data() {
return { return {
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
membraneTypeList: baseConfig.membraneTypeList || [],
solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112], solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112],
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
lookImgVisible: false, lookImgVisible: false,
...@@ -642,7 +650,7 @@ export default { ...@@ -642,7 +650,7 @@ export default {
trigger: "blur" trigger: "blur"
} }
], ],
goodsType: [ tempGoodsType: [
{ required: true, message: "请选择类目", trigger: "change" } { required: true, message: "请选择类目", trigger: "change" }
], ],
supplierCode: [ supplierCode: [
...@@ -915,11 +923,30 @@ export default { ...@@ -915,11 +923,30 @@ export default {
selectAddAttr(value, targetItem) { selectAddAttr(value, targetItem) {
this.selectedValue = value this.selectedValue = value
this.editOptionIndex = -1 this.editOptionIndex = -1
if (targetItem.name == "goodsType") { if (targetItem.name == "tempGoodsType") {
var tempVal = targetItem.optionList.find( var tempVal = targetItem.optionList.find(
(item) => item.categoryType === value (item) => item.categoryType === value?.[0]
) )
this.formData.goodsTypeName = tempVal.categoryName let secondGoodsObj
let thirdGoodsObj
targetItem.optionList?.forEach(val => {
val.children?.find(item => {
if (item.categoryType === value?.[1]) {
secondGoodsObj = item
}
item.children?.find(val => {
if (val.categoryType === value?.[2]) {
thirdGoodsObj = val
}
})
})
})
this.formData.goodsType = value?.[0] // 一级类目
this.formData.secondaryGoodsType = value?.[1] || '' // 二级类目
this.formData.thirdLevelGoodsType = value?.[2] || '' // 三级类目
this.formData.goodsTypeName = tempVal.categoryName // 一级类目名
this.formData.secondaryGoodsTypeName = secondGoodsObj?.categoryName || '' // 二级类目名
this.formData.thirdLevelGoodsTypeName = thirdGoodsObj?.categoryName || '' // 三级类目名
const copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock) const copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock)
// 太阳膜类 部位下拉框数据 // 太阳膜类 部位下拉框数据
copyMembranesFormBlock[ copyMembranesFormBlock[
...@@ -929,15 +956,10 @@ export default { ...@@ -929,15 +956,10 @@ export default {
this.membranesFormBlock = [] this.membranesFormBlock = []
if (this.formData.goodsType == 1) { if (this.formData.goodsType == 1) {
this.membranesFormBlock = copyMembranesFormBlock this.membranesFormBlock = copyMembranesFormBlock
} else if ( } else if (this.membraneTypeList?.includes(this.formData.goodsType)) { // 膜类配置比例换算
this.formData.goodsType == 12 ||
this.formData.goodsType == 14 ||
this.formData.goodsType == 4 ||
this.formData.goodsType == 6
) {
this.membranesFormBlock = [copyMembranesFormBlock[1]] this.membranesFormBlock = [copyMembranesFormBlock[1]]
} }
this.setUpdateGoodsInfo({ goodsType: value }) this.setUpdateGoodsInfo({ goodsType: value?.[0] })
} }
// 修改供应方 // 修改供应方
if (targetItem.name == "supplierCode") { if (targetItem.name == "supplierCode") {
...@@ -1338,5 +1360,13 @@ export default { ...@@ -1338,5 +1360,13 @@ export default {
.add_icon { .add_icon {
color: #3fcf77; color: #3fcf77;
} }
::v-deep .el-radio__original {
display: none !important;
}
::v-deep .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled)
.el-radio__inner {
box-shadow: none !important;
}
</style> </style>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<script> <script>
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { getBrandSupplyMerchant, addBrandSupplyMerchant, editBrandSupplyMerchant, getProductTypeBySceneId } from '@/api/product' import { getBrandSupplyMerchant, addBrandSupplyMerchant, editBrandSupplyMerchant, getProductTypeBySceneId, getAllCategory } from '@/api/product'
import productForm from './productForm.vue' import productForm from './productForm.vue'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -29,6 +29,7 @@ export default { ...@@ -29,6 +29,7 @@ export default {
editData: { editData: {
goodsName: '', goodsName: '',
goodsType: '', goodsType: '',
tempGoodsType: [],
goodsTypeName: '', goodsTypeName: '',
sapCode: '', sapCode: '',
brandMerchantCode: '', brandMerchantCode: '',
...@@ -56,10 +57,10 @@ export default { ...@@ -56,10 +57,10 @@ export default {
width: '432px' width: '432px'
}, },
{ {
name: 'goodsType', name: 'tempGoodsType',
label: '类目', label: '类目',
isRequired: true, isRequired: true,
type: 'select', type: 'cascader',
isClear: false, isClear: false,
isDisabled: false, isDisabled: false,
optionList: [], optionList: [],
...@@ -175,10 +176,22 @@ export default { ...@@ -175,10 +176,22 @@ export default {
}), }),
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
getGoodTypeList() { getGoodTypeList() {
getProductTypeBySceneId({ categoryTypeList: this.selfBuildGoodsType }).then(res => { getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
const obj = this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'goodsType')] const obj = this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'tempGoodsType')]
obj.optionList = res obj.optionList = res?.list || []
if (this.addOrEdit === 'edit' && this.formData?.status != 3) obj.isDisabled = true if (this.addOrEdit === 'edit' && this.formData?.status != 3) {
obj.optionList.forEach(item => {
if (item.categoryType != this.editData.goodsType) {
item.disabled = true
item?.children?.forEach(i => {
i.disabled = true
i?.children?.forEach(j => {
j.disabled = true
})
})
}
})
}
}) })
}, },
// 获取品牌/供应方 // 获取品牌/供应方
......
...@@ -8,6 +8,13 @@ ...@@ -8,6 +8,13 @@
:search-form="searchForm" :search-form="searchForm"
:label-width="'100px'" :label-width="'100px'"
:form-data="showFormData"> :form-data="showFormData">
<template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;"
v-model="tempGoodsType" :placeholder="'请选择'"
@change="selectAddAttr($event)"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }" :show-all-levels="false">
</el-cascader>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary"> <el-button :id="tableParams.btnId" size="small" type="primary">
...@@ -112,7 +119,7 @@ ...@@ -112,7 +119,7 @@
<script> <script>
import { Util } from '@/common/util' import { Util } from '@/common/util'
import { getProductManageList, productImport } from '@api/productManage' import { getProductManageList, productImport } from '@api/productManage'
import { getProductTypeBySceneId } from '@api/product' import { getAllCategory } from '@api/product'
import { mapActions, mapState, mapMutations } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
import { baseGoodsDelete } from '@api/commodity' import { baseGoodsDelete } from '@api/commodity'
import drawerDetail from './components/drawerDetail.vue' import drawerDetail from './components/drawerDetail.vue'
...@@ -127,9 +134,12 @@ export default { ...@@ -127,9 +134,12 @@ export default {
commodityCode: '', commodityCode: '',
baseGoodsName: '', baseGoodsName: '',
goodsType: '', goodsType: '',
secondaryGoodsType: '',
thirdLevelGoodsType: '',
baseGoodsStatus: '', baseGoodsStatus: '',
type: '' type: ''
}, },
tempGoodsType: [],
showFormData: [{ showFormData: [{
label: 'ID', label: 'ID',
name: 'commodityCode', name: 'commodityCode',
...@@ -151,11 +161,7 @@ export default { ...@@ -151,11 +161,7 @@ export default {
}, { }, {
label: '类目', label: '类目',
name: 'goodsType', name: 'goodsType',
type: 'select', addHtml: 'goodsCascader'
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}, { }, {
label: '商品状态', label: '商品状态',
name: 'baseGoodsStatus', name: 'baseGoodsStatus',
...@@ -202,7 +208,14 @@ export default { ...@@ -202,7 +208,14 @@ export default {
}, { }, {
label: '类目', label: '类目',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
prop: 'goodsTypeName' prop: 'goodsTypeName',
formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
return result
}
}, { }, {
label: '规格', label: '规格',
prop: 'listShowSpecificationData', prop: 'listShowSpecificationData',
...@@ -302,9 +315,8 @@ export default { ...@@ -302,9 +315,8 @@ export default {
var allOpt = { confId: '', confValue: '全部' } var allOpt = { confId: '', confValue: '全部' }
this.baseData.statusList.unshift(allOpt) this.baseData.statusList.unshift(allOpt)
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
getProductTypeBySceneId({ categoryTypeList: this.selfBuildGoodsType }).then(res => { getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
this.baseData.productTypeList = res this.baseData.productTypeList = res?.list || []
this.getBaseData()
}) })
}, },
...@@ -315,12 +327,13 @@ export default { ...@@ -315,12 +327,13 @@ export default {
}), }),
...mapMutations('d2admin/user', ['setUpdateRefesh']), ...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
selectAddAttr(value) {
this.searchForm.goodsType = value?.[0]
this.searchForm.secondaryGoodsType = value?.[1]
this.searchForm.thirdLevelGoodsType = value?.[2]
},
async getBaseData() { async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList) this.positionTypeList = await this.get(BaseData.positionTypeList)
this.baseData.productTypeList.unshift({
categoryType: '',
categoryName: '全部'
})
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName]) this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
...@@ -406,9 +419,12 @@ export default { ...@@ -406,9 +419,12 @@ export default {
commodityCode: '', commodityCode: '',
baseGoodsName: '', baseGoodsName: '',
goodsType: '', goodsType: '',
secondaryGoodsType: '',
thirdLevelGoodsType: '',
baseGoodsStatus: '', baseGoodsStatus: '',
type: '' type: ''
} }
this.tempGoodsType = []
this.$refs.productManageTable.refreshTable(true, true) this.$refs.productManageTable.refreshTable(true, true)
}, },
handleAdd(form) { handleAdd(form) {
......
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!