|
@@ -162,13 +162,13 @@ $(document).ready(function() {
|
|
spread.bind(spreadNS.Events.EditEnded, function (e, info) {
|
|
spread.bind(spreadNS.Events.EditEnded, function (e, info) {
|
|
const value = _.toNumber(info.editingText);
|
|
const value = _.toNumber(info.editingText);
|
|
if (!_.isInteger(value)) {
|
|
if (!_.isInteger(value)) {
|
|
- toast('请输入0-6的整数', 'warning');
|
|
|
|
|
|
+ toastr.warning('请输入0-6的整数');
|
|
sheet.setText(info.row, info.col, '0');
|
|
sheet.setText(info.row, info.col, '0');
|
|
} else if (value > 6) {
|
|
} else if (value > 6) {
|
|
- toast('请输入0-6的整数', 'warning');
|
|
|
|
|
|
+ toastr.warning('请输入0-6的整数');
|
|
sheet.setText(info.row, info.col, '6');
|
|
sheet.setText(info.row, info.col, '6');
|
|
} else if (value < 0) {
|
|
} else if (value < 0) {
|
|
- toast('请输入0-6的整数', 'warning');
|
|
|
|
|
|
+ toastr.warning('请输入0-6的整数');
|
|
sheet.setText(info.row, info.col, '0');
|
|
sheet.setText(info.row, info.col, '0');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -208,7 +208,7 @@ $(document).ready(function() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (bHint) {
|
|
if (bHint) {
|
|
- toast('请输入0-6的整数', 'warning');
|
|
|
|
|
|
+ toastr.warning('请输入0-6的整数');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -248,8 +248,21 @@ $(document).ready(function() {
|
|
precision.other.value = _.toNumber(sheet.getText(13, 2));
|
|
precision.other.value = _.toNumber(sheet.getText(13, 2));
|
|
return precision;
|
|
return precision;
|
|
}
|
|
}
|
|
|
|
+ function checkPrecisionMinLimit(precision, limit) {
|
|
|
|
+ for (const unit of precision) {
|
|
|
|
+ if (precision[unit].value < limit[unit].value) {
|
|
|
|
+ if (precision[unit].unit) {
|
|
|
|
+ toastr.warning('台账已审批通过,清单精度不可减少,单位为' + limit[unit].unit + '的清单的精度不可小于' + limit[unit].value);
|
|
|
|
+ } else {
|
|
|
|
+ toastr.warning('台账已审批通过,清单精度不可减少,其他清单的精度不可小于' + limit[unit].value);
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ };
|
|
|
|
|
|
- return {loadPrecisonProperty, setReadOnly, getNewPrecisionData, };
|
|
|
|
|
|
+ return {loadPrecisonProperty, setReadOnly, getNewPrecisionData, checkPrecisionMinLimit};
|
|
})();
|
|
})();
|
|
// 合同参数
|
|
// 合同参数
|
|
const dealObj = (function () {
|
|
const dealObj = (function () {
|
|
@@ -290,10 +303,10 @@ $(document).ready(function() {
|
|
spread.bind(spreadNS.Events.EditEnded, function (e, info) {
|
|
spread.bind(spreadNS.Events.EditEnded, function (e, info) {
|
|
const value = _.toNumber(info.editingText);
|
|
const value = _.toNumber(info.editingText);
|
|
if (_.isNaN(value)) {
|
|
if (_.isNaN(value)) {
|
|
- toast('请输入不超过万亿的数字', 'warning');
|
|
|
|
|
|
+ toastr.warning('请输入不超过万亿的数字');
|
|
info.sheet.setText(info.row, info.col, '0');
|
|
info.sheet.setText(info.row, info.col, '0');
|
|
} else if (value > Math.pow(10, 13)) {
|
|
} else if (value > Math.pow(10, 13)) {
|
|
- toast('请输入不超过万亿的数字', 'warning');
|
|
|
|
|
|
+ toastr.warning('请输入不超过万亿的数字');
|
|
info.sheet.setText(info.row, info.col, '0');
|
|
info.sheet.setText(info.row, info.col, '0');
|
|
}
|
|
}
|
|
if (info.row === 1 || info.row === 2) {
|
|
if (info.row === 1 || info.row === 2) {
|
|
@@ -329,7 +342,7 @@ $(document).ready(function() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (bHint) {
|
|
if (bHint) {
|
|
- toast('请输入不超过万亿的数字', 'warning');
|
|
|
|
|
|
+ toastr.warning('请输入不超过万亿的数字');
|
|
}
|
|
}
|
|
calcHtjMinusZlj();
|
|
calcHtjMinusZlj();
|
|
});
|
|
});
|
|
@@ -549,13 +562,41 @@ $(document).ready(function() {
|
|
payTp: _.toNumber($('#decimal-pay-tp').val()),
|
|
payTp: _.toNumber($('#decimal-pay-tp').val()),
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+ if (ledgerChecked) {
|
|
|
|
+ if (prop.decimal.up < property.decimal.up) {
|
|
|
|
+ toastr.warning('台账已审批完成,单价的小数位数,不可小于' + property.decimal.up);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (prop.decimal.tp < property.decimal.tp) {
|
|
|
|
+ toastr.warning('台账已审批完成,金额的小数位数,不可小于' + property.decimal.tp);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (firstStageChecked) {
|
|
|
|
+ if (property.decimal.pay) {
|
|
|
|
+ if (!prop.decimal.pay) {
|
|
|
|
+ toastr.warning('第一期已审批完成,不可取消合同支付单独设置');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (prop.decimal.payTp < property.decimal.payTp) {
|
|
|
|
+ toastr.warning('第一期已审批完成,单独设置的合同支付小数位数,不可小于' + property.decimal.payTp);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (prop.decimal.pay) {
|
|
|
|
+ toastr.warning('第一期已审批完成,合同支付不可单独设置');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ledgerChecked && !precisionObj.checkPrecisionMinLimit(prop.decimal, property.decimal)) return;
|
|
const tenderId = window.location.pathname.split('/')[2];
|
|
const tenderId = window.location.pathname.split('/')[2];
|
|
postData('/tender/' + tenderId + '/save', prop, function (data) {
|
|
postData('/tender/' + tenderId + '/save', prop, function (data) {
|
|
setReadOnly('#v-pills-2', true);
|
|
setReadOnly('#v-pills-2', true);
|
|
property.decimal = data.decimal;
|
|
property.decimal = data.decimal;
|
|
$('#post-2').parent().hide();
|
|
$('#post-2').parent().hide();
|
|
$('#edit-2').parent().show();
|
|
$('#edit-2').parent().show();
|
|
- });
|
|
|
|
|
|
+ }, null, true);
|
|
});
|
|
});
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -577,13 +618,14 @@ $(document).ready(function() {
|
|
// 提交
|
|
// 提交
|
|
$('#post-3').click(() => {
|
|
$('#post-3').click(() => {
|
|
const prop = { precision: precisionObj.getNewPrecisionData() };
|
|
const prop = { precision: precisionObj.getNewPrecisionData() };
|
|
|
|
+ if (ledgerChecked && !precisionObj.checkPrecisionMinLimit(prop.precision, property.precision)) return;
|
|
const tenderId = window.location.pathname.split('/')[2];
|
|
const tenderId = window.location.pathname.split('/')[2];
|
|
postData('/tender/' + tenderId + '/save', prop, function (data) {
|
|
postData('/tender/' + tenderId + '/save', prop, function (data) {
|
|
precisionObj.setReadOnly(true);
|
|
precisionObj.setReadOnly(true);
|
|
property.precision = data.precision;
|
|
property.precision = data.precision;
|
|
$('#post-3').parent().hide();
|
|
$('#post-3').parent().hide();
|
|
$('#edit-3').parent().show();
|
|
$('#edit-3').parent().show();
|
|
- });
|
|
|
|
|
|
+ }, null, true);
|
|
});
|
|
});
|
|
|
|
|
|
/**
|
|
/**
|