Kaynağa Gözat

包裹管理添加备注 问题件日志排序

ANG YU 4 yıl önce
ebeveyn
işleme
a35cab3df0

+ 3 - 1
app/Http/Controllers/PackageLogisticController.php

@@ -29,7 +29,9 @@ class PackageLogisticController extends Controller
         $orderPackages = OrderPackage::query()
             ->filter($filters)
             ->whereIn('owner_id', $owner_ids)->with(['order.logistic', 'order.owner', 'order.issue' => function ($query) {
-                $query->with(['issueType', 'logs.user']);
+                $query->with(['issueType', 'logs'=>function($query) {
+                    $query->with('user')->orderBy('created_at', 'DESC');
+                }]);
             }])->orderByDesc('id')->paginate($request->paginate ?? 50);
         $logistics = Logistic::all();
         $owners = Owner::find($owner_ids);

+ 13 - 11
resources/views/package/logistic/index.blade.php

@@ -69,14 +69,15 @@
                     <td @mouseover="remarkHover = package.id" @mouseleave="remarkHover=null;remark=null;isShowRemarkInput = false">
                         <button @click="isShowRemarkInput = true" v-if="remarkHover===package.id">新增</button>
                         <input @keydown.enter="submitRemark(package)" v-if="isShowRemarkInput && remarkHover===package.id" type="text" v-model="remark">
-                        <div v-if="package.remark && package.remark.length>0"
-                             class="text-overflow-warp-200 up" :id="'remark-'+i">
-                            <p v-for="remark_item in package.remark">
-                                @{{ remark_item }}
-                            </p>
-                        </div>
-                        <div class="text-overflow-warp-200 " v-if=" package.remark && !showRemarkList[i] && package.remark.length > 0">
-                            @{{ package.remark[0] }}
+                        <div v-if="package.remark && package.remark.length>0" :id="'remark-'+i">
+                            <div v-if="showRemarkList[i]" class="text-overflow-warp-200 up" >
+                                <p v-for="remark_item in package.remark">
+                                    @{{ remark_item }}
+                                </p>
+                            </div>
+                            <div class="text-overflow-warp-200" v-else>
+                                @{{ package.remark[0] }}
+                            </div>
                         </div>
                         <div @click="showRemarkItem(i)" v-if="package.remark && package.remark.length > 1">
                             <label class="text-center mt-0 p-0 cursor-pointer pull-left">
@@ -285,10 +286,12 @@
                     restorationColumn: 'addtime',
                     fixedTop:($('#form_div').height())+($('#btn').height())+1,
                 }).init();
+            },
+            computed:{
+
             },
             methods: {
                 showRoute(id) {
-                    // item.isShowTransferStatus = true;
                     if (this.showList[id]) {
                         this.$set(this.showList, id, false);
                         $("#route-" + id).slideUp();
@@ -299,7 +302,6 @@
                     this.$forceUpdate();
                 },
                 showRemarkItem(id) {
-                    // item.isShowTransferStatus = true;
                     if (this.showRemarkList[id]) {
                         this.$set(this.showRemarkList, id, false);
                         $("#remark-" + id).slideUp();
@@ -349,7 +351,7 @@
                         tempTip.setDuration(3000);
                         tempTip.show("网络错误:"+err)
                     });
-                }
+                },
             },
             filters: {
                 toObjected: function (value) {