| | |
| | | </div> |
| | | </el-card> |
| | | <el-card body-style="height: 100%;padding: 0;" style="margin-bottom: 12px;"> |
| | | <el-table :data="tableData" border @selection-change="handleSelectionChange"> |
| | | <el-table-column prop="test" label="序号" width="60"></el-table-column> |
| | | <el-table-column prop="test" label="零件号" width="80"></el-table-column> |
| | | <el-table-column prop="test" label="工序号" width="80"></el-table-column> |
| | | <el-table-column prop="test" label="版次" width="60"></el-table-column> |
| | | <el-table-column prop="test" label="机床" width="60"></el-table-column> |
| | | <el-table-column prop="test" label="开机时间" width="80"></el-table-column> |
| | | <el-table-column prop="test" label="结束时间" width="80"></el-table-column> |
| | | <el-table-column prop="test" label="占机时间" width="100"></el-table-column> |
| | | <el-table-column prop="test" label="装夹调试时间" width="100"></el-table-column> |
| | | <el-table-column prop="test" label="首件切削时间" width="100"></el-table-column> |
| | | <el-table-column prop="test" label="首件切削时间" width="100"></el-table-column> |
| | | <el-table-column prop="test" label="末件拆卸时间" width="100"></el-table-column> |
| | | <el-table-column prop="test" label="首件计量时间" width="100"></el-table-column> |
| | | <el-table-column prop="test" label="加工时间" width="80"></el-table-column> |
| | | <el-table-column prop="test" label="准备时间" width="80"></el-table-column> |
| | | <el-table-column prop="test" label="单件工时" width="80"></el-table-column> |
| | | <el-table-column prop="test" label="数量" width="60"></el-table-column> |
| | | <el-table :data="tableData" border> |
| | | <el-table-column prop="index" label="序号" width="60"></el-table-column> |
| | | <el-table-column prop="partNo" label="零件号" width="80"></el-table-column> |
| | | <el-table-column prop="processNo" label="工序号" width="80"></el-table-column> |
| | | <el-table-column prop="version" label="版次" width="60"></el-table-column> |
| | | <el-table-column prop="workstationName" label="机床" width="100"></el-table-column> |
| | | <el-table-column prop="startTime" label="开机时间" width="145"></el-table-column> |
| | | <el-table-column prop="endTime" label="结束时间" width="145"></el-table-column> |
| | | <el-table-column prop="occupancySecs" label="占机时间" width="100"> |
| | | <template #default="scope"> |
| | | {{ convertSeconds(scope.row.occupancySecs || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="clampingSecs" label="装夹调试时间" width="100"> |
| | | <template #default="scope"> |
| | | {{ convertSeconds(scope.row.clampingSecs || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="firstWorkingSecs" label="首件切削时间" width="100"> |
| | | <template #default="scope"> |
| | | {{ convertSeconds(scope.row.firstWorkingSecs || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="firstMeasureSecs" label="首件计量时间" width="100"> |
| | | <template #default="scope"> |
| | | {{ convertSeconds(scope.row.firstMeasureSecs || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="lastRemoveSecs" label="末件拆卸时间" width="100"> |
| | | <template #default="scope"> |
| | | {{ convertSeconds(scope.row.lastRemoveSecs || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="processingSecs" label="加工时间" width="80"> |
| | | <template #default="scope"> |
| | | {{ convertSeconds(scope.row.processingSecs || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="prepareSecs" label="准备时间" width="80"> |
| | | <template #default="scope"> |
| | | {{ convertSeconds(scope.row.prepareSecs || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="singleProcessSecs" label="单件工时" width="80"> |
| | | <template #default="scope"> |
| | | {{ convertSeconds(scope.row.singleProcessSecs || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="amount" label="数量" width="60"></el-table-column> |
| | | </el-table> |
| | | <el-footer> |
| | | <el-button type="primary">输出</el-button> |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | var idList = this.$route.query.idList.split(","); |
| | | }, |
| | | mounted() { |
| | | this.getTableData(); |
| | | var idList = this.$route.query.ids.split(","); |
| | | idList.forEach(item=> { |
| | | this.detailModelList.push({id: item}); |
| | | }) |
| | | // console.log(this.detailModelList,222); |
| | | for(var i=0;i<10;i++) { |
| | | this.tableData.push({test: 1}) |
| | | } |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | handleSelectionChange() { |
| | | convertSeconds(seconds) { //转换时间 |
| | | // 定义时间单位转换关系 |
| | | const daysInSeconds = 24 * 60 * 60; |
| | | const hoursInSeconds = 60 * 60; |
| | | const minutesInSeconds = 60; |
| | | |
| | | // 计算天数 |
| | | let days = Math.floor(seconds / daysInSeconds); |
| | | seconds %= daysInSeconds; |
| | | |
| | | // 计算小时数 |
| | | let hours = Math.floor(seconds / hoursInSeconds); |
| | | seconds %= hoursInSeconds; |
| | | |
| | | // 计算分钟数 |
| | | let minutes = Math.floor(seconds / minutesInSeconds); |
| | | seconds %= minutesInSeconds; |
| | | |
| | | // 准备结果数组 |
| | | let result = []; |
| | | |
| | | // 根据需要添加天数到结果数组 |
| | | if (days > 0) { |
| | | result.push(`${days}天`); |
| | | } |
| | | |
| | | // 根据需要添加小时数到结果数组 |
| | | if (hours > 0) { |
| | | result.push(`${hours}小时`); |
| | | } |
| | | |
| | | // 根据需要添加分钟数到结果数组 |
| | | if (minutes > 0) { |
| | | result.push(`${minutes}分钟`); |
| | | } |
| | | |
| | | // 始终添加秒数到结果数组(因为秒数总是有意义的) |
| | | result.push(`${seconds}秒`); |
| | | |
| | | // 返回格式化后的字符串 |
| | | return result.join(' '); |
| | | }, |
| | | goFirstWorkProcess(item) { |
| | | this.$router.push({path: `/mdc/first-workpiece-process`,query: {id:item.id}}) |
| | | sthis.$router.push({path: `/mdc/first-workpiece-process`,query: {id:item.id}}) |
| | | }, |
| | | getTableData() { |
| | | this.$HTTP.post(`/api/workinghour/listByIds`, {ids: this.$route.query.ids.split(',')}).then(res => { |
| | | if (res.code === 200) { |
| | | res.data.forEach((item,index)=> { |
| | | item.index = index + 1; |
| | | }) |
| | | this.tableData = res.data; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |