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

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper into master

# Conflicts:
#	fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue
seyason пре 3 година
родитељ
комит
7b102208f9

+ 13 - 0
fhKeeper/formulahousekeeper/timesheet/src/routes.js

@@ -63,6 +63,9 @@ import tasks from './views/task/list';
 // 请假
 import leave from './views/leave/list';
 
+// 研究中心
+// import research from './views/research/list';
+
 Vue.use(Router)
 
 export const fixedRouter = [
@@ -246,6 +249,16 @@ export const allRouters = [//组织架构
             { path: '/customer', component: customer, name: '客户管理' }
         ]
     },
+    // {
+    //     path: '/',
+    //     component: Home,
+    //     name: '研究中心',
+    //     iconCls: 'iconfont firerock-iconkehuguanli',
+    //     leaf: true,
+    //     children: [
+    //         { path: '/research', component: research, name: '研究中心' }
+    //     ]
+    // },
     {
         path: '/',
         component: Home,

+ 334 - 78
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -1,6 +1,6 @@
 <template>
     <section>
-        <el-col :span="24" style="padding-bottom: 0px;text-align:center;margin-top:10px;">
+        <el-col :span="24" style="padding-bottom: 0px;text-align:center;margin-top:10px;position: fixed;top: 60px;left: 160px;z-index: 999;">
             <el-date-picker v-show="user.timeType.fixMonthcost==0"
             v-model="dateRange" :editable="false" 
             format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
@@ -24,9 +24,13 @@
                 <el-radio-button label="项目"></el-radio-button>
                 <el-radio-button label="部门"></el-radio-button>
                 <el-radio-button label="人员"></el-radio-button>
+                <el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button>
             </el-radio-group>
         </el-col>
-        <div id="container" :style="'height:'+containerHeight+'px;'"></div>
+        <!-- <div :style="'width:'+widthHtval+'rem;position: relative;'"> -->
+        <div :style="'width:'+widthHtval+'px;position: relative; height:'+containerHeight+'px;'">
+             <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
+        </div>
         <div style="position:fixed;top:120px;right:150px;"><el-button @click="showExportDialog">报表导出</el-button></div>
 
         <!--导出报表条件选择 -->
@@ -61,9 +65,15 @@
                     :clearable="true" 
                     type="month" 
                     ></el-date-picker>
-                    
                 </el-form-item>
                 
+                <el-form-item label="选择人员">
+                    <el-select v-model="exportParam.userId"  placeholder="请选择人员" style="width: 350px" filterable="true">
+                        <span v-for="(item, index) in users" :key="index">
+                        <el-option :label="item.name" :value="item.id"></el-option>
+                        </span> 
+                    </el-select>
+                </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="exportProjectData" style="width:100%;" >导出</el-button>
@@ -79,7 +89,7 @@
             return {
                 hasReportUserList:[],
                 projectList:[],
-                exportParam:{projectId:null,dateRange:[]},
+                exportParam:{projectId:null,dateRange:[],userId: ''},
                 exportDialog:false,
                 dateRange:[],
                 user: JSON.parse(sessionStorage.getItem("user")),
@@ -87,9 +97,61 @@
                 containerHeight: 0,    
                 myChart: null,
                 params: null,
+                widthHtval: 1800,
+                users: [],
+                jichu: [],
+                namess: ''
             };
         },
         methods: {
+            jutishez() {
+                this.http.post('/time-type/getCompanyTimeSetting', {
+                    companyId: this.user.companyId,
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.jichu = res.data
+                        if(res.data.customDegreeActive == 1) {
+                            this.namess = res.data.customDegreeName
+                        }
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            getUsers() {
+                console.log(this.port.manage.list)
+                this.http.post(this.port.manage.list, {
+                        departmentId: -1,
+                        pageIndex: 1,
+                        pageSize: 99999
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.users = res.data.records;
+                        } else {
+                            this.$message({
+                            message: res.msg,
+                            type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                },
             
             showExportDialog() {
                 this.exportDialog = true;
@@ -142,7 +204,9 @@
                 if (this.exportParam.projectId != null) {
                     param.projectId = this.exportParam.projectId;
                 }
-
+                if (this.exportParam.userId != null) {
+                    param.userId = this.exportParam.userId;
+                }
                 this.http.post(url, param,
                     res => {
                         this.listLoading = false;
@@ -325,7 +389,11 @@
                     });
                 });
             },
+            yanjiu() {
+                console.log('触发')
+            },
             getEchart(){
+                console.log(this.radio, this.namess)
                 sessionStorage.radio = this.radio;
                 var _this = this;
                 var param = {};
@@ -342,88 +410,272 @@
                 } else if (this.radio=='人员') {
                     this.getUserCostList();
                     return;
+                } else if (this.radio == this.namess) {
+                    url = '/project/getDegreeCost'
                 }
                 this.http.post(url, param,
                 res => {
                     if (res.code == "ok") {
-                        var xList = [], yList = [], list = res.data.costList, 
-                        totalMoneyCost = ((this.radio=='项目' || this.radio=='人员')?res.data.totalMoneyCost:res.data.totalCostMoney);
-                        for(var i in list) {
-                            if(this.radio=='项目' || this.radio == '人员') {
-                                xList.push(this.radio=='项目'?list[i].project:list[i].name);
+                        // 测试写的
+                            // var shujuy = res.data.costList
+                            // var arrsa = []
+                            // for(var i=0; i<40; i++) {
+                            //     arrsa.push(shujuy[0])
+                            // }
+                            // console.log(arrsa)
+                            // res.data.costList = arrsa
+                            for(var i in res.data.costList) {
+                                if(i>20) {
+                                    // this.widthHtval = +this.widthHtval + 2
+                                    this.widthHtval = +this.widthHtval + 30
+                                } else {
+                                    this.widthHtval = 1800
+                                }
+                            }
+                            
+                        // 测试写的
+                        var xList = []
+                        var yList = []
+                        var list
+                        if(this.radio == '项目' || this.radio == '人员' || this.radio=='部门') {
+                            list = res.data.costList
+                            var totalMoneyCost = ((this.radio=='项目' || this.radio=='人员')?res.data.totalMoneyCost:res.data.totalCostMoney);
+                            for(var i in list) {
+                                if(this.radio=='项目' || this.radio == '人员') {
+                                    xList.push(this.radio=='项目'?list[i].project:list[i].name);
+                                    yList.push({
+                                        "value": list[i].costMoney.toFixed(2),
+                                        "id": list[i].id || i,
+                                        "cost": list[i].cost
+                                    });
+                                } else {
+                                    xList.push(list[i].departmentName);
+                                    yList.push({
+                                        "value": list[i].costMoney.toFixed(2),
+                                        "id": list[i].departmentId,
+                                        "cost": list[i].costTime
+                                    });
+                                }
+                            }
+                        } else {
+                            list = res.data
+                            var totalMoneyCost = 1
+                            for(var i in list) {
+                                console.log(list[i].name, list[i].costMoney, list[i].cost)
+                                xList.push(list[i].name);
                                 yList.push({
                                     "value": list[i].costMoney.toFixed(2),
-                                    "id": list[i].id,
+                                    "id": list[i].id || i,
                                     "cost": list[i].cost
                                 });
-                            } else {
-                                xList.push(list[i].departmentName);
-                                yList.push({
-                                    "value": list[i].costMoney.toFixed(2),
-                                    "id": list[i].departmentId,
-                                    "cost": list[i].costTime
-                                });
                             }
                         }
+                        // var xList = [], yList = [], list = res.data.costList, 
+                        // totalMoneyCost = ((this.radio=='项目' || this.radio=='人员')?res.data.totalMoneyCost:res.data.totalCostMoney);
+                        // for(var i in list) {
+                        //     if(this.radio=='项目' || this.radio == '人员') {
+                        //         xList.push(this.radio=='项目'?list[i].project:list[i].name);
+                        //         yList.push({
+                        //             "value": list[i].costMoney.toFixed(2),
+                        //             "id": list[i].id || i,
+                        //             "cost": list[i].cost
+                        //         });
+                        //     } 
+                        //     // else if(this.radio=='研究'){
+                        //     //     xList.push(list[i].name)
+                        //     //     yList.push({
+                        //     //         "value": list[i].costMoney.toFixed(2),
+                        //     //         // "id": list[i].id,
+                        //     //         "id": i,
+                        //     //         "cost": list[i].cost
+                        //     //     })
+                        //     // } 
+                        //     else {
+                        //         xList.push(list[i].departmentName);
+                        //         yList.push({
+                        //             "value": list[i].costMoney.toFixed(2),
+                        //             "id": list[i].departmentId,
+                        //             "cost": list[i].costTime
+                        //         });
+                        //     }
+                        // }
                         
                         var myChart = echarts.init(document.getElementById("container"));
+                        myChart.resize({
+                            width: this.widthHtval
+                        })
                         _this.myChart = myChart;
-                        var option = {
-                            title: {
-                                text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元',
-                                left:'left',
-                            },
-                            // 工具箱
-                            toolbox: {
-                                show: true,
-                                feature:{
+                        if(this.radio == '项目' || this.radio == '人员' || this.radio=='部门') {
+                            var option = {
+                                title: {
+                                    text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元',
+                                    left:'left',
+                                },
+                                // 工具箱
+                                toolbox: {
+                                    show: true,
+                                    feature:{
+                                    
+                                        saveAsImage:{
+                                            show:true
+                                        },
+                                        restore:{
+                                            show:true
+                                        },
+                                        // dataView:{
+                                        //     show:true
+                                        // },
+                                        // dataZoom:{
+                                        //     show:true
+                                        // },
+                                        magicType:{
+                                            type:['line','bar']
+                                        },
+                                        
+                                    }
+                                },
+                                tooltip:{
+                                    trigger:'axis',
+                                    formatter: function (params,ticket,callback) {
+                                        var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.value 
+                                        + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
+                                        _this.params = params;
+                                        return res;
+                                    }
+                                },
+                                xAxis: {
+                                    data: xList,
+                                    axisLabel: {
+                                        interval:0,rotate:20
+                                    }
+                                },
+                                yAxis: [{
+                                    type : 'value',
+                                    axisLabel: {
+                                        formatter:'{value} (元)'
+                                    }
+                                }],
+                                series: [{
+                                    name: '工作成本(元)',
+                                    type: 'bar',
+                                    barMaxWidth: 30,
+                                    data: yList,
+                                }]
+                            };
+                        } else {
+                            var option = {
+                                title: {
+                                    text: '',
+                                    left:'left',
+                                },
+                                // 工具箱
+                                toolbox: {
+                                    show: true,
+                                    feature:{
+                                    
+                                        saveAsImage:{
+                                            show:true
+                                        },
+                                        restore:{
+                                            show:true
+                                        },
+                                        // dataView:{
+                                        //     show:true
+                                        // },
+                                        // dataZoom:{
+                                        //     show:true
+                                        // },
+                                        magicType:{
+                                            type:['line','bar']
+                                        },
+                                        
+                                    }
+                                },
+                                tooltip:{
+                                    trigger:'axis',
+                                    formatter: function (params,ticket,callback) {
+                                        var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.value 
+                                        + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
+                                        _this.params = params;
+                                        return res;
+                                    }
+                                },
+                                xAxis: {
+                                    data: xList,
+                                    axisLabel: {
+                                        interval:0,rotate:20
+                                    }
+                                },
+                                yAxis: [{
+                                    type : 'value',
+                                    axisLabel: {
+                                        formatter:'{value} (元)'
+                                    }
+                                }],
+                                series: [{
+                                    name: '工作成本(元)',
+                                    type: 'bar',
+                                    barMaxWidth: 30,
+                                    data: yList,
+                                }]
+                            };
+                        }
+                        // var option = {
+                        //     title: {
+                        //         text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元',
+                        //         left:'left',
+                        //     },
+                        //     // 工具箱
+                        //     toolbox: {
+                        //         show: true,
+                        //         feature:{
                                    
-                                    saveAsImage:{
-                                        show:true
-                                    },
-                                    restore:{
-                                        show:true
-                                    },
-                                    // dataView:{
-                                    //     show:true
-                                    // },
-                                    // dataZoom:{
-                                    //     show:true
-                                    // },
-                                    magicType:{
-                                        type:['line','bar']
-                                    },
+                        //             saveAsImage:{
+                        //                 show:true
+                        //             },
+                        //             restore:{
+                        //                 show:true
+                        //             },
+                        //             // dataView:{
+                        //             //     show:true
+                        //             // },
+                        //             // dataZoom:{
+                        //             //     show:true
+                        //             // },
+                        //             magicType:{
+                        //                 type:['line','bar']
+                        //             },
                                      
-                                }
-                            },
-                            tooltip:{
-                                trigger:'axis',
-                                formatter: function (params,ticket,callback) {
-                                    var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.value 
-                                    + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
-                                    _this.params = params;
-                                    return res;
-                                }
-                            },
-                            xAxis: {
-                                data: xList,
-                                axisLabel: {
-                                    interval:0,rotate:20
-                                }
-                            },
-                            yAxis: [{
-                                type : 'value',
-                                axisLabel: {
-                                    formatter:'{value} (元)'
-                                }
-                            }],
-                            series: [{
-                                name: '工作成本(元)',
-                                type: 'bar',
-                                barMaxWidth: 30,
-                                data: yList,
-                            }]
-                        };
+                        //         }
+                        //     },
+                        //     tooltip:{
+                        //         trigger:'axis',
+                        //         formatter: function (params,ticket,callback) {
+                        //             var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.value 
+                        //             + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
+                        //             _this.params = params;
+                        //             return res;
+                        //         }
+                        //     },
+                        //     xAxis: {
+                        //         data: xList,
+                        //         axisLabel: {
+                        //             interval:0,rotate:20
+                        //         }
+                        //     },
+                        //     yAxis: [{
+                        //         type : 'value',
+                        //         axisLabel: {
+                        //             formatter:'{value} (元)'
+                        //         }
+                        //     }],
+                        //     series: [{
+                        //         name: '工作成本(元)',
+                        //         type: 'bar',
+                        //         barMaxWidth: 30,
+                        //         data: yList,
+                        //     }]
+                        // };
                         myChart.setOption(option,{notMerge: true});
                         myChart.getZr().on('click', params => {
                             const pointInPixel = [params.offsetX, params.offsetY];
@@ -496,7 +748,7 @@
                 }
                 this.exportParam.dateRange = this.dateRange;
             }
-            
+            this.radio = '项目'
             this.getEchart();
             var _this = this;
             window.addEventListener("resize", function() {
@@ -504,16 +756,20 @@
             });
 
             this.getMyProjectList();
-        }
+            this.getUsers()
+            this.jutishez()
+        },
     };
 </script>
 
 <style lang="scss" scoped>
     #container {
-        display: inline-block;
-        width: 100%; 
-        margin-top: 10px;
-    }  
+        // display: inline-block;
+        display: block;
+        position: absolute;
+        // width: 100% !important; 
+        margin-top: 60px;
+    } 
 </style>
 
 <style lang="scss">

+ 86 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -134,6 +134,13 @@
                         <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
+                <el-form-item :label="yonghuUser.customDegreeName" v-if="yonghuUser.customDegreeActive == 1">
+                    <el-select v-model="auseList" multiple placeholder="请选择" filterable="true" style="width: 100%">
+                        <span v-for="(item, index) in ause" :key="index">
+                        <el-option :label="item.name" :value="item.id"></el-option>
+                        </span> 
+                    </el-select>
+                </el-form-item>
                 <!-- <el-form-item label="客户" v-if="user.company.packageCustomer == 1">
                     <el-select v-model="addForm.customerId" clearable="true" filterable placeholder="请选择客户" style="width:100%;" >
                         <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
@@ -490,7 +497,10 @@
                 },
                 rules: {
                     name: [{ required: true, message: "请输入名称", trigger: "blur" }],
-                }
+                },
+                ause: [],
+                auseList: [],
+                yonghuUser: []
             };
         },
         // 过滤器
@@ -515,6 +525,45 @@
             }
         },
         methods: {
+            userssHu() {
+                this.http.post('/time-type/getCompanyTimeSetting',{ 
+                    companyId: this.user.companyId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.yonghuUser = res.data
+                        console.log(this.yonghuUser)
+                    } 
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    }
+                );
+            },
+            yanjiuzx() {
+                this.http.post('/report-extra-degree/getAll ',{},
+                res => {
+                    if (res.code == "ok") {
+                        console.log(res, '过来的数据')
+                        this.ause = res.data
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    }
+                );
+            },
             selectPublic() {
                 if (this.addForm.isPublic == 1) {
                     this.participator = this.users;
@@ -1270,6 +1319,7 @@
                         chosenLeaders:[],
                     }
                     this.projectBaseCostData = [];
+                    this.auseList = [];
                     for (var m=0;m<this.baseCostItemList.length; m++) {
                         this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
                     }
@@ -1309,6 +1359,24 @@
                         baseOutsourcing: item.baseOutsourcing,
                         customerId:item.customerId==0?null:item.customerId,
                     }
+                    if(item.associateDegrees) {
+                        var spli = item.associateDegrees.split(',')
+                        var sl  = []
+                        for(var i in spli) {
+                            var num = +spli[i] + 0
+                            sl.push(num)
+                        }
+                        this.auseList = sl
+                        console.log(this.auseList)
+                    }
+                    // var spli = item.associateDegrees.split(',')
+                    // var sl  = []
+                    // for(var i in spli) {
+                    //     var num = +spli[i] + 0
+                    //     sl.push(num)
+                    // }
+                    // this.auseList = sl
+                    // console.log(this.auseList)
                     this.changeParticipator();
                     this.getProjectBaseData(item.id);
                     if (this.user.company.packageEngineering == 1) {
@@ -1460,7 +1528,21 @@
                         if (this.chosenLeaders != null && this.chosenLeaders.length > 0) {
                             formData.append("chosenLeaders", JSON.stringify(this.chosenLeaders));
                         }
-                        
+                        var listId = []
+                        var listName = []
+                        for(var i in this.auseList) {
+                            listId.push(this.auseList[i])
+                            for(var j in this.ause) {
+                                if(this.auseList[i] == this.ause[j].id) {
+                                    listName.push(this.ause[i].name)
+                                }
+                            }
+                        }
+                        listId.toString()
+                        listName.toString()
+                        formData.append("associateDegrees", listId)
+                        formData.append("associateDegreeNames", listName)
+                        // return
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
                             this.addLoading = false;
@@ -1544,12 +1626,13 @@
             };
         },
         mounted() {
+            this.userssHu()
             this.getDepartment();
             this.getList();
             this.getUsers();
             this.getCustomerList();
             this.getProjectBaseConfigList();
-            
+            this.yanjiuzx()
         }
     };
 </script>

+ 461 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/research/list.vue

@@ -0,0 +1,461 @@
+<template>
+    <section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+            <el-form :inline="true">
+                <el-form-item label="研究中心">
+                    
+                </el-form-item>
+                <el-form-item >
+                    <div>
+                    <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true">
+                        <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
+                    </el-input>
+                    </div>
+                </el-form-item>
+                <el-form-item style="float:right;" v-if="user.role == 1||user.role == 2||user.role == 5">
+                    <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增客户</el-link>
+                </el-form-item>
+            </el-form>
+        </el-col>
+
+        <!--列表-->
+        <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
+            <el-table-column type="index" width="60">
+                <template slot-scope="scope" >
+                        {{scope.$index+1+(page-1)*size}}
+                    </template>
+            </el-table-column>
+            <el-table-column prop="customerCode" label="客户编码"  width="120"></el-table-column>
+            <el-table-column prop="customerName" label="客户名称" >
+            </el-table-column>
+            <el-table-column prop="contactName" label="联系人"  width="120">
+            </el-table-column>
+            <el-table-column prop="contactPhone" label="联系电话"  width="150">
+            </el-table-column>
+            <el-table-column prop="email" label="邮箱"  width="150">
+            </el-table-column>
+            <el-table-column prop="address" label="地址" >
+            </el-table-column>
+            
+            <el-table-column label="操作" width="150" v-if="user.role == 1||user.role == 2||user.role == 5 || user.leader">
+                <template slot-scope="scope">
+                    <el-button size="mini" v-if="user.role>0" type="primary" @click="handleAdd(scope.$index, scope.row)">编辑</el-button>
+                    <el-button v-if="user.role>0" size="mini"  @click="deletePro(scope.$index, scope.row)">删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <!--工具条-->
+        <el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;"
+            ></el-pagination>
+        </el-col>
+
+        <!--新增界面-->
+        <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
+            <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
+                <el-form-item label="客户编号" >
+                    <el-input v-model="addForm.customerCode" :max="20" :disabled="user.role==0" placeholder="请输入客户编号" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="客户名称" prop="customerName">
+                    <el-input v-model="addForm.customerName" :max="20" :disabled="user.role==0" placeholder="请输入客户名称" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="联系人" prop="contactName">
+                    <el-input v-model="addForm.contactName" :max="20" :disabled="user.role==0" placeholder="请输入客户联系人" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="联系电话" prop="contactPhone">
+                    <el-input v-model="addForm.contactPhone" :max="20" :disabled="user.role==0" placeholder="请输入客户联系电话" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="邮箱" prop="email">
+                    <el-input v-model="addForm.email" :max="25" :disabled="user.role==0" placeholder="请输入客户邮箱" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="地址" prop="address">
+                    <el-input v-model="addForm.address" :max="50"  :disabled="user.role==0" placeholder="请输入客户联系地址" clearable></el-input>
+                </el-form-item>
+
+            </el-form>
+            <div slot="footer" class="dialog-footer;">
+                <el-button @click.native="addFormVisible = false">取消</el-button>
+                <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
+            </div>
+        </el-dialog>
+    </section>
+</template>
+<style scoped>
+.input-with-select .el-input-group__prepend {
+    background-color: #fff;
+  }
+.line {
+    padding:10px;
+}
+.line span{
+    font-size:15px;
+}
+.line span:nth-child(even){
+    float:right;
+}
+</style>
+<script>
+    import util from "../../common/js/util";
+    export default {
+        data() {
+            return {
+                roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","人事管理员", "项目管理员"],
+                status:null,
+                statusTxt:["-","进行中","已完成","已撤销"],
+                importanceList:[{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}],
+                searchField:null,
+                keyword:null,
+                user: JSON.parse(sessionStorage.getItem("user")),
+                userDetailVisible: false,
+                userDetail:{},
+                date: new Date(),
+                users: [],
+                participator:[],
+                tableHeight: 0,
+                listLoading: false,
+                total: 0,
+                page: 1,
+                size: 20,
+                list: [],
+                subProjectVisible: false,
+                subProjectList: [],//子项目列表
+                currentProject:{},
+                addSubProject: false,
+                addFormVisible: false,
+                addLoading: false,
+                addUp: 0, // 合计
+                title: "",
+                addForm: {
+                    name: '',
+                    userId: [],
+                    level:1,
+                },
+                rules: {
+                    customerName: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
+                }
+            };
+        },
+        // 过滤器
+        filters: {
+            numberToCurrency(value) {
+                if (!value) return '0.00'
+                // 将数值截取,保留两位小数
+                value = value.toFixed(2)
+                // 获取整数部分
+                const intPart = Math.trunc(value)
+                // 整数部分处理,增加,
+                const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
+                // 预定义小数部分
+                let floatPart = '.00'
+                // 将数值截取为小数部分和整数部分
+                const valueArray = value.toString().split('.')
+                if (valueArray.length === 2) { // 有小数部分
+                floatPart = valueArray[1].toString() // 取得小数部分
+                return intPartFormat + '.' + floatPart
+                }
+                return intPartFormat + floatPart
+            }
+        },
+        methods: {
+            importProject(item) {
+                //首先判断文件类型
+                let str = item.file.name.split(".");
+                let format = str[str.length - 1];
+                if (format != "xls" && format != "xlsx") {
+                    this.$message({
+                        message: "请选择.xls或.xlsx文件",
+                        type: "error"
+                    });
+                } else {
+                    this.listLoading = true;
+                    let formData = new FormData();
+                    formData.append("file", item.file);
+                    formData.append("userId", this.user.id);
+                    this.http.uploadFile('/project/importData', formData,
+                    res => {
+                        this.$refs.upload.clearFiles();
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "导入成功",
+                                type: "success"
+                            });
+                            this.getList();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$refs.upload.clearFiles();
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            },
+            number(){  
+        //      this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
+        //         this.addForm.budget = this.addForm.budget.replace('.','');
+          },
+            deleteSubPro(subProject) {
+                this.$confirm("确定要删除子项目" + subProject.name + "吗?","删除子项目", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                })
+                .then(() => {
+                    this.listLoading = true;
+                    this.http.post('/sub-project/deleteProject',{ 
+                        id: subProject.id 
+                    },
+                    res => {
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "删除成功",
+                                type: "success"
+                            });
+                            this.subProject(this.currentProject);
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+                })
+                .catch(() => {});
+            },
+            searchList() {
+                this.page = 1;
+                this.getList();
+            },
+            addNewSubProject(subProject) {
+                console.log(123);
+                if (subProject == null) {
+                    this.addForm = {projectId: this.currentProject.id, level:1}
+                } else {
+                    this.addForm = subProject;
+                }
+                this.addSubProject = true;
+            },
+            //显示子项目
+            subProject(item) {
+                this.subProjectVisible = true;
+                this.currentProject = item;
+                this.http.post('/sub-project/list', {
+                    projectId: item.id
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.subProjectList = res.data;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //显示用户详情
+            showUser(userId) {
+                this.userDetailVisible = true;
+                this.http.post(this.port.manage.userDetail, {
+                    userId: userId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.userDetail = res.data;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            
+            
+            //分页
+            handleCurrentChange(val) {
+                this.page = val;
+                this.getList();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+                this.getList();
+            },
+
+            //获取项目列表
+            getList() {
+                this.listLoading = true;
+                this.http.post('/customer-info/list', {
+                    pageIndex: this.page,
+                    pageSize: this.size,
+                    keyword:this.keyword
+                },
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        var list = res.data.records;
+                        this.list = list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
+            //显示新增界面
+            handleAdd(i, item) {
+                if(i == -1) {
+                    this.title = "新增客户";
+                    this.addForm = {
+                    }
+                } else {
+                    this.title = "修改客户";
+                    this.addForm = JSON.parse(JSON.stringify(item));
+                }
+                this.addFormVisible = true;
+            },
+
+            submitInsert() {
+                this.$refs.form1.validate(valid => {
+                    if (valid) {
+                        this.addLoading = true;
+                        this.http.post('/customer-info/addOrMod', this.addForm,
+                        res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.getList();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.addLoading = false;
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                        });
+                        }
+                });
+            },
+
+            // 删除
+            deletePro(i, item) {
+                this.$confirm("确定要客户" + item.customerName + "吗?","删除客户", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                })
+                .then(() => {
+                    this.listLoading = true;
+                    this.http.post('/customer-info/delete',{ 
+                        id: item.id 
+                    },
+                    res => {
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "删除成功",
+                                type: "success"
+                            });
+                            this.getList();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+                })
+                .catch(() => {});
+            },
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 195;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 195;
+            };
+        },
+        mounted() {
+            this.getList();
+        }
+    };
+</script>
+
+<style lang="scss" scoped>
+.rg_span{
+    display: inline-block;
+}
+.rg_span span {
+    text-align: right;
+    box-sizing: border-box;
+    padding-right: 10px;
+}
+.el-dialog__title {
+    display: inline-table;
+    margin-top: 20px;
+}
+</style>

+ 191 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -167,7 +167,7 @@
             </div>
         </el-col>
         </el-row>
-        <!-- 设置员工可补填的时间 -->
+<!-- 设置员工可补填的时间 -->
         <p style="margin-left:10px;color:#666;">普通员工补填日报时间限制</p>
         <el-row :gutter="20" style="padding-top:10px;width:100%;margin:0 auto;padding-left:10px;padding-right:10px;">
         <el-col :span="24" >
@@ -184,11 +184,57 @@
                 </el-form>
             </div>
         </el-col>
-        </el-row>
-        <div style="width:80px;margin:0 auto;padding:20px;">
+        </el-row><!-- 设置研究中心 -->
+        <div class="yanjiu">
+            <p style="margin-left:10px;color:#666;">自定义日报统计维度</p>
+            <el-switch style="margin-left: 40px" v-model="timeType.customDegreeActive" active-color="#13ce66" inactive-color="#ff4949"> </el-switch>
+        </div>
+        <el-row v-if="timeType.customDegreeActive" :gutter="20" style="padding-top:10px;width:100%;margin:0 auto;padding-left:10px;padding-right:10px;">
+            <el-col :span="24" >
+                <div class="panel" style="height:60px;">
+                    <el-form :inline="true" :model="timeType"  style="margin-top:10px;">
+                        <el-form-item label="维度名称 ">
+                            <el-input placeholder="请输入维度名称" size="small" v-model="timeType.customDegreeName" clearable> </el-input>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-button type="primary" size="small" @click="bianji()">数据维护</el-button>
+                        </el-form-item>
+                    </el-form>
+                </div>
+            </el-col>
+        </el-row>        <div style="width:80px;margin:0 auto;padding:20px;">
             <el-button  type="primary" @click="submitInsert" :loading="addLoading">保存</el-button>
         </div>
-        
+        <!-- 维护数据 -->
+        <el-dialog title="维护数据列表" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
+            <el-table :data="subProjectList" highlight-current-row  height="400" style="width: 100%;">
+            <el-table-column prop="id" width="60" label="序号"></el-table-column>
+            <el-table-column prop="name" label="名称" ></el-table-column>
+            <el-table-column label="操作" width="150">
+                <template slot-scope="scope" >
+                    <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">编辑</el-button>
+                    <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">删除</el-button>
+                </template>
+            </el-table-column>
+
+            </el-table>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="subProjectVisible = false" >关闭</el-button>
+                <el-button type="primary" @click="addNewSubProject()" >新增数据</el-button>
+            </div>
+        </el-dialog>
+        <!-- 新增子项目弹出框 -->
+        <el-dialog title="新增/修改维护数据" v-if="addSubProject" :visible.sync="addSubProject" :close-on-click-modal="false" customClass="customWidth" width="500px">
+            <el-form ref="form2" :model="addfm" :rules="ruless" label-width="100px">
+                <el-form-item label="名称" prop="name">
+                    <el-input v-model="addfm.name" placeholder="请输入名称" clearable></el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click.native="addSubProject = false">取消</el-button>
+                <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">提交</el-button>
+            </div>
+        </el-dialog>
     </section>
 </template>
 <script>
@@ -213,14 +259,135 @@
                 monthDays: 21.75,
                 pm: 4,
                 type: 0},
+                customDegreeActive: false,
+                customDegreeName: '',
                 rules: {
                     allday: [{ required: true, message: "请选择全天工作时长", trigger: "blur" }],
                     am: [{ required: true, message: "请输入上午工作时长", trigger: "blur" }],
                     pm: [{ required: true, message: "请输入下午工作时长", trigger: "blur" }],
+                },
+                ruless: {
+                    name: [{ required: true, message: "请输入名称", trigger: "blur" }],
+                },
+                subProjectVisible: false,
+                subProjectList: [],//子项目列表
+                addSubProject: false,
+                addfm: {
+                    name: '',
                 }
             };
         },
         methods: {
+            bianji() {
+                this.subProjectVisible = true
+                this.listLoading = true;
+                this.http.post('/report-extra-degree/getAll ',{},
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        console.log(res, '看看')
+                        this.subProjectList = res.data
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    }
+                );
+            },
+            submitInsertSubProject() {
+                this.$refs.form2.validate(valid => {
+                    if (valid) {
+                        var slp = this.addfm
+                        this.http.post('/report-extra-degree/addOrMod',slp,
+                        res => {
+                            this.listLoading = false;
+                            if (res.code == "ok") {
+                                this.$message({
+                                    message: '成功',
+                                    type: "success"
+                                });
+                                this.addfm = {name: ''}
+                                this.addSubProject = false
+                                this.bianji()
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.listLoading = false;
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                            }
+                        );
+                    }
+                })
+            },
+            addNewSubProject(subProject) {
+                // console.log(1234)
+                // if (subProject == null) {
+                //     this.addForm = {projectId: this.currentProject.id, level:1}
+                // } 
+                // else {
+                //     this.addForm = subProject;
+                // }
+                if(subProject) {
+                    this.addfm.name = subProject.name
+                    this.addfm.id = subProject.id
+                }
+                this.addSubProject = true;
+            },
+            deleteSubPro(subProject) {
+                this.$confirm("确定要这条" + subProject.name + "数据吗?","删除", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                })
+                .then(() => {
+                    this.listLoading = true;
+                    this.http.post('/report-extra-degree/delete',{ 
+                        id: subProject.id 
+                    },
+                    res => {
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "删除成功",
+                                type: "success"
+                            });
+                            this.bianji();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+                })
+                .catch(() => {});
+            },
+            // 改的
             selectPanel(type) {
                 this.timeType.type = type;
             },
@@ -233,7 +400,12 @@
                     this.timeType.am = this.timeType.allday;
                 }
                 this.timeType.pm = this.timeType.allday - this.timeType.am;
-               
+                if(this.timeType.customDegreeActive == 0) {
+                    this.timeType.customDegreeActive = false
+                } else {
+                    this.timeType.customDegreeActive = true
+                }
+                // this.customDegreeName = this.timeType.customDegreeName
             },
             initTime() {
                 for (var i=1.0; i<=12.0; i+=0.5) {
@@ -246,6 +418,12 @@
             submitInsert() {
                 this.$refs.form1.validate(valid => {
                     if (valid) {
+                        var spl = this.timeType.customDegreeActive
+                        if(this.timeType.customDegreeActive) {
+                            this.timeType.customDegreeActive = 1
+                        } else {
+                            this.timeType.customDegreeActive = 0
+                        }
                         this.http.post('/time-type/save',this.timeType,
                             res => {
                                 this.listLoading = false;
@@ -254,6 +432,7 @@
                                         message: '保存成功',
                                         type: "success"
                                     });
+                                    this.timeType.customDegreeActive = spl
                                 } else {
                                     this.$message({
                                         message: res.msg,
@@ -326,6 +505,12 @@
 }
 .tip {
     margin-left:10px; color:gray;
-    
+    float: right;   
+}
+.yanjiu {
+    display: flex;
+    align-items: center;
+    // justify-content: space-between;
+    padding: 0 20px 0 0;
 }
 </style>

+ 270 - 16
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -189,18 +189,18 @@
         </div>
 
         <!-- 填写日报的dialog -->
-        <el-dialog :title="isBatch==0?'填写日报':'批量填报'" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false">
+        <el-dialog :title="isBatch==0?'填写日报':'批量填报'" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()">
             <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px">
-                <el-form-item label="选择人员" v-if="isSubstitude" 
-
-                >
+                <el-form-item label="选择人员" v-if="isSubstitude">
                     <el-input @focus="showChooseMembTree" v-model="workForm.userNames"
                     placeholder="请选择代填人员" ></el-input>
                 </el-form-item>
                 <el-form-item label="工作日期" prop="createDate">
                     <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
                     :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
-                    @change="changeMonth()" :clearable="false" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
+                    @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
+                    <div v-if="falsss" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
+                    <div v-if="isBatch!=0" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
                     <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0?'总':'每日'}}时长:</span>
                     <el-input-number :disabled="!canEdit" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
                         v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
@@ -227,7 +227,8 @@
                         <el-select v-model="domain.workingTime" style="width:200px;"
                         v-if="reportTimeType.type == 1"
                         :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
-                        placeholder="请选择工作时长" >
+                        placeholder="请选择工作时长"
+                        @change="seleChn(0)">
                         <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
                         </el-select>
                         <span v-if="reportTimeType.type == 1">小时</span>
@@ -244,7 +245,8 @@
                             :picker-options="{
                             start: '08:00',
                             end: '23:30'
-                            }">
+                            }"
+                            @change="iptChang()">
                         </el-time-picker> - <el-time-picker 
                         :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
                             v-model="domain.endTime"
@@ -256,7 +258,8 @@
                             start: '08:00',
                             end: '23:30',
                             minTime: domain.startTime
-                            }">
+                            }"
+                            @change="iptChang()">
                         </el-time-picker>
                         </span>
                         <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
@@ -291,11 +294,19 @@
                         <el-link type="primary" v-if="workForm.domains[index].state == 0 || workForm.domains[index].state == 2"
                              :underline="false" style="margin-left:5px;" @click="copyProject(index)">复制</el-link>
                     </el-form-item>
+                    <!-- 相关维度 -->
+                    <!-- <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
+                            <el-select v-model="domain.degreeId" clearable placeholder="请选择相关维度">
+                                <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-form-item> -->
 
                     <el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
                         :rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
                         <div style="width:300px;">
-                            <el-col span="14"><el-slider :disabled="!canEdit" v-model="domain.progress" :min="10" :show-tooltip="false" :step="10" style="width:180px;" @change="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)"></el-slider></el-col>
+                            <el-col span="14"><el-slider :disabled="!canEdit" v-model="domain.progress" :min="10" :show-tooltip="false" :step="10" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
                             <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}小时</span></el-col>
                         </div>
                         <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
@@ -360,6 +371,13 @@
                                 :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
                             </span>
                         </el-form-item>
+                        <!-- 相关维度 -->
+                        <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
+                            <el-select v-model="domain.degreeId" clearable placeholder="请选择相关维度">
+                                <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
                         <!--项目管理专业版模式下,项目下的近期执行的任务 -->
                         <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
                             <el-select v-model="domain.taskId" placeholder="请选择" style="width:100%;" filterable="true" 
@@ -384,8 +402,9 @@
                                 value-format="HH:mm"
                                 :picker-options="{
                                 start: '00:00',
-                                end: '23:59'
-                                }">
+                                end: '23:59',
+                                }"
+                                @change="iptChangs()">
                             </el-time-picker> - <el-time-picker 
                             :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
                                 v-model="timeItem.endTime"
@@ -397,7 +416,8 @@
                                 start: '00:00',
                                 end: '23:59',
                                 minTime: timeItem.startTime
-                                }">
+                                }"
+                                @change="iptChangs()">
                             </el-time-picker>
                             </span>
                         </el-form-item>
@@ -421,7 +441,7 @@
                     </p>
                     <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
                 </div>
-                <el-link v-if="showAddMore"  :disabled="!canEdit" type="primary" :underline="false" @click="addDomain" style="margin-left:40px">添加更多</el-link>
+                <el-link v-if="showAddMore"  :disabled="!canEdit" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px">添加更多</el-link>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="deleteReport" v-if="workForm.domains[0].id != null">删除</el-button>
@@ -666,9 +686,149 @@
                 domObj: null,
                 participator:[],
                 chosenMembCount:0,
+                jsDay: 0,
+                jsTime: 0,
+                falsss: false,
+                weidu: [],
+                weiduList: [],
+                yonghuUser: []
             };
         },
         methods: {
+            userssHu() {
+                this.http.post('/time-type/getCompanyTimeSetting',{ 
+                    companyId: this.user.companyId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.yonghuUser = res.data
+                        console.log(this.yonghuUser)
+                    } 
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    }
+                );
+            },
+            iptBlur(i) {
+                console.log(i)
+                // console.log(this.workForm.createDate)
+                if(this.isBatch == 0) {
+                    return
+                }
+                var stat = this.workForm.createDate[0]
+                var end = this.workForm.createDate[1]
+                // this.jsDay = 10
+                this.http.post('/report/getWorkDays',{ 
+                    startDate: stat,
+                    endDate: end
+                },
+                res => {
+                    if (res.code == "ok") {
+                        // console.log(res, '出来的数据')
+                        this.jsDay = res.data
+                        this.chuji(i)
+                    } 
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    }
+                );
+
+                var sl = this.workForm.domains
+                this.chuji(i)
+                // console.log(this.workForm, '看看')
+            },
+            chuji(i) {
+                console.log(12345, i)
+                if(i == 0) {
+                    this.seleChn(1)
+                } else if(i == 1) {
+                    this.seleChn(0)
+                } else if(i == 2) {
+                    if(this.workForm.domains[0].multiWorktime > 0) {
+                        console.log('触发上面的')
+                        this.iptChangs()
+                    } else {
+                        console.log('触发下面的')
+                        this.iptChang()
+                    }
+                } else if(i == 3) {
+                    this.seleChn(0)
+                }
+            },
+            seleChn(e) {
+                console.log('出发了', e)
+                if(e == 1) {
+                    for(var i in this.workForm.domains) {
+                        if(this.workForm.domains[i].timeType == 0) {
+                            this.workForm.domains[i].workingTime = 8
+                        } else {
+                            this.workForm.domains[i].workingTime = 4
+                        }
+                    }
+                }
+                var quanbu = 0 
+                var spl = this.workForm.domains
+                var zhi = ''
+                for(var i in spl) {
+                    var sp = +spl[i].workingTime + 0
+                    zhi = this.jsDay * sp
+                    quanbu = +quanbu + zhi
+                }
+                this.jsTime = quanbu
+            },
+            iptChang() {
+                var sl = this.workForm.domains
+                var quanbu = 0 
+                var zhi = ''
+                for(var i in sl) {
+                    if(sl[i].startTime && sl[i].endTime) {
+                        var date2 = '2021/12/12 ' + sl[i].endTime +':00'
+                        var date1 = '2021/12/12 ' + sl[i].startTime +':00'
+                        var date3 = new Date(date2).getTime() - new Date(date1).getTime();
+                        var leave1=date3%(24*3600*1000)
+                        var hours=Math.floor(leave1/(3600*1000))
+                        var leave2=leave1%(3600*1000)
+                        var minutes=Math.floor(leave2/(60*1000))
+                        var shi = hours+'.'+ minutes
+                        var sll = +shi + 0
+                        zhi = this.jsDay * sll
+                        quanbu = +quanbu + zhi
+                    }
+                }
+                this.jsTime = quanbu
+            },
+            iptChangs() {
+                console.log(this.workForm)
+                var sl = this.workForm.domains
+                var quanbu = 0 
+                var zhi = ''
+                for(var i in sl) {
+                    for(var j in sl[i].worktimeList){
+                        if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
+                            var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
+                            var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
+                            var date3 = new Date(date2).getTime() - new Date(date1).getTime();
+                            var leave1=date3%(24*3600*1000)
+                            var hours=Math.floor(leave1/(3600*1000))
+                            var leave2=leave1%(3600*1000)
+                            var minutes=Math.floor(leave2/(60*1000))
+                            var shi = hours+'.'+ minutes
+                            var sll = +shi + 0
+                            zhi = this.jsDay * sll
+                            quanbu = +quanbu + zhi
+                        }
+                    }
+                }
+                this.jsTime = quanbu
+            },
             removeTimeItem(item, index) {
                 item.worktimeList.splice(index, 1);
             },
@@ -1007,6 +1167,30 @@
                 if (this.user.company.packageProject == 1) {
                     this.getProjectStages(domain, index);
                 }
+                // 获取项目相关的维度
+                this.dimension(domain, index)
+            },
+            // 获取维度数据
+            dimension(domain, index) {
+                console.log(domain)
+                if(domain.projectId == '') {
+                    return
+                }
+                this.http.post('/project/getDegreeList',{ 
+                    projectId: domain.projectId,
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.workForm.domains[index].wuduList = res.data
+                    } 
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    }
+                );
             },
             //切换任务阶段
             changeStages(domain, index) {
@@ -1456,6 +1640,7 @@
             },
             //时间段范围设置改动,监听
             onTimeTypeChange(timeType) {
+                this.seleChn(1)
                 this.showAddMore = true;
                 for(var i in this.workForm.domains) {
                     if (this.workForm.domains[i].timeType == 0) {
@@ -1505,13 +1690,12 @@
                             type: "error"
                         });
                     });
-            },
+            },  
             // 改变月份
             changeMonthOut() {
                 this.getAllDate();
                 this.getReportList();
                 this.getDepartment();
-                
             },
 
             // 选择日期
@@ -1676,14 +1860,35 @@
                 },
                 res => {
                     if (res.code == "ok") {
+                        var quanbu = 0 
+                        this.jsDay = 1
+                        var zhi = ''
+                        var slp = res.data.report
+                        for(var i in slp) {
+                            var sp = +slp[i].workingTime + 0
+                            zhi = this.jsDay * sp
+                            quanbu = +quanbu + zhi
+                        }
+                        this.jsTime = quanbu
                         var list = res.data;
                         this.report = list;
                         if(list.report.length != 0) {
+                            console.log('执行上面')
                             var arr = [];
                             this.canEdit = false;
                             for(var i in list.report) {
                                 var flg = null
                                 list.report[i].isOvertime == 1 ? flg = true : flg = false
+                                // var srr = []
+                                // if(list.report[i].degreeId != null) {
+                                //     var a = list.report[i].degreeId + ''
+                                //     var ace = a.split('')
+                                //     for(var b in ace) {
+                                //         var nnm = +ace[b] + 0
+                                //         srr.push(nnm)
+                                //     }
+                                // }
+                                
                                 arr.push({
                                     id: list.report[i].id,
                                     projectId: list.report[i].projectId,
@@ -1707,6 +1912,8 @@
                                     pics: list.report[i].pics,
                                     multiWorktime: list.report[i].multiWorktime,
                                     worktimeList: list.report[i].worktimeList,
+                                    degreeId: list.report[i].degreeId,
+                                    wuduList: list.report[i].degreeList,
                                 })
                                 if (list.report[i].state >= 2) {
                                     this.canEdit = true;
@@ -1718,6 +1925,7 @@
                                 userNames:null,
                                 userId:null,
                             }
+                            console.log(this.workForm, '数据')
                         } else {
                             this.workForm = {
                                 createDate: this.workForm.createDate,
@@ -1751,9 +1959,35 @@
                     });
                 });
             },
+            guanbi() {
+                this.falsss = false
+            },
+            // wuduLists(id) {
+            //     console.log(id)
+            //     this.http.post('/project/getDegreeList',{ 
+            //         projectId: id,
+            //     },
+            //     res => {
+            //         if (res.code == "ok") {
+            //             return res.data
+            //         } 
+            //     },
+            //     error => {
+            //         this.$message({
+            //             message: error,
+            //             type: "error"
+            //         });
+            //         }
+            //     );
+            // },
 
             // 打开日报填写
             fillInReport(i, isBatch) {
+                if(i != 1) {
+                    this.falsss = false 
+                } else {
+                    this.falsss = true
+                }
                 if (this.isSubstitude) {
                     this.getSubstitudeUserDeptList();
                 }
@@ -1790,7 +2024,7 @@
             },
 
             // 添加模块
-            addDomain() {
+            addDomain(i) {
                 var leftProgress = 10;
                 if (this.reportTimeType.type == 3) {
                     //计算已经待分配工时比例
@@ -1820,6 +2054,8 @@
                         this.showAddMore = false;
                     }
                 }
+
+                this.chuji()
                 
             },
 
@@ -1834,6 +2070,7 @@
                         this.showAddMore = true;
                     }
                 }
+                this.seleChn(0)
                 
             },
 
@@ -2042,7 +2279,17 @@
                             } else {
                                 formData.append("stage", "");
                             }
+                            if(this.workForm.domains[i].degreeId) {
+                                var sss = this.workForm.domains[i].degreeId.toString()
+                                formData.append("degreeId", sss);
+                            }
                         }
+                        // console.log(formData, '看看数据')
+                        // formData.forEach((value, key) => {
+                        //     console.log("%s=%s", key, value);
+                        //     })
+                        // console.log(this.workForm, '这里是数据')
+                        // return
                         this.http.uploadFile( this.port.report.editPort, formData,
                         res => {
                             this.listLoading = false;
@@ -2052,6 +2299,8 @@
                                     type: "success"
                                 });
                                 this.dialogVisible = false;
+                                this.jsDay = 0
+                                this.jsTime = 0
                                 this.getReportList();
                                 this.getDepartment();
                             } else {
@@ -2212,6 +2461,7 @@
             this.getTimeType();
             this.getDepartment();
             this.scrollFunction()
+            this.userssHu()
         }
     };
 </script>
@@ -2325,5 +2575,9 @@
         display: inline-block;
         margin-left: 30px;
     }
+    .bloks {
+        display: inline-block;
+        width: 380px;
+    }
     
 </style>