Pārlūkot izejas kodu

报价单审批,回填商品中文名称 编码 图片

lxf 1 gadu atpakaļ
vecāks
revīzija
6c72e845b1
1 mainītis faili ar 18 papildinājumiem un 1 dzēšanām
  1. 18 1
      src/components/process/PriceSheet.vue

+ 18 - 1
src/components/process/PriceSheet.vue

@@ -816,6 +816,24 @@ watch(
       for (var text in props.queryData) {
         formData.data[text] = props.queryData[text];
       }
+      if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+        for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+          delete formData.data.quotationProductList[i].id;
+          proxy.post("/productInfo/detail", { id: formData.data.quotationProductList[i].productId }).then((resProduct) => {
+            formData.data.quotationProductList[i].name = resProduct.name;
+            formData.data.quotationProductList[i].code = resProduct.code;
+            formData.data.quotationProductList[i].unit = resProduct.unit;
+          });
+        }
+        let fileIds = formData.data.quotationProductList.map((item) => item.productId);
+        proxy.post("/fileInfo/getList", { businessIdList: fileIds }).then((resFile) => {
+          for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+            if (resFile[formData.data.quotationProductList[i].productId] && resFile[formData.data.quotationProductList[i].productId].length > 0) {
+              formData.data.quotationProductList[i].fileUrl = resFile[formData.data.quotationProductList[i].productId][0].fileUrl;
+            }
+          }
+        });
+      }
       if (formData.data.countryId) {
         getCityData(formData.data.countryId, "20");
       }
@@ -846,7 +864,6 @@ onMounted(() => {
             formData.data.quotationProductList[i].unit = resProduct.unit;
           });
         }
-        console.log(formData.data.quotationProductList);
         let fileIds = formData.data.quotationProductList.map((item) => item.productId);
         proxy.post("/fileInfo/getList", { businessIdList: fileIds }).then((resFile) => {
           for (let i = 0; i < formData.data.quotationProductList.length; i++) {