From 19aff1ac87030b21d2b01cdca5d5604c840ba7c0 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期一, 21 七月 2025 21:36:31 +0800 Subject: [PATCH] 维修工单 --- src/views/eam/maintenance/EamInspectionOrderList.vue | 99 +++++++++++++++++++++++++++++++------------------ 1 files changed, 62 insertions(+), 37 deletions(-) diff --git a/src/views/eam/maintenance/EamInspectionOrderList.vue b/src/views/eam/maintenance/EamInspectionOrderList.vue index be8ef7d..c8d5ae1 100644 --- a/src/views/eam/maintenance/EamInspectionOrderList.vue +++ b/src/views/eam/maintenance/EamInspectionOrderList.vue @@ -39,14 +39,15 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator" v-if="isDisplayOperation"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button v-has="'eam:inspection:add'" @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button v-if="selectedRowKeys.length == 1" @click="handlePrint" type="primary">鏌ョ湅</a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchZf('ABOLISH')"> + <a-menu-item key="1" @click="batchZf('ABOLISH')" v-has="'eam:inspection:abolish'"> <a-icon type="snippets"/> 浣滃簾 </a-menu-item> - <a-menu-item key="2" @click="batchLq('UNDER_INSPECTION')"> + <a-menu-item key="2" @click="batchLq('UNDER_INSPECTION')" v-has="'eam:inspection:collect'"> <a-icon type="form"/> 棰嗗彇 </a-menu-item> @@ -85,19 +86,25 @@ <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a> <a-menu slot="overlay"> <a-menu-item> - <a @click="handleDetail(record)">璇︽儏</a> - </a-menu-item> - - <a-menu-item> <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleAbolish(record.id)"> <a>浣滃簾</a> </a-popconfirm> + </a-menu-item> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> </a-menu-item> </a-menu> </a-dropdown> </template> - <a v-else @click="handleDetail(record)">璇︽儏</a> + <template v-else> + <template v-if="record.inspectionStatus=='COMPLETE'"> + <a @click="handlePrint(record)">棰勮</a> + <a-divider type="vertical"/> + </template> + + <a @click="handleDetail(record)">璇︽儏</a> + </template> </span> </a-table> </div> @@ -143,22 +150,26 @@ align: 'center', customRender: function(t, r, index) { return parseInt(index) + 1 - } + }, + fixed: 'left' }, { title: '缁熶竴缂栫爜', align: 'center', - dataIndex: 'equipmentCode' + dataIndex: 'equipmentCode', + fixed: 'left' }, { title: '璁惧鍚嶇О', align: 'center', - dataIndex: 'equipmentName' + dataIndex: 'equipmentName', + fixed: 'left' }, { title: '璁惧鍨嬪彿', align: 'center', - dataIndex: 'equipmentModel' + dataIndex: 'equipmentModel', + fixed: 'left' }, { title: '宸ュ崟鍙�', @@ -176,7 +187,8 @@ dataIndex: 'inspectionDate', customRender: function(text) { return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) - } + }, + width: 150 }, { title: '鐐规杩囨湡鏃ユ湡', @@ -184,7 +196,8 @@ dataIndex: 'expirationTime', customRender: function(text) { return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) - } + }, + width: 150 }, { title: '鍒涘缓鏂瑰紡', @@ -204,7 +217,8 @@ { title: '鐐规鏃堕棿', align: 'center', - dataIndex: 'operateTime' + dataIndex: 'operateTime', + width: 150 }, { title: '缁翠慨宸�', @@ -214,12 +228,14 @@ { title: '纭鏃堕棿', align: 'center', - dataIndex: 'confirmTime' + dataIndex: 'confirmTime', + width: 150 }, { - title: '纭鎰忚', + title: 'HF缂栫爜', align: 'center', - dataIndex: 'confirmComment' + dataIndex: 'hfCode', + width: 250 } ], url: { @@ -244,9 +260,8 @@ title: '鎿嶄綔', dataIndex: 'action', align: 'center', - fixed: 'right', - width: 200, - scopedSlots: { customRender: 'action' } + scopedSlots: { customRender: 'action' }, + fixed: 'right' } this.columns = [...this.columns, operationColumn] this.loadData(1) @@ -263,8 +278,7 @@ this.$refs.modalFormXq.visible = true this.$refs.modalFormXq.title = '璇︽儏' this.$refs.modalFormXq.disableSubmit = true - this.$refs.modalFormXq.getAllApproveData(record) - this.$refs.modalFormXq.getBasicInformation({ ...record, dataId: record.id }) + this.$refs.modalFormXq.handleDetail(record) }, handleInspection(id) { @@ -290,21 +304,25 @@ handleAbolish(id) { var that = this - getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => { - if (res.success) { - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - } else { - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) + this.loading = true + getAction(that.url.cancelInspectionOrder, { id }) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + this.loading = false + } + }) }, + batchZf(type) { var ids = '' for (var a = 0; a < this.selectedRowKeys.length; a++) { @@ -337,6 +355,7 @@ } }) }, + batchLq(type) { var ids = '' for (var a = 0; a < this.selectedRowKeys.length; a++) { @@ -370,6 +389,12 @@ } }) }, + + handlePrint(record) { + let href = `${window._CONFIG['domianURL']}/jmreport/view/1105664887569121280?equipmentCode=` + record.equipmentCode + window.open(href, '_blank') + }, + onInspectionDateChange: function(value, dateString) { this.queryParam.inspectionDateBegin = dateString[0] this.queryParam.inspectionDateEnd = dateString[1] -- Gitblit v1.9.3