Browse Source

bug fixed

zhongzewei 7 years ago
parent
commit
ad2ef33c15

+ 2 - 1
config/gulpConfig.js

@@ -152,6 +152,7 @@ module.exports = {
         'public/web/id_tree.js',
         'public/web/tree_sheet/tree_sheet_controller.js',
         'public/web/tree_sheet/tree_sheet_helper.js',
+        'public/web/ration_glj_units.js',
         'web/building_saas/complementary_glj_lib/js/glj.js',
         'web/building_saas/complementary_glj_lib/js/gljClassTree.js',
         'web/building_saas/complementary_glj_lib/js/gljComponent.js',
@@ -182,7 +183,7 @@ module.exports = {
         'public/web/scMathUtil.js',
         'public/web/common_ajax.js',
         'public/web/ztree_common.js',
-        'web/building_saas/complementary_ration_lib/js/rationUnits.js',
+        'public/web/ration_glj_units.js',
         'web/building_saas/complementary_ration_lib/js/ration.js',
         'web/building_saas/complementary_ration_lib/js/ration_glj.js',
         'web/building_saas/complementary_ration_lib/js/ration_coe.js',

+ 5 - 0
modules/complementary_ration_lib/models/sectionTreeModel.js

@@ -4,6 +4,7 @@
 
 const mongoose = require('mongoose');
 const compleRationSectionTreeModel = mongoose.model('complementary_ration_section_tree');
+const compleRationModel = mongoose.model('complementary_ration_items');
 let counter = require('../../../public/counter/counter');
 let stdSectionTreeModel = require ('../../ration_repository/models/ration_section_tree').Model;
 
@@ -75,6 +76,10 @@ class SectionTreeDao {
                 }
                 else if(updateObj.updateType === 'update'){
                     await compleRationSectionTreeModel.update({userId: userID, rationRepId: updateObj.updateData.rationRepId, ID: updateObj.updateData.ID}, updateObj.updateData);
+                    if(updateObj.updateData.deleteInfo){
+                        await compleRationModel.update({userId: userID, sectionId: updateObj.updateData.ID},
+                            {$set: {deleteInfo: {deleted: true, deleteBy: userID, deleteDateTime: Date.now()}}}, {multi: true});
+                    }
                 }
             }
             callback(0, 'success');

+ 49 - 0
public/web/ration_glj_units.js

@@ -0,0 +1,49 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Zhong
+ * @date 2018/6/4
+ * @version
+ */
+//定额与工料机公用单位
+const rationAndGljUnits =[
+    'm',
+    'm2',
+    'm3',
+    '台班',
+    '工日',
+    't',
+    'kg',
+    '座',
+    '组',
+    '宗',
+    '元',
+    '套',
+    '台',
+    '千米',
+    '千克',
+    '辆',
+    '块',
+    '公斤',
+    '付',
+    '部',
+    '10t',
+    '10m',
+    '10 m2',
+    '10 m3',
+    '100m',
+    '100 m2',
+    '100 m3',
+    '1000m',
+    '1000 m2',
+    '1000 m3',
+    '10000块',
+    '立方米',
+    '平方米',
+    '株',
+    '棵',
+    '项',
+    '樘'
+];

+ 2 - 2
public/web/sheet/sheet_common.js

@@ -12,7 +12,7 @@ var sheetCommonObj = {
         spreadBook.options.showVerticalScrollbar = true;
         spreadBook.options.allowCopyPasteExcelStyle = false;
         spreadBook.options.allowUserDragDrop = true;
-        spreadBook.options. allowUserEditFormula = false;
+        spreadBook.options.allowUserEditFormula = false;
         return spreadBook;
     },
 
@@ -34,7 +34,7 @@ var sheetCommonObj = {
 
         sheet.options.colHeaderAutoTextIndex = 1;
         sheet.options.colHeaderAutoText = spreadNS.HeaderAutoText.numbers;
-
+        sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
         sheet.options.protectionOptions = {
             allowResizeColumns: true
         };

+ 1 - 1
public/web/tree_sheet/tree_sheet_controller.js

@@ -53,7 +53,7 @@ var TREE_SHEET_CONTROLLER = {
                 if (this.tree.delete(this.tree.selected)) {
                     TREE_SHEET_HELPER.massOperationSheet(this.sheet, function () {
                         that.sheet.deleteRows(sels[0].row, that.tree.selected.posterityCount() + 1);
-                        that.setTreeSelected(that.tree.items[sels[0].row]);
+                        that.setTreeSelected(that.tree.items[sels[0].row] ? that.tree.items[sels[0].row] : that.tree.items[that.tree.items.length - 1]);
                     });
                     if(typeof cbTools !== 'undefined'){
                         cbTools.refreshFormulaNodes();

+ 1 - 0
web/building_saas/complementary_glj_lib/html/tools-gongliaoji.html

@@ -153,6 +153,7 @@
     <script type="text/javascript" src="/public/web/id_tree.js"></script>
     <script type="text/javascript" src="/public/web/tree_sheet/tree_sheet_controller.js"></script>
     <script type="text/javascript" src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
+    <script type="text/javascript" src="/public/web/ration_glj_units.js"></script>
     <script type="text/javascript" src="/web/building_saas/complementary_glj_lib/js/glj.js"></script>
     <script type="text/javascript" src="/web/building_saas/complementary_glj_lib/js/gljClassTree.js"></script>
     <script type="text/javascript" src="/web/building_saas/complementary_glj_lib/js/gljComponent.js"></script>

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

@@ -60,6 +60,21 @@ let repositoryGljObj = {
             ]
         }
     },
+    setUnitCombo: function (sheet, headers) {
+        let me = this;
+        sheet.suspendPaint();
+        sheet.suspendEvent();
+        let combo = sheetCommonObj.getDynamicCombo();
+        combo.items(rationAndGljUnits).itemHeight(10).editable(true);
+        for(let i = 0; i < headers.length; i++){
+            if(headers[i].dataCode === 'unit'){
+                sheet.getRange(-1, i, -1, 1).cellType(combo);
+                break;
+            }
+        }
+        sheet.resumePaint();
+        sheet.resumeEvent();
+    },
     getComboData: function (gljDistType) {
         let me = this;
         let distType;
@@ -162,6 +177,7 @@ let repositoryGljObj = {
         let me = repositoryGljObj;
         me.workBook = sheetOpr.buildSheet(container, me.setting, 30);
         me.repositoryGljDelOpr();
+        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);
         me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditStarting, me.onCellEditStart);

+ 2 - 2
web/building_saas/complementary_ration_lib/html/anzhuang.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
+    <title>定额库编辑器-Smartcost</title>
     <!--inject:css-->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.sc.css" type="text/css">
@@ -39,7 +39,7 @@
                       <a class="nav-link px-3" id="gongliao" href="gongliao.html">人材机</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="fuzhu" href="fuzhu.html">附注条件</a>
+                      <a class="nav-link px-3" id="fuzhu" href="fuzhu.html">子目换算</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link active px-3" >安装增加费</a>

+ 2 - 2
web/building_saas/complementary_ration_lib/html/dinge.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
+    <title>定额库编辑器-Smartcost</title>
     <!--inject:css-->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css" type="text/css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css" type="text/css">
@@ -481,7 +481,7 @@
 <!--  <script type="text/javascript" src="/public/web/scMathUtil.js"></script>-->
 <script type="text/javascript" src="/public/web/common_ajax.js"></script>
 <script type="text/javascript" src="/public/web/ztree_common.js"></script>
-<script type="text/javascript" src="/web/building_saas/complementary_ration_lib/js/rationUnits.js"></script>
+<script type="text/javascript" src="/public/web/ration_glj_units.js"></script>
 <script type="text/javascript" src="/web/building_saas/complementary_ration_lib/js/ration.js"></script>
 <script type="text/javascript" src="/web/building_saas/complementary_ration_lib/js/ration_glj.js"></script>
 <!--     <script type="text/javascript" src="/public/web/sheet/sheet_creater.js"></script>-->

+ 2 - 2
web/building_saas/complementary_ration_lib/html/fuzhu.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
+    <title>定额库编辑器-Smartcost</title>
     <!--inject:css-->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
@@ -38,7 +38,7 @@
                       <a class="nav-link px-3" id="gongliao" href="javascript:void(0);">人材机</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link active px-3">附注条件</a>
+                      <a class="nav-link active px-3">子目换算</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link px-3" id="anzhuang" href="javascript:void(0);">安装增加费</a>

+ 2 - 2
web/building_saas/complementary_ration_lib/html/gongliao.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
+    <title>定额库编辑器-Smartcost</title>
     <!--inject:css-->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
@@ -41,7 +41,7 @@
                       <a class="nav-link active px-3">人材机</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="fuzhu" href="javascript:void(0);">附注条件</a>
+                      <a class="nav-link px-3" id="fuzhu" href="javascript:void(0);">子目换算</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link px-3" id="anzhuang" href="javascript:void(0);">安装增加费</a>

+ 1 - 1
web/building_saas/complementary_ration_lib/html/main.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
+    <title>定额库编辑器-Smartcost</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
    <!-- <link rel="stylesheet" href="css/bootstrap/themes.css">-->
     <link rel="stylesheet" href="/web/building_saas/css/main.css">

+ 15 - 15
web/building_saas/complementary_ration_lib/js/ration.js

@@ -70,7 +70,7 @@ let rationOprObj = {
         sheet.suspendEvent();
         if(combo){
             combo = sheetCommonObj.getDynamicCombo();
-            combo.items(rationUnits).itemHeight(10).editable(true);
+            combo.items(rationAndGljUnits).itemHeight(10).editable(true);
         }
         sheet.getRange(-1, me.setting.view.comboBox[0].col, -1, 1).cellType(combo);
         sheet.resumePaint();
@@ -176,7 +176,7 @@ let rationOprObj = {
                             for(let i = 0; i < sels[sel].rowCount; i++){
                                 if(sels[sel].row + i < cacheSection.length && cacheSection[sels[sel].row + i].type !== me.type.std){
                                     removeArr.push(cacheSection[sels[sel].row + i].ID);
-                                    me.rationsCodes.splice(me.rationsCodes.indexOf(cacheSection[sels[sel].row + i].code), 1);
+                                    me.rationsCodes.splice(me.rationsCodes.indexOf(cacheSection[sels[sel].row + i].code.toString()), 1);
                                 }
                             }
                         }
@@ -293,9 +293,9 @@ let rationOprObj = {
                 if(me.currentEditingRation[dataCode] !== rObj[dataCode]){
                     me.addRationItem = rObj;
                     if(dataCode === 'code'){
-                        if(me.rationsCodes.indexOf(rObj.code) === -1){
-                            me.rationsCodes.splice(me.rationsCodes.indexOf(rObj.code), 1);
-                            me.rationsCodes.push(rObj.code);
+                        if(me.rationsCodes.indexOf(rObj.code.toString()) === -1){
+                            me.rationsCodes.splice(me.rationsCodes.indexOf(rObj.code.toString()), 1);
+                            me.rationsCodes.push(rObj.code.toString());
                             updateArr.push(rObj);
                         }
                         else{
@@ -324,7 +324,7 @@ let rationOprObj = {
                 //addArr.push(rObj);
                 me.addRationItem = rObj;
                 if(rObj.code && rObj.code.toString().trim().length > 0){
-                    if(me.rationsCodes.indexOf(rObj.code) === -1){
+                    if(me.rationsCodes.indexOf(rObj.code.toString()) === -1){
                         //jobContent
                         if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
                             rObj.jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
@@ -334,7 +334,7 @@ let rationOprObj = {
                         }
                         me.setInitPrc(rObj);
                         addArr.push(rObj);
-                        me.rationsCodes.push(rObj.code);
+                        me.rationsCodes.push(rObj.code.toString());
                         me.addRationItem = null;
                     }
                     else{
@@ -386,11 +386,11 @@ let rationOprObj = {
         for (let i = 0; i < items.length; i++) {
             let rowIdx = info.cellRange.row + i;
             if (cacheSection) {
-                if(!me.isValidUnit(items[i], rationUnits)){//无效单位
+               /* if(!me.isValidUnit(items[i], rationUnits)){//无效单位
                     items[i].unit = rowIdx < cacheSection.length  && typeof cacheSection[rowIdx].unit !== 'undefined' ? cacheSection[rowIdx].unit : '';
-                }
+                }*/
                 if(!cacheSection[rowIdx] && info.cellRange.col === 0 ){
-                    if(me.rationsCodes.indexOf(items[i].code) === -1){
+                    if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
                         //jobConten
                         if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
                             items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
@@ -400,7 +400,7 @@ let rationOprObj = {
                         }
                         me.setInitPrc(items[i]);
                         addArr.push(items[i]);
-                        me.rationsCodes.push(items[i].code);
+                        me.rationsCodes.push(items[i].code.toString());
                     }
                     else{
                         me.workBook.getSheet(0).setValue(rowIdx, 0, '');
@@ -417,7 +417,7 @@ let rationOprObj = {
                         me.workBook.getSheet(0).setValue(rowIdx, 8, '');
                     }
                     if(info.cellRange.col === 0){
-                        if(me.rationsCodes.indexOf(items[i].code) === -1){
+                        if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
                             items[i].ID = cacheSection[rowIdx].ID;
                             updateArr.push(items[i]);
                         }
@@ -432,13 +432,13 @@ let rationOprObj = {
                 }
 
             } else {
-                if(!me.isValidUnit(items[i], rationUnits)){//无效单位
+                /*if(!me.isValidUnit(items[i], rationUnits)){//无效单位
                     items[i].unit = '';
-                }
+                }*/
                 //add
                 if(info.cellRange.col === 0){
                     //是否含有已存在的编号
-                        if(me.rationsCodes.indexOf(items[i].code) === -1){
+                        if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
                             //jobConten
                             if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
                                 items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';

+ 1 - 1
web/building_saas/complementary_ration_lib/js/ration_coe.js

@@ -289,7 +289,7 @@ var rationCoeOprObj = {
             var curCache = me.cache["_Coe_" + me.curRation.ID];
             if (curCache) {
                 for (let obj of curCache) {
-                    rst.push(obj.ID);
+                    rst.push({ID: obj.ID, no: obj.no});
                 };
                 me.curRation.rationCoeList = rst;
                 updateArr.push(me.curRation);

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

@@ -256,7 +256,7 @@ var rationGLJOprObj = {
                         }
                     }
                     if (isExist) {
-                        alert("该工料机已存在!");
+                        alert("人材机已存在!");
                         args.sheet.setValue(args.row, args.col, typeof cacheArr[args.row] !== 'undefined' ? cacheArr[args.row].code + '' : '');
                     }
                     else {
@@ -402,7 +402,7 @@ var rationGLJOprObj = {
                     return rst;
                 });
                 $('#alertModalBtn').click();
-                $('#alertText').text("工料机"+ codes + "不存在,请查找你所需要的工料机,或新增工料机");
+                $('#alertText').text("人材机"+ codes + "不存在,请查找你所需要的人材机,或新增人材机");
                 $('#alertModalCls').click(function () {
                     me.showGljItems(me.currentRationItem.ID);
                 });

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

@@ -353,6 +353,7 @@ let sectionTreeObj = {
                     me.refreshBtn(me.tree.selected);
                     //fresh tools
                     me.initTools(me.tree.selected);
+                    me.initSelection(me.tree.selected);
                 });
             }
         });
@@ -400,6 +401,7 @@ let sectionTreeObj = {
                 me.controller.delete();
                 me.refreshBtn(me.tree.selected);
                 me.initTools(me.tree.selected);
+                me.initSelection(me.tree.selected);
             });
         }
     },
@@ -439,8 +441,14 @@ let sectionTreeObj = {
     initSelection: function (node) {
         let me = this;
         if(!me.isDef(node)){
+            sheetCommonObj.cleanSheet(rationOprObj.workBook.getActiveSheet(), rationOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
             return;
         }
+        me.workBook.getActiveSheet().setActiveCell(node.serialNo(), 0);
         me.initTools(node);
         me.refreshBtn(node);
         if(!me.isDef(node.children) || node.children.length === 0){

+ 21 - 8
web/building_saas/main/js/views/character_content_view.js

@@ -731,8 +731,12 @@ let characterOprObj = {
         }
     },
     initSelection: function (row) {
+        console.log('enter');
         let me = characterOprObj;
         let disObj = {itemAdd: false, itemInsert: true, itemDel: true, itemUp: true, itemDown: true};
+        if(projectObj.project.mainTree.selected.sourceType !== projectObj.project.Bills.getSourceType()){
+            disObj.itemAdd = true;
+        }
         //清单锁定,不可用
         if(projectInfoObj.projectInfo.property.lockBills){
             disObj.itemAdd = true;
@@ -894,14 +898,20 @@ let pageCCOprObj = {
     },
     //设置特征及内容currentCache
     setCacheAndShow: function (node) {
-        let theCont = contentOprObj, theCha = characterOprObj;
-        node.data.jobContent = node && typeof node.data.jobContent !== 'undefined' ? node.data.jobContent : [];
-        node.data.itemCharacter = node && typeof node.data.itemCharacter !== 'undefined' ? node.data.itemCharacter : [];
-        theCont.currentCache =  node.data.jobContent;
-        theCha.currentCache = node.data.itemCharacter;
-        this.currentFindSet = node && typeof node.data.ID !== 'undefined' && typeof node.data.projectID ? {ID: node.data.ID, projectID: node.data.projectID} : null;
-        this.showData(theCont.workBook.getSheet(0), theCont.setting, theCont.currentCache);
-        this.showData(theCha.workBook.getSheet(0), theCha.setting, theCha.currentCache);
+        if(node && node.sourceType === projectObj.project.Bills.getSourceType()){
+            let theCont = contentOprObj, theCha = characterOprObj;
+            node.data.jobContent = node && typeof node.data.jobContent !== 'undefined' ? node.data.jobContent : [];
+            node.data.itemCharacter = node && typeof node.data.itemCharacter !== 'undefined' ? node.data.itemCharacter : [];
+            theCont.currentCache =  node.data.jobContent;
+            theCha.currentCache = node.data.itemCharacter;
+            this.currentFindSet = node && typeof node.data.ID !== 'undefined' && typeof node.data.projectID ? {ID: node.data.ID, projectID: node.data.projectID} : null;
+            this.showData(theCont.workBook.getSheet(0), theCont.setting, theCont.currentCache);
+            this.showData(theCha.workBook.getSheet(0), theCha.setting, theCha.currentCache);
+        }
+        else{
+            this.clearData();
+
+        }
     },
     //contentSpread、itemSpread展示数据用
     showData: function(sheet, setting, data) {
@@ -950,9 +960,12 @@ let pageCCOprObj = {
     clearData: function () {
         let theCon = contentOprObj, theCha = characterOprObj;
         theCon.workBook.getSheet(0).setRowCount(0);
+        theCon.refreshTools({jobAdd: true, jobInsert: true, jobDel: true, jobUp: true, jobDown: true});
         theCha.workBook.getSheet(0).setRowCount(0);
+        theCha.refreshTools({itemAdd: true, itemInsert: true, itemDel: true, itemUp: true, itemDown: true});
         sheetCommonObj.cleanSheet(theCon.workBook.getSheet(0), theCon.setting, -1);
         sheetCommonObj.cleanSheet(theCha.workBook.getSheet(0), theCha.setting, -1);
+
         projectObj.mainSpread.focus(true);
     },
     //锁定/解锁清单后添加规则的改变

+ 1 - 1
web/building_saas/main/js/views/project_property_indicativeInfo.js

@@ -64,7 +64,7 @@ let indicativeInfoObj = {
             sheet.setRowCount(datas.length);
             for(let col = 0, cLen = cols.length; col < cLen; col++){
                 //设置小数位数
-                if(cols[col]['dataCode'] === 'price'){
+                if(cols[col]['dataCode'] !== 'name'){
                     sheet.setFormatter(-1, col, MainTreeCol.getNumberFormatter(decimalObj.bills.totalPrice, true));
                 }
                 sheet.getRange(-1, col, -1, 1, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign[cols[col]['hAlign']]);

+ 41 - 50
web/building_saas/main/js/views/project_view.js

@@ -41,12 +41,7 @@ var projectObj = {
         //zhong 2017-9-1 特征及内容
         if(pageCCOprObj.active){
             pageCCOprObj.mainActiveCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];//mainSpread焦点单元格
-            if(node && node.sourceType === project.Bills.getSourceType()){
-                pageCCOprObj.setCacheAndShow(node);
-            }
-            else{
-                pageCCOprObj.clearData();
-            }
+            pageCCOprObj.setCacheAndShow(node);
         }
         // for test interface.  CSLAAAAA
         // projectObj.testDisplay('前四项累计值排除当前选中项' + projectObj.project.calcProgram.getBeforeTaxTotalFee([node]));
@@ -483,7 +478,6 @@ var projectObj = {
     },
     //repaint 动态下拉框
     mainSpreadEnterCell: function (sender, info) {
-        console.log('enterCell');
         let colSetting = projectObj.mainController.setting.cols[info.col];
         if(colSetting.data.field === 'unit' || (projectObj.lastCol&&projectObj.lastCol.data.field === 'unit')||colSetting.data.field ==='subType'
             || (projectObj.lastCol&&projectObj.lastCol.data.field === 'subType') || colSetting.data.field === 'programID' ||(projectObj.lastCol&&projectObj.lastCol.data.field === 'programID')){
@@ -1155,54 +1149,47 @@ var projectObj = {
         if(!isDef(node)){
             return null;
         }
-        //选中行
-        if(node === this.project.mainTree.selected){
-            styleMap = mapping.SELECTED;
-        }
-        //非选中行
-        else {
-            //清单大类
-            if(node.sourceType === this.project.Bills.getSourceType()){
-                //大项费用
-                if(node.data.type === billType.DXFY){
-                    styleMap = mapping.DXFY;
-                }
-                //分部
-                if(node.data.type === billType.FB){
-                    styleMap = mapping.FB;
+        //清单大类
+        if(node.sourceType === this.project.Bills.getSourceType()){
+            //大项费用
+            if(node.data.type === billType.DXFY){
+                styleMap = mapping.DXFY;
+            }
+            //分部
+            if(node.data.type === billType.FB){
+                styleMap = mapping.FB;
+            }
+            //分项
+            else if(node.data.type === billType.FX){
+                styleMap = mapping.FX;
+            }
+            //补项
+            else if(node.data.type === billType.BX){
+                styleMap = mapping.BX;
+            }
+            //清单
+            else if(node.data.type === billType.BILL){
+                //非叶子节点的清单
+                if(node.source.children.length > 0){
+                    styleMap = mapping.UNLEAFBILL;
                 }
-                //分项
-                else if(node.data.type === billType.FX){
-                    styleMap = mapping.FX;
+                //未使用基数计算的叶子节点的清单
+                else if(node.source.children.length === 0 && (!isDef(node.data.calcBase) || node.data.calcBase === '')){
+                    styleMap = mapping.UNCBBILL;
                 }
-                //补项
-                else if(node.data.type === billType.BX){
-                    styleMap = mapping.BX;
+                //使用基数计算的叶子节点的清单
+                else if(node.source.children.length === 0 && isDef(node.data.calcBase && node.data.calcBaseValue !== '')){
+                    styleMap = mapping.CBBILL;
                 }
-                //清单
-                else if(node.data.type === billType.BILL){
-                    //非叶子节点的清单
-                    if(node.source.children.length > 0){
-                        styleMap = mapping.UNLEAFBILL;
-                    }
-                    //未使用基数计算的叶子节点的清单
-                    else if(node.source.children.length === 0 && (!isDef(node.data.calcBase) || node.data.calcBase === '')){
-                        styleMap = mapping.UNCBBILL;
-                    }
-                    //使用基数计算的叶子节点的清单
-                    else if(node.source.children.length === 0 && isDef(node.data.calcBase && node.data.calcBaseValue !== '')){
-                        styleMap = mapping.CBBILL;
-                    }
-                }
-            }
-            //定额下的主材、设备
-            else if(node.sourceType === this.project.ration_glj.getSourceType()){
-                styleMap = mapping.ZCSB;
-            }
-            else {
-                styleMap = mapping.DEFAULT;
             }
         }
+        //定额下的主材、设备
+        else if(node.sourceType === this.project.ration_glj.getSourceType()){
+            styleMap = mapping.ZCSB;
+        }
+        else {
+            styleMap = mapping.DEFAULT;
+        }
         let styleSetting = colorSetting[styleMap];
         let defaultSetting = colorSetting[mapping.DEFAULT];
         if(!isDef(styleSetting)){
@@ -1224,6 +1211,10 @@ var projectObj = {
                 }
             }*/
         }
+        //选中行-替换底色
+        if(node === this.project.mainTree.selected){
+             style.backColor = colorSetting[mapping.SELECTED]['backColor'];
+        }
         style.borderLeft = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
         style.borderTop = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
         style.borderRight = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);

+ 4 - 8
web/building_saas/main/js/views/std_bills_lib.js

@@ -49,15 +49,12 @@ var billsLibObj = {
             sheet.resumePaint();
         }
     },
-    setTagForHint: function (datas) {
+    setTagForHint: function (nodes) {
         let sheet = this.stdBillsSpread.getActiveSheet();
         sheet.suspendPaint();
         sheet.suspendEvent();
-        for(let i = 0, len = sheet.getRowCount(); i < len; i++){
-            sheet.setTag(i, 2, '');
-        }
-        for(let i = 0, len = datas.length; i < len; i++){
-            sheet.setTag(i, 2, datas[i].ruleText ? datas[i].ruleText : '');
+        for(let node of nodes){
+            sheet.setTag(node.serialNo(), 2, node.data.ruleText ? node.data.ruleText : '');
         }
         sheet.resumePaint();
         sheet.resumeEvent();
@@ -185,9 +182,8 @@ var billsLibObj = {
                 that.stdBillsTree.setRootExpanded(that.stdBillsTree.roots, false);
             }
             stdBillsTreeController.showTreeData();
-            billsLibObj.setTagForHint(datas);
+            billsLibObj.setTagForHint(that.stdBillsTree.items);
             showBillsRela(that.stdBillsTree.firstNode());
-            console.log(that.stdBillsTree.items);
             stdBillsTreeController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, showBillsRela);
             that.stdBillsSpread.unbind(GC.Spread.Sheets.Events.CellDoubleClick);
             that.stdBillsSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, function (sender, args) {

+ 3 - 2
web/building_saas/main/js/views/sub_view.js

@@ -102,12 +102,13 @@ $("#linkTZJNR").click(function () {
         setRule(projectObj.project.property.addRule);
     }
     pageCCOprObj.mainActiveCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];
-    if(selectedNode && selectedNode.sourceType === projectObj.project.Bills.getSourceType()){
+    pageCCOprObj.setCacheAndShow(selectedNode);
+   /* if(selectedNode && selectedNode.sourceType === projectObj.project.Bills.getSourceType()){
         pageCCOprObj.setCacheAndShow(selectedNode);
     }
     else{
         pageCCOprObj.clearData();
-    }
+    }*/
     gljOprObj.activeTab='#linkTZJNR';
 });
 

+ 1 - 1
web/building_saas/pm/html/project-management-Recycle.html

@@ -64,7 +64,7 @@
                 <p>勾选需要恢复的文件,点“确定”按钮,确认从回收站中恢复。</p>
                 <table class="table table-hover table-sm mb-5">
                     <thead><tr style="display: block;"><th width="266px">名称</th><th width="136px">删除时间</th><th width="64px">勾选</th></tr></thead>
-                    <tbody style="display:block; height: 300px; overflow: auto">
+                    <tbody style="display:block; height: 300px; overflow: auto;">
                     <tr><td>XX单价文件</td><td>2017-11-01<br>12:11:43</td><td><input type="checkbox"></td></tr>
                     </tbody>
                 </table>

+ 22 - 14
web/building_saas/pm/js/pm_newMain.js

@@ -555,10 +555,9 @@ const projTreeObj = {
             }
             if(hitinfo.sheet.name() != "copyToSheet"){//如果是复制到sheet,不用执行
                 //建设项目,侧滑汇总
-                if(node.data.projType === projectType.project && withingClickArea()){
+                if(node.data.projType === projectType.project && withingClickArea() && !$('.slide-sidebar').hasClass('open')){
                     setDataToSideBar();
                     $(".slide-sidebar").animate({width:"440"}).addClass("open");
-                    $('body').unbind('click');
                     setTimeout(function () {
                         $("body").bind('click', function (event) {
                             var e = event || window.event; //浏览器兼容性
@@ -568,23 +567,29 @@ const projTreeObj = {
                                     if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
                                         return false;
                                     }
+                                    if($(elem).attr('id') && $(elem).attr('id') === 'del-wj'){
+                                        return false;
+                                    }
                                     elem = elem.parentNode;
                                 }
                                 $(".slide-sidebar").animate({width: "0"}).removeClass("open")// 关闭处理
+                                $('body').unbind('click');
                             }
                         });
                     }, 500);
                 }
                 //单项文件,进入造价书界面
                 else if(node.data.projType === projectType.tender && withingClickArea()){
-                    let newTab = window.open('about:blank');
-                    BeforeOpenProject(node.data.ID, {'fullFolder': GetFullFolder(node.parent)}, function () {
-                        let mainUrl = `/main?project=${node.data.ID}`;
-                        CommonAjax.get(mainUrl, [], function () {
-                            newTab.location.href = mainUrl;
+                    setTimeout(function () {
+                        let newTab = window.open('about:blank');
+                        BeforeOpenProject(node.data.ID, {'fullFolder': GetFullFolder(node.parent)}, function () {
+                            let mainUrl = `/main?project=${node.data.ID}`;
+                            CommonAjax.get(mainUrl, [], function () {
+                                newTab.location.href = mainUrl;
+                            });
                         });
-                    });
-                    return;
+                        return;
+                    }, 200);
                 }
                 if (!node || node.children.length === 0) { return; }
             }
@@ -861,6 +866,7 @@ $(document).ready(function() {
             a_updateFiles([updateObj], function () {
                 fileDelObj = null;
                 $('#fileDelCancel').click();
+                setDataToSideBar();
                 //refresh front?
             });
         }
@@ -2470,8 +2476,8 @@ function bindEvents_file_table(jqS, usedObj, targetBody, type){
             let newName = $(jqS + ' input').val().trim();
             if(newName !== orgName){
                 if(hasThisFileName(fileObjs, newName)){
-                    alert('本建设项目已存在该文件名,请重新输入!');
-                    $(jqS + ' input').val(orgName);
+                    $(jqS).find('span:eq(2)').show();
+                    //$(jqS + ' input').val(orgName);
                     return;
                 }
                 if(newName.trim().length === 0){
@@ -2510,6 +2516,7 @@ function bindEvents_file_table(jqS, usedObj, targetBody, type){
         $(jqS + ' .btn-secondary').on('click', function () {
             $(jqS + ' div:eq(0)').show();
             $(jqS + ' div:eq(1)').hide();
+            $(jqS).find('span:eq(2)').hide();
         });
     });
     //悬浮框显示使用该文件的单位工程
@@ -2552,7 +2559,9 @@ function set_file_table(target, poj_tenders, fileList, type){
             + '<span class="input-group-btn">'
             + '<button class="btn btn-secondary btn-sm" type="button"><i class="fa fa-remove"></i></button>'
             + '</span>'
-            + '</div></td>';
+            + '</div>'
+            + '<span class="form-text text-danger" style="display: none">本建设项目已存在该文件名,请重新输入!' +
+            '</span></td>';
         let fileTypeStr = type === fileType.unitPriceFile ? '单价文件' : '费率文件';
         let fileHtml = '<tr><td>' + fileCounter + '</td><td id="file_' + fileId + '"><div>' + fileList[i].name + hoverHtml + renHtml + usedHtml + '</tr>';
         fileCounter++;
@@ -2568,8 +2577,7 @@ function getFileObj(jqS, type){
     let trs = $('tr', jqS);
     for(let i = 0, len = trs.length; i < len; i++){
         let td = $('td:eq(1)', trs[i])[0];
-        let dispName = td.childNodes[0].childNodes[0].textContent;
-        let name = dispName.slice(0, dispName.length - 4);
+        let name = td.childNodes[0].childNodes[0].textContent;
         let attrId = $(td).attr('id');
         let id = attrId.slice(5, attrId.length);
         if(type === fileType.unitPriceFile){