| | |
| | | --> |
| | | <template> |
| | | <el-main style="height: 100%;" class="timeAnalysis"> |
| | | <el-card shadow="never" body-style="height: 100%;padding: 0;" style="margin-bottom: 12px;"> |
| | | <div class="detailModel" v-for="item in detailModelList"> |
| | | <div> |
| | | <div class="">零件名称</div><div><process-charts></process-charts></div> |
| | | </div> |
| | | <div> |
| | | <div>开始时间</div><div><process-charts></process-charts></div> |
| | | </div> |
| | | <div> |
| | | <div>结束时间</div><div><process-charts></process-charts></div> |
| | | </div> |
| | | <div> |
| | | <div>加工机床</div><div><process-charts></process-charts></div> |
| | | </div> |
| | | <div class="modelBtn"> |
| | | <el-button type="primary" @click="goFirstWorkProcess(item)">过程分析</el-button> |
| | | <el-card body-style="height: 100%;padding: 0;" style="margin-bottom: 12px;"> |
| | | <div class="tableOuter"> |
| | | <div class="tableAll"> |
| | | <div class="tableHeader"> |
| | | <span v-for="item in tableHeader" :style="{'width': item.width}"> {{item.title}} </span> |
| | | </div> |
| | | <div v-for="(item,index) in tableData" class="tableBody"> |
| | | <span style="width:60px;" v-if="item.id">{{item.index}}</span> |
| | | <span style="width:80px;" v-if="item.id">{{item.partNo}}</span> |
| | | <span style="width:80px;" v-if="item.id">{{item.processNo}}</span> |
| | | <span style="width:60px;" v-if="item.id">{{item.version}}</span> |
| | | <span style="width:100px;" v-if="item.id">{{item.workstationName}}</span> |
| | | <span style="width:145px;" v-if="item.id">{{item.startTime}}</span> |
| | | <span style="width:145px;" v-if="item.id">{{item.endTime}}</span> |
| | | <span style="width:100px;" v-if="item.id">{{ convertSeconds(item.occupancySecs || 0) }}</span> |
| | | <span style="width:100px;" v-if="item.id">{{ convertSeconds(item.clampingSecs || 0) }}</span> |
| | | <span style="width:100px;" v-if="item.id">{{ convertSeconds(item.firstWorkingSecs || 0) }}</span> |
| | | <span style="width:100px;" v-if="item.id">{{ convertSeconds(item.firstMeasureSecs || 0) }}</span> |
| | | <span style="width:100px;" v-if="item.id">{{ convertSeconds(item.lastRemoveSecs || 0) }}</span> |
| | | <span style="width:80px;" v-if="item.id">{{ convertSeconds(item.processingSecs || 0) }}</span> |
| | | <span style="width:80px;" v-if="item.id">{{ convertSeconds(item.prepareSecs || 0) }}</span> |
| | | <span style="width:80px;" v-if="item.id">{{ convertSeconds(item.singleProcessSecs || 0) }}</span> |
| | | <span style="width:60px;" v-if="item.id">{{item.amount}}</span> |
| | | <!-- 图表 --> |
| | | <el-card v-if="!item.id" shadow="never" body-style="padding: 0;" class="chartsDiv"> |
| | | <process-charts :index="index" :tableData="tableData"></process-charts> |
| | | <div class="modelBtn"> |
| | | <el-button type="primary" @click="goFirstWorkProcess(item,index)">过程分析</el-button> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | <el-card body-style="height: 100%;padding: 0;" style="margin-bottom: 12px;"> |
| | | <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> |
| | | </el-footer> |
| | |
| | | data() { |
| | | return { |
| | | detailModelList: [], |
| | | tableData: [] |
| | | tableData: [], |
| | | tableHeader: [ |
| | | {title:'序号',width: '60px'}, |
| | | {title:'零件号',width: '80px'}, |
| | | {title:'工序号',width: '80px'}, |
| | | {title:'版次',width: '60px'}, |
| | | {title:'机床',width: '100px'}, |
| | | {title:'开机时间',width: '145px'}, |
| | | {title:'结束时间',width: '145px'}, |
| | | {title:'占机时间',width: '100px'}, |
| | | {title:'装夹调试时间',width: '100px'}, |
| | | {title:'首件切削时间',width: '100px'}, |
| | | {title:'首件计量时间',width: '100px'}, |
| | | {title:'末件拆卸时间',width: '100px'}, |
| | | {title:'加工时间',width: '80px'}, |
| | | {title:'准备时间',width: '80px'}, |
| | | {title:'单件工时',width: '80px'}, |
| | | {title:'数量',width: '60px'} |
| | | ] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | // 返回格式化后的字符串 |
| | | return result.join(' '); |
| | | }, |
| | | goFirstWorkProcess(item) { |
| | | sthis.$router.push({path: `/mdc/first-workpiece-process`,query: {id:item.id}}) |
| | | goFirstWorkProcess(item,index) { |
| | | var id = this.tableData[index - 1].id; |
| | | this.$router.push({path: `/mdc/first-workpiece-process`,query: {id}}) |
| | | }, |
| | | getTableData() { |
| | | this.$HTTP.post(`/api/workinghour/listByIds`, {ids: this.$route.query.ids.split(',')}).then(res => { |
| | |
| | | res.data.forEach((item,index)=> { |
| | | item.index = index + 1; |
| | | }) |
| | | this.tableData = res.data; |
| | | // 使用 reduce 方法来构建新的数组 |
| | | var newArray = res.data.reduce((acc, curr) => { |
| | | acc.push(curr); // 将当前对象添加到累积器中 |
| | | acc.push({}); // 在当前对象后添加一个空对象 |
| | | return acc; |
| | | }, []); |
| | | this.tableData = newArray; |
| | | //console.log(this.tableData,111) |
| | | } |
| | | }) |
| | | } |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .tableOuter { |
| | | width: 100%; |
| | | overflow: hidden; |
| | | } |
| | | .tableAll { |
| | | overflow-x: scroll; |
| | | white-space: nowrap; |
| | | border: 1px solid #e4e7ed; |
| | | } |
| | | .tableHeader,.tableBody { |
| | | width:1470px; |
| | | border-top: 1px solid #e4e7ed; |
| | | display: flex; |
| | | } |
| | | .tableHeader span { |
| | | padding: 8px 12px; |
| | | display: inline-block; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: normal; |
| | | word-break: break-all; |
| | | line-height: 23px; |
| | | color: #909399; |
| | | font-weight: bold; |
| | | border-right: 1px solid #e4e7ed; |
| | | } |
| | | .tableBody span { |
| | | padding: 8px 12px; |
| | | display: inline-block; |
| | | white-space: normal; |
| | | word-break: break-all; |
| | | color: #909399; |
| | | border-right: 1px solid #e4e7ed; |
| | | } |
| | | .chartsDiv { |
| | | padding-bottom: 12px; |
| | | width: 100%; |
| | | padding-top: 12px; |
| | | padding-left: 12px; |
| | | padding-right: 12px; |
| | | } |
| | | .detailModel > div { |
| | | height: 32px; |
| | | display: flex; |