提交 28532147 authored 作者: lidongxu's avatar lidongxu

refactor(promotion/tabs/): 修改:店内执行上报_部分列的形式修改

上级 b456805b
......@@ -9,7 +9,7 @@ export function getDisplayList(params) {
// 填报-陈列计划
export function submitDisplayPlan(data) {
// 遍历 data 每对 key value,发现 value 是 undefined 替换成空字符串
// 遍历 data 每对 key value,发现 value 是 undefined / null 替换成空字符串
Object.keys(data).forEach(key => {
if (data[key] === undefined || data[key] === null) {
data[key] = ''
......
......@@ -105,7 +105,6 @@ const showSearch = ref(false)
// 从新增页面跳转回来需要刷新列表
watch(() => route.path, (newPath, oldPath) => {
console.log(oldPath, newPath)
if (oldPath.includes('/cp_activity/promotion_plan_editing') && newPath === '/cp_activity/promotion_plan') {
planSearch.value.resetFn()
}
......
......@@ -667,24 +667,6 @@
// 请求时需要额外携带影响的列字段值
requestKey: ["actualFloorStackExecuted", "regularDisplayExecuted"]
},
{
label: "实际地堆是否执行",
prop: "actualFloorStackExecuted",
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedFloorStackArea || !row.plannedFloorStackQty) {
row.actualFloorStackExecuted = '-'
return '-';
}
row.actualFloorStackExecuted = ((parseFloat(row.actualFloorStackArea) >= parseFloat(row.plannedFloorStackArea)) && (parseInt(row.actualFloorStackQty) >= parseInt(row.plannedFloorStackQty))) ? '是' : '否';
return row.actualFloorStackExecuted;
},
formulaStr: '公式:(实际地堆平米数 >= 计划地堆平米数)并且(实际地堆数量 >= 计划地堆数量)',
fill: true,
width: 150
},
{
label: "实际主题地堆-是否",
prop: "actualThemedFloorStack",
......@@ -695,7 +677,7 @@
{ label: '是', value: '是' },
{ label: '否', value: '否' }
],
fill: true,
fill: false,
width: 140,
render: (_, row, col) => {
return (
......@@ -720,6 +702,25 @@
)
}
},
{
label: "实际地堆是否执行",
prop: "actualFloorStackExecuted",
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedFloorStackArea || !row.plannedFloorStackQty) {
row.actualFloorStackExecuted = '-'
return '-';
}
row.actualFloorStackExecuted = ((parseFloat(row.actualFloorStackArea) >= parseFloat(row.plannedFloorStackArea)) && (parseInt(row.actualFloorStackQty) >= parseInt(row.plannedFloorStackQty))) ? '是' : '否';
return row.actualFloorStackExecuted;
},
formulaStr: '公式:(实际地堆平米数 >= 计划地堆平米数)并且(实际地堆数量 >= 计划地堆数量)',
fill: true,
width: 150
},
{
label: "计划多点陈列-数量+形式",
prop: "plannedMultiDisplay",
......@@ -740,11 +741,11 @@
label: "实际多点陈列-数量+形式",
prop: "actualMultiDisplay",
visible: true,
type: 'input',
func: (row) => {
// 没有输入内容时,则是否执行设置为否
// row.actualMultiDisplayExecuted = !row.actualMultiDisplay ? '否' : '是'
},
type: 'select',
options: [
{ label: '执行与计划一致', value: '执行与计划一致' },
{ label: '执行与计划不一致', value: '执行与计划不一致' }
],
referenceKey: "plannedMultiDisplay",
fill: true,
width: 175,
......@@ -752,14 +753,22 @@
return (
<div>
<span>{row[col.referenceKey] || '-'}</span>
<el-input modelValue={row[col.prop]}
<el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
placeholder="">
</el-input>
placeholder=""
clearable>
{col.options.map(item => (
<el-option
key={item.value}
label={item.label}
value={item.value}
/>
))}
</el-select>
</div>
)
},
......@@ -778,7 +787,7 @@
row.actualMultiDisplayExecuted = '-'
return '-';
}
row.actualMultiDisplayExecuted = (row.actualMultiDisplay) ? '是' : '否';
row.actualMultiDisplayExecuted = row.actualMultiDisplay === '执行与计划一致' ? '是' : '否';
return row.actualMultiDisplayExecuted;
},
formulaStr: '公式:实际多点陈列-数量+形式,有值',
......@@ -797,11 +806,11 @@
label: "实际挂条-数量+形式",
prop: "actualHangingStripQuantityForm",
visible: true,
type: 'input',
func: (row) => {
// 没有输入内容时,则是否执行设置为否
// row.actualMultiDisplayExecuted = !row.actualMultiDisplay ? '否' : '是'
},
type: 'select',
options: [
{ label: '执行与计划一致', value: '执行与计划一致' },
{ label: '执行与计划不一致', value: '执行与计划不一致' }
],
referenceKey: "plannedHangingStripQuantityForm",
fill: true,
width: 175,
......@@ -809,14 +818,22 @@
return (
<div>
<span>{row[col.referenceKey] || '-'}</span>
<el-input modelValue={row[col.prop]}
<el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
placeholder="">
</el-input>
placeholder=""
clearable>
{col.options.map(item => (
<el-option
key={item.value}
label={item.label}
value={item.value}
/>
))}
</el-select>
</div>
)
},
......@@ -835,8 +852,7 @@
row.hangingStripExecuted = '-'
return '-';
}
console.log(row.actualHangingStripQuantityForm, row.plannedHangingStripQuantityForm)
row.hangingStripExecuted = (row.actualHangingStripQuantityForm === row.plannedHangingStripQuantityForm) ? '是' : '否';
row.hangingStripExecuted = (row.actualHangingStripQuantityForm === '执行与计划一致') ? '是' : '否';
return row.hangingStripExecuted;
},
formulaStr: '公式:实际挂条-数量+形式 === 计划挂条-数量+形式',
......@@ -1002,7 +1018,7 @@
[col.prop]: row[col.prop], // 当前修改列的值
...requestObj
})
}
// 表格数据
......
......@@ -377,7 +377,6 @@
submitChange(row, { prop: 'actualPromotionSpecRe' })
}).catch(() => {
// 用户点击取消或关闭弹窗
console.log('用户取消了输入')
})
} else {
// 没选其他,则清空实际执行规格
......@@ -397,13 +396,17 @@
render: (_, row, col) => {
return (
<div>
<el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
placeholder="">
</el-input>
{
row.actualPromotionSpec !== '其他' ? (<div style="width: 100%; text-align: center;">-</div>) : (
<el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
placeholder="">
</el-input>
)
}
</div>
)
},
......@@ -519,7 +522,6 @@
submitChange(row, { prop: 'actualPromotionFlavorRe' })
}).catch(() => {
// 用户点击取消或关闭弹窗
console.log('用户取消了输入')
})
} else {
// 没选其他,则清空实际执行口味
......@@ -539,13 +541,17 @@
render: (_, row, col) => {
return (
<div>
<el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
placeholder="">
</el-input>
{
row.actualPromotionFlavor[0] !== '其他' ? (<div style="width: 100%; text-align: center;">-</div>) : (
<el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
placeholder="">
</el-input>
)
}
</div>
)
},
......@@ -861,7 +867,6 @@
submitChange(row, { prop: 'actualPromotionPriceRe' })
}).catch(() => {
// 用户点击取消或关闭弹窗
console.log('用户取消了输入')
})
} else {
// 没选其他,则清空实际执行价格
......@@ -875,7 +880,24 @@
label: "实际执行价格",
prop: "actualPromotionPriceRe",
visible: true,
type: 'string',
type: "input",
render: (_, row, col) => {
return (
<div>
{
row.actualPromotionMechanism !== '执行与计划不一致' ? (<div style="width: 100%; text-align: center;">-</div>) : (
<el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
placeholder="">
</el-input>
)
}
</div>
)
},
fill: true,
width: 200
},
......
......@@ -111,31 +111,31 @@
showOverflowTooltip: true,
fixed: 'left'
},
{
"label": "经销商类型",
"prop": "dealerType",
showOverflowTooltip: true,
"visible": true,
"type": "string",
"fill": false,
"width": 150
},
{
"label": "开户日期",
"prop": "openingDate",
"visible": true,
"type": "string",
"fill": false,
"width": 120
},
{
"label": "闭户日期",
"prop": "closingDate",
"visible": true,
"type": "string",
"fill": false,
"width": 120
},
// {
// "label": "经销商类型",
// "prop": "dealerType",
// showOverflowTooltip: true,
// "visible": true,
// "type": "string",
// "fill": false,
// "width": 150
// },
// {
// "label": "开户日期",
// "prop": "openingDate",
// "visible": true,
// "type": "string",
// "fill": false,
// "width": 120
// },
// {
// "label": "闭户日期",
// "prop": "closingDate",
// "visible": true,
// "type": "string",
// "fill": false,
// "width": 120
// },
{
"label": "大区总监",
"prop": "regionManager",
......@@ -515,6 +515,10 @@
{
"label": "4",
"value": 4
},
{
"label": "6",
"value": 6
}
],
render: (_, row, col) => {
......@@ -565,7 +569,12 @@
{
"label": "3",
"value": 3
},
{
"label": "4",
"value": 4
}
],
render: (_, row, col) => {
return (
......@@ -629,7 +638,11 @@
"label": "实际其他陈列 - 数量 + 形式",
"prop": "actualOtherDisplay",
"visible": true,
"type": "input",
"type": "select",
"options": [
{ label: '执行与计划一致', value: '执行与计划一致' },
{ label: '执行与计划不一致', value: '执行与计划不一致' }
],
"fill": true,
"width": 190,
referenceKey: "plannedOtherDisplay",
......@@ -637,17 +650,23 @@
return (
<div>
<span>{row[col.referenceKey] || '-'}</span>
<div>
<el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
placeholder=""
clearable
/>
</div>
<el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
placeholder=""
clearable
>
{col.options.map(item => (
<el-option
key={item.value}
label={item.label}
value={item.value}
/>
))}
</el-select>
</div>
)
},
......@@ -665,7 +684,7 @@
row.actualOtherDisplayExecuted = '-'
return '-';
}
row.actualOtherDisplayExecuted = row.actualOtherDisplay ? '是' : '否'
row.actualOtherDisplayExecuted = row.actualOtherDisplay === '执行与计划一致' ? '是' : '否'
return row.actualOtherDisplayExecuted
},
formulaStr: "公式:实际其他陈列-数量+形式,有值"
......
......@@ -351,7 +351,6 @@
const getTableList = () => {
isLoading.value = true
getSixLittleDiamondsPlanList(params.value).then(res => {
console.log(res, 'res')
isLoading.value = false
tableData.value = res.data.rows.map(item => {
// 计划月份
......
......@@ -264,12 +264,12 @@
"type": "input",
options: [
{
label: '',
value: ''
label: '执行与计划一致',
value: '执行与计划一致'
},
{
label: '',
value: ''
label: '执行与计划不一致',
value: '执行与计划不一致'
}
],
referenceKey: "plannedDisplay",
......@@ -413,43 +413,43 @@
// requestKey: ["endCapQtyExecuted", "snackDisplayExecuted"]
requestKey: ["endCapQtyExecuted"]
},
{
"label": "端架数量是否执行",
"prop": "endCapQtyExecuted",
"visible": true,
"type": "formula",
"fill": true,
"width": 150,
func: (row) => {
if (!row.plannedEndCapQty) {
row.endCapQtyExecuted = '-'
return '-'
}
// 截取计划端架数量数据
row.endCapQtyExecuted = row.actualEndCapQty == row.plannedEndCapQty ? '是' : '否'
return row.endCapQtyExecuted
},
formulaStr: "执行端架数量 == 计划端架数量"
},
// {
// "label": "零食陈列是否执行",
// "prop": "snackDisplayExecuted",
// "label": "端架数量是否执行",
// "prop": "endCapQtyExecuted",
// "visible": true,
// "type": "formula",
// "fill": true,
// "width": 150,
// func: (row) => {
// const executionStatuses = [
// row.displayExecuted,
// row.endCapQtyExecuted
// ].filter(status => status !== '-');
// // 如果所有过滤后的状态都是'是',则返回'是',否则返回'否'
// row.snackDisplayExecuted = executionStatuses.every(status => status === '是') ? '是' : '否';
// return row.snackDisplayExecuted;
// if (!row.plannedEndCapQty) {
// row.endCapQtyExecuted = '-'
// return '-'
// }
// // 截取计划端架数量数据
// row.endCapQtyExecuted = row.actualEndCapQty == row.plannedEndCapQty ? '是' : '否'
// return row.endCapQtyExecuted
// },
// formulaStr: "公式:陈列形式执行,并且端架数量执行(某项无计划时,忽略该项)"
// formulaStr: "执行端架数量 == 计划端架数量"
// },
{
"label": "零食陈列是否执行",
"prop": "snackDisplayExecuted",
"visible": true,
"type": "formula",
"fill": true,
"width": 150,
func: (row) => {
const executionStatuses = [
row.displayExecuted,
row.endCapQtyExecuted
].filter(status => status !== '-');
// 如果所有过滤后的状态都是'是',则返回'是',否则返回'否'
row.snackDisplayExecuted = executionStatuses.every(status => status === '是') ? '是' : '否';
return row.snackDisplayExecuted;
},
formulaStr: "公式:陈列形式执行,并且端架数量执行(某项无计划时,忽略该项)"
},
{
"label": "计划 - 陈列费用",
"prop": "totalCost",
......
......@@ -268,7 +268,8 @@
</div>
</div>
);
}
},
requestKey: ["displayQtyExecuted60"]
},
// 60g挂条陈列-是否执行
{
......@@ -282,10 +283,10 @@
row.displayQtyExecuted60 = '-';
return '-';
}
row.displayQtyExecuted60 = row.plannedDisplayQty60 == row.actualDisplayQty60 ? '是' : '否';
row.displayQtyExecuted60 = (row.actualDisplayQty60 * 1) >= (row.plannedDisplayQty60 * 1) ? '是' : '否';
return row.displayQtyExecuted60;
},
formulaStr: '公式:(计划-60g挂条陈列数量 = 实际-60g挂条陈列数量)',
formulaStr: '公式:(实际-60g挂条陈列数量 >= 计划-60g挂条陈列数量)',
fill: true,
width: 200
},
......@@ -349,8 +350,6 @@
const getTableList = () => {
isLoading.value = true
getThreeMetersTwoSecondsPlanList(params.value).then(res => {
console.log(res)
console.log(res.data.rows)
isLoading.value = false
tableData.value = res.data.rows.map(item => {
// 计划月份
......@@ -370,6 +369,7 @@
// 提交变更
const submitChange = async (row, col) => {
let requestObj = {}
if (col.requestKey) {
// 关联的公式计算列,需要特殊处理
......
......@@ -681,7 +681,6 @@
dateRange.value = [] // 创建时间置空
proxy.resetForm("queryRef")
queryParams.value.deptId = undefined // 部门搜索置空
console.log(deptTreeRef.value)
deptTreeRef.value.setCurrentKey(null)
handleQuery()
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论