|
@@ -38,7 +38,7 @@
|
|
|
<h3 ref="headHe" style="padding-left: 10px;float:left;width:15%">{{shuz[ins]}}</h3>
|
|
|
<div class="headScreen" :style="'width:72%'">
|
|
|
<!-- 部门筛选 -->
|
|
|
- <el-cascader v-if="ins!=5" v-model="departmentIdArray" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
|
|
|
+ <el-cascader v-if="ins!=5 && !isViewUser" v-model="departmentIdArray" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
|
|
|
:props="{ checkStrictly: true,expandTrigger: 'hover' }" collapse-tags :show-all-levels="false" clearable
|
|
|
@change="selcts()" size="small" style="margin-bottom: 10px;width:180px"
|
|
|
></el-cascader>
|
|
@@ -207,33 +207,54 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 车间工位计划表 -->
|
|
|
- <el-table v-if="ins == 6" key="7" border :data="planDataWithStationDatas" highlight-current-row v-loading="listLoading" :height="+tableHeight - 1" style="width: 100%;">
|
|
|
- <el-table-column v-if="!isViewUser" align="center" prop="departmentCascade" label="部门名称" min-width="150" fixed="left">
|
|
|
+ <el-table v-if="ins == 6" key="7" border :data="planDataWithStationDatas" :span-method="workshopStationMerge" highlight-current-row v-loading="listLoading" :height="+tableHeight - 1" style="width: 100%;">
|
|
|
+ <el-table-column v-if="!isViewUser && !personnelFlag" align="center" prop="departmentCascade" label="部门名称" min-width="150" fixed="left">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.deptId!='0'" class="colorText" @click="getPlanDataWithStation(scope.row.deptId)" >{{scope.row.departmentCascade}}</span>
|
|
|
<span v-else class="colorText" >{{scope.row.departmentCascade}}</span>
|
|
|
<!-- <span class="colorText" >{{scope.row.departmentCascade}}</span> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column v-else align="center" prop="departmentCascade" label="人员名称" min-width="150" fixed="left">
|
|
|
+ <el-table-column v-if="isViewUser && !personnelFlag" align="center" prop="departmentCascade" label="人员名称" min-width="150" fixed="left">
|
|
|
<template slot-scope="scope">
|
|
|
- <span class="colorText">{{scope.row.userName}}</span>
|
|
|
+ <span v-if="scope.row.userId!='0'" class="colorText" @click="getPlanDataWithUserId(scope.row.userId)">{{scope.row.userName}}</span>
|
|
|
+ <span v-else class="colorText" >{{scope.row.userName}}</span>
|
|
|
<!-- <span class="colorText" >{{scope.row.departmentCascade}}</span> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column v-for="(item, index) in planDataWithStationHead" :key="index" :label="item" align="center" min-width="250">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-for="(items, indexs) in (isViewUser?scope.row.userList:scope.row.deptList)" :key="indexs" >
|
|
|
- <div v-if="items.startDate == item">
|
|
|
- <div>计划数:{{items.planNum}} {{items.planHour}}分钟 {{items.planCost}}元 </div>
|
|
|
- <div>实际数:{{items.nowNum}} {{items.nowHour}}分钟 {{items.nowCost}}元</div>
|
|
|
- <div v-if="!isViewUser">进度:{{items.progress}}</div>
|
|
|
- <div v-if="isViewUser">进度:{{ comSchedule(items.nowHour, items.planHour) }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <el-table-column v-if="personnelFlag" align="center" prop="departmentCascade" label="产品名称" min-width="150" fixed="left">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span class="colorText" >{{scope.row.productName}}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" prop="totalResult" label="合计" min-width="280">
|
|
|
+ <div v-if="!personnelFlag">
|
|
|
+ <el-table-column v-for="(item, index) in planDataWithStationHead" :key="index" :label="item" align="center" min-width="250">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-for="(items, indexs) in (isViewUser?scope.row.userList:scope.row.deptList)" :key="indexs" >
|
|
|
+ <div v-if="items.startDate == item">
|
|
|
+ <div>计划数:{{items.planNum}} {{items.planHour}}分钟 {{items.planCost}}元 </div>
|
|
|
+ <div>实际数:{{items.nowNum}} {{items.nowHour}}分钟 {{items.nowCost}}元</div>
|
|
|
+ <div v-if="!isViewUser">进度:{{items.progress}}</div>
|
|
|
+ <div v-if="isViewUser">进度:{{ comSchedule(items.nowHour, items.planHour) }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </div>
|
|
|
+ <div v-if="personnelFlag">
|
|
|
+ <el-table-column v-for="(item, index) in planDataWithStationHead" :key="index" :label="item" align="center" min-width="250" prop="createDate">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-for="(items, indexs) in (scope.row.dataList)" :key="indexs" >
|
|
|
+ <div v-if="items.createDate == item">
|
|
|
+ <div>{{items.procedureName}}</div>
|
|
|
+ <div>{{items.workingTime}}分钟 {{items.cost}}元</div>
|
|
|
+ <div>{{items.finishNum}}件数</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </div>
|
|
|
+ <el-table-column v-if="!personnelFlag" align="center" prop="totalResult" label="合计" min-width="280">
|
|
|
<template slot-scope="scope">
|
|
|
<div>计划数:{{scope.row.totalPlanNum}} {{scope.row.totalPlanHour}}分钟 {{scope.row.totalPlanCost}}元 </div>
|
|
|
<div>实际数:{{scope.row.totalNowNum}} {{scope.row.totalNowHour}}分钟 {{scope.row.totalNowCost}}元</div>
|
|
@@ -632,6 +653,8 @@ export default {
|
|
|
steelNum:"",
|
|
|
|
|
|
plondelas: 100,
|
|
|
+ personnelFlag: false, // 是否处于最后一集的人员
|
|
|
+ rowSpanArr: [], // 需要合并的数据
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -1042,6 +1065,7 @@ export default {
|
|
|
this.http.post( "/report/getPlanDataWithStation",param,
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
+ this.personnelFlag = false
|
|
|
this.planDataWithStationDatas=res.data.records
|
|
|
this.planDataWithStationHead=res.data.header
|
|
|
this.total=res.data.total
|
|
@@ -1060,6 +1084,66 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ //获取人员填报数据
|
|
|
+ getPlanDataWithUserId(userId){
|
|
|
+ this.listLoading=true
|
|
|
+ this.http.post( "/report/getPlanDataWithUserId", {
|
|
|
+ startDate:this.rangeDatas[0],
|
|
|
+ endDate:this.rangeDatas[1],
|
|
|
+ userId: userId,
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.personnelFlag = true
|
|
|
+ this.handleTableData(res.data)
|
|
|
+ this.planDataWithStationDatas=res.data
|
|
|
+ this.total=res.data
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.listLoading=false
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取相同名称的个数 tableData: 表格的数据, productId: 确定相同的参数
|
|
|
+ handleTableData(tableData){
|
|
|
+ let rowSpanArr = [], position = 0;
|
|
|
+ for (let [index, item] of tableData.entries()) {
|
|
|
+ if (index == 0) {
|
|
|
+ rowSpanArr.push(1);
|
|
|
+ position = 0;
|
|
|
+ } else {
|
|
|
+ if (item.productId == tableData[index - 1].productId) {
|
|
|
+ rowSpanArr[position] += 1; //项目名称相同,合并到同一个数组中
|
|
|
+ rowSpanArr.push(0);
|
|
|
+ } else {
|
|
|
+ rowSpanArr.push(1);
|
|
|
+ position = index;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.rowSpanArr = rowSpanArr
|
|
|
+ },
|
|
|
+ // 合并车间工位计划表人员点击进去的数据
|
|
|
+ workshopStationMerge({ row, column, rowIndex, columnIndex }) {
|
|
|
+ if(!this.personnelFlag) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ const rowSpan = this.rowSpanArr[rowIndex];
|
|
|
+ return {
|
|
|
+ rowspan: rowSpan, //行
|
|
|
+ colspan: 1 //列
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
//获取产品列表
|
|
|
getProductList(){
|
|
|
this.http.post( "/product/getProductPage", {
|