From 3e5a1806bce60170c8749cae3cd5c900b550f4f2 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期日, 27 四月 2025 16:10:18 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/flowable/workflow/weekMaintenance/WeekMaintenanceBatchApprovalModal.vue | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 208 insertions(+), 0 deletions(-) diff --git a/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceBatchApprovalModal.vue b/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceBatchApprovalModal.vue new file mode 100644 index 0000000..a51d614 --- /dev/null +++ b/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceBatchApprovalModal.vue @@ -0,0 +1,208 @@ +<template> + <j-modal + :title="title" + :width="1200" + :visible="visible" + :confirmLoading="confirmLoading" + :okButtonProps="{ class:{'jee-hidden': !isDisplaySubmitButton} }" + switchFullscreen + @ok="handleOk" + @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-tabs> + <a-tab-pane key='1' tab='娴佺▼鍥�'> + <img :src="imageSrc" alt="娴佺▼鍥捐幏鍙栦腑..."/> + </a-tab-pane> + </a-tabs> + </a-row> + + <div v-if="model.maintenanceStatus==='WAIT_CONFIRM'"> + <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 prop="confirmDealType" label="纭绫诲瀷"> + <j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approved_rejected' + placeholder="璇烽�夋嫨澶勭悊绫诲瀷"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item prop="confirmComment" label="纭鎰忚"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.confirmComment"/> + </a-form-model-item> + </a-col> + </a-row> + </div> + + <div v-if="model.maintenanceStatus==='WAIT_INITIAL_ACCEPTANCE'"> + <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 prop="initialAcceptanceComment" + label="鍒濋獙鏀舵剰瑙�"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.initialAcceptanceComment"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item prop="initialAcceptanceFilesResult" + label="鍒濋獙鏀堕檮浠�"> + <lx-upload :returnUrl="false" :isMultiple="true" v-model="model.initialAcceptanceFilesResult"/> + </a-form-model-item> + </a-col> + </a-row> + </div> + + <div v-if="model.maintenanceStatus==='WAIT_FINAL_ACCEPTANCE'"> + <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 prop="finalAcceptanceComment" + label="缁堥獙鏀舵剰瑙�"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.finalAcceptanceComment"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item prop="finalAcceptanceFilesResult" + label="缁堥獙鏀堕檮浠�"> + <lx-upload :returnUrl="false" :isMultiple="true" v-model="model.finalAcceptanceFilesResult"/> + </a-form-model-item> + </a-col> + </a-row> + </div> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { downFile, getAction, httpAction } from '@/api/manage' + + export default { + name: 'WeekMaintenanceBatchApprovalModal', + props: { + taskList: { + type: Array + } + }, + data() { + return { + title: '', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + confirmLoading: false, + spinning: false, + imageSrc: null, + validatorRules: { + confirmDealType: [ + { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' } + ], + confirmComment: [ + { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' } + ], + initialAcceptanceComment: [ + { required: true, message: '璇疯緭鍏ュ垵楠屾敹鎰忚!' } + ], + finalAcceptanceComment: [ + { required: true, message: '璇疯緭鍏ョ粓楠屾敹鎰忚!' } + ] + }, + url: { + queryById: '/eam/weekMaintenanceOrder/queryById', + batchApprove: '/eam/weekMaintenanceOrder/batchApproval', + diagramView: '/assign/flow/diagramView' + } + } + }, + computed: { + isDisplaySubmitButton: function() { + return ['WAIT_CONFIRM', 'WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE'].includes(this.model.maintenanceStatus) + } + }, + methods: { + async handleDetail(item) { + this.visible = true + this.spinning = true + this.imageSrc = null + if (item.procInstId) { + const { processDefinitionId, processInstanceId, processDefinitionKey } = item + + 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({ + message: '娑堟伅', + description: res.message + }) + }) + } + let res = await getAction(this.url.queryById, { id: item.dataId }) + this.model = Object.assign({}, res.result) + this.spinning = false + }, + + async handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = that.spinning = true + const { confirmComment, confirmDealType, initialAcceptanceComment, initialAcceptanceFilesResult, finalAcceptanceComment, finalAcceptanceFilesResult } = that.model + const params = {} + params.taskList = that.taskList + params.confirmComment = confirmComment + params.confirmDealType = confirmDealType + params.initialAcceptanceComment = initialAcceptanceComment + params.initialAcceptanceFilesResult = initialAcceptanceFilesResult + params.finalAcceptanceComment = finalAcceptanceComment + params.finalAcceptanceFilesResult = finalAcceptanceFilesResult + console.log('params', params) + httpAction(this.url.batchApprove, params, 'post').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 + }) + } else { + return false + } + }) + }, + + handleCancel() { + this.close() + }, + + close() { + this.$emit('close') + this.visible = false + if (this.$refs.form) this.$refs.form.clearValidate() + } + } + } +</script> \ No newline at end of file -- Gitblit v1.9.3