소스 검색

feat: 新增物流信息查看

zh 2 년 전
부모
커밋
39ea3c08aa
3개의 변경된 파일114개의 추가작업 그리고 9개의 파일을 삭제
  1. 9 0
      src/api/supply/pickup.js
  2. 54 5
      src/views/supply/pickup/components/pickup_form.vue
  3. 51 4
      src/views/supply/pickup/sum_list.vue

+ 9 - 0
src/api/supply/pickup.js

@@ -186,3 +186,12 @@ export function cancelData(params) {
     params
   })
 }
+
+// 订单查询物流
+export function getListOrderTrack(params) {
+  return request({
+    url: '/pick/listOrderTrack',
+    method: 'get',
+    params
+  })
+}

+ 54 - 5
src/views/supply/pickup/components/pickup_form.vue

@@ -332,6 +332,11 @@
             min-width="100"
             show-overflow-tooltip
           ></el-table-column>
+          <el-table-column fixed="right" label="操作" width="100" v-if="flag">
+            <template slot-scope="scope">
+              <el-button @click="handLogistics(scope.row)" type="text" size="small">物流信息</el-button>
+            </template>
+          </el-table-column>
         </el-table>
       </div>
     </div>
@@ -346,6 +351,28 @@
         </el-popconfirm>
       </div>
     </div>
+    <el-dialog title="物流信息" :visible.sync="visible" width="60%" @close="onClose" :close-on-click-modal="false">
+      <el-timeline class="logistics" :reverse="false" v-if="logisticsDetail.length">
+        <el-timeline-item
+          placement="top"
+          type="success"
+          v-for="(item, index) in logisticsDetail"
+          :key="index"
+          :timestamp="item.time"
+        >
+          <el-row :gutter="20">
+            <el-col class="logistics-title"> {{ item.status }} </el-col>
+            <el-col>
+              <div class="flex">
+                <div>{{ item.context }}</div>
+                <!-- <div>{{ item.createTime }}</div> -->
+              </div>
+            </el-col>
+          </el-row>
+        </el-timeline-item>
+      </el-timeline>
+      <div v-else class="tip">暂无物流信息</div>
+    </el-dialog>
   </div>
 </template>
 
@@ -359,7 +386,8 @@ import {
   addPickupBook,
   editPickupBook,
   getDetail,
-  checkStock
+  checkStock,
+  getListOrderTrack
 } from '@/api/supply/pickup'
 import { getDictList } from '@/api/common'
 
@@ -374,7 +402,7 @@ export default {
       mainForm: {
         // 筛选表单数据
         warehouse: '',
-        date:'',
+        date: '',
         timeSlot: '',
         pickupWay: '',
         pickupMan: '',
@@ -421,9 +449,12 @@ export default {
       ],
       setDisabled: {
         disabledDate: time => {
-          return time.getTime()< new Date() - 24 * 3600 * 1000
+          return time.getTime() < new Date() - 24 * 3600 * 1000
         }
-      }
+      },
+      visible: false,
+      orderId: '',
+      logisticsDetail: []
     }
   },
 
@@ -876,9 +907,27 @@ export default {
         this.mainForm.pickupWay = '1'
       }
       this.deliverList = []
+    },
+    handLogistics(row) {
+      getListOrderTrack({ orderId: row.invoiceId }).then(res => {
+        this.logisticsDetail = res.data
+      })
+      this.orderId = row.id
+      this.visible = true
+    },
+    onClose() {
+      this.logisticsDetail = []
+      this.orderId = ''
+      this.visible = false
     }
   }
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.tip {
+  height: 200px;
+  text-align: center;
+  line-height: 200px;
+}
+</style>

+ 51 - 4
src/views/supply/pickup/sum_list.vue

@@ -258,6 +258,11 @@
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注" prop="remark" min-width="100" show-overflow-tooltip />
+          <el-table-column fixed="right" label="操作" width="100" >
+            <template slot-scope="scope">
+              <el-button @click="handLogistics(scope.row)" type="text" size="small">物流信息</el-button>
+            </template>
+          </el-table-column>
         </el-table>
       </div>
     </div>
@@ -274,14 +279,35 @@
         />
       </div>
     </div>
+    <el-dialog title="物流信息" :visible.sync="visible" width="60%" @close="onClose" :close-on-click-modal="false">
+      <el-timeline class="logistics" :reverse="false" v-if="logisticsDetail.length">
+        <el-timeline-item
+          placement="top"
+          type="success"
+          v-for="(item, index) in logisticsDetail"
+          :key="index"
+          :timestamp="item.time"
+        >
+          <el-row :gutter="20">
+            <el-col class="logistics-title"> {{ item.status }} </el-col>
+            <el-col>
+              <div class="flex">
+                <div>{{ item.context }}</div>
+                <!-- <div>{{ item.createTime }}</div> -->
+              </div>
+            </el-col>
+          </el-row>
+        </el-timeline-item>
+      </el-timeline>   
+      <div v-else class="tip">暂无物流信息</div>   
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { getPickupList, getPickupManList } from '@/api/supply/pickup'
+import { getPickupList, getPickupManList,getListOrderTrack } from '@/api/supply/pickup'
 import { getLogisticsList } from '@/api/basic_data/logistics'
 import { getWarehouseList } from '@/api/supply/engin'
-
 export default {
   data() {
     return {
@@ -307,7 +333,10 @@ export default {
       pickupManList: '',
       isCollapse: true,
       logisticsList: [],
-      warehouseList: []
+      warehouseList: [],
+      visible: false,
+      orderId: '',
+      logisticsDetail: []
     }
   },
 
@@ -414,9 +443,27 @@ export default {
     handleCurrentChange(val) {
       this.currentPage = val
       this.getList()
+    },
+    handLogistics(row) {
+      getListOrderTrack({ orderId: row.invoiceId }).then(res => {
+        this.logisticsDetail = res.data
+      })
+      this.orderId = row.id
+      this.visible = true
+    },
+    onClose() {
+      this.logisticsDetail = []
+      this.orderId = ''
+      this.visible = false
     }
   }
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.tip{
+  height: 200px;
+    text-align: center;
+    line-height: 200px;
+}
+</style>