提交 559ce6bc authored 作者: lidongxu's avatar lidongxu

refactor(promotion/display_schedule): 修改:店内执行上报_已知问题修改

上级 bcd2f4a8
......@@ -113,10 +113,48 @@ export function getThreeMetersTwoSecondsPlanList(params) {
})
}
// 填报-三米两秒计划
export function submitThreeMetersTwoSecondsPlan(data) {
Object.keys(data).forEach(key => {
if (data[key] === undefined || data[key] === null) {
data[key] = ''
}
})
return request({
url: `/operation/sales/ap_display/core_s/${data.id}`,
method: 'PUT',
data: {
displayS: {
...data,
id: undefined // 不携带 id
}
}
});
}
// 获取-六小金刚计划列表
export function getSixLittleDiamondsPlanList(params) {
return request({
url: '/operation/sales/ap_display/query/jg_page',
params
})
}
// 填报-六小金刚计划
export function submitSixLittleDiamondsPlan(data) {
Object.keys(data).forEach(key => {
if (data[key] === undefined || data[key] === null) {
data[key] = ''
}
})
return request({
url: `/operation/sales/ap_display/core_j/${data.id}`,
method: 'PUT',
data: {
displayJ: {
...data,
id: undefined // 不携带 id
}
}
});
}
\ No newline at end of file
......@@ -41,9 +41,7 @@ import Snack from './tabs/snack.vue'
import ThreeTwoSeconds from './tabs/three_two_seconds.vue'
import SixLittleDiamonds from './tabs/six_little_diamonds.vue'
// const activeName = ref('常规陈列');
const activeName = ref('三米两秒');
// const activeName = ref('六小金刚');
const activeName = ref('常规陈列');
const handleClickTabs = (tab) => {
activeName.value = tab.name;
}
......
......@@ -393,7 +393,20 @@
label: "实际执行规格",
prop: "actualPromotionSpecRe",
visible: true,
type: "string",
type: "input",
render: (_, row, col) => {
return (
<div>
<el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
placeholder="">
</el-input>
</div>
)
},
fill: true,
width: 140
},
......@@ -522,7 +535,20 @@
label: "实际执行口味",
prop: "actualPromotionFlavorRe",
visible: true,
type: 'string',
type: "input",
render: (_, row, col) => {
return (
<div>
<el-input modelValue={row[col.prop]}
onUpdate:modelValue={(value) => {
row[col.prop] = value;
submitChange(row, col);
}}
placeholder="">
</el-input>
</div>
)
},
fill: true,
width: 170,
},
......@@ -853,24 +879,24 @@
fill: true,
width: 200
},
{
label: "促销机制是否执行",
prop: "promotionMechanismExecutionStatus",
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedPromotionMechanism) {
row.promotionMechanismExecutionStatus = '-';
return '-';
}
row.promotionMechanismExecutionStatus = row.actualPromotionMechanism === '执行与计划一致' ? '是' : '否';
return row.promotionMechanismExecutionStatus;
},
formulaStr: '公式:实际促销机制,是否有值',
fill: true,
width: 145,
},
// {
// label: "促销机制是否执行",
// prop: "promotionMechanismExecutionStatus",
// visible: true,
// type: 'formula',
// func: (row) => {
// // 如果参考值是空则返回 '-'
// if (!row.plannedPromotionMechanism) {
// row.promotionMechanismExecutionStatus = '-';
// return '-';
// }
// row.promotionMechanismExecutionStatus = row.actualPromotionMechanism === '执行与计划一致' ? '是' : '否';
// return row.promotionMechanismExecutionStatus;
// },
// formulaStr: '公式:实际促销机制,是否有值',
// fill: true,
// width: 145,
// },
{
label: "预估袋数",
prop: "estimatedBagCount",
......@@ -879,34 +905,34 @@
fill: false,
width: 90
},
{
label: "档期备货量(袋)",
prop: "promotionStockQuantity",
visible: true,
type: 'input',
format: 'number',
referenceKey: "estimatedBagCount",
fill: true,
width: 135,
render: (_, row, col) => {
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>
</div>
)
}
},
// {
// label: "档期备货量(袋)",
// prop: "promotionStockQuantity",
// visible: true,
// type: 'input',
// format: 'number',
// referenceKey: "estimatedBagCount",
// fill: true,
// width: 135,
// render: (_, row, col) => {
// 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>
// </div>
// )
// }
// },
{
label: "单包厂价(单包)",
prop: "unitFactoryPrice",
......@@ -939,45 +965,45 @@
fill: false,
width: 165
},
{
label: "实际促销售价(单包)",
prop: "actualPromotionPrice",
visible: true,
type: 'input',
format: 'number',
referenceKey: "plannedPromotionPrice",
fill: true,
width: 165,
render: (_, row, col) => {
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>
</div>
)
},
requestKey: ["promotionPriceExecutionStatus"]
},
// {
// label: "实际促销售价(单包)",
// prop: "actualPromotionPrice",
// visible: true,
// type: 'input',
// format: 'number',
// referenceKey: "plannedPromotionPrice",
// fill: true,
// width: 165,
// render: (_, row, col) => {
// 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>
// </div>
// )
// },
// requestKey: ["promotionPriceExecutionStatus"]
// },
{
label: "促销价是否执行",
prop: "promotionPriceExecutionStatus",
visible: true,
type: 'formula',
func: (row) => {
row.promotionPriceExecutionStatus = row.plannedPromotionPrice == row.actualPromotionPrice ? '是' : '否';
row.promotionPriceExecutionStatus = row.actualPromotionMechanism === '执行与计划一致' ? '是' : '否';
return row.promotionPriceExecutionStatus;
},
formulaStr: '公式:(计划促销售价 = 实际促销售价)',
formulaStr: '公式:(计划促销机制 = 执行促销机制)',
fill: true,
width: 140
},
......
......@@ -653,23 +653,23 @@
},
requestKey: ["actualOtherDisplayExecuted", "promotionDisplayExecuted"]
},
// {
// "label": "实际其他陈列 - 是否执行",
// "prop": "actualOtherDisplayExecuted",
// "visible": true,
// "type": "formula",
// "fill": true,
// "width": 190,
// func: (row) => {
// if (!row.plannedOtherDisplay) {
// row.actualOtherDisplayExecuted = '-'
// return '-';
// }
// row.actualOtherDisplayExecuted = row.actualOtherDisplay ? '是' : '否'
// return row.actualOtherDisplayExecuted
// },
// formulaStr: "公式:实际其他陈列-数量+形式,有值"
// },
{
"label": "实际其他陈列 - 是否执行",
"prop": "actualOtherDisplayExecuted",
"visible": true,
"type": "formula",
"fill": true,
"width": 190,
func: (row) => {
if (!row.plannedOtherDisplay) {
row.actualOtherDisplayExecuted = '-'
return '-';
}
row.actualOtherDisplayExecuted = row.actualOtherDisplay ? '是' : '否'
return row.actualOtherDisplayExecuted
},
formulaStr: "公式:实际其他陈列-数量+形式,有值"
},
{
"label": "合计费用 - 费用",
"prop": "totalCost",
......
......@@ -2,17 +2,6 @@
<!-- 六小金刚 -->
<SearchList :showSearch="showSearch"
@change="searchChange" />
<!-- <CustomTable :tableData="tableData"
:isLoading="isLoading"
:total="total"
:tableColumns="tableColumns"
:chooseColumns="chooseColumns"
:visibleProps="visibleProps"
:params="params"
:showFill="showFill"
@updateColumns="updateColumns"
@getTableList="getTableList"
@updateShowSearch="updateShowSearch" /> -->
<CustomTable :tableData="tableData"
:isLoading="isLoading"
:total="total"
......@@ -28,7 +17,7 @@
lang="jsx">
import CustomTable from '@/views/promotion/components/Table'
import SearchList from '@/views/promotion/components/SearchList'
import { getSixLittleDiamondsPlanList } from '@/api'
import { getSixLittleDiamondsPlanList, submitSixLittleDiamondsPlan } from '@/api'
const { proxy } = getCurrentInstance()
/*************** 搜索列表 ***************/
......@@ -237,7 +226,7 @@
children: [
{
label: '计划执行-六小金刚批发挂网',
prop: 'plannedWholesaleNet',
prop: 'plannedGw6',
visible: true,
type: 'string',
fill: false,
......@@ -245,15 +234,43 @@
},
{
label: '实际执行-六小金刚批发挂网',
prop: 'actualWholesaleNet',
prop: 'actualGw6',
referenceKey: 'plannedGw6',
visible: true,
type: 'string',
type: 'select',
options: [
{ label: '是', value: '是' },
{ label: '否', value: '否' }
],
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=""
clearable>
{col.options.map(item => (
<el-option
key={item.value}
label={item.label}
value={item.value}
/>
))}
</el-select>
</div>
)
},
fill: true,
width: 180
},
{
label: '六小金刚批发挂网陈列费',
prop: 'wholesaleNetCost',
prop: 'totalCostGw6',
visible: true,
type: 'string',
fill: false,
......@@ -261,9 +278,19 @@
},
{
label: '六小金刚批发挂网-是否执行',
prop: 'wholesaleNetExecuted',
prop: 'gwExecuted6',
visible: true,
type: 'string',
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedGw6) {
row.gwExecuted6 = '-'
return '-';
}
row.gwExecuted6 = (row.actualGw6 === '是') ? '是' : '否';
return row.gwExecuted6;
},
formulaStr: '公式:(实际执行-六小金刚批发挂网 = 是)',
fill: true,
width: 160
}
......@@ -339,6 +366,28 @@
showSearch.value = val
}
// 提交变更
const submitChange = async (row, col) => {
let requestObj = {}
if (col.requestKey) {
// 关联的公式计算列,需要特殊处理
for (const str of col.requestKey) {
const obj = tableColumns.value.find(item => item.prop === str)
if (obj && obj.type === 'formula') {
obj.func(row)
}
}
requestObj = col.requestKey.reduce((acc, key) => ({ ...acc, [key]: row[key] }), {})
}
await submitSixLittleDiamondsPlan({
id: row.sadjId,
[col.prop]: row[col.prop], // 当前修改列的值
...requestObj
})
}
</script>
......
......@@ -2,7 +2,7 @@
<!-- 三米两秒 -->
<SearchList :showSearch="showSearch"
@change="searchChange" />
<!-- <CustomTable :tableData="tableData"
<CustomTable :tableData="tableData"
:isLoading="isLoading"
:total="total"
:tableColumns="tableColumns"
......@@ -12,23 +12,14 @@
:showFill="showFill"
@updateColumns="updateColumns"
@getTableList="getTableList"
@updateShowSearch="updateShowSearch" /> -->
<CustomTable :tableData="tableData"
:isLoading="isLoading"
:total="total"
:tableColumns="tableColumns"
:chooseColumns="chooseColumns"
:visibleProps="visibleProps"
:params="params"
:showFill="showFill"
@updateColumns="updateColumns" />
@updateShowSearch="updateShowSearch" />
</template>
<script setup
lang="jsx">
import CustomTable from '@/views/promotion/components/Table'
import SearchList from '@/views/promotion/components/SearchList'
import { getThreeMetersTwoSecondsPlanList } from '@/api'
import { getThreeMetersTwoSecondsPlanList, submitThreeMetersTwoSecondsPlan } from '@/api'
const { proxy } = getCurrentInstance()
......@@ -255,7 +246,6 @@
{
label: '实际-60g挂条陈列数量',
prop: 'actualDisplayQty60',
// 计划
referenceKey: 'plannedDisplayQty60',
visible: true,
type: 'string',
......@@ -279,7 +269,26 @@
</div>
);
}
}
},
// 60g挂条陈列-是否执行
{
label: '60g挂条陈列-是否执行',
prop: 'displayQtyExecuted60',
visible: true,
type: 'formula',
func: (row) => {
// 如果参考值是空则返回 '-'
if (!row.plannedDisplayQty60) {
row.displayQtyExecuted60 = '-';
return '-';
}
row.displayQtyExecuted60 = row.plannedDisplayQty60 == row.actualDisplayQty60 ? '是' : '否';
return row.displayQtyExecuted60;
},
formulaStr: '公式:(计划-60g挂条陈列数量 = 实际-60g挂条陈列数量)',
fill: true,
width: 200
},
],
prop: 'sixtyGramHangBarColumns',
visible: true
......@@ -373,8 +382,8 @@
requestObj = col.requestKey.reduce((acc, key) => ({ ...acc, [key]: row[key] }), {})
}
await submitDisplayPlan({
id: row.sadId,
await submitThreeMetersTwoSecondsPlan({
id: row.sadsId,
[col.prop]: row[col.prop], // 当前修改列的值
...requestObj
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论