| | |
| | | @cancel="handleCancel" centered 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-row :gutter="24" id="outer-row"> |
| | | <a-col :span="8" class="scroll-col"> |
| | | <a-tabs> |
| | | <a-tab-pane tab="基础信息"> |
| | | <a-row> |
| | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="操作工"> |
| | | <a-input v-model="model.operator_dicText" readOnly/> |
| | | <a-input v-model="model.operator_dictText" readOnly/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="维修工"> |
| | | <a-input v-model="model.repairer_dicText" readOnly/> |
| | | <a-input v-model="model.repairman_dictText" readOnly/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="maintenancePeriod" label="保养周期"> |
| | | <a-form-model-item label="保养周期"> |
| | | <a-input v-model="model.maintenancePeriod" readOnly/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | </a-tabs> |
| | | </a-col> |
| | | |
| | | <a-col |
| | | :span="model.maintenanceStatus!='WAIT_MAINTENANCE'&&model.maintenanceStatus!='UNDER_MAINTENANCE'?10:16"> |
| | | <a-tabs v-model="activeTabKey"> |
| | | <a-tab-pane key="1" tab="操作工"> |
| | | <a-col class="scroll-col" |
| | | :span="model.maintenanceStatus&&model.maintenanceStatus!='WAIT_MAINTENANCE'&&model.maintenanceStatus!='UNDER_MAINTENANCE'?10:16"> |
| | | <a-tabs :active-key="activeTabKey" @change="handleTabChange"> |
| | | <a-tab-pane :key="1" tab="操作工" |
| | | v-if="selectShenpiData.taskDefKey&&selectShenpiData.taskDefKey=='operator_task'|| |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"> |
| | | <j-vxe-table ref="editableDetailTable1" :rowNumber="false" rowSelection bordered |
| | | alwaysEdit keep-source :height="300" |
| | | :dataSource="detail.operatorMaintenanceList" :columns="detail.columns" |
| | | @selectRowChange="handleTableSelectRowChange"> |
| | | @selectRowChange="handleTableSelectRowChange($event,'Operator')"> |
| | | <template v-slot:maintenanceResult="props"> |
| | | <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="eam_inspection_result" |
| | | placeholder="请选择保养结果" :disabled="disableSubmit || confirmDisable" |
| | | <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="maintenance_result" |
| | | placeholder="请选择保养结果" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')" |
| | | @change="handleInspectionResultSelectChange($event,props.row)" |
| | | style="width: 100%"/> |
| | | </template> |
| | | |
| | | <template v-slot:exceptionDescription="props"> |
| | | <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" |
| | | :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'"/> |
| | | <a-textarea :rows="1" :autoSize="false" v-model="props.row.exceptionDescription" |
| | | :placeholder="props.row.maintenanceResult&&props.row.maintenanceResult!='1'?'请输入异常描述':''" |
| | | :disabled="disableSubmit|| |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE') || |
| | | !props.row.maintenanceResult || |
| | | props.row.maintenanceResult === '1'"/> |
| | | </template> |
| | | |
| | | <template v-slot:reportFlag="props"> |
| | | <j-dict-select-tag v-model="props.row.reportFlag" |
| | | :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'" |
| | | dictCode="yn" |
| | | style="width: 100%"/> |
| | | <j-dict-select-tag v-model="props.row.reportFlag" dictCode="yn" style="width: 100%" |
| | | :placeholder="props.row.maintenanceResult&&props.row.maintenanceResult!='1'?'请选择异常是否报修':''" |
| | | :disabled="disableSubmit || |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE') || |
| | | !props.row.maintenanceResult || |
| | | props.row.maintenanceResult === '1'"/> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane key="2" tab="维修工"> |
| | | <a-tab-pane :key="2" tab="维修工" |
| | | v-if="selectShenpiData.taskDefKey&&selectShenpiData.taskDefKey=='maintenance_task'|| |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"> |
| | | <j-vxe-table ref="editableDetailTable2" :rowNumber="false" rowSelection bordered |
| | | alwaysEdit kee-source :height="300" |
| | | :dataSource="detail.repairerMaintenanceList" :columns="detail.columns" |
| | | @selectRowChange="handleTableSelectRowChange"> |
| | | @selectRowChange="handleTableSelectRowChange($event,'Repairer')"> |
| | | <template v-slot:maintenanceResult="props"> |
| | | <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="eam_inspection_result" |
| | | placeholder="请选择保养结果" :disabled="disableSubmit || confirmDisable" |
| | | <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="maintenance_result" |
| | | placeholder="请选择保养结果" |
| | | :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')" |
| | | @change="handleInspectionResultSelectChange($event,props.row)" |
| | | style="width: 100%"/> |
| | | </template> |
| | | |
| | | <template v-slot:exceptionDescription="props"> |
| | | <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" |
| | | :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'"/> |
| | | <a-textarea :rows="1" :autoSize="false" v-model="props.row.exceptionDescription" |
| | | :placeholder="props.row.maintenanceResult&&props.row.maintenanceResult!='1'?'请输入异常描述':''" |
| | | :disabled="disableSubmit || |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE') || |
| | | !props.row.maintenanceResult || |
| | | props.row.maintenanceResult === '1'"/> |
| | | </template> |
| | | |
| | | <template v-slot:reportFlag="props"> |
| | | <j-dict-select-tag v-model="props.row.reportFlag" |
| | | :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'" |
| | | dictCode="yn" |
| | | style="width: 100%"/> |
| | | :placeholder="props.row.maintenanceResult&&props.row.maintenanceResult!='1'?'请选择异常是否报修':''" |
| | | dictCode="yn" style="width: 100%" |
| | | :disabled="disableSubmit|| |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE') || |
| | | !props.row.maintenanceResult || |
| | | props.row.maintenanceResult === '1'"/> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | |
| | | </a-tab-pane> |
| | | </template> |
| | | |
| | | <a-button :disabled="disableSubmit ||confirmDisable||selectedRowKeys.length > 0" slot="tabBarExtraContent" |
| | | type="primary" @click="handleSelectAllInspectionResult">批量保养正常 |
| | | <a-button |
| | | v-if="activeTabKey!=='3'" |
| | | :disabled="disableSubmit || |
| | | (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE') || |
| | | (activeTabKey=='1'&&selectedOperatorMaintenanceRowKeys.length == 0)|| |
| | | (activeTabKey=='2'&&selectedRepairerMaintenanceRowKeys.length == 0)" |
| | | slot="tabBarExtraContent" |
| | | type="primary" @click="handleSelectAllInspectionResult">批量保养正常 |
| | | </a-button> |
| | | </a-tabs> |
| | | </a-col> |
| | | |
| | | <a-col :span="6" |
| | | v-if="model.maintenanceStatus!='WAIT_MAINTENANCE'&&model.maintenanceStatus!='UNDER_MAINTENANCE'"> |
| | | <a-tabs> |
| | | <a-tab-pane tab="管理员确认" v-if="confirmDisable"> |
| | | <!--右侧审批列--> |
| | | <a-col :span="6" class="scroll-col" |
| | | v-if="model.maintenanceStatus&&model.maintenanceStatus!='WAIT_MAINTENANCE'&&model.maintenanceStatus!='UNDER_MAINTENANCE'"> |
| | | <a-tabs v-if="displayAdminConfirmFlag"> |
| | | <a-tab-pane tab="管理员确认"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item prop="confirmDealType" label="确认类型"> |
| | | <j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approve_reject' |
| | | placeholder="请选择确认类型" :disabled="disableSubmit || inspectorConfirmDisable"/> |
| | | <a-form-model-item prop="manageUserResult" label="确认类型"> |
| | | <j-dict-select-tag type='radio' v-model='model.manageUserResult' dictCode='approve_reject' |
| | | placeholder="请选择确认类型" |
| | | :disabled="disableSubmit || model.maintenanceStatus!='WAIT_ADMIN_CONFIRM'"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item prop="confirmComment" label="确认意见"> |
| | | <a-textarea placeholder="请输入意见" v-model="model.confirmComment" |
| | | :disabled="disableSubmit || inspectorConfirmDisable"/> |
| | | <a-form-model-item label="问题描述"> |
| | | <a-textarea placeholder="请描述问题" v-model='model.problemDescription' |
| | | :disabled="disableSubmit || model.maintenanceStatus!='WAIT_ADMIN_CONFIRM'"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="处理措施描述"> |
| | | <a-textarea placeholder="请描述处理措施" v-model="model.dealDescription" |
| | | :disabled="disableSubmit || model.maintenanceStatus!='WAIT_ADMIN_CONFIRM'"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | <a-tabs> |
| | | <a-tab-pane tab="检查人确认" v-if="inspectorConfirmDisable"> |
| | | <a-tabs v-if="displayInspectorConfirmFlag"> |
| | | <a-tab-pane tab="检查人确认"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item prop="confirmDealType" label="确认类型"> |
| | | <j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approve_reject' |
| | | placeholder="请选择确认类型" :disabled="disableSubmit || inspectorConfirmDisable"/> |
| | | <a-form-model-item prop="inspectorResult" label="确认类型"> |
| | | <j-dict-select-tag type='radio' v-model='model.inspectorResult' dictCode='approve_reject' |
| | | placeholder="请选择确认类型" |
| | | :disabled="disableSubmit || model.maintenanceStatus!='WAIT_INSPECTOR_CONFIRM'"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item prop="leaderConfirmComment" label="确认意见"> |
| | | <a-textarea placeholder="请输入意见" v-model="model.leaderConfirmComment" |
| | | :disabled="disableSubmit || completionDisable"/> |
| | | <a-form-model-item label="确认意见"> |
| | | <a-textarea placeholder="请输入意见" v-model="model.inspectConfirmComment" |
| | | :disabled="disableSubmit || model.maintenanceStatus!='WAIT_INSPECTOR_CONFIRM'"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | confirmLoading: false, |
| | | spinning: false, |
| | | imageSrc: null, |
| | | activeTabKey: '1', |
| | | activeTabKey: 1, |
| | | validatorRules: { |
| | | confirmDealType: [ |
| | | { required: true, message: '请选择通过或驳回!' } |
| | | ], |
| | | confirmComment: [ |
| | | { required: true, message: '请输入确认意见!' } |
| | | ], |
| | | leaderConfirmComment: [ |
| | | { required: true, message: '请输入初验收意见!' } |
| | | ] |
| | | manageUserResult: [{ required: true, message: '请选择确认类型' }], |
| | | inspectorResult: [{ required: true, message: '请选择确认类型' }] |
| | | }, |
| | | url: { |
| | | queryById: '/eam/secondMaintenanceOrder/queryById', |
| | | queryById: '/eam/secondMaintenanceOrder/list', |
| | | detail: '/eam/secondMaintenanceOrderDetail/queryList', |
| | | approval: '/eam/secondMaintenanceOrder/approval', |
| | | userSelect: '/eam/user_select/list', |
| | | queryHisTaskList: '/assign/flow/queryHisTaskList', |
| | | diagramView: '/assign/flow/diagramView' |
| | | }, |
| | | disableSubmit: false, |
| | | taskData: [], |
| | | selectedRowKeys: [], |
| | | selectedOperatorMaintenanceRowKeys: [], |
| | | selectedRepairerMaintenanceRowKeys: [], |
| | | detail: { |
| | | operatorMaintenanceList: [], |
| | | repairerMaintenanceList: [], |
| | |
| | | align: 'center', |
| | | slotName: 'maintenanceResult', |
| | | validateRules: [ |
| | | { required: true, message: '保养结果不能为空!' } |
| | | { required: true, message: '请选择${title}' } |
| | | ] |
| | | }, |
| | | { |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | confirmDisable: function() { |
| | | displayAdminConfirmFlag() { |
| | | return ['WAIT_ADMIN_CONFIRM', 'WAIT_INSPECTOR_CONFIRM', 'COMPLETE'].includes(this.model.maintenanceStatus) |
| | | }, |
| | | inspectorConfirmDisable: function() { |
| | | displayInspectorConfirmFlag() { |
| | | return ['WAIT_INSPECTOR_CONFIRM', 'COMPLETE'].includes(this.model.maintenanceStatus) |
| | | }, |
| | | completionDisable: function() { |
| | | return ['COMPLETE'].includes(this.model.maintenanceStatus) |
| | | } |
| | | }, |
| | | methods: { |
| | | async handleDetail(item) { |
| | | this.initParams() |
| | | /** |
| | | * 主页面点击执行审批时触发 |
| | | * @param record 主页面列表行记录 |
| | | */ |
| | | async handleDetail(record) { |
| | | this.model = {} |
| | | if (item.procInstId) { |
| | | const { processDefinitionId, processInstanceId, processDefinitionKey } = item |
| | | this.detail.operatorMaintenanceList = this.detail.repairerMaintenanceList = [] |
| | | this.handleTabToFirstTable() |
| | | this.getBasicInformationByApi(record) |
| | | this.getFlowChartImageByApi(record) |
| | | this.loadDetail(record.dataId) |
| | | this.visible = true |
| | | }, |
| | | |
| | | downFile(this.url.diagramView, { |
| | | processDefinitionId, |
| | | processInstanceId, |
| | | TaskDefinitionKey: processDefinitionKey |
| | | }, 'get') |
| | | .then((res => { |
| | | const urlObject = window.URL.createObjectURL(new Blob([res])) |
| | | this.imageSrc = urlObject |
| | | })) |
| | | .catch(err => { |
| | | this.$notification.error({ |
| | | /** |
| | | * 主页面点击详情时触发 |
| | | * @param record 主页面列表行记录 |
| | | */ |
| | | recordDetail(record) { |
| | | this.activeTabKey = 1 |
| | | this.detail.operatorMaintenanceList = this.detail.repairerMaintenanceList = [] |
| | | this.model = Object.assign({}, record) |
| | | this.loadDetail(record.id) |
| | | this.visible = true |
| | | }, |
| | | |
| | | /** |
| | | * 获取基础信息 |
| | | * @param record 主页面列表行记录 |
| | | */ |
| | | getBasicInformationByApi(record) { |
| | | this.spinning = true |
| | | const that = this |
| | | getAction(this.url.queryById, { id: record.dataId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | that.model = Object.assign({}, res.result.records[0]) |
| | | that.model.dataId = record.dataId |
| | | that.model.taskId = record.id |
| | | that.model.userId = record.assignee |
| | | that.model.instanceId = record.procInstId |
| | | } |
| | | else { |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 获取流程图 |
| | | * @param record 主页面列表行记录 |
| | | */ |
| | | getFlowChartImageByApi(record) { |
| | | const { processDefinitionId, processInstanceId, processDefinitionKey } = record |
| | | |
| | | downFile(this.url.diagramView, { |
| | | processDefinitionId, |
| | | processInstanceId, |
| | | TaskDefinitionKey: processDefinitionKey |
| | | }, 'get') |
| | | .then((res => { |
| | | this.imageSrc = window.URL.createObjectURL(new Blob([res])) |
| | | })) |
| | | .catch(err => { |
| | | this.$notification.error({ |
| | | message: '消息', |
| | | description: err.message |
| | | }) |
| | | } |
| | | let res = await getAction(this.url.queryById, { id: item.dataId }) |
| | | this.model = Object.assign({}, res.result) |
| | | this.model.dataId = item.dataId |
| | | this.model.taskId = item.id |
| | | this.model.userId = item.assignee |
| | | this.model.instanceId = item.procInstId |
| | | this.model.values = item.variables |
| | | await this.loadDetail(item.dataId) |
| | | }, |
| | | |
| | | recordDetail(record) { |
| | | console.log('record', record) |
| | | this.initParams() |
| | | this.model = Object.assign({}, record) |
| | | this.loadDetail(record.id) |
| | | }, |
| | | |
| | | initParams() { |
| | | this.detail.dataSource = [] |
| | | this.visible = true |
| | | this.activeTabKey = '1' |
| | | this.spinning = true |
| | | }) |
| | | }, |
| | | |
| | | async handleOk() { |
| | | const that = this |
| | | let errMap = await that.$refs.editableDetailTable.validateTable() |
| | | if (errMap) { |
| | | this.$message.warning('数据校验失败!') |
| | | return |
| | | |
| | | let errMap |
| | | if (that.$refs['editableDetailTable' + that.activeTabKey]) { |
| | | // 校验当前tab表格 |
| | | errMap = await that.$refs['editableDetailTable' + that.activeTabKey].validateTable() |
| | | } else { |
| | | // 当前tab不是表格时则校验有表格的 |
| | | for (let index = 1; index <= 2; index++) { |
| | | if (that.$refs['editableDetailTable' + index]) { |
| | | errMap = await that.$refs['editableDetailTable' + index].validateTable() |
| | | if (errMap) { |
| | | that.activeTabKey = index |
| | | console.log('that.activeTabKey-----------', that.activeTabKey) |
| | | that.$refs['editableDetailTable' + that.activeTabKey].clearValidate() |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | | description: '保养不能为空' |
| | | }) |
| | | break |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (errMap) return |
| | | |
| | | // 触发表单验证 |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = that.spinning = true |
| | | let tableData = that.$refs.editableDetailTable.getTableData() |
| | | that.model.tableDetailList = [...tableData] |
| | | let httpurl = this.url.approval |
| | | let method = 'put' |
| | | |
| | | httpAction(httpurl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$emit('searchReset') |
| | | that.close() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | // 仅在保养中状态传递表格列表 |
| | | if (this.model.maintenanceStatus == 'UNDER_MAINTENANCE') { |
| | | for (let index = 1; index <= 2; index++) { |
| | | if (that.$refs['editableDetailTable' + index]) { |
| | | this.model.tableDetailList = that.$refs['editableDetailTable' + index].getTableData() |
| | | break |
| | | } |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = that.spinning = false |
| | | }) |
| | | } |
| | | console.log('model', this.model.tableDetailList) |
| | | |
| | | httpAction(this.url.approval, this.model, 'put') |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | that.$emit('modalFormOk') |
| | | that.close() |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.confirmLoading = that.spinning = false |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | |
| | | |
| | | autocompleteForm(selectObj) { |
| | | this.$set(this.model, 'standardName', selectObj.standardName) |
| | | this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) |
| | | this.$set(this.model, 'standardId', selectObj.id) |
| | | this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) |
| | | this.$set(this.model, 'equipmentId', selectObj.equipmentId) |
| | | if (!this.model.id) this.loadStandardDetail(selectObj.id) |
| | | this.spinning = false |
| | | }, |
| | | |
| | | /** |
| | | * 检查明细标签切换时触发 |
| | | * @param tabKey 切换后的tabKey |
| | | */ |
| | | handleTabChange(tabKey) { |
| | | if (this.$refs['editableDetailTable' + this.activeTabKey]) this.$refs['editableDetailTable' + this.activeTabKey].clearValidate() |
| | | this.activeTabKey = tabKey |
| | | }, |
| | | |
| | | // 切换tab至第一个表格 |
| | | handleTabToFirstTable() { |
| | | this.$nextTick(() => { |
| | | console.log('taskDefKey', this.selectShenpiData.taskDefKey) |
| | | if ((this.selectShenpiData.taskDefKey && this.selectShenpiData.taskDefKey == 'operator_task') || !this.selectShenpiData.taskDefKey) this.activeTabKey = 1 |
| | | else if (this.selectShenpiData.taskDefKey && this.selectShenpiData.taskDefKey == 'maintenance_task') this.activeTabKey = 2 |
| | | }) |
| | | }, |
| | | |
| | | //规范选择变化 |
| | | loadDetail(orderId) { |
| | | if (orderId) { |
| | | getAction(this.url.detail, { orderId }) |
| | | .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 |
| | | }) |
| | | } |
| | | this.spinning = true |
| | | getAction(this.url.detail, { orderId }) |
| | | .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') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleInspectionResultSelectChange(value, record) { |
| | |
| | | |
| | | // 批量选择所有点检结果 |
| | | handleSelectAllInspectionResult() { |
| | | this.selectedRowKeys.forEach(key => { |
| | | const dataItem = this.detail.dataSource.find(item => item.id === key) |
| | | let selectedRowKeys, prefix |
| | | if (this.activeTabKey == 1) { |
| | | selectedRowKeys = this.selectedOperatorMaintenanceRowKeys |
| | | prefix = 'operator' |
| | | } |
| | | else if (this.activeTabKey == 2) { |
| | | selectedRowKeys = this.selectedRepairerMaintenanceRowKeys |
| | | prefix = 'repairer' |
| | | } |
| | | else selectedRowKeys = [] |
| | | if (selectedRowKeys.length == 0) return |
| | | |
| | | selectedRowKeys.forEach(key => { |
| | | const dataItem = this.detail[prefix + 'MaintenanceList'].find(item => item.id === key) |
| | | if (dataItem && dataItem.maintenanceResult !== '1') { |
| | | console.log('dataItem', dataItem) |
| | | delete dataItem.exceptionDescription |
| | | delete dataItem.reportFlag |
| | | dataItem.maintenanceResult = '1' |
| | | } |
| | | }) |
| | | this.$refs.editableDetailTable.clearCheckboxRow() |
| | | this.selectedRowKeys = [] |
| | | this.$refs['editableDetailTable' + this.activeTabKey].clearCheckboxRow() |
| | | this['selected' + prefix.charAt(0).toUpperCase() + prefix.slice(1) + 'MaintenanceRowKeys'] = [] |
| | | }, |
| | | |
| | | /** |
| | | * 表格多选框发生改变时触发 |
| | | * @param {selectedRowIds} 表格中已选择的ID列表 |
| | | * @param key 二保区分key |
| | | */ |
| | | handleTableSelectRowChange({ selectedRowIds }) { |
| | | this.selectedRowKeys = selectedRowIds |
| | | handleTableSelectRowChange({ selectedRowIds }, key) { |
| | | this[`selected${key}MaintenanceRowKeys`] = selectedRowIds |
| | | }, |
| | | |
| | | /** |
| | | * 自定义校验 |
| | | * @param cellValue 输入值 |
| | | * @param row 表格行记录 |
| | | * @param callback 结果回调函数 |
| | | */ |
| | | customValidator({ cellValue, row }, callback) { |
| | | if (row.maintenanceResult === '2') { |
| | | if (!cellValue) { |
| | | callback(false, '${title}不能为空!') // false = 未通过,可以跟自定义提示 |
| | | callback(false, '${title}不能为空') // false = 未通过,可以跟自定义提示 |
| | | } else { |
| | | callback(true) // true = 通过验证 |
| | | } |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-select-dropdown-menu { |
| | | text-align: left; |
| | | } |
| | | |
| | | /deep/ .ant-spin-nested-loading { |
| | | height: 100%; |
| | | |
| | | .ant-spin-container { |
| | | height: 100%; |
| | | |
| | | .ant-form { |
| | | height: 100%; |
| | | |
| | | #outer-row { |
| | | height: 100%; |
| | | |
| | | .scroll-col { |
| | | height: 100%; |
| | | overflow: auto; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |