From 1e653db94c24389cc7615fd4a7ef1d63b00af534 Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期五, 13 六月 2025 11:39:32 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/dnc/base/modules/TerminalIndex/ReportEquipmentClose.vue | 196 ++++++++++++++++++++++++++++++++---------------- 1 files changed, 131 insertions(+), 65 deletions(-) diff --git a/src/views/dnc/base/modules/TerminalIndex/ReportEquipmentClose.vue b/src/views/dnc/base/modules/TerminalIndex/ReportEquipmentClose.vue index 0f5f685..ce7f0ba 100644 --- a/src/views/dnc/base/modules/TerminalIndex/ReportEquipmentClose.vue +++ b/src/views/dnc/base/modules/TerminalIndex/ReportEquipmentClose.vue @@ -7,33 +7,36 @@ <div class="table-page-search-wrapper"> <a-form layout="inline"> <a-row :gutter="24"> - <a-col :span="4"> + <a-col :span="5"> <a-form-item label="璁惧"> - <a-select placeholder="璇烽�夋嫨璁惧" v-model="queryParam.equipmentId"></a-select> + <a-select placeholder="璇烽�夋嫨璁惧" v-model="queryParam.equipmentId" allow-clear> + <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="4"> + <a-col :span="5"> <a-form-item label="寮�濮嬫椂闂�"> - <a-date-picker style="width: 100%" show-time placeholder="璇烽�夋嫨寮�濮嬫椂闂�" v-model="queryParam.startTime"/> + <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="4"> + <a-col :span="5"> <a-form-item label="缁撴潫鏃堕棿"> - <a-date-picker style="width: 100%" show-time placeholder="璇烽�夋嫨缁撴潫鏃堕棿" v-model="queryParam.endTime"/> + <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="4"> + <a-col :span="5"> <a-form-item label="鍋滄満鍘熷洜"> - <a-select placeholder="璇烽�夋嫨鍋滄満鍘熷洜" v-model="queryParam.closeReason"></a-select> - </a-form-item> - </a-col> - - <a-col :span="4"> - <a-form-item label="鍋滄満鏃堕棿"> - <a-date-picker style="width: 100%" placeholder="璇烽�夋嫨鍋滄満鏃堕棿" v-model="queryParam.closeTime"/> + <a-select placeholder="璇烽�夋嫨鍋滄満鍘熷洜" v-model="queryParam.downtimeDescription" allow-clear> + <a-select-option v-for="item in downtimeDescriptionList" :key="item.value">{{item.label}} + </a-select-option> + </a-select> </a-form-item> </a-col> @@ -51,17 +54,30 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> - <a-button type="primary" @click="handleMaintainShutdown">缁存姢鍋滄満</a-button> - <a-button type="primary" @click="handleSplitShutdownInfo">鎷嗗垎鍋滄満淇℃伅</a-button> + <a-button type="primary" @click="handleMaintainShutdown" :disabled="selectedRowKeys.length===0">缁存姢鍋滄満</a-button> + <a-button type="primary" @click="handleSplitShutdownInfo" :disabled="selectionRows.length!==1">鎷嗗垎鍋滄満淇℃伅</a-button> </div> - <a-table :dataSource="dataSource" :columns="columns" rowKey="id" bordered :pagination="false" - :rowSelection="{selectedRowKeys, onChange: onSelectChange}"/> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i>宸查�夋嫨 <a style="font-weight: 600">{{ + selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table :dataSource="dataSource" :columns="columns" rowKey="id" bordered :pagination="ipagination" + :loading="loading" @change="handleTableChange" :customRow="customRow" + :rowSelection="{selectedRowKeys, onChange: onSelectChange}"> + <template slot="downtimeType" slot-scope="text"> + {{ text!=null?text === 0 ? '璁″垝鍋滄満' : '闈炶鍒掑仠鏈�':'' }} + </template> + </a-table> </a-card> - <maintain-shutdown-modal ref="maintainShutdownModal"/> + <maintain-shutdown-modal :downtimeDescriptionList="downtimeDescriptionList" ref="maintainShutdownModal" + @submitSuccess="loadData"/> - <split-shutdown-info-modal ref="splitShutdownInfoModal"/> + <split-shutdown-info-modal ref="splitShutdownInfoModal" :downtimeDescriptionList="downtimeDescriptionList" + @submitSuccess="modalFormOk"/> </div> </template> @@ -69,6 +85,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import MaintainShutdownModal from './ReportEquipmentClose/MaintainShutdownModal' import SplitShutdownInfoModal from './ReportEquipmentClose/SplitShutdownInfoModal' + import { getAction } from '@/api/manage' export default { name: 'ReportEquipmentClose', @@ -76,6 +93,8 @@ mixins: [JeecgListMixin], data() { return { + equipmentList: [], + downtimeDescriptionList: [], columns: [ { title: '璁惧缂栧彿', @@ -89,17 +108,19 @@ dataIndex: 'equipmentName' }, { - title: '鍋滄満缂栧彿', + title: '鍋滄満鍘熷洜', align: 'center', - dataIndex: 'shutdownId' + dataIndex: 'downtimeDescription' }, { title: '鍋滄満绫诲瀷', align: 'center', - dataIndex: 'shutdownType' + scopedSlots: { customRender: 'downtimeType' }, + dataIndex: 'downtimeType', + width: 150 }, { - title: '鍋滄満鏃堕棿', + title: '鍋滄満鏃堕棿(MIN)', align: 'center', width: 150, dataIndex: 'shutdownDuration' @@ -108,68 +129,113 @@ title: '寮�濮嬫椂闂�', align: 'center', width: 200, - dataIndex: 'startTime' + dataIndex: 'startDate' }, { title: '缁撴潫鏃堕棿', align: 'center', width: 200, - dataIndex: 'endTime' + dataIndex: 'endDate' }, { title: '褰曞叆绫诲瀷', align: 'center', width: 100, - dataIndex: 'recordType' - } - ], - dataSource: [ - { - id: 1, - equipmentId: '3140221', - equipmentName: '鏁版帶鏈哄簥', - shutdownDuration: 360, - startTime: '2025-05-20 02:21:49', - endTime: '2525-05-20 08:21:59', - recordType: '鑷姩涓婃姤' - }, - { - id: 2, - equipmentId: '3140221', - equipmentName: '鏁版帶鏈哄簥', - shutdownDuration: 360, - startTime: '2025-05-20 02:21:49', - endTime: '2525-05-20 08:21:59', - recordType: '鑷姩涓婃姤' - }, - { - id: 3, - equipmentId: '3140221', - equipmentName: '鏁版帶鏈哄簥', - shutdownDuration: 360, - startTime: '2025-05-20 02:21:49', - endTime: '2525-05-20 08:21:59', - recordType: '鑷姩涓婃姤' + dataIndex: 'enterType_dictText' } ], url: { - list: '' + equipmentList: '/mdc/mdcEquipment/getEquipmentList', + downtimeDescriptionList: '/mdc/mdcDowntimeReason/reasonList', + list: '/mdc/operator/mdcDowntime/list' } } }, + created() { + this.getEquipmentListByApi() + this.getDowntimeDescriptionListByApi() + }, methods: { - handleMaintainShutdown() { - this.$refs.maintainShutdownModal.visible = true - this.$refs.maintainShutdownModal.model = {} + // 鑾峰彇璁惧鍒楄〃 + 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 + }) + + }, + + loadData(arg) { + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + const params = this.getQueryParams()//鏌ヨ鏉′欢 + if (!params) return false + this.loading = true + getAction(this.url.list, params) + .then((res) => { + if (res.success) { + this.dataSource = res.result.records || res.result + this.selectionRows = this.dataSource.filter(item => this.selectedRowKeys.includes(item.id)) + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + } else { + this.$message.warning(res.message) + } + }) + .finally(() => { + this.loading = false + }) + }, + + customRow(record) { + return { + style: { + cursor: 'pointer' + }, + on: { + click: () => { + let selectedRowKeys = [...this.selectedRowKeys] + let selectionRows = [...this.selectionRows] + if (selectedRowKeys.includes(record.id)) { + selectedRowKeys = selectedRowKeys.filter(item => item !== record.id) + selectionRows = selectionRows.filter(item => item.id !== record.id) + } + else { + selectedRowKeys.push(record.id) + selectionRows.push(record) + } + this.onSelectChange(selectedRowKeys, selectionRows) + } + } + } + }, + + // 鎵撳紑缁存姢鍋滄満绐楀彛 + 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]) } } } -</script> - -<style scoped lang="less"> - -</style> \ No newline at end of file +</script> \ No newline at end of file -- Gitblit v1.9.3