From a4674a75bfffc500a049beafb74daaec50c8f87f Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 17 七月 2025 17:46:06 +0800 Subject: [PATCH] 三保工单审批流程 --- src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue | 1000 ++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 558 insertions(+), 442 deletions(-) diff --git a/src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue b/src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue index 8d86f59..11a5855 100644 --- a/src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue +++ b/src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue @@ -1,184 +1,222 @@ <template> - <j-modal - :title="title" - :width="1200" - :visible="visible" - :confirmLoading="confirmLoading" - :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" - switchFullscreen - @ok="handleOk" - @cancel="handleCancel" - centered - cancelText="鍏抽棴"> - + <j-modal :title="title" :visible="visible" :confirmLoading="confirmLoading" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" fullscreen @ok="handleOk" @cancel="handleCancel" + cancelText="鍏抽棴"> <a-spin :spinning="spinning"> - <a-form-model ref="form" :model="model" :rules="validatorRules"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 淇濆吇鍩虹淇℃伅 - </a-divider> - <a-row :gutter="24"> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderNum" label="宸ュ崟鍙�"> - <a-input placeholder="宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled/> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栫爜"> - <maintenance-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" - :maintenanceCategory="maintenanceCategory" - @autocompleteForm="autocompleteForm" - disabled></maintenance-equipment-select> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> - <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.standardName" disabled/> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceDate" label="淇濆吇鏃ユ湡"> - <a-date-picker placeholder="璇烽�夋嫨璁″垝淇濆吇鏃ユ湡" v-model="model.maintenanceDate" format="YYYY-MM-DD" - disabled - style="width: 100%"/> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="淇濆吇浜�"> - <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨淇濆吇浜�" disabled - :dictOptions="maintenanceOperatorOptions"/> - </a-form-model-item> - </a-col> - <a-col :span="8"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> - <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" disabled/> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="澶囨敞"> - <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" disabled/> - </a-form-model-item> - </a-row> - <a-row :gutter="24"> - <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="淇濆吇鍥剧墖"> - <lx-upload :returnUrl="false" - :isMultiple="true" - file-type="image" - :disabled="confirmDisable" - :number="3" - v-model="model.imageFilesResult"/> - </a-form-model-item> - </a-row> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 淇濆吇椤逛俊鎭� - </a-divider> - <a-row :gutter="24"> - <a-tabs v-model="activeTabKey"> - <a-tab-pane key="1" tab="淇濆吇椤规槑缁�" v-if="!isPrecisionCheck"> - <j-vxe-table - ref="editableDetailTable" - :rowNumber="false" - :rowSelection="true" - :bordered="true" - :alwaysEdit="true" - :toolbar="false" - keep-source - :height="300" - :loading="detail.loading" - :dataSource="detail.dataSource" - :columns="detail.columns" - @selectRowChange="handleTableSelectRowChange" - > - <template v-slot:maintenanceResult="props"> - <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="eam_inspection_result" - placeholder="璇烽�夋嫨淇濆吇缁撴灉" - :disabled="disableSubmit || confirmDisable" - @change="handleInspectionResultSelectChange($event,props.row)" - style="width: 100%"/> - </template> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row :gutter="24" id="outer-row"> + <a-col :span="8" class="scroll-col"> + <a-tabs> + <a-tab-pane tab="鍩虹淇℃伅"> + <a-row> + <a-col :span="12"> + <a-form-model-item label="宸ュ崟鍙�"> + <a-input v-model="model.orderNum" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="缁熶竴缂栫爜"> + <maintenance-equipment-select v-model="model.equipmentId" maintenanceCategory="THIRD_MAINTENANCE" + @autocompleteForm="autocompleteForm" disabled/> + </a-form-model-item> + </a-col> + </a-row> - <template v-slot:exceptionDescription="props"> - <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" - :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'"/> - </template> + <a-row> + <a-col :span="12"> + <a-form-model-item label="瑙勮寖鍚嶇О"> + <a-input v-model="model.standardName" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="淇濆吇鏃ユ湡"> + <a-input v-model="model.maintenanceDate" readOnly/> + </a-form-model-item> + </a-col> + </a-row> - <template v-slot:reportFlag="props"> - <j-dict-select-tag v-model="props.row.reportFlag" - :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'" - dictCode="yn" - style="width: 100%"/> - </template> - </j-vxe-table> - </a-tab-pane> -<!-- <a-tab-pane key='4' tab='绮惧害妫�楠�' v-if="!isMaintenance">--> -<!-- <j-vxe-table--> -<!-- ref="editablePrecisionDetailTable"--> -<!-- :rowNumber="true"--> -<!-- :rowSelection="true"--> -<!-- :bordered="true"--> -<!-- :alwaysEdit="true"--> -<!-- :toolbar="false"--> -<!-- :toolbarConfig="precisionDetail.toolbarConfig"--> -<!-- keep-source--> -<!-- :height="300"--> -<!-- :dataSource="precisionDetail.dataSource"--> -<!-- :columns="precisionDetail.columns"--> -<!-- style="margin-top: 8px;" >--> -<!-- <template v-slot:actualValue="props">--> -<!-- <a-input-number v-model="props.row.actualValue" :disabled="disableSubmit || confirmDisable" style="width: 100%" />--> -<!-- </template>--> -<!-- </j-vxe-table>--> -<!-- </a-tab-pane>--> - <template v-if="selectShenpiData.procInstId"> - <a-tab-pane key='2' tab='娴佺▼鑺傜偣'> - <a-card :bordered="false"> - <a-timeline> - <a-timeline-item v-for="(item,index) in taskData" :key="index"> - <div> - <h3 style="font-weight: bold;">{{item.taskName}}</h3> - <div>澶勭悊浜猴細{{item.assignee_dictText}}</div> - <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div> - <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div> - <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div> - </div> - </a-timeline-item> - </a-timeline> - </a-card> + <a-row> + <a-col :span="12"> + <a-form-model-item label="缁翠慨浜�"> + <a-input v-model="model.repairman_dictText" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="淇濆吇鍛ㄦ湡"> + <a-input v-model="model.maintenancePeriod" readOnly/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="24"> + <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="澶囨敞"> + <a-textarea v-model="model.remark" readOnly/> + </a-form-model-item> + </a-col> + </a-row> </a-tab-pane> - <a-tab-pane key='3' tab='娴佺▼鍥�'> - <img :src="imageSrc" alt="Fetched Image"/> + </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-tab-pane key="1" tab="淇濆吇椤规槑缁�"> + <j-vxe-table ref="editableDetailTable" rowSelection bordered alwaysEdit keep-source :height="300" + :dataSource="detail.dataSource" :columns="detail.columns" + @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')" + @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" + :disabled="disableSubmit || + (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE') || + !props.row.maintenanceResult || + props.row.maintenanceResult === 'NORMAL'"/> + </template> + + <!--绗竴娆¢獙鏀剁粨鏋�--> + <template v-slot:firstInspectResult="props"> + <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')" + 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" + :disabled="disableSubmit || + (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_FIRST_ACCEPTANCE')|| + !props.row.firstInspectResult || + props.row.firstInspectResult === '1'" + dictCode="check_status" style="width: 100%;resize:none"/> + </template> + + <!--绗簩娆¢獙鏀剁粨鏋�--> + <template v-slot:secondInspectResult="props"> + <j-dict-select-tag v-model="props.row.secondInspectResult" + placeholder="璇烽�夋嫨楠屾敹缁撴灉" + @change="handleResultSelectChange($event,props.row,'secondInspectException')" + disabled dictCode="check_status" style="width: 100%"/> + </template> + + <!--绗簩娆¢獙鏀跺紓甯告弿杩�--> + <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" + :disabled="disableSubmit || + (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> - </template> - <a-button v-if="!disableSubmit &&!confirmDisable&& selectedRowKeys.length > 0" slot="tabBarExtraContent" - type="primary" @click="handleSelectAllInspectionResult">淇濆吇姝e父 - </a-button> - </a-tabs> + <template v-if="selectShenpiData.procInstId"> + <a-tab-pane key='2' 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" + type="primary" @click="handleSelectAllMaintenanceResult">鎵归噺淇濆吇姝e父 + </a-button> + <a-button + v-if="activeTabKey=='1'" + :disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_FIRST_ACCEPTANCE')||selectedRowKeys.length == 0" + type="primary" @click="handleSelectAllFirstAcceptanceResult">鎵归噺楠屾敹閫氳繃 + </a-button> + </a-space> + </template> + </a-tabs> + </a-col> + + <a-col v-if="model.maintenanceStatus&&model.maintenanceStatus!='WAIT_MAINTENANCE'" :span="6" + class="scroll-col"> + <a-tabs v-if="displayEvaluationFlag"> + <a-tab-pane tab="淇濆吇鍓嶆妧鏈姸鎬侀壌瀹�"> + <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" + 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')"/> + </a-form-model-item> + <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" + prop="runningNormally" label="璁惧鑳藉惁姝e父杩愯浆"> + <j-dict-select-tag type='radio' v-model='model.runningNormally' dictCode='yn' + @change="handleCheckRadioChange" + :disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='WAIT_CHECK')"/> + </a-form-model-item> + <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')"/> + </a-form-model-item> + </a-tab-pane> + </a-tabs> + + <a-tabs v-if="displayOperatorFlag"> + <a-tab-pane tab="鎿嶄綔浜虹‘璁�"> + <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="纭绫诲瀷"> + <j-dict-select-tag v-model="model.operatorSignatureResult" type="radio" disabled dict-code="yn"/> + </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')" + placeholder="璇疯緭鍏ュ崗鍔╂搷浣滀汉"/> + </a-form-model-item> + </a-tab-pane> + </a-tabs> + + <a-tabs v-if="displayRepairerFlag"> + <a-tab-pane tab="缁翠慨浜虹‘璁�"> + <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="纭绫诲瀷"> + <j-dict-select-tag v-model="model.repairmanSignatureResult" type="radio" disabled dict-code="yn"/> + </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')" + placeholder="璇疯緭鍏ュ崗鍔╃淮淇汉"/> + </a-form-model-item> + </a-tab-pane> + </a-tabs> + + <a-tabs v-if="displayRepairLeaderFlag"> + <a-tab-pane tab="缁翠慨瀹や富浠荤‘璁�"> + <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="纭绫诲瀷"> + <j-dict-select-tag v-model="model.repairManagerSignatureResult" type="radio" disabled dict-code="yn"/> + </a-form-model-item> + </a-tab-pane> + </a-tabs> + + <a-tabs v-if="displayInspectorFlag"> + <a-tab-pane tab="妫�鏌ヤ汉纭"> + <a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="纭绫诲瀷"> + <j-dict-select-tag v-model="model.inspectorSignatureResult" type="radio" disabled dict-code="yn"/> + </a-form-model-item> + </a-tab-pane> + </a-tabs> + </a-col> </a-row> - <div v-if="confirmDisable"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鏈哄姩鍔炵‘璁や俊鎭� - </a-divider> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="confirmComment" label="纭鎰忚"> - <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.confirmComment" - :disabled="disableSubmit || leaderConfirmDisable"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - <div v-if="leaderConfirmDisable"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 棰嗗纭淇℃伅 - </a-divider> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="leaderConfirmComment" - label="棰嗗鎰忚"> - <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.leaderConfirmComment" - :disabled="disableSubmit || completionDisable"/> - </a-form-model-item> - </a-col> - </a-row> - </div> </a-form-model> </a-spin> </j-modal> @@ -189,11 +227,13 @@ 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: { @@ -205,15 +245,7 @@ return { title: '鎿嶄綔', visible: false, - //鐘舵�佹帶鍒� - //淇濆吇涓� 涓嶅彲缂栬緫 - // confirmDisable: false, - // initialAcceptanceDisable: false, - // finalAcceptanceDisable: false, - editable: false, model: {}, - maintenanceCategory: 'SECOND_MAINTENANCE', - maintenanceOperatorOptions: [], labelCol: { xs: { span: 24 }, sm: { span: 6 } @@ -224,42 +256,40 @@ }, labelColLong: { xs: { span: 24 }, - sm: { span: 2 } + sm: { span: 3 } }, wrapperColLong: { xs: { span: 24 }, - sm: { span: 21 } + sm: { span: 20 } + }, + rightColLabelCol: { + xs: { span: 24 }, + sm: { span: 9 } + }, + rightColWrapperCol: { + xs: { span: 24 }, + sm: { span: 15 } }, confirmLoading: false, spinning: false, imageSrc: null, activeTabKey: '1', validatorRules: { - confirmComment: [ - { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' } - ], - leaderConfirmComment: [ - { required: true, message: '璇疯緭鍏ュ垵楠屾敹鎰忚!' } - ], + fullyFunctional: [{ required: true, message: '璇烽�夋嫨璁惧鍔熻兘鏄惁榻愬叏' }], + runningNormally: [{ required: true, message: '璇烽�夋嫨璁惧鑳藉惁姝e父杩愯浆' }] }, url: { queryById: '/eam/thirdMaintenanceOrder/queryById', detail: '/eam/thirdMaintenanceOrderDetail/queryList', approval: '/eam/thirdMaintenanceOrder/approval', - userSelect: '/eam/user_select/list', - queryHisTaskList: '/assign/flow/queryHisTaskList', - diagramView: '/assign/flow/diagramView', - // precisionCheckDetail: '/eam/precisionCheckDetail/queryList', + diagramView: '/assign/flow/diagramView' }, disableSubmit: false, - taskData: [], - isDisplayBmp: false, - showBmpButtonLoading: false, selectedRowKeys: [], detail: { - loading: false, dataSource: [], - columns: [ + columns: [], + defaultColumns: [ { title: 'ID', key: 'id', @@ -274,322 +304,338 @@ title: '搴忓彿', key: 'itemCode', type: JVXETypes.normal, - width: '5%', + width: 60, align: 'center' }, { - title: '淇濆吇椤�', + title: '淇濆吇閮ㄤ綅', + key: 'itemPart', + type: JVXETypes.normal, + width: 120, + align: 'center' + }, + { + title: '淇濆吇鍐呭', key: 'itemName', type: JVXETypes.normal, - width: '10%', + width: 120, align: 'center' }, { - title: '淇濆吇瑕佹眰', + title: '楠屾敹鏍囧噯', key: 'itemDemand', type: JVXETypes.normal, - width: '20%', + width: 120, align: 'center' }, { title: '淇濆吇缁撴灉', key: 'maintenanceResult', type: JVXETypes.slot, - width: '10%', align: 'center', + width: 200, slotName: 'maintenanceResult', validateRules: [ - { required: true, message: '淇濆吇缁撴灉涓嶈兘涓虹┖锛�' } + { required: true, message: '璇烽�夋嫨${title}' } ] }, { - title: '寮傚父鎻忚堪', + title: '淇濆吇寮傚父鎻忚堪', key: 'exceptionDescription', type: JVXETypes.slot, - width: '20%', align: 'center', + width: 200, slotName: 'exceptionDescription', validateRules: [ - { handler: this.customValidator } - ] - }, - { - title: '鏄惁鎶ヤ慨', - key: 'reportFlag', - type: JVXETypes.slot, - width: '10%', - align: 'center', - slotName: 'reportFlag', - validateRules: [ - { handler: this.customValidator } + { handler: this.maintenanceExceptionDescriptionValidator } ] } - ], - toolbarConfig: { - // prefix 鍓嶇紑锛泂uffix 鍚庣紑 - slot: ['prefix', 'suffix'], - // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 - btn: ['clearSelection'] - } - }, - // precisionDetail: { - // loading: false, - // dataSource: [], - // columns: [ - // { - // title: 'ID', - // key: 'id', - // type: JVXETypes.hidden - // }, - // { - // title: 'orderId', - // key: 'orderId', - // type: JVXETypes.hidden - // }, - // { - // title: 'equipmentId', - // key: 'equipmentId', - // type: JVXETypes.hidden - // }, - // { - // title: 'parameterId', - // key: 'parameterId', - // type: JVXETypes.hidden - // }, - // { - // title: '妫�娴嬮」鐩�', - // key: 'parameterId_dictText', - // type: JVXETypes.normal, - // width: '25%', - // align: 'center' - // }, - // { - // title: '鍙傛暟缂栫爜', - // key: 'parameterCode_dictText', - // type: JVXETypes.normal, - // width: '20%', - // align: 'center', - // }, - // { - // title: '鍏佸樊鍊�', - // key: 'parameterValue', - // type: JVXETypes.normal, - // width: '15%', - // align: 'center', - // }, - // { - // title: '瀹炴祴鍊�', - // key: 'actualValue', - // type: JVXETypes.slot, - // width: '15%', - // align: 'center', - // slotName: 'actualValue', - // validateRules: [ - // { required: true, message: '璇疯緭鍏ュ疄娴嬪�硷紒' } - // ] - // } - // ], - // toolbarConfig: { - // // prefix 鍓嶇紑锛泂uffix 鍚庣紑 - // slot: ['prefix', 'suffix'], - // // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 - // btn: ['add', 'remove', 'clearSelection'] - // } - // } + ] + } } }, - created() { - }, computed: { - confirmDisable: function() { - return ['WAIT_CONFIRM', 'WAIT_LEADER_CONFIRM', 'COMPLETE'].includes(this.model.maintenanceStatus) + displayEvaluationFlag() { + return this.model.maintenanceStatus && ['WAIT_CHECK', 'UNDER_MAINTENANCE', 'UNDER_FIRST_ACCEPTANCE', 'UNDER_SECOND_ACCEPTANCE', 'OPERATOR_SIGNATURE', 'REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE', 'CANCEL'].includes(this.model.maintenanceStatus) }, - leaderConfirmDisable: function() { - return ['WAIT_LEADER_CONFIRM', 'COMPLETE'].includes(this.model.maintenanceStatus) + displayFirstAcceptanceFlag() { + return this.model.maintenanceStatus && ['UNDER_FIRST_ACCEPTANCE', 'UNDER_SECOND_ACCEPTANCE', 'OPERATOR_SIGNATURE', 'REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus) }, - completionDisable: function() { - return ['COMPLETE', 'ABOLISH'].includes(this.model.maintenanceStatus) + displaySecondAcceptanceFlag() { + return this.model.maintenanceStatus && ['UNDER_SECOND_ACCEPTANCE', 'OPERATOR_SIGNATURE', 'REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus) }, - isMaintenance: function() { - return this.selectShenpiData && this.selectShenpiData.taskDefKey === 'maintenance_execution'; + displayOperatorFlag() { + return this.model.maintenanceStatus && ['OPERATOR_SIGNATURE', 'REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus) }, - isPrecisionCheck: function() { - return this.selectShenpiData && this.selectShenpiData.taskDefKey === 'precision_check'; + displayRepairerFlag() { + return this.model.maintenanceStatus && ['REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus) }, + displayRepairLeaderFlag() { + return this.model.maintenanceStatus && ['REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus) + }, + displayInspectorFlag() { + return this.model.maintenanceStatus && ['INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus) + } }, methods: { - async handleDetail(item) { - this.initParams() - //閲嶆柊璁$畻defaultKey - if(item && item.taskDefKey === 'precision_check') { - this.activeTabKey = '4'; - } + /** + * 涓婚〉闈㈢偣鍑绘墽琛屽鎵规椂瑙﹀彂 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + async handleDetail(record) { this.model = {} - if (item.procInstId) { - const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = item + this.detail.dataSource = [] + this.getBasicInformationByApi(record) + this.getFlowChartImageByApi(record) + }, - let taskDataList = await getAction(this.url.queryHisTaskList, { procInstId }) - this.taskData = [...taskDataList.result] + /** + * 涓婚〉闈㈢偣鍑昏鎯呮椂瑙﹀彂 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + recordDetail(record) { + this.spinning = true + this.detail.dataSource = [] + this.model = Object.assign({ + operatorSignatureResult: '1', + repairmanSignatureResult: '1', + repairManagerSignatureResult: '1', + inspectorSignatureResult: '1' + }, record) + this.handleDynamicColumns() + this.loadDetail(record.id) + }, - 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 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + getBasicInformationByApi(record) { + this.spinning = true + const that = this + getAction(this.url.queryById, { id: record.dataId }) + .then(res => { + if (res.success) { + that.model = Object.assign({ + operatorSignatureResult: '1', + repairmanSignatureResult: '1', + repairManagerSignatureResult: '1', + inspectorSignatureResult: '1' + }, res.result) + that.model.dataId = record.dataId + that.model.taskId = record.id + that.model.userId = record.assignee + that.model.instanceId = record.procInstId + that.handleDynamicColumns() + } + else { + that.$notification.warning({ message: '娑堟伅', description: res.message }) - }) - } - let res = await getAction(this.url.queryById, { id: item.dataId }) - this.model = Object.assign({}, res.result) - if (this.model.imageFiles) { - let obj = JSON.parse(this.model.imageFiles) - this.model.imageFilesResult = [...obj] - } - 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) - // await this.loadPrecisionDetail(item.dataId); + } + }) + .finally(() => { + this.loadDetail(record.dataId) + }) + }, - recordDetail(record) { - console.log('record', record) - this.initParams() - this.model = Object.assign({}, record) - if (this.model.imageFiles) { - let obj = JSON.parse(this.model.imageFiles) - this.model.imageFilesResult = [...obj] - } - this.loadDetail(record.id) - this.loadPrecisionDetail(record.id); + /** + * 鑾峰彇淇濆吇鏄庣粏 + * @param orderId 宸ュ崟鍙� + */ + loadDetail(orderId) { + getAction(this.url.detail, { orderId }) + .then(res => { + if (res.success) { + if (this.model.maintenanceStatus && this.model.maintenanceStatus == 'UNDER_SECOND_ACCEPTANCE') { + this.detail.dataSource = res.result.map(item => { + return { + ...item, + secondInspectResult: '1' + } + }) + return + } + this.detail.dataSource = res.result + } + }) + .finally(() => { + this.spinning = false + }) }, - initParams() { - this.detail.dataSource = [] - this.visible = true - this.activeTabKey = '1'; - if(this.selectShenpiData && this.selectShenpiData.taskDefKey === 'precision_check') { - this.activeTabKey = '4'; - } - this.spinning = true + + /** + * 鑾峰彇娴佺▼鍥� + * @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 + }) + }) }, + async handleOk() { const that = this - if(that.$refs.editableDetailTable) { + + 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 (errMap) { - this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') - return + if (this.activeTabKey != '1') { + this.activeTabKey = '1' + if (errMap) { + that.$refs.editableDetailTable.clearValidate() + that.$notification.warning({ + message: '娑堟伅', + description: '淇濆吇鎴栭獙鏀朵笉鑳戒负绌�' + }) + return + } } + if (errMap) return } + // 瑙﹀彂琛ㄥ崟楠岃瘉 this.$refs.form.validate(valid => { if (valid) { that.confirmLoading = that.spinning = true - let tableData = []; - let precisionTableData = []; - if(that.$refs.editableDetailTable) { - tableData = that.$refs.editableDetailTable.getTableData() - } - if(that.$refs.editablePrecisionDetailTable) { - precisionTableData = that.$refs.editablePrecisionDetailTable.getTableData() - } - that.model.tableDetailList = [...tableData] - that.model.precisionDetailList = [...precisionTableData] - let httpurl = this.url.approval - let method = 'put' + that.model.tableDetailList = that.$refs.editableDetailTable.getTableData() - httpAction(httpurl, this.model, method).then((res) => { - if (res.success) { - that.$message.success(res.message) - that.$emit('searchReset') - that.close() - } else { - that.$message.warning(res.message) - } - }).finally(() => { - that.confirmLoading = that.spinning = false - }) + httpAction(that.url.approval, that.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 } }) }, + + handleDynamicColumns() { + let columns = [] + if (this.displayFirstAcceptanceFlag) { + columns = [ + { + title: '绗竴娆¢獙鏀剁粨鏋�', + key: 'firstInspectResult', + type: JVXETypes.slot, + align: 'center', + width: 200, + slotName: 'firstInspectResult', + validateRules: [{ required: true, message: '璇烽�夋嫨${title}' }] + }, + { + title: '绗竴娆¢獙鏀跺紓甯告弿杩�', + key: 'firstInspectException', + type: JVXETypes.slot, + align: 'center', + width: 200, + slotName: 'firstInspectException', + validateRules: [ + { handler: this.firstAcceptanceExceptionDescriptionValidator } + ] + } + ] + } + + if (this.displaySecondAcceptanceFlag) { + columns = [ + ...columns, + { + title: '绗簩娆¢獙鏀剁粨鏋�', + key: 'secondInspectResult', + type: JVXETypes.slot, + align: 'center', + width: 200, + slotName: 'secondInspectResult', + validateRules: [{ required: true, message: '璇烽�夋嫨${title}' }] + }, + { + title: '绗簩娆¢獙鏀跺紓甯告弿杩�', + key: 'secondInspectException', + type: JVXETypes.slot, + align: 'center', + width: 200, + slotName: 'secondInspectException', + validateRules: [ + { handler: this.secondAcceptanceExceptionDescriptionValidator } + ] + } + ] + } + this.detail.columns = [...this.detail.defaultColumns, ...columns] + }, + autocompleteForm(selectObj) { this.$set(this.model, 'standardName', selectObj.standardName) this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) this.$set(this.model, 'standardId', selectObj.id) this.$set(this.model, 'equipmentId', selectObj.equipmentId) - // console.log('model', this.model) - if (!this.model.id) { - this.loadStandardDetail(selectObj.id) - } - this.loadMaintenanceOperatorList(this.model.equipmentId) }, - //鏍囧噯閫夋嫨鍙樺寲 - loadDetail(orderId) { - if (orderId) { - getAction(this.url.detail, { orderId: orderId }) - .then(res => { - if (res.success) { - this.detail.dataSource = [...res.result] - } - }) - .finally(() => { - this.spinning = false - }) - } + + /** + * 淇濆吇銆侀獙鏀剁粨鏋滃彂鐢熸敼鍙樻椂瑙﹀彂 + * @param value 鏀瑰彉鍚庣殑鍊� + * @param record 琛ㄦ牸琛岃褰� + * @param key 瀵硅薄灞炴�у悕绉� + */ + handleResultSelectChange(value, record, key) { + if (record[key]) delete record[key] + this.$refs.editableDetailTable.validateTable() }, - // loadPrecisionDetail(orderId) { - // if (orderId) { - // getAction(this.url.precisionCheckDetail, { orderId: orderId }).then(res => { - // if (res.success) { - // this.precisionDetail.dataSource = [...res.result] - // } - // }) - // } - // }, - loadMaintenanceOperatorList(equipmentId) { - this.maintenanceOperatorOptions = [] - let params = { positionCode: 'PCR0001' } - if (equipmentId) { - params.equipmentId = equipmentId - } - getAction(this.url.userSelect, params).then(res => { - if (res.success) { - this.maintenanceOperatorOptions = res.result.map(item => ({ - key: item.id, - value: item.username, - text: item.realname - })) - } - }) - }, - handleInspectionResultSelectChange(value, record) { - if (record.exceptionDescription) delete record.exceptionDescription - if (record.reportFlag) delete record.reportFlag - }, - // 鎵归噺閫夋嫨鎵�鏈夌偣妫�缁撴灉 - handleSelectAllInspectionResult() { + + // 鎵归噺閫夋嫨淇濆吇缁撴灉姝e父 + handleSelectAllMaintenanceResult() { this.selectedRowKeys.forEach(key => { const dataItem = this.detail.dataSource.find(item => item.id === key) - if (dataItem && dataItem.maintenanceResult !== '1') { - console.log('dataItem', dataItem) + if (dataItem && dataItem.maintenanceResult !== 'NORMAL') { delete dataItem.exceptionDescription - delete dataItem.reportFlag - dataItem.maintenanceResult = '1' + dataItem.maintenanceResult = 'NORMAL' } }) this.$refs.editableDetailTable.clearCheckboxRow() + this.selectedRowKeys = [] + }, + + // 鎵归噺閫夋嫨绗竴娆¢獙鏀剁粨鏋滈�氳繃 + handleSelectAllFirstAcceptanceResult() { + this.selectedRowKeys.forEach(key => { + const dataItem = this.detail.dataSource.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.selectedRowKeys = [] }, @@ -601,10 +647,57 @@ this.selectedRowKeys = selectedRowIds }, - customValidator({ cellValue, row }, callback) { + // 淇濆吇鍓嶆妧鏈姸鎬佸崟閫夊彂鐢熸敼鍙樻椂瑙﹀彂 + handleCheckRadioChange() { + if (this.model.fullyFunctional == '1' && this.model.runningNormally == '1') this.model.problemDescription = '' + }, + + /** + * 淇濆吇寮傚父鎻忚堪鍗曞厓鏍兼牎楠� + * @param cellValue 鍗曞厓鏍煎�� + * @param row 琛ㄦ牸琛岃褰� + * @param callback 缁撴灉鍥炶皟鍑芥暟 + */ + maintenanceExceptionDescriptionValidator({ cellValue, row }, callback) { if (row.maintenanceResult === '2') { if (!cellValue) { - callback(false, '${title}涓嶈兘涓虹┖锛�') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀� + callback(false, '璇疯緭鍏�${title}') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀� + } else { + callback(true) // true = 閫氳繃楠岃瘉 + } + } else { + callback(true) + } + }, + + /** + * 绗竴娆¢獙鏀跺紓甯告弿杩板崟鍏冩牸鏍¢獙 + * @param cellValue 鍗曞厓鏍煎�� + * @param row 琛ㄦ牸琛岃褰� + * @param callback 缁撴灉鍥炶皟鍑芥暟 + */ + firstAcceptanceExceptionDescriptionValidator({ cellValue, row }, callback) { + if (row.firstInspectResult === '2') { + if (!cellValue) { + callback(false, '璇疯緭鍏�${title}') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀� + } else { + callback(true) // true = 閫氳繃楠岃瘉 + } + } else { + callback(true) + } + }, + + /** + * 绗簩娆¢獙鏀跺紓甯告弿杩板崟鍏冩牸鏍¢獙 + * @param cellValue 鍗曞厓鏍煎�� + * @param row 琛ㄦ牸琛岃褰� + * @param callback 缁撴灉鍥炶皟鍑芥暟 + */ + secondAcceptanceExceptionDescriptionValidator({ cellValue, row }, callback) { + if (row.secondInspectResult === '2') { + if (!cellValue) { + callback(false, '璇疯緭鍏�${title}') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀� } else { callback(true) // true = 閫氳繃楠岃瘉 } @@ -626,6 +719,29 @@ } </script> -<style lang="less" scoped> +<style scoped lang="less"> + /deep/ .ant-select-dropdown-menu { + text-align: left; + } -</style> \ No newline at end of file + /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> -- Gitblit v1.9.3