|
@@ -203,7 +203,7 @@ $(function () {
|
|
|
if (info.sheet.zh_setting) {
|
|
|
const select = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
const col = info.sheet.zh_setting.cols[info.col];
|
|
|
- const validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : null);
|
|
|
+ let validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : null);
|
|
|
const orgValue = select[col.field];
|
|
|
if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
@@ -220,23 +220,25 @@ $(function () {
|
|
|
let plan_tp = 0;
|
|
|
// 判断输入位数,提示
|
|
|
if (mode === 'tp') {
|
|
|
- const reg = new RegExp('^([-]?)\\d+(\\.\\d{0,'+ parseInt(tenderInfo.decimal.tp) +'})?$');
|
|
|
+ const reg = new RegExp('^([-]?)\\d+$');
|
|
|
if (validText !== null && (!reg.test(validText))) {
|
|
|
- toastr.error('输入金额小数位数不能大于' + tenderInfo.decimal.tp + '位');
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
- return;
|
|
|
+ // toastr.error('输入金额请为整数');
|
|
|
+ // SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
+ // return;
|
|
|
+ validText = ZhCalc.round(validText, 0);
|
|
|
}
|
|
|
- plan_gcl = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.div(validText, select.dgn_price), tenderInfo.decimal.up) : 0;
|
|
|
+ plan_gcl = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.div(validText, select.dgn_price), 3) : 0;
|
|
|
plan_tp = validText;
|
|
|
} else {
|
|
|
- const reg = new RegExp('^([-]?)\\d+(\\.\\d{0,'+ parseInt(tenderInfo.decimal.up) +'})?$');
|
|
|
+ const reg = new RegExp('^([-]?)\\d+$');
|
|
|
if (validText !== null && (!reg.test(validText))) {
|
|
|
- toastr.error('输入工程量小数位数不能大于' + tenderInfo.decimal.up + '位');
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
- return;
|
|
|
+ // toastr.error('输入工程量小数位数不能大于3位');
|
|
|
+ // SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
+ // return;
|
|
|
+ validText = ZhCalc.round(validText, 3);
|
|
|
}
|
|
|
plan_gcl = validText;
|
|
|
- plan_tp = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(validText, select.dgn_price), tenderInfo.decimal.tp) : 0;
|
|
|
+ plan_tp = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(validText, select.dgn_price), 0) : 0;
|
|
|
}
|
|
|
select[col.field] = validText;
|
|
|
const updateData = {
|
|
@@ -280,7 +282,7 @@ $(function () {
|
|
|
}
|
|
|
const select = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
const col = info.sheet.zh_setting.cols[range.col];
|
|
|
- const validText = is_numeric(info.pasteData.text) ? parseFloat(info.pasteData.text) : (info.pasteData.text ? trimInvalidChar(info.pasteData.text) : null);
|
|
|
+ let validText = is_numeric(info.pasteData.text) ? parseFloat(info.pasteData.text) : (info.pasteData.text ? trimInvalidChar(info.pasteData.text) : null);
|
|
|
const orgValue = select[col.field];
|
|
|
if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
@@ -297,23 +299,26 @@ $(function () {
|
|
|
let plan_tp = 0;
|
|
|
// 判断输入位数,提示
|
|
|
if (mode === 'tp') {
|
|
|
- const reg = new RegExp('^([-]?)\\d+(\\.\\d{0,'+ parseInt(tenderInfo.decimal.tp) +'})?$');
|
|
|
+ const reg = new RegExp('^([-]?)\\d+$');
|
|
|
if (validText !== null && (!reg.test(validText))) {
|
|
|
- toastr.error('粘贴的金额小数位数不能大于' + tenderInfo.decimal.tp + '位');
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
- return;
|
|
|
+ // toastr.error('粘贴的金额小数位数不能大于0位');
|
|
|
+ // SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
+ // return;
|
|
|
+ validText = ZhCalc.round(validText, 0);
|
|
|
}
|
|
|
- plan_gcl = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.div(validText, select.dgn_price), tenderInfo.decimal.up) : 0;
|
|
|
+ plan_gcl = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.div(validText, select.dgn_price), 3) : 0;
|
|
|
plan_tp = validText;
|
|
|
} else {
|
|
|
- const reg = new RegExp('^([-]?)\\d+(\\.\\d{0,'+ parseInt(tenderInfo.decimal.up) +'})?$');
|
|
|
+ // const reg = new RegExp('^([-]?)\\d+(\\.\\d{0,3})?$');
|
|
|
+ const reg = new RegExp('^([-]?)\\d+$');
|
|
|
if (validText !== null && (!reg.test(validText))) {
|
|
|
- toastr.error('粘贴的工程量小数位数不能大于' + tenderInfo.decimal.up + '位');
|
|
|
- SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
- return;
|
|
|
+ // toastr.error('粘贴的工程量小数位数不能大于3位');
|
|
|
+ // SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
+ // return;
|
|
|
+ validText = ZhCalc.round(validText, 3);
|
|
|
}
|
|
|
plan_gcl = validText;
|
|
|
- plan_tp = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(validText, select.dgn_price), tenderInfo.decimal.tp) : 0;
|
|
|
+ plan_tp = select.dgn_price && select.dgn_price !== 0 ? ZhCalc.round(ZhCalc.mul(validText, select.dgn_price), 0) : 0;
|
|
|
}
|
|
|
select[col.field] = validText;
|
|
|
const updateData = {
|