lxf 1 year ago
parent
commit
3f067da099
1 changed files with 21 additions and 9 deletions
  1. 21 9
      src/views/group/data-board/daily-board/index.vue

+ 21 - 9
src/views/group/data-board/daily-board/index.vue

@@ -1,9 +1,16 @@
 <template>
   <div class="box-card">
     <el-card>
-      <el-form :model="beginTime" :inline="true" @submit.native.prevent>
+      <el-form :model="timeList" :inline="true" @submit.native.prevent>
         <el-form-item label="日期:">
-          <el-date-picker v-model="beginTime" type="date" placeholder="请选择日期" value-format="YYYY-MM-DD" @change="changeTime" />
+          <el-date-picker
+            v-model="timeList"
+            type="daterange"
+            range-separator="To"
+            start-placeholder="Start date"
+            end-placeholder="End date"
+            value-format="YYYY-MM-DD"
+            @change="changeTime" />
         </el-form-item>
       </el-form>
     </el-card>
@@ -339,7 +346,7 @@ import moment from "moment";
 import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
-const beginTime = ref(moment().format("yyyy-MM-DD"));
+const timeList = ref([moment().format("yyyy-MM-DD"), moment().format("yyyy-MM-DD")]);
 const topLeft = ref(false);
 const topCenter = ref(false);
 const topRight = ref(false);
@@ -386,15 +393,16 @@ const BCData = ref({
   outStorageBomList: [],
 });
 const changeTime = () => {
-  if (beginTime.value) {
+  if (timeList.value && timeList.value.length == 2) {
     getList();
   } else {
     ElMessage("请选择日期");
   }
 };
 const getList = () => {
+  TLData.value = {};
   topLeft.value = true;
-  proxy.post("/dailyBoard/getProductionOutStorageList", { beginTime: beginTime.value }).then(
+  proxy.post("/dailyBoard/getProductionOutStorageList", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
     (res) => {
       if (res && res.length > 0) {
         res.map(function (item) {
@@ -414,8 +422,9 @@ const getList = () => {
       topLeft.value = false;
     }
   );
+  TCData.value = {};
   topCenter.value = true;
-  proxy.post("/dailyBoard/getOrderBomDifferenceList", { beginTime: beginTime.value }).then(
+  proxy.post("/dailyBoard/getOrderBomDifferenceList", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
     (res) => {
       if (res && res.length > 0) {
         res.map(function (item) {
@@ -435,8 +444,9 @@ const getList = () => {
       topCenter.value = false;
     }
   );
+  CLData.value = {};
   centerLeft.value = true;
-  proxy.post("/dailyBoard/getWlnSalesOutStorageInfo", { beginTime: beginTime.value }).then(
+  proxy.post("/dailyBoard/getWlnSalesOutStorageInfo", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
     (res) => {
       CLData.value = res;
       centerLeft.value = false;
@@ -446,8 +456,9 @@ const getList = () => {
       centerLeft.value = false;
     }
   );
+  CRData.value = {};
   centerRight.value = true;
-  proxy.post("/dailyBoard/getMesProductionOutStorageInfo", { beginTime: beginTime.value }).then(
+  proxy.post("/dailyBoard/getMesProductionOutStorageInfo", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
     (res) => {
       CRData.value = res;
       centerRight.value = false;
@@ -457,8 +468,9 @@ const getList = () => {
       centerRight.value = false;
     }
   );
+  BCData.value = {};
   bottomCenter.value = true;
-  proxy.post("/dailyBoard/getSelfOrderOutStorageInfo", { beginTime: beginTime.value }).then(
+  proxy.post("/dailyBoard/getSelfOrderOutStorageInfo", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
     (res) => {
       BCData.value = res;
       bottomCenter.value = false;