瀏覽代碼

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

Conflicts:
	web/building_saas/main/js/views/glj_col.js
zhangweicheng 7 年之前
父節點
當前提交
7be6609124

+ 4 - 2
modules/pm/controllers/pm_controller.js

@@ -471,7 +471,8 @@ module.exports = {
         try {
             let userID = req.session.sessionUser.id;
             let rst = {receive: [], share: []}//接收的、由我分享的
-            let shareProjects = await projectModel.find({userID: userID, $or: [{deleteInfo: null}, {'deleteInfo.deleted': false}], 'shareInfo.0': {$exists: true}});
+            let shareProjects = await projectModel.find({userID: userID,
+                $or: [{deleteInfo: null}, {'deleteInfo.deleted': false}], compilation: req.session.sessionCompilation._id, 'shareInfo.0': {$exists: true}});
             //项目类型为分享给别人
             let shareToUserIDs = [];
             for(let proj of shareProjects){
@@ -499,7 +500,8 @@ module.exports = {
                 }
             }
             rst.share = shareProjects;
-            let receiveProjects = await projectModel.find({$or: [{deleteInfo: null}, {'deleteInfo.deleted': false}], 'shareInfo.userID': userID});
+            let receiveProjects = await projectModel.find({
+                $or: [{deleteInfo: null}, {'deleteInfo.deleted': false}], compilation: req.session.sessionCompilation._id, 'shareInfo.userID': userID});
             //设置原项目用户信息
             if(receiveProjects.length > 0){
                 let orgUserIDs = [];

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

@@ -6,7 +6,7 @@
 const defaultDecimal = {
     bills: {unitPrice: 2, totalPrice: 2},
     ration: {quantity: 4, unitPrice: 2, totalPrice: 2},
-    glj: {quantity: 4, unitPrice: 3},
+    glj: {quantity: 4, unitPriceHasMix: 2, unitPrice: 3},
     feeRate: 2,
     quantity_detail: 4,
     material:5,//三材系数

+ 4 - 3
modules/reports/controllers/rpt_controller.js

@@ -224,7 +224,8 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
                     let tplData = rptDataUtil.assembleData(rawDataObj);
                     let printCom = JpcEx.createNew();
                     if (pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = pageSize;
-                    if (orientation) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = orientation;
+                    //console.log("orientation: " + (orientation === 'null'));
+                    if (orientation !== 'null') rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = orientation;
                     let defProperties = rptUtil.getReportDefaultCache();
                     if (customizeCfg) setupCustomizeCfg(customizeCfg, rptTpl, defProperties);
                     let dftOption = option||JV.PAGING_OPTION_NORMAL;
@@ -331,7 +332,7 @@ module.exports = {
         let dftOption = option||JV.PAGING_OPTION_NORMAL;
         getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, null, dftOption, function(err, pageRst){
             try {
-                rpt_xl_util.exportExcel(pageRst, pageSize, rptName, isOneSheet, null, function(newName){
+                rpt_xl_util.exportExcel(pageRst, pageSize, rptName, isOneSheet, null, null, function(newName){
                     res.setHeader('Content-Type', 'application/vnd.openxmlformats');
                     let rptNameURI = encodeURI(rptName);
                     res.setHeader("Content-Disposition", "attachment; filename=\"" + rptNameURI + ".xlsx\"; filename*=utf-8''" + rptNameURI + '.xlsx' );
@@ -400,7 +401,7 @@ module.exports = {
         getAllPagesCommonOrg(rpt_id, pageSize, dftOption, function(err, pageRst){
             fs.writeFileSync('D:/GitHome/ConstructionOperation/tmp/testRpt.js', JSON.stringify(pageRst));
             try {
-                rpt_xl_util.exportExcel(pageRst, pageSize, rptName, isOneSheet, null, function(newName){
+                rpt_xl_util.exportExcel(pageRst, pageSize, rptName, isOneSheet, null, null, function(newName){
                     res.setHeader('Content-Type', 'application/vnd.openxmlformats');
                     res.setHeader("Content-Disposition", "attachment; filename=" + strUtil.getPinYinCamelChars(rptName) + ".xlsx");
                     let filestream = fs.createReadStream(__dirname.slice(0, __dirname.length - 28) + '/tmp/' + newName + '.xlsx');

+ 28 - 4
modules/reports/controllers/rpt_tpl_controller.js

@@ -24,7 +24,8 @@ let callback = function(req, res, err, message, data){
 let mExport = {
     getCustomerCfg(req, res) {
         let params = JSON.parse(req.body.params),
-            userId = params.userId
+            userId = params.userId,
+            me = this;
         ;
         if (req.session.sessionUser && req.session.sessionUser.id) userId = req.session.sessionUser.id;
         let userIds = [];
@@ -37,14 +38,26 @@ let mExport = {
                 //success
                 let rst = null;
                 if (custCfg.length > 0) {
+                    rst = [];
+                    rst.push(null);
                     for (let itemCfg of custCfg) {
-                        rst = itemCfg;
+                        // rst = itemCfg;
                         let doc = (itemCfg._doc)?itemCfg._doc:itemCfg;
+                        let dest = {};
+                        copyRptCfg(doc, dest);
                         if (doc.userId !== "-100") {
-                            break;
+                            rst.push(dest);
+                        } else {
+                            rst[0] = dest;
                         }
                     }
                 }
+                if (rst !== null && rst.length === 1) {
+                    //copy dft config
+                    let userDest = {};
+                    copyRptCfg(rst[0], userDest);
+                    rst.push(userDest);
+                }
                 callback(req,res, false, "", rst);
             } else {
                 //failed
@@ -69,7 +82,6 @@ let mExport = {
             }
         })
     },
-
     getDftTemplates(req, res) {
         let filter = {"userId": "-100", "$or": [{"isDeleted": null}, {"isDeleted": false} ]};
         TreeNodeModel.find(filter, '-_id', function(err, data){
@@ -381,4 +393,16 @@ let mExport = {
     }
 };
 
+function copyRptCfg(src, dest) {
+    dest.margins = {Left: src.margins.Left, Right: src.margins.Right, Top: src.margins.Top, Bottom: src.margins.Bottom};
+    dest.showVerticalLine = src.showVerticalLine;
+    dest.isNarrow = src.isNarrow;
+    dest.fillZero = src.fillZero;
+    dest.fonts = [];
+    for (let font of src.fonts) {
+        dest.fonts.push({"ID": font["ID"], "CfgDispName": font["CfgDispName"], "Name": font["Name"], "FontHeight": font["FontHeight"], "FontColor": font["FontColor"],
+            "FontBold": font["FontBold"], "FontItalic": font["FontItalic"], "FontUnderline": font["FontUnderline"], "FontStrikeOut": font["FontStrikeOut"], "FontAngle": font["FontAngle"]});
+    }
+}
+
 export default mExport;

+ 16 - 8
modules/reports/util/rpt_excel_util.js

@@ -287,7 +287,7 @@ function writeSharedString(sharedStrList){
     }
     return rst;
 }
-function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage){
+function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage, custSheetMergeBands){
     let rst = [];
     let private_pushDftFont = function(){
         let font = {};
@@ -329,15 +329,19 @@ function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage
     private_pushDftFont();
     private_buildFirstDftStyle();
     if (isSinglePage) {
-        rst.push(writeSheet(pageData, null, paperSize, sharedStrList, stylesObj));
+        rst.push(writeSheet(pageData, null, paperSize, sharedStrList, stylesObj, null));
     } else {
         for (let i = 0; i < pageData.items.length; i++) {
-            rst.push(writeSheet(pageData, pageData.items[i], paperSize, sharedStrList, stylesObj));
+            let appointedMergeBand = null;
+            if (custSheetMergeBands && custSheetMergeBands.length > i) {
+                appointedMergeBand = custSheetMergeBands[i];
+            }
+            rst.push(writeSheet(pageData, pageData.items[i], paperSize, sharedStrList, stylesObj, appointedMergeBand));
         }
     }
     return rst;
 }
-function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj){
+function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, appointedMergeBand){
     let rst = [], xPos = [], yPos = [], yMultiPos = [], headerStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
     let currentPageMergePos = null; //在 JV.PAGING_OPTION_INFINITY 场合应用
     let private_pre_analyze_pos = function(){
@@ -501,6 +505,9 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj){
             mergeBorder = (sheetData)?sheetData[JV.PROP_PAGE_MERGE_BORDER]:pageData[JV.BAND_PROP_MERGE_BAND],
             mergeBand = pageData[JV.BAND_PROP_MERGE_BAND]
         ;
+        if (appointedMergeBand !== null) {
+            mergeBand = appointedMergeBand;
+        }
         if (sheetBorder[borderStr] && sheetBorder[borderStr][JV.PROP_LINE_WEIGHT] !== undefined) {
             rst = sheetBorder[borderStr][JV.PROP_LINE_WEIGHT];
         }
@@ -809,7 +816,7 @@ function mergeProperties(orgObj, newObj) {
 }
 
 module.exports = {
-    exportExcel: function (pageData, paperSize, fName, options, custSheetNames, callback) {
+    exportExcel: function (pageData, paperSize, fName, options, custSheetNames, custSheetMergeBands, callback) {
         let rptOptions = ({singlePage: false, fileName: 'report'});
         if (options === 'true') {
             rptOptions.singlePage = true;
@@ -864,7 +871,7 @@ module.exports = {
         //6.
         let zip_worksheets = zip_xl.folder('worksheets');
         let sharedStrList = [], stylesObj = {};
-        data = writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage);
+        data = writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage, custSheetMergeBands);
         if (isSinglePage) {
             for (let i = 0; i < 1; i++) {
                 file = 'sheet' + (i + 1) + '.xml';
@@ -906,7 +913,7 @@ module.exports = {
         //   -- 简单来说,就是重新包装数据
         try {
             // 1.1 newPageData外围属性
-            let newContrl = {}, newFont = {}, newStyle = {};
+            let newContrl = {}, newFont = {}, newStyle = {}, custMergeBands = [];
             for (let i = 0; i < pageDataArray.length; i++) {
                 mergeProperties(newContrl, pageDataArray[i][JV.NODE_CONTROL_COLLECTION]);
                 mergeProperties(newFont, pageDataArray[i][JV.NODE_FONT_COLLECTION]);
@@ -923,6 +930,7 @@ module.exports = {
             for (let i = 0; i < pageDataArray.length; i++) {
                 let offsetY = 0;
                 let mergeBand = {};
+                custMergeBands.push(pageDataArray[i][JV.BAND_PROP_MERGE_BAND]);
                 mergeBand[JV.PROP_LEFT] = [];
                 mergeBand[JV.PROP_RIGHT] = [];
                 mergeBand[JV.PROP_TOP] = [];
@@ -976,7 +984,7 @@ module.exports = {
                 newPageData.items.push(pageItem);
             }
             //3. everything is ok, then call me
-            me.exportExcel(newPageData, paperSize, fName, 'false', sheetNames, callback);
+            me.exportExcel(newPageData, paperSize, fName, 'false', sheetNames, custMergeBands, callback);
             // fsUtil.writeObjToFile(newPageData, 'D:/GitHome/ConstructionOperation/tmp/combinedHeader.js');
         } catch (e) {
             console.log(e);

+ 1 - 1
test/unit/excel_export/rpt_excel_export_test.js

@@ -14,7 +14,7 @@ test('check real function.', function(t){
     eval(data);
     var pageObj = testReport08_2;
     //console.log(pageObj.items[0].cells.length);
-    rpt_xl_util.exportExcel(pageObj, fName, null);
+    rpt_xl_util.exportExcel(pageObj, fName, 'false', null, null, null);
     t.pass('pass exportExcel');
     t.end();
 });

+ 32 - 0
web/building_saas/complementary_glj_lib/js/glj.js

@@ -170,10 +170,42 @@ let repositoryGljObj = {
             cacheSection = null;
         }
     },
+    bindEnterKey: function () {
+        let me = this;
+        let sheet = me.workBook.getActiveSheet();
+        me.workBook.commandManager().register("myEnter", function(){
+            let orgRow = sheet.getActiveRowIndex();
+            let orgCol = sheet.getActiveColumnIndex();
+            if(sheet.isEditing()){
+                sheet.endEdit();
+            }
+            let code = sheet.getValue(orgRow, 0);
+            let newRow, newCol;
+            if(!me.currentCache[orgRow] && code !== undefined && code !== null && orgCol !== me.setting.header.length - 1){
+                newRow = orgRow;
+                newCol = orgCol + 1;
+                sheet.setActiveCell(newRow, newCol);
+            }
+            else{
+                newRow = orgRow + 1;
+                newCol = me.currentCache[orgRow + 1] ? orgCol : 0;
+                sheet.setActiveCell(newRow, newCol);
+            }
+            //触发事件
+            //me.onLeaveCell({type: 'LeaveCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: orgRow, col: orgCol});
+            me.onEnterCell({type: 'EnterCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: newRow, col: newCol});
+            let newSels = [{row: newRow, rowCount: 1, col: newCol, colCount: 1}];
+            let oldSels = [{row: orgRow, rowCount: 1, col: orgRow, colCount: 1}];
+            me.onSelectionChanged({type: 'SelectionChanged'}, {sheet: sheet, sheetName: sheet.name(), newSelections: newSels, oldSelections: oldSels});
+        });
+        me.workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.enter, false, false, false, false);
+        me.workBook.commandManager().setShortcutKey("myEnter", GC.Spread.Commands.Key.enter, false, false, false, false);
+    },
     buildSheet: function(container) {
         let me = repositoryGljObj;
         me.workBook = sheetOpr.buildSheet(container, me.setting, 30);
         me.repositoryGljDelOpr();
+        me.bindEnterKey();
         me.setUnitCombo(me.workBook.getActiveSheet(), me.setting.header);
         me.workBook.getActiveSheet().bind(GC.Spread.Sheets.Events.ClipboardPasting, me.onClipboardPasting);
         me.workBook.getActiveSheet().bind(GC.Spread.Sheets.Events.ClipboardPasted, me.onClipboardPasted);

+ 11 - 5
web/building_saas/main/html/main.html

@@ -621,15 +621,21 @@
                                             </div>
                                             <h5 class="mt-3">人材机</h5>
                                             <div class="row m-0">
-                                                <div class="col-sm-3">
-                                                    <div class="input-group input-group-sm mb-2">
+                                                <div style="width: 23.3%;">
+                                                    <div style="width:120px;" class="input-group input-group-sm mb-2">
                                                         <div class="input-group-addon">消耗量</div>
                                                         <input type="number" name="glj-quantity" class="form-control" value="2" step="1" max="6" min="0">
                                                     </div>
                                                 </div>
-                                                <div class="col-sm-3">
-                                                    <div class="input-group input-group-sm mb-2">
-                                                        <div class="input-group-addon">单价</div>
+                                                <div  style="width: 38.3%;">
+                                                    <div style="width:190px;" class="input-group input-group-sm mb-2">
+                                                        <div class="input-group-addon">单价(有组成物)</div>
+                                                        <input type="number" name="glj-unitPriceHasMix" class="form-control" value="2" step="1" max="6" min="0">
+                                                    </div>
+                                                </div>
+                                                <div style="width: 38.3%;">
+                                                    <div  style="width:190px;" class="input-group input-group-sm mb-2">
+                                                        <div class="input-group-addon">单价(无组成物)</div>
                                                         <input type="number" name="glj-unitPrice" class="form-control" value="2" step="1" max="6" min="0">
                                                     </div>
                                                 </div>

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

@@ -145,6 +145,7 @@ ProjectController = {
     addFX:function(project, sheetController) {//添加分项
         if (!project || !sheetController) { return null; }
         let selected = project.mainTree.selected;
+        console.log(selected);
         if(selected.data.type==billType.FB||(selected.parent==null&&isFlag(selected.data)&&selected.data.flagsIndex.fixed.flag==fixedFlag.SUB_ENGINERRING)){//选中的是分部或者是分部分项工程,则插入做为最后一个子项
             this.addSpecialBill(project, sheetController,selected, null,true,billType.FX);
         }

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

@@ -239,6 +239,30 @@ let cbTools = {
             //根据基数和行引用获取清单ID
             for(let i = 0, len = bases.length; i < len; i++){
                 //基数是跟清单直接关联的
+                /*if(bases[i]['type'] === 'base' && cbTools.isDef(calcBase.baseFigures[bases[i]['value']])){
+                    //税前工程造价算法用了分部分项、项目措施、其他项目、规费里的底层价格,相当于引用了4条固定清单,特殊处理
+                    if(bases[i]['value'] === '税前工程造价'){
+                        let subEngineering = cbTools.findBill(calcBase.fixedFlag.SUB_ENGINERRING),
+                            measure = cbTools.findBill(calcBase.fixedFlag.MEASURE),
+                            other = cbTools.findBill(calcBase.fixedFlag.OTHER),
+                            charge = cbTools.findBill(calcBase.fixedFlag.CHARGE);
+                        if(subEngineering){
+                            block.push(subEngineering.ID);
+                        }
+                        if(measure){
+                            block.push(measure.ID);
+                        }
+                        if(other){
+                            block.push(other.ID);
+                        }
+                        if(charge){
+                            block.push(charge.ID);
+                        }
+                    }
+                    else if(cbTools.isDef(calcBase.baseFigures[bases[i]['value']]['fixedBill'])){
+                        block.push(calcBase.baseFigures[bases[i]['value']]['fixedBill']['bill']['ID']);
+                    }
+                }*/
                 if(bases[i]['type'] === 'base' && cbTools.isDef(calcBase.baseFigures[bases[i]['value']])
                     && cbTools.isDef(calcBase.baseFigures[bases[i]['value']]['fixedBill'])){
                     block.push(calcBase.baseFigures[bases[i]['value']]['fixedBill']['bill']['ID']);

+ 0 - 1
web/building_saas/main/js/models/project.js

@@ -361,7 +361,6 @@ var PROJECT = {
         };
         //清单是否属于锁定范围(分部分项、措施项目)
         project.prototype.withinBillsLocked = function (node) {
-            console.log(node);
             const lockedFixFlag = [fixedFlag.SUB_ENGINERRING, fixedFlag.MEASURE];
             while(node){
                 if(!node.parent){

+ 12 - 4
web/building_saas/main/js/views/fee_rate_view.js

@@ -185,6 +185,14 @@ var feeRateObject={
         sheet.rowOutlines.group(22, 6);*/
        // sheet.getRange(-1, 0, -1, 1).width(300);
         sheet.showRowOutline(false);
+
+        // 默认折叠
+        for (let i in data){
+            if (!data[i].ParentID){
+                sheet.rowOutlines.setCollapsed(parseFloat(i), true);
+            };
+        };
+
         sheet.resumeEvent();
         sheet.resumePaint(false);
     },
@@ -204,11 +212,11 @@ var feeRateObject={
             }
         };
 
+        // 展开
         for (let i in rates){
-            if (!rates[i].ParentID){
-                sheet.rowOutlines.setCollapsed(parseFloat(i), true);
-                if (rates[i].ID == pID)
-                    sheet.rowOutlines.setCollapsed(parseFloat(i), false);
+            if (!rates[i].ParentID && (rates[i].ID == pID)){
+                sheet.rowOutlines.setCollapsed(parseFloat(i), false);
+                break;
             };
         };
 

+ 3 - 3
web/building_saas/main/js/views/glj_col.js

@@ -16,7 +16,7 @@ let gljCol = {
             {headerName: "定额价", headerWidth: 80, dataCode: "basePrice", dataType: "Number", hAlign: "right", decimalField: "glj.unitPrice"},
             {headerName: "调整价", headerWidth: 80, dataCode: "adjustPrice", dataType: "Number", hAlign: "right", decimalField: "glj.unitPrice"},
             {headerName: "市场价", headerWidth: 80, dataCode: "marketPrice", dataType: "Number", hAlign: "right", decimalField: "glj.unitPrice"},
-            {headerName: "暂估", headerWidth: 65, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"
+            {headerName: "暂估", headerWidth: 45, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"
             }
         ],
         view: {
@@ -36,8 +36,8 @@ let gljCol = {
             {headerName: "定额价", headerWidth: 70, dataCode: "basePrice", hAlign: "right", dataType: "Number",validator:"number"},//decimalField:'glj.unitPrice',
             {headerName: "调整价", headerWidth: 70, dataCode: "adjustPrice", hAlign: "right", dataType: "Number"},//,decimalField:"glj.unitPrice"
             {headerName: "市场价", headerWidth: 70, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
-            {headerName: "暂估", headerWidth: 60, dataCode: "is_evaluate", hAlign: "center", dataType: "String",cellType:'checkBox'},
-            {headerName: "主要\n材料", headerWidth: 60, dataCode: "is_main_material", hAlign: "center", dataType: "String",cellType:'checkBox'},
+            {headerName: "暂估", headerWidth: 45, dataCode: "is_evaluate", hAlign: "center", dataType: "String",cellType:'checkBox'},
+            {headerName: "主要\n材料", headerWidth: 45, dataCode: "is_main_material", hAlign: "center", dataType: "String",cellType:'checkBox'},
             {headerName: "供货方式", headerWidth: 80, dataCode: "supply", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:supplyComboMap},
             {headerName: "甲供数量", headerWidth: 100, dataCode: "supply_quantity", hAlign: "right", dataType: "Number",validator:"number",decimalField:'glj.quantity'},
             {headerName: "三材类别", headerWidth: 80, dataCode: "materialType", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:materialComboMap},

+ 23 - 4
web/building_saas/main/js/views/glj_view.js

@@ -1239,6 +1239,16 @@ var gljOprObj = {
             hasCom = this.hasComposition(node.data);
         }
         return hasCom|| node.data.isEstimate == 1;
+    },
+    locateZTree: function(ID) {
+        let zTree = $.fn.zTree.getZTreeObj("gljTree");
+        let node = null;
+        if (ID) node = zTree.getNodesByParam('ID', ID, null)[0]
+        if (!node) node = zTree.getNodeByTId('gljTree_1');
+        zTree.selectNode(node);
+        gljOprObj.gljCurTypeId = ID;
+        gljOprObj.filterLibGLJSheetData();
+        gljOprObj.showLibGLJSheetData();
     }
 
 }
@@ -1253,7 +1263,7 @@ $(function () {
             gljOprObj.gljLibSheet.name('glj_lib');
         }
         gljOprObj.gljLibSheetData = gljOprObj.AllRecode;
-        let selections = [],selectMap = {};
+        let gljClass = 0, selectMap = {};
         if ($('#actionType').val() == 'add' || $('#actionType').val() == 'insert') {//插入,添加
             gljOprObj.GLJSelection = [];
         } else if($('#actionType').val() =='m_replace' || $('#actionType').val() == 'replace'){//替换、批量替换
@@ -1277,17 +1287,20 @@ $(function () {
             let item_key = gljOprObj.getIndex(item, gljLibKeyArray);
             if(selectMap[item_key]){
                 item.select = 1 ;
+                gljClass = item.gljClass;
             }
         }
-        gljOprObj.showLibGLJSheetData();
+
         //替换,焦点定位至当前选中人材机
         if($('#actionType').val() =='m_replace' || $('#actionType').val() == 'replace'){
+            gljOprObj.locateZTree(gljClass);
             let selected = gljOprObj.sheetData[gljContextMenu.selectedRow];
             let index = _.findIndex(gljOprObj.gljLibSheetData, {code: selected.code});
             gljOprObj.gljLibSheet.showRow(index, GC.Spread.Sheets.VerticalPosition.center);
             gljOprObj.gljLibSheet.setActiveCell(index, 0);
             gljOprObj.gljLibSpresd.focus(true);
         }
+        else gljOprObj.showLibGLJSheetData();
     });
 
     $('#glj_tree_div').on('hidden.bs.modal', function () {
@@ -1306,16 +1319,21 @@ $(function () {
             gljOprObj.showLibGLJSheetData();
         }
     })
-    //工料机搜索
+/*    //工料机搜索
     $('#gljSearchKeyword').change(function () {
         gljOprObj.filterLibGLJSheetData();
         gljOprObj.showLibGLJSheetData();
     });
-    $('#gljSearchKeyword').bind('keypress', function (e) {
+     $('#gljSearchKeyword').bind('keypress', function (e) {
         if(e.keyCode === 13){
+            alert('2');
             $(this).blur();
             return false;
         }
+    });*/
+    $('#gljSearchKeyword').bind('keyup', function (e) {
+        gljOprObj.filterLibGLJSheetData();
+        gljOprObj.showLibGLJSheetData();
     });
 
     $('#glj_selected_conf').click(function () {
@@ -1447,3 +1465,4 @@ function compareRationGLJ(a, b) {
     }
     return false;
 }
+

+ 6 - 1
web/building_saas/main/js/views/main_tree_col.js

@@ -484,10 +484,15 @@ let colSettingObj = {
         for(let i = 0; i < cols.length; i++){
             let colSetting = cols[i];
             if(colSetting.data.field === field){
-                return i
+                return i;
             }
         }
         return null;
+    },
+    getFieldByCol: function (col) {
+        let cols = projectObj.project.projSetting.main_tree_col.cols;
+        let colSetting = cols[col];
+        return colSetting ? colSetting.data.field : null;
     }
 
 };

+ 7 - 0
web/building_saas/main/js/views/project_glj_view.js

@@ -62,10 +62,17 @@ projectGljObject={
     },
     initProjectGljSheet:function () {
         this.projectGljSheet = this.projectGljSpread .getSheet(0);
+
         this.initSheet(this.projectGljSheet,this.projectGljSetting);
         this.projectGljSheet.bind(GC.Spread.Sheets.Events.SelectionChanged,this.onProjectGljSelectionChange);
         this.projectGljSheet.bind(GC.Spread.Sheets.Events.EditStarting,this.onProjectGljEditStarting);
         this.projectGljSheet.name('projectGljSheet');
+
+        this.projectGljSheet.setRowHeight(0, 45, 1);
+        let cell = this.projectGljSheet.getCell(0, 9, GC.Spread.Sheets.SheetArea.colHeader);
+        // console.log(cell.value());
+        cell.hAlign(GC.Spread.Sheets.HorizontalAlign.center).vAlign(GC.Spread.Sheets.VerticalAlign.center).wordWrap(true);
+        // cell.wordWrap(true);
     },
     initMixRatio:function () {
         let me = projectGljObject;

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

@@ -8,7 +8,7 @@ let defaultDecimal = {
     _def: {//editable: 开放给用户编辑的
         bills: {editable: true, data: {unitPrice: 2, totalPrice: 2}},
         ration: {editable: true, data: {quantity: 4, unitPrice: 2, totalPrice: 2}},
-        glj: {editable: true, data: {quantity: 4, unitPrice: 3}},
+        glj: {editable: true, data: {quantity: 4, unitPriceHasMix: 2, unitPrice: 3}},
         material: {editable: false, data: 5},
         feeRate: {editable: true, data: 2},
         quantity_detail: {editable: false, data: 4},
@@ -20,6 +20,42 @@ let decimalObj = Object.create(null);
 
 decimalObj.decimal = function (field, node) {
     if(isDef(field)){
+        if(field.sameText('unitFee')){
+            field = 'unitPrice';
+        }
+        else if(field.sameText('totalFee')){
+            field = 'totalPrice';
+        }
+    }
+    if(!isDef(node)){
+        if(!isDef(field)){
+            return this.process;
+        }
+        let fields = field.split('.');
+        let fieldDecimal = fields.length === 2 ? this[fields[0]][fields[1]] : this[fields[0]];
+        return  fieldDecimal ? fieldDecimal : this.process;
+    }
+    else {
+        if(node.sourceType === projectObj.project.Bills.getSourceType()){
+            if(field === 'quantity'){
+                return billsQuanDecimal.decimal(node.data.unit);
+            }
+            else {
+                return returnV(this['bills'][field], this.process);
+            }
+        }
+        else if(node.sourceType === projectObj.project.Ration.getSourceType()){
+            return returnV(this['ration'][field], this.process);
+        }
+        else if(node.sourceType === projectObj.project.ration_glj.getSourceType()){
+            return returnV(this['glj'][field], this.process);
+        }
+    }
+    return  this[field]? this[field] : this.process;
+};
+
+/*decimalObj.decimal = function (field, node) {
+    if(isDef(field)){
         if(field === 'feeRate'||field==="quantity_detail"){
             return this[field];
         }
@@ -44,7 +80,7 @@ decimalObj.decimal = function (field, node) {
         }
     }
     return  this[field]?this[field]:this.process;
-};
+};*/
 
 function returnV(v, r){
     if(isDef(v)){

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

@@ -680,7 +680,7 @@ var projectObj = {
                         col.data.autoHeight = true;
                         col.showHint = true;
                     }
-                    if(col.data.field ==='quantity'){
+                    if(col.data.field ==='quantity' || col.data.field ==='remark'){
                         col.showHint = true;
                     }
 
@@ -701,14 +701,16 @@ var projectObj = {
                 that.mainController.bind('refreshBaseActn', that.refreshBaseActn);
                 that.mainController.bind(TREE_SHEET_CONTROLLER.eventName.beforeTreeSelectedChange, that.beforeMainTreeSelectedChange);
                 that.mainController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, that.treeSelectedChanged);
-
+                if(!projectReadOnly){
+                    that.bindEnterKey(that.mainSpread, 'mainEnterKey', that.mainSpreadEnterKey);
+                }
                 setTimeout(function () {
                     that.mainSpread.getActiveSheet().startEdit();//这两句需要挺多时间,而又需要在editend 事件前触发,而这些又不影响计算,所以这里用异步的方法
                     that.mainSpread.getActiveSheet().endEdit();
 
                     that.mainSpread.bind(GC.Spread.Sheets.Events.EditEnded, that.mainSpreadEditEnded);
                 },100);
-                that.mainSpread.bind(GC.Spread.Sheets.Events.SelectionChanged, that.amountAreaNumber);
+                that.mainSpread.bind(GC.Spread.Sheets.Events.SelectionChanged, that.amountAreaNumber);//选中统计专用,节点相关操作在treeSelectedChanged里些
                 that.mainSpread.bind(GC.Spread.Sheets.Events.LeaveCell, that.mainSpreadLeaveCell);
                 that.mainSpread.bind(GC.Spread.Sheets.Events.EnterCell, that.mainSpreadEnterCell);
                 that.mainSpread.bind(GC.Spread.Sheets.Events.EditStarting, that.mainSpreadEditStarting);
@@ -739,6 +741,7 @@ var projectObj = {
                 if(projectReadOnly){
                     disableSpread(that.mainSpread);
                 }
+                console.log(decimalObj.decimal());
                 $.bootstrapLoading.end();
             }
             else {
@@ -747,6 +750,150 @@ var projectObj = {
         });
 
     },
+    mainSpreadEnterKey: function () {
+        let me = projectObj;
+        let sheet = me.mainSpread.getActiveSheet();
+        let orgRow = sheet.getActiveRowIndex();
+        let orgCol = sheet.getActiveColumnIndex();
+        let orgField = colSettingObj.getFieldByCol(orgCol);
+        let selected = me.project.mainTree.items[orgRow];
+        if(sheet.isEditing()){
+            sheet.endEdit();
+        }
+        //正常情况,焦点应该是在下一行的同一列
+        let newRow = orgRow + 1, newCol = orgCol;
+        //getColByField getVisible都不提出来,减少调用次数
+        if(selected){
+            //在分项/补项的编码单元格回车,焦点应跳动至本行的工程量单元格
+            if(orgField && orgField === 'code' && selected.sourceType === me.project.Bills.getSourceType() && [billType.FX, billType.BX].includes(selected.data.type)){
+                let quantityCol = colSettingObj.getColByField('quantity');
+                let quantityVisible = colSettingObj.getVisible('quantity');
+                if(quantityCol !== null && quantityVisible !== false){
+                    newRow = orgRow;
+                    newCol = quantityCol;
+                }
+            }
+            else if(orgField && orgField === 'quantity' && selected.sourceType === me.project.Bills.getSourceType() && [billType.FX, billType.BX].includes(selected.data.type)){
+                //在分项/补项的工程量单元格回车,如果其下有定额/量价/人材机,焦点应跳动至其下第一条定额/量价/人材机的工程量,如果是空行,则跳到至第一条定额xx的编码;
+                if(selected.children.length !== 0 && !(isDef(selected.children[0].data.code) && selected.children[0].data.code.toString().trim() !== '')){
+                    let codeCol = colSettingObj.getColByField('code');
+                    let codeVisible = colSettingObj.getVisible('code');
+                    newRow = orgRow + 1;
+                    if(codeCol !== null && codeVisible !== false){
+                        newCol = codeCol;
+                    }
+                }
+                //如果其下没有定额/量价/人材机,则自动在其下插入一条定额空行,在其后自动插入一条分项空行,焦点跳动至定额空行的编码单元格。
+                else if(selected.children.length === 0){
+                    //在其后插入分项
+                    if(!(projectInfoObj.projectInfo.property.lockBills && projectObj.project.withinBillsLocked(projectObj.project.mainTree.selected))){
+                        ProjectController.addFX(me.project, me.mainController);
+                        //将焦点行设置成原本的行,以插入定额
+                        me.mainController.setTreeSelected(me.project.mainTree.items[orgRow]);
+                    }
+                    //插入定额
+                    me.project.Ration.addNewRation(null, rationType.ration, function () {
+                        newRow = sheet.getActiveRowIndex();
+                        let codeCol = colSettingObj.getColByField('code');
+                        let codeVisible = colSettingObj.getVisible('code');
+                        if(codeCol !== null && codeVisible !== false){
+                            newCol = codeCol;
+                        }
+                        sheet.setActiveCell(newRow, newCol);
+                    });
+                }
+            }
+            //在定额/量价/人材机的编码单元格回车,焦点应跳动至本行的工程量单元格
+            else if(orgField && orgField === 'code' && selected.sourceType === me.project.Ration.getSourceType()){
+                let quantityCol = colSettingObj.getColByField('quantity');
+                let quantityVisible = colSettingObj.getVisible('quantity');
+                if(quantityCol !== null && quantityVisible !== false){
+                    newRow = orgRow;
+                    newCol = quantityCol;
+                }
+            }
+            //在定额/量价/人材机的工程量单元格回车
+            else if(orgField && orgField === 'quantity' && selected.sourceType === me.project.Ration.getSourceType()){
+                let nextSibling = selected.nextSibling;
+                //如果其后有定额/量价/人材机(空行:编码为空不算),焦点应跳动至下一行定额/量价/人材机的工程量,不需处理
+
+                //如果其后没有定额/量价/人材机(空行也没有),则自动在其后插入一行定额空行,焦点跳动至定额空行的编码单元格
+                if(!nextSibling){
+                    let codeCol = colSettingObj.getColByField('code');
+                    let codeVisible = colSettingObj.getVisible('code');
+                    me.project.Ration.addNewRation(null, rationType.ration, function () {
+                        newRow = sheet.getActiveRowIndex();
+                        if(codeCol !== null && codeVisible !== false){
+                            newCol = codeCol;
+                        }
+                        sheet.setActiveCell(newRow, newCol);
+                    });
+                }
+                //如果其后有定额空行,焦点跳动至定额空行的编码单元格
+                else if(nextSibling && !(isDef(nextSibling.data.code) && nextSibling.data.code.toString().trim() !== '')) {
+                    let codeCol = colSettingObj.getColByField('code');
+                    let codeVisible = colSettingObj.getVisible('code');
+                    if(codeCol !== null && codeVisible !== false){
+                        newRow = orgRow + 1;
+                        newCol = codeCol;
+                    }
+                }
+            }
+            //在清单的编码单元格回车,如果清单是叶子节点,焦点跳动至本行的工程量单元格
+            else if(orgField && orgField === 'code' && selected.sourceType === me.project.Bills.getSourceType()
+                && selected.data.type === billType.BILL && selected.source.children.length === 0){
+                let quantityCol = colSettingObj.getColByField('quantity');
+                let quantityVisible = colSettingObj.getVisible('quantity');
+                if(quantityCol && quantityVisible){
+                    newRow = orgRow;
+                    newCol = quantityCol;
+                }
+            }
+
+
+        }
+        //设置焦点
+        sheet.setActiveCell(newRow, newCol);
+        //触发表格事件
+        me.mainController.setTreeSelected(me.project.mainTree.items[newRow]);//SelectionChanged
+        me.mainSpreadLeaveCell({type: 'LeaveCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: orgRow, col: orgCol});
+        me.mainSpreadEnterCell({type: 'EnterCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: newRow, col: newCol});
+
+    },
+    //注册自定义回车键事件
+    bindEnterKey: function (workBook, registerName, operation) {
+        let me = this;
+        let sheet = workBook.getActiveSheet();
+        workBook.commandManager().register(registerName, operation);
+       /* workBook.commandManager().register(registerName, function(){
+            operation();
+           /!* let orgRow = sheet.getActiveRowIndex();
+            let orgCol = sheet.getActiveColumnIndex();
+            if(sheet.isEditing()){
+                sheet.endEdit();
+            }
+            let code = sheet.getValue(orgRow, 0);
+            let newRow, newCol;
+            if(!me.currentCache[orgRow] && code !== undefined && code !== null && orgCol !== me.setting.header.length - 1){
+                newRow = orgRow;
+                newCol = orgCol + 1;
+                sheet.setActiveCell(newRow, newCol);
+            }
+            else{
+                newRow = orgRow + 1;
+                newCol = me.currentCache[orgRow + 1] ? orgCol : 0;
+                sheet.setActiveCell(newRow, newCol);
+            }*!/
+            //触发事件
+            /!*me.onLeaveCell({type: 'LeaveCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: orgRow, col: orgCol});
+            me.onEnterCell({type: 'EnterCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: newRow, col: newCol});
+            let newSels = [{row: newRow, rowCount: 1, col: newCol, colCount: 1}];
+            let oldSels = [{row: orgRow, rowCount: 1, col: orgRow, colCount: 1}];
+            me.onSelectionChanged({type: 'SelectionChanged'}, {sheet: sheet, sheetName: sheet.name(), newSelections: newSels, oldSelections: oldSels});*!/
+        });*/
+        workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.enter, false, false, false, false);
+        workBook.commandManager().setShortcutKey(registerName, GC.Spread.Commands.Key.enter, false, false, false, false);
+    },
     loadMainSpreadContextMenu: function () {
         var project = this.project, spread = this.mainSpread, controller = this.mainController;
         $.contextMenu({

+ 1 - 1
web/building_saas/report/html/rpt_content_format.html

@@ -2,7 +2,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title">格式</h5>
+                <h5 class="modal-title">格式</h5><h6 id="update_msg_response"></h6>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">&times;</span>
                 </button>

+ 12 - 19
web/building_saas/report/html/rpt_print.html

@@ -41,15 +41,15 @@
         if (sessionStorage.multiRptsData) {
             let multiRptData = JSON.parse(sessionStorage.multiRptsData);
             let scaleFactor = parseInt(sessionStorage.scaleFactor);
-            let svgArr = [];
             for (let idx = 0; idx < multiRptData.length; idx++) {
                 let pageData = multiRptData[idx];
                 if (idx === 0) {
                     $(document).attr("title", pageData[JV.NODE_PAGE_INFO][JV.NODE_MAIN_INFO_RPT_NAME]);
                 }
-                svgArr = svgArr.concat(rptPrintHelper.buildSvgArr(pageData, -30, -30));
+                let svgArr = rptPrintHelper.buildSvgArr(pageData, -30, -30);
+                let orientation = (pageData[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE][0] < pageData[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE][1])?"纵向":"横向";
+                showPreviewData(svgArr, scaleFactor, sessionStorage.pageSize, orientation);
             }
-            showPreviewData(svgArr, scaleFactor, sessionStorage.pageSize, sessionStorage.orientation);
             window.print();
         } else if (sessionStorage.currentPageData) {
             let pageData = JSON.parse(sessionStorage.currentPageData);
@@ -70,36 +70,29 @@
 
     function showPreviewData(svgArr, scaleFactor, pageSize, orientation) {
         let orgHeight = 793, orgWidth = 1122;
-        let pageHeight = orgHeight * scaleFactor, pageWidth = orgWidth * scaleFactor;
         if (pageSize === 'A3') {
-            pageHeight = orgWidth * scaleFactor;
-            pageWidth = orgHeight * 2 * scaleFactor;
             orgHeight = 1122;
             orgWidth = 793 * 2;
-        } else if (pageSize === '自定义') {
+        } else if (pageSize.indexOf('自定义') >= 0) {
             //自定义
+        } else {
+            //其他size(LEGAL, 16K etc.)
         }
+        let pageHeight = orgHeight * scaleFactor, pageWidth = orgWidth * scaleFactor;
         if (orientation === "纵向") {
-            let tmpInt = pageHeight;
-            pageHeight = pageWidth;
-            pageWidth = tmpInt;
-
-            tmpInt = orgWidth;
-            orgWidth = orgHeight;
-            orgHeight = tmpInt;
+            pageHeight = orgWidth * scaleFactor;
+            pageWidth = orgHeight * scaleFactor;
         }
 
         for (let i = 0; i < svgArr.length; i++) {
             let div = $('<div class="pageBreak"></div>');
             div.append($(svgArr[i].join("")));
-            $("body").append(div);
-        }
-        $(document.body).find("div").each(function(index,element){
-            $(element).find("svg").each(function(cIdx,elementSvg){
+            $(div).find("svg").each(function(cIdx,elementSvg){
                 elementSvg.setAttribute('height', pageHeight);
                 elementSvg.setAttribute('width', pageWidth);
             });
-        });
+            $("body").append(div);
+        }
     }
 
     function closing() {

+ 51 - 32
web/building_saas/report/js/rpt_main.js

@@ -29,6 +29,7 @@ let zTreeOprObj = {
     checkedRptTplNodes: null,
     currentRptPageRst: null,
     reportPageCfg: null,
+    defReportPageCfg: null,
     currentPage: 1,
     maxPages: 0,
     countChkedRptTpl: function () {
@@ -90,40 +91,45 @@ let zTreeOprObj = {
         params.engineerId = projectInfoObj.projectInfo.property.engineering;
         CommonAjax.postEx("report_tpl_api/getCustomizeCfg", params, 20000, true, function(result){
                 if (result) {
-                    me.reportPageCfg = result;
-                    $("#elementMargin_Left").get(0).value = result.margins.Left;
-                    $("#elementMargin_Right").get(0).value = result.margins.Right;
-                    $("#elementMargin_Top").get(0).value = result.margins.Top;
-                    $("#elementMargin_Bottom").get(0).value = result.margins.Bottom;
-
-                    for (let font of result.fonts) {
-                        let fontPropSuffix = "title";
-                        if (font.CfgDispName === "表标题") {
-                            fontPropSuffix = "title";
-                        } else if (font.CfgDispName === "列标题") {
-                            fontPropSuffix = "column";
-                        } else if (font.CfgDispName === "正文内容") {
-                            fontPropSuffix = "content";
-                        } else if (font.CfgDispName === "合计") {
-                            fontPropSuffix = "summary";
-                        } else if (font.CfgDispName === "表眉/表脚") {
-                            fontPropSuffix = "header_footer";
-                        }
-                        document.getElementById("fontName_" + fontPropSuffix).value = font.Name;
-                        document.getElementById("fontHeight_" + fontPropSuffix).value = font.FontHeight;
-                        document.getElementById("font_bold_" + fontPropSuffix).className = (font.FontBold === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
-                        document.getElementById("font_italic_" + fontPropSuffix).className = (font.FontItalic === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
-                        document.getElementById("font_underline_" + fontPropSuffix).className = (font.FontUnderline === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
-                    }
-                    document.getElementById("rpt_vertical_line").checked = result.showVerticalLine;
-                    document.getElementById("rpt_narrow").checked = result.isNarrow;
-                    document.getElementById("rpt_fill_zero").checked = result.fillZero;
+                    me.defReportPageCfg = result[0];
+                    me.reportPageCfg = result[1];
+                    me.renderRptCfg(result[1]);
                 } else {
                     me.reportPageCfg = null;
+                    me.defReportPageCfg = null;
                 }
             }, null, null
         );
     },
+    renderRptCfg: function (cfg) {
+        $("#elementMargin_Left").get(0).value = cfg.margins.Left;
+        $("#elementMargin_Right").get(0).value = cfg.margins.Right;
+        $("#elementMargin_Top").get(0).value = cfg.margins.Top;
+        $("#elementMargin_Bottom").get(0).value = cfg.margins.Bottom;
+
+        for (let font of cfg.fonts) {
+            let fontPropSuffix = "title";
+            if (font.CfgDispName === "表标题") {
+                fontPropSuffix = "title";
+            } else if (font.CfgDispName === "列标题") {
+                fontPropSuffix = "column";
+            } else if (font.CfgDispName === "正文内容") {
+                fontPropSuffix = "content";
+            } else if (font.CfgDispName === "合计") {
+                fontPropSuffix = "summary";
+            } else if (font.CfgDispName === "表眉/表脚") {
+                fontPropSuffix = "header_footer";
+            }
+            document.getElementById("fontName_" + fontPropSuffix).value = font.Name;
+            document.getElementById("fontHeight_" + fontPropSuffix).value = font.FontHeight;
+            document.getElementById("font_bold_" + fontPropSuffix).className = (font.FontBold === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
+            document.getElementById("font_italic_" + fontPropSuffix).className = (font.FontItalic === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
+            document.getElementById("font_underline_" + fontPropSuffix).className = (font.FontUnderline === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
+        }
+        document.getElementById("rpt_vertical_line").checked = cfg.showVerticalLine;
+        document.getElementById("rpt_narrow").checked = cfg.isNarrow;
+        document.getElementById("rpt_fill_zero").checked = cfg.fillZero;
+    },
     refreshNodes: function() {
         let me = this;
         let private_setupIsParent = function(node){
@@ -333,10 +339,11 @@ let rptControlObj = {
         } else if ($("#excelExportType_IndividualBook").get(0).checked) {
             if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
                 let urls = [];
+                let orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
                 for (let tplNode of zTreeOprObj.checkedRptTplNodes) {
                     let orgRptName = tplNode.name;
                     let url =  "/report_api/getExcel/" + projectInfoObj.projectInfo.ID + "/" + tplNode.refId + "/" +
-                        me.getCurrentPageSize() + "/" + me.getCurrentOrientation() + "/" + orgRptName + "/" + true + "/" + 'normal';
+                        me.getCurrentPageSize() + "/" + orientation + "/" + orgRptName + "/" + true + "/" + 'normal';
                     urls.push(url);
                 }
                 downloadReport(urls);
@@ -347,10 +354,11 @@ let rptControlObj = {
         let me = rptControlObj;
         if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
             let urls = [];
+            let orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
             for (let tplNode of zTreeOprObj.checkedRptTplNodes) {
                 let orgRptName = tplNode.name;
                 let url =  "/report_api/getPDF/" + projectInfoObj.projectInfo.ID + "/" + tplNode.refId + "/" +
-                    me.getCurrentPageSize() + "/" + me.getCurrentOrientation() + "/" + orgRptName;
+                    me.getCurrentPageSize() + "/" + orientation + "/" + orgRptName;
                 urls.push(url);
             }
             downloadReport(urls);
@@ -429,8 +437,19 @@ let rptControlObj = {
         let params = {};
         params.custCfg = zTreeOprObj.reportPageCfg;
         CommonAjax.postEx("report_tpl_api/saveCustomerCfg", params, 20000, true, function(result){
-                alert("Save successfully!");
-            }, null, null
+                // alert("Save successfully!");
+                $("#update_msg_response")[0].style.color = "green";
+                $("#update_msg_response")[0].innerHTML = " (保存成功!)";
+                setTimeout(function(){
+                    $("#update_msg_response")[0].innerHTML = "";
+                }, 1000);
+            }, function (failRst) {
+                $("#update_msg_response")[0].style.color = "red";
+                $("#update_msg_response")[0].innerHTML = " (保存失败!)";
+                setTimeout(function(){
+                    $("#update_msg_response")[0].innerHTML = "";
+                }, 1000);
+            }, null
         );
     },
     confirmCfgChange: function() {

+ 2 - 1
web/building_saas/report/js/rpt_print.js

@@ -58,7 +58,8 @@ let rptPrintHelper = {
             let page = pagesData.items[idx];
             let svgPageArr = [], pixelSize = getPixelSize(pagesData);
             svgPageArr.push("<svg width='" + pixelSize[0] + "' height='" + pixelSize[1] + "'>");
-            let adjustY = 0.5 * ((idx + 1) % 2);
+            // let adjustY = 0.5 * ((idx + 1) % 2);
+            let adjustY = 0.5;
             for (let cell of page.cells) {
                 svgPageArr.push(buildCellSvg(cell, fonts, styles, controls, page[JV.PROP_PAGE_MERGE_BORDER], pagesData[JV.BAND_PROP_MERGE_BAND], offsetX, offsetY, adjustY, canvas));
             }