فهرست منبع

1. 工程量清单,合并规则调整
2. 调用变更令,调整

MaiXinRong 4 سال پیش
والد
کامیت
70ee9d8e7d
2فایلهای تغییر یافته به همراه10 افزوده شده و 9 حذف شده
  1. 4 1
      app/public/js/gcl_gather.js
  2. 6 8
      app/public/js/stage.js

+ 4 - 1
app/public/js/gcl_gather.js

@@ -103,7 +103,10 @@ const gclGatherModel = (function () {
      */
     function getGclNode(node) {
         const gcl = gclList.find(function (g) {
-            return g.b_code === node.b_code && g.name === node.name && g.unit === node.unit && checkZero(g.unit_price - node.unit_price);
+            return g.b_code === node.b_code &&
+                (g.name || node.name ? g.name === node.name : true) &&
+                (g.unit || node.unit ? g.unit === node.unit : true) &&
+                checkZero(ZhCalc.sub(g.unit_price, node.unit_price));
         });
         if (gcl) {
             return gcl

+ 6 - 8
app/public/js/stage.js

@@ -320,14 +320,12 @@ $(document).ready(() => {
                 for (const c of self.displayChanges) {
                     if (c.uamount) {
                         const vamount = (!c.vamount || checkZero(c.vamount)) ? 0 : c.vamount;
-                        if (vamount > 0 && c.uamount < 0) {
-                            toastr.error('变更令:' + c.code + ' 下,请勿进行负变更');
-                            return;
-                        } else if (vamount < 0 && c.uamount > 0) {
-                            toastr.error('变更令:' + c.code + ' 下,请勿进行正变更');
-                            return;
-                        }
-                        if ((vamount > 0 && c.uamount > vamount) || (vamount < 0 && c.uamount < vamount)) {
+                        if (vamount === 0) {
+                            if ((c.b_amount > 0 && c.uamount > c.b_amount) || (c.b_amount < 0 && c.uamount < b_amount)) {
+                                toastr.error('变更令:' + c.code + ' 超计,请修改本期计量后,再提交');
+                                return;
+                            }
+                        } else if ((vamount > 0 && c.uamount > vamount) || (vamount < 0 && c.uamount < vamount)) {
                             toastr.error('变更令:' + c.code + ' 超计,请修改本期计量后,再提交');
                             return;
                         }