瀏覽代碼

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

seyason 2 年之前
父節點
當前提交
a58732b5bf

+ 12 - 0
fhKeeper/formulahousekeeper/timesheet/src/permissions.js

@@ -51,6 +51,7 @@ const StringUtil = {
         reportPhaseCost: false, // 查看阶段成本 //
         reportTimeDivide: false, // 人员工时分配表 //
         reportTimely: false, // 查看人员填报及时率 //
+        reportAuditRate: false, // 查看日报待审核统计 // 
 
         // 请假模块
         leaveFil : false, // 请假填报 // 
@@ -72,6 +73,12 @@ const StringUtil = {
         costAudit : false, // 费用审核 //
         costAll : false, // 查看全部报销单 //
 
+        // 工时成本统计
+        countAllWorkTime: false, // 查看全公司工时统计 //
+        countAllCost: false, // 查看全公司成本统计 //
+        countResWorkTime: false, // 查看负责部门工时统计 //
+        countResCost: false, // 查看负责部门成本统计 //
+
         // 项目报告审核
         projectReportReview: false, // 审核全员日报 //
 
@@ -137,6 +144,11 @@ const StringUtil = {
         arr[i] == '查看人员工时分配' ? obj.reportTimeDivide = true : ''
         arr[i] == '自定义配置' ? obj.structureCustomConfig = true : ''
         arr[i] == '查看人员填报及时率' ? obj.reportTimely = true : ''
+        arr[i] == '查看日报待审核统计' ? obj.reportAuditRate = true : ''
+        arr[i] == '查看全公司工时统计' ? obj.countAllWorkTime = true : ''
+        arr[i] == '查看负责部门工时统计' ? obj.countResWorkTime = true : ''
+        arr[i] == '查看全公司成本统计' ? obj.countAllCost = true : ''
+        arr[i] == '查看负责部门成本统计' ? obj.countResCost = true : ''
     }
 
     return obj

+ 8 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -28,7 +28,7 @@
                 <el-menu-item index="1-8" v-if="permissions.reportOvertime"><p @click="ssl(6)">加班情况统计表</p></el-menu-item>
 
                 <el-menu-item index="1-10" v-if="permissions.reportTimely"><p @click="ssl(9)">员工填报及时率</p></el-menu-item>
-                <el-menu-item index="1-11" v-if="permissions.reportTimely"><p @click="ssl(10)">日报待审核统计</p></el-menu-item>
+                <el-menu-item index="1-11" v-if="permissions.reportAuditRate"><p @click="ssl(10)">日报待审核统计</p></el-menu-item>
               </el-submenu>
             </el-menu>
         </el-col>
@@ -79,7 +79,7 @@
         </el-select>
           
           <!-- 部门筛选 -->
-          <el-cascader v-if="ins == 9 || (ins == 10 && departmentOrProject == 0)" v-model="departmentIdArray" :options="departmentList" placeholder="请选择部门"
+          <el-cascader v-if="ins == 9 || ins == 8 || ins == 6 || (ins == 10 && departmentOrProject == 0)" v-model="departmentIdArray" :options="departmentList" placeholder="请选择部门"
             :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
             @change="selcts(9)" size="small" style="margin-left:10px"
           ></el-cascader>
@@ -1064,6 +1064,9 @@ export default {
       } else {
         obj.userId = this.userId
       }
+      if(this.departmentIdArray.length != 0){
+        obj.departmentId = this.departmentIdArray[this.departmentIdArray.length - 1]
+      }
       this.http.post('/project/getOvertimeList', obj,
         res => {
             if (res.code == "ok") {
@@ -1220,6 +1223,9 @@ export default {
       if(this.userId){
         parameter.userId = this.userId
       }
+      if(this.departmentIdArray.length != 0){
+        parameter.departmentId = this.departmentIdArray[this.departmentIdArray.length - 1]
+      }
       this.listLoading = true
       this.http.post('/project/getUserWorkingTimeList',parameter,
       res => {

+ 102 - 49
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -4,8 +4,8 @@
         <el-col :span="6" >
             <div ><span style="color:#999;">图表Y轴: </span>
             <el-radio-group v-model="yAxisValue" @change="onYAxisChange">
-            <el-radio-button label="0">显示成本</el-radio-button>
-            <el-radio-button label="1">显示工时</el-radio-button>
+            <el-radio-button label="0" v-if="permissions.countAllCost || permissions.countResCost">显示成本</el-radio-button>
+            <el-radio-button label="1" v-if="permissions.countAllWorkTime || permissions.countResWorkTime">显示工时</el-radio-button>
             </el-radio-group></div>
         </el-col>
         <el-col :span="14" style="display: flex;flex-wrap: wrap;">
@@ -149,6 +149,7 @@
                 exportDialog:false,
                 dateRange:[],
                 user: JSON.parse(sessionStorage.getItem("user")),
+                permissions: JSON.parse(sessionStorage.getItem("permissions")),
                 radio: sessionStorage.radio!=null?sessionStorage.radio:'项目',
                 containerHeight: 0,    
                 myChart: null,
@@ -548,12 +549,18 @@
                             if(project.length != 0) {
                                 for(var k in project) {
                                     if(project[k].project == array[i]) {
-                                        dataList.push({
+                                        let item = {
                                             "value": this.yAxisValue==0?project[k].money:project[k].time,
-                                            "cost": project[k].time,
-                                             "money":project[k].money
-                                        })
-                                        totalHours += parseFloat(project[k].time);
+                                        }
+                                        if(this.permissions.countAllCost || this.permissions.countResCost){
+                                            item.money = project[k].money
+                                        }
+                                        if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
+                                            item.cost = project[k].time
+                                            totalHours += parseFloat(project[k].time);
+                                        }
+                                        dataList.push(item)
+                                        
                                     } else {
                                         num++;
                                     }
@@ -595,7 +602,10 @@
                     var option = {
                         //总成本
                         title: {
-                            text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元, 时长'+totalHours+'小时',
+                            // text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元, 时长'+totalHours+'小时',
+                            text: '工时成本总计:' + 
+                            ((this.permissions.countAllCost || this.permissions.countResCost) ? '成本' + totalMoneyCost.toFixed(2) + '元,' : '') + 
+                            ((this.permissions.countAllWorkTime || this.permissions.countResWorkTime) ? '时长' + totalHours + '小时' : ''),
                             left:'left',
                         },
                         // 工具箱
@@ -642,13 +652,17 @@
                                 for(var i in params) {
                                     if (params[i].data.value > 0) {
                                         res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>项目名称:" + params[i].seriesName 
-                                            + "</font><br/>工作成本 : " + params[i].data.money
-                                            + "元 <br/>工作时长"+" : " + params[i].data.cost + "小时</br></div>";
+                                            + "</font><br/>" + 
+                                            ((_this.permissions.countAllCost || _this.permissions.countResCost) ? "工作成本 : " + params[i].data.money + "元<br/>" : '') + 
+                                            ((_this.permissions.countAllWorkTime || _this.permissions.countResWorkTime) ? "工作时长 : " + params[i].data.cost + "小时</br>" : '') + "</div>";
                                         totalTime += Number(params[i].data.cost);
                                         totalCost += Number(params[i].data.money);
                                     }
                                 }
-                                res = res +'<br/>'+ params[0].name+ '<br/>总计: ' + totalTime.toFixed(1)+'小时 '+totalCost.toFixed(2) + "元<br/>";
+                                res = res +'<br/>'+ params[0].name+ '<br/>总计: ' + 
+                                ((_this.permissions.countAllWorkTime || _this.permissions.countResWorkTime) ? totalTime.toFixed(1) + '小时 ' : '') + 
+                                ((_this.permissions.countAllCost || _this.permissions.countResCost) ? totalCost.toFixed(2) + "元" : '') + 
+                                "<br/>";
                                 return res;
                             }
                         },
@@ -679,9 +693,9 @@
                     that.jieliu()
                 // },100);
                 // this.jieliu()
-                if(this.radio == '项目分类'){
-                    this.getCategoryList()
-                }
+                // if(this.radio == '项目分类'){
+                //     this.getCategoryList()
+                // }
             },
             getCategoryList(){
                 this.http.post('/project-category/list',{},
@@ -722,13 +736,14 @@
                 if (this.dateRange != null) {
                     param = {startDate:this.user.timeType.fixMonthcost==0?this.dateRange[0]:this.dateRange, 
                     endDate: this.user.timeType.fixMonthcost==0?this.dateRange[1]:this.dateRange};
-                    console.log(param);
+                    // console.log(param);
                 }
                 var url = '';
                 if (this.radio=='项目') {
                     url = this.port.project.listCost;
                 } else if (this.radio=='项目分类') {
                     url = '/project/getTimeCostByCategory';
+                    
                     // param.parentDeptId = this.parentDeptId;
                     // param.userId = this.user.id
                 } else if (this.radio=='部门') {
@@ -760,56 +775,81 @@
                         var totalHours = 0.0;
                         if(this.radio == '项目' || this.radio == '项目分类' || this.radio=='部门') {
                             list = res.data.costList
-                            totalMoneyCost = ((this.radio=='项目')?res.data.totalMoneyCost:res.data.totalCostMoney);
+                            totalMoneyCost = ((this.radio=='项目' || this.radio == '项目分类')?res.data.totalMoneyCost:res.data.totalCostMoney);
+
                             for(var i in list) {
                                 if(this.radio=='项目') {
                                     xList.push(list[i].project);
-                                    yList.push({
+                                    let item = {
                                         "value": this.yAxisValue==0?list[i].costMoney.toFixed(2) || list[i].costMoney:list[i].cost.toFixed(1),
                                         "id": list[i].id || i,
-                                        "cost": list[i].cost,
-                                        "money":list[i].costMoney.toFixed(2)
-                                    });
-                                    totalHours += parseFloat(list[i].cost);
+                                    }
+                                    if(this.permissions.countAllCost || this.permissions.countResCost){
+                                        item.money = list[i].costMoney.toFixed(2)
+                                    }
+                                    if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
+                                        item.cost = list[i].cost
+                                        totalHours += parseFloat(list[i].cost);
+                                    }
+                                    yList.push(item);
+                                    
                                 } else if(this.radio == '部门'){
                                     xList.push(list[i].departmentName);
-                                    yList.push({
-                                        "value": this.yAxisValue==0? list[i].costMoney.toFixed(2) || list[i].costMoney: list[i].costTime.toFixed(1),
+                                    let item = {
+                                        "value": this.yAxisValue==0 ? list[i].costMoney.toFixed(2) || list[i].costMoney: list[i].costTime.toFixed(1),
                                         "id": list[i].departmentId,
-                                        "cost": list[i].costTime,
-                                        "hasSubDept": list[i].hasSubDept,
-                                        "money":list[i].costMoney.toFixed(2)
-                                    });
-                                    totalHours += parseFloat(list[i].costTime);
+                                        "hasSubDept": list[i].hasSubDept
+                                    }
+                                    if(this.permissions.countAllCost || this.permissions.countResCost){
+                                        item.money = list[i].costMoney.toFixed(2)
+                                    }
+                                    if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
+                                        item.cost = list[i].costTime
+                                        totalHours += parseFloat(list[i].costTime);
+                                    }
+                                    yList.push(item);
+                                    
                                 }else {
                                     xList.push(list[i].categoryName);
-                                    yList.push({
+                                    let item = {
                                         "value": this.yAxisValue==0?list[i].costMoney.toFixed(2) || list[i].costMoney:list[i].cost.toFixed(1),
                                         "id": list[i].id || i,
-                                        "cost": list[i].cost,
-                                        "money":list[i].costMoney.toFixed(2)
-                                    });
-                                    totalHours += parseFloat(list[i].cost);
+                                    }
+                                    if(this.permissions.countAllCost || this.permissions.countResCost){
+                                        item.money = list[i].costMoney.toFixed(2)
+                                    }
+                                    if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
+                                        item.cost = list[i].cost
+                                        totalHours += parseFloat(list[i].cost);
+                                    }
+                                    yList.push(item);
                                 }
                             }
                         } else {
                             list = res.data
-                            var totalMoneyCost = 0;
+                            
                             for(var i in list) {
-                                console.log(list[i].name, list[i].costMoney, list[i].cost)
+                                // console.log(list[i].name, list[i].costMoney, list[i].cost)
                                 xList.push(list[i].name);
-                                yList.push({
+                                let item = {
                                     "value": this.yAxisValue==0?list[i].costMoney:list[i].cost,
                                     "id": list[i].id || i,
-                                    "cost": list[i].cost,
-                                    "money":list[i].costMoney.toFixed(2)
-                                });
-                                totalHours += parseFloat(list[i].cost);
-                                totalMoneyCost += parseFloat(list[i].costMoney);
+                                }
+                                if(this.permissions.countAllCost || this.permissions.countResCost){
+                                    item.money = list[i].costMoney.toFixed(2)
+                                    totalMoneyCost += parseFloat(list[i].costMoney);
+                                }
+                                if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
+                                    item.cost = list[i].cost
+                                    totalHours += parseFloat(list[i].cost);
+                                }
+                                yList.push(item);
+                                
                             }
                         }
                         totalHours = totalHours.toFixed(1);
                         
+                        
                         var myChart = echarts.init(document.getElementById("container"));
                         myChart.resize({
                             width: this.widthHtval
@@ -820,10 +860,11 @@
                         if(totalMoneyCost) {
                             this.zhishin = totalMoneyCost.toFixed(2)
                         } 
-                        if(this.radio == '项目' || this.radio == '人员' || this.radio=='部门') {
+
+                        if(this.radio == '项目' || this.radio == '人员' || this.radio == '项目分类' || this.radio=='部门') {
                             var option = {
                                 title: {
-                                    text: '工时成本总计' + this.zhishin + '元, 时长'+totalHours+'小时',
+                                    text: '工时成本总计:' + ((this.permissions.countAllCost || this.permissions.countResCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countAllWorkTime || this.permissions.countResWorkTime) ? '时长' + totalHours + '小时' : ''),
                                     left:'left',
                                 },
                                 // 工具箱
@@ -836,9 +877,13 @@
                                 tooltip:{
                                     trigger:'axis',
                                     formatter: function (params,ticket,callback) {
-                                        var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.money 
-                                        + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
-                                        _this.params = params;
+                                        // var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.money 
+                                        // + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
+                                        // _this.params = params;
+                                        var res = params[0].name + "<br/>" + 
+                                        ((_this.permissions.countAllCost || _this.permissions.countResCost) ? "工作成本"+" : " + params[0].data.money 
+                                        + "元 <br/>" : '') + 
+                                        ((_this.permissions.countAllWorkTime || _this.permissions.countResWorkTime) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
                                         return res;
                                     }
                                 },
@@ -864,7 +909,8 @@
                         } else {
                             var option = {
                                 title: {
-                                    text: '工时成本总计' + this.zhishin + '元, 时长'+totalHours+'小时',
+                                    // text: '工时成本总计' + this.zhishin + '元, 时长'+totalHours+'小时',
+                                    text: '工时成本总计:' + ((this.permissions.countAllCost || this.permissions.countResCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countAllWorkTime || this.permissions.countResWorkTime) ? '时长' + totalHours + '小时' : ''),
                                     left:'left',
                                 },
                                 // 工具箱
@@ -877,8 +923,10 @@
                                 tooltip:{
                                     trigger:'axis',
                                     formatter: function (params,ticket,callback) {
-                                        var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.money 
-                                        + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
+                                        var res = params[0].name + "<br/>" + 
+                                        ((_this.permissions.countAllCost || _this.permissions.countResCost) ? "工作成本"+" : " + params[0].data.money 
+                                        + "元 <br/>" : '') + 
+                                        ((_this.permissions.countAllWorkTime || _this.permissions.countResWorkTime) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
                                         _this.params = params;
                                         return res;
                                     }
@@ -985,6 +1033,11 @@
                 this.containerHeight = window.innerHeight - 130
                 // this.containerHeight = window.innerHeight - 200
             };
+            if(this.permissions.countAllCost || this.permissions.countResCost){
+                this.yAxisValue = '0'
+            }else{
+                this.yAxisValue = '1'
+            }
             if (this.user.timeType.fixMonthcost == 0) {
                 if (this.$route.query.startDate != null) {
                     this.dateRange = [this.$route.query.startDate, this.$route.query.endDate];

+ 7 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -217,6 +217,13 @@
                     <span style="color:#666;margin-left:10px;">(说明:系统管理员为员工代填日报时不受补填时间的限制)</span>
                     <span class="lockworktime"><el-checkbox v-model="timeType.fillAhead" label="可提前填报" /></span>
                 </el-form-item>
+                <el-form-item label="员工填报及时日" prop="timeliness">
+                    <el-select v-model="timeType.timeliness">
+                        <el-option label="当天" :value="0"></el-option>
+                        <el-option label="第二天" :value="1"></el-option>
+                        <el-option label="第三天" :value="2"></el-option>
+                    </el-select>
+                </el-form-item>
                 </el-form>
             </div>
         </el-col>

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

@@ -1321,7 +1321,7 @@
                 fillMembList:[],
                 membListVisible: false,
                 isBatch:0,//是否是批量填报
-                editTitle: ['填写日报','批量填报','批量代填'],
+                editTitle: ['填写日报','批量填报','代填日报'],
                 weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
                 statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
                 fillStatusList: [],

+ 39 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -66,6 +66,14 @@
                         <van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage" 
                             @cancel="item.showPickerStage = false;$forceUpdate();" />
                     </van-popup>
+                    <!-- 预算来源 -->
+                    <van-field  readonly  name="basecostId" v-if="user.company.packageProject==1&&reportBasecostList &&reportBasecostList.length>0" 
+                        :value="item.basecostName" label="预算来源" placeholder="请选择预算来源" 
+                    @click="clickPickCostId(index, item)" />
+                    <van-popup v-model="item.showPickerCostId" position="bottom">
+                        <van-picker show-toolbar :columns="reportBasecostList" value-key="name" @confirm="choseCostId" 
+                            @cancel="item.showPickerCostId = false;$forceUpdate();" />
+                    </van-popup>
                     <!-- 审核人 -->
                     <van-field  readonly  name="projectAuditorId" v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
                         :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人" 
@@ -324,6 +332,7 @@
                 showPickerStage: false,
                 showPickerTaskGroup: false,
                 showPickerSubProject: false,
+                showPickerCostId: false,
                 isDraft:0,
                 showWorkStartTime:false,
                 showWorkEndTime:false,
@@ -389,7 +398,8 @@
                 projectss: [],
                 proads: [],
                 userName: '',
-                flgLg: true
+                flgLg: true,
+                reportBasecostList: []
             };
         },
 
@@ -398,6 +408,18 @@
         },
 
         methods: {
+            // 获取预算来源
+            getReportBasecostList(){
+                this.$axios.post('/project-basecost-setting/getReportBasecostList',{
+                    companyId: this.user.companyId
+                }).then(res => {
+                    if(res.code == 'ok'){
+                        this.reportBasecostList = res.data
+                    }else{
+                        this.$toast.fail('获取失败:'+res.msg);
+                    }
+                }).catch(err => {this.$toast.clear();})
+            },
             //获取项目审核人
             getProjectAuditorList(domainItem) {
                 this.$axios.post("/project-auditor/getList", {projectId: domainItem.projectId})
@@ -997,6 +1019,12 @@
                 item.showPickerSubProject = true;
                 this.$forceUpdate();
             },
+            clickPickCostId(i, item) {
+                if (!this.canEdit) return;
+                this.clickIndex = i;
+                item.showPickerCostId = true;
+                this.$forceUpdate();
+            },
             clickPickTaskGroup(i, item) {
                 if (!this.canEdit) return;
                 this.clickIndex = i;
@@ -1105,6 +1133,12 @@
                 this.$forceUpdate();
 
             },
+            choseCostId(value,index){
+                this.form.domains[this.clickIndex].basecostId = value.id;
+                this.form.domains[this.clickIndex].basecostName = value.name;
+                this.form.domains[this.clickIndex].showPickerCostId = false;
+                this.$forceUpdate();
+            },
 
             getGroupStages(domain, index) {
                 this.$axios.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId})
@@ -1561,15 +1595,18 @@
                 this.isWX = true;
             }
             this.getPeoject() // 获取项目
+            console.log('mounted');
+            this.getReportBasecostList()
             //获取传递过来的日期
             var passDate = this.$route.query.date;
             if (passDate != null) {
                 this.form.createDate = this.$route.query.date;
             }
             
-            this.getProject();
+            // this.getProject();
             this.getReport();
             this.getTimeType();
+            
             //初始化微信js-sdk参数
             if (this.isCorpWX) {
                 this.initWxConfig();