فهرست منبع

补货列表存储库位按存储数量默认显示前5个库位

haozi 4 سال پیش
والد
کامیت
64289f18b7
2فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 5 3
      app/Services/ReplenishmentService.php
  2. 1 1
      resources/views/inventory/stockOut/index.blade.php

+ 5 - 3
app/Services/ReplenishmentService.php

@@ -109,7 +109,7 @@ sql;
     {
         $db = DB::connection("oracle");
         $sql = <<<sql
-select INV_LOT_LOC_ID.CUSTOMERID,INV_LOT_LOC_ID.SKU,INV_LOT_LOC_ID.LOCATIONID
+select INV_LOT_LOC_ID.CUSTOMERID,INV_LOT_LOC_ID.SKU,INV_LOT_LOC_ID.LOCATIONID,sum(INV_LOT_LOC_ID.QTY) qty
 from INV_LOT_LOC_ID
          left join BAS_LOCATION on BAS_LOCATION.LOCATIONID = INV_LOT_LOC_ID.LOCATIONID
 where BAS_LOCATION.LOCATIONUSAGE = 'RS'
@@ -126,7 +126,7 @@ sql;
             }
             $sql .= ")";
         }
-        $sql.= ' group by INV_LOT_LOC_ID.CUSTOMERID,INV_LOT_LOC_ID.SKU,INV_LOT_LOC_ID.LOCATIONID';
+        $sql.= ' group by INV_LOT_LOC_ID.CUSTOMERID,INV_LOT_LOC_ID.SKU,INV_LOT_LOC_ID.LOCATIONID order by qty desc';
         $info= $db->select(DB::raw($sql),[$customer]);
         //整合同sku下的存储库位
         $tmpArray = array();
@@ -134,7 +134,9 @@ sql;
             $key = $row->sku;
             if (array_key_exists($key, $tmpArray)) {
                 if (is_array($tmpArray[$key]['locationid'])) {
-                    $tmpArray[$key]['locationid'][] = $row->locationid;
+                    if (count($tmpArray[$key]['locationid'])<5){
+                        $tmpArray[$key]['locationid'][] = $row->locationid;
+                    }
                 } else {
                     $tmpArray[$key]['locationid'] = array($tmpArray[$key]['locationid'], $row->locationid);
                 }

+ 1 - 1
resources/views/inventory/stockOut/index.blade.php

@@ -23,7 +23,6 @@
             <table class="table table-striped table-bordered table-hover card-body td-min-width-80" id="table">
                 <tr v-if="item.amount > 0 " v-for="(item,i) in details" @click="selectTr===i+1?selectTr=0:selectTr=i+1"
                     :class="selectTr===i+1?'focusing' : ''">
-                    <td><input type="checkbox"> </td>
                     <td>@{{ item.customerid }}</td>
                     <td>@{{ item.sku }}</td>
                     <td>@{{ item.alternate_sku1 }}</td>
@@ -88,6 +87,7 @@
                     restorationColumn: 'addtime',
                     fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
                 }).init();
+                $('#table tr:eq(0) th:eq(0)').remove();
             },
             methods: {
                 orderItemExport(sign) {