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

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

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