xiaodai2022 1 рік тому
батько
коміт
ab117c0a51

+ 3 - 13
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -1164,7 +1164,7 @@ import { replaceTextWrapAndSpace } from "@/utils";
 import ProductModal from "./productModal.vue";
 import ProductListModal from "./productListModal.vue";
 import { isStockOptions } from "@/assets/js/statusList";
-
+import { isArray } from "@/utils/validate";
 import {
   options1,
   options2,
@@ -2191,18 +2191,8 @@ export default {
             lead_time: lead_time || "",
             sample_day: sample_day || "",
             good_thumb_img: good_thumb_img || "",
-            good_img: good_img
-              ? Object.prototype.toString.call(good_img) === "[object Array]"
-                ? []
-                : (good_img || "").split(",")
-              : [],
-            good_info_img: good_info_img
-              ? (Object.prototype.toString.call(good_info_img) ===
-                "[object Array]"
-                  ? []
-                  : good_info_img || ""
-                ).split(",")
-              : [],
+            good_img: !isArray(good_img || "") ? good_img.split(",") : [],
+            good_info_img: !isArray(good_info_img || "") ? good_info_img.split(",") : [],
             //固定阶梯成本
             demo_fee: demo_fee || "",
             open_fee: open_fee || "",

+ 3 - 13
src/views/goodStore/goodsCost/components/baseFormNormal.vue

@@ -1142,7 +1142,7 @@ import { replaceTextWrapAndSpace } from "@/utils";
 import ProductModal from "./productModal.vue";
 import ProductListModal from "./productListModal.vue";
 import { isStockOptions } from "@/assets/js/statusList";
-
+import { isArray } from "@/utils/validate";
 import {
   options1,
   options2,
@@ -2158,18 +2158,8 @@ export default {
             lead_time: lead_time || "",
             sample_day: sample_day || "",
             good_thumb_img: good_thumb_img || "",
-            good_img: good_img
-              ? Object.prototype.toString.call(good_img) === "[object Array]"
-                ? []
-                : (good_img || "").split(",")
-              : [],
-            good_info_img: good_info_img
-              ? (Object.prototype.toString.call(good_info_img) ===
-                "[object Array]"
-                  ? []
-                  : good_info_img || ""
-                ).split(",")
-              : [],
+            good_img: !isArray(good_img || "") ? good_img.split(",") : [],
+            good_info_img: !isArray(good_info_img || "") ? good_info_img.split(",") : [],
             //固定阶梯成本
             demo_fee: demo_fee || "",
             open_fee: open_fee || "",