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