Browse Source

轨迹查询,供应商仓库审核

jiana 2 weeks ago
parent
commit
c4d6c7a6ae

BIN
src/assets/images/dian.png


+ 4 - 1
src/layout/Tabs/item.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="tags-view-item" :class="active? 'active' : ''">
-    <router-link :to="menu.path" v-if="menu.meta.title">
+    <router-link :to="menu.path" v-if="menu.meta.title && menu.meta.title !=''">
       {{ menu.meta.title }}
     </router-link>
     <i class="iconfont icon-shuaxin"  @click.stop="reload" v-if="active" style="font-size:14px;"></i>
@@ -97,4 +97,7 @@ export default defineComponent({
       background-color: var(--system-header-item-hover-color);
     }
   }
+  .tags-view-item:first-child{
+    display: none;
+  }
 </style>

+ 13 - 1
src/request/modules/apiTms.js

@@ -8,4 +8,16 @@ import res from '@/utils/system/request.js'
 export const queryWaybillByCondition = (params) => res('post', 'apiTms', '/admin/waybills/queryWaybillByCondition',params,{form:true})
 
 // 查询异常运单列表   type = DEVICE 设备异常,  type = LOADING 装货地异常  , type  = UNLOAD 卸货地异常
-export const queryWaybillExceptionByCondition = (params) => res('post', 'apiTms', '/admin/waybills/queryWaybillExceptionByCondition',params,{form:true})
+export const queryWaybillExceptionByCondition = (params) => res('post', 'apiTms', '/admin/waybills/queryWaybillExceptionByCondition',params,{form:true})
+
+//查询轨迹
+export const truckTrackQueryByWaybillNum = (params) => res('post', 'apiTms', '/transwiseway/truckTrackQueryByWaybillNum',params,{form:true})
+
+//供应商仓库列表
+export const warehouseList = (params) => res('post', 'apiTms', '/warehouse/review',params,{form:true})
+
+//供应商仓库-审核通过
+export const warehouseApprove = (params) => res('post', 'apiTms', '/warehouse/'+params.id+'/approve',params,{form:true})
+
+//供应商仓库-审核拒绝
+export const warehouseReject = (params) => res('post', 'apiTms', '/warehouse/'+params.id+'/reject',params,{form:true})

+ 23 - 0
src/router/modules/pages.js

@@ -33,6 +33,29 @@ const route = [
       //   meta: { title: '发布详情', hideMenuItem: true, cache: false, },
       // },
     ]
+  },
+  {
+    path: '/auditPlaceShip',
+    component: Layout,
+    redirect: 'trackManager/auditPlaceShip',
+    meta: { title: '供应商仓库管理', icon: 'icon-fabu' },
+    children: [
+      {
+        path: 'auditPlaceShip',
+        component: createNameComponent(() => import('@/views/trackManager/auditPlaceShip.vue')),
+        meta: { title: '待审核仓库列表', cache: false, },
+      },
+      {
+        path: 'placeShip',
+        component: createNameComponent(() => import('@/views/trackManager/placeShip.vue')),
+        meta: { title: '已通过仓库列表', cache: false, },
+      },
+      {
+        path: 'unPlaceShip',
+        component: createNameComponent(() => import('@/views/trackManager/unPlaceShip.vue')),
+        meta: { title: '已拒绝仓库列表', cache: false, },
+      },
+    ]
   }
 ]
 

+ 13 - 1
src/utils/system/filters.js

@@ -36,7 +36,19 @@
         return '已取消'
     }
   }
+
+  //车辆颜色
+  function plateColorFilter(val){
+    switch (val) {
+      case "1":
+        return '蓝色'
+      case "2":
+        return '黄色'
+      case "3":
+        return '黄绿色'      
+    }
+  }
 export{
-  wayBillStatus,publishStatus,
+  wayBillStatus,publishStatus,plateColorFilter
 }
 

+ 23 - 7
src/views/trackManager/abnormalWaybill.vue

@@ -37,21 +37,34 @@
         <el-table-column label="司机姓名" prop="waybill.driverName" width="120"  align="center"></el-table-column>
         <el-table-column label="司机手机号" prop="waybill.driverPhone" width="120" align="center"></el-table-column>
         <el-table-column label="车牌" prop="waybill.plateNumber" width="120" align="center"></el-table-column>
+        <el-table-column label="车辆颜色" align="center" width="100">
+          <template #default="scope">
+            <span>{{ plateColorFilter(scope.row.waybill.plateColor)}}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="状态" align="center" width="100">
           <template #default="scope">
             <Tag color="green" v-if="scope.row.status == 'NORMAL'">正常</Tag>
             <Tag color="red" v-if="scope.row.status == 'ABNORMAL'">异常</Tag>
           </template>
         </el-table-column>
-        <el-table-column label="关联单号" prop="waybill.orderNum" width="220" align="center"></el-table-column>
-        <el-table-column label="添加时间" width="160" align="center">
+        <el-table-column label="运输发货时间" width="160" align="center">
+          <template #default="scope">
+            {{ moment(scope.row.startTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+          </template>
+        </el-table-column>
+        <el-table-column label="运输到货时间" width="160" align="center">
           <template #default="scope">
-            {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+            {{ moment(scope.row.endTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
           </template>
         </el-table-column>
+        <el-table-column label="订单号" prop="waybill.orderInfo.orderNum" width="220" align="center"></el-table-column>
+        <el-table-column label="物料名称" prop="waybill.orderInfo.name" width="150" align="center"></el-table-column>
+        <el-table-column label="供应商名称" prop="waybill.orderInfo.company" width="180" align="center"></el-table-column>
+        <el-table-column label="牧场名称" prop="waybill.orderInfo.orgName" width="180" align="center"></el-table-column>
         <el-table-column label="操作" width="180"  fixed="right" align="center">
           <template  #default="scope">
-            <Button class="opt_btn" size="small" type="primary" ghost @click="lookTrack(scope.row.id)">查看轨迹</Button>
+            <Button class="opt_btn" size="small" type="primary" ghost @click="lookTrack(scope.row)">查看轨迹</Button>
             <Button class="opt_btn" size="small" type="warning" @click="lookInfo(scope.row.exceptionInfo)">查看异常</Button>
           </template>
         </el-table-column>
@@ -63,7 +76,7 @@
     </Card>
     <!-- 查看轨迹 -->
     <Modal v-model="showModal" width="75%" title="查看轨迹">
-      <mapTrack></mapTrack>
+      <mapTrack :waybillNum="waybillNum" v-if="showModal"></mapTrack>
     </Modal>
     <!-- 查看异常 -->
     <Modal v-model="showInfo" width="60%" title="查看异常">
@@ -89,6 +102,7 @@ import { Message,Modal,Spin,Input } from 'view-ui-plus'
 import moment from 'moment'
 import {useRoute} from 'vue-router'
 import mapTrack from "./mapTrack.vue"
+import {plateColorFilter} from '@/utils/system/filters'
 export default defineComponent({
   components:{
     mapTrack
@@ -165,8 +179,10 @@ export default defineComponent({
     }
 
     const showModal = ref(false)
+    let waybillNum = ref('')
     // 查看详情
-    function lookTrack(){
+    function lookTrack(data){
+      waybillNum.value = data.waybillNum
       showModal.value = true
     }
     const showInfo = ref(false)
@@ -182,7 +198,7 @@ export default defineComponent({
 
     return {
       handleSelectionChange,getData,changePage,moment,deleteInfo,TabData,filtInfoData,
-      loading,batchOperation,resetData,exceptionInfo,showInfo,lookInfo,lookTrack,showModal
+      loading,batchOperation,resetData,exceptionInfo,showInfo,lookInfo,lookTrack,showModal,plateColorFilter,waybillNum
     }
   },
 })

+ 189 - 0
src/views/trackManager/auditPlaceShip.vue

@@ -0,0 +1,189 @@
+/**
+  // author:jiana
+  // time:2025-04-23
+  // desc:运单管理
+*/
+<template>
+  <div class="auditPlaceShip">
+    <Card>
+      <!-- 筛选 -->
+      <Row :gutter="8">
+        <Col span="10">
+          供应商名称 <Input v-model="filtInfoData.supplierName" placeholder="请输入运单号" style="width:80%"/>
+        </Col>
+        <Col span="2">
+          <Button type="primary" @click="getData">查询</Button>
+        </Col>
+        <Col span="2">
+          <Button @click="resetData">重置</Button>
+        </Col>
+      </Row>
+    </Card>
+    <Card style="margin-top:20px;">
+      <Row>
+        <Col span="12">
+          待审列表
+        </Col>
+      </Row>
+      <!-- 表格部分 -->
+      <el-table v-loading="loading" :data="TabData.data" border style="width: 100%;margin-top:20px;">
+        <el-table-column label="供应商名称" prop="supplierName" width="160" align="center"></el-table-column>
+        <el-table-column label="仓库名称" width="150" prop="name" align="center"/>
+        <el-table-column label="仓库地址" width="150" prop="address" align="center"/>
+        <el-table-column label="经度" width="150" prop="longitude" align="center"></el-table-column>
+        <el-table-column label="维度" prop="latitude" width="150"  align="center"></el-table-column>
+        <el-table-column label="添加时间" width="160" align="center">
+          <template #default="scope">
+            {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="250"  fixed="right" align="center">
+          <template  #default="scope">
+            <Button class="opt_btn" size="small" type="primary" ghost @click="lookInfo(scope.row)">查看地址</Button>
+            <Button class="opt_btn" size="small" type="primary" @click="auditSuccess(scope.row.id)">审核通过</Button>
+            <Button class="opt_btn" size="small" type="warning" @click="auditFail(scope.row.id)">审核拒绝</Button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 分页 -->
+      <div class="page_style">
+        <Page :total="TabData.total" :model-value="currentPage" show-elevator show-total @on-change="changePage" />
+      </div>
+    </Card>
+    <!-- 查看地址 -->
+    <Modal v-model="showInfo" width="60%" title="查看地址">
+     <mapMark v-if="showInfo" :markInfo="markInfo"></mapMark>
+    </Modal>
+  </div>
+</template>
+
+<script>
+import { defineComponent, ref ,reactive, onMounted} from 'vue'
+import { tms } from '@/request/api'
+import { Message,Modal,Spin,Input } from 'view-ui-plus'
+import moment from 'moment'
+import {useRoute} from 'vue-router'
+import mapMark from "./mapMark.vue"
+export default defineComponent({
+  components:{
+    mapMark
+  },
+  setup() {
+    const route = useRoute()
+    let filtInfoData = reactive({ // 搜索
+      limit:10,offset:0,status:0,supplierName:''
+    })
+
+    let TabData = ref([])  // 列表数据
+
+    let loading = ref(false)
+    //获取列表内容
+    async function getData(){
+      loading.value = true
+      await tms.warehouseList(filtInfoData).then(res =>{
+        if (res.code == 0) {
+          TabData.value = res
+        }
+      })
+      loading.value = false
+    }
+    //重置
+    function resetData(){
+      filtInfoData.offset = 0
+      filtInfoData.limit = 10
+      filtInfoData.supplierName = ''
+      filtInfoData.status = 0
+      getData()
+    }
+
+    let currentPage = ref(1)
+    //更改页码
+    function changePage (page) {
+      if(TabData.value.limit){
+        filtInfoData.offset = (page -1) *  TabData.value.limit  //更新偏移量
+        currentPage = page  //切换当前页码
+        getData() 
+      }
+    }
+
+    //审核通过
+    function auditSuccess(id){
+      this.$Modal.confirm({
+        title: '提示',
+        content: '<p>确定审核通过该信息吗?</p>',
+        onOk: async() => {
+          await tms.warehouseApprove({id:id}).then(res=>{
+            if(res.code === 101){
+              Message.success('审核成功!');
+              getData()
+            }
+          })
+        },
+        onCancel: () => {
+          this.$Message.info('已取消');
+        }
+      })
+    }
+    let refuseValue = ref('')
+    //查看异常
+    function auditFail(id){
+      this.$Modal.confirm({
+        title: '审核拒绝',
+        render: (h) => {
+          return h( Input, {
+            size: "large",
+            modelValue: refuseValue.value,
+            autofocus: true,
+            placeholder: '请输入拒绝原因',
+            'onInput': async (event) => {
+              refuseValue.value = event.target.value;
+            },
+          })
+        },
+        onOk: async () => {
+          const params={
+            id:id,
+            remark:refuseValue.value
+          }
+          await tms.warehouseReject(params).then(res=>{
+            if(res.code === 101){
+              Message.success('拒绝成功!');
+              getData()
+            }
+          })
+        },
+      })
+    }
+    
+    const showInfo = ref(false)
+    let markInfo =  reactive({
+      longitude:'',latitude:''
+    })
+    //查看地址
+    function lookInfo(data){
+      markInfo.longitude = data.longitude
+      markInfo.latitude = data.latitude
+      showInfo.value = true
+    }
+    onMounted(()=>{
+      getData() 
+    })
+
+    return {
+      getData,changePage,moment,TabData,filtInfoData,
+      loading,resetData,showInfo,auditFail,auditSuccess,refuseValue,lookInfo,markInfo
+    }
+  },
+})
+</script>
+
+<style lang="scss" scoped>
+.auditPlaceShip{
+  padding: 1em;
+  .opt_btn{margin-bottom:3px; margin-right: 3px;}
+  .page_style{
+    text-align: right; margin-top: 1em;
+    // background-color: var(--system-container-background);
+  }
+}
+</style>

+ 23 - 7
src/views/trackManager/deviceAbnormality.vue

@@ -37,21 +37,34 @@
         <el-table-column label="司机姓名" prop="waybill.driverName" width="120"  align="center"></el-table-column>
         <el-table-column label="司机手机号" prop="waybill.driverPhone" width="120" align="center"></el-table-column>
         <el-table-column label="车牌" prop="waybill.plateNumber" width="120" align="center"></el-table-column>
+        <el-table-column label="车辆颜色" align="center" width="100">
+          <template #default="scope">
+            <span>{{ plateColorFilter(scope.row.waybill.plateColor)}}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="状态" align="center" width="100">
           <template #default="scope">
             <Tag color="green" v-if="scope.row.status == 'NORMAL'">正常</Tag>
             <Tag color="red" v-if="scope.row.status == 'ABNORMAL'">异常</Tag>
           </template>
         </el-table-column>
-        <el-table-column label="关联单号" prop="waybill.orderNum" width="220" align="center"></el-table-column>
-        <el-table-column label="添加时间" width="160" align="center">
+        <el-table-column label="运输发货时间" width="160" align="center">
+          <template #default="scope">
+            {{ moment(scope.row.startTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+          </template>
+        </el-table-column>
+        <el-table-column label="运输到货时间" width="160" align="center">
           <template #default="scope">
-            {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+            {{ moment(scope.row.endTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
           </template>
         </el-table-column>
+        <el-table-column label="订单号" prop="waybill.orderInfo.orderNum" width="220" align="center"></el-table-column>
+        <el-table-column label="物料名称" prop="waybill.orderInfo.name" width="150" align="center"></el-table-column>
+        <el-table-column label="供应商名称" prop="waybill.orderInfo.company" width="180" align="center"></el-table-column>
+        <el-table-column label="牧场名称" prop="waybill.orderInfo.orgName" width="180" align="center"></el-table-column>
         <el-table-column label="操作" width="180"  fixed="right" align="center">
           <template  #default="scope">
-            <Button class="opt_btn" size="small" type="primary" ghost @click="lookTrack(scope.row.id)">查看轨迹</Button>
+            <Button class="opt_btn" size="small" type="primary" ghost @click="lookTrack(scope.row)">查看轨迹</Button>
             <Button class="opt_btn" size="small" type="warning" @click="lookInfo(scope.row.exceptionInfo)">查看异常</Button>
           </template>
         </el-table-column>
@@ -63,7 +76,7 @@
     </Card>
     <!-- 查看轨迹 -->
     <Modal v-model="showModal" width="75%" title="查看轨迹">
-      <mapTrack></mapTrack>
+      <mapTrack :waybillNum="waybillNum" v-if="showModal"></mapTrack>
     </Modal>
     <!-- 查看异常 -->
     <Modal v-model="showInfo" width="60%" title="查看异常">
@@ -89,6 +102,7 @@ import { Message,Modal,Spin,Input } from 'view-ui-plus'
 import moment from 'moment'
 import {useRoute} from 'vue-router'
 import mapTrack from "./mapTrack.vue"
+import {plateColorFilter} from '@/utils/system/filters'
 export default defineComponent({
   components:{
     mapTrack
@@ -165,8 +179,10 @@ export default defineComponent({
     }
 
     const showModal = ref(false)
+    let waybillNum = ref('')
     // 查看详情
-    function lookTrack(){
+    function lookTrack(data){
+      waybillNum.value = data.waybillNum
       showModal.value = true
     }
     const showInfo = ref(false)
@@ -182,7 +198,7 @@ export default defineComponent({
 
     return {
       handleSelectionChange,getData,changePage,moment,deleteInfo,TabData,filtInfoData,
-      loading,batchOperation,resetData,exceptionInfo,showInfo,lookInfo,lookTrack,showModal
+      loading,batchOperation,resetData,exceptionInfo,showInfo,lookInfo,lookTrack,showModal,plateColorFilter,waybillNum
     }
   },
 })

+ 24 - 7
src/views/trackManager/loadDeviation.vue

@@ -37,21 +37,34 @@
         <el-table-column label="司机姓名" prop="waybill.driverName" width="120"  align="center"></el-table-column>
         <el-table-column label="司机手机号" prop="waybill.driverPhone" width="120" align="center"></el-table-column>
         <el-table-column label="车牌" prop="waybill.plateNumber" width="120" align="center"></el-table-column>
+        <el-table-column label="车辆颜色" align="center" width="100">
+          <template #default="scope">
+            <span>{{ plateColorFilter(scope.row.waybill.plateColor)}}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="状态" align="center" width="100">
           <template #default="scope">
             <Tag color="green" v-if="scope.row.status == 'NORMAL'">正常</Tag>
             <Tag color="red" v-if="scope.row.status == 'ABNORMAL'">异常</Tag>
           </template>
         </el-table-column>
-        <el-table-column label="关联单号" prop="waybill.orderNum" width="220" align="center"></el-table-column>
-        <el-table-column label="添加时间" width="160" align="center">
+        <el-table-column label="运输发货时间" width="160" align="center">
           <template #default="scope">
-            {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+            {{ moment(scope.row.startTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
           </template>
         </el-table-column>
+        <el-table-column label="运输到货时间" width="160" align="center">
+          <template #default="scope">
+            {{ moment(scope.row.endTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+          </template>
+        </el-table-column>
+        <el-table-column label="订单号" prop="waybill.orderInfo.orderNum" width="220" align="center"></el-table-column>
+        <el-table-column label="物料名称" prop="waybill.orderInfo.name" width="150" align="center"></el-table-column>
+        <el-table-column label="供应商名称" prop="waybill.orderInfo.company" width="180" align="center"></el-table-column>
+        <el-table-column label="牧场名称" prop="waybill.orderInfo.orgName" width="180" align="center"></el-table-column>
         <el-table-column label="操作" width="180"  fixed="right" align="center">
           <template  #default="scope">
-            <Button class="opt_btn" size="small" type="primary" ghost @click="lookTrack(scope.row.id)">查看轨迹</Button>
+            <Button class="opt_btn" size="small" type="primary" ghost @click="lookTrack(scope.row)">查看轨迹</Button>
             <Button class="opt_btn" size="small" type="warning" @click="lookInfo(scope.row.exceptionInfo)">查看异常</Button>
           </template>
         </el-table-column>
@@ -63,7 +76,7 @@
     </Card>
     <!-- 查看轨迹 -->
     <Modal v-model="showModal" width="75%" title="查看轨迹">
-      <mapTrack></mapTrack>
+      <mapTrack :waybillNum="waybillNum" v-if="showModal"></mapTrack>
     </Modal>
     <!-- 查看异常 -->
     <Modal v-model="showInfo" width="60%" title="查看异常">
@@ -89,6 +102,7 @@ import { Message,Modal,Spin,Input } from 'view-ui-plus'
 import moment from 'moment'
 import {useRoute} from 'vue-router'
 import mapTrack from "./mapTrack.vue"
+import {plateColorFilter} from '@/utils/system/filters'
 export default defineComponent({
   components:{
     mapTrack
@@ -165,10 +179,13 @@ export default defineComponent({
     }
 
     const showModal = ref(false)
+    let waybillNum = ref('')
     // 查看详情
-    function lookTrack(){
+    function lookTrack(data){
+      waybillNum.value = data.waybillNum
       showModal.value = true
     }
+
     const showInfo = ref(false)
     const exceptionInfo = ref({})
     //查看异常
@@ -182,7 +199,7 @@ export default defineComponent({
 
     return {
       handleSelectionChange,getData,changePage,moment,deleteInfo,TabData,filtInfoData,
-      loading,batchOperation,resetData,exceptionInfo,showInfo,lookInfo,lookTrack,showModal
+      loading,batchOperation,resetData,exceptionInfo,showInfo,lookInfo,lookTrack,showModal,plateColorFilter,waybillNum
     }
   },
 })

+ 96 - 0
src/views/trackManager/mapMark.vue

@@ -0,0 +1,96 @@
+/**
+  // author:jiana
+  // time:2025-04-23
+  // desc:运单管理
+*/
+<template>
+  <div class="mapMark">
+    <div id="container"></div>
+  </div>
+</template>
+<script>
+import { defineComponent, ref ,reactive, onMounted} from 'vue'
+import {useRoute} from 'vue-router'
+import AMapLoader from "@amap/amap-jsapi-loader";
+import axios from 'axios';
+import { tms } from '@/request/api'
+export default defineComponent({
+  components:{
+    
+  },
+  props:{
+    markInfo: { type: Object, default:{longitude:'',latitude:''}}
+  },
+  setup(props) {
+    const route = useRoute()
+    const trajectory = ref([]);
+    const loadData = async () =>{
+      trajectory.value = []
+      trajectory.value.push([Number(props.markInfo.longitude),Number(props.markInfo.latitude)])
+    }
+    const getMap = () =>{
+      AMapLoader.load({
+        key: '81a1282308f1aae58082425a1ebb91b0',
+        version: '2.0',
+        plugins: ['AMap.MoveAnimation']
+      }).then(AMap => {
+        AMap.plugin('AMap.MoveAnimation', () => {
+          var map = new AMap.Map('container', {
+            center: trajectory.value[0],
+          });
+          // 起点
+          var marker = new AMap.Marker({
+            map: map,
+            position: trajectory.value[0],
+            icon: require('@/assets/images/dian.png'), // 自定义图标
+            offset: new AMap.Pixel(-13, -26),
+          });
+
+          map.setFitView();
+          map.setZoom(13);
+        });
+      }).catch(e => {
+        console.error(e);
+      });
+    }
+    onMounted(async ()=>{
+      await loadData()
+      await getMap()
+    })
+    return {
+      
+    }
+  },
+})
+</script>
+
+<style lang="scss" scoped>
+.mapMark{
+  // padding: 20px;
+  #container{
+    width: 100%; 
+    height: 460px;
+  }
+  .btnBox{
+    position: absolute;
+    top: 70px;
+    left: 20px;
+    z-index: 1;
+    background: #fff;
+    width: 200px;
+    height: 110px;
+    padding: 10px;
+    border-radius: 5px;
+  }
+}
+</style>
+<style lang="scss">
+.amap-icon{
+  width: 40px !important;
+  height: 40px !important;
+}
+.amap-icon img{
+  width: 40px !important;
+  height: 40px !important;
+}
+</style>

+ 16 - 7
src/views/trackManager/mapTrack.vue

@@ -24,23 +24,32 @@ import { defineComponent, ref ,reactive, onMounted} from 'vue'
 import {useRoute} from 'vue-router'
 import AMapLoader from "@amap/amap-jsapi-loader";
 import axios from 'axios';
+import { tms } from '@/request/api'
 export default defineComponent({
   components:{
     
   },
-  setup() {
+  props:{
+    waybillNum: { type: String, default: "" }
+  },
+  setup(props) {
     const route = useRoute()
     const data = ref(null);
     const trajectory = ref([]);
     const loadData = async () =>{
       trajectory.value = []
-      const module = await import('@/assets/track.json');
-      data.value = module.default; // 对于JSON文件,默认导出是整个JSON对象
-      data.value.obj.runRoute.forEach(item => {
-        if (!isNaN(item.lon) && !isNaN(item.lat)) {
-          trajectory.value.push([Number(item.lon),Number(item.lat)])
+      await tms.truckTrackQueryByWaybillNum({waybillNum:props.waybillNum}).then(res =>{
+        if (res.code == 101) {
+          data.value = res.data
+          if(data.value.obj && data.value.obj.runRoute){
+            data.value.obj.runRoute.forEach(item => {
+              if (!isNaN(item.lon) && !isNaN(item.lat)) {
+                trajectory.value.push([Number(item.lon),Number(item.lat)])
+              }
+            });
+          }
         }
-      });
+      })
     }
 
     const getMap = () =>{

+ 138 - 0
src/views/trackManager/placeShip.vue

@@ -0,0 +1,138 @@
+/**
+  // author:jiana
+  // time:2025-04-23
+  // desc:运单管理
+*/
+<template>
+  <div class="placeShip">
+    <Card>
+      <!-- 筛选 -->
+      <Row :gutter="8">
+        <Col span="10">
+          供应商名称 <Input v-model="filtInfoData.supplierName" placeholder="请输入供应商名称" style="width:80%"/>
+        </Col>
+        <Col span="2">
+          <Button type="primary" @click="getData">查询</Button>
+        </Col>
+        <Col span="2">
+          <Button @click="resetData">重置</Button>
+        </Col>
+      </Row>
+    </Card>
+    <Card style="margin-top:20px;">
+      <Row>
+        <Col span="12">
+         已通过列表
+        </Col>
+      </Row>
+      <!-- 表格部分 -->
+      <el-table v-loading="loading" :data="TabData.data" border style="width: 100%;margin-top:20px;">
+        <el-table-column label="供应商名称" prop="supplierName" width="160" align="center"></el-table-column>
+        <el-table-column label="仓库名称" width="150" prop="name" align="center"/>
+        <el-table-column label="仓库地址" width="150" prop="address" align="center"/>
+        <el-table-column label="经度" width="150" prop="longitude" align="center"></el-table-column>
+        <el-table-column label="维度" prop="latitude" width="150"  align="center"></el-table-column>
+        <el-table-column label="添加时间" width="160" align="center">
+          <template #default="scope">
+            {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="150"  fixed="right" align="center">
+          <template  #default="scope">
+            <Button class="opt_btn" size="small" type="primary" ghost @click="lookInfo(scope.row)">查看地址</Button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 分页 -->
+      <div class="page_style">
+        <Page :total="TabData.total" :model-value="currentPage" show-elevator show-total @on-change="changePage" />
+      </div>
+    </Card>
+    <!-- 查看地址 -->
+    <Modal v-model="showInfo" width="60%" title="查看地址">
+     <mapMark v-if="showInfo" :markInfo="markInfo"></mapMark>
+    </Modal>
+  </div>
+</template>
+
+<script>
+import { defineComponent, ref ,reactive, onMounted} from 'vue'
+import { tms } from '@/request/api'
+import { Message,Modal,Spin,Input } from 'view-ui-plus'
+import moment from 'moment'
+import {useRoute} from 'vue-router'
+import mapMark from "./mapMark.vue"
+export default defineComponent({
+  components:{
+    mapMark
+  },
+  setup() {
+    const route = useRoute()
+    let filtInfoData = reactive({ // 搜索
+      limit:10,offset:0,status:1,supplierName:''
+    })
+
+    let TabData = ref([])  // 列表数据
+
+    let loading = ref(false)
+    //获取列表内容
+    async function getData(){
+      loading.value = true
+      await tms.warehouseList(filtInfoData).then(res =>{
+        if (res.code == 0) {
+          TabData.value = res
+        }
+      })
+      loading.value = false
+    }
+    //重置
+    function resetData(){
+      filtInfoData.offset = 0
+      filtInfoData.limit = 10
+      filtInfoData.supplierName = ''
+      filtInfoData.status = 1
+      getData()
+    }
+
+    let currentPage = ref(1)
+    //更改页码
+    function changePage (page) {
+      if(TabData.value.limit){
+        filtInfoData.offset = (page -1) *  TabData.value.limit  //更新偏移量
+        currentPage = page  //切换当前页码
+        getData() 
+      }
+    }
+    
+    const showInfo = ref(false)
+    let markInfo =  reactive({
+      longitude:'',latitude:''
+    })
+    //查看地址
+    function lookInfo(data){
+      markInfo.longitude = data.longitude
+      markInfo.latitude = data.latitude
+      showInfo.value = true
+    }
+    onMounted(()=>{
+      getData() 
+    })
+
+    return {
+      getData,changePage,moment,TabData,filtInfoData,
+      loading,resetData,showInfo,lookInfo,markInfo
+    }
+  },
+})
+</script>
+
+<style lang="scss" scoped>
+.placeShip{
+  padding: 1em;
+  .opt_btn{margin-bottom:3px; margin-right: 3px;}
+  .page_style{
+    text-align: right; margin-top: 1em;
+    // background-color: var(--system-container-background);
+  }
+}
+</style>

+ 138 - 0
src/views/trackManager/unPlaceShip.vue

@@ -0,0 +1,138 @@
+/**
+  // author:jiana
+  // time:2025-04-23
+  // desc:运单管理
+*/
+<template>
+  <div class="unPlaceShip">
+    <Card>
+      <!-- 筛选 -->
+      <Row :gutter="8">
+        <Col span="10">
+          供应商名称 <Input v-model="filtInfoData.supplierName" placeholder="请输入供应商名称" style="width:80%"/>
+        </Col>
+        <Col span="2">
+          <Button type="primary" @click="getData">查询</Button>
+        </Col>
+        <Col span="2">
+          <Button @click="resetData">重置</Button>
+        </Col>
+      </Row>
+    </Card>
+    <Card style="margin-top:20px;">
+      <Row>
+        <Col span="12">
+          已拒绝列表
+        </Col>
+      </Row>
+      <!-- 表格部分 -->
+      <el-table v-loading="loading" :data="TabData.data" border style="width: 100%;margin-top:20px;">
+        <el-table-column label="供应商名称" prop="supplierName" width="160" align="center"></el-table-column>
+        <el-table-column label="仓库名称" width="150" prop="name" align="center"/>
+        <el-table-column label="仓库地址" width="150" prop="address" align="center"/>
+        <el-table-column label="经度" width="150" prop="longitude" align="center"></el-table-column>
+        <el-table-column label="维度" prop="latitude" width="150"  align="center"></el-table-column>
+        <el-table-column label="添加时间" width="160" align="center">
+          <template #default="scope">
+            {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="150"  fixed="right" align="center">
+          <template  #default="scope">
+            <Button class="opt_btn" size="small" type="primary" ghost @click="lookInfo(scope.row)">查看地址</Button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 分页 -->
+      <div class="page_style">
+        <Page :total="TabData.total" :model-value="currentPage" show-elevator show-total @on-change="changePage" />
+      </div>
+    </Card>
+    <!-- 查看地址 -->
+    <Modal v-model="showInfo" width="60%" title="查看地址">
+     <mapMark v-if="showInfo" :markInfo="markInfo"></mapMark>
+    </Modal>
+  </div>
+</template>
+
+<script>
+import { defineComponent, ref ,reactive, onMounted} from 'vue'
+import { tms } from '@/request/api'
+import { Message,Modal,Spin,Input } from 'view-ui-plus'
+import moment from 'moment'
+import {useRoute} from 'vue-router'
+import mapMark from "./mapMark.vue"
+export default defineComponent({
+  components:{
+    mapMark
+  },
+  setup() {
+    const route = useRoute()
+    let filtInfoData = reactive({ // 搜索
+      limit:10,offset:0,status:2,supplierName:''
+    })
+
+    let TabData = ref([])  // 列表数据
+
+    let loading = ref(false)
+    //获取列表内容
+    async function getData(){
+      loading.value = true
+      await tms.warehouseList(filtInfoData).then(res =>{
+        if (res.code == 0) {
+          TabData.value = res
+        }
+      })
+      loading.value = false
+    }
+    //重置
+    function resetData(){
+      filtInfoData.offset = 0
+      filtInfoData.limit = 10
+      filtInfoData.supplierName = ''
+      filtInfoData.status = 2
+      getData()
+    }
+
+    let currentPage = ref(1)
+    //更改页码
+    function changePage (page) {
+      if(TabData.value.limit){
+        filtInfoData.offset = (page -1) *  TabData.value.limit  //更新偏移量
+        currentPage = page  //切换当前页码
+        getData() 
+      }
+    }
+    
+    const showInfo = ref(false)
+    let markInfo =  reactive({
+      longitude:'',latitude:''
+    })
+    //查看地址
+    function lookInfo(data){
+      markInfo.longitude = data.longitude
+      markInfo.latitude = data.latitude
+      showInfo.value = true
+    }
+    onMounted(()=>{
+      getData() 
+    })
+
+    return {
+      getData,changePage,moment,TabData,filtInfoData,
+      loading,resetData,showInfo,lookInfo,markInfo
+    }
+  },
+})
+</script>
+
+<style lang="scss" scoped>
+.unPlaceShip{
+  padding: 1em;
+  .opt_btn{margin-bottom:3px; margin-right: 3px;}
+  .page_style{
+    text-align: right; margin-top: 1em;
+    // background-color: var(--system-container-background);
+  }
+}
+</style>

+ 23 - 8
src/views/trackManager/waybillManager.vue

@@ -37,20 +37,33 @@
         <el-table-column label="司机姓名" prop="driverName" width="120"  align="center"></el-table-column>
         <el-table-column label="司机手机号" prop="driverPhone" width="120" align="center"></el-table-column>
         <el-table-column label="车牌" prop="plateNumber" width="120" align="center"></el-table-column>
+        <el-table-column label="车辆颜色" align="center" width="100">
+          <template #default="scope">
+            <span>{{ plateColorFilter(scope.row.plateColor)}}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="状态" align="center" width="100">
           <template #default="scope">
             <span>{{ wayBillStatus(scope.row.status)}}</span>
           </template>
         </el-table-column>
-        <el-table-column label="订单号" prop="orderNum" width="220" align="center"></el-table-column>
-        <el-table-column label="添加时间" width="160" align="center">
+        <el-table-column label="运输发货时间" width="160" align="center">
+          <template #default="scope">
+            {{ moment(scope.row.startTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+          </template>
+        </el-table-column>
+        <el-table-column label="运输到货时间" width="160" align="center">
           <template #default="scope">
-            {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
+            {{ moment(scope.row.endTime).format('yyyy-MM-DD hh:mm:ss') || '暂无'}}
           </template>
         </el-table-column>
+        <el-table-column label="订单号" prop="orderInfo.orderNum" width="220" align="center"></el-table-column>
+        <el-table-column label="物料名称" prop="orderInfo.name" width="150" align="center"></el-table-column>
+        <el-table-column label="供应商名称" prop="orderInfo.company" width="180" align="center"></el-table-column>
+        <el-table-column label="牧场名称" prop="orderInfo.orgName" width="180" align="center"></el-table-column>
         <el-table-column label="操作" width="130"  fixed="right" align="center">
           <template  #default="scope">
-            <Button class="opt_btn" size="small" type="primary" ghost @click="lookTrack(scope.row.id)">查看轨迹</Button>
+            <Button class="opt_btn" size="small" type="primary" ghost @click="lookTrack(scope.row)">查看轨迹</Button>
             <!-- <Button class="opt_btn" size="small" type="warning" @click="deleteInfo(scope.row.id)">删除</Button> -->
           </template>
         </el-table-column>
@@ -61,7 +74,7 @@
       </div>
     </Card>
     <Modal v-model="showModal" width="75%" title="查看轨迹">
-      <mapTrack></mapTrack>
+      <mapTrack :waybillNum="waybillNum" v-if="showModal"></mapTrack>
     </Modal>
   </div>
 </template>
@@ -73,7 +86,7 @@ import moment from 'moment'
 import {useRouter,useRoute} from 'vue-router'
 import AMapLoader from "@amap/amap-jsapi-loader";
 import mapTrack from "./mapTrack.vue"
-import {wayBillStatus} from '@/utils/system/filters'
+import {wayBillStatus,plateColorFilter} from '@/utils/system/filters'
 export default defineComponent({
   components:{
     mapTrack
@@ -144,8 +157,10 @@ export default defineComponent({
       
     }
     const showModal = ref(false)
+    let waybillNum = ref('')
     // 查看详情
-    function lookTrack(){
+    function lookTrack(data){
+      waybillNum.value = data.waybillNum
       showModal.value = true
     }
 
@@ -159,7 +174,7 @@ export default defineComponent({
     })
     return {
       handleSelectionChange,getData,changePage,moment,deleteInfo,TabData,filtInfoData,
-      loading,batchOperation,resetData,lookTrack,showModal,wayBillStatus
+      loading,batchOperation,resetData,lookTrack,showModal,wayBillStatus,plateColorFilter,waybillNum
     }
   },
 })