|
@@ -154,7 +154,7 @@ $(document).ready(() => {
|
|
|
return ZhCalc.round(data.camount, findDecimal(data.unit));
|
|
|
},
|
|
|
del_list: function (data) {
|
|
|
- return !_.find(changeUsedData, { id: data.id }) ? '移除' : '';
|
|
|
+ return !_.find(changeUsedData, { cbid: data.id }) ? '移除' : '';
|
|
|
}
|
|
|
},
|
|
|
readOnly: {
|
|
@@ -162,7 +162,7 @@ $(document).ready(() => {
|
|
|
return !readOnly && data.lid != 0;
|
|
|
},
|
|
|
isEdit2: function (data) {
|
|
|
- return !readOnly && (data.lid != 0 || (data.lid == 0 && _.findIndex(changeUsedData, { id: data.id }) !== -1));
|
|
|
+ return !readOnly && (data.lid != 0 || (data.lid == 0 && _.findIndex(changeUsedData, { cbid: data.id }) !== -1));
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -211,7 +211,7 @@ $(document).ready(() => {
|
|
|
del: function () {
|
|
|
const select = SpreadJsObj.getSelectObject(changeSpreadSheet);
|
|
|
const index = changeList.indexOf(select);
|
|
|
- if (index > -1 && !_.find(changeUsedData, { id: select.id })) {
|
|
|
+ if (index > -1 && !_.find(changeUsedData, { cbid: select.id })) {
|
|
|
postData(window.location.pathname + '/save', {type: 'del', id: select.id}, function (result) {
|
|
|
changeList.splice(index, 1);
|
|
|
changeSpreadSheet.deleteRows(index, 1);
|
|
@@ -240,7 +240,7 @@ $(document).ready(() => {
|
|
|
const sel = info.sheet.getSelections()[0];
|
|
|
const col = info.sheet.zh_setting.cols[sel.col];
|
|
|
const data = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
- if (col && col.field === 'del_list' && !_.find(changeUsedData, { id: data.id })) {
|
|
|
+ if (col && col.field === 'del_list' && !_.find(changeUsedData, { cbid: data.id })) {
|
|
|
changeSpreadObj.del();
|
|
|
}
|
|
|
changeSpreadObj.resetXmjSpread(data);
|
|
@@ -281,7 +281,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if(col.field === 'camount') {
|
|
|
// 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
|
|
|
- const usedInfo = _.find(changeUsedData, { id: select.id });
|
|
|
+ const usedInfo = _.find(changeUsedData, { cbid: select.id });
|
|
|
if (usedInfo && usedInfo.used_qty >= 0 && validText < usedInfo.used_qty) {
|
|
|
toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.used_qty);
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
@@ -371,7 +371,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if(colSetting.field === 'camount') {
|
|
|
// 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
|
|
|
- const usedInfo = _.find(changeUsedData, { id: sortData[curRow].id });
|
|
|
+ const usedInfo = _.find(changeUsedData, { cbid: sortData[curRow].id });
|
|
|
if (usedInfo && usedInfo.used_qty >= 0 && validText < usedInfo.used_qty) {
|
|
|
toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须大于等于已调用值 ' + usedInfo.used_qty : '清单变更数值必须大于等于已调用值 ' + usedInfo.used_qty);
|
|
|
bPaste = false;
|
|
@@ -619,7 +619,7 @@ $(document).ready(() => {
|
|
|
const sel = changeSpreadSheet.getSelections()[0];
|
|
|
changeSpreadObj.resetXmjSpread(select);
|
|
|
// console.log(select, sel);
|
|
|
- if (!readOnly && select && sel.row !== changeSpreadSheet.getRowCount() - 1 && !_.find(changeUsedData, { id: select.id })) {
|
|
|
+ if (!readOnly && select && sel.row !== changeSpreadSheet.getRowCount() - 1 && !_.find(changeUsedData, { cbid: select.id })) {
|
|
|
return false;
|
|
|
} else {
|
|
|
return true;
|
|
@@ -659,7 +659,8 @@ $(document).ready(() => {
|
|
|
+ '!_!' + (leaf.gcl_id ? leaf.gcl_id : '0') + '!_!' + (leaf.mx_id ? leaf.mx_id : '') + '!_!' +
|
|
|
(bwmx !== undefined ? bwmx : leaf.jldy ? leaf.jldy : '') + '*;*' + quantity) !== -1 && isCheck ?
|
|
|
'checked' : '';
|
|
|
- const isUsed = _.find(changeUsedData, { gcl_id: leaf.gcl_id, bwmx: (bwmx ? bwmx : leaf.jldy ? leaf.jldy : ''), oamount: leaf.quantity });
|
|
|
+ const existGcl = _.find(changeList, {gcl_id: leaf.gcl_id, bwmx: (bwmx ? bwmx : leaf.jldy ? leaf.jldy : ''), oamount: leaf.quantity});
|
|
|
+ const isUsed = existGcl ? _.find(changeUsedData, { cbid: existGcl.id }) : null;
|
|
|
const isDisabled = isUsed ? 'disabled ' : '';
|
|
|
codeHtml += '<tr quantity="' + quantity + '" gcl_id="' + gcl_id + '" mx_id="' + mx_id + '">' +
|
|
|
'<td class="text-center">' + (index+1) + (leaf.cid ? '<i class="text-danger" style="font-weight: 900">*</i>' : '') + '</td>' +
|