|
|
@@ -336,7 +336,7 @@ $(document).ready(() => {
|
|
|
// 未改变值则不提交
|
|
|
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 === ''))) {
|
|
|
+ if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === '' || validText === null))) {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
}
|
|
|
@@ -379,7 +379,8 @@ $(document).ready(() => {
|
|
|
validText = ZhCalc.round(num, 3);
|
|
|
num = ZhCalc.round(num, 3);
|
|
|
}
|
|
|
- const total_weight = showStageExponent || exponent_nodes ? ZhCalc.add(ZhCalc.sub(ZhCalc.sum(_.map(materialExponentShardData, 'weight_num')), parseFloat(orgValue)), num) : ZhCalc.add(ZhCalc.sub(ZhCalc.sum(_.map(materialExponentData, 'weight_num')), parseFloat(orgValue)), num);
|
|
|
+ const weight_datas = showStageExponent || exponent_nodes ? _.filter(materialExponentShardData, { ms_id: parseInt($('#myTab').find('.active').attr('data-msid')) || null, mn_id: parseInt($('#myTab2').find('.active').attr('data-mnid')) || null }) : materialExponentData;
|
|
|
+ const total_weight = ZhCalc.add(ZhCalc.sub(ZhCalc.sum(_.map(weight_datas, 'weight_num')), parseFloat(orgValue)), num);
|
|
|
if (total_weight > 1) {
|
|
|
toastr.error('加权系数总和不能大于1');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
@@ -591,7 +592,8 @@ $(document).ready(() => {
|
|
|
validText = ZhCalc.round(num, 3);
|
|
|
num = ZhCalc.round(num, 3);
|
|
|
}
|
|
|
- const total_weight = showStageExponent || exponent_nodes ? ZhCalc.add(ZhCalc.sub(ZhCalc.sum(_.map(materialExponentShardData, 'weight_num')), parseFloat(orgValue)), num) : ZhCalc.add(ZhCalc.sub(ZhCalc.sum(_.map(materialExponentData, 'weight_num')), parseFloat(orgValue)), num);
|
|
|
+ const weight_datas = showStageExponent || exponent_nodes ? _.filter(materialExponentShardData, { ms_id: parseInt($('#myTab').find('.active').attr('data-msid')) || null, mn_id: parseInt($('#myTab2').find('.active').attr('data-mnid')) || null }) : materialExponentData;
|
|
|
+ const total_weight = ZhCalc.add(ZhCalc.sub(ZhCalc.sum(_.map(weight_datas, 'weight_num')), parseFloat(orgValue)), num);
|
|
|
if (total_weight > 1) {
|
|
|
toastMessageUniq(getPasteHint(hint.weightNumberCan, hintRow));
|
|
|
bPaste = false;
|