|
@@ -1868,6 +1868,9 @@ export const useHooks = (t?: any) => {
|
|
|
let { visibleData } = $table.getTableData();
|
|
|
const copyMap = new Map();
|
|
|
|
|
|
+ const COMMON_PRESERVED_PROPS = ["bj_inputtype", "erp_pzname", "erp_pzcode", "bj_pzname", "bj_namemx", "itemname"];
|
|
|
+ const SPECIAL_PRESERVED_PROPS = ["actual_size", "sb_craft", "actual_size_sb", "ss_rate", "ls_rate"];
|
|
|
+ const FULL_PRESERVED_PROPS = [...COMMON_PRESERVED_PROPS, ...SPECIAL_PRESERVED_PROPS];
|
|
|
// inputtype 0 - 选择 1 - 录入 2 - 带出
|
|
|
if (isPz === 0) {
|
|
|
// 刷新配置 FEAT: 只刷新【带出】类型的配置,只刷新明细名称列,并检查核价是否有新增的【带出】类型资料,添加到配置
|
|
@@ -1875,28 +1878,16 @@ export const useHooks = (t?: any) => {
|
|
|
copyMap.set(`${mx.erp_pzid}`, mx);
|
|
|
});
|
|
|
|
|
|
- const PRESERVE_PROPS = [
|
|
|
- "bj_inputtype",
|
|
|
- "erp_pzname",
|
|
|
- "erp_pzcode",
|
|
|
- "bj_pzname",
|
|
|
- "bj_namemx",
|
|
|
- "itemname",
|
|
|
- "actual_size",
|
|
|
- "sb_craft",
|
|
|
- "actual_size_sb",
|
|
|
- "ss_rate",
|
|
|
- "ls_rate"
|
|
|
- ];
|
|
|
state.mattressYWList = res.mxList.map(mx => {
|
|
|
const key = `${mx.erp_pzid}`;
|
|
|
if (copyMap.has(key)) {
|
|
|
const mx2 = copyMap.get(key);
|
|
|
if (mx2.bj_inputtype === 2) {
|
|
|
- mx.bj_inputtype = mx2.bj_inputtype;
|
|
|
- mx.bj_namemx = mx2.bj_namemx;
|
|
|
+ SPECIAL_PRESERVED_PROPS.forEach(prop => {
|
|
|
+ mx[prop] = mx2[prop];
|
|
|
+ });
|
|
|
} else {
|
|
|
- PRESERVE_PROPS.forEach(prop => {
|
|
|
+ FULL_PRESERVED_PROPS.forEach(prop => {
|
|
|
mx[prop] = mx2[prop];
|
|
|
});
|
|
|
}
|
|
@@ -1920,13 +1911,11 @@ export const useHooks = (t?: any) => {
|
|
|
state.mattressQDList = visibleData.map((mx: any) => mx);
|
|
|
} else {
|
|
|
// 重新生成: FEAT: 删除所有已经填写的【录入】和【选择)项目,根据核价资料,重新生成所有的【带出】资料
|
|
|
- const PRESERVE_PROPS = ["actual_size", "sb_craft", "actual_size_sb", "ss_rate", "ls_rate"];
|
|
|
-
|
|
|
visibleData.forEach(mx => copyMap.set(`${mx.erp_pzid}`, mx));
|
|
|
state.mattressYWList = res.mxList.map(mx => {
|
|
|
const key = `${mx.erp_pzid}`;
|
|
|
if (copyMap.has(key)) {
|
|
|
- PRESERVE_PROPS.forEach(prop => {
|
|
|
+ SPECIAL_PRESERVED_PROPS.forEach(prop => {
|
|
|
mx[prop] = copyMap.get(key)[prop];
|
|
|
});
|
|
|
}
|