From 2de735967d33dba5da5fc87191dee543b000afaf Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 18 七月 2025 20:20:18 +0800 Subject: [PATCH] 删除 --- src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue | 206 ++++++++++++++++++++++++++++++--------------------- 1 files changed, 121 insertions(+), 85 deletions(-) diff --git a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue index 4a6b56f..1662efc 100644 --- a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue +++ b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue @@ -3,21 +3,20 @@ :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="submitForm" @cancel="handleCancel" :mask-closable="false" :confirmLoading="confirmLoading" fullscreen> <a-spin :spinning="spinning"> - <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol" - :rules="validatorRules"> - <a-row :gutter="48"> - <a-col :span="8"> + <a-form-model ref='form' :model='model' :labelCol="labelCol" :wrapperCol="wrapperCol" :rules="validatorRules"> + <a-row :gutter="48" id="outer-row"> + <a-col :span="8" class="scroll-col"> <a-tabs> <a-tab-pane tab="鍩虹淇℃伅"> <a-row> <a-col :span='span'> <a-form-model-item label="宸ュ崟鍙�"> - <a-input readOnly v-model="tableRowRecord.orderNum"/> + <a-input readOnly v-model="model.orderNum"/> </a-form-model-item> </a-col> <a-col :span='span'> <a-form-model-item label="璁惧缂栧彿"> - <MaintenanceEquipmentSelect v-model="tableRowRecord.equipmentId" + <MaintenanceEquipmentSelect v-model="model.equipmentId" :maintenanceCategory="'POINT_INSPECTION'" disabled @autocompleteForm="autoCompleteForm"/> </a-form-model-item> @@ -28,12 +27,12 @@ <a-row> <a-col :span='span'> <a-form-model-item label="瑙勮寖鍚嶇О"> - <a-input readOnly v-model="tableRowRecord.standardName"/> + <a-input readOnly v-model="model.standardName"/> </a-form-model-item> </a-col> <a-col :span='span'> <a-form-model-item label="瑙勮寖缂栫爜"> - <a-input readOnly v-model="tableRowRecord.standardCode"/> + <a-input readOnly v-model="model.standardCode"/> </a-form-model-item> </a-col> @@ -42,12 +41,12 @@ <a-row> <a-col :span='span'> <a-form-model-item label="鐐规鏃ユ湡"> - <a-input v-model="tableRowRecord.inspectionDate" readOnly/> + <a-input v-model="model.inspectionDate" readOnly/> </a-form-model-item> </a-col> <a-col :span='span'> - <a-form-model-item label="鐐规杩囨湡鏃堕棿"> - <a-input v-model="tableRowRecord.expirationTime" readOnly/> + <a-form-model-item label="杩囨湡鏃堕棿"> + <a-input v-model="model.expirationTime" readOnly/> </a-form-model-item> </a-col> </a-row> @@ -55,12 +54,12 @@ <a-row> <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-col :span='span'> <a-form-model-item label="鐐规浜�"> - <a-input v-model="tableRowRecord.operator_dictText" readOnly/> + <a-input v-model="model.operator_dictText" readOnly/> </a-form-model-item> </a-col> </a-row> @@ -68,7 +67,7 @@ <a-row> <a-col :span="span*2"> <a-form-model-item label="澶囨敞" :labelCol="{span:4}" :wrapperCol="{span:20}"> - <a-textarea v-model="tableRowRecord.remark" rows="3" readOnly/> + <a-textarea v-model="model.remark" rows="3" readOnly/> </a-form-model-item> </a-col> </a-row> @@ -76,11 +75,11 @@ </a-tabs> </a-col> - <a-col :span="!isDisplayConfirm?16:10"> + <a-col :span="!isDisplayConfirm?16:10" class="scroll-col"> <a-tabs :active-key="activeTabKey" @change="handleTabChange"> <a-tab-pane key="1" tab="鏃ョ偣妫�"> <j-vxe-table ref="editableDetailTable1" :rowNumber="false" rowSelection bordered - alwaysEdit :toolbar="false" keep-source :height="300" :loading="detail.loading" + alwaysEdit :toolbar="false" keep-source :height="500" :dataSource="detail.dayInspectionList" :columns="detail.columns" @selectRowChange="handleTableSelectRowChange($event,'Day')"> <template v-slot:inspectionResult="props"> @@ -91,7 +90,7 @@ </template> <template v-slot:exceptionDescription="props"> - <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" + <a-textarea :rows="1" style="resize: none" v-model="props.row.exceptionDescription" :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'璇疯緭鍏ュ紓甯告弿杩�':''" :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"/> </template> @@ -107,7 +106,7 @@ <a-tab-pane key="2" tab="鍛ㄧ偣妫�" forceRender> <j-vxe-table ref="editableDetailTable2" :rowNumber="false" rowSelection bordered - alwaysEdit :toolbar="false" keep-source :height="300" :loading="detail.loading" + alwaysEdit :toolbar="false" keep-source :height="500" :dataSource="detail.weekInspectionList" :columns="detail.columns" @selectRowChange="handleTableSelectRowChange($event,'Week')"> <template v-slot:inspectionResult="props"> @@ -119,7 +118,7 @@ </template> <template v-slot:exceptionDescription="props"> - <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" + <a-textarea :rows="1" style="resize: none" v-model="props.row.exceptionDescription" :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'璇疯緭鍏ュ紓甯告弿杩�':''" :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"/> </template> @@ -148,23 +147,23 @@ </a-tabs> </a-col> - <a-col v-if="isDisplayConfirm" :span="6"> + <a-col v-if="isDisplayConfirm" :span="6" class="scroll-col"> <a-tabs> <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='tableRowRecord.confirmDealType' + <j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approved_rejected' - :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"/> + :disabled="disableSubmit||model.inspectionStatus!=='WAIT_CONFIRM'"/> </a-form-model-item> </a-col> <a-col :span="24"> - <a-form-model-item prop="confirmComment" label="澶勭悊鎰忚"> - <a-textarea placeholder="璇疯緭鍏ュ鐞嗘剰瑙�" - :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'" - v-model="tableRowRecord.confirmComment"/> + <a-form-model-item label="澶勭悊鎰忚"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" + :disabled="disableSubmit||model.inspectionStatus!=='WAIT_CONFIRM'" + v-model="model.confirmComment"/> </a-form-model-item> </a-col> </a-row> @@ -196,23 +195,20 @@ span: 12, confirmLoading: false, spinning: false, - tableRowRecord: {}, + model: {}, validatorRules: { confirmDealType: [ { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' } - ], - confirmComment: [ - { required: true, message: '璇疯緭鍏ュ鐞嗘剰瑙�' } ] }, imageSrc: null, labelCol: { xs: { span: 24 }, - sm: { span: 9 } + sm: { span: 8 } }, wrapperCol: { xs: { span: 30 }, - sm: { span: 15 } + sm: { span: 16 } }, visible: false, // 琛ㄥご @@ -292,52 +288,75 @@ }, computed: { isDisplayConfirm() { - return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.inspectionStatus) + return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.inspectionStatus) }, isDisableOperation() { - return this.disableSubmit || this.tableRowRecord.inspectionStatus !== 'UNDER_INSPECTION' + return this.disableSubmit || this.model.inspectionStatus !== 'UNDER_INSPECTION' } }, methods: { - /** - * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘 - * @param record 寰呭姙璁板綍淇℃伅 - */ - getAllApproveData(record) { - if (record.procInstId) { - const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = record - const param = { procInstId } - const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey } - const that = this + handleApprove(record) { + this.spinning = true + this.activeTabKey = '1' + this.detail.dayInspectionList = this.detail.weekInspectionList = [] + this.getBasicInformationByApi(record) + this.getFlowChartImageByApi(record) + }, - downFile(this.url.diagramView, imageParam, 'get') - .then((res => { - const urlObject = window.URL.createObjectURL(new Blob([res])) - that.imageSrc = urlObject - })) - .catch(err => { - that.$notification.error({ - message: '娑堟伅', - description: res.message - }) - }) - } + handleDetail(record) { + this.spinning = true + this.activeTabKey = '1' + this.detail.dayInspectionList = this.detail.weekInspectionList = [] + this.model = Object.assign({}, record) + this.getDayInspectionOrderListByApi(record.id) + this.getWeekInspectionOrderListByApi(record.standardId) }, /** - * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭� - * @param record 寰呭姙璁板綍淇℃伅 + * 鑾峰彇鍩虹淇℃伅 + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 */ - async getBasicInformation(record) { - this.activeTabKey = '1' - this.detail.dayInspectionList = this.detail.weekInspectionList = [] - this.spinning = true - const param = { id: record.dataId } - let res = await getAction(this.url.queryById, param) - this.tableRowRecord = Object.assign({}, res.result) - this.getDayInspectionOrderListByApi(record.dataId) - console.log('record', record) - this.getWeekInspectionOrderListByApi(this.tableRowRecord.standardId) + getBasicInformationByApi(record) { + const that = this + getAction(this.url.queryById, { id: record.dataId }) + .then(res => { + if (res.success) { + that.model = Object.assign({}, res.result) + that.model.dataId = record.dataId + that.model.taskId = record.id + that.model.userId = record.assignee + that.model.instanceId = record.procInstId + this.getDayInspectionOrderListByApi(record.dataId) + this.getWeekInspectionOrderListByApi(this.model.standardId) + } + else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + + /** + * 鑾峰彇娴佺▼鍥� + * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍 + */ + getFlowChartImageByApi(record) { + const { processDefinitionId, processInstanceId, processDefinitionKey } = record + const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey } + const that = this + + downFile(this.url.diagramView, imageParam, 'get') + .then((res => { + that.imageSrc = window.URL.createObjectURL(new Blob([res])) + })) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message + }) + }) }, /** @@ -349,7 +368,7 @@ getAction(this.url.detailList, { orderId }) .then(res => { if (res.success) { - this.detail.dayInspectionList = [...res.result] + this.detail.dayInspectionList = res.result } }) .finally(() => { @@ -363,8 +382,7 @@ * @param standardId 瑙勮寖id */ getWeekInspectionOrderListByApi(standardId) { - console.log('standardId-------------------------', standardId) - getAction(this.url.weekInspectionOrderList, { standardId, inspectionDate: this.tableRowRecord.inspectionDate }) + getAction(this.url.weekInspectionOrderList, { standardId, inspectionDate: this.model.inspectionDate }) .then(res => { if (res.success) { this.detail.weekInspectionList = res.result.list @@ -376,6 +394,10 @@ }) }, + /** + * tab鏍忓垏鎹㈡椂瑙﹀彂 + * @param tabKey 鍒囨崲鍚庣殑tabKey + */ handleTabChange(tabKey) { if (this.activeTabKey == '1') this.$refs.editableDetailTable1.clearValidate() this.activeTabKey = tabKey @@ -400,17 +422,10 @@ 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 - flowTaskVo.confirmDealType = this.tableRowRecord.confirmDealType - flowTaskVo.confirmComment = this.tableRowRecord.confirmComment - flowTaskVo.tableDetailList = this.$refs.editableDetailTable1.getTableData() - if (!this.detail.weekInspectionFinishedFlag) flowTaskVo.tableWeekDetailList = this.$refs.editableDetailTable2.getTableData() + this.model.tableDetailList = this.$refs.editableDetailTable1.getTableData() + if (!this.detail.weekInspectionFinishedFlag) this.model.tableWeekDetailList = this.$refs.editableDetailTable2.getTableData() const that = this - postAction(this.url.approve, flowTaskVo) + postAction(this.url.approve, this.model) .then((res) => { if (res.success) { that.$notification.success({ @@ -437,9 +452,9 @@ }, autoCompleteForm({ standardName, maintenancePeriod, standardCode }) { - this.$set(this.tableRowRecord, 'standardName', standardName) - this.$set(this.tableRowRecord, 'maintenancePeriod', maintenancePeriod) - this.$set(this.tableRowRecord, 'standardCode', standardCode) + this.$set(this.model, 'standardName', standardName) + this.$set(this.model, 'maintenancePeriod', maintenancePeriod) + this.$set(this.model, 'standardCode', standardCode) }, // 鎵归噺閫夋嫨鎵�鏈夌偣妫�缁撴灉 @@ -512,8 +527,29 @@ } } </script> -<style 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> \ No newline at end of file -- Gitblit v1.9.3