ソースを参照

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

17613754660 3 年 前
コミット
99544e41d1

+ 61 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -8,7 +8,7 @@
             <el-radio-button label="1">显示工时</el-radio-button>
             </el-radio-group></div>
         </el-col>
-        <el-col :span="12" style="">
+        <el-col :span="14" style="">
             <el-date-picker v-show="user.timeType.fixMonthcost==0"
             v-model="dateRange" :editable="false" 
             format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
@@ -35,13 +35,19 @@
                 <el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button>
             </el-radio-group>
         </el-col>
-        <el-col :span="6">
+        <el-col :span="4">
             <el-button @click="showExportDialog">报表导出</el-button>
         </el-col>
         </el-row>
-        <div :style="'width:'+widthHtval+'px;position: relative; height:'+containerHeight+'px;'">
+        <!-- <div id="clearfix" :style="'width:'+widthHtval+'px;position: relative; height:'+containerHeight+'px;'">
+             <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
+        </div> -->
+        <div id="clearfix" :style="'overflow-x: auto;width:100%;padding-bottom: 100px; position: relative; height:'+containerHeight+'px;'">
              <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
         </div>
+        <!-- <div>
+             <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
+        </div> -->
         <div style="position:fixed;top:170px;left:600px;" v-show="radio=='部门' && parentDeptId != null">
             <el-button @click="backToParentDept">返回上级</el-button>
         </div>
@@ -280,6 +286,24 @@
                     var _this = this;
                     this.hasReportUserList = [];
                     if (res.code == "ok") {
+                        // 
+                            // var sss = []
+                            // var ddd = []
+                            // for(var i = 0; i < 120; i++) {
+                            //     sss.push(res.data.list[0])
+                            //     ddd.push(res.data.userList[0])
+                            // }
+                            // res.data.list = sss
+                            // res.data.userList = ddd
+                            for(var i in res.data.list) {
+                                if(i>20) {
+                                    // this.widthHtval = +this.widthHtval + 2
+                                    this.widthHtval = +this.widthHtval + 40
+                                } else {
+                                    this.widthHtval = document.body.clientWidth - 230
+                                }
+                            }
+                        // 
                         //工时总成本
                         this.hasReportUserList = res.data.userList;
                         var xList = [] , yList = [] , list = res.data.list, array = [] , series = [];
@@ -343,6 +367,11 @@
                             
                             var myChart = echarts.init(document.getElementById("container"));
                             totalHours = totalHours.toFixed(1);
+                            // 设置宽度
+                            myChart.resize({
+                                width: this.widthHtval
+                            })
+                            // 设置宽度
                             _this.myChart = myChart;
                             var option = {
                                 //总成本
@@ -350,7 +379,6 @@
                                     text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元, 时长'+totalHours+'小时',
                                     left:'left',
                                 },
-                                
                                 // 工具箱
                                 legend: {
                                     x: 80,
@@ -361,7 +389,10 @@
                                 },
                                 grid : {
                                     top : 80,    //距离容器上边界40像素
-                                    bottom: 35   //距离容器下边界30像素
+                                    // bottom: 100,   //距离容器下边界30像素
+                                    bottom: 35,   //距离容器下边界30像素
+                                    left: 150,
+                                    right: 150
                                 },
                                 toolbox: {
                                     show: true,
@@ -683,15 +714,37 @@
                         type: "error"
                     });
                 });
-            }
+            },
+            // 左右滚动
+            scrollFunction () {
+                this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
+                if (this.domObj.attachEvent) { // IE
+                this.domObj.attachEvent('onmousewheel', this.mouseScroll)
+                } else if (this.domObj.addEventListener) {
+                this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
+                }
+                this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
+            },
+
+            mouseScroll(event) { // google 浏览器下
+                let detail = event.wheelDelta || event.detail
+                let moveForwardStep = -1
+                let moveBackStep = 1
+                let step = 0
+                step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
+                event.preventDefault() // 阻止浏览器默认事件
+                this.domObj.scrollLeft = this.domObj.scrollLeft + step
+            },
         },
         created() {
         },
         mounted() {
             this.containerHeight = window.innerHeight - 200
+            // this.containerHeight = window.innerHeight - 130
             const that = this;
             window.onresize = function temp() {
-                this.containerHeight = window.innerHeight - 200
+                this.containerHeight = window.innerHeight - 130
+                // this.containerHeight = window.innerHeight - 200
             };
             if (this.user.timeType.fixMonthcost == 0) {
                 if (this.$route.query.startDate != null) {
@@ -724,6 +777,7 @@
             this.getMyProjectList();
             this.getUsers()
             this.jutishez()
+            this.scrollFunction()
         },
     };
 </script>

+ 43 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/detail.vue

@@ -22,8 +22,9 @@
                 <el-radio-button label="阶段" v-if="user.company.packageProject != 0"></el-radio-button>
             </el-radio-group>
         </el-col>
-        
-        <div id="container" :style="'height:' + tableHeight + 'px'"></div> 
+        <div id="clearfix" :style="'overflow-x: auto;width:100%;padding-bottom: 0px; position: relative; height:'+containerHeight+'px;'">
+            <div id="container" :style="'height:' + tableHeight + 'px'"></div> 
+        </div>
     </section>
 </template>
 
@@ -75,6 +76,15 @@
                     endDate: this.endDate,
                 },
                 res => {
+                    // 
+                        for(var i in res.data.costList) {
+                            if(i>20) {
+                                this.widthHtval = +this.widthHtval + 40
+                            } else {
+                                this.widthHtval = document.body.clientWidth - 230
+                            }
+                        }
+                    // 
                     this.listLoading = false;
                     var _this = this;
                     if (res.code == "ok") {
@@ -90,6 +100,10 @@
                         }
 
                         var myChart = echarts.init(document.getElementById("container"));
+                        // 设置宽度
+                        myChart.resize({
+                            width: this.widthHtval
+                        })
                         _this.myChart = myChart;
                         var option = {
                             // 工具箱
@@ -113,6 +127,12 @@
                                     }
                                 }
                             },
+                            grid : {
+                                top : 80,    //距离容器上边界40像素
+                                bottom: 100,   //距离容器下边界30像素
+                                left: 150,
+                                right: 150
+                            },
                             tooltip:{
                                 trigger:'axis',
                                 formatter: function (params,ticket,callback) {
@@ -156,6 +176,26 @@
                     });
                 });
             },
+             // 左右滚动
+            scrollFunction () {
+                this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
+                if (this.domObj.attachEvent) { // IE
+                this.domObj.attachEvent('onmousewheel', this.mouseScroll)
+                } else if (this.domObj.addEventListener) {
+                this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
+                }
+                this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
+            },
+
+            mouseScroll(event) { // google 浏览器下
+                let detail = event.wheelDelta || event.detail
+                let moveForwardStep = -1
+                let moveBackStep = 1
+                let step = 0
+                step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
+                event.preventDefault() // 阻止浏览器默认事件
+                this.domObj.scrollLeft = this.domObj.scrollLeft + step
+            },
         },
         created() {
             let height = window.innerHeight;
@@ -173,6 +213,7 @@
             window.addEventListener("resize", function() {
                 _this.myChart.resize();
             });
+            this.scrollFunction()
         }
     };
 </script>

+ 40 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/detailDep.vue

@@ -19,8 +19,9 @@
                 </el-form-item>
             </el-form>
         </el-col> 
-
-        <div id="container" :style="'height:' + tableHeight + 'px'"></div> 
+        <div id="clearfix" :style="'overflow-x: auto;width:100%;padding-bottom: 100px; position: relative; height:'+containerHeight+'px;'">
+            <div id="container" :style="'height:' + tableHeight + 'px'"></div> 
+        </div>
     </section>
 </template>
 
@@ -117,6 +118,15 @@
                     this.listLoading = false;
                     var _this = this;
                     if (res.code == "ok") {
+                        // 
+                            for(var i in res.data.list) {
+                                if(i>20) {
+                                    this.widthHtval = +this.widthHtval + 40
+                                } else {
+                                    this.widthHtval = document.body.clientWidth - 230
+                                }
+                            }
+                        // 
                         var xList = [] , yList = [] , list = res.data.list, array = [] , series = [];
                         if (list.length > 0) {
                             this.cost = res.data.totalCostMoney;
@@ -171,6 +181,10 @@
                             }
 
                             var myChart = echarts.init(document.getElementById("container"));
+                            // 设置宽度
+                            myChart.resize({
+                                width: this.widthHtval
+                            })
                             _this.myChart = myChart;
                             var option = {
                                 // 工具箱
@@ -181,7 +195,9 @@
                                 },
                                 grid : {
                                     top : 80,    //距离容器上边界40像素
-                                    bottom: 35   //距离容器下边界30像素
+                                    bottom: 35,   //距离容器下边界30像素
+                                    left: 150,
+                                    right: 150
                                 },
                                 toolbox: {
                                     show: true,
@@ -258,6 +274,26 @@
                     });
                 });
             },
+            // 左右滚动
+            scrollFunction () {
+                this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
+                if (this.domObj.attachEvent) { // IE
+                this.domObj.attachEvent('onmousewheel', this.mouseScroll)
+                } else if (this.domObj.addEventListener) {
+                this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
+                }
+                this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
+            },
+
+            mouseScroll(event) { // google 浏览器下
+                let detail = event.wheelDelta || event.detail
+                let moveForwardStep = -1
+                let moveBackStep = 1
+                let step = 0
+                step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
+                event.preventDefault() // 阻止浏览器默认事件
+                this.domObj.scrollLeft = this.domObj.scrollLeft + step
+            },
         },
         created() {
             let height = window.innerHeight;
@@ -276,6 +312,7 @@
             window.addEventListener("resize", function() {
                 _this.myChart.resize();
             });
+            this.scrollFunction()
         }
     };
 </script>

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -6,7 +6,7 @@
                 <!-- <el-form-item label="财务核算成本 | 月份选择" style="margin-top:5px;"> -->
                 <el-form-item label="月份选择" style="margin-top:5px;">
                 <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change="changeMonth" :clearable="false" type="month" placeholder="选择月份" style="margin-right: 20px"></el-date-picker>
-                <el-link type="primary" :underline="false" @click="audits()">{{revaelse}}</el-link>
+                <el-link type="primary" :underline="false" @click="audits()" v-if="user.timeType.financeAudit == '1'">{{revaelse}}</el-link>
             </el-form-item>
             <!-- <el-radio-group v-model="radio" @change="switchList" style="margin-left:160px;margin-top:5px;"> -->
             <el-radio-group v-model="radio" @change="switchList" style="margin-left:80px;margin-top:5px;">
@@ -31,7 +31,7 @@
             <el-form-item style="float:right;" v-if="user.role == 1 || user.role == 2 || user.role == 4">
                 <el-link type="primary" :underline="false" @click="showItemDialog">自定义薪资项</el-link>
             </el-form-item>
-            <el-form-item style="float:right;" v-if="user.role == 1 || user.role == 2 || user.role == 4">
+            <el-form-item style="float:right;" v-if="(user.role == 1 || user.role == 2 || user.role == 4) && user.timeType.financeAudit == '1'">
                 <el-link type="primary" :underline="false" @click="reviewerVisible = true">设置审核人</el-link>
             </el-form-item>
             </el-form>

+ 5 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1261,11 +1261,13 @@
         },
         methods: {
             addUpload(data) {
-                var zhi = data.fileName.split('.')[0]
-                var sss = zhi + '.xlsx'
+                // var zhi = data.fileName.split('.')[0]
+                // var sss = zhi + '.xlsx'
+                // console.log(sss, data)
+                // return
                 var filePath = '/upload/' + data.serverName;
                 const a = document.createElement('a'); // 创建a标签
-                a.setAttribute('download', sss);// download属性
+                a.setAttribute('download', data.fileName);// download属性
                 a.setAttribute('href', filePath);// href链接
                 a.click(); //自执行点击事件
                 a.remove();