From ff1f734e5f37cdd004f6c8bf88a2917737e1ff08 Mon Sep 17 00:00:00 2001 From: hyingbo <1363390067@qq.com> Date: 星期四, 11 九月 2025 11:10:56 +0800 Subject: [PATCH] 故障报修列表超期标记红色 --- src/views/eam/repair/EamReportRepairList.vue | 68 +++++++++++++++++++++++++++++----- 1 files changed, 58 insertions(+), 10 deletions(-) diff --git a/src/views/eam/repair/EamReportRepairList.vue b/src/views/eam/repair/EamReportRepairList.vue index 8e41d23..37aa3b5 100644 --- a/src/views/eam/repair/EamReportRepairList.vue +++ b/src/views/eam/repair/EamReportRepairList.vue @@ -58,15 +58,15 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator" v-if="isDisplayOperation"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button @click="handleAdd" type="primary" icon="plus" v-if="isShowAuth('eam:reportRepair:add')">鏂板</a-button> <!--<a-button type="primary" icon="download" @click="handleExportXls('鏁呴殰鎶ヤ慨')">瀵煎嚭</a-button>--> <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"--> - <!--@change="handleImportExcel">--> - <!--<a-button type="primary" icon="import">瀵煎叆</a-button>--> + <!--@change="handleImportExcel">--> + <!--<a-button type="primary" icon="import">瀵煎叆</a-button>--> <!--</a-upload>--> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"> + <a-menu-item key="1" @click="batchDel" v-if="isShowAuth('eam:reportRepair:abolish')"> <a-icon type="delete"/> 浣滃簾 </a-menu-item> @@ -96,18 +96,23 @@ :loading="loading" class="j-table-force-nowrap" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:isDisplayOperation?'checkbox':'radio',getCheckboxProps:getCheckboxProps}" - @change="handleTableChange"> + @change="handleTableChange" + :rowClassName="getRowClassName"> <template slot="imageFiles" slot-scope="text, record" v-if="text"> <a @click="handlePreviewImages(record)">棰勮</a> </template> <span slot="action" slot-scope="text, record" v-if="record.reportStatus=='WAIT_REPAIR'"> - <a @click="handleEdit(record)">缂栬緫</a> + <a @click="handleEdit(record)" v-if="isShowAuth('eam:reportRepair:edit')">缂栬緫</a> - <a-divider type="vertical"/> + <a-divider type="vertical" v-if="isShowAuth('eam:reportRepair:edit')"/> - <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleDelete(record.id)"> + <a @click="handleAssign(record)" v-if="isShowAuth('eam:reportRepair:assign')">鎸囨淳</a> + + <a-divider type="vertical" v-if="isShowAuth('eam:reportRepair:assign')"/> + + <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleDelete(record.id)" v-if="isShowAuth('eam:reportRepair:abolish')"> <a>浣滃簾</a> </a-popconfirm> </span> @@ -121,6 +126,8 @@ @ok="modalFormOk"/> <!-- 鍥剧墖棰勮寮圭獥 --> <images-preview-modal ref="imagesPreviewModalRef" :imageListUrl="currentImageListUrl"/> + <!--鎸囨淳鎶ヤ慨寮圭獥--> + <assign-repair-report-modal ref="assignRepairReportModalRef" @ok="modalFormOk"/> </a-card> </template> @@ -132,12 +139,14 @@ import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' import ImagesPreviewModal from '@views/eam/repair/modules/ImagesPreviewModal.vue' import { getAction } from '@/api/manage' + import AssignRepairReportModal from './modules/EamReportRepairList/AssignRepairReportModal' export default { name: 'EamReportRepairList', mixins: [JeecgListMixin], components: { + AssignRepairReportModal, ImagesPreviewModal, LxSearchEquipmentSelect, EamReportRepairModal @@ -170,7 +179,13 @@ { title: '璁惧缂栧彿', align: 'center', - dataIndex: 'equipmentId_dictText', + dataIndex: 'equipmentCode', + width: 200 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', width: 200 }, { @@ -252,7 +267,7 @@ dataIndex: 'action', align: 'center', scopedSlots: { customRender: 'action' }, - width: 150 + width: 200 } this.columns = [...this.columns, operationColumn] this.getFaultReasonListByApi() @@ -260,6 +275,26 @@ this.loadData(1) }, methods: { + + /** + * 璁$畻褰撳墠鏃堕棿鏄惁澶т簬鏁呴殰寮�濮嬫椂闂�+3澶� + * @param record 琛ㄦ牸琛屾暟鎹� + * @returns {string} 琛屾牱寮忕被鍚� + */ + getRowClassName(record) { + if ('WAIT_REPAIR' !== record.reportStatus) return ''; + + // 瑙f瀽鏁呴殰寮�濮嬫椂闂� + const faultStartTime = new Date(record.createTime); + // 璁$畻鏁呴殰寮�濮嬫椂闂�+3澶╃殑鏃堕棿鎴� + const threeDaysLater = new Date(faultStartTime.getTime() + 3 * 24 * 60 * 60 * 1000); + // 鑾峰彇褰撳墠鏃堕棿 + const now = new Date(); + + // 濡傛灉褰撳墠鏃堕棿澶т簬鏁呴殰寮�濮嬫椂闂�+3澶╋紝杩斿洖鏍囩孩鏍峰紡绫诲悕 + return now > threeDaysLater ? 'row-overdue' : ''; + }, + /** * 鑾峰彇鏁版嵁瀛楀吀鍊� * @param dictCode 鏁版嵁瀛楀吀瀵瑰簲璁板綍缂栫爜 @@ -307,6 +342,15 @@ this.$refs.imagesPreviewModalRef.visible = true }, + /** + * 鎸囨淳鎶ヤ慨鍗� + * @param record 琛ㄦ牸琛屼俊鎭� + */ + handleAssign(record) { + this.$refs.assignRepairReportModalRef.visible = true + this.$refs.assignRepairReportModalRef.model = Object.assign({}, { id: record.id }) + }, + getCheckboxProps(record) { return { props: { @@ -326,4 +370,8 @@ </script> <style scoped> @import '~@assets/less/common.less'; + /* 娣诲姞鏍囩孩鏍峰紡 */ + ::v-deep .row-overdue { + color: red !important; + } </style> \ No newline at end of file -- Gitblit v1.9.3