|
@@ -41,8 +41,8 @@
|
|
|
<el-menu-item index="1-19" v-if="user.timeType.restartTaskNeedReason == 1" @click="ssl(18)"><p>任务重启表</p></el-menu-item>
|
|
|
<el-menu-item index="1-20" v-if="permissions.reportFTEAll || permissions.reportFTEPart" @click="ssl(19)"><p>FTE报表</p></el-menu-item>
|
|
|
<el-menu-item index="1-21" v-if="permissions.reportEfficent" @click="ssl(20)"><p>有效工时率表</p></el-menu-item>
|
|
|
- <el-menu-item index="1-22" @click="ssl(21)"><p>项目分类工时占比表</p></el-menu-item>
|
|
|
- <el-menu-item index="1-23" @click="ssl(22)" v-if="false"><p>分类工时明细表</p></el-menu-item>
|
|
|
+ <el-menu-item index="1-22" v-if="permissions.reportSortScaleTable" @click="ssl(21)"><p>项目分类工时占比表</p></el-menu-item>
|
|
|
+ <el-menu-item index="1-23" v-if="permissions.reportSortDetailTable" @click="ssl(22)"><p>分类工时明细表</p></el-menu-item>
|
|
|
<!-- <el-menu-item index="1-12"><p @click="ssl(11)">人员工时统计表</p></el-menu-item> -->
|
|
|
</el-submenu>
|
|
|
</el-menu>
|
|
@@ -76,7 +76,7 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
<!-- 时间段筛选 -->
|
|
|
- <template v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 12 || ins == 5 || ins == 16 || ins == 17 || ins == 18 || ins == 20 || ins == 21">
|
|
|
+ <template v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 12 || ins == 5 || ins == 16 || ins == 17 || ins == 18 || ins == 20 || ins == 21 || ins == 22">
|
|
|
<span>
|
|
|
<span class="demonstration" style="color:#999;padding:0 10px">
|
|
|
{{ ins == 15 ? $t('xiang-mu-chuang-jian-shi-jian-duan') : $t('message.period') }}
|
|
@@ -84,13 +84,16 @@
|
|
|
<el-date-picker v-model="rangeDatas" type="daterange" value-format="yyyy-MM-dd" :placeholder="$t('selectstartdate')" @change="picks()" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" style="width:300px" :clearable="ins == 15" size="small"> </el-date-picker>
|
|
|
</span>
|
|
|
</template>
|
|
|
- <!-- 日期筛选 -->
|
|
|
+
|
|
|
+ <!-- 项目分类 -->
|
|
|
<template v-if="ins == 22">
|
|
|
<span>
|
|
|
<span class="demonstration" style="color:#999;padding:0 10px">
|
|
|
- 日期
|
|
|
+ 项目分类
|
|
|
</span>
|
|
|
- <el-date-picker v-model="dateSelect" size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" @change="picks()"></el-date-picker>
|
|
|
+ <el-select v-model="projectSortId" placeholder="请选择" @change="picks()" size="small">
|
|
|
+ <el-option v-for="item in projectSortList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
</span>
|
|
|
</template>
|
|
|
|
|
@@ -163,7 +166,7 @@
|
|
|
</div>
|
|
|
<!-- <p :style="ins == 9 ? 'float: right;margin-right: 25px;width:20%' : 'float: right;margin-right: 25px;width:10%'" > -->
|
|
|
<p :style="`${ins == 9 ? 'width:20%' : ins == 14 ? 'width: 20%' : 'width: 10%'}`" class="tableRightBtn">
|
|
|
- <el-button type="primary" @click="exportExcel" size="mini" v-if="ins != 21 && ins != 22">{{ $t('reporderived') }}</el-button>
|
|
|
+ <el-button type="primary" @click="exportExcel" size="mini" v-if="ins != 21">{{ $t('reporderived') }}</el-button>
|
|
|
<el-button type="primary" @click="fillAll" size="mini" v-if="ins == 14">全部补足</el-button>
|
|
|
<el-button type="primary" @click="exportExcelByQuarter" size="mini" v-if="ins == 9 && user.companyId == 876">{{ $t('an-ji-du-dao-chu') }}</el-button>
|
|
|
<el-button type="primary" @click="setWarning" size="mini" v-if="ins == 21">设置预警</el-button>
|
|
@@ -699,7 +702,10 @@
|
|
|
<el-table-column prop="departmentName" :label="$t('subordinatedepartments')" min-width="200" align="center">
|
|
|
<template slot-scope="scope" >
|
|
|
<span v-if="user.userNameNeedTranslate == '1'">
|
|
|
- <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
|
|
|
+ <span v-for="(item,index) in scope.row.departmentName" :key="index">
|
|
|
+ <ww-open-data type='departmentName' :openid='item'></ww-open-data>
|
|
|
+ <span v-if="index < scope.row.departmentName.length - 1">/</span>
|
|
|
+ </span>
|
|
|
</span>
|
|
|
<span v-if="user.userNameNeedTranslate != '1'">
|
|
|
{{scope.row.departmentName}}
|
|
@@ -974,16 +980,59 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 分类工时明细表 -->
|
|
|
- <el-table v-if="ins == 22" key="22" border :data="hoursDetailClassList" highlight-current-row v-loading="listLoading" :height="tableHeight + 50" style="width: 100%;" >
|
|
|
- <el-table-column align="center" prop="c" label="姓名" min-width="150"></el-table-column>
|
|
|
- <el-table-column align="center" prop="x" label="部门" min-width="150"></el-table-column>
|
|
|
- <el-table-column align="center" prop="p" label="人员类型" min-width="150"></el-table-column>
|
|
|
- <el-table-column align="center" prop="j" label="生产工时" min-width="150"></el-table-column>
|
|
|
- <el-table-column align="center" prop="workingTime" label="总工时" min-width="150"></el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-table v-if="ins == 22" :key="hoursDetailClassListKey" border :data="hoursDetailClassList.record" highlight-current-row v-loading="listLoading" :height="+tableHeight -1" style="width: 100%;" >
|
|
|
+ <el-table-column align="center" prop="categoryName" label="生产项目号" min-width="150"></el-table-column>
|
|
|
+ <el-table-column align="center" prop="userName" label="姓名" min-width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'">
|
|
|
+ <ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data>
|
|
|
+ </span>
|
|
|
+ <span v-if="user.userNameNeedTranslate != '1'">
|
|
|
+ {{scope.row.userName}}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" prop="deptName" label="部门" min-width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'">
|
|
|
+ <ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data>
|
|
|
+ </span>
|
|
|
+ <span v-if="user.userNameNeedTranslate != '1'">
|
|
|
+ {{scope.row.userName}}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <!-- 渲染自定义字段 -->
|
|
|
+ <el-table-column align="center" :label="item.titleName" min-width="150" v-for="(item, index) in hoursDetailClassList.custom" :key="index">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="processingJudgment(item.titleIndex, scope.row, false)">
|
|
|
+ {{ scope.row[item.titleIndex] || '' }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
+ <el-table-column align="center" prop="allWorkingTime" label="总工时" min-width="150"></el-table-column>
|
|
|
+ <el-table-column align="center" prop="targetWorkingTime" label="生产工时" min-width="150"></el-table-column>
|
|
|
+
|
|
|
+ <!-- 渲染日期 -->
|
|
|
+ <el-table-column align="center" :label="item.titleName" min-width="150" v-for="(item, index) in hoursDetailClassList.header" :key="index">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-for="v,i in scope.row.dataList || []" :key="i">
|
|
|
+ <div v-if="processingJudgment(item.titleIndex, v, true)">
|
|
|
+ {{ v.workingTime ? `${v.workingTime} h` : '' }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
<!--工具条-->
|
|
|
- <el-col :span="24" class="toolbar" v-if="ins != 6 && ins != 20 && ins != 21 && ins != 22">
|
|
|
+ <el-col :span="24" class="toolbar" v-if="ins != 6 && ins != 20 && ins != 21">
|
|
|
<el-pagination
|
|
|
v-if="ins == 12"
|
|
|
@size-change="groupSizeChange"
|
|
@@ -1408,8 +1457,15 @@ export default {
|
|
|
radio: 0,
|
|
|
slider: 0,
|
|
|
}], // 预警表格数据
|
|
|
- hoursDetailClassList: [], // 分类工时明细表数据
|
|
|
+ hoursDetailClassList: {
|
|
|
+ header: [],
|
|
|
+ record: [],
|
|
|
+ custom: []
|
|
|
+ }, // 分类工时明细表数据
|
|
|
+ hoursDetailClassListKey: 500,
|
|
|
dateSelect: '', // 日期选择
|
|
|
+ projectSortId: '', // 项目分类选中的id
|
|
|
+ projectSortList: [], // 项目分类
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -1437,6 +1493,7 @@ export default {
|
|
|
this.getcustomerList()
|
|
|
// this.getcusProjectList()
|
|
|
this.authorityToJudge()
|
|
|
+ this.getProjectSort()
|
|
|
},
|
|
|
filters: {
|
|
|
numberToCurrency(value) {
|
|
@@ -1500,13 +1557,16 @@ export default {
|
|
|
if(this.permissions.reportTimely || this.permissions.reportAllTimely) {this.ssl(9);this.defaultActive = '1-10';return} else
|
|
|
if(this.permissions.reportAllGroup || this.permissions.reportGroup) {this.ssl(12);this.defaultActive = '1-13';return} else
|
|
|
if(this.permissions.reportAuditRate) {this.ssl(10);this.defaultActive = '1-11';return} else
|
|
|
- if(this.permissions.reportPersonnel || this.permissions.reportResponsible) {this.ssl(11);this.defaultActive = '1-12';return}
|
|
|
- if(this.permissions.reportMonthlyPersonnel || this.permissions.reportResponsiblePersonnel) {this.ssl(14);this.defaultActive = '1-15';return}
|
|
|
- if(this.permissions.reportAllDepartmentParticipation || this.permissions.reportResponsibleDepartmentParticipation) {this.ssl(15);this.defaultActive = '1-16';return}
|
|
|
- if(this.permissions.reportPhaseHours || this.permissions.reportStageWorkingTime) {this.ssl(16);this.defaultActive = '1-17';return}
|
|
|
- if(this.permissions.reportAllManhourCost || this.permissions.reportResponsibleManhourCost) {this.ssl(17);this.defaultActive = '1-18';return}
|
|
|
- if(this.user.timeType.restartTaskNeedReason == 1) {this.ssl(18);this.defaultActive = '1-19';return}
|
|
|
- if(this.permissions.reportFTEAll || this.permissions.reportFTEPart) {this.ssl(19);this.defaultActive = '1-20';return}
|
|
|
+ if(this.permissions.reportPersonnel || this.permissions.reportResponsible) {this.ssl(11);this.defaultActive = '1-12';return} else
|
|
|
+ if(this.permissions.reportMonthlyPersonnel || this.permissions.reportResponsiblePersonnel) {this.ssl(14);this.defaultActive = '1-15';return} else
|
|
|
+ if(this.permissions.reportAllDepartmentParticipation || this.permissions.reportResponsibleDepartmentParticipation) {this.ssl(15);this.defaultActive = '1-16';return} else
|
|
|
+ if(this.permissions.reportPhaseHours || this.permissions.reportStageWorkingTime) {this.ssl(16);this.defaultActive = '1-17';return} else
|
|
|
+ if(this.permissions.reportAllManhourCost || this.permissions.reportResponsibleManhourCost) {this.ssl(17);this.defaultActive = '1-18';return} else
|
|
|
+ if(this.user.timeType.restartTaskNeedReason == 1) {this.ssl(18);this.defaultActive = '1-19';return} else
|
|
|
+ if(this.permissions.reportFTEAll || this.permissions.reportFTEPart) {this.ssl(19);this.defaultActive = '1-20';return} else
|
|
|
+ if(this.permissions.reportEfficent) {this.ssl(20);this.defaultActive = '1-21';return} else
|
|
|
+ if(this.permissions.reportSortScaleTable) {this.ssl(21);this.defaultActive = '1-22';return} else
|
|
|
+ if(this.permissions.reportSortDetailTable) {this.ssl(22);this.defaultActive = '1-23';return} else
|
|
|
{this.allWrong = false}
|
|
|
},
|
|
|
rowspan(spanArr,position,spanName){
|
|
@@ -1929,6 +1989,12 @@ export default {
|
|
|
url += "/exportFTEData"
|
|
|
sl.month = this.monthPersonnel + '-01'
|
|
|
sl.area = this.areaName || null
|
|
|
+ } else if(this.ins == 22) {
|
|
|
+ fName = '分类工时明细表' + '.xlsx'
|
|
|
+ url = "/report/exportUserWorkTimeByCategory"
|
|
|
+ sl.categoryId = this.projectSortId
|
|
|
+ sl.startDate = this.rangeDatas[0]
|
|
|
+ sl.endDate = this.rangeDatas[1]
|
|
|
}
|
|
|
this.http.post(url, sl,
|
|
|
res => {
|
|
@@ -2704,7 +2770,16 @@ export default {
|
|
|
res => {
|
|
|
this.listLoading = false
|
|
|
if(res.code == 'ok'){
|
|
|
- this.auditRateList = res.data.result
|
|
|
+ const { userNameNeedTranslate } = this.user
|
|
|
+ if(userNameNeedTranslate == 1) {
|
|
|
+ res.data.result.forEach((item) => {
|
|
|
+ item.departmentName = item.departmentName.split('/') || []
|
|
|
+ })
|
|
|
+ this.auditRateList = res.data.result
|
|
|
+ console.log('处理好的 ==>', this.auditRateList)
|
|
|
+ } else {
|
|
|
+ this.auditRateList = res.data.result
|
|
|
+ }
|
|
|
this.total = res.data.total
|
|
|
}else {
|
|
|
this.$message({
|
|
@@ -3271,21 +3346,50 @@ export default {
|
|
|
async getHoursDetailClass() {
|
|
|
let params = {
|
|
|
// 日期, 项目分类
|
|
|
+ categoryId: this.projectSortId,
|
|
|
+ startDate: this.rangeDatas[0],
|
|
|
+ endDate: this.rangeDatas[1],
|
|
|
+ pageIndex: this.page,
|
|
|
+ pageSize: this.size,
|
|
|
}
|
|
|
- console.log('开始调用分类工时明细表', this.dateSelect)
|
|
|
- return
|
|
|
this.listLoading = true
|
|
|
- let { data } = await this.postData('/project/getMembProjectCateRatio', params)
|
|
|
- let { categoryList, userList } = data
|
|
|
- categoryList.push({
|
|
|
- name: '未分类'
|
|
|
- })
|
|
|
+ let { data } = await this.postData('/report/getUserWorkTimeByCategory', params)
|
|
|
+ this.hoursDetailClassListKey++
|
|
|
+ this.hoursDetailClassList = data
|
|
|
+ this.total = data.total
|
|
|
this.listLoading = false
|
|
|
- this.projectCateRatioList = {
|
|
|
- categoryList,
|
|
|
- userList
|
|
|
+ },
|
|
|
+ processingJudgment(fields, item, date) {
|
|
|
+ if(!date) {
|
|
|
+ for(var i in item) {
|
|
|
+ if(i == fields) {
|
|
|
+ // return item[fields]
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if(date) {
|
|
|
+ if(item.createDate == fields) {
|
|
|
+ // return item.workingTime
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+ return false
|
|
|
}
|
|
|
+
|
|
|
+ return ''
|
|
|
},
|
|
|
+ // 获取项目分类
|
|
|
+ async getProjectSort() {
|
|
|
+ let { data } = await this.postData('project-category/list', {})
|
|
|
+ let dataList = data || []
|
|
|
+ dataList.push({id: 'null', name: '未分类'})
|
|
|
+ this.projectSortList = dataList
|
|
|
+ this.projectSortId = dataList[0].id
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|