|
@@ -1044,6 +1044,11 @@ $(document).ready(() => {
|
|
|
} else if (!posData) {
|
|
|
if (newText !== '') {
|
|
|
data.updateType = 'add';
|
|
|
+ if ((node.pre_used === 1 || !checkZero(node.gather_qty) || !checkZero(node.gather_tp)) && sortData.length === 0) {
|
|
|
+ toastr.error('无计量单元的清单,计量后,不可新增计量单元');
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
+ return;
|
|
|
+ }
|
|
|
const order = (!sortData || sortData.length === 0) ? 1 : Math.max(sortData[sortData.length - 1].porder + 1, sortData.length + 1);
|
|
|
data.updateData = {name: newText, lid: node.id, tid: tender.id, porder: order};
|
|
|
} else {
|
|
@@ -1128,7 +1133,6 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
clipboardPasted: function (e, info) {
|
|
|
- const self = this;
|
|
|
if (info.sheet.zh_setting) {
|
|
|
const data = { updateType: '', updateData: [], };
|
|
|
const sortData = info.sheet.zh_data;
|
|
@@ -1137,7 +1141,12 @@ $(document).ready(() => {
|
|
|
data.updateType = 'add';
|
|
|
if (info.cellRange.col !== 0) {
|
|
|
toastr.warning('新增部位请先输入名称');
|
|
|
- self.loadCurPosData();
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ((node.pre_used === 1 || !checkZero(node.gather_qty) || !checkZero(node.gather_tp)) && sortData.length === 0) {
|
|
|
+ toastr.error('无计量单元的清单,计量后,不可新增计量单元');
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
return;
|
|
|
}
|
|
|
const lastOrder = sortData.length > 0 ? sortData[sortData.length - 1].porder + 1 : 1;
|
|
@@ -1157,7 +1166,7 @@ $(document).ready(() => {
|
|
|
newData[colSetting.field] = math.evaluate(transExpr(newData[colSetting.field]));
|
|
|
} catch(err) {
|
|
|
toastr.error('输入的表达式非法');
|
|
|
- self.loadCurPosData();
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
return;
|
|
|
|
|
|
}
|
|
@@ -1186,7 +1195,7 @@ $(document).ready(() => {
|
|
|
newData[colSetting.field] = math.evaluate(transExpr(newData[colSetting.field]));
|
|
|
} catch(err) {
|
|
|
toastr.error('输入的表达式非法');
|
|
|
- self.loadCurPosData();
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
return;
|
|
|
}
|
|
|
}
|