|
@@ -9,7 +9,8 @@
|
|
|
*/
|
|
|
|
|
|
const stageIm = (function () {
|
|
|
- const imFields = ['uuid', 'doc_code', 'peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'calc_img', 'calc_img_org','calc_img_remark', 'position', 'jldy'];
|
|
|
+ const imFields = ['uuid', 'peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'position', 'jldy'];
|
|
|
+ const resetFields = ['peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'position', 'jldy'];
|
|
|
const splitChar = '-';
|
|
|
const mergeChar = ';';
|
|
|
let stage, imType, decimal, details, changes, ImData, pre;
|
|
@@ -254,10 +255,19 @@ const stageIm = (function () {
|
|
|
}
|
|
|
|
|
|
function loadCustomDetail(im, detail) {
|
|
|
+ if (!im.org) {
|
|
|
+ im.org = {};
|
|
|
+ for (const f of resetFields) {
|
|
|
+ im.org[f] = im[f];
|
|
|
+ }
|
|
|
+ }
|
|
|
im.custom_define = detail.custom_define ? detail.custom_define.split(',') : imFields;
|
|
|
_.assignInWith(im, detail, function (oV, sV, key) {
|
|
|
- return (im.custom_define.indexOf(key) > -1 && sV !== undefined && sV !== null) ? sV : oV;
|
|
|
+ return (im.custom_define.indexOf(key) > -1) ? sV : ((resetFields.indexOf(key) > -1) ? im.org[key] : oV);
|
|
|
});
|
|
|
+ im.uuid = detail.uuid;
|
|
|
+ im.doc_code = detail.doc_code;
|
|
|
+ im.calc_img = detail.calc_img;
|
|
|
im.calc_img_org = detail.calc_img_org;
|
|
|
im.calc_img_remark = detail.calc_img_remark;
|
|
|
}
|
|
@@ -867,8 +877,8 @@ const stageIm = (function () {
|
|
|
for (const d of datas) {
|
|
|
const detail = _.find(details, {uuid: d.uuid});
|
|
|
if (detail) {
|
|
|
- _.assignInWith(detail, d, function (oV, sV, key) {
|
|
|
- return imFields.indexOf(key) > -1 && !_.isUndefined(sV) && !_.isNull(sV) ? sV : oV;
|
|
|
+ _.assignInWith(detail, d, function (oV, sV) {
|
|
|
+ return !_.isUndefined(sV) ? sV : oV;
|
|
|
});
|
|
|
detail.custom_define = d.custom_define;
|
|
|
} else {
|
|
@@ -988,5 +998,6 @@ const stageIm = (function () {
|
|
|
getFirstUsed: getFirstUsed,
|
|
|
getRelaXmj: getRelaXmj,
|
|
|
getRelaImData: getRelaImData,
|
|
|
+ resetFields,
|
|
|
}
|
|
|
})();
|