wenhongquan 3 年之前
父节点
当前提交
de11e6bef4
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      src/views/Warehouse/index.vue

+ 5 - 4
src/views/Warehouse/index.vue

@@ -140,6 +140,7 @@ import {
 import { Toast, Notify,Dialog } from 'vant';
 import { BaseMediaUrl } from '@/utils';
 import { upload } from '@/api/common';
+import { cloneDeep } from 'lodash';
 
 const whdata = reactive({
   value: { name: '', manageUnit: '', contactName: '', contactPhone: '' },
@@ -237,9 +238,9 @@ const dosavedata = () => {
     forbidClick: true,
   });
   var data = whdata.value;
-  data['resourceDetailList'] = wzdata.aar;
+  data['resourceDetailList'] = cloneDeep( wzdata.aar);
   data['resourceDetailList'].map(item=>{
-    if(item.pic.length>0){
+    if((item.pic ?? []) .length>0){
       if(item.pic[0].url == undefined || item.pic[0].url==null){
          item.pic = item.pic[0].file.purl;
       }else{
@@ -333,8 +334,8 @@ const getdata = () => {
                  item.pic = []
               }
               
-            })
-            wzdata.aar = res1.data.resourceDetailList;
+            }) 
+            wzdata.aar = cloneDeep( res1.data.resourceDetailList);
 
             // console.log(whdata)
           }