From f7f0a26ba95de85e537b0c18e02f06416b01312f Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期一, 04 八月 2025 21:33:28 +0800 Subject: [PATCH] 保养流程添加流程节点 --- src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue | 449 ++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 341 insertions(+), 108 deletions(-) diff --git a/src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue b/src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue index 95e580f..988848e 100644 --- a/src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue +++ b/src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue @@ -3,7 +3,7 @@ :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="submitForm" @cancel="handleCancel" :mask-closable="false" :confirmLoading="confirmLoading"> <a-spin :spinning="spinning"> - <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol" + <a-form-model ref='form' :model='model' :labelCol="labelCol" :wrapperCol="wrapperCol" :rules="validatorRules"> <a-row :gutter="24" id="outer-row"> <a-col :span="8" class="scroll-col"> @@ -12,12 +12,12 @@ <a-row> <a-col :span="span"> <a-form-model-item prop="standardCode" label="瑙勮寖缂栫爜"> - <a-input v-model="tableRowRecord.standardCode" readOnly/> + <a-input v-model="model.standardCode" readOnly/> </a-form-model-item> </a-col> <a-col :span="span"> <a-form-model-item prop="standardName" label="瑙勮寖鍚嶇О"> - <a-input v-model="tableRowRecord.standardName" readOnly/> + <a-input v-model="model.standardName" readOnly/> </a-form-model-item> </a-col> </a-row> @@ -25,12 +25,12 @@ <a-row> <a-col :span='span'> <a-form-model-item label="缁熶竴缂栫爜"> - <a-input v-model="tableRowRecord.equipmentCode" readOnly/> + <a-input v-model="model.equipmentCode" readOnly/> </a-form-model-item> </a-col> <a-col :span='span'> <a-form-model-item label="淇濆吇鍒嗙被"> - <a-input v-model="tableRowRecord.maintenanceCategory_dictText" readOnly/> + <a-input v-model="model.maintenanceCategory_dictText" readOnly/> </a-form-model-item> </a-col> @@ -39,12 +39,12 @@ <a-row> <a-col :span='span'> <a-form-model-item label="淇濆吇鍛ㄦ湡鍗曚綅"> - <a-input v-model="tableRowRecord.periodUnit" readOnly/> + <a-input v-model="model.periodUnit" readOnly/> </a-form-model-item> </a-col> <a-col :span='span'> <a-form-model-item label="淇濆吇鍛ㄦ湡"> - <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/> + <a-input v-model="model.maintenancePeriod" readOnly/> </a-form-model-item> </a-col> </a-row> @@ -52,12 +52,12 @@ <a-row> <a-col :span='span'> <a-form-model-item label="鍒濆鏃ユ湡"> - <a-input v-model="tableRowRecord.initialDate" readOnly/> + <a-input v-model="model.initialDate" readOnly/> </a-form-model-item> </a-col> <a-col :span='span'> <a-form-model-item label="瑙勮寖鐘舵��"> - <a-input v-model="tableRowRecord.standardStatus_dictText" readOnly/> + <a-input v-model="model.standardStatus_dictText" readOnly/> </a-form-model-item> </a-col> </a-row> @@ -65,7 +65,7 @@ <a-row> <a-col :span="span"> <a-form-model-item label="瑙勮寖鐗堟湰"> - <a-input v-model="tableRowRecord.standardVersion" readOnly/> + <a-input v-model="model.standardVersion" readOnly/> </a-form-model-item> </a-col> </a-row> @@ -76,59 +76,76 @@ <a-col :span="10" class="scroll-col"> <a-tabs default-active-key="1"> <a-tab-pane key="1" tab="淇濆吇椤规槑缁�"> - <j-vxe-table ref="editableDetailTable" :rowNumber="false" :bordered="true" - :alwaysEdit="true" :toolbar="false" keep-source :loading="detail.loading" - :dataSource="detail.dataSource" :columns="detail.columns"> + <j-vxe-table ref="editableDetailTable" bordered alwaysEdit keep-source :dataSource="detail.dataSource" + :columns="detail.columns"> <template v-slot:itemCategory="props"> <j-dict-select-tag v-model="props.row.itemCategory" :dict-code="encodedDictCode" disabled/> </template> </j-vxe-table> </a-tab-pane> - <template v-if="selectShenpiData.procInstId"> - <a-tab-pane tab='娴佺▼鍥�' forceRender> - <img :src="imageSrc" width="100%" v-if="imageSrc"/> + <template v-if="selectShenpiData.processDefinitionKey"> + <a-tab-pane key='2' tab='娴佺▼鍥�'> + <img :src="imageSrc" alt="Fetched Image"/> </a-tab-pane> </template> + + <a-tab-pane key='3' tab='娴佽浆鑺傜偣'> + <a-card> + <a-timeline style="padding:0 1% 0 12%" > + <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1"> + <div class="bottom"> + <p>澶勭悊浜猴細{{item.assignee_dictText}}</p> + <p v-if="index1 !==0">澶勭悊鏃堕暱锛歿{item.duration}}</p> + <p v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</p> + <p v-if="item.description != null">澶勭悊鎰忚锛歿{item.description}}</p> + <div class="left_qiu"><span>{{item.taskName}}</span></div> + </div> + </a-timeline-item> + </a-timeline> + </a-card> + </a-tab-pane> </a-tabs> </a-col> <a-col :span="6" class="scroll-col"> - <a-tabs> + <a-tabs v-if="displayRepairLeaderFlag"> <a-tab-pane tab="缁翠慨涓讳换瀹℃壒"> <a-row :gutter="24"> <a-col :span="24"> - <a-form-model-item prop="repairManagerApproveResult" label="澶勭悊绫诲瀷"> - <j-dict-select-tag type='radio' v-model='tableRowRecord.repairManagerApproveResult' - dictCode='approved_rejected' - :disabled="disableSubmit||tableRowRecord.standardStatus!=='WAIT_REPAIR_DIRECTOR'"/> + <a-form-model-item prop="repairManagerApproveResult" label="纭绫诲瀷"> + <j-dict-select-tag type='radio' v-model='model.repairManagerApproveResult' + dictCode='approve_reject' + :disabled="disableSubmit||model.standardStatus!=='WAIT_REPAIR_DIRECTOR'"/> </a-form-model-item> </a-col> <a-col :span="24"> - <a-form-model-item label="澶勭悊鎰忚"> + <a-form-model-item label="纭鎰忚"> <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" - :disabled="disableSubmit||tableRowRecord.standardStatus!=='WAIT_REPAIR_DIRECTOR'" - v-model="tableRowRecord.repairManagerApproveComment"/> + :disabled="disableSubmit||model.standardStatus!=='WAIT_REPAIR_DIRECTOR'" + v-model="model.repairManagerApproveComment"/> </a-form-model-item> </a-col> </a-row> </a-tab-pane> </a-tabs> - <a-tabs v-if="tableRowRecord.standardStatus&&tableRowRecord.standardStatus!=='WAIT_REPAIR_DIRECTOR'"> + <a-tabs v-if="displayTechnicalDirectorFlag"> <a-tab-pane tab="鎶�鏈富绠″鎵�"> <a-row :gutter="24"> <a-col :span="24"> - <a-form-model-item prop="technicalManagerApproveResult" label="澶勭悊绫诲瀷"> - <j-dict-select-tag type='radio' v-model='tableRowRecord.technicalManagerApproveResult' - dictCode='approved_rejected'/> + <a-form-model-item prop="technicalManagerApproveResult" label="纭绫诲瀷"> + <j-dict-select-tag type='radio' v-model='model.technicalManagerApproveResult' + dictCode='approve_reject' + :disabled="disableSubmit||model.standardStatus!=='WAIT_TECHNICAL_DIRECTOR'"/> </a-form-model-item> </a-col> <a-col :span="24"> - <a-form-model-item label="澶勭悊鎰忚"> - <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="tableRowRecord.technicalManagerApproveComment"/> + <a-form-model-item label="纭鎰忚"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.technicalManagerApproveComment" + :disabled="disableSubmit||model.standardStatus!=='WAIT_TECHNICAL_DIRECTOR'"/> </a-form-model-item> </a-col> </a-row> @@ -142,10 +159,9 @@ </template> <script> - import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' + import { getAction, downFile, httpAction } from '@api/manage' import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' import { JVXETypes } from '@comp/jeecg/JVxeTable' - import moment from 'moment' export default { name: 'MaintenanceStandardApprovalModal', @@ -160,14 +176,10 @@ span: 12, confirmLoading: false, spinning: false, - tableRowRecord: {}, + model: {}, validatorRules: { - repairManagerApproveResult: [ - { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' } - ], - technicalManagerApproveResult: [ - { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' } - ] + repairManagerApproveResult: [{ required: true, message: '璇烽�夋嫨纭绫诲瀷' }], + technicalManagerApproveResult: [{ required: true, message: '璇烽�夋嫨纭绫诲瀷' }] }, imageSrc: null, labelCol: { @@ -188,10 +200,10 @@ detailList: '/eam/eamMaintenanceStandardDetail/queryList' }, detail: { - loading: false, dataSource: [], columns: [], - defaultColumns: [ + hitaskDataSource:[], + inspectionColumns: [ { title: 'ID', key: 'id', @@ -205,37 +217,90 @@ { title: '椤圭洰搴忓彿', key: 'itemCode', - type: JVXETypes.inputNumber, - align: 'center', - disabled: true - }, - { - title: '閮ㄤ綅', - key: 'itemPart', - type: JVXETypes.textarea, - align: 'center', - disabled: true + type: JVXETypes.normal, + align: 'center' }, { title: '淇濆吇椤瑰垎绫�', key: 'itemCategory', type: JVXETypes.slot, slotName: 'itemCategory', - align: 'center' + align: 'center', + disabled: true }, { title: '淇濆吇椤圭洰', key: 'itemName', - type: JVXETypes.textarea, - align: 'center', - disabled: true + type: JVXETypes.normal, + align: 'center' }, { title: '淇濆吇瑙勮寖鎴栬姹�', key: 'itemDemand', - type: JVXETypes.textarea, + type: JVXETypes.normal, + align: 'center' + } + ], + secondMaintenanceColumns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: 'standardId', + key: 'standardId', + type: JVXETypes.hidden + }, + { + title: '椤圭洰搴忓彿', + key: 'itemCode', + type: JVXETypes.normal, + align: 'center' + }, + { + title: '淇濆吇椤瑰垎绫�', + key: 'itemCategory', + type: JVXETypes.slot, + slotName: 'itemCategory', align: 'center', disabled: true + }, + { + title: '淇濆吇椤圭洰', + key: 'itemName', + type: JVXETypes.normal, + align: 'center' + } + ], + thirdMaintenanceColumns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: 'standardId', + key: 'standardId', + type: JVXETypes.hidden + }, + { + title: '淇濆吇閮ㄤ綅', + key: 'itemPart', + type: JVXETypes.normal, + align: 'center' + }, + { + title: '淇濆吇鍐呭', + key: 'itemName', + type: JVXETypes.normal, + align: 'center' + }, + { + title: '楠屾敹鏍囧噯', + key: 'itemDemand', + type: JVXETypes.normal, + align: 'center' } ] }, @@ -244,17 +309,36 @@ } }, watch: { - 'tableRowRecord.maintenanceCategory': { + 'model.maintenanceCategory': { handler(val) { if (val) { - if (val != 'THIRD_MAINTENANCE') this.detail.columns = [...this.detail.defaultColumns.filter(item => item.key != 'itemPart')] - else this.detail.columns = [...this.detail.defaultColumns.filter(item => item.key != 'itemCategory')] + console.log('val', val) + switch (val) { + case 'POINT_INSPECTION': + this.detail.columns = this.detail.inspectionColumns + break + case 'SECOND_MAINTENANCE': + this.detail.columns = this.detail.secondMaintenanceColumns + break + case 'THIRD_MAINTENANCE': + this.detail.columns = this.detail.thirdMaintenanceColumns + break + default: + break + } } - else this.detail.columns = [...this.detail.defaultColumns] } } }, computed: { + displayRepairLeaderFlag() { + return this.model.standardStatus && ['WAIT_REPAIR_DIRECTOR', 'WAIT_TECHNICAL_DIRECTOR', 'REJECTED'].includes(this.model.standardStatus) + }, + + displayTechnicalDirectorFlag() { + return this.model.standardStatus && ['WAIT_TECHNICAL_DIRECTOR', 'REJECTED'].includes(this.model.standardStatus) && this.model.repairManagerApproveResult === '1' + }, + encodedDictCode() { const dictCode = `sys_dict_item,item_text,item_value,dict_id='1940598438685134850'` return encodeURIComponent(dictCode) @@ -262,39 +346,93 @@ }, methods: { /** - * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘 - * @param record 寰呭姙璁板綍淇℃伅 + * 涓婚〉闈㈢偣鍑绘墽琛屽鎵规椂瑙﹀彂 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 */ - getAllApproveData(record) { - if (record.procInstId) { - const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = record - const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey } - const that = this - this.imageSrc = null - - downFile(this.url.diagramView, imageParam, 'get') - .then((res => { - const urlObject = window.URL.createObjectURL(new Blob([res])) - that.imageSrc = urlObject - })) - .finally(() => { - this.spinning = false - }) - } + handleApprove(record) { + this.getBasicInformationByApi(record) + this.getFlowChartImageByApi(record) + this.getFlowTaskListByApi(record) }, /** - * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭� - * @param record 寰呭姙璁板綍淇℃伅 + * 鑾峰彇娴佽浆鑺傜偣 + * @param record */ - async getBasicInformation(record) { + getFlowTaskListByApi(record) { + console.log("sss",record) + let parmhis={ + 'procInstId': record.procInstId + } + getAction(this.url.queryHisTaskList,parmhis).then(res=>{ + this.hitaskDataSource=res.result + }).finally( + this.visible = true, + console.log('this.approveData---->', this.approveData) + ) + }, + + /** + * 涓婚〉闈㈢偣鍑昏鎯呮椂瑙﹀彂 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + handleDetail(record) { this.detail.dataSource = [] - this.tableRowRecord = {} + this.model = Object.assign({}, record) + this.loadDetail(record.id) + }, + + /** + * 鑾峰彇鍩虹淇℃伅 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + getBasicInformationByApi(record) { this.spinning = true - const param = { id: record.dataId } - let res = await getAction(this.url.queryById, param) - this.tableRowRecord = Object.assign({}, res.result.records[0]) - await this.loadDetail(record.dataId) + this.model = {} + this.detail.dataSource = [] + 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 + }) + } + }) + .finally(() => { + this.loadDetail(record.dataId) + }) + }, + + /** + * 鑾峰彇娴佺▼鍥� + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + getFlowChartImageByApi(record) { + const { processDefinitionId, processInstanceId, processDefinitionKey } = record + this.imageSrc = null + 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 + }) + }) }, /** @@ -302,14 +440,13 @@ * @param dataId 涓氬姟ID */ loadDetail(dataId) { - if (dataId) { - getAction(this.url.detailList, { standardId: dataId }) - .then(res => { - if (res.success) { - this.detail.dataSource = [...res.result] - } - }) - } + getAction(this.url.detailList, { standardId: dataId }) + .then(res => { + if (res.success) this.detail.dataSource = res.result + }) + .finally(() => { + this.spinning = false + }) }, async submitForm() { @@ -321,21 +458,8 @@ this.$refs.form.validate(valid => { if (valid) { this.confirmLoading = this.spinning = true - const flowTaskVo = {} - flowTaskVo.dataId = this.selectShenpiData.dataId - flowTaskVo.taskId = this.selectShenpiData.id - flowTaskVo.userId = this.selectShenpiData.assignee - flowTaskVo.instanceId = this.selectShenpiData.procInstId - if (this.tableRowRecord.standardStatus == 'WAIT_REPAIR_DIRECTOR') { - flowTaskVo.repairManagerApproveResult = this.tableRowRecord.repairManagerApproveResult - flowTaskVo.repairManagerApproveComment = this.tableRowRecord.repairManagerApproveComment - } else { - flowTaskVo.technicalManagerApproveResult = this.tableRowRecord.technicalManagerApproveResult - flowTaskVo.technicalManagerApproveComment = this.tableRowRecord.technicalManagerApproveComment - } const that = this - console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo) - httpAction(this.url.approve, flowTaskVo, 'post') + httpAction(this.url.approve, that.model, 'post') .then((res) => { if (res.success) { that.$notification.success({ @@ -392,4 +516,113 @@ } } } + /* 鍏ㄥ眬绂侀�夋牱寮� - 浣滅敤浜庢暣涓〉闈� */ + html.submitting, + html.submitting body { + pointer-events: none !important; + cursor: wait !important; + } + + /* 钂欏眰鏁堟灉澧炲己 */ + html.submitting::before { + content: ''; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(255, 255, 255, 0.5); + z-index: 9998; + } + + /* 鍔犺浇鎸囩ず鍣� - 鏇存槑鏄剧殑瑙嗚鍙嶉 */ + html.submitting::after { + content: '鎻愪氦涓�...'; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background: #1890ff; + color: white; + padding: 10px 20px; + border-radius: 4px; + z-index: 9999; + } + + /* 绂佺敤鐘舵�佹寜閽牱寮� */ + .disabled-btn { + opacity: 0.6; + cursor: not-allowed !important; + } + + .shallow-hr { + border: 0; + height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */ + background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */ + margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */ + } + .btn-custom { + background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */ + color: white; /* 鐧借壊鏂囧瓧 */ + border: none; /* 鏃犺竟妗� */ + padding: 5px 15px; /* 鍐呰竟璺� */ + text-align: center; /* 鏂囧瓧灞呬腑 */ + text-decoration: none; /* 鏃犱笅鍒掔嚎 */ + display: inline-block; /* 琛屽唴鍧楀厓绱� */ + font-size: 12px; /* 瀛椾綋澶у皬 */ + margin: 4px 2px; /* 澶栬竟璺� */ + cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */ + border-radius: 4px; /* 鍦嗚杈规 */ + } + + .bold-large-label { + font-weight: bold; + font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */ + } + .left_qiu{ + position: absolute; + left: -74px; + top: 0; + width:54px; + border-radius: 50%; + height:54px; + font-size: 13px; + margin: auto; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + background: #0099ff; + transform: translate(0, 0); + } + /deep/ .ant-timeline-item-tail{ + left: -29px !important; + } + .left_qiu span{ + width: 3em; + display: block; + color: #fff; + text-align: center; + } + .img{ + width: 75%; + } + + .wrap{ + clear: both; + width: 100%; + display: flex; + height: 50px; + border: 1px solid #ccc; + /* background-color: aqua; */ + } + .box{ + width:21%; + height:50px; + border-right: 1px solid #ccc; + line-height: 50px; + /* background: red; */ + text-align:center; + margin: auto; + } </style> \ No newline at end of file -- Gitblit v1.9.3