|
@@ -1860,8 +1860,48 @@ export const useHooks = (t?: any) => {
|
|
|
* @param mattressid 床垫ID
|
|
|
*/
|
|
|
const RefreshMattressInterfaceList = async (mattressid: number, isPz: number, configcodetype: number = 0) => {
|
|
|
- let res = await RefreshMattressInterface({ mattressid, isPz, configcodetype });
|
|
|
- state.mattressYWList = res.mxList;
|
|
|
+ let res = await RefreshMattressInterface({ mattressid, isPz: isPz, configcodetype });
|
|
|
+ // state.mattressYWList = res.mxList;
|
|
|
+
|
|
|
+ // 获取先有配置信息
|
|
|
+ const $table = state.YwTableRef?.element;
|
|
|
+ if ($table) {
|
|
|
+ let { visibleData } = $table.getTableData();
|
|
|
+ const copyMap = new Map();
|
|
|
+
|
|
|
+ res.mxList.forEach((mx: any) => {
|
|
|
+ const key = `${mx.erp_pzid}`;
|
|
|
+ if (!copyMap.has(key)) copyMap.set(key, mx);
|
|
|
+ });
|
|
|
+
|
|
|
+ visibleData.forEach((mx: any) => {
|
|
|
+ const key = `${mx.erp_pzid}`;
|
|
|
+ if (mx.erp_pzid > 0 && copyMap.has(key)) {
|
|
|
+ const mx2 = copyMap.get(key);
|
|
|
+
|
|
|
+ if (mx.bj_inputtype !== 2 || (mx.bj_inputtype === 2 && mx2.bj_inputtype === 1)) {
|
|
|
+ mx.bj_namemx = mx2.bj_namemx;
|
|
|
+ mx.actual_size = mx2.actual_size;
|
|
|
+ mx.sb_craft = mx2.sb_craft;
|
|
|
+ mx.actual_size_sb = mx2.actual_size_sb;
|
|
|
+ mx.ss_rate = mx2.ss_rate;
|
|
|
+ mx.ls_rate = mx2.ls_rate;
|
|
|
+
|
|
|
+ if (mx.bj_inputtype === 2 && mx2.bj_inputtype === 1) {
|
|
|
+ mx.bj_inputtype = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ mx.actual_size = mx2.actual_size;
|
|
|
+ mx.sb_craft = mx2.sb_craft;
|
|
|
+ mx.actual_size_sb = mx2.actual_size_sb;
|
|
|
+ mx.ss_rate = mx2.ss_rate;
|
|
|
+ mx.ls_rate = mx2.ls_rate;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $table.reloadData(visibleData);
|
|
|
+ }
|
|
|
|
|
|
resetMergeCells();
|
|
|
|
|
@@ -1906,13 +1946,13 @@ export const useHooks = (t?: any) => {
|
|
|
let { visibleData } = $table.getTableData();
|
|
|
const copyMap = new Map();
|
|
|
|
|
|
- visibleData.forEach(mx => {
|
|
|
+ res.mxList.forEach(mx => {
|
|
|
const key = `${mx.itemname}|${mx.bj_pzname}|${mx.bj_pzname_mx}`;
|
|
|
|
|
|
if (!copyMap.has(key)) copyMap.set(key, mx);
|
|
|
});
|
|
|
|
|
|
- res.mxList.forEach(mx => {
|
|
|
+ visibleData.forEach(mx => {
|
|
|
// 创建复合键(使用模板字符串生成唯一标识)
|
|
|
const key = `${mx.itemname}|${mx.bj_pzname}|${mx.bj_pzname_mx}`;
|
|
|
|
|
@@ -1935,6 +1975,8 @@ export const useHooks = (t?: any) => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ $table.reloadData(visibleData);
|
|
|
}
|
|
|
// state.mattressQDList = res.mxList;
|
|
|
|