From ebdee541df438f35ae291bf136c91afc2c1fffae Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期三, 10 九月 2025 20:45:58 +0800 Subject: [PATCH] 设备归还功能调整 --- src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue | 360 +++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 211 insertions(+), 149 deletions(-) diff --git a/src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue b/src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue index 8f7f0d8..e837873 100644 --- a/src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue +++ b/src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue @@ -18,7 +18,7 @@ <a-row :gutter="24"> <a-col :span="12"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code" label="鍗曟嵁鍙�"> - <a-input v-model="model.code" disabled /> + <a-input v-model="model.code" disabled/> </a-form-model-item> </a-col> <a-col :span="12"> @@ -28,39 +28,107 @@ </a-form-model-item> </a-col> </a-row> - <a-row :guitter="24"> + <a-row :gutter="24"> <a-col :span="12"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanDepartId_dictText" label="鍊熷叆杞﹂棿"> - <a-input v-model="model.leanDepartId_dictText" disabled /> + <a-input v-model="model.leanDepartId_dictText" disabled/> </a-form-model-item> </a-col> <a-col :span="12"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanPerson_dictText" label="鍊熺敤浜�"> - <a-input v-model="model.leanPerson_dictText" disabled /> + <a-input v-model="model.leanPerson_dictText" disabled/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> <a-col :span="12"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanReason" label="鍊熺敤鍘熷洜"> - <a-textarea v-model="model.leanReason" disabled /> + <a-textarea v-model="model.leanReason" disabled/> </a-form-model-item> </a-col> <a-col :span="12"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="澶囨敞"> - <a-textarea v-model="model.remark" disabled /> + <a-textarea v-model="model.remark" disabled/> </a-form-model-item> </a-col> </a-row> - <div v-if="confirmDisable"> - <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 绠$悊鍛樼‘璁� + + <div> + <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="labelCol" :wrapperCol="wrapperCol" prop="confirmComment" + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="瀹℃壒绫诲瀷"> + <j-dict-select-tag type="radio" v-model="model.useApprovalDealType" dictCode="approved_rejected" + placeholder="璇烽�夋嫨澶勭悊绫诲瀷" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鎰忚"> + <a-textarea placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-model="model.useApprovalComment" disabled/> + </a-form-model-item> + </a-col> + </a-row> + </div> + + <div> + <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" label="瀹℃壒绫诲瀷"> + <j-dict-select-tag type="radio" v-model="model.leanOutApprovalDealType" dictCode="approved_rejected" + placeholder="璇烽�夋嫨澶勭悊绫诲瀷" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鎰忚"> - <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.confirmComment" - :disabled="disableSubmit || completionDisable" /> + <a-textarea placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-model="model.leanOutApprovalComment" disabled/> + </a-form-model-item> + </a-col> + </a-row> + </div> + + <div v-if="returnConfirmApprovalDisable"> + <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="leanOutConfirmDealType" + label="瀹℃壒绫诲瀷"> + <j-dict-select-tag type="radio" v-model="model.leanOutConfirmDealType" dictCode="approved_rejected" + placeholder="璇烽�夋嫨澶勭悊绫诲瀷" + :disabled="disableSubmit||model.leanStatus!=='WAIT_CONFIRM_RETURN'"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanOutConfirmComment" + label="纭鎰忚"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.leanOutConfirmComment" + :disabled="disableSubmit||model.leanStatus!=='WAIT_CONFIRM_RETURN'"/> + </a-form-model-item> + </a-col> + </a-row> + </div> + + <div v-if="borrowConfirmApprovalDisable"> + <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="useConfirmDealType" + label="瀹℃壒绫诲瀷"> + <j-dict-select-tag type="radio" v-model="model.useConfirmDealType" dictCode="approved_rejected" + placeholder="璇烽�夋嫨澶勭悊绫诲瀷" + :disabled="disableSubmit||model.leanStatus!=='WAIT_CONFIRM_BORROW'"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useConfirmComment" + label="纭鎰忚"> + <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.useConfirmComment" + :disabled="disableSubmit||model.leanStatus!=='WAIT_CONFIRM_BORROW'"/> </a-form-model-item> </a-col> </a-row> @@ -71,154 +139,148 @@ </template> <script> -import { getAction, httpAction } from '@/api/manage' -import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import { getAction, httpAction } from '@/api/manage' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' -export default { - name: 'EquipmentLeanOutApprovalModal', - components: { - LxSearchEquipmentSelect - }, - props: { - selectShenpiData: { - type: Object - } - }, - data() { - return { - title: '鎿嶄綔', - visible: false, - editable: false, - model: {}, - treeData: [], - labelCol: { - xs: { span: 24 }, - sm: { span: 5 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - }, - labelColLong: { - xs: { span: 24 }, - sm: { span: 2 } - }, - wrapperColLong: { - xs: { span: 24 }, - sm: { span: 21 } - }, - confirmLoading: false, - spinning: false, - imageSrc: null, - validatorRules: { - approvalDealType: [ - { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' } - ], - approvalComment: [ - { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!' } - ], - returnComment: [ - { required: true, message: '璇疯緭鍏ュ綊杩樺娉�!' } - ], - confirmComment: [ - { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' } - ] - }, - url: { - queryById: '/eam/eamEquipmentLeanOut/queryById', - approval: '/eam/eamEquipmentLeanOut/approval', - loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions' - }, - disableSubmit: false - } - }, - created() { - this.loadAllProductionTree() - }, - computed: { - approvalDisable: function() { - return ['WAIT_APPROVAL', 'WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus) + export default { + name: 'EquipmentLeanOutApprovalModal', + components: { + LxSearchEquipmentSelect }, - returnDisable: function() { - return ['WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus) + props: { + selectShenpiData: { + type: Object + } }, - confirmDisable: function() { - return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus) + data() { + return { + title: '鎿嶄綔', + visible: false, + editable: false, + model: {}, + treeData: [], + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 2 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 21 } + }, + confirmLoading: false, + spinning: false, + imageSrc: null, + validatorRules: { + leanOutConfirmDealType: [ + { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' } + ], + leanOutConfirmComment: [ + { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' } + ], + useConfirmDealType: [ + { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' } + ], + useConfirmComment: [ + { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' } + ] + }, + url: { + queryById: '/eam/eamEquipmentLeanOut/queryById', + approval: '/eam/eamEquipmentLeanOut/approval', + loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions' + }, + disableSubmit: false + } }, - completionDisable: function() { - return ['COMPLETE'].includes(this.model.leanStatus) - } - }, - methods: { - async handleDetail(item) { - this.initParams() - this.model = {} - let res = await getAction(this.url.queryById, { id: item.dataId }) - this.model = Object.assign({}, res.result) - 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 - this.spinning = false; + created() { + this.loadAllProductionTree() }, + computed: { + returnConfirmApprovalDisable: function() { + return ['WAIT_CONFIRM_RETURN', 'WAIT_CONFIRM_BORROW', 'COMPLETE'].includes(this.model.leanStatus) + }, + borrowConfirmApprovalDisable: function() { + return ['WAIT_CONFIRM_BORROW', 'COMPLETE'].includes(this.model.leanStatus) + } + }, + methods: { + async handleDetail(item) { + this.initParams() + this.model = {} + let res = await getAction(this.url.queryById, { id: item.dataId }) + this.model = Object.assign({}, res.result) + 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 + this.spinning = false + }, - recordDetail(record) { - console.log('record', record) - this.initParams() - this.model = Object.assign({}, record) - }, + recordDetail(record) { + console.log('record', record) + this.initParams() + this.model = Object.assign({}, record) + }, - initParams() { - this.visible = true - this.spinning = true - }, + initParams() { + this.visible = true + this.spinning = true + }, - async handleOk() { - const that = this - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = that.spinning = true - let httpurl = this.url.approval - let method = 'put' - 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 - }) - } else { - return false - } - }) - }, - handleCancel() { - this.close() - }, + async handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = that.spinning = true + let httpurl = this.url.approval + let method = 'put' + 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 + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, - close() { - this.$emit('close') - this.visible = false - this.$refs.form.clearValidate() - }, - loadAllProductionTree() { - //鍔犺浇杞﹂棿閫夋嫨鏍� - getAction(this.url.loadProductionOptions).then(res => { - if (res.success) { - this.treeData = [...res.result] - } else { - that.$message.warning(res.message) - } - }) + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + loadAllProductionTree() { + //鍔犺浇杞﹂棿閫夋嫨鏍� + getAction(this.url.loadProductionOptions).then(res => { + if (res.success) { + this.treeData = [...res.result] + } else { + that.$message.warning(res.message) + } + }) + } } } -} </script> <style lang="less" scoped> -- Gitblit v1.9.3