Преглед изворни кода

Merge remote-tracking branch 'origin/master'

vian пре 5 година
родитељ
комит
01a696b2c7

+ 1 - 0
config/gulpConfig.js

@@ -153,6 +153,7 @@ module.exports = {
         'web/building_saas/main/js/views/zlfb_view.js',
         'web/building_saas/main/js/views/installation_fee_view.js',
         'web/building_saas/main/js/views/area_increase_fee_view.js',
+        'web/building_saas/main/js/views/item_increase_fee_view.js',
         'web/building_saas/main/js/views/material_adjust_view.js',
         'web/building_saas/main/js/views/config_material_view.js',
         'web/building_saas/main/js/views/index_view.js',

+ 1 - 1
gulpfile.js

@@ -186,7 +186,7 @@ function css(options) {
     if(options.csspaths){
         return gulp.src(options.csspaths)
             .pipe($.plumber())
-            .pipe($.cssnano())
+            .pipe($.cssnano({reduceIdents: false}))
             .pipe($.concat(options.concatName+"."+version+".css"))
             .pipe(gulp.dest(cssDest));
     }

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

@@ -379,7 +379,7 @@ var sheetCommonObj = {
             }
             sheet.setValue(row, col, val, ch);
             if(data[row].foreColor && data[row].styleCol == col){
-                sheet.setStyle(row, col, {foreColor: "#ff2a23"});
+                sheet.setStyle(row, col, {foreColor: data[row].foreColor});
             }
         }
         this.setRowStyle(row,sheet,data[row].bgColour);

+ 22 - 0
web/building_saas/main/html/main.html

@@ -2313,6 +2313,27 @@
     </div>
 </div>
 
+<!--弹出 子目增加费窗口-->
+<div class="modal fade" id="itemIncreaseFeeDiv" data-backdrop="static">
+    <div class="modal-dialog " style="max-width:600px" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">统一设置子目增加费</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <div class="modal-body" style="height: 200px;padding: 0px">
+                <div class="ovf-hidden full-h" id="itemIncreaseFee_sheet"></div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" data-dismiss="modal" id="itemIncreaseFeeConfirm">确定</button>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+
 
 
     <img src="/web/dest/css/img/folder_open.png" id="folder_open_pic" style="display: none">
@@ -2447,6 +2468,7 @@
     <script type="text/javascript" src='/web/building_saas/main/js/views/zlfb_view.js'></script>
     <script type="text/javascript" src='/web/building_saas/main/js/views/installation_fee_view.js'></script>
     <script type="text/javascript" src='/web/building_saas/main/js/views/area_increase_fee_view.js'></script>
+    <script type="text/javascript" src='/web/building_saas/main/js/views/item_increase_fee_view.js'></script>
     <script type="text/javascript" src='/web/building_saas/main/js/views/material_adjust_view.js'></script>
     <script type="text/javascript" src='/web/building_saas/main/js/views/config_material_view.js'></script>
     <script type="text/javascript" src='/web/building_saas/main/js/views/index_view.js'></script>

+ 99 - 0
web/building_saas/main/js/views/item_increase_fee_view.js

@@ -0,0 +1,99 @@
+/**
+ * Created by zhang on 2020/1/17.
+ */
+let itemBaseOptions = ["人工费","材料费","机械费","人工费+材料费","人工费+机械费","人工费+材料费","材料费+机械费","人工费+材料费+机械费"];
+let itemIncreaseFeeObj = {
+    settingSpread:null,
+    itemSetting:{
+        header:[
+            {headerName: "名称", headerWidth: 270, dataCode: "name", dataType: "String"},
+            {headerName: "范围", headerWidth: 70, dataCode: "displayScope",hAlign: "center",dataType: "String"},
+            {headerName: "取费基数", headerWidth: 150, dataCode: "base",  hAlign: "center", dataType: "String",cellType:'comboBox',options:itemBaseOptions},
+            {headerName: "系数(%)", headerWidth: 55, dataCode: "coe", hAlign: "center", dataType: "Number",validator:"number"}
+        ],
+        view: {
+            lockColumns: ["code","specs"],
+            rowHeaderWidth:25,
+            colHeaderHeight:36
+        },
+        autoFit:true,
+        fitRow:['name']
+    },
+    settingDatas:[],
+    initSpread:function () {
+        if(this.settingSpread) return this.settingSpread.refresh();
+        this.settingSpread = SheetDataHelper.createNewSpread($("#itemIncreaseFee_sheet")[0]);
+        sheetCommonObj.spreadDefaultStyle(this.settingSpread);
+        this.settingSheet = this.settingSpread.getSheet(0);
+        sheetCommonObj.initSheet(this.settingSheet, this.itemSetting, 4);
+        this.settingSheet.bind(GC.Spread.Sheets.Events.SelectionChanged,this.onItemSelectionChange);
+        this.settingSheet.bind(GC.Spread.Sheets.Events.ValueChanged, this.onItemValueChange);
+    /*   ;
+
+        this.settingSheet.bind(GC.Spread.Sheets.Events.EditStarting,this.onElectrovalenceEditStarting);*/
+        /*
+         ;*/
+        this.settingSheet.name('itemIncreaseFee_sheet');
+        if(projectReadOnly){
+            disableSpread(this.settingSpread);
+        }
+    },
+    onItemSelectionChange:function (sender,args) {
+        args.sheet.repaint();
+    },
+    showDatas:function(datas){
+        let sel = this.settingSheet.getSelections()[0];
+        let oldData = sel.row<this.settingDatas.length?this.settingDatas[sel.row]:"";
+        this.settingSheet.setRowCount(0);
+        this.settingDatas = datas?datas:this.getItemSettingDatas();
+        sheetCommonObj.showData(this.settingSheet, this.itemSetting,this.settingDatas);
+        this.settingSheet.setRowCount(this.settingDatas.length);
+        sel.row =  oldData?_.findIndex(this.settingDatas,{'name':oldData.name}):sel.row ;
+        this.settingSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
+    },
+    getItemSettingDatas:function () {
+        let datas = [];
+        if(projectObj.project.property.itemIncreaseSetting){
+            for(let i of projectObj.project.property.itemIncreaseSetting){
+                let d = {name:i.name,displayScope:"范围",scope:i.scope,base:i.base,coe:i.coe};
+                if(_.isEmpty(d.scope)){
+                    d.foreColor = "#ff2a23";
+                    d.styleCol = 1;
+                }
+                datas.push(d);
+            }
+        }
+        return datas;
+    },
+    onItemValueChange:function (sender,args) {
+        let me = itemIncreaseFeeObj;
+        let dataCode = me.itemSetting.header[args.col].dataCode;
+        let value = args.newValue;
+        let tem = me.settingDatas[args.row];
+        if (value&&!sheetCommonObj.checkData(args.col,me.itemSetting,value)) {
+            alert('输入的数据类型不对,请重新输入!');
+            return  me.showDatas(me.settingDatas);
+        }
+        if(dataCode == 'coe') {
+            if (value) value = scMathUtil.roundForObj(value, 2);
+        }
+        tem[dataCode] = value;
+        me.showDatas(me.settingDatas);
+    }
+};
+
+
+
+
+
+
+$(function () {
+   /* $("#areaIncreaseFeeConfirm").on("click",async function(e){
+        areaIncreaseFeeObj.confirmAreaIncreaseFeeSetting();
+    });*/
+
+    $('#itemIncreaseFeeDiv').on('shown.bs.modal', function (e) {
+        itemIncreaseFeeObj.initSpread();
+        itemIncreaseFeeObj.showDatas();
+    });
+});

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

@@ -1549,7 +1549,7 @@ var projectObj = {
                             name:"设置范围",
                             icon: 'fa-sign-in',
                             callback:function(){
-                                $("#areaIncreaseFeeDiv").modal('show');
+                                $("#itemIncreaseFeeDiv").modal('show');
                             }
                         },
                         "cancelAreaIncreaseFee":{