提交 55378c04 authored 作者: lidongxu's avatar lidongxu

refactor(promotion): 修复:店内执行上报已知问题

上级 73a98b11
......@@ -146,8 +146,8 @@ const emit = defineEmits(['getTableList', 'updateShowSearch'])
/*************** 工具栏 ***************/
const showFill = userStore().hasQcMarketEmpInfo // 是否启用填报模式
// const operation = ref('展示模式'); // 切换平铺/填报模式
const operation = ref('填报模式'); // 切换平铺/填报模式
const operation = ref('展示模式'); // 切换平铺/填报模式
// const operation = ref('填报模式'); // 切换平铺/填报模式
const tableRef = ref(null)
const chooseColumns = ref([]) // 右上角工具显隐列选择
......@@ -408,6 +408,7 @@ const handleDialogClose = () => {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 10px;
}
}
......
......@@ -434,12 +434,6 @@ export const getDisplayConfig = (submitChangeCallback) => {
visible: true,
type: 'formula',
func: (row) => {
// 如果参考计划,值是空,则当前数据也为空
// 主货架形式计划,主货架数量计划
if (!row.plannedMainShelfType || !row.plannedMainShelfQty) {
return row.actualMainShelfExecuted = ''
}
if (parseInt(row.actualMainShelfType) < parseInt(row.plannedMainShelfType)) {
// 主货架形式实际 < 主货架形式计划
row.actualMainShelfExecuted = '未执行'
......@@ -453,7 +447,7 @@ export const getDisplayConfig = (submitChangeCallback) => {
row.actualMainShelfExecuted = '执行'
}
},
formulaStr: '公式:(实际主货架形式 >= 计划主货架形式)并且(实际主货架数量 >= 计划主货架数量)',
formulaStr: '公式:(主货架形式实际 >= 主货架形式计划)并且(主货架数量实际 >= 主货架数量计划)',
fill: true,
width: 130
},
......@@ -530,13 +524,9 @@ export const getDisplayConfig = (submitChangeCallback) => {
visible: true,
type: 'formula',
func: (row) => {
// 端架数量计划没有,则实际也为空
if (!row.plannedEndCapQty) {
return row.actualEndCapExecuted = ''
}
row.actualEndCapExecuted = ((parseFloat(row.actualEndCapQty) >= parseFloat(row.plannedEndCapQty))) ? '执行' : '未执行'
},
formulaStr: '公式:(实际端架数量 >= 计划端架数量)',
formulaStr: '公式:(端架数量实际 >= 端架数量计划)',
fill: true,
width: 130
},
......@@ -713,13 +703,9 @@ export const getDisplayConfig = (submitChangeCallback) => {
visible: true,
type: 'formula',
func: (row) => {
// 地堆平米数计划,地堆数量计划
if (!row.plannedFloorStackArea || !row.plannedFloorStackQty) {
return row.actualFloorStackExecuted = ''
}
row.actualFloorStackExecuted = ((parseFloat(row.actualFloorStackArea) >= parseFloat(row.plannedFloorStackArea)) && (parseInt(row.actualFloorStackQty) >= parseInt(row.plannedFloorStackQty))) ? '执行' : '未执行';
},
formulaStr: '公式:(实际地堆平米数 >= 计划地堆平米数)并且(实际地堆数量 >= 计划地堆数量)',
formulaStr: '公式:(地堆平米数实际 >= 地堆平米数计划)并且(地堆数量实际 >= 地堆数量计划)',
fill: true,
width: 130
},
......@@ -786,10 +772,6 @@ export const getDisplayConfig = (submitChangeCallback) => {
visible: true,
type: 'formula',
func: (row) => {
// 多点陈列数量形式计划
if (!row.plannedMultiDisplay) {
return row.actualMultiDisplayExecuted = ''
}
row.actualMultiDisplayExecuted = row.actualMultiDisplay === '执行与计划一致' ? '执行' : '未执行';
},
formulaStr: '公式:实际与计划是否一致',
......@@ -850,10 +832,6 @@ export const getDisplayConfig = (submitChangeCallback) => {
visible: true,
type: 'formula',
func: (row) => {
// 挂条数量形式计划
if (!row.plannedHangingStripQuantityForm) {
return row.hangingStripExecuted = ''
}
row.hangingStripExecuted = (row.actualHangingStripQuantityForm === '执行与计划一致') ? '执行' : '未执行';
},
formulaStr: '公式:实际与计划是否一致',
......@@ -1167,40 +1145,6 @@ export const getSchedulePlanConfig = (submitChange) => {
prop: "actualPromotionSpec",
visible: true,
type: 'select',
options: [
// {
// label: '虎皮105g',
// value: '虎皮105g'
// },
// {
// label: '虎皮210g',
// value: '虎皮210g'
// },
// {
// label: '去骨72g',
// value: '去骨72g'
// },
// {
// label: '去骨138g',
// value: '去骨138g'
// },
// {
// label: '小鸡腿80g',
// value: '小鸡腿80g'
// },
// {
// label: '老卤95g',
// value: '老卤95g'
// },
// {
// label: '鸡肉豆堡',
// value: '鸡肉豆堡'
// },
// {
// label: '牛肉豆堡',
// value: '牛肉豆堡'
// }
],
referenceKey: "plannedPromotionSpec",
fill: true,
width: 150,
......@@ -1215,14 +1159,12 @@ export const getSchedulePlanConfig = (submitChange) => {
}])
return (
<div>
{/* <span>{row[col.referenceKey] || '-'}</span> */}
<el-select modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-select modelValue={row[col.prop]}
onUpdate:modelValue={async (value) => {
row[col.prop] = value;
await submitChange(row, col);
col.checkFn(row)
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
placeholder=""
clearable
......@@ -1234,7 +1176,7 @@ export const getSchedulePlanConfig = (submitChange) => {
value={item.value}
/>
))}
</el-select>
</el-select> : '-'}
</div>
)
},
......@@ -1306,15 +1248,9 @@ export const getSchedulePlanConfig = (submitChange) => {
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedPromotionSpec) {
row.specExecutionStatus = '-';
return '-';
}
row.specExecutionStatus = row.plannedPromotionSpec === row.actualPromotionSpec ? '执行' : '未执行';
return row.specExecutionStatus;
row.specExecutionStatus = row.actualPromotionSpec === row.plannedPromotionSpec ? '执行' : '未执行';
},
formulaStr: '公式:(档期计划促销规格 = 档期执行促销规格)',
formulaStr: '公式:(档期促销规格实际 = 档期促销规格计划)',
fill: true,
width: 150
},
......@@ -1364,36 +1300,29 @@ export const getSchedulePlanConfig = (submitChange) => {
}])
isFullFlavor = false
}
// span 标签超出宽度时显示省略号
return (
<div>
{/* <el-tooltip placement="top" content={row[col.referenceKey] || '-'} disabled={!isContentOverflow(col.referenceKey, row[col.referenceKey], col)}>
<span >
{row[col.referenceKey] || '-'}
</span>
</el-tooltip> */}
<el-select modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-select modelValue={row[col.prop]}
onUpdate:modelValue={async (value) => {
row[col.prop] = value;
await submitChange(row, col);
{/* 检查一下未执行/部分执行时,填写实际执行内容 */ }
col.checkFn(row)
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
placeholder=""
clearable
multiple={!isFullFlavor}
collapse-tags={!isFullFlavor}
collapse-tags-tooltip={!isFullFlavor}>
{list.map(item => (
{list.map((item, index) => (
<el-option
key={item.value}
key={index}
label={item.label}
value={item.value}
/>
))}
</el-select>
</el-select> : '-'}
</div >
)
},
......@@ -1447,7 +1376,8 @@ export const getSchedulePlanConfig = (submitChange) => {
submitChange(row, col);
}}
class='no-disabled'
placeholder="">
placeholder=""
clearable>
</el-input>
) : (<div style="width: 100%; text-align: center;">-</div>)
}
......@@ -1464,11 +1394,6 @@ export const getSchedulePlanConfig = (submitChange) => {
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedPromotionFlavor) {
row.flavorExecutionStatus = '-';
return '-';
}
// 处理逗号的口味形成数组
let ppromotionFlavor = splitAndFilter(row.plannedPromotionFlavor)
if (!row.actualPromotionFlavor) {
......@@ -1490,6 +1415,7 @@ export const getSchedulePlanConfig = (submitChange) => {
// 有且只有一个,并且是全口味,则执行
row.flavorExecutionStatus = '执行';
} else if (row.actualPromotionFlavor?.length === ppromotionFlavor.length && row.actualPromotionFlavor.every(item => ppromotionFlavor.includes(item))) {
// 实际选项和计划选项数量一致
row.flavorExecutionStatus = '执行';
}
return row.flavorExecutionStatus;
......@@ -1598,8 +1524,7 @@ export const getSchedulePlanConfig = (submitChange) => {
render: (_, row, col) => {
return (
<div>
{/* <span>{row[col.referenceKey] || '-'}</span> */}
<div class={['date-picker', { 'no-disabled': row[col.referenceKey] }]}>
{row[col.referenceKey] ? <div class={['date-picker', { 'no-disabled': row[col.referenceKey] }]}>
<el-date-picker modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
......@@ -1610,7 +1535,7 @@ export const getSchedulePlanConfig = (submitChange) => {
clearable
type="date"
/>
</div>
</div> : '-'}
</div>
)
},
......@@ -1645,8 +1570,7 @@ export const getSchedulePlanConfig = (submitChange) => {
render: (_, row, col) => {
return (
<div>
{/* <span>{row[col.referenceKey] || '-'}</span> */}
<div class={['date-picker', { 'no-disabled': row[col.referenceKey] }]}>
{row[col.referenceKey] ? <div class={['date-picker', { 'no-disabled': row[col.referenceKey] }]}>
<el-date-picker modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
......@@ -1657,7 +1581,7 @@ export const getSchedulePlanConfig = (submitChange) => {
clearable
type="date"
/>
</div>
</div> : '-'}
</div>
)
},
......@@ -1670,11 +1594,6 @@ export const getSchedulePlanConfig = (submitChange) => {
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedPromotionStartDate || !row.plannedPromotionEndDate) {
row.promotionImplementationStatus = '-';
return '-';
}
row.promotionImplementationStatus = row.actualPromotionStartDate && row.actualPromotionEndDate ? '是' : '否';
return row.promotionImplementationStatus;
},
......@@ -1798,7 +1717,7 @@ export const getSchedulePlanConfig = (submitChange) => {
label: "执行价格",
subLabel: '实际',
prop: "actualPromotionPriceRe",
referenceKey: "plannedPromotionPrice", // 促销售价计划
referenceKey: "plannedPromotionMechanism", // 促销机制计划
visible: true,
type: "input",
options: [
......@@ -1815,13 +1734,12 @@ export const getSchedulePlanConfig = (submitChange) => {
return (
<div>
{
row.plannedPromotionMechanism.includes('满') ? (<el-select modelValue={row[col.prop]}
row.plannedPromotionMechanism ? (row.plannedPromotionMechanism?.includes('赠') ? (<el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
class='no-disabled'
placeholder=""
clearable
>
......@@ -1835,13 +1753,13 @@ export const getSchedulePlanConfig = (submitChange) => {
row[col.prop] = value;
submitChange(row, col);
}}
class='no-disabled'
class={{ 'no-disabled': true, 'no-spinner': true, 'red-text': row[col.prop] > row.plannedPromotionPrice }}
placeholder=""
type="number"
min="0"
clearable>
</el-input>
)
)) : '-'
}
</div>
)
......@@ -1972,17 +1890,15 @@ export const getSchedulePlanConfig = (submitChange) => {
visible: true,
type: 'formula',
func: (row) => {
// 如果执行价格是数组类型
if (Array.isArray(row.actualPromotionPriceRe)) {
row.promotionPriceExecutionStatus = row.actualPromotionPriceRe[0] === '买赠' ? '执行' : '未执行'
if (row.actualPromotionPriceRe === '买赠') {
row.promotionPriceExecutionStatus = '执行'
} else if (row.actualPromotionPriceRe) {
row.promotionPriceExecutionStatus = (row.actualPromotionPriceRe * 1 <= row.plannedPromotionPrice * 1) ? '执行' : '未执行'
} else {
row.promotionPriceExecutionStatus = '未执行'
}
return row.promotionPriceExecutionStatus;
},
formulaStr: '公式:(计划促销机制 = 执行促销机制)',
formulaStr: '公式:(促销机制计划带"赠"则选择买赠) 或 (执行促销实际 <= 促销售价计划)为执行否则未执行',
fill: true,
width: 150
},
......@@ -2135,12 +2051,11 @@ export const getSchedulePlanConfig = (submitChange) => {
return (
<div>
<div style="width: 100%">
<el-select modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
placeholder=""
clearable
......@@ -2148,7 +2063,7 @@ export const getSchedulePlanConfig = (submitChange) => {
{col.options.map(item => (
<el-option key={item.value} label={item.label} value={item.value} />
))}
</el-select>
</el-select> : '-'}
</div>
</div>
)
......@@ -2162,10 +2077,7 @@ export const getSchedulePlanConfig = (submitChange) => {
visible: true,
type: 'formula',
func: (row) => {
if (!row.plannedPosterFormat) return row.posterExecutionStatus = '-'
if (!row.actualPosterFormat) return row.posterExecutionStatus = '未执行'
row.posterExecutionStatus = row.plannedPosterFormat == row.actualPosterFormat ? '执行' : '未执行';
return row.posterExecutionStatus;
},
formulaStr: '公式:(计划海报形式 = 实际海报形式)',
fill: true,
......@@ -2611,16 +2523,11 @@ export const getScheduleDisConfig = (submitChange) => {
render: (_, row, col) => {
return (
<div>
{/* <span>{row[col.referenceKey] || '-'}</span> */}
<el-select modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
if (!value) {
value = 0;
}
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
placeholder=""
clearable>
......@@ -2631,7 +2538,7 @@ export const getScheduleDisConfig = (submitChange) => {
value={item.value}
/>
))}
</el-select>
</el-select> : '-'}
</div>
)
},
......@@ -2648,12 +2555,7 @@ export const getScheduleDisConfig = (submitChange) => {
"fill": true,
"width": 140,
func: (row) => {
// 如果计划端架数量为空则返回 '-'
if (!row.plannedEndCapQty) {
row.actualEndCapExecuted = '-'
return '-';
}
row.actualEndCapExecuted = row.actualEndCapQty >= row.plannedEndCapQty ? '执行' : '未执行'
row.actualEndCapExecuted = row.actualEndCapQty * 1 >= row.plannedEndCapQty * 1 ? '执行' : '未执行'
return row.actualEndCapExecuted
},
formulaStr: "执行端架数量 >= 计划端架数量"
......@@ -2700,16 +2602,11 @@ export const getScheduleDisConfig = (submitChange) => {
render: (_, row, col) => {
return (
<div>
<el-select modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
// 判断空字符串给 0
if (!value) {
value = 0
}
row[col.prop] = value;
submitChangeCallback(row, col);
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
placeholder=""
clearable>
......@@ -2720,7 +2617,7 @@ export const getScheduleDisConfig = (submitChange) => {
value={item.value}
/>
))}
</el-select>
</el-select> : '-'}
</div>
)
},
......@@ -2770,20 +2667,19 @@ export const getScheduleDisConfig = (submitChange) => {
render: (_, row, col) => {
return (
<div>
{/* <span>{row[col.referenceKey] || '-'}</span> */}
<el-input modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
const numValue = value === '' ? 0 : Number(value);
row[col.prop] = numValue;
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
class={{ 'no-disabled': row[col.referenceKey], 'no-spinner': true, 'red-text': row[col.prop] > row[col.referenceKey] }}
min="0"
type="number"
placeholder=""
clearable>
</el-input>
</el-input> : '-'}
</div>
)
},
......@@ -2798,15 +2694,10 @@ export const getScheduleDisConfig = (submitChange) => {
"fill": true,
"width": 140,
func: (row) => {
// 如果计划端架数量为空则返回 '-'
if (!row.plannedFloorStackArea || !row.plannedFloorStackQty) {
row.actualFloorStackExecuted = '-'
return '-';
}
row.actualFloorStackExecuted = row.actualFloorStackArea >= row.plannedFloorStackArea && row.actualFloorStackQty >= row.plannedFloorStackQty ? '执行' : '未执行'
return row.actualFloorStackExecuted
},
formulaStr: "执行平米数 >= 计划平米数,并且 执行地堆数量 >= 计划地堆数量"
formulaStr: "地堆平米数实际 >= 地堆平米数计划,并且 地堆数量实际 >= 地堆数量计划"
},
{
"label": "其他陈列数量+形式",
......@@ -2841,13 +2732,11 @@ export const getScheduleDisConfig = (submitChange) => {
render: (_, row, col) => {
return (
<div>
{/* <span>{row[col.referenceKey] || '-'}</span> */}
<el-select modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
placeholder=""
clearable
......@@ -2859,7 +2748,7 @@ export const getScheduleDisConfig = (submitChange) => {
value={item.value}
/>
))}
</el-select>
</el-select> : '-'}
</div>
)
},
......@@ -2874,10 +2763,6 @@ export const getScheduleDisConfig = (submitChange) => {
"fill": true,
"width": 140,
func: (row) => {
if (!row.plannedOtherDisplay) {
row.actualOtherDisplayExecuted = '-'
return '-';
}
row.actualOtherDisplayExecuted = row.actualOtherDisplay === '执行与计划一致' ? '执行' : '未执行'
return row.actualOtherDisplayExecuted
},
......@@ -3263,8 +3148,8 @@ export const getSnackCofing = (submitChange) => {
// </div>
// )
// },
// requestKey: ["displayExecuted", "snackDisplayExecuted"]
requestKey: ["displayExecuted"]
requestKey: ["displayExecuted", "snackDisplayExecuted"]
// requestKey: ["displayExecuted"]
},
// {
// "label": "陈列形式是否执行",
......@@ -3323,26 +3208,23 @@ export const getSnackCofing = (submitChange) => {
return (
<div>
<div>
<el-input modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
const numValue = value === '' ? 0 : Number(value);
row[col.prop] = numValue;
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
class={{ 'no-disabled': row[col.referenceKey], 'no-spinner': true, 'red-text': row[col.prop] > row[col.referenceKey] }}
min="0"
type="number"
placeholder=""
clearable
/>
/> : '-'}
</div>
</div>
)
},
"width": 190,
// requestKey: ["endCapQtyExecuted", "snackDisplayExecuted"]
requestKey: ["endCapQtyExecuted"]
requestKey: ["endCapQtyExecuted", "snackDisplayExecuted"]
},
{
"label": "端架数量是否执行",
......@@ -3352,13 +3234,8 @@ export const getSnackCofing = (submitChange) => {
"fill": false,
"width": 150,
func: (row) => {
if (!row.plannedEndCapQty) {
row.endCapQtyExecuted = '-'
return '-'
}
// 截取计划端架数量数据
row.endCapQtyExecuted = row.actualEndCapQty >= row.plannedEndCapQty ? '执行' : '未执行'
return row.endCapQtyExecuted
},
formulaStr: "执行端架数量 == 计划端架数量"
},
......@@ -3370,26 +3247,15 @@ export const getSnackCofing = (submitChange) => {
"fill": true,
"width": 150,
func: (row) => {
// 如果关键的 2 个计划属性无值,则直接返回 '-'
if (!row.plannedDisplay && !row.plannedEndCapQty) {
row.snackDisplayExecuted = '-'
return '-'
}
if ((row.plannedDisplay && row.actualDisplay === '执行与计划一致')) {
// 判断实际端架数量为 0 或者空时就是未执行,如果小于计划是部分执行,如果大于等于就是执行
if (!row.actualEndCapQty || row.actualEndCapQty == 0) {
row.snackDisplayExecuted = '未执行'
return '未执行'
} else if (row.actualEndCapQty < row.plannedEndCapQty) {
row.snackDisplayExecuted = '部分执行'
return '部分执行'
} else {
row.snackDisplayExecuted = '执行'
return '执行'
}
} else {
row.snackDisplayExecuted = '未执行'
return '未执行'
}
},
formulaStr: "公式:陈列形式执行,并且端架数量执行(某项无计划时,忽略该项)"
......@@ -3668,22 +3534,19 @@ export const getThreeTwoSecondsConfig = (submitChange) => {
render: (_, row, col) => {
return (
<div style="padding: 10px 0;">
{/* <span>{row[col.referenceKey] || '-'}</span> */}
<div>
<el-input
{row[col.referenceKey] ? <el-input
modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
const numValue = value === '' ? 0 : Number(value);
row[col.prop] = numValue;
row[col.prop] = value;
submitChange(row, col);
}}
min="0"
type="number"
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
class={{ 'no-disabled': row[col.referenceKey], 'no-spinner': true, 'red-text': row[col.prop] > row[col.referenceKey] }}
placeholder=""
clearable
/>
/> : '-'}
</div>
</div>
);
......@@ -3698,24 +3561,16 @@ export const getThreeTwoSecondsConfig = (submitChange) => {
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedDisplayQty60) {
row.displayQtyExecuted60 = '-';
return '-';
}
// 判断区间,未执行,部分执行,执行
if (!row.actualDisplayQty60 || row.actualDisplayQty60 == 0) {
if (row.actualDisplayQty60 < row.plannedDisplayQty60) {
row.displayQtyExecuted60 = '未执行'
return '未执行'
} else if (row.actualDisplayQty60 * 1 < row.plannedDisplayQty60 * 1) {
row.displayQtyExecuted60 = '部分执行'
return '部分执行'
} else {
row.displayQtyExecuted60 = '执行'
return '执行'
}
},
formulaStr: '公式:(实际-60g挂条陈列数量 >= 计划-60g挂条陈列数量)',
formulaStr: '公式:(60g挂条陈列数量实际 >= 60g挂条陈列数量计划)',
fill: true,
width: 200
},
......@@ -3950,20 +3805,17 @@ export const getSixLittleDiamondsConfig = (submitChange) => {
render: (_, row, col) => {
return (
<div style="padding: 10px 0;">
{/* <span>{row[col.referenceKey] || '-'}</span> */}
<el-input modelValue={row[col.prop]}
{row[col.referenceKey] ? <el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
const numValue = value === '' ? 0 : Number(value);
row[col.prop] = numValue;
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
class={{ 'no-disabled': row[col.referenceKey] }}
class={{ 'no-disabled': row[col.referenceKey], 'no-spinner': true, 'red-text': row[col.prop] > row[col.referenceKey] }}
min="0"
type="number"
placeholder=""
clearable>
</el-input>
</el-input> : '-'}
</div>
)
},
......@@ -3985,24 +3837,16 @@ export const getSixLittleDiamondsConfig = (submitChange) => {
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedGw6) {
row.gwExecuted6 = '-'
return '-';
}
// 判断区间,未执行,部分执行,执行
if (!row.actualGw6 || row.actualGw6 == 0) {
row.gwExecuted6 = '未执行'
return '未执行'
} else if (row.actualGw6 < row.plannedGw6) {
row.gwExecuted6 = '部分执行'
return '部分执行'
} else if (row.actualGw6 !== row.plannedGw6) {
row.gwExecuted6 = '未执行'
} else {
row.gwExecuted6 = '执行'
return '执行'
}
},
formulaStr: '公式:(计划执行-六小金刚批发挂网 = 实际执行-六小金刚批发挂网)',
formulaStr: '公式:(六小金刚批发挂网实际 = 六小金刚批发挂网计划)',
fill: true,
width: 210
}
......
......@@ -67,9 +67,8 @@
const isLoading = ref(true)
const params = ref({
pageNum: 1,
pageSize: 20,
// salesMonth: new Date(),
salesMonth: '',
pageSize: 50,
salesMonth: new Date(),
deptName: '',
dealerCN: '',
lineNameLike: '',
......
......@@ -60,7 +60,12 @@
if (col.requestKey) {
// 关联的公式计算列,需要特殊处理
for (const str of col.requestKey) {
const obj = getSchedulePlanConfig().find(item => item.prop == str)
const obj = getSchedulePlanConfig().flatMap(item => {
if (item.children) {
return item.children.filter(child => !child.onlyFill);
}
return [];
}).find(item => item.prop == str)
if (obj && obj.type === 'formula') {
obj.func(row)
}
......@@ -84,7 +89,7 @@
const isLoading = ref(true)
const params = ref({
pageNum: 1,
pageSize: 20,
pageSize: 50,
salesMonth: new Date(),
deptName: '',
dealerCN: '',
......
......@@ -31,7 +31,12 @@
// 关联的公式计算列,需要特殊处理
for (const str of col.requestKey) {
const obj = getScheduleDisConfig().find(item => item.prop === str)
const obj = getScheduleDisConfig().flatMap(item => {
if (item.children) {
return item.children.filter(child => !child.onlyFill);
}
return [];
}).find(item => item.prop === str)
if (obj && obj.type === 'formula') {
obj.func(row)
}
......@@ -41,6 +46,11 @@
id: row.sapdId,
[col.prop]: row[col.prop], // 当前修改列的值
...col.requestKey.reduce((acc, key) => ({ ...acc, [key]: row[key] }), {}), // 额外携带影响的列字段值
// 特殊类型字段处理
// 端架数量实际
actualEndCapQty: row.actualEndCapQty || 0,
// 地堆平米数实际
actualFloorStackArea: row.actualFloorStackArea || 0,
})
}
// 全部列
......@@ -51,7 +61,7 @@
const isLoading = ref(true)
const params = ref({
pageNum: 1,
pageSize: 20,
pageSize: 50,
salesMonth: new Date(),
deptName: '',
dealerCN: '',
......@@ -88,6 +98,10 @@
item.plannedPromotionDisplayEndDate = parseTime(item.plannedPromotionDisplayEndDate, '{y}-{m}-{d}')
// 修改时间
item.updateTime = parseTime(item.updateTime, '{y}-{m}-{d} {h}:{i}:{s}')
// 特殊类型处理
item.actualEndCapQty = item.actualEndCapQty || ''
item.actualFloorStackArea = item.actualFloorStackArea || ''
})
tableData.value = res.data.rows
total.value = res.data.total
......
......@@ -32,7 +32,12 @@
if (col.requestKey) {
// 关联的公式计算列,需要特殊处理
for (const str of col.requestKey) {
const obj = getSixLittleDiamondsConfig().find(item => item.prop === str)
const obj = getSixLittleDiamondsConfig().flatMap(item => {
if (item.children) {
return item.children.filter(child => !child.onlyFill);
}
return [];
}).find(item => item.prop === str)
if (obj && obj.type === 'formula') {
obj.func(row)
}
......@@ -56,7 +61,7 @@
const params = ref({
pageNum: 1,
pageSize: 20,
pageSize: 50,
salesMonth: new Date(),
deptName: '',
dealerCN: '',
......
......@@ -31,7 +31,12 @@
// 关联的公式计算列,需要特殊处理
for (const str of col.requestKey) {
const obj = getSnackCofing().find(item => item.prop === str)
const obj = getSnackCofing().flatMap(item => {
if (item.children) {
return item.children.filter(child => !child.onlyFill);
}
return [];
}).find(item => item.prop === str)
if (obj && obj.type === 'formula') {
obj.func(row)
}
......@@ -88,7 +93,7 @@
const isLoading = ref(true)
const params = ref({
pageNum: 1,
pageSize: 20,
pageSize: 50,
salesMonth: new Date(),
deptName: '',
dealerCN: '',
......
......@@ -18,7 +18,6 @@
import SearchList from '@/views/promotion/components/SearchList'
import { getThreeMetersTwoSecondsPlanList, submitThreeMetersTwoSecondsPlan } from '@/api'
import { getThreeTwoSecondsConfig } from './data.jsx'
import { parseTime } from '@/utils'
const { proxy } = getCurrentInstance()
......@@ -34,7 +33,12 @@
if (col.requestKey) {
// 关联的公式计算列,需要特殊处理
for (const str of col.requestKey) {
const obj = getThreeTwoSecondsConfig().find(item => item.prop === str)
const obj = getThreeTwoSecondsConfig().flatMap(item => {
if (item.children) {
return item.children.filter(child => !child.onlyFill);
}
return [];
}).find(item => item.prop === str)
if (obj && obj.type === 'formula') {
obj.func(row)
}
......@@ -58,7 +62,7 @@
const params = ref({
pageNum: 1,
pageSize: 20,
pageSize: 50,
salesMonth: new Date(),
deptName: '',
dealerCN: '',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论