Ver código fonte

Merge branch '1.0.0_online' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost into 1.0.0_online

# Conflicts:
#	public/web/tree_sheet/tree_sheet_helper.js
zhongzewei 6 anos atrás
pai
commit
f7caed649e

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
config/config.js


+ 39 - 2
modules/main/facade/ration_facade.js

@@ -133,8 +133,11 @@ async function replaceRations(userID,data) {
 }
 
 async function replaceRation(nodeInfo,stdRation,firstLibID,projectID,calQuantity) {
-    if(stdRation){
-        await deleRationSubRecode(projectID,nodeInfo.ID);
+    if(nodeInfo.newCode == null||nodeInfo.newCode ==""){//说明是删除编号,则要变成一条空定额
+        await deleRationSubRecode(projectID,nodeInfo.ID);//删除定额下挂的各种数据,如定额工料机等
+        return await setEmptyRation(projectID,nodeInfo.ID);
+    }else if(stdRation){
+        await deleRationSubRecode(projectID,nodeInfo.ID);//删除定额下挂的各种数据,如定额工料机等
         let newRation = await updateRation(stdRation,firstLibID,nodeInfo.ID,nodeInfo.billsItemID,projectID,calQuantity);//生成并插入新的定额
         return await addRationSubList(stdRation,newRation,nodeInfo.needInstall);
     }else {
@@ -375,6 +378,40 @@ async function  updateRation(std,firstLibID,rationID,billsItemID,projectID,calQu
     return newRation;
 }
 
+async function setEmptyRation(projectID,rationID){
+    let ration ={};
+    ration.code = "";
+    ration.name = "";
+    ration.caption = "";
+    ration.unit = "";
+    ration.libID = null;
+    ration.content = "";
+    ration.adjustState = '';
+    ration.isFromDetail=0;
+    ration.isSubcontract=false;
+    ration.fees=[];
+    ration.comments = "";
+    ration.ruleText = "";
+    ration.quantity="";
+    ration.contain="";
+    ration.quantityEXP="";
+    ration.from = 'std';
+    //定额前缀 none:0, complementary:1, borrow: 2
+    ration.prefix = '';
+    ration.rationAssList = [];
+    ration.marketUnitFee ="";
+    ration.marketTotalFee ="";
+    ration.maskName = "";
+    ration.targetTotalFee ='';
+    ration.targetUnitFee = "";
+    ration.deleteInfo = null;
+    ration.quantityCoe = {};
+    ration.rationQuantityCoe="";
+    ration.tenderQuantity = "";
+    let newRation = await ration_model.model.findOneAndUpdate({ID:rationID,projectID:projectID},{"$set":ration},{new: true});//;
+    return {ration:newRation,ration_gljs:[],ration_coes:[],ration_installs:[]};
+}
+
 function createRationAss(std) {
     let  rationAssList = [];//生成辅助定额
     if(std.hasOwnProperty('rationAssList')&&std.rationAssList.length>0){

+ 22 - 0
modules/reports/rpt_component/jpc_rte.js

@@ -92,6 +92,28 @@ let JE = {
             }
         }
         return rst;
+    },
+    removeFieldValue: function (field, dataObj, valIdx) {
+        if (field.DataNodeName === "NA") {
+            if (field[JV.PROP_AD_HOC_DATA].length > valIdx && valIdx >= 0) {
+                field[JV.PROP_AD_HOC_DATA].splice(valIdx, 1);
+            }
+        } else {
+            if (dataObj[field.DataNodeName][field.DataSeq].length > valIdx && valIdx >= 0) {
+                dataObj[field.DataNodeName][field.DataSeq].splice(valIdx, 1);
+            }
+        }
+    },
+    insertFieldValue: function (field, dataObj, valIdx, newValue) {
+        if (field.DataNodeName === "NA") {
+            if (field[JV.PROP_AD_HOC_DATA].length > valIdx && valIdx >= 0) {
+                field[JV.PROP_AD_HOC_DATA].splice(valIdx, 0, newValue);
+            }
+        } else {
+            if (dataObj[field.DataNodeName][field.DataSeq].length > valIdx && valIdx >= 0) {
+                dataObj[field.DataNodeName][field.DataSeq].splice(valIdx, 0, newValue);
+            }
+        }
     }
 };
 

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

@@ -23,7 +23,7 @@ var sheetCommonObj = {
         var spreadNS = GC.Spread.Sheets;
         sheet.suspendPaint();
         sheet.suspendEvent();
-
+        if(setting.frozenCols)  sheet.frozenColumnCount(setting.frozenCols);//冻结列
         sheet.setRowCount(1, spreadNS.SheetArea.colHeader);
         sheet.setColumnCount(setting.header.length, spreadNS.SheetArea.viewport);
 

+ 2 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -120,9 +120,10 @@ var TREE_SHEET_HELPER = {
             }
             setting.cols.forEach(function (colSetting, iCol) {
                 var cell = sheet.getCell(iRow, iCol, GC.Spread.Sheets.SheetArea.viewport);
-               /* if(typeof projectObj !== 'undefined'){
+   /* if(typeof projectObj !== 'undefined'){ 7/28  取消黑体显示
                     let boldFontStyle = projectObj.getBoldFontStyle(node, colSetting);
                     sheet.setStyle(iRow, iCol, boldFontStyle);
+                }
                 }*/
 
                 // var getFieldText = function () {

+ 2 - 2
socketdockerfile

@@ -1,8 +1,8 @@
-FROM costbase:latest
+FROM costbase:2.0
 
 WORKDIR /home/ConstructionCost
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost master
+COPY . /home/ConstructionCost
 
 RUN cnpm install 
 

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

@@ -399,8 +399,10 @@ var Ration = {
                     needInstall = project.Bills.isFBFX(r.node);
                 }
                 r.value===null||r.value===undefined?"":r.value = r.value.replace(/[\s\r\n]/g, "");//去掉空格回车换行等字符
-                nodeInfo.push({ID:r.node.data.ID,billsItemID:r.node.data.billsItemID,newCode:r.value,needInstall:needInstall});
-                refershNodes.push(r.node);
+                if(r.value != r.node.data.code){
+                    nodeInfo.push({ID:r.node.data.ID,billsItemID:r.node.data.billsItemID,newCode:r.value,needInstall:needInstall});
+                    refershNodes.push(r.node);
+                }
             }
             let calQuantity = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan');
             $.bootstrapLoading.start();

+ 13 - 12
web/building_saas/main/js/views/glj_col.js

@@ -5,8 +5,8 @@ let gljCol = {
     ration_glj_setting: {
         header: [
             {headerName: "编码", headerWidth: 100, dataCode: "code", dataType: "String", formatter: "@"},
-            {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String",cellType:'tipsCell'},
-            {headerName: "规格型号", headerWidth: 90, dataCode: "specs", dataType: "String", hAlign: "left",cellType:'tipsCell'},
+            {headerName: "名称", headerWidth: 240, dataCode: "name", dataType: "String",cellType:'tipsCell'},
+            {headerName: "规格型号", headerWidth: 190, dataCode: "specs", dataType: "String", hAlign: "left",cellType:'tipsCell'},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", dataType: "String", hAlign: "center"},
             {headerName: "市场价", headerWidth: 80, dataCode: "marketPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"
             {headerName: "调整价", headerWidth: 80, dataCode: "adjustPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"1
@@ -26,8 +26,8 @@ let gljCol = {
     project_glj_setting:{
         header: [
             {headerName: "编码", headerWidth: 80, dataCode: "code", dataType: "String"},
-            {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String"},
-            {headerName: "规格型号", headerWidth: 120, dataCode: "specs", hAlign: "left", dataType: "String"},
+            {headerName: "名称", headerWidth: 240, dataCode: "name", dataType: "String",cellType:'tipsCell'},
+            {headerName: "规格型号", headerWidth: 190, dataCode: "specs", hAlign: "left", dataType: "String",cellType:'tipsCell'},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", hAlign: "center", dataType: "String"},
             {headerName: "类型", headerWidth: 45, dataCode: "short_name", hAlign: "center", dataType: "String"},
             {headerName: "市场价", headerWidth: 70, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
@@ -36,18 +36,19 @@ let gljCol = {
             {headerName: "总消耗量", headerWidth: 90, dataCode: "quantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity'},
             {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},
-            {headerName: "三材系数", headerWidth: 100, dataCode: "materialCoe", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'material'
-            {headerName: "交货方式", headerWidth: 90, dataCode: "delivery", hAlign: "left", dataType: "String"},
-            {headerName: "送达地点", headerWidth: 100, dataCode: "delivery_address", hAlign: "left", dataType: "String"},
+            {headerName: "供货方式", headerWidth: 70, dataCode: "supply", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:supplyComboMap},
+            {headerName: "甲供数量", headerWidth: 90, dataCode: "supply_quantity", hAlign: "right", dataType: "Number",validator:"number",decimalField:'glj.quantity'},
+            {headerName: "三材类别", headerWidth: 70, dataCode: "materialType", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:materialComboMap},
+            {headerName: "三材系数", headerWidth: 70, dataCode: "materialCoe", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'material'
+            {headerName: "交货方式", headerWidth: 70, dataCode: "delivery", hAlign: "left", dataType: "String"},
+            {headerName: "送达地点", headerWidth: 70, dataCode: "delivery_address", hAlign: "left", dataType: "String"},
             {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox"},
             {headerName: "备注", headerWidth: 100, dataCode: "remark", hAlign: "left", dataType: "String"}
         ],
-            view: {
+        view: {
             lockColumns: [0,1,2,3,4,6,8]
-        }
+        },
+        frozenCols:4
     },
     mixRatio_Setting:{
         header:[

+ 6 - 2
web/building_saas/main/js/views/glj_view.js

@@ -1221,7 +1221,11 @@ var gljOprObj = {
             return offset;
         }
 
-        TreeNodeCellType.prototype =  data[index]&&data[index].isMixRatio?new ns.CellTypes.Text(): sheetCommonObj.getDynamicCombo();//new ns.CellTypes.Text();
+        if(index && data[index] && data[index].isMixRatio !==true){
+            TreeNodeCellType.prototype =  sheetCommonObj.getDynamicCombo();
+        }else {
+            TreeNodeCellType.prototype =  new ns.CellTypes.Text();
+        }
         TreeNodeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
             if (value != null) {
                 var offset = margin + rectW + 6;
@@ -1277,7 +1281,7 @@ var gljOprObj = {
         };
         let cellType = new TreeNodeCellType();
         let options = [];
-        if(!(data[index]&&data[index].isMixRatio)){
+        if(index && data[index] && data[index].isMixRatio !==true){
             let code = data[index].code;
             if(code) {
                 let preCode = code.split("-")[0];

+ 5 - 5
web/building_saas/main/js/views/installation_fee_view.js

@@ -63,11 +63,11 @@ let installationFeeObj={
             {headerName: "费用规则", headerWidth: 220, dataCode: "rule", hAlign: "left", dataType: "String",getText:'forRule'},
             {headerName: "编码", headerWidth: 70, dataCode: "code", hAlign: "left", dataType: "String"},
             {headerName: "基数", headerWidth: 80, dataCode: "base", hAlign: "left", dataType: "String",cellType:'comboBox',options:installSectionBase},
-            {headerName: "费率(%)", headerWidth: 70, dataCode: "feeRate", hAlign: "right", dataType: "String"},
-            {headerName: "人工(%)", headerWidth: 70, dataCode: "labour", hAlign: "right", dataType: "String"},
-            {headerName: "材料(%)", headerWidth: 70, dataCode: "material", hAlign: "right", dataType: "String"},
-            {headerName: "机械(%)", headerWidth: 70, dataCode: "machine", hAlign: "right", dataType: "String"},
-            {headerName: "记取位置", headerWidth: 200, dataCode: "position", hAlign: "left", dataType: "String",cellType:'selectButton'}
+            {headerName: "费率(%)", headerWidth: 75, dataCode: "feeRate", hAlign: "right", dataType: "String"},
+            {headerName: "人工(%)", headerWidth: 75, dataCode: "labour", hAlign: "right", dataType: "String"},
+            {headerName: "材料(%)", headerWidth: 75, dataCode: "material", hAlign: "right", dataType: "String"},
+            {headerName: "机械(%)", headerWidth: 75, dataCode: "machine", hAlign: "right", dataType: "String"},
+            {headerName: "记取位置", headerWidth: 180, dataCode: "position", hAlign: "left", dataType: "String",cellType:'selectButton'}
         ],
         view: {
             lockColumns: [0, 2]

+ 5 - 5
web/building_saas/main/js/views/project_glj_view.js

@@ -24,15 +24,15 @@ projectGljObject={
     materialSetting:{
         header:[
             {headerName: "编码", headerWidth: 200, dataCode: "code", dataType: "String"},
-            {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String"},
-            {headerName: "规格型号", headerWidth: 120, dataCode: "specs", hAlign: "left", dataType: "String"},
+            {headerName: "名称", headerWidth: 240, dataCode: "name", dataType: "String"},
+            {headerName: "规格型号", headerWidth: 190, dataCode: "specs", hAlign: "left", dataType: "String"},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", hAlign: "center", dataType: "String"},
             {headerName: "定额价", headerWidth: 70, dataCode: "basePrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'glj.unitPrice'
             {headerName: "市场价", headerWidth: 70, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
-            {headerName: "总消耗量", headerWidth: 100, dataCode: "quantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity'},
-            {headerName: "三材系数", headerWidth: 100, dataCode: "materialCoe", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'material'
+            {headerName: "总消耗量", headerWidth: 70, dataCode: "quantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity'},
+            {headerName: "三材系数", headerWidth: 70, dataCode: "materialCoe", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'material'
             {headerName: "三材量", headerWidth: 100, dataCode: "materialQuantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity'},
-            {headerName: "三材类别", headerWidth: 80, dataCode: "materialType", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:materialComboMap}
+            {headerName: "三材类别", headerWidth: 70, dataCode: "materialType", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:materialComboMap}
         ],
         view: {
             lockColumns: [0,1,2,3,6,8]

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

@@ -524,9 +524,9 @@ var projectObj = {
         let node = project.mainTree.items[info.row];
         let fieldName = projectObj.mainController.setting.cols[info.col].data.field;
         let value = info.sheet.getValue(info.row, info.col);
-        if(fieldName === 'code' && node && calcTools.isRationItem(node) && isDef(node.data.code)){
+        if(fieldName === 'code' && node && calcTools.isRationItem(node) && isDef(node.data.code)&&isDef(value)){
             if (isDef(node.data.prefix) && node.data.prefix !== rationPrefix.none){
-                value = value.replace(new RegExp(node.data.prefix), '');
+                 value = value.replace(new RegExp(node.data.prefix), '');
             };
             value = value.replace(new RegExp(rationPrefix.replace), '');
             info.sheet.setValue(info.row, info.col, value);
@@ -545,6 +545,22 @@ var projectObj = {
                 return;
             }
         }
+        if(fieldName == 'code' && node){
+            projectObj.showBillOrRationLib(node)
+        }
+
+    },
+    showBillOrRationLib(node){
+        if(node.sourceType == ModuleNames.bills){//当清单是“分部分项工程”、“措施项目工程”时,要展开清单规则节点
+
+        }
+
+
+
+/*
+        if(node){
+            if(!$("#qd").is(":visible"))  $('#stdBillsTab').click();
+        }*/
     },
     onColumnWidthChanged: function (sender, info) {         // CSL,2018.07.25
         if (info.colList.includes(4) || info.colList.includes(5)){
@@ -600,7 +616,7 @@ var projectObj = {
                 let node = project.mainTree.items[changedCell.row];
                 let colSetting = setting.cols[changedCell.col];
                 let value = projectObj.checkSpreadEditingText(changedCell.text, colSetting)
-                if(colSetting.data.field=='code' && value != '' && node.sourceType == project.Ration.getSourceType()&&node.data.type==rationType.ration){//如果是更新定额的编码
+                if(colSetting.data.field=='code' && node.sourceType == project.Ration.getSourceType()&&node.data.type==rationType.ration){//如果是更新定额的编码
                     updateRationCodes.push({'node':node,value:value});
                 }else {
                     projectObj.updateCellValue(node, value, colSetting,changedCell.text);

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

@@ -171,7 +171,7 @@ let quantityEditObj = {
     showSelectModal:function (hitinfo) {
         //锁定的清单不显示
         let project = projectObj.project;
-        if(project.isBillsLocked() && project.withinBillsLocked(project.mainTree.selected)){
+        if(project.mainTree.selected.sourceType == ModuleNames.bills && project.isBillsLocked() && project.withinBillsLocked(project.mainTree.selected)){
             return;
         }
         this.initModalContent();