|
@@ -835,7 +835,7 @@ $(document).ready(() => {
|
|
const color = notx === undefined ? '' : '#d6d8db';
|
|
const color = notx === undefined ? '' : '#d6d8db';
|
|
// leafXmjSheet.getRange(iRow, -1, 1, -1).backColor(color);
|
|
// leafXmjSheet.getRange(iRow, -1, 1, -1).backColor(color);
|
|
const notx2 = findNotChangeLeafXmj(x);
|
|
const notx2 = findNotChangeLeafXmj(x);
|
|
- const color2 = notx2 === undefined ? color : '#FFE699';
|
|
|
|
|
|
+ const color2 = notx2 === undefined || materialQtySource === qtySourceValueConst.contract_qty ? color : '#FFE699';
|
|
leafXmjSheet.getRange(iRow, -1, 1, -1).backColor(color2);
|
|
leafXmjSheet.getRange(iRow, -1, 1, -1).backColor(color2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -893,7 +893,7 @@ $(document).ready(() => {
|
|
qc_qty: xmj.qc_qty,
|
|
qc_qty: xmj.qc_qty,
|
|
qc_minus_qty: xmj.qc_minus_qty,
|
|
qc_minus_qty: xmj.qc_minus_qty,
|
|
gather_qty: xmj.gather_qty,
|
|
gather_qty: xmj.gather_qty,
|
|
- is_join: notx === undefined ? 1 : 0,
|
|
|
|
|
|
+ is_join: notx !== undefined ? 0 : notx2 !== undefined ? 2 : 1,
|
|
};
|
|
};
|
|
if (ms_id) data.ms_id = ms_id;
|
|
if (ms_id) data.ms_id = ms_id;
|
|
datas.push(data);
|
|
datas.push(data);
|
|
@@ -920,7 +920,7 @@ $(document).ready(() => {
|
|
qc_qty: xmj.qc_qty,
|
|
qc_qty: xmj.qc_qty,
|
|
qc_minus_qty: xmj.qc_minus_qty,
|
|
qc_minus_qty: xmj.qc_minus_qty,
|
|
gather_qty: xmj.gather_qty,
|
|
gather_qty: xmj.gather_qty,
|
|
- is_join: notx === undefined ? 1 : 0,
|
|
|
|
|
|
+ is_join: notx !== undefined ? 0 : notx2 !== undefined ? 2 : 1,
|
|
ms_id: ms.id,
|
|
ms_id: ms.id,
|
|
};
|
|
};
|
|
datas.push(data);
|
|
datas.push(data);
|
|
@@ -967,7 +967,7 @@ $(document).ready(() => {
|
|
qc_qty: xmj.qc_qty,
|
|
qc_qty: xmj.qc_qty,
|
|
qc_minus_qty: xmj.qc_minus_qty,
|
|
qc_minus_qty: xmj.qc_minus_qty,
|
|
gather_qty: xmj.gather_qty,
|
|
gather_qty: xmj.gather_qty,
|
|
- is_join: notx === undefined ? 1 : 0,
|
|
|
|
|
|
+ is_join: notx !== undefined ? 0 : notx2 !== undefined ? 2 : 1,
|
|
};
|
|
};
|
|
console.log(data);
|
|
console.log(data);
|
|
postData(window.location.pathname + '/save', {type: 'add', postData: data, ms_id: $('#myTab').find('.active').data('msid') || null }, function (result) {
|
|
postData(window.location.pathname + '/save', {type: 'add', postData: data, ms_id: $('#myTab').find('.active').data('msid') || null }, function (result) {
|
|
@@ -1000,7 +1000,7 @@ $(document).ready(() => {
|
|
const data = {
|
|
const data = {
|
|
type: type,
|
|
type: type,
|
|
select: type === 'join' ? findNotJoinLeafXmj(select) : select,
|
|
select: type === 'join' ? findNotJoinLeafXmj(select) : select,
|
|
- gather_qty: select.gather_qty,
|
|
|
|
|
|
+ // gather_qty: select.gather_qty,
|
|
ms_id: $('#myTab').find('.active').data('msid') || null,
|
|
ms_id: $('#myTab').find('.active').data('msid') || null,
|
|
};
|
|
};
|
|
// 添加到
|
|
// 添加到
|
|
@@ -1027,7 +1027,7 @@ $(document).ready(() => {
|
|
const data = {
|
|
const data = {
|
|
type: type,
|
|
type: type,
|
|
select: type === 'change' ? findNotChangeLeafXmj(select) : select,
|
|
select: type === 'change' ? findNotChangeLeafXmj(select) : select,
|
|
- gather_qty: type === 'change' ? select.gather_qty : select.contract_qty,
|
|
|
|
|
|
+ // gather_qty: type === 'change' ? select.gather_qty : select.contract_qty,
|
|
ms_id: $('#myTab').find('.active').data('msid') || null,
|
|
ms_id: $('#myTab').find('.active').data('msid') || null,
|
|
};
|
|
};
|
|
// 添加到
|
|
// 添加到
|
|
@@ -1065,6 +1065,9 @@ $(document).ready(() => {
|
|
for (const [index, ms] of materialStageData.entries()) {
|
|
for (const [index, ms] of materialStageData.entries()) {
|
|
const gclOther = _.find(gclGatherListData[index], { b_code: gclData.b_code, name: gclData.name, unit: gclData.unit, unit_price: gclData.unit_price });
|
|
const gclOther = _.find(gclGatherListData[index], { b_code: gclData.b_code, name: gclData.name, unit: gclData.unit, unit_price: gclData.unit_price });
|
|
let gather_qty = null;
|
|
let gather_qty = null;
|
|
|
|
+ let contract_qty = null;
|
|
|
|
+ let qc_qty = null;
|
|
|
|
+ let qc_minus_qty = null;
|
|
if (gclOther) {
|
|
if (gclOther) {
|
|
const leafXmjs = gclOther.leafXmjs.filter(item => {
|
|
const leafXmjs = gclOther.leafXmjs.filter(item => {
|
|
return item.qc_qty || item.contract_qty || item.qc_minus_qty
|
|
return item.qc_qty || item.contract_qty || item.qc_minus_qty
|
|
@@ -1072,12 +1075,23 @@ $(document).ready(() => {
|
|
const oneXmj = _.find(leafXmjs, function (item) {
|
|
const oneXmj = _.find(leafXmjs, function (item) {
|
|
return item.gcl_id === select.gcl_id && item.id === select.id && (select.mx_id === undefined || item.mx_id === select.mx_id);
|
|
return item.gcl_id === select.gcl_id && item.id === select.id && (select.mx_id === undefined || item.mx_id === select.mx_id);
|
|
});
|
|
});
|
|
- if (oneXmj) gather_qty = oneXmj.gather_qty;
|
|
|
|
|
|
+ if (oneXmj) {
|
|
|
|
+ gather_qty = oneXmj.gather_qty;
|
|
|
|
+ contract_qty = oneXmj.contract_qty;
|
|
|
|
+ qc_qty = oneXmj.qc_qty;
|
|
|
|
+ qc_minus_qty = oneXmj.qc_minus_qty ? oneXmj.qc_minus_qty : null;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
data.select.gather_qty['ms_id_' + ms.id] = gather_qty;
|
|
data.select.gather_qty['ms_id_' + ms.id] = gather_qty;
|
|
|
|
+ data.select.contract_qty['ms_id_' + ms.id] = contract_qty;
|
|
|
|
+ data.select.qc_qty['ms_id_' + ms.id] = qc_qty;
|
|
|
|
+ data.select.qc_minus_qty['ms_id_' + ms.id] = qc_minus_qty;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
data.select.gather_qty = select.gather_qty ? select.gather_qty : null;
|
|
data.select.gather_qty = select.gather_qty ? select.gather_qty : null;
|
|
|
|
+ data.select.contract_qty = select.contract_qty ? select.contract_qty : null;
|
|
|
|
+ data.select.qc_qty = select.qc_qty ? select.qc_qty : null;
|
|
|
|
+ data.select.qc_minus_qty = select.qc_minus_qty ? select.qc_minus_qty : null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
console.log(data);
|
|
console.log(data);
|
|
@@ -1166,12 +1180,15 @@ $(document).ready(() => {
|
|
if (!select || sel.rowCount !== 1) {
|
|
if (!select || sel.rowCount !== 1) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ if (materialQtySource === qtySourceValueConst.contract_qty) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
const notx = findNotJoinLeafXmj(select);
|
|
const notx = findNotJoinLeafXmj(select);
|
|
if (!(!readOnly && select && notx === undefined)) {
|
|
if (!(!readOnly && select && notx === undefined)) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
const notx2 = findNotChangeLeafXmj(select);
|
|
const notx2 = findNotChangeLeafXmj(select);
|
|
- if (!readOnly && select && notx2 === undefined && materialQtySource !== qtySourceValueConst.contract_qty) {
|
|
|
|
|
|
+ if (!readOnly && select && notx2 === undefined) {
|
|
return true;
|
|
return true;
|
|
} else {
|
|
} else {
|
|
return false;
|
|
return false;
|
|
@@ -1191,6 +1208,9 @@ $(document).ready(() => {
|
|
if (!select || sel.rowCount !== 1) {
|
|
if (!select || sel.rowCount !== 1) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ if (materialQtySource === qtySourceValueConst.contract_qty) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
const notx = findNotJoinLeafXmj(select);
|
|
const notx = findNotJoinLeafXmj(select);
|
|
if (!(!readOnly && select && notx === undefined)) {
|
|
if (!(!readOnly && select && notx === undefined)) {
|
|
return false;
|
|
return false;
|