From 1828cfc3c596ee2142a9e76582fa02ee9631a23d Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期三, 15 一月 2025 17:55:52 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModal.vue | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 112 insertions(+), 0 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModal.vue b/src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModal.vue new file mode 100644 index 0000000..c430569 --- /dev/null +++ b/src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModal.vue @@ -0,0 +1,112 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + :maskClosable="false" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <ProcessStepModalForm ref="realForm" @ok="submitCallback"/> + </j-modal> +</template> + +<script> + import ProcessStepModalForm from './ProcessStepModalForm.vue' + + export default { + name: 'ProcessStepModal', + components: { + ProcessStepModalForm + }, + props: { + currentTreeNodeInfo: { + type: Object + } + }, + data() { + return { + title: '', + width: 700, + visible: false, + isAddNextLevel: false // 鏄惁涓烘坊鍔犱笅绾э紝浣滀负鏍戣妭鐐规槸鍚﹀睍寮�鐨勫垽鏂� + } + }, + created() { + this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) + }, + methods: { + /** + * 鐐瑰嚮宸ュ簭鍒涘缓宸ュ簭涓嬬骇宸ユ + */ + handleProcessAddChild() { + this.isAddNextLevel = true + this.visible = true + this.$nextTick(() => { + if (this.$refs.realForm) { + this.$refs.realForm.add({ + productId: this.currentTreeNodeInfo.entity.productId, + componentId: this.currentTreeNodeInfo.entity.componentId, + partsId: this.currentTreeNodeInfo.entity.partsId, + processId: this.currentTreeNodeInfo.entity.processId + }) + } + }) + }, + + + /** + * 鐐瑰嚮宸ユ娣诲姞鍚岀骇宸ユ + */ + handleProcessStepAdd() { + this.isAddNextLevel = false + this.visible = true + this.$nextTick(() => { + if (this.$refs.realForm) { + this.$refs.realForm.add({ + productId: this.currentTreeNodeInfo.entity.productId, + componentId: this.currentTreeNodeInfo.entity.componentId, + partsId: this.currentTreeNodeInfo.entity.partsId, + processId: this.currentTreeNodeInfo.entity.processId + }) + } + }) + }, + + /** + * 缂栬緫宸ュ簭淇℃伅 + */ + handleProcessStepEdit() { + this.isAddNextLevel = false + this.visible = true + this.$nextTick(() => { + if (this.$refs.realForm) { + this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity }) + } + }) + }, + + handleOk() { + this.$refs.realForm.submitForm() + }, + + submitCallback() { + this.$emit('submitSuccess', this.isAddNextLevel) + this.visible = false + }, + + handleCancel() { + this.$emit('close') + this.visible = false + }, + + triggerCorrespondingMethod({ methodName, modalTitle }) { + if (this[methodName]) { + this[methodName]() + this.title = modalTitle + } + } + } + } +</script> \ No newline at end of file -- Gitblit v1.9.3