From 2637821cb7466330f5c612be809531cb65790219 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 04 七月 2025 20:01:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/eam/maintenance/EamInspectionOrderList.vue | 750 +++++++++------------ src/views/eam/equipment/modules/EamEquipmentModal.vue | 66 + src/mixins/JeecgListMixin.js | 1 src/views/eam/base/modules/EamMaintenanceStandardModal.vue | 450 +++++++----- src/views/eam/equipment/EamEquipmentLedger.vue | 28 src/views/eam/maintenance/modules/EamInspectionOrderModal.vue | 54 - src/api/manage.js | 8 src/views/eam/base/EamMaintenanceStandardList.vue | 454 ++++++------- src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue | 226 +++--- 9 files changed, 984 insertions(+), 1,053 deletions(-) diff --git a/src/api/manage.js b/src/api/manage.js index 2d86db1..7dc227e 100644 --- a/src/api/manage.js +++ b/src/api/manage.js @@ -224,3 +224,11 @@ return; } } + +export function templateXlsDownload(fileUrl) { + let downloadUrl = getFileAccessHttpUrl(fileUrl) + if (downloadUrl) { + window.open(downloadUrl) + } +} + diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js index 2883b4b..686383d 100644 --- a/src/mixins/JeecgListMixin.js +++ b/src/mixins/JeecgListMixin.js @@ -233,6 +233,7 @@ description:res.message }); that.loadData(); + that.clearSelected() } else { // that.$message.warning(res.message); that.$notification.warning({ diff --git a/src/views/eam/base/EamMaintenanceStandardList.vue b/src/views/eam/base/EamMaintenanceStandardList.vue index fe262e6..04196b6 100644 --- a/src/views/eam/base/EamMaintenanceStandardList.vue +++ b/src/views/eam/base/EamMaintenanceStandardList.vue @@ -1,37 +1,38 @@ <template> <a-card :bordered="false"> - <template v-if="isDisplayOperation"> <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> <a-col :xl="4" :lg="7" :md="8" :sm="24"> - <a-form-item label="鏍囧噯缂栫爜"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗙紪鐮�" v-model="queryParam.standardCode"></a-input> + <a-form-item label="瑙勮寖缂栫爜"> + <a-input placeholder="璇疯緭鍏ヨ鑼冪紪鐮�" v-model="queryParam.standardCode"/> </a-form-item> </a-col> <a-col :xl="4" :lg="7" :md="8" :sm="24"> - <a-form-item label="鏍囧噯鍚嶇О"> - <a-input placeholder="璇疯緭鍏ユ爣鍑嗗悕绉�" v-model="queryParam.standardName"></a-input> + <a-form-item label="瑙勮寖鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ鑼冨悕绉�" v-model="queryParam.standardName"/> </a-form-item> </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> + <a-col :xl="5" :lg="7" :md="8" :sm="24"> + <a-form-item label="缁熶竴缂栫爜"> + <lx-search-equipment-select placeholder="璇疯緭鍏ョ粺涓�缂栫爜鎴栧悕绉版悳绱�" v-model="queryParam.equipmentId"/> </a-form-item> </a-col> <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="淇濆吇鍒嗙被"> - <j-dict-select-tag dict-code="maintenance_category" placeholder="璇烽�夋嫨淇濆吇鍒嗙被" v-model="queryParam.maintenanceCategory" /> + <j-dict-select-tag dict-code="maintenance_category" placeholder="璇烽�夋嫨淇濆吇鍒嗙被" + v-model="queryParam.maintenanceCategory"/> </a-form-item> </a-col> <a-col :xl="4" :lg="7" :md="8" :sm="24"> - <a-form-item label="鏍囧噯鐘舵��"> - <j-dict-select-tag dict-code="maintenance_standard_status" placeholder="璇烽�夋嫨鏍囧噯鐘舵��" v-model="queryParam.standardStatus" /> + <a-form-item label="瑙勮寖鐘舵��"> + <j-dict-select-tag dict-code="maintenance_standard_status" placeholder="璇烽�夋嫨瑙勮寖鐘舵��" + v-model="queryParam.standardStatus"/> </a-form-item> </a-col> - <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-col :xl="3" :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="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> @@ -44,21 +45,30 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <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" + <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" + :action="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="secondMaintenanceImportExcel" + <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)"> + 鐐规鏍囧噯妯℃澘涓嬭浇 + </a-button> + <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" + :action="secondMaintenanceImportExcel" @change="handleImportExcel"> <a-button type="primary" icon="import">浜屼繚鏍囧噯瀵煎叆</a-button> </a-upload> - <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.secondMaintenanceXlsDownloadUrl)">浜屼繚鏍囧噯妯℃澘涓嬭浇</a-button> - <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="thirdMaintenanceImportExcel" + <a-button type="primary" icon="download" + @click="handleTemplateXlsDownload(url.secondMaintenanceXlsDownloadUrl)">浜屼繚鏍囧噯妯℃澘涓嬭浇 + </a-button> + <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" + :action="thirdMaintenanceImportExcel" @change="handleImportExcel"> <a-button type="primary" icon="import">涓変繚鏍囧噯瀵煎叆</a-button> </a-upload> - <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)">涓変繚鏍囧噯妯℃澘涓嬭浇</a-button> + <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)"> + 涓変繚鏍囧噯妯℃澘涓嬭浇 + </a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> <a-menu-item key="1" @click="batchDel"> @@ -72,8 +82,6 @@ </a-dropdown> </div> </template> - - <!-- table鍖哄煙-begin --> <div> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation"> @@ -95,33 +103,23 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :customRow='clickThenSelect' @change="handleTableChange"> - <template slot="referenceFile" slot-scope="text, record, index"> - <a v-if="text && text !== ''" @click.stop="handlePreview(record)">棰勮</a> - </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.standardStatus === 'NORMAL'" @click.stop="handleEdit(record)">缂栬緫</a> + <a v-if="record.standardStatus === 'WAIT_SUBMIT'" @click.stop="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 v-if="record.standardStatus === 'NORMAL'"> - <a @click.stop="handleUpgrade(record)">鍗囩増</a> - </a-menu-item> - <a-menu-item v-if="record.standardStatus === 'NORMAL'"> - <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleAbolish(record.id)"> - <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> + <template v-if="record.standardStatus === 'START'"> + <a-divider type="vertical"/> + + <a @click.stop="handleUpgrade(record)">鍗囩増</a> + </template> + + <template v-if="record.standardStatus === 'WAIT_SUBMIT'"> + <a-divider type="vertical"/> + + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a @click="event=>event.stopPropagation()">鍒犻櫎</a> + </a-popconfirm> + </template> </span> - </a-table> <a-tabs defaultActiveKey="1"> @@ -137,219 +135,191 @@ <!-- 琛ㄥ崟鍖哄煙 --> <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"></eamMaintenanceStandard-modal> - <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview> </a-card> </template> <script> -import '@/assets/less/TableExpand.less' -import EamMaintenanceStandardModal from './modules/EamMaintenanceStandardModal' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import EamMaintenanceStandardDetailList from '@views/eam/base/modules/EamMaintenanceStandardDetailList' -import { deleteAction, templateXlsDownload } from '@api/manage' -import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import '@/assets/less/TableExpand.less' + import EamMaintenanceStandardModal from './modules/EamMaintenanceStandardModal' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import EamMaintenanceStandardDetailList from '@views/eam/base/modules/EamMaintenanceStandardDetailList' + import { deleteAction, templateXlsDownload } from '@api/manage' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' -export default { - name: 'EamMaintenanceStandardList', - mixins: [JeecgListMixin], - props: { - isDisplayOperation: { - type: Boolean, - default: true - } - }, - components: { - LxSearchEquipmentSelect, - EamMaintenanceStandardModal, - EamMaintenanceStandardDetailList - }, - data() { - return { - description: '淇濆吇鏍囧噯绠$悊椤甸潰', - disableMixinCreated: true, - // 琛ㄥご - columns: [ - { - title: '鏍囧噯缂栫爜', - align: 'center', - dataIndex: 'standardCode' - }, - { - title: '鏍囧噯鍚嶇О', - align: 'center', - dataIndex: 'standardName' - }, - { - title: '鏂囦欢缂栧彿', - align: 'center', - dataIndex: 'fileCode' - }, - { - title: '淇濆吇鍛ㄦ湡(澶�)', - align: 'center', - dataIndex: 'maintenancePeriod' - }, - { - title: '鍒濆鏃ユ湡', - align: 'center', - dataIndex: 'initialDate' - }, - { - title: '淇濆吇鍒嗙被', - align: 'center', - dataIndex: 'maintenanceCategory_dictText' - }, - { - title: '璁惧缂栧彿', - align: 'center', - dataIndex: 'equipmentId_dictText' - }, - { - title: '鏍囧噯鐘舵��', - align: 'center', - dataIndex: 'standardStatus_dictText' - }, - { - title: '鐗堟湰', - align: 'center', - dataIndex: 'standardVersion' - }, - { - title: '鍙傝�冩枃浠�', - align: 'center', - dataIndex: 'referenceFile', - scopedSlots: { customRender: 'referenceFile' } - } - ], - url: { - list: '/eam/maintenanceStandard/list', - delete: '/eam/maintenanceStandard/delete', - deleteBatch: '/eam/maintenanceStandard/deleteBatch', - exportXlsUrl: 'eam/maintenanceStandard/exportXls', - inspectionImportExcel: 'eam/maintenanceStandard/inspectionImportExcel', - weekMaintenanceImportExcel: 'eam/maintenanceStandard/weekMaintenanceImportExcel', - secondMaintenanceImportExcel: 'eam/maintenanceStandard/secondMaintenanceImportExcel', - thirdMaintenanceImportExcel: 'eam/maintenanceStandard/thirdMaintenanceImportExcel', - inspectionXlsDownloadUrl: '瀵煎叆妯℃澘/鐐规鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', - weekMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/鍛ㄤ繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', - secondMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/浜屼繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', - thirdMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/涓変繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', - abolish: '/eam/maintenanceStandard/abolish', - }, - fileUrl: '', - standardId: '-1' - } - }, - computed: { - inspectionImportExcel: function() { - return `${window._CONFIG['domianURL']}/${this.url.inspectionImportExcel}` - }, - weekMaintenanceImportExcel: function() { - return `${window._CONFIG['domianURL']}/${this.url.weekMaintenanceImportExcel}` - }, - secondMaintenanceImportExcel: function() { - return `${window._CONFIG['domianURL']}/${this.url.secondMaintenanceImportExcel}` - }, - thirdMaintenanceImportExcel: function() { - return `${window._CONFIG['domianURL']}/${this.url.thirdMaintenanceImportExcel}` - } - }, - created() { - if (!this.isDisplayOperation) { - return - } - const operationColumn = { - title: '鎿嶄綔', - dataIndex: 'action', - align: 'center', - scopedSlots: { customRender: 'action' } - } - this.columns = [...this.columns, operationColumn] - this.loadData(1) - }, - methods: { - handlePreview: function(record) { - if (record.referenceFile) { - try { - let file = JSON.parse(record.referenceFile) - this.$refs.lxFilePreview.preview(file.filePath) - } catch (e) { - console.error(e) - this.$message.error(e.message) - } - } else { - this.$message.warning('鍙傝�冩枃浠朵负绌猴紒') + export default { + name: 'EamMaintenanceStandardList', + mixins: [JeecgListMixin], + props: { + isDisplayOperation: { + type: Boolean, + default: true } }, - clickThenSelect(record) { + components: { + LxSearchEquipmentSelect, + EamMaintenanceStandardModal, + EamMaintenanceStandardDetailList + }, + data() { return { - style: { - cursor: 'pointer' - }, - on: { - click: () => { - this.onSelectChange(record.id.split(','), [record]) + description: '淇濆吇瑙勮寖椤甸潰', + disableMixinCreated: true, + // 琛ㄥご + columns: [ + { + title: '缁熶竴缂栫爜', + align: 'center', + dataIndex: 'equipmentCode' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName' + }, + { + title: '璁惧鍨嬪彿', + align: 'center', + dataIndex: 'equipmentModel' + }, + { + title: '淇濆吇鍒嗙被', + align: 'center', + dataIndex: 'maintenanceCategory_dictText', + width: 100 + }, + { + title: '瑙勮寖缂栫爜', + align: 'center', + dataIndex: 'standardCode', + width: 150 + }, + { + title: '瑙勮寖鍚嶇О', + align: 'center', + dataIndex: 'standardName' + }, + { + title: '淇濆吇鍛ㄦ湡', + align: 'center', + dataIndex: 'maintenancePeriod', + width: 100 + }, + { + title: '淇濆吇鍛ㄦ湡鍗曚綅', + align: 'center', + dataIndex: 'periodUnit', + width: 120 + }, + { + title: '鍒濆鏃ユ湡', + align: 'center', + dataIndex: 'initialDate', + width: 100 + }, + { + title: '瑙勮寖鐘舵��', + align: 'center', + dataIndex: 'standardStatus_dictText' + }, + { + title: '瑙勮寖鐗堟湰', + align: 'center', + dataIndex: 'standardVersion', + width: 100 } - } + ], + url: { + list: '/eam/maintenanceStandard/list', + delete: '/eam/maintenanceStandard/delete', + deleteBatch: '/eam/maintenanceStandard/deleteBatch', + exportXlsUrl: 'eam/maintenanceStandard/exportXls', + inspectionImportExcel: 'eam/maintenanceStandard/inspectionImportExcel', + weekMaintenanceImportExcel: 'eam/maintenanceStandard/weekMaintenanceImportExcel', + secondMaintenanceImportExcel: 'eam/maintenanceStandard/secondMaintenanceImportExcel', + thirdMaintenanceImportExcel: 'eam/maintenanceStandard/thirdMaintenanceImportExcel', + inspectionXlsDownloadUrl: '瀵煎叆妯℃澘/鐐规鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', + weekMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/鍛ㄤ繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', + secondMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/浜屼繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', + thirdMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/涓変繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', + abolish: '/eam/maintenanceStandard/abolish' + }, + standardId: '-1' } }, - onClearSelected() { - this.selectedRowKeys = [] - this.selectionRows = [] - this.standardId = '-1' - }, - onSelectChange(selectedRowKeys, selectionRows) { - this.selectedRowKeys = selectedRowKeys - this.selectionRows = selectionRows - if (selectedRowKeys.length === 1) { - this.standardId = selectedRowKeys[0] - } else { - this.standardId = '-1' + computed: { + inspectionImportExcel: function() { + return `${window._CONFIG['domianURL']}/${this.url.inspectionImportExcel}` + }, + weekMaintenanceImportExcel: function() { + return `${window._CONFIG['domianURL']}/${this.url.weekMaintenanceImportExcel}` + }, + secondMaintenanceImportExcel: function() { + return `${window._CONFIG['domianURL']}/${this.url.secondMaintenanceImportExcel}` + }, + thirdMaintenanceImportExcel: function() { + return `${window._CONFIG['domianURL']}/${this.url.thirdMaintenanceImportExcel}` } }, - searchReset() { - this.standardId = '-1' - this.queryParam = {} - this.loadData(1) - }, - handleTemplateXlsDownload(url) { - templateXlsDownload(url) - }, - handleAbolish: function (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 - }); + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + this.columns = [...this.columns, operationColumn] + this.loadData(1) + }, + methods: { + clickThenSelect(record) { + return { + style: { + cursor: 'pointer' + }, + on: { + click: () => { + this.onSelectChange(record.id.split(','), [record]) + } + } } - }); - }, - handleUpgrade(record) { - //鍗囩増 - this.$refs.modalForm.upgrade(record); - this.$refs.modalForm.title = "鍗囩増"; - this.$refs.modalForm.disableSubmit = false; - }, + }, + + onClearSelected() { + this.selectedRowKeys = [] + this.selectionRows = [] + this.standardId = '-1' + }, + + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectionRows + if (selectedRowKeys.length === 1) { + this.standardId = selectedRowKeys[0] + } else { + this.standardId = '-1' + } + }, + + handleTemplateXlsDownload(url) { + templateXlsDownload(url) + }, + + handleUpgrade(record) { + //鍗囩増 + this.$refs.modalForm.upgrade(record) + this.$refs.modalForm.title = '鍗囩増' + this.$refs.modalForm.disableSubmit = false + }, + + searchReset() { + this.standardId = '-1' + this.queryParam = {} + this.loadData(1) + } + } } -} -</script> -<style scoped> -@import '~@assets/less/common.less'; -</style> \ No newline at end of file +</script> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue b/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue index 51fcea1..ea3c9f1 100644 --- a/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue +++ b/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue @@ -21,131 +21,123 @@ </template> <script> -import '@/assets/less/TableExpand.less' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { getAction } from '@api/manage' + import '@/assets/less/TableExpand.less' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { getAction } from '@api/manage' -export default { - name: 'EamMaintenanceStandardDetailList', - mixins: [JeecgListMixin], - props: { - standardId: { - type: String, - required: true, - default: '-1' - } - }, - data() { - return { - description: '淇濆吇鏍囧噯鏄庣粏绠$悊椤甸潰', - // 琛ㄥご - columns: [ - { - title: '搴忓彿', - align: 'center', - dataIndex: 'itemCode', - width: 60, - }, - { - title: '閮ㄤ綅', - align: 'center', - dataIndex: 'itemPart', - width: 200, - ellipsis: true, - }, - { - title: '淇濆吇椤�', - align: 'center', - dataIndex: 'itemName', - ellipsis: true, - }, - { - title: '淇濆吇瑕佹眰', - align: 'center', - dataIndex: 'itemDemandAlias', - ellipsis: true, - }, - { - title: '妫�鏌ユ爣鍑嗘垨瑕佹眰', - align: 'center', - dataIndex: 'itemDemand', - ellipsis: true, - }, - { - title: '妫�鏌ユ柟娉�', - align: 'center', - dataIndex: 'checkMethod', - ellipsis: true, - } - ], - url: { - list: '/eam/eamMaintenanceStandardDetail/list' + export default { + name: 'EamMaintenanceStandardDetailList', + mixins: [JeecgListMixin], + props: { + standardId: { + type: String, + required: true, + default: '-1' } - } - }, - watch: { - standardId: { - immediate: true, - handler(val) { - if(val) { - this.loadData(1) - }else { - this.clearList(); + }, + data() { + return { + description: '淇濆吇鏍囧噯鏄庣粏绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '搴忓彿', + align: 'center', + dataIndex: 'itemCode', + width: 60 + }, + { + title: '閮ㄤ綅', + align: 'center', + dataIndex: 'itemPart', + ellipsis: true + }, + { + title: '淇濆吇椤瑰垎绫�', + align: 'center', + dataIndex: 'itemCategory_dictText', + ellipsis: true + }, + { + title: '淇濆吇椤圭洰', + align: 'center', + dataIndex: 'itemName', + ellipsis: true + }, + { + title: '淇濆吇瑙勮寖鎴栬姹�', + align: 'center', + dataIndex: 'itemDemand', + ellipsis: true + } + ], + url: { + list: '/eam/eamMaintenanceStandardDetail/list' } } - } - }, - created() { - }, - computed: { - }, - methods: { - loadData(arg) { - if (!this.url.list) { - this.$message.error('璇疯缃畊rl.list灞炴��!') - return + }, + watch: { + standardId: { + immediate: true, + handler(val) { + if (val) { + this.loadData(1) + } else { + this.clearList() + } + } } - if(this.standardId && this.standardId === '-1'){ - this.clearList(); - return; - } - //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 - if (arg === 1) { + }, + created() { + }, + computed: {}, + methods: { + loadData(arg) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + if (this.standardId && this.standardId === '-1') { + this.clearList() + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + let params = this.getQueryParams()//鏌ヨ鏉′欢 + if (!params) { + return false + } + this.dataSource = [] + params.standardId = this.standardId + this.loading = true + getAction(this.url.list, params).then((res) => { + if (res.success) { + // console.log(res) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + this.dataSource = res.result.records || res.result + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] this.ipagination.current = 1 } - let params = this.getQueryParams()//鏌ヨ鏉′欢 - if (!params) { - return false - } - this.dataSource = [] - params.standardId = this.standardId - this.loading = true - getAction(this.url.list, params).then((res) => { - if (res.success) { - // console.log(res) - //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - this.dataSource = res.result.records || res.result - if (res.result.total) { - this.ipagination.total = res.result.total - } else { - this.ipagination.total = 0 - } - //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - } else { - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - clearList() { - this.dataSource = [] - this.selectedRowKeys = [] - this.ipagination.current = 1 - }, + } } -} </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/base/modules/EamMaintenanceStandardModal.vue b/src/views/eam/base/modules/EamMaintenanceStandardModal.vue index a25d747..0ece138 100644 --- a/src/views/eam/base/modules/EamMaintenanceStandardModal.vue +++ b/src/views/eam/base/modules/EamMaintenanceStandardModal.vue @@ -8,75 +8,67 @@ @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + <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 prop="standardCode" label="瑙勮寖缂栫爜"> + <a-input placeholder="缂栫爜绯荤粺鑷姩鐢熸垚" v-model="model.standardCode" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="standardName" label="瑙勮寖鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ鑼冨悕绉�" v-model="model.standardName"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentId" label="缁熶竴缂栫爜"> + <lx-search-equipment-select placeholder="璇疯緭鍏ョ粺涓�缂栫爜鎴栧悕绉版悳绱�" v-model="model.equipmentId" :disabled="!editable"/> + </a-form-model-item> + </a-col> + </a-row> - <a-spin :spinning="confirmLoading"> - <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.standardCode" disabled /> + <a-form-model-item prop="maintenanceCategory" label="淇濆吇鍒嗙被"> + <j-dict-select-tag dict-code="maintenance_category" placeholder="璇烽�夋嫨淇濆吇鍒嗙被" + @change="handleMaintenanceCategoryChange" + v-model="model.maintenanceCategory" :disabled="!editable"/> </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" /> + <a-form-model-item label="淇濆吇鍛ㄦ湡鍗曚綅"> + <a-input readOnly v-model="model.periodUnit" placeholder="鏍规嵁淇濆吇鍒嗙被鑷姩甯﹀嚭"/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceCategory" label="淇濆吇鍒嗙被"> - <j-dict-select-tag dict-code="maintenance_category" placeholder="璇烽�夋嫨淇濆吇鍒嗙被" v-model="model.maintenanceCategory" :disabled="editable" /> + <a-form-model-item prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> + <a-input-number v-model="model.maintenancePeriod" placeholder="璇疯緭鍏ヤ繚鍏诲懆鏈�" :min="1" :precision="0" + style="width: 100%"/> </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="fileCode" label="鏂囦欢缂栧彿"> - <a-input placeholder="璇疯緭鍏ヤ繚鍏绘爣鍑嗘枃浠剁紪鍙�" v-model="model.fileCode"/> + <a-form-model-item prop="initialDate" label="鍒濆鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨鍒濆鏃ユ湡" v-model="model.initialDate" value-format="YYYY-MM-DD" + style="width: 100%"/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialDate" label="鍒濆鏃ユ湡"> - <a-date-picker placeholder="璇烽�夋嫨鍒濆鏃ユ湡" v-model="model.initialDate" format="YYYY-MM-DD" style="width: 100%" :disabled="editable"/> + <a-form-model-item label="瑙勮寖鐘舵��"> + <j-dict-select-tag dict-code="maintenance_standard_status" placeholder="鏍规嵁娴佺▼杩涘害鑷姩甯﹀嚭" + v-model="model.standardStatus" disabled/> </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" style="width: 100%"/> + <a-form-model-item label="瑙勮寖鐗堟湰"> + <a-input-number v-model="model.standardVersion" placeholder="鏍规嵁娴佺▼杩涘害鑷姩甯﹀嚭" style="width: 100%" 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="equipmentId" label="璁惧缂栧彿"> - <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" :disabled="editable"></lx-search-equipment-select> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardStatus" label="鏍囧噯鐘舵��"> - <j-dict-select-tag dict-code="maintenance_standard_status" v-model="model.standardStatus" disabled/> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardVersion" label="鏍囧噯鐗堟湰"> - <a-input-number v-model="model.standardVersion" style="width: 100%" disabled/> - </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="fileList"> - <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"> <j-vxe-table ref="editableDetailTable" @@ -91,7 +83,20 @@ :loading="detail.loading" :dataSource="detail.dataSource" :columns="detail.columns" - style="margin-top: 8px;"/> + style="margin-top: 8px;"> + <template v-slot:itemPart="props"> + <a-textarea v-model="props.row.itemPart" allowClear @change="$refs.editableDetailTable.validateTable()" + :placeholder="model.maintenanceCategory!='THIRD_MAINTENANCE'?'浠呬笁淇濋渶瑕佺淮鎶�':'璇疯緭鍏ラ儴浣�'" :rows="1" + autoSize :disabled="model.maintenanceCategory!='THIRD_MAINTENANCE'"/> + </template> + + <template v-slot:itemCategory="props"> + <j-dict-select-tag v-model="props.row.itemCategory" :dict-code="encodedDictCode" + @change="$refs.editableDetailTable.validateTable()" + :placeholder="getItemCategoryPlaceholder" + :disabled="!Boolean(model.maintenanceCategory)||model.maintenanceCategory=='THIRD_MAINTENANCE'"/> + </template> + </j-vxe-table> </a-row> </a-form-model> </a-spin> @@ -99,55 +104,56 @@ </template> <script> -import { getAction, httpAction } from '@/api/manage' + import { getAction, httpAction } from '@/api/manage' import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' import { JVXETypes } from '@/components/jeecg/JVxeTable' import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect' export default { - name: "EamMaintenanceStandardModal", + name: 'EamMaintenanceStandardModal', mixins: [JVxeTableModelMixin], components: { - LxSearchEquipmentSelect, + LxSearchEquipmentSelect }, - data () { + data() { return { - title:"鎿嶄綔", + title: '鎿嶄綔', visible: false, model: {}, - editable: false, + editable: true, upgradeFlag: false, labelCol: { xs: { span: 24 }, - sm: { span: 5 }, + sm: { span: 7 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 16 }, + sm: { span: 16 } }, confirmLoading: false, + spinning: false, validatorRules: { standardName: [ - { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�!' } + { required: true, message: '璇疯緭鍏ヨ鑼冨悕绉�', trigger: 'change' } ], maintenanceCategory: [ - { required: true, message: '璇烽�夋嫨淇濆吇鍒嗙被!' } + { required: true, message: '璇烽�夋嫨淇濆吇鍒嗙被', trigger: 'change' } ], initialDate: [ - { required: true, message: '璇烽�夋嫨鍒濆鏃ユ湡!' } + { required: true, message: '璇烽�夋嫨鍒濆鏃ユ湡', trigger: 'change' } ], maintenancePeriod: [ - { required: true, message: '璇疯緭鍏ヤ繚鍏诲懆鏈燂紝鍗曚綅锛氬ぉ!' } + { required: true, message: '璇疯緭鍏ヤ繚鍏诲懆鏈�', trigger: 'change' } ], equipmentId: [ - { required: true, message: '璇烽�夋嫨璁惧!' } + { required: true, message: '璇疯緭鍏ョ粺涓�缂栫爜鎴栧悕绉版悳绱�', trigger: 'change' } ] }, url: { - add: "/eam/maintenanceStandard/add", - edit: "/eam/maintenanceStandard/edit", - detail: "/eam/eamMaintenanceStandardDetail/queryList", - upgrade: '/eam/maintenanceStandard/upgrade', + add: '/eam/maintenanceStandard/add', + edit: '/eam/maintenanceStandard/edit', + detail: '/eam/eamMaintenanceStandardDetail/queryList', + upgrade: '/eam/maintenanceStandard/upgrade' }, detail: { loading: false, @@ -156,169 +162,249 @@ { title: 'ID', key: 'id', - type: JVXETypes.hidden, + type: JVXETypes.hidden }, { title: 'standardId', key: 'standardId', - type: JVXETypes.hidden, + type: JVXETypes.hidden }, { - title: '搴忓彿', + title: '椤圭洰搴忓彿', key: 'itemCode', type: JVXETypes.inputNumber, - align:"center", - width: 100, + align: 'center', + placeholder: '璇疯緭鍏ラ」鐩簭鍙�', + width: 150, validateRules: [ - {required : true, unique: true, message: '搴忓彿涓嶈兘閲嶅'} + { required: true, message: '璇疯緭鍏ラ」鐩簭鍙�' }, + { unique: true, message: '椤圭洰搴忓彿涓嶈兘閲嶅' } ] }, { title: '閮ㄤ綅', key: 'itemPart', - type: JVXETypes.textarea, - align:"center", + type: JVXETypes.slot, + slotName: 'itemPart', + placeholder: '璇疯緭鍏ラ儴浣�', + align: 'center', + validateRules: [{ handler: this.itemPartValidate }] }, { - title: '淇濆吇椤�', + title: '淇濆吇椤瑰垎绫�', + key: 'itemCategory', + type: JVXETypes.slot, + slotName: 'itemCategory', + align: 'center', + validateRules: [{ handler: this.itemCategoryValidate }] + }, + { + title: '淇濆吇椤圭洰', key: 'itemName', + placeholder: '璇疯緭鍏ヤ繚鍏婚」鐩�', type: JVXETypes.textarea, - align:"center", + align: 'center', validateRules: [ - {required : true, message: '淇濆吇椤逛笉鑳戒负绌猴紒'} + { required: true, message: '璇疯緭鍏ヤ繚鍏婚」鐩�' } ] }, { - title: '淇濆吇瑕佹眰', - key: 'itemDemandAlias', - type: JVXETypes.textarea, - align:"center", - }, - { - title: '妫�鏌ユ爣鍑嗘垨瑕佹眰', + title: '淇濆吇瑙勮寖鎴栬姹�', key: 'itemDemand', + placeholder: '璇疯緭鍏ヤ繚鍏昏鑼冩垨瑕佹眰', type: JVXETypes.textarea, - align:"center", + align: 'center', validateRules: [ - {required : true, message: "淇濆吇瑕佹眰涓嶈兘涓虹┖锛�"} + { required: true, message: '璇疯緭鍏ヤ繚鍏昏鑼冩垨瑕佹眰' } ] - }, - { - title: '妫�鏌ユ柟娉�', - key: 'checkMethod', - type: JVXETypes.textarea, - align:"center", - }, + } ], toolbarConfig: { // prefix 鍓嶇紑锛泂uffix 鍚庣紑 slot: ['prefix', 'suffix'], // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 btn: ['add', 'remove', 'clearSelection'] - }, + } } } }, - created () { + computed: { + getItemCategoryPlaceholder() { + if (!Boolean(this.model.maintenanceCategory)) return '璇烽�夋嫨淇濆吇鍒嗙被' + else { + if (this.model.maintenanceCategory != 'THIRD_MAINTENANCE') return '璇烽�夋嫨淇濆吇椤瑰垎绫�' + else return '涓変繚鏃犻渶缁存姢' + } + }, + + encodedDictCode() { + let suffix + if (!Boolean(this.model.maintenanceCategory) || this.model.maintenanceCategory === 'THIRD_MAINTENANCE') return + else suffix = this.model.maintenanceCategory.split('_')[1] + + const dictCode = `sys_dict_item,item_text,item_value,item_value like '%${suffix}' and dict_id='1940598438685134850'` + return encodeURIComponent(dictCode) + } }, methods: { - add () { - this.model = {}; - this.visible = true; - this.editable = false; - this.upgradeFlag = false; - this.detail.dataSource = []; + add() { + this.model = {} + this.visible = true + this.editable = true + this.upgradeFlag = false + this.detail.dataSource = [] }, - edit (record) { - this.model = Object.assign({}, record); - this.visible = true; - this.editable = true; - this.upgradeFlag = false; - this.detail.dataSource = []; - if(record && record.referenceFile) { - let obj = JSON.parse(record.referenceFile); - this.model.fileList = [obj]; - }else { - this.model.fieldList = []; - } - this.loadDetail(record.id); - }, - upgrade(record) { - this.model = Object.assign({}, record); - this.visible = true; - this.editable = true; - this.upgradeFlag = true; - this.detail.dataSource = []; - if(record && record.referenceFile) { - let obj = JSON.parse(record.referenceFile); - this.model.fileList = [obj]; - }else { - this.model.fieldList = []; - } - 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{ - if(this.upgradeFlag) { - httpurl+=this.url.upgrade; - }else { - httpurl+=this.url.edit; + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + this.editable = false + this.upgradeFlag = false + this.detail.dataSource = [] + this.loadDetail(record.id) + }, + + upgrade(record) { + this.model = Object.assign({}, record) + this.visible = true + this.editable = false + this.upgradeFlag = true + this.detail.dataSource = [] + this.loadDetail(record.id) + }, + + /** + * 淇濆吇鍒嗙被鍊兼敼鍙樻椂鍚屾椂鏀瑰彉淇濆吇鍛ㄦ湡鍗曚綅浠ュ強淇濆吇椤瑰垎绫� + * @param value 淇濆吇鍒嗙被鍊� + */ + handleMaintenanceCategoryChange(value) { + switch (value) { + case 'THIRD_MAINTENANCE': + this.model.periodUnit = '骞�' + break + case 'SECOND_MAINTENANCE': + this.model.periodUnit = '鏈�' + break + case 'POINT_INSPECTION': + this.model.periodUnit = '澶�' + break + default: + delete this.model.periodUnit + } + + const tableData = this.$refs.editableDetailTable.getTableData() + tableData.forEach(item => { + if (value !== 'THIRD_MAINTENANCE') delete item.itemPart + delete item.itemCategory + }) + this.detail.dataSource = [...tableData] + console.log('tableData', tableData) + }, + + /** + * 淇濆吇閮ㄤ綅鏍¢獙 + * @param cellValue 杈撳叆鍊� + * @param callback 鍥炶皟鍑芥暟 + */ + itemPartValidate({ cellValue }, callback) { + if (this.model.maintenanceCategory === 'THIRD_MAINTENANCE') { + if (cellValue) callback(true) + else callback(false, '璇烽�夋嫨${title}') + } else { + callback(true) + } + }, + + /** + * 淇濆吇椤瑰垎绫绘牎楠� + * @param cellValue 杈撳叆鍊� + * @param callback 鍥炶皟鍑芥暟 + */ + itemCategoryValidate({ cellValue }, callback) { + if (this.model.maintenanceCategory === 'THIRD_MAINTENANCE') { + callback(true) + } else { + if (cellValue) callback(true) + else callback(false, '璇烽�夋嫨${title}') + } + }, + + // 鎻愪氦浜嬩欢 + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) return false + // 瑙﹀彂琛ㄥ崟楠岃瘉 + 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 { + if (this.upgradeFlag) { + httpUrl += this.url.upgrade + } else { + httpUrl += this.url.edit } - method = 'put'; + 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; + httpAction(httpUrl, this.model, method) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + that.close() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + that.confirmLoading = that.spinning = false + }) + } else { + return false } }) }, - handleCancel () { + + handleCancel() { this.close() }, + + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + //鍔犺浇璇︽儏鏁版嵁 loadDetail(standardId) { - this.detail.dataSource = []; + this.spinning = true + this.detail.dataSource = [] if (standardId) { - getAction(this.url.detail, { standardId: standardId }).then(res => { - if (res.success) { - this.detail.dataSource = [...res.result]; - } - }) + getAction(this.url.detail, { standardId }) + .then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + .finally(() => { + this.spinning = false + }) } } @@ -326,6 +412,12 @@ } </script> -<style lang="less" scoped> +<style scoped lang="less"> + /deep/ .ant-select-dropdown-menu { + text-align: left; + } + /deep/ textarea.ant-input { + resize: none; + } </style> \ No newline at end of file diff --git a/src/views/eam/equipment/EamEquipmentLedger.vue b/src/views/eam/equipment/EamEquipmentLedger.vue index ac6cb61..79d620d 100644 --- a/src/views/eam/equipment/EamEquipmentLedger.vue +++ b/src/views/eam/equipment/EamEquipmentLedger.vue @@ -92,19 +92,9 @@ style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� <a style="margin-left: 24px" @click="onSelectChange([])">娓呯┖</a> </div> - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - :scroll="{ x: 'max-content' }" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange" - > + <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" + :pagination="ipagination" :loading="loading" :scroll="{ x: 'max-content' }" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> <!--缁熶竴缂栫爜--> <template slot="equipmentCode" slot-scope="text"> <a href="#" @click="handleDetail(record)" style="display: inline-block;height: 100%">{{text}}</a> @@ -139,6 +129,7 @@ <a @click.stop="handleEdit(record)">缂栬緫</a> <a-divider type="vertical"/> + <a-dropdown> <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a> <a-menu slot="overlay"> @@ -298,7 +289,7 @@ { title: '缁翠慨鐝粍', align: 'center', - dataIndex: 'repairDepartOrgCode' + dataIndex: 'repairDepartOrgCode_dictText' }, { title: '瀹夊叏閰嶇疆', @@ -441,7 +432,7 @@ dataIndex: 'nextThirdMaintenance' }, { - title: '涓変繚鍛ㄦ湡', + title: '涓変繚鍛ㄦ湡锛堝勾锛�', align: 'center', dataIndex: 'thirdMaintenancePeriod' }, @@ -456,7 +447,7 @@ dataIndex: 'nextTechnologyCheck' }, { - title: '鎶�鏈壌瀹氬懆鏈�', + title: '鎶�鏈壌瀹氬懆鏈燂紙骞达級', align: 'center', dataIndex: 'technologyCheckPeriod' }, @@ -541,7 +532,4 @@ } } } -</script> -<style scoped> - @import '~@assets/less/common.less'; -</style> \ No newline at end of file +</script> \ 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 49a8cd4..4db5113 100644 --- a/src/views/eam/equipment/modules/EamEquipmentModal.vue +++ b/src/views/eam/equipment/modules/EamEquipmentModal.vue @@ -24,7 +24,7 @@ </a-col> <a-col :span="customSpan"> <a-form-model-item prop="equipmentCode" label="缁熶竴缂栫爜"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode"/> + <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="!editable"/> </a-form-model-item> </a-col> <a-col :span="customSpan"> @@ -35,7 +35,7 @@ <a-col :span="customSpan"> <a-form-model-item prop="factoryOrgCode" label="浣跨敤閮ㄩ棬"> <a-tree-select v-model="model.factoryOrgCode" style="width: 100%" show-search - :tree-data="productionTreeData" + :tree-data="productionTreeData" :disabled="!editable" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬" allow-clear treeNodeFilterProp="title" :replaceFields="{key:'orgCode',value:'orgCode'}" @@ -47,7 +47,7 @@ <a-row> <a-col :span="customSpan"> <a-form-model-item prop="equipmentCategory" label="鎵�灞炲垎绫�"> - <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨鎵�灞炲垎绫�" + <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨鎵�灞炲垎绫�" :disabled="!editable" v-model="model.equipmentCategory"/> </a-form-model-item> </a-col> @@ -216,7 +216,8 @@ <a-row> <a-col :span="customSpan"> <a-form-model-item label="鏈涓変繚鏃ユ湡"> - <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD" style="width:100%"/> + <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD" + :disabled="!editable" style="width:100%"/> </a-form-model-item> </a-col> <a-col :span="customSpan"> @@ -225,14 +226,15 @@ </a-form-model-item> </a-col> <a-col :span="customSpan"> - <a-form-model-item label="涓変繚鍛ㄦ湡"> - <a-input-number placeholder="璇疯緭鍏ヤ笁淇濆懆鏈�" v-model="model.thirdMaintenancePeriod" :min="0" + <a-form-model-item label="涓変繚鍛ㄦ湡锛堝勾锛�"> + <a-input-number placeholder="璇疯緭鍏ヤ笁淇濆懆鏈燂紙骞达級" v-model="model.thirdMaintenancePeriod" :min="1" style="width: 100%"/> </a-form-model-item> </a-col> <a-col :span="customSpan"> <a-form-model-item label="鏈鎶�鏈壌瀹氭棩鏈�"> - <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD" style="width:100%"/> + <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD" + :disabled="!editable" style="width:100%"/> </a-form-model-item> </a-col> </a-row> @@ -244,8 +246,8 @@ </a-form-model-item> </a-col> <a-col :span="customSpan"> - <a-form-model-item label="鎶�鏈壌瀹氬懆鏈�"> - <a-input-number placeholder="璇疯緭鍏ユ妧鏈壌瀹氬懆鏈�" v-model="model.technologyCheckPeriod" :min="0" + <a-form-model-item label="鎶�鏈壌瀹氬懆鏈燂紙骞达級"> + <a-input-number placeholder="璇疯緭鍏ユ妧鏈壌瀹氬懆鏈燂紙骞达級" v-model="model.technologyCheckPeriod" :min="1" style="width: 100%"/> </a-form-model-item> </a-col> @@ -355,7 +357,7 @@ }, methods: { add() { - this.editable = false + this.editable = true //鍒濆鍖栭粯璁ゅ�� this.model = { operationSystem: 1, @@ -365,7 +367,7 @@ }, edit(record) { - this.editable = true + this.editable = false this.model = Object.assign({}, record) this.visible = true }, @@ -376,32 +378,34 @@ this.$refs.form.validate(valid => { if (valid) { that.confirmLoading = true - let httpurl = '' + let httpUrl = '' let method = '' if (!this.model.id) { - httpurl += this.url.add + httpUrl += this.url.add method = 'post' } else { - httpurl += this.url.edit + httpUrl += this.url.edit method = 'put' } - httpAction(httpurl, this.model, method).then((res) => { - if (res.success) { - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.$emit('ok') - that.close() - } else { - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - that.confirmLoading = false - }) + httpAction(httpUrl, this.model, method) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + that.close() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + that.confirmLoading = false + }) } else { return false } diff --git a/src/views/eam/maintenance/EamInspectionOrderList.vue b/src/views/eam/maintenance/EamInspectionOrderList.vue index 775a14e..c67e2f4 100644 --- a/src/views/eam/maintenance/EamInspectionOrderList.vue +++ b/src/views/eam/maintenance/EamInspectionOrderList.vue @@ -10,12 +10,7 @@ @keyup.enter.native="searchQuery" > <a-row :gutter="24"> - <a-col - :xl="4" - :lg="7" - :md="8" - :sm="24" - > + <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="宸ュ崟鍙�"> <a-input placeholder="璇疯緭鍏ュ伐鍗曞彿" @@ -23,69 +18,27 @@ ></a-input> </a-form-item> </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> + <a-col :xl="5" :lg="7" :md="8" :sm="24"> + <a-form-item label="缁熶竴缂栫爜"> + <lx-search-equipment-select placeholder="璇疯緭鍏ョ粺涓�缂栫爜鎴栧悕绉版悳绱�" v-model="queryParam.equipmentId"/> </a-form-item> </a-col> - <a-col - :xl="6" - :lg="7" - :md="8" - :sm="24" - > + <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-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-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" - /> + <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="info" - @click="searchReset" - icon="reload" - style="margin-left: 8px" - >閲嶇疆</a-button> + <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="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> </span> </a-col> </a-row> @@ -94,431 +47,374 @@ <!-- 鏌ヨ鍖哄煙-END --> <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div - class="table-operator" - v-if="isDisplayOperation" - > - <a-button - @click="handleAdd" - type="primary" - icon="plus" - v-if="isShowAuth('eam:inspection:add')" - >鏂板</a-button> + <div class="table-operator" v-if="isDisplayOperation"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> - <a-menu-item - key="1" - v-if="isShowAuth('eam:inspection:abolish')" - @click="batchZf('ABOLISH')" - > - <a-icon type="snippets" /> + <a-menu-item key="1" @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 key="2" @click="batchLq('UNDER_INSPECTION')"> + <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;" - 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 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> - <a-table - ref="table" - size="middle" - :scroll="{x:true}" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - class="j-table-force-nowrap" - @change="handleTableChange" - > + <a-table ref="table" size="middle" :scroll="{x:true}" bordered rowKey="id" :columns="columns" + :dataSource="dataSource" :pagination="ipagination" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" class="j-table-force-nowrap" + @change="handleTableChange"> + <span slot="action" slot-scope="text, record"> + <template v-if=" record.inspectionStatus === 'WAIT_INSPECTION'"> + <a @click="handleEdit(record)">缂栬緫</a> - <span - slot="action" - slot-scope="text, record" - > - <a - @click="handleEdit(record)" - v-if="isShowAuth('eam:inspection:edit') && record.inspectionStatus === 'WAIT_INSPECTION'" - >缂栬緫</a> + <a-divider type="vertical"/> - <a-divider - type="vertical" - v-if="isShowAuth('eam:inspection:edit') && record.inspectionStatus === 'WAIT_INSPECTION'" - /> - - <a-popconfirm - title="纭畾棰嗗彇鍚�?" - v-if="isShowAuth('eam:inspection:collect') && record.inspectionStatus === 'WAIT_INSPECTION'" - @confirm="() => handleInspection(record.id)" - > + <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handleInspection(record.id)"> <a>棰嗗彇</a> </a-popconfirm> - <a-divider - type="vertical" - v-if="isShowAuth('eam:inspection:collect') && record.inspectionStatus === 'WAIT_INSPECTION'" - /> + <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> <a @click="handleDetail(record)">璇︽儏</a> </a-menu-item> - <a-menu-item v-if="isShowAuth('eam:inspection:abolish') && record.inspectionStatus === 'WAIT_INSPECTION'"> - <a-popconfirm - title="纭畾浣滃簾鍚�?" - @confirm="() => handleOrReceive(record.id)" - > + + <a-menu-item> + <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleOrReceive(record.id)"> <a>浣滃簾</a> </a-popconfirm> </a-menu-item> </a-menu> </a-dropdown> + </template> - <a-divider - v-if="record.inspectionStatus === 'COMPLETE'" - type="vertical" - /> - <a - v-if="record.inspectionStatus === 'COMPLETE'" - @click="handlePrint(record)" - >鎵撳嵃</a> + <a v-else @click="handleDetail(record)">璇︽儏</a> + + <template v-if="record.inspectionStatus === 'COMPLETE'"> + <a-divider type="vertical"/> + + <a @click="handlePrint(record)">鎵撳嵃</a> + </template> </span> </a-table> </div> - <eam-inspection-order-modal - ref="modalForm" - @ok="modalFormOk" - ></eam-inspection-order-modal> + <eam-inspection-order-modal ref="modalForm" @ok="modalFormOk"/> - <inspection-order-handle - ref="modalFormXq" - :selectShenpiData="selectInspectionOrderXqData" - /> + <inspection-order-handle ref="modalFormXq" :selectShenpiData="selectInspectionOrderXqData"/> </a-card> </template> <script> -import '@/assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import EamInspectionOrderModal from './modules/EamInspectionOrderModal' -import { deleteAction, getAction } from '@api/manage' -import InspectionOrderHandle from '../../flowable/workflow/InspectionOrder/InspectionOrderHandle' -import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import EamInspectionOrderModal from './modules/EamInspectionOrderModal' + 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], - components: { - InspectionOrderHandle, - EamInspectionOrderModal, - LxSearchEquipmentSelect, - }, - 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 + export default { + name: 'EamInspectionOrderList', + mixins: [JeecgListMixin, mixinDevice], + components: { + InspectionOrderHandle, + EamInspectionOrderModal, + LxSearchEquipmentSelect + }, + 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 + } + }, + { + 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: 'inspectionDate', + customRender: function(text) { + return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) + } + }, + { + title: '鐐规杩囨湡鏃ユ湡', + align: 'center', + dataIndex: 'expirationTime', + customRender: function(text) { + return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) + } + }, + { + title: '鍒涘缓鏂瑰紡', + align: 'center', + dataIndex: 'creationMethod_dictText' + }, + { + title: '鐐规鐘舵��', + align: 'center', + dataIndex: 'inspectionStatus_dictText' + }, + { + title: '鐐规浜�', + align: 'center', + dataIndex: 'operator_dictText' + }, + { + title: '鐐规鏃堕棿', + align: 'center', + dataIndex: 'operateTime' + }, + { + title: '绠$悊鍛樼‘璁�', + align: 'center', + dataIndex: 'confirmUser_dictText' + }, + { + title: '纭鏃堕棿', + align: 'center', + dataIndex: 'confirmTime' + }, + { + 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' }, - { - 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: 'inspectionDate', - customRender: function (text) { - return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) - } - }, - { - title: '鐐规杩囨湡鏃ユ湡', - align: 'center', - dataIndex: 'expirationTime', - customRender: function (text) { - return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) - } - }, - { - title: '鍒涘缓鏂瑰紡', - align: 'center', - dataIndex: 'creationMethod_dictText' - }, - { - title: '鐐规鐘舵��', - align: 'center', - dataIndex: 'inspectionStatus_dictText' - }, - { - title: '鐐规浜�', - align: 'center', - dataIndex: 'operator_dictText' - }, - { - title: '鐐规鏃堕棿', - align: 'center', - dataIndex: 'operateTime', - }, - { - title: '绠$悊鍛樼‘璁�', - align: 'center', - dataIndex: 'confirmUser_dictText' - }, - { - title: '纭鏃堕棿', - align: 'center', - dataIndex: 'confirmTime', - }, - { - 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' + dictOptions: {}, + superFieldList: [], + selectInspectionOrderXqData: {} + } + }, + created() { + 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}` + } + }, + methods: { + initDictConfig() { }, - dictOptions: {}, - superFieldList: [], - selectInspectionOrderXqData: {} - } - }, - created() { - 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}` - } - }, - methods: { - initDictConfig() { - }, - //璇︽儏 - handleDetail: function (record) { - 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!') - return - } - var that = this - getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => { - if (res.success) { - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - }, - handleOrReceive(id) { - if (!this.url.cancelInspectionOrder) { - this.$message.error('璇疯缃畊rl.cancelInspectionOrder!') - return - } - var that = this - getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => { - if (res.success) { - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - }, - batchZf(type) { - if (this.selectedRowKeys.length <= 0) { - this.$notification.warning({ - message: '娑堟伅', - description: '璇烽�夋嫨涓�鏉¤褰�' - }) - } else { - var ids = '' - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ',' + //璇︽儏 + handleDetail: function(record) { + 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!') + return } var that = this - this.$confirm({ - 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() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - that.loading = false + getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message }) } }) - } - }, - batchLq(type) { - if (this.selectedRowKeys.length <= 0) { - this.$notification.warning({ - message: '娑堟伅', - description: '璇烽�夋嫨涓�鏉¤褰�' - }) - } else { - var ids = '' - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ',' + }, + handleOrReceive(id) { + if (!this.url.cancelInspectionOrder) { + this.$message.error('璇疯缃畊rl.cancelInspectionOrder!') + return } var that = this - this.$confirm({ - 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() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - that.loading = false + getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message }) } }) - } - }, - onInspectionDateChange: function (value, dateString) { - this.queryParam.inspectionDateBegin = dateString[0] - this.queryParam.inspectionDateEnd = dateString[1] - }, + }, + batchZf(type) { + if (this.selectedRowKeys.length <= 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + } 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 + getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => { + if (res.success) { + 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 + }) + } + }) + } + }, + batchLq(type) { + if (this.selectedRowKeys.length <= 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + } 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 + getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => { + if (res.success) { + 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 + }) + } + }) + } + }, + onInspectionDateChange: function(value, dateString) { + this.queryParam.inspectionDateBegin = dateString[0] + this.queryParam.inspectionDateEnd = dateString[1] + }, - handlePrint(record) { - let href = `${window._CONFIG['domianURL']}/jmreport/view/1094871242505912320?id=` + record.id + `&equipmentId=` + record.equipmentId + `&inspectionDate=` + record.inspectionDate; //缃戠珯閾炬帴 - window.open(href, "_blank"); - }, + handlePrint(record) { + let href = `${window._CONFIG['domianURL']}/jmreport/view/1094871242505912320?id=` + record.id + `&equipmentId=` + record.equipmentId + `&inspectionDate=` + record.inspectionDate //缃戠珯閾炬帴 + window.open(href, '_blank') + } + } } -} </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/EamInspectionOrderModal.vue b/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue index 61258e3..8a81706 100644 --- a/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue +++ b/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue @@ -1,40 +1,31 @@ <template> - <j-modal - :title="title" - :width="1200" - :visible="visible" - :confirmLoading="confirmLoading" - switchFullscreen - centered - :mask-closable="false" - @ok="handleOk" - @cancel="handleCancel" - cancelText="鍏抽棴"> + <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen centered + :mask-closable="false" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> <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 prop="standardCode" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" v-model="model.orderNum" readOnly/> + <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item prop="equipmentId" label="璁惧缂栧彿"> - <MaintenanceEquipmentSelect placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" + <a-form-model-item prop="equipmentId" label="缁熶竴缂栫爜"> + <MaintenanceEquipmentSelect placeholder="璇疯緭鍏ョ粺涓�缂栫爜鎴栧悕绉版悳绱�" v-model="model.equipmentId" :maintenanceCategory="maintenanceCategory" :disabled="disabled" @autocompleteForm="autocompleteForm"/> </a-form-model-item> </a-col> <a-col :span="8"> - <a-form-model-item prop="standardName" label="鏍囧噯鍚嶇О"> + <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 prop="standardCode" label="鏍囧噯缂栫爜"> + <a-form-model-item prop="standardCode" label="瑙勮寖缂栫爜"> <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.standardCode"/> </a-form-model-item> </a-col> @@ -73,19 +64,9 @@ </a-col> </a-row> <a-row :gutter="24"> - <j-vxe-table - ref="editableDetailTable" - :rowNumber="true" - :rowSelection="true" - :bordered="true" - :alwaysEdit="true" - :toolbar="true" - keep-source - :height="300" - :loading="detail.loading" - :dataSource="detail.dataSource" - :columns="detail.columns" - style="margin-top: 8px;"/> + <j-vxe-table ref="editableDetailTable" :rowNumber="true" :rowSelection="true" :bordered="true" + :alwaysEdit="true" :toolbar="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> @@ -123,16 +104,16 @@ disabled: false, validatorRules: { // standardName: [ - // { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�!' } + // { required: true, message: '璇疯緭鍏ヨ鑼冨悕绉�!' } // ], inspectionDate: [ - { required: true, message: '璇烽�夋嫨鐐规鏃ユ湡!' } + { required: true, message: '璇烽�夋嫨鐐规鏃ユ湡', trigger: 'change' } ], // maintenancePeriod: [ // { required: true, message: '璇疯緭鍏ヤ繚鍏诲懆鏈燂紝鍗曚綅锛氬ぉ!' } // ], equipmentId: [ - { required: true, message: '璇烽�夋嫨璁惧!' } + { required: true, message: '璇烽�夋嫨璁惧', trigger: 'change' } ] }, url: { @@ -157,7 +138,8 @@ width: '10%', align: 'center', validateRules: [ - { required: true, unique: true, message: '搴忓彿涓嶈兘閲嶅' } + { required: true, message: '璇疯緭鍏�${title}' }, + { unique: true, message: '搴忓彿涓嶈兘閲嶅' } ] }, { @@ -167,7 +149,7 @@ width: '20%', align: 'center', validateRules: [ - { required: true, message: '淇濆吇椤逛笉鑳戒负绌猴紒' } + { required: true, message: '璇疯緭鍏�${title}' } ] }, { @@ -177,14 +159,12 @@ width: '30%', align: 'center', validateRules: [ - { required: true, message: '淇濆吇瑕佹眰涓嶈兘涓虹┖锛�' } + { required: true, message: '璇疯緭鍏�${title}' } ] } ] } } - }, - created() { }, methods: { add() { -- Gitblit v1.9.3