loustwo 4 лет назад
Родитель
Сommit
df7b9e8d0e

+ 6 - 2
app/Http/Controllers/OracleDOCAsnHeaderController.php

@@ -28,8 +28,12 @@ class OracleDOCAsnHeaderController extends Controller
         if (!$customer_id){
             return ['success'=> false,'message' => '参数错误'];
         }
-        $data = $this->service->getToBeProcessAsnDetailsByCustomId($customer_id);
-        return ['success' => true,'data' => $data];
+        $page = $request->input('page',0);
+        $prePage = $request->input('prePage',20);
+        $data = $this->service->getToBeProcessAsnDetailsByCustomId($customer_id,$page,$prePage);
+        $total= $this->service->getToBeProcessAsnCountByCustomId($customer_id);
+        $page_count = ceil($total / $prePage);
+        return ['success' => true,'data' => $data,'total' => $total,'current_page'=>$page ,'page_count' => $page_count];
     }
 
 }

+ 3 - 0
app/Http/Controllers/TestController.php

@@ -411,6 +411,9 @@ class TestController extends Controller
         app("BatchService")->assignTasks($batches);
     }
 
+    public function testRequest(Request $request){
+        return json_encode($request->header(),JSON_UNESCAPED_UNICODE) ;
+    }
 
 
 }

+ 12 - 2
app/Services/OracleDocAsnHerderService.php

@@ -36,14 +36,24 @@ class OracleDocAsnHerderService
             ->get();
     }
 
-    public function getToBeProcessAsnDetailsByCustomId($customId)
+    public function getToBeProcessAsnDetailsByCustomId($customId,$page = 1, $perGage= 20)
     {
         return OracleDOCASNHeader::query()
             ->with(['asnType', 'asnStatus', 'basCustomer','asnDetails' => function ($query) {
                 $query->with(['lineStatus', 'qualityStatus', 'basSku']);
             }])
             ->whereIn("AsnStatus", ['00', '30'])
-            ->where('CustomerId', $customId)->get();
+            ->where('CustomerId', $customId)->orderByDesc('addtime')->forPage($page,$perGage)->get();
+    }
+
+    public function getToBeProcessAsnCountByCustomId($customId): int
+    {
+        return OracleDOCASNHeader::query()
+            ->with(['asnType', 'asnStatus', 'basCustomer','asnDetails' => function ($query) {
+                $query->with(['lineStatus', 'qualityStatus', 'basSku']);
+            }])
+            ->whereIn("AsnStatus", ['00', '30'])
+            ->where('CustomerId', $customId)->count();
     }
 
 }

+ 113 - 66
resources/views/store/receivingTasks/create.blade.php

@@ -300,6 +300,18 @@
                             label="接收时间">
                         </el-table-column>
                     </el-table>
+
+                    <div class="block">
+                        <el-pagination
+                            @size-change="handleSizeChange"
+                            @current-change="handleCurrentChange"
+                            :current-page="current_page"
+                            :page-sizes="['50',100, 200, 300, 400]"
+                            :page-size="50"
+                            layout="total, sizes, prev, pager, next, jumper"
+                            :total="total">
+                        </el-pagination>
+                    </div>
                 </div>
                 <div class="card-body mt-0 pt-0 pm-0">
                     <el-table
@@ -351,9 +363,10 @@
                 </div>
                 <div class="form-group">
                     @can('入库管理-开单入库-打印任务单')
-                    <el-button type="primary" class="col-12" @click="printLodop" v-show="receiving_task_print.number">
-                        <span v-text="receiving_task_print.number + '打  印'" ></span>
-                    </el-button>
+                        <el-button type="primary" class="col-12" @click="printLodop"
+                                   v-show="receiving_task_print.number">
+                            <span v-text="receiving_task_print.number + '打  印'"></span>
+                        </el-button>
                     @endcan
                 </div>
                 @include("store.receivingTasks._receiving_task_print")
@@ -381,7 +394,7 @@
                     appointment_number: null,
                     driver_name: null,
                     driver_phone: null,
-                    for_single_member: '{{ Auth::user()->name }}' ,
+                    for_single_member: '{{ Auth::user()->name }}',
                     plate_number: null,
                     driving_license_no: null,
                     logistics_single_number: null,
@@ -405,6 +418,10 @@
                     @endforeach
                 ],
                 driving_license_image: null,
+                page_size: 20,
+                pager_count: 0,
+                current_page: 0,
+                total: 0,
                 asn_headers: [],
                 asn_details: [],
                 asn_detail: [],
@@ -440,7 +457,7 @@
                     owner: null,                // 货主
                     appointment_number: null, // 预约号
                 },
-                clodop:null,
+                clodop: null,
                 clodopPrintDialogVisible: false,
                 printerList: [],
                 print_setting: {
@@ -506,20 +523,50 @@
                         this.submit_loading = false;
                     })
                 },
-                getASNDetails() {
+                nextPage() {
+                    this.getASNDetails(false,this.current_page + 1,this.pager_count);
+                },
+                prevPage(){
+                    this.getASNDetails(false,this.current_page - 1,this.pager_count);
+                },
+                handleSizeChange(val){
+                    this.getASNDetails(false,0,val);
+                },
+                handleCurrentChange(val){
+                    this.getASNDetails(false,val,this.pager_count);
+                },
+                changeCurrent(val){
+                    this.getASNDetails(false,val,this.pager_count);
+                },
+                getASNDetails(isChange,page, prePage) {
                     let {owner_id} = this.receiving_task;
                     let owner = this.owners.filter(e => e.id === owner_id).find(e => e);
                     if (!owner) return;
                     let url = '{{route('oracle.asn.getToBeProcessApi')}}';
-                    let data = {customer_id: owner.value};
+                    page = page ? page : this.current_page;
+                    prePage = prePage ? prePage : this.prevPage;
+                    if (isChange){
+                        this.current_page = 0;
+                        this.pager_count = 20;
+                        this.sum = 0;
+                    }
+                    let data = {
+                        customer_id: owner.value,
+                        page: page,
+                        prePage: prePage
+                    };
                     window.axios.post(url, data).then(res => {
                         if (res.data.success) {
+                            this.total = res.data.total;
+                            this.pager_count = res.data.pager_count;
+                            this.current_page = res.data.current_page;
                             this.asn_headers = this.formatAsnHeaderDetails(res.data.data);
+                            this.selected_asn_nos = [];
                         }
                     }).catch(err => {
                         this.errorTempTip(err);
                     });
-                 },
+                },
                 formatAsnHeaderDetails(asnHeaderDetails) {
                     return asnHeaderDetails.map(e => this.formatAsnHeaderDetail(e));
                 },
@@ -685,7 +732,7 @@
                         });
                     }
                 },
-                clodopPrint(){
+                clodopPrint() {
                     let {
                         number,               // 收货任务号
                         warehouse,             // 仓库
@@ -699,63 +746,63 @@
                         owner,                // 货主
                         appointment_number, // 预约号
                     } = this.receiving_task_print;
-                    this.clodop.PRINT_INITA(2,0,0,0,"");
-                    this.clodop.SET_PRINT_PAGESIZE(2,'76mm','130mm');
-                    this.clodop.ADD_PRINT_BARCODE(20,70,350,50,"Code39",number);
-                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
-                    this.clodop.ADD_PRINT_TEXT(100,15,100,20,"收货任务号");
-                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(130,15,100,20,"仓库");
-                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(160,15,100,20,"司机姓名");
-                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(190,15,100,20,"车牌号");
-                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(220,15,100,20,"是否提供清单");
-                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(250,15,100,20,"货主");
-                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(130,245,100,20,"投单员");
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(160,245,100,20,"司机电话");
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(190,245,100,20,"驾驶证号");
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(220,245,100,20,"收货类型");
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(250,245,100,20,"预约号");
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(100,115,250,20,number); // number
-                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
-                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
-                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(130,115,130,20,warehouse);  // warehouse
-                    this.clodop.ADD_PRINT_TEXT(160,115,100,20,driver_name); //driver_name
-                    this.clodop.ADD_PRINT_TEXT(190,115,130,20,plate_number);  //plate_number
-                    this.clodop.ADD_PRINT_TEXT(220,115,100,20,provide_list); //provide_list
-                    this.clodop.ADD_PRINT_TEXT(250,115,130,20,owner);  // owner
-                    this.clodop.ADD_PRINT_TEXT(130,345,100,20,for_single_member);  // for_single_member
-                    this.clodop.ADD_PRINT_TEXT(160,345,140,20,driver_phone); // driver_phone
-                    this.clodop.ADD_PRINT_TEXT(190,345,140,20,driving_license_no); // driving_license_no
-                    this.clodop.ADD_PRINT_TEXT(220,345,100,20,receiving_type);  // receiving_type
-                    this.clodop.ADD_PRINT_TEXT(250,345,140,20,appointment_number); //appointment_number
+                    this.clodop.PRINT_INITA(2, 0, 0, 0, "");
+                    this.clodop.SET_PRINT_PAGESIZE(2, '76mm', '130mm');
+                    this.clodop.ADD_PRINT_BARCODE(20, 70, 350, 50, "Code39", number);
+                    this.clodop.SET_PRINT_STYLEA(0, "FontSize", 10);
+                    this.clodop.ADD_PRINT_TEXT(100, 15, 100, 20, "收货任务号");
+                    this.clodop.SET_PRINT_STYLEA(0, "FontSize", 10);
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(130, 15, 100, 20, "仓库");
+                    this.clodop.SET_PRINT_STYLEA(0, "FontSize", 10);
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(160, 15, 100, 20, "司机姓名");
+                    this.clodop.SET_PRINT_STYLEA(0, "FontSize", 10);
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(190, 15, 100, 20, "车牌号");
+                    this.clodop.SET_PRINT_STYLEA(0, "FontSize", 10);
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(220, 15, 100, 20, "是否提供清单");
+                    this.clodop.SET_PRINT_STYLEA(0, "FontSize", 10);
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(250, 15, 100, 20, "货主");
+                    this.clodop.SET_PRINT_STYLEA(0, "FontSize", 10);
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(130, 245, 100, 20, "投单员");
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(160, 245, 100, 20, "司机电话");
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(190, 245, 100, 20, "驾驶证号");
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(220, 245, 100, 20, "收货类型");
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(250, 245, 100, 20, "预约号");
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(100, 115, 250, 20, number); // number
+                    this.clodop.SET_PRINT_STYLEA(0, "FontSize", 10);
+                    this.clodop.SET_PRINT_STYLEA(0, "Alignment", 2);
+                    this.clodop.SET_PRINT_STYLEA(0, "Bold", 1);
+                    this.clodop.ADD_PRINT_TEXT(130, 115, 130, 20, warehouse);  // warehouse
+                    this.clodop.ADD_PRINT_TEXT(160, 115, 100, 20, driver_name); //driver_name
+                    this.clodop.ADD_PRINT_TEXT(190, 115, 130, 20, plate_number);  //plate_number
+                    this.clodop.ADD_PRINT_TEXT(220, 115, 100, 20, provide_list); //provide_list
+                    this.clodop.ADD_PRINT_TEXT(250, 115, 130, 20, owner);  // owner
+                    this.clodop.ADD_PRINT_TEXT(130, 345, 100, 20, for_single_member);  // for_single_member
+                    this.clodop.ADD_PRINT_TEXT(160, 345, 140, 20, driver_phone); // driver_phone
+                    this.clodop.ADD_PRINT_TEXT(190, 345, 140, 20, driving_license_no); // driving_license_no
+                    this.clodop.ADD_PRINT_TEXT(220, 345, 100, 20, receiving_type);  // receiving_type
+                    this.clodop.ADD_PRINT_TEXT(250, 345, 140, 20, appointment_number); //appointment_number
                     this.clodop.PREVIEW();
                 }
             }