From 886748a39efb188d8008d41f2718eb78f3006ddd Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 18 七月 2025 17:08:33 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/eam/base/EamMaintenanceStandardList.vue | 176 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 127 insertions(+), 49 deletions(-) diff --git a/src/views/eam/base/EamMaintenanceStandardList.vue b/src/views/eam/base/EamMaintenanceStandardList.vue index 04196b6..be2b0cd 100644 --- a/src/views/eam/base/EamMaintenanceStandardList.vue +++ b/src/views/eam/base/EamMaintenanceStandardList.vue @@ -44,29 +44,29 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button v-has="'standard:add'" @click="handleAdd" type="primary" icon="plus">鏂板</a-button> <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="inspectionImportExcel" @change="handleImportExcel"> - <a-button type="primary" icon="import">鐐规鏍囧噯瀵煎叆</a-button> + <a-button v-has="'standard:pointInspection'" type="primary" icon="import">鐐规鏍囧噯瀵煎叆</a-button> </a-upload> - <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)"> + <a-button v-has="'standard:pointInspectionDownload'" type="primary" icon="download" @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)"> 鐐规鏍囧噯妯℃澘涓嬭浇 </a-button> <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="secondMaintenanceImportExcel" @change="handleImportExcel"> - <a-button type="primary" icon="import">浜屼繚鏍囧噯瀵煎叆</a-button> + <a-button v-has="'standard:secondMaintenance'" type="primary" icon="import">浜屼繚鏍囧噯瀵煎叆</a-button> </a-upload> - <a-button type="primary" icon="download" + <a-button v-has="'standard:secondMaintenanceDownload'" type="primary" icon="download" @click="handleTemplateXlsDownload(url.secondMaintenanceXlsDownloadUrl)">浜屼繚鏍囧噯妯℃澘涓嬭浇 </a-button> <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="thirdMaintenanceImportExcel" @change="handleImportExcel"> - <a-button type="primary" icon="import">涓変繚鏍囧噯瀵煎叆</a-button> + <a-button v-has="'standard:ThirdMaintenance'" type="primary" icon="import">涓変繚鏍囧噯瀵煎叆</a-button> </a-upload> - <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)"> + <a-button v-has="'standard:ThirdMaintenanceDownload'" type="primary" icon="download" @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)"> 涓変繚鏍囧噯妯℃澘涓嬭浇 </a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> @@ -90,51 +90,73 @@ <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> </div> - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - class="j-table-force-nowrap" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - :customRow='clickThenSelect' - @change="handleTableChange"> + <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" + :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :customRow='clickThenSelect' + @change="handleTableChange"> <span slot="action" slot-scope="text, record"> - <a v-if="record.standardStatus === 'WAIT_SUBMIT'" @click.stop="handleEdit(record)">缂栬緫</a> - - <template v-if="record.standardStatus === 'START'"> - <a-divider type="vertical"/> - - <a @click.stop="handleUpgrade(record)">鍗囩増</a> - </template> + <a v-has="'standard:upgrade'" v-if="record.standardStatus === 'START'" @click.stop="handleUpgrade(record)">鍗囩増</a> <template v-if="record.standardStatus === 'WAIT_SUBMIT'"> - <a-divider type="vertical"/> + <a v-has="'standard:edit'" @click.stop="handleEdit(record)">缂栬緫</a> + + <a-divider v-has="'standard:edit'" type="vertical"/> + + <a-popconfirm title="纭畾鎻愪氦鍚�?" @confirm="() => startProcess(record.id)"> + <a v-has="'standard:saveFlow'" @click.stop="event=>event.stopPropagation()">鎻愪氦</a> + </a-popconfirm> + + + <a-divider v-has="'standard:saveFlow'" type="vertical"/> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> - <a @click="event=>event.stopPropagation()">鍒犻櫎</a> + <a v-has="'standard:del'" @click.stop="event=>event.stopPropagation()">鍒犻櫎</a> </a-popconfirm> + </template> + + <template v-if="record.standardStatus != 'WAIT_SUBMIT'"> + <a-divider v-has="'standard:delete'" type="vertical" v-if="record.standardStatus=='START'"/> + + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a v-has="'standard:delete'" @click.stop="event=>event.stopPropagation()">鍒犻櫎</a> + </a-popconfirm> </template> </span> </a-table> - <a-tabs defaultActiveKey="1"> - <a-tab-pane tab='淇濆吇鏍囧噯鏄庣粏椤�' key="1"> - <div class="table-operator" style="margin:-16px"> - <eam-maintenance-standard-detail-list ref="standardDetailRef" :standardId="standardId"/> - </div> - </a-tab-pane> + <a-tabs defaultActiveKey="1" v-if="selectionRows.length===1"> + <template v-if="selectionRows[0]&&selectionRows[0].maintenanceCategory=='POINT_INSPECTION'"> + <a-tab-pane tab="鏃ョ偣妫�" key="1"> + <eam-maintenance-standard-detail-list :standardId="standardId" :pageSelectionRow="selectionRows[0]" + filterKey="DAY_INSPECTION"/> + </a-tab-pane> + <a-tab-pane tab="鍛ㄧ偣妫�" key="2" forceRender> + <eam-maintenance-standard-detail-list :standardId="standardId" :pageSelectionRow="selectionRows[0]" + filterKey="WEEK_INSPECTION"/> + </a-tab-pane> + </template> + <template v-if="selectionRows[0]&&selectionRows[0].maintenanceCategory=='SECOND_MAINTENANCE'"> + <a-tab-pane tab="鎿嶄綔宸�" key="1"> + <eam-maintenance-standard-detail-list :standardId="standardId" :pageSelectionRow="selectionRows[0]" + filterKey="OPERATOR_MAINTENANCE"/> + </a-tab-pane> + <a-tab-pane tab="缁翠慨宸�" key="2" forceRender> + <eam-maintenance-standard-detail-list :standardId="standardId" :pageSelectionRow="selectionRows[0]" + filterKey="REPAIRER_MAINTENANCE"/> + </a-tab-pane> + </template> + + <a-tab-pane tab="涓変繚" key="1" v-if="selectionRows[0]&&selectionRows[0].maintenanceCategory=='THIRD_MAINTENANCE'"> + <eam-maintenance-standard-detail-list :standardId="standardId" + :pageSelectionRow="selectionRows[0]"/> + </a-tab-pane> </a-tabs> </div> <!-- table鍖哄煙-end --> <!-- 琛ㄥ崟鍖哄煙 --> - <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"></eamMaintenanceStandard-modal> + <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"/> </a-card> </template> @@ -143,7 +165,7 @@ import EamMaintenanceStandardModal from './modules/EamMaintenanceStandardModal' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import EamMaintenanceStandardDetailList from '@views/eam/base/modules/EamMaintenanceStandardDetailList' - import { deleteAction, templateXlsDownload } from '@api/manage' + import { deleteAction, getAction, templateXlsDownload } from '@api/manage' import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' @@ -233,16 +255,14 @@ list: '/eam/maintenanceStandard/list', delete: '/eam/maintenanceStandard/delete', deleteBatch: '/eam/maintenanceStandard/deleteBatch', + startProcess: '/eam/maintenanceStandard/saveEamMaintenanceStandardProcess', exportXlsUrl: 'eam/maintenanceStandard/exportXls', - inspectionImportExcel: 'eam/maintenanceStandard/inspectionImportExcel', - weekMaintenanceImportExcel: 'eam/maintenanceStandard/weekMaintenanceImportExcel', - secondMaintenanceImportExcel: 'eam/maintenanceStandard/secondMaintenanceImportExcel', - thirdMaintenanceImportExcel: 'eam/maintenanceStandard/thirdMaintenanceImportExcel', - inspectionXlsDownloadUrl: '瀵煎叆妯℃澘/鐐规鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', - weekMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/鍛ㄤ繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', - secondMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/浜屼繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', - thirdMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/涓変繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', - abolish: '/eam/maintenanceStandard/abolish' + inspectionImportExcel: '/eam/maintenanceStandard/importPointInspection', + secondMaintenanceImportExcel: '/eam/maintenanceStandard/importSecondMaintenanceStandard', + thirdMaintenanceImportExcel: '/eam/maintenanceStandard/importThirdMaintenanceStandard', + inspectionXlsDownloadUrl: '瀵煎叆妯℃澘/璁惧鐐规鏍囧噯瀵煎叆妯℃澘.xlsx', + secondMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/鐢熶骇璁惧浜岀骇淇濆吇瑙勮寖.docx', + thirdMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/鐢熶骇璁惧涓夌骇淇濆吇瑙勮寖.docx' }, standardId: '-1' } @@ -250,9 +270,6 @@ computed: { inspectionImportExcel: function() { return `${window._CONFIG['domianURL']}/${this.url.inspectionImportExcel}` - }, - weekMaintenanceImportExcel: function() { - return `${window._CONFIG['domianURL']}/${this.url.weekMaintenanceImportExcel}` }, secondMaintenanceImportExcel: function() { return `${window._CONFIG['domianURL']}/${this.url.secondMaintenanceImportExcel}` @@ -308,6 +325,33 @@ templateXlsDownload(url) }, + /** + * 鐐瑰嚮鍙戣捣娴佺▼瑙﹀彂 + * @param id 鍒楄〃琛岃褰旾D + */ + startProcess(id) { + this.loading = true + const that = this + getAction(this.url.startProcess, { id }) + .then(res => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + that.loading = false + }) + }, + handleUpgrade(record) { //鍗囩増 this.$refs.modalForm.upgrade(record) @@ -315,6 +359,40 @@ this.$refs.modalForm.disableSubmit = false }, + batchDel() { + 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.deleteBatch, { 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 + }) + } + }) + }, + searchReset() { this.standardId = '-1' this.queryParam = {} -- Gitblit v1.9.3