Bläddra i källkod

变更已调用值字段名调整

laiguoran 3 år sedan
förälder
incheckning
16e6f6735a

+ 1 - 1
app/controller/change_controller.js

@@ -763,7 +763,7 @@ module.exports = app => {
                     return item.qty !== null;
                 })
                 renderData.changeUsedData = changeUsedData;
-                renderData.stageChangeNum = this.ctx.helper.sum(changeUsedData.map(x => { return Math.abs(x.used_qty); }));
+                renderData.stageChangeNum = this.ctx.helper.sum(changeUsedData.map(x => { return Math.abs(x.qty); }));
                 await this.layout('change/information.ejs', renderData, 'change/information_modal.ejs');
             } catch (err) {
                 this.log(err);

+ 8 - 8
app/public/js/change_information_approval.js

@@ -201,13 +201,13 @@ $(document).ready(() => {
                     validText = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
                     // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
                     const usedInfo = _.find(changeUsedData, { id: select.id });
-                    if (usedInfo && validText >= 0 && validText < usedInfo.used_qty) {
-                        toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.used_qty);
+                    if (usedInfo && validText >= 0 && validText < usedInfo.qty) {
+                        toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
                         return;
-                    } else if (usedInfo && validText < 0 && validText > usedInfo.used_qty) {
-                        toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.used_qty);
+                    } else if (usedInfo && validText < 0 && validText > usedInfo.qty) {
+                        toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
                         return;
@@ -294,14 +294,14 @@ $(document).ready(() => {
                         validText = ZhCalc.round(validText, findDecimal(sortData[curRow].unit)) || 0;
                         // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
                         const usedInfo = _.find(changeUsedData, { id: sortData[curRow].id });
-                        if (usedInfo && usedInfo.used_qty >= 0 && validText < usedInfo.used_qty) {
-                            toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须大于等于已调用值 ' + usedInfo.used_qty : '清单变更数值必须大于等于已调用值 ' + usedInfo.used_qty);
+                        if (usedInfo && usedInfo.qty >= 0 && validText < usedInfo.qty) {
+                            toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须大于等于已调用值 ' + usedInfo.qty : '清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
                             SpreadJsObj.reLoadRowData(info.sheet, curRow);
                             changeSpreadObj.setRowValueAndSum(sortData[curRow], curRow, curCol);
                             bPaste = false;
                             continue;
-                        } else if (usedInfo && usedInfo.used_qty < 0 && validText > usedInfo.used_qty) {
-                            toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须小于等于已调用值 ' + usedInfo.used_qty : '清单变更数值必须小于等于已调用值 ' + usedInfo.used_qty);
+                        } else if (usedInfo && usedInfo.qty < 0 && validText > usedInfo.qty) {
+                            toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须小于等于已调用值 ' + usedInfo.qty : '清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
                             SpreadJsObj.reLoadRowData(info.sheet, curRow);
                             changeSpreadObj.setRowValueAndSum(sortData[curRow], curRow, curCol);
                             bPaste = false;

+ 8 - 8
app/public/js/change_information_set.js

@@ -456,12 +456,12 @@ $(document).ready(() => {
                 if(col.field === 'camount') {
                     // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
                     const usedInfo = _.find(changeUsedData, { cbid: select.id });
-                    if (usedInfo && usedInfo.used_qty >= 0 && validText < usedInfo.used_qty) {
-                        toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.used_qty);
+                    if (usedInfo && usedInfo.qty >= 0 && validText < usedInfo.qty) {
+                        toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         return;
-                    } else if (usedInfo && usedInfo.used_qty < 0  && validText > usedInfo.used_qty) {
-                        toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.used_qty);
+                    } else if (usedInfo && usedInfo.qty < 0  && validText > usedInfo.qty) {
+                        toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         return;
                     }
@@ -546,12 +546,12 @@ $(document).ready(() => {
                         if(colSetting.field === 'camount') {
                             // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
                             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);
+                            if (usedInfo && usedInfo.qty >= 0 && validText < usedInfo.qty) {
+                                toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须大于等于已调用值 ' + usedInfo.qty : '清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
                                 bPaste = false;
                                 continue;
-                            } else if (usedInfo && usedInfo.used_qty < 0 && validText > usedInfo.used_qty) {
-                                toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须小于等于已调用值 ' + usedInfo.used_qty : '清单变更数值必须小于等于已调用值 ' + usedInfo.used_qty);
+                            } else if (usedInfo && usedInfo.qty < 0 && validText > usedInfo.qty) {
+                                toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须小于等于已调用值 ' + usedInfo.qty : '清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
                                 bPaste = false;
                                 continue;
                             }