lxf před 1 rokem
rodič
revize
c3373b6faa

+ 6 - 6
src/views/production/operation/batching/index.vue

@@ -441,10 +441,10 @@ const openPrint = ref(false);
 const printTime = ref("");
 const outExcel = () => {
   if (selectData.value && selectData.value.length > 0) {
-    let printBomList = [];
-    let bomColorList = Array.from(new Set(selectData.value.map((item) => item.bomColorId)));
-    for (let i = 0; i < bomColorList.length; i++) {
-      let list = selectData.value.filter((item) => item.bomColorId === bomColorList[i]);
+    let printList = [];
+    let bomSpecList = Array.from(new Set(selectData.value.map((item) => item.bomSpecId)));
+    for (let i = 0; i < bomSpecList.length; i++) {
+      let list = selectData.value.filter((item) => item.bomSpecId === bomSpecList[i]);
       let skuSpecList = Array.from(new Set(list.map((item) => item.skuSpecId)));
       let sum = 0;
       let SKUList = [];
@@ -462,14 +462,14 @@ const outExcel = () => {
         });
         sum = Number(parseFloat(Number(sum) + Number(sumSKU)).toFixed(0));
       }
-      printBomList.push({
+      printList.push({
         bomSpecCode: list[0].bomSpecCode,
         bomSpecName: list[0].bomSpecName,
         quantity: sum,
         SKUList: SKUList,
       });
     }
-    printBomList.value = printBomList;
+    printBomList.value = printList;
     printTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
     openPrint.value = true;
   } else {