Răsfoiți Sursa

Merge branch 'dev_g' of United_Software/k_online_ui into dev

Jack Zhou 1 an în urmă
părinte
comite
557df863d9

+ 13 - 0
src/components/MoreFilters/src/MoreFilters.vue

@@ -7,6 +7,19 @@ import { ref, onMounted, onBeforeMount, computed } from 'vue'
 import SelectTable from '@/components/SelectTable/src/SelectTable.vue'
 
 onMounted(() => {
+  const reportlist = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
+  const data = JSON.parse(sessionStorage.getItem('tagsList') as string) || {}
+  if (reportlist._city_name != '') {
+    if (data.title.includes('Origin')) {
+      InputForm.value.palces.Origin.push(reportlist._city_name)
+      MoreFiltersObj.Origin = reportlist._city_name
+      MoreFiltersObj2.Origin = InputForm.value.palces.Origin
+    } else {
+      InputForm.value.palces.Destination.push(reportlist._city_name)
+      MoreFiltersObj.Destination = reportlist._city_name
+      MoreFiltersObj2.Destination = InputForm.value.palces.Origin
+    }
+  }
   emitter.on('clearTag', (tag: any) => {
     if (tag.includes('Shippername')) {
       clearname(InputForm.value, 'parties', 'Shippername')

+ 36 - 17
src/views/Dashboard/src/DashboardView.vue

@@ -280,6 +280,8 @@ const GetCo2DestinationEcharts = () => {
     }
   })
 }
+const topdestinationinType = ref()
+const toporiginType = ref()
 //获取Top10 Origin/Destination
 const Top10Obj = reactive({
   OriginData: [],
@@ -302,6 +304,8 @@ const GetTop10ODEcharts = () => {
       Top1OInterval.interval = res.data.interval
       Top1OInterval_dest.Max = res.data.dest_Max
       Top1OInterval_dest.interval = res.data.dest_interval
+      topdestinationinType.value = res.data.topdestinationinType
+      toporiginType.value = res.data.toporiginType
     }
   })
 }
@@ -384,6 +388,7 @@ const ClickParams = (val: any) => {
         if (res.code == 200) {
           reportList._reportRef = pie_chart_ETD.value[0].paramsdata.name
           reportList._reportRefe_date = currentDate.getMonth() + 1 + '/' + currentDate.getFullYear()
+          reportList._reportType = 'r1'
           reportList._reportRefb_date = currentDate.getMonth() + 3 + '/' + tenyear
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
@@ -406,6 +411,7 @@ const ClickParams = (val: any) => {
       .then((res: any) => {
         if (res.code == 200) {
           reportList._reportRef = pie_chart_pending_arrival.value[0].paramsdata.name
+          reportList._reportType = 'r3'
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
@@ -426,6 +432,7 @@ const ClickParams = (val: any) => {
       })
       .then((res: any) => {
         if (res.code == 200) {
+          reportList._reportType = 'r4'
           reportList._reportRef = pie_chart_pending_departure.value[0].paramsdata.name
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
@@ -448,6 +455,7 @@ const ClickParams = (val: any) => {
       .then((res: any) => {
         if (res.code == 200) {
           reportList._reportRef = pie_chart_kpi_departure.value[0].paramsdata.name
+          reportList._reportType = 'atd_r4'
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
@@ -469,6 +477,7 @@ const ClickParams = (val: any) => {
       .then((res: any) => {
         if (res.code == 200) {
           reportList._reportRef = pie_chart_kpi_arrival.value[0].paramsdata.name
+          reportList._reportType = 'ata_r3'
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
@@ -483,22 +492,23 @@ const ClickParams = (val: any) => {
   }
   // Top10 origin点击跳转
   else if (val == 'Top 10 Origin') {
-    let array: any = []
-    array.push(seller_chart_top10_origin.value[0].paramsdata)
     $api
       .ClickTop10({
-        _reportRef: array,
-        _reportStationType: 'origin'
+        _reportRef: seller_chart_top10_origin.value[0].paramsdata,
+        _reportStationType: toporiginType.value,
+        _city_name: seller_chart_top10_origin.value[0].paramscityname
       })
       .then((res: any) => {
         if (res.code == 200) {
-          reportList._reportRef = array
-          reportList._reportStationType = 'origin'
+          reportList._reportRef = seller_chart_top10_origin.value[0].paramsdata
+          reportList._reportType = 'top'
+          reportList._reportStationType = toporiginType.value
+          reportList._city_name = seller_chart_top10_origin.value[0].paramscityname
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           obj.title = 'Top 10 Origin'
-          obj.data = seller_chart_top10_origin.value[0].paramsdata
+          obj.data = seller_chart_top10_origin.value[0].paramscityname
           sessionStorage.setItem('tagsList', JSON.stringify(obj))
           router.push({
             path: '/tracking'
@@ -508,22 +518,23 @@ const ClickParams = (val: any) => {
   }
   // Top10 destination点击跳转
   else if (val == 'Top 10 Destination') {
-    let array: any = []
-    array.push(seller_chart_top10_destination.value[0].paramsdata)
     $api
       .ClickTop10({
-        _reportRef: array,
-        _reportStationType: 'agent'
+        _reportRef: seller_chart_top10_destination.value[0].paramsdata,
+        _reportStationType: topdestinationinType.value,
+        _city_name: seller_chart_top10_destination.value[0].paramscityname
       })
       .then((res: any) => {
         if (res.code == 200) {
-          reportList._reportRef = array
-          reportList._reportStationType = 'agent'
+          reportList._reportRef = seller_chart_top10_destination.value[0].paramsdata
+          reportList._reportStationType = topdestinationinType.value
+          reportList._reportType = 'top'
+          reportList._city_name = seller_chart_top10_destination.value[0].paramscityname
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           obj.title = 'Top 10 Destination'
-          obj.data = seller_chart_top10_destination.value[0].paramsdata
+          obj.data = seller_chart_top10_destination.value[0].paramscityname
           sessionStorage.setItem('tagsList', JSON.stringify(obj))
           router.push({
             path: '/tracking'
@@ -544,6 +555,7 @@ const ClickParams = (val: any) => {
           reportList._reportRef = seller_chart_CO2_origin.value[0].paramsdata.name
           reportList._reportDataType = seller_chart_CO2_origin.value[0].paramsdata.type
           reportList._reportStationType = 'origin'
+          reportList._reportType = 'co2e'
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
@@ -568,6 +580,7 @@ const ClickParams = (val: any) => {
         if (res.code == 200) {
           reportList._reportRef = seller_chart_CO2_destination.value[0].paramsdata.name
           reportList._reportDataType = seller_chart_CO2_destination.value[0].paramsdata.type
+          reportList._reportType = 'co2e'
           reportList._reportStationType = 'agent'
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
@@ -630,7 +643,7 @@ const ClickParams = (val: any) => {
             <el-button
               class="el-button--default"
               @click="SaveVisible = !SaveVisible"
-              @blur="SaveFilters"
+              @blur="SaveVisible = false"
             >
               <span class="iconfont_icon">
                 <svg class="iconfont" aria-hidden="true">
@@ -704,7 +717,13 @@ const ClickParams = (val: any) => {
     <!-- 图表 -->
     <div class="echarts">
       <VueDraggable
-        style="display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px"
+        style="
+          display: flex;
+          flex-wrap: wrap;
+          justify-content: space-between;
+          gap: 8px;
+          width: 100%;
+        "
         ref="infoContentRef"
         ghost-class="ghost-class"
         :forceFallback="true"
@@ -1223,7 +1242,7 @@ const ClickParams = (val: any) => {
   height: 32px;
 }
 .echarts {
-  padding: 0 24px;
+  padding: 0 22px;
 }
 .kpi {
   width: 50%;

+ 1 - 2
src/views/Dashboard/src/components/BarChart.vue

@@ -15,7 +15,6 @@ watch(
     initOption.title.text = bar_title.value
     initOption.xAxis.data = barName.value
     initOption.series = bar_series.value
-    console.log(initOption.series)
     initOption.legend.data = Name.value
     initOption.yAxis.max = Max.value
     initOption.yAxis.interval = interval.value
@@ -196,6 +195,7 @@ const initOption = reactive({
 })
 onMounted(() => {
   initChart()
+  clickParams()
 })
 
 const emits = defineEmits(['ClickParams'])
@@ -219,7 +219,6 @@ const initChart = () => {
   window.addEventListener('resize', () => {
     bar_chart.resize()
   })
-  clickParams()
 }
 defineExpose({
   paramsdata

+ 1 - 1
src/views/Dashboard/src/components/PieChart.vue

@@ -159,6 +159,7 @@ const initOption: any = reactive({
 
 onMounted(() => {
   initChart()
+  clickParams()
 })
 const emits = defineEmits(['ClickParams'])
 const paramsdata = ref()
@@ -177,7 +178,6 @@ const initChart = () => {
   window.addEventListener('resize', () => {
     pie_chart.resize()
   })
-  clickParams()
 }
 defineExpose({
   paramsdata

+ 13 - 1
src/views/Dashboard/src/components/RecentStatus.vue

@@ -1,5 +1,6 @@
 <script lang="ts" setup>
 import { useRouter } from 'vue-router'
+import dayjs from 'dayjs'
 
 const router = useRouter()
 interface RecentItem {
@@ -16,6 +17,8 @@ interface RecentItem {
   type: string
   Arrived: string
   Time: string
+  timezone: string
+  act_time: string
 }
 interface Props {
   RecentStatusList: RecentItem[]
@@ -31,6 +34,13 @@ const RouteToDetail = (val: any) => {
     }
   })
 }
+const formatDate = (date: string) => {
+  if (date != '') {
+    return dayjs(date).format('MMM/DD/YYYY')
+  } else {
+    return ''
+  }
+}
 </script>
 <template>
   <div class="recent_route" v-for="(item, index) in props.RecentStatusList" :key="index">
@@ -120,7 +130,9 @@ const RouteToDetail = (val: any) => {
       <div class="recent-content-right">
         <VTag :type="item.type" style="margin-bottom: 4px">{{ item.type }}</VTag>
         <div class="right_text">{{ item.Arrived }}</div>
-        <div class="startStation_time">{{ item.Time }}</div>
+        <div class="startStation_time">
+          {{ formatDate(item.Time) }}&nbsp;&nbsp;{{ item.act_time }}&nbsp;&nbsp;{{ item.timezone }}
+        </div>
       </div>
     </div>
   </div>

+ 11 - 3
src/views/Dashboard/src/components/SellerChart.vue

@@ -142,7 +142,7 @@ const initOption = reactive({
       label: {
         show: true,
         color: '#646A73',
-        position: 'insideRight',
+        position: 'right',
         fontFamily: 'Lato-Light',
         // 数据每三位加一个逗号
         formatter: function (data: { value: { toString: () => string } }) {
@@ -157,14 +157,22 @@ const initOption = reactive({
 
 onMounted(() => {
   initChart()
+  clickParams()
 })
 const emits = defineEmits(['ClickParams'])
 const paramsdata = ref()
+const paramscityname = ref()
 const clickParams = () => {
   const seller_chart = echarts.init(seller_ref.value)
   // 监听点击事件
   seller_chart.on('click', function (params) {
     paramsdata.value = params.name
+    seller_data.value?.forEach((item: any) => {
+      if (item.name == paramsdata.value) {
+        paramscityname.value = item.city_name
+        console.log(paramscityname.value)
+      }
+    })
     emits('ClickParams')
   })
 }
@@ -178,10 +186,10 @@ const initChart = () => {
   window.addEventListener('resize', () => {
     seller_chart.resize()
   })
-  clickParams()
 }
 defineExpose({
-  paramsdata
+  paramsdata,
+  paramscityname
 })
 </script>
 

+ 11 - 3
src/views/Tracking/src/TrackingView.vue

@@ -59,7 +59,7 @@ const handleClose = (tag: any) => {
   } else if (tag.includes('Sales')) {
     delete searchTableQeury.sales_rep
   } else if (tag.includes('Origin')) {
-    delete searchTableQeury.from_station
+    delete searchTableQeury['shipper_city/consignee_city']
   } else if (tag.includes('Destination')) {
     delete searchTableQeury.final_desination
   } else if (tag.includes('Place of Receipt')) {
@@ -304,11 +304,19 @@ onMounted(() => {
   ) {
     const data = JSON.parse(sessionStorage.getItem('tagsList') as string) || {}
     const reportlist = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
-    let str = `${data.title}:${data.data}`
-    filterData.daterangeData.push(str)
     for (const key in reportlist) {
       searchTableQeury[key] = reportlist[key]
     }
+    if (reportlist._city_name == '') {
+      let str = `${data.title}:${data.data}`
+      filterData.dashboardData.push(str)
+    } else if (data.title.includes('Origin')) {
+      let str = `Origin: ${data.data}`
+      filterData.morefiltersData.push(str)
+    } else {
+      let str = `Destination: ${data.data}`
+      filterData.morefiltersData.push(str)
+    }
     renderTagsData()
   }
   Gettrackingdata()