From b6d89c86d31ad156185893659913b92e4631d25c Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 21 八月 2025 17:35:49 +0800 Subject: [PATCH] 1、产品质量隐患确认表批量打印及导出功能 2、调整点检和二保批量打印功能代码 --- src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue | 247 +++++++++++++++++++++++++------------------------ 1 files changed, 126 insertions(+), 121 deletions(-) diff --git a/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue b/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue index 0487a9f..a675c0b 100644 --- a/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue +++ b/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue @@ -38,27 +38,47 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator" v-if="isDisplayOperation"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> - <a-button @click="handleBatchAdd" type="primary" icon="plus">鎵归噺鏂板</a-button> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="handlerBatchAbolish"> - <a-icon type="delete"/> - 浣滃簾 - </a-menu-item> - <a-menu-item key="2" @click="handlerBatchCollect"> - <a-icon type="form"/> - 棰嗗彇 - </a-menu-item> - <a-menu-item key="3" @click="handlerBatchRestore"> - <a-icon type="reload"/> - 杩樺師 - </a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 - <a-icon type="down"/> - </a-button> - </a-dropdown> + <a-button v-has="'secondMaintenanceOrder:add'" @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button v-has="'secondMaintenanceOrder:batchAdd'" @click="handleBatchAdd" type="primary" icon="plus">鎵归噺鏂板 + </a-button> + + <a-button v-has="'secondMaintenanceOrder:batchCollect'" @click="handlerBatchCollect" type="primary" icon="form" + :disabled="selectedRowKeys.length===0"> + 鎵归噺棰嗗彇 + </a-button> + <a-button @click="handleBatchPrint" type="primary" icon="monitor" :disabled="selectedRowKeys.length===0">鎵归噺棰勮 + </a-button> + <a-button v-has="'secondMaintenanceOrder:batchAbolish'" @click="handlerBatchAbolish" type="danger" + icon="delete" :disabled="selectedRowKeys.length===0"> + 鎵归噺浣滃簾 + </a-button> + <a-button v-has="'secondMaintenanceOrder:batchRestore'" @click="handlerBatchRestore" + :disabled="selectedRowKeys.length===0" icon="reload"> + 鎵归噺杩樺師 + </a-button> + <!-- <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item v-has="'secondMaintenanceOrder:batchAbolish'" key="1" @click="handlerBatchAbolish"> + <a-icon type="delete"/> + 浣滃簾 + </a-menu-item> + <a-menu-item v-has="'secondMaintenanceOrder:batchCollect'" key="2" @click="handlerBatchCollect"> + <a-icon type="form"/> + 棰嗗彇 + </a-menu-item> + <a-menu-item v-has="'secondMaintenanceOrder:batchRestore'" key="3" @click="handlerBatchRestore"> + <a-icon type="reload"/> + 杩樺師 + </a-menu-item> + <a-menu-item key="4" @click="handleBatchPrint"> + <a-icon type="monitor"/> + 棰勮 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown>--> </div> @@ -75,21 +95,23 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> <span slot="action" slot-scope="text, record"> <template v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE'"> - <a @click="handleEdit(record)">缂栬緫</a> + <a v-has="'secondMaintenanceOrder:edit'" @click="handleEdit(record)">缂栬緫</a> - <a-divider type="vertical"/> + <a-divider v-has="'secondMaintenanceOrder:edit'" type="vertical"/> - <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handlerCollect(record.id)"> + <a-popconfirm v-has="'secondMaintenanceOrder:collect'" title="纭畾棰嗗彇鍚�?" + @confirm="() => handlerCollect(record.id)"> <a>棰嗗彇</a> </a-popconfirm> - <a-divider type="vertical"/> + <a-divider v-has="'secondMaintenanceOrder:collect'" type="vertical"/> <a-dropdown> <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a> <a-menu slot="overlay"> <a-menu-item> - <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleAbolish(record.id)"> + <a-popconfirm v-has="'secondMaintenanceOrder:abolish'" title="纭畾浣滃簾鍚�?" + @confirm="() => handlerAbolish(record.id)"> <a>浣滃簾</a> </a-popconfirm> </a-menu-item> @@ -104,15 +126,16 @@ <a @click="handleDetail(record)">璇︽儏</a> - <a-divider v-if="record.maintenanceStatus === 'ABOLISH'" type="vertical"/> + <a-divider v-has="'secondMaintenanceOrder:restore'" v-if="record.maintenanceStatus === 'ABOLISH'" + type="vertical"/> - <a-popconfirm v-if="record.maintenanceStatus === 'ABOLISH'" title="纭畾杩樺師鍚�?" - @confirm="() => handlerRestore(record.id)"> + <a-popconfirm v-has="'secondMaintenanceOrder:restore'" v-if="record.maintenanceStatus === 'ABOLISH'" + title="纭畾杩樺師鍚�?" @confirm="() => handlerRestore(record.id)"> <a>杩樺師</a> </a-popconfirm> - <a-divider type="vertical" v-if="record.maintenanceStatus === 'COMPLETE'"/> - <a v-if="record.maintenanceStatus === 'COMPLETE'" @click="handlePrint(record)">鎵撳嵃</a> + <a-divider type="vertical"/> + <a @click="handlePrint(record)">棰勮</a> </template> </span> </a-table> @@ -122,10 +145,15 @@ <!-- 琛ㄥ崟鍖哄煙 --> <eamSecondMaintenanceOrder-modal ref="modalForm" @ok="modalFormOk"/> + <!--鎵归噺鏂板--> <eam-second-maintenance-batch-order-modal ref="batchModalForm" @ok="modalFormOk"/> + <!--瀹℃壒寮圭獥--> <second-maintenance-approval-modal ref="secondMaintenanceApprovalModal" :selectShenpiData="selectSecondMaintenanceData"/> + + <!--鎵归噺鎵撳嵃寮圭獥--> + <eam-second-maintenance-order-batch-print-modal ref="batchPrintModal"/> </a-card> </template> @@ -137,11 +165,13 @@ from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue' import LxSearchEquipmentSelect from '../equipment/modules/LxSearchEquipmentSelect' import EamSecondMaintenanceBatchOrderModal from './modules/EamSecondMaintenanceBatchOrderModal' + import EamSecondMaintenanceOrderBatchPrintModal from './modules/EamSecondMaintenanceOrderBatchPrintModal' export default { name: 'EamSecondMaintenanceOrderList', mixins: [JeecgListMixin], components: { + EamSecondMaintenanceOrderBatchPrintModal, EamSecondMaintenanceBatchOrderModal, LxSearchEquipmentSelect, EamSecondMaintenanceOrderModal, @@ -290,7 +320,7 @@ methods: { handleBatchAdd() { this.$refs.batchModalForm.title = '鎵归噺鏂板' - this.$refs.batchModalForm.visible = true + this.$refs.batchModalForm.add() }, /** @@ -335,9 +365,10 @@ * @param record 鍒楄〃琛岃褰� */ handlePrint(record) { - let href = `${window._CONFIG['domianURL']}/jmreport/view/1094834721929232384?id=` + record.id //缃戠珯閾炬帴 + let href = `${window._CONFIG['domianURL']}/jmreport/view/1110733537193545728?id=` + record.id //缃戠珯閾炬帴 window.open(href, '_blank') }, + handlerAbolish(id) { var that = this deleteAction(that.url.abolish, { id }) @@ -389,6 +420,7 @@ } }) }, + //杩樺師 handlerRestore(id) { let that = this @@ -410,103 +442,76 @@ } }) }, + //鎵归噺杩樺師 handlerBatchRestore() { - if (!this.url.restoreBatch) { - this.$message.error('璇疯缃畊rl.restoreBatch灞炴��!') - return + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' } - if (this.selectedRowKeys.length <= 0) { - // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); - this.$notification.warning({ - message: '娑堟伅', - description: '璇烽�夋嫨涓�鏉¤褰�' - }) - return - } else { - var ids = '' - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ',' + var that = this + this.$confirm({ + title: '纭杩樺師', + content: '鏄惁杩樺師閫変腑鏁版嵁锛屽彧鏈変綔搴熺姸鎬佺殑鏁版嵁鎵嶅彲杩樺師鎴愬姛?', + onOk: function() { + that.loading = true + deleteAction(that.url.restoreBatch, { ids: ids }).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) } - var that = this - this.$confirm({ - title: '纭杩樺師', - content: '鏄惁杩樺師閫変腑鏁版嵁锛屽彧鏈変綔搴熺姸鎬佺殑鏁版嵁鎵嶅彲杩樺師鎴愬姛?', - onOk: function() { - that.loading = true - deleteAction(that.url.restoreBatch, { ids: ids }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(that.selectedRowKeys.length) - // that.$message.success(res.message); - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - that.onClearSelected() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - that.loading = false - }) - } - }) - } + }) }, + //鎵归噺棰嗗彇 handlerBatchCollect() { - if (!this.url.collectBatch) { - this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') - return + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' } - if (this.selectedRowKeys.length <= 0) { - // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); - this.$notification.warning({ - message: '娑堟伅', - description: '璇烽�夋嫨涓�鏉¤褰�' - }) - return - } else { - var ids = '' - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ',' + var that = this + this.$confirm({ + title: '纭棰嗗彇', + content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?', + onOk: function() { + that.loading = true + deleteAction(that.url.collectBatch, { ids: ids }).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) } - var that = this - this.$confirm({ - title: '纭棰嗗彇', - content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?', - onOk: function() { - that.loading = true - deleteAction(that.url.collectBatch, { ids: ids }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(that.selectedRowKeys.length) - // that.$message.success(res.message); - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - that.onClearSelected() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - that.loading = false - }) - } - }) - } + }) + }, + + // 鎵归噺鎵撳嵃 + handleBatchPrint() { + this.$refs.batchPrintModal.handlePreview(this.selectedRowKeys.join()) }, onMaintenanceDateChange: function(dataArray) { -- Gitblit v1.9.3