ソースを参照

新增标段属性

MaiXinRong 1 年間 前
コミット
32d781680e

+ 7 - 0
app/const/tender_info.js

@@ -28,6 +28,11 @@ const defaultInfo = {
             corporation: '',
             date: '',
         },
+        sub_build: {
+            company: '',
+            corporation: '',
+            date: '',
+        },
         contract1: {
             company: '',
             corporation: '',
@@ -73,6 +78,7 @@ const defaultInfo = {
         realStartDate: '',
         realEndDate: '',
         structureScale: '',
+        mainContent: '',
     },
     bid_info: {
         controlPrice: 0,
@@ -80,6 +86,7 @@ const defaultInfo = {
         bidStartDate: '',
         bidType: '公开招标',
         dealCalcType: '单价合同',
+        bidYuPrice: 0,
     },
     // 小数位数
     decimal: {

+ 4 - 4
app/lib/analysis_excel.js

@@ -439,8 +439,8 @@ class ImportStd18Tree extends ImportBaseTree {
      * @returns {*}
      */
     findXmjParent(code) {
-        if (aeUtils.check18MainCode(code)) {
-        // if (code.match(mainReg)) {
+        //if (aeUtils.check18MainCode(code)) {
+        if (code.match(mainReg)) {
             if (!this.cacheMainXmjNode) throw '主表项目节找不到父项';
             return this.findMainXmjParent(code);
         } else if (code.match(subReg)) {
@@ -456,8 +456,8 @@ class ImportStd18Tree extends ImportBaseTree {
     defineCacheData(node) {
         super.defineCacheData(node);
         if (node.code) {
-            if (aeUtils.check18MainCode(node.code)) {
-            //if (node.code.match(mainReg)) {
+            //if (aeUtils.check18MainCode(node.code)) {
+            if (node.code.match(mainReg)) {
                 node.is_main = true;
                 this.cacheMainXmjNode = node;
                 this.cacheSubXmjNode = null;

+ 18 - 6
app/lib/budget_final.js

@@ -211,6 +211,9 @@ class BudgetFinal {
 
     async _afterLoad() {
         const helper = this.ctx.helper;
+        const checkGaiExist = !!this.finalTree.find(x => {
+            if (x.gai_tp || x.gai_dgn_qty1 || x.gai_dgn_qty2 || x.gai_dgn_price || x.gai_dgn_qty) return true;
+        });
         this.finalTree.afterLoad(node => {
             node.dgn_price = helper.div(node.total_price, node.dgn_qty1, 2);
             node.dgn_qty = node.dgn_qty1
@@ -238,12 +241,21 @@ class BudgetFinal {
             node.final_dgn_qty = node.final_dgn_qty1
                 ? (node.final_dgn_qty2 ? node.final_dgn_qty1 + '/' + node.final_dgn_qty2 : node.final_dgn_qty1)
                 : (node.final_dgn_qty2 ? '/' + node.final_dgn_qty2 : '');
-            node.grow_dgn_qty1 = helper.mul(helper.div(helper.sub(node.final_dgn_qty1, node.gai_dgn_qty1), node.gai_dgn_qty1, 4), 100);
-            node.grow_dgn_qty2 = helper.mul(helper.div(helper.sub(node.final_dgn_qty2, node.gai_dgn_qty2), node.gai_dgn_qty2, 4), 100);
-            node.grow_dgn_qty = node.grow_dgn_qty1
-                ? (node.grow_dgn_qty2 ? node.grow_dgn_qty1 + '/' + node.grow_dgn_qty2 : node.grow_dgn_qty1)
-                : (node.grow_dgn_qty2 ? '/' + node.grow_dgn_qty2 : '');
-            node.grow_tp = helper.mul(helper.div(helper.sub(node.final_tp, node.gai_tp), node.gai_tp, 4), 100);
+            if (checkGaiExist) {
+                node.grow_dgn_qty1 = helper.mul(helper.div(helper.sub(node.final_dgn_qty1, node.gai_dgn_qty1), node.gai_dgn_qty1, 4), 100);
+                node.grow_dgn_qty2 = helper.mul(helper.div(helper.sub(node.final_dgn_qty2, node.gai_dgn_qty2), node.gai_dgn_qty2, 4), 100);
+                node.grow_dgn_qty = node.grow_dgn_qty1
+                    ? (node.grow_dgn_qty2 ? node.grow_dgn_qty1 + '/' + node.grow_dgn_qty2 : node.grow_dgn_qty1)
+                    : (node.grow_dgn_qty2 ? '/' + node.grow_dgn_qty2 : '');
+                node.grow_tp = helper.mul(helper.div(helper.sub(node.final_tp, node.gai_tp), node.gai_tp, 4), 100);
+            } else {
+                node.grow_dgn_qty1 = helper.mul(helper.div(helper.sub(node.final_dgn_qty1, node.yu_dgn_qty1), node.yu_dgn_qty1, 4), 100);
+                node.grow_dgn_qty2 = helper.mul(helper.div(helper.sub(node.final_dgn_qty2, node.yu_dgn_qty2), node.yu_dgn_qty2, 4), 100);
+                node.grow_dgn_qty = node.grow_dgn_qty1
+                    ? (node.grow_dgn_qty2 ? node.grow_dgn_qty1 + '/' + node.grow_dgn_qty2 : node.grow_dgn_qty1)
+                    : (node.grow_dgn_qty2 ? '/' + node.grow_dgn_qty2 : '');
+                node.grow_tp = helper.mul(helper.div(helper.sub(node.final_tp, node.yu_tp), node.yu_tp, 4), 100);
+            }
         });
         this.finalTree.resortChildrenByCustom(function (x, y) {
             const iCode = helper.compareCode(x.code, y.code);

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

@@ -325,7 +325,7 @@ const gclGatherModel = (function () {
         for (const node of nodes) {
             if (node.b_code) {
                 if (node.children.length > 0) {
-                    const gcl = getGclNode(node);
+                    // const gcl = getGclNode(node);
                     recursiveGatherGclData(node.children, leafXmj);
                 } else {
                     loadGatherGclNode(node, leafXmj);

+ 12 - 3
app/public/js/revise_price.js

@@ -594,6 +594,7 @@ $(document).ready(() => {
 
     class LedgerGcl {
         constructor(setting) {
+            const self = this;
             this.setting = setting;
             this.spread = SpreadJsObj.createNewSpread($(this.setting.selector)[0]);
             this.sheet = this.spread.getActiveSheet();
@@ -610,22 +611,30 @@ $(document).ready(() => {
                 $.contextMenu({
                     selector: setting.selector,
                     build: function ($trigger, e) {
-                        const target = SpreadJsObj.safeRightClickSelection($trigger, e, priceSpread);
+                        const target = SpreadJsObj.safeRightClickSelection($trigger, e, self.spread);
                         return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
                     },
                     items: {
                         del: {
                             name: '添加',
-                            icon: 'fa-remove',
+                            icon: 'fa-sign-in',
                             callback: function (key, opt) {
                                 const datas = [];
+                                const sel = self.sheet.getSelections()[0];
+                                const node = self.sheet.zh_data[sel.row];
+                                datas.push(node);
+                                if (sel.rowCount > 1) {
+                                    for (let r = 1; r < sel.rowCount; r++) {
+                                        const rNode = self.sheet.zh_data[sel.row + r];
+                                        if (rNode) datas.push(rNode);
+                                    }
+                                }
                                 priceOprObj.addRevisePrices(datas);
                             },
                         },
                     },
                 });
             }
-            const self = this;
             this.spread.bind(spreadNS.Events.SelectionChanged, function (e, info) {
                 self.loadLeafXmj();
             });

+ 62 - 4
app/view/tender/detail_modal.ejs

@@ -122,6 +122,35 @@
                                 </div>
                             </div>
                             <div class="form-group mb-4">
+                                <label>代建单位:</label>
+                                <div class="row">
+                                    <div class="col-12 mb-2">
+                                        <div class="input-group input-group-sm">
+                                            <div class="input-group-prepend">
+                                                <span class="input-group-text">单位名称</span>
+                                            </div>
+                                            <input type="text" class="form-control" value="" id="sub-build-company" maxlength="100" oninput="limitReturn(this)">
+                                        </div>
+                                    </div>
+                                    <div class="col-6 pr-0">
+                                        <div class="input-group input-group-sm">
+                                            <div class="input-group-prepend">
+                                                <span class="input-group-text">法人代表</span>
+                                            </div>
+                                            <input type="text" class="form-control" value="" id="sub-build-corporation" maxlength="100" oninput="limitReturn(this)">
+                                        </div>
+                                    </div>
+                                    <div class="col-6">
+                                        <div class="input-group input-group-sm">
+                                            <div class="input-group-prepend">
+                                                <span class="input-group-text">签订日期</span>
+                                            </div>
+                                            <input type="date" class="form-control" value="" id="sub-build-date">
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-group mb-4">
                                 <label>承包单位1:</label>
                                 <div class="row">
                                     <div class="col-12 mb-2">
@@ -216,7 +245,7 @@
                                     </div>
                                 </div>
                             </div>
-                            <div class="form-group">
+                            <div class="form-group mb-4">
                                 <label>监理单位2:</label>
                                 <div class="row">
                                     <div class="col-12 mb-2">
@@ -245,7 +274,7 @@
                                     </div>
                                 </div>
                             </div>
-                            <div class="form-group">
+                            <div class="form-group mb-4">
                                 <label>检测单位:</label>
                                 <div class="row">
                                     <div class="col-12 mb-2">
@@ -274,7 +303,7 @@
                                     </div>
                                 </div>
                             </div>
-                            <div class="form-group">
+                            <div class="form-group mb-4">
                                 <label>跟踪审计单位:</label>
                                 <div class="row">
                                     <div class="col-12 mb-2">
@@ -394,7 +423,7 @@
                                             <input type="date" class="form-control" value="" id="real-end-date">
                                         </div>
                                     </div>
-                                    <div class="col-12">
+                                    <div class="col-12 mb-2">
                                         <div class="input-group input-group-sm">
                                             <div class="input-group-prepend">
                                                 <span class="input-group-text">构造物规模</span>
@@ -402,6 +431,14 @@
                                             <textarea class="form-control" id="structure-scale"></textarea>
                                         </div>
                                     </div>
+                                    <div class="col-12 mb-2">
+                                        <div class="input-group input-group-sm">
+                                            <div class="input-group-prepend">
+                                                <span class="input-group-text">主要工作内容</span>
+                                            </div>
+                                            <textarea class="form-control" id="main-content"></textarea>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -455,6 +492,14 @@
                                             </select>
                                         </div>
                                     </div>
+                                    <div class="col-12 mb-2">
+                                        <div class="input-group input-group-sm">
+                                            <div class="input-group-prepend">
+                                                <span class="input-group-text">招标清单预算</span>
+                                            </div>
+                                            <input type="number" class="form-control nospin" value="" id="bid-yu-price" onchange="checkNumberValid(this)">
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -982,6 +1027,10 @@
         $('#build-company').val(property.construction_unit.build.company);
         $('#build-corporation').val(property.construction_unit.build.corporation);
         $('#build-date').val(property.construction_unit.build.date);
+        // 代建单位
+        $('#sub-build-company').val(property.construction_unit.sub_build.company);
+        $('#sub-build-corporation').val(property.construction_unit.sub_build.corporation);
+        $('#sub-build-date').val(property.construction_unit.sub_build.date);
         // 承包单位1
         $('#contract1-company').val(property.construction_unit.contract1.company);
         $('#contract1-corporation').val(property.construction_unit.contract1.corporation);
@@ -1020,10 +1069,12 @@
         $('#real-start-date').val(property.tech_param.realStartDate);
         $('#real-end-date').val(property.tech_param.realEndDate);
         $('#structure-scale').val(property.tech_param.structureScale);
+        $('#main-content').val(property.tech_param.mainContent);
 
         // 中标信息
         $('#control-price').val(property.bid_info.controlPrice);
         $('#bid-price').val(property.bid_info.bidPrice);
+        $('#bid-yu-price').val(property.bid_info.bidYuPrice);
         $('#bid-start-date').val(property.bid_info.bidStartDate);
         $('#bid-type').find("option:contains('" + property.bid_info.bidType + "')").attr("selected",true);
         $('#deal-calc-type').find("option:contains('" + property.bid_info.dealCalcType + "')").attr("selected",true);
@@ -1049,6 +1100,11 @@
                     corporation: $('#build-corporation').val(),
                     date: $('#build-date').val(),
                 },
+                sub_build: {
+                    company: $('#sub-build-company').val(),
+                    corporation: $('#sub-build-corporation').val(),
+                    date: $('#sub-build-date').val(),
+                },
                 contract1: {
                     company: $('#contract1-company').val(),
                     corporation: $('#contract1-corporation').val(),
@@ -1093,6 +1149,7 @@
                 realStartDate: $('#real-start-date').val(),
                 realEndDate: $('#real-end-date').val(),
                 structureScale: $('#structure-scale').val(),
+                mainContent: $('#main-content').val(),
             },
             bid_info: {
                 controlPrice: _.toNumber($('#control-price').val()),
@@ -1100,6 +1157,7 @@
                 bidStartDate: $('#bid-start-date').val(),
                 bidType: $('#bid-type').find("option:selected").text(),
                 dealCalcType: $('#deal-calc-type').find("option:selected").text(),
+                bidYuPrice: _.toNumber($('#bid-yu-price').val()),
             }
         };
         const tenderId = window.location.pathname.split('/')[2];