| | |
| | | </a-tabs> |
| | | </a-col> |
| | | |
| | | <a-col :span="model.maintenanceStatus&&model.maintenanceStatus!='WAIT_MAINTENANCE'?10:16" class="scroll-col"> |
| | | <a-tabs v-model="activeTabKey" @change="$refs.editableDetailTable.clearValidate()"> |
| | | <a-col :span="model.maintenanceStatus&&model.maintenanceStatus!=='WAIT_MAINTENANCE'?10:16" class="scroll-col"> |
| | | <a-tabs :active-key="activeTabKey" @change="handleTabChange"> |
| | | <a-tab-pane key="1" tab="保养项明细"> |
| | | <j-vxe-table ref="editableDetailTable" rowSelection bordered alwaysEdit keep-source :height="300" |
| | | :dataSource="detail.dataSource" :columns="detail.columns" |
| | | <j-vxe-table ref="editableDetailTable1" rowSelection bordered alwaysEdit keep-source |
| | | :dataSource="detail.maintenanceDetailList" :columns="detail.maintenanceDetailColumns" |
| | | @selectRowChange="handleTableSelectRowChange"> |
| | | <!--保养结果--> |
| | | <template v-slot:maintenanceResult="props"> |
| | | <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="third_maintenance_result" |
| | | placeholder="请选择保养结果" |
| | | :disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')" |
| | | :disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_MAINTENANCE')" |
| | | @change="handleResultSelectChange($event,props.row,'exceptionDescription')" |
| | | style="width: 100%"/> |
| | | </template> |
| | |
| | | <template v-slot:exceptionDescription="props"> |
| | | <a-textarea :rows="1" :autoSize="false" v-model="props.row.exceptionDescription" |
| | | :placeholder="props.row.maintenanceResult&&props.row.maintenanceResult!='NORMAL'?'请输入异常描述':''" |
| | | @blur="$refs.editableDetailTable.validateTable" |
| | | @blur="$refs.editableDetailTable1.validateTable" |
| | | :disabled="disableSubmit || |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE') || |
| | | (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_MAINTENANCE') || |
| | | !props.row.maintenanceResult || |
| | | props.row.maintenanceResult === 'NORMAL'"/> |
| | | </template> |
| | |
| | | <j-dict-select-tag v-model="props.row.firstInspectResult" |
| | | placeholder="请选择验收结果" |
| | | @change="handleResultSelectChange($event,props.row,'firstInspectException')" |
| | | :disabled="disableSubmit ||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_FIRST_ACCEPTANCE')" |
| | | :disabled="disableSubmit ||(model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_FIRST_ACCEPTANCE')" |
| | | dictCode="check_status" style="width: 100%"/> |
| | | </template> |
| | | |
| | |
| | | <template v-slot:firstInspectException="props"> |
| | | <a-textarea :rows="1" v-model="props.row.firstInspectException" |
| | | :placeholder="props.row.firstInspectResult&&props.row.firstInspectResult!='1'?'请输入异常描述':''" |
| | | @blur="$refs.editableDetailTable.validateTable" |
| | | @blur="$refs.editableDetailTable1.validateTable" |
| | | :disabled="disableSubmit || |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_FIRST_ACCEPTANCE')|| |
| | | (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_FIRST_ACCEPTANCE')|| |
| | | !props.row.firstInspectResult || |
| | | props.row.firstInspectResult === '1'" |
| | | dictCode="check_status" style="width: 100%;resize:none"/> |
| | |
| | | <!--第二次验收异常描述--> |
| | | <template v-slot:secondInspectException="props"> |
| | | <a-textarea :rows="1" v-model="props.row.secondInspectException" |
| | | :placeholder="props.row.secondInspectResult&&props.row.secondInspectResult!='1'?'请输入异常描述':''" |
| | | @blur="$refs.editableDetailTable.validateTable" |
| | | :placeholder="props.row.secondInspectResult&&props.row.secondInspectResult!=='1'?'请输入异常描述':''" |
| | | @blur="$refs.editableDetailTable1.validateTable" |
| | | :disabled="disableSubmit || |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_SECOND_ACCEPTANCE')|| |
| | | (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_SECOND_ACCEPTANCE')|| |
| | | !props.row.secondInspectResult || |
| | | props.row.secondInspectResult === '1'" |
| | | dictCode="check_status" style="width: 100%;resize:none"/> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane key="2" tab="备件使用明细" |
| | | v-if="model.maintenanceStatus&&model.maintenanceStatus!=='WAIT_CHECK'&&detail.sparePartsDetailList.length>0|| |
| | | (model.maintenanceStatus&&model.maintenanceStatus==='UNDER_MAINTENANCE')" |
| | | forceRender> |
| | | <j-vxe-table ref="editableDetailTable2" bordered alwaysEdit keep-source toolbar |
| | | :toolbar-config="detail.toolbarConfig" row-selection |
| | | :disabled="model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_MAINTENANCE'" |
| | | :dataSource="detail.sparePartsDetailList" :columns="detail.sparePartsDetailColumns"> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | |
| | | <template v-if="selectShenpiData.procInstId"> |
| | | <a-tab-pane key='2' tab='流程图'> |
| | | <a-tab-pane key='3' tab='流程图'> |
| | | <img :src="imageSrc" alt="Fetched Image"/> |
| | | </a-tab-pane> |
| | | </template> |
| | |
| | | <template slot="tabBarExtraContent"> |
| | | <a-space> |
| | | <a-button |
| | | v-if="activeTabKey=='1'" |
| | | :disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')||selectedRowKeys.length == 0" |
| | | v-if="activeTabKey==='1'" |
| | | :disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_MAINTENANCE')||selectedRowKeys.length === 0" |
| | | type="primary" @click="handleSelectAllMaintenanceResult">批量保养正常 |
| | | </a-button> |
| | | <a-button |
| | | v-if="activeTabKey=='1'" |
| | | :disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_FIRST_ACCEPTANCE')||selectedRowKeys.length == 0" |
| | | v-if="activeTabKey==='1'" |
| | | :disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_FIRST_ACCEPTANCE')||selectedRowKeys.length === 0" |
| | | type="primary" @click="handleSelectAllFirstAcceptanceResult">批量验收通过 |
| | | </a-button> |
| | | </a-space> |
| | |
| | | </a-tabs> |
| | | </a-col> |
| | | |
| | | <a-col v-if="model.maintenanceStatus&&model.maintenanceStatus!='WAIT_MAINTENANCE'" :span="6" |
| | | <a-col v-if="model.maintenanceStatus&&model.maintenanceStatus!=='WAIT_MAINTENANCE'" :span="6" |
| | | class="scroll-col"> |
| | | <a-tabs v-if="displayEvaluationFlag"> |
| | | <a-tab-pane tab="保养前技术状态鉴定"> |
| | |
| | | prop="fullyFunctional" label="设备功能是否齐全"> |
| | | <j-dict-select-tag type='radio' v-model='model.fullyFunctional' dictCode='yn' |
| | | @change="handleCheckRadioChange" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='WAIT_CHECK')"/> |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!=='WAIT_CHECK')"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" |
| | | prop="runningNormally" label="设备能否正常运转"> |
| | | <j-dict-select-tag type='radio' v-model='model.runningNormally' dictCode='yn' |
| | | @change="handleCheckRadioChange" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='WAIT_CHECK')"/> |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!=='WAIT_CHECK')"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item v-if="model.fullyFunctional=='0'||model.runningNormally=='0'" |
| | | <a-form-model-item v-if="model.fullyFunctional==='0'||model.runningNormally==='0'" |
| | | :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="问题描述"> |
| | | <a-textarea v-model='model.problemDescription' placeholder="请描述问题" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='WAIT_CHECK')"/> |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!=='WAIT_CHECK')"/> |
| | | </a-form-model-item> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="协助操作人"> |
| | | <a-input v-model="model.assistantOperator" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='OPERATOR_SIGNATURE')" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!=='OPERATOR_SIGNATURE')" |
| | | placeholder="请输入协助操作人"/> |
| | | </a-form-model-item> |
| | | </a-tab-pane> |
| | |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="协助维修人"> |
| | | <a-input v-model="model.assistantRepairman" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='REPAIRMAN_SIGNATURE')" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!=='REPAIRMAN_SIGNATURE')" |
| | | placeholder="请输入协助维修人"/> |
| | | </a-form-model-item> |
| | | </a-tab-pane> |
| | |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@comp/jeecg/JVxeTable' |
| | | import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' |
| | | import ATextarea from 'ant-design-vue/es/input/TextArea' |
| | | |
| | | export default { |
| | | name: 'ThirdMaintenanceApprovalModal', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | ATextarea, |
| | | MaintenanceEquipmentSelect |
| | | }, |
| | | props: { |
| | |
| | | }, |
| | | url: { |
| | | queryById: '/eam/thirdMaintenanceOrder/queryById', |
| | | detail: '/eam/thirdMaintenanceOrderDetail/queryList', |
| | | maintenanceDetail: '/eam/thirdMaintenanceOrderDetail/queryList', |
| | | sparePartsDetail: '/eam/eamThirdMaintenanceSpare/queryList', |
| | | approval: '/eam/thirdMaintenanceOrder/approval', |
| | | diagramView: '/assign/flow/diagramView' |
| | | }, |
| | | disableSubmit: false, |
| | | selectedRowKeys: [], |
| | | detail: { |
| | | dataSource: [], |
| | | columns: [], |
| | | defaultColumns: [ |
| | | maintenanceDetailList: [], |
| | | sparePartsDetailList: [], |
| | | maintenanceDetailColumns: [], |
| | | defaultMaintenanceDetailColumns: [ |
| | | { |
| | | title: 'ID', |
| | | key: 'id', |
| | |
| | | { handler: this.maintenanceExceptionDescriptionValidator } |
| | | ] |
| | | } |
| | | ] |
| | | ], |
| | | sparePartsDetailColumns: [ |
| | | { |
| | | title: '备件序号', |
| | | key: 'spareCode', |
| | | type: JVXETypes.inputNumber, |
| | | placeholder: '请输入${title}', |
| | | width: 150, |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: true, message: '请输入${title}' }, |
| | | { unique: true, message: '${title}不能重复' } |
| | | ] |
| | | }, |
| | | { |
| | | title: '备件名称', |
| | | key: 'spareName', |
| | | type: JVXETypes.input, |
| | | placeholder: '请输入${title}', |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: '请输入${title}' }] |
| | | }, |
| | | { |
| | | title: '备件型号', |
| | | key: 'spareModel', |
| | | type: JVXETypes.input, |
| | | placeholder: '请输入${title}', |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: '请输入${title}' }] |
| | | }, |
| | | { |
| | | title: '使用数量', |
| | | key: 'spareQuantity', |
| | | type: JVXETypes.inputNumber, |
| | | placeholder: '请输入${title}', |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: '请输入${title}' }] |
| | | } |
| | | ], |
| | | toolbarConfig: { |
| | | // prefix 前缀;suffix 后缀 |
| | | slot: ['prefix', 'suffix'], |
| | | // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮 |
| | | btn: ['add', 'remove', 'clearSelection'] |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | * 主页面点击执行审批时触发 |
| | | * @param record 主页面列表行记录 |
| | | */ |
| | | async handleDetail(record) { |
| | | async handleApprove(record) { |
| | | this.model = {} |
| | | this.detail.dataSource = [] |
| | | this.detail.maintenanceDetailList = this.detail.sparePartsDetailList = [] |
| | | this.getBasicInformationByApi(record) |
| | | this.getFlowChartImageByApi(record) |
| | | }, |
| | |
| | | * 主页面点击详情时触发 |
| | | * @param record 主页面列表行记录 |
| | | */ |
| | | recordDetail(record) { |
| | | handleDetail(record) { |
| | | this.spinning = true |
| | | this.detail.dataSource = [] |
| | | this.detail.maintenanceDetailList = this.detail.sparePartsDetailList = [] |
| | | this.model = Object.assign({ |
| | | operatorSignatureResult: '1', |
| | | repairmanSignatureResult: '1', |
| | |
| | | inspectorSignatureResult: '1' |
| | | }, record) |
| | | this.handleDynamicColumns() |
| | | this.loadDetail(record.id) |
| | | this.loadMaintenanceDetail(record.id) |
| | | this.loadSparePartsDetail(record.id) |
| | | }, |
| | | |
| | | /** |
| | |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loadDetail(record.dataId) |
| | | this.loadMaintenanceDetail(record.dataId) |
| | | this.loadSparePartsDetail(record.dataId) |
| | | }) |
| | | |
| | | }, |
| | |
| | | * 获取保养明细 |
| | | * @param orderId 工单号 |
| | | */ |
| | | loadDetail(orderId) { |
| | | getAction(this.url.detail, { orderId }) |
| | | loadMaintenanceDetail(orderId) { |
| | | getAction(this.url.maintenanceDetail, { orderId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | if (this.model.maintenanceStatus && this.model.maintenanceStatus == 'UNDER_SECOND_ACCEPTANCE') { |
| | | this.detail.dataSource = res.result.map(item => { |
| | | if (this.model.maintenanceStatus && this.model.maintenanceStatus === 'UNDER_SECOND_ACCEPTANCE') { |
| | | this.detail.maintenanceDetailList = res.result.map(item => { |
| | | return { |
| | | ...item, |
| | | secondInspectResult: '1' |
| | |
| | | }) |
| | | return |
| | | } |
| | | this.detail.dataSource = res.result |
| | | this.detail.maintenanceDetailList = res.result |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 获取备件使用明细 |
| | | * @param orderId 工单号 |
| | | */ |
| | | loadSparePartsDetail(orderId) { |
| | | getAction(this.url.sparePartsDetail, { orderId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.detail.sparePartsDetailList = res.result |
| | | } |
| | | }) |
| | | }, |
| | | |
| | |
| | | async handleOk() { |
| | | const that = this |
| | | |
| | | if (this.model.maintenanceStatus == 'UNDER_MAINTENANCE' || this.model.maintenanceStatus == 'UNDER_FIRST_ACCEPTANCE' || this.model.maintenanceStatus == 'UNDER_SECOND_ACCEPTANCE') { |
| | | let errMap = await that.$refs.editableDetailTable.validateTable() |
| | | if (this.activeTabKey != '1') { |
| | | if (this.model.maintenanceStatus === 'UNDER_MAINTENANCE' || this.model.maintenanceStatus === 'UNDER_FIRST_ACCEPTANCE' || this.model.maintenanceStatus === 'UNDER_SECOND_ACCEPTANCE') { |
| | | let errMap = await that.$refs.editableDetailTable1.validateTable() |
| | | if (this.activeTabKey !== '1' && errMap) { |
| | | that.$refs.editableDetailTable1.clearValidate() |
| | | this.activeTabKey = '1' |
| | | if (errMap) { |
| | | that.$refs.editableDetailTable.clearValidate() |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | | description: '保养或验收不能为空' |
| | | }) |
| | | return |
| | | } |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | | description: '保养或验收不能为空' |
| | | }) |
| | | return |
| | | } |
| | | if (errMap) return |
| | | } |
| | | |
| | | if (this.$refs.editableDetailTable2 && this.model.maintenanceStatus === 'UNDER_MAINTENANCE') { |
| | | const errMap = await that.$refs.editableDetailTable2.validateTable() |
| | | if (this.activeTabKey !== '2' && errMap) { |
| | | this.activeTabKey = '2' |
| | | that.$refs.editableDetailTable2.clearValidate() |
| | | this.activeTabKey = '2' |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | | description: '备件使用明细记录字段需填写' |
| | | }) |
| | | return |
| | | } |
| | | if (errMap) return |
| | | } |
| | | |
| | | |
| | | // 触发表单验证 |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = that.spinning = true |
| | | that.model.tableDetailList = that.$refs.editableDetailTable.getTableData() |
| | | that.model.tableDetailList = that.$refs.editableDetailTable1.getTableData() |
| | | if (that.$refs.editableDetailTable2) that.model.tableSpareList = that.$refs.editableDetailTable2.getTableData() |
| | | |
| | | httpAction(that.url.approval, that.model, 'put') |
| | | .then((res) => { |
| | |
| | | } |
| | | ] |
| | | } |
| | | this.detail.columns = [...this.detail.defaultColumns, ...columns] |
| | | this.detail.maintenanceDetailColumns = [...this.detail.defaultMaintenanceDetailColumns, ...columns] |
| | | }, |
| | | |
| | | autocompleteForm(selectObj) { |
| | |
| | | */ |
| | | handleResultSelectChange(value, record, key) { |
| | | if (record[key]) delete record[key] |
| | | this.$refs.editableDetailTable.validateTable() |
| | | this.$refs.editableDetailTable1.validateTable() |
| | | }, |
| | | |
| | | // 批量选择保养结果正常 |
| | | handleSelectAllMaintenanceResult() { |
| | | this.selectedRowKeys.forEach(key => { |
| | | const dataItem = this.detail.dataSource.find(item => item.id === key) |
| | | const dataItem = this.detail.maintenanceDetailList.find(item => item.id === key) |
| | | if (dataItem && dataItem.maintenanceResult !== 'NORMAL') { |
| | | delete dataItem.exceptionDescription |
| | | dataItem.maintenanceResult = 'NORMAL' |
| | | } |
| | | }) |
| | | this.$refs.editableDetailTable.clearCheckboxRow() |
| | | this.$refs.editableDetailTable1.clearCheckboxRow() |
| | | this.selectedRowKeys = [] |
| | | }, |
| | | |
| | | // 批量选择第一次验收结果通过 |
| | | handleSelectAllFirstAcceptanceResult() { |
| | | this.selectedRowKeys.forEach(key => { |
| | | const dataItem = this.detail.dataSource.find(item => item.id === key) |
| | | const dataItem = this.detail.maintenanceDetailList.find(item => item.id === key) |
| | | if (dataItem && dataItem.firstInspectResult !== '1') { |
| | | delete dataItem.firstInspectException |
| | | dataItem.firstInspectResult = '1' |
| | | } |
| | | }) |
| | | this.$refs.editableDetailTable.clearCheckboxRow() |
| | | this.$refs.editableDetailTable.clearValidate() |
| | | this.$refs.editableDetailTable1.clearCheckboxRow() |
| | | this.$refs.editableDetailTable1.clearValidate() |
| | | this.selectedRowKeys = [] |
| | | }, |
| | | |
| | |
| | | |
| | | // 保养前技术状态单选发生改变时触发 |
| | | handleCheckRadioChange() { |
| | | if (this.model.fullyFunctional == '1' && this.model.runningNormally == '1') this.model.problemDescription = '' |
| | | if (this.model.fullyFunctional === '1' && this.model.runningNormally === '1') this.model.problemDescription = '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 标签栏切换时触发 |
| | | * @param tabKey 切换后的tabKey |
| | | */ |
| | | handleTabChange(tabKey) { |
| | | if (this.activeTabKey !== '3') this.$refs['editableDetailTable' + this.activeTabKey].clearValidate() |
| | | this.activeTabKey = tabKey |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |