From dbb3445dc720a8f36b3424e73f2e02a6b0f9deb6 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期日, 27 四月 2025 11:31:57 +0800 Subject: [PATCH] art: 从沃克项目迁移设备管理代码到航宇 --- src/views/eam/equipment/modules/EamEquipmentModal.vue | 2 vue.config.js | 4 src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue | 874 +++--- src/views/eam/maintenance/modules/EamInspectionOrderModal.vue | 514 ++- src/views/eam/base/EamMaintenanceStandardList.vue | 4 src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue | 729 ++++- src/views/eam/equipment/EamEquipmentList.vue | 59 src/views/flowable/workflow/FlowLedger.vue | 360 +- src/config/index.js | 6 src/views/flowable/workflow/FlowTodo.vue | 496 +-- src/views/eam/equipment/EamEquipmentAttachmentList.vue | 185 + src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue | 52 src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue | 554 ++-- src/views/eam/equipment/modules/EamEquipmentAttachmentModal.vue | 138 + src/views/eam/repair/modules/ImagesPreviewModal.vue | 75 src/views/eam/repair/EamReportRepairList.vue | 44 src/views/system/modules/SelectDeviceDrawer.vue | 1 src/utils/request.js | 2 src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue | 2 /dev/null | 443 --- src/views/eam/maintenance/EamInspectionOrderList.vue | 396 +- src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue | 275 + src/views/eam/equipment/modules/NameplateModal.vue | 121 src/views/eam/equipment/modules/ResumeDrawer.vue | 188 src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue | 648 ++-- src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue | 618 +++- src/views/eam/repair/EamRepairOrderList.vue | 90 src/views/flowable/workflow/FlowCompleted.vue | 338 +- 28 files changed, 3,840 insertions(+), 3,378 deletions(-) diff --git a/src/config/index.js b/src/config/index.js index 1843b2a..ad4f310 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -2,9 +2,9 @@ import Vue from 'vue' //璁剧疆鍏ㄥ眬API_BASE_URL Vue.prototype.API_BASE_URL = window._CONFIG.VUE_APP_API_BASE_URL?window._CONFIG.VUE_APP_API_BASE_URL:process.env.VUE_APP_API_BASE_URL -window._CONFIG['domianURL'] = Vue.prototype.API_BASE_URL +window._CONFIG['domianURL'] = '/jeecg-boot' //鍗曠偣鐧诲綍鍦板潃 window._CONFIG['casPrefixUrl'] = window._CONFIG.VUE_APP_CAS_BASE_URL?window._CONFIG.VUE_APP_CAS_BASE_URL:process.env.VUE_APP_CAS_BASE_URL window._CONFIG['onlinePreviewDomainURL'] = window._CONFIG.VUE_APP_ONLINE_BASE_URL?window._CONFIG.VUE_APP_ONLINE_BASE_URL:process.env.VUE_APP_ONLINE_BASE_URL -window._CONFIG['staticDomainURL'] = Vue.prototype.API_BASE_URL + '/sys/common/static' -window._CONFIG['pdfDomainURL'] = Vue.prototype.API_BASE_URL+ '/sys/common/pdf/pdfPreviewIframe' \ No newline at end of file +window._CONFIG['staticDomainURL'] = '/jeecg-boot/sys/common/static' +window._CONFIG['pdfDomainURL'] = '/jeecg-boot/sys/common/pdf/pdfPreviewIframe' \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index 9092e57..0cc4be1 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -11,7 +11,7 @@ * 鍒欐槧灏勫悗绔煙鍚嶏紝閫氳繃 vue.config.js * @type {*|string} */ -let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot"; +let apiBaseUrl = "/jeecg-boot"; //console.log("apiBaseUrl= ",apiBaseUrl) // 鍒涘缓 axios 瀹炰緥 const service = axios.create({ diff --git a/src/views/eam/base/EamMaintenanceStandardList.vue b/src/views/eam/base/EamMaintenanceStandardList.vue index ce37ca9..a422f17 100644 --- a/src/views/eam/base/EamMaintenanceStandardList.vue +++ b/src/views/eam/base/EamMaintenanceStandardList.vue @@ -45,12 +45,12 @@ <div class="table-operator"> <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="inspectionImportExcel" - @change="inspectionImportExcel"> + @change="handleImportExcel"> <a-button type="primary" icon="import">鐐规鏍囧噯瀵煎叆</a-button> </a-upload> <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)">鐐规鏍囧噯妯℃澘涓嬭浇</a-button> <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="weekMaintenanceImportExcel" - @change="weekMaintenanceImportExcel"> + @change="handleImportExcel"> <a-button type="primary" icon="import">鍛ㄤ繚鏍囧噯瀵煎叆</a-button> </a-upload> <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.weekMaintenanceXlsDownloadUrl)">鍛ㄤ繚鏍囧噯妯℃澘涓嬭浇</a-button> diff --git a/src/views/eam/equipment/EamEquipmentAttachmentList.vue b/src/views/eam/equipment/EamEquipmentAttachmentList.vue new file mode 100644 index 0000000..074fabb --- /dev/null +++ b/src/views/eam/equipment/EamEquipmentAttachmentList.vue @@ -0,0 +1,185 @@ +<template> + <a-card :bordered="false"> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button v-if="queryParam.equipmentId" @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <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 + 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}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handlePreview(record)">棰勮</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾涓嬭浇鏂囦欢鍚�?" @confirm="() => handleDownload(record)"> + <a>涓嬭浇</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipmentAttachment-modal ref="modalForm" @ok="modalFormOk" :equipmentId="queryParam.equipmentId"></eamEquipmentAttachment-modal> + <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentAttachmentModal from './modules/EamEquipmentAttachmentModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { downFile } from '@api/manage' + +export default { + name: 'EamEquipmentAttachmentList', + mixins: [JeecgListMixin], + components: { + EamEquipmentAttachmentModal + }, + data() { + return { + description: '璁惧鏂囨。鍙拌处浣跨敤绠$悊椤甸潰', + disableMixinCreated: true, + fileUrl: '', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鏂囦欢鍔犲瘑鍚�', + align: 'center', + dataIndex: 'fileEncodeName', + ellipsis: true, + }, + { + title: '鏂囦欢鍚嶇О', + align: 'center', + dataIndex: 'fileName', + ellipsis: true, + }, + { + title: '鏂囦欢璺緞', + align: 'center', + dataIndex: 'filePath', + ellipsis: true, + }, + { + title: '鏂囦欢鍚庣紑鍚�', + align: 'center', + dataIndex: 'fileSuffix' + }, + { + title: '鏂囦欢澶у皬', + align: 'center', + dataIndex: 'fileSize' + }, + { + title: '鎻忚堪', + align: 'center', + dataIndex: 'description', + ellipsis: true, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/equipmentAttachment/list', + delete: '/eam/equipmentAttachment/delete', + deleteBatch: '/eam/equipmentAttachment/deleteBatch', + download: '/eam/equipmentAttachment/downloadFile', + } + } + }, + computed: { + }, + methods: { + handleDownload(record) { + downFile(this.url.download, { id: record.id }).then((res) => { + if (!res) { + this.$message.warning('鏂囦欢涓嬭浇澶辫触') + return + } else { + let fileName = record.fileName; + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([res]), fileName); + } else { + let url = window.URL.createObjectURL(new Blob([res])); + let link = document.createElement('a'); + link.style.display = 'none'; + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click() + document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 + } + } + }) + }, + handlePreview: function (record) { + this.$refs.lxFilePreview.preview(record.filePath); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue index 4dc9dda..e136054 100644 --- a/src/views/eam/equipment/EamEquipmentList.vue +++ b/src/views/eam/equipment/EamEquipmentList.vue @@ -85,13 +85,13 @@ <a-button type="primary" icon="download" @click="handleTemplateXlsDownload">瀵煎叆妯℃澘涓嬭浇</a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"> - <a-icon type="delete"/> - 鍒犻櫎 - </a-menu-item> - <a-menu-item key="2" @click="handleOpenNameplateModal(selectionRows)"> + <a-menu-item key="1" @click="handleOpenNameplateModal(selectionRows)"> <a-icon type="printer"/> 鎵撳嵃閾墝 + </a-menu-item> + <a-menu-item key="2" @click="batchDel" v-if="isShowAuth('eam:equipment:delete')"> + <a-icon type="delete"/> + 鍒犻櫎 </a-menu-item> </a-menu> <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 @@ -107,7 +107,6 @@ style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� <a style="margin-left: 24px" @click="onSelectChange([])">娓呯┖</a> </div> - <a-table ref="table" size="middle" @@ -153,7 +152,7 @@ <a-menu-item> <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a> </a-menu-item> - <a-menu-item> + <a-menu-item v-if="isShowAuth('eam:equipment:delete')"> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> <a>鍒犻櫎</a> </a-popconfirm> @@ -167,11 +166,20 @@ <!-- table鍖哄煙-end --> <a-tabs v-model="activeTabKey" @change="handleTabChange"> - <a-tab-pane tab="淇濆吇鏍囧噯" :key="1"> - <eam-maintenance-standard-list ref="tabPaneTableListRef1" :isDisplayOperation="false"/> + <a-tab-pane tab="璁惧鏂囨。" :key="1"> + <eam-equipment-attachment-list ref="tabPaneTableListRef1"/> </a-tab-pane> - <a-tab-pane tab="缁翠慨宸ュ崟" :key="2"> - <eam-repair-order-list ref="tabPaneTableListRef2" :isDisplayOperation="false"/> + <a-tab-pane tab="鐐规宸ュ崟" :key="2"> + <eam-inspection-order-list ref="tabPaneTableListRef2" :isDisplayOperation="false"/> + </a-tab-pane> + <a-tab-pane tab="鍛ㄤ繚宸ュ崟" :key="3"> + <eam-week-maintenance-order-list ref="tabPaneTableListRef3" :isDisplayOperation="false"/> + </a-tab-pane> + <a-tab-pane tab="缁翠慨宸ュ崟" :key="4"> + <eam-repair-order-list ref="tabPaneTableListRef4" :isDisplayOperation="false"/> + </a-tab-pane> + <a-tab-pane tab="淇濆吇鏍囧噯" :key="5"> + <eam-maintenance-standard-list ref="tabPaneTableListRef5" :isDisplayOperation="false"/> </a-tab-pane> </a-tabs> @@ -180,7 +188,7 @@ <!--閾墝寮圭獥--> <nameplate-modal ref="nameplateModalRef" :printedRows="printedRows"/> <!--灞ュ巻寮圭獥--> - <resume-drawer ref="resumeDrawerRef"/> + <resume-drawer ref="resumeDrawerRef" :currentTableRowRecord="currentTableRowRecord"/> </a-card> </template> @@ -194,16 +202,22 @@ import ResumeDrawer from '@views/eam/equipment/modules/ResumeDrawer.vue' import EamMaintenanceStandardList from '@views/eam/base/EamMaintenanceStandardList.vue' import EamRepairOrderList from '../repair/EamRepairOrderList' + import EamInspectionOrderList from '../maintenance/EamInspectionOrderList' + import EamEquipmentAttachmentList from '@views/eam/equipment/EamEquipmentAttachmentList.vue' + import EamWeekMaintenanceOrderList from '@views/eam/maintenance/EamWeekMaintenanceOrderList.vue' export default { name: 'EamEquipmentList', mixins: [JeecgListMixin], components: { + EamInspectionOrderList, EamRepairOrderList, EamMaintenanceStandardList, ResumeDrawer, NameplateModal, - EamEquipmentModal + EamEquipmentModal, + EamEquipmentAttachmentList, + EamWeekMaintenanceOrderList }, data() { return { @@ -290,7 +304,6 @@ { title: '璁惧鍒嗙被', align: 'center', - width: 100, dataIndex: 'equipmentCategory_dictText' }, { @@ -323,23 +336,20 @@ width: 100, dataIndex: 'installationPosition' }, - { title: '绔嬮」鍗″彿', align: 'center', - width: 100, dataIndex: 'cardNumber' }, { title: '鍑哄巶缂栧彿', align: 'center', - width: 100, dataIndex: 'factoryNumber' }, { title: '鏈哄簥鍘傚', align: 'center', - width: 100, + width: 300, dataIndex: 'manufacturingEnterprise' }, { @@ -408,23 +418,23 @@ { title: '璁惧绔彛', align: 'center', - width: 100, dataIndex: 'equipmentPort' }, { title: '鍧愭爣鏁伴噺', align: 'center', - width: 100, dataIndex: 'coordinateNum' }, { title: '鍒涘缓浜�', align: 'center', + width: 100, dataIndex: 'createBy_dictText' }, { title: '鍒涘缓鏃堕棿', align: 'center', + width: 200, dataIndex: 'createTime' }, { @@ -440,7 +450,6 @@ { title: '澶囨敞', align: 'center', - width: 100, dataIndex: 'remark' }, { @@ -464,7 +473,8 @@ treeData: [], printedRows: [], activeTabKey: 1, - appHomeUrl: '' + appHomeUrl: '', + currentTableRowRecord: {} } }, computed: { @@ -503,7 +513,11 @@ * @param record 琛ㄦ牸琛屼俊鎭� */ handleOpenResumeDrawer(record) { + this.currentTableRowRecord = Object.assign({}, record) + this.$refs.resumeDrawerRef.title = '璁惧灞ュ巻' + `锛�${record.equipmentCode}锛塦 + this.$refs.resumeDrawerRef.dataSource = [] this.$refs.resumeDrawerRef.visible = true + this.$nextTick(() => this.$refs.resumeDrawerRef.getEquipmentResumeByApi()) }, /** @@ -550,6 +564,7 @@ onSelectChange(selectedRowKeys, selectionRows) { this.selectedRowKeys = selectedRowKeys this.selectionRows = selectionRows + this.$refs['tabPaneTableListRef' + this.activeTabKey].queryParam.equipmentId = null this.$refs['tabPaneTableListRef' + this.activeTabKey].dataSource = [] this.$refs['tabPaneTableListRef' + this.activeTabKey].onClearSelected() if (selectedRowKeys.length === 1) this.loadTabPaneTableData(selectedRowKeys[0]) diff --git a/src/views/eam/equipment/modules/EamEquipmentAttachmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentAttachmentModal.vue new file mode 100644 index 0000000..bf170cc --- /dev/null +++ b/src/views/eam/equipment/modules/EamEquipmentAttachmentModal.vue @@ -0,0 +1,138 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item + label="涓婁紶" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + v-if="!editable" + prop="fileList"> + <lx-upload :returnUrl="false" + :isMultiple="false" + v-model="model.fileList" + biz="test"> + </lx-upload> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileName" label="鏂囦欢鍚嶇О" v-if="editable"> + <a-input placeholder="璇疯緭鍏ユ枃浠跺悕绉�" v-model="model.fileName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description" label="鎻忚堪"> + <a-textarea placeholder="璇疯緭鍏ユ弿杩�" v-model="model.description" /> + </a-form-model-item> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' + +export default { + name: "EamEquipmentAttachmentModal", + props: { + equipmentId: { + type: String, + required: true, + default: '-1' + } + }, + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules:{ + fileName: [ + { required: true, message: '璇疯緭鍏ユ枃浠跺悕绉�!' } + ] + }, + url: { + add: "/eam/equipmentAttachment/add", + edit: "/eam/equipmentAttachment/edit", + }, + editable: false, + } + }, + created () { + }, + methods: { + add () { + this.editable = false; + //鍒濆鍖栭粯璁ゅ�� + this.model = {}; + this.visible = true + }, + edit (record) { + this.editable = true; + this.model = Object.assign({}, record) + this.visible = true + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + that.model.equipmentId = that.equipmentId; + httpAction(httpurl, that.model, method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + that.close(); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/EamEquipmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentModal.vue index bda0eb0..63a550d 100644 --- a/src/views/eam/equipment/modules/EamEquipmentModal.vue +++ b/src/views/eam/equipment/modules/EamEquipmentModal.vue @@ -284,7 +284,7 @@ { required: true, message: '璇烽�夋嫨鍑哄巶鏃ユ湡' } ], acceptanceCheckDate: [ - { required: true, message: '璇烽�夋嫨楠屾敹鏃ユ湡' } + { required: false, message: '璇烽�夋嫨楠屾敹鏃ユ湡' } ], technologyStatus: [ { required: true, message: '璇烽�夋嫨鎶�鏈姸鎬�' } diff --git a/src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue b/src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue index 6cc7d31..abc6eba 100644 --- a/src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue +++ b/src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue @@ -82,7 +82,7 @@ if (!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key != this.value || !this.maintenanceCategory) { console.log('杩欐墠璇锋眰鍚庡彴') getAction(`/eam/maintenanceStandard/listByUser`, { - id: this.value, + equipmentId: this.value, maintenanceCategory: this.maintenanceCategory }).then(res => { if (res.success) { diff --git a/src/views/eam/equipment/modules/NameplateModal.vue b/src/views/eam/equipment/modules/NameplateModal.vue index e02482b..f36442b 100644 --- a/src/views/eam/equipment/modules/NameplateModal.vue +++ b/src/views/eam/equipment/modules/NameplateModal.vue @@ -18,8 +18,10 @@ <tbody> <tr> - <td rowspan="3"> - <QrcodeVue :value="httpUrl+item.equipmentCode"/> + <td rowspan="3" align="center"> + <div style="height: 80%;width: 50%"> + <QrcodeVue :value="httpUrl+item.id" :size="50"/> + </div> </td> <td>璁惧缂栧彿</td> <td>{{ item.equipmentCode }}</td> @@ -42,8 +44,10 @@ </tr> <tr> - <td rowspan="3"> - <QrcodeVue :value="item.equipmentCode"/> + <td rowspan="3" align="center"> + <div style="height: 80%;width: 50%"> + <QrcodeVue :value="item.equipmentCode" :size="50"/> + </div> </td> <td>鍑哄巶缂栧彿</td> <td>{{ item.factoryNumber }}</td> @@ -75,72 +79,73 @@ </template> <script> -import QrcodeVue from 'qrcode.vue' + import QrcodeVue from 'qrcode.vue' -export default { - name: 'NameplateModal', - components: { QrcodeVue }, - props: { - printedRows: { - type: Array - } - }, - data() { - return { - title: '閾墝', - visible: false, - httpUrl: '' - } - }, - methods: { - handleCancel() { - this.visible = false + export default { + name: 'NameplateModal', + components: { QrcodeVue }, + props: { + printedRows: { + type: Array + } + }, + data() { + return { + title: '閾墝', + visible: false, + httpUrl: '' + } + }, + methods: { + handleCancel() { + this.visible = false + } } } -} </script> <style lang="less" scoped> -/deep/ .ant-modal { - height: 75%; - overflow: hidden; - - .ant-modal-content { - height: 100%; - display: flex; - flex-direction: column; + /deep/ .ant-modal { + height: 75%; overflow: hidden; - ::-webkit-scrollbar { - width: 8px; - height: 8px; - } + .ant-modal-content { + height: 100%; + display: flex; + flex-direction: column; + overflow: hidden; - .ant-modal-body { - flex: 1; - overflow: auto; + ::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + .ant-modal-body { + flex: 1; + overflow: auto; + } } } -} -table { - font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "寰蒋闆呴粦", Arial, sans-serif; - color: #000; - text-align: center; + table { + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "寰蒋闆呴粦", Arial, sans-serif; + color: #000; + text-align: center; - &:not(:last-child) { - margin-bottom: 10px; + &:not(:last-child) { + margin-bottom: 10px; + } + + th { + font-size: 24px; + letter-spacing: 3px; + padding: 12px; + } + + td { + font-size: 14px; + width: 33%; + padding: 6px; + } } - - th { - font-size: 28px; - letter-spacing: 3px; - padding: 20px; - } - - td { - font-size: 18px; - width: 33%; - } -} </style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/ResumeDrawer.vue b/src/views/eam/equipment/modules/ResumeDrawer.vue index 4178982..7d3547a 100644 --- a/src/views/eam/equipment/modules/ResumeDrawer.vue +++ b/src/views/eam/equipment/modules/ResumeDrawer.vue @@ -1,98 +1,124 @@ <template> - <a-drawer title="璁惧灞ュ巻" placement="right" :width="500" :closable="false" :visible="visible" @close="onClose"> - <a-timeline mode="alternate"> - <a-timeline-item>Create a services site 2015-09-01</a-timeline-item> - <a-timeline-item color="green"> - Solve initial network problems 2015-09-01 - </a-timeline-item> - <a-timeline-item> - <a-icon slot="dot" type="clock-circle-o" style="font-size: 16px;"/> - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque - laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto - beatae vitae dicta sunt explicabo. - </a-timeline-item> - <a-timeline-item color="red"> - Network problems being solved 2015-09-01 - </a-timeline-item> - <a-timeline-item>Create a services site 2015-09-01</a-timeline-item> - <a-timeline-item> - <a-icon slot="dot" type="clock-circle-o" style="font-size: 16px;"/> - Technical testing 2015-09-01 - </a-timeline-item> - <a-timeline-item>Create a services site 2015-09-01</a-timeline-item> - <a-timeline-item color="green"> - Solve initial network problems 2015-09-01 - </a-timeline-item> - <a-timeline-item> - <a-icon slot="dot" type="clock-circle-o" style="font-size: 16px;"/> - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque - laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto - beatae vitae dicta sunt explicabo. - </a-timeline-item> - <a-timeline-item color="red"> - Network problems being solved 2015-09-01 - </a-timeline-item> - <a-timeline-item>Create a services site 2015-09-01</a-timeline-item> - <a-timeline-item> - <a-icon slot="dot" type="clock-circle-o" style="font-size: 16px;"/> - Technical testing 2015-09-01 - </a-timeline-item> - <a-timeline-item>Create a services site 2015-09-01</a-timeline-item> - <a-timeline-item color="green"> - Solve initial network problems 2015-09-01 - </a-timeline-item> - <a-timeline-item> - <a-icon slot="dot" type="clock-circle-o" style="font-size: 16px;"/> - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque - laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto - beatae vitae dicta sunt explicabo. - </a-timeline-item> - <a-timeline-item color="red"> - Network problems being solved 2015-09-01 - </a-timeline-item> - <a-timeline-item>Create a services site 2015-09-01</a-timeline-item> - <a-timeline-item> - <a-icon slot="dot" type="clock-circle-o" style="font-size: 16px;"/> - Technical testing 2015-09-01 - </a-timeline-item> - </a-timeline> + <a-drawer :title="title" placement="right" :width="600" :closable="false" :visible="visible" @close="onClose"> + <a-spin :spinning="spinning"> + <a-skeleton :title="false" :paragraph="{ rows: 30}" v-if="spinning&&dataSource.length===0"/> + + <template v-if="dataSource.length>0"> + <a-timeline mode="alternate"> + <a-timeline-item v-for="item in dataSource" :key="item.id"> + <span>鎿嶄綔浜猴細{{item.operator_dictText}}</span><br/> + <span>鎿嶄綔锛歿{item.operationTag_dictText}}</span><br/> + <!--<span>鎻忚堪锛歿{item.description}}</span>--> + <span>鎿嶄綔鏃堕棿锛歿{item.createTime}}</span> + </a-timeline-item> + </a-timeline> + + <div style="text-align: center"> + <a v-if="dataSource.length>0&&pageConfig.pageNo===1&&pageConfig.pageNo!==pageConfig.totalPage" + @click="loadNextPageData"> + 鐐瑰嚮鍔犺浇鏇村 + <a-icon type="down"/> + </a> + + <span v-if="isNoMoreData">- 宸茬粡鍒板簳浜� -</span> + + <a-empty v-if="dataSource.length===0"/> + </div> + </template> + </a-spin> </a-drawer> </template> <script> -export default { - name: 'ResumeDrawer', - data() { - return { - visible: false - } - }, - methods: { - getEquipmentResumeByApi() { + import { getAction } from '@/api/manage' + export default { + name: 'ResumeDrawer', + props: { + currentTableRowRecord: { + type: Object + } }, + data() { + return { + title: '璁惧灞ュ巻', + visible: false, + spinning: false, + dataSource: [], + url: { + list: '/eam/equipmentHistoryLog/list' + }, + pageConfig: { + pageNo: 1, + pageSize: 10, + totalPage: 0 + }, + drawerBodyElement: null, + isNoMoreData: false + } + }, + methods: { + getEquipmentResumeByApi(pageNo = 1) { + this.pageConfig.pageNo = pageNo + const params = Object.assign({}, this.pageConfig, { equipmentId: this.currentTableRowRecord.id }) + const that = this + this.spinning = true + getAction(this.url.list, params) + .then(res => { + if (res.success) { + console.log('res.result', res.result) + if (!this.pageConfig.totalPage) this.pageConfig.totalPage = res.result.pages + res.result.records.forEach(item => that.dataSource.push(item)) + if (this.pageConfig.totalPage !== this.pageConfig.pageNo) { + if (res.result.current === 2) { + if (!this.drawerBodyElement) this.drawerBodyElement = document.querySelector('.ant-drawer-body') + this.drawerBodyElement.addEventListener('scroll', this.handleDrawerBodyScroll) + } + } else this.isNoMoreData = true + } + }) + .finally(() => { + that.spinning = false + }) + }, - onClose() { - this.visible = false + // 鍔犺浇涓嬩竴椤垫暟鎹� + loadNextPageData() { + const current = this.pageConfig.pageNo + 1 + this.getEquipmentResumeByApi(current) + }, + + // 鎶藉眽鍏冪礌婊氬姩浜嬩欢 + handleDrawerBodyScroll() { + if (this.pageConfig.totalPage === this.pageConfig.pageNo) return + const { scrollTop, clientHeight, scrollHeight } = this.drawerBodyElement + if (scrollTop + clientHeight + 1 >= scrollHeight) this.loadNextPageData() + }, + + onClose() { + this.visible = false + this.pageConfig.totalPage = 0 + this.isNoMoreData = false + if (this.drawerBodyElement) this.drawerBodyElement.removeEventListener('scroll', this.handleDrawerBodyScroll) + } } } -} </script> <style scoped lang="less"> -/deep/ .ant-drawer-wrapper-body { - overflow: hidden; - display: flex; - flex-direction: column; + /deep/ .ant-drawer-wrapper-body { + overflow: hidden; + display: flex; + flex-direction: column; - ::-webkit-scrollbar { - width: 8px; - height: 8px; - } + ::-webkit-scrollbar { + width: 8px; + height: 8px; + } - .ant-drawer-body { - flex: 1; - overflow: auto; + .ant-drawer-body { + flex: 1; + overflow: auto; + } } -} </style> \ No newline at end of file diff --git a/src/views/eam/maintenance/EamInspectionOrderList.vue b/src/views/eam/maintenance/EamInspectionOrderList.vue index a7000e3..bc708f8 100644 --- a/src/views/eam/maintenance/EamInspectionOrderList.vue +++ b/src/views/eam/maintenance/EamInspectionOrderList.vue @@ -1,39 +1,33 @@ <template> <a-card :bordered="false"> <!-- 鏌ヨ鍖哄煙 --> - <div class="table-page-search-wrapper"> + <div class="table-page-search-wrapper" v-if="isDisplayOperation"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="宸ュ崟鍙�"> <a-input placeholder="璇疯緭鍏ュ伐鍗曞彿" v-model="queryParam.orderNum"></a-input> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="璁惧ID"> - <a-input placeholder="璇疯緭鍏ヨ澶嘔D" v-model="queryParam.equipmentId"></a-input> + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁惧缂栧彿"> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="queryParam.equipmentId"></lx-search-equipment-select> </a-form-item> </a-col> - <template v-if="toggleSearchStatus"> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="鐐规鏃ユ湡"> - <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="queryParam.inspectionDate"></j-date> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="鐐规鏃堕棿"> - <j-date placeholder="璇烽�夋嫨鐐规鏃堕棿" v-model="queryParam.operateTime"></j-date> - </a-form-item> - </a-col> - </template> <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁″垝鐐规鏃ユ湡"> + <a-range-picker v-model="queryParam.inspectionDateRange" @change="onInspectionDateChange" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /> + </a-form-item> + </a-col> + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="鐐规鐘舵��"> + <j-dict-select-tag placeholder="璇烽�夋嫨鐐规鐘舵��" dict-code="inspection_status" v-model="queryParam.inspectionStatus" /> + </a-form-item> + </a-col> + <a-col :xl="4" :lg="7" :md="8" :sm="24"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> - <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> - <a @click="handleToggleSearch" style="margin-left: 8px"> - {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} - <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> - </a> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> </span> </a-col> </a-row> @@ -42,21 +36,30 @@ <!-- 鏌ヨ鍖哄煙-END --> <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <div class="table-operator" v-if="isDisplayOperation"> + <a-button @click="handleAdd" type="primary" icon="plus" v-if="isShowAuth('eam:inspection:add')">鏂板</a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchZf(5)"><a-icon type="snippets"/>浣滃簾</a-menu-item> - <a-menu-item key="2" @click="batchLq(2)"><a-icon type="form"/>棰嗗彇</a-menu-item> + <a-menu-item key="1" v-if="isShowAuth('eam:inspection:abolish')" @click="batchZf('ABOLISH')"> + <a-icon type="snippets"/> + 浣滃簾 + </a-menu-item> + <a-menu-item key="2" v-if="isShowAuth('eam:inspection:collect')" @click="batchLq('UNDER_INSPECTION')"> + <a-icon type="form"/> + 棰嗗彇 + </a-menu-item> </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> </a-dropdown> </div> <!-- table鍖哄煙-begin --> <div> - <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>椤� + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation"> + <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> @@ -74,44 +77,25 @@ class="j-table-force-nowrap" @change="handleTableChange"> - <template slot="htmlSlot" slot-scope="text"> - <div v-html="text"></div> - </template> - <template slot="imgSlot" slot-scope="text,record"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> - <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> - </template> - <template slot="fileSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> - <a-button - v-else - :ghost="true" - type="primary" - icon="download" - size="small" - @click="downloadFile(text)"> - 涓嬭浇 - </a-button> - </template> - <span slot="action" slot-scope="text, record"> - <a v-if="record.inspectionStatus === '1'" @click="handleEdit(record)">缂栬緫</a> + <a @click="handleEdit(record)" v-if="isShowAuth('eam:inspection:edit') && record.inspectionStatus === 'WAIT_INSPECTION'" >缂栬緫</a> - <a-divider v-if="record.inspectionStatus === '1'" type="vertical" /> + <a-divider type="vertical" v-if="isShowAuth('eam:inspection:edit') && record.inspectionStatus === 'WAIT_INSPECTION'" /> - <a-popconfirm v-if="record.inspectionStatus === '1'" title="纭畾棰嗗彇鍚�?" @confirm="() => handleInspection(record.id)"> + <a-popconfirm title="纭畾棰嗗彇鍚�?" v-if="isShowAuth('eam:inspection:collect') && record.inspectionStatus === 'WAIT_INSPECTION'" + @confirm="() => handleInspection(record.id)"> <a>棰嗗彇</a> </a-popconfirm> - <a-divider v-if="record.inspectionStatus === '1'" type="vertical" /> + <a-divider type="vertical" v-if="isShowAuth('eam:inspection:collect') && record.inspectionStatus === 'WAIT_INSPECTION'" /> <a-dropdown> - <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <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 v-if="record.inspectionStatus === '1'" > + <a-menu-item v-if="isShowAuth('eam:inspection:abolish') && record.inspectionStatus === 'WAIT_INSPECTION'"> <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleOrReceive(record.id)"> <a>浣滃簾</a> </a-popconfirm> @@ -119,12 +103,12 @@ </a-menu> </a-dropdown> </span> - </a-table> </div> <eam-inspection-order-modal ref="modalForm" @ok="modalFormOk"></eam-inspection-order-modal> - <EamInspectionOrderModalXq ref="modalFormXq" @ok="modalFormOk"></EamInspectionOrderModalXq> + + <inspection-order-handle ref="modalFormXq" :selectShenpiData="selectInspectionOrderXqData"/> </a-card> </template> @@ -134,276 +118,284 @@ import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import EamInspectionOrderModal from './modules/EamInspectionOrderModal' - import EamInspectionOrderModalXq from './modules/EamInspectionOrderModalXq.vue' import { deleteAction, getAction } from '@api/manage' + import InspectionOrderHandle from '../../flowable/workflow/InspectionOrder/InspectionOrderHandle' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' export default { name: 'EamInspectionOrderList', - mixins:[JeecgListMixin, mixinDevice], + mixins: [JeecgListMixin, mixinDevice], components: { + InspectionOrderHandle, EamInspectionOrderModal, - EamInspectionOrderModalXq + LxSearchEquipmentSelect, }, - data () { + props: { + isDisplayOperation: { + type: Boolean, + default: true + } + }, + data() { return { description: 'eam_inspection_order绠$悊椤甸潰', + disableMixinCreated: true, // 琛ㄥご columns: [ { title: '#', dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 } }, { - title:'宸ュ崟鍙�', - align:"center", + title: '宸ュ崟鍙�', + align: 'center', dataIndex: 'orderNum' }, { - title:'璁惧缂栧彿', - align:"center", - dataIndex: 'equipmentId_dictText' + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode' }, { - title:'鏍囧噯缂栫爜', - align:"center", + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName' + }, + { + title: '鏍囧噯鍚嶇О', + align: 'center', dataIndex: 'standardId_dictText' }, { - title:'鐐规鏃ユ湡', - align:"center", + title: '鐐规鏃ユ湡', + align: 'center', dataIndex: 'inspectionDate', - customRender:function (text) { - return !text?"":(text.length>10?text.substr(0,10):text) + customRender: function(text) { + return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) } }, { - title:'鐐规杩囨湡鏃堕棿', - align:"center", + title: '鐐规杩囨湡鏃ユ湡', + align: 'center', dataIndex: 'expirationTime', - customRender:function (text) { - return !text?"":(text.length>10?text.substr(0,10):text) + customRender: function(text) { + return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) } }, { - title:'鍒涘缓鏂瑰紡', - align:"center", + title: '鍒涘缓鏂瑰紡', + align: 'center', dataIndex: 'creationMethod_dictText' }, { - title:'鐐规鐘舵��', - align:"center", + title: '鐐规鐘舵��', + align: 'center', dataIndex: 'inspectionStatus_dictText' }, { - title:'鐐规鏃堕棿', - align:"center", - dataIndex: 'operateTime', - customRender:function (text) { - return !text?"":(text.length>10?text.substr(0,10):text) - } - }, - { - title:'鐐规浜�', - align:"center", + title: '鐐规浜�', + align: 'center', dataIndex: 'operator_dictText' }, { - title:'鐝粍闀跨‘璁�', - align:"center", - dataIndex: 'confirmUser' + title: '鐐规鏃堕棿', + align: 'center', + dataIndex: 'operateTime', }, { - title:'纭鏃堕棿', - align:"center", + title: '鐝粍闀跨‘璁�', + align: 'center', + dataIndex: 'confirmUser_dictText' + }, + { + title: '纭鏃堕棿', + align: 'center', dataIndex: 'confirmTime', - customRender:function (text) { - return !text?"":(text.length>10?text.substr(0,10):text) - } }, { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' } + title: '纭鎰忚', + align: 'center', + dataIndex: 'confirmComment', } ], url: { - list: "/eam/eamInspectionOrder/list", - cancelInspectionOrder: "/eam/eamInspectionOrder/cancelInspectionOrder", - deleteBatch: "/eam/eamInspectionOrder/deleteBatch", - exportXlsUrl: "/eam/eamInspectionOrder/exportXls", - importExcelUrl: "eam/eamInspectionOrder/importExcel", - receiveInspectionOrder : "eam/eamInspectionOrder/receiveInspectionOrder", - cancelOrReceive: "eam/eamInspectionOrder/cancelOrReceive" + list: '/eam/eamInspectionOrder/list', + cancelInspectionOrder: '/eam/eamInspectionOrder/cancelInspectionOrder', + deleteBatch: '/eam/eamInspectionOrder/deleteBatch', + exportXlsUrl: '/eam/eamInspectionOrder/exportXls', + importExcelUrl: 'eam/eamInspectionOrder/importExcel', + receiveInspectionOrder: 'eam/eamInspectionOrder/receiveInspectionOrder', + cancelOrReceive: 'eam/eamInspectionOrder/cancelOrReceive' }, - dictOptions:{}, - superFieldList:[], + dictOptions: {}, + superFieldList: [], + selectInspectionOrderXqData: {} } }, created() { - this.getSuperFieldList(); + if (!this.isDisplayOperation) { + return + } + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 200, + scopedSlots: { customRender: 'action' } + } + this.columns = [...this.columns, operationColumn] + this.loadData(1) }, computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; - }, + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } }, methods: { - initDictConfig(){ - }, - getSuperFieldList(){ - let fieldList=[]; - fieldList.push({type:'string',value:'orderNum',text:'宸ュ崟鍙�',dictCode:''}) - fieldList.push({type:'string',value:'equipmentId',text:'璁惧ID',dictCode:''}) - fieldList.push({type:'string',value:'standardId',text:'鏍囧噯ID',dictCode:''}) - fieldList.push({type:'date',value:'inspectionDate',text:'鐐规鏃ユ湡'}) - fieldList.push({type:'date',value:'operateTime',text:'鐐规鏃堕棿'}) - fieldList.push({type:'string',value:'operator',text:'鐐规浜�',dictCode:''}) - fieldList.push({type:'date',value:'expirationTime',text:'鐐规杩囨湡鏃堕棿'}) - fieldList.push({type:'string',value:'creationMethod',text:'鍒涘缓鏂瑰紡',dictCode:''}) - fieldList.push({type:'string',value:'inspectionStatus',text:'鐐规鐘舵��',dictCode:''}) - fieldList.push({type:'string',value:'confirmUser',text:'璁惧绠$悊鍛樼‘璁�',dictCode:''}) - fieldList.push({type:'date',value:'confirmTime',text:'纭鏃堕棿'}) - fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) - fieldList.push({type:'string',value:'imageFiles',text:'鐓х墖鏂囦欢ids;id浠ラ�楀彿鍒嗛殧',dictCode:''}) - this.superFieldList = fieldList + initDictConfig() { }, //璇︽儏 handleDetail: function(record) { - this.$refs.modalFormXq.edit(record); - this.$refs.modalFormXq.title = "璇︽儏"; - this.$refs.modalFormXq.disableSubmit = true; + this.selectInspectionOrderXqData = Object.assign({}, record) + 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 }) }, handleInspection(id) { if (!this.url.receiveInspectionOrder) { - this.$message.error("璇疯缃畊rl.receiveInspectionOrder!") + this.$message.error('璇疯缃畊rl.receiveInspectionOrder!') return } - var that = this; + var that = this getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => { if (res.success) { that.$notification.success({ message: '娑堟伅', description: res.message - }); - that.loadData(); + }) + that.loadData() } else { // that.$message.warning(res.message); that.$notification.warning({ message: '娑堟伅', description: res.message - }); + }) } - }); + }) }, - handleOrReceive(id){ + handleOrReceive(id) { if (!this.url.cancelInspectionOrder) { - this.$message.error("璇疯缃畊rl.cancelInspectionOrder!") + this.$message.error('璇疯缃畊rl.cancelInspectionOrder!') return } - var that = this; + var that = this getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => { if (res.success) { that.$notification.success({ message: '娑堟伅', description: res.message - }); - that.loadData(); + }) + that.loadData() } else { // that.$message.warning(res.message); that.$notification.warning({ message: '娑堟伅', description: res.message - }); + }) } - }); + }) }, - batchZf(type){ + batchZf(type) { if (this.selectedRowKeys.length <= 0) { this.$notification.warning({ - message:'娑堟伅', - description:"璇烽�夋嫨涓�鏉¤褰�" - }); + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) } else { - var ids = ""; + var ids = '' for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ","; + ids += this.selectedRowKeys[a] + ',' } - var that = this; + var that = this this.$confirm({ - title: "纭浣滃簾", - content: "鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟鐐规鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?", - onOk: function () { - that.loading = true; - getAction(that.url.cancelOrReceive, {ids: ids,type:type}).then((res) => { + title: '纭浣滃簾', + content: '鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟鐐规鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?', + onOk: function() { + that.loading = true + getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => { if (res.success) { that.$notification.success({ - message:'娑堟伅', - description:res.message - }); - that.loadData(); - that.onClearSelected(); + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() } else { // that.$message.warning(res.message); that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { - that.loading = false; - }); + that.loading = false + }) } - }); + }) } }, - batchLq(type){ + batchLq(type) { if (this.selectedRowKeys.length <= 0) { this.$notification.warning({ - message:'娑堟伅', - description:"璇烽�夋嫨涓�鏉¤褰�" - }); + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) } else { - var ids = ""; + var ids = '' for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ","; + ids += this.selectedRowKeys[a] + ',' } - var that = this; + var that = this this.$confirm({ - title: "纭棰嗗彇", - content: "鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟鐐规鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?", - onOk: function () { - that.loading = true; - getAction(that.url.cancelOrReceive, {ids: ids,type:type}).then((res) => { + title: '纭棰嗗彇', + content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟鐐规鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?', + onOk: function() { + that.loading = true + getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => { if (res.success) { that.$notification.success({ - message:'娑堟伅', - description:res.message - }); - that.loadData(); - that.onClearSelected(); + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() } else { // that.$message.warning(res.message); that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { - that.loading = false; - }); + that.loading = false + }) } - }); + }) } }, + onInspectionDateChange: function(value, dateString) { + this.queryParam.inspectionDateBegin = dateString[0] + this.queryParam.inspectionDateEnd = dateString[1] + }, } } </script> diff --git a/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue b/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue index 39ccbf6..2b5c30b 100644 --- a/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue +++ b/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue @@ -2,7 +2,7 @@ <a-card :bordered="false"> <!-- 鏌ヨ鍖哄煙 --> - <div class="table-page-search-wrapper"> + <div class="table-page-search-wrapper" v-if="isDisplayOperation"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> <a-col :xl="4" :lg="7" :md="8" :sm="24"> @@ -12,17 +12,20 @@ </a-col> <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="璁惧缂栧彿"> - <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="queryParam.equipmentId"></lx-search-equipment-select> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" + v-model="queryParam.equipmentId"></lx-search-equipment-select> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="璁″垝淇濆吇鏃ユ湡"> - <a-range-picker v-model="queryParam.maintenanceDateRange" @change="onMaintenanceDateChange" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /> + <a-range-picker v-model="queryParam.maintenanceDateRange" @change="onMaintenanceDateChange" + format="YYYY-MM-DD" value-format="YYYY-MM-DD"/> </a-form-item> </a-col> <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="淇濆吇鐘舵��"> - <j-dict-select-tag placeholder="璇烽�夋嫨淇濆吇鐘舵��" dict-code="week_maintenance_status" v-model="queryParam.maintenanceStatus" /> + <j-dict-select-tag placeholder="璇烽�夋嫨淇濆吇鐘舵��" dict-code="week_maintenance_status" + v-model="queryParam.maintenanceStatus"/> </a-form-item> </a-col> <a-col :xl="4" :lg="7" :md="8" :sm="24"> @@ -37,28 +40,28 @@ </div> <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <div class="table-operator" v-if="isDisplayOperation"> + <a-button @click="handleAdd" type="primary" icon="plus" v-if="isShowAuth('eam:weekMaintenance:add')">鏂板</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 key="1" @click="handlerBatchAbolish" v-if="isShowAuth('eam:weekMaintenance:abolish')"> + <a-icon type="delete"/> 浣滃簾 </a-menu-item> - <a-menu-item key="1" @click="handlerBatchCollect"> - <a-icon type="delete" /> + <a-menu-item key="2" @click="handlerBatchCollect" v-if="isShowAuth('eam:weekMaintenance:collect')"> + <a-icon type="form"/> 棰嗗彇 </a-menu-item> </a-menu> <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 - <a-icon type="down" /> + <a-icon type="down"/> </a-button> </a-dropdown> </div> <!-- table鍖哄煙-begin --> <div> - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation"> <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> @@ -74,268 +77,411 @@ :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" + :scroll="{x:'max-content'}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> <span slot="action" slot-scope="text, record"> - <a v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE'" @click="handleEdit(record)">缂栬緫</a> - <a-divider type="vertical" /> + <template v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE' && isShowAuth('eam:weekMaintenance:edit')"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical"/> + + <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handlerCollect(record.id)"> + <a>棰嗗彇</a> + </a-popconfirm> + + <a-divider type="vertical"/> + <a-dropdown> - <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a> <a-menu slot="overlay"> - <a-menu-item v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE'"> - <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handlerCollect(record.id)"> - <a>棰嗗彇</a> - </a-popconfirm> - </a-menu-item> - <a-menu-item v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE'"> + <a-menu-item> <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handlerAbolish(record.id)"> <a>浣滃簾</a> </a-popconfirm> </a-menu-item> - <a-menu-item > + <a-menu-item> <a @click="handleDetail(record)">璇︽儏</a> </a-menu-item> </a-menu> </a-dropdown> - </span> + </template> + <template v-else> + <a @click="handleDetail(record)">璇︽儏</a> + </template> + </span> </a-table> </div> <!-- table鍖哄煙-end --> <!-- 琛ㄥ崟鍖哄煙 --> <eamWeekMaintenanceOrder-modal ref="modalForm" @ok="modalFormOk"></eamWeekMaintenanceOrder-modal> + <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal" + :selectShenpiData="selectWeekMaintenanceData"></week-maintenance-approval-modal> </a-card> </template> <script> -import '@/assets/less/TableExpand.less' -import EamWeekMaintenanceOrderModal from './modules/EamWeekMaintenanceOrderModal' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' -import { deleteAction, getAction } from '@api/manage' + import '@/assets/less/TableExpand.less' + import EamWeekMaintenanceOrderModal from './modules/EamWeekMaintenanceOrderModal' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import { deleteAction, getAction } from '@api/manage' + import WeekMaintenanceApprovalModal from '@views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal' -export default { - name: 'EamWeekMaintenanceOrderList', - mixins: [JeecgListMixin], - components: { - LxSearchEquipmentSelect, - EamWeekMaintenanceOrderModal - }, - data() { - return { - description: '鍛ㄤ繚宸ュ崟绠$悊椤甸潰', - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: 'center', - customRender: function(t, r, index) { - return parseInt(index) + 1 + export default { + name: 'EamWeekMaintenanceOrderList', + mixins: [JeecgListMixin], + components: { + LxSearchEquipmentSelect, + EamWeekMaintenanceOrderModal, + WeekMaintenanceApprovalModal + }, + props: { + isDisplayOperation: { + type: Boolean, + default: true + } + }, + data() { + return { + description: '鍛ㄤ繚宸ュ崟绠$悊椤甸潰', + disableMixinCreated: true, + selectWeekMaintenanceData: {}, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + fixed: 'left', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '宸ュ崟鍙�', + align: 'center', + dataIndex: 'orderNum', + fixed: 'left', + width: 60 + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode', + fixed: 'left', + width: 60 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + fixed: 'left', + width: 60 + }, + { + title: '鏍囧噯鍚嶇О', + align: 'center', + dataIndex: 'standardId_dictText', + width: 100 + }, + { + title: '璁″垝淇濆吇鏃ユ湡', + align: 'center', + dataIndex: 'maintenanceDate', + width: 60 + }, + { + title: '瀹為檯寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'actualStartTime', + width: 60 + }, + { + title: '瀹為檯缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'actualEndTime', + width: 60 + }, + { + title: '淇濆吇浜�', + align: 'center', + dataIndex: 'operator_dictText', + width: 60 + }, + { + title: '淇濆吇鐘舵��', + align: 'center', + dataIndex: 'maintenanceStatus_dictText', + width: 60 + }, + { + title: '鍒涘缓鏂瑰紡', + align: 'center', + dataIndex: 'creationMethod_dictText', + width: 60 + }, + { + title: '纭浜�', + align: 'center', + dataIndex: 'confirmUser_dictText', + width: 60 + }, + { + title: '纭鏃堕棿', + align: 'center', + dataIndex: 'confirmTime', + width: 60 + }, + { + title: '纭鎰忚', + align: 'center', + dataIndex: 'confirmComment', + width: 60 + }, + { + title: '鍒濋獙鏀朵汉', + align: 'center', + dataIndex: 'initialAcceptanceUser_dictText', + width: 60 + }, + { + title: '鍒濋獙鏀舵椂闂�', + align: 'center', + dataIndex: 'initialAcceptanceTime', + width: 60 + }, + { + title: '鍒濋獙鏀舵剰瑙�', + align: 'center', + dataIndex: 'initialAcceptanceComment', + width: 60 + }, + { + title: '缁堥獙鏀朵汉', + align: 'center', + dataIndex: 'finalAcceptanceUser_dictText', + width: 60 + }, + { + title: '缁堥獙鏀舵椂闂�', + align: 'center', + dataIndex: 'finalAcceptanceTime', + width: 60 + }, + { + title: '缁堥獙鏀舵剰瑙�', + align: 'center', + dataIndex: 'finalAcceptanceComment', + width: 60 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark', + width: 60 } - }, - { - title: '宸ュ崟鍙�', - align: 'center', - dataIndex: 'orderNum' - }, - { - title: '璁惧缂栧彿', - align: 'center', - dataIndex: 'equipmentCode' - }, - { - title: '璁惧鍚嶇О', - align: 'center', - dataIndex: 'equipmentName' - }, - { - title: '鏍囧噯鍚嶇О', - align: 'center', - dataIndex: 'standardId_dictText' - }, - { - title: '璁″垝淇濆吇鏃ユ湡', - align: 'center', - dataIndex: 'maintenanceDate' - }, - { - title: '瀹為檯寮�濮嬫椂闂�', - align: 'center', - dataIndex: 'actualStartTime' - }, - { - title: '瀹為檯缁撴潫鏃堕棿', - align: 'center', - dataIndex: 'actualEndTime' - }, - { - title: '淇濆吇浜�', - align: 'center', - dataIndex: 'operator_dictText' - }, - { - title: '淇濆吇鐘舵��', - align: 'center', - dataIndex: 'maintenanceStatus_dictText' - }, - { - title: '鍒涘缓鏂瑰紡', - align: 'center', - dataIndex: 'creationMethod_dictText' - }, - { - title: '纭浜�', - align: 'center', - dataIndex: 'confirmUser_dictText' - }, - { - title: '纭鏃堕棿', - align: 'center', - dataIndex: 'confirmTime' - }, - { - title: '淇濆吇鍥剧墖', - align: 'center', - dataIndex: 'imageFiles' - }, - { - title: '澶囨敞', - align: 'center', - dataIndex: 'remark', - editable: true, - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align: 'center', - scopedSlots: { customRender: 'action' } + // { + // title: '鎿嶄綔', + // dataIndex: 'action', + // align: 'center', + // fixed: 'right', + // width: 100, + // scopedSlots: { customRender: 'action' } + // } + ], + url: { + list: '/eam/weekMaintenanceOrder/list', + abolish: '/eam/weekMaintenanceOrder/abolish', + abolishBatch: '/eam/weekMaintenanceOrder/abolishBatch', + collect: '/eam/weekMaintenanceOrder/collect', + collectBatch: '/eam/weekMaintenanceOrder/collectBatch' } - ], - url: { - list: '/eam/weekMaintenanceOrder/list', - abolish: '/eam/weekMaintenanceOrder/abolish', - abolishBatch: '/eam/weekMaintenanceOrder/abolishBatch', - collect: '/eam/weekMaintenanceOrder/collect', } - } - }, - computed: {}, - methods: { - onMaintenanceDateChange: function(value, dateString) { - this.queryParam.maintenanceDateBegin = dateString[0] - this.queryParam.maintenanceDateEnd = dateString[1] }, - handlerAbolish(id) { - if(!this.url.abolish){ - this.$message.error("璇疯缃畊rl.abolish灞炴��!") + created() { + if (!this.isDisplayOperation) { return } - var that = this; - deleteAction(that.url.abolish, {id: id}).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(1) - // that.$message.success(res.message); - that.$notification.success({ - message:'娑堟伅', - description:res.message - }); - that.loadData(); - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); - } - }); - }, - handlerBatchAbolish() { - if(!this.url.abolishBatch){ - this.$message.error("璇疯缃畊rl.abolishBatch灞炴��!") - return + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 200, + scopedSlots: { customRender: 'action' } } - 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] + ","; + this.columns = [...this.columns, operationColumn] + this.loadData(1) + }, + computed: {}, + methods: { + onMaintenanceDateChange: function(value, dateString) { + this.queryParam.maintenanceDateBegin = dateString[0] + this.queryParam.maintenanceDateEnd = dateString[1] + }, + handlerAbolish(id) { + if (!this.url.abolish) { + this.$message.error('璇疯缃畊rl.abolish灞炴��!') + return } - var that = this; - this.$confirm({ - title: "纭浣滃簾", - content: "鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?", - onOk: function () { - that.loading = true; - deleteAction(that.url.abolishBatch, {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; - }); + var that = this + deleteAction(that.url.abolish, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) } - }); - } - }, - //鍗曚釜棰嗗彇 - handlerCollect(id) { - if(!this.url.collect){ - this.$message.error("璇疯缃畊rl.collect灞炴��!") - return - } - var that = this; - getAction(that.url.collect, {id: id}).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(1) - // that.$message.success(res.message); - that.$notification.success({ - message:'娑堟伅', - description:res.message - }); - that.loadData(); - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + }) + }, + handlerBatchAbolish() { + if (!this.url.abolishBatch) { + this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') + return } - }); - }, - //鎵归噺棰嗗彇 - handlerBatchCollect(){ - + 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.abolishBatch, { 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 + }) + } + }) + } + }, + //鍗曚釜棰嗗彇 + handlerCollect(id) { + if (!this.url.collect) { + this.$message.error('璇疯缃畊rl.collect灞炴��!') + return + } + let that = this + getAction(that.url.collect, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + //鎵归噺棰嗗彇 + handlerBatchCollect() { + if (!this.url.collectBatch) { + this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') + return + } + 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.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 + }) + } + }) + } + }, + handleDetail(record) { + this.selectWeekMaintenanceData = Object.assign({}, record) + this.$refs.weekMaintenanceApprovalModal.recordDetail(record) + this.$refs.weekMaintenanceApprovalModal.title = '璇︽儏' + this.$refs.weekMaintenanceApprovalModal.disableSubmit = true + } } } -} </script> <style scoped> -@import '~@assets/less/common.less'; + @import '~@assets/less/common.less'; </style> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamInspectionOrderDetailForm.vue b/src/views/eam/maintenance/modules/EamInspectionOrderDetailForm.vue deleted file mode 100644 index f27ed57..0000000 --- a/src/views/eam/maintenance/modules/EamInspectionOrderDetailForm.vue +++ /dev/null @@ -1,124 +0,0 @@ -<template> - <a-spin :spinning="confirmLoading"> - <j-form-container :disabled="formDisabled"> - <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> - <a-row> - <a-col :span="24"> - <a-form-model-item label="鍒犻櫎鏍囪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> - <a-input-number v-model="model.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="宸ュ崟ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> - <a-input v-model="model.orderId" placeholder="璇疯緭鍏ュ伐鍗旾D" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐐规椤笽D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemId"> - <a-input v-model="model.itemId" placeholder="璇疯緭鍏ョ偣妫�椤笽D" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐐规缁撴灉" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionResult"> - <a-input v-model="model.inspectionResult" placeholder="璇疯緭鍏ョ偣妫�缁撴灉" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="寮傚父鎻忚堪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="exceptionDescription"> - <a-input v-model="model.exceptionDescription" placeholder="璇疯緭鍏ュ紓甯告弿杩�" ></a-input> - </a-form-model-item> - </a-col> - </a-row> - </a-form-model> - </j-form-container> - </a-spin> -</template> - -<script> - - import { httpAction, getAction } from '@/api/manage' - import { validateDuplicateValue } from '@/utils/util' - - export default { - name: 'EamInspectionOrderDetailForm', - components: { - }, - props: { - //琛ㄥ崟绂佺敤 - disabled: { - type: Boolean, - default: false, - required: false - } - }, - data () { - return { - model:{ - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - confirmLoading: false, - validatorRules: { - }, - url: { - add: "/eam/eamInspectionOrderDetail/add", - edit: "/eam/eamInspectionOrderDetail/edit", - queryById: "/eam/eamInspectionOrderDetail/queryById" - } - } - }, - computed: { - formDisabled(){ - return this.disabled - }, - }, - created () { - //澶囦唤model鍘熷鍊� - this.modelDefault = JSON.parse(JSON.stringify(this.model)); - }, - methods: { - add () { - this.edit(this.modelDefault); - }, - edit (record) { - this.model = Object.assign({}, record); - this.visible = true; - }, - submitForm () { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; - } - httpAction(httpurl,this.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - }) - } - - }) - }, - } - } -</script> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamInspectionOrderForm.vue b/src/views/eam/maintenance/modules/EamInspectionOrderForm.vue deleted file mode 100644 index 0cc673a..0000000 --- a/src/views/eam/maintenance/modules/EamInspectionOrderForm.vue +++ /dev/null @@ -1,164 +0,0 @@ -<template> - <a-spin :spinning="confirmLoading"> - <j-form-container :disabled="formDisabled"> - <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> - <a-row> - <a-col :span="24"> - <a-form-model-item label="宸ュ崟鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderNum"> - <a-input v-model="model.orderNum" placeholder="璇疯緭鍏ュ伐鍗曞彿" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="璁惧ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId"> - <a-input v-model="model.equipmentId" placeholder="璇疯緭鍏ヨ澶嘔D" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鏍囧噯ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardId"> - <a-input v-model="model.standardId" placeholder="璇疯緭鍏ユ爣鍑咺D" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐐规鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> - <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="model.inspectionDate" style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐐规鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime"> - <j-date placeholder="璇烽�夋嫨鐐规鏃堕棿" v-model="model.operateTime" style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐐规浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator"> - <a-input v-model="model.operator" placeholder="璇疯緭鍏ョ偣妫�浜�" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐐规杩囨湡鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expirationTime"> - <j-date placeholder="璇烽�夋嫨鐐规杩囨湡鏃堕棿" v-model="model.expirationTime" style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鍒涘缓鏂瑰紡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="creationMethod"> - <a-input v-model="model.creationMethod" placeholder="璇疯緭鍏ュ垱寤烘柟寮�" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐐规鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionStatus"> - <j-dict-select-tag type="list" v-model="model.inspectionStatus" dictCode="" placeholder="璇烽�夋嫨鐐规鐘舵��" /> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="璁惧绠$悊鍛樼‘璁�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmUser"> - <a-input v-model="model.confirmUser" placeholder="璇疯緭鍏ヨ澶囩鐞嗗憳纭" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> - <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> - <a-textarea v-model="model.remark" rows="4" placeholder="璇疯緭鍏ュ娉�" /> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐓х墖鏂囦欢" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="imageFiles"> - <j-image-upload isMultiple v-model="model.imageFiles" ></j-image-upload> - </a-form-model-item> - </a-col> - </a-row> - </a-form-model> - </j-form-container> - </a-spin> -</template> - -<script> - - import { httpAction, getAction } from '@/api/manage' - import { validateDuplicateValue } from '@/utils/util' - - export default { - name: 'EamInspectionOrderForm', - components: { - }, - props: { - //琛ㄥ崟绂佺敤 - disabled: { - type: Boolean, - default: false, - required: false - } - }, - data () { - return { - model:{ - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - confirmLoading: false, - validatorRules: { - }, - url: { - add: "/eam/eamInspectionOrder/add", - edit: "/eam/eamInspectionOrder/edit", - queryById: "/eam/eamInspectionOrder/queryById" - } - } - }, - computed: { - formDisabled(){ - return this.disabled - }, - }, - created () { - //澶囦唤model鍘熷鍊� - this.modelDefault = JSON.parse(JSON.stringify(this.model)); - }, - methods: { - add () { - this.edit(this.modelDefault); - }, - edit (record) { - this.model = Object.assign({}, record); - this.visible = true; - }, - submitForm () { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; - } - httpAction(httpurl,this.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - }) - } - - }) - }, - } - } -</script> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue b/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue index 4c49a93..61258e3 100644 --- a/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue +++ b/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue @@ -5,80 +5,70 @@ :visible="visible" :confirmLoading="confirmLoading" switchFullscreen + centered + :mask-closable="false" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> - <a-spin :spinning="confirmLoading"> - <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-spin :spinning="spinning"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-row :gutter="24"> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled /> + <a-form-model-item prop="standardCode" label="宸ュ崟鍙�"> + <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" v-model="model.orderNum" readOnly/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿"> + <a-form-model-item prop="equipmentId" label="璁惧缂栧彿"> <MaintenanceEquipmentSelect placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" - :maintenanceCategory="maintenanceCategory" :disabled="editable" - @autocompleteForm="autocompleteForm"></MaintenanceEquipmentSelect> + :maintenanceCategory="maintenanceCategory" :disabled="disabled" + @autocompleteForm="autocompleteForm"/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗗悕绉�" disabled v-model="model.standardName" /> + <a-form-model-item prop="standardName" label="鏍囧噯鍚嶇О"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.standardName"/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="鏍囧噯缂栫爜"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗙紪鐮�" disabled v-model="model.standardCode" /> + <a-form-model-item prop="standardCode" label="鏍囧噯缂栫爜"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.standardCode"/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> - <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%" /> + <a-form-model-item label="淇濆吇鍛ㄦ湡"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" readOnly/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="鐐规浜�"> - <j-dict-select-tag v-model="model.operator" placeholder="璇烽�夋嫨鐢ㄦ埛" dictCode="sys_user,realname,username,username!='admin' order by create_time"/> + <a-form-model-item prop="operator" label="鐐规浜�"> + <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨鐐规浜�" :disabled="!model.equipmentId" + :dictOptions="maintenanceOperatorOptions"/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> <a-col :span="8"> - <a-form-model-item label="鐐规鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> - <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="model.inspectionDate" @change="expirationTimeFrom(model.inspectionDate)" style="width: 100%" /> + <a-form-model-item label="鐐规鏃ユ湡" prop="inspectionDate"> + <j-date :placeholder="!model.maintenancePeriod?'璇峰~鍐欎繚鍏诲懆鏈�':'璇烽�夋嫨鐐规鏃ユ湡'" v-model="model.inspectionDate" + :disabled="!model.maintenancePeriod" + @change="expirationTimeFrom(model.inspectionDate)" style="width: 100%"/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item label="鐐规杩囨湡鏃堕棿" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime"> - <j-date placeholder="璇烽�夋嫨鐐规杩囨湡鏃堕棿" v-model="model.expirationTime" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="8"> - <a-form-model-item - label="鐓х墖鏂囦欢" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - prop="imageFiles"> - <lx-upload :returnUrl="false" - :multiple="false" - v-model="model.imageFiles" - biz="EamMaintenanceStandard"> - </lx-upload> + <a-form-model-item label="鐐规杩囨湡鏃堕棿"> + <j-date placeholder="閫夋嫨鐐规鏃ユ湡鍚庤嚜鍔ㄥ甫鍑�" v-model="model.expirationTime" disabled style="width: 100%"/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> <a-col :span="24"> - <a-form-model-item label="澶囨敞" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark"> - <a-textarea v-model="model.remark" rows="3" placeholder="璇疯緭鍏ュ娉�" /> + <a-form-model-item label="澶囨敞" :labelCol="{span:2}" :wrapperCol="{span:21}" prop="remark"> + <a-textarea v-model="model.remark" rows="3" placeholder="璇疯緭鍏ュ娉�"/> </a-form-model-item> </a-col> </a-row> @@ -95,7 +85,7 @@ :loading="detail.loading" :dataSource="detail.dataSource" :columns="detail.columns" - style="margin-top: 8px;" /> + style="margin-top: 8px;"/> </a-row> </a-form-model> </a-spin> @@ -103,215 +93,271 @@ </template> <script> -import { getAction, httpAction } from '@/api/manage' -import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' -import { JVXETypes } from '@/components/jeecg/JVxeTable' -import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' -import moment from 'dayjs' + import { getAction, httpAction } from '@/api/manage' + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' + import { JVXETypes } from '@/components/jeecg/JVxeTable' + import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' + import moment from 'dayjs' -export default { - name: 'EamMaintenanceStandardModal', - mixins: [JVxeTableModelMixin], - components: { - MaintenanceEquipmentSelect - }, - data() { - return { - title: '鎿嶄綔', - visible: false, - model: {}, - editable: false, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - }, - confirmLoading: false, - validatorRules: { - standardName: [ - { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�!' } - ], - maintenanceCategory: [ - { required: true, message: '璇烽�夋嫨淇濆吇鍒嗙被!' } - ], - initialDate: [ - { required: true, message: '璇烽�夋嫨鍒濆鏃ユ湡!' } - ], - maintenancePeriod: [ - { required: true, message: '璇疯緭鍏ヤ繚鍏诲懆鏈燂紝鍗曚綅锛氬ぉ!' } - ], - equipmentId: [ - { required: true, message: '璇烽�夋嫨璁惧!' } - ], - }, - url: { - add: '/eam/eamInspectionOrder/add', - edit: '/eam/eamInspectionOrder/edit', - detail: '/eam/eamMaintenanceStandardDetail/queryList', - detailOrder: '/eam/eamInspectionOrderDetail/queryList' - }, - maintenanceCategory: 'POINT_INSPECTION', - standardId:"", - standardType:false, - detail: { - loading: false, - dataSource: [], - columns: [ - { - title: '搴忓彿', - key: 'itemCode', - type: JVXETypes.inputNumber, - width: '10%', - align:"center", - validateRules: [ - {required : true, unique: true, message: '搴忓彿涓嶈兘閲嶅'} - ] - }, - { - title: '淇濆吇椤�', - key: 'itemName', - type: JVXETypes.textarea, - width: '20%', - align:"center", - validateRules: [ - {required : true, message: '淇濆吇椤逛笉鑳戒负绌猴紒'} - ] - }, - { - title: '淇濆吇瑕佹眰', - key: 'itemDemand', - type: JVXETypes.textarea, - width: '30%', - align:"center", - validateRules: [ - {required : true, message: "淇濆吇瑕佹眰涓嶈兘涓虹┖锛�"} - ] - }, - ] - } - } - }, - created() { - }, - methods: { - add() { - this.model = {} - this.detail.dataSource = []; - this.visible = true - this.editable = false - this.standardType=false; + export default { + name: 'EamMaintenanceStandardModal', + mixins: [JVxeTableModelMixin], + components: { + MaintenanceEquipmentSelect }, - edit(record) { - console.log(record) - this.model = Object.assign({}, record) - this.standardId=record.standardId - this.standardType=true; - this.visible = true - this.editable = true - this.detail.dataSource = [] - if (record && record.referenceFile) { - let obj = JSON.parse(record.referenceFile) - this.model.fileList = [obj] - } else { - this.model.fieldList = [] - } - this.loadDetailOrder(record.id) - }, - close() { - this.$emit('close') - this.visible = false - this.$refs.form.clearValidate() - }, - async handleOk() { - const that = this - let errMap = await that.$refs.editableDetailTable.validateTable() - if (errMap) { - this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') - return - } - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - let tableData = that.$refs.editableDetailTable.getTableData() - let removeData = that.$refs.editableDetailTable.getDeleteData() - that.model.tableDetailList = [...tableData] - that.model.removeDetailList = [...removeData] - - that.confirmLoading = true - let httpurl = '' - let method = '' - if (!this.model.id) { - httpurl += this.url.add - method = 'post' - } else { - httpurl += this.url.edit - method = 'put' - } - this.model.standardId=this.standardId - httpAction(httpurl, this.model, method).then((res) => { - if (res.success) { - that.$message.success(res.message) - that.$emit('ok') - that.close() - } else { - that.$message.warning(res.message) + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 15 } + }, + confirmLoading: false, + spinning: false, + disabled: false, + validatorRules: { + // standardName: [ + // { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�!' } + // ], + inspectionDate: [ + { required: true, message: '璇烽�夋嫨鐐规鏃ユ湡!' } + ], + // maintenancePeriod: [ + // { required: true, message: '璇疯緭鍏ヤ繚鍏诲懆鏈燂紝鍗曚綅锛氬ぉ!' } + // ], + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ] + }, + url: { + add: '/eam/eamInspectionOrder/add', + edit: '/eam/eamInspectionOrder/edit', + detail: '/eam/eamMaintenanceStandardDetail/queryList', + detailOrder: '/eam/eamInspectionOrderDetail/queryList', + userSelect: '/eam/user_select/list' + }, + maintenanceCategory: 'POINT_INSPECTION', + maintenanceOperatorOptions: [], + standardId: '', + standardType: false, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.inputNumber, + width: '10%', + align: 'center', + validateRules: [ + { required: true, unique: true, message: '搴忓彿涓嶈兘閲嶅' } + ] + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.textarea, + width: '20%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇椤逛笉鑳戒负绌猴紒' } + ] + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemand', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇瑕佹眰涓嶈兘涓虹┖锛�' } + ] } - }).finally(() => { - that.confirmLoading = false - }) - } else { - return false + ] } - }) - }, - handleCancel() { - this.close() - }, - autocompleteForm(selectObj) { - this.model.standardName = selectObj.standardName - this.model.maintenancePeriod=selectObj.maintenancePeriod - this.model.standardCode=selectObj.standardCode - if (!this.standardType) { - this.standardId=selectObj.id - this.loadDetail(selectObj.id) } }, - expirationTimeFrom(date) { - //杩囨湡鏃堕棿鏄垵濮嬫椂闂�+淇濆吇鍛ㄦ湡 - if (date && this.model.maintenancePeriod) { - // 杞崲涓烘椂闂存埑瀛楃涓诧紙鎴栨寚瀹氭牸寮忥級 - this.model.expirationTime = moment(date) - .add(this.model.maintenancePeriod, 'days') - .format('YYYY-MM-DD') - } else { - this.model.expirationTime = null; // 娓呯┖鏃犳晥鍊� - } + created() { }, - //鍔犺浇璇︽儏鏁版嵁 - loadDetail(standardId) { - if (standardId) { - getAction(this.url.detail, { standardId: standardId }).then(res => { - if (res.success) { - this.detail.dataSource = [...res.result] - this.standardType=false; + methods: { + add() { + this.model = {} + this.detail.dataSource = [] + this.visible = true + this.disabled = false + this.standardType = false + }, + + edit(record) { + this.model = Object.assign({}, record) + this.standardId = record.standardId + this.disabled = true + this.standardType = true + this.visible = true + this.detail.dataSource = [] + if (record && record.referenceFile) { + let obj = JSON.parse(record.referenceFile) + this.model.fileList = [obj] + } else { + this.model.fieldList = [] + } + this.loadDetailOrder(record.id) + }, + + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) { + this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') + return + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + let tableData = that.$refs.editableDetailTable.getTableData() + let removeData = that.$refs.editableDetailTable.getDeleteData() + that.model.tableDetailList = [...tableData] + that.model.removeDetailList = [...removeData] + + that.confirmLoading = that.spinning = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + this.model.standardId = this.standardId + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = that.spinning = false + }) + } else { + return false } }) - } - }, - loadDetailOrder(orderId){ - if (orderId) { - getAction(this.url.detailOrder, { orderId: orderId }).then(res => { - if (res.success) { - this.detail.dataSource = [...res.result] - } - }) + }, + + autocompleteForm(selectObj) { + this.model.standardName = selectObj.standardName + this.model.maintenancePeriod = selectObj.maintenancePeriod + this.model.standardCode = selectObj.standardCode + // 鑻ュ彇娑堣澶囬�夋嫨鍚庝繚鍏诲懆鏈熶负绌哄垯闇�娓呯┖鐐规鏃ユ湡鍜岀偣妫�杩囨湡鏃堕棿 + if (!this.model.equipmentId) { + delete this.model.inspectionDate + delete this.model.expirationTime + } else { + // 濡傛灉鐐规鏃ユ湡瀛樺湪锛屽垯鍦ㄩ噸鏂伴�夋嫨璁惧鍚庡嵆淇濆吇鍛ㄦ湡鍙兘鍙戠敓鏀瑰彉鍚庨噸鏂拌绠楄繃鏈熸椂闂� + if (this.model.inspectionDate) this.expirationTimeFrom(this.model.inspectionDate) + } + if (!this.standardType) { + console.log('this.standardType', this.standardType) + this.standardId = selectObj.id + this.loadDetail(selectObj.id) + } + this.$nextTick(() => this.loadMaintenanceOperatorList(this.model.equipmentId)) + }, + + expirationTimeFrom(date) { + //杩囨湡鏃堕棿鏄垵濮嬫椂闂�+淇濆吇鍛ㄦ湡 + if (date && this.model.maintenancePeriod) { + // 杞崲涓烘椂闂存埑瀛楃涓诧紙鎴栨寚瀹氭牸寮忥級 + this.model.expirationTime = moment(date) + .add(this.model.maintenancePeriod, 'days') + .format('YYYY-MM-DD') + } else { + this.model.expirationTime = null // 娓呯┖鏃犳晥鍊� + } + }, + + //鍔犺浇璇︽儏鏁版嵁 + loadDetail(standardId) { + this.detail.dataSource = [] + if (standardId) { + console.log('standardId', standardId) + this.spinning = true + getAction(this.url.detail, { standardId: standardId }) + .then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + + loadDetailOrder(orderId) { + if (orderId) { + this.spinning = true + getAction(this.url.detailOrder, { orderId: orderId }) + .then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + + loadMaintenanceOperatorList(equipmentId) { + this.maintenanceOperatorOptions = [] + let params = { positionCode: 'PCR0001' } + if (equipmentId) { + params.equipmentId = equipmentId + } else { + delete this.model.operator + return + } + const that = this + getAction(this.url.userSelect, params) + .then(res => { + if (res.success) { + that.maintenanceOperatorOptions = res.result.map(item => ({ + key: item.id, + value: item.username, + text: item.realname + })) + if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator + } else { + if (that.model.operator) delete that.model.operator + } + }) + .catch(err => { + if (that.model.operator) delete that.model.operator + }) + }, + + handleCancel() { + this.close() + }, + + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() } } } -} </script> <style lang="less" scoped> diff --git a/src/views/eam/maintenance/modules/EamInspectionOrderModalXq.vue b/src/views/eam/maintenance/modules/EamInspectionOrderModalXq.vue deleted file mode 100644 index ab6bebf..0000000 --- a/src/views/eam/maintenance/modules/EamInspectionOrderModalXq.vue +++ /dev/null @@ -1,358 +0,0 @@ -<template> - <j-modal - :title="title" - :width="1200" - :visible="visible" - :confirmLoading="false" - :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" - switchFullscreen - @ok="handleOk" - @cancel="handleCancel" - cancelText="鍏抽棴"> - - <a-spin :spinning="false"> - <a-form-model ref="form" :model="model" :rules="validatorRules"> - <a-row :gutter="24"> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled /> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿"> - <MaintenanceEquipmentSelect placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" - :maintenanceCategory="maintenanceCategory" :disabled="editable" - @autocompleteForm="autocompleteForm"></MaintenanceEquipmentSelect> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗗悕绉�" disabled v-model="model.standardName" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="鏍囧噯缂栫爜"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗙紪鐮�" disabled v-model="model.standardCode" /> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> - <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="鐐规浜�"> - <j-dict-select-tag v-model="model.operator" placeholder="璇烽�夋嫨鐢ㄦ埛" disabled dictCode="sys_user,realname,username,username!='admin' order by create_time"/> - </a-form-model-item> - </a-col> - </a-row> - - <a-row :gutter="24"> - <a-col :span="8"> - <a-form-model-item label="鐐规鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> - <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="model.inspectionDate" disabled @change="expirationTimeFrom(model.inspectionDate)" style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item label="鐐规杩囨湡鏃堕棿" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime"> - <j-date placeholder="璇烽�夋嫨鐐规杩囨湡鏃堕棿" v-model="model.expirationTime" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="8" v-if="model.inspectionStatus === '3' || model.inspectionStatus === '4'"> - <a-form-model-item label="鐐规鏃堕棿" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="operateTime"> - <j-date placeholder="璇烽�夋嫨鐐规鏃堕棿" v-model="model.operateTime" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - </a-row> - - <a-row :gutter="24"> - <a-col :span="8"> - <a-form-model-item label="鐐规鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionStatus"> - <j-dict-select-tag v-model="model.inspectionStatus" placeholder="璇烽�夋嫨鐐规鐘舵��" disabled dictCode="inspection_status"/> - - </a-form-model-item> - </a-col> - <a-col :span="8" v-if="model.inspectionStatus === '4'"> - <a-form-model-item label="鐝粍闀跨‘璁�" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="confirmUser"> - <j-dict-select-tag v-model="model.confirmUser" placeholder="璇烽�夋嫨鐢ㄦ埛" disabled dictCode="sys_user,realname,username,username!='admin' order by create_time"/> - </a-form-model-item> - </a-col> - <a-col :span="8" v-if="model.inspectionStatus === '4'"> - <a-form-model-item label="纭鏃堕棿" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="confirmTime"> - <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="8"> - <a-form-model-item - label="鐓х墖鏂囦欢" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - prop="imageFiles"> - <lx-upload :returnUrl="false" - :multiple="false" - v-model="model.fileList" - biz="EamMaintenanceStandard"> - </lx-upload> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-model-item label="澶囨敞" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark"> - <a-textarea v-model="model.remark" rows="3" placeholder="璇疯緭鍏ュ娉�" disabled/> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <j-vxe-table - ref="editableDetailTable" - :rowNumber="false" - :rowSelection="false" - :bordered="true" - :alwaysEdit="true" - :toolbar="false" - :disabled="true" - keep-source - :height="300" - :loading="detail.loading" - :dataSource="detail.dataSource" - :columns="detail.columns" - style="margin-top: 8px;" /> - </a-row> - </a-form-model> - </a-spin> - </j-modal> -</template> - -<script> -import { getAction, httpAction } from '@/api/manage' -import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' -import { JVXETypes } from '@/components/jeecg/JVxeTable' -import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' -import moment from 'dayjs' - -export default { - name: 'EamMaintenanceStandardModal', - mixins: [JVxeTableModelMixin], - components: { - MaintenanceEquipmentSelect - }, - data() { - return { - title: '鎿嶄綔', - visible: false, - model: {}, - editable: false, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - }, - confirmLoading: false, - validatorRules: { - standardName: [ - { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�!' } - ], - maintenanceCategory: [ - { required: true, message: '璇烽�夋嫨淇濆吇鍒嗙被!' } - ], - initialDate: [ - { required: true, message: '璇烽�夋嫨鍒濆鏃ユ湡!' } - ], - maintenancePeriod: [ - { required: true, message: '璇疯緭鍏ヤ繚鍏诲懆鏈燂紝鍗曚綅锛氬ぉ!' } - ], - equipmentId: [ - { required: true, message: '璇烽�夋嫨璁惧!' } - ], - operator: [ - { required: true, message: '璇烽�夋嫨鐐规浜�!' } - ] - }, - url: { - add: '/eam/eamInspectionOrder/add', - edit: '/eam/eamInspectionOrder/edit', - detail: '/eam/eamMaintenanceStandardDetail/queryList', - detailOrder: '/eam/eamInspectionOrderDetail/queryList' - }, - maintenanceCategory: 'POINT_INSPECTION', - standardId:"", - detail: { - loading: false, - dataSource: [], - columns: [ - { - title: '搴忓彿', - key: 'itemCode', - type: JVXETypes.normal, - width: '10%', - align:"center", - }, - { - title: '淇濆吇椤�', - key: 'itemName', - type: JVXETypes.normal, - width: '20%', - align:"center", - }, - { - title: '淇濆吇瑕佹眰', - key: 'itemDemand', - type: JVXETypes.normal, - width: '30%', - align:"center", - }, - { - title: "鐐规缁撴灉" - ,key: 'inspectionResult' - ,type: JVXETypes.selectSearch - ,dictCode:'eam_inspection_result' - ,width: '20%' - ,align:"center" - }, - { - title: '寮傚父鎻忚堪', - key: 'exceptionDescription', - type: JVXETypes.normal, - width: '30%', - align:"center", - }, - { - title: '寮傚父鏄惁鎶ヤ慨', - key: 'selectSearch', - type: JVXETypes.selectSearch, - dictCode:'yn', - width: '20%', - align:"center", - } - ] - } - } - }, - created() { - }, - methods: { - add() { - this.model = {} - this.detail.dataSource = []; - this.visible = true - this.editable = false - }, - edit(record) { - this.model = Object.assign({}, record) - this.standardId=record.standardId - this.visible = true - this.editable = true - if (record && record.referenceFile) { - let obj = JSON.parse(record.referenceFile) - this.model.fileList = [obj] - } else { - this.model.fieldList = [] - } - this.loadDetailOrder(record.id) - }, - close() { - this.$emit('close') - this.visible = false - this.$refs.form.clearValidate() - }, - async handleOk() { - const that = this - let errMap = await that.$refs.editableDetailTable.validateTable() - if (errMap) { - this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') - return - } - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - let tableData = that.$refs.editableDetailTable.getTableData() - let removeData = that.$refs.editableDetailTable.getDeleteData() - that.model.tableDetailList = [...tableData] - that.model.removeDetailList = [...removeData] - - that.confirmLoading = false - let httpurl = '' - let method = '' - if (!this.model.id) { - httpurl += this.url.add - method = 'post' - } else { - httpurl += this.url.edit - method = 'put' - } - this.model.standardId=this.standardId - httpAction(httpurl, this.model, method).then((res) => { - if (res.success) { - that.$message.success(res.message) - that.$emit('ok') - that.close() - } else { - that.$message.warning(res.message) - } - }).finally(() => { - that.confirmLoading = false - }) - } else { - return false - } - }) - }, - handleCancel() { - this.close() - }, - autocompleteForm(selectObj) { - this.model.standardName = selectObj.standardName - this.model.maintenancePeriod=selectObj.maintenancePeriod - this.model.standardCode=selectObj.standardCode - if (this.standardId===undefined || this.standardId==="") { - this.standardId=selectObj.id - this.loadDetail(selectObj.id) - } - }, - expirationTimeFrom(date) { - //杩囨湡鏃堕棿鏄垵濮嬫椂闂�+淇濆吇鍛ㄦ湡 - if (date && this.model.maintenancePeriod) { - // 杞崲涓烘椂闂存埑瀛楃涓诧紙鎴栨寚瀹氭牸寮忥級 - this.model.expirationTime = moment(date) - .add(this.model.maintenancePeriod, 'days') - .format('YYYY-MM-DD') - } else { - this.model.expirationTime = null; // 娓呯┖鏃犳晥鍊� - } - }, - //鍔犺浇璇︽儏鏁版嵁 - loadDetail(standardId) { - this.detail.dataSource = [] - if (standardId) { - getAction(this.url.detail, { standardId: standardId }).then(res => { - if (res.success) { - this.detail.dataSource = [...res.result] - } - }) - } - }, - loadDetailOrder(orderId){ - this.detail.dataSource = [] - if (orderId) { - getAction(this.url.detailOrder, { orderId: orderId }).then(res => { - if (res.success) { - this.detail.dataSource = [...res.result] - } - }) - } - } - } -} -</script> - -<style lang="less" scoped> - -</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue b/src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue index eb2abe2..4a77dba 100644 --- a/src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue +++ b/src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue @@ -5,70 +5,72 @@ :visible="visible" :confirmLoading="confirmLoading" switchFullscreen + :mask-closable="false" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> - - <a-spin :spinning="confirmLoading"> - <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-spin :spinning="spinning"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-row :gutter="24"> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderNum" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled /> + <a-form-model-item prop="orderNum" label="宸ュ崟鍙�"> + <a-input placeholder="宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栫爜"> + <a-form-model-item prop="equipmentId" label="璁惧缂栫爜"> <maintenance-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" :maintenanceCategory="maintenanceCategory" - @autocompleteForm="autocompleteForm" :disabled="editable"></maintenance-equipment-select> + @autocompleteForm="autocompleteForm" + :disabled="editable"></maintenance-equipment-select> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> - <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.standardName" disabled /> + <a-form-model-item prop="standardName" label="鏍囧噯鍚嶇О"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.standardName" disabled/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceDate" label="淇濆吇鏃ユ湡"> + <a-form-model-item prop="maintenanceDate" label="淇濆吇鏃ユ湡"> <a-date-picker placeholder="璇烽�夋嫨璁″垝淇濆吇鏃ユ湡" v-model="model.maintenanceDate" format="YYYY-MM-DD" - style="width: 100%" /> + style="width: 100%"/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="淇濆吇浜�"> - <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨淇濆吇浜�" - :dictOptions="maintenanceOperatorOptions" /> + <a-form-model-item prop="operator" label="淇濆吇浜�"> + <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨淇濆吇浜�" :disabled="!model.equipmentId" + :dictOptions="maintenanceOperatorOptions"/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> - <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" disabled /> + <a-form-model-item prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" disabled/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="澶囨敞"> - <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" /> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark"/> </a-form-model-item> </a-row> <a-row :gutter="24"> - <j-vxe-table - ref="editableDetailTable" - :rowNumber="true" - :rowSelection="true" - :bordered="true" - :alwaysEdit="true" - :toolbar="true" - :toolbarConfig="detail.toolbarConfig" - keep-source - :height="300" - :loading="detail.loading" - :dataSource="detail.dataSource" - :columns="detail.columns" - style="margin-top: 8px;" /> + <a-spin :spinning="detail.loading"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="true" + :toolbarConfig="detail.toolbarConfig" + keep-source + :height="300" + :dataSource="detail.dataSource" + :columns="detail.columns" + style="margin-top: 8px;"/> + </a-spin> </a-row> </a-form-model> </a-spin> @@ -76,250 +78,266 @@ </template> <script> -import { getAction, httpAction } from '@/api/manage' -import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' -import { JVXETypes } from '@comp/jeecg/JVxeTable' -import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' + import { getAction, httpAction } from '@/api/manage' + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' + import { JVXETypes } from '@comp/jeecg/JVxeTable' + import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' -export default { - name: 'EamWeekMaintenanceOrderModal', - mixins: [JVxeTableModelMixin], - components: { - MaintenanceEquipmentSelect - }, - data() { - return { - title: '鎿嶄綔', - visible: false, - editable: false, - model: {}, - maintenanceCategory: 'WEEK_MAINTENANCE', - maintenanceOperatorOptions: [], - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - }, - labelColLong: { - xs: { span: 24 }, - sm: { span: 2 } - }, - wrapperColLong: { - xs: { span: 24 }, - sm: { span: 21 } - }, - confirmLoading: false, - validatorRules: { - equipmentId: [ - { required: true, message: '璇烽�夋嫨璁惧!' } - ], - maintenanceDate: [ - { required: true, message: '璇烽�夋嫨璁″垝淇濆吇鏃ユ湡!' } - ] - }, - url: { - add: '/eam/weekMaintenanceOrder/add', - edit: '/eam/weekMaintenanceOrder/edit', - standardDetail: '/eam/eamMaintenanceStandardDetail/queryList', - detail: '/eam/weekMaintenanceOrderDetail/queryList', - userSelect: '/eam/user_select/list', - }, - detail: { - loading: false, - dataSource: [], - columns: [ - { - title: 'ID', - key: 'id', - type: JVXETypes.hidden - }, - { - title: 'orderId', - key: 'orderId', - type: JVXETypes.hidden - }, - { - title: '搴忓彿', - key: 'itemCode', - type: JVXETypes.inputNumber, - width: '10%', - align: 'center', - validateRules: [ - { required: true, unique: true, message: '搴忓彿涓嶈兘閲嶅' } - ] - }, - { - title: '淇濆吇椤�', - key: 'itemName', - type: JVXETypes.textarea, - width: '20%', - align: 'center', - validateRules: [ - { required: true, message: '淇濆吇椤逛笉鑳戒负绌猴紒' } - ] - }, - { - title: '瀛愪繚鍏婚」', - key: 'subItemName', - type: JVXETypes.textarea, - width: '25%', - align: 'center' - }, - { - title: '淇濆吇瑕佹眰', - key: 'itemDemand', - type: JVXETypes.textarea, - width: '30%', - align: 'center', - validateRules: [ - { required: true, message: '淇濆吇瑕佹眰涓嶈兘涓虹┖锛�' } - ] - } - ], - toolbarConfig: { - // prefix 鍓嶇紑锛泂uffix 鍚庣紑 - slot: ['prefix', 'suffix'], - // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 - btn: ['add', 'remove', 'clearSelection'] - } - } - } - }, - created() { - }, - methods: { - add() { - //鍒濆鍖栭粯璁ゅ�� - this.model = {} - this.visible = true - this.editable = false - this.detail.dataSource = [] - this.loadMaintenanceOperatorList(); + export default { + name: 'EamWeekMaintenanceOrderModal', + mixins: [JVxeTableModelMixin], + components: { + MaintenanceEquipmentSelect }, - edit(record) { - this.model = Object.assign({}, record) - this.visible = true - this.editable = true - this.detail.dataSource = [] - this.loadDetail(record.id) - }, - close() { - this.$emit('close') - this.visible = false - this.$refs.form.clearValidate() - }, - async handleOk() { - const that = this - let errMap = await that.$refs.editableDetailTable.validateTable() - if (errMap) { - this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') - return - } - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - let tableData = that.$refs.editableDetailTable.getTableData() - let removeData = that.$refs.editableDetailTable.getDeleteData() - that.model.tableDetailList = [...tableData] - that.model.removeDetailList = [...removeData] - - that.confirmLoading = true - let httpurl = '' - let method = '' - if (!this.model.id) { - httpurl += this.url.add - method = 'post' - } else { - httpurl += this.url.edit - method = 'put' - } - httpAction(httpurl, this.model, method).then((res) => { - if (res.success) { - that.$message.success(res.message) - that.$emit('ok') - that.close() - } else { - that.$message.warning(res.message) + data() { + return { + title: '鎿嶄綔', + visible: false, + editable: false, + model: {}, + maintenanceCategory: 'WEEK_MAINTENANCE', + maintenanceOperatorOptions: [], + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 2 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 21 } + }, + confirmLoading: false, + spinning: false, + validatorRules: { + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ], + maintenanceDate: [ + { required: true, message: '璇烽�夋嫨璁″垝淇濆吇鏃ユ湡!' } + ] + }, + url: { + add: '/eam/weekMaintenanceOrder/add', + edit: '/eam/weekMaintenanceOrder/edit', + standardDetail: '/eam/eamMaintenanceStandardDetail/queryList', + detail: '/eam/weekMaintenanceOrderDetail/queryList', + userSelect: '/eam/user_select/list' + }, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: 'orderId', + key: 'orderId', + type: JVXETypes.hidden + }, + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.inputNumber, + width: '10%', + align: 'center', + validateRules: [ + { required: true, unique: true, message: '搴忓彿涓嶈兘閲嶅' } + ] + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.textarea, + width: '20%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇椤逛笉鑳戒负绌猴紒' } + ] + }, + { + title: '瀛愪繚鍏婚」', + key: 'subItemName', + type: JVXETypes.textarea, + width: '25%', + align: 'center' + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemand', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇瑕佹眰涓嶈兘涓虹┖锛�' } + ] } - }).finally(() => { - that.confirmLoading = false - }) - } else { - return false - } - }) - }, - handleCancel() { - this.close() - }, - autocompleteForm(selectObj) { - //鏍囧噯鍚嶇О锛屼繚鍏诲懆鏈熶笉鍒锋柊瑙e喅鍔炴硶 - //鍔炴硶涓� validatorRules equipmentId 杩樻槸鏈夐棶棰� - // const newObj = { - // standardName: selectObj.standardName, - // maintenancePeriod: selectObj.maintenancePeriod, - // standardId : selectObj.id, - // equipmentId: selectObj.equipmentId, - // }; - // this.model = Object.assign({}, newObj, this.model) - //鍔炴硶浜� - this.$set(this.model, 'standardName', selectObj.standardName) - this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) - this.$set(this.model, 'standardId', selectObj.id) - this.$set(this.model, 'equipmentId', selectObj.equipmentId) - // console.log('model', this.model) - if (!this.model.id) { - this.loadStandardDetail(selectObj.id) - } - this.loadMaintenanceOperatorList(this.model.equipmentId); - }, - //鍔犺浇璇︽儏鏁版嵁 - loadStandardDetail(standardId) { - if (standardId) { - getAction(this.url.standardDetail, { standardId: standardId }).then(res => { - if (res.success) { - this.detail.dataSource = res.result.map(item => ({ - itemCode: item.itemCode, - itemName: item.itemName, - subItemName: item.subItemName, - itemDemand: item.itemDemand - })) + ], + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['add', 'remove', 'clearSelection'] } - }) - } - }, - //鏍囧噯閫夋嫨鍙樺寲 - loadDetail(orderId) { - if (orderId) { - getAction(this.url.detail, { orderId: orderId }).then(res => { - if (res.success) { - this.detail.dataSource = [...res.result] - } - }) - } - }, - loadMaintenanceOperatorList(equipmentId) { - this.maintenanceOperatorOptions = [] - let params = { positionCode: 'PCR0001' } - if (equipmentId) { - params.equipmentId = equipmentId - } - getAction(this.url.userSelect, params).then(res => { - if (res.success) { - this.maintenanceOperatorOptions = res.result.map(item => ({ - key: item.id, - value: item.username, - text: item.realname - })) } - }) - } + } + }, + created() { + }, + methods: { + add() { + //鍒濆鍖栭粯璁ゅ�� + this.model = {} + this.visible = true + this.editable = false + this.detail.dataSource = [] + }, + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + this.editable = true + this.detail.dataSource = [] + this.loadDetail(record.id) + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) { + this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') + return + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + let tableData = that.$refs.editableDetailTable.getTableData() + let removeData = that.$refs.editableDetailTable.getDeleteData() + that.model.tableDetailList = [...tableData] + that.model.removeDetailList = [...removeData] + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, + autocompleteForm(selectObj) { + //鏍囧噯鍚嶇О锛屼繚鍏诲懆鏈熶笉鍒锋柊瑙e喅鍔炴硶 + //鍔炴硶涓� validatorRules equipmentId 杩樻槸鏈夐棶棰� + // const newObj = { + // standardName: selectObj.standardName, + // maintenancePeriod: selectObj.maintenancePeriod, + // standardId : selectObj.id, + // equipmentId: selectObj.equipmentId, + // }; + // this.model = Object.assign({}, newObj, this.model) + //鍔炴硶浜� + this.$set(this.model, 'standardName', selectObj.standardName) + this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) + this.$set(this.model, 'standardId', selectObj.id) + this.$set(this.model, 'equipmentId', selectObj.equipmentId) + // console.log('model', this.model) + if (!this.model.equipmentId) delete this.model.operator + if (!this.model.id) { + this.loadStandardDetail(selectObj.id) + } + this.loadMaintenanceOperatorList(this.model.equipmentId) + }, + //鍔犺浇璇︽儏鏁版嵁 + loadStandardDetail(standardId) { + this.detail.dataSource = [] + if (standardId) { + this.spinning = true + getAction(this.url.standardDetail, { standardId: standardId }) + .then(res => { + if (res.success) { + this.detail.dataSource = res.result.map(item => ({ + itemCode: item.itemCode, + itemName: item.itemName, + subItemName: item.subItemName, + itemDemand: item.itemDemand + })) + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + //鏍囧噯閫夋嫨鍙樺寲 + loadDetail(orderId) { + if (orderId) { + getAction(this.url.detail, { orderId: orderId }).then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + } + }, + loadMaintenanceOperatorList(equipmentId) { + this.maintenanceOperatorOptions = [] + let params = { positionCode: 'PCR0001' } + if (equipmentId) { + params.equipmentId = equipmentId + } + else return + const that = this + getAction(this.url.userSelect, params) + .then(res => { + if (res.success) { + that.maintenanceOperatorOptions = res.result.map(item => ({ + key: item.id, + value: item.username, + text: item.realname + })) + if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator + } else { + if (that.model.operator) delete that.model.operator + } + }) + .catch(err => { + if (that.model.operator) delete that.model.operator + }) + } + + } } -} </script> <style lang="less" scoped> diff --git a/src/views/eam/repair/EamRepairOrderList.vue b/src/views/eam/repair/EamRepairOrderList.vue index d905fc3..5d01fd4 100644 --- a/src/views/eam/repair/EamRepairOrderList.vue +++ b/src/views/eam/repair/EamRepairOrderList.vue @@ -45,7 +45,7 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator" v-if="isDisplayOperation"> <a-button @click="handleOpenReceiveFaultModal" type="primary" icon="plus">棰嗗彇</a-button> - <a-button type="primary" icon="download" @click="handleExportXls('缁翠慨宸ュ崟')">瀵煎嚭</a-button> + <!--<a-button type="primary" icon="download" @click="handleExportXls('缁翠慨宸ュ崟')">瀵煎嚭</a-button>--> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> <a-menu-item key="1" @click="batchDel"> @@ -81,34 +81,16 @@ @change="handleTableChange" :scroll="{x:'max-content'}" > - <span slot="action" slot-scope="text, record"> - <a @click="handleOpenApplySparePartsModal(record)">鐢宠澶囦欢</a> - - <a-divider type="vertical"/> - - <a @click="handleOpenRepairCompletedModal(record)">瀹屾垚缁翠慨</a> - - <!--<a @click="handleEdit(record)">缂栬緫</a>--> - - <!--<a-divider 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="() => handleDelete(record.id)">--> - <!--<a>鍒犻櫎</a>--> - <!--</a-popconfirm>--> - <!--</a-menu-item>--> - <!--</a-menu>--> - <!--</a-dropdown>--> + <a @click="handleDetail(record)">璇︽儏</a> </span> - </a-table> </div> <!-- table鍖哄煙-end --> <receive-fault-modal ref="receiveFaultModalRef" @ok="loadData"/> + + <repair-order-approval-modal ref="repairOrderApprovalModal" :selectShenpiData="selectRepairOrderData"/> </a-card> </template> @@ -118,18 +100,20 @@ import ReceiveFaultModal from './modules/EamRepairOrderList/ReceiveFaultModal' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' import LxSearchEquipmentSelect from '../equipment/modules/LxSearchEquipmentSelect' + import RepairOrderApprovalModal from '../../flowable/workflow/repairOrder/RepairOrderApprovalModal' export default { name: 'EamRepairOrderList', mixins: [JeecgListMixin], components: { + RepairOrderApprovalModal, LxSearchEquipmentSelect, ReceiveFaultModal }, - props:{ - isDisplayOperation:{ - type:Boolean, - default:true + props: { + isDisplayOperation: { + type: Boolean, + default: true } }, data() { @@ -167,6 +151,12 @@ width: 100 }, { + title: '缁翠慨璐熻矗浜�', + align: 'center', + dataIndex: 'repairer', + width: 100 + }, + { title: '缁翠慨寮�濮嬫椂闂�', align: 'center', dataIndex: 'actualStartTime', @@ -181,26 +171,20 @@ { title: '鏁呴殰鍘熷洜', align: 'center', - dataIndex: 'faultReason', - width: 150 + dataIndex: 'faultReason' }, { title: '缁翠慨缁撴灉鎻忚堪', align: 'center', - dataIndex: 'repairDescription', - width: 300 - }, - { - title: '缁翠慨鍥剧墖', - align: 'center', - dataIndex: 'imageFiles', - width: 100 - }, - { - title: '缁翠慨璐熻矗浜�', - align: 'center', - dataIndex: 'repairer' - }, + dataIndex: 'repairDescription' + // width: 300 + } + // { + // title: '缁翠慨鍥剧墖', + // align: 'center', + // dataIndex: 'imageFiles', + // width: 100 + // }, // { // title: '鏄惁濮斿', // align: 'center', @@ -233,6 +217,7 @@ // }, ], report_repair_status_list: [], + selectRepairOrderData: {}, url: { list: '/eam/eamRepairOrder/list', delete: '/eam/eamRepairOrder/delete', @@ -255,6 +240,7 @@ title: '鎿嶄綔', dataIndex: 'action', align: 'center', + width: 100, scopedSlots: { customRender: 'action' } } this.columns = [...this.columns, operationColumn] @@ -283,23 +269,19 @@ // 寮�鍚鍙栨晠闅滀繚淇崟寮圭獥 handleOpenReceiveFaultModal() { this.$refs.receiveFaultModalRef.visible = true - this.$refs.receiveFaultModalRef.loadData() }, /** - * 寮�鍚敵璇峰浠跺脊绐� + * 鐐瑰嚮璇︽儏瑙﹀彂 * @param record 琛ㄦ牸琛屼俊鎭� */ - handleOpenApplySparePartsModal(record) { - - }, - - /** - * 寮�鍚畬鎴愮淮淇脊绐� - * @param record 琛ㄦ牸琛屼俊鎭� - */ - handleOpenRepairCompletedModal(record) { - + handleDetail(record) { + this.selectRepairOrderData = Object.assign({}, record) + this.$refs.repairOrderApprovalModal.visible = true + this.$refs.repairOrderApprovalModal.title = '璇︽儏' + this.$refs.repairOrderApprovalModal.disableSubmit = true + this.$refs.repairOrderApprovalModal.getAllApproveData(record) + this.$refs.repairOrderApprovalModal.getBasicInformation({ ...record, dataId: record.id }) } } } diff --git a/src/views/eam/repair/EamReportRepairList.vue b/src/views/eam/repair/EamReportRepairList.vue index fb7d04e..8e41d23 100644 --- a/src/views/eam/repair/EamReportRepairList.vue +++ b/src/views/eam/repair/EamReportRepairList.vue @@ -12,28 +12,18 @@ </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="isDisplayOperation"> - <a-form-item label="鍗曟嵁鐘舵��"> - <a-select placeholder="璇烽�夋嫨鍗曟嵁鐘舵��" v-model="queryParam.reportStatus" allow-clear> + <a-form-item label="鎶ヤ慨鐘舵��"> + <a-select placeholder="璇烽�夋嫨鎶ヤ慨鐘舵��" v-model="queryParam.reportStatus" allow-clear> <a-select-option v-for="item in report_repair_status_list" :key="item.value">{{ item.label }} </a-select-option> </a-select> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="鏁呴殰绠�绉�"> - <!-- <a-select placeholder="璇烽�夋嫨鏁呴殰绠�绉�" v-model="queryParam.faultName" allow-clear>--> - <!-- <a-select-option v-for="item in faultReasonList" :key="item.faultName">--> - <!-- {{ item.faultName }}--> - <!-- </a-select-option>--> - <!-- </a-select>--> - <a-input placeholder="璇疯緭鍏ユ晠闅滅畝绉�" v-model="queryParam.faultName" allow-clear/> + <a-form-item label="鏁呴殰鎻忚堪"> + <a-input placeholder="璇疯緭鍏ユ晠闅滄弿杩�" v-model="queryParam.faultDescription" allow-clear/> </a-form-item> </a-col> - <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> - <!-- <a-form-item label="鏁呴殰鍒嗙被">--> - <!-- <a-input placeholder="璇疯緭鍏ユ晠闅滃垎绫�" v-model="queryParam.faultType"></a-input>--> - <!-- </a-form-item>--> - <!-- </a-col>--> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="鏁呴殰鏃堕棿"> <a-range-picker showTime v-model="faultTimeRange" value-format="YYYY-MM-DD HH:mm:ss" @@ -69,11 +59,11 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator" v-if="isDisplayOperation"> <a-button @click="handleAdd" type="primary" icon="plus">鏂板</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> - </a-upload> + <!--<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>--> + <!--</a-upload>--> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> <a-menu-item key="1" @click="batchDel"> @@ -105,7 +95,7 @@ :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:isDisplayOperation?'checkbox':'radio'}" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:isDisplayOperation?'checkbox':'radio',getCheckboxProps:getCheckboxProps}" @change="handleTableChange"> <template slot="imageFiles" slot-scope="text, record" v-if="text"> @@ -184,7 +174,7 @@ width: 200 }, { - title: '鐘舵��', + title: '鎶ヤ慨鐘舵��', align: 'center', dataIndex: 'reportStatus_dictText', width: 100 @@ -255,8 +245,7 @@ created() { this.initDictData('breakdown_flag') this.initDictData('report_repair_status') - this.getFaultReasonListByApi() - if (!this.isDisplayOperation) this.queryParam = Object.assign({} ,this.propsQueryParam) + if (!this.isDisplayOperation) this.queryParam = Object.assign({}, this.propsQueryParam) else { const operationColumn = { title: '鎿嶄綔', @@ -266,6 +255,7 @@ width: 150 } this.columns = [...this.columns, operationColumn] + this.getFaultReasonListByApi() } this.loadData(1) }, @@ -317,6 +307,14 @@ this.$refs.imagesPreviewModalRef.visible = true }, + getCheckboxProps(record) { + return { + props: { + disabled: record.reportStatus !== 'WAIT_REPAIR' + } + } + }, + searchReset() { if (this.isDisplayOperation) this.queryParam = {} else this.queryParam = Object.assign({}, this.propsQueryParam) diff --git a/src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue b/src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue index 2bd4d7a..9c015c4 100644 --- a/src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue +++ b/src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue @@ -23,7 +23,7 @@ components: { EamReportRepairList }, data() { return { - title: '鏁呴殰淇濅慨鍗�', + title: '鏁呴殰鎶ヤ慨鍗�', visible: false, model: {}, labelCol: { @@ -52,34 +52,36 @@ created() { }, methods: { - loadData() { - this.$nextTick(() => { - // this.$refs.reportRepairListRef.queryParam.reportStatus = 'WAIT_REPAIR' - // this.$refs.reportRepairListRef.loadData(1) - }) + handleOk() { + const reportId = this.$refs.reportRepairListRef.selectedRowKeys[0] + if (!reportId) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨闇�棰嗗彇鐨勬晠闅滄姤淇崟' + }) + return + } + this.confirmLoading = true + httpAction(this.url.receiveFault, { reportId }, 'post') + .then((res) => { + if (res.success) { + this.$message.success(res.message) + this.$emit('ok') + } else { + this.$message.warning(res.message) + } + }) + .finally(() => { + this.confirmLoading = false + this.close() + }) + }, + handleCancel() { + this.close() }, close() { this.$emit('close') this.visible = false - }, - handleOk() { - console.log('rowKey', this.$refs.reportRepairListRef.selectedRowKeys[0]) - const reportId = this.$refs.reportRepairListRef.selectedRowKeys[0] - this.confirmLoading = true - httpAction(this.url.receiveFault, { reportId }, 'post').then((res) => { - if (res.success) { - this.$message.success(res.message) - this.$emit('ok') - } else { - this.$message.warning(res.message) - } - }).finally(() => { - this.confirmLoading = false - this.close() - }) - }, - handleCancel() { - this.close() } } } diff --git a/src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue b/src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue index 8fe5db7..038abde 100644 --- a/src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue +++ b/src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue @@ -35,10 +35,13 @@ <a-input placeholder="璇疯緭鍏ユ晠闅滃垎绫�" v-model="model.faultType_dictText" readOnly/> </a-form-model-item> </a-col> + </a-row> - <a-col :span="12"> - <a-form-model-item label="鏁呴殰鎻忚堪"> - <a-input placeholder="璇疯緭鍏ユ晠闅滄弿杩�" v-model="model.faultDescription" readOnly/> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鏁呴殰鎻忚堪" prop="faultDescription" :labelCol="labelColLong" + :wrapperCol="wrapperColLong"> + <a-textarea placeholder="璇疯緭鍏ユ晠闅滄弿杩�" v-model="model.faultDescription"/> </a-form-model-item> </a-col> </a-row> @@ -47,7 +50,8 @@ <a-col :span="12"> <a-form-model-item prop="faultStartTime" label="鏁呴殰寮�濮嬫椂闂�"> <a-date-picker showTime placeholder="璇烽�夋嫨鏁呴殰寮�濮嬫椂闂�" v-model="model.faultStartTime" - :allow-clear="false" value-format="YYYY-MM-DD HH:mm:ss"/> + :allow-clear="false" value-format="YYYY-MM-DD HH:mm:ss" :disabledDate="disabledDate" + :disabledTime="disabledTime"/> </a-form-model-item> </a-col> @@ -63,7 +67,8 @@ <a-row> <a-col :span="24"> <a-form-model-item prop="imageFiles" label="鎶ヤ慨鍥剧墖" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <j-image-upload v-model="model.imageFiles" :is-multiple="true" :number="3"/> + <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3" + v-model="model.imageFilesResult"/> </a-form-model-item> </a-col> </a-row> @@ -75,132 +80,172 @@ </a-form-model-item> </a-col> </a-row> - <!-- <a-form-model-item prop="reportStatus" label="鎶ヤ慨鐘舵��">--> - <!-- <a-input placeholder="璇疯緭鍏ユ姤淇姸鎬�" v-model="model.reportStatus" />--> - <!-- </a-form-model-item>--> - </a-form-model> </a-spin> </j-modal> </template> <script> -import { httpAction } from '@/api/manage' -import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import { httpAction } from '@/api/manage' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import moment from 'moment' -export default { - name: 'EamReportRepairModal', - components: { LxSearchEquipmentSelect }, - props: { - breakdownFlagList: { - type: Array + export default { + name: 'EamReportRepairModal', + components: { LxSearchEquipmentSelect }, + props: { + breakdownFlagList: { + type: Array + }, + faultReasonList: { + type: Array + } }, - faultReasonList: { - type: Array - } - }, - data() { - return { - title: '鎿嶄綔', - visible: false, - model: {}, - labelCol: { - xs: { span: 24 }, - sm: { span: 8 } + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 12 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 4 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 18 } + }, + confirmLoading: false, + validatorRules: { + faultStartTime: [ + { required: true, message: '璇烽�夋嫨鏁呴殰寮�濮嬫椂闂�' } + ], + breakdownFlag: [ + { required: true, message: '璇烽�夋嫨鏄惁鍋滄満' } + ], + equipmentId: [ + { required: true, message: '璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储' } + ], + faultName: [ + { required: true, message: '璇烽�夋嫨鏁呴殰绠�绉�' } + ], + faultDescription: [ + { required: true, message: '璇疯緭鍏ユ晠闅滄弿杩�' } + ] + }, + url: { + add: '/eam/eamReportRepair/add', + edit: '/eam/eamReportRepair/edit' + } + } + }, + methods: { + add() { + //鍒濆鍖栭粯璁ゅ�� + this.edit({ + faultDescription: '', + breakdownFlag: this.breakdownFlagList.find(item => item.label === '鍚�').value + }) }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 12 } + + edit(record) { + this.model = Object.assign({}, record, { imageFilesResult: record.imageFiles && this.isJSON(record.imageFiles) ? JSON.parse(record.imageFiles) : null }) + this.visible = true }, - labelColLong: { - xs: { span: 24 }, - sm: { span: 4 } + + handleFaultNameChange(value) { + const faultReasonItem = this.faultReasonList.find(item => item.faultName === value) + this.model.faultType = faultReasonItem.faultCategory + this.model.faultType_dictText = faultReasonItem.faultCategory_dictText + this.model.faultDescription = faultReasonItem.faultDescription }, - wrapperColLong: { - xs: { span: 24 }, - sm: { span: 18 } + + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + console.log('model---------------', that.model) + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpUrl = '' + let method = '' + if (!this.model.id) { + httpUrl += this.url.add + method = 'post' + } else { + httpUrl += this.url.edit + method = 'put' + } + httpAction(httpUrl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } else { + return false + } + }) }, - confirmLoading: false, - validatorRules: { - faultStartTime: [ - { required: true, message: '璇烽�夋嫨鏁呴殰寮�濮嬫椂闂�' } - ], - breakdownFlag: [ - { required: true, message: '璇烽�夋嫨鏄惁鍋滄満' } - ], - equipmentId: [ - { required: true, message: '璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储' } - ], - faultName: [ - { required: true, message: '璇烽�夋嫨鏁呴殰绠�绉�' } - ] + + // 鍒ゆ柇鏄笉鏄疛SON瀛楃涓� + isJSON(str) { + try { + JSON.parse(str) + return true // 濡傛灉杩欓噷娌℃湁鎶涘嚭寮傚父锛岃鏄庢槸JSON鏍煎紡鐨勫瓧绗︿覆 + } catch (e) { + return false // 濡傛灉鎶涘嚭寮傚父锛岃鏄庝笉鏄疛SON鏍煎紡鐨勫瓧绗︿覆 + } }, - url: { - add: '/eam/eamReportRepair/add', - edit: '/eam/eamReportRepair/edit' + + /** + * 绂佺敤鏃ユ湡 + * @params current 琚鐢ㄧ殑鏃堕棿 + */ + disabledDate(current) { + // Can not select days after today + return current > moment().endOf('day') + }, + + /** + * 绂佺敤鏃ユ湡涓殑鏃堕棿 + * @returns {{disabledHours: (function(): Array), disabledMinutes: (function(): Array)}} + */ + disabledTime() { + function range(start, end) { + const result = [] + for (let i = start; i < end; i++) { + result.push(i) + } + return result + } + + return { + disabledHours: () => range(moment().hour() + 1, 24), + disabledMinutes: () => range(moment().minute() + 1, 60), + disabledSeconds: () => range(moment().second() + 1, 60) + } + }, + + close() { + this.$emit('close') + this.visible = false + if (this.$refs.form) this.$refs.form.clearValidate() } } - }, - created() { - }, - methods: { - add() { - //鍒濆鍖栭粯璁ゅ�� - this.edit({ - breakdownFlag: this.breakdownFlagList.find(item => item.label === '鏄�').value - }) - }, - edit(record) { - this.model = Object.assign({}, record) - this.visible = true - }, - handleFaultNameChange(value) { - const faultReasonItem = this.faultReasonList.find(item => item.faultName === value) - this.model.faultType = faultReasonItem.faultCategory - this.model.faultType_dictText = faultReasonItem.faultCategory_dictText - this.model.faultDescription = faultReasonItem.faultDescription - }, - - handleOk() { - const that = this - // 瑙﹀彂琛ㄥ崟楠岃瘉 - console.log('model---------------', that.model) - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true - let httpUrl = '' - let method = '' - if (!this.model.id) { - httpUrl += this.url.add - method = 'post' - } else { - httpUrl += this.url.edit - method = 'put' - } - httpAction(httpUrl, this.model, method).then((res) => { - if (res.success) { - that.$message.success(res.message) - that.$emit('ok') - } else { - that.$message.warning(res.message) - } - }).finally(() => { - that.confirmLoading = false - that.close() - }) - } else { - return false - } - }) - }, - - close() { - this.$emit('close') - this.visible = false - this.$refs.form.clearValidate() - } } -} </script> <style lang="less" scoped> diff --git a/src/views/eam/repair/modules/ImagesPreviewModal.vue b/src/views/eam/repair/modules/ImagesPreviewModal.vue index 9b017db..37ac715 100644 --- a/src/views/eam/repair/modules/ImagesPreviewModal.vue +++ b/src/views/eam/repair/modules/ImagesPreviewModal.vue @@ -1,56 +1,61 @@ <template> <a-modal title="棰勮" :visible="visible" width="50%" :footer="null" @cancel="visible=false"> - <template v-for="(item,index) in imageListUrl.split(',')"> + <template v-for="(item,index) in imageUrlArr"> <img :src="getImageItemUrl(item)" width="100%;"/> - <a-divider v-if="index+1<imageListUrl.split(',').length" style="margin:20px 0;background-color: #000"></a-divider> + <a-divider v-if="index+1<imageUrlArr.length" style="margin:20px 0;background-color: #000"></a-divider> </template> </a-modal> </template> <script> -export default { - name: 'ImagesPreviewModal', - props: { - imageListUrl: { - type: String, - default: '' - } - }, - data() { - return { - visible: false - } - }, - methods: { - getImageItemUrl(imageItemSrcSuffix) { - return `${window._CONFIG['domianURL']}/${imageItemSrcSuffix}` + export default { + name: 'ImagesPreviewModal', + props: { + imageListUrl: { + type: String, + default: '' + } + }, + data() { + return { + visible: false + } + }, + computed: { + imageUrlArr() { + return JSON.parse(this.imageListUrl).map(item => item.filePath) + } + }, + methods: { + getImageItemUrl(imageItemSrcSuffix) { + return `${window._CONFIG['domianURL']}/${imageItemSrcSuffix}` + } } } -} </script> <style scoped lang="less"> -/deep/ .ant-modal { - height: 70%; - overflow: hidden; - - .ant-modal-content { - height: 100%; - display: flex; - flex-direction: column; + /deep/ .ant-modal { + height: 70%; overflow: hidden; - ::-webkit-scrollbar { - width: 8px; - height: 8px; - } + .ant-modal-content { + height: 100%; + display: flex; + flex-direction: column; + overflow: hidden; - .ant-modal-body { - flex: 1; - overflow: auto; + ::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + .ant-modal-body { + flex: 1; + overflow: auto; + } } } -} </style> \ No newline at end of file diff --git a/src/views/flowable/workflow/FlowCompleted.vue b/src/views/flowable/workflow/FlowCompleted.vue index 78c8c5b..deccb7b 100644 --- a/src/views/flowable/workflow/FlowCompleted.vue +++ b/src/views/flowable/workflow/FlowCompleted.vue @@ -11,20 +11,23 @@ <a-row :gutter="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="娴佺▼鍒嗙被"> - <j-dict-select-tag placeholder="璇烽�夋嫨娴佺▼鍒嗙被" v-model="queryParam.category" dictCode="flow_type"></j-dict-select-tag> + <j-dict-select-tag placeholder="璇烽�夋嫨娴佺▼鍒嗙被" v-model="queryParam.category" + dictCode="flow_type"></j-dict-select-tag> </a-form-item> </a-col> - <a-col :xl="10" :lg="11" :md="12" :sm="24"> - <a-form-item label="鎿嶄綔鏃堕棿"> - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" class="query-group-cust" v-model="queryParam.startTime"></j-date> - <span class="query-group-split-cust"></span> - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" class="query-group-cust" v-model="queryParam.endTime"></j-date> - </a-form-item> - </a-col> + <a-col :xl="10" :lg="11" :md="12" :sm="24"> + <a-form-item label="鎿嶄綔鏃堕棿"> + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" class="query-group-cust" + v-model="queryParam.startTime"></j-date> + <span class="query-group-split-cust"></span> + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" class="query-group-cust" + v-model="queryParam.endTime"></j-date> + </a-form-item> + </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> - <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a-button @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> </span> </a-col> </a-row> @@ -48,17 +51,13 @@ class="j-table-force-nowrap" @change="handleTableChange"> - <!-- 瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず--> - <span slot="description" slot-scope="text"> - <j-ellipsis :value="text" :length="25" /> - </span> - <template slot="htmlSlot" slot-scope="text"> <div v-html="text"></div> </template> <template slot="imgSlot" slot-scope="text"> <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> - <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + <img v-else :src="getImgView(text)" height="25px" alt="" + style="max-width:80px;font-size: 12px;font-style: italic;"/> </template> <template slot="fileSlot" slot-scope="text"> <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> @@ -80,168 +79,183 @@ </a-table> </div> - <AssignFileStreamXq ref="modalFormApproval" :selectShenpiData="selectShenpiData"></AssignFileStreamXq> + <inspection-order-handle ref="modalFormInspectionOrderXq" :selectShenpiData="selectInspectionOrderXqData"/> - <DispatchFileXq ref="modalFormDispatchFileXq" :selectShenpiData="selectDispatchFileXqData"></DispatchFileXq> + <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal" :selectShenpiData="selectWeekMaintenanceData"/> - <InspectionOrderXq ref="modalFormInspectionOrderXq" :selectShenpiData="selectInspectionOrderXqData"></InspectionOrderXq> - + <repair-order-approval-modal ref="repairOrderApprovalModal" :selectShenpiData="selectRepairOrderData"/> </a-card> </template> <script> -import '@/assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import JDictSelectTag from '@/components/dict/JDictSelectTag.vue' -import AssignFileStreamXq from '@views/flowable/workflow/assignFileStream/AssignFileStreamXq.vue' -import DispatchFileXq from '@views/flowable/workflow/dispatchFile/DispatchFileXq.vue' -import InspectionOrderXq from '@views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue' + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import JDictSelectTag from '@/components/dict/JDictSelectTag.vue' + import InspectionOrderHandle from './InspectionOrder/InspectionOrderHandle' + import WeekMaintenanceApprovalModal from './weekMaintenance/WeekMaintenanceApprovalModal' + import RepairOrderApprovalModal from './repairOrder/RepairOrderApprovalModal' -export default { - name: 'NcDeviceCharactersList', - mixins:[JeecgListMixin, mixinDevice], - components: { - InspectionOrderXq, - DispatchFileXq, - AssignFileStreamXq: AssignFileStreamXq, - JDictSelectTag, - }, - data () { - return { - description: '宸ヤ綔娴�-宸插姙', - // 琛ㄥご - columns: [ - { - title: '搴忓彿', - dataIndex: '', - key:'rowIndex', - width:200, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title: '娴佺▼鍒嗙被', - align: "center", - dataIndex: 'category_dictText', - width: 200, - }, - { - title: '娴佺▼鍚嶇О', - align: "center", - dataIndex: 'procDefName', - width: 200, - }, - { - title:'娴佺▼涓氬姟绠�瑕佹弿杩�', - align:"center", - dataIndex: 'description', - width:300, - scopedSlots: {customRender: 'description'}, - }, - { - title: '娴佺▼鍙戣捣浜哄悕绉�', - align: "center", - dataIndex: 'startUserName', - width: 250, - }, - { - title: '浠诲姟鍚嶇О', - align: "center", - dataIndex: 'taskName', - width:250 - }, - { - title: '鎿嶄綔鏃堕棿', - align: "center", - dataIndex: 'finishTime', - width:300 - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - scopedSlots: { customRender: 'action' }, - align: 'center', - width: 200, - fixed: 'right' - } - ], - url: { - list: "/assign/flow/finishedList", - }, - dictOptions:{}, - selectShenpiData: {}, - selectDispatchFileXqData:{}, - selectInspectionOrderXqData:{} - } - }, - created() { - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + export default { + name: 'NcDeviceCharactersList', + mixins: [JeecgListMixin, mixinDevice], + components: { + RepairOrderApprovalModal, + WeekMaintenanceApprovalModal, + InspectionOrderHandle, + JDictSelectTag }, - }, - methods: { - handelDetial(item, index) { - console.log('鐐瑰嚮浜嗚鎯�') - console.log('item----->', item) - console.log('index----->', index) - let approcesstype = this.splitAprocessType(item.category) - console.log('approcesstype--->', approcesstype) - switch (approcesstype) { - case 'drApproval': - this.handDrDetial(item) - break - case 'ggApproval': - this.handDispatchFileDetial(item) - break - case 'sbdjApproval': - this.handInspectionOrder(item) - break - default: - alert('娌℃壘鍒拌娴佺▼') + data() { + return { + description: '璁惧鐗规畩瀛楃绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '搴忓彿', + dataIndex: '', + key: 'rowIndex', + width: 200, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '娴佺▼鍒嗙被', + align: 'center', + dataIndex: 'category_dictText', + width: 200 + }, + { + title: '娴佺▼鍚嶇О', + align: 'center', + dataIndex: 'procDefName', + width: 200 + }, + { + title: '娴佺▼涓氬姟绠�瑕佹弿杩�', + align: 'center', + dataIndex: 'description', + width: 300 + }, + { + title: '娴佺▼鍙戣捣浜哄悕绉�', + align: 'center', + dataIndex: 'startUserName', + width: 250 + }, + { + title: '浠诲姟鍚嶇О', + align: 'center', + dataIndex: 'taskName', + width: 250 + }, + { + title: '鎿嶄綔鏃堕棿', + align: 'center', + dataIndex: 'finishTime', + width: 300 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 200, + fixed: 'right' + } + ], + url: { + list: '/assign/flow/finishedList' + }, + dictOptions: {}, + selectWeekMaintenanceData: {}, + selectInspectionOrderXqData: {}, + selectRepairOrderData: {} } }, - splitAprocessType(title) { - let parts = title.split('锛�') // 娉ㄦ剰鍐掑彿鏄叏瑙掑瓧绗︼紝浣跨敤瀵瑰簲鐨勫瓧杩涜鍒嗗壊 - let result = parts[0] - return result + created() { }, - handDrDetial(item) { - this.selectShenpiData = item - this.selectShenpiData.assignee_dictText=item.todoUsers_dictText - this.selectShenpiData.procInstId=item.procInsId - this.selectShenpiData.title=item.description - this.$refs.modalFormApproval.clearTableSource() - this.$refs.modalFormApproval.getAllApproveData(item) + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } }, - handDispatchFileDetial(item){ - console.log('item----->', item) - this.selectDispatchFileXqData = item - this.selectDispatchFileXqData.assignee_dictText=item.todoUsers_dictText - this.selectDispatchFileXqData.procInstId=item.procInsId - this.selectDispatchFileXqData.processInstanceId=item.procInsId - this.selectDispatchFileXqData.title=item.description - this.$refs.modalFormDispatchFileXq.clearTableSource() - this.$refs.modalFormDispatchFileXq.getAllApproveData(item) - }, - handInspectionOrder(item) { - console.log('item----->', item) - this.selectInspectionOrderXqData = item - this.selectInspectionOrderXqData.assignee_dictText=item.todoUsers_dictText - this.selectInspectionOrderXqData.procInstId=item.procInsId - this.selectInspectionOrderXqData.processInstanceId=item.procInsId - this.selectInspectionOrderXqData.title=item.description - this.$refs.modalFormInspectionOrderXq.clearTableSource() - this.$refs.modalFormInspectionOrderXq.getAllApproveData(item) + methods: { + handelDetial(item, index) { + console.log('鐐瑰嚮浜嗚鎯�') + console.log('item----->', item) + console.log('index----->', index) + let approcesstype = this.splitAprocessType(item.category) + console.log('approcesstype--->', approcesstype) + switch (approcesstype) { + case 'sbdjApproval': + this.handInspectionOrder(item) + break + case 'WEEK_MAINTENANCE': + this.handleWeekMaintenance(item) + break + case 'eam_repair': + this.handleRepairOrder(item) + break + default: + alert('娌℃壘鍒拌娴佺▼') + } + }, + + splitAprocessType(title) { + let parts = title.split('锛�') // 娉ㄦ剰鍐掑彿鏄叏瑙掑瓧绗︼紝浣跨敤瀵瑰簲鐨勫瓧杩涜鍒嗗壊 + let result = parts[0] + return result + }, + + handleWeekMaintenance(record) { + this.selectWeekMaintenanceData = Object.assign({}, record) + this.$refs.weekMaintenanceApprovalModal.handleDetail(record) + this.$refs.weekMaintenanceApprovalModal.title = '璇︽儏' + this.$refs.weekMaintenanceApprovalModal.disableSubmit = true + }, + + handInspectionOrder(record) { + console.log('record----->', record) + this.selectInspectionOrderXqData = Object.assign({}, record) + const { todoUsers_dictText, procInsId, description, taskName } = this.selectInspectionOrderXqData + this.selectInspectionOrderXqData.assignee_dictText = todoUsers_dictText + this.selectInspectionOrderXqData.procInstId = procInsId + this.selectInspectionOrderXqData.processInstanceId = procInsId + this.selectInspectionOrderXqData.title = description + this.$refs.modalFormInspectionOrderXq.visible = true + this.$refs.modalFormInspectionOrderXq.title = taskName + this.$refs.modalFormInspectionOrderXq.disableSubmit = true + this.$refs.modalFormInspectionOrderXq.getAllApproveData({ + ...record, + procInstId: procInsId, + processInstanceId: procInsId + }) + this.$refs.modalFormInspectionOrderXq.getBasicInformation(record) + }, + + /** + * 鐐瑰嚮璁惧缁翠慨鍒嗙被娴佺▼璇︽儏鏃惰Е鍙� + * @param record + */ + handleRepairOrder(record) { + this.selectRepairOrderData = Object.assign({}, record) + const { procInsId, taskName } = this.selectRepairOrderData + this.$refs.repairOrderApprovalModal.visible = true + this.$refs.repairOrderApprovalModal.disableSubmit = true + this.$refs.repairOrderApprovalModal.title = taskName + this.$refs.modalFormInspectionOrderXq.getAllApproveData({ + ...record, + procInstId: procInsId, + processInstanceId: procInsId + }) + this.$refs.repairOrderApprovalModal.getBasicInformation(record) + } } } -} </script> <style scoped> -@import '~@assets/less/common.less'; + @import '~@assets/less/common.less'; </style> \ No newline at end of file diff --git a/src/views/flowable/workflow/FlowLedger.vue b/src/views/flowable/workflow/FlowLedger.vue index 172ee82..ace988b 100644 --- a/src/views/flowable/workflow/FlowLedger.vue +++ b/src/views/flowable/workflow/FlowLedger.vue @@ -9,11 +9,12 @@ <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="娴佺▼鍒嗙被"> - <j-dict-select-tag placeholder="璇烽�夋嫨娴佺▼鍒嗙被" v-model="queryParam.category" dictCode="flow_type"></j-dict-select-tag> - </a-form-item> - </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="娴佺▼鍒嗙被"> + <j-dict-select-tag placeholder="璇烽�夋嫨娴佺▼鍒嗙被" v-model="queryParam.category" + dictCode="flow_type"></j-dict-select-tag> + </a-form-item> + </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="娴佺▼鍚嶇О"> <a-input placeholder="璇疯緭鍏ユ祦绋嬪悕绉�" v-model="queryParam.flowName"></a-input> @@ -24,17 +25,19 @@ <a-input placeholder="璇疯緭鍏ョ畝瑕佹弿杩�" v-model="queryParam.title"></a-input> </a-form-item> </a-col> - <a-col :xl="10" :lg="11" :md="12" :sm="24"> - <a-form-item label="鎿嶄綔鏃堕棿"> - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" class="query-group-cust" v-model="queryParam.startTime"></j-date> - <span class="query-group-split-cust"></span> - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" class="query-group-cust" v-model="queryParam.endTime"></j-date> - </a-form-item> - </a-col> + <a-col :xl="10" :lg="11" :md="12" :sm="24"> + <a-form-item label="鎿嶄綔鏃堕棿"> + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" class="query-group-cust" + v-model="queryParam.startTime"></j-date> + <span class="query-group-split-cust"></span> + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" class="query-group-cust" + v-model="queryParam.endTime"></j-date> + </a-form-item> + </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> - <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a-button @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> </span> </a-col> </a-row> @@ -59,219 +62,162 @@ :loading="loading" class="j-table-force-nowrap" @change="handleTableChange"> - - <!-- 瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず--> - <span slot="description" slot-scope="text"> - <j-ellipsis :value="text" :length="25" /> - </span> - - <template slot="htmlSlot" slot-scope="text"> - <div v-html="text"></div> - </template> - <template slot="imgSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> - <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> - </template> - <template slot="fileSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> - <a-button - v-else - :ghost="true" - type="primary" - icon="download" - size="small" - @click="downloadFile(text)"> - 涓嬭浇 - </a-button> - </template> - <span slot="action" slot-scope="text, record"> - <a @click="handelDetial(record,text)">璇︽儏</a> + <a @click="handelDetail(record,text)">璇︽儏</a> </span> - </a-table> </div> - <AssignFileStreamXq ref="modalFormApproval" :selectShenpiData="selectShenpiData"></AssignFileStreamXq> - <DispatchFileXq ref="modalFormDispatchFileXq" :selectShenpiData="selectDispatchFileXqData"></DispatchFileXq> - - <InspectionOrderXq ref="modalFormInspectionOrderXq" :selectShenpiData="selectInspectionOrderXqData"></InspectionOrderXq> + <inspection-order-handle ref="modalFormInspectionOrderXq" :selectShenpiData="selectInspectionOrderXqData"/> </a-card> </template> <script> -import '@/assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import JDictSelectTag from '@/components/dict/JDictSelectTag.vue' -import AssignFileStreamXq from '@views/flowable/workflow/assignFileStream/AssignFileStreamXq.vue' -import DispatchFileXq from '@views/flowable/workflow/dispatchFile/DispatchFileXq.vue' -import InspectionOrderXq from '@views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue' + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import JDictSelectTag from '@/components/dict/JDictSelectTag.vue' + import InspectionOrderHandle from './InspectionOrder/InspectionOrderHandle' -export default { - name: 'NcDeviceCharactersList', - mixins:[JeecgListMixin, mixinDevice], - components: { - DispatchFileXq, - AssignFileStreamXq: AssignFileStreamXq, - JDictSelectTag, - InspectionOrderXq - }, - data () { - return { - description: '璁惧鐗规畩瀛楃绠$悊椤甸潰', - // 琛ㄥご - columns: [ - { - title: '搴忓彿', - dataIndex: '', - key:'rowIndex', - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title: '娴佺▼鍒嗙被', - align: "center", - dataIndex: 'category_dictText', - width: 200, - }, - { - title:'娴佺▼鍚嶇О', - align:"center", - dataIndex: 'flowName' - }, - { - title:'娴佺▼涓氬姟绠�瑕佹弿杩�', - align:"center", - dataIndex: 'description', - width: '30%', - scopedSlots: {customRender: 'description'}, - }, - { - title:'鐢宠浜�', - align:"center", - dataIndex: 'proposer_dictText' - }, - { - title: '鍓嶉┍鑺傜偣', - align: "center", - dataIndex: 'preNode', - }, - { - title:'褰撳墠鑺傜偣', - align:"center", - dataIndex: 'taskName' - }, - { - title:'娴佺▼寮�濮嬫椂闂�', - align:"center", - dataIndex: 'startTime' - }, - { - title:'娴佺▼缁撴潫鏃堕棿', - align:"center", - dataIndex: 'endTime' - }, - { - title:'澶勭悊鏃堕暱', - align:"center", - dataIndex: 'duration' - }, - { - title:'褰撳墠浠诲姟浜�', - align:"center", - dataIndex: 'todoUsers_dictText' - }, - { - title:'澶勭悊杩囩殑浜�', - align:"center", - dataIndex: 'doneUsers_dictText' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - scopedSlots: { customRender: 'action' }, - align: 'center', - width: 200, - fixed: 'right' - } - ], - url: { - list: "/assign/flow/list", - }, - dictOptions:{}, - selectShenpiData: {}, - selectDispatchFileXqData:{}, - selectInspectionOrderXqData:{} - } - }, - created() { - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + export default { + name: 'FlowLedger', + mixins: [JeecgListMixin, mixinDevice], + components: { + InspectionOrderHandle, + JDictSelectTag }, - }, - methods: { - handelDetial(item, index) { - console.log('鐐瑰嚮浜嗚鎯�') - console.log('item----->', item) - console.log('index----->', index) - let approcesstype = this.splitAprocessType(item.category) - console.log('approcesstype--->', approcesstype) - switch (approcesstype) { - case 'drApproval': - item.description=item.title - this.handDrDetial(item) - break - case 'ggApproval': - item.description=item.title - this.handDispatchFileDetial(item) - break - case 'sbdjApproval': - item.description=item.title - this.handInspectionOrderDetial(item) - break - default: - alert('娌℃壘鍒拌娴佺▼') + data() { + return { + description: '娴佺▼绠$悊', + // 琛ㄥご + columns: [ + { + title: '搴忓彿', + dataIndex: '', + key: 'rowIndex', + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '娴佺▼鍒嗙被', + align: 'center', + dataIndex: 'category_dictText', + width: 200 + }, + { + title: '娴佺▼鍚嶇О', + align: 'center', + dataIndex: 'flowName' + }, + { + title: '娴佺▼涓氬姟绠�瑕佹弿杩�', + align: 'center', + dataIndex: 'title' + }, + { + title: '鐢宠浜�', + align: 'center', + dataIndex: 'proposer_dictText' + }, + { + title: '鍓嶉┍鑺傜偣', + align: 'center', + dataIndex: 'preNode' + }, + { + title: '褰撳墠鑺傜偣', + align: 'center', + dataIndex: 'taskName' + }, + { + title: '娴佺▼寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'startTime' + }, + { + title: '娴佺▼缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'endTime' + }, + { + title: '澶勭悊鏃堕暱', + align: 'center', + dataIndex: 'duration' + }, + { + title: '褰撳墠浠诲姟浜�', + align: 'center', + dataIndex: 'todoUsers_dictText' + }, + { + title: '澶勭悊杩囩殑浜�', + align: 'center', + dataIndex: 'doneUsers_dictText' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 200, + fixed: 'right' + } + ], + url: { + list: '/assign/flow/list' + }, + dictOptions: {}, + selectShenpiData: {}, + selectDispatchFileXqData: {}, + selectInspectionOrderXqData: {} } }, - splitAprocessType(title) { - let parts = title.split('锛�') // 娉ㄦ剰鍐掑彿鏄叏瑙掑瓧绗︼紝浣跨敤瀵瑰簲鐨勫瓧杩涜鍒嗗壊 - let result = parts[0] - return result + created() { }, - handDrDetial(item) { - this.selectShenpiData = item - this.selectShenpiData.assignee_dictText=item.todoUsers_dictText - this.selectShenpiData.createTime=item.startTime - this.selectShenpiData.procInstId=item.processInstanceId - this.$refs.modalFormApproval.clearTableSource() - this.$refs.modalFormApproval.getAllApproveData(item) + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } }, - handDispatchFileDetial(item){ - this.selectDispatchFileXqData = item - this.selectDispatchFileXqData.assignee_dictText=item.todoUsers_dictText - this.selectDispatchFileXqData.createTime=item.startTime - this.selectDispatchFileXqData.procInstId=item.processInstanceId - this.$refs.modalFormDispatchFileXq.clearTableSource() - this.$refs.modalFormDispatchFileXq.getAllApproveData(item) - }, - handInspectionOrderDetial(item){ - this.selectInspectionOrderXqData = item - this.selectInspectionOrderXqData.assignee_dictText=item.todoUsers_dictText - this.selectInspectionOrderXqData.createTime=item.startTime - this.selectInspectionOrderXqData.procInstId=item.processInstanceId - this.$refs.modalFormInspectionOrderXq.clearTableSource() - this.$refs.modalFormInspectionOrderXq.getAllApproveData(item) + methods: { + handelDetail(item, index) { + console.log('鐐瑰嚮浜嗚鎯�') + console.log('item----->', item) + console.log('index----->', index) + let approcesstype = this.splitAprocessType(item.category) + console.log('approcesstype--->', approcesstype) + switch (approcesstype) { + case 'sbdjApproval': + item.description = item.title + this.handInspectionOrderDetail(item) + break + default: + alert('娌℃壘鍒拌娴佺▼') + } + }, + splitAprocessType(title) { + let parts = title.split('锛�') // 娉ㄦ剰鍐掑彿鏄叏瑙掑瓧绗︼紝浣跨敤瀵瑰簲鐨勫瓧杩涜鍒嗗壊 + let result = parts[0] + return result + }, + + handInspectionOrderDetail(item) { + this.selectInspectionOrderXqData = item + this.selectInspectionOrderXqData.assignee_dictText = item.todoUsers_dictText + this.selectInspectionOrderXqData.createTime = item.startTime + this.selectInspectionOrderXqData.procInstId = item.processInstanceId + this.$refs.modalFormInspectionOrderXq.visible = true + this.$refs.modalFormInspectionOrderXq.disableSubmit = true + this.$refs.modalFormInspectionOrderXq.getAllApproveData(item) + this.$refs.modalFormInspectionOrderXq.getBasicInformation(item) + } } } -} </script> <style scoped> -@import '~@assets/less/common.less'; + @import '~@assets/less/common.less'; </style> \ No newline at end of file diff --git a/src/views/flowable/workflow/FlowTodo.vue b/src/views/flowable/workflow/FlowTodo.vue index 6404081..8f8957a 100644 --- a/src/views/flowable/workflow/FlowTodo.vue +++ b/src/views/flowable/workflow/FlowTodo.vue @@ -9,32 +9,47 @@ <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-col :xl="4" :lg="6" :md="8" :sm="24"> <a-form-item label="娴佺▼鍒嗙被"> - <j-dict-select-tag placeholder="璇烽�夋嫨娴佺▼鍒嗙被" v-model="queryParam.category" dictCode="flow_type"></j-dict-select-tag> + <j-dict-select-tag placeholder="璇烽�夋嫨娴佺▼鍒嗙被" v-model="queryParam.category" + dictCode="flow_type"></j-dict-select-tag> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-col :xl="4" :lg="6" :md="8" :sm="24"> <a-form-item label="娴佺▼鍚嶇О"> <a-input placeholder="璇疯緭鍏ユ祦绋嬪悕绉�" v-model="queryParam.flowName"></a-input> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-col :xl="4" :lg="6" :md="8" :sm="24"> + <a-form-item label="褰撳墠鑺傜偣"> + <a-input placeholder="璇疯緭鍏ュ綋鍓嶈妭鐐圭簿纭煡璇�" v-model="queryParam.name"></a-input> + </a-form-item> + </a-col> + <a-col :xl="4" :lg="6" :md="8" :sm="24"> <a-form-item label="绠�瑕佹弿杩�"> <a-input placeholder="璇疯緭鍏ョ畝瑕佹弿杩�" v-model="queryParam.title"></a-input> </a-form-item> </a-col> - <a-col :xl="10" :lg="11" :md="12" :sm="24"> - <a-form-item label="褰撳墠鎿嶄綔鏃堕棿"> - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" class="query-group-cust" v-model="queryParam.startTime"></j-date> - <span class="query-group-split-cust"></span> - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" class="query-group-cust" v-model="queryParam.endTime"></j-date> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <template v-if="toggleSearchStatus"> + <a-col :xl="8" :lg="8" :md="12" :sm="24"> + <a-form-item label="浠诲姟鏃堕棿鑼冨洿"> + <j-date :show-time="false" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" class="query-group-cust" + v-model="queryParam.startTime"></j-date> + <span class="query-group-split-cust"></span> + <j-date :show-time="false" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" class="query-group-cust" + v-model="queryParam.endTime"></j-date> + </a-form-item> + </a-col> + </template> + + <a-col :xl="4" :lg="6" :md="8" :sm="24"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> - <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a-button @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> </span> </a-col> </a-row> @@ -44,19 +59,24 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> - <a-dropdown v-if="selectedRowKeys.length > 0 "> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchHandle"><a-icon type="delete"/>鎵归噺澶勭悊</a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> - </a-dropdown> + <a-dropdown v-if="selectedRowKeys.length > 0 "> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchHandle"> + <a-icon type="delete"/> + 鎵归噺澶勭悊 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown> </div> <!-- table鍖哄煙-begin --> <div> <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>椤� + selectedRowKeys.length }}</a>椤� <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> </div> @@ -65,7 +85,7 @@ bordered size="middle" rowKey="id" - :scroll="{x:'max-content',y:465}" + :scroll="{x:getTableColumnsTotalWidth,y:465}" :columns="columns" :dataSource="dataSource" :pagination="ipagination" @@ -73,268 +93,222 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> - <!-- 瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず--> - <span slot="description" slot-scope="text"> - <j-ellipsis :value="text" :length="25" /> - </span> - - <template slot="htmlSlot" slot-scope="text"> - <div v-html="text"></div> - </template> - <template slot="imgSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> - <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> - </template> - <template slot="fileSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> - <a-button - v-else - :ghost="true" - type="primary" - icon="download" - size="small" - @click="downloadFile(text)"> - 涓嬭浇 - </a-button> - </template> - <span slot="action" slot-scope="text, record"> - <a @click="handelDetial(record,text)">鏌ョ湅璇︽儏</a> + <a @click="handelDetail(record,text)">鎵ц/瀹℃壒</a> </span> </a-table> </div> - <AssignFileStreamHandle ref="modalFormApproval" :selectShenpiData="selectShenpiData" @searchReset="searchReset"></AssignFileStreamHandle> - <DispatchFileHandle ref="modalFormDispatchFileXq" :selectShenpiData="selectDispatchFileXqData" @searchReset="searchReset"></DispatchFileHandle> - <DispatchFileBachHandleStyle ref="modalFormDispatchFileBatch" @searchReset="searchReset" @ok="modalFormOk"></DispatchFileBachHandleStyle> - <InspectionOrderHandle ref="modalFormInspectionOrder" :selectShenpiData="selectInspectionOrderData" @searchReset="searchReset"></InspectionOrderHandle> - <InspectionOrderHandleBzz ref="modalFormInspectionOrderBzz" :selectShenpiData="selectInspectionOrderDataBzz" @searchReset="searchReset"></InspectionOrderHandleBzz> - <week-maintenance-approval-modal ref = "weekMaintenanceApprovalModal" ></week-maintenance-approval-modal> - <repair-order-approval-modal ref="repairOrderApprovalModal" :selectShenpiData="selectRepairOrderData" ></repair-order-approval-modal> + <InspectionOrderHandle ref="modalFormInspectionOrder" :selectShenpiData="selectInspectionOrderData" + @searchReset="searchReset"></InspectionOrderHandle> + <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal" :selectShenpiData="selectWeekMaintenanceData" + @searchReset="searchReset"></week-maintenance-approval-modal> + <repair-order-approval-modal ref="repairOrderApprovalModal" @searchReset="searchReset" + :selectShenpiData="selectRepairOrderData"></repair-order-approval-modal> </a-card> </template> <script> -import '@/assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import JDictSelectTag from '@/components/dict/JDictSelectTag.vue' -import AssignFileStreamHandle from '@views/flowable/workflow/assignFileStream/AssignFileStreamHandle.vue' -import DispatchFileHandle from '@views/flowable/workflow/dispatchFile/DispatchFileHandle.vue' -import DispatchFileBachHandleStyle from '@views/flowable/workflow/dispatchFile/DispatchFileBachHandleStyle#Drawer.vue' -import WeekMaintenanceApprovalModal from '@views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal' -import RepairOrderApprovalModal from '@views/flowable/workflow/repairOrder/RepairOrderApprovalModal' -import InspectionOrderHandle from '@views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue' -import InspectionOrderHandleBzz from '@views/flowable/workflow/InspectionOrder/InspectionOrderHandleBzz.vue' + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import JDictSelectTag from '@/components/dict/JDictSelectTag.vue' + import WeekMaintenanceApprovalModal from '@views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal' + import RepairOrderApprovalModal from '@views/flowable/workflow/repairOrder/RepairOrderApprovalModal' + import InspectionOrderHandle from '@views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue' -import { getAction } from '@api/manage' -export default { - name: 'NcDeviceCharactersList', - mixins:[JeecgListMixin, mixinDevice], - components: { - AssignFileStreamHandle, - JDictSelectTag, - DispatchFileHandle, - DispatchFileBachHandleStyle, - WeekMaintenanceApprovalModal, - RepairOrderApprovalModal, - InspectionOrderHandle, - InspectionOrderHandleBzz, - }, - data () { - return { - description: '宸ヤ綔娴�-鎴戠殑寰呭姙', - // 琛ㄥご - columns: [ - { - title: '搴忓彿', - dataIndex: '', - key:'rowIndex', - width:100, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; + import { getAction } from '@api/manage' + + export default { + name: 'NcDeviceCharactersList', + mixins: [JeecgListMixin, mixinDevice], + components: { + JDictSelectTag, + WeekMaintenanceApprovalModal, + RepairOrderApprovalModal, + InspectionOrderHandle + }, + data() { + return { + description: '宸ヤ綔娴�-鎴戠殑寰呭姙', + // 琛ㄥご + columns: [ + { + title: '搴忓彿', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '娴佺▼鍒嗙被', + align: 'center', + dataIndex: 'category_dictText', + }, + { + title: '娴佺▼鍚嶇О', + align: 'center', + dataIndex: 'flowName', + width: 200 + }, + { + title: '娴佺▼涓氬姟绠�瑕佹弿杩�', + align: 'center', + dataIndex: 'title', + width: 350, + ellipsis: true + + }, + { + title: '涓婁竴姝ュ鐞嗕汉', + align: 'center', + dataIndex: 'preNodeAssignee_dictText', + width: 150 + }, + { + title: '鍓嶉┍鑺傜偣', + align: 'center', + dataIndex: 'preNode', + width: 200 + }, + { + title: '褰撳墠鑺傜偣', + align: 'center', + dataIndex: 'name', + width: 200 + }, + { + title: '褰撳墠鑺傜偣寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'createTime', + width: 200 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 150, + fixed: 'right' } + ], + url: { + list: '/assign/flow/toTaskBySelf', + isSameNode: '/assign/flow/isSameNode' }, - { - title: '娴佺▼鍒嗙被', - align: "center", - dataIndex: 'category_dictText', - width: 200, - }, - { - title: '娴佺▼鍚嶇О', - align: "center", - dataIndex: 'flowName', - width: 200, - }, - { - title:'娴佺▼涓氬姟绠�瑕佹弿杩�', - align:"center", - dataIndex: 'description', - width:300, - scopedSlots: {customRender: 'description'}, - }, - { - title: '涓婁竴姝ュ鐞嗕汉', - align: "center", - dataIndex: 'preNodeAssignee_dictText', - width:100 - }, - { - title: '鍓嶉┍鑺傜偣', - align: "center", - dataIndex: 'preNode', - width:200 - }, - { - title: '褰撳墠鑺傜偣', - align: "center", - dataIndex: 'name', - width:200 - }, - { - title: '褰撳墠鑺傜偣寮�濮嬫椂闂�', - align: "center", - dataIndex: 'createTime', - width:300 - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - scopedSlots: { customRender: 'action' }, - align: 'center', - width: 200, - fixed: 'right' - } - ], - url: { - list: '/assign/flow/toTaskBySelf', - isSameNode: '/assign/flow/isSameNode' + dictOptions: {}, + selectInspectionOrderData: {}, + selectWeekMaintenanceData: {}, + selectBachData: {}, + selectRepairOrderData: {}, + //涓氬姟淇℃伅ID + dataId: undefined + } + }, + created() { + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` }, - dictOptions:{}, - selectShenpiData: {}, - selectDispatchFileXqData:{}, - selectInspectionOrderData:{}, - selectInspectionOrderDataBzz:{}, - selectBachData:{}, - selectRepairOrderData: {}, - //涓氬姟淇℃伅ID - dataId: undefined, - } - }, - created() { - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; - }, - }, - methods: { - handelDetial(item, index) { - console.log('鐐瑰嚮浜嗚鎯�') - console.log('item----->', item) - console.log('index----->', index) - let approcesstype = this.splitAprocessType(item.category) - console.log('approcesstype--->', approcesstype) - switch (approcesstype) { - case 'drApproval': - this.handDrDetial(item) - break - case 'ggApproval': - this.handDispatchFileDetial(item) - break - case 'sbdjApproval': - this.handInspectionOrder(item) - break - case 'WEEK_MAINTENANCE': - this.handleWeekMaintenance(item) - break - case 'eam_repair': - this.handleRepairOrder(item) - break - default: - alert('娌℃壘鍒拌娴佺▼') + getTableColumnsTotalWidth() { + return this.columns.reduce((total, item) => total + item.width, 0) } }, - splitAprocessType(title) { - let parts = title.split('锛�') // 娉ㄦ剰鍐掑彿鏄叏瑙掑瓧绗︼紝浣跨敤瀵瑰簲鐨勫瓧杩涜鍒嗗壊 - let result = parts[0] - return result - }, - handDrDetial(item) { - this.selectShenpiData = item - this.$refs.modalFormApproval.clearTableSource() - this.$refs.modalFormApproval.getAllApproveData(item) - }, - searchReset() { - this.queryParam = {} - this.loadData(1); - }, - handDispatchFileDetial(item){ - console.log('item----->', item) - this.selectDispatchFileXqData = item - this.$refs.modalFormDispatchFileXq.clearTableSource() - this.$refs.modalFormDispatchFileXq.getAllApproveData(item) - }, - handInspectionOrder(item) { - console.log('item----->', item) - if (item.taskDefKey ==='Confirmed_completed'){ - this.selectInspectionOrderDataBzz = item - this.$refs.modalFormInspectionOrderBzz .clearTableSource() - this.$refs.modalFormInspectionOrderBzz .getAllApproveData(item) - }else { - this.selectInspectionOrderData = item - this.$refs.modalFormInspectionOrder.clearTableSource() - this.$refs.modalFormInspectionOrder.getAllApproveData(item) - } - }, - batchHandle() { - if (this.selectedRowKeys.length <= 0) { - this.$notification.warning({ - message: '娑堟伅', - description: "璇烽�夋嫨涓�鏉¤褰�" - }); - return; - } else { - let ids = ""; - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ","; + methods: { + handelDetail(item, index) { + console.log('鐐瑰嚮浜嗚鎯�') + console.log('item----->', item) + console.log('index----->', index) + let processType = this.splitAprocessType(item.category) + console.log('processType--->', processType) + switch (processType) { + case 'sbdjApproval': + this.handInspectionOrder(item) + break + case 'WEEK_MAINTENANCE': + this.handleWeekMaintenance(item) + break + case 'eam_repair': + this.handleRepairOrder(item) + break + default: + alert('娌℃壘鍒拌娴佺▼') } - getAction(this.url.isSameNode+"?taskIds="+ids).then((res)=>{ - if(res.success){ - let taskDefKey=res.result - this.selectBachData.taskIds = ids - this.selectBachData.taskDefKey = taskDefKey - this.$refs.modalFormDispatchFileBatch.title="鎵归噺澶勭悊"; - this.$refs.modalFormDispatchFileBatch.edit(this.selectBachData) - this.$refs.modalFormDispatchFileBatch.disableSubmit = false; - }else{ - this.$notification.warning({ - message: '娑堟伅', - description: res.message - }); + }, + splitAprocessType(title) { + let parts = title.split('锛�') // 娉ㄦ剰鍐掑彿鏄叏瑙掑瓧绗︼紝浣跨敤瀵瑰簲鐨勫瓧杩涜鍒嗗壊 + let result = parts[0] + return result + }, + + handInspectionOrder(record) { + console.log('record----->', record) + this.selectInspectionOrderData = Object.assign({}, record) + this.$refs.modalFormInspectionOrder.visible = true + this.$refs.modalFormInspectionOrder.title = record.name + this.$refs.modalFormInspectionOrder.getAllApproveData(record) + this.$refs.modalFormInspectionOrder.getBasicInformation(record) + }, + + batchHandle() { + if (this.selectedRowKeys.length <= 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + let ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' } - }) + getAction(this.url.isSameNode + '?taskIds=' + ids).then((res) => { + if (res.success) { + let taskDefKey = res.result + this.selectBachData.taskIds = ids + this.selectBachData.taskDefKey = taskDefKey + this.$refs.modalFormDispatchFileBatch.title = '鎵归噺澶勭悊' + this.$refs.modalFormDispatchFileBatch.edit(this.selectBachData) + this.$refs.modalFormDispatchFileBatch.disableSubmit = false + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + } + }, + + handleWeekMaintenance(item) { + if (item && item.dataId) { + this.selectWeekMaintenanceData = Object.assign({}, item) + this.$refs.weekMaintenanceApprovalModal.handleDetail(item) + this.$refs.weekMaintenanceApprovalModal.title = item.name + this.$refs.weekMaintenanceApprovalModal.disableSubmit = false + } + }, + + /** + * 鐐瑰嚮璁惧缁翠慨鍒嗙被娴佺▼璇︽儏鏃惰Е鍙� + * @param record + */ + handleRepairOrder(record) { + this.selectRepairOrderData = Object.assign({}, record) + this.$refs.repairOrderApprovalModal.visible = true + this.$refs.repairOrderApprovalModal.title = record.name + this.$refs.repairOrderApprovalModal.getAllApproveData(record) + this.$refs.repairOrderApprovalModal.getBasicInformation(record) } - }, - handleWeekMaintenance(item) { - if(item && item.dataId) { - this.$refs.weekMaintenanceApprovalModal.handleDetail(item.dataId) - this.$refs.weekMaintenanceApprovalModal.title = item.name; - this.$refs.weekMaintenanceApprovalModal.disableSubmit = false; - } - }, - handleRepairOrder(item) { - this.selectRepairOrderData = item - this.$refs.repairOrderApprovalModal.clearTableSource() - this.$refs.repairOrderApprovalModal.getAllApproveData(item) } } -} </script> <style scoped> -@import '~@assets/less/common.less'; + @import '~@assets/less/common.less'; </style> \ No newline at end of file diff --git a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue index d4cfa8b..c99495f 100644 --- a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue +++ b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue @@ -1,133 +1,98 @@ -<!-- - Description: 宸ヤ綔娴�-璁惧鐐规澶勭悊椤甸潰 List - Author: 浣滆�� liuyh - Date: 2025-02-27 ---> <template> - <a-modal + <j-modal :title="title" - :width="width" + :width="1200" :visible="visible" - :footer="null" - @cancel="handCancel" + :okButtonProps="{ class:{'jee-hidden': disableSubmit||!hasInspectionDateArrived} }" + @ok="submitForm" + @cancel="handleCancel" + :mask-closable="false" + :confirmLoading="confirmLoading" + switchFullscreen + centered > - <a-card :bordered="false"> - <div> - <b>{{ selectShenpiData.description }}</b> - <br> - <br> - <a-tag color="blue"> - 褰撳墠澶勭悊浜� {{ selectShenpiData.assignee_dictText }} - </a-tag> - <a-tag color="blue"> - 浠诲姟鍒涘缓鏃堕棿 {{ selectShenpiData.createTime }} - </a-tag> - <br> - <br> - <button @click="fetchAndShowBmp" class="btn-custom">鎵撳紑娴佺▼鍥�</button> - <div v-if="imageSrc"> - <img :src="imageSrc" alt="Fetched Image" /> - </div> - <hr class="shallow-hr"> - </div> - <div> - <b>鐐规宸ュ崟璇︽儏</b> - <br> - <a-form :form='form'> - <a-spin :spinning="spinning"> - <a-tabs default-active-key='1' @change='callback'> - <a-tab-pane key='1' tab='鍩烘湰淇℃伅'> - <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" :disabled="true" v-model="tableRowRecord.orderNum" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿"> - <MaintenanceEquipmentSelect placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="tableRowRecord.equipmentId" - :maintenanceCategory="maintenanceCategory" :disabled="true" - @autocompleteForm="autocompleteForm"></MaintenanceEquipmentSelect> - </a-form-model-item> - </a-col> + <a-spin :spinning="spinning"> + <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol" + :rules="validatorRules"> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鐐规鍩虹淇℃伅</a-divider> - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗗悕绉�" disabled v-model="this.standardName" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="鏍囧噯缂栫爜"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗙紪鐮�" disabled v-model="this.standardCode" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> - <a-input-number v-model="this.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="鐐规浜�"> - <j-dict-select-tag v-model="tableRowRecord.operator" placeholder="璇烽�夋嫨鐢ㄦ埛" disabled dictCode="sys_user,realname,username,username!='admin' order by create_time"/> - </a-form-model-item> - </a-col> - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item label="鐐规鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> - <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="tableRowRecord.inspectionDate" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item label="鐐规杩囨湡鏃堕棿" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime"> - <j-date placeholder="璇烽�夋嫨鐐规杩囨湡鏃堕棿" v-model="tableRowRecord.expirationTime" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row > - <a-col :span="24"> - <a-form-model-item label="澶囨敞" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark"> - <a-textarea v-model="tableRowRecord.remark" rows="3" placeholder="璇疯緭鍏ュ娉�" disabled /> - </a-form-model-item> - </a-col> - </a-row> - </a-form-model> - </a-tab-pane> - <a-tab-pane key='2' tab='娴佺▼鑺傜偣'> - <a-card> - <a-timeline style="padding:0 1% 0 12%" > - <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1"> - <div class="bottom"> - <p>澶勭悊浜猴細{{item.assignee_dictText}}</p> - <p v-if="index1 !==0">澶勭悊鏃堕暱锛歿{item.duration}}</p> - <p v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</p> - <p v-if="item.description != null">澶勭悊鎰忚锛歿{item.description}}</p> - <div class="left_qiu"><span>{{item.taskName}}</span></div> - </div> - </a-timeline-item> - </a-timeline> - </a-card> - </a-tab-pane> - </a-tabs> - </a-spin> - </a-form> - </div> - <div> - <hr class="shallow-hr"> - <br> - <b>淇濆吇椤规槑缁�</b> - <br> - <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail"> - <a-row :gutter="24"> + <a-row> + <a-col :span='span'> + <a-form-model-item label="宸ュ崟鍙�"> + <a-input readOnly v-model="tableRowRecord.orderNum"/> + </a-form-model-item> + </a-col> + <a-col :span='span'> + <a-form-model-item label="璁惧缂栧彿"> + <MaintenanceEquipmentSelect v-model="tableRowRecord.equipmentId" + :maintenanceCategory="'POINT_INSPECTION'" disabled + @autocompleteForm="autoCompleteForm"/> + </a-form-model-item> + </a-col> + <a-col :span='span'> + <a-form-model-item label="鏍囧噯鍚嶇О"> + <a-input readOnly v-model="tableRowRecord.standardName"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span='span'> + <a-form-model-item label="鏍囧噯缂栫爜"> + <a-input readOnly v-model="tableRowRecord.standardCode"/> + </a-form-model-item> + </a-col> + <a-col :span='span'> + <a-form-model-item label="鐐规鏃ユ湡"> + <a-input v-model="tableRowRecord.inspectionDate" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span='span'> + <a-form-model-item label="鐐规杩囨湡鏃堕棿"> + <a-input v-model="tableRowRecord.expirationTime" readOnly/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span='span'> + <a-form-model-item label="淇濆吇鍛ㄦ湡"> + <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span='span'> + <a-form-model-item label="鐐规浜�"> + <a-input v-model="tableRowRecord.operator_dictText" readOnly/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="span*3"> + <a-form-model-item label="澶囨敞" :labelCol="{span:2}" :wrapperCol="{span:21}"> + <a-textarea v-model="tableRowRecord.remark" rows="3" readOnly/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-form-model-item prop="imageFilesResult" label="鐐规鍥剧墖" :labelCol="{span:2}" :wrapperCol="{span:21}"> + <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3" + :disabled="isDisableOperation||!hasInspectionDateArrived" + v-model="tableRowRecord.fileList"/> + </a-form-model-item> + </a-row> + + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> + 淇濆吇椤逛俊鎭� + </a-divider> + + <a-tabs v-model="activeTabKey"> + <a-tab-pane key="1" tab="淇濆吇椤规槑缁�"> <j-vxe-table ref="editableDetailTable" :rowNumber="false" - :rowSelection="false" + :rowSelection="true" :bordered="true" :alwaysEdit="true" :toolbar="false" @@ -136,311 +101,394 @@ :loading="detail.loading" :dataSource="detail.dataSource" :columns="detail.columns" - style="margin-top: 8px;" /> + @selectRowChange="handleTableSelectRowChange" + > + <template v-slot:inspectionResult="props"> + <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result" + :disabled="isDisableOperation" + placeholder="璇烽�夋嫨鐐规缁撴灉" + @change="handleInspectionResultSelectChange($event,props.row)" + style="width: 100%"/> + </template> + + <template v-slot:exceptionDescription="props"> + <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" + :placeholder="props.row.inspectionResult==='2'?'璇疯緭鍏ュ紓甯告弿杩�':''" + :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"/> + </template> + + <template v-slot:reportFlag="props"> + <j-dict-select-tag v-model="props.row.reportFlag" + :placeholder="props.row.inspectionResult==='2'?'璇烽�夋嫨寮傚父鏄惁鎶ヤ慨':''" + :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'" + dictCode="yn" + style="width: 100%"/> + </template> + </j-vxe-table> + </a-tab-pane> + + <template v-if="selectShenpiData.procInstId"> + <a-tab-pane key='2' tab='娴佺▼鑺傜偣'> + <a-card :bordered="false"> + <a-timeline> + <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index"> + <div> + <h3 style="font-weight: bold;">{{item.taskName}}</h3> + <div>澶勭悊浜猴細{{item.assignee_dictText}}</div> + <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div> + <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div> + <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div> + </div> + </a-timeline-item> + </a-timeline> + </a-card> + </a-tab-pane> + + <a-tab-pane key='3' tab='娴佺▼鍥�'> + <img :src="imageSrc" alt="Fetched Image"/> + </a-tab-pane> + </template> + + <a-button + v-if="selectedRowKeys.length>0&&!isDisableOperation&&hasInspectionDateArrived&&activeTabKey==='1'" + slot="tabBarExtraContent" type="primary" + @click="handleSelectAllInspectionResult">鎵归噺鐐规姝e父 + </a-button> + + <!--<a-dropdown slot="tabBarExtraContent" v-if="selectedRowKeys.length>0">--> + <!--<a-menu slot="overlay">--> + <!--<a-menu-item key="1" @click="handleSelectAllInspectionResult('姝e父')">姝e父</a-menu-item>--> + <!--<a-menu-item key="2" @click="handleSelectAllInspectionResult('寮傚父')">寮傚父</a-menu-item>--> + <!--</a-menu>--> + + <!--<a-button> 鎵归噺閫夋嫨鐐规缁撴灉--> + <!--<a-icon type="down"/>--> + <!--</a-button>--> + <!--</a-dropdown>--> + </a-tabs> + + <template v-if="isDisplayConfirm"> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鐝粍闀跨‘璁や俊鎭� + </a-divider> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item prop="confirmDealType" label="澶勭悊绫诲瀷"> + <j-dict-select-tag type='radio' v-model='tableRowRecord.confirmDealType' dictCode='approved_rejected' + :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"/> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item prop="confirmComment" label="澶勭悊鎰忚"> + <a-textarea placeholder="璇疯緭鍏ュ鐞嗘剰瑙�" + :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'" + v-model="tableRowRecord.confirmComment"/> + </a-form-model-item> + </a-col> </a-row> - <div class="table-operator" style="text-align: right;"> - <a-button @click="handleQueXiaoTask" type="primary" icon="close">鍙栨秷</a-button> - <a-button @click="submitForm">鎻� 浜�</a-button> - </div> - </a-form-model> - </div> - </a-card> - - - </a-modal> + </template> + </a-form-model> + </a-spin> + </j-modal> </template> <script> + import '@assets/less/TableExpand.less' + import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' + import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' + import { JVXETypes } from '@comp/jeecg/JVxeTable' + import moment from 'moment' -import '@assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' -import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' -import { JVXETypes } from '@comp/jeecg/JVxeTable' -export default { - name: 'FlowShenPi', - components: { MaintenanceEquipmentSelect }, - mixins: [mixinDevice], - props: { - selectShenpiData: { - type: Object, - required: true - } - }, - - data() { - return { - form: this.$form.createForm(this), - span: 12, - span1: 8, - coldisabled: true, - spinning: false, - tableRowRecord: {}, - assignFileStream:{}, - tableDataSource: [], - usageDataSource: [], - hitaskDataSource:[], - bomForm: {}, - approveContent:"", - imageSrc: null, - drawerVisible: true, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 } - }, - wrapperCol: { - xs: { span: 30 }, - sm: { span: 16 } - }, - validatorRules: { - status: { - rules: [ - { required: true, message: '璇烽�夋嫨瀹℃壒鐘舵��!'}, + export default { + name: 'InspectionOrderHandle', + components: { MaintenanceEquipmentSelect }, + props: { + selectShenpiData: { + type: Object + } + }, + data() { + return { + span: 8, + confirmLoading: false, + spinning: false, + tableRowRecord: {}, + assignFileStream: {}, + hitaskDataSource: [], + validatorRules: { + confirmDealType: [ + { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' } + ], + confirmComment: [ + { required: true, message: '璇疯緭鍏ュ鐞嗘剰瑙�' } ] }, - }, - approveData: {}, - flowData: {}, - title: '璇︽儏椤甸潰', - width: 1000, - visible: false, - // 琛ㄥご - url: { - queryBomDataById: '/eam/eamInspectionOrder/selectVoById', - diagramView: '/assign/flow/diagramView', - queryHisTaskList:'/dncFlow/dispatchFile/queryHisTaskList', - approve:"/eam/eamInspectionOrder/approval", - saveDispatchFile:"/dncFlow/dispatchFile/saveDispatchFile" - }, - dictOptions: {}, - superFieldList: [], - workflowSource: [], - maintenanceCategory: 'POINT_INSPECTION', - standardName:"", - maintenancePeriod:"", - standardCode:"", - detail: { - loading: false, - dataSource: [], - columns: [ - { - title: '搴忓彿', - key: 'itemCode', - type: JVXETypes.normal, - width: '10%', - align:"center", - }, - { - title: '淇濆吇椤�', - key: 'itemName', - type: JVXETypes.normal, - width: '20%', - align:"center", - }, - { - title: '淇濆吇瑕佹眰', - key: 'itemDemand', - type: JVXETypes.normal, - width: '30%', - align:"center", - }, - { - title: "鐐规缁撴灉" - ,key: 'inspectionResult' - ,type: JVXETypes.selectSearch - ,dictCode:'eam_inspection_result' - ,width: '20%' - ,align:"center" - }, - { - title: '寮傚父鎻忚堪', - key: 'exceptionDescription', - type: JVXETypes.textarea, - width: '30%', - align:"center", - }, - { - title: '寮傚父鏄惁鎶ヤ慨', - key: 'reportFlag', - type: JVXETypes.selectSearch, - dictCode:'yn', - width: '20%', - align:"center", - } - ] - } - } - }, - created() { - }, - computed: {}, - methods: { - callback() { - }, - handCancel() { - this.visible = false - }, - clearTableSource() { - this.tableDataSource = [] - this.usageDataSource = [] - }, - fetchAndShowBmp() { - console.log('flowData----->', this.flowData) - try { - let parm = { - processDefinitionId: this.flowData.processDefinitionId, - processInstanceId:this.flowData.processInstanceId, - TaskDefinitionKey:this.flowData.processDefinitionKey - } - downFile(this.url.diagramView,parm,'get').then((res=>{ - console.log('Pica------>',res) - const urlObject = window.URL.createObjectURL(new Blob([res])) - this.imageSrc = urlObject - })) - } catch (error) { - console.error('Error fetching image blob:', error) - alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�') - } - }, - handleQueXiaoTask(){ - this.visible = false - this.routeReload() - }, - autocompleteForm(selectObj) { - this.standardName = selectObj.standardName - this.maintenancePeriod=selectObj.maintenancePeriod - this.standardCode=selectObj.standardCode - }, - submitForm () { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let url=this.url.approve - let method = 'post'; - let flowTaskVo = {} - let tableData = that.$refs.editableDetailTable.getTableData() - flowTaskVo.comment =that.assignFileStream.approveContent; - flowTaskVo.dataId = this.selectShenpiData.dataId - flowTaskVo.taskId = this.selectShenpiData.id - flowTaskVo.userId = this.selectShenpiData.assignee - flowTaskVo.instanceId = this.selectShenpiData.procInstId - flowTaskVo.values = this.selectShenpiData.variables - flowTaskVo.tableDetailList=tableData - console.log("琛ㄥ崟鎻愪氦鏁版嵁",flowTaskVo) - httpAction(url,flowTaskVo,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.visible = false - //鍒锋柊琛ㄦ牸 - that.$emit('searchReset') - }else{ - that.$message.warning(res.message); + imageSrc: null, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 30 }, + sm: { span: 16 } + }, + visible: false, + // 琛ㄥご + url: { + // queryBomDataById: '/eam/eamInspectionOrder/selectVoById', + diagramView: '/assign/flow/diagramView', + queryHisTaskList: '/assign/flow/queryHisTaskList', + approve: '/eam/eamInspectionOrder/approval', + queryById: '/eam/eamInspectionOrder/queryById', + detailList: '/eam/eamInspectionOrderDetail/queryList' + }, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.normal, + width: '5%', + align: 'center', + fixed: 'left' + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.normal, + width: '15%', + align: 'center', + fixed: 'left' + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemand', + type: JVXETypes.normal, + width: '15%', + align: 'center', + fixed: 'left' + }, + { + title: '鐐规缁撴灉', + key: 'inspectionResult', + type: JVXETypes.slot, + slotName: 'inspectionResult', + width: '15%', + align: 'center', + validateRules: [ + { required: true, message: '${title}涓嶈兘涓虹┖锛�' } + ] + }, + { + title: '寮傚父鎻忚堪', + key: 'exceptionDescription', + type: JVXETypes.slot, + slotName: 'exceptionDescription', + width: '20%', + align: 'center', + validateRules: [ + { handler: this.customValidator } + ] + }, + { + title: '寮傚父鏄惁鎶ヤ慨', + key: 'reportFlag', + type: JVXETypes.slot, + slotName: 'reportFlag', + width: '20%', + align: 'center', + validateRules: [ + { handler: this.customValidator } + ] } - }).finally(() => { - that.confirmLoading = false; - }) - } - }) + ] + }, + selectedRowKeys: [], + disableSubmit: false, + activeTabKey: '1', + title: '' + } }, - getAllApproveData(item) { - console.log('selectShenpiData----->', this.selectShenpiData) - this.flowData = item - let param = { - 'id': item.dataId + computed: { + hasInspectionDateArrived() { + return moment(this.tableRowRecord.inspectionDate).diff(moment(), 'hours') <= 0 + }, + isDisplayConfirm() { + return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.inspectionStatus) + }, + isDisableOperation() { + return this.disableSubmit || this.tableRowRecord.inspectionStatus !== 'UNDER_INSPECTION' } - let parmhis={ - 'procInstId': item.procInstId - } - getAction(this.url.queryHisTaskList,parmhis).then(res=>{ - this.hitaskDataSource=res.result - getAction(this.url.queryBomDataById, param).then((res => { - if (res.success) { - this.tableRowRecord = res.result[0] - this.detail.dataSource=res.result[0].tableDetailList - console.log('this.tableRowRecord----->', this.tableRowRecord[0]) + }, + methods: { + /** + * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘 + * @param record 寰呭姙璁板綍淇℃伅 + */ + getAllApproveData(record) { + if (record.procInstId) { + const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = record + const param = { procInstId } + const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey } + const that = this + + getAction(this.url.queryHisTaskList, param) + .then(res => { + that.hitaskDataSource = res.result + }) + + downFile(this.url.diagramView, imageParam, 'get') + .then((res => { + const urlObject = window.URL.createObjectURL(new Blob([res])) + that.imageSrc = urlObject + })) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + }) + } + }, + + /** + * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭� + * @param record 寰呭姙璁板綍淇℃伅 + */ + async getBasicInformation(record) { + this.activeTabKey = '1' + this.detail.dataSource = [] + this.spinning = true + const param = { id: record.dataId } + let res = await getAction(this.url.queryById, param); + this.tableRowRecord = Object.assign({}, res.result); + if (this.tableRowRecord.imageFiles) { + let obj = JSON.parse(this.tableRowRecord.imageFiles) + this.tableRowRecord.fileList = [...obj] + } + await this.loadDetail(record.dataId) + }, + + async submitForm() { + let errMap = await this.$refs.editableDetailTable.validateTable() + if (errMap) { + console.log('err', errMap) + return + } + + this.$refs.form.validate(valid => { + if (valid) { + this.confirmLoading = this.spinning = true + const flowTaskVo = {} + flowTaskVo.dataId = this.selectShenpiData.dataId + flowTaskVo.taskId = this.selectShenpiData.id + flowTaskVo.userId = this.selectShenpiData.assignee + flowTaskVo.instanceId = this.selectShenpiData.procInstId + flowTaskVo.values = this.selectShenpiData.variables + flowTaskVo.confirmDealType = this.tableRowRecord.confirmDealType + flowTaskVo.confirmComment = this.tableRowRecord.confirmComment + flowTaskVo.fileList = this.tableRowRecord.fileList + flowTaskVo.tableDetailList = this.$refs.editableDetailTable.getTableData() + const that = this + console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo) + httpAction(this.url.approve, flowTaskVo, 'post') + .then((res) => { + if (res.success) { + that.$message.success(res.message) + //鍒锋柊琛ㄦ牸 + that.$emit('searchReset') + that.handleCancel() + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = this.spinning = false + }) + } else { + return false } - })) - }).finally( - this.visible = true, - console.log('this.approveData---->', this.approveData) - ) + }) + }, + + autoCompleteForm({ standardName, maintenancePeriod, standardCode }) { + this.$set(this.tableRowRecord, 'standardName', standardName) + this.$set(this.tableRowRecord, 'maintenancePeriod', maintenancePeriod) + this.$set(this.tableRowRecord, 'standardCode', standardCode) + }, + + // 鎵归噺閫夋嫨鎵�鏈夌偣妫�缁撴灉 + handleSelectAllInspectionResult() { + this.selectedRowKeys.forEach(key => { + const dataItem = this.detail.dataSource.find(item => item.id === key) + if (dataItem && dataItem.inspectionResult !== '1') { + delete dataItem.exceptionDescription + delete dataItem.reportFlag + dataItem.inspectionResult = '1' + } + }) + this.$refs.editableDetailTable.clearCheckboxRow() + this.selectedRowKeys = [] + }, + + /** + * 琛ㄦ牸澶氶�夋鍙戠敓鏀瑰彉鏃惰Е鍙� + * @param {selectedRowIds} 琛ㄦ牸涓凡閫夋嫨鐨処D鍒楄〃 + */ + handleTableSelectRowChange({ selectedRowIds }) { + this.selectedRowKeys = selectedRowIds + }, + + /** + * 鐐规缁撴灉閫夋嫨鍣ㄥ彂鐢熸敼鍙樻椂瑙﹀彂 + * @param value 鏀瑰彉鍚庣殑鍊� + * @param record 淇濆吇鏄庣粏琛岃褰� + */ + handleInspectionResultSelectChange(value, record) { + if (record.exceptionDescription) delete record.exceptionDescription + if (record.reportFlag) delete record.reportFlag + }, + + customValidator({ cellValue, row }, callback) { + if (row.inspectionResult === '2') { + if (!cellValue) { + callback(false, '${title}涓嶈兘涓虹┖锛�') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀� + } else { + callback(true) // true = 閫氳繃楠岃瘉 + } + } else { + callback(true) + } + }, + + handleCancel() { + this.selectedRowKeys = [] + this.visible = false + }, + //鏍囧噯閫夋嫨鍙樺寲 + loadDetail(orderId) { + if (orderId) { + getAction(this.url.detailList, { orderId: orderId }) + .then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + .finally(() => { + this.spinning = false + }) + } + }, } } -} </script> <style scoped> -.shallow-hr { - border: 0; - height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */ - background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */ - margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */ -} -.btn-custom { - background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */ - color: white; /* 鐧借壊鏂囧瓧 */ - border: none; /* 鏃犺竟妗� */ - padding: 5px 15px; /* 鍐呰竟璺� */ - text-align: center; /* 鏂囧瓧灞呬腑 */ - text-decoration: none; /* 鏃犱笅鍒掔嚎 */ - display: inline-block; /* 琛屽唴鍧楀厓绱� */ - font-size: 12px; /* 瀛椾綋澶у皬 */ - margin: 4px 2px; /* 澶栬竟璺� */ - cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */ - border-radius: 4px; /* 鍦嗚杈规 */ -} + /deep/ .ant-select-dropdown-menu { + text-align: left; + } -.bold-large-label { - font-weight: bold; - font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */ -} -.left_qiu{ - position: absolute; - left: -74px; - top: 0; - width:54px; - border-radius: 50%; - height:54px; - font-size: 13px; - margin: auto; - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: center; - background: #0099ff; - transform: translate(0, 0); -} -/deep/ .ant-timeline-item-tail{ - left: -29px !important; -} -.left_qiu span{ - width: 3em; - display: block; - color: #fff; - text-align: center; -} -.img{ - width: 75%; -} - -.wrap{ - clear: both; - width: 100%; - display: flex; - height: 50px; - border: 1px solid #ccc; - /* background-color: aqua; */ -} -.box{ - width:21%; - height:50px; - border-right: 1px solid #ccc; - line-height: 50px; - /* background: red; */ - text-align:center; - margin: auto; -} - -@import '~@assets/less/common.less'; + @import '~@assets/less/common.less'; </style> \ No newline at end of file diff --git a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandleBzz.vue b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandleBzz.vue deleted file mode 100644 index 4e9fc1a..0000000 --- a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandleBzz.vue +++ /dev/null @@ -1,468 +0,0 @@ -<!-- - Description: 宸ヤ綔娴�-璁惧鐐规澶勭悊椤甸潰 List - Author: 浣滆�� liuyh - Date: 2025-02-27 ---> -<template> - <a-modal - :title="title" - :width="width" - :visible="visible" - :footer="null" - @cancel="handCancel" - > - <a-card :bordered="false"> - <div> - <b>{{ selectShenpiData.title }}</b> - <br> - <br> - <a-tag color="blue"> - 褰撳墠澶勭悊浜� {{ selectShenpiData.assignee_dictText }} - </a-tag> - <a-tag color="blue"> - 浠诲姟鍒涘缓鏃堕棿 {{ selectShenpiData.createTime }} - </a-tag> - <br> - <br> - <button @click="fetchAndShowBmp" class="btn-custom">鎵撳紑娴佺▼鍥�</button> - <div v-if="imageSrc"> - <img :src="imageSrc" alt="Fetched Image" /> - </div> - <hr class="shallow-hr"> - </div> - <div> - <b>鐐规宸ュ崟璇︽儏</b> - <br> - <a-form :form='form'> - <a-spin :spinning="spinning"> - <a-tabs default-active-key='1' @change='callback'> - <a-tab-pane key='1' tab='鍩烘湰淇℃伅'> - <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" :disabled="true" v-model="tableRowRecord.orderNum" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿"> - <MaintenanceEquipmentSelect placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="tableRowRecord.equipmentId" - :maintenanceCategory="maintenanceCategory" :disabled="true" - @autocompleteForm="autocompleteForm"></MaintenanceEquipmentSelect> - </a-form-model-item> - </a-col> - - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗗悕绉�" disabled v-model="this.standardName" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="鏍囧噯缂栫爜"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗙紪鐮�" disabled v-model="this.standardCode" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> - <a-input-number v-model="this.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="鐐规浜�"> - <j-dict-select-tag v-model="tableRowRecord.operator" placeholder="璇烽�夋嫨鐢ㄦ埛" disabled dictCode="sys_user,realname,username,username!='admin' order by create_time"/> - </a-form-model-item> - </a-col> - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item label="鐐规鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> - <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="tableRowRecord.inspectionDate" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item label="鐐规杩囨湡鏃堕棿" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime"> - <j-date placeholder="璇烽�夋嫨鐐规杩囨湡鏃堕棿" v-model="tableRowRecord.expirationTime" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row > - <a-col :span="24"> - <a-form-model-item label="澶囨敞" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark"> - <a-textarea v-model="tableRowRecord.remark" rows="3" placeholder="璇疯緭鍏ュ娉�" disabled /> - </a-form-model-item> - </a-col> - </a-row> - </a-form-model> - </a-tab-pane> - <a-tab-pane key='2' tab='娴佺▼鑺傜偣'> - <a-card> - <a-timeline style="padding:0 1% 0 12%" > - <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1"> - <div class="bottom"> - <p>澶勭悊浜猴細{{item.assignee_dictText}}</p> - <p v-if="index1 !==0">澶勭悊鏃堕暱锛歿{item.duration}}</p> - <p v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</p> - <p v-if="item.description != null">澶勭悊鎰忚锛歿{item.description}}</p> - <div class="left_qiu"><span>{{item.taskName}}</span></div> - </div> - </a-timeline-item> - </a-timeline> - </a-card> - </a-tab-pane> - </a-tabs> - </a-spin> - </a-form> - </div> - <div> - <hr class="shallow-hr"> - <br> - <b>淇濆吇椤规槑缁�</b> - <br> - <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail"> - <a-row :gutter="24"> - <j-vxe-table - ref="editableDetailTable" - :rowNumber="false" - :rowSelection="false" - :bordered="true" - :alwaysEdit="true" - :toolbar="false" - keep-source - :height="300" - :loading="detail.loading" - :dataSource="detail.dataSource" - :columns="detail.columns" - :disabled="true" - style="margin-top: 8px;" /> - </a-row> - </a-form-model> - </div> - <div> - <hr class="shallow-hr"> - <br> - <b>鐝粍闀跨‘璁�</b> - <br> - <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail"> - <a-row> - <a-col ::span='span' class="btxx"> - <a-form-model-item label="澶勭悊绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop='dealType'> - <j-dict-select-tag type='list' v-model='assignFileStream.dealType' dictCode='approved_rejected' placeholder="璇烽�夋嫨澶勭悊绫诲瀷" /> - </a-form-model-item > - </a-col> - <a-col :span="24" class="btxx"> - <a-form-model-item label="澶勭悊鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-textarea v-model="assignFileStream.dealSuggestion" rows="4" placeholder="璇疯緭鍏ュ鐞嗘剰瑙�"/> - </a-form-model-item > - </a-col> - </a-row> - <div class="table-operator" style="text-align: right;"> - <a-button @click="handleQueXiaoTask" type="primary" icon="close">鍙栨秷</a-button> - <a-button @click="submitForm">鎻� 浜�</a-button> - </div> - </a-form-model> - </div> - </a-card> - - - </a-modal> -</template> - -<script> - -import '@assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' -import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' -import { JVXETypes } from '@comp/jeecg/JVxeTable' -export default { - name: 'FlowShenPi', - components: { MaintenanceEquipmentSelect }, - mixins: [mixinDevice], - props: { - selectShenpiData: { - type: Object, - required: true - } - }, - - data() { - return { - form: this.$form.createForm(this), - span: 12, - span1: 8, - coldisabled: true, - spinning: false, - tableRowRecord: {}, - assignFileStream:{}, - tableDataSource: [], - usageDataSource: [], - hitaskDataSource:[], - bomForm: {}, - approveContent:"", - imageSrc: null, - drawerVisible: true, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 } - }, - wrapperCol: { - xs: { span: 30 }, - sm: { span: 16 } - }, - validatorRules: { - status: { - rules: [ - { required: true, message: '璇烽�夋嫨瀹℃壒鐘舵��!'}, - ] - }, - }, - approveData: {}, - flowData: {}, - title: '璇︽儏椤甸潰', - width: 1000, - visible: false, - // 琛ㄥご - url: { - queryBomDataById: '/eam/eamInspectionOrder/selectVoById', - diagramView: '/assign/flow/diagramView', - queryHisTaskList:'/dncFlow/dispatchFile/queryHisTaskList', - approve:"/eam/eamInspectionOrder/approval", - saveDispatchFile:"/dncFlow/dispatchFile/saveDispatchFile" - }, - dictOptions: {}, - superFieldList: [], - workflowSource: [], - maintenanceCategory: 'POINT_INSPECTION', - standardName:"", - maintenancePeriod:"", - standardCode:"", - detail: { - loading: false, - dataSource: [], - columns: [ - { - title: '搴忓彿', - key: 'itemCode', - type: JVXETypes.normal, - width: '10%', - align:"center", - }, - { - title: '淇濆吇椤�', - key: 'itemName', - type: JVXETypes.normal, - width: '20%', - align:"center", - }, - { - title: '淇濆吇瑕佹眰', - key: 'itemDemand', - type: JVXETypes.normal, - width: '30%', - align:"center", - }, - { - title: "鐐规缁撴灉" - ,key: 'inspectionResult' - ,type: JVXETypes.selectSearch - ,dictCode:'eam_inspection_result' - ,width: '20%' - ,align:"center" - }, - { - title: '寮傚父鎻忚堪', - key: 'exceptionDescription', - type: JVXETypes.normal, - width: '30%', - align:"center", - }, - { - title: '寮傚父鏄惁鎶ヤ慨', - key: 'reportFlag', - type: JVXETypes.selectSearch, - dictCode:'yn', - width: '20%', - align:"center", - } - ] - } - } - }, - created() { - }, - computed: {}, - methods: { - callback() { - }, - handCancel() { - this.visible = false - }, - clearTableSource() { - this.tableDataSource = [] - this.usageDataSource = [] - }, - fetchAndShowBmp() { - console.log('flowData----->', this.flowData) - try { - let parm = { - processDefinitionId: this.flowData.processDefinitionId, - processInstanceId:this.flowData.processInstanceId, - TaskDefinitionKey:this.flowData.processDefinitionKey - } - downFile(this.url.diagramView,parm,'get').then((res=>{ - console.log('Pica------>',res) - const urlObject = window.URL.createObjectURL(new Blob([res])) - this.imageSrc = urlObject - })) - } catch (error) { - console.error('Error fetching image blob:', error) - alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�') - } - }, - handleQueXiaoTask(){ - this.visible = false - this.routeReload() - }, - autocompleteForm(selectObj) { - this.standardName = selectObj.standardName - this.maintenancePeriod=selectObj.maintenancePeriod - this.standardCode=selectObj.standardCode - }, - submitForm () { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let url=this.url.approve - let method = 'post'; - let flowTaskVo = {} - let tableData = that.$refs.editableDetailTable.getTableData() - flowTaskVo.dealType=that.assignFileStream.dealType - flowTaskVo.dealSuggestion=that.assignFileStream.dealSuggestion - flowTaskVo.dataId = this.selectShenpiData.dataId - flowTaskVo.taskId = this.selectShenpiData.id - flowTaskVo.userId = this.selectShenpiData.assignee - flowTaskVo.instanceId = this.selectShenpiData.procInstId - flowTaskVo.values = this.selectShenpiData.variables - flowTaskVo.tableDetailList=tableData - console.log("琛ㄥ崟鎻愪氦鏁版嵁",flowTaskVo) - httpAction(url,flowTaskVo,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.visible = false - //鍒锋柊琛ㄦ牸 - that.$emit('searchReset') - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - }) - } - }) - }, - getAllApproveData(item) { - console.log('selectShenpiData----->', this.selectShenpiData) - this.flowData = item - let param = { - 'id': item.dataId - } - let parmhis={ - 'procInstId': item.procInstId - } - getAction(this.url.queryHisTaskList,parmhis).then(res=>{ - this.hitaskDataSource=res.result - getAction(this.url.queryBomDataById, param).then((res => { - if (res.success) { - this.tableRowRecord = res.result[0] - this.detail.dataSource=res.result[0].tableDetailList - console.log('this.tableRowRecord----->', this.tableRowRecord[0]) - } - })) - }).finally( - this.visible = true, - console.log('this.approveData---->', this.approveData) - ) - } - } -} -</script> -<style scoped> -.shallow-hr { - border: 0; - height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */ - background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */ - margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */ -} -.btn-custom { - background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */ - color: white; /* 鐧借壊鏂囧瓧 */ - border: none; /* 鏃犺竟妗� */ - padding: 5px 15px; /* 鍐呰竟璺� */ - text-align: center; /* 鏂囧瓧灞呬腑 */ - text-decoration: none; /* 鏃犱笅鍒掔嚎 */ - display: inline-block; /* 琛屽唴鍧楀厓绱� */ - font-size: 12px; /* 瀛椾綋澶у皬 */ - margin: 4px 2px; /* 澶栬竟璺� */ - cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */ - border-radius: 4px; /* 鍦嗚杈规 */ -} - -.bold-large-label { - font-weight: bold; - font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */ -} -.left_qiu{ - position: absolute; - left: -74px; - top: 0; - width:54px; - border-radius: 50%; - height:54px; - font-size: 13px; - margin: auto; - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: center; - background: #0099ff; - transform: translate(0, 0); -} -/deep/ .ant-timeline-item-tail{ - left: -29px !important; -} -.left_qiu span{ - width: 3em; - display: block; - color: #fff; - text-align: center; -} -.img{ - width: 75%; -} - -.wrap{ - clear: both; - width: 100%; - display: flex; - height: 50px; - border: 1px solid #ccc; - /* background-color: aqua; */ -} -.box{ - width:21%; - height:50px; - border-right: 1px solid #ccc; - line-height: 50px; - /* background: red; */ - text-align:center; - margin: auto; -} - -@import '~@assets/less/common.less'; -</style> \ No newline at end of file diff --git a/src/views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue b/src/views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue deleted file mode 100644 index 498e570..0000000 --- a/src/views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue +++ /dev/null @@ -1,443 +0,0 @@ -<!-- - Description: 宸ヤ綔娴�-璁惧鐐规澶勭悊椤甸潰 List - Author: 浣滆�� liuyh - Date: 2025-02-27 ---> -<template> - <a-modal - :title="title" - :width="width" - :visible="visible" - :footer="null" - @cancel="handCancel" - > - <a-card :bordered="false"> - <div> - <b>{{ selectShenpiData.title }}</b> - <br> - <br> - <a-tag color="blue"> - 褰撳墠澶勭悊浜� {{ selectShenpiData.assignee_dictText }} - </a-tag> - <a-tag color="blue"> - 浠诲姟鍒涘缓鏃堕棿 {{ selectShenpiData.createTime }} - </a-tag> - <br> - <br> - <button @click="fetchAndShowBmp" class="btn-custom">鎵撳紑娴佺▼鍥�</button> - <div v-if="imageSrc"> - <img :src="imageSrc" alt="Fetched Image" /> - </div> - <hr class="shallow-hr"> - </div> - <div> - <b>鐐规宸ュ崟璇︽儏</b> - <br> - <a-form :form='form'> - <a-spin :spinning="spinning"> - <a-tabs default-active-key='1' @change='callback'> - <a-tab-pane key='1' tab='鍩烘湰淇℃伅'> - <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" :disabled="true" v-model="tableRowRecord.orderNum" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿"> - <MaintenanceEquipmentSelect placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="tableRowRecord.equipmentId" - :maintenanceCategory="maintenanceCategory" :disabled="true" - @autocompleteForm="autocompleteForm"></MaintenanceEquipmentSelect> - </a-form-model-item> - </a-col> - - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗗悕绉�" disabled v-model="this.standardName" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="鏍囧噯缂栫爜"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗙紪鐮�" disabled v-model="this.standardCode" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> - <a-input-number v-model="this.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="鐐规浜�"> - <j-dict-select-tag v-model="tableRowRecord.operator" placeholder="璇烽�夋嫨鐢ㄦ埛" disabled dictCode="sys_user,realname,username,username!='admin' order by create_time"/> - </a-form-model-item> - </a-col> - </a-row> - <a-row> - <a-col :span='span'> - <a-form-model-item label="鐐规鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> - <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="tableRowRecord.inspectionDate" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item label="鐐规杩囨湡鏃堕棿" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime"> - <j-date placeholder="璇烽�夋嫨鐐规杩囨湡鏃堕棿" v-model="tableRowRecord.expirationTime" disabled style="width: 100%" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row > - <a-col :span="24"> - <a-form-model-item label="澶囨敞" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark"> - <a-textarea v-model="tableRowRecord.remark" rows="3" placeholder="璇疯緭鍏ュ娉�" disabled /> - </a-form-model-item> - </a-col> - </a-row> - </a-form-model> - </a-tab-pane> - <a-tab-pane key='2' tab='娴佺▼鑺傜偣'> - <a-card> - <a-timeline style="padding:0 1% 0 12%" > - <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1"> - <div class="bottom"> - <p>澶勭悊浜猴細{{item.assignee_dictText}}</p> - <p v-if="index1 !==0">澶勭悊鏃堕暱锛歿{item.duration}}</p> - <p v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</p> - <p v-if="item.description != null">澶勭悊鎰忚锛歿{item.description}}</p> - <div class="left_qiu"><span>{{item.taskName}}</span></div> - </div> - </a-timeline-item> - </a-timeline> - </a-card> - </a-tab-pane> - </a-tabs> - </a-spin> - </a-form> - </div> - <div> - <hr class="shallow-hr"> - <br> - <b>淇濆吇椤规槑缁�</b> - <br> - <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail"> - <a-row :gutter="24"> - <j-vxe-table - ref="editableDetailTable" - :rowNumber="false" - :rowSelection="false" - :bordered="true" - :alwaysEdit="true" - :toolbar="false" - :disabled="true" - keep-source - :height="300" - :loading="detail.loading" - :dataSource="detail.dataSource" - :columns="detail.columns" - style="margin-top: 8px;" /> - </a-row> - </a-form-model> - </div> - </a-card> - - - </a-modal> -</template> - -<script> - -import '@assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' -import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' -import { JVXETypes } from '@comp/jeecg/JVxeTable' -export default { - name: 'FlowShenPi', - components: { MaintenanceEquipmentSelect }, - mixins: [mixinDevice], - props: { - selectShenpiData: { - type: Object, - required: true - } - }, - - data() { - return { - form: this.$form.createForm(this), - span: 12, - span1: 8, - coldisabled: true, - spinning: false, - tableRowRecord: {}, - assignFileStream:{}, - tableDataSource: [], - usageDataSource: [], - hitaskDataSource:[], - bomForm: {}, - approveContent:"", - imageSrc: null, - drawerVisible: true, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 } - }, - wrapperCol: { - xs: { span: 30 }, - sm: { span: 16 } - }, - validatorRules: { - status: { - rules: [ - { required: true, message: '璇烽�夋嫨瀹℃壒鐘舵��!'}, - ] - }, - }, - approveData: {}, - flowData: {}, - title: '璇︽儏椤甸潰', - width: 1000, - visible: false, - // 琛ㄥご - url: { - queryBomDataById: '/eam/eamInspectionOrder/selectVoById', - diagramView: '/assign/flow/diagramView', - queryHisTaskList:'/dncFlow/dispatchFile/queryHisTaskList', - approve:"/eam/eamInspectionOrder/approval", - saveDispatchFile:"/dncFlow/dispatchFile/saveDispatchFile" - }, - dictOptions: {}, - superFieldList: [], - workflowSource: [], - maintenanceCategory: 'POINT_INSPECTION', - standardName:"", - maintenancePeriod:"", - standardCode:"", - detail: { - loading: false, - dataSource: [], - columns: [ - { - title: '搴忓彿', - key: 'itemCode', - type: JVXETypes.normal, - width: '10%', - align:"center", - }, - { - title: '淇濆吇椤�', - key: 'itemName', - type: JVXETypes.normal, - width: '20%', - align:"center", - }, - { - title: '淇濆吇瑕佹眰', - key: 'itemDemand', - type: JVXETypes.normal, - width: '30%', - align:"center", - }, - { - title: "鐐规缁撴灉" - ,key: 'inspectionResult' - ,type: JVXETypes.selectSearch - ,dictCode:'eam_inspection_result' - ,width: '20%' - ,align:"center" - }, - { - title: '寮傚父鎻忚堪', - key: 'exceptionDescription', - type: JVXETypes.normal, - width: '30%', - align:"center", - }, - { - title: '寮傚父鏄惁鎶ヤ慨', - key: 'selectSearch', - type: JVXETypes.selectSearch, - dictCode:'yn', - width: '20%', - align:"center", - } - ] - } - } - }, - created() { - }, - computed: {}, - methods: { - callback() { - }, - handCancel() { - this.visible = false - }, - clearTableSource() { - this.tableDataSource = [] - this.usageDataSource = [] - }, - fetchAndShowBmp() { - console.log('flowData----->', this.flowData) - try { - let parm = { - processDefinitionId: this.flowData.processDefinitionId, - processInstanceId:this.flowData.processInstanceId, - TaskDefinitionKey:this.flowData.processDefinitionKey - } - downFile(this.url.diagramView,parm,'get').then((res=>{ - console.log('Pica------>',res) - const urlObject = window.URL.createObjectURL(new Blob([res])) - this.imageSrc = urlObject - })) - } catch (error) { - console.error('Error fetching image blob:', error) - alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�') - } - }, - handleQueXiaoTask(){ - this.visible = false - this.routeReload() - }, - autocompleteForm(selectObj) { - this.standardName = selectObj.standardName - this.maintenancePeriod=selectObj.maintenancePeriod - this.standardCode=selectObj.standardCode - }, - submitForm () { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let url=this.url.approve - let method = 'post'; - let flowTaskVo = {} - let tableData = that.$refs.editableDetailTable.getTableData() - flowTaskVo.comment =that.assignFileStream.approveContent; - flowTaskVo.dataId = this.selectShenpiData.dataId - flowTaskVo.taskId = this.selectShenpiData.id - flowTaskVo.userId = this.selectShenpiData.assignee - flowTaskVo.instanceId = this.selectShenpiData.procInstId - flowTaskVo.values = this.selectShenpiData.variables - flowTaskVo.tableDetailList=tableData - console.log("琛ㄥ崟鎻愪氦鏁版嵁",flowTaskVo) - httpAction(url,flowTaskVo,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.visible = false - //鍒锋柊琛ㄦ牸 - that.$emit('searchReset') - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - }) - } - }) - }, - getAllApproveData(item) { - console.log('selectShenpiData----->', this.selectShenpiData) - this.flowData = item - let param = { - 'id': item.dataId - } - let parmhis={ - 'procInstId': item.procInstId - } - getAction(this.url.queryHisTaskList,parmhis).then(res=>{ - this.hitaskDataSource=res.result - getAction(this.url.queryBomDataById, param).then((res => { - if (res.success) { - this.tableRowRecord = res.result[0] - this.detail.dataSource=res.result[0].tableDetailList - console.log('this.tableRowRecord----->', this.tableRowRecord[0]) - } - })) - }).finally( - this.visible = true, - console.log('this.approveData---->', this.approveData) - ) - } - } -} -</script> -<style scoped> -.shallow-hr { - border: 0; - height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */ - background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */ - margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */ -} -.btn-custom { - background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */ - color: white; /* 鐧借壊鏂囧瓧 */ - border: none; /* 鏃犺竟妗� */ - padding: 5px 15px; /* 鍐呰竟璺� */ - text-align: center; /* 鏂囧瓧灞呬腑 */ - text-decoration: none; /* 鏃犱笅鍒掔嚎 */ - display: inline-block; /* 琛屽唴鍧楀厓绱� */ - font-size: 12px; /* 瀛椾綋澶у皬 */ - margin: 4px 2px; /* 澶栬竟璺� */ - cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */ - border-radius: 4px; /* 鍦嗚杈规 */ -} - -.bold-large-label { - font-weight: bold; - font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */ -} -.left_qiu{ - position: absolute; - left: -74px; - top: 0; - width:54px; - border-radius: 50%; - height:54px; - font-size: 13px; - margin: auto; - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: center; - background: #0099ff; - transform: translate(0, 0); -} -/deep/ .ant-timeline-item-tail{ - left: -29px !important; -} -.left_qiu span{ - width: 3em; - display: block; - color: #fff; - text-align: center; -} -.img{ - width: 75%; -} - -.wrap{ - clear: both; - width: 100%; - display: flex; - height: 50px; - border: 1px solid #ccc; - /* background-color: aqua; */ -} -.box{ - width:21%; - height:50px; - border-right: 1px solid #ccc; - line-height: 50px; - /* background: red; */ - text-align:center; - margin: auto; -} - -@import '~@assets/less/common.less'; -</style> \ No newline at end of file diff --git a/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue b/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue index 0660b32..4384150 100644 --- a/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue +++ b/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue @@ -1,337 +1,357 @@ <template> - <a-modal - :title="title" - :width="width" + <j-modal + :width="1200" :visible="visible" - :footer="null" + :title="title" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @cancel="handCancel" + @ok="submitForm" + :mask-closable="false" + :confirmLoading="confirmLoading" + centered > - <a-card :bordered="false"> - <div> - <b>{{ selectShenpiData.title }}</b> - <br> - <br> - <a-tag color="blue"> - 澶勭悊浜� {{ selectShenpiData.assignee }} - </a-tag> - <a-tag color="blue"> - 鍒涘缓鏃堕棿 {{ selectShenpiData.createTime }} - </a-tag> - <br> - <br> - <button @click="fetchAndShowBmp" class="btn-custom">鎵撳紑娴佺▼鍥�</button> - <div v-if="imageSrc"> - <img :src="imageSrc" alt="Fetched Image" /> - </div> - <hr class="shallow-hr"> - </div> - <div> - <b>鎸囨淳璇︽儏</b> - <br> - <a-form :form='form'> - <a-spin :spinning="spinning"> - <a-tabs default-active-key='1' @change='callback'> - <a-tab-pane key='1' tab='鍩烘湰淇℃伅'> - <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'> - <a-row> - <a-col :span='span'> - <a-form-model-item label='浜у搧鍚嶇О' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='productName'> - <a-input :disabled='coldisabled' v-model='tableRowRecord.productName'></a-input> - </a-form-model-item> - </a-col> - <a-col :span='span'> - <a-form-model-item label='閮ㄤ欢鍚嶇О' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='componentId'> - <a-input :disabled='coldisabled' v-model='tableRowRecord.componentName'></a-input> - </a-form-model-item> - </a-col> - </a-row> - </a-form-model> - </a-tab-pane> - <a-tab-pane key='2' tab='娴佺▼鑺傜偣'> - <a-card> - <a-timeline style="padding:0 1% 0 12%" > - <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1"> - <div class="bottom"> - <p>寮�濮嬫椂闂达細{{item.startTime}}</p> - <p>缁撴潫鏃堕棿锛歿{item.endTime}}</p> - <p>澶勭悊浜猴細{{item.assignee}}</p> - <p>鍔炵悊绫诲瀷锛歿{item.bllx_dictText}}</p> - <p v-if="item.name == '鎻愪氦鐢宠'">鎸囨淳鍘熷洜锛歿{item.cause}}</p> - <p v-else >澶勭悊鎰忚锛歿{item.cause}}</p> - <div class="left_qiu"><span>{{item.name}}</span></div> - </div> - </a-timeline-item> - </a-timeline> - </a-card> - </a-tab-pane> - </a-tabs> - </a-spin> - </a-form> - </div> - <div> - <hr class="shallow-hr"> - <br> - <b>瀹℃壒璇︽儏</b> - <br> - <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail"> + <a-spin :spinning="spinning"> + <a-form-model ref="form" :model='tableRowRecord' :rules='validatorRules' :labelCol='labelCol' + :wrapperCol='wrapperCol'> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">鎶ヤ慨鍩虹淇℃伅</a-divider> + + <a-row> + <a-col :span='threeColSpan'> + <a-form-model-item label='宸ュ崟缂栧彿'> + <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairCode'/> + </a-form-model-item> + </a-col> + <a-col :span='threeColSpan'> + <a-form-model-item label='璁惧缂栧彿'> + <lx-search-equipment-select disabled v-model='tableRowRecord.equipmentId'/> + </a-form-model-item> + </a-col> + <a-col :span='threeColSpan'> + <a-form-model-item label='缁翠慨璐熻矗浜�'> + <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairer'/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="threeColSpan"> + <a-form-model-item label="鏁呴殰寮�濮嬫椂闂�"> + <a-input :readOnly='inputReadOnly' v-model="tableRowRecord.faultStartTime"/> + </a-form-model-item> + </a-col> + + <a-col :span="threeColSpan"> + <a-form-model-item label="鏄惁鍋滄満"> + <j-dict-select-tag type='radio' v-model='tableRowRecord.breakdownFlag' dictCode='breakdown_flag' + disabled/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span='threeColSpan*3'> + <a-form-model-item label='鎶ヤ慨鍥剧墖' :labelCol='labelColLong' :wrapperCol='wrapperColLong'> + <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" disabled :number="3" + v-model="tableRowRecord.reportImageFiles"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">鏄惁闇�瑕侀鐢ㄥ浠�</a-divider> + + <a-tabs v-model="activeTabKey"> + <a-tab-pane key="1" tab="棰嗙敤澶囦欢"> + <a-row> + <a-col :span="twoColSpan*2"> + <a-form-model-item label="鏄惁闇�瑕侀鐢ㄥ浠�" prop="isUseSpare"> + <a-radio-group v-model="tableRowRecord.isUseSpare" + :disabled="isDisableUseSpare"> + <a-radio :value="1">鏄�</a-radio> + <a-radio :value="0">鍚�</a-radio> + </a-radio-group> + </a-form-model-item> + </a-col> + + <template v-if="tableRowRecord.isUseSpare===0"> + <a-col :span="twoColSpan*2"> + <a-form-model-item label="鏁呴殰鍘熷洜" prop="faultReason"> + <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_REPAIR'" + v-model="tableRowRecord.faultReason" rows="4" + placeholder="璇疯緭鍏ユ晠闅滃師鍥�"/> + </a-form-model-item> + </a-col> + <a-col :span="twoColSpan*2"> + <a-form-model-item label="缁翠慨缁撴灉鎻忚堪" prop="repairDescription"> + <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_REPAIR'" + v-model="tableRowRecord.repairDescription" + placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�"/> + </a-form-model-item> + </a-col> + <a-col :span="twoColSpan*2"> + <a-form-model-item label="缁翠慨鍥剧墖"> + <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3" + :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_REPAIR'" + v-model="tableRowRecord.imageFiles"/> + </a-form-model-item> + </a-col> + </template> + </a-row> + </a-tab-pane> + + <template v-if="selectShenpiData.procInstId"> + <a-tab-pane key='2' tab='娴佺▼鑺傜偣'> + <a-card :bordered="false"> + <a-timeline> + <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index"> + <div> + <h3 style="font-weight: bold;">{{item.taskName}}</h3> + <div>澶勭悊浜猴細{{item.assignee_dictText}}</div> + <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div> + <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div> + <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div> + </div> + </a-timeline-item> + </a-timeline> + </a-card> + </a-tab-pane> + + <a-tab-pane key='3' tab='娴佺▼鍥�'> + <img :src="imageSrc" alt="Fetched Image"/>--> + </a-tab-pane> + </template> + </a-tabs> + + <template v-if="tableRowRecord.isUseSpare===1&&isDisableUseSpare"> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">绠$悊鍛橀鐢ㄥ浠� + </a-divider> + <a-row> - <a-col :span="24" class="btxx"> - <a-form-item label="瀹℃壒鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-dict-select-tag type='list' v-model='assignFileStream.status' dictCode='dnc_assign_stream_status' placeholder="璇烽�夋嫨瀹℃壒鐘舵��" /> - </a-form-item> - </a-col> - <a-col :span="24" class="btxx"> - <a-form-model-item label="瀹℃壒鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-textarea v-model="assignFileStream.approveContent" rows="4" placeholder="璇疯緭鍏ュ鎵规剰瑙�"/> - </a-form-model-item > + <a-col :span="twoColSpan*2"> + <a-form-model-item prop="sparePartDescription" label="澶囦欢鎻忚堪"> + <a-textarea placeholder="璇疯緭鍏ュ浠舵弿杩�" :readOnly="disableSubmit||tableRowRecord.repairStatus!=='WAIT_SPARES'" + v-model="tableRowRecord.sparePartDescription"></a-textarea> + </a-form-model-item> </a-col> </a-row> - <div class="table-operator" style="text-align: right;"> - <a-button @click="handleQueXiaoTask" type="primary" icon="close">鍙栨秷</a-button> - <a-button @click="submitForm">鎻� 浜�</a-button> - </div> - </a-form-model> - </div> - </a-card> + </template> + <template v-if="Boolean(tableRowRecord.sparePartDescription)&&isDisplayRepairResult"> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">缁翠慨缁撴灉涓婃姤</a-divider> + <a-row> + <a-col :span="twoColSpan*2"> + <a-form-model-item label="鏁呴殰鍘熷洜" prop="faultReason"> + <a-input :readOnly="disableSubmit||isDisableSubmitRepairResult" v-model="tableRowRecord.faultReason" + rows="4" placeholder="璇疯緭鍏ユ晠闅滃師鍥�"/> + </a-form-model-item> + </a-col> + </a-row> - </a-modal> + <a-row> + <a-col :span="twoColSpan*2"> + <a-form-model-item label="缁翠慨缁撴灉鎻忚堪" prop="repairDescription"> + <a-textarea :readOnly="disableSubmit||isDisableSubmitRepairResult" + v-model="tableRowRecord.repairDescription" + placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="twoColSpan*2"> + <a-form-model-item label="缁翠慨鍥剧墖"> + <lx-upload :disabled="disableSubmit||isDisableSubmitRepairResult" :returnUrl="false" :isMultiple="true" + file-type="image" :number="3" + v-model="tableRowRecord.imageFiles"/> + </a-form-model-item> + </a-col> + </a-row> + </template> + </a-form-model> + </a-spin> + </j-modal> </template> <script> + import '@assets/less/TableExpand.less' + import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' + import LxSearchEquipmentSelect from '../../../eam/equipment/modules/LxSearchEquipmentSelect' -import '@assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' - -export default { - name: 'RepairOrderApprovalModal', - mixins: [mixinDevice], - props: { - selectShenpiData: { - type: Object, - required: true - } - }, - - data() { - return { - form: this.$form.createForm(this), - span: 12, - span1: 8, - coldisabled: true, - spinning: false, - tableRowRecord: {}, - assignFileStream:{}, - tableDataSource: [], - usageDataSource: [], - hitaskDataSource:[], - bomForm: {}, - approveContent:"", - imageSrc: null, - drawerVisible: true, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 } - }, - wrapperCol: { - xs: { span: 30 }, - sm: { span: 16 } - }, - validatorRules: { - }, - approveData: {}, - flowData: {}, - title: '', - width: 1000, - visible: false, - // 琛ㄥご - url: { - queryBomDataById: '/eam/eamRepairOrder/queryById', - diagramView: '/assign/flow/diagramView', - queryHisTaskList:'/dncFlow/dispatchFile/queryHisTaskList', - approve:"/activit/assign/file/approve", - }, - dictOptions: {}, - superFieldList: [], - workflowSource: [] - } - }, - created() { - }, - computed: {}, - methods: { - callback() { + export default { + name: 'RepairOrderApprovalModal', + components: { LxSearchEquipmentSelect }, + props: { + selectShenpiData: { + type: Object, + required: true + } }, - handCancel() { - this.visible = false - }, - clearTableSource() { - this.tableDataSource = [] - this.usageDataSource = [] - }, - fetchAndShowBmp() { - console.log('flowData----->', this.flowData) - try { - let parm = { - processDefinitionId: this.flowData.processDefinitionId, - processInstanceId:this.flowData.processInstanceId, - TaskDefinitionKey:this.flowData.processDefinitionKey + data() { + return { + title: '', + threeColSpan: 8, + twoColSpan: 12, + inputReadOnly: true, + disableSubmit: false, + confirmLoading: false, + spinning: false, + tableRowRecord: {}, + hitaskDataSource: [], + imageSrc: null, + activeTabKey: '1', + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 2 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 20 } + }, + validatorRules: { + isUseSpare: [ + { required: true, message: '璇烽�夋嫨鏄惁闇�瑕侀鐢ㄥ浠�' } + ], + sparePartDescription: [ + { required: true, message: '璇疯緭鍏ュ浠舵弿杩�' } + ], + faultReason: [ + { required: true, message: '璇疯緭鍏ユ晠闅滃師鍥�' } + ], + repairDescription: [ + { required: true, message: '璇疯緭鍏ョ淮淇粨鏋滄弿杩�' } + ] + }, + approveData: {}, + visible: false, + // 琛ㄥご + url: { + queryBomDataById: '/eam/eamRepairOrder/queryById', + diagramView: '/assign/flow/diagramView', + queryHisTaskList: '/assign/flow/queryHisTaskList', + approve: '/eam/eamRepairOrder/perform' } - downFile(this.url.diagramView,parm,'get').then((res=>{ - console.log('Pica------>',res) - const urlObject = window.URL.createObjectURL(new Blob([res])) - this.imageSrc = urlObject - })) - } catch (error) { - console.error('Error fetching image blob:', error) - alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�') } }, - handleQueXiaoTask(){ - this.visible = false - this.routeReload() + computed: { + isDisableUseSpare() { + return this.disableSubmit || this.tableRowRecord.repairStatus !== 'UNDER_REPAIR' || Boolean(this.tableRowRecord.sparePartDescription) + }, + isDisplayRepairResult() { + return ['UNDER_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) + }, + isDisableSubmitRepairResult() { + return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) + } }, - submitForm () { - const that = this; - if (!that.assignFileStream.status==null || that.assignFileStream.status===undefined){ - this.$message.warning('璇烽�夋嫨瀹℃壒鐘舵�侊紒') - return false; - } - if (!that.assignFileStream.approveContent==null || that.assignFileStream.approveContent===undefined) { - this.$message.warning('璇疯緭鍏ュ鎵规剰瑙侊紒') - return false; - } - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let url=this.url.approve - let method = 'post'; - let flowTaskVo = {} - flowTaskVo.status=that.assignFileStream.status; - flowTaskVo.approveContent =that.assignFileStream.approveContent; - flowTaskVo.comment =that.assignFileStream.approveContent; - flowTaskVo.secretLevel = that.assignFileStream.secretLevel; - flowTaskVo.dataId = this.selectShenpiData.dataId - flowTaskVo.taskId = this.selectShenpiData.id - flowTaskVo.userId = this.selectShenpiData.assignee - flowTaskVo.instanceId = this.selectShenpiData.procInstId - flowTaskVo.targetKey = this.selectShenpiData.taskDefKey - flowTaskVo.values = this.selectShenpiData.variables - flowTaskVo.assignee = this.selectShenpiData.assignee - flowTaskVo.secretLevel = that.assignFileStream.secretLevel; - console.log("琛ㄥ崟鎻愪氦鏁版嵁",flowTaskVo) - httpAction(url,flowTaskVo,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; + methods: { + /** + * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘 + * @param record 寰呭姙璁板綍淇℃伅 + */ + getAllApproveData(record) { + if (!record.procInstId) return + console.log('record----->', record) + const { procInstId, processDefinitionId, processInstanceId, processDefinitionKey } = record + const param = { procInstId } + const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey } + const that = this + + getAction(this.url.queryHisTaskList, param) + .then(res => { + that.hitaskDataSource = res.result }) - } - }) - }, - getAllApproveData(item) { - console.log('selectShenpiData----->', this.selectShenpiData) - this.flowData = item - let param = { - 'id': item.dataId - } - let parmhis={ - 'procInstId': item.dataId - } - getAction(this.url.queryHisTaskList,parmhis).then(res=>{ - this.hitaskDataSource=res.result - getAction(this.url.queryBomDataById, param).then((res => { - if (res.success) { - this.tableRowRecord = res.result - console.log('this.tableRowRecord----->', this.tableRowRecord) + downFile(this.url.diagramView, imageParam, 'get') + .then((res => { + const urlObject = window.URL.createObjectURL(new Blob([res])) + that.imageSrc = urlObject + })) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + }) + }, + + /** + * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭� + * @param record 寰呭姙璁板綍淇℃伅 + */ + getBasicInformation(record) { + this.spinning = true + const that = this + const param = { id: record.dataId } + this.tableRowRecord = {} + this.activeTabKey = '1' + getAction(this.url.queryBomDataById, param) + .then((res => { + if (res.success) { + that.tableRowRecord = Object.assign({}, res.result, { + isUseSpare: res.result.isUseSpare === null ? 0 : res.result.isUseSpare, + imageFiles: JSON.parse(res.result.imageFiles), + reportImageFiles: JSON.parse(res.result.reportImageFiles) + }) + console.log('this.tableRowRecord----->', that.tableRowRecord) + } + })) + .finally(() => { + that.spinning = false + }) + }, + + submitForm() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = that.spinning = true + const { isUseSpare, faultReason, repairDescription, sparePartDescription, imageFiles, equipmentId } = that.tableRowRecord + const { dataId, id, procInstId, taskDefKey, variables } = that.selectShenpiData + + const flowTaskVo = {} + flowTaskVo.isUseSpare = isUseSpare + flowTaskVo.faultReason = faultReason + flowTaskVo.repairDescription = repairDescription + flowTaskVo.sparePartDescription = sparePartDescription + flowTaskVo.imageFilesResult = imageFiles + flowTaskVo.equipmentId = equipmentId + flowTaskVo.id = dataId + flowTaskVo.dataId = dataId + flowTaskVo.taskId = id + flowTaskVo.instanceId = procInstId + flowTaskVo.targetKey = taskDefKey + flowTaskVo.values = variables + console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo) + httpAction(this.url.approve, flowTaskVo, 'post') + .then((res) => { + if (res.success) { + that.$message.success(res.message) + that.handCancel() + that.$emit('searchReset') + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = that.spinning = false + }) + } else { + return false } - })) - }).finally( - this.visible = true, - console.log('this.approveData---->', this.approveData) - ) + }) + }, + + handCancel() { + this.visible = false + if (this.$refs.form) this.$refs.form.clearValidate() + } } } -} -</script> -<style scoped> -.shallow-hr { - border: 0; - height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */ - background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */ - margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */ -} -.btn-custom { - background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */ - color: white; /* 鐧借壊鏂囧瓧 */ - border: none; /* 鏃犺竟妗� */ - padding: 5px 15px; /* 鍐呰竟璺� */ - text-align: center; /* 鏂囧瓧灞呬腑 */ - text-decoration: none; /* 鏃犱笅鍒掔嚎 */ - display: inline-block; /* 琛屽唴鍧楀厓绱� */ - font-size: 12px; /* 瀛椾綋澶у皬 */ - margin: 4px 2px; /* 澶栬竟璺� */ - cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */ - border-radius: 4px; /* 鍦嗚杈规 */ -} - -.bold-large-label { - font-weight: bold; - font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */ -} -.left_qiu{ - position: absolute; - left: -74px; - top: 0; - width:54px; - border-radius: 50%; - height:54px; - font-size: 13px; - margin: auto; - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: center; - background: #0099ff; - transform: translate(0, 0); -} -/deep/ .ant-timeline-item-tail{ - left: -29px !important; -} -.left_qiu span{ - width: 3em; - display: block; - color: #fff; - text-align: center; -} -.img{ - width: 75%; -} - -.wrap{ - clear: both; - width: 100%; - display: flex; - height: 50px; - border: 1px solid #ccc; - /* background-color: aqua; */ -} -.box{ - width:21%; - height:50px; - border-right: 1px solid #ccc; - line-height: 50px; - /* background: red; */ - text-align:center; - margin: auto; -} - -@import '~@assets/less/common.less'; -</style> \ No newline at end of file +</script> \ No newline at end of file diff --git a/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue b/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue index aed2480..612bc6c 100644 --- a/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue +++ b/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue @@ -4,285 +4,584 @@ :width="1200" :visible="visible" :confirmLoading="confirmLoading" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" switchFullscreen @ok="handleOk" @cancel="handleCancel" + centered cancelText="鍏抽棴"> - <a-spin :spinning="confirmLoading"> + <a-spin :spinning="spinning"> <a-form-model ref="form" :model="model" :rules="validatorRules"> <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 淇濆吇鍩虹淇℃伅 </a-divider> <a-row :gutter="24"> <a-col :span="8"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderNum" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled /> + <a-input placeholder="宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled/> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栫爜"> <maintenance-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" :maintenanceCategory="maintenanceCategory" - @autocompleteForm="autocompleteForm" disabled></maintenance-equipment-select> + @autocompleteForm="autocompleteForm" + disabled></maintenance-equipment-select> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> - <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.standardName" disabled /> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.standardName" disabled/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> <a-col :span="8"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceDate" label="淇濆吇鏃ユ湡"> - <a-date-picker placeholder="璇烽�夋嫨璁″垝淇濆吇鏃ユ湡" v-model="model.maintenanceDate" format="YYYY-MM-DD" disabled - style="width: 100%" /> + <a-date-picker placeholder="璇烽�夋嫨璁″垝淇濆吇鏃ユ湡" v-model="model.maintenanceDate" format="YYYY-MM-DD" + disabled + style="width: 100%"/> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="淇濆吇浜�"> <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨淇濆吇浜�" disabled - :dictOptions="maintenanceOperatorOptions" /> + :dictOptions="maintenanceOperatorOptions"/> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> - <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" disabled /> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" disabled/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="澶囨敞"> - <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" disabled /> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" disabled/> </a-form-model-item> </a-row> - + <a-row :gutter="24"> + <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="淇濆吇鍥剧墖"> + <lx-upload :returnUrl="false" + :isMultiple="true" + file-type="image" + :disabled="confirmDisable" + :number="3" + v-model="model.imageFilesResult"/> + </a-form-model-item> + </a-row> <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 淇濆吇椤逛俊鎭� </a-divider> <a-row :gutter="24"> - <j-vxe-table - ref="editableDetailTable" - :rowNumber="true" - :rowSelection="true" - :bordered="true" - :alwaysEdit="true" - :toolbar="true" - :toolbarConfig="detail.toolbarConfig" - keep-source - :height="300" - :loading="detail.loading" - :dataSource="detail.dataSource" - :columns="detail.columns" - style="margin-top: 8px;" /> + <a-tabs v-model="activeTabKey"> + <a-tab-pane key="1" tab="淇濆吇椤规槑缁�"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="false" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="false" + keep-source + :height="300" + :loading="detail.loading" + :dataSource="detail.dataSource" + :columns="detail.columns" + @selectRowChange="handleTableSelectRowChange" + > + <template v-slot:maintenanceResult="props"> + <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="eam_inspection_result" + placeholder="璇烽�夋嫨淇濆吇缁撴灉" + :disabled="disableSubmit || confirmDisable" + @change="handleInspectionResultSelectChange($event,props.row)" + style="width: 100%"/> + </template> + + <template v-slot:exceptionDescription="props"> + <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" + :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'"/> + </template> + + <template v-slot:reportFlag="props"> + <j-dict-select-tag v-model="props.row.reportFlag" + :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'" + dictCode="yn" + style="width: 100%"/> + </template> + </j-vxe-table> + </a-tab-pane> + <template v-if="selectShenpiData.procInstId"> + <a-tab-pane key='2' tab='娴佺▼鑺傜偣'> + <a-card :bordered="false"> + <a-timeline> + <a-timeline-item v-for="(item,index) in taskData" :key="index"> + <div> + <h3 style="font-weight: bold;">{{item.taskName}}</h3> + <div>澶勭悊浜猴細{{item.assignee_dictText}}</div> + <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div> + <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div> + <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div> + </div> + </a-timeline-item> + </a-timeline> + </a-card> + </a-tab-pane> + <a-tab-pane key='3' tab='娴佺▼鍥�'> + <img :src="imageSrc" alt="Fetched Image"/>--> + </a-tab-pane> + </template> + <a-button v-if="!disableSubmit &&!confirmDisable&& selectedRowKeys.length > 0" slot="tabBarExtraContent" + type="primary" @click="handleSelectAllInspectionResult">淇濆吇姝e父 + </a-button> + </a-tabs> </a-row> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鐝粍闀跨‘璁や俊鎭� - </a-divider> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鍒濋獙鏀朵俊鎭� - </a-divider> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 缁堥獙鏀朵俊鎭� - </a-divider> + <div v-if="confirmDisable"> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鐝粍闀跨‘璁や俊鎭� + </a-divider> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmDealType" label="纭绫诲瀷"> + <j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approved_rejected' + placeholder="璇烽�夋嫨澶勭悊绫诲瀷" :disabled="disableSubmit || initialAcceptanceDisable"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment" label="纭鎰忚"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.confirmComment" + :disabled="disableSubmit || initialAcceptanceDisable"/> + </a-form-model-item> + </a-col> + </a-row> + </div> + <div v-if="initialAcceptanceDisable"> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鍒濋獙鏀朵俊鎭� + </a-divider> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAcceptanceComment" + label="鍒濋獙鏀舵剰瑙�"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.initialAcceptanceComment" + :disabled="disableSubmit || finalAcceptanceDisable"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAcceptanceFilesResult" + label="鍒濋獙鏀堕檮浠�"> + <lx-upload :returnUrl="false" + :isMultiple="true" + :disabled="disableSubmit || finalAcceptanceDisable" + v-model="model.initialAcceptanceFilesResult"/> + </a-form-model-item> + </a-col> + </a-row> + </div> + <div v-if="finalAcceptanceDisable"> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 缁堥獙鏀朵俊鎭� + </a-divider> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="finalAcceptanceComment" + label="缁堥獙鏀舵剰瑙�"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.finalAcceptanceComment" + :disabled="disableSubmit || completionDisable"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="finalAcceptanceFilesResult" + label="缁堥獙鏀堕檮浠�"> + <lx-upload :returnUrl="false" + :isMultiple="true" + :disabled="disableSubmit || completionDisable" + v-model="model.finalAcceptanceFilesResult"/> + </a-form-model-item> + </a-col> + </a-row> + </div> </a-form-model> </a-spin> </j-modal> </template> <script> -import { getAction, httpAction } from '@/api/manage' -import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' -import { JVXETypes } from '@comp/jeecg/JVxeTable' -import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' + import { downFile, getAction, httpAction } from '@/api/manage' + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' + import { JVXETypes } from '@comp/jeecg/JVxeTable' + import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' -export default { - name: 'WeekMaintenanceApprovalModal', - mixins: [JVxeTableModelMixin], - components: { - MaintenanceEquipmentSelect - }, - data() { - return { - title: '鎿嶄綔', - visible: false, - //鐘舵�佹帶鍒� - //淇濆吇涓� 涓嶅彲缂栬緫 - underMaintenanceDisable : false, - confirmDisable : false, - initialAcceptanceDisable : false, - finalAcceptanceDisable : false, - editable: false, - model: {}, - maintenanceCategory: 'WEEK_MAINTENANCE', - maintenanceOperatorOptions: [], - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - }, - labelColLong: { - xs: { span: 24 }, - sm: { span: 2 } - }, - wrapperColLong: { - xs: { span: 24 }, - sm: { span: 21 } - }, - confirmLoading: false, - validatorRules: { - }, - url: { - queryById: '/eam/weekMaintenanceOrder/queryById', - detail: '/eam/weekMaintenanceOrderDetail/queryList', - approval : '/eam/weekMaintenanceOrder/approval', - userSelect: '/eam/user_select/list', - }, - detail: { - loading: false, - dataSource: [], - columns: [ - { - title: 'ID', - key: 'id', - type: JVXETypes.hidden - }, - { - title: 'orderId', - key: 'orderId', - type: JVXETypes.hidden - }, - { - title: '搴忓彿', - key: 'itemCode', - type: JVXETypes.normal, - width: '10%', - align: 'center', - }, - { - title: '淇濆吇椤�', - key: 'itemName', - type: JVXETypes.normal, - width: '20%', - align: 'center', - }, - { - title: '瀛愪繚鍏婚」', - key: 'subItemName', - type: JVXETypes.normal, - width: '25%', - align: 'center' - }, - { - title: '淇濆吇瑕佹眰', - key: 'itemDemand', - type: JVXETypes.normal, - width: '30%', - align: 'center', - } - ], - toolbarConfig: { - // prefix 鍓嶇紑锛泂uffix 鍚庣紑 - slot: ['prefix', 'suffix'], - // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 - btn: ['clearSelection'] - } - } - } - }, - created() { - }, - methods: { - async handleDetail(dataId) { - this.loading = true; - this.visible = true; - this.detail.dataSource = [] - let res = await getAction(this.url.queryById, {id: dataId}); - this.model = Object.assign({}, res.result); - await this.loadDetail(dataId); - this.loading = false; + export default { + name: 'WeekMaintenanceApprovalModal', + mixins: [JVxeTableModelMixin], + components: { + MaintenanceEquipmentSelect }, - close() { - this.$emit('close') - this.visible = false - this.$refs.form.clearValidate() - }, - async handleOk() { - const that = this - let errMap = await that.$refs.editableDetailTable.validateTable() - if (errMap) { - this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') - return + props: { + selectShenpiData: { + type: Object } - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - let tableData = that.$refs.editableDetailTable.getTableData() - that.model.tableDetailList = [...tableData] - - that.confirmLoading = true - let httpurl = this.url.approval - let method = 'put' - - httpAction(httpurl, this.model, method).then((res) => { - if (res.success) { - that.$message.success(res.message) - that.$emit('ok') - that.close() - } else { - that.$message.warning(res.message) + }, + data() { + return { + title: '鎿嶄綔', + visible: false, + //鐘舵�佹帶鍒� + //淇濆吇涓� 涓嶅彲缂栬緫 + // confirmDisable: false, + // initialAcceptanceDisable: false, + // finalAcceptanceDisable: false, + editable: false, + model: {}, + maintenanceCategory: 'WEEK_MAINTENANCE', + maintenanceOperatorOptions: [], + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 2 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 21 } + }, + confirmLoading: false, + spinning: false, + imageSrc: null, + activeTabKey: '1', + validatorRules: { + confirmDealType: [ + { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' } + ], + confirmComment: [ + { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' } + ], + initialAcceptanceComment: [ + { required: true, message: '璇疯緭鍏ュ垵楠屾敹鎰忚!' } + ], + finalAcceptanceComment: [ + { required: true, message: '璇疯緭鍏ョ粓楠屾敹鎰忚!' } + ] + }, + url: { + queryById: '/eam/weekMaintenanceOrder/queryById', + detail: '/eam/weekMaintenanceOrderDetail/queryList', + approval: '/eam/weekMaintenanceOrder/approval', + userSelect: '/eam/user_select/list', + queryHisTaskList: '/assign/flow/queryHisTaskList', + diagramView: '/assign/flow/diagramView' + }, + disableSubmit: false, + taskData: [], + isDisplayBmp: false, + showBmpButtonLoading: false, + selectedRowKeys: [], + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: 'orderId', + key: 'orderId', + type: JVXETypes.hidden + }, + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.normal, + width: '5%', + align: 'center' + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.normal, + width: '10%', + align: 'center' + }, + { + title: '瀛愪繚鍏婚」', + key: 'subItemName', + type: JVXETypes.normal, + width: '10%', + align: 'center' + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemand', + type: JVXETypes.normal, + width: '20%', + align: 'center' + }, + { + title: '淇濆吇缁撴灉', + key: 'maintenanceResult', + type: JVXETypes.slot, + width: '10%', + align: 'center', + slotName: 'maintenanceResult', + validateRules: [ + { required: true, message: '淇濆吇缁撴灉涓嶈兘涓虹┖锛�' } + ] + }, + { + title: '寮傚父鎻忚堪', + key: 'exceptionDescription', + type: JVXETypes.slot, + width: '20%', + align: 'center', + slotName: 'exceptionDescription', + validateRules: [ + { handler: this.customValidator } + ] + }, + { + title: '鏄惁鎶ヤ慨', + key: 'reportFlag', + type: JVXETypes.slot, + width: '10%', + align: 'center', + slotName: 'reportFlag', + validateRules: [ + { handler: this.customValidator } + ] } - }).finally(() => { - that.confirmLoading = false - }) - } else { - return false + ], + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['clearSelection'] + } } - }) - }, - handleCancel() { - this.close() - }, - autocompleteForm(selectObj) { - this.$set(this.model, 'standardName', selectObj.standardName) - this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) - this.$set(this.model, 'standardId', selectObj.id) - this.$set(this.model, 'equipmentId', selectObj.equipmentId) - // console.log('model', this.model) - if (!this.model.id) { - this.loadStandardDetail(selectObj.id) } - debugger - this.loadMaintenanceOperatorList(this.model.equipmentId); }, - //鏍囧噯閫夋嫨鍙樺寲 - loadDetail(orderId) { - if (orderId) { - getAction(this.url.detail, { orderId: orderId }).then(res => { - if (res.success) { - this.detail.dataSource = [...res.result] + created() { + }, + computed: { + confirmDisable: function() { + return ['WAIT_CONFIRM', 'WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus) + }, + initialAcceptanceDisable: function() { + return ['WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus) + }, + finalAcceptanceDisable: function() { + return ['WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus) + }, + completionDisable: function() { + return ['COMPLETE', 'ABOLISH'].includes(this.model.maintenanceStatus) + } + }, + methods: { + async handleDetail(item) { + this.initParams() + this.model = {} + if (item.procInstId) { + const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = item + + let taskDataList = await getAction(this.url.queryHisTaskList, { procInstId }) + this.taskData = [...taskDataList.result] + + downFile(this.url.diagramView, { + processDefinitionId, + processInstanceId, + TaskDefinitionKey: processDefinitionKey + }, 'get') + .then((res => { + const urlObject = window.URL.createObjectURL(new Blob([res])) + this.imageSrc = urlObject + })) + .catch(err => { + this.$notification.error({ + message: '娑堟伅', + description: res.message + }) + }) + } + let res = await getAction(this.url.queryById, { id: item.dataId }) + this.model = Object.assign({}, res.result) + if (this.model.imageFiles) { + let obj = JSON.parse(this.model.imageFiles) + this.model.imageFilesResult = [...obj] + } + if (this.model.initialAcceptanceFiles) { + let obj = JSON.parse(this.model.initialAcceptanceFiles) + this.model.initialAcceptanceFilesResult = [...obj] + } + if (this.model.finalAcceptanceFiles) { + let obj = JSON.parse(this.model.finalAcceptanceFiles) + this.model.finalAcceptanceFilesResult = [...obj] + } + this.model.dataId = item.dataId + this.model.taskId = item.id + this.model.userId = item.assignee + this.model.instanceId = item.procInstId + this.model.values = item.variables + await this.loadDetail(item.dataId) + }, + + recordDetail(record) { + console.log('record', record) + this.initParams() + this.model = Object.assign({}, record) + if (this.model.imageFiles) { + let obj = JSON.parse(this.model.imageFiles) + this.model.imageFilesResult = [...obj] + } + if (this.model.initialAcceptanceFiles) { + let obj = JSON.parse(this.model.initialAcceptanceFiles) + this.model.initialAcceptanceFilesResult = [...obj] + } + if (this.model.finalAcceptanceFiles) { + let obj = JSON.parse(this.model.finalAcceptanceFiles) + this.model.finalAcceptanceFilesResult = [...obj] + } + this.loadDetail(record.id) + }, + + initParams() { + this.detail.dataSource = [] + this.visible = true + this.activeTabKey = '1' + this.spinning = true + }, + + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) { + this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') + return + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = that.spinning = true + let tableData = that.$refs.editableDetailTable.getTableData() + that.model.tableDetailList = [...tableData] + let httpurl = this.url.approval + let method = 'put' + + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('searchReset') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = that.spinning = false + }) + } else { + return false } }) - } - }, - loadMaintenanceOperatorList(equipmentId) { - this.maintenanceOperatorOptions = [] - let params = { positionCode: 'PCR0001' } - if (equipmentId) { - params.equipmentId = equipmentId - } - getAction(this.url.userSelect, params).then(res => { - if (res.success) { - this.maintenanceOperatorOptions = res.result.map(item => ({ - key: item.id, - value: item.username, - text: item.realname - })) - } - }) - } + }, + autocompleteForm(selectObj) { + this.$set(this.model, 'standardName', selectObj.standardName) + this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) + this.$set(this.model, 'standardId', selectObj.id) + this.$set(this.model, 'equipmentId', selectObj.equipmentId) + // console.log('model', this.model) + if (!this.model.id) { + this.loadStandardDetail(selectObj.id) + } + this.loadMaintenanceOperatorList(this.model.equipmentId) + }, + + //鏍囧噯閫夋嫨鍙樺寲 + loadDetail(orderId) { + if (orderId) { + getAction(this.url.detail, { orderId: orderId }) + .then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + + loadMaintenanceOperatorList(equipmentId) { + this.maintenanceOperatorOptions = [] + let params = { positionCode: 'PCR0001' } + if (equipmentId) { + params.equipmentId = equipmentId + } + getAction(this.url.userSelect, params).then(res => { + if (res.success) { + this.maintenanceOperatorOptions = res.result.map(item => ({ + key: item.id, + value: item.username, + text: item.realname + })) + } + }) + }, + + handleInspectionResultSelectChange(value, record) { + if (record.exceptionDescription) delete record.exceptionDescription + if (record.reportFlag) delete record.reportFlag + }, + + // 鎵归噺閫夋嫨鎵�鏈夌偣妫�缁撴灉 + handleSelectAllInspectionResult() { + this.selectedRowKeys.forEach(key => { + const dataItem = this.detail.dataSource.find(item => item.id === key) + if (dataItem && dataItem.maintenanceResult !== '1') { + console.log('dataItem', dataItem) + delete dataItem.exceptionDescription + delete dataItem.reportFlag + dataItem.maintenanceResult = '1' + } + }) + this.$refs.editableDetailTable.clearCheckboxRow() + this.selectedRowKeys = [] + }, + + /** + * 琛ㄦ牸澶氶�夋鍙戠敓鏀瑰彉鏃惰Е鍙� + * @param {selectedRowIds} 琛ㄦ牸涓凡閫夋嫨鐨処D鍒楄〃 + */ + handleTableSelectRowChange({ selectedRowIds }) { + this.selectedRowKeys = selectedRowIds + }, + + customValidator({ cellValue, row }, callback) { + if (row.maintenanceResult === '2') { + if (!cellValue) { + callback(false, '${title}涓嶈兘涓虹┖锛�') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀� + } else { + callback(true) // true = 閫氳繃楠岃瘉 + } + } else { + callback(true) + } + }, + + handleCancel() { + this.close() + }, + + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + } + } } -} </script> <style lang="less" scoped> diff --git a/src/views/system/modules/SelectDeviceDrawer.vue b/src/views/system/modules/SelectDeviceDrawer.vue index 6015831..cdd045b 100644 --- a/src/views/system/modules/SelectDeviceDrawer.vue +++ b/src/views/system/modules/SelectDeviceDrawer.vue @@ -96,6 +96,7 @@ expandedKeys: [], checkedKeys: [], autoExpandParent: true, + searchValue: '', url: { getBaseTree: '/mdc/mdcEquipment/queryTreeListByProduction' }, diff --git a/vue.config.js b/vue.config.js index 07c53ce..92003d2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -87,7 +87,7 @@ devServer: { port: 3000, - open:true, + open: true, // hot: true, // disableHostCheck: true, // overlay: { @@ -109,7 +109,7 @@ /* 娉ㄦ剰锛歫eecgboot鍓嶇鍋氫簡鏀归�狅紝姝ゅ涓嶉渶瑕侀厤缃法鍩熷拰鍚庡彴鎺ュ彛锛堝彧闇�瑕佹敼.env鐩稿叧閰嶇疆鏂囦欢鍗冲彲锛� issues/3462 寰堝浜烘澶勫仛浜嗛厤缃紝瀵艰嚧鍒锋柊鍓嶇404闂锛岃涓�瀹氭敞鎰�*/ '/jeecg-boot': { - target: 'http://localhost:8080', // 璇锋眰鏈湴 闇�瑕乯eecg-boot鍚庡彴椤圭洰 + target: 'http://localhost:9999', // 璇锋眰鏈湴 闇�瑕乯eecg-boot鍚庡彴椤圭洰 ws: false, changeOrigin: true } -- Gitblit v1.9.3