提交 097c47a6 authored 作者: lidongxu's avatar lidongxu

refactor(display_schedule): 新增:链路中心_档期陈列填报模式端架数量填写

上级 374dda14
......@@ -59,6 +59,25 @@ export function getDisplayScheduleDetail(params) {
})
}
// 填报-档期陈列
export function submitDisplayScheduleDetail(data) {
Object.keys(data).forEach(key => {
if (data[key] === undefined || data[key] === null) {
data[key] = ''
}
})
return request({
url: `/operation/sales/ap_display/core_pro/${data.id}`,
method: 'PUT',
data: {
display: {
...data,
id: undefined // 不携带 id
}
}
});
}
// 获取-零食计划列表
export function getSnackPlanList(params) {
return request({
......@@ -66,3 +85,22 @@ export function getSnackPlanList(params) {
params
})
}
// 填报-零食计划
export function submitSnackPlan(data) {
Object.keys(data).forEach(key => {
if (data[key] === undefined || data[key] === null) {
data[key] = ''
}
})
return request({
url: `/operation/sales/ap_display/core_snack/${data.id}`,
method: 'PUT',
data: {
display: {
...data,
id: undefined // 不携带 id
}
}
});
}
\ No newline at end of file
......@@ -74,8 +74,8 @@
<script setup>
import { h } from 'vue'
/*************** 操作类型 ***************/
const operation = ref('平铺模式');
// const operation = ref('填报模式');
// const operation = ref('平铺模式');
const operation = ref('填报模式');
const tableRef = ref(null)
const props = defineProps({
......
......@@ -14,7 +14,7 @@
<script setup
lang="jsx">
import CommonPlan from '@/views/promotion/components/CommonPlan'
import { getDisplayScheduleDetail, submitDisplayPlan } from '@/api'
import { getDisplayScheduleDetail, submitDisplayScheduleDetail } from '@/api'
import { parseTime } from '@/utils'
import { onMounted } from 'vue';
......@@ -347,17 +347,64 @@
"label": "实际端架 - 数量",
"prop": "actualEndCapQty",
"visible": true,
"type": "string",
"fill": false,
"width": 140
"type": "select",
referenceKey: "plannedEndCapQty",
"options": [
{
"label": "0",
"value": 0
},
{
"label": "0.5",
"value": 0.5
},
{
"label": "1",
"value": 1
},
{
"label": "2",
"value": 2
}
],
render: (_, row, col) => {
return (
<div>
<span>{row[col.referenceKey] || '-'}</span>
<el-select modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
disabled={!row[col.referenceKey]}
placeholder="">
{col.options.map(item => (
<el-option
key={item.value}
label={item.label}
value={item.value}
/>
))}
</el-select>
</div>
)
},
"fill": true,
"width": 140,
requestKey: ["actualEndCapExecuted"]
},
{
"label": "实际端架 - 是否执行",
"prop": "actualEndCapExecuted",
"visible": true,
"type": "string",
"fill": false,
"width": 160
"type": "formula",
"fill": true,
"width": 160,
func: (row) => {
row.actualEndCapExecuted = row.actualEndCapQty >= row.plannedEndCapQty ? '是' : '否'
return row.actualEndCapExecuted
},
formulaStr: "执行端架数量 >= 计划端架数量"
},
{
"label": "计划地堆 - 平米数(㎡)",
......@@ -535,48 +582,11 @@
}
}
await submitDisplayPlan({
id: row.sadId,
await submitDisplayScheduleDetail({
id: row.sapdId,
[col.prop]: row[col.prop], // 当前修改列的值
...col.requestKey.reduce((acc, key) => ({ ...acc, [key]: row[key] }), {}), // 额外携带影响的列字段值
})
// // 这些提交变化的,同时会影响公式计算的,需要把公式计算的字段列结果,一起发给后台
// // 注意:实际主货架形式改变并为空时,要置空实际主货架数量
// if (col.prop === 'actualMainShelfType' && !row.actualMainShelfType) {
// row.actualMainShelfQty = ''
// // 并提交保存一次
// await submitDisplayPlan({
// id: row.sadId,
// actualMainShelfQty: row.actualMainShelfQty,
// })
// }
// // 主货架
// if (['actualMainShelfType', 'actualMainShelfQty'].includes(col.prop)) {
// await submitDisplayPlan({
// id: row.sadId,
// actualMainShelfExecuted: row.actualMainShelfExecuted,
// })
// }
// // 端架
// if (['actualEndCapQty'].includes(col.prop)) {
// await submitDisplayPlan({
// id: row.sadId,
// actualEndCapExecuted: row.actualEndCapExecuted,
// })
// }
// // 地堆
// if (['actualFloorStackArea', 'actualFloorStackQty'].includes(col.prop)) {
// await submitDisplayPlan({
// id: row.sadId,
// actualFloorStackExecuted: row.actualFloorStackExecuted,
// })
// }
// // 常规陈列是否执行
// await submitDisplayPlan({
// id: row.sadId,
// regularDisplayExecuted: row.regularDisplayExecuted,
// })
}
// 表格数据
......
......@@ -353,7 +353,7 @@
}
await submitDisplayPlan({
id: row.sadId,
id: row.sasdId,
[col.prop]: row[col.prop], // 当前修改列的值
...col.requestKey.reduce((acc, key) => ({ ...acc, [key]: row[key] }), {}), // 额外携带影响的列字段值
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论