ソースを参照

Merge remote-tracking branch 'remotes/origin/dev' into uat

MaiXinRong 4 年 前
コミット
76a8101dec

+ 16 - 5
app/public/js/change_information_approval.js

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

+ 13 - 5
app/public/js/change_information_set.js

@@ -277,12 +277,16 @@ $(document).ready(() => {
                     select.oamount = ZhCalc.round(select.oamount, findDecimal(validText)) || 0;
                 }
                 if(col.field === 'camount') {
-                    // 判断是否大于等于限制值,否则无法更改
+                    // 判断是否 正数必须于等于限制值,负数必须小于等于限制值,否则无法更改
                     const usedInfo = _.find(changeUsedData, { id: select.id });
-                    if (usedInfo && validText < usedInfo.used_qty) {
+                    if (usedInfo && usedInfo.used_qty >= 0 && validText < usedInfo.used_qty) {
                         toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.used_qty);
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         return;
+                    } else if (usedInfo && usedInfo.used_qty < 0  && validText > usedInfo.used_qty) {
+                        toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.used_qty);
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
                     }
                     select.spamount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
                 }
@@ -363,12 +367,16 @@ $(document).ready(() => {
                             validText = ZhCalc.round(validText, findDecimal(sortData[curRow].unit)) || 0;
                         }
                         if(colSetting.field === 'camount') {
-                            // 判断是否大于等于限制值,否则无法更改
+                            // 判断是否 正数必须于等于限制值,负数必须小于等于限制值,否则无法更改
                             const usedInfo = _.find(changeUsedData, { id: sortData[curRow].id });
-                            if (usedInfo && validText < usedInfo.used_qty) {
+                            if (usedInfo && usedInfo.used_qty >= 0 && validText < usedInfo.used_qty) {
                                 toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须大于等于已调用值 ' + usedInfo.used_qty : '清单变更数值必须大于等于已调用值 ' + usedInfo.used_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);
+                                bPaste = false;
+                                continue;
                             }
                         }
                     }
@@ -632,7 +640,7 @@ $(document).ready(() => {
                     + '!_!' + (leaf.gcl_id ? leaf.gcl_id : '0') + '!_!' +
                     (bwmx !== '' ? bwmx : leaf.jldy ? leaf.jldy : '') + '*;*' + quantity) !== -1 && isCheck ?
                     'checked' : '';
-                const isUsed = _.find(changeUsedData, { gcl_id: leaf.gcl_id, bwmx: bwmx, oamount: leaf.quantity });
+                const isUsed = _.find(changeUsedData, { gcl_id: leaf.gcl_id, bwmx: (bwmx ? bwmx : leaf.jldy ? leaf.jldy : ''), oamount: leaf.quantity });
                 const isDisabled = isUsed ? 'disabled ' : '';
                 codeHtml += '<tr quantity="' + quantity + '" gcl_id="' + gcl_id + '"><td>' + leaf.code + '</td>' +
                     '<td>' + (leaf.jldy ? leaf.jldy: '') + '</td>' +

+ 1 - 1
app/service/change.js

@@ -167,7 +167,7 @@ module.exports = app => {
         }
 
         async getHaveAuditLastInfo(tenderId) {
-            const sql = 'SELECT * FROM ?? as a LEFT JOIN ?? as b ON a.`cid` = b.`cid` WHERE a.`tid` = ? AND b.`usite` > 0 ORDER BY a.`in_time` DESC';
+            const sql = 'SELECT a.* FROM ?? as a LEFT JOIN ?? as b ON a.`cid` = b.`cid` WHERE a.`tid` = ? AND b.`usite` > 0 ORDER BY a.`in_time` DESC';
             const sqlParam = [this.tableName, this.ctx.service.changeAudit.tableName, tenderId];
             return await this.db.queryOne(sql, sqlParam);
         }

+ 1 - 1
app/service/change_audit_list.js

@@ -230,7 +230,7 @@ module.exports = app => {
                 // 更新stage_change和stage_change_final的cbid
                 if (usedList.length > 0) {
                     const updateList = [];
-                    const sql2 = 'SELECT * FROM ?? WHERE `cid` = ? AND `lid` != 0';
+                    const sql2 = 'SELECT * FROM ?? WHERE `cid` = ? AND `lid` != "0"';
                     const sqlParam2 = [this.tableName, this.ctx.change.cid];
                     const newList = await transaction.query(sql2, sqlParam2);
                     // const newList = await transaction.select(this.tableName, { where: { cid: this.ctx.change.cid } });

+ 2 - 2
app/service/stage_bonus.js

@@ -36,7 +36,7 @@ module.exports = app => {
 
         async getStageData(sid) {
             const data = await this.getAllDataByCondition({where: { sid: sid }});
-            if (this.ctx.stage && this.ctx.stage.readOnly && this.ctx.stage.status !== auditConst.status.checked) {
+            if (this.ctx.stage && this.ctx.stage.readOnly && !this.ctx.tender.isTourist && this.ctx.stage.status !== auditConst.status.checked) {
                 for (const d of data) {
                     const his = d.shistory ? JSON.parse(d.shistory) : [];
                     const h = this.ctx.helper._.find(his, {
@@ -217,4 +217,4 @@ module.exports = app => {
     }
 
     return StageBonus;
-};
+};

+ 1 - 1
app/service/stage_jgcl.js

@@ -24,7 +24,7 @@ module.exports = app => {
 
         async getStageData(stage) {
             const data = await this.getAllDataByCondition({where: { sid: stage.id }});
-            if (stage && stage.readOnly && stage.status !== auditConst.status.checked) {
+            if (stage && stage.readOnly && !this.ctx.tender.isTourist && stage.status !== auditConst.status.checked) {
                 for (const d of data) {
                     const his = d.shistory ? JSON.parse(d.shistory) : [];
                     const h = this.ctx.helper._.find(his, {

+ 1 - 1
app/service/stage_other.js

@@ -24,7 +24,7 @@ module.exports = app => {
 
         async getStageData(stage) {
             const data = await this.getAllDataByCondition({where: { sid: stage.id }});
-            if (stage && stage.readOnly && stage.status !== auditConst.status.checked) {
+            if (stage && stage.readOnly && !this.ctx.tender.isTourist && stage.status !== auditConst.status.checked) {
                 for (const d of data) {
                     const his = d.shistory ? JSON.parse(d.shistory) : [];
                     const h = this.ctx.helper._.find(his, {