Forráskód Böngészése

生产备料调整

lxf 1 éve
szülő
commit
702ecdf57b
1 módosított fájl, 99 hozzáadás és 14 törlés
  1. 99 14
      src/views/production/operation/batching/index.vue

+ 99 - 14
src/views/production/operation/batching/index.vue

@@ -2,7 +2,7 @@
   <div>
     <el-card class="box-card">
       <el-tabs v-model="activeName" type="card" @tab-change="changeActiveName">
-        <el-tab-pane label="待备料" name="first">
+        <el-tab-pane :label="'待备料(半成品)' + numData.data.semiFinishedCount" name="first">
           <byTable
             :hideTable="true"
             :hidePagination="true"
@@ -14,7 +14,7 @@
             :action-list="[
               {
                 text: '打印备料单',
-                action: () => outExcel(),
+                action: () => outExcel(0),
               },
               {
                 text: '快捷出库',
@@ -24,7 +24,6 @@
             @get-list="getList"
             @clickReset="clickReset">
           </byTable>
-
           <table class="table-class" border="0" cellpadding="0" cellspacing="0" v-loading="loading">
             <tr>
               <th style="width: 200px">BOM品号</th>
@@ -44,6 +43,47 @@
             </tbody>
           </table>
         </el-tab-pane>
+        <el-tab-pane :label="'待备料(成品)' + numData.data.finishedCount" name="third">
+          <byTable
+            :hideTable="true"
+            :hidePagination="true"
+            :source="sourceListThree.data"
+            :pagination="sourceListThree.pagination"
+            :config="config"
+            :searchConfig="searchConfig"
+            highlight-current-row
+            :action-list="[
+              {
+                text: '打印备料单',
+                action: () => outExcel(1),
+              },
+              {
+                text: '快捷出库',
+                action: () => clickQuickDelivery(),
+              },
+            ]"
+            @get-list="getListThree"
+            @clickReset="clickResetThree">
+          </byTable>
+          <table class="table-class" border="0" cellpadding="0" cellspacing="0" v-loading="loading">
+            <tr>
+              <th style="width: 200px">BOM品号</th>
+              <th style="min-width: 320px">BOM品名</th>
+              <th style="width: 200px">SKU品号</th>
+              <th style="width: 120px; text-align: center">数量小计</th>
+              <th style="width: 140px; text-align: center">数量总计</th>
+            </tr>
+            <tbody v-for="(item, index) in sourceListThree.data" :key="index">
+              <tr v-for="(itemSKU, indexSKU) in item.skuInfoList" :key="indexSKU">
+                <td v-if="indexSKU === 0" :rowspan="item.skuInfoList.length">{{ item.bomSpecCode }}</td>
+                <td v-if="indexSKU === 0" :rowspan="item.skuInfoList.length">{{ item.bomSpecName }}</td>
+                <td>{{ itemSKU.skuSpecCode }}</td>
+                <td style="text-align: center">{{ itemSKU.quantity }}</td>
+                <td v-if="indexSKU === 0" :rowspan="item.skuInfoList.length" style="text-align: center">{{ item.totalQuantity }}</td>
+              </tr>
+            </tbody>
+          </table>
+        </el-tab-pane>
         <el-tab-pane label="已备料" name="second">
           <byTable
             :source="sourceListTwo.data"
@@ -117,7 +157,7 @@
     </el-dialog>
 
     <el-dialog title="快捷出库" v-if="openQuick" v-model="openQuick" width="90%">
-      <Quick :pagination="sourceList.pagination" @clickCancel="clickCancel"></Quick>
+      <Quick :pagination="activeName === 'first' ? sourceList.pagination : sourceListThree.pagination" @clickCancel="clickCancel"></Quick>
     </el-dialog>
   </div>
 </template>
@@ -145,6 +185,17 @@ const sourceList = ref({
     orderStockType: "0",
   },
 });
+const sourceListThree = ref({
+  data: [],
+  pagination: {
+    bomSpecCode: "",
+    bomSpecName: "",
+    skuSpecCode: "",
+    skuSpecName: "",
+    departmentId: "1689164627162529793",
+    orderStockType: "1",
+  },
+});
 const sourceListTwo = ref({
   data: [],
   pagination: {
@@ -192,13 +243,6 @@ const searchConfig = computed(() => {
       label: "事业部",
       clearable: true,
     },
-    {
-      type: "select",
-      prop: "orderStockType",
-      data: orderStockType.value,
-      label: "订单备料类型",
-      clearable: true,
-    },
   ];
 });
 const searchConfigTwo = computed(() => {
@@ -381,6 +425,26 @@ getList();
 const clickReset = () => {
   getList("", true);
 };
+const getListThree = async (req, status) => {
+  if (status) {
+    sourceListThree.value.pagination = {
+      departmentId: "1689164627162529793",
+      orderStockType: "0",
+    };
+  } else {
+    sourceListThree.value.pagination = { ...sourceListThree.value.pagination, ...req };
+  }
+  loading.value = true;
+  proxy.post("/stockPreparation/uncompletedList", sourceListThree.value.pagination).then((res) => {
+    sourceListThree.value.data = res;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const clickResetThree = () => {
+  getListThree("", true);
+};
 const getListTwo = async (req, status) => {
   if (status) {
     sourceListTwo.value.pagination = {
@@ -406,10 +470,25 @@ const clickResetTwo = () => {
 const changeActiveName = (val) => {
   if (val === "first") {
     getList();
-  } else {
+  } else if (val === "second") {
     getListTwo();
+  } else if (val === "third") {
+    getListThree();
+  } else {
+    getList();
   }
 };
+const numData = reactive({
+  data: {
+    finishedCount: 0,
+    semiFinishedCount: 0,
+  },
+});
+const getNum = () => {
+  proxy.post("/stockPreparation/uncompletedListStatistics", { orderStockType: 0 }).then((res) => {
+    numData.data = res;
+  });
+};
 const getDemandData = () => {
   proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     if (res.rows && res.rows.length > 0) {
@@ -423,6 +502,7 @@ const getDemandData = () => {
       );
     }
   });
+  getNum();
 };
 getDemandData();
 const openFile = (path) => {
@@ -432,12 +512,16 @@ const openPrint = ref(false);
 const printTime = ref("");
 const formData = ref([]);
 const loadingPrint = ref(false);
-const outExcel = () => {
+const outExcel = (orderStockType) => {
   formData.value = [];
   printTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
   loadingPrint.value = true;
   openPrint.value = true;
-  proxy.post("/stockPreparation/printUncompletedList", sourceList.value.pagination).then((res) => {
+  let bodyParameter = proxy.deepClone(sourceList.value.pagination);
+  if (orderStockType === 1) {
+    bodyParameter = proxy.deepClone(sourceListThree.value.pagination);
+  }
+  proxy.post("/stockPreparation/printUncompletedList", bodyParameter).then((res) => {
     if (res && res.length > 0) {
       for (let i = 0; i < res.length; i++) {
         if (res[i].colourGroupingInfoList && res[i].colourGroupingInfoList.length > 0) {
@@ -525,6 +609,7 @@ const clickCancel = (status) => {
   openQuick.value = false;
   if (status) {
     getList();
+    getNum();
   }
 };
 </script>