From 19aff1ac87030b21d2b01cdca5d5604c840ba7c0 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期一, 21 七月 2025 21:36:31 +0800 Subject: [PATCH] 维修工单 --- src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue | 609 +++++++++++++++++++++---------------------------------- 1 files changed, 232 insertions(+), 377 deletions(-) diff --git a/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue b/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue index 50aebc3..57590e6 100644 --- a/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue +++ b/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue @@ -1,268 +1,97 @@ <template> - <j-modal - :width="1200" - :visible="visible" - :title="title" - :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" - @cancel="handCancel" - @ok="submitForm" - :mask-closable="false" - :confirmLoading="confirmLoading" - centered - > + <j-modal :width="1200" :visible="visible" :title="title" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handCancel" @ok="submitForm" :mask-closable="false" :confirmLoading="confirmLoading" fullscreen> <a-spin :spinning="spinning"> - <a-form-model ref="form" :model='tableRowRecord' :rules='validatorRules' :labelCol='labelCol' - :wrapperCol='wrapperCol'> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">鎶ヤ慨鍩虹淇℃伅</a-divider> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelColLong" + :wrapperCol="wrapperColLong"> + <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="缁翠慨寮�濮嬫椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input v-model="model.actualStartTime" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="缁翠慨缁撴潫鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input v-model="model.actualEndTime" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏁呴殰鍘熷洜"> + <a-textarea v-model="model.faultReason" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏁呴殰鍒嗘瀽"> + <a-textarea v-model="model.faultAnalysis" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鎺掓晠杩囩▼"> + <a-textarea v-model="model.faultProcess" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="棰勯槻鎺柦"> + <a-textarea v-model="model.faultPrevent" readOnly/> + </a-form-model-item> + </a-col> + </a-row> + </a-tab-pane> + </a-tabs> + </a-col> - <a-row> - <a-col :span='threeColSpan'> - <a-form-model-item label='宸ュ崟缂栧彿'> - <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairCode'/> - </a-form-model-item> + <!--缁翠慨浜烘槑缁�--> + <a-col class="scroll-col" :span="10"> + <a-tabs v-model="activeTabKey"> + <a-tab-pane key="1" tab="缁翠慨浜烘槑缁�"> + <j-vxe-table ref="editableDetailTable" rowNumber bordered keep-source :dataSource="detail.dataSource" + :columns="detail.columns"/> + </a-tab-pane> + + <template v-if="selectShenpiData.procInstId"> + <a-tab-pane key='2' tab='娴佺▼鍥�'> + <img :src="imageSrc" alt="Fetched Image"/> + </a-tab-pane> + </template> + </a-tabs> </a-col> - <a-col :span='threeColSpan'> - <a-form-model-item label='璁惧缂栧彿'> - <lx-search-equipment-select disabled v-model='tableRowRecord.equipmentId'/> - </a-form-model-item> - </a-col> - <a-col :span='threeColSpan'> - <a-form-model-item label='缁翠慨璐熻矗浜�'> - <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairer'/> - </a-form-model-item> + + <!--鍙充晶瀹℃壒鍒�--> + <a-col :span="6" class="scroll-col"> + <a-tabs> + <a-tab-pane tab="鎿嶄綔宸ョ‘璁�"> + <a-row> + <a-col :span="24"> + <a-form-model-item prop="confirmResult" label="纭绫诲瀷"> + <j-dict-select-tag type='radio' v-model='model.confirmResult' dictCode='approve_reject' + placeholder="璇烽�夋嫨纭绫诲瀷" + :disabled="disableSubmit || model.repairStatus!='PENDING_CONFIRMATION'"/> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鎰忚"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.confirmComment" + :disabled="disableSubmit || model.repairStatus!='PENDING_CONFIRMATION'"/> + </a-form-model-item> + </a-col> + </a-row> + </a-tab-pane> + </a-tabs> </a-col> </a-row> - - <a-row> - <a-col :span="threeColSpan"> - <a-form-model-item label="鏁呴殰寮�濮嬫椂闂�"> - <a-input :readOnly='inputReadOnly' v-model="tableRowRecord.faultStartTime"/> - </a-form-model-item> - </a-col> - - <a-col :span="threeColSpan"> - <a-form-model-item label="鏄惁鍋滄満"> - <j-dict-select-tag type='radio' v-model='tableRowRecord.breakdownFlag' dictCode='breakdown_flag' - disabled/> - </a-form-model-item> - </a-col> - </a-row> - - <a-row> - <a-col :span='threeColSpan*3'> - <a-form-model-item label='鎶ヤ慨鍥剧墖' :labelCol='labelColLong' :wrapperCol='wrapperColLong'> - <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" disabled :number="3" - v-model="tableRowRecord.reportImageFiles"/> - </a-form-model-item> - </a-col> - </a-row> - - <a-tabs v-model="activeTabKey"> - <a-tab-pane key="1" tab="缁翠慨澶勭悊"> - - <div v-if="repairConfirm"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">缁翠慨纭</a-divider> - - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairConfirm" label="鏄惁鍐呴儴鍙淮淇�"> - <j-dict-select-tag type='radio' v-model='tableRowRecord.repairConfirm' dictCode='yn' - placeholder="璇烽�夋嫨" :disabled="disableSubmit || tableRowRecord.repairStatus !== 'WAIT_INTERNAL_CONFIRM'"/> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairConfirmComment" label="缁翠慨纭鎰忚"> - <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="tableRowRecord.repairConfirmComment" - :readOnly="disableSubmit || tableRowRecord.repairStatus !== 'WAIT_INTERNAL_CONFIRM'"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - <div v-if="underInternalRepair && tableRowRecord.repairConfirm === '1'"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">缁翠慨缁撴灉</a-divider> - <a-row> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="鏁呴殰鍘熷洜" prop="faultReason" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'" - v-model="tableRowRecord.faultReason" rows="4" - placeholder="璇疯緭鍏ユ晠闅滃師鍥�"/> - </a-form-model-item> - </a-col> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="缁翠慨缁撴灉鎻忚堪" prop="repairDescription" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'" - v-model="tableRowRecord.repairDescription" - placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�"/> - </a-form-model-item> - </a-col> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="缁翠慨鍥剧墖" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3" - :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'" - v-model="tableRowRecord.imageFiles"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - <div v-if="leaderConfirm && tableRowRecord.repairConfirm === '0'"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">棰嗗纭</a-divider> - - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaderConfirm" label="鏄惁鍚屾剰澶栭儴缁翠慨"> - <j-dict-select-tag type='radio' v-model='tableRowRecord.leaderConfirm' dictCode='approved_rejected' - placeholder="璇烽�夋嫨" :disabled="disableSubmit || tableRowRecord.repairStatus!=='WAIT_LEADER_CONFIRM'"/> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaderConfirmComment" label="纭鎰忚"> - <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="tableRowRecord.leaderConfirmComment" - :readOnly="disableSubmit || tableRowRecord.repairStatus!=='WAIT_LEADER_CONFIRM'"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - <div v-if="underInternalRepair && tableRowRecord.leaderConfirm === '2'"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">缁翠慨缁撴灉</a-divider> - <a-row> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="鏁呴殰鍘熷洜" prop="faultReason" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'" - v-model="tableRowRecord.faultReason" rows="4" - placeholder="璇疯緭鍏ユ晠闅滃師鍥�"/> - </a-form-model-item> - </a-col> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="缁翠慨缁撴灉鎻忚堪" prop="repairDescription" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'" - v-model="tableRowRecord.repairDescription" - placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�"/> - </a-form-model-item> - </a-col> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="缁翠慨鍥剧墖" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3" - :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'" - v-model="tableRowRecord.imageFiles"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - <div v-if="externalConfirm && tableRowRecord.leaderConfirm === '1'"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">鏈哄姩鍔炵‘璁�</a-divider> - - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="externalConfirm" label="鏈哄姩鍔炴槸鍚﹀彲缁翠慨"> - <j-dict-select-tag type='radio' v-model='tableRowRecord.externalConfirm' dictCode='yn' - placeholder="璇烽�夋嫨" :disabled="disableSubmit||tableRowRecord.repairStatus!=='WAIT_EXTERNAL_CONFIRM'"/> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="externalConfirmComment" label="纭鎰忚"> - <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="tableRowRecord.externalConfirmComment" - :readOnly="disableSubmit || tableRowRecord.repairStatus!=='WAIT_EXTERNAL_CONFIRM'"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - <div v-if="underExternalRepair && tableRowRecord.externalConfirm === '1'"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">鏈哄姩鍔炵淮淇粨鏋�</a-divider> - <a-row> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="鏁呴殰鍘熷洜" prop="faultReason" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_EXTERNAL_REPAIR'" - v-model="tableRowRecord.faultReason" rows="4" - placeholder="璇疯緭鍏ユ晠闅滃師鍥�"/> - </a-form-model-item> - </a-col> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="缁翠慨缁撴灉鎻忚堪" prop="repairDescription" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_EXTERNAL_REPAIR'" - v-model="tableRowRecord.repairDescription" - placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�"/> - </a-form-model-item> - </a-col> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="缁翠慨鍥剧墖" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3" - :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_EXTERNAL_REPAIR'" - v-model="tableRowRecord.imageFiles"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - <div v-if="underOutsideRepair && tableRowRecord.externalConfirm === '0'"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">濮斿缁翠慨缁撴灉</a-divider> - <a-row> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="鏁呴殰鍘熷洜" prop="faultReason" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_OUTSIDE_REPAIR'" - v-model="tableRowRecord.faultReason" rows="4" - placeholder="璇疯緭鍏ユ晠闅滃師鍥�"/> - </a-form-model-item> - </a-col> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="缁翠慨缁撴灉鎻忚堪" prop="repairDescription" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_OUTSIDE_REPAIR'" - v-model="tableRowRecord.repairDescription" - placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�"/> - </a-form-model-item> - </a-col> - <a-col :span="twoColSpan*2"> - <a-form-model-item label="缁翠慨鍥剧墖" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3" - :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_OUTSIDE_REPAIR'" - v-model="tableRowRecord.imageFiles"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - <div v-if="operatorConfirm"> - <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="tableRowRecord.confirmComment" - :readOnly="disableSubmit || tableRowRecord.repairStatus!=='WAIT_CONFIRM'"/> - </a-form-model-item> - </a-col> - </a-row> - </div> - </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 hitaskDataSource" :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-tab-pane> - - <a-tab-pane key='3' tab='娴佺▼鍥�'> - <img :src="imageSrc" alt="Fetched Image"/> - </a-tab-pane> - </template> - </a-tabs> </a-form-model> </a-spin> </j-modal> </template> <script> - import '@assets/less/TableExpand.less' import { getAction, downFile, httpAction } from '@api/manage' import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect' + import { JVXETypes } from '@comp/jeecg/JVxeTable' export default { name: 'RepairOrderApprovalModal', @@ -276,151 +105,170 @@ data() { return { title: '', - threeColSpan: 8, - twoColSpan: 12, - inputReadOnly: true, disableSubmit: false, confirmLoading: false, spinning: false, - tableRowRecord: {}, - hitaskDataSource: [], + model: {}, imageSrc: null, activeTabKey: '1', labelCol: { xs: { span: 24 }, - sm: { span: 6 } + sm: { span: 10 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 16 } + sm: { span: 14 } }, labelColLong: { xs: { span: 24 }, - sm: { span: 2 } + sm: { span: 5 } }, wrapperColLong: { xs: { span: 24 }, - sm: { span: 20 } + sm: { span: 19 } }, - validatorRules: { - repairConfirm: [ - { required: true, message: '璇烽�夋嫨鏄惁鍐呴儴鍙淮淇紒' } + validatorRules: { confirmResult: [{ required: true, message: '璇烽�夋嫨纭绫诲瀷' }] }, + detail: { + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: '缁翠慨浜�', + key: 'repairUser', + align: 'center', + type: JVXETypes.normal + }, + { + title: '鏄惁鏄富缁翠慨浜�', + key: 'repairPrimary_dictText', + align: 'center', + type: JVXETypes.normal + }, + { + title: '缁翠慨鏃堕暱', + key: 'repairDuration', + align: 'center', + type: JVXETypes.normal + }, + { + title: '澶囨敞', + key: 'remark', + align: 'center', + type: JVXETypes.normal + } ], - repairConfirmComment: [ - { required: true, message: '璇疯緭鍏ョ淮淇‘璁ゆ剰瑙�' } - ], - leaderConfirm: [ - { required: true, message: '璇烽�夋嫨鏄惁鍚屾剰澶栭儴缁翠慨锛�' } - ], - leaderConfirmComment: [ - { required: true, message: '璇疯緭鍏ラ瀵肩‘璁ゆ剰瑙�' } - ], - externalConfirm: [ - { required: true, message: '璇烽�夋嫨鏈哄姩鍔炴槸鍚﹀彲缁翠慨锛�' } - ], - externalConfirmComment: [ - { required: true, message: '璇疯緭鍏ユ満鍔ㄥ姙纭鎰忚' } - ], - confirmComment: [ - { required: true, message: '璇疯緭鍏ユ搷浣滃伐纭鎰忚' } - ], - faultReason: [ - { required: true, message: '璇疯緭鍏ユ晠闅滃師鍥�' } - ], - repairDescription: [ - { required: true, message: '璇疯緭鍏ョ淮淇粨鏋滄弿杩�' } - ] + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['add', 'remove', 'clearSelection'] + } }, - approveData: {}, visible: false, // 琛ㄥご url: { - queryBomDataById: '/eam/eamRepairOrder/queryById', + queryById: '/eam/eamRepairOrder/queryByReportId', diagramView: '/assign/flow/diagramView', - queryHisTaskList: '/assign/flow/queryHisTaskList', - approve: '/eam/eamRepairOrder/perform' + approve: '/eam/eamRepairOrder/perform', + detail: '/eam/eamRepairPerson/list' } } }, computed: { - repairConfirm() { - return ['WAIT_INTERNAL_CONFIRM', 'UNDER_INTERNAL_REPAIR', 'WAIT_LEADER_CONFIRM', 'WAIT_EXTERNAL_CONFIRM', 'UNDER_EXTERNAL_REPAIR', 'UNDER_OUTSIDE_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) - }, - underInternalRepair() { - return ['UNDER_INTERNAL_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) - }, - leaderConfirm() { - return ['UNDER_INTERNAL_REPAIR', 'WAIT_LEADER_CONFIRM', 'WAIT_EXTERNAL_CONFIRM', 'UNDER_EXTERNAL_REPAIR', 'UNDER_OUTSIDE_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) - }, - externalConfirm() { - return ['WAIT_EXTERNAL_CONFIRM', 'UNDER_EXTERNAL_REPAIR', 'UNDER_OUTSIDE_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) - }, - underExternalRepair() { - return ['UNDER_EXTERNAL_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) - }, - underOutsideRepair() { - return ['UNDER_OUTSIDE_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) - }, operatorConfirm() { - return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus) + return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.repairStatus) } }, methods: { /** - * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘 - * @param record 寰呭姙璁板綍淇℃伅 + * 涓婚〉闈㈢偣鍑绘墽琛屽鎵规椂瑙﹀彂 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 */ - getAllApproveData(record) { - if (!record.procInstId) return - console.log('record----->', record) - const { procInstId, processDefinitionId, processInstanceId, processDefinitionKey } = record - const param = { procInstId } - const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey } + async handleDetail(record) { + this.spinning = true + this.activeTabKey = '1' + this.model = {} + this.getBasicInformationByApi(record) + this.getFlowChartImageByApi(record) + this.loadDetail(record.dataId) + }, + + /** + * 涓婚〉闈㈢偣鍑昏鎯呮椂瑙﹀彂 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + recordDetail(record) { + this.spinning = true + this.activeTabKey = '1' + this.model = Object.assign({}, record) + this.loadDetail(record.id) + }, + + /** + * 鑾峰彇鍩虹淇℃伅 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + getBasicInformationByApi(record) { const that = this - - getAction(this.url.queryHisTaskList, param) + getAction(this.url.queryById, { id: record.dataId }) .then(res => { - that.hitaskDataSource = res.result + if (res.success) { + that.model = Object.assign({}, res.result[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 + }) + } }) + }, - downFile(this.url.diagramView, imageParam, 'get') + /** + * 鑾峰彇娴佺▼鍥� + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + getFlowChartImageByApi(record) { + const { processDefinitionId, processInstanceId, processDefinitionKey } = record + + downFile(this.url.diagramView, { + processDefinitionId, + processInstanceId, + TaskDefinitionKey: processDefinitionKey + }, 'get') .then((res => { - const urlObject = window.URL.createObjectURL(new Blob([res])) - that.imageSrc = urlObject + this.imageSrc = window.URL.createObjectURL(new Blob([res])) })) .catch(err => { - that.$notification.error({ + this.$notification.error({ message: '娑堟伅', - description: res.message + description: err.message }) }) }, /** - * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭� - * @param record 寰呭姙璁板綍淇℃伅 + * 鑾峰彇缁翠慨浜烘槑缁� + * @param repairId */ - getBasicInformation(record) { - this.spinning = true - const that = this - const param = { id: record.dataId } - this.tableRowRecord = {} - this.activeTabKey = '1' - getAction(this.url.queryBomDataById, param) - .then((res => { - if (res.success) { - that.tableRowRecord = Object.assign({}, res.result, { - isUseSpare: res.result.isUseSpare === null ? 0 : res.result.isUseSpare, - imageFiles: JSON.parse(res.result.imageFiles), - reportImageFiles: JSON.parse(res.result.reportImageFiles) - }) - console.log('this.tableRowRecord----->', that.tableRowRecord) - } - })) + loadDetail(repairId) { + getAction(this.url.detail, { repairId }) + .then(res => { + if (res.success) this.detail.dataSource = res.result + }) .finally(() => { - that.spinning = false + this.spinning = false }) }, + submitForm() { const that = this @@ -428,41 +276,25 @@ this.$refs.form.validate(valid => { if (valid) { that.confirmLoading = that.spinning = true - const { confirmComment, externalConfirm, externalConfirmComment, repairConfirm, repairConfirmComment, leaderConfirm, leaderConfirmComment, faultReason, repairDescription, imageFiles, equipmentId } = that.tableRowRecord - const { dataId, id, procInstId, taskDefKey, variables } = that.selectShenpiData - - const flowTaskVo = {} - flowTaskVo.repairConfirm = repairConfirm - flowTaskVo.repairConfirmComment = repairConfirmComment - flowTaskVo.leaderConfirm = leaderConfirm - flowTaskVo.leaderConfirmComment = leaderConfirmComment - flowTaskVo.externalConfirm = externalConfirm - flowTaskVo.externalConfirmComment = externalConfirmComment - flowTaskVo.confirmComment = confirmComment - - flowTaskVo.faultReason = faultReason - flowTaskVo.repairDescription = repairDescription - flowTaskVo.imageFilesResult = imageFiles - flowTaskVo.equipmentId = equipmentId - flowTaskVo.id = dataId - flowTaskVo.dataId = dataId - flowTaskVo.taskId = id - flowTaskVo.instanceId = procInstId - flowTaskVo.targetKey = taskDefKey - flowTaskVo.values = variables - console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo) - httpAction(this.url.approve, flowTaskVo, 'post') + httpAction(this.url.approve, that.model, 'post') .then((res) => { if (res.success) { - that.$message.success(res.message) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) that.handCancel() - that.$emit('searchReset') + that.$emit('modalFormOk') } else { - that.$message.warning(res.message) + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) } - }).finally(() => { - that.confirmLoading = that.spinning = false - }) + }) + .finally(() => { + that.confirmLoading = that.spinning = false + }) } else { return false } @@ -475,4 +307,27 @@ } } } -</script> \ No newline at end of file +</script> + +<style scoped lang="less"> + /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