Commit c90b1613 by chenwq

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

…stem into SAAS+V5.8.2-cwq
2 parents c08fad54 0d76505f
Showing 29 changed files with 528 additions and 215 deletions
......@@ -418,10 +418,15 @@ export function batchCreateStrategy(data = {}) {
*
* 查询策略 驻店员工/区域运营/飞行督导列表
*/
// export function getStrategyStaffList(data = {}) {
// data.method = "dj.api.strategy.staff.page";
// return request(data, RequestMethods.POST);
// }
export function getStrategyStaffList(data = {}) {
data.method = "dj.api.strategy.staff.page";
data.method = "dj.api.strategy.staff.page.distinct.phone";
return request(data, RequestMethods.POST);
}
/*
/**
* 策略中心-查询策略录音记录
......
......@@ -141,7 +141,9 @@
<el-tag v-if="hasValue(sub, scope.row)" :type="getSchemaTagOptions(sub, scope.row).type">
{{ getSchemaTagOptions(sub, scope.row).label }}
</el-tag>
<span v-else></span>
<el-tag v-else>
-
</el-tag>
</div>
</template>
......@@ -255,7 +257,9 @@
<el-tag v-if="hasValue(item, scope.row)" :type="getSchemaTagOptions(item, scope.row).type">
{{ getSchemaTagOptions(item, scope.row).label }}
</el-tag>
<span v-else></span>
<el-tag v-else>
-
</el-tag>
</div>
</template>
......
<template>
<el-row class="description-wrapper"
style="width:100%;overflow:hidden;flex-wrap: wrap"
type="flex"
:gutter="gutter"
align="top">
<template v-for="item in getSchema">
<el-col v-if="!isHideSchemaItem(item)"
:key="item._key"
:span="item.col || 12">
<template v-if="item.divider">
<el-divider v-bind="item.dividerProps"></el-divider>
</template>
<template v-else>
<slot :name="item.slot || item.name ">
<div class="form-item" :style="item.itemStyle || {}">
<span class="label text-hide"
:title="item.label"
:style="{ width: item.labelWidth || '150px' }">
<slot :name="`${item.slot || item.name}-label`">
{{ item.label }}{{ item.hideColon ? "" : ":" }}
</slot>
</span>
<span class="value">
<el-tooltip :disabled="!item.tooltip"
v-bind="item.tooltipProps">
<template #content>
<template v-if="item.tooltipProps.render">
<RenderProxy :render="item.tooltipProps.render"
:row="{ data, schemaItem: item, schema }" />
</template>
<template v-else>
{{ isZeroOrNumber(getValue(item.descKey || item.name, item)) }}
</template>
</template>
<div :class="item.parentProps.className" :style="{ width: item.valueWidth, ...item.parentProps.style }">
<template v-if="item.render">
<RenderProxy :render="item.render"
:row="{ data, schemaItem: item, schema }" />
</template>
<template v-else>
<slot :name="`${item.slot || item.name}-value`">
{{ isZeroOrNumber(getValue(item.descKey || item.name, item)) }}
</slot>
</template>
</div>
</el-tooltip>
</span>
</div>
</slot>
</template>
</el-col>
<el-row align="top"
class="description-wrapper"
style="width:100%;overflow:hidden;flex-wrap: wrap"
type="flex"
:gutter="gutter">
<template v-for="item in getSchema">
<el-col v-if="!isHideSchemaItem(item)"
:key="item._key"
:span="item.col || 12">
<template v-if="item.divider">
<el-divider v-bind="item.dividerProps"></el-divider>
</template>
<template v-else>
<slot :name="item.slot || item.name ">
<div class="form-item" :style="item.itemStyle || {}">
<div class="label text-hide"
:style="{ width: item.labelWidth || '150px' }"
:title="item.label">
<slot :name="`${item.slot || item.name}-label`">
{{ item.label }}{{ item.hideColon ? "" : ":" }}
</slot>
</div>
<div class="value">
<el-tooltip :disabled="!item.tooltip"
v-bind="item.tooltipProps">
<template #content>
<template v-if="item.tooltipProps.render">
<RenderProxy :render="item.tooltipProps.render"
:row="{ data, schemaItem: item, schema }" />
</template>
<template v-else>
{{ isZeroOrNumber(getValue(item.descKey || item.name, item)) }}
</template>
</template>
<div :class="item.parentProps.className" :style="{ width: item.valueWidth, ...item.parentProps.style }">
<template v-if="item.render">
<RenderProxy :render="item.render"
:row="{ data, schemaItem: item, schema }" />
</template>
<template v-else>
<slot :name="`${item.slot || item.name}-value`">
{{ isZeroOrNumber(getValue(item.descKey || item.name, item)) }}
</slot>
</template>
</div>
</el-tooltip>
</div>
</div>
</slot>
</template>
</el-col>
</template>
</el-row>
</el-row>
</template>
<script>
......@@ -168,6 +168,7 @@ export default {
> .value {
flex-shrink: 0;
flex: 1;
flex-basis: 0;
overflow: hidden;
}
}
......
......@@ -33,7 +33,7 @@
<div class="label">
{{ item.categoryExtension }}
{{ item.categoryExtension == '全部' ? item.metricName : (item.categoryExtension + item.metricName) }}
</div>
......@@ -79,7 +79,7 @@
<div class="label">
{{ item.categoryExtension }}
{{ item.categoryExtension == '全部' ? item.metricName : (item.categoryExtension + item.metricName) }}
</div>
......@@ -224,7 +224,7 @@ export default {
},
formatIsRatio(delta) {
return delta < 0 ? "decline" : delta === 0 ? "just01" : "rise";
return delta < 0 ? "decline" : delta == 0 ? "just01" : "rise";
},
},
......@@ -321,9 +321,10 @@ export default {
font-size: 13px;
.label {
width: 104px;
min-width: 104px;
color: #888888;
margin-right: 10px;
}
.value {
......
......@@ -177,7 +177,7 @@
<template #metrics="scope">
<span class="effect-cell"
@click="handleEffectDetail(scope.scope)">
{{ scope.scope.metrics.length }} <span style="color: #333333;">项提升</span>
{{ countImprovedMetrics(scope.scope.metrics) }} <span style="color: #333333;">项提升</span>
</span>
</template>
</d2-table>
......@@ -743,6 +743,12 @@ export default {
this.loading.onlineOperData = false;
}
},
countImprovedMetrics(metrics) {
if (!Array.isArray(metrics)) {
return 0;
}
return metrics.filter(m => m.improved === true).length;
},
handleEffectDetail(row) {
this.effectDetailRow = row.metrics;
this.effectDetailVisible = true;
......
......@@ -175,16 +175,27 @@ export default {
brand: [],
regionOps: "",
onlineOps: this.getDefaultOnlineOps(),
supervisorOps: null,
};
},
syncFormFromFilters() {
const { region = "", provinceId = "", brand = [], regionOps = "", onlineOps = "" } = this.filters || {};
const {
region = "",
provinceId = "",
brand = [],
regionOps = "",
onlineOps = "",
supervisorOps,
flightSupervisionId,
} = this.filters || {};
const supervisorValue = supervisorOps ?? flightSupervisionId ?? null;
this.formData = {
region,
provinceId: provinceId || "",
brand: Array.isArray(brand) ? brand.map(item => (Array.isArray(item) ? [...item] : item)) : [],
regionOps: regionOps || "",
onlineOps: onlineOps || this.getDefaultOnlineOps(),
supervisorOps: supervisorValue === "" ? null : supervisorValue,
};
},
submit() {
......
......@@ -22,19 +22,20 @@
<span class="label">门店名称:</span>
<el-input v-model="localFilters.storeName"
class="filter-select"
clearable
maxlength="50"
placeholder="请输入"
size="small">
size="small"
clearable>
</el-input>
</div>
<div class="filter-group">
<span class="label">项目组:</span>
<el-select v-model="localFilters.groupId"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in groupOptions"
:key="item.value"
:label="item.label"
......@@ -59,10 +60,10 @@
<span class="label">区域:</span>
<el-select v-model="localFilters.provinceId"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in provinceOptions"
:key="item.code"
:label="item.name"
......@@ -74,24 +75,24 @@
<span class="label">品牌:</span>
<el-cascader v-model="localFilters.brand"
class="filter-select-brand"
placeholder="全部"
size="small"
clearable
collapse-tags
filterable
:options="brandOptions"
placeholder="全部"
:props="cascaderProps"
:show-all-levels="false"
size="small">
:show-all-levels="false">
</el-cascader>
</div>
<div v-if="false" class="filter-group">
<span class="label">区域运营:</span>
<el-select v-model="localFilters.regionOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in regionOpsOptions"
:key="item.value"
:label="item.label"
......@@ -103,10 +104,10 @@
<span class="label">线上运营:</span>
<el-select v-model="localFilters.onlineOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in onlineOpsOptions"
:key="item.value"
:label="item.label"
......
......@@ -2,10 +2,10 @@
<div class="monitor-card" :class="{ 'is-checked': cardData.checked }">
<div class="card-head">
<!-- {{ cardData }} -->
<el-tooltip :disabled="!cardData.storeName"
effect="dark"
<el-tooltip effect="dark"
placement="bottom"
popper-class="dark-tooltip">
popper-class="dark-tooltip"
:disabled="!cardData.storeName">
<template #content>
<div style="width:236px;line-height:1.6;word-break:break-all;">
{{ cardData.storeName }}
......@@ -24,10 +24,10 @@
<div class="card-body" @click="handleViewDetail">
<div class="row-item">
<span class="label">主营品牌:</span>
<el-tooltip :disabled="!cardData.mainBrands"
effect="dark"
<el-tooltip effect="dark"
placement="top"
popper-class="dark-tooltip">
popper-class="dark-tooltip"
:disabled="!cardData.mainBrands">
<template #content>
<div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ cardData.mainBrandsStr }}
......@@ -38,10 +38,10 @@
</div>
<div class="row-item">
<span class="label">线上运营:</span>
<el-tooltip :disabled="!onlineOperatorText"
effect="dark"
<el-tooltip effect="dark"
placement="top"
popper-class="dark-tooltip">
popper-class="dark-tooltip"
:disabled="!onlineOperatorText">
<template #content>
<div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ onlineOperatorText }}
......@@ -52,10 +52,10 @@
</div>
<div class="row-item">
<span class="label">区域运营:</span>
<el-tooltip :disabled="!areaOperatorText"
effect="dark"
<el-tooltip effect="dark"
placement="top"
popper-class="dark-tooltip">
popper-class="dark-tooltip"
:disabled="!areaOperatorText">
<template #content>
<div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ areaOperatorText }}
......@@ -66,10 +66,10 @@
</div>
<div class="row-item">
<span class="label">区域督导:</span>
<el-tooltip :disabled="!flightSupervisionText"
effect="dark"
<el-tooltip effect="dark"
placement="top"
popper-class="dark-tooltip">
popper-class="dark-tooltip"
:disabled="!flightSupervisionText">
<template #content>
<div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ flightSupervisionText }}
......@@ -88,10 +88,10 @@
<img alt=""
class="icon-img"
:src="getAlertIcon(item)">
<el-tooltip :disabled="!warningOverflowMap[index]"
effect="dark"
<el-tooltip effect="dark"
placement="top"
popper-class="dark-tooltip">
popper-class="dark-tooltip"
:disabled="!warningOverflowMap[index]">
<template #content>
<div style="max-width:236px;line-height:1.6;word-break:break-all;">
{{ getWarningDisplayText(item) }}
......
......@@ -108,6 +108,7 @@ import HeaderCustom from "./compoments/headerCustom.vue";
import MonitorCard from "./compoments/monitorCard.vue";
import SelectCustom from "./compoments/selectCustom.vue";
import AddStrategy from "./storeSignboard/components/AddStrategy/index.vue";
import { getWarningSummaryCleanParams, saveWarningSummaryParams } from "./utils/warningSummaryParams";
// 盯防类型图标配置(配置化管理,易于扩展)
const WATCH_TYPE_ICON_CONFIG = {
2: {
......@@ -273,8 +274,28 @@ export default {
storeName: card.storeName,
}));
},
// 与 getMonitorListData 中 cleanParams 保持一致,供门店看板等场景复用
warningSummaryCleanParams() {
return getWarningSummaryCleanParams({
filters: this.filters,
timeRangeType: this.timeRangeType,
dateRange: this.dateRange,
currentTab: this.currentTab,
currentWatchType: this.currentWatchType,
currentIndicatorType: this.currentIndicatorType,
});
},
},
watch: {
"warningSummaryCleanParams": {
handler(params) {
saveWarningSummaryParams(params);
},
deep: true,
immediate: true,
},
// 监听盯防类型变化,自动重置指标类型为"全部"
"currentWatchType.value": function (newValue, oldValue) {
if (newValue !== oldValue) {
......@@ -347,6 +368,7 @@ export default {
twoBrandIds,
regionOps,
onlineOps,
supervisorOps,
} = this.filters;
const params = {
storeName,
......@@ -357,6 +379,7 @@ export default {
twoBrandIds: twoBrandIds || [],
regionalOperatorId: regionOps,
onlineOperatorId: onlineOps,
flightSupervision: supervisorOps,
// periodType: this.timeRangeType.value,
cycleType: {
1: 2,
......@@ -365,7 +388,7 @@ export default {
}[this.timeRangeType.value],
businessType: this.currentTab.value,
startDate: this.dateRange.startDate,
monitorType: this.currentWatchType.value,
warningType: this.currentWatchType.value,
metricTypeId: this.currentIndicatorType.value,
endDate: this.dateRange.endDate,
};
......
......@@ -14,9 +14,9 @@
<div class="search-box flex">
<el-input v-model="searchForm.staffName"
class="search-input"
clearable
placeholder="搜索员工名称"
size="small">
size="small"
clearable>
</el-input>
<el-date-picker v-model="searchForm.receptionDate"
class="search-input"
......@@ -24,6 +24,16 @@
size="small"
type="date">
</el-date-picker>
<el-select v-model="searchForm.orderFinishFlag"
class="search-input"
placeholder="订单成交标记"
size="small">
<el-option v-for="item in orderFinishFlagOptions"
:key="String(item.value)"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button size="small"
type="primary"
@click="handleSearch">
......@@ -36,10 +46,10 @@
</div>
<div class="table">
<d2-table ref="multipleTable"
layout="total, prev, pager, next"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:has-num="false"
layout="total, prev, pager, next"
:pager-count="5"
:search-form="searchFormSearch"
:table-params="tableParams"
......@@ -96,7 +106,7 @@ export default {
dialogConfig: {
config: {
title: "选择录音",
width: "1092px",
width: "1192px",
},
},
targetId: "id",
......@@ -107,9 +117,15 @@ export default {
};
},
getListApi: getRecordAllPageListByCondition,
orderFinishFlagOptions: [
{ label: "全部", value: null },
{ label: "战败", value: 0 },
{ label: "成功", value: 1 },
],
searchForm: {
staffName: "",
receptionDate: "",
orderFinishFlag: null,
businessType: 1,
},
searchFormSearch: {},
......@@ -155,8 +171,10 @@ export default {
},
{
label: "成交状态",
prop: "defencePoint",
minWidth: 90,
prop: "orderFinishFlag",
formatter(row) {
return row.orderFinishFlag ? "成功" : "战败";
},
},
],
},
......
......@@ -14,9 +14,9 @@
<div class="search-box flex">
<el-input v-model="searchForm.staffName"
class="search-input"
clearable
placeholder="搜索员工名称"
size="small">
size="small"
clearable>
</el-input>
<el-button size="small"
type="primary"
......@@ -30,10 +30,10 @@
</div>
<div class="table">
<d2-table ref="multipleTable"
layout="total, prev, pager, next"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:has-num="false"
layout="total, prev, pager, next"
:pager-count="5"
:search-form="searchFormSearch"
:table-params="tableParams"
......
......@@ -495,12 +495,12 @@ export default {
if ((index + 1) % 2 == 0) {
rightWarningInfoList.push({
type: e.warningText.startsWith("兜底预警") ? 1 : 2,
text: e.warningText,
text: `${e.warningTypeName}: ${e.warningText}`,
});
} else {
leftWarningInfoList.push({
type: e.warningText.startsWith("兜底预警") ? 1 : 2,
text: e.warningText,
text: `${e.warningTypeName}: ${e.warningText}`,
});
}
});
......@@ -732,9 +732,9 @@ export default {
.summary-box {
position: relative;
height: calc(100% - 91px);
margin-top: 8px;
margin-top: 18%;
box-sizing: border-box;
padding: 12px 35px 12px 13px;
padding: 12px 10px 12px 13px;
z-index: 9;
.help {
position: absolute;
......@@ -755,7 +755,7 @@ export default {
}
.fixed-summary02 {
position: absolute;
bottom: 12%;
bottom: 30%;
left: 50%;
transform: translateX(-54%);
min-width: 95px;
......
......@@ -26,9 +26,17 @@
<script>
import { getWarningSummaryList } from "@/api/earlyWarningManager";
import {
cleanWarningSummaryParams,
getWarningSummaryParamsFromRoute,
loadWarningSummaryParams,
} from "../../../utils/warningSummaryParams";
export default {
name: "ChangeMerchantDialog",
inject: {
GET_PARAMS_INFO: { default: () => () => ({}) },
},
props: {
visible: {
type: Boolean,
......@@ -81,18 +89,25 @@ export default {
this.btnLoding = false;
this.$emit("dialogClose");
},
getWarningSummaryRequestParams() {
const stored = loadWarningSummaryParams() || getWarningSummaryParamsFromRoute(this.$route.query);
const { bizs, cycleType, startTime, endTime } = this.GET_PARAMS_INFO() || {};
return cleanWarningSummaryParams({
...stored,
...(bizs != null && { businessType: bizs }),
...(cycleType != null && { cycleType }),
...(startTime && { startDate: startTime }),
...(endTime && { endDate: endTime }),
});
},
async getMerchantList() {
this.loading = true;
console.log(this.$route.query);
const { businessType, startDate, endDate, periodType } = this.$route.query || {};
const data = await getWarningSummaryList({
businessType,
startDate,
endDate,
periodType,
});
this.loading = false;
this.merchantList = data;
try {
const data = await getWarningSummaryList(this.getWarningSummaryRequestParams());
this.merchantList = data;
} finally {
this.loading = false;
}
},
async submit() {
this.btnLoding = true;
......
......@@ -125,7 +125,7 @@ export default {
},
{
label: "区域督导",
key: "flightSupervisionext",
key: "flightSupervisionText",
tooltip: true,
},
{
......
......@@ -185,9 +185,9 @@
</template>
</div>
<d2-table ref="leftTable"
layout="total, prev, pager, next"
:before-search-fn="leftBeforeSearchFn"
:get-list-api="secondGetListApi"
layout="total, prev, pager, next"
:pager-count="5"
:search-form="leftFormSearch"
:table-params="secondTableParams">
......@@ -234,9 +234,9 @@
</template>
</div>
<d2-table ref="rightTable"
layout="total, prev, pager, next"
:before-search-fn="rightBeforeSearchFn"
:get-list-api="secondGetListApi"
layout="total, prev, pager, next"
:pager-count="5"
:search-form="rightFormSearch"
:table-params="secondTableParams">
......@@ -366,8 +366,9 @@ export default {
{
label: "成交状态",
minWidth: 80,
formatter: (cell) => {
return cell.defencePoint != null ? `${cell.defencePoint}分` : "-";
prop: "orderFinishFlag",
formatter(row) {
return row.orderFinishFlag ? "成功" : "战败";
},
},
],
......
......@@ -50,7 +50,7 @@
</template>
<div class="btn-list flex">
<!-- 状态=未下发 -->
<template v-if="item.pushFlag == 0">
<template v-if="item.pushFlag == 0 || item.pushFlag == 2 || item.pushFlag == 3">
<el-button class="btn-default _btn"
:size="size"
@click="deleteStrategy(item)">
......@@ -58,9 +58,9 @@
</el-button>
</template>
<el-button class="btn-primary _btn"
type="primary"
plain
:size="size"
type="primary"
@click="$emit('toDetail', item)">
查看详情
</el-button>
......
......@@ -101,10 +101,10 @@
</div>
<div class="sub-value flex">
<template>
环比{{ formatMom(summaryInfo.contactConversionRateMon) }}
<template v-if="formatIsRatio(summaryInfo.contactConversionRateMon)">
环比{{ formatMom(summaryInfo.contactConversionRateMom) }}
<template v-if="formatIsRatio(summaryInfo.contactConversionRateMom)">
<img class="arrow"
:src="getIconSrc(formatIsRatio(summaryInfo.contactConversionRateMon))" />
:src="getIconSrc(formatIsRatio(summaryInfo.contactConversionRateMom))" />
</template>
</template>
</div>
......@@ -412,23 +412,26 @@ export default {
async getStrategyMerchantListWarningInfo() {
let params = this.paramsInfo;
let data = await getStrategyMerchantListWarningInfo(params);
console.log(data, "data/index.vue(查询门店预警信息列表)");
let leftWarningInfoList = [];
let rightWarningInfoList = [];
data.forEach((e, index) => {
if ((index + 1) % 2 == 0) {
rightWarningInfoList.push({
type: e.startsWith("兜底预警") ? 1 : 2,
text: e,
type: e.warningType,
text: `${e.warningTypeName}: ${e.warningText}`,
});
} else {
leftWarningInfoList.push({
type: e.startsWith("兜底预警") ? 1 : 2,
text: e,
type: e.warningType,
text: `${e.warningTypeName}: ${e.warningText}`,
});
}
});
this.leftWarningInfoList = leftWarningInfoList;
this.rightWarningInfoList = rightWarningInfoList;
console.log(this.leftWarningInfoList, "leftWarningInfoList/index.vue(查询门店预警信息列表)");
console.log(this.rightWarningInfoList, "rightWarningInfoList/index.vue(查询门店预警信息列表)");
},
async getStrategyStoreDetailSummaryZJInfo() {
try {
......@@ -444,7 +447,8 @@ export default {
this.summaryInfoZJ = data || {};
this.startDay = data.periodStartDate;
this.endDay = data.periodEndDate;
this.showZJ = data.contactRate > 0;
this.showZJ
= data?.newCarDeliveryCount != null && data.newCarDeliveryCount !== "";
this.summaryLeftLoading = false;
console.log(data, "SummaryOverview/index.vue(查询门店经营概况-主机厂)");
} catch (error) {
......@@ -597,7 +601,7 @@ export default {
height: calc(100% - 91px);
margin-top: 8px;
box-sizing: border-box;
padding: 12px 35px 12px 13px;
padding: 12px 20px 12px 13px;
z-index: 9;
.help {
position: absolute;
......@@ -625,7 +629,6 @@ export default {
font-size: 13px;
.label {
color: #666666;
.num {
display: block;
color: #2a58ad;
......
const STORAGE_KEY = "strategyCentre_warningSummaryParams";
const CYCLE_TYPE_MAP = { 1: 2, 2: 3, 4: 4 };
/** 与策略中心 getMonitorListData 中 params 构建逻辑一致 */
export function buildWarningSummaryParams({
filters = {},
timeRangeType = {},
dateRange = {},
currentTab = {},
currentWatchType = {},
currentIndicatorType = {},
}) {
const {
storeName,
isStrategySent,
groupId,
provinceId,
firstbrandIds,
twoBrandIds,
regionOps,
onlineOps,
} = filters;
return {
storeName,
isStrategySent: isStrategySent === "" ? undefined : isStrategySent,
groupId,
regionId: provinceId,
firstbrandIds: firstbrandIds || [],
twoBrandIds: twoBrandIds || [],
regionalOperatorId: regionOps,
onlineOperatorId: onlineOps,
cycleType: CYCLE_TYPE_MAP[timeRangeType.value],
businessType: currentTab.value,
startDate: dateRange.startDate,
monitorType: currentWatchType.value,
metricTypeId: currentIndicatorType.value,
endDate: dateRange.endDate,
};
}
export function cleanWarningSummaryParams(params) {
return Object.fromEntries(
Object.entries(params).filter(([_, v]) => v != null && v !== "" && !(Array.isArray(v) && v.length === 0)),
);
}
export function getWarningSummaryCleanParams(state) {
return cleanWarningSummaryParams(buildWarningSummaryParams(state));
}
export function saveWarningSummaryParams(params) {
sessionStorage.setItem(STORAGE_KEY, JSON.stringify(params));
}
export function loadWarningSummaryParams() {
try {
const raw = sessionStorage.getItem(STORAGE_KEY);
return raw ? JSON.parse(raw) : null;
} catch {
return null;
}
}
/** 门店看板路由参数兜底(无策略中心缓存时) */
export function getWarningSummaryParamsFromRoute(query = {}) {
const { businessType, startDate, endDate, timeRangeType, periodType } = query;
const period = timeRangeType ?? periodType;
return cleanWarningSummaryParams({
businessType: businessType != null ? Number(businessType) : undefined,
startDate,
endDate,
cycleType: CYCLE_TYPE_MAP[period],
});
}
......@@ -20,15 +20,15 @@
<span class="detail-label">门店名称:</span>
<span class="detail-value">{{ detailForm.storeName }}</span>
</el-col>
<el-col class="detail-row" :span="12">
<el-col class="detail-row" :span="12">
<span class="detail-label">园区店店名称:</span>
<span class="detail-value">{{ detailForm.sellerMerchantShopName }}</span>
</el-col>
<el-col class="detail-row" :span="12">
<el-col class="detail-row" :span="12">
<span class="detail-label">客户姓名:</span>
<span class="detail-value">{{ detailForm.customerName }}</span>
</el-col>
<el-col class="detail-row" :span="12">
<el-col class="detail-row" :span="12">
<span class="detail-label">车架号:</span>
<span class="detail-value">{{ detailForm.standNo }}</span>
</el-col>
......@@ -77,7 +77,7 @@
技师占比
</div>
<div class="value">
<span>{{ detailForm.staffList[0] ? detailForm.staffList[0].name : '-' }}</span>
<span>{{ detailForm.technicianShareText || '-' }}</span>
</div>
</div>
</section>
......@@ -150,12 +150,14 @@
prop="remark" />
<el-table-column align="center" label="操作">
<template #default="scope">
<el-button type="text" v-if="scope.row.subItemPictures.length" @click="handlePreviewImage(scope.row)">
<el-button v-if="scope.row.subItemPictures.length"
type="text"
@click="handlePreviewImage(scope.row)">
查看施工图
</el-button>
<span v-else>
-
</span>
<span v-else>
-
</span>
</template>
</el-table-column>
</el-table>
......@@ -231,6 +233,7 @@ function emptyForm() {
staffList: [],
mainTechnicianList: [],
subTechnicianList: [],
technicianShareText: "-",
serviceItems: [],
subOrders: [],
dispatchTime: "",
......@@ -430,7 +433,7 @@ export default {
EARLIEST_OUTBOUND: "outboundTime",
EARLIEST_START: "startConstructionTime",
LATEST_END: "endConstructionTime",
LATEST_COMPLETE: "completeTime"
LATEST_COMPLETE: "completeTime",
};
const next = emptyTimelineFields();
list.forEach((it) => {
......@@ -454,7 +457,8 @@ export default {
});
},
handlePreviewImage(item) {
if (!item.subItemPictures?.length) return
if (!item.subItemPictures?.length)
return;
this.imgViewerVisible = true;
this.imageFileArr = item.subItemPictures || [];
},
......
......@@ -16,6 +16,92 @@ function toIntOrNull(v) {
return Number.isNaN(n) ? null : n;
}
function toNumberOrNull(v) {
if (v == null || v === "")
return null;
const n = Number(v);
return Number.isNaN(n) ? null : n;
}
function formatPercentNumber(n) {
const rounded = Math.round(n * 100) / 100;
if (!Number.isFinite(rounded))
return "";
return String(rounded);
}
function shareRateToPercentString(shareRate) {
const n = toNumberOrNull(shareRate);
if (n == null)
return "";
const percent = n <= 1 ? n * 100 : n;
return `${formatPercentNumber(percent)}%`;
}
function shareRateToPercentNumber(shareRate) {
const n = toNumberOrNull(shareRate);
if (n == null)
return null;
const percent = n <= 1 ? n * 100 : n;
return Number.isFinite(percent) ? percent : null;
}
function getTechnicianShareValue(t) {
if (!t)
return null;
if (t.shareRate != null && t.shareRate !== "")
return t.shareRate;
if (t.shareRatio != null && t.shareRatio !== "")
return t.shareRatio;
return null;
}
function buildTechnicianShareText(mainList, subList) {
const all = []
.concat(Array.isArray(mainList) ? mainList : [])
.concat(Array.isArray(subList) ? subList : [])
.filter(Boolean);
const mains = all.filter(t => Number(t.technicianType) === 0);
const subs = all.filter(t => Number(t.technicianType) === 1);
if (!mains.length && !subs.length)
return "-";
const subWithRate = subs.filter((t) => {
const v = getTechnicianShareValue(t);
return v != null && v !== "";
});
const mainCandidate = mains.find((t) => {
const v = getTechnicianShareValue(t);
return v != null && v !== "";
}) || mains[0] || null;
const mainPercentStr = shareRateToPercentString(getTechnicianShareValue(mainCandidate));
if (!subWithRate.length) {
const p = mainPercentStr || "100%";
return `主技师${p}(默认比例)`;
}
let mainPartPercent = mainPercentStr;
if (!mainPartPercent) {
const sum = subWithRate.reduce((acc, t) => {
const pn = shareRateToPercentNumber(getTechnicianShareValue(t));
return acc + (pn != null ? pn : 0);
}, 0);
const remain = Math.max(0, 100 - sum);
mainPartPercent = `${formatPercentNumber(remain)}%`;
}
const parts = [`主技师 ${mainPartPercent}`];
subWithRate.forEach((t, idx) => {
const name = `副手技师${t.technicianName}`;
const p = shareRateToPercentString(getTechnicianShareValue(t));
if (!p)
return;
parts.push(`${name} ${p}`);
});
return parts.length ? parts.join(" / ") : "-";
}
function formatListDateTime(v) {
if (v == null || v === "")
return "-";
......@@ -224,6 +310,7 @@ export function mapApiRowToDetailForm(row) {
name: t.technicianName,
role: t.technicianType === 0 ? "main" : "sub",
roleLabel: t.technicianType === 0 ? "主技师" : "技师",
shareRate: t.shareRate != null ? t.shareRate : t.shareRatio,
}));
const subTech = (row.subTechnicianList || [])
.filter(t => t)
......@@ -231,6 +318,7 @@ export function mapApiRowToDetailForm(row) {
name: t.technicianName,
role: "sub",
roleLabel: "副手技师",
shareRate: t.shareRate != null ? t.shareRate : t.shareRatio,
}));
const staffList = [...mainTech, ...subTech];
const serviceItems = []
......@@ -269,7 +357,7 @@ export function mapApiRowToDetailForm(row) {
reworkFlag: s.subItemStatus == 3 ? "是" : "否",
reworkConstructionCode: s.reworkConstructionCode || "-",
refundQuantity: formatMaterialsUsedDisplay(s.refundQuantity),
remark: s.subItemStatus == 3 ? (s.remark || '-') : "-",
remark: s.subItemStatus == 3 ? (s.remark || "-") : "-",
subItemPictures: (s.subItemPictures || [])
.map((p) => {
if (typeof p === "string")
......@@ -290,6 +378,9 @@ export function mapApiRowToDetailForm(row) {
staffList: staffList.length
? staffList
: [{ name: "-", role: "", roleLabel: "-" }],
mainTechnicianList: row.mainTechnicianList || [],
subTechnicianList: row.subTechnicianList || [],
technicianShareText: buildTechnicianShareText(row.mainTechnicianList, row.subTechnicianList),
serviceItems: serviceItems.length ? serviceItems : [{ name: "-", qty: "-" }],
subOrders: subOrders.length
? subOrders
......
......@@ -7,12 +7,22 @@ export async function getTaskCenterTaskDescriptionSchema() {
label: "任务描述",
col: 24,
labelWidth: "120px",
// slot : 整体的插槽名,优先级高于name
// itemStyle: 每一项的样式
// tooltip: boolean 是否用tooltip 展示data数据
// tooltipProps: el-tooltip 的传参
// render ?:(h,{ data,schemaItem,schema } )=>{} 自定义渲染
// isHide 是否隐藏 (data)=>boolean || boolean
// slot : 整体的插槽名,优先级高于name
// itemStyle: 每一项的样式
tooltip: true,
parentProps: {
style: {
display: "inline-block",
height: "32px",
width: "auto",
verticalAlign: "top",
},
},
// tooltipProps: el-tooltip 的传参
render: (h, { data, schemaItem, schema }) => {
return h("span", {}, data.description || "-");
},
isHide: ({ formModel }) => !formModel.description,
},
{
name: "bizTypeName",
......@@ -56,7 +66,6 @@ export async function getTaskCenterTaskDescriptionSchema() {
col: 24,
labelWidth: "120px",
render: (h, { data }) => {
console.log("data");
const names = data.assignees.map(item => item.assigneeName).join(",") || "-";
return h("span", {}, names);
},
......@@ -64,6 +73,8 @@ export async function getTaskCenterTaskDescriptionSchema() {
{
divider: true,
isHide: ({ formModel }) => !formModel.description,
},
{
divider: true,
......@@ -73,24 +84,46 @@ export async function getTaskCenterTaskDescriptionSchema() {
label: "任务编号",
col: 24,
labelWidth: "120px",
render: (h, { data }) => {
return h("span", {}, data.taskNo || "-");
},
},
{
name: "createdBy",
label: "创建人",
col: 24,
labelWidth: "120px",
render: (h, { data }) => {
return h("span", {}, data.createdBy || "-");
},
},
{
name: "createdDate",
label: "创建时间",
col: 24,
labelWidth: "120px",
render: (h, { data }) => {
return h("span", {}, data.createdDate || "-");
},
},
{
name: "dueTime",
label: "截止时间",
col: 24,
labelWidth: "120px",
render: (h, { data }) => {
return h("span", {}, data.dueTime || "-");
},
},
{
name: "completeTime",
label: "完成时间",
col: 24,
labelWidth: "120px",
render: (h, { data }) => {
return h("span", {}, data.completeTime || "-");
},
},
];
}
......@@ -58,18 +58,24 @@ export default {
await this.getData(query.taskId);
const schema = await getTaskCenterTaskDescriptionSchema();
schema.splice(6, 0, ...this.detail.bizDisplayInfo.map(item => ({
name: item.fieldId,
label: item.fieldName,
col: 24,
parentProps: {
className: "",
},
labelWidth: "120px",
meta: item,
render: cover2Descriptions[toUpper(item.fieldType)],
})));
this.descriptionSchema = schema;
const dynamicSchema = this?.detail?.bizDisplayInfo || [];
if (dynamicSchema && dynamicSchema.length) {
schema.splice(6, 0, ...(this?.detail?.bizDisplayInfo || []).map(item => ({
name: item.fieldId,
label: item.fieldName,
col: 24,
parentProps: {
className: "",
},
labelWidth: "120px",
meta: item,
render: cover2Descriptions[toUpper(item.fieldType)],
})));
this.descriptionSchema = schema;
} else {
// 如果是空的, 去除两条横线
this.descriptionSchema = schema.filter(item => !item.divider);
}
},
methods: {
async getData(taskId) {
......
......@@ -109,7 +109,7 @@ export async function getTableColumns() {
width: "120px",
align: "left",
formatter: (row) => {
return row.assignees.map(item => item.assigneeName).join(",") || "-";
return (row?.assignees || []).map(item => item.assigneeName).join(",") || "-";
},
},
{
......@@ -130,6 +130,9 @@ export async function getTableColumns() {
prop: "completeTime",
width: "180px",
align: "left",
formatter: (row) => {
return row.completeTime || "-";
},
},
{
label: "截止时间",
......@@ -159,12 +162,18 @@ export async function getTableColumns() {
prop: "createdBy",
width: "140px",
align: "left",
formatter: (row) => {
return row.createdBy || "-";
},
},
{
label: "创建时间",
prop: "createdDate",
width: "180px",
align: "left",
formatter: (row) => {
return row.createdDate || "-";
},
},
];
}
......@@ -22,15 +22,13 @@
<span>{{ row.upgradeCommodityCode || '-' }}</span>
</el-form-item>
<el-form-item v-if="row.isFilm"
:error="errorMsg"
label="库存数量:"
prop="stockNum">
<el-input v-model="form.stockNum"
placeholder="请输入"
style="width: 200px"
@input="handleInput">
style="width: 200px">
<template #append>
米
{{ membraneTypeList.includes(row.goodsType) == 1 ? "米" : "件" }}
</template>
</el-input>
</el-form-item>
......@@ -43,6 +41,7 @@
<script>
import { replenishCodeApi } from "@/api/stockManage";
import { limitPrice } from "@/common/format";
import { baseConfig } from "@/main";
export default {
name: "ComplementCodeDialog",
......@@ -58,16 +57,18 @@ export default {
},
data() {
return {
membraneTypeList: baseConfig.membraneTypeList,
showQrCode: false,
form: {
stockNum: "",
},
rules: {
stockNum: [
{ required: true, message: "请输入库存数量", trigger: "blur" },
{ required: true, message: "请输入库存数量" },
{ validator: this.validateStockNum, trigger: "blur" },
{ validator: this.validateStockNum, trigger: "change" },
],
},
errorMsg: "",
isLoading: false,
config: {
showClose: true,
......@@ -94,17 +95,40 @@ export default {
},
},
methods: {
handleInput(val) {
// 只能输入数字,保留2位小数
validateStockNum(rule, val, callback) {
// 1. 必填校验
if (!val) {
return callback(new Error("请输入库存数量"));
}
// 2. 格式化输入:只能输入数字,保留2位小数
let formatted = val.replace(/[^\d.]/g, "");
formatted = limitPrice(formatted, this.form.stockNum, 10, 2, 0);
this.form.stockNum = formatted;
if (this.form.stockNum && Number(this.form.stockNum) > Number(this.row.stock)) {
this.errorMsg = "输入值不能高于当前库存数量";
} else {
this.errorMsg = "";
// 使用 $nextTick 更新表单数据,保持视图同步
this.$nextTick(() => {
this.form.stockNum = formatted;
});
const numVal = Number(formatted);
// 3. 校验数值有效性
if (isNaN(numVal)) {
return callback(new Error("请输入有效的数字"));
}
if (numVal <= 0) {
return callback(new Error("库存数量必须大于0"));
}
// 4. 校验是否超过当前库存上限
const maxStock = Number(this.row.stock);
if (!isNaN(maxStock) && numVal > maxStock) {
return callback(new Error("输入值不能高于当前库存数量"));
}
// 校验通过
callback();
},
handleConfirm() {
if (this.showQrCode) {
......@@ -117,7 +141,6 @@ export default {
return;
}
if (Number(this.form.stockNum) > Number(this.row.stock)) {
this.errorMsg = "输入值不能高于当前库存数量";
this.$message.error("输入值不能高于当前库存数量");
return;
}
......
......@@ -43,7 +43,7 @@
<template #auth-button="scope">
<auth-button :data="scope.scope" :show-btn-ids="['9080202', '9080203']" />
<!-- 补码 日志 -->
<span v-if="!scope.scope.canScanEnable" style="margin-left:10px">
<span v-if="scope.scope.canScanEnable" style="margin-left:10px">
<auth-button :data="scope.scope" :show-btn-ids="['9080205', '9080206']" />
</span>
</template>
......
......@@ -82,14 +82,6 @@ export default {
prop: "groupName",
showOverFlow: true,
}, {
label: "备注",
minWidth: 160,
prop: "remark",
showOverFlow: true,
formatter: (row) => {
return row.remark || "-";
},
}, {
label: "门店数量",
width: 100,
prop: "storeCount",
......@@ -98,14 +90,6 @@ export default {
return val === 0 || val ? val : "-";
},
}, {
label: "预警配置数",
width: 100,
prop: "warningConfigCount",
formatter: (row) => {
const val = row.warningConfigCount;
return val === 0 || val ? val : "-";
},
}, {
label: "创建人",
width: 120,
prop: "createdBy",
......
......@@ -52,10 +52,10 @@
<el-form-item label="门店"
prop="merchantId">
<el-select v-model="addForm.merchantId"
filterable
clearable
placeholder="请选择门店,可输入关键字搜索"
style="width: 100%"
clearable
filterable
:loading="merchantSearchLoading"
@change="handleMerchantSelectChange">
<el-option v-for="item in merchantOptions"
......@@ -67,25 +67,25 @@
</el-form>
</d2-dialog>
<d2-file-import-dialog :is-visible="fileVisible"
title="门店导入"
template-name="下载模板"
:max-size="5"
@closeDialog="handleBatchImport"
@confirmDialog="handleConfirmImport"
@downloadTemplate="exportTemplate" />
<d2-file-import-dialog template-name="下载模板"
title="门店导入"
:is-visible="fileVisible"
:max-size="5"
@closeDialog="handleBatchImport"
@confirmDialog="handleConfirmImport"
@downloadTemplate="exportTemplate" />
</d2-container>
</template>
<script>
import { mapActions, mapMutations, mapState } from "vuex";
import { listShop4sByRef } from "@api/merchant";
import {
addProjectGroupStores,
deleteProjectGroupStore,
getProjectGroupStoreList,
importProjectGroupStore,
} from "@api/projectGroup";
import { listShop4sByRef } from "@api/merchant";
import { mapActions, mapMutations, mapState } from "vuex";
import { Util } from "@/common/util";
export default {
......@@ -125,7 +125,7 @@ export default {
prop: "merchantName",
minWidth: 220,
showOverFlow: true,
formatter: (row) => row.merchantName || "-",
formatter: row => row.merchantName || "-",
},
{
label: "门店商户号",
......@@ -142,10 +142,10 @@ export default {
prop: "createdBy",
minWidth: 120,
showOverFlow: true,
formatter: (row) => row.createdBy || "-",
formatter: row => row.createdBy || "-",
},
{
label: "添加时间",
label: "创建时间",
prop: "createdDate",
minWidth: 170,
showOverFlow: true,
......@@ -413,6 +413,5 @@ export default {
color: #303133;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!