From 450bcae3cfffe9923dc09dea2a4e89312bb373d7 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期五, 31 七月 2026 15:01:03 +0800
Subject: [PATCH] 库存流水修改

---
 yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/detail/index.vue.vm |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/detail/index.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/detail/index.vue.vm
index b3302e5..bde41c2 100644
--- a/yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/detail/index.vue.vm
+++ b/yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/detail/index.vue.vm
@@ -62,11 +62,12 @@
   #end
 #end
 import type { ${simpleClassName} } from '@/api/${table.moduleName}/${table.businessName}'
+import { onUnload } from '@dcloudio/uni-app'
 import { onMounted, ref } from 'vue'
-import { useToast } from 'wot-design-uni'
+import { useToast } from '@wot-ui/ui/components/wd-toast'
 import { delete${simpleClassName}, get${simpleClassName} } from '@/api/${table.moduleName}/${table.businessName}'
 import { useAccess } from '@/hooks/useAccess'
-import { navigateBackPlus } from '@/utils'
+import { delay, navigateBackPlus } from '@/utils'
 #if ($hasDict == 1)
 import { DICT_TYPE } from '@/utils/constants'
 #end
@@ -87,8 +88,8 @@
 
 const { hasAccessByCodes } = useAccess()
 const toast = useToast()
-const formData = ref<${simpleClassName}>()
-const deleting = ref(false)
+const formData = ref<${simpleClassName}>() // 璇︽儏鏁版嵁
+const deleting = ref(false) // 鍒犻櫎鐘舵��
 
 /** 杩斿洖涓婁竴椤� */
 function handleBack() {
@@ -97,7 +98,7 @@
 
 /** 鍔犺浇${table.classComment}璇︽儏 */
 async function getDetail() {
-  if (!props.id) {
+  if (!props.id || deleting.value) {
     return
   }
   try {
@@ -131,9 +132,8 @@
       try {
         await delete${simpleClassName}(props.id)
         toast.success('鍒犻櫎鎴愬姛')
-        setTimeout(() => {
-          handleBack()
-        }, 500)
+        uni.$emit('${table.moduleName}:${table.businessName}:reload')
+        delay(handleBack)
       } finally {
         deleting.value = false
       }
@@ -143,8 +143,14 @@
 
 /** 鍒濆鍖� */
 onMounted(() => {
+  uni.$on('${table.moduleName}:${table.businessName}:reload', getDetail)
   getDetail()
 })
+
+/** 鍗歌浇 */
+onUnload(() => {
+  uni.$off('${table.moduleName}:${table.businessName}:reload', getDetail)
+})
 </script>
 
 <style lang="scss" scoped>

--
Gitblit v1.9.3