Pārlūkot izejas kodu

订单库存数量

lxf 1 gadu atpakaļ
vecāks
revīzija
818e8a4318
1 mainītis faili ar 10 papildinājumiem un 1 dzēšanām
  1. 10 1
      src/views/subsidiary/order/management/add.vue

+ 10 - 1
src/views/subsidiary/order/management/add.vue

@@ -80,6 +80,10 @@
                       <template #default="{ row }">
                         <div style="width: 100%">
                           <div style="line-height: 35px">
+                            <span style="color: black; font-weight: 700">库存数量: </span>
+                            <span>{{ item.inventoryQuantity }}</span>
+                          </div>
+                          <div style="line-height: 35px">
                             <span style="color: black; font-weight: 700">商品名称: </span>
                             <span>{{ item.wlnSkuName }}</span>
                           </div>
@@ -797,7 +801,7 @@ const selectProduct = (row, SKU) => {
     if (list && list.length > 0) {
       return ElMessage("该产品已添加");
     }
-    proxy.post("/sku/detail", { id: SKU.id }).then((res) => {
+    proxy.post("/sku/detail", { id: SKU.id }).then(async (res) => {
       let orderSkuBomList = [];
       if (res.skuSpecList && res.skuSpecList.length > 0) {
         let listTwo = res.skuSpecList.filter((item) => item.id === row.id);
@@ -814,6 +818,10 @@ const selectProduct = (row, SKU) => {
           }
         }
       }
+      let inventoryQuantity = 0;
+      let getSkuInventoryQuantity = await proxy.post("/skuSpec/getSkuInventoryQuantity", { id: row.id }).then((resQuantity) => {
+        inventoryQuantity = resQuantity;
+      });
       formData.data.orderSkuList.push({
         wlnSkuName: SKU.name,
         skuId: row.skuId,
@@ -834,6 +842,7 @@ const selectProduct = (row, SKU) => {
         orderSkuBomList: orderSkuBomList,
         blueprint: row.designImgUrl,
         productionDocument: row.sharedFolder,
+        inventoryQuantity: inventoryQuantity,
       });
       ElMessage({ message: "添加成功", type: "success" });
     });