Browse Source

修改成本组件

xiaodai2022 1 year ago
parent
commit
be3003ec85

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

@@ -1159,7 +1159,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,
@@ -2192,18 +2192,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/supplierGoodsCost/components/baseFormNormal.vue

@@ -1157,7 +1157,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,
@@ -2184,18 +2184,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 || "",