Commit c4aa2c78 by 张立顺

Merge branch 'SAAS+V5.6.1' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into SAAS+V5.6.1
2 parents ba0a601f f0a47330
Showing 103 changed files with 4688 additions and 162 deletions
# 忽略目录
build/
tests/
node_modules/
# node 覆盖率文件
coverage/
# 忽略文件
**/*-min.js
**/*.min.js
**/*.vue
......@@ -6,6 +6,7 @@
"vuex",
"Cascader"
],
"eslint.enable": true,
"explorer.compactFolders": false,
"scm.compactFolders": false,
"problems.decorations.enabled": false,
......
......@@ -30,7 +30,9 @@ const request = (
apiName = "dj.smartcarlife"
} else if (params.method.includes("risk.manage.api")) {
apiName = "riskmanage"
}else {
} else if (params.method.includes("dj.api.strategy")) {
apiName = "strategy"
} else {
// console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0]
}
......@@ -52,7 +54,8 @@ const request = (
"dj.businessSchool": "axios6",
script: "axios7",
staff: "axios9",
riskmanage:"axios10",
riskmanage: "axios10",
strategy: 'axios_strategy'
}
const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName")
......@@ -88,7 +91,7 @@ const request = (
clue: "sha1",
script: "sha1",
staff: "sha1",
riskmanage:'sha1'
riskmanage: 'sha1'
}
// console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret
......
No preview for this file type
......@@ -329,17 +329,20 @@ $prefix: d2;
height: 200px !important;
overflow-y: scroll;
}
.tools-gltip {
.el-tooltip__popper.tools-gltip {
width: 238px !important;
height: auto !important;
background: #fff;
height: 95px !important;
}
.el-tooltip__popper.is-light {
width: 177px;
max-width: 400px;
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08) !important;
border: 1px solid #e4e7ed !important;
color: #666;
width: fit-content;
.tooltip-content-max{
max-height: 50vh;
overflow-y: auto;
}
}
.el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow {
......@@ -347,9 +350,14 @@ $prefix: d2;
}
.el-tooltip__popper.is-dark {
white-space: wrap;
width: 400px;
max-width: 400px;
height: auto;
padding: 8px 10px;
width: fit-content;
.tooltip-content-max{
max-height: 50vh;
overflow-y: auto;
}
}
.el-textarea {
.el-input__count {
......
......@@ -15,6 +15,8 @@
:span-method="arraySpanMethod"
v-bind="$attrs"
v-scroll="scroll"
@select="handleSelectRow"
@select-all="handleSelectAll"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
......@@ -362,6 +364,7 @@
:page-size="page.pageSize"
:total="getListApi ? total : tableTotal"
:layout="layout"
:pager-count="pagerCount"
/>
</div>
</template>
......@@ -561,6 +564,15 @@ export default {
noDataText: {
type: String,
default: "暂无数据"
},
pagerCount: {
type: Number,
default: 7
}
},
computed:{
tableRef(){
return this.$refs[this.tableParams.mutiSelectName + 'MutiTable' || 'mutiTable']
}
},
......@@ -594,9 +606,8 @@ export default {
handleSelect(val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val
// 多选
this.$emit("selectionTable", val)
this.$emit("selectionTable", val, this.page.currentPage)
},
// 清空多选
clearMutiSelect() {
this.mutiSelectArr[this.tableParams.mutiSelectName] = []
......@@ -742,7 +753,7 @@ export default {
}
this.total = res.total
this.loading = false
this.$emit("setTableFinishFun", this.data)
this.$emit("setTableFinishFun", this.data , this.page.currentPage)
})
.catch(() => {
this.loading = false
......@@ -788,7 +799,15 @@ export default {
},
scroll(e) {
this.$emit("scroll", e)
}
},
//当用户手动勾选数据行的 Checkbox 时触发的事件 selection, row
handleSelectRow(selection, row){
this.$emit("selectRow", selection, row)
},
// 当用户手动勾选数据行的 Checkbox 时触发的事件 selection
handleSelectAll(selection){
this.$emit("selectAll", selection)
},
}
}
</script>
......
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import { uploadImg, syncUploadVideo, uploadVideo } from "@/api/sys.base"
import E from "wangeditor"
export default {
name: "TextBox",
data() {
return {
editor: "",
content: "",
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ["code"]
},
boxHeight: {
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E("#div-demo")
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = "down"
this.editor.config.height = this.boxHeight
this.editor.config.width = "500px"
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = (html) => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit("change", this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit("focus")
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传图片大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const imgFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
imgFile.split(",")[1]
// _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
uploadImg({ file: base64, compress: 0 }).then((res) => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function (
resultFiles,
insertVideoFn
) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传视频大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const videoFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
videoFile.split(",")[1]
_this.$apis.common.pictureUpload({ file: base64 }).then((res) => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
width: 575px;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import { uploadImg, syncUploadVideo, uploadVideo } from "@/api/sys.base"
import { set } from "nprogress";
import E from "wangeditor"
export default {
name: "TextBox",
data () {
return {
editor: "",
content: "",
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ["code"]
},
boxHeight: {
type: Number,
default: 240
}
},
mounted () {
this.getEdit()
},
methods: {
getEdit () {
const _this = this
this.editor = new E("#div-demo")
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = "down"
this.editor.config.height = this.boxHeight
this.editor.config.width = "500px"
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = (html) => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit("change", this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit("focus")
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传图片大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const imgFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
imgFile.split(",")[1]
// _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
uploadImg({ file: base64, compress: 0 }).then((res) => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function (
resultFiles,
insertVideoFn
) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传视频大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const videoFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
videoFile.split(",")[1]
_this.$apis.common.pictureUpload({ file: base64 }).then((res) => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.config.focus = false // 解决编辑器内输入框获取焦点
this.editor.create()
},
setEdit (html) {
if (html) this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit () {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
width: 575px;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
......@@ -182,5 +182,53 @@ util.formatTime = function (time) {
}
}
/**
* 防抖函数
*/
util.debounce = function (func, wait = 300, immediate = false) {
let timeout = null
let result
const debounced = function (...args) {
const context = this
// 清除之前的定时器
if (timeout) {
clearTimeout(timeout)
}
// 如果设置了立即执行
if (immediate) {
// 如果还没有执行过,立即执行
const callNow = !timeout
timeout = setTimeout(() => {
timeout = null
}, wait)
if (callNow) {
result = func.apply(context, args)
}
} else {
// 延迟执行
timeout = setTimeout(() => {
func.apply(context, args)
timeout = null
}, wait)
}
return result
}
// 添加取消方法
debounced.cancel = function () {
if (timeout) {
clearTimeout(timeout)
timeout = null
}
}
return debounced
}
export default util
export const deepClone = util.deepClone
export const debounce = util.debounce
......@@ -141,5 +141,54 @@ export const routerName = {
}
],
component: _import("earlyWarningManager/biEventManager/index")
}
},
91506: {
path: "/strategyCentre",
name: "strategyCentre",
meta: {
title: "策略中心",
authId: "91506",
parentId: "915",
cache: false
},
auth: [
{
authId: "9150601",
parentId: "91506",
label: "查看详情",
handle: "handleDetail",
addRoutePath: [
{
authId: "9150602",
name: "门店看板",
parentId: "91506"
}
]
}
],
component: _import("earlyWarningManager/strategyCentre/index")
},
91507: {
path: "/strategyAnalysis",
name: "strategyAnalysis",
meta: {
title: "策略分析",
authId: "91507",
parentId: "915",
cache: false
},
component: _import("earlyWarningManager/strategyAnalysis/index")
},
9150602: {
path: "/storeSignboard",
name: "storeSignboard",
meta: {
title: "门店看板",
authId: "9150601",
parentId: "91506",
activePath: "/storeSignboard",
cache: false
},
component: _import("earlyWarningManager/strategyCentre/storeSignboard/index")
},
}
<template>
<div class="dashboard-card rank-card">
<div class="card-header">
<span class="card-title">线上运营分布</span>
</div>
<div class="rank-list">
<!-- 表头 -->
<div class="rank-header">
<span class="rank-header-col" style="flex: 1;">排名</span>
<span class="rank-header-col" style="flex: 1;">姓名</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">策略总数</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">占比</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">门店总数</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">占比</span>
</div>
<!-- 列表内容 -->
<block v-if="rankData.length > 0">
<div
class="rank-item"
v-for="(item, index) in rankData"
:key="index"
>
<!-- 排名 Icon 处理 -->
<div
class="rank-index"
:class="'rank-' + (index + 1)"
>
<img
v-if="index < 3"
:src="require(`@/assets/strategy/icon-strategy-rank0${index + 1}.png`)"
style="width: 24px; height: 24px;"
/>
<span
v-else
style="width: 20px; height: 20px; border-radius: 50%; opacity: 1; background: #2a58ad1a; display: inline-block; text-align: center; line-height: 20px;"
>{{ index + 1 }}</span>
</div>
<div class="rank-name" :title="item.staffName">{{ item.staffName }}</div>
<div class="rank-col">{{ item.strategyCount }}</div>
<div class="rank-col">{{ item.strategyCountPercent }}%</div>
<div class="rank-col">{{ item.storeCount }}</div>
<div class="rank-col">{{ item.storeCountPercent }}%</div>
</div>
</block>
<block v-else>
<!-- 空数据占位,实际显示在 .dashboard-card 层级 -->
</block>
</div>
<div v-if="rankData.length === 0" class="empty-box">
<img :src="noDataImg" alt="暂无数据">
<div class="empty-text">暂无数据</div>
</div>
<div class="bottom-cover"></div>
</div>
</template>
<script>
import noDataImg from "@/assets/strategy/emepty-strategy.png"
export default {
name: 'OnlineOperatorRanking',
props: {
// 排行榜数据(由父组件传递)
rankData: {
type: Array,
default: () => []
}
},
data() {
return {
noDataImg
};
}
};
</script>
<style lang="scss" scoped>
$bg-white: #fff;
.dashboard-card {
background: $bg-white;
border-radius: 4px;
padding: 20px;
padding-right: 28px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
position: relative;
&.rank-card {
height: 332px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.card-title {
font-size: 16px;
font-weight: 500;
color: #303133;
}
}
.bottom-cover {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 72px;
border-radius: 10px;
background: linear-gradient(0deg, #ffffff 0%, #ffffff00 100%);
}
}
/* 排行榜样式 */
.rank-list {
font-size: 13px;
.rank-header {
display: flex;
color: #909399;
.rank-header-col {
display: inline-block;
}
}
.rank-item {
display: flex;
align-items: center;
box-sizing: border-box;
margin-top: 16px;
&:last-child {
border-bottom: none;
}
.rank-index {
flex: 1;
}
.rank-name {
flex: 1;
color: #303133;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.rank-col {
flex: 1;
text-align: center;
color: #606266;
}
}
}
.empty-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 12px;
color: #909399;
text-align: center;
width: calc(100% - 48px); // 减去左右 padding (20px + 28px)
box-sizing: border-box;
img {
width: 86px;
height: 86px;
}
.empty-text {
margin-top: 0;
}
}
</style>
<template>
<div class="dashboard-card chart-card">
<div class="card-header">
<span class="card-title">策略类型分布</span>
<div class="operator-filter">
线上运营人员:
<el-select
:value="operatorFilter"
size="mini"
style="width: 120px;"
@change="handleOperatorChange"
>
<el-option
v-for="operator in operatorList"
:key="operator.value"
:label="operator.label"
:value="operator.value"
></el-option>
</el-select>
</div>
</div>
<div class="chart-container" v-show="hasChartData">
<!-- ECharts 容器 -->
<div ref="pieChart" class="echart-box"></div>
<!-- 自定义图例 -->
<div class="custom-legend">
<div
class="legend-item"
v-for="(item, index) in processedPieData"
:key="index"
>
<div
class="legend-dot"
:style="{ background: item.color }"
></div>
<div class="legend-name">{{ item.name }}</div>
<div class="legend-right">
<div class="legend-percent">{{ item.percent }}%</div>
<span class="legend-sep">|</span>
<div class="legend-value">{{ item.value }}</div>
</div>
</div>
</div>
</div>
<div v-show="!hasChartData" class="empty-box">
<img :src="noDataImg" alt="暂无数据">
<div class="empty-text">暂无数据</div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import { merchantStaffByRoleList } from '@api/index';
import noDataImg from "@/assets/strategy/emepty-strategy.png";
/**
* 策略类型配置(统一管理名称和颜色)
* @type {Object<number, {name: string, color: string}>}
*/
const STRATEGY_TYPE_CONFIG = {
0: { name: '学习', color: '#409EFF' },
1: { name: '优秀案例分享', color: '#36CBCB' },
2: { name: '带教', color: '#67C23A' },
3: { name: '任务下发', color: '#FFD666' },
4: { name: '销售精英到店提拉', color: '#B3E19D' },
5: { name: '强力促销', color: '#E6A23C' },
6: { name: '最终盘点与低客单产品购入', color: '#9254DE' }
};
/**
* 获取策略类型配置
* @param {number} strategyType - 策略类型编号
* @returns {{name: string, color: string}}
*/
const getStrategyTypeConfig = (strategyType) => {
return STRATEGY_TYPE_CONFIG[strategyType];
};
/**
* 转换策略类型分布数据为图表数据格式
* @param {Array} apiData - API 返回的原始数据
* @returns {Array} 图表数据
*/
const transformStrategyData = (apiData) => {
if (!Array.isArray(apiData) || apiData.length === 0) {
return [];
}
// 过滤有效数据并计算总数
const validData = apiData.filter(item => (item.strategyCount || 0) > 0);
const total = validData.reduce((sum, item) => sum + (item.strategyCount || 0), 0);
// 转换数据格式
return validData
.map(item => {
const { strategyType, strategyCount = 0, percent } = item;
const config = getStrategyTypeConfig(strategyType);
const calculatedPercent = percent ?? (total > 0 ? Math.round((strategyCount / total) * 100) : 0);
return {
name: config.name,
value: strategyCount,
percent: calculatedPercent,
color: config.color,
strategyType // 保留原始类型用于调试
};
})
.sort((a, b) => b.value - a.value); // 按数量降序排序
};
export default {
name: 'StrategyTypeDistribution',
props: {
// 策略类型分布原始数据(由父组件传递)
pieData: {
type: Array,
default: () => []
},
// 运营人员筛选值(双向绑定)
operatorFilter: {
type: [String, Number],
default: null
}
},
data() {
return {
noDataImg,
myChart: null,
// 运营人员列表
operatorList: [
{ label: '全部', value: null },
],
// 处理后的图表数据
processedPieData: []
};
},
computed: {
/**
* 图表数据总数
*/
chartTotal() {
return this.processedPieData.reduce((sum, item) => sum + (item.value || 0), 0);
},
/**
* 图表是否有数据
*/
hasChartData() {
return this.processedPieData.length > 0 && this.chartTotal > 0;
},
/**
* ECharts 配置项
*/
chartOption() {
return this.getChartOption();
}
},
watch: {
// 监听原始数据变化,处理数据并更新图表
pieData: {
handler(newData) {
this.processedPieData = transformStrategyData(newData);
this.$nextTick(() => {
this.updateChart();
});
},
immediate: true,
deep: true
}
},
mounted() {
this.initChart();
window.addEventListener('resize', this.resizeChart);
// 获取线上运营列表
this.getOnlineOpsList();
// 数据加载由 watch 统一管理,无需在此处调用
},
beforeDestroy() {
// 清理图表实例
if (this.myChart) {
this.myChart.dispose();
this.myChart = null;
}
// 清理事件监听器
window.removeEventListener('resize', this.resizeChart);
},
methods: {
/**
* 获取线上运营列表
*/
getOnlineOpsList() {
merchantStaffByRoleList({ roleName: '线上运营' }).then((res) => {
if (res) {
// 将返回的数据转换为选择器需要的格式
this.operatorList = res.map(item => ({
value: item.uuid,
label: item.staffName
}));
// 在列表前面添加"全部"选项
if (this.operatorList.length && this.operatorList[0].label !== '全部') {
this.operatorList.unshift({
value: null,
label: '全部'
});
}
}
});
},
/**
* 处理运营人员选择变化
*/
handleOperatorChange(value) {
// 通过 .sync 修饰符自动更新父组件的值
this.$emit('update:operatorFilter', value);
},
/**
* 生成 ECharts 配置项
* @returns {Object} ECharts 配置对象
*/
getChartOption() {
return {
series: [
{
name: '策略总数',
type: 'pie',
radius: ['55%', '75%'],
center: ['50%', '50%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 0,
borderColor: '#fff',
borderWidth: 2,
},
label: {
show: true,
position: 'center',
formatter: this.hasChartData ? `策略总数` : '暂无数据',
fontSize: 18,
color: '#666666',
lineHeight: 20
},
emphasis: {
},
labelLine: {
show: false
},
data: this.processedPieData.map(item => ({
value: item.value,
name: item.name,
itemStyle: { color: item.color }
}))
}
]
};
},
/**
* 更新图表(使用 computed 配置)
*/
updateChart() {
if (!this.myChart) {
console.warn('图表实例未初始化');
return;
}
try {
this.myChart.setOption(this.chartOption, true); // true 表示不合并,使用新配置
} catch (error) {
console.error('图表更新失败:', error);
}
},
/**
* 初始化图表
*/
initChart() {
const chartDom = this.$refs.pieChart;
if (!chartDom) return;
this.myChart = echarts.init(chartDom);
// 初始时使用空数据,等待API数据加载后再更新
this.updateChart();
},
/**
* 图表窗口大小调整
*/
resizeChart() {
if (this.myChart) {
this.myChart.resize();
}
},
}
};
</script>
<style lang="scss" scoped>
$bg-white: #fff;
.dashboard-card {
background: $bg-white;
border-radius: 4px;
padding: 20px;
padding-right: 28px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
position: relative;
&.chart-card {
height: 332px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.card-title {
font-size: 16px;
font-weight: 500;
color: #303133;
}
.operator-filter {
font-size: 13px;
color: #909399;
}
}
}
/* 图表容器样式 */
.chart-container {
display: flex;
align-items: center;
justify-content: flex-end;
}
.echart-box {
width: 200px;
height: 200px;
flex-shrink: 0;
}
.custom-legend {
font-size: 13px;
margin-left: 20%;
.legend-item {
display: flex;
align-items: center;
margin-bottom: 12px;
color: #606266;
width: 306px;
.legend-dot {
width: 8px;
height: 8px;
border-radius: 2px;
margin-right: 8px;
}
.legend-name {
flex: 1;
}
.legend-right {
display: flex;
align-items: center;
justify-content: flex-end;
}
.legend-percent {
text-align: right;
color: #909399;
}
.legend-value {
text-align: right;
color: #303133;
font-weight: 500;
}
.legend-sep {
color: #E4E7ED;
margin: 0 8px;
}
}
}
.empty-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 12px;
color: #909399;
text-align: center;
width: calc(100% - 48px); // 减去左右 padding (20px + 28px)
box-sizing: border-box;
img {
width: 86px;
height: 86px;
}
.empty-text {
margin-top: 0;
}
}
</style>
<template>
<div class="top-header">
<!-- 左侧 Tabs -->
<div class="tabs-nav" ref="tabsNav">
<div
v-for="(tab, index) in tabs"
:key="getTabKey(tab, index)"
:ref="`tabItem${index}`"
:class="['tab-item', { active: isTabActive(tab) }]"
@click="switchTab(tab)"
>
{{ getTabLabel(tab) }}
</div>
<!-- 选中指示条 - 独立元素,通过动态计算位置实现滑动效果 -->
<div
class="active-line"
:style="activeLineStyle"
></div>
</div>
<!-- 右侧 筛选区 + 按钮 -->
<div class="filter-area" v-if="showRightArea">
<div class="filter-group">
<span class="label">区域:</span>
<el-select
v-model="localFilters.provinceId"
size="small"
placeholder="全部"
class="filter-select"
filterable
clearable
>
<el-option
v-for="item in provinceOptions"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</div>
<div class="filter-group">
<span class="label">品牌:</span>
<el-cascader
v-model="localFilters.brand"
:options="brandOptions"
:props="cascaderProps"
collapse-tags
size="small"
filterable
class="filter-select-brand"
placeholder="全部"
:show-all-levels="false"
clearable></el-cascader>
</div>
<div class="filter-group">
<span class="label">区域运营:</span>
<el-select v-model="localFilters.regionOps" size="small" placeholder="全部" class="filter-select" filterable clearable>
<el-option
v-for="item in regionOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</div>
<div class="filter-group">
<span class="label">线上运营:</span>
<el-select v-model="localFilters.onlineOps" size="small" placeholder="全部" class="filter-select" filterable clearable>
<el-option
v-for="item in onlineOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</div>
<!-- 按钮组 -->
<div class="btn-group">
<el-button type="primary" size="small" class="btn-search" @click="handleSearch">查询</el-button>
<el-button size="small" class="btn-reset" @click="handleReset">重置</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'HeaderCustom',
props: {
// Tabs 配置
tabs: {
type: Array,
default: () => ['延保', '权益', '轻改']
},
// 当前选中的 Tab
value: {
type: [String, Object],
default: () => ({label:'延保',value:0})
},
// 筛选条件
filters: {
type: Object,
default: () => ({
region: '',
provinceId: '',
brand: [],
regionOps: '',
onlineOps: ''
})
},
// 品牌级联选择器数据
brandOptions: {
type: Array,
default: () => []
},
// 省份选项数据
provinceOptions: {
type: Array,
default: () => []
},
// 城市选项数据
cityOptions: {
type: Array,
default: () => []
},
// 区域运营选项数据
regionOpsOptions: {
type: Array,
default: () => []
},
// 线上运营选项数据
onlineOpsOptions: {
type: Array,
default: () => []
},
// 控制筛选区域是否展示
showRightArea: {
type: Boolean,
default: false
}
},
data() {
return {
currentTab: this.value,
activeLineStyle: { transform: 'translateX(0px)', width: '52px' },
localFilters: {
...this.filters,
provinceId: this.filters.provinceId || ''
},
// 级联选择器配置
cascaderProps: {
value: 'id',
label: 'label',
children: 'children',
expandTrigger: 'hover',
emitPath: true,
checkStrictly: true, // 允许选择任意一级
multiple: true // 启用多选功能(Element UI 2.x 需要在 props 中配置)
}
};
},
watch: {
// 监听外部传入的 value 变化
value(newVal) {
this.currentTab = newVal;
this.$nextTick(this.updateActiveLinePosition);
},
// 监听外部传入的 filters 变化
filters: {
handler(newVal) {
this.localFilters = {
...newVal,
provinceId: newVal.provinceId || ''
};
},
deep: true
}
},
mounted() {
this.$nextTick(this.updateActiveLinePosition);
},
methods: {
switchTab(tab) {
this.currentTab = tab;
this.$emit('input', tab);
this.$emit('tab-change', tab);
this.$nextTick(this.updateActiveLinePosition);
},
updateActiveLinePosition() {
const currentIndex = this.getCurrentTabIndex();
const tabItemRef = this.$refs[`tabItem${currentIndex}`];
if (!tabItemRef?.[0]) return;
const { offsetLeft, offsetWidth } = tabItemRef[0];
this.activeLineStyle = {
transform: `translateX(${offsetLeft}px)`,
width: `${offsetWidth}px`
};
},
// 获取 tab 的 key(用于 v-for)
getTabKey(tab, index) {
if (typeof tab === 'string') {
return tab;
}
return tab.value !== undefined ? tab.value : index;
},
// 获取 tab 的 label(用于显示)
getTabLabel(tab) {
if (typeof tab === 'string') {
return tab;
}
return tab.label || tab;
},
// 判断 tab 是否激活
isTabActive(tab) {
if (typeof this.currentTab === 'string' && typeof tab === 'string') {
return this.currentTab === tab;
}
if (typeof tab === 'object' && typeof this.currentTab === 'object') {
// 比较 value 或整个对象
if (tab.value !== undefined && this.currentTab.value !== undefined) {
return tab.value === this.currentTab.value;
}
// 如果没有 value,比较 label
if (tab.label !== undefined && this.currentTab.label !== undefined) {
return tab.label === this.currentTab.label;
}
// 最后比较整个对象
return JSON.stringify(tab) === JSON.stringify(this.currentTab);
}
// 混合类型比较:字符串和对象
if (typeof tab === 'object' && typeof this.currentTab === 'string') {
return tab.label === this.currentTab;
}
if (typeof tab === 'string' && typeof this.currentTab === 'object') {
return tab === this.currentTab.label;
}
return false;
},
// 获取当前 tab 的索引
getCurrentTabIndex() {
return this.tabs.findIndex(tab => this.isTabActive(tab));
},
handleSearch() {
this.$emit('search', { ...this.localFilters });
},
handleReset() {
const resetFilters = {
region: '',
provinceId: '',
brand: [],
regionOps: '',
onlineOps: ''
};
this.localFilters = { ...resetFilters };
this.$emit('reset', resetFilters);
this.$emit('search', resetFilters);
}
}
};
</script>
<style lang="scss" scoped>
// 颜色变量
$primary: #2A58AD;
$text-main: #1D2129;
$text-sub: #333333;
$text-sub-2: #666666;
$border: #E5E6EB;
$bg-red: #FEF0F0;
$text-red: #F53F3F;
$bg-orange: #FDF6EC;
$text-orange: #FF7D00;
// ================= Top Header =================
.top-header {
background: #fff;
height: 54px;
display: flex;
align-items: center;
padding: 0 24px;
border-radius: 4px;
margin-bottom: 1px;
position: sticky;
top: 0;
z-index: 100;
// 确保 sticky 定位正常工作
flex-shrink: 0;
}
.tabs-nav {
position: relative;
display: flex;
height: 100%;
.tab-item {
height: 100%;
width: 54px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 32px;
font-size: 16px;
color: $text-sub;
cursor: pointer;
transition: all 0.2s;
&:hover { color: $primary; }
&.active { color: $primary; font-weight: 500; font-size: 16px;}
}
}
.active-line {
position: absolute;
bottom: 0;
left: 0;
height: 3px;
background: $primary;
border-radius: 2px 2px 0 0;
transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.filter-area {
display: flex;
align-items: center;
justify-content: flex-end;
margin-left: auto;
.filter-group {
display: flex;
align-items: center;
margin-right: 24px;
.label { font-size: 14px; color: $text-sub; margin-right: 8px; white-space: nowrap; }
.filter-select { width: 123px; }
.filter-select-brand {
min-width: 120px;
width: auto;
}
}
.btn-group { display: flex; gap: 12px; }
.btn-search { background: $primary; border-color: $primary; border-radius: 4px;&:hover { opacity: 0.9; }}
.btn-reset { background: #F2F3F5; border-color: #F2F3F5; color: $text-sub; &:hover { background: #e5e6eb; } border-radius: 4px;}
}
// 覆盖 Element UI 样式
::v-deep {
.el-input__inner {
border-radius: 2px;
border-color: $border;
color: $text-main;
&:hover { border-color: #C9CDD4; }
&:focus { border-color: $primary; }
}
.el-button--small { border-radius: 2px; }
// 确保级联选择器的 input 宽度自适应
.filter-select-brand {
.el-input {
width: 100%;
}
.el-input__inner {
width: 100%;
min-width: 120px;
}
.el-cascader__tags {
flex-wrap: nowrap;
}
}
}
</style>
<template>
<div class="monitor-card" :class="{ 'is-checked': cardData.checked }">
<div class="card-head">
<el-tooltip effect="dark" placement="bottom" popper-class="dark-tooltip" :disabled="!cardData.storeName">
<div slot="content" style="width:236px;line-height:1.6;word-break:break-all;">{{ cardData.storeName }}</div>
<div class="company-name">{{ cardData.storeName }}</div>
</el-tooltip>
<el-checkbox @change="handleCheckboxChange" v-model="cardData.checked" class="card-checkbox"></el-checkbox>
</div>
<div class="card-body" @click="handleViewDetail">
<div class="row-item">
<span class="label">主营品牌:</span>
<el-tooltip effect="dark" placement="top" popper-class="dark-tooltip" :disabled="!cardData.mainBrands">
<div slot="content" style="max-width:236px;line-height:1.6;word-break:break-all;">{{ cardData.mainBrands }}</div>
<span class="val">{{ cardData.mainBrands || '-' }}</span>
</el-tooltip>
</div>
<div class="row-item">
<span class="label">线上运营:</span>
<el-tooltip :disabled="!cardData.onlineOperators" effect="dark" placement="top" popper-class="dark-tooltip">
<div slot="content" style="max-width:236px;line-height:1.6;">{{ cardData.onlineOperators }}</div>
<span class="val">{{ cardData.onlineOperators || '-' }}</span>
</el-tooltip>
</div>
<div class="row-item">
<span class="label">区域运营:</span>
<el-tooltip :disabled="!cardData.regionalOperators" effect="dark" placement="top" popper-class="dark-tooltip">
<div slot="content" style="max-width:236px;line-height:1.6;">{{ cardData.regionalOperators }}</div>
<span class="val">{{ cardData.regionalOperators || '-' }}</span>
</el-tooltip>
</div>
<!-- 预警标签组 -->
<div v-if="cardData.warningSummary && cardData.warningSummary.length > 0" class="alert-group">
<div v-for="(item, index) in cardData.warningSummary" :key="index" :class="['alert-tag', item.includes('兜底预警') ? 'red' : 'orange']">
<img :src="getAlertIcon(item)" alt="" class="icon-img">
<span style=" font-size: 13px;">{{ item }}</span>
</div>
</div>
</div>
<div class="card-foot" @click="handleViewDetail">
<span class="info">共{{ cardData.warningTotalCount }}项预警</span>
<span class="link">查看详情 <img src="@/assets/strategy/icon-strategy-arrow-r.png" alt="" srcset="" class="icon-arrow"></span>
</div>
</div>
</template>
<script>
export default {
name: 'MonitorCard',
props: {
// 卡片数据
cardData: {
type: Object,
required: true,
default: () => ({})
},
// 卡片索引
index: {
type: Number,
default: 0
},
// 时间范围类型
timeRangeType: {
type: Object,
default: () => ({ label: '周', value: 1 })
},
// 日期范围
dateRange: {
type: Object,
default: () => ({ startDate: null, endDate: null })
}
},
methods: {
handleCheckboxChange() {
// 触发复选框变化事件,传递卡片数据和索引
this.$emit('checkbox-change', this.cardData, this.index);
},
handleViewDetail() {
// 获取 merchantNo 并跳转到门店看板页面
if (this.cardData.merchantNo) {
// 构建查询参数
const query = {
merchantNo: this.cardData.merchantNo,
storeName: this.cardData.storeName
};
// 添加时间范围类型
if (this.timeRangeType && this.timeRangeType.value !== undefined) {
query.timeRangeType = this.timeRangeType.value;
}
// 添加日期范围
if (this.dateRange) {
if (this.dateRange.startDate) {
query.startDate = this.dateRange.startDate;
}
if (this.dateRange.endDate) {
query.endDate = this.dateRange.endDate;
}
}
this.$router.push({
path: '/storeSignboard',
query
});
}
},
// 获取预警图标
getAlertIcon(item) {
// Tode: 数据未返回具体字段类型,因此经沟通智能暂时先通过字符串截取判断
return item.includes('兜底预警')
? require('@/assets/strategy/icon-strategy-type01.png')
: require('@/assets/strategy/icon-strategy-type02.png');
},
// 获取预警标签文本
getAlertLabel(index) {
return index === 0 ? '兜底指标:' : '生态预警:';
}
}
};
</script>
<style lang="scss" scoped>
// 颜色变量
$primary: #2A58AD;
$text-main: #1D2129;
$text-sub: #333333;
$bg-red: #FEF0F0;
$text-red: #F53F3F;
$bg-orange: #FDF6EC;
$text-orange: #FF7D00;
.monitor-card {
background: #fff;
border-radius: 8px;
border: 1px solid #0000001a;
box-shadow: 0 0 8px 0 #0000000d;
min-height: 266px;
transition: all 0.3s;
display: flex;
flex-direction: column;
&:hover {
border: 1px solid #0000001a;
background: #f9f9f9;
box-shadow: 0 0 8px 0 #0000000d;
}
.card-head {
padding: 16px 20px 0;
display: flex;
justify-content: space-between;
align-items: flex-start;
.company-name {
flex: 1;
padding-right: 10px;
font-size: 16px;
font-weight: 500;
color: $text-main;
line-height: 1.4;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-checkbox { transform: scale(1.1); margin-top: 2px; }
}
.card-body {
padding: 12px 20px 16px;
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
padding-bottom: 0px;
cursor: pointer;
.row-item {
display: flex;
margin-bottom: 8px;
font-size: 14px;
line-height: 1.5;
.label { color: #666666; white-space: nowrap; }
.val { color: $text-main; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.alert-group { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.alert-tag {
padding: 7px 10px;
border-radius: 4px;
font-size: 12px;
display: flex;
align-items: center;
color: #606266;
i { margin-right: 6px; font-size: 14px; }
.icon-img {
width: 18px;
height: 18px;
border-radius: 3px;
margin-right: 6px;
object-fit: contain;
}
&.red { background: $bg-red; i { color: $text-red; } }
&.orange { background: $bg-orange; i { color: $text-orange; } }
}
}
.card-foot {
padding: 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 13px;
height: 42px;
.info { color: #86909C; }
.link {
color: $primary;
cursor: pointer;
display: flex;
align-items: center;
i { font-size: 12px; margin-left: 4px; }
.icon-arrow {
width: 16px;
height: 16px;
margin-left: 6px;
padding-top: 2px;
}
&:hover { opacity: 0.8; }
}
}
}
</style>
<style>
/* 全局样式 - tooltip 样式 */
.dark-tooltip { background: #000000 !important; }
</style>
<template>
<el-popover
placement="bottom-start"
:width="popoverWidth"
trigger="click"
popper-class="pure-popover"
v-model="popoverVisible"
>
<ul class="popover-list">
<li
v-for="(item, index) in options"
:key="index"
:class="{ 'is-selected': isSelected(item) }"
@click="handleSelect(item)"
style="font-size: 14px;"
>
<!-- 支持图片图标 -->
<img
v-if="item.iconUrl"
:src="item.iconUrl"
alt=""
class="icon-img"
>
<!-- 支持字体图标 -->
<i
v-else-if="item.icon"
:class="item.icon"
></i>
{{ item.label }}
</li>
</ul>
<div
slot="reference"
class="icon-text-btn"
:class="{ 'has-selected': value && value.label && value.label !== defaultText }"
>
<!-- 触发按钮图标:支持图片和字体图标 -->
<img
v-if="triggerIconType === 'image'"
:src="triggerIcon"
alt=""
class="icon-img"
>
<i
v-else-if="triggerIconType === 'icon'"
:class="triggerIcon"
></i>
<span>{{ label }}:{{ currentValue }}</span>
</div>
</el-popover>
</template>
<script>
export default {
name: 'SelectCustom',
props: {
// 选项列表
options: {
type: Array,
required: true,
default: () => []
},
// 当前选中的值
value: {
type: Object,
default: () => ({ label: '盯防类型', value: '' })
},
// 标签文本(如"盯防类型"、"指标类型")
label: {
type: String,
required: true
},
// 触发按钮的图标(可以是图片路径或图标类名)
triggerIcon: {
type: String,
required: true
},
// 触发按钮图标类型:'image' | 'icon'
triggerIconType: {
type: String,
default: 'icon',
validator: (value) => ['image', 'icon'].includes(value)
},
// 默认文本(用于判断是否选中状态)
defaultText: {
type: String,
default: '全部'
},
// popover宽度
popoverWidth: {
type: Number,
default: 120
}
},
data() {
return {
popoverVisible: false
};
},
computed: {
// 当前显示的值
currentValue() {
if (this.value && typeof this.value === 'object' && this.value.label) {
return this.value.label;
}
return this.defaultText;
}
},
methods: {
// 处理选择
handleSelect(item) {
this.popoverVisible = false;
// 触发change事件,传递选中的项
this.$emit('change', item);
// 同时触发input事件,支持v-model,传递包含label和value的对象
const selectedValue = {
label: item.label,
value: item.value !== undefined ? item.value : item.label
};
this.$emit('input', selectedValue);
},
// 判断选项是否被选中
isSelected(item) {
if (!this.value) return false;
// 优先比较value属性,如果没有value则比较label
const itemValue = item.value !== undefined ? item.value : item.label;
const currentValue = this.value.value !== undefined ? this.value.value : this.value.label;
return itemValue === currentValue;
}
}
};
</script>
<style lang="scss" scoped>
.icon-text-btn {
cursor: pointer;
display: flex;
align-items: center;
padding: 4px 8px;
border-radius: 4px;
transition: all 0.3s;
font-size: 14px;
color: #333333;
&:hover {
color: #2A58AD;
}
i {
margin-right: 6px;
font-size: 16px;
}
.icon-img {
width: 16px;
height: 16px;
margin-right: 6px;
object-fit: contain;
vertical-align: middle;
}
&.has-selected {
background-color: #EFF3F6;
}
}
</style>
<style>
/* 全局样式,与父组件保持一致 */
.pure-popover {
padding: 4px 0 !important;
border-color: #E5E6EB !important;
box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}
.popover-list {
list-style: none;
margin: 0;
padding: 0;
li {
padding: 9px 16px;
cursor: pointer;
color: #333333;
font-size: 12px;
display: flex;
align-items: center;
&.is-selected {
background-color: #f7f7f7;
}
&:hover {
background-color: #F2F3F5;
}
i {
margin-right: 8px;
font-size: 14px;
}
.icon-img {
width: 18px;
height: 18px;
border-radius: 3px;
margin-right: 8px;
}
}
}
</style>
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
@handleClick="submit"
:config="config"
>
<div
class="content"
:key="viewKey"
>
<div class="left">
<div class="title flex">录音列表</div>
<div class="left-content">
<div class="search-box flex">
<el-input
placeholder="搜索员工名称"
size="small"
class="search-input"
clearable
v-model="searchForm.staffName"
></el-input>
<el-date-picker
v-model="searchForm.receptionDate"
size="small"
type="date"
class="search-input"
placeholder="搜索接待日期"
>
</el-date-picker>
<el-button
type="primary"
size="small"
@click="handleSearch"
>查询</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
</div>
<div class="table">
<d2-table
ref="multipleTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:has-num="false"
:layout="'total, prev, pager, next'"
:pagerCount="5"
@setTableFinishFun="setTableFinishFun"
@selectionTable="selectionTable"
@selectRow="selectRow"
@selectAll="selectAll"
:before-search-fn="beforeSearchFn"
>
</d2-table>
</div>
</div>
</div>
<div class="right">
<div class="title flex">
已选录音<div class="num">{{ count }}</div>条
<el-button
class="clear"
type="text"
@click="clearChooseList"
>清空</el-button>
</div>
<div class="right-content">
<el-scrollbar class="multiple-tag-box">
<div class="multiple-tags">
<template v-for="(i,ind) in chooseList">
<el-tag
closable
:key="ind"
@close="remove(i,ind)"
disable-transitions
>{{ i.chooseContent }}</el-tag>
</template>
</div>
</el-scrollbar>
</div>
</div>
</div>
</basedialog>
</template>
<script>
import {
getRecordAllPageListByCondition,
} from '@/api/earlyWarningManager'
import multipleMixin from "./multipleMixin";
import dayjs from 'dayjs';
export default {
name: "MultipleRecording",
mixins: [multipleMixin],
mounted () {
},
data () {
return {
dialogConfig: {
config: {
title: "选择录音",
width: "1092px"
}
},
targetId: 'id',
formatTag: (e) => {
return {
...e,
chooseContent: `${e.employeeName} ${e.startTime}`
}
},
getListApi: getRecordAllPageListByCondition,
searchForm: {
staffName: '',
receptionDate: '',
businessType: 1
},
searchFormSearch: {},
tableParams: {
listName: "list",
mutiSelectUniqueKey: "id",
mutiSelectName: "contentIndex",
tableColumns: [
{
label: "员工姓名",
prop: "employeeName",
minWidth: 90
},
{
label: "接待时间",
prop: "startTime",
minWidth: 90
},
{
label: "客户姓名",
prop: "customerName",
minWidth: 90
},
{
label: "车型",
prop: "carModel",
minWidth: 90
},
{
label: "接待时长",
prop: "duration",
minWidth: 90
},
{
label: "质检评分/分",
prop: "score",
minWidth: 90
},
{
label: "攻防得分/分",
prop: "defencePoint",
minWidth: 90
},
]
},
}
},
methods: {
getParams () {
let params = this.deepClone(this.searchForm)
if (params.receptionDate) {
params.receptionDate = dayjs(params.receptionDate).format("YYYY-MM-DD")
}
return params
},
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
::v-deep.el-dialog__wrapper {
overflow: hidden !important;
.el-dialog {
margin: 50vh auto 0 !important;
transform: translateY(-50%);
.el-dialog__body {
padding: 0;
// padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
}
.detail-content {
.content {
display: flex;
height: 588px;
box-sizing: border-box;
padding: 20px;
gap: 24px;
.left,
.right {
flex-shrink: 0;
height: 100%;
border: 1px solid #e5e5e5;
box-sizing: border-box;
border-radius: 2px;
overflow: hidden;
.title {
font-weight: 700;
color: #333333;
font-size: 16px;
height: 48px;
border-bottom: 1px solid #e5e5e5;
background: #f5f5f5;
padding: 0 16px;
.num {
margin-left: 4px;
}
.clear {
margin-left: auto;
}
}
}
.left {
width: calc(100% - 304px);
&-content {
padding: 16px;
height: calc(100% - 49px);
box-sizing: border-box;
.search-box {
margin-bottom: 20px;
.search-input {
width: 200px;
margin-right: 12px;
}
}
.table {
height: calc(100% - 52px);
::v-deep .d2-table {
height: 100%;
display: flex;
flex-direction: column;
.el-pagination {
margin-top: auto;
}
.el-table {
margin: 0 !important;
border-left: none;
overflow-y: auto;
&::before,
&::after {
display: none;
}
.el-table__header-wrapper,
.el-table__body-wrapper {
position: relative;
border-left: 1px solid #ebeef5;
&::after {
content: "";
position: absolute;
top: 0;
right: 1px;
width: 1px;
height: 100%;
background: #ebeef5;
}
}
.el-table__header-wrapper {
.cell {
padding: 0 5px;
}
}
}
.el-table-column--selection {
.cell {
padding: 0;
}
}
}
}
}
}
.right {
width: 284px;
.multiple-tag-box {
width: 100%;
height: 499px;
box-sizing: border-box;
.multiple-tags {
padding: 16px;
display: flex;
flex-wrap: wrap;
gap: 16px;
}
}
}
}
}
</style>
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
@handleClick="submit"
:config="config"
>
<div
class="content"
:key="viewKey"
>
<div class="left">
<div class="title flex">人员列表</div>
<div class="left-content">
<div class="search-box flex">
<el-input
placeholder="搜索员工名称"
size="small"
class="search-input"
clearable
v-model="searchForm.staffName"
></el-input>
<el-button
type="primary"
size="small"
@click="handleSearch"
>查询</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
</div>
<div class="table">
<d2-table
ref="multipleTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:has-num="false"
:layout="'total, prev, pager, next'"
:pagerCount="5"
@setTableFinishFun="setTableFinishFun"
@selectionTable="selectionTable"
@selectRow="selectRow"
@selectAll="selectAll"
:before-search-fn="beforeSearchFn"
>
</d2-table>
</div>
</div>
</div>
<div class="right">
<div class="title flex">
已选人员<div class="num">{{ count }}</div>人
<el-button
class="clear"
type="text"
@click="clearChooseList"
>清空</el-button>
</div>
<div class="right-content">
<el-scrollbar class="multiple-tag-box">
<div class="multiple-tags">
<template v-for="(i,ind) in chooseList">
<el-tag
closable
:key="ind"
@close="remove(i,ind)"
disable-transitions
>{{ i.staffName }}</el-tag>
</template>
</div>
</el-scrollbar>
</div>
</div>
</div>
</basedialog>
</template>
<script>
import {
getStrategyStaffList,
} from "@api/earlyWarningManager"
import multipleMixin from "./multipleMixin";
export default {
name: "MultipleStaff",
mixins: [multipleMixin],
mounted () {
},
data () {
return {
dialogConfig: {
config: {
title: "选择人员",
width: "1092px"
}
},
targetId: 'staffUuid',
getListApi: getStrategyStaffList,
searchForm: {
staffName: ''
},
tableParams: {
listName: "list",
mutiSelectUniqueKey: "staffUuid",
mutiSelectName: "contentIndex",
tableColumns: [
{
label: "员工姓名",
prop: "staffName",
minWidth: 130
},
{
label: "手机号",
prop: "phoneNumber",
minWidth: 160
},
{
label: "岗位",
minWidth: 130,
formatter (row) {
return {
0: '驻店人员',
6: '飞行督导',
9: '区域运营'
}[row.positionType]
}
},
]
},
}
},
methods: {
beforeSearchFn () {
return new Promise((resolve) => {
let { positionTypeList, merchantList, paramsInfo ,delMerchantList} = this,
{ staffName } = this.searchForm,
merchantIdList = []
if (merchantList.length) merchantIdList = merchantList.map(item => item.merchantId)
else merchantIdList = paramsInfo.merchantIds
let params = {
positionTypeList,
sceneType: 0,
staffName,
merchantIdList
}
if(delMerchantList) params.merchantIdList = []
this.searchFormSearch = this.deepClone(params)
resolve()
})
},
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
::v-deep.el-dialog__wrapper {
overflow: hidden !important;
.el-dialog {
margin: 50vh auto 0 !important;
transform: translateY(-50%);
.el-dialog__body {
padding: 0;
// padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
}
.detail-content {
.content {
display: flex;
height: 588px;
box-sizing: border-box;
padding: 20px;
gap: 24px;
.left,
.right {
width: calc(50% - 12px);
flex-shrink: 0;
height: 100%;
border: 1px solid #e5e5e5;
box-sizing: border-box;
border-radius: 2px;
overflow: hidden;
.title {
font-weight: 700;
color: #333333;
font-size: 16px;
height: 48px;
border-bottom: 1px solid #e5e5e5;
background: #f5f5f5;
padding: 0 16px;
.num {
margin-left: 4px;
}
.clear {
margin-left: auto;
}
}
}
.left {
&-content {
padding: 16px;
height: calc(100% - 49px);
box-sizing: border-box;
.search-box {
margin-bottom: 20px;
.search-input {
width: 200px;
margin-right: 12px;
}
}
.table {
height: calc(100% - 52px);
::v-deep .d2-table {
height: 100%;
display: flex;
flex-direction: column;
.el-pagination {
margin-top: auto;
}
.el-table {
margin: 0 !important;
border-left: none;
overflow-y: auto;
&::before,
&::after {
display: none;
}
.el-table__header-wrapper,
.el-table__body-wrapper {
position: relative;
border-left: 1px solid #ebeef5;
&::after {
content: "";
position: absolute;
top: 0;
right: 1px;
width: 1px;
height: 100%;
background: #ebeef5;
}
}
}
.el-table-column--selection {
.cell {
padding: 0;
}
}
}
}
}
}
.right {
.multiple-tag-box {
width: 100%;
height: 499px;
box-sizing: border-box;
.multiple-tags {
padding: 16px;
display: flex;
flex-wrap: wrap;
gap: 16px;
}
}
}
}
}
</style>
const STRATEGYTYPEOPTIONS = [
{ label: '学习', value: 0 },
{ label: '优秀案例分享', value: 1 },
{ label: '带教', value: 2 },
{ label: '任务下发', value: 3 },
{ label: '销售精英到店提拉', value: 4 },
{ label: '强力促销', value: 5 },
{ label: '最终盘点与低客单产品购入', value: 6 },
]
/**
*positionTypeList: 0:驻店,6:飞行督导,9:2.1区域运营
*/
const STRATEGY_FORM_0 = [
{
label: '标题',
type: 'input',
key: 'title',
maxlength: 20,
},
{
label: '学习人员',
type: 'multipleTag',
btnText: '选择人员',
componentName: 'staffTag',
key: 'staffList',
positionTypeList: [0],
tagNameKey: 'staffName'
},
{
label: '学习内容',
type: 'multipleTag',
btnText: '选择课程',
componentName: 'courseTag',
key: 'courseList',
tagKey: 'courseId',
tagNameKey: 'title'
},
{
label: '执行周期',
type: 'daterange',
key: 'dateRange',
pickerOptions: 'afterPickerOptions'
},
]
const STRATEGY_FORM_1 = [
{
label: '标题',
type: 'input',
key: 'title',
maxlength: 20,
},
{
label: '学习人员',
type: 'multipleTag',
btnText: '选择人员',
componentName: 'staffTag',
key: 'staffList',
positionTypeList: [0],
tagNameKey: 'staffName'
},
{
label: '学习内容',
type: 'multipleTag',
btnText: '选择录音',
componentName: 'recordingTag',
key: 'recordingList',
tagKey: 'id',
tagNameKey: 'chooseContent'
},
{
label: '执行周期',
type: 'daterange',
key: 'dateRange',
pickerOptions: 'afterPickerOptions'
},
]
const STRATEGY_FORM_2456 = [
{
label: '执行人员',
type: 'multipleTag',
btnText: '选择人员',
componentName: 'staffTag',
key: 'staffList',
hide: (val) => {
let { strategyType } = val
return [5, 6].includes(strategyType)
},
positionTypeList: [0, 6, 9],
tagNameKey: 'staffName',
delMerchantList: true
},
{
label: '执行周期',
type: 'daterange',
key: 'dateRange',
pickerOptions: 'afterPickerOptions'
},
]
const STRATEGY_FORM_3 = [
{
label: '标题',
type: 'input',
key: 'title',
maxlength: 20,
},
{
label: '副标题',
type: 'input',
maxlength: 200,
key: 'subTitle'
},
{
label: '内容',
type: 'richText',
key: 'content',
},
{
label: '处理人',
type: 'checkbox',
key: 'handlerType',
options: [
{ label: '区域运营', value: 0 },
{ label: '驻店人员', value: 1 },
]
},
{
label: '区域运营',
type: 'multipleTag',
btnText: '选择人员',
componentName: 'staffTag',
key: 'staffList',
hide: (val) => {
let { handlerType } = val
return !handlerType.includes(0)
},
positionTypeList: [9],
tagNameKey: 'staffName'
},
{
label: '驻店人员',
type: 'multipleTag',
btnText: '选择人员',
componentName: 'staffTag1',
key: 'staffList_1',
hide: (val) => {
let { handlerType } = val
return !handlerType.includes(1)
},
positionTypeList: [0],
tagNameKey: 'staffName'
},
{
label: '执行时间',
type: 'radioTime',
key: 'pushType',
pickerOptions: 'afterPickerOptions',
timeKey: 'pushTime',
options: [
{ label: '立即推送', value: 1 },
{ label: '定时推送', value: 0 },
],
showDateTimePicker: (val) => {
let { pushType } = val
return pushType == 0
},
pickerOptions: 'afterTwoHourPickerOptions'
},
]
const TITLE_RULES = [{ required: true, message: '请输入标题', trigger: 'blur' }]
const STAFF_LIST_RULES = { required: true, message: '请选择学习人员' }
const STUDY_LIST_RULES = { required: true, message: '请选择学习内容' }
const RANGE_DATE = [{ required: true, message: '请选择执行周期', trigger: 'blur' }]
const DESCRIPTION_RULES = [{ required: true, message: '请输入策略说明', trigger: 'blur' }]
const STRATEGY_FORM_RULES_0 = {
title: TITLE_RULES,
staffList: STAFF_LIST_RULES,
courseList: STUDY_LIST_RULES,
dateRange: RANGE_DATE,
description: DESCRIPTION_RULES
}
const STRATEGY_FORM_RULES_1 = {
title: TITLE_RULES,
staffList: STAFF_LIST_RULES,
recordingList: STUDY_LIST_RULES,
dateRange: RANGE_DATE,
description: DESCRIPTION_RULES
}
const STRATEGY_FORM_RULES_2456 = {
dateRange: RANGE_DATE,
description: DESCRIPTION_RULES
}
const STRATEGY_FORM_RULES_3 = {
title: TITLE_RULES,
// subTitle: [{ required: true, message: '请输入副标题', trigger: 'blur' }],
content: [
{ required: true, message: '请输入内容', trigger: 'blur' }
],
handlerType: [
{ required: true, message: '请选择处理人', trigger: 'change' }
],
staffList: [{ required: true, message: '请选择区域运营' }],
staffList_1: [{ required: true, message: '请选择驻店人员' }],
description: DESCRIPTION_RULES
}
export {
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_0,
STRATEGY_FORM_1,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
STRATEGY_FORM_RULES_0,
STRATEGY_FORM_RULES_1,
STRATEGY_FORM_RULES_2456,
STRATEGY_FORM_RULES_3
}
\ No newline at end of file
export default {
props: {
visible: {
type: Boolean,
default: false
},
chooseData: {
type: Array,
default: () => []
}
},
inject: [
'deepClone',
'GET_POSITION_TYPE_LIST',
'GET_PARAMS_INFO',
'GET_MERCHANT_LIST',
'GET_BIZ',
'DEL_PARAMS_MERCHANT_LIST'
],
computed: {
dialogShow: {
get () {
return this.visible
},
set (val) {
this.chooseList = []
this.close()
}
},
count () {
return this.chooseList.length
},
positionTypeList () {
return this.GET_POSITION_TYPE_LIST && this.GET_POSITION_TYPE_LIST()
},
paramsInfo () {
return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO()
},
merchantList () {
return this.GET_MERCHANT_LIST && this.GET_MERCHANT_LIST()
},
biz () {
return this.GET_BIZ && this.GET_BIZ()
},
delMerchantList(){
return this.DEL_PARAMS_MERCHANT_LIST && this.DEL_PARAMS_MERCHANT_LIST()
}
},
watch: {
visible: {
handler (val) {
if (val) {
this.searchForm = this.$options.data.call(this).searchForm
let multipleTable = this.multipleTable()
if (multipleTable) multipleTable.page.currentPage = 1
this.chooseList = this.deepClone(this.chooseData)
this.viewKey = Date.now()
}
},
immediate: true,
deep: true
},
},
mounted () {
},
data () {
return {
viewKey: Date.now(),
config: {
appendToBody: true,
isShowFooter: true,
cancel_name: "取消",
confirm_name: "确定",
},
searchFormSearch: {},
chooseList: [],
}
},
methods: {
getParams () {
const params = this.deepClone(this.searchForm)
return params
},
beforeSearchFn () {
return new Promise((resolve) => {
this.searchFormSearch = this.getParams()
resolve()
})
},
close () {
this.$emit('dialogClose')
},
remove (i, index) {
this.chooseList.splice(index, 1)
let tableData = this.multipleTable().data
tableData.map(j => {
if (i[this.targetId] === j[this.targetId]) {
this.multipleTable().tableRef.toggleRowSelection(j, false)
}
})
},
async submit () {
this.$emit('choose', this.chooseList)
this.close()
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.multipleTable().page.currentPage = 1
this.handleSearch()
},
handleSearch () {
this.multipleTable().page.currentPage = 1
this.multipleTable().refreshTable()
},
setTableFinishFun (data) {
this.$nextTick(() => {
let { chooseList, targetId } = this
chooseList.map(item => {
let index = data.findIndex(i => i[targetId] === item[targetId])
if (index > -1) this.multipleTable().tableRef.toggleRowSelection(data[index], true)
})
})
},
selectionTable (list) {
this.$nextTick(() => {
let { targetId, chooseList } = this
if (this.formatTag) list = list.map(e => {
return this.formatTag(e)
})
// 合并列表后基于 targetId 去重
const mergedList = [...chooseList, ...list]
this.chooseList = [...new Map(
mergedList.map(item => [item[targetId], item])
).values()]
})
},
selectRow (list, row) {
let { targetId } = this,
index = list.findIndex(i => i[targetId] === row[targetId])
if (index == -1) {
let delIndex = this.chooseList.findIndex(i => i[targetId] === row[targetId])
if (delIndex > -1) this.chooseList.splice(delIndex, 1)
}
},
selectAll (list) {
if (!list.length) {
let tableData = this.multipleTable().data,
{ targetId } = this
// 使用 Set 存储 tableData 中的所有 targetId
const tableDataIds = new Set(tableData.map(item => item[targetId]));
// 保留 chooseList 中不在 tableData 的项目
this.chooseList = this.chooseList.filter(item =>
!tableDataIds.has(item[targetId])
);
}
},
multipleTable () {
return this.$refs.multipleTable
},
clearChooseList () {
this.chooseList = []
this.multipleTable().clearMutiSelect()
}
}
}
\ No newline at end of file
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
@handleClick="submit"
>
<el-form
ref="form"
class="form"
label-width="120px"
size="small"
:rules="formRules"
:model="formData"
@submit.native.prevent="submit"
>
<el-form-item
label="停止展业日期:"
prop="nodeDate"
>
<el-date-picker
v-model="formData.nodeDate"
type="date"
placeholder="请选择停止展业日期"
:picker-options="afterTodayOptions"
>
</el-date-picker>
</el-form-item>
</el-form>
</basedialog>
</template>
<script>
import {
stopBusiness,
} from "@api/earlyWarningManager"
import dayjs from "dayjs";
export default {
name: "AddStaff",
props: {
visible: {
type: Boolean,
default: false
},
minDate: {
type: String,
default: dayjs().format("YYYY-MM-DD")
}
},
inject: ['GET_PARAMS_INFO'],
computed: {
dialogShow: {
get () {
return this.visible
},
set (val) {
this.close()
}
},
afterTodayOptions () {
return {
disabledDate: (time) => {
return (
time.getTime() < dayjs(this.minDate).valueOf() // 小于最小日期 → 禁用
);
}
}
},
paramsInfo () {
return this.GET_PARAMS_INFO()
},
},
mounted () {
},
data () {
return {
formData: {
nodeDate: '',
},
formRules: {
nodeDate: [{ required: true, message: '请选择停止展业日期', trigger: 'blur' }],
},
dialogConfig: {
config: {
title: "停止展业",
width: "640px"
}
},
}
},
methods: {
close () {
this.formData = this.$options.data.call(this).formData
this.$refs?.form?.resetFields()
this.$emit('dialogClose')
},
submit () {
this.$refs.form.validate(async (valid) => {
if (valid) {
const { merchantIds } = this.paramsInfo,
{ nodeDate } = this.formData,
data = await stopBusiness({
merchantId: merchantIds[0],
sceneType: 0,
bizs: 1,
nodeDate: dayjs(nodeDate).format("YYYY-MM-DD HH:mm:ss")
})
if(data) {
this.$emit('refresh')
this.$message.success('操作成功')
this.close()
}else this.$message.error('操作失败')
}
})
}
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
::v-deep.el-dialog__wrapper {
overflow: hidden !important;
.el-dialog {
margin: 50vh auto 0 !important;
transform: translateY(-50%);
.el-dialog__body {
padding: 0;
// padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
}
.detail-content {
.form {
padding: 52px 42px 34px;
.el-date-editor {
width: 100%;
}
}
}
</style>
<template>
<div
class="business-overview"
v-loading="loading"
>
<div class="business-overview-title">
展业概况
<div :class="['business-overview-status',{'normal':businessOverviewDetail.status == 0}]">{{ businessOverviewText }}</div>
<div class="business-overview-total flex">
累计展业
<div class="num">{{ businessOverviewDetail.developmentDay || '-'}}</div>
天
<el-button
plain
type="primary"
class="stop"
size="small"
@click="openStopBusinessDialog"
>停止展业</el-button>
</div>
</div>
<template v-if="businessOverviewDetail.timelineList && businessOverviewDetail.timelineList.length">
<scroll-x-view>
<div class="timeline">
<div
:class="['timeline-item',{last: index == businessOverviewDetail.timelineList.length - 1}]"
v-for="(item, index) in businessOverviewDetail.timelineList"
:key="index"
>
<div class="timeline-item-arc"></div>
<div class="timeline-item-line"></div>
<div class="timeline-item-date">{{ item.nodeDate }}</div>
<div class="timeline-item-content">{{ item.content }}</div>
</div>
</div>
</scroll-x-view>
</template>
<stop-business
:visible.sync="stopBusinessVisible"
@dialogClose="stopBusinessVisible = false"
:minDate="minDate"
@refresh="getStrategyMerchantTimeline"
></stop-business>
</div>
</template>
<script>
import ScrollXView from '../ScrollXView.vue';
import StopBusiness from './StopBusiness.vue';
import {
getStrategyMerchantTimeline
} from '@/api/earlyWarningManager';
import dayjs from 'dayjs';
export default {
components: {
ScrollXView,
StopBusiness
},
name: 'BusinessOverview',
inject: ['GET_PARAMS_INFO'],
data () {
return {
stopBusinessVisible: false,
businessOverviewDetail: {},
loading: false,
minDate: dayjs().format('YYYY-MM-DD')
};
},
computed: {
businessOverviewText () {
let { status } = this.businessOverviewDetail
return status == 0 ? '展业中' : '停止展业'
},
paramsInfo () {
return this.GET_PARAMS_INFO()
}
},
mounted () {
},
methods: {
init () {
this.getStrategyMerchantTimeline()
},
openStopBusinessDialog () {
this.stopBusinessVisible = true
},
async getStrategyMerchantTimeline () {
try {
this.businessOverviewDetail = {}
this.loading = true
let { merchantIds } = this.paramsInfo,
data = await getStrategyMerchantTimeline({
merchantId: merchantIds[0],
bizs: 1, //业务类型(1.延保 2.轻改 3.权益)
sceneType: 0 //业务场景(0.会员权益,1.精品升级)
})
data.timelineList && data.timelineList.forEach(item => {
item.nodeDate = dayjs(item.nodeDate).format('YYYY-MM-DD')
/**
* 节点类型,0-产品首次上架,1- 正式开单,2-安心包产品上架,3-延保-轮胎上架,4-延保-电池上架,5-展业风险,6-停止展业,7-恢复展业
*/
item.content = {
0: '产品首次上架',
1: '正式开单',
2: '安心包产品上架',
3: '轮胎产品上架',
4: '电池产品上架',
5: '展业风险',
6: '停止展业',
7: '恢复展业'
}[item.nodeType]
})
this.businessOverviewDetail = data
let nodeDate = ''
if (data && data.timelineList) {
let { timelineList } = data
if (timelineList.length) {
let lastNode = timelineList.at(-1)
if (lastNode) {
if (lastNode.nodeType != 6) nodeDate = lastNode.nodeDate
else nodeDate = timelineList.at(-2).nodeDate
}
}
if (nodeDate) this.minDate = dayjs(nodeDate).format('YYYY-MM-DD')
} else this.minDate = dayjs().format('YYYY-MM-DD')
this.loading = false
} catch (error) {
console.log(error)
}
}
}
};
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.business-overview {
padding: 0 20px;
border-bottom: 1px solid #e5e5e5;
.timeline-content{
min-height: 89px;
}
&-title {
height: 50px;
color: #333333;
font-size: 16px;
font-weight: 500;
display: flex;
align-items: center;
}
&-status {
color: #999999;
font-size: 14px;
padding: 0 8px;
height: 23px;
border-radius: 2px;
background: #9999991a;
line-height: 23px;
margin-left: 8px;
font-weight: 400;
}
.normal {
color: #43cf7c;
background: #43cf7c1a;
}
&-total {
margin-left: auto;
font-size: 14px;
font-weight: 400;
.num {
color: #2a58ad;
font-weight: 500;
margin: 0 2px;
}
.stop {
margin-left: 8px;
border-color: transparent;
font-size: 13px;
padding: 3px 7px;
line-height: 16px;
}
}
.timeline {
min-height: 87px;
width: 100%;
display: flex;
// gap: 0 33px;
&-item {
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
color: #333333;
font-size: 14px;
padding: 30px 20px 20px;
position: relative;
&-date {
color: #999ea8;
font-weight: 500;
margin-bottom: 4px;
}
&-line {
position: absolute;
top: 16px;
left: 0;
width: 100%;
height: 1.5px;
background-color: #d4deef;
}
&-arc {
position: absolute;
top: 4px;
left: 50%;
transform: translateX(-50%);
width: 24px;
height: 24px;
background-color: #fff;
z-index: 2;
&::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 16px;
height: 16px;
background: #2a58ad33;
border-radius: 50%;
}
&::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 10px;
height: 10px;
border: 2px solid #2a58ad;
background: #ffffff;
z-index: 2;
border-radius: 50%;
box-sizing: border-box;
}
}
}
.last {
.timeline-item-line {
width: 50%;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div :class="['warning-item flex',`bg-${item.type || 1}`]">
<img
:src="icon"
class="warning-icon"
>
<div class="warning-text text-hide">{{ item.text }}</div>
</div>
</template>
<script type='text/ecmascript-6'>
const type_1 = require('@/assets/strategy/icon-strategy-type01.png'),
type_2 = require('@/assets/strategy/icon-strategy-type02.png'),
type_3 = require('@/assets/strategy/icon-strategy-type03.png'),
type_4 = require('@/assets/strategy/icon-strategy-type04.png'),
type_5 = require('@/assets/strategy/icon-strategy-type05.png'),
type_6 = require('@/assets/strategy/icon-strategy-type06.png')
export default {
name: 'EarlyWarningTips',
props: {
item: {
type: Object,
default: () => ({})
}
},
computed: {
icon () {
return {
1: type_1,
2: type_2,
3: type_3,
4: type_4,
5: type_5,
6: type_6
}[this.item.type] || ''
}
},
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.warning-item {
width: 100%;
border-radius: 4px;
color: #333333;
font-size: 13px;
margin-top: 12px;
height: 30px;
background: #2c66f714;
box-sizing: border-box;
padding: 0 8px;
word-break: break-all;
.warning-icon {
width: 18px;
height: 18px;
margin-right: 6px;
}
.warning-text {
width: calc(100% - 24px);
}
}
.bg-1 {
background: #f2472414;
}
.bg-2 {
background: #ff9d0a14;
}
</style>
\ No newline at end of file
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
:config="config"
>
<div class="content">
<d2-table
class="table"
ref="table"
:search-form="formSearch"
:table-params="tableParams"
:table-data="list"
:has-page="false"
:has-num="false"
>
</d2-table>
<div class="block"></div>
</div>
</basedialog>
</template>
<script>
import {
getStrategyMerchantAnalysisIndexHistory,
} from "@api/earlyWarningManager"
export default {
name: "HistoryTarget",
inject: [
'GET_PARAMS_INFO',
],
props: {
visible: {
type: Boolean,
default: false
},
index: {
type: Number,
default: 0
}
},
computed: {
dialogShow: {
get () {
return this.visible
},
set (val) {
this.close()
}
},
merchantId () {
let [merchantId] = this.GET_PARAMS_INFO().merchantIds
return merchantId
}
},
watch: {
visible: function (val) {
if (val) {
this.list = []
this.getList()
}
}
},
mounted () {
},
data () {
return {
config: {
isShowFooter: true,
cancel_name: "返回",
hideConfirmBtn: true
},
dialogConfig: {
config: {
title: "历史兜底目标",
width: "600px"
}
},
formSearch: {},
tableParams: {
tableColumns: [
{
label: "月份",
prop: 'recordYearMonth',
minWidth: 64,
},
{
label: "渗透率兜底目标",
minWidth: 80,
formatter: (row) => {
let val = row[
{
0: 'ewPenetrationRate',
1: 'ewAxbPenetrationRate',
2: 'batteryPenetrationRate',
3: 'ewLtPenetrationRate'
}[this.index]
] || null
return val != null ? val + '%' : '-'
}
},
{
label: "转化率兜底目标",
minWidth: 80,
formatter: (row) => {
let val = row[
{
0: 'ewConRate',
1: 'ewAxbConRate',
2: 'batteryConversionRate',
3: 'ewLtConRate'
}[this.index]
] || null
return val != null ? val + '%' : '-'
}
},
]
},
list: []
}
},
methods: {
close () {
this.$emit('dialogClose')
},
async getList () {
const { merchantId } = this,
data = await getStrategyMerchantAnalysisIndexHistory({
bizs: 1,
merchantId
})
this.list = data
}
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
::v-deep.el-dialog__wrapper {
overflow: hidden !important;
.el-dialog {
margin: 50vh auto 0 !important;
transform: translateY(-50%);
.el-dialog__body {
padding: 0;
// padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
}
.detail-content {
.content {
height: 592px;
box-sizing: border-box;
padding: 20px;
overflow-y: auto;
.table {
width: 100%;
}
}
}
</style>
<template>
<div class="overview-box">
<template v-for="(item,index) in overviewList">
<div
:class="['overview-item',{'clear-border':index == overviewList.length - 1}]"
:key="index"
>
<div class="title flex">
{{ item.title }}
<el-button
v-if="hasEHi"
type="text"
class="target"
@click="handleTargetConfig(index)"
>历史兜底目标</el-button>
</div>
<div class="content">
<template v-for="(i,idx) in item.list">
<div
class="item"
:key="idx"
:style="{width: `calc(100% / ${item.list.length})`}"
>
<div class="label">{{ i.label }}</div>
<div class="value">
<template v-if="viewData[i.key] == null || i.hide">-</template>
<template v-else>
{{ viewData[i.key] }}<template v-if="i.unit">{{ i.unit }}</template>
</template>
</div>
<div :class="['sub-value',{show:i.subKey && viewData[i.subKey] != null}]">兜底目标{{ viewData[i.subKey] }}%</div>
</div>
</template>
</div>
</div>
</template>
<HistoryTarget
:visible.sync="historyTargetVisible"
:index="historyTargetIndex"
@dialogClose="historyTargetVisible = false"
/>
</div>
</template>
<script type='text/ecmascript-6'>
import HistoryTarget from './HistoryTarget.vue';
const overviewList = [
{
title: '整车延保',
list: [
{
label: '成交数',
key: 'vehicleWarrantyDealCount',
},
{
label: '渗透率',
key: 'vehicleWarrantyPenetrationRate',
subKey: 'vehicleWarrantyPenetrationBottomTarget',
unit: '%'
},
{
label: '转化率',
key: 'vehicleWarrantyConversionRate',
subKey: 'vehicleWarrantyConversionBottomTarget',
unit: '%'
}
]
},
{
title: '安心包',
list: [
{
label: '成交数',
key: 'safetyPackageDealCount'
},
{
label: '渗透率',
key: 'safetyPackagePenetrationRate',
subKey: 'safetyPackagePenetrationBottomTarget',
unit: '%'
},
{
label: '转化率',
key: 'safetyPackageConversionRate',
subKey: 'safetyPackageConversionBottomTarget',
unit: '%'
}
],
},
{
title: '电池',
list: [
{
label: '成交数',
key: 'batteryWarrantyDealCount'
},
{
label: '渗透率',
key: 'batteryWarrantyPenetrationRate',
subKey: 'batteryWarrantyPenetrationBottomTarget',
unit: '%'
},
{
label: '转化率',
key: 'batteryWarrantyConversionRate',
subKey: 'batteryWarrantyConversionBottomTarget',
unit: '%'
}
],
},
{
title: '轮胎',
list: [
{
label: '成交数',
key: 'tireWarrantyDealCount'
},
{
label: '渗透率',
key: 'tireWarrantyPenetrationRate',
subKey: 'tireWarrantyPenetrationBottomTarget',
unit: '%'
},
{
label: '转化率',
key: 'tireWarrantyConversionRate',
subKey: 'tireWarrantyConversionBottomTarget',
unit: '%'
}
],
}
]
export default {
name: 'OverViewList',
components: { HistoryTarget },
inject: ['deepClone'],
props: {
hasEHi: {
type: Boolean,
default: false
},
viewData: {
type: Object,
default () {
return {}
}
},
isHarmony: {
type: Boolean,
default: false
}
},
data () {
return {
historyTargetIndex: 0,
historyTargetVisible: false
}
},
computed: {
overviewList () {
let { hasEHi, isHarmony } = this,
list = this.deepClone(overviewList)
if (hasEHi) list.map((e, index) => {
e.list.push({
label: '生态系数',
key: {
0: 'vehicleWarrantyEcoCoefficient',
1: 'safetyPackageEcoCoefficient',
2: 'batteryWarrantyEcoCoefficient',
3: 'tireWarrantyEcoCoefficient',
}[index],
hide: !isHarmony
})
})
return list
},
},
mounted () {
},
methods: {
handleTargetConfig (index) {
this.historyTargetIndex = index
this.historyTargetVisible = true
}
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.overview-box {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
padding: 20px 16px;
box-sizing: border-box;
gap: 15px;
.overview-item {
padding-bottom: 7px;
border-bottom: 1px solid #e5e5e5;
.content {
display: flex;
align-items: stretch;
.item {
.label {
color: #666666;
font-size: 14px;
line-height: 16px;
}
.value {
color: #2a58ad;
font-size: 20px;
font-weight: 500;
margin-top: 4px;
line-height: 20px;
}
.sub-value {
color: #999999;
font-size: 13px;
margin-top: 4px;
line-height: 15px;
opacity: 0;
}
.show {
opacity: 1;
}
}
}
}
.clear-border {
border: none;
padding-bottom: 0;
}
.title {
color: #222222;
font-size: 15px;
font-weight: 500;
margin-bottom: 14px;
line-height: 16px;
.target {
margin-left: auto;
padding: 0;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="timeline-content">
<div
class="left-mask mask"
v-show="!isAtLeftEnd"
>
<div
class="btn flex"
@click="scrollTo(-400)"
>
<i class="el-icon-arrow-left"></i>
</div>
</div>
<div
class="right-mask mask"
v-show="!isAtRightEnd"
>
<div
class="btn flex"
@click="scrollTo(400)"
>
<i class="el-icon-arrow-left"></i>
</div>
</div>
<el-scrollbar
class="timeline-scrollbar"
ref="timelineScrollbar"
>
<slot></slot>
</el-scrollbar>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ScrollXView',
data () {
return {
isAtLeftEnd: true, // 初始在最左侧
isAtRightEnd: false // 初始不在最右侧
}
},
mounted () {
this.$nextTick(() => {
this.checkScrollPosition();
const scrollbar = this.$refs.timelineScrollbar;
if (scrollbar && scrollbar.wrap) {
scrollbar.wrap.addEventListener('scroll', this.handleScroll);
}
})
},
beforeDestroy () {
const scrollbar = this.$refs.timelineScrollbar;
if (scrollbar && scrollbar.wrap) {
scrollbar.wrap.removeEventListener('scroll', this.handleScroll);
}
},
methods: {
// 检查当前滚动位置
checkScrollPosition () {
const scrollbar = this.$refs.timelineScrollbar;
if (!scrollbar || !scrollbar.wrap) return;
const { scrollLeft, scrollWidth, clientWidth } = scrollbar.wrap;
const maxScroll = scrollWidth - clientWidth;
this.isAtLeftEnd = scrollLeft <= 0;
this.isAtRightEnd = scrollLeft >= maxScroll - 1; // 允许1px误差
},
// 滚动事件处理
handleScroll () {
this.checkScrollPosition();
},
scrollTo (x) {
const scrollbar = this.$refs.timelineScrollbar;
if (scrollbar && scrollbar.wrap) {
scrollbar.wrap.scrollBy({ left: x, behavior: 'smooth' });
}
this.$nextTick(this.checkScrollPosition);
}
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.timeline-content {
width: 100%;
position: relative;
.mask {
// opacity: 0;
width: 72px;
height: 100%;
background: linear-gradient(
90deg,
#ffffff 0%,
#ffffffe6 51%,
#ffffff00 100%
);
position: absolute;
z-index: 3;
transition: all 0.15s;
.btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 32px;
height: 32px;
background: #ffffff;
box-shadow: 0 0 4px 0 #0000001a;
border-radius: 50%;
cursor: pointer;
justify-content: center;
.el-icon-arrow-left {
color: #222;
font-weight: 700;
font-size: 14px;
}
}
}
.left-mask {
top: 0;
left: 0;
.btn {
left: 20px;
}
}
.right-mask {
top: 0;
right: -1px;
transform: scaleX(-1);
.btn {
right: 20px;
}
}
&:hover {
.mask {
opacity: 1;
}
}
}
.timeline-scrollbar {
width: 100%;
::v-deep .el-scrollbar__wrap {
// overflow:auto hidden !important;
// margin-bottom: 0 !important;
}
}
</style>
\ No newline at end of file
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
@handleClick="submit"
>
<el-form
ref="form"
class="form"
label-width="120px"
size="small"
:rules="formRules"
:model="formData"
>
<el-form-item
label="人员姓名:"
prop="staffName"
>
<el-input
v-model="formData.staffName"
class="input-width"
placeholder="请输入人员姓名"
maxlength="15"
></el-input>
</el-form-item>
<el-form-item
label="手机号:"
prop="staffPhone"
>
<el-input
v-model="formData.staffPhone"
class="input-width"
placeholder="请输入手机号"
maxlength="11"
></el-input>
</el-form-item>
</el-form>
</basedialog>
</template>
<script>
import {
addStrategyStaff,
} from "@api/earlyWarningManager"
import { Validator } from "@/common/validator"
export default {
name: "AddStaff",
props: {
visible: {
type: Boolean,
default: false
},
},
inject: ['GET_PARAMS_INFO'],
computed: {
dialogShow: {
get () {
return this.visible
},
set (val) {
this.close()
}
},
paramsInfo () {
return this.GET_PARAMS_INFO()
},
},
mounted () {
},
data () {
return {
formData: {
staffName: '',
staffPhone: ''
},
formRules: {
staffName: [{ required: true, message: '请输入人员姓名', trigger: 'blur' }],
staffPhone: [
{ required: true, message: "请输入手机号码", trigger: "blur" },
{
required: true,
validator: (rule, value, callback) => {
Validator.checkPhoneNumber(value)
? callback()
: callback(new Error("你输入的手机号码不正确,请重新输入"))
},
trigger: "blur"
}
]
},
dialogConfig: {
config: {
title: "新增驻店员工",
width: "640px"
}
},
}
},
methods: {
close () {
this.formData = this.$options.data.call(this).formData
this.$refs?.form?.resetFields()
this.$emit('dialogClose')
},
submit () {
this.$refs.form.validate(async (valid) => {
if (valid) {
const { merchantIds } = this.paramsInfo,
{ staffPhone, staffName } = this.formData,
data = await addStrategyStaff({
staffLabel: 0,
staffName,
staffPhone,
merchantId: merchantIds[0],
})
if (data) {
this.$message.success('操作成功')
this.close()
} else this.$message.error('操作失败')
}
})
}
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
::v-deep.el-dialog__wrapper {
overflow: hidden !important;
.el-dialog {
margin: 50vh auto 0 !important;
transform: translateY(-50%);
.el-dialog__body {
padding: 0;
// padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
}
.detail-content {
.form {
padding: 52px 42px 34px;
}
}
</style>
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
:config="config"
>
<div class="content">
<template v-for="(item,index) in list">
<div
class="list-box"
:key="index"
>
<div :class="['line',{'first-line':index == 0},{'last-line':index == list.length - 1}]">
<div class="icon"></div>
</div>
<div class="title">{{ item.yearMonth }}</div>
<div class="staff-list flex">
<template v-for="(i,ind) in item.staffList">
<div
class="staff-item flex"
:key="ind"
>
<div class="staff-icon">
<img src="@/assets/strategy/default-avatar.png">
<template v-if="i.temporarySupport">
<div class="temporary-support flex">临时支援</div>
</template>
</div>
<div class="staff-info">
<div class="name text-hide">{{ i.staffName }}</div>
<template v-if="i.deletedFlag == 'N'">
<div
class="deleted flex"
@click.stop="disabledStaff(i)"
>
禁用
<div class="disabled-btn flex">
</div>
</div>
</template>
</div>
</div>
</template>
</div>
</div>
</template>
</div>
</basedialog>
</template>
<script>
import {
disableStrategyStaff,
getStrategyMerchantAnalysisEmployeeHistory,
} from "@api/earlyWarningManager"
export default {
name: "HistoryStaffList",
props: {
visible: {
type: Boolean,
default: false
},
},
computed: {
dialogShow: {
get () {
return this.visible
},
set (val) {
this.close()
}
},
paramsInfo () {
return this.GET_PARAMS_INFO()
}
},
inject: ['GET_PARAMS_INFO'],
watch: {
visible: {
handler (val) {
if (val) {
this.getStrategyMerchantAnalysisEmployeeHistory()
}
},
immediate: true
}
},
mounted () {
},
data () {
return {
config: {
isShowFooter: true,
cancel_name: "返回",
hideConfirmBtn: true
},
dialogConfig: {
config: {
title: "历史人员记录",
width: "600px"
}
},
list: []
}
},
methods: {
close () {
this.$emit('dialogClose')
},
async getStrategyMerchantAnalysisEmployeeHistory () {
let { merchantIds } = this.paramsInfo,
data = await getStrategyMerchantAnalysisEmployeeHistory({
bizs: 1,
merchantId: merchantIds[0]
})
this.list = data
},
disabledStaff (item) {
this.$confirm("对员工进行禁用操作后,对应的账户无法再使用;历史已产生的业务数据不受影响。", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
}).then(async () => {
const data = await disableStrategyStaff({
staffUuid: item.staffUUid
})
if (data) {
this.getStrategyMerchantAnalysisEmployeeHistory()
this.$message.success('操作成功')
} else this.$message.error('操作失败')
}).catch(() => {
})
},
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
::v-deep.el-dialog__wrapper {
overflow: hidden !important;
.el-dialog {
margin: 50vh auto 0 !important;
transform: translateY(-50%);
.el-dialog__body {
padding: 0;
// padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
}
.detail-content {
.content {
width: 100%;
height: 558px;
box-sizing: border-box;
padding: 16px 20px 0 0;
overflow-y: auto;
.line {
position: absolute;
top: 4px;
left: 20px;
width: 16px;
height: calc(100% - 4px);
&::after {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
content: "";
width: 1.5px;
height: 100%;
background: #d4deef;
}
.icon {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 10px;
height: 10px;
background: #2a58ad;
border-radius: 100%;
z-index: 2;
}
}
.first-line {
.icon {
width: 16px;
height: 16px;
background: #2a58ad33;
&::after {
width: 10px;
height: 10px;
border: 2px solid #2a58ad;
background: #ffffff;
border-radius: 100%;
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
}
}
&::after {
top: 16px;
height: calc(100% - 16px);
}
}
.last-line {
&::after {
display: none;
}
}
.list-box {
position: relative;
width: 100%;
box-sizing: border-box;
padding-left: 50px;
.title {
color: #333333;
font-size: 16px;
font-weight: 500;
line-height: 22px;
margin-bottom: 8px;
}
.staff-list {
width: 100%;
flex-wrap: wrap;
gap: 14px 0;
padding-bottom: 16px;
.staff-item {
width: 25%;
.staff-icon {
position: relative;
width: 48px;
height: 48px;
margin-right: 8px;
border-radius: 8px;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
.temporary-support {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 15px;
background: #000000b3;
color: #ffffff;
font-size: 9px;
font-weight: 500;
justify-content: center;
}
}
.staff-info {
width: calc(100% - 56px);
font-size: 14px;
line-height: 17px;
.name {
margin-bottom: 6px;
color: #333333;
}
.deleted {
color: #2a58ad;
cursor: pointer;
}
.disabled-btn {
width: 14px;
height: 14px;
background: #2a58ad33;
border-radius: 50%;
margin-left: 5px;
justify-content: center;
&::after {
content: "";
width: 7.7px;
height: 2.1px;
background: #2a58ad;
display: block;
}
}
}
}
}
}
}
}
</style>
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content-warn"
@handleClick="submit"
:btnLoding="btnLoding"
>
<el-form
v-loading="loading"
class="form"
label-width="120px"
size="small"
>
<el-form-item
label="门店名称:"
required
>
<el-select
v-model="currentMerchantId"
class="select"
filterable
>
<el-option
v-for="item in merchantList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId"
></el-option>
</el-select>
</el-form-item>
</el-form>
</basedialog>
</template>
<script>
import { listShop4sByRef } from "@api/merchant"
export default {
name: "ChangeMerchantDialog",
props: {
visible: {
type: Boolean,
default: false
},
merchantId: [String, Number]
},
computed: {
dialogShow: {
get () {
return this.visible
},
set (val) {
this.close()
}
},
},
watch: {
visible: {
handler (val) {
if (val) {
this.currentMerchantId = this.merchantId
this.getMerchantList()
}
},
immediate: true,
deep: true
}
},
mounted () {
},
data () {
return {
dialogConfig: {
config: {
title: "切换门店",
width: "640px"
}
},
merchantList: [],
currentMerchantId: '',
loading: false,
btnLoding: false
}
},
methods: {
close () {
this.btnLoding = false
this.$emit('dialogClose')
},
async getMerchantList () {
this.loading = true
const data = await listShop4sByRef({})
this.loading = false
this.merchantList = data
},
async submit () {
this.btnLoding = true
if (this.currentMerchantId != this.merchantId) this.$emit('changeMerchant', {
merchantId: this.currentMerchantId,
merchantName: this.merchantList.find(item => item.merchantId == this.currentMerchantId).merchantName
})
this.close()
}
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
.detail-content-warn {
::v-deep .el-dialog {
height: 256px;
.el-dialog__body {
padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
.form {
height: 89px;
padding: 37px 22px 0 0;
box-sizing: border-box;
.select {
width: 436px;
}
}
}
</style>
<template>
<div class="storeSignboard-container">
<div class="calendar-box">
<!-- 时间切换和日期选择器 -->
<calendar-custom
v-model="timeRangeType"
:time-range-options="timeRangeOptions"
:date-range.sync="dateRange"
:date-format="dateFormat"
@date-range-change="handleDateRangeChange"
ref="calendarCustom"
/>
</div>
<div class="merchant-info flex">
<div class="merchant-icon flex">
<img
:src="`${IMG_URL}merchant-icon.webp`"
class="icon"
>
</div>
<div class="info ">
<div class="name text-hide">{{merchantDetailInfo.merchantName||'-'}}</div>
<div class="control flex">
<div class="scene flex">
<img
:src="`${IMG_URL}scene-icon.webp`"
class="scene-icon"
>
业务:延保
</div>
<el-button
type="text"
class="change-store"
@click="merchantVisible = true"
>
切换门店
<i class="el-icon-sort"></i>
</el-button>
</div>
</div>
</div>
<div class="merchant-detail flex">
<template v-for="(item,index) in formList">
<div
:class="['item flex',item.className]"
:key="index"
>
<div class="label">{{ item.label }}:</div>
<template v-if=" merchantDetailInfo[item.key]">
<template v-if="item.tooltip">
<el-tooltip
effect="dark"
placement="top"
>
<div
slot="content"
class="tooltip-content-max"
>
<div>{{ merchantDetailInfo[item.key]}}</div>
</div>
<span class="text-hide value">{{ merchantDetailInfo[item.key]}}</span>
</el-tooltip>
</template>
<template v-else>
<div class="value text-hide">{{ merchantDetailInfo[item.key]}}</div>
</template>
</template>
<template v-else>-</template>
</div>
</template>
</div>
<change-merchant-dialog
:visible="merchantVisible"
@dialogClose="merchantVisible = false"
@changeMerchant="changeMerchant"
:merchantId="merchantDetailInfo.merchantNo"
></change-merchant-dialog>
</div>
</template>
<script type='text/ecmascript-6'>
import ChangeMerchantDialog from './ChangeMerchantDialog.vue';
import CalendarCustom from '../../../compoments/clendarCustom.vue';
import {
getStrategyMerchantDetail
} from '@/api/earlyWarningManager'
export default {
name: 'StoreSignboardInfo',
components: {
ChangeMerchantDialog,
CalendarCustom
},
inject: ['IMG_URL', 'GET_PARAMS_INFO'],
data () {
return {
merchantVisible: false,
timeRangeType: { label: '周', value: 2 }, // 当前选中的时间范围类型
timeRangeOptions: [
{ label: '周', value: 2 },
{ label: '月', value: 3 },
{ label: '自定义', value: 4 }
],
dateFormat: 'YYYY-MM-DD',
dateRange: {
startDate: null,
endDate: null
},
formList: [
{
label: '主营品牌',
key: 'carBrandText',
tooltip: true
},
{
label: '线上运营',
key: 'onlineOperatorText',
tooltip: true
},
{
label: '区域运营',
key: 'areaOperatorText',
tooltip: true
},
{
label: '运营模式',
key: 'directSalesFlagText'
},
{
label: '所属服务商',
key: 'mainServiceMerchantName',
className: 'fit-width'
}
],
merchantDetailInfo: {},
}
},
computed: {
paramsInfo () {
return this.GET_PARAMS_INFO()
}
},
mounted () {
},
methods: {
init () {
this.getStrategyMerchantDetail()
},
// 处理日期范围变化
handleDateRangeChange (dateRange) {
this.$nextTick(() => {
let { value } = this.timeRangeType
this.$emit('dateChange', {
startTime: dateRange.startDate,
endTime: dateRange.endDate,
cycleType: value || 2
})
})
},
async getStrategyMerchantDetail (merchantNo = '') {
let { merchantIds } = this.paramsInfo,
data = await getStrategyMerchantDetail({
businessType: 1,
merchantNo: merchantNo || merchantIds[0]
})
data.directSalesFlagText = {
0: '非直营',
1: '直营'
}[data.directSalesFlag] || '-'
if (data.carBrandResponses && data.carBrandResponses.length) {
let carBrandText = []
data.carBrandResponses.map(e => {
if (e) {
if (e.children && e.children.length) e.children.map(i => {
carBrandText.push(`${e.label}-${i.label}`)
})
else carBrandText.push(e.label)
}
})
data.carBrandText = carBrandText.join('/')
}
if (data.onlineOperator && data.onlineOperator.length) data.onlineOperatorText = data.onlineOperator.map(e => e.username).join('/')
if (data.areaOperator && data.areaOperator.length) data.areaOperatorText = data.areaOperator.map(e => e.username).join('/')
this.merchantDetailInfo = data
},
changeMerchant (e) {
this.$emit('changeMerchant', e)
},
setDate (rangeType, dateRange) {
if (rangeType) this.timeRangeType = this.timeRangeOptions.find(item => item.value == rangeType)
if (dateRange) this.dateRange = dateRange
}
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.storeSignboard-container {
padding: 22px 20px 0;
border-bottom: 1px solid #e5e5e5;
position: relative;
::v-deep.calendar-box {
position: absolute;
top: 16px;
right: 20px;
.calendar-custom {
flex-direction: column;
.time-control-group {
margin: 0 0 6px;
}
}
}
.merchant-info {
height: 48px;
margin-bottom: 6px;
.merchant-icon {
width: 48px;
height: 48px;
border-radius: 100%;
background: #2a58ad1a;
margin-right: 12px;
justify-content: center;
.icon {
width: 20px;
height: 20px;
}
}
.info {
width: 527px;
height: 100%;
.name {
padding-top: 2.5px;
color: #333333;
font-size: 16px;
font-weight: 500;
margin-bottom: 8px;
}
}
}
.control {
color: #333333;
font-size: 13px;
.scene {
padding-right: 12px;
margin-right: 12px;
border-right: 1px solid #ddd;
&-icon {
width: 16px;
height: 16px;
margin-right: 4px;
}
}
.change-store {
padding: 0 !important;
}
}
.el-icon-sort {
transform: rotate(90deg) scaleX(-1);
}
.merchant-detail {
padding: 12.5px 0 8.5px;
flex-wrap: wrap;
.item {
width: calc(100% / 3);
font-size: 14px;
margin-bottom: 8px;
.label {
text-align: right;
color: #666666;
flex-shrink: 0;
}
.value {
max-width: calc(100% - 73px);
color: #333333;
}
}
.fit-width {
width: calc(100% / 3 * 2);
}
}
}
::v-deep .el-tooltip__popper {
max-height: 50vh;
overflow-y: auto;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!