فهرست منبع

fix: 清空缓存以避免数据残留,优化弹框打开和关闭逻辑

xieyong 1 ماه پیش
والد
کامیت
003b9815e1
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      src/views/purchasingManage/purchaseOrder/components/addDialogNew.vue

+ 6 - 0
src/views/purchasingManage/purchaseOrder/components/addDialogNew.vue

@@ -2222,6 +2222,9 @@
         this.activeName = '1';
         this.activeName = '1';
 
 
         this.row = row;
         this.row = row;
+        // 打开弹框前先清空缓存,避免残留上次数据
+        this.rawDetailListCache = [];
+        this.outputDetailListCache = [];
         this.visible = true;
         this.visible = true;
         if (this.enterprisePage.length == 0) {
         if (this.enterprisePage.length == 0) {
           await this.getEnterprisePage();
           await this.getEnterprisePage();
@@ -2572,6 +2575,9 @@
         this.$emit('done');
         this.$emit('done');
       },
       },
       cancel() {
       cancel() {
+        // 先清空带料清单与产出清单的缓存,避免 nextTick 异步导致关闭事件再次触发时缓存残留
+        this.rawDetailListCache = [];
+        this.outputDetailListCache = [];
         this.$nextTick(() => {
         this.$nextTick(() => {
           this.isFlag = false;
           this.isFlag = false;
           // 关闭后,销毁所有的表单数据
           // 关闭后,销毁所有的表单数据