ソースを参照

维多利亚生命周期现实异常修改

cz 2 年 前
コミット
b8188cebe7

+ 5 - 1
src/components/WDLY/product/SelectProduct.vue

@@ -372,6 +372,10 @@ const config = computed(() => {
       attrs: {
         label: "生命周期",
         prop: "lifeCycle",
+        width: 80,
+      },
+      render(lifeCycle) {
+        return lifeCycle == "1" ? "新品" : lifeCycle == "2" ? "成长" : "成熟";
       },
     },
     {
@@ -599,7 +603,7 @@ const getList = async (req) => {
     .post(
       props.isCombination
         ? "/productInfo/getCombinationPage"
-        : "/productInfo/page",
+        : "/productInfo/pageByWdly",
       sourceList.value.pagination
     )
     .then((message) => {

+ 9 - 1
src/views/product/product/index.vue

@@ -195,6 +195,9 @@ const config = computed(() => {
         label: "单位",
         prop: "unit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -532,8 +535,9 @@ const handleClickFile = (file) => {
   window.open(file.fileUrl, "_blank");
 };
 const productType = ref([]);
+const productUnit = ref([]);
 const getDict = () => {
-  proxy.getDictOne(["product_type"]).then((res) => {
+  proxy.getDictOne(["product_type", "unit"]).then((res) => {
     productType.value = res["product_type"];
     formConfig.value[1].data = productType.value.map((x) => ({
       label: x.dictValue,
@@ -543,6 +547,10 @@ const getDict = () => {
       label: x.dictValue,
       value: x.dictKey,
     }));
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
   });
 };
 getDict();

+ 9 - 2
src/views/product/product/index2.vue

@@ -186,7 +186,6 @@ const config = computed(() => {
     {
       attrs: {
         label: "图片",
-        prop: "unit",
         slot: "pic",
       },
     },
@@ -195,6 +194,9 @@ const config = computed(() => {
         label: "单位",
         prop: "unit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -508,8 +510,9 @@ const handleClickFile = (file) => {
 };
 
 const productType = ref([]);
+const productUnit = ref([]);
 const getDict = () => {
-  proxy.getDictOne(["product_type"]).then((res) => {
+  proxy.getDictOne(["product_type", "unit"]).then((res) => {
     productType.value = res["product_type"];
     formConfig.value[1].data = productType.value.map((x) => ({
       label: x.dictValue,
@@ -519,6 +522,10 @@ const getDict = () => {
       label: x.dictValue,
       value: x.dictKey,
     }));
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
   });
 };
 getDict();