zhangweicheng před 7 roky
rodič
revize
6f317caec8

+ 1 - 1
modules/glj/models/unit_price_file_model.js

@@ -120,7 +120,7 @@ class UnitPriceFileModel extends BaseModel {
             return result;
         }
 
-        let condition = {project_id: {$in: idList}};
+        let condition = {project_id: {$in: idList},deleteInfo:null};
         result = await this.findDataByCondition(condition, null, false);
 
         return result;

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

@@ -222,7 +222,7 @@ module.exports = {
 
     getGCDatas: async function(request, response) {
         let userID = request.session.sessionUser.ssoId;
-        let compilatoinId = req.session.sessionCompilation._id;
+        let compilatoinId = request.session.sessionCompilation._id;
         let rst = [];
         let _projs = Object.create(null), _engs = Object.create(null), prefix = 'ID_';
         try{

+ 9 - 1
web/building_saas/glj/js/project_glj_spread.js

@@ -60,7 +60,7 @@ ProjectGLJSpread.prototype.init = function () {
             ,width:60
         },
         {name: '供货方式', field: 'supply', visible: true, cellType: selectBox,width:80},
-        {name: '甲供数量', field: 'supply_quantity', visible: true,width:100},
+        {name: '甲供数量', field: 'supply_quantity',validator:'number', visible: true,width:100},
         {name: '交货方式', field: 'delivery', visible: true,width:90},
         {name: '送达地点', field: 'delivery_address', visible: true,width:100},
         {
@@ -106,6 +106,7 @@ ProjectGLJSpread.prototype.init = function () {
     this.sheetObj.setStyle(-1, basePriceColumn, rightStyleSetting);
     this.sheetObj.setStyle(-1, adjustPriceColumn, rightStyleSetting);
     this.sheetObj.setStyle(-1, marketPriceColumn, rightStyleSetting);
+    this.sheetObj.setStyle(-1, supplyColumn, rightStyleSetting);
 
     // 设置可编辑列
     this.sheetObj.setColumnEditable(marketPriceColumn);
@@ -204,6 +205,9 @@ ProjectGLJSpread.prototype.updateProjectGLJField = function(info, callback) {
         value = this.supplyType.indexOf(value);
         extend.supply_quantity = this.getSupplyQuantity(value, activeSheet, info);
     }
+    if(field === 'supply_quantity'){//修改数量需做4舍5入
+        value= value.toDecimal(getDecimal('glj.quantity'));
+    }
 
     extend = Object.keys(extend).length > 0 ?  JSON.stringify(extend) : '';
     $.ajax({
@@ -229,6 +233,9 @@ ProjectGLJSpread.prototype.updateProjectGLJField = function(info, callback) {
                 if (parentMarketPrice !== null) {
                     info.parentMarketPrice = parentMarketPrice;
                 }
+                if(field !== 'supply'){ //供货方式需做转换才能直接设置值, 这里设置值是为了早点更新数据,等getdata返回数据再刷新的话会有比较大的延时
+                    activeSheet.setValue(row, column, value);
+                }
                 callback(field, info);
             }
         }
@@ -466,6 +473,7 @@ ProjectGLJSpread.prototype.getSupplyQuantity = function(supplyType, activeSheet,
     let quantity = activeSheet.getValue(info.row, quantityColumn);
     // 自行采购和甲定乙供则把甲供数量设置为0,其余情况则设置为当前总消耗量
     let supplyQuantity = supplyType === 0 || supplyType === 3 ? 0 : quantity;
+    supplyQuantity = parseFloat(supplyQuantity);
 
     return supplyQuantity;
 };

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

@@ -22,7 +22,7 @@ var gljOprObj = {
         header: [
             {headerName: "编码", headerWidth: 100, dataCode: "code", dataType: "String", formatter: "@"},
             {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String"},
-            {headerName: "规格型号", headerWidth: 120, dataCode: "specs", dataType: "String", hAlign: "left"},
+            {headerName: "规格型号", headerWidth: 90, dataCode: "specs", dataType: "String", hAlign: "left"},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", dataType: "String", hAlign: "center"},
             {headerName: "类型", headerWidth: 45, dataCode: "shortName", dataType: "String", hAlign: "center"},
             {headerName: "定额消耗", headerWidth: 80, dataCode: "rationItemQuantity", dataType: "Number", hAlign: "right",decimalField:"glj.quantity"},    // dataType: "Number", formatter: "0.00"
@@ -792,6 +792,7 @@ var gljOprObj = {
             isValidate = me.checkingActualValue(recode,newval)
         }
         if(isValidate){
+            newval = scMathUtil.roundTo(newval,-2);
             projectObj.project.ration_ass.updateActualValue(me.assSheetData,args.row,newval)
         }else {
             newval = recode.actualValue;