mt-ck-wms-ui/src/views/EquipmentManager/equipmentUtilizationRate/MTTR.vue
2022-03-16 08:58:59 +08:00

152 lines
3.9 KiB
Vue

<!--
* @Author: DY
* @Date: 2021-12-16 15:41:11
* @LastEditors: zwq
* @LastEditTime: 2022-03-04 09:04:09
* @Description: MTTR
-->
<template>
<div class="app-container">
<el-form
:model="formData"
:inline="true"
size="medium"
label-width="80px"
>
<el-form-item>
<el-button @click="toE10()">E10</el-button>
</el-form-item>
<el-form-item>
<el-button @click="toOEE()">OEE</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="toMTTR()">MTTR</el-button>
</el-form-item>
<el-form-item>
<el-button @click="toMCBF()">MCBF</el-button>
</el-form-item>
<!-- <el-form-item :label="$t('module.equipmentManager.recipe.equipmentId')" prop="equipmentName">
<el-select v-model="formData.equipmentName" :placeholder="$t('module.equipmentManager.recipe.EQselect')" filterable clearable>
<el-option
v-for="(item, index) in eqList"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item> -->
<el-form-item :label="$t('module.equipmentManager.equipmentVisualization.timeSlot')" label-width="100px" prop="time">
<el-date-picker
v-model="formData.timeSlot"
type="datetimerange"
:start-placeholder="$t('module.orderManage.order.StartTime')"
:end-placeholder="$t('module.orderManage.order.StartTime')"
:range-separator="$t('module.orderManage.order.To')"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getList()"> {{ 'btn.search' | i18nFilter }} </el-button>
</el-form-item>
<!-- <el-form-item>
<el-button type="primary" @click="getList()"> {{ 'btn.exportBtn' | i18nFilter }} </el-button>
</el-form-item> -->
</el-form>
<mttrChart v-if="mttrVisible" ref="mttrChart" :time1="startTime" :time2="endTime" @equipmentName="seeDetail" />
<mttr-detail-chart v-if="mttrDetail" ref="mttrDetailChart" :time1="startTime" :time2="endTime" :equipment-name="equipmentName" />
</div>
</template>
<script>
import mttrChart from './components/mttr-chart'
import mttrDetailChart from './components/mttrDetail-chart'
// import { equipmentList } from '@/api/basicData/Equipment/equipmentInfo'
export default {
name: 'MTTR',
components: { mttrChart, mttrDetailChart },
data() {
return {
list: [],
startTime: '',
endTime: '',
formData: {
timeSlot: [],
current: 1,
size: 10
},
mttrVisible: false,
mttrDetail: false,
equipmentName: '',
eqList: []
}
},
created() {
// this.getEqList()
// this.getList()
},
methods: {
// async getEqList() {
// const res = await equipmentList({
// current: 1,
// size: 999
// })
// if (res.code === 0) {
// this.eqList = res.data
// }
// },
toE10() {
this.$router.push({
name: 'E10'
})
},
toOEE() {
this.$router.push({
name: 'OEE'
})
},
toMTTR() {
this.$router.push({
name: 'MTTR'
})
},
toMCBF() {
this.$router.push({
name: 'MCBF'
})
},
seeDetail(name) {
this.equipmentName = name
this.mttrVisible = false
this.mttrDetail = true
setTimeout(() => {
this.$refs.mttrDetailChart.getList()
}, 60)
},
getList() {
if (this.formData.timeSlot.length !== 0) {
this.startTime = this.formData.timeSlot[0]
this.endTime = this.formData.timeSlot[1]
this.$nextTick(() => {
this.mttrVisible = true
setTimeout(() => {
this.$refs.mttrChart.getList()
}, 60)
})
}
}
}
}
</script>
<style scoped>
.edit-input {
padding-right: 100px;
}
.cancel-btn {
position: absolute;
right: 15px;
top: 10px;
}
</style>