Commit ddf4caef by Jaxon

Merge branch 'feature/strategy-center' into 'SAAS+V5.8.2'

Feature/strategy center

See merge request !669
2 parents c3c90d38 3b6ad690
Showing 50 changed files with 3155 additions and 1149 deletions
......@@ -2,14 +2,8 @@
"eslint.enable": true,
"eslint.format.enable": true,
"prettier.enable": false,
"i18n-ally.localesPaths": [
"src/locales"
],
"cSpell.words": [
"vuex",
"Cascader",
"glsx"
],
"i18n-ally.localesPaths": ["src/locales"],
"cSpell.words": ["vuex", "Cascader", "glsx"],
"workbench.tree.indent": 24,
"explorer.compactFolders": false,
"scm.compactFolders": false,
......@@ -71,10 +65,7 @@
// "source.organizeImports": "explicit",
"source.fixAll.eslint": "explicit"
},
"editor.pasteAs.preferences": [
"text.updateImports.jsts",
"text"
],
"editor.pasteAs.preferences": ["text.updateImports.jsts", "text"],
"eslint.validate": [
"javascript",
"javascriptreact",
......@@ -100,5 +91,8 @@
"javascript.preferences.importModuleSpecifier": "non-relative", // 优先使用 @/ 别名路径
"javascript.suggest.autoImports": true, // 确保这个是 true
"vue.updateImportsOnFileMove.enabled": true,
"i18n-ally.sourceLanguage": "zh-chs"
"i18n-ally.sourceLanguage": "zh-chs",
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
......@@ -4,8 +4,7 @@ export function getCurrentSixMonth(n = 5) {
}
export function formatThousand(val) {
if (val === null || val === undefined || val === "")
return "-";
if (val === null || val === undefined || val === "") return "-";
const str = String(val);
const parts = str.split(".");
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
......@@ -20,7 +19,7 @@ export function limitPrice(
pointDigit,
minValue,
maxValue,
regRule,
regRule
) {
// console.log(
// newValue,
......@@ -31,15 +30,15 @@ export function limitPrice(
// )
let reg = {
priceReg: /^\d[\d\.]*$/, // eslint-disable-line
priceReg: /^\d[\d\.]*$/, // eslint-disable-line
numReg: /^[1-9]\d*$/,
priceReg_negative: /^-?\d[\d.]*$/, // 允许负数的正则表达式,
priceReg_negative_input: /^-?(\d+(?:\.\d*)?|\.\d+)?$/, // input时,允许负数的正则表达式
};
regRule = regRule || "priceReg";
if (
newValue
&& ((minValue && newValue < minValue) || (maxValue && newValue > maxValue))
newValue &&
((minValue && newValue < minValue) || (maxValue && newValue > maxValue))
) {
return oldValue || "";
}
......@@ -48,16 +47,16 @@ export function limitPrice(
newValue = newValue + "";
let interger = newValue.split(".")[0];
let point = newValue.split(".")[1];
let intergerNum
= interger.length > intergerDigit ? oldValue.split(".")[0] : interger;
let pointNum
= point.length > pointDigit ? point.slice(0, pointDigit) : point;
let intergerNum =
interger.length > intergerDigit ? oldValue.split(".")[0] : interger;
let pointNum =
point.length > pointDigit ? point.slice(0, pointDigit) : point;
newValue = pointDigit
? intergerNum + "." + pointNum
: newValue.split(".")[0];
} else {
newValue
= newValue.length > intergerDigit
newValue =
newValue.length > intergerDigit
? oldValue.slice(0, intergerDigit)
: newValue;
}
......@@ -149,9 +148,9 @@ export const appointDays = 35;
export const afterTodayOptions = {
disabledDate(date) {
if (
date < new Date(new Date().toLocaleDateString())
|| date
> new Date(new Date().setDate(new Date().getDate() + (appointDays - 1)))
date < new Date(new Date().toLocaleDateString()) ||
date >
new Date(new Date().setDate(new Date().getDate() + (appointDays - 1)))
) {
return true;
}
......@@ -288,8 +287,8 @@ export const rangePickerOptions_year_2023 = {
// console.log(new Date())
if (
date.getFullYear() > new Date().getFullYear()
|| date.getFullYear() < 2023
date.getFullYear() > new Date().getFullYear() ||
date.getFullYear() < 2023
) {
return true;
}
......@@ -322,7 +321,7 @@ export const todayEndPickerOptions = {
today.getDate(),
23,
59,
59,
59
);
return time.getTime() > todayEnd.getTime();
......@@ -331,7 +330,7 @@ export const todayEndPickerOptions = {
export const stockQueryDatePickerOptions = {
disabledDate(time) {
const minDate = new Date(2026, 1, 1);
const minDate = new Date(2026, 1, 1); // 2026年2月1日 (月份从0开始,1代表2月)
minDate.setHours(0, 0, 0, 0);
const today = new Date();
......@@ -341,12 +340,11 @@ export const stockQueryDatePickerOptions = {
today.getDate(),
23,
59,
59,
59
);
return (
time.getTime() < minDate.getTime()
|| time.getTime() > todayEnd.getTime()
time.getTime() < minDate.getTime() || time.getTime() > todayEnd.getTime()
);
},
};
......@@ -383,7 +381,7 @@ export const rangePickerOptions_outputValue = {
const year = time.getFullYear();
const month = time.getMonth();
const isAllowed = allowedMonths.some(
m => m.year === year && m.month === month,
(m) => m.year === year && m.month === month
);
return !isAllowed; // 不在允许范围则禁用
},
......@@ -418,7 +416,7 @@ export const rangePickerOptions_oneYearNoFuture = {
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
today.getDate()
).getTime();
// 不可选未来时间
if (time.getTime() > todayStart) {
......@@ -430,12 +428,9 @@ export const rangePickerOptions_oneYearNoFuture = {
const minTime = selectDate_oneYearNoFuture - oneYearMs;
const maxTime = Math.min(
selectDate_oneYearNoFuture + oneYearMs,
todayStart,
);
return (
time.getTime() < minTime
|| time.getTime() > maxTime
todayStart
);
return time.getTime() < minTime || time.getTime() > maxTime;
}
return false;
},
......@@ -464,7 +459,7 @@ export const rangePickerOptions_deliveryQuantity = {
// 处理跨年情况(如当前为1月时,上个月是去年12月)
currentMonth === 0
? { year: currentYear - 1, month: 11 }
: { year: currentYear, month: currentMonth - 1 },
: { year: currentYear, month: currentMonth - 1 }
);
}
......@@ -472,7 +467,7 @@ export const rangePickerOptions_deliveryQuantity = {
const year = time.getFullYear();
const month = time.getMonth();
const isAllowed = allowedMonths.some(
m => m.year === year && m.month === month,
(m) => m.year === year && m.month === month
);
return !isAllowed; // 不在允许范围则禁用
},
......
<template>
<baseDialog class="effect-detail-dialog"
:config="config"
:dialog-config="dialogConfig.config"
:is-show.sync="dialogShow">
<div class="content">
<div class="block">
<div class="business-box">
<img class="bg"
src="@/assets/strategy/strategy-analyse-bg.png">
<div class="left">
<div class="business-title">
当前周期
</div>
<template v-for="(item, index) in row">
<div :key="index"
class="business-item">
<div class="label">
{{ item.categoryExtension }}
</div>
<div class="value flex">
<template v-if="item.currentValue >= 0">
{{ item.currentValue }}<template v-if="item.unit">
{{ item.unit }}
</template>
</template>
<template v-else>
-
</template>
</div>
</div>
</template>
</div>
<div class="right">
<div class="business-title">
下一周期
</div>
<template v-for="(item, index) in row">
<div :key="index"
class="business-item">
<div class="label">
{{ item.categoryExtension }}
</div>
<div class="value flex">
<template v-if="item.nextValue >= 0">
{{ item.nextValue }}<template v-if="item.unit">
{{ item.unit }}
</template>
<img class="arrow"
:src="getIconSrc(formatIsRatio(item.nextValue - item.currentValue))" />
</template>
<template v-else>
-
</template>
</div>
</div>
</template>
</div>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
const decline = require("@/assets/strategy/decline.png");
const just01 = require("@/assets/strategy/just01.png");
const rise = require("@/assets/strategy/rise.png");
export default {
name: "EffectDetailDialog",
props: {
visible: {
type: Boolean,
default: false,
},
row: {
type: Array,
default: () => [],
},
searchParams: {
type: Object,
default: () => ({}),
},
},
data() {
return {
config: {
isShowFooter: false,
cancel_name: "关闭",
hideConfirmBtn: true,
},
dialogConfig: {
config: {
title: "效果分析",
width: "720px",
},
},
};
},
computed: {
dialogShow: {
get() {
return this.visible;
},
set() {
this.close();
},
},
},
methods: {
close() {
this.$emit("update:visible", false);
},
getIconSrc(name) {
return {
rise,
decline,
just01,
}[name] ?? "";
},
formatIsRatio(delta) {
return delta < 0 ? "decline" : delta === 0 ? "just01" : "rise";
},
},
};
</script>
<style scoped lang="scss">
.flex {
display: flex;
align-items: center;
}
.arrow {
width: 16px;
height: 16px;
transform: translateY(1px);
}
.content {
min-height: 289px;
}
.block {
&-title {
padding: 0 0 8px;
}
&-icon {
width: 16px;
height: 16px;
margin-right: 4px;
}
.business-box {
height: 289px;
border-radius: 4px;
position: relative;
display: flex;
box-sizing: border-box;
padding: 10px;
.bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.left,
.right {
width: 59%;
display: flex;
flex-direction: column;
gap: 14px;
position: relative;
z-index: 2;
.business-title {
padding-top: 16px;
color: #1d1d1d;
font-size: 14px;
font-weight: 500;
}
.business-item {
display: flex;
align-items: center;
font-size: 13px;
.label {
width: 104px;
color: #888888;
}
.value {
color: #1d1d1d;
}
}
}
.left {
box-sizing: border-box;
padding-left: 15%;
}
.right {
border-radius: 4px;
background: #ffffffcc;
padding-left: 24px;
.business-item {
.value {
color: #2a58ad;
font-size: 16px;
font-weight: 500;
}
}
}
}
}
</style>
<template>
<baseDialog :is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
:config="config"
class="filtrate-dialog"
@handleClick="submit">
<div class="filtrate-body">
<div class="filtrate-form">
<div class="filter-group">
<span class="label">区域:</span>
<el-select v-model="formData.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="formData.brand"
:options="brandOptions"
:props="cascaderProps"
collapse-tags
size="small"
filterable
class="filter-select filter-select-brand"
placeholder="全部"
:show-all-levels="false"
clearable>
</el-cascader>
</div>
<div class="filter-group">
<span class="label">区域运营:</span>
<el-select v-model="formData.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="formData.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>
<baseDialog class="filtrate-dialog"
:config="config"
:dialog-config="dialogConfig.config"
:is-show.sync="dialogShow"
@handleClick="submit">
<div class="filtrate-body">
<div class="filtrate-form">
<div class="filter-group">
<span class="label">区域:</span>
<el-select v-model="formData.provinceId"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
<el-option v-for="item in provinceOptions"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</div>
</baseDialog>
<div class="filter-group">
<span class="label">品牌:</span>
<el-cascader v-model="formData.brand"
class="filter-select filter-select-brand"
clearable
collapse-tags
filterable
:options="brandOptions"
placeholder="全部"
:props="cascaderProps"
:show-all-levels="false"
size="small">
</el-cascader>
</div>
<div class="filter-group">
<span class="label">区域运营:</span>
<el-select v-model="formData.regionOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
<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="formData.onlineOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
<el-option v-for="item in onlineOpsOptions"
: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="formData.supervisorOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
<el-option v-for="item in supervisorOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
......@@ -82,10 +97,11 @@ export default {
type: Object,
default: () => ({
region: "",
provinceId: "",
provinceId: null,
brand: [],
regionOps: "",
onlineOps: "",
regionOps: "all",
onlineOps: null,
supervisorOps: null,
}),
},
brandOptions: {
......@@ -104,6 +120,10 @@ export default {
type: Array,
default: () => [],
},
supervisorOpsOptions: {
type: Array,
default: () => [],
},
cascaderProps: {
type: Object,
default: () => ({}),
......@@ -144,13 +164,17 @@ export default {
},
},
methods: {
getDefaultOnlineOps() {
const { roleName, uuid } = this.$store.state.d2admin.user.info?.detail || {};
return roleName === "线上运营" ? uuid : "";
},
getInitialFormData() {
return {
region: "",
provinceId: "",
brand: [],
regionOps: "",
onlineOps: "",
onlineOps: this.getDefaultOnlineOps(),
};
},
syncFormFromFilters() {
......@@ -160,7 +184,7 @@ export default {
provinceId: provinceId || "",
brand: Array.isArray(brand) ? brand.map(item => (Array.isArray(item) ? [...item] : item)) : [],
regionOps: regionOps || "",
onlineOps: onlineOps || "",
onlineOps: onlineOps || this.getDefaultOnlineOps(),
};
},
submit() {
......@@ -201,11 +225,17 @@ $text-sub: #333333;
.label {
flex-shrink: 0;
width: 72px;
width: 92px;
font-size: 14px;
color: $text-sub;
text-align: right;
margin-right: 12px;
&::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
}
}
.filter-select {
......
<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>
<el-dropdown :disabled="disabled"
placement="bottom-start"
trigger="click"
@command="handleSelect">
<div class="icon-text-btn"
:class="{ 'has-selected': value && value.label && value.label !== defaultText, 'is-disabled': disabled }">
<img v-if="triggerIconType === 'image'"
alt=""
class="icon-img"
:src="triggerIcon">
<i v-else-if="triggerIconType === 'icon'"
:class="triggerIcon">
</i>
<span>{{ label }}:{{ currentValue }}</span>
</div>
</el-popover>
<template #dropdown>
<el-dropdown-menu class="select-custom-dropdown"
:style="{ minWidth: `${popoverWidth}px` }">
<el-dropdown-item v-for="(item, index) in options"
:key="index"
:class="{ 'is-selected': isSelected(item) }"
:command="item">
<div class="icon-img">
<img v-if="item.iconUrl"
alt=""
class="icon-img"
:src="item.iconUrl">
<i v-else-if="item.icon"
:class="item.icon">
</i>
</div>
{{ item.label }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</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;
}
}
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,
},
triggerIconType: {
type: String,
default: "icon",
validator: value => ["image", "icon"].includes(value),
},
defaultText: {
type: String,
default: "全部",
},
popoverWidth: {
type: Number,
default: 120,
},
disabled: {
type: Boolean,
default: false,
},
},
computed: {
currentValue() {
if (this.value && typeof this.value === "object" && this.value.label) {
return this.value.label;
}
return this.defaultText;
},
},
methods: {
// 根据选项 value(即 warningType)动态获取图标,逻辑与 monitorCard.getAlertIcon 一致
getOptionIcon(item) {
if (!item || item.value == null) {
return null;
}
const iconMap = {
2: require("@/assets/strategy/icon-strategy-type01.png"),
3: require("@/assets/strategy/icon-strategy-type02.png"),
4: require("@/assets/strategy/icon-strategy-type07.png"),
5: require("@/assets/strategy/icon-strategy-type08.png"),
};
const key = item.value ?? item.warningType;
return iconMap[key] || iconMap[2];
},
handleSelect(item) {
this.$emit("change", item);
const selectedValue = {
label: item.label,
value: item.value !== undefined ? item.value : item.label,
};
this.$emit("input", selectedValue);
},
isSelected(item) {
if (!this.value)
return false;
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;
}
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;
}
&.is-disabled {
cursor: not-allowed;
color: #c0c4cc;
&:hover {
color: #c0c4cc;
}
}
}
</style>
<style>
/* 全局样式,与父组件保持一致 */
.pure-popover {
padding: 4px 0 !important;
border-color: #E5E6EB !important;
box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
.select-custom-dropdown {
padding: 4px 0 !important;
border-color: #e5e6eb !important;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}
.select-custom-dropdown .el-dropdown-menu__item {
display: flex;
align-items: center;
padding: 9px 16px;
font-size: 14px;
color: #333333;
line-height: 1.5;
}
.select-custom-dropdown .el-dropdown-menu__item.is-selected {
background-color: #f7f7f7;
}
.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;
}
}
.select-custom-dropdown .el-dropdown-menu__item .icon-img {
width: 18px;
height: 18px;
border-radius: 3px;
margin-right: 8px;
}
</style>
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
},
},
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()
}
}
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;
let 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;
let { 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
};
\ No newline at end of file
<template>
<el-drawer ref="drawer"
class="strategy-drawer"
size="50vw"
:visible.sync="dialogShow"
:wrapper-closable="false"
@close="close">
<template #title>
<div class="strategy-drawer-title">
添加协同任务
</div>
</template>
<div class="strategy-drawer-content">
<el-scrollbar class="content">
<el-form ref="form"
class="form"
label-width="110px"
:model="formData"
:rules="rules"
size="small">
<el-form-item label="任务类型:" prop="taskType">
<el-select v-model="formData.taskType"
placeholder="请选择任务类型"
style="width: 100%;">
<el-option v-for="(label, value) in taskTypeOptions"
:key="value"
:label="label"
:value="Number(value)">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="任务标题:" prop="taskTitle">
<el-input v-model="formData.taskTitle"
maxlength="20"
placeholder="请输入标题">
</el-input>
</el-form-item>
<el-form-item v-if="formData.taskType === 9"
label="问题人员:"
prop="staffList">
<el-button size="small" @click="openStaffDialog">
选择人员
</el-button>
<div v-if="formData.staffList && formData.staffList.length > 0" class="tags-container">
<el-tag v-for="(item, index) in formData.staffList"
:key="item.staffUuid"
class="staff-tag"
closable
@close="removeStaff(index)">
{{ item.staffName }}
</el-tag>
</div>
</el-form-item>
<el-form-item label="执行人员:" prop="executorUuid">
<el-select v-model="formData.executorUuid"
placeholder="请选择执行人员"
style="width: 100%;">
<el-option v-for="item in executorList"
:key="item.directorUserId"
:label="item.directorName"
:value="item.directorUserId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="任务说明:" prop="description">
<el-input v-model="formData.description"
maxlength="200"
placeholder="请输入任务说明"
:rows="6"
type="textarea">
</el-input>
</el-form-item>
</el-form>
</el-scrollbar>
<div class="footer">
<el-button v-preventReClick
size="small"
@click="close">
取消
</el-button>
<el-button :loading="loading"
size="small"
type="primary"
@click="confirm">
确定
</el-button>
</div>
</div>
<MultipleStaff ref="staffTagRef"
:choose-data="formData.staffList"
:visible="staffTagVisible"
@choose="handleStaffChoose"
@dialogClose="staffTagVisible = false">
</MultipleStaff>
</el-drawer>
</template>
<script>
import { batchCreateStrategy, getStrategyShopMerchantOperators, getStrategyStaffList } from "@/api/earlyWarningManager";
import MultipleStaff from "../AddStrategy/MultipleStaff.vue";
export default {
name: "AddTask",
components: {
MultipleStaff,
},
inject: ["GET_PARAMS_INFO", "GET_MERCHANT_NAME"],
provide() {
return {
GET_POSITION_TYPE_LIST: () => this.positionTypeList,
GET_MERCHANT_LIST: () => [],
GET_BIZ: () => this.biz,
DEL_PARAMS_MERCHANT_LIST: () => false,
};
},
props: {
visibleSync: {
type: Boolean,
default: false,
},
biz: {
type: Number,
default: 1,
},
},
data() {
return {
loading: false,
taskTypeOptions: {
9: "人员更换评估",
10: "商务政策更新评估",
11: "多品类拓张",
12: "流量问题改善",
},
formData: {
taskType: "",
taskTitle: "",
staffList: [],
executorUuid: "",
description: "",
},
rules: {
taskType: [
{ required: true, message: "请选择任务类型", trigger: "change" },
],
staffList: [
{
validator: (rule, value, callback) => {
if (this.formData.taskType === 9 && (!value || value.length === 0)) {
callback(new Error("请选择问题人员"));
} else {
callback();
}
},
trigger: "change",
},
],
executorUuid: [
{ required: true, message: "请选择执行人员", trigger: "change" },
],
description: [
{ required: true, message: "请输入任务说明", trigger: "blur" },
],
},
staffTagVisible: false,
positionTypeList: [0], // 0:驻店人员
executorList: [], // 区域运营列表
};
},
computed: {
dialogShow: {
get() {
return this.visibleSync;
},
set(val) {
this.$emit("update:visibleSync", val);
},
},
paramsInfo() {
return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO();
},
merchantName() {
return this.GET_MERCHANT_NAME && this.GET_MERCHANT_NAME();
},
},
watch: {
visibleSync(val) {
if (val) {
this.init();
}
},
"formData.taskType": function (val) {
// 切换任务类型时,如果不是人员更换评估,清空问题人员
if (val !== 9) {
this.formData.staffList = [];
}
// 触发重新校验
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.validateField("staffList");
}
});
},
},
methods: {
init() {
this.formData = {
taskType: "",
taskTitle: "",
staffList: [],
executorUuid: "",
description: "",
};
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate();
}
});
this.loadExecutors();
},
close() {
this.dialogShow = false;
},
loadExecutors() {
const params = {
merchantId: this.paramsInfo ? this.paramsInfo.merchantIds[0] : "",
businessType: this.biz,
};
getStrategyShopMerchantOperators(params).then((res) => {
if (res && res.length) {
this.executorList = res;
} else {
this.executorList = [];
}
}).catch(() => {
this.executorList = [];
});
},
openStaffDialog() {
this.staffTagVisible = true;
},
removeStaff(index) {
this.formData.staffList.splice(index, 1);
},
handleStaffChoose(list) {
this.formData.staffList = list;
this.$refs.form.validateField("staffList");
},
confirm() {
try {
this.loading = true;
let { paramsInfo, merchantName, formData, biz } = this;
let { taskType, taskTitle, staffList, executorUuid, description } = formData;
this.$refs.form.validate(async (valid) => {
if (valid) {
const executor = this.executorList.find(item => item.directorUserId === executorUuid);
let params = {
strategyInfo: {
strategyType: taskType,
biz,
title: taskTitle,
description,
},
merchantList: [
{
merchantId: paramsInfo.merchantIds[0],
merchantName,
},
],
};
let allStaffs = [];
if (staffList && staffList.length) {
if (staffList.length > 100) {
this.loading = false;
this.$message.error("最多只能选择100个问题人员");
return;
}
allStaffs = staffList.map(e => ({
userUuid: e.staffUuid,
userName: e.staffName,
userPhone: e.phoneNumber,
userPosition: 0, // 问题人员
}));
}
if (executor) {
allStaffs.push({
userUuid: executor.directorUserId,
userName: executor.directorName,
userPhone: executor.directorPhone,
userPosition: biz === 2 ? 8 : 9, // 执行人员:轻改=8,权益、延保=9
});
}
if (allStaffs.length) {
params.staffList = allStaffs;
}
console.log(params);
const data = await batchCreateStrategy(params);
this.loading = false;
if (data) {
this.$emit("refresh");
this.$message.success("操作成功");
this.close();
} else {
this.$message.error("操作失败");
}
} else {
this.loading = false;
}
});
} catch (error) {
console.log(error, "===");
this.loading = false;
if (error)
this.$message.error(error);
console.log(error);
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep.strategy-drawer {
.el-drawer__header {
padding: 0;
margin: 0;
border-bottom: 1px solid #e5e5e5;
}
.el-drawer__close-btn {
padding: 0 20px;
.el-dialog__close {
font-weight: 700;
font-size: 24px;
}
}
&-title {
height: 26px;
line-height: 26px;
color: #333333;
font-size: 18px;
padding: 17px 20px;
font-weight: bold;
}
&-content {
height: calc(100vh - 61px);
.content {
height: calc(100% - 61px);
.form {
padding: 20px;
.tags-container {
margin-top: 10px;
padding: 10px;
border: 1px solid #e4e7ed;
border-radius: 4px;
min-height: 40px;
max-height: 120px;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.staff-tag {
margin-right: 0;
}
}
}
.footer {
padding: 14px 0;
border-top: 1px solid #e5e5e5;
display: flex;
justify-content: flex-end;
padding-right: 20px;
}
}
}
</style>
\ No newline at end of file
<template>
<el-drawer ref="drawer"
class="strategy-drawer"
size="50vw"
:visible.sync="dialogShow"
:wrapper-closable="false"
@close="close">
<template #title>
<div class="strategy-drawer-title">
添加带教申请
</div>
</template>
<div class="strategy-drawer-content">
<el-scrollbar class="content">
<el-form ref="form"
class="form"
label-width="110px"
:model="formData"
:rules="rules"
size="small">
<el-form-item label="需带教人员:" prop="staffList">
<el-button size="small" @click="openStaffDialog">
选择人员
</el-button>
<div v-if="formData.staffList && formData.staffList.length > 0" class="tags-container">
<el-tag v-for="(item, index) in formData.staffList"
:key="item.staffUuid"
class="staff-tag"
closable
@close="removeStaff(index)">
{{ item.staffName }}
</el-tag>
</div>
</el-form-item>
<el-form-item label="申请说明:" prop="description">
<el-input v-model="formData.description"
maxlength="200"
placeholder="请输入申请说明"
:rows="6"
type="textarea">
</el-input>
</el-form-item>
</el-form>
</el-scrollbar>
<div class="footer">
<el-button v-preventReClick
size="small"
@click="close">
取消
</el-button>
<el-button :loading="loading"
size="small"
type="primary"
@click="confirm">
确定
</el-button>
</div>
</div>
<MultipleStaff ref="staffTagRef"
:choose-data="formData.staffList"
:visible="staffTagVisible"
@choose="handleStaffChoose"
@dialogClose="staffTagVisible = false">
</MultipleStaff>
</el-drawer>
</template>
<script>
import { batchCreateStrategy } from "@/api/earlyWarningManager";
import MultipleStaff from "../AddStrategy/MultipleStaff.vue";
export default {
name: "AddTeaching",
components: {
MultipleStaff,
},
inject: ["GET_PARAMS_INFO", "GET_MERCHANT_NAME"],
provide() {
return {
GET_POSITION_TYPE_LIST: () => this.positionTypeList,
GET_MERCHANT_LIST: () => [],
GET_BIZ: () => this.biz,
DEL_PARAMS_MERCHANT_LIST: () => false,
};
},
props: {
visibleSync: {
type: Boolean,
default: false,
},
biz: {
type: Number,
default: 1,
},
},
data() {
return {
loading: false,
formData: {
staffList: [],
description: "",
},
rules: {
staffList: [
{ type: "array", required: true, message: "请选择需带教人员", trigger: "change" },
],
description: [
{ required: true, message: "请输入申请说明", trigger: "blur" },
],
},
staffTagVisible: false,
positionTypeList: [0], // 0:驻店人员
};
},
computed: {
dialogShow: {
get() {
return this.visibleSync;
},
set(val) {
this.$emit("update:visibleSync", val);
},
},
paramsInfo() {
return this.GET_PARAMS_INFO && this.GET_PARAMS_INFO();
},
merchantName() {
return this.GET_MERCHANT_NAME && this.GET_MERCHANT_NAME();
},
},
watch: {
visibleSync(val) {
if (val) {
this.init();
}
},
},
methods: {
init() {
this.formData = {
staffList: [],
description: "",
};
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate();
}
});
},
close() {
this.dialogShow = false;
},
openStaffDialog() {
this.staffTagVisible = true;
},
removeStaff(index) {
this.formData.staffList.splice(index, 1);
},
handleStaffChoose(list) {
this.formData.staffList = list;
this.$refs.form.validateField("staffList");
},
confirm() {
try {
this.loading = true;
const { paramsInfo, merchantName, formData, biz } = this;
const { staffList, description } = formData;
this.$refs.form.validate(async (valid) => {
if (valid) {
const params = {
strategyInfo: {
strategyType: 8,
biz,
description,
},
merchantList: [
{
merchantId: paramsInfo.merchantIds[0],
merchantName,
},
],
};
if (staffList && staffList.length) {
if (staffList.length > 100) {
this.loading = false;
this.$message.error("最多只能选择100个人员");
return;
}
params.staffList = staffList.map((e) => {
return {
userUuid: e.staffUuid,
userName: e.staffName,
userPhone: e.phoneNumber,
userPosition: e.positionType,
};
});
}
console.log(params);
const data = await batchCreateStrategy(params);
this.loading = false;
if (data) {
this.$emit("refresh");
this.$message.success("操作成功");
this.close();
} else {
this.$message.error("操作失败");
}
} else {
this.loading = false;
}
});
} catch (error) {
console.log(error, "===");
this.loading = false;
if (error)
this.$message.error(error);
console.log(error);
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep.strategy-drawer {
.el-drawer__header {
padding: 0;
margin: 0;
border-bottom: 1px solid #e5e5e5;
}
.el-drawer__close-btn {
padding: 0 20px;
.el-dialog__close {
font-weight: 700;
font-size: 24px;
}
}
&-title {
height: 26px;
line-height: 26px;
color: #333333;
font-size: 18px;
padding: 17px 20px;
font-weight: bold;
}
&-content {
height: calc(100vh - 61px);
.content {
height: calc(100% - 61px);
.form {
padding: 20px;
.tags-container {
margin-top: 10px;
padding: 10px;
border: 1px solid #e4e7ed;
border-radius: 4px;
min-height: 40px;
max-height: 120px;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.staff-tag {
margin-right: 0;
}
}
}
.footer {
padding: 14px 0;
border-top: 1px solid #e5e5e5;
display: flex;
justify-content: flex-end;
padding-right: 20px;
}
}
}
</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"
@submit.native.prevent="submit"
>
<el-form-item
label="停止展业日期:"
prop="nodeDate"
>
<el-date-picker
v-model="formData.nodeDate"
type="date"
placeholder="请选择停止展业日期"
:picker-options="afterTodayOptions"
>
<baseDialog class="detail-content"
:dialog-config="dialogConfig.config"
:is-show.sync="dialogShow"
@handleClick="submit">
<el-form ref="form"
class="form"
label-width="120px"
:model="formData"
:rules="formRules"
size="small"
@submit.native.prevent="submit">
<el-form-item label="停止展业日期:"
prop="nodeDate">
<el-date-picker v-model="formData.nodeDate"
:picker-options="afterTodayOptions"
placeholder="请选择停止展业日期"
type="date">
</el-date-picker>
</el-form-item>
</el-form>
......@@ -32,125 +24,128 @@
<script>
import {
stopBusiness,
} from "@api/earlyWarningManager"
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'],
name: "AddStaff",
props: {
visible: {
type: Boolean,
default: false,
},
minDate: {
type: String,
default: dayjs().format("YYYY-MM-DD"),
},
},
inject: ["GET_PARAMS_INFO"],
data() {
return {
formData: {
nodeDate: "",
},
formRules: {
nodeDate: [{ required: true, message: "请选择停止展业日期", trigger: "blur" }],
},
dialogConfig: {
config: {
title: "停止展业",
width: "640px",
},
},
};
},
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()
},
},
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('操作失败')
}
})
}
}
}
mounted() {
},
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, bizs } = this.paramsInfo;
const { nodeDate } = this.formData;
const data = await stopBusiness({
merchantId: merchantIds[0],
sceneType: bizs == 2 ? 1 : 0, // 业务场景(0.会员权益(延保权益),1.精品升级(轻改))
bizs,
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;
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;
}
}
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%;
}
}
.form {
padding: 52px 42px 34px;
.el-date-editor {
width: 100%;
}
}
}
</style>
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
:config="config"
>
<baseDialog class="detail-content"
:config="config"
:dialog-config="dialogConfig.config"
:is-show.sync="dialogShow">
<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 ref="table"
class="table"
:has-num="false"
:has-page="false"
:search-form="formSearch"
:table-data="list"
:table-params="tableParams">
</d2-table>
<div class="block"></div>
</div>
......@@ -23,156 +19,156 @@
<script>
import {
getStrategyMerchantAnalysisIndexHistory,
} from "@api/earlyWarningManager"
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()
}
}
},
name: "HistoryTarget",
inject: [
"GET_PARAMS_INFO",
],
props: {
visible: {
type: Boolean,
default: false,
},
index: {
type: Number,
default: 0,
},
},
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: [],
};
},
computed: {
dialogShow: {
get() {
return this.visible;
},
set(val) {
this.close();
},
},
merchantId() {
let [merchantId] = this.GET_PARAMS_INFO().merchantIds;
return merchantId;
},
},
watch: {
visible(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
}
}
}
mounted() {
},
methods: {
close() {
this.$emit("dialogClose");
},
async getList() {
const { merchantId } = this;
const data = await getStrategyMerchantAnalysisIndexHistory({
bizs: 1,
merchantId,
});
this.list = data;
},
},
};
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
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;
}
}
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%;
}
}
.content {
height: 592px;
box-sizing: border-box;
padding: 20px;
overflow-y: auto;
.table {
width: 100%;
}
}
}
</style>
<template>
<div class="storeSignboard-container">
<div class="calendar-box">
<!-- 时间切换和日期选择器 -->
<CalendarCustom ref="calendarCustom"
v-model="timeRangeType"
:time-range-options="timeRangeOptions"
:date-range.sync="dateRange"
:date-format="dateFormat"
@date-range-change="handleDateRangeChange" />
<div class="storeSignboard-container">
<div class="calendar-box">
<!-- 时间切换和日期选择器 -->
<CalendarCustom ref="calendarCustom"
v-model="timeRangeType"
:date-format="dateFormat"
:date-range.sync="dateRange"
:time-range-options="timeRangeOptions"
@date-range-change="handleDateRangeChange" />
</div>
<div class="merchant-info flex">
<div class="merchant-icon flex">
<img class="icon"
:src="`${IMG_URL}merchant-icon.webp`">
</div>
<div class="info ">
<div class="name text-hide">
{{ merchantDetailInfo.merchantName || '-' }}
</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 class="control flex">
<div class="scene flex">
<img class="scene-icon"
:src="`${IMG_URL}scene-icon.webp`">
业务:{{ businessLabel }}
</div>
<el-button class="change-store"
type="text"
@click="merchantVisible = true">
切换门店
<i class="el-icon-sort"></i>
</el-button>
</div>
<div class="merchant-detail flex">
<template v-for="(item, index) in formList">
<div :key="index"
class="item flex"
:class="[item.className]">
<div class="label">
{{ item.label }}:
</div>
<template v-if=" merchantDetailInfo[item.key]">
<template v-if="item.tooltip">
<el-tooltip effect="dark"
placement="top">
<template #content>
<div class="tooltip-content-max">
<div>{{ merchantDetailInfo[item.key] }}</div>
</div>
</template>
<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>
</div>
</div>
<div class="merchant-detail flex">
<template v-for="(item, index) in formList">
<div :key="index"
class="item flex"
:class="[item.className]">
<div class="label">
{{ item.label }}:
</div>
<template v-if=" merchantDetailInfo[item.key]">
<template v-if="item.tooltip">
<el-tooltip effect="dark"
placement="top">
<template #content>
<div class="tooltip-content-max">
<div>{{ merchantDetailInfo[item.key] }}</div>
</div>
</template>
<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>
<ChangeMerchantDialog :visible="merchantVisible"
:merchant-id="merchantDetailInfo.merchantNo"
@dialogClose="merchantVisible = false"
@changeMerchant="changeMerchant">
</ChangeMerchantDialog>
</template>
</div>
<ChangeMerchantDialog :merchant-id="merchantDetailInfo.merchantNo"
:visible="merchantVisible"
@changeMerchant="changeMerchant"
@dialogClose="merchantVisible = false">
</ChangeMerchantDialog>
</div>
</template>
<script type='text/ecmascript-6'>
......@@ -118,8 +118,8 @@ export default {
tooltip: true,
},
{
label: "区域运营",
key: "areaOperatorText",
label: "区域督导",
key: "flightSupervisionext",
tooltip: true,
},
{
......@@ -138,6 +138,17 @@ export default {
paramsInfo() {
return this.GET_PARAMS_INFO();
},
businessLabel() {
const BIZ_LABEL_MAP = {
1: "延保",
2: "轻改",
3: "权益",
};
const routeLabel = this.$route.query.businessLabel;
if (routeLabel)
return routeLabel;
return BIZ_LABEL_MAP[this.paramsInfo.bizs] || "-";
},
},
mounted() {
......@@ -158,9 +169,9 @@ export default {
});
},
async getStrategyMerchantDetail(merchantNo = "") {
let { merchantIds } = this.paramsInfo;
let { merchantIds, bizs } = this.paramsInfo;
let data = await getStrategyMerchantDetail({
businessType: 1,
businessType: bizs || 1,
merchantNo: merchantNo || merchantIds[0],
});
data.directSalesFlagText = {
......@@ -186,6 +197,8 @@ export default {
data.onlineOperatorText = data.onlineOperator.map(e => e.username).join("/");
if (data.areaOperator && data.areaOperator.length)
data.areaOperatorText = data.areaOperator.map(e => e.username).join("/");
if (data.flightSupervision && data.flightSupervision.length)
data.flightSupervisionText = data.flightSupervision.map(e => e.username).join("/");
this.merchantDetailInfo = data;
},
changeMerchant(e) {
......
import dayjs from "dayjs"
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2026-04-01 09:57:49
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-06-02 17:54:09
* @FilePath: \dj-car-life-system\src\views\earlyWarningManager\strategyCentre\storeSignboard\components\StrategyList\contant.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import dayjs from "dayjs";
const STRATEGYTYPEOPTIONS = {
0: '学习',
1: '优秀案例分享',
2: '带教',
3: '任务下发',
4: '销售精英到店提拉',
5: '强力促销',
6: '最终盘点与低客单产品购入',
7: '留言'
}
0: "学习",
1: "优秀案例分享",
2: "带教",
3: "任务下发",
4: "销售精英到店提拉",
5: "强力促销",
6: "最终盘点与低客单产品购入",
7: "留言",
8: "带教申请",
9: "人员更换评估",
10: "商务政策更新评估",
11: "多品类拓张",
12: "流量问题改善",
};
const DATE_RANGE = {
label: '执行周期',
format: (val) => {
let { startDate, endDate } = val
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}`
}
}
const STAFF_FORMAT = (label) => {
return {
label,
format: (val) => {
let { staffList } = val
return staffList.map(item => item.userName).join('/') || '-'
}
}
label: "执行周期",
format: (val) => {
let { startDate, endDate } = val;
return `${dayjs(startDate).format("YYYY-MM-DD")}至 ${dayjs(endDate).format("YYYY-MM-DD")}`;
},
};
function STAFF_FORMAT(label) {
return {
label,
format: (val) => {
let { staffList } = val;
return staffList.filter(item => !item.userPosition).map(item => item.userName).join("/") || "-";
},
};
}
const STRATEGY_01 = [
STAFF_FORMAT('学习人员'),
{
label: '学习内容',
className: 'two-line-ellipsis',
format: (val) => {
let { courseList, recordingList, strategyType } = val
return strategyType == 1 ?
recordingList.map(item => `《${item.receptionStaffName}${item.receptionDate}》`).join('\t') :
courseList.map(item => `《${item.courseName}》`).join('\t')
}
},
DATE_RANGE
]
STAFF_FORMAT("学习人员"),
{
label: "学习内容",
className: "two-line-ellipsis",
format: (val) => {
let { courseList, recordingList, strategyType } = val;
return strategyType == 1
? recordingList.map(item => `《${item.receptionStaffName}${item.receptionDate}》`).join("\t")
: courseList.map(item => `《${item.courseName}》`).join("\t");
},
},
DATE_RANGE,
];
const STRATEGY_2456 = [
{
...STAFF_FORMAT('执行人'),
hide: (val) => {
let { strategyType } = val
return [5, 6].includes(strategyType)
},
},
DATE_RANGE
]
{
...STAFF_FORMAT("执行人"),
hide: (val) => {
let { strategyType } = val;
return [5, 6].includes(strategyType);
},
},
DATE_RANGE,
];
const STRATEGY_3 = [
{
label: '标题',
key: 'title',
},
STAFF_FORMAT('处理人'),
{
label: '执行时间',
format: (val) => {
let { startDate, createdDate } = val
return `${dayjs(startDate ? startDate : createdDate).format('YYYY-MM-DD HH:mm:ss')}`
}
},
]
{
label: "标题",
key: "title",
},
STAFF_FORMAT("处理人"),
{
label: "执行时间",
format: (val) => {
let { startDate, createdDate } = val;
return `${dayjs(startDate || createdDate).format("YYYY-MM-DD HH:mm:ss")}`;
},
},
];
const STRATEGY_7 = [
{
label: '留言人',
key: 'createdBy',
},
STAFF_FORMAT('处理人')
]
{
label: "留言人",
key: "createdBy",
},
STAFF_FORMAT("处理人"),
];
const STRATEGY_8 = [
STAFF_FORMAT("需带教人员"),
];
const STRATEGY_9 = [
STAFF_FORMAT("问题人员"),
{
label: "执行人员",
format: (val) => {
let { staffList } = val;
return staffList.filter(item => item.userPosition != 0).map(item => item.userName).join("/") || "-";
},
},
];
const STRATEGY_10_11_12 = [
{
label: "执行人员",
format: (val) => {
let { staffList } = val;
return staffList.filter(item => item.userPosition != 0).map(item => item.userName).join("/") || "-";
},
},
];
export {
STRATEGYTYPEOPTIONS,
STRATEGY_01,
STRATEGY_2456,
STRATEGY_3,
STRATEGY_7,
STRATEGY_01,
STRATEGY_3,
STRATEGY_7,
STRATEGY_8,
STRATEGY_9,
STRATEGY_10_11_12,
STRATEGY_2456,
STRATEGYTYPEOPTIONS,
}
\ No newline at end of file
};
\ No newline at end of file
<template>
<el-drawer class="strategy-drawer"
size="69.44vw"
:visible.sync="dialogShow"
:wrapper-closable="false"
@close="close">
<template #title>
<div class="strategy-drawer-title">
查看详情
</div>
</template>
<div class="drawer-content">
<el-scrollbar class="scrollbar-wrapper">
<div class="detail-container">
<div v-for="(section, index) in detailData"
:key="index"
class="detail-section">
<div class="section-title">
{{ section.title }}
</div>
<div class="section-content">
<el-row>
<el-col v-for="(item, idx) in section.config"
:key="idx"
class="info-item"
:span="item.fullRow ? 24 : 12">
<div class="info-label">
{{ item.subtitle }}
</div>
<div class="info-value">
<template v-if="!item.isImage">
{{ item.value || '-' }}
</template>
<template v-else>
<div v-if="item.value && item.value.length > 0" class="image-list">
<el-image v-for="(img, imgIdx) in item.value"
:key="imgIdx"
fit="cover"
:preview-src-list="item.value"
:src="img"
style="width: 80px; height: 80px; margin-right: 10px; border-radius: 4px;">
</el-image>
</div>
<div v-else>
-
</div>
</template>
</div>
</el-col>
</el-row>
</div>
</div>
</div>
</el-scrollbar>
<div class="footer">
<el-button v-preventReClick
:size="size"
@click="close">
返回
</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import { queryStrategyStudyDetailById } from "@/api/earlyWarningManager";
export default {
name: "TeachingDetail",
props: {
visibleSync: {
type: Boolean,
default: false,
},
item: {
type: Object,
default: () => ({}),
},
},
data() {
return {
size: "small",
detailData: [],
};
},
computed: {
dialogShow: {
get() {
return this.visibleSync;
},
set(val) {
this.$emit("update:visibleSync", val);
},
},
},
watch: {
visibleSync(val) {
if (val) {
this.initData();
}
},
},
methods: {
close() {
this.dialogShow = false;
},
async initData() {
if (!this.item.id)
return;
try {
this.item.id = 133;
const res = await queryStrategyStudyDetailById({ id: this.item.id });
if (res) {
this.formatDetailData(res);
}
} catch (error) {
console.error(error);
}
},
formatDetailData(data) {
const staffList = data.staffList || [];
const targetStaffs = staffList.filter(e => e.userPosition === 0).map(e => e.userName).join("/");
const detailData = [
{
title: "申请信息",
config: [
{ subtitle: "需带教人员:", value: targetStaffs || "-", fullRow: true },
{ subtitle: "申请说明:", value: data.description || "-", fullRow: true },
{ subtitle: "操作人:", value: data.createdBy || "-", fullRow: false },
{ subtitle: "操作时间:", value: data.createdDate || "-", fullRow: false },
],
},
];
const mentoringAppDetail = data.mentoringApplicationDetail || {};
const approvalInfo = mentoringAppDetail.approvalInfo || {};
detailData.push({
title: "审批信息",
config: [
{ subtitle: "状态:", value: approvalInfo.approvalStatus || "-", fullRow: true },
...(approvalInfo.approvalStatus === "驳回" && approvalInfo.rejectReason ? [{ subtitle: "驳回:", value: approvalInfo.rejectReason || "-", fullRow: true }] : []),
{ subtitle: "审批人:", value: approvalInfo.approverName || "-", fullRow: false },
{ subtitle: "审批时间:", value: approvalInfo.approvalTime || "-", fullRow: false },
],
});
const taskDetail = mentoringAppDetail.taskDetail;
if (taskDetail) {
detailData.push({
title: "带教信息",
config: [
{ subtitle: "状态:", value: taskDetail.taskStatus || "-", fullRow: false },
{ subtitle: "指定区域督导:", value: taskDetail.supervisorName || "-", fullRow: false },
{ subtitle: "带教场景:", value: taskDetail.mentoringScene || "-", fullRow: false },
{ subtitle: "带教时间:", value: taskDetail.mentoringTime || "-", fullRow: false },
{ subtitle: "带教方式:", value: taskDetail.mentoringMethod || "-", fullRow: false },
{ subtitle: "带教主题:", value: taskDetail.mentoringTopic || "-", fullRow: false },
{ subtitle: "推送课程:", value: taskDetail.pushCourses || "-", fullRow: true },
{ subtitle: "带教内容摘要:", value: taskDetail.contentSummary || "-", fullRow: true },
{ subtitle: "带教招聘佐证:", value: taskDetail.evidenceImages || [], isImage: true, fullRow: true },
],
});
}
this.detailData = detailData;
},
},
};
</script>
<style scoped lang="scss">
::v-deep.strategy-drawer {
.el-drawer__header {
padding: 0;
margin: 0;
border-bottom: 1px solid #e5e5e5;
}
.el-drawer__close-btn {
padding: 0 20px;
.el-dialog__close {
font-weight: 700;
font-size: 24px;
}
}
&-title {
height: 26px;
line-height: 26px;
color: #333333;
font-size: 18px;
padding: 17px 20px;
font-weight: bold;
}
.el-drawer__body {
height: calc(100% - 55px);
overflow: hidden;
}
}
.drawer-content {
height: 100%;
display: flex;
flex-direction: column;
.scrollbar-wrapper {
flex: 1;
overflow: hidden;
::v-deep .el-scrollbar__wrap {
overflow-x: hidden;
}
}
.detail-container {
padding: 0 20px;
}
.detail-section {
.section-title {
color: #333333;
font-size: 16px;
padding: 16px 0;
border-bottom: 1px solid #e5e5e5;
margin-bottom: 16px;
display: flex;
justify-content: space-between;
align-items: center;
}
.section-content {
padding: 0 10px;
.info-item {
display: flex;
margin-bottom: 16px;
line-height: 20px;
font-size: 14px;
.info-label {
color: #666;
width: 110px;
flex-shrink: 0;
text-align: right;
}
.info-value {
color: #333;
flex: 1;
word-break: break-all;
.image-list {
display: flex;
flex-wrap: wrap;
}
}
}
}
}
.footer {
padding: 14px 0;
border-top: 1px solid #e5e5e5;
display: flex;
justify-content: flex-end;
padding-right: 20px;
}
}
</style>
\ No newline at end of file
<template>
<el-drawer class="strategy-drawer"
size="69.44vw"
:visible.sync="dialogShow"
:wrapper-closable="false"
@close="close">
<template #title>
<div class="strategy-drawer-title">
查看详情
</div>
</template>
<div class="drawer-content">
<el-scrollbar class="scrollbar-wrapper">
<div class="detail-container">
<el-row class="section-content">
<el-col v-for="(item, idx) in detailData"
:key="idx"
class="info-item"
:span="item.fullRow ? 24 : 12">
<div class="info-label">
{{ item.subtitle }}
</div>
<div class="info-value">
<template v-if="!item.isImage">
{{ item.value || '-' }}
</template>
<template v-else>
<div v-if="item.value && item.value.length > 0" class="image-list">
<el-image v-for="(img, imgIdx) in item.value"
:key="imgIdx"
fit="cover"
:preview-src-list="item.value"
:src="img"
style="width: 80px; height: 80px; margin-right: 10px; border-radius: 4px;">
</el-image>
</div>
<div v-else>
-
</div>
</template>
</div>
</el-col>
</el-row>
</div>
</el-scrollbar>
<div class="footer">
<el-button v-preventReClick
:size="size"
@click="close">
返回
</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import { queryStrategyStudyDetailById } from "@/api/earlyWarningManager";
export default {
name: "TaskDetail",
props: {
visibleSync: {
type: Boolean,
default: false,
},
item: {
type: Object,
default: () => ({}),
},
},
data() {
return {
size: "small",
detailData: [],
};
},
computed: {
dialogShow: {
get() {
return this.visibleSync;
},
set(val) {
this.$emit("update:visibleSync", val);
},
},
},
watch: {
visibleSync(val) {
if (val) {
this.initData();
}
},
},
methods: {
close() {
this.dialogShow = false;
},
async initData() {
if (!this.item.id)
return;
try {
const res = await queryStrategyStudyDetailById({ id: this.item.id });
if (res) {
this.formatDetailData(res);
}
} catch (error) {
console.error(error);
}
},
formatDetailData(data) {
const staffList = data.staffList || [];
// 问题人员:userPosition=0
const problemStaffs = staffList.filter(e => e.userPosition === 0).map(e => e.userName).join("、");
// 执行人员:userPosition=8 或 9
const executorStaffs = staffList.filter(e => e.userPosition === 8 || e.userPosition === 9).map(e => e.userName).join("、");
// 任务类型映射
const taskTypeMap = {
9: "人员更换评估",
10: "商务政策更新评估",
11: "多品类拓张",
12: "流量问题改善",
};
const taskTypeName = taskTypeMap[data.strategyType] || "-";
const taskStatusName = data.pushFlag === 6 ? "已完成" : "未完成";
const detailData = [
{ subtitle: "任务类型:", value: taskTypeName, fullRow: false },
{ subtitle: "操作人:", value: data.createdBy || "-", fullRow: false },
{ subtitle: "操作时间:", value: data.createdDate || "-", fullRow: false },
];
// 仅 strategyType=9 时展示问题人员
if (data.strategyType === 9) {
detailData.push({ subtitle: "问题人员:", value: problemStaffs || "-", fullRow: true });
}
// 剩余基础字段
detailData.push(
{ subtitle: "执行人:", value: executorStaffs || "-", fullRow: true },
{ subtitle: "任务说明:", value: data.description || "-", fullRow: true },
{ subtitle: "任务状态:", value: taskStatusName, fullRow: true },
);
// 协同任务专有详情 (collaborativeTaskDetail)
const collabDetail = data.collaborativeTaskDetail || {};
detailData.push(
{ subtitle: "完成描述:", value: collabDetail.completionDescription || "-", fullRow: true },
{ subtitle: "完成人:", value: collabDetail.completedBy || "-", fullRow: false },
{ subtitle: "完成时间:", value: collabDetail.completedTime || "-", fullRow: false },
);
this.detailData = detailData;
},
},
};
</script>
<style scoped lang="scss">
::v-deep.strategy-drawer {
.el-drawer__header {
padding: 0;
margin: 0;
border-bottom: 1px solid #e5e5e5;
}
.el-drawer__close-btn {
padding: 0 20px;
.el-dialog__close {
font-weight: 700;
font-size: 24px;
}
}
&-title {
height: 26px;
line-height: 26px;
color: #333333;
font-size: 18px;
padding: 17px 20px;
font-weight: bold;
}
.el-drawer__body {
height: calc(100% - 55px);
overflow: hidden;
}
}
.drawer-content {
height: 100%;
display: flex;
flex-direction: column;
.scrollbar-wrapper {
flex: 1;
overflow: hidden;
::v-deep .el-scrollbar__wrap {
overflow-x: hidden;
}
}
.detail-container {
padding: 20px;
}
.info-item {
display: flex;
margin-bottom: 16px;
line-height: 20px;
font-size: 14px;
.info-label {
color: #666;
width: 110px;
flex-shrink: 0;
text-align: right;
}
.info-value {
color: #333;
flex: 1;
word-break: break-all;
.image-list {
display: flex;
flex-wrap: wrap;
}
}
}
.footer {
padding: 14px 0;
border-top: 1px solid #e5e5e5;
display: flex;
justify-content: flex-end;
padding-right: 20px;
}
}
</style>
\ No newline at end of file
<!-- 采购订单 -->
<template>
<d2-container class="container">
<template #header>
<div class="header">
<d2-search ref="showSearch" class="show-search" label-width="130px" :form-data="showFormData"
:search-form="searchForm">
<template slot="onlyAllocateOrderHtml">
<el-switch v-model="searchForm.onlyAllocateOrder"></el-switch>
</template>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" handle size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span v-if="!userInfo.beSuper && userInfo.beYQMerchant">
<!-- <auth-button category="Button" /> -->
<auth-button category="Button" />
</span>
</template>
<span>
<!-- <el-button type="primary"
<d2-container class="container">
<template #header>
<div class="header">
<d2-search ref="showSearch"
class="show-search"
label-width="130px"
:form-data="showFormData"
:search-form="searchForm">
<template #onlyAllocateOrderHtml>
<el-switch v-model="searchForm.onlyAllocateOrder"></el-switch>
</template>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary"
handle>
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span v-if="!userInfo.beSuper && userInfo.beYQMerchant">
<!-- <auth-button category="Button" /> -->
<auth-button category="Button" />
</span>
</template>
<span>
<!-- <el-button type="primary"
size="mini"
@click="handleExport">
导出
</el-button> -->
<auth-button category="Button" :show-btn-ids="['9090106']" />
</span>
</d2-table-header>
<d2-table ref="purchaseOrderTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:search-form="tableSearchForm" :table-data="tableData" :table-params="tableParams">
<template #auth-button="scope">
<div>
<!-- 查看 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9090102']" />
</span>
<!-- 取消 -->
<span v-show="scope.scope.status == 1 && !userInfo.beSuper && userInfo.beYQMerchant"
style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9090103']" />
</span>
<!-- 入库 -->
<span v-show="scope.scope.putStatus == 1 && !userInfo.beSuper && userInfo.beYQMerchant"
style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9090104']" />
</span>
<span
v-show="(scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 2) || (scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 3) || (scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 4)"
style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9090105']" />
</span>
</div>
</template>
</d2-table>
</div>
<OrderDeatilDialog v-if="detailVisible" :params-obj="paramsObj" :show-film-roll-no="paramsObj.purchaseType != 1"
:visible.sync="detailVisible" :is-allocate="true">
</OrderDeatilDialog>
</d2-container>
<auth-button category="Button" :show-btn-ids="['9090106']" />
</span>
</d2-table-header>
<d2-table ref="purchaseOrderTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="tableSearchForm"
:table-data="tableData"
:table-params="tableParams">
<template #auth-button="scope">
<div>
<!-- 查看 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9090102']" />
</span>
<!-- 取消 -->
<span v-show="scope.scope.status == 1 && !userInfo.beSuper && userInfo.beYQMerchant"
style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9090103']" />
</span>
<!-- 入库 -->
<span v-show="scope.scope.putStatus == 1 && !userInfo.beSuper && userInfo.beYQMerchant"
style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9090104']" />
</span>
<span v-show="(scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 2) || (scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 3) || (scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 4)"
style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9090105']" />
</span>
</div>
</template>
</d2-table>
</div>
<OrderDeatilDialog v-if="detailVisible"
:is-allocate="true"
:params-obj="paramsObj"
:show-film-roll-no="paramsObj.purchaseType != 1"
:visible.sync="detailVisible">
</OrderDeatilDialog>
</d2-container>
</template>
<script>
......@@ -160,7 +172,7 @@ export default {
{
label: "仅查看调拨订单",
name: "onlyAllocateOrder",
addHtml: 'onlyAllocateOrderHtml'
addHtml: "onlyAllocateOrderHtml",
},
// {
// label: '入库时间',
......
<!-- 出入库记录 -->
<template>
<d2-container class="container">
<template #header>
<div class="header">
<d2-search ref="showSearch" class="show-search" :form-data="showFormData" label-width="120px"
:search-form="searchForm">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" handle size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<span>
<auth-button category="Button" :show-btn-ids="['9081301']" />
</span>
</d2-table-header>
<d2-table ref="purchasementReviewTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:search-form="tableSearchForm" :selectable-fn="selectableFn" :table-data="tableData"
:table-params="tableParams">
</d2-table>
</div>
</d2-container>
<d2-container class="container">
<template #header>
<div class="header">
<d2-search ref="showSearch"
class="show-search"
label-width="120px"
:form-data="showFormData"
:search-form="searchForm">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<span>
<auth-button category="Button" :show-btn-ids="['9081301']" />
</span>
</d2-table-header>
<d2-table ref="purchasementReviewTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="tableSearchForm"
:selectable-fn="selectableFn"
:table-data="tableData"
:table-params="tableParams">
</d2-table>
</div>
</d2-container>
</template>
<script>
......@@ -231,6 +241,26 @@ export default {
width: 150,
},
{
label: "出入库方式",
prop: "stockMethod",
width: 120,
formatter: (cellValue) => {
const obj = {
1: "扫码入库",
2: "扫码出库",
3: "手工入库",
4: "手工出库",
};
// stockMethod:出入库方式(1, “扫码入库”,2, “扫码出库”,3, “手工入库”,“手工出库”)
return cellValue.stockMethod ? obj[cellValue.stockMethod] : "-";
},
},
{
label: "备注",
prop: "remark",
width: 120,
},
{
label: "操作人",
prop: "operator",
},
......@@ -295,6 +325,13 @@ export default {
mounted() {
let allOpt = { confId: "", confValue: "全部" };
this.baseData.inventoryTypeList.unshift(allOpt);
// 接收上个页面带过来的时间参数
if (this.$route.query.startDate && this.$route.query.endDate) {
this.searchForm.transactionTimeStr = [this.$route.query.startDate, this.$route.query.endDate];
this.handleSearch();
}
this.getBaseData();
},
......@@ -325,6 +362,9 @@ export default {
}
delete this.tableSearchForm.transactionTimeStr;
},
handleSearch() {
this.$refs.purchasementReviewTable.refreshTable(true, true);
},
handleReset() {
this.searchForm = {
transactionTimeStr: "",
......
<!-- 出库管理 -->
<template>
<div>
<d2-container>
<template #header>
<div class="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :form-data="showFormData" :search-form="searchForm">
<template #filmRollNo>
<el-input v-model.trim="searchForm.filmRollNo" :clearable="true" :maxlength="50"
placeholder="请输入膜卷号" :style="{ width: '100%' }" @input="filmRollNoInput" />
</template>
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span class="leftSpan">
合计:出库数量<span class="count-txt">{{ statisticsData.totalReduceStockNum }}</span>,出库金额<span
class="count-txt">¥{{ statisticsData.totalReduceStockMoney }}</span>
</span>
</template>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:search-form="searchFormSearch" :table-params="tableParams">
<template #auth-button="scope">
<!-- 关联技师 -->
<span v-if="scope.scope.subOrderStatus != 2" style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9080302']" />
</span>
</template>
</d2-table>
</div>
<!-- 关联技师 -->
<CorrelationDialog v-if="corrVisible" :params-obj="recordInfo" :visible.sync="corrVisible"
@dialogClose="closeCorrDialog" />
</d2-container>
</div>
<div>
<d2-container>
<template #header>
<div class="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm">
<template #filmRollNo>
<el-input v-model.trim="searchForm.filmRollNo"
:clearable="true"
:maxlength="50"
placeholder="请输入膜卷号"
:style="{ width: '100%' }"
@input="filmRollNoInput" />
</template>
</d2-search>
<div class="up-btns">
<el-button size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span class="leftSpan">
合计:出库数量<span class="count-txt">{{ statisticsData.totalReduceStockNum }}</span>,出库金额<span class="count-txt">¥{{ statisticsData.totalReduceStockMoney }}</span>
</span>
</template>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #auth-button="scope">
<!-- 关联技师 -->
<span v-if="scope.scope.subOrderStatus != 2"
style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9080302']" />
</span>
</template>
</d2-table>
</div>
<!-- 关联技师 -->
<CorrelationDialog v-if="corrVisible"
:params-obj="recordInfo"
:visible.sync="corrVisible"
@dialogClose="closeCorrDialog" />
</d2-container>
</div>
</template>
<script>
......@@ -287,6 +305,28 @@ export default {
return cellValue.storeUsage || "-";
},
}, {
label: "出库方式",
prop: "reduceMethod",
width: "200px",
formatter: (cellValue) => {
// 出库方式: 2-扫码出库, 4-手工出库
return cellValue.reduceMethod == 2 ? "扫码出库" : cellValue.reduceMethod == 4 ? "手工出库" : "-";
},
}, {
label: "备注",
prop: " remark",
}, {
label: "出库方式",
prop: "reduceMethod",
width: "200px",
formatter: (cellValue) => {
// 出库方式: 2-扫码出库, 4-手工出库
return cellValue.reduceMethod == 2 ? "扫码出库" : cellValue.reduceMethod == 4 ? "手工出库" : "-";
},
}, {
label: "备注",
prop: " remark",
}, {
label: "支付时间",
prop: "successDate",
width: 150,
......
<!-- 补库存标签码弹窗 -->
<template>
<baseDialog :config="config"
:dialog-config="dialogConfig"
:is-loading="isLoading"
:is-show.sync="visible"
@handleClick="handleConfirm">
<div class="complement-dialog-content">
<!-- 步骤1:填写补码信息 -->
<div v-if="!showQrCode">
<el-form ref="form"
label-width="120px"
:model="form"
:rules="rules">
<el-form-item label="产品名称:">
<span>{{ row.upgradeGoodsName || '-' }}</span>
</el-form-item>
<el-form-item label="产品编码:">
<span>{{ row.productCode || '-' }}</span>
</el-form-item>
<el-form-item label="产品ID:">
<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">
<template #append>
米
</template>
</el-input>
</el-form-item>
</el-form>
</div>
</div>
</baseDialog>
</template>
<script>
import { replenishCodeApi } from "@/api/stockManage";
import { limitPrice } from "@/common/format";
export default {
name: "ComplementCodeDialog",
props: {
visibleSync: {
type: Boolean,
default: false,
},
row: {
type: Object,
default: () => ({}),
},
},
data() {
return {
showQrCode: false,
form: {
stockNum: "",
},
rules: {
stockNum: [
{ required: true, message: "请输入库存数量", trigger: "blur" },
],
},
errorMsg: "",
isLoading: false,
config: {
showClose: true,
appendToBody: false,
isShowFooter: true,
cancel_name: "取消",
confirm_name: "下载",
},
dialogConfig: {
title: "补库存标签码",
width: "500px",
},
qrcode: null,
};
},
computed: {
visible: {
get() {
return this.visibleSync;
},
set(newVal) {
this.$emit("update:visibleSync", newVal);
},
},
},
methods: {
handleInput(val) {
// 只能输入数字,保留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 = "";
}
},
handleConfirm() {
if (this.showQrCode) {
// 执行下载
this.downloadQrCode();
} else {
if (this.row.isFilm) {
if (!this.form.stockNum) {
this.$message.warning("请输入库存数量");
return;
}
if (Number(this.form.stockNum) > Number(this.row.stock)) {
this.errorMsg = "输入值不能高于当前库存数量";
this.$message.error("输入值不能高于当前库存数量");
return;
}
} else {
if (!this.row.stock || Number(this.row.stock) <= 0) {
this.$message.error("当前产品库存必须大于0,才允许补库存标签码");
return;
}
}
const params = {
merchantId: this.row.yqMerchantId,
upgradeGoodsId: this.row.upgradeGoodsId, // 产品ID
goodsType: this.row.goodsType, // 商品类型
};
if (this.row.isFilm) {
params.stockNum = this.form.stockNum;
}
this.isLoading = true;
replenishCodeApi({ dataString: JSON.stringify(params) }).then((res) => {
this.isLoading = false;
if (res && res.labelImageUrl) {
this.downloadFile(res.labelImageUrl);
this.visible = false;
this.$message.success("补库存标签码成功并开始下载");
} else {
this.$message.error("未获取到标签码下载链接");
}
}).catch(() => {
this.isLoading = false;
});
}
},
downloadFile(url, fileName) {
const link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
},
};
</script>
<style scoped lang="scss">
.complement-dialog-content {
padding: 20px;
}
.qrcode-wrapper {
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
}
.qrcode-capture-box {
width: 280px;
padding: 20px;
background: #fff;
border: 1px solid #eee;
border-radius: 8px;
display: flex;
flex-direction: column;
align-items: center;
.info-section {
width: 100%;
margin-bottom: 15px;
font-size: 14px;
color: #333;
line-height: 1.8;
.info-item {
word-break: break-all;
}
}
.qrcode-img {
margin-bottom: 10px;
}
.qr-text {
font-size: 16px;
font-weight: bold;
color: #333;
margin-top: 5px;
}
}
::v-deep .el-form-item__error {
position: relative;
margin-top: 4px;
}
</style>
<!-- 补库存标签码日志弹窗 -->
<template>
<baseDialog :config="config"
:dialog-config="dialogConfig"
:is-show.sync="visible">
<div class="complement-log-content">
<!-- 产品基础信息 -->
<div class="section-title">
产品基础信息
</div>
<div class="info-box">
<el-row>
<el-col class="info-item" :span="24">
<span class="label">产品名称:</span>
<span class="value">{{ row.upgradeGoodsName || '-' }}</span>
</el-col>
<el-col class="info-item" :span="24">
<span class="label">产品编码:</span>
<span class="value">{{ row.productCode || '-' }}</span>
</el-col>
<el-col class="info-item" :span="24">
<span class="label">产品ID:</span>
<span class="value">{{ row.upgradeCommodityCode || '-' }}</span>
</el-col>
</el-row>
</div>
<!-- 操作日志 -->
<template v-if="tableData.length">
<div class="section-title" style="margin-top: 20px;">
操作日志
</div>
<el-table v-loading="loading"
border
:data="tableData"
style="width: 100%">
<el-table-column align="center"
label="序号"
type="index"
width="80">
</el-table-column>
<el-table-column v-if="row.isFilm"
align="center"
label="库存数量"
prop="stockNum">
</el-table-column>
<el-table-column align="center"
label="操作人"
prop="createdBy">
</el-table-column>
<el-table-column align="center"
label="操作时间">
<template #default="scope">
{{ scope.row.createdDate | formatDate }}
</template>
</el-table-column>
</el-table>
</template>
</div>
</baseDialog>
</template>
<script>
import dayjs from "dayjs";
import { getReplenishLogListApi } from "@/api/stockManage";
export default {
name: "ComplementLogDialog",
filters: {
formatDate(val) {
if (!val)
return "-";
return dayjs(val).format("YYYY-MM-DD HH:mm:ss");
},
},
props: {
visibleSync: {
type: Boolean,
default: false,
},
row: {
type: Object,
default: () => ({}),
},
},
data() {
return {
config: {
showClose: true,
appendToBody: false,
isShowFooter: false, // 日志弹窗只需要展示,不需要底部确认/取消按钮
},
dialogConfig: {
title: "补库存标签码日志",
width: "700px",
},
tableData: [],
loading: false,
};
},
computed: {
visible: {
get() {
return this.visibleSync;
},
set(newVal) {
this.$emit("update:visibleSync", newVal);
},
},
},
mounted() {
this.fetchLogData();
},
methods: {
fetchLogData() {
this.loading = true;
const params = {
pageSize: 1000,
currentPage: 1,
upgradeGoodsId: this.row.upgradeGoodsId,
merchantId: this.row.merchantId,
};
getReplenishLogListApi(params).then((res) => {
this.loading = false;
if (res && res.list) {
this.tableData = res.list;
} else {
this.tableData = [];
}
}).catch(() => {
this.loading = false;
this.tableData = [];
});
},
},
};
</script>
<style scoped lang="scss">
.complement-log-content {
padding: 0 10px 20px 10px;
.section-title {
font-size: 16px;
font-weight: bold;
color: #333;
margin-bottom: 15px;
}
.info-box {
padding: 0 20px;
.info-item {
margin-bottom: 12px;
font-size: 14px;
.label {
color: #666;
display: inline-block;
width: 80px;
text-align: right;
}
.value {
color: #333;
}
}
}
}
</style>
<!-- 库存管理 -->
<template>
<div>
<d2-container>
<template #header>
<div class="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :form-data="showFormData" :search-form="searchForm" />
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span class="leftSpan">
合计:当前库存<span class="count-txt">{{ statisticsData }}</span>
</span>
</template>
<div>
<auth-button category="Button" />
</div>
</d2-table-header>
<d2-table ref="recordTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:search-form="searchFormSearch" :table-params="tableParams">
<template #auth-button="scope">
<auth-button :data="scope.scope" />
</template>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<StockMonthDialog v-if="stockMonthVisible" :record-info="recordInfo" :stock-month-visible="stockMonthVisible"
@dialogClose="dialogClose" />
<StockDetailDialog v-if="stockDetailDialogVisible" :record-info="recordInfo"
:visible.sync="stockDetailDialogVisible">
</StockDetailDialog>
<StatementOfAccountDialog v-if="statementOfAccountDialogVisible" :visible.sync="statementOfAccountDialogVisible"
:yq-merchant-list="baseData.yqMerchantList" @handleRelateProConfirm="handleRelateProConfirm">
</StatementOfAccountDialog>
</div>
<div>
<d2-container>
<template #header>
<div class="header" style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm" />
<div class="up-btns">
<el-button size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span class="leftSpan">
合计:当前库存<span class="count-txt">{{ statisticsData }}</span>
</span>
</template>
<div>
<auth-button category="Button" />
</div>
</d2-table-header>
<d2-table ref="recordTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #stockHtml="scope">
<span class="count-txt" @click="gotoInventoryTransaction">{{ (scope.scope.stock || scope.scope.stock == 0) ? Number.parseFloat(scope.scope.stock).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) == 1 ? "米" : "件") : "-" }}</span>
</template>
<template #auth-button="scope">
<auth-button :data="scope.scope" :show-btn-ids="['9080202', '9080203']" />
<!-- 补码 日志 -->
<span v-if="!scope.scope.canScanEnable" style="margin-left:10px">
<auth-button :data="scope.scope" :show-btn-ids="['9080205', '9080206']" />
</span>
</template>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<StockMonthDialog v-if="stockMonthVisible"
:record-info="recordInfo"
:stock-month-visible="stockMonthVisible"
@dialogClose="dialogClose" />
<StockDetailDialog v-if="stockDetailDialogVisible"
:record-info="recordInfo"
:visible.sync="stockDetailDialogVisible">
</StockDetailDialog>
<StatementOfAccountDialog v-if="statementOfAccountDialogVisible"
:visible.sync="statementOfAccountDialogVisible"
:yq-merchant-list="baseData.yqMerchantList"
@handleRelateProConfirm="handleRelateProConfirm">
</StatementOfAccountDialog>
<ComplementCodeDialog v-if="complementDialogVisible"
:row="recordInfo"
:visibleSync.sync="complementDialogVisible">
</ComplementCodeDialog>
<ComplementLogDialog v-if="complementLogDialogVisible"
:row="recordInfo"
:visibleSync.sync="complementLogDialogVisible">
</ComplementLogDialog>
</div>
</template>
<script>
......@@ -52,6 +81,8 @@ import { getMerchantGoodsStockMonthReport, getyqMerchantList, stockMonthReportCo
import { mapActions, mapState } from "vuex";
import { deepClone, Util } from "@/common/util";
import { baseConfig } from "@/main";
import complementCodeDialog from "./complementCodeDialog";
import complementLogDialog from "./complementLogDialog";
import statementOfAccountDialog from "./statementOfAccountDialog";
import stockDetailDialog from "./stockDetailDialog";
import stockMonthDialog from "./stockMonthDialog";
......@@ -62,6 +93,8 @@ export default {
StockMonthDialog: stockMonthDialog,
StockDetailDialog: stockDetailDialog,
StatementOfAccountDialog: statementOfAccountDialog,
ComplementCodeDialog: complementCodeDialog,
ComplementLogDialog: complementLogDialog,
},
data() {
return {
......@@ -72,6 +105,7 @@ export default {
yqMerchantId: "",
goodsType: "",
goodsSeries: "",
selectData: [],
queryDate: "",
},
searchFormSearch: {},
......@@ -123,9 +157,8 @@ export default {
isClear: true,
}, {
label: "选择日期",
name: "queryDate",
name: "selectData",
type: "datePicker",
dateType: "date",
isClear: true,
placeholder: "请选择",
pickerOptions: "stockQueryDatePickerOptions",
......@@ -137,20 +170,26 @@ export default {
mutiSelectUniqueKey: "uniqueVal",
btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: "list",
tableOption: true,
tableOption: {
width: "200",
},
tableColumns: [{
label: "产品名称",
prop: "upgradeGoodsName",
width: "160px",
}, {
label: "规格",
prop: "specificationData",
width: "160px",
}, {
label: "产品编码",
prop: "productCode",
width: "250px",
}, {
label: "产品ID",
prop: "upgradeCommodityCode",
width: "250px",
}, {
label: "规格",
prop: "specificationData",
width: "160px",
}, {
label: "系列",
prop: "goodsSeries",
width: "250px",
......@@ -173,9 +212,10 @@ export default {
}, {
label: "当前库存",
prop: "stock",
formatter: (cellValue) => {
return (cellValue.stock || cellValue.stock == 0) ? Number.parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) == 1 ? "米" : "件") : "-";
},
addHtml: "stockHtml",
// formatter: (cellValue) => {
// return (cellValue.stock || cellValue.stock == 0) ? Number.parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) == 1 ? "米" : "件") : "-";
// },
}, {
label: "所属仓库",
prop: "yqMerchantName",
......@@ -192,6 +232,8 @@ export default {
},
stockDetailDialogVisible: false,
stockMonthVisible: false,
complementDialogVisible: false,
complementLogDialogVisible: false,
recordInfo: null,
statisticsData: {},
statementOfAccountDialogVisible: false,
......@@ -229,10 +271,30 @@ export default {
// async getBaseData() {
// this.getOptionsList()
// },
gotoInventoryTransaction() {
let query = {};
if (this.searchForm.selectData && this.searchForm.selectData.length === 2) {
query.startDate = Util.dateFormate(this.searchForm.selectData[0], "YYYY-MM-DD");
query.endDate = Util.dateFormate(this.searchForm.selectData[1], "YYYY-MM-DD");
}
this.$router.push({
path: "/inventoryTransactionRecords",
query,
});
},
// 补码
handleComplement(row) {
this.recordInfo = row;
this.complementDialogVisible = true;
},
// 日志
handleLog(row) {
this.recordInfo = row;
this.complementLogDialogVisible = true;
},
// 库存记录统计
stockMonthReportCount() {
this.beforeSearchFn()
this.beforeSearchFn();
stockMonthReportCount(this.searchFormSearch).then((res) => {
this.statisticsData = res;
});
......@@ -246,9 +308,10 @@ export default {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm);
if (this.searchFormSearch.queryDate) {
this.searchFormSearch.queryDate = Util.dateFormate(this.searchFormSearch.queryDate, "YYYY-MM-DD") + " 23:59:59";
if (this.searchFormSearch.selectData && this.searchFormSearch.selectData.length) {
this.searchFormSearch.queryDate = Util.dateFormate(this.searchFormSearch.selectData[1], "YYYY-MM-DD") + " 23:59:59";
}
delete this.searchFormSearch.selectData;
this.searchFormSearch.dataMonth = Util.dateFormate(new Date(), "YYYY-MM");
resolve();
......@@ -279,6 +342,7 @@ export default {
yqMerchantId: "",
goodsType: "",
goodsSeries: "",
selectData: [],
queryDate: "",
};
this.$refs.recordTable.refreshTable();
......@@ -289,7 +353,7 @@ export default {
handleRelateProConfirm(data) {
let params = data;
params.method = "dj.api.smartcarlife.merchantShopGoodsStock.statement.exportAsync";
console.log(params);
// return
const list = [
...this.dowloadList,
......@@ -348,6 +412,7 @@ export default {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
cursor: pointer;
}
.leftSpan {
......
<!-- 入库管理 -->
<template>
<div>
<d2-container>
<template #header>
<div class="header"
<div>
<d2-container>
<template #header>
<div class="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm">
<template #filmRollNo>
<el-input v-model.trim="searchForm.filmRollNo"
:clearable="true"
:maxlength="50"
placeholder="请输入膜卷号"
:style="{ width: '100%' }"
@input="filmRollNoInput" />
</template>
</d2-search>
<div class="up-btns">
<el-button size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm">
<template #filmRollNo>
<el-input v-model.trim="searchForm.filmRollNo"
:clearable="true"
:maxlength="50"
placeholder="请输入膜卷号"
:style="{ width: '100%' }"
@input="filmRollNoInput" />
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span class="leftSpan">
合计:入库数量<span class="count-txt">{{ statisticsData.totalIncreaseStockNum }}</span>,入库金额<span class="count-txt">¥{{ statisticsData.totalIncreaseStockMoney }}</span>
</span>
</template>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #auth-button="scope">
<auth-button :data="scope.scope" />
</template>
</d2-table>
</div>
</d2-container>
</div>
</d2-search>
<div class="up-btns">
<el-button size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span class="leftSpan">
合计:入库数量<span class="count-txt">{{ statisticsData.totalIncreaseStockNum }}</span>,入库金额<span class="count-txt">¥{{ statisticsData.totalIncreaseStockMoney }}</span>
</span>
</template>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #auth-button="scope">
<auth-button :data="scope.scope" />
</template>
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
......@@ -261,6 +261,15 @@ export default {
label: "入库门店",
prop: "merchantName",
width: "200px",
}, {
label: "入库方式",
prop: "warehousingMethod",
width: "200px",
formatter: (cellValue) => {
// 入库方式: 1-扫码入库, 3-手工入库
return cellValue.warehousingMethod == 1 ? "扫码入库" : cellValue.warehousingMethod == 3 ? "手工入库" : "-";
},
}],
},
baseData: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!