Procházet zdrojové kódy

Merge branch 'master' of http://git.xt.wenhq.top:8083/wenhongquan/khyznh-ui

liwei19941102 před 2 roky
rodič
revize
79d77ced4a

+ 14 - 9
src/api/data.ts

@@ -4,7 +4,15 @@ import { AxiosPromise } from 'axios';
 export const getpassenger = () => {
   return request({
     url: '/statistic/passenger/flow',
-    method: 'get'
+    method: 'post'
+  });
+};
+
+export const getpassenger1 = (data: any) => {
+  return request({
+    url: '/statistic/passenger/flow',
+    method: 'post',
+    data: JSON.stringify(data)
   });
 };
 
@@ -13,7 +21,7 @@ export const getInfo = (code) => {
     url: '/system/common/cabinet/' + code + '/info',
     method: 'post'
   });
-}
+};
 
 export const getInfoWait = async (code) => {
   const res = await request({
@@ -24,29 +32,28 @@ export const getInfoWait = async (code) => {
     return res.data;
   }
   return Promise.reject(new Error(res.message));
-}
-
+};
 
 export const getBoxInfo = (code) => {
   return request({
     url: '/system/common/cabinet/' + code + '/allbox/info',
     method: 'post'
   });
-}
+};
 
 export const getLock = (code, lockAddress) => {
   return request({
     url: '/system/common/cabinet/' + code + '/openlock/' + lockAddress,
     method: 'post'
   });
-}
+};
 
 export const openall = (code) => {
   return request({
     url: '/system/common/cabinet/' + code + '/lock/openall',
     method: 'post'
   });
-}
+};
 
 // export const openall = (code) =>{
 //   return request({
@@ -61,5 +68,3 @@ export const openall = (code) => {
 //     method: 'post'
 //   });
 // }
-
-

+ 45 - 54
src/components/HomeComponents/countPage.vue

@@ -1,75 +1,66 @@
 <template>
-    <div class="countHomeClass">
-        <div class="titleBg">
-            <div class="titleFont">今日统计</div>
+  <div class="countHomeClass">
+    <div class="titleBg">
+      <div class="titleFont">今日统计</div>
+    </div>
+    <div class="divContent" style="display: flex;flex-direction: row;justify-content: space-around;align-items: center;">
+      <div>
+        <div class="divBackGround">
+          <div class="countFont" style="color: #16FF84;">{{ people }}</div>
+        </div>
+        <div style="display: flex;flex-direction: row;justify-content: center;margin-top: 10px;">
+          <div class="titleClass">客流数</div>
+          <div class="unitClass">(人)</div>
+        </div>
+      </div>
+      <div>
+        <div class="hldivBackGround">
+          <div class="countFont" style="color: #0EF7FF;">{{ goods }}</div>
         </div>
-        <div class="divContent" style="display: flex;flex-direction: row;justify-content: space-around;align-items: center;">
-            <div>
-                <div class="divBackGround">
-                    <div class="countFont" style="color: #16FF84;">{{ people }}</div>
-                </div>
-                <div style="display: flex;flex-direction: row;justify-content: center;margin-top: 10px;">
-                    <div class="titleClass">
-                        客流数
-                    </div>
-                    <div class="unitClass">
-                        (人)
-                    </div>
-                </div>
-            </div>
-            <div>
-                <div class="hldivBackGround">
-                    <div class="countFont" style="color: #0EF7FF;">{{ goods }}</div>
-                </div>
-                <div style="display: flex;flex-direction: row;justify-content: center;margin-top: 10px">
-                    <div class="titleClass">
-                        货流数
-                    </div>
-                    <div class="unitClass">
-                        (人)
-                    </div>
-                </div>
-            </div>
+        <div style="display: flex;flex-direction: row;justify-content: center;margin-top: 10px">
+          <div class="titleClass">货订数</div>
+          <div class="unitClass">(人)</div>
         </div>
+      </div>
     </div>
+  </div>
 </template>
 
 <script setup name="CarInfo" lang="ts">
 import moment from 'moment';
 import { getCountData } from '@/api/gpsData';
 import { listGoodsOrder } from "@/api/goodsOrder";
+import { getpassenger1 } from '@/api/data'
+import { cabinetboxstatic } from '@/api/gpsData';
 
 const people = ref(0)
 const goods = ref(0)
 
-const getCountDataList = () => {
-    var startDate = moment(new Date()).format('YYYY-MM-DD');
-    var dateTime = new Date()
-    dateTime = dateTime.setDate(dateTime.getDate() + 1);
-    dateTime = new Date(dateTime);
-    var endDate = moment(dateTime).format('YYYY-MM-DD')
-    var obj = {
-        params: {
-            starttime: startDate,
-            endtime: endDate
-        }
-    }
-    getCountData(obj).then(res => {
-        people.value = res.data.totalin
-    })
-}
 
-const getlistGoodsOrder = () =>{
-    var gotime =  moment(new Date()).format('YYYY-MM-DD 00:00:00')
-    listGoodsOrder({pageSize:1000,gotime:gotime}).then(res=>{
-          goods.value = res.rows.length
-    })
-}
+const getlist = () =>{
+  getpassenger1({
+    "start":moment(new Date()).format('YYYY-MM-DD'),
+    "end":moment(new Date()).format('YYYY-MM-DD')
+}).then(res=>{
+  console.log(res)
+  people.value = res.data[0].flowCount.incount;
+  // goods.value = res.data[0].goodsOrderCount.ordercount;
+})
+
 
+cabinetboxstatic().then((res) => {
+    let totalcabinet = 0;
+    let kxcabinet = 0;
+    for (let key in res) {
+      totalcabinet += res[key].total ?? 0;
+      kxcabinet += res[key].unuse ?? 0;
+    }
+    goods.value = totalcabinet-kxcabinet;
+  });
+}
 onMounted(() => {
     // getList();
-    getCountDataList();
-    getlistGoodsOrder();
+      getlist();
 });
 </script>
 <style scoped lang="scss">

+ 51 - 27
src/components/HomeStatics/countPage.vue

@@ -10,7 +10,7 @@
             </div>
             <div class="bgClass1">
                 <img class="imgClass" src="@/assets/images/home/路径6@2x.png" />
-                <div class="bgTitle">货数</div>
+                <div class="bgTitle">货数</div>
                 <div class="countClass">{{ goods }}</div>
                 <div class="unitClass">件</div>
             </div>
@@ -20,41 +20,65 @@
 
 <script setup name="CarInfo" lang="ts">
 import moment from 'moment';
-import { getCountData } from '@/api/gpsData';
-import { listGoodsOrder } from "@/api/goodsOrder";
+// import { getCountData } from '@/api/gpsData';
+// import { listGoodsOrder } from "@/api/goodsOrder";
+import { getpassenger1 } from '@/api/data'
+import { cabinetboxstatic } from '@/api/gpsData';
+
 
 const people = ref(0)
 const goods = ref(0)
 
-const getCountDataList = () => {
-    var startDate = moment(new Date()).format('YYYY-MM-DD');
-    var dateTime = new Date()
-    dateTime = dateTime.setDate(dateTime.getDate() + 1);
-    dateTime = new Date(dateTime);
-    var endDate = moment(dateTime).format('YYYY-MM-DD')
-    var obj = {
-        params: {
-            starttime: startDate,
-            endtime: endDate
-        }
-    }
-    getCountData(obj).then(res=>{
-        people.value = res.data.totalin
-    })
-}
+// const getCountDataList = () => {
+//     var startDate = moment(new Date()).format('YYYY-MM-DD');
+//     var dateTime = new Date()
+//     dateTime = dateTime.setDate(dateTime.getDate() + 1);
+//     dateTime = new Date(dateTime);
+//     var endDate = moment(dateTime).format('YYYY-MM-DD')
+//     var obj = {
+//         params: {
+//             starttime: startDate,
+//             endtime: endDate
+//         }
+//     }
+//     getCountData(obj).then(res=>{
+//         people.value = res.data.totalin
+//     })
+// }
+
+// const getlistGoodsOrder = () =>{
+//     var gotime =  moment(new Date()).format('YYYY-MM-DD 00:00:00')
+//     listGoodsOrder({pageSize:1000,gotime:gotime}).then(res=>{
+//         goods.value = res.rows.length
+//     })
+// }
 
-const getlistGoodsOrder = () =>{
-    var gotime =  moment(new Date()).format('YYYY-MM-DD 00:00:00')
-    listGoodsOrder({pageSize:1000,gotime:gotime}).then(res=>{
-        goods.value = res.rows.length
-    })
+const getlist = () =>{
+  getpassenger1({
+    "start":moment(new Date()).format('YYYY-MM-DD'),
+    "end":moment(new Date()).format('YYYY-MM-DD')
+}).then(res=>{
+  console.log(res)
+  people.value = res.data[0].flowCount.incount;
+  // goods.value = res.data[0].goodsOrderCount.ordercount;
+})
+
+
+cabinetboxstatic().then((res) => {
+    let totalcabinet = 0;
+    let kxcabinet = 0;
+    for (let key in res) {
+      totalcabinet += res[key].total ?? 0;
+      kxcabinet += res[key].unuse ?? 0;
+    }
+    goods.value = totalcabinet-kxcabinet;
+  });
 }
 
 
 onMounted(() => {
-    // getList();
-    getCountDataList();
-    getlistGoodsOrder();
+    getlist();
+
 });
 </script>
 <style scoped lang="scss">

+ 2 - 0
src/components/Public/table.vue

@@ -51,6 +51,8 @@
 </template>
 
 <script setup lang="ts">
+import { de } from 'element-plus/es/locale';
+
 const { proxy } = getCurrentInstance() as ComponentInternalInstance
 const { energy_type, business_type, tbl_car_type } = toRefs<any>(proxy?.useDict("energy_type", "business_type", "tbl_car_type"));
 

+ 2 - 1
src/views/car/work/schedule.vue

@@ -206,7 +206,7 @@ const getcarInfoList = async () => {
 }
 
 const getScheduleData = () => {
-  console.log(1111111111111111111111)
+  // console.log(1111111111111111111111)
   var year = new Date().getFullYear();
   var obj = {
     starttime: year + "-01-01",
@@ -323,6 +323,7 @@ const getList = async () => {
   carScheduleList.value = res.rows;
   total.value = res.total;
   loading.value = false;
+   table.value.setDataList(res.rows);
 }
 
 const changeCarNum = (val) => {

+ 1 - 1
src/views/yunying/scheduling/index.vue

@@ -390,7 +390,7 @@ const getScheduleList = async () => {
         }
     })
     //测试用
-    // carScheduleList.value = res.rows;
+    carScheduleList.value = res.rows;
     reloadData.value = true
 }