zhongzewei 6 лет назад
Родитель
Сommit
76086c0bcf

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

@@ -98,7 +98,11 @@ let calcTools = {
     getNodeByID: function (ID){
         return cbTools.getNodeByID(ID);
     },
-
+    // 是否是标题清单
+    isTitleBills: function (node) {
+        let flag = node.getFlag();
+        return titleFlags.includes(flag);
+    },
     isBill: function(treeNode){
         return treeNode.sourceType === ModuleNames.bills;
     },

+ 6 - 6
web/building_saas/main/js/models/exportStandardInterface.js

@@ -585,7 +585,7 @@ const XMLStandard = (function () {
         //暂列金额定义
         function Provisional(source) {
             let attrs = [
-                {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0', type: _config.TYPE.NUM2}
+                {name: '金额', value: _util.getFee(source.fees, 'common.totalFee'), type: _config.TYPE.NUM2}
             ];
             XML_EXPORT_BASE.Element.call(this, '暂列金额', attrs);
         }
@@ -598,7 +598,7 @@ const XMLStandard = (function () {
                     failHint: `第${source.row}行暂列金额清单-“名称”`},
                 {name: '计量单位', value: source.unit, maxLen: 20, required: true,
                     failHint: `第${source.row}行暂列金额清单-“单位”`},
-                {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0',
+                {name: '金额', value: _util.getFee(source.fees, 'common.totalFee'),
                     type: _config.TYPE.NUM2, required: true},
                 {name: '备注', value: source.remark, required: true}
             ];
@@ -607,7 +607,7 @@ const XMLStandard = (function () {
         //专业工程暂估价定义
         function EngEstimate(source) {
             let attrs = [
-                {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0'}
+                {name: '金额', value: _util.getFee(source.fees, 'common.totalFee')}
             ];
             XML_EXPORT_BASE.Element.call(this, '专业工程暂估价', attrs);
         }
@@ -620,7 +620,7 @@ const XMLStandard = (function () {
                     failHint: `第${source.row}行专业工程暂估清单-“名称”`},
                 {name: '工程内容', value: source.engineeringContent, maxLen: 2000, required: true,
                     failHint: `第${source.row}行专业工程暂估清单-“工程内容”`},
-                {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0',
+                {name: '金额', value: _util.getFee(source.fees, 'common.totalFee'),
                     type: _config.TYPE.NUM2, required: true},
                 {name: '备注', value: source.remark, required: true}
             ];
@@ -704,9 +704,9 @@ const XMLStandard = (function () {
                 {name: '项目名称', value: source.name, required: true},
                 {name: '计量单位', value: source.unit, required: true},
                 {name: '数量', value: source.quantity, type: _config.TYPE.DECIMAL, required: true},
-                {name: '单价', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.unitFee') : '0',
+                {name: '单价', value: _util.getFee(source.fees, 'common.unitFee'),
                     type: _config.TYPE.DECIMAL, required: true},
-                {name: '合价', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0',
+                {name: '合价', value: _util.getFee(source.fees, 'common.totalFee'),
                     type: _config.TYPE.NUM2, required: true},
                 {name: '依据', value: source.claimVisa, required: true},
             ];

+ 6 - 6
web/building_saas/main/js/models/importStandardInterface.js

@@ -709,9 +709,9 @@ const ImportXML = (() => {
                     unit: getValue(src, ['_计量单位']),
                     remark: getValue(src, ['_备注'])
                 };
-                if (importFileKind === FileKind.tender) {
+                //if (importFileKind === FileKind.tender) {
                     obj.fees = [{fieldName: 'common', totalFee: getValue(src, ['_金额']) || '0'},];
-                }
+                //}
                 return obj;
             })};
             //专业工程暂估价
@@ -723,9 +723,9 @@ const ImportXML = (() => {
                     engineeringContent: getValue(src, ['_工程内容']),
                     remark: getValue(src, ['_备注'])
                 };
-                if (importFileKind === FileKind.tender) {
+                //if (importFileKind === FileKind.tender) {
                     obj.fees = [{fieldName: 'common', totalFee: getValue(src, ['_金额']) || '0'},];
-                }
+                //}
                 return obj;
             })};
             //计日工
@@ -788,11 +788,11 @@ const ImportXML = (() => {
                     quantity: getValue(src, ['_数量']),
                     claimVisa: getValue(src, ['_依据'])
                 };
-                if (importFileKind === FileKind.tender) {
+                //if (importFileKind === FileKind.tender) {
                     obj.fees = [
                         {fieldName: 'common', unitFee: getValue(src, ['_单价']) || '0', totalFee: getValue(src, ['_合价']) || '0'}
                     ];
-                }
+                //}
                 return obj;
             }
             let claim = {items: arrayValue(otherSrc, ['索赔计价汇总', '签证索赔计价汇总费用项']).map(extractClaimVisa)},

+ 14 - 0
web/building_saas/main/js/models/main_consts.js

@@ -272,6 +272,20 @@ const fixedFlag = {
     //组织措施费
     ORGANIZATION:32,
 };
+// 只读的固定类别(工程量、单价、综合合价只读,相当于是标题)
+const titleFlags = [
+    fixedFlag.PROVISIONAL,
+    fixedFlag.ESTIMATE,
+    fixedFlag.ENGINEERING_ESITIMATE,
+    fixedFlag.DAYWORK,
+    fixedFlag.LABOUR,
+    fixedFlag.MATERIAL,
+    fixedFlag.MACHINE,
+    fixedFlag.TURN_KEY_CONTRACT,
+    fixedFlag.CLAIM_VISA,
+    fixedFlag.CLAIM,
+    fixedFlag.VISA
+];
 const gljKeyArray =['code','name','specs','unit','type'];
 const rationKeyArray =['code','name','specs','unit','subType'];
 const gljLibKeyArray =['code', 'name', 'specs', 'unit', 'gljType'];

+ 8 - 4
web/building_saas/main/js/models/project.js

@@ -30,7 +30,7 @@ var PROJECT = {
             });
 
         };
-        tools.doAfterLoad = function(result, callback){
+        tools.doAfterLoad = function(result, showProjectInfo, callback){
             var counter;
             //必须要先load ProjectInfo的信息
             let projectInfoModule = result.find(data => data.moduleName === ModuleNames.projectInfo);
@@ -56,7 +56,9 @@ var PROJECT = {
                     me.modules[module].setMaxID(counter[module]);
                 }
             }
-            projectInfoObj.showProjectInfo(me._project.projectInfo);
+            if (showProjectInfo) {
+                projectInfoObj.showProjectInfo(me._project.projectInfo);
+            }
             me._project.loadMainTree();
             //me.test(result[0].data[0]);
             if (callback) {
@@ -236,7 +238,8 @@ var PROJECT = {
                 timeout: 50000,
                 success: function (result) {
                     if (!result.error) {
-                        tools.doAfterLoad(result.data, callback);
+                        let showProjectInfo = true;
+                        tools.doAfterLoad(result.data, showProjectInfo, callback);
                         // for test calc
                         //tools.doAfterLoad([{moduleName: 'bills', data: BillsData}, {'moduleName': 'ration', data: DrawingData}], callback);
                     } else {
@@ -252,7 +255,8 @@ var PROJECT = {
         project.prototype.loadDataSync = async function () {
             let data = await ajaxPost('/project/getData', {user_id: tools._userID, project_id: tools._ID});
             if (data) {
-                tools.doAfterLoad(data);
+                let showProjectInfo = false;
+                tools.doAfterLoad(data, showProjectInfo);
             }
         };
 

+ 2 - 0
web/building_saas/main/js/views/export_view.js

@@ -82,6 +82,7 @@ const ExportView = (() => {
                         _exportCache.push(...exportData);
                     }
                 }
+                failList = [...new Set(failList)];
                 //设置提示弹窗
                 if (failList.length * 20 > 400) {
                     $('#hintBox_caption').addClass('export-check');
@@ -125,6 +126,7 @@ const ExportView = (() => {
                     }
                     pr.end();
                 }
+                failList = [...new Set(failList)];
                 //错误-设置提示弹窗
                 if (failList.length * 20 > 400) {
                     $('#hintBox_caption').addClass('export-check');

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

@@ -114,6 +114,10 @@ let MainTreeCol = {
             // 2018-11-15 zhang
             let Bills =projectObj.project.Bills;
             if(node.sourceType == ModuleNames.bills){//针对清单、分项部分
+                // 属于标题清单,只读
+                if (calcTools.isTitleBills(node)) {
+                    return true;
+                }
                 // 当前属于分部分项、施工技术措施项目,综合单价只读。
                 if(Bills.isFBFX(node)||Bills.isTechMeasure(node)) return true;
                 // 不属于分部分项、施工技术措施项目的部分,如果不是叶子清单,或有基数计算/定额/量价/人材机 只读
@@ -124,6 +128,11 @@ let MainTreeCol = {
             return false;
         },
         commonTotalFee: function (node) {
+            // 属于标题清单,只读
+            if (node.sourceType == ModuleNames.bills &&
+                calcTools.isTitleBills(node)) {
+                return true;
+            }
             // 09-29 zhang
             let Bills =projectObj.project.Bills;
             // 当前属于分部分项、施工技术措施项目,综合单价只读。
@@ -195,6 +204,11 @@ let MainTreeCol = {
             return (!MainTreeCol.readOnly.billsParent(node)) && (node.children.length > 0);
         },
         forCalcBase: function (node) {
+            // 属于标题清单,只读
+            if (node.sourceType == ModuleNames.bills &&
+                calcTools.isTitleBills(node)) {
+                return true;
+            }
             // to do according to billsParentType
             return MainTreeCol.readOnly.billsParent(node) || MainTreeCol.readOnly.non_bills(node) || MainTreeCol.readOnly.leafBillsWithDetail(node) || MainTreeCol.readOnly.calcBaseType(node);
         },
@@ -209,6 +223,11 @@ let MainTreeCol = {
         },
         forFeeRate: function (node) {
             let readOnly = true;
+            // 属于标题清单,只读
+            if (node.sourceType == ModuleNames.bills &&
+                calcTools.isTitleBills(node)) {
+                return true;
+            }
             let Bills = projectObj.project.Bills;
             //只有当选中节点是清单,并且不属于“分部分项工程”或“技术措施项目”,并且是叶子清单且没有定额/量价/工料机时,费率列才可编辑
             if(MainTreeCol.readOnly.bills(node)){
@@ -220,6 +239,10 @@ let MainTreeCol = {
         },
         forQuantity: function (node) {
             if(node.sourceType === projectObj.project.Bills.getSourceType()){
+                // 属于标题清单,只读
+                if (calcTools.isTitleBills(node)) {
+                    return true;
+                }
                 if(node.data.type==billType.DXFY||node.data.type==billType.FB||(node.data.type==billType.BILL&&MainTreeCol.readOnly.billsParent(node))){//大项费用、分部、清单父项行,工程量只读。
                     return true;
                 }
@@ -247,6 +270,11 @@ let MainTreeCol = {
             return false;
         },
         forName:function (node) {
+            // 属于标题清单,只读
+            if (node.sourceType == ModuleNames.bills &&
+                calcTools.isTitleBills(node)) {
+                return true;
+            }
             if(projectObj.project.Bills.isTopThreeNode(node)){//是大项1、2、3项的编号设置为只读
                 return true;
             }