| | |
| | | |
| | | <a-divider type="vertical"/> |
| | | |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | |
| | | <a-divider type="vertical"/> |
| | | |
| | | <a-popconfirm title="ç¡®å®ä½åºå?" @confirm="() => handlerAbolish(record.id)"> |
| | | <a>ä½åº</a> |
| | | </a-popconfirm> |
| | | |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down"/></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®ä½åºå?" @confirm="() => handleAbolish(record.id)"> |
| | | <a>ä½åº</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </template> |
| | | |
| | | <template v-else> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal :title="title" :width="1200" :visible="visible" switchFullscreen centered |
| | | :okButtonProps="{ class:{'jee-hidden': true} }" @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-spin :spinning="spinning"> |
| | | <a-tabs default-active-key="1"> |
| | | <a-tab-pane tab="æä½å·¥" key="1"> |
| | | <j-vxe-table rowNumber bordered keep-source :height="500" :dataSource="detail.operatorMaintenanceList" |
| | | :columns="detail.columns"/> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="维修工" key="2" forceRender> |
| | | <j-vxe-table rowNumber bordered keep-source :height="500" :dataSource="detail.repairerMaintenanceList" |
| | | :columns="detail.columns"/> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, httpAction } from '@/api/manage' |
| | | import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' |
| | | import { JVXETypes } from '@comp/jeecg/JVxeTable' |
| | | |
| | | export default { |
| | | name: 'EamSecondMaintenanceBatchOrderDetailModal', |
| | | components: { MaintenanceEquipmentSelect }, |
| | | data() { |
| | | return { |
| | | title: 'é¢è§æç»', |
| | | visible: false, |
| | | spinning: false, |
| | | url: { |
| | | standardDetail: '/eam/eamMaintenanceStandardDetail/queryList' |
| | | }, |
| | | detail: { |
| | | operatorMaintenanceList: [], |
| | | repairerMaintenanceList: [], |
| | | columns: [ |
| | | { |
| | | title: 'ID', |
| | | key: 'id', |
| | | type: JVXETypes.hidden |
| | | }, |
| | | { |
| | | title: 'orderId', |
| | | key: 'orderId', |
| | | type: JVXETypes.hidden |
| | | }, |
| | | { |
| | | title: 'åºå·', |
| | | key: 'itemCode', |
| | | type: JVXETypes.normal, |
| | | width: 60, |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹', |
| | | key: 'itemName', |
| | | type: JVXETypes.normal, |
| | | align: 'center' |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è·åä¿å
»è§èæ°æ® |
| | | * @param standardId è§èId |
| | | */ |
| | | loadStandardDetail(standardId) { |
| | | this.spinning = true |
| | | getAction(this.url.standardDetail, { standardId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.detail.operatorMaintenanceList = res.result.filter(item => item.itemCategory == 'OPERATOR_MAINTENANCE') |
| | | this.detail.repairerMaintenanceList = res.result.filter(item => item.itemCategory == 'REPAIRER_MAINTENANCE') |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen centered |
| | | :mask-closable="false" @ok="handleOk" @cancel="handleCancel" cancelText="å
³é"> |
| | | <a-spin :spinning="spinning"> |
| | | <j-vxe-table ref="editableDetailTable" rowNumber rowSelection bordered alwaysEdit toolbar @added="addNewRow" |
| | | <j-vxe-table ref="editableDetailTable" rowNumber rowSelection bordered alwaysEdit toolbar |
| | | :toolbarConfig="detail.toolbarConfig" keep-source :height="500" |
| | | :dataSource="detail.dataSource" :columns="detail.columns"/> |
| | | :dataSource="detail.dataSource" :columns="detail.columns"> |
| | | <!--ç»ä¸ç¼ç --> |
| | | <template v-slot:equipmentId="props"> |
| | | <maintenance-equipment-select placeholder="请è¾å
¥ç»ä¸ç¼ç æåç§°æç´¢" v-model="props.row.equipmentId" |
| | | maintenanceCategory="SECOND_MAINTENANCE" :allowClear="false" |
| | | @autocompleteForm="autocompleteForm($event,props.row)"/> |
| | | </template> |
| | | |
| | | <!-- ä¿å
»æ¥æ--> |
| | | <template v-slot:maintenanceDate="props"> |
| | | <a-date-picker v-model="props.row.maintenanceDate" value-format="YYYY-MM-DD"/> |
| | | </template> |
| | | |
| | | <!-- æä½--> |
| | | <template v-slot:action="props"> |
| | | <a :disabled="!props.row.equipmentId" @click="handlePreviewDetail(props.row.standardId)">é¢è§æç»</a> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-spin> |
| | | |
| | | <eam-second-maintenance-batch-order-detail-modal ref="detailModal"/> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, httpAction } from '@/api/manage' |
| | | import { postAction } from '@/api/manage' |
| | | import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' |
| | | import { JVXETypes } from '@comp/jeecg/JVxeTable' |
| | | import EamSecondMaintenanceBatchOrderDetailModal from './EamSecondMaintenanceBatchOrderDetailModal' |
| | | |
| | | export default { |
| | | name: 'EamSecondMaintenanceBatchOrderModal', |
| | | components: { MaintenanceEquipmentSelect }, |
| | | components: { EamSecondMaintenanceBatchOrderDetailModal, MaintenanceEquipmentSelect }, |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | |
| | | }, |
| | | { |
| | | title: 'å·¥åå·', |
| | | dataIndex: 'orderNum', |
| | | key: 'orderNum', |
| | | align: 'center', |
| | | type: JVXETypes.inputNumber, |
| | | disabled: true, |
| | | placeholder: 'å·¥åå·ç³»ç»èªå¨çæ' |
| | | placeholder: '${title}ç³»ç»èªå¨çæ', |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: 'ç»ä¸ç¼ç ', |
| | | dataIndex: 'equipmentId', |
| | | key: 'equipmentId', |
| | | align: 'center', |
| | | type: JVXETypes.slot, |
| | | slotName: 'equipmentId' |
| | | slotName: 'equipmentId', |
| | | width: 300, |
| | | validateRules: [ |
| | | { required: true, message: '请è¾å
¥${title}æåç§°æç´¢' }, |
| | | { unique: true, message: '${title}ä¸è½éå¤' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'è§èåç§°', |
| | | dataIndex: 'standardName', |
| | | key: 'standardName', |
| | | align: 'center', |
| | | type: JVXETypes.input, |
| | | disabled: true, |
| | | placeholder: 'éæ©è®¾å¤åèªå¨å¸¦åº' |
| | | type: JVXETypes.normal, |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: 'ä¿å
»æ¥æ', |
| | | dataIndex: 'maintenanceDate', |
| | | key: 'maintenanceDate', |
| | | align: 'center', |
| | | type: JVXETypes.date |
| | | type: JVXETypes.slot, |
| | | width: 200, |
| | | slotName: 'maintenanceDate', |
| | | validateRules: [{ required: true, message: 'è¯·éæ©${title}' }] |
| | | }, |
| | | { |
| | | title: 'ä¿å
»å¨æ', |
| | | dataIndex: 'maintenancePeriod', |
| | | key: 'maintenancePeriod', |
| | | align: 'center', |
| | | type: JVXETypes.inputNumber, |
| | | defaultValue: '6' |
| | | type: JVXETypes.normal, |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: '夿³¨', |
| | | key: 'remark', |
| | | align: 'center', |
| | | type: JVXETypes.textarea, |
| | | placeholder: '请è¾å
¥å¤æ³¨', |
| | | width: 300 |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | type: JVXETypes.slot, |
| | | width: 150, |
| | | slotName: 'action', |
| | | fixed: 'right' |
| | | } |
| | | ], |
| | | toolbarConfig: { |
| | |
| | | this.detail.operatorMaintenanceList = this.detail.repairerMaintenanceList = [] |
| | | }, |
| | | |
| | | addNewRow({ row }) { |
| | | console.log('row', row) |
| | | row.maintenancePeriod = 6 |
| | | this.$refs.editableDetailTable.updateData() |
| | | handlePreviewDetail(standardId) { |
| | | this.$refs.detailModal.visible = true |
| | | this.$refs.detailModal.loadStandardDetail(standardId) |
| | | }, |
| | | |
| | | autocompleteForm(selectObj) { |
| | | this.$set(this.model, 'standardName', selectObj.standardName) |
| | | this.$set(this.model, 'standardId', selectObj.id) |
| | | this.$set(this.model, 'equipmentId', selectObj.equipmentId) |
| | | if (!this.model.id) this.loadStandardDetail(selectObj.id) |
| | | autocompleteForm(selectObj, record) { |
| | | this.$set(record, 'standardName', selectObj.standardName) |
| | | this.$set(record, 'standardId', selectObj.id) |
| | | this.$set(record, 'equipmentId', selectObj.equipmentId) |
| | | this.$set(record, 'maintenancePeriod', selectObj.maintenancePeriod) |
| | | this.$refs.editableDetailTable.validateTable() |
| | | }, |
| | | |
| | | async handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = that.spinning = true |
| | | let httpUrl = '' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpUrl += this.url.add |
| | | method = 'post' |
| | | const requests = this.$refs.editableDetailTable.getTableData() |
| | | if (requests.length == 0) { |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: '请è³å°æ°å¢ä¸æ¡è®°å½' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | const errMap = await this.$refs.editableDetailTable.validateTable() |
| | | if (errMap) return |
| | | |
| | | this.confirmLoading = this.spinning = true |
| | | postAction(this.url.batchAdd, requests) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | this.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | this.$emit('ok') |
| | | this.close() |
| | | } else { |
| | | httpUrl += this.url.edit |
| | | method = 'put' |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | 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 |
| | | } |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | this.confirmLoading = this.spinning = false |
| | | }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-select-dropdown-menu { |
| | | text-align: left; |
| | | } |
| | | </style> |