zhongzewei 7 years ago
parent
commit
46b8951bc7

+ 13 - 5
modules/complementary_ration_lib/models/compleRationModel.js

@@ -162,7 +162,7 @@ class CompleRatoinDao {
                 return rst;
             });
             for(let ration of rations){
-                let hint = '';
+                let hintsArr = [];
                 for(let rationGlj of ration.rationGljList){
                     let glj;
                     if(!isDef(rationGlj.type) || rationGlj.type === 'std'){
@@ -172,12 +172,20 @@ class CompleRatoinDao {
                          glj = await complementaryGljModel.findOne({uesrId: userId, ID: rationGlj.gljId});
                     }
                     if(isDef(glj)){
-                        let unitHint = '' + glj.code + ' ' + glj.name + ' ' + glj.unit + ' ' + rationGlj.consumeAmt + '</br>';
-                        hint += unitHint;
+                        hintsArr.push(` ${glj.code} ${glj.name} ${glj.unit} ${rationGlj.consumeAmt}`);
                     }
                 }
-                ration._doc.hint = hint;
-                ration._doc.hintHeight = ration.rationGljList.length * perHintHeight;//控制定额库悬浮提示位置
+                hintsArr.push(`基价 元 ${ration.basePrice}`);
+                hintsArr.push(`工作内容:`);
+                if(ration.jobContent){
+                    hintsArr = hintsArr.concat(ration.jobContent.split('\n'));
+                }
+                hintsArr.push(`附注:`);
+                if(ration.annotation){
+                    hintsArr = hintsArr.concat(ration.annotation.split('\n'));
+                }
+                ration._doc.hint = hintsArr.join('<br>');
+                ration._doc.hintHeight = hintsArr.length * perHintHeight;//控制定额库悬浮提示位置
             }
             callback(0, rations);
         }

+ 2 - 2
modules/main/controllers/bills_controller.js

@@ -278,7 +278,7 @@ module.exports = {
                 const billsLibId = fields.billsLibId !== undefined && fields.billsLibId.length > 0 && fields.billsLibId[0]? parseInt(fields.billsLibId[0]) : null;
                 let stdBills = [], stdJobs = [], stdCharacters = [];
                 if(billsLibId){
-                    stdBills = await stdBillsModel.find({billsLibId: billsLibId, deleted: false}, '-_id code jobs items engineering sectionInfo');
+                    stdBills = await stdBillsModel.find({billsLibId: billsLibId, deleted: false}, '-_id code jobs items engineering billsLibId');
                     stdJobs = await stdBillJobsModel.find({billsLibId: billsLibId, deleted: false});
                     stdCharacters = await stdBillCharacterModel.find({billsLibId: billsLibId, deleted: false});
                 }
@@ -572,7 +572,7 @@ function parseToBillData(validData, colMapping, fixedBill, projectID, stdData){
                 if(nineCode == stdBill.code){
                     isMatch = true;
                     excelBill.programID = stdBill.engineering ? stdBill.engineering : null;
-                    excelBill.sectionInfo = stdBill.sectionInfo ? stdBill.sectionInfo : null;
+                    excelBill.billsLibId = stdBill.billsLibId ? stdBill.billsLibId : null;
                     //set jobContent and itemCharacter
                     let tempJob = [], tempCharacter = [];
                     for(let billJob of stdBill.jobs){

+ 2 - 2
modules/pm/models/project_property_template.js

@@ -5,8 +5,8 @@
 //默认的小数位数,用于定义用户可编辑的字段(入库),用户不可编辑的字段在前端defaultDecima._def中定义即可
 const defaultDecimal = {
     bills: {unitPrice: 2, totalPrice: 2},
-    ration: {quantity: 3, unitPrice: 2, totalPrice: 2},
-    glj: {quantity: 3, unitPrice: 2},
+    ration: {quantity: 4, unitPrice: 2, totalPrice: 2},
+    glj: {quantity: 4, unitPrice: 3},
     feeRate: 2,
     quantity_detail: 4,
     material:5,//三材系数

+ 10 - 0
web/building_saas/complementary_ration_lib/js/ration.js

@@ -139,11 +139,19 @@ let rationOprObj = {
             for (let j = 0; j < cacheSection.length; j++) {
                 if (updateArr[i]["ID"] && cacheSection[j]["ID"]) {
                     if (cacheSection[j]["ID"] == updateArr[i]["ID"]) {
+                        updateArr[i]['rationGljList'] = rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] ? rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] : [];
+                        updateArr[i]['rationCoeList'] = rationCoeOprObj.cache['_Coe_' + cacheSection[j]['ID']] ? rationCoeOprObj.cache['_Coe_' + cacheSection[j]['ID']] : [];
+                        updateArr[i]['rationAssList'] = cacheSection[j]['rationAssList'];
+                        updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
                         cacheSection[j] = updateArr[i];
                         cacheSection[j].type = me.type.complementary;
                     }
                 } else {
                     if (cacheSection[j][me.setting.header[0].dataCode] == updateArr[i][me.setting.header[0].dataCode]) {
+                        updateArr[i]['rationGljList'] = rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] ? rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] : [];
+                        updateArr[i]['rationCoeList'] = rationCoeOprObj.cache['_Coe_' + cacheSection[j]['ID']] ? rationCoeOprObj.cache['_Coe_' + cacheSection[j]['ID']] : [];
+                        updateArr[i]['rationAssList'] = cacheSection[j]['rationAssList'];
+                        updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
                         cacheSection[j] = updateArr[i];
                         cacheSection[j].type = me.type.complementary;
                     }
@@ -562,6 +570,8 @@ let rationOprObj = {
                 me.mixUpdate = 0;
                 me.mixDel = 0;
                 if(callback) callback();
+                sectionTreeObj.workBook.focus(false);
+                rationOprObj.workBook.focus(true);
             }, function () {
                 me.getRationItems(me.currentSectionId);
             });

+ 5 - 5
web/building_saas/complementary_ration_lib/js/ration_glj.js

@@ -79,8 +79,8 @@ var rationGLJOprObj = {
         var me = this;
         me.sheet = sheet;
         me.getGljDistType(function () {
-            gljSelOprObj.getGljClassTree(pageOprObj.gljLibId, function () {
-                gljSelOprObj.getSelGljItems(pageOprObj.gljLibId, function () {
+           // gljSelOprObj.getGljClassTree(pageOprObj.gljLibId, function () {
+              //  gljSelOprObj.getSelGljItems(pageOprObj.gljLibId, function () {
                     sheetCommonObj.initSheet(me.sheet, me.setting, 30);
                     me.onContextmenuOpr();
                     me.bindRationGljDelOpr();
@@ -89,8 +89,8 @@ var rationGLJOprObj = {
                     me.sheet.bind(GC.Spread.Sheets.Events.EditStarting, me.onEditStarting);
                     me.sheet.bind(GC.Spread.Sheets.Events.EditEnded, me.onCellEditEnd);
                 });
-            });
-        });
+          //  });
+        //});
     },
     onContextmenuOpr: function () {//右键菜单
         let me = this;
@@ -537,7 +537,7 @@ var rationGLJOprObj = {
         return rst;
     },
     getGljItems: function(rationItem, callback) {
-        let me = this, rationID = rationItem.ID, rationGljList = rationItem.rationGljList, rationType = rationItem.type;
+        let me = this, rationID = rationItem.ID, rationGljList = rationItem.rationGljList ? rationItem.rationGljList : [], rationType = rationItem.type;
         me.currentRationItem = rationItem;
         if (me.cache["_GLJ_" + rationID]) {
             me.showGljItems(rationID);

+ 3 - 0
web/building_saas/complementary_ration_lib/js/section_tree.js

@@ -27,6 +27,9 @@ let pageOprObj = {
                 $('#fzUpdateConBtn').click(annotationOprObj.bindUpdateConBtn());
                 annotationOprObj.bindAllEvents($('#fzTxtareaAll'));
             }
+            gljSelOprObj.getGljClassTree(pageOprObj.gljLibId, function () {
+                    gljSelOprObj.getSelGljItems(pageOprObj.gljLibId);
+            });
         });
     },
     getRationLibInfo: function (rationLibId, callback) {

File diff suppressed because it is too large
+ 9 - 3
web/building_saas/main/html/main.html


+ 5 - 0
web/building_saas/main/js/models/calc_base.js

@@ -525,6 +525,10 @@ let baseFigureTemplate = {
         if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
         return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
     },
+    'JZMJ': function () {
+        let buildingArea = projFeatureView.getFeature('buildingArea');
+        return buildingArea ? parseFloat(buildingArea) : 0;
+    },
     'SQGCZJ': function (tender) {//税前工程造价
         let bill = calcBase.fixedBills[calcBase.fixedFlag.SAFETY_CONSTRUCTION]['bill'];
         if(cbTools.isUnDef(bill) || cbTools.isUnDef(bill.ID)) return 0;
@@ -1003,6 +1007,7 @@ let baseFigureMap = {
     '规费': {base: 'GF', fixedFlag: fixedFlag.CHARGE, class: 'GF'},
     '税金': {base: 'SJ', fixedFlag: fixedFlag.TAX, class: 'SJ'},
     //不于清单直接关联==========
+    '建筑面积': {base: 'JZMJ', class: 'FBFX'},
     '税前工程造价': {base: 'SQGCZJ', class: 'SQGCZJ'},//安全文明施工专项费用使用
     '人材机价差': {base: 'RCJJC', class: 'RCJ'},
     '人工价差': {base: 'RGJC', class: 'RCJ'},

+ 4 - 1
web/building_saas/main/js/models/ration.js

@@ -541,7 +541,7 @@ var Ration = {
                 })
             }
         };
-        ration.prototype.addNewRation = function (itemQuery,rationType) {
+        ration.prototype.addNewRation = function (itemQuery,rationType,callback=null) {
             let me = this;
             let project = projectObj.project, sheetController = projectObj.mainController;
             let engineering = projectInfoObj.projectInfo.property.engineering;
@@ -609,6 +609,9 @@ var Ration = {
                                 installationFeeObj.calcInstallationFee();
                             }
                         });
+                        if(callback){
+                            callback();
+                        }
                         $.bootstrapLoading.end();
                     });
                 })

+ 10 - 0
web/building_saas/main/js/views/main_tree_col.js

@@ -478,6 +478,16 @@ let colSettingObj = {
             }
         }
         return false;
+    },
+    getColByField: function (field) {
+        let cols = projectObj.project.projSetting.main_tree_col.cols;
+        for(let i = 0; i < cols.length; i++){
+            let colSetting = cols[i];
+            if(colSetting.data.field === field){
+                return i
+            }
+        }
+        return null;
     }
 
 };

+ 2 - 2
web/building_saas/main/js/views/project_property_decimal_view.js

@@ -7,8 +7,8 @@ let defaultDecimal = {
     max: 6,
     _def: {//editable: 开放给用户编辑的
         bills: {editable: true, data: {unitPrice: 2, totalPrice: 2}},
-        ration: {editable: true, data: {quantity: 3, unitPrice: 2, totalPrice: 2}},
-        glj: {editable: true, data: {quantity: 3, unitPrice: 2}},
+        ration: {editable: true, data: {quantity: 4, unitPrice: 2, totalPrice: 2}},
+        glj: {editable: true, data: {quantity: 4, unitPrice: 3}},
         material: {editable: false, data: 5},
         feeRate: {editable: true, data: 2},
         quantity_detail: {editable: false, data: 4},

+ 5 - 1
web/building_saas/main/js/views/project_property_projFeature.js

@@ -191,7 +191,11 @@ let projFeatureView = {
     },
 
     getFeature: function (featureKey) {
-        for(let feature of this.datas){
+        let datas = this.datas;
+        if(datas.length === 0){
+            datas = projectObj.project.property.projectFeature;
+        }
+        for(let feature of datas){
             if(feature.key === featureKey){
                 return feature.value;
             }

+ 18 - 3
web/building_saas/main/js/views/project_view.js

@@ -233,6 +233,18 @@ var projectObj = {
         }
         return rst;
     },
+    //根据列标段设置焦点单元格
+    setActiveCell(field, moveScroll){
+        projectObj.mainSpread.focus(true);
+        let mainSheet = projectObj.mainSpread.getActiveSheet();
+        let fieldCol = colSettingObj.getColByField(field);
+        if(fieldCol){
+            if(moveScroll){
+                mainSheet.showColumn(fieldCol, GC.Spread.Sheets.HorizontalPosition.left);
+            }
+            mainSheet.setActiveCell(projectObj.project.mainTree.selected.serialNo(), fieldCol);
+        }
+    },
     //获取粘贴更改的单元格(粘贴时,跳过隐藏行)
     checkSpreadChangedCells: function (info) {
         let rst = {refreshRows: [], changedCells: []};
@@ -1680,11 +1692,15 @@ $('#property_ok').click(function () {
 
     //基本信息
     if(basicInfoView.toUpdate(basicInfoView.orgDatas, basicInfoView.datas)){
-        properties['property.basicInformation'] = basicInfoView.toSaveDatas(basicInfoView.datas);
+        let saveData = basicInfoView.toSaveDatas(basicInfoView.datas);
+        projectObj.project.property.basicInformation = saveData;
+        properties['property.basicInformation'] = saveData;
     }
     //工程特征
     if(projFeatureView.toUpdate(projFeatureView.orgDatas, projFeatureView.datas)){
-        properties['property.projectFeature'] = projFeatureView.toSaveDatas(projFeatureView.datas);
+        let saveData = projFeatureView.toSaveDatas(projFeatureView.datas);
+        projectObj.project.property.projectFeature = saveData;
+        properties['property.projectFeature'] = saveData;
     }
     //清单工程量精度
     let newBillsDecimalDatas = billsDecimalView.toBillsDecimalDatas(billsDecimalView.cache);
@@ -2039,7 +2055,6 @@ $('#customFile').change(function () {
             console.log('enter');
             try {
                 let data = ev.target.result;
-                console.log(data);
                 // 以二进制流方式读取得到整份excel表格对象
                 let workbook = XLSX.read(data, {type: 'binary'});
                 // 遍历每张表读取

+ 1 - 0
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -499,6 +499,7 @@ const billsGuidance = (function () {
                         }
                     }
                 });
+                projectObj.setActiveCell('quantity', true);
             });
         }
     }

+ 8 - 3
web/building_saas/main/js/views/std_ration_lib.js

@@ -63,8 +63,11 @@ var rationLibObj = {
                 that.tree.setExpandedByState(that.tree.items, currentExpState);
             }
             else {
-                //非叶子节点默认收起
-                that.tree.setRootExpanded(that.tree.roots, false);
+                //展开至第二层
+                for(let root of that.tree.roots){
+                    root.setExpanded(true);
+                    that.tree.setRootExpanded(root.children, false);
+                }
             }
             rationChapterTreeController.showTreeData();
 
@@ -135,7 +138,9 @@ var rationLibObj = {
     onRationSpreadCellDoubleClick: function (sender, args) {
         var select = $('#stdRationLibSelect'), rationCode = args.sheet.getText(args.row, 0);
         if (rationCode !== '') {
-            projectObj.project.Ration.addNewRation({userID: userID, rationRepId: select.val(), code: rationCode},rationType.ration);
+            projectObj.project.Ration.addNewRation({userID: userID, rationRepId: select.val(), code: rationCode},rationType.ration, function () {
+                projectObj.setActiveCell('quantity', true);
+            });
         }
     },
     loadStdRationContextMenu: function () {

+ 4 - 4
web/building_saas/pm/html/project-management.html

@@ -67,16 +67,16 @@
                             <a class="nav-link active" href="#pm_all" role="tab" id="tab_pm_all" data-toggle="tab" data-placement="right" data-original-title="全部"><i class="fa fa-bars"></i></a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="#"  data-toggle="tooltip" data-placement="right" data-original-title="最近使用"><i class="fa fa-bookmark"></i></a>
+                            <a class="nav-link" href="javascript:void(0);"  data-toggle="tooltip" data-placement="right" data-original-title="最近使用"><i class="fa fa-bookmark"></i></a>
                         </li>
                         <li class="nav-item" data-toggle="tooltip" data-placement="right" data-original-title="分享">
                             <a class="nav-link" href="#pm_share" id="tab_pm_share" data-toggle="tab" data-placement="right" data-original-title="分享"><i class="fa fa-share-alt"></i></a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="project-management-synergy.html"  data-toggle="tooltip" data-placement="right" data-original-title="协同工作"><i class="fa fa-users"></i></a>
+                            <a class="nav-link" href="javascript:void(0);"  data-toggle="tooltip" data-placement="right" data-original-title="协同工作"><i class="fa fa-users"></i></a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="#"  data-toggle="tooltip" data-placement="right" data-original-title="归档"><i class="fa fa-book"></i></a>
+                            <a class="nav-link" href="javascript:void(0);"  data-toggle="tooltip" data-placement="right" data-original-title="归档"><i class="fa fa-book"></i></a>
                         </li>
                         <li class="nav-item" data-toggle="tooltip" data-placement="right" data-original-title="回收站">
                             <a class="nav-link" href="#pm_gc" id="tab_pm_gc" data-toggle="tab" data-placement="right" data-original-title="回收站"><i class="fa fa-trash"></i></a>
@@ -503,7 +503,7 @@
                     </ul>
                 </div>
                 <div class="form-group mt-3">
-                    <p>分享后,该用户仅可查阅工程,不具备任何编辑修改功能。</p>
+                    <p>分享后,对方仅可查阅工程,不能修改。</p>
                 </div>
                 <div class="form-check">
                     <input type="checkbox" class="form-check-input" id="allowCopy">

+ 4 - 0
web/building_saas/pm/js/pm_newMain.js

@@ -1154,6 +1154,8 @@ $(document).ready(function() {
         let engName = $('#eng-name').val().trim();
         let tenderName = $('#tender-name').val().trim();
         let isExist = hasTender(selected, pojName, engName, tenderName);
+        $('#unit-price').find('option:first-child').text(tenderName);
+        $('#tender-fee-rate').find('option:first-child').text(tenderName);
         if(isExist){
             if(tenderName !== '')
                 setDangerInfo($('#tender-name-info'), `已存在“${tenderName}”`);
@@ -1190,6 +1192,8 @@ $(document).ready(function() {
         $('#tender-name').val('');
         $('#valuation-info').hide();
         $('#engineering-info').hide();
+        $('#unit-price').find('option:first-child').text('新建单价文件');
+        $('#tender-fee-rate').find('option:first-child').text('新建费率文件');
         //获取建设项目
         let selected = projTreeObj.tree.selected;
         let projs = getProjs(selected);

+ 2 - 6
web/common/html/header.html

@@ -1,16 +1,12 @@
 <nav class="navbar navbar-expand-lg p-0 d-flex">
-    <div class="header-logo">
+    <a style="text-decoration: none" href="/pm" class="header-logo">
         <div class="v-title">纵横云计价</div>
         <div class="p-title"><%= versionName %></div>
-    </div>
-    <!--<a class="header-logo px-2" href="/pm" style="text-decoration: none;">纵横云计价<sup><%= versionName %></sup></a>-->
+    </a>
     <ul class="nav navbar-nav px-1" id="header-menu" style="display: none;">
         <li class="nav-item">
             <a class="nav-link" href="#" aria-expanded="false" data-toggle="modal" data-target="#poj-set"><i class="fa fa-cube"></i> 项目属性</a>
         </li>
-        <!--<li class="nav-item">
-            <a class="nav-link" href="#import" data-toggle="modal" data-target="#import"><i class="fa fa-cloud-upload"></i> 导入</a>
-        </li>-->
         <li class="nav-item dropdown">
             <a class="nav-link dropdown-toggle" href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa  fa-cloud-upload"></i> 导入</a>
             <div class="dropdown-menu">