<template>
|
<div class="page-view-container">
|
<slot name="function"/>
|
|
<a-card :bordered="false">
|
<!-- 查询区域 -->
|
<div class="table-page-search-wrapper">
|
<a-form layout="inline">
|
<a-row :gutter="24">
|
<a-col :span="5">
|
<a-form-item label="设备">
|
<a-select placeholder="请选择设备" v-model="queryParam.equipmentId">
|
<a-select-option v-for="item in equipmentList" :key="item.equipmentId">
|
{{item.equipmentId+`[${item.equipmentName}]`}}
|
</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
|
<a-col :span="5">
|
<a-form-item label="开始时间">
|
<a-date-picker style="width: 100%" show-time placeholder="请选择开始时间" value-format="YYYY-MM-DD HH:mm:ss"
|
v-model="queryParam.startDate"/>
|
</a-form-item>
|
</a-col>
|
|
<a-col :span="5">
|
<a-form-item label="结束时间">
|
<a-date-picker style="width: 100%" show-time placeholder="请选择结束时间" value-format="YYYY-MM-DD HH:mm:ss"
|
v-model="queryParam.endDate"/>
|
</a-form-item>
|
</a-col>
|
|
<a-col :span="5">
|
<a-form-item label="停机原因">
|
<a-select placeholder="请选择停机原因" v-model="queryParam.downtimeDescription">
|
<a-select-option v-for="item in downtimeDescriptionList" :key="item.value">{{item.label}}
|
</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
|
<a-col :span="4">
|
<a-space>
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
<a-button @click="searchReset" icon="reload">重置</a-button>
|
</a-space>
|
</a-col>
|
</a-row>
|
|
|
</a-form>
|
</div>
|
|
<!-- 操作按钮区域 -->
|
<div class="table-operator">
|
<a-button type="primary" @click="handleMaintainShutdown" :disabled="selectedRowKeys.length===0">维护停机</a-button>
|
<a-button type="primary" @click="handleSplitShutdownInfo"
|
:disabled="selectedRowKeys.length===0||selectedRowKeys.length>1">拆分停机信息
|
</a-button>
|
</div>
|
|
<a-table :dataSource="dataSource" :columns="columns" rowKey="id" bordered :pagination="false" :loading="loading"
|
:rowSelection="{selectedRowKeys, onChange: onSelectChange}">
|
<template slot="downtimeType" slot-scope="text">
|
{{ text!=null?text === 0 ? '计划停机' : '非计划停机':'' }}
|
</template>
|
</a-table>
|
</a-card>
|
|
<maintain-shutdown-modal :downtimeDescriptionList="downtimeDescriptionList" ref="maintainShutdownModal"
|
@submitSuccess="loadData"/>
|
|
<split-shutdown-info-modal ref="splitShutdownInfoModal" :selectedRow="selectionRows[0]"
|
:downtimeDescriptionList="downtimeDescriptionList"
|
@submitSuccess="clearSelectedRowKeysAndLoadData"/>
|
</div>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import MaintainShutdownModal from './ReportEquipmentClose/MaintainShutdownModal'
|
import SplitShutdownInfoModal from './ReportEquipmentClose/SplitShutdownInfoModal'
|
import { getAction } from '@/api/manage'
|
|
export default {
|
name: 'ReportEquipmentClose',
|
components: { SplitShutdownInfoModal, MaintainShutdownModal },
|
mixins: [JeecgListMixin],
|
data() {
|
return {
|
equipmentList: [],
|
downtimeDescriptionList: [],
|
columns: [
|
{
|
title: '设备编号',
|
align: 'center',
|
dataIndex: 'equipmentId',
|
width: 150
|
},
|
{
|
title: '设备名称',
|
align: 'center',
|
dataIndex: 'equipmentName'
|
},
|
{
|
title: '停机原因',
|
align: 'center',
|
dataIndex: 'downtimeDescription'
|
},
|
{
|
title: '停机类型',
|
align: 'center',
|
scopedSlots: { customRender: 'downtimeType' },
|
dataIndex: 'downtimeType',
|
width: 150
|
},
|
{
|
title: '停机时间(MIN)',
|
align: 'center',
|
width: 150,
|
dataIndex: 'shutdownDuration'
|
},
|
{
|
title: '开始时间',
|
align: 'center',
|
width: 200,
|
dataIndex: 'startDate'
|
},
|
{
|
title: '结束时间',
|
align: 'center',
|
width: 200,
|
dataIndex: 'endDate'
|
},
|
{
|
title: '录入类型',
|
align: 'center',
|
width: 100,
|
dataIndex: 'enterType_dictText'
|
}
|
],
|
url: {
|
equipmentList: '/mdc/mdcEquipment/getEquipmentList',
|
downtimeDescriptionList: '/mdc/mdcDowntimeReason/reasonList',
|
list: '/mdc/operator/mdcDowntime/list'
|
}
|
}
|
},
|
created() {
|
this.getEquipmentListByApi()
|
this.getDowntimeDescriptionListByApi()
|
},
|
methods: {
|
getEquipmentListByApi() {
|
const that = this
|
getAction(this.url.equipmentList)
|
.then(res => {
|
if (res.success) that.equipmentList = res.result
|
})
|
},
|
|
getDowntimeDescriptionListByApi() {
|
const that = this
|
getAction(this.url.downtimeDescriptionList)
|
.then(res => {
|
if (res.success) that.downtimeDescriptionList = res.result
|
})
|
},
|
|
handleMaintainShutdown() {
|
this.$refs.maintainShutdownModal.visible = true
|
this.$refs.maintainShutdownModal.model = { downTimeIds: this.selectedRowKeys.join() }
|
},
|
|
handleSplitShutdownInfo() {
|
this.$refs.splitShutdownInfoModal.visible = true
|
this.$refs.splitShutdownInfoModal.setDateTime(this.selectionRows[0])
|
},
|
|
clearSelectedRowKeysAndLoadData() {
|
this.selectedRowKeys = this.selectionRows = []
|
this.loadData()
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="less">
|
|
</style>
|