From c5f1d9790f712b5d7d5de9c5e58a0f0de5dec928 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 27 二月 2025 11:21:55 +0800 Subject: [PATCH] 新增设备故障维修报表页面并完成布局样式及功能 --- src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeList.vue | 1 src/views/mdc/base/modules/EquipmentFailureRepaireReport/EquipmentFailureRepaireReportList.vue | 267 ++++++++++++++++++++++++++++++++++++++++++++ src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeList.vue | 1 src/views/mdc/base/EquipmentFailureRepaireReport.vue | 82 +++++++++++++ 4 files changed, 351 insertions(+), 0 deletions(-) diff --git a/src/views/mdc/base/EquipmentFailureRepaireReport.vue b/src/views/mdc/base/EquipmentFailureRepaireReport.vue new file mode 100644 index 0000000..efead2e --- /dev/null +++ b/src/views/mdc/base/EquipmentFailureRepaireReport.vue @@ -0,0 +1,82 @@ +<template> + <div style="width: 100%; height: 100%;"> + <a-card :bordered="false"> + <a-row type="flex" :gutter="16"> + <a-col :md="5"> + <a-tabs :activeKey="activeKey" @change="tabChange"> + <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render> + <base-tree @getCurrSelected="changeSelectionNode"></base-tree> + </a-tab-pane> + <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇">, + <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree> + </a-tab-pane> + </a-tabs> + </a-col> + <a-col :md="19"> + <EquipmentFailureRepaireReportList :nodePeople='selectPeople' :nodeTree='selectEquipment' :Type="selectTypeTree"/> + </a-col> + </a-row> + </a-card> + </div> + +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import BaseTree from '../common/BaseTree' + import EquipmentFailureRepaireReportList from './modules/EquipmentFailureRepaireReport/EquipmentFailureRepaireReportList' + import DepartTree from './modules/DepartList/DepartListTree/DepartTree' + import { mapActions } from 'vuex' + + export default { + name: 'EquipmentFailureRepaireReport', + components: { + BaseTree, + DepartTree, + EquipmentFailureRepaireReportList + }, + data() { + return { + activeKey: '1', + selectEquipmentId: '', + selectEquipment: {}, + selectPeople: {}, + selectTypeTree: '', + isDepartType: '' + } + }, + created() { + this.queryTreeData() + }, + methods: { + ...mapActions(['QueryDepartTree']), + queryTreeData() { + this.QueryDepartTree().then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + } else { + // this.$message.warn(res.message) + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + }) + }, + tabChange(val) { + this.activeKey = val + this.selectTypeTree = val + }, + changeSelectionNode(val) { + this.selectEquipment = val + this.selectTypeTree = '1' + }, + changeSelectionNodedd(val) { + this.selectPeople = val + this.selectTypeTree = '2' + } + } + + } +</script> \ No newline at end of file diff --git a/src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeList.vue b/src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeList.vue index 4baa52d..80b6a86 100644 --- a/src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeList.vue +++ b/src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeList.vue @@ -61,6 +61,7 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" + @change="handleTableChange" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"> <template slot="action" slot-scope="text, record"> <a @click="handleEdit(record)">缂栬緫</a> diff --git a/src/views/mdc/base/modules/EquipmentFailureRepaireReport/EquipmentFailureRepaireReportList.vue b/src/views/mdc/base/modules/EquipmentFailureRepaireReport/EquipmentFailureRepaireReportList.vue new file mode 100644 index 0000000..b1bec5a --- /dev/null +++ b/src/views/mdc/base/modules/EquipmentFailureRepaireReport/EquipmentFailureRepaireReportList.vue @@ -0,0 +1,267 @@ +<template> + <div class="device_list"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁惧缂栧彿"> + <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏈堜唤"> + <a-range-picker + :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']" + format="YYYY-MM" + :value="dates" + :mode="['month', 'month']" + @panelChange="dateParamChange" + @change="handleDateChange" + /> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button type="primary" icon="download" @click="handleExportXls('璁惧鏁呴殰缁翠慨鎶ヨ〃')">瀵煎嚭</a-button> + </div> + + <!-- table鍖哄煙-begin --> + <div id="DeviceList" style="flex: 1;overflow: hidden"> + <a-table + ref="table" + :scroll="{x:'max-content',y:scrollY}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + /> + </div> + </div> +</template> + +<script> + import moment from 'moment' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + + export default { + name: 'EquipmentFailureRepaireReportList', + mixins: [JeecgListMixin], + components: { }, + props: { nodeTree: '', Type: '', nodePeople: '' }, + data() { + return { + disableMixinCreated: true, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + dates: [moment().subtract('month', 1), moment().subtract('month', 1)], + queryParam: {}, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 200 + }, + { + title: '鎬绘晠闅滄鏁�', + align: 'center', + dataIndex: 'totalDownCount', + width: 100 + }, { + title: '鎬绘晠闅滃仠鏈烘椂闂�(hour)', + align: 'center', + dataIndex: 'totalDownLong', + width: 150 + }, + { + title: '鎬荤淮淇鏁�', + align: 'center', + dataIndex: 'totalRepairCount', + width: 100 + }, { + title: '鎬荤淮淇椂闂�(hour)', + align: 'center', + dataIndex: 'totalRepairLong', + width: 150 + }, + { + title: 'MTBF(hour)', + align: 'center', + dataIndex: 'mtbf', + width: 150 + }, { + title: 'MTTR(hour)', + align: 'center', + dataIndex: 'mttr', + width: 150 + }, + { + title: '鏃ユ湡', + align: 'center', + dataIndex: 'theDate', + width: 150 + } + ], + scrollY: 465, + url: { + list: '/mdc/mdcMttrInfo/list', + exportXlsUrl: '/mdc/mdcMttrInfo/exportXls' + } + } + }, + watch: { + Type(valmath) { + this.dataList = [] + this.queryParam.typeTree = valmath + // console.log(this.queryParam.typeTree) + }, + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParam.parentId = '' + this.queryParam.equipmentId = val.equipmentId + } else { + this.queryParam.parentId = val.key + this.queryParam.equipmentId = '' + } + this.searchQuery() + } + }, + nodePeople(val) { + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParam.parentId = '' + this.queryParam.equipmentId = val.equipmentId + } else { + this.queryParam.parentId = val.key + this.queryParam.equipmentId = '' + } + this.searchQuery() + } + } + }, + methods: { + handleComputeModalOpen() { + this.$refs.computeEquipmentFailureCloseTimeModalRef.visible = true + }, + + dateParamChange(value) { + console.log('dateParamChangeValue', value) + this.dates = value + this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') + this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') + }, + + handleDateChange(value) { + console.log('handleDateChangeValue', value) + if (!value.length) { + delete this.queryParam.startTime + delete this.queryParam.endTime + this.dates = [] + } + }, + + searchReset() { + this.queryParam = {} + this.dates = [] + this.loadData(1) + }, + + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + handleWindowResize() { + const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2) + const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) + this.scrollY = boxHeight - tableHeadHeight - 50 + } + }, + created() { + this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') + this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') + this.loadData() + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; + + .device_list { + display: flex; + flex-direction: column; + overflow: hidden; + } + + @media screen and (min-width: 1920px) { + .device_list { + height: 811px !important; + } + } + + @media screen and (min-width: 1680px) and (max-width: 1920px) { + .device_list { + height: 811px !important; + } + } + + @media screen and (min-width: 1400px) and (max-width: 1680px) { + .device_list { + height: 663px !important; + } + } + + @media screen and (min-width: 1280px) and (max-width: 1400px) { + .device_list { + height: 564px !important; + } + } + + @media screen and (max-width: 1280px) { + .device_list { + height: 564px !important; + } + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeList.vue b/src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeList.vue index 804b85d..e5b9345 100644 --- a/src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeList.vue +++ b/src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeList.vue @@ -61,6 +61,7 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" + @change="handleTableChange" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"> <template slot="action" slot-scope="text, record"> <a @click="handleEdit(record)">缂栬緫</a> -- Gitblit v1.9.3