Переглянути джерело

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost

zhangweicheng 7 роки тому
батько
коміт
ee33f1658a

+ 2 - 1
modules/common/base/base_controller.js

@@ -60,11 +60,12 @@ class BaseController {
         // 获取当前用户消息数量
         let userMessageModel = new UserMessageModel();
         // 消息处理
+        console.log(`sessionUser`);
+        console.log(sessionUser);
         await userMessageModel.initMessage(sessionUser.id);
         // 获取未读数据
         let messageUnreadCount = await userMessageModel.count({user_id: sessionUser.id, is_read: 0, is_delete: 0});
         response.locals.unreadCount = messageUnreadCount;
-
         next();
     }
 }

+ 2 - 0
modules/complementary_ration_lib/models/compleRationModel.js

@@ -141,6 +141,7 @@ class CompleRatoinDao {
     //造价书定额库
     async getRationGljItemsBySection(userId, sectionId, callback){
         try{
+            const perHintHeight = 17.2;
             let stdRations = await stdRationModel.find({sectionId: sectionId, $or: [{isDeleted: null}, {isDeleted: false}]});
             for(let ration of stdRations){
                 ration._doc.type = 'std';
@@ -176,6 +177,7 @@ class CompleRatoinDao {
                     }
                 }
                 ration._doc.hint = hint;
+                ration._doc.hintHeight = ration.rationGljList.length * perHintHeight;//控制定额库悬浮提示位置
             }
             callback(0, rations);
         }

+ 28 - 8
modules/main/controllers/bills_controller.js

@@ -200,7 +200,7 @@ module.exports = {
                 if (sheet[0] === undefined || sheet[0].data === undefined) {
                     throw 'excel没有对应数据';
                 }
-                //导入的数据是否含有固定行(分部分项、施工技术措施项目、施工组织措施项目)
+                //导入的数据是否含有固定行(分部分项、施工技术措施项目、施工组织措施项目,通过文件名判断)
                 let flag = getImportFlag(file.originalFilename);
                 if(!flag){
                     throw 'excel数据错误';
@@ -232,6 +232,8 @@ module.exports = {
                     await billsData.model.create(insertFixedBill);
                     fixedBill = insertFixedBill;
                 }
+                console.log(`fixedBill--------------`);
+                console.log(fixedBill);
                 //匹配的清单库
                 const billsLibId = fields.billsLibId !== undefined && fields.billsLibId.length > 0 && fields.billsLibId[0]? parseInt(fields.billsLibId[0]) : null;
                 let stdBills = [], stdJobs = [], stdCharacters = [];
@@ -241,7 +243,7 @@ module.exports = {
                     stdCharacters = await stdBillCharacterModel.find({billsLibId: billsLibId, deleted: false});
                 }
                 //将excel数据转换成清单树结构数据
-                let insertDatas = parseToBillData(getValidImportData(sheet[0].data), getColMapping(sheet[0].data), fixedBill, projectID, {stdBills: stdBills, stdJobs: stdJobs, stdCharacters: stdCharacters});
+                let insertDatas = parseToBillData(getValidImportData(sheet[0].data, fixedBill), getColMapping(sheet[0].data), fixedBill, projectID, {stdBills: stdBills, stdJobs: stdJobs, stdCharacters: stdCharacters});
                 //删除相关数据
                 let deleteDatas = await billsData.deepDeleteBill([fixedBill], req.session.sessionUser.id);
                 //新增清单数据
@@ -305,8 +307,10 @@ function rowExistData(rowData){
     }
     return false;
 }
-//提取excel表数据中的有效数据(去表头表尾,提取其中的excel数据)
-function getValidImportData(sheetData){
+//提取excel表数据中的有效数据(去表头表尾,提取其中的excel数据)(根据fixedBill获取栏头占行数)
+function getValidImportData(sheetData, fixedBill){
+    console.log(`sheetData`);
+    console.log(sheetData);
     let withingD = false;
     let validData = [];
     for(let r = 0; r < sheetData.length; r++){
@@ -317,7 +321,9 @@ function getValidImportData(sheetData){
             //表头
             if(rData[0] === '序号'){
                 withingD = true;
-                r++;
+                if(fixedBill.name !== '施工组织措施项目'){
+                    r++;
+                }
                 continue;
             }
             //表尾
@@ -325,10 +331,16 @@ function getValidImportData(sheetData){
                 withingD = false;
             }
         }
+        /*console.log(`rData`);
+        console.log(rData);
+        console.log(withingD);
+        console.log(rowExistData(rData));*/
         if(withingD && rowExistData(rData)){
             validData.push(rData);
         }
     }
+    /*console.log(`validData`);
+    console.log(validData);*/
     return validData;
 }
 
@@ -358,7 +370,7 @@ function parseToBillData(validData, colMapping, fixedBill, projectID, stdData){
     }
     //续数据,上一行数据是有效节点且无序号
     function isExtend(preData, rData){
-        return preData && (isRoot(preData) || isLeaf(preData)) && (rData[colMapping.serialNo] === undefined || rData[colMapping.serialNo] === '');
+        return preData && (isRoot(preData) || isLeaf(preData)) &&  !isRoot(rData) && (rData[colMapping.serialNo] === undefined || rData[colMapping.serialNo] === '');
     }
     function getBillType(rData, flag){
         if(flag === fixedFlag.CONSTRUCTION_TECH || flag === fixedFlag.CONSTRUCTION_ORGANIZATION){
@@ -371,12 +383,14 @@ function parseToBillData(validData, colMapping, fixedBill, projectID, stdData){
     }
     //excel数据与标准库数据匹配,根据清单前九位编码匹配,匹配成功则获取标准清单对应的工程专业、特征及内容
     function matchStdBill(excelBill, stdData){
+        let isMatch = false;
         let regExp = /^\d{12}$/g;
         if(regExp.test(excelBill.code)){
             let nineCode = excelBill.code.substr(0, 9);
             for(let stdBill of stdData.stdBills){
                 //set programID
                 if(nineCode == stdBill.code){
+                    isMatch = true;
                     excelBill.programID = stdBill.engineering ? stdBill.engineering : null;
                     //set jobContent and itemCharacter
                     let tempJob = [], tempCharacter = [];
@@ -403,6 +417,9 @@ function parseToBillData(validData, colMapping, fixedBill, projectID, stdData){
                 }
             }
         }
+        if(!isMatch && excelBill.type === billType.FX){//分项在标准清单中不匹配,则识别为补项
+                excelBill.type = billType.BX;
+        }
     }
     for(let r = 0; r < validData.length; r++){
         let preData = validData[r-1],
@@ -450,8 +467,9 @@ function parseToBillData(validData, colMapping, fixedBill, projectID, stdData){
                 programID: null,
                 unit: rData[colMapping.unit] ? rData[colMapping.unit] : '',
                 quantity: rData[colMapping.quantity] ? rData[colMapping.quantity] : '',
-                flags: fixedBill.flags[0].flag === fixedFlag.CONSTRUCTION_ORGANIZATION && rData[colMapping.name] === '安全文明施工专项费用' ?
-                    [{fieldName: 'fixed', flag: fixedBill.flags[0].flag}] : [],
+                //安全文明
+                flags: fixedBill.flags[0].flag === fixedFlag.CONSTRUCTION_ORGANIZATION && (rData[colMapping.name] === '安全文明施工专项费用' || rData[colMapping.name] === '安全文明施工费') ?
+                    [{fieldName: 'fixed', flag: fixedFlag.SAFETY_CONSTRUCTION}] : [],
                 fees: [],
                 projectID: projectID,
                 type: getBillType(rData, fixedBill.flags[0].flag)};
@@ -470,6 +488,8 @@ function parseToBillData(validData, colMapping, fixedBill, projectID, stdData){
     for(let i in billIdx){
         rst.push(billIdx[i]);
     }
+    console.log('rst');
+    console.log(rst);
     return rst;
 }
 

+ 0 - 1
modules/pm/controllers/pm_controller.js

@@ -195,7 +195,6 @@ module.exports = {
         let rationValuation = sessionCompilation.ration_valuation !== undefined ?
             sessionCompilation.ration_valuation : [];
         rationValuation = await engineeringLibModel.getLib(rationValuation);
-
         let renderData = {
             userAccount: request.session.userAccount,
             userID: request.session.sessionUser.id,

+ 16 - 1
modules/reports/util/rpt_construct_data_util.js

@@ -619,8 +619,23 @@ function sortData(sourceData, sortCfg, prjData) {
     switch (sortType) {
         case "tree":
             rst = treeUtil.buildTreeNodeDirectly(tempRstArr);
+            let newTopArr = [];
+            if (sortCfg[JV.PROP_FILTER_TOP_BILLS_NODES] && sortCfg[JV.PROP_FILTER_TOP_BILLS_NODES].length > 0) {
+                for (let topItem of rst) {
+                    if (topItem.flags && topItem.flags.length > 0) {
+                        for (let flagItem of topItem.flags) {
+                            if (sortCfg[JV.PROP_FILTER_TOP_BILLS_NODES].indexOf(flagItem.flag) >= 0) {
+                                newTopArr.push(topItem);
+                                break;
+                            }
+                        }
+                    }
+                }
+            } else {
+                newTopArr = rst;
+            }
             let destArr = [];
-            treeUtil.getFlatArray(rst, destArr);
+            treeUtil.getFlatArray(newTopArr, destArr);
             delete sourceData.data;
             sourceData.data = destArr;
             // fsUtil.writeObjToFile(sourceData.data, "D:/GitHome/ConstructionCost/tmp/sortedAndFlattedRst.js");

+ 1 - 0
public/web/rpt_value_define.js

@@ -54,6 +54,7 @@ const JV = {
     PROP_OTHER_SUB_SORT: "其他子排序",
     PROP_HANDLE_TYPE: "预处理类型",
     PROP_FILTER_KEYS: "过滤键值集",
+    PROP_FILTER_TOP_BILLS_NODES: "清单顶节点集",
     PROP_FILTER_COMPARE_OBJ: "compareObjKey",
     PROP_FILTER_COMPARE_OBJ_KEY: "compareObjIdKey",
     PROP_FILTER_COMPARE_VAL: "compareValue",

+ 13 - 1
public/web/sheet/sheet_data_helper.js

@@ -118,6 +118,7 @@ var SheetDataHelper = {
     loadSheetData: function (setting, sheet, datas) {
         SheetDataHelper.protectdSheet(sheet);
 
+
         let TipCellType = function () {};
         TipCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
         TipCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
@@ -135,6 +136,9 @@ var SheetDataHelper = {
         TipCellType.prototype.processMouseEnter = function (hitinfo) {
             let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
             let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
+            let hintHeight = datas[hitinfo.row] ?
+                                datas[hitinfo.row].hintHeight ? datas[hitinfo.row].hintHeight : null
+                            : null; //定额库定额悬浮提示位置相关
             if(tag !== undefined && tag){
                 text = tag;
             }
@@ -154,8 +158,15 @@ var SheetDataHelper = {
                         document.body.insertBefore(div, null);
                     }
                     this._toolTipElement = div;
-                    $(this._toolTipElement).html(text).css("top", setting.pos.y + hitinfo.y + 15).css("left", setting.pos.x + hitinfo.x + 15);
+                    $(this._toolTipElement).html(text);
+                    if(hintHeight){
+                        $(this._toolTipElement).css("top", setting.pos.y  + hitinfo.y - hintHeight).css("left", setting.pos.x + hitinfo.x + 15);
+                    }
+                    else{
+                        $(this._toolTipElement).css("top", setting.pos.y + hitinfo.y +15).css("left", setting.pos.x + hitinfo.x + 15);
+                    }
                     $(this._toolTipElement).show("fast");
+                    TREE_SHEET_HELPER.tipDiv = 'show';//做个标记
                 }
             }
         };
@@ -164,6 +175,7 @@ var SheetDataHelper = {
                 $(this._toolTipElement).hide();
                 this._toolTipElement = null;
             }
+            TREE_SHEET_HELPER.tipDivCheck();//延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
         }
 
         sheet.suspendPaint();

+ 67 - 106
web/building_saas/css/main.css

@@ -8,10 +8,10 @@ body {
     font-size: 0.9rem
 }
 .btn.disabled, .btn:disabled {
-    color:#999
+  color:#999
 }
 .btn-link:focus, .btn-link:hover{
-    text-decoration: none
+  text-decoration: none
 }
 /*自定义css*/
 .header {
@@ -28,21 +28,15 @@ body {
     line-height: inherit
 }
 .header .header-logo sup{
-    font-size:10px;
-    top:-1.2em
+  font-size:10px;
+  top:-1.2em
 }
 .top-msg{
-    position: fixed;
-    top:0;
-    width:100%;
-    z-index: 999
+  position: fixed;
+  top:0;
+  width:100%;
+  z-index: 999
 }
-.in-1{padding-left:0px!important}
-.in-2{padding-left:21px!important}
-.in-3{padding-left:42px!important}
-.in-4{padding-left:63px!important}
-.in-5{padding-left:84px!important}
-.in-6{padding-left:105px!important}
 .main {
     position: relative;
     background: #f7f7f9;
@@ -73,41 +67,40 @@ body {
     color: #333
 }
 .main-nav .nav-tabs{
-    border-bottom: none
+  border-bottom: none
 }
-
 .poj-manage .col-auto{
-    background:#f7f7f9
+  background:#f7f7f9
 }
 .poj-cate {
-    width:58px
+  width:58px
 }
 .poj-cate .nav-pills .nav-link{
-    border-radius: 0;
-    font-size: 24px;
-    color: #007bff
+  border-radius: 0;
+  font-size: 24px;
+  color: #007bff
 }
 .poj-cate .nav-pills .nav-link:hover{
-    color:#0056b3
+  color:#0056b3
 }
 .poj-cate .nav-pills .nav-link.active, .nav-pills .show > .nav-link{
-    background-color: #6c757d;
-    color:#fff
+  background-color: #6c757d;
+  color:#fff
 }
 .pm-side{
-    position: fixed;
-    left:0
+  position: fixed;
+  left:0
 }
 .pm-content{
-    padding-left:58px
+  padding-left:58px
 }
 .content {
     border-left: 1px solid #ccc;
     margin-left: 29px;
     background: #fff
 }
-.toolsbar,.toolsbar-f,.toolsbar_feeRate {
-    border-bottom: 1px solid #ccc
+.toolsbar,.toolsbar-f {
+  border-bottom: 1px solid #ccc
 }
 .tools-btn {
     height: 30px;
@@ -121,23 +114,23 @@ body {
     overflow-y: hidden;
 }
 .main-data-top,.main-data-full{
-    overflow: hidden;
-    width:100%
+  overflow: hidden;
+  width:100%
 }
 .main-content.col-lg-8{
-    width:66.666667%
+  width:66.666667%
 }
 .main-content.col-lg-12{
-    width:100%
+  width:100%
 }
 .main-side.col-lg-4{
-    width: 33.333333%;
+  width: 33.333333%;
 }
 .main-side.col-lg-0{
-    width:0%;
+  width:0%;
 }
 .sidebar-bottom,.sidebar-bottom .col-lg-6,.sidebar-bottom .col-lg-12 {
-    height:300px
+  height:300px
 }
 .top-content, .fluid-content {
     overflow: auto;
@@ -153,7 +146,7 @@ body {
     padding: 0.2em 0.5em
 }
 .side-tabs .nav-tabs .nav-item {
-    z-index: 999
+  z-index: 999
 }
 .side-tabs .nav-tabs {
     border-bottom: none;
@@ -280,114 +273,82 @@ body {
 .poj-list, .side-content ,.form-view{
     overflow: auto;
 }
-.poj-list span.poj-icon {
-    padding-right:7px;
-    color:#ccc
-}
-.poj-list a.tree-open,.poj-list a.tree-close{
-    width:15px;
-    display: inline-block;
-}
 .print-toolsbar{
-    padding:5px
+  padding:5px
 }
 .print-toolsbar .panel {
-    display:inline-block;
-    vertical-align:top;
-    background:#f7f7f9
+  display:inline-block;
+  vertical-align:top;
+  background:#f7f7f9
 }
 .print-toolsbar .panel .panel-foot{
-    text-align: center;
-    font-size: 12px
+  text-align: center;
+  font-size: 12px
 }
 .print-list {
-    border-right:1px solid #ccc
+  border-right:1px solid #ccc
 }
 .print-list .form-list {
-    overflow: auto
+  overflow: auto
 }
 .print-list .list-tools{
-    height:50px;
-    padding:10px 0;
-    border-bottom:1px solid #f2f2f2
+  height:50px;
+  padding:10px 0;
+  border-bottom:1px solid #f2f2f2
 }
 .pageContainer {
-    background: #ededed;
-    text-align: center
+  background: #ededed;
+  text-align: center
 }
 .pageContainer .page{
-    border:9px solid transparent;
-    display: inline-block;
+  border:9px solid transparent;
+  display: inline-block;
 }
 .pageContainer .page img{
-    width:inherit;
-    height: inherit;
+  width:inherit;
+  height: inherit;
 }
 .modal-auto-height {
-    height: 400px;
-    overflow-y: auto;
+  height: 400px;
+  overflow-y: auto;
+}
+.modal-toolbar + .modal-auto-height{
+  height:369px
 }
 .modal-fixed-height {
-    height: 400px;
-    overflow-y: hidden;
+  height: 400px;
+  overflow-y: hidden;
 }
 .sidebar-tools-bar {
-    background:#fff
+  background:#fff
 }
 .side-search-box{
-    background:#fff;
-    border-bottom:1px solid #ddd
+  background:#fff;
+  border-bottom:1px solid #ddd
 }
 .navbar-crumb span{
-    max-width: 200px
+  max-width: 200px
 }
 .dropdown-item{
-    color:#007bff
+  color:#007bff
 }
 .dropdown-item:hover{
-    color:#0056b3
+  color:#0056b3
 }
 .dropdown-item.disabled, .dropdown-item:disabled{
-    pointer-events:none
-}
-.text-green{
-    color: #172a30
-}
-label.title{
-    display: inline-block;
-    width: 100px;
-}
-.modal-feeRate {max-width: 550px}
-.gc-column-header-cell{
-    text-align: center!important;
-}
-div.resize{
-    height: 4px;
-    background: #f7f7f9;
-    width: 100%;
-    cursor: s-resize;
-}
-/*.zlfb-check{
-    margin-left: 20px;
-}*/
-legend.legend{
-    display:block;
-    width:auto;
-    font-size:0.9rem;
-    top:-15px;
-    background: white;
+  pointer-events:none
 }
 .tools-symbol{
-    width:450px
+  width:450px
 }
 .tools-symbol p{
-    margin: 0
+  margin: 0
 }
 .tools-symbol a.btn{
-    font-size: .95rem;
-    width:26px;
-    padding: 0;
-    height:26px;
+  font-size: .95rem;
+  width:26px;
+  padding: 0;
+  height:26px;
 }
 .custom-file-input:lang(zh) ~ .custom-file-label::after {
     content: "浏览";

+ 2 - 3
web/building_saas/main/html/main.html

@@ -477,11 +477,10 @@
                                 </div>
                                 <!--人工单价调整-->
                                 <div class="tab-pane fade" id="poj-settings-6" role="tabpanel">
-                                    <div class="row px-3">
+                                    <div class="row px-3 modal-toolbar">
                                         <select class="col-4 form-control form-control-sm" id="std_labour_coe_files"><option>渝建[2016]71号</option><option>渝建[2017]78号</option></select>
                                     </div>
-                                    <div style="height:8px;"></div>
-                                    <div class="modal-auto-height" id="labourCoeSpread"></div>
+                                    <div class="modal-auto-height pt-1"  style="overflow: hidden" id="labourCoeSpread" ></div>
                                 </div>
                                 <!--呈现选项-->
                                 <div class="tab-pane fade" id="display-setting" role="tabpanel">

+ 3 - 1
web/building_saas/main/js/controllers/project_controller.js

@@ -30,8 +30,10 @@ ProjectController = {
             });
             for(let newNode of newNodes){
                 sc.sheet.addRows(newNode.serialNo(), 1);
-               // TREE_SHEET_HELPER.refreshTreeNodeData(sc.setting, sc.sheet, [newNode], false);
+            }
+            for(let newNode of newNodes){
                 sc.setTreeSelected(newNode);
+                TREE_SHEET_HELPER.refreshTreeNodeData(sc.setting, sc.sheet, [newNode], false);
                 sc.sheet.setSelection(newNode.serialNo(), sels[0].col, 1, 1);
                 sc.sheet.showRow(newNode.serialNo(), GC.Spread.Sheets.VerticalPosition.center);
             }

+ 5 - 1
web/building_saas/main/js/models/calc_program.js

@@ -1408,7 +1408,11 @@ class CalcProgram {
                     delete treeNode.data.gljList;
                     let muf = treeNode.data.marketUnitFee ? treeNode.data.marketUnitFee : 0;
                     let q = calcTools.uiNodeQty(treeNode) ? calcTools.uiNodeQty(treeNode) : 0;
-                    treeNode.data.marketTotalFee = (muf * q).toDecimal(decimalObj.ration.totalPrice);
+                    let mtf = (muf * q).toDecimal(decimalObj.ration.totalPrice);
+                    if (treeNode.data.marketTotalFee != mtf){
+                        treeNode.data.marketTotalFee = mtf;
+                        treeNode.changed = true;
+                    } ;
                 }
                 else{
                     treeNode.data.gljList = me.project.ration_glj.getGljArrByRation(treeNode.data.ID);

+ 27 - 11
web/building_saas/main/js/models/ration_glj.js

@@ -67,15 +67,20 @@ var ration_glj = {
                 return null;
             }
             for (let ration of rations) {
-                let rationGljs = this.getGljArrByRation(ration.ID);
-                for (let glj of rationGljs) {
-                    let sameGlj = findGlj(glj, result);
-                    if (!sameGlj) {
-                        sameGlj = clone(glj);
-                        sameGlj.quantity = (sameGlj.quantity * ration.quantity).toDecimal(4);
-                        result.push(sameGlj);
-                    } else {
-                        sameGlj.quantity = sameGlj.quantity + (glj.quantity * ration.quantity).toDecimal(4);
+                if (ration.type == rationType.volumePrice || ration.type == rationType.gljRation){
+                    result.push(ration);
+                }
+                else{
+                    let rationGljs = this.getGljArrByRation(ration.ID);
+                    for (let glj of rationGljs) {
+                        let sameGlj = findGlj(glj, result);
+                        if (!sameGlj) {
+                            sameGlj = clone(glj);
+                            sameGlj.quantity = (sameGlj.quantity * ration.quantity).toDecimal(4);
+                            result.push(sameGlj);
+                        } else {
+                            sameGlj.quantity = sameGlj.quantity + (glj.quantity * ration.quantity).toDecimal(4);
+                        }
                     }
                 }
             }
@@ -83,9 +88,20 @@ var ration_glj = {
             result = gljOprObj.combineWithProjectGlj(result);
 
             // 上面取的是清单下所有工料机的总量,我要算清单单价,所以要取单位清单的工料机数量,所以下面要除以清单数量。
-            let oneBill = Array.from(result);
+            let oneBill = JSON.parse(JSON.stringify(result));
+
             for (let glj of oneBill){
-                  glj.quantity = (glj.quantity / billQuantity).toDecimal(decimalObj.glj.quantity);
+                if (glj.type == rationType.volumePrice){  // 量价、工料机形式的定额要进行数据变换才能参与基数计算。
+                    glj.type = glj.subType;
+                    glj.basePrice = glj.marketUnitFee;
+                    glj.marketPrice = glj.marketUnitFee;
+                    glj.adjustPrice = glj.marketUnitFee;
+                }
+                else if (glj.type == rationType.gljRation){
+                    glj.type = glj.subType;
+                };
+
+                glj.quantity = (glj.quantity / billQuantity).toDecimal(decimalObj.glj.quantity);
             };
             return oneBill;
         }

+ 64 - 54
web/building_saas/main/js/views/project_property_labour_coe_view.js

@@ -8,7 +8,7 @@ let labourCoeView = {
     sheet: null,
     needUpdateDatas: [],
 
-    init(){
+    buildSelect(){
         let me = this;
 
         function getStdLabourCoeFilesHtml(stdLabourCoeLibs) {
@@ -26,7 +26,6 @@ let labourCoeView = {
         let stdLCHtml = getStdLabourCoeFilesHtml(projectInfoObj.projectInfo.engineeringInfo.artificial_lib);
         $("#std_labour_coe_files").html(stdLCHtml);
     },
-
     buildSheet: function (){
         let me = this;
         if (me.spread) {
@@ -35,8 +34,8 @@ let labourCoeView = {
         };
         me.spread = new GC.Spread.Sheets.Workbook($("#labourCoeSpread")[0], { sheetCount: 1 });
         me.spread.options.tabStripVisible = false;
-        me.spread.options.showVerticalScrollbar = false;
-        me.spread.options.showHorizontalScrollbar = false;
+        me.spread.options.showVerticalScrollbar = true;
+        me.spread.options.showHorizontalScrollbar = true;
         let sheetArea = GC.Spread.Sheets.SheetArea;
         let sheet = me.spread.getSheet(0);
         me.sheet = sheet;
@@ -51,48 +50,7 @@ let labourCoeView = {
         sheet.resumeEvent();
         sheet.resumePaint();
     },
-
-    onCellChanged: function(sender, args){
-        var me = labourCoeView;
-        if (args.propertyName !== "value"){return;};
-        let cell = me.sheet.getCell(args.row, args.col);
-        let value = args.newValue;
-        let oValue = args.oldValue;
-        if (number_util.isNumber(value)) {
-            value = value.toDecimal(2);
-            me.sheet.suspendEvent();
-            cell.value(value);
-            me.sheet.resumeEvent();
-            me.addNeedUpdateData({ID: cell.tag(), coe: value});
-        } else {
-            me.sheet.suspendEvent();
-            cell.value(oValue);  // 屏蔽事件,否则这句会导致死循环
-            me.sheet.resumeEvent();
-            alert('当前输入的数据类型不正确,请重新输入。');
-        }
-    },
-
-    addNeedUpdateData: function (data) {
-        let me = this;
-        let isExist = false;
-        for (let el of me.needUpdateDatas){
-             if (el.ID == data.ID){
-                 isExist = true;
-                 el.coe = data.coe;
-                 return;
-             };
-        };
-        if (!isExist){
-            me.needUpdateDatas.push(data);
-        }
-    },
-
-    needSave: function (){
-        let me = this;
-        return me.needUpdateDatas.length > 0;
-    },
-
-    loadData(datas){          // 树结构转换二维表显示,行列转换
+    loadCrossData(datas){          // 交叉表:树结构转换二维表显示,行列转换
         let me = this;
         me.spread.suspendEvent();
         me.datas = datas;
@@ -135,40 +93,92 @@ let labourCoeView = {
         };
         me.spread.resumeEvent();
     },
-
     showData(){
         let me = this;
         let datas = projectObj.project.labourCoe.datas !== null ? projectObj.project.labourCoe.datas.coes : [];
-        me.init();
+        me.buildSelect();
         me.buildSheet();
-        me.loadData(datas);
+        me.loadCrossData(datas);
+    },
+    addNeedUpdateData: function (data) {
+        let me = this;
+        let isExist = false;
+        for (let el of me.needUpdateDatas){
+             if (el.ID == data.ID){
+                 isExist = true;
+                 el.coe = data.coe;
+                 return;
+             };
+        };
+        if (!isExist){
+            me.needUpdateDatas.push(data);
+        }
+    },
+    needSave: function (){
+        let me = this;
+        return me.needUpdateDatas.length > 0;
+    },
+    clearSave: function(){
+        let me = this;
+        me.needUpdateDatas.splice(0, me.needUpdateDatas.length);
     },
-
     refresh(){
         let me = this;
         me.needUpdateDatas.splice(0, me.needUpdateDatas.length);
         $("#std_labour_coe_files").val('');
         calcProgramManage.buildSheet();
+    },
+    onCellChanged: function(sender, args){
+        var me = labourCoeView;
+        if (args.propertyName !== "value"){return;};
+        let cell = me.sheet.getCell(args.row, args.col);
+        let value = args.newValue;
+        let oValue = args.oldValue;
+        if (number_util.isNumber(value)) {
+            value = value.toDecimal(2);
+            me.sheet.suspendEvent();
+            cell.value(value);
+            me.sheet.resumeEvent();
+            me.addNeedUpdateData({ID: cell.tag(), coe: value});
+        } else {
+            me.sheet.suspendEvent();
+            cell.value(oValue);  // 屏蔽事件,否则这句会导致死循环
+            me.sheet.resumeEvent();
+            alert('当前输入的数据类型不正确,请重新输入。');
+        }
     }
 };
 
 $(document).ready(function(){
-    $("#tab_poj-settings-6").on('shown.bs.tab', function (e) {
+    $('#poj-set').on('shown.bs.modal', function (e) {
         labourCoeView.showData();
     });
 
+    $('#poj-set').on('hidden.bs.modal', function (e) {
+        if(labourCoeView.spread){
+            labourCoeView.spread.destroy();
+            labourCoeView.spread = null;
+        }
+        labourCoeView.datas = [];
+        labourCoeView.clearSave();
+    });
+
+    $("#tab_poj-settings-6").on('shown.bs.tab', function (e) {
+        labourCoeView.spread.refresh();
+    });
+
     $("#std_labour_coe_files").change(function() {
         // 取标准库数据过来显示。
         let libID = $(this).val();
         if (libID == ''){
-            labourCoeView.loadData([]);
+            labourCoeView.loadCrossData([]);
             return false;
         };
 
         CommonAjax.post('/labourCoe/getStdLabourCoe', {"ID": libID}, function (data) {
             labourCoeView.buildSheet();
-            labourCoeView.loadData(data.coes);
-            labourCoeView.needUpdateDatas.splice(0, labourCoeView.needUpdateDatas.length);
+            labourCoeView.loadCrossData(data.coes);
+            labourCoeView.clearSave();
             labourCoeView.needUpdateDatas.push(...data.coes);
         });
     });

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

@@ -1400,22 +1400,18 @@ $('#poj-set').on('show.bs.modal', function () {
     let setCalcFlag = function (obj, val, curFlag) {
         obj.val(val);
         if (val === curFlag) {
-            obj.attr('checked', true);
+            obj.prop('checked', true);
         } else {
-            obj.removeAttr('checked');
+            obj.prop('checked', false);
         }
     }
     if (projectObj.project) {
-        // let mode = projectObj.project.projSetting.billsCalcMode;
-        // let settingConst = projectObj.project.projSetting.settingConst;、
         let ft = projectObj.project.property.billsCalcMode ? projectObj.project.property.billsCalcMode : leafBillGetFeeType.rationContent;
+        let zg = projectObj.project.property.zanguCalcMode ? projectObj.project.property.zanguCalcMode : zanguCalcType.common;
         setCalcFlag($('#rationContent'), leafBillGetFeeType.rationContent, ft);
         setCalcFlag($('#rationPriceConverse'), leafBillGetFeeType.rationPriceConverse, ft);
         setCalcFlag($('#rationPrice'), leafBillGetFeeType.rationPrice, ft);
         setCalcFlag($('#billsPrice'), leafBillGetFeeType.billsPrice, ft);
-
-        // mode = projectObj.project.projSetting.zanguCalcType;
-        let zg = projectObj.project.property.zanguCalcMode ? projectObj.project.property.zanguCalcMode : zanguCalcType.common;
         setCalcFlag($('#zangu_common'), zanguCalcType.common, zg);
         setCalcFlag($('#zangu_gatherMaterial'), zanguCalcType.gatherMaterial, zg);
         projDisplayView.init();

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

@@ -124,7 +124,7 @@
 
                         <legend>单价文件</legend>
                         <table class="table table-bordered table-hover table-sm" id="summary-project-unit-price-table">
-                            <thead><th></th><th>名称</th><th width="50">使用</th></thead>
+                            <thead><th style="width: 25px;"></th><th style="width: 330px;">名称</th><th style="width:40px;">使用</th></thead>
                             <tbody>
                             <tr><td>1</td><td>A单价文件</td></tr>
                             <tr><td>2</td><td>B单价文件</td></tr>
@@ -135,7 +135,7 @@
 
                         <legend>费率文件</legend>
                         <table class="table table-bordered table-hover table-sm" id="summary-project-fee-table">
-                            <thead><th></th><th>名称</th><th width="50">使用</th></thead>
+                            <thead><th style="width: 25px;"></th><th style="width: 330px;">名称</th><th style="width:40px;">使用</th></thead>
                             <tbody>
                             <tr><td>1</td><td>A费率文件</td></tr>
                             <tr><td>2</td><td>B费率文件</td></tr>

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

@@ -107,7 +107,6 @@ const projTreeObj = {
                 allowResizeRows: true,
                 allowResizeColumns: true
             };
-            sheet.setColumnCount(headers.length);
             sheet.setRowHeight(0, 40, GC.Spread.Sheets.SheetArea.colHeader);
             for(let i = 0, len = headers.length; i < len; i++){
                 sheet.setValue(0, i, headers[i].name, GC.Spread.Sheets.SheetArea.colHeader);