Explorar el Código

管理后台-商品管理:添加商品

panyong hace 3 años
padre
commit
5fc76de4ed
Se han modificado 1 ficheros con 19 adiciones y 21 borrados
  1. 19 21
      htmldev/manage/src/views/business/pms/goods/details.vue

+ 19 - 21
htmldev/manage/src/views/business/pms/goods/details.vue

@@ -373,28 +373,26 @@ export default {
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
-          if ((Array.isArray(value) && value.length > 0) || value) {
-            if (key === 'product_img_url') {
-              value = [value]
-            }
-            if (key === 'product_place' || key === 'product_status') {
-              value = value.toString()
-            }
-            if (key === 'skus') {
-              value = value.map(item => ({
-                ...item,
-                product_status: item.product_status === 1,
-                product_price: fen2Yuan(item.product_price)
-              }))
-            }
-            if (key === 'attachs') {
-              value = value.map(item => ({
-                ...item,
-                attach_content: item.attach_content.split(',')
-              }))
-            }
-            this.$set(this.form, key, value)
+          if (key === 'product_img_url') {
+            value = [value]
           }
+          if (key === 'product_place' || key === 'product_status') {
+            value = value.toString()
+          }
+          if (key === 'skus') {
+            value = value.map(item => ({
+              ...item,
+              product_status: item.product_status === 1,
+              product_price: fen2Yuan(item.product_price)
+            }))
+          }
+          if (key === 'attachs') {
+            value = value.map(item => ({
+              ...item,
+              attach_content: item.attach_content.split(',')
+            }))
+          }
+          this.$set(this.form, key, value)
         }
       }
     }