Browse Source

新增了调度页面

hzj18279462576@163.com 3 years ago
parent
commit
0f3591f500

BIN
dist.zip


BIN
src/assets/busquery.png


BIN
src/assets/busqueryA.png


+ 6 - 1
src/layout/index.vue

@@ -55,6 +55,10 @@ watch(
       store.commit("indexUp", 7);
       sessionStorage.setItem("sidevarItem", 7);
     }
+    if (newValue == "/schoolBus/busquery") {
+      store.commit("indexUp", 9);
+      sessionStorage.setItem("sidevarItem", 9);
+    }
     if (newValue == "/schoolBus/news") {
       store.commit("indexUp", 0);
       sessionStorage.setItem("sidevarItem", 0);
@@ -154,7 +158,8 @@ onBeforeMount(async () => {
   display: flex;
   .content {
     // min-width: 1740px;
-    max-width: calc(100vw - 200px);
+    max-width: calc(100vw - 81px);
+    min-width: calc(100vw - 200px);
     width: 100%;
     height: calc(100vh);
     background-color: rgba(238, 238, 238, 1);

+ 20 - 1
src/layout/sidebar/SidevarItem.vue

@@ -14,7 +14,21 @@
           ><img src="@/assets/logo.png" style="width: 30px; height: 24px"
         /></el-icon>
       </div>
-
+      <el-menu-item :index="9">
+        <img
+          v-if="activeIndex == 9"
+          src="@/assets/busqueryA.png"
+          alt=""
+          style="width: 22px; height: 22px; margin: 0 18px"
+        />
+        <img
+          v-else
+          src="@/assets/busquery.png "
+          alt=""
+          style="width: 22px; height: 22px; margin: 0 18px"
+        />
+        <span>车辆调度</span>
+      </el-menu-item>
       <el-menu-item :index="1">
         <img v-if="activeIndex == 1" src="@/assets/statementA.png" alt="" />
         <img v-else src="@/assets/statement.png " alt="" />
@@ -140,6 +154,11 @@ const handleSelect = (key, keyPath) => {
       path: `/schoolBus/blacklist`,
     });
   }
+  if (activeIndex.value == 9) {
+    router.push({
+      path: `/schoolBus/busquery`,
+    });
+  }
   if (activeIndex.value == 0) {
     router.push({
       path: `/schoolBus/news`,

+ 5 - 5
src/router/index.js

@@ -60,11 +60,11 @@ const router = createRouter({
                     component: () => import("@/views/waiting/waiting.vue"),
                     meta: { title: "Dashboard", icon: "dashboard" },
                 },
-                // {
-                //     path: "busquery",
-                //     component: () => import("@/views/busquery/busquery.vue"),
-                //     meta: { title: "Dashboard", icon: "dashboard" },
-                // },
+                {
+                    path: "busquery",
+                    component: () => import("@/views/busquery/busquery.vue"),
+                    meta: { title: "Dashboard", icon: "dashboard" },
+                },
             ],
         },
         

+ 20 - 16
src/views/account/account.vue

@@ -86,12 +86,7 @@
         />
         <el-table-column align="center" prop="name" label="姓名" />
         <el-table-column align="center" prop="number" label="账号" />
-        <el-table-column
-          align="center"
-          prop="create_time"
-          label="创建时间"
-          width="250"
-        />
+        <el-table-column align="center" prop="create_time" label="创建时间" />
 
         <el-table-column align="center" label="操作" width="220">
           <template #default="scope">
@@ -330,14 +325,23 @@ const importExcel = async () => {
   });
   // console.log(res, "导出账号");
   if (res.data.code == 200) {
-    const elt = document.createElement("a");
-    elt.setAttribute(
-      "href",
-      "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
-    );
-    elt.setAttribute("download", "file.png");
-    elt.style.display = "none";
-    document.body.appendChild(elt);
+    // const elt = document.createElement("a");
+    // elt.setAttribute(
+    //   "href",
+    //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
+    // );
+    // // elt.setAttribute("download", "file.xlsx");
+    // // elt.style.display = "none";
+    // document.body.appendChild(elt);
+    var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
+    console.log("获得地址数据:", downloadPath);
+    var downloadLink = document.createElement("a");
+    downloadLink.style.display = "none"; // 使其隐藏
+    downloadLink.href = downloadPath;
+    downloadLink.download = "";
+    downloadLink.click();
+    document.body.appendChild(downloadLink);
+    document.body.removeChild(downloadLink);
     elt.click();
     ElMessage({
       type: "success",
@@ -623,7 +627,7 @@ onUnmounted(() => {
   .footer {
     width: 96%;
     height: 550px;
-    margin: 10px auto 30px;
+    margin: 10px auto 10px;
     .el-table--fit {
       height: 100%;
       :deep(.el-table__header-wrapper) {
@@ -684,7 +688,7 @@ onUnmounted(() => {
   .el-pagination {
     // width: 1600px;
     width: 96%;
-    margin: 0 auto 18px;
+    margin: 20px auto 18px;
     justify-content: flex-end;
     :deep(.el-pagination__total) {
       color: #000;

+ 20 - 23
src/views/bus/bus.vue

@@ -91,12 +91,7 @@
           width="200"
         />
 
-        <el-table-column
-          align="center"
-          prop="create_time"
-          label="创建时间"
-          width="250"
-        />
+        <el-table-column align="center" prop="create_time" label="创建时间" />
 
         <el-table-column align="center" label="操作" width="220">
           <template #default="scope">
@@ -231,14 +226,7 @@ const ruleForm = reactive({
 });
 // 表单验证
 const rules = reactive({
-  serial: [
-    { required: true, message: "序列号不能为空", trigger: "blur" },
-    // {
-    //   pattern: /^[A-Za-z0-9]$/,
-    //   message: "请输入正确序列号",
-    //   trigger: "blur",
-    // },
-  ],
+  // serial: [{ required: true, message: "序列号不能为空", trigger: "blur" }],
   buslicence: [
     { required: true, message: "请输入车牌号", trigger: "blur" },
     {
@@ -501,15 +489,24 @@ const importExcel = async () => {
   });
   // console.log(res, "导出账号");
   if (res.data.code == 200) {
-    const elt = document.createElement("a");
-    elt.setAttribute(
-      "href",
-      "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
-    );
-    elt.setAttribute("download", "file.png");
-    elt.style.display = "none";
-    document.body.appendChild(elt);
-    elt.click();
+    // const elt = document.createElement("a");
+    // elt.setAttribute(
+    //   "href",
+    //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
+    // );
+    // elt.setAttribute("download", "file.png");
+    // elt.style.display = "none";
+    // document.body.appendChild(elt);
+    // elt.click();
+    var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
+    console.log("获得地址数据:", downloadPath);
+    var downloadLink = document.createElement("a");
+    downloadLink.style.display = "none"; // 使其隐藏
+    downloadLink.href = downloadPath;
+    downloadLink.download = "";
+    downloadLink.click();
+    document.body.appendChild(downloadLink);
+    document.body.removeChild(downloadLink);
     ElMessage({
       type: "success",
       showClose: true,

+ 174 - 424
src/views/busquery/busquery.vue

@@ -2,97 +2,7 @@
   <div class="content-box">
     <div class="left">
       <!-- <el-icon :size="23" class="camera"><UserFilled /></el-icon> -->
-      <span class="cameratxt">报表统计</span>
-    </div>
-    <div class="middle" v-if="footerMenuIndex == 1">
-      <div class="filter">
-        <div class="condition">
-          <span>车牌号 : </span>
-          <el-input
-            clearable
-            v-model="searchInput.car_number"
-            class="w-50 m-2"
-            placeholder="请输入车牌号"
-            style="width: 150px"
-          />
-        </div>
-        <div class="condition">
-          <span>汇总日期 : </span>
-          <!-- <el-date-picker
-              v-model="searchData.input5"
-              type="datetimerange"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              format="YYYY-MM-DD HH:mm:ss"
-              value-format="YYYY-MM-DD HH:mm:ss"
-            /> -->
-          <el-date-picker
-            v-model="searchInput.yy_date"
-            type="date"
-            placeholder="请选择日期"
-            format="YYYY-MM-DD"
-            value-format="YYYY-MM-DD"
-          />
-        </div>
-        <div class="condition">
-          <span>状态 : </span>
-          <el-select
-            v-model="searchInput.state"
-            class="m-2"
-            placeholder="请选择职位"
-          >
-            <el-option label="预约成功" value="1" />
-            <el-option label="已乘车" value="2" />
-            <el-option label="候补中" value="3" />
-            <el-option label="已取消" value="4" />
-          </el-select>
-        </div>
-
-        <el-button
-          style="margin-left: 20px"
-          color="rgba(61, 81, 232, 1)"
-          type="primary"
-          class="search"
-          @click="search"
-          ><el-icon><Search /></el-icon><span>搜索</span></el-button
-        >
-        <el-button
-          style="margin-left: 20px"
-          color="rgba(61, 81, 232, 1)"
-          type="primary"
-          class="search"
-          @click="resetInput"
-          ><el-icon><Search /></el-icon><span>重置</span></el-button
-        >
-      </div>
-      <el-button
-        color="rgba(61, 81, 232, 1)"
-        class="import"
-        type="primary"
-        @click="downLoad"
-        ><img
-          src="@/assets/import.png"
-          style="width: 14px; height: 14px; margin-right: 4px"
-          alt=""
-        />
-        <span>导出表单</span></el-button
-      >
-    </div>
-    <div class="footerMenu">
-      <div
-        class="menuList"
-        @click="collectMenu"
-        :class="footerMenuIndex == 0 ? 'menuListActive' : ''"
-      >
-        汇总
-      </div>
-      <div
-        class="menuList"
-        @click="detailMenu"
-        :class="footerMenuIndex == 1 ? 'menuListActive' : ''"
-      >
-        明细列表
-      </div>
+      <span class="cameratxt">车辆调度</span>
     </div>
     <!-- 候补派车 -->
     <el-dialog
@@ -115,6 +25,18 @@
         label-position="left"
         status-icon
       >
+        <el-form-item
+          label="发车时间 :"
+          prop="ci_time"
+          v-if="ruleForm.state != 3"
+        >
+          <el-time-picker
+            v-model="ruleForm.ci_time"
+            placeholder="请选择时间"
+            format="HH:mm"
+            value-format="HH:mm"
+          />
+        </el-form-item>
         <el-form-item label="车牌 :" prop="busname">
           <el-select-v2
             validate-event
@@ -178,30 +100,29 @@
         </el-form-item>
       </el-form>
     </el-dialog>
-    <div class="MingXi" v-if="footerMenuIndex == 0">
-      <div class="footer mingxi">
+    <div class="MingXi" style="height: 652px; margin: 10px 0 20px 0">
+      <div class="footer">
         <el-table
           :row-class-name="tableRowClassName"
           :data="tableData.list"
-          style="width: 100%; height: 550px"
+          style="width: 100%; height: 630px"
           :header-cell-style="{
             background: 'rgba(240, 243, 247, 1)',
             border: 0,
           }"
           @selection-change="handleSelectionChange"
         >
-          <!-- <el-table-column align="center" type="selection" width="80" /> -->
           <el-table-column
             align="center"
-            width="250"
-            prop="yy_date"
-            label="创建时间"
+            width="150"
+            prop="s_date"
+            label="发车日期"
           />
           <el-table-column
             align="center"
+            width="150"
             prop="ci_time"
             label="发车时间"
-            width="100"
           />
           <el-table-column
             align="center"
@@ -211,167 +132,67 @@
           />
           <el-table-column
             align="center"
-            prop="by_num"
-            width="120"
+            width="100"
+            prop="yy_num"
             label="乘车人数"
           />
-          <el-table-column align="center" prop="car_number" label="车牌号" />
-          <el-table-column align="center" prop="contain" label="容量" />
-          <el-table-column align="center" label="状态">
-            <template #default="scope">
-              <div
-                v-if="scope.row.state == '已乘车'"
-                style="color: rgba(67, 207, 124, 1)"
-              >
-                {{ scope.row.state }}
-              </div>
-              <div
-                v-if="scope.row.state == '候补'"
-                style="color: rgba(212, 48, 48, 1)"
-              >
-                {{ scope.row.state }}
-              </div>
-              <div
-                v-if="scope.row.state == '已分配'"
-                style="color: rgba(61, 81, 232, 1)"
-              >
-                {{ scope.row.state }}
-              </div>
-              <div
-                v-if="scope.row.state == '已通行'"
-                style="color: rgba(77, 77, 77, 1)"
-              >
-                {{ scope.row.state }}
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="操作">
-            <template #default="scope">
-              <el-button link type="primary" @click="info(scope.row)"
-                ><div class="look">详情</div></el-button
-              >
-              <el-button
-                v-if="scope.row.state == '候补'"
-                link
-                type="primary"
-                @click="sendBus(scope.row)"
-                ><div class="look">派车</div></el-button
-              >
-              <!-- <el-button
-                  v-if="scope.row.state == '已乘车'"
-                  link
-                  type="primary"
-                  @click="sendBus(scope.row)"
-                  ><div class="look">派车</div></el-button
-                > -->
-            </template>
-          </el-table-column>
-          <!-- <template #empty>
-              <div
-                style="width: 100%; height:520px;display: flex; flex-direction: column;     justify-        
-          content: center;align-items: center"
-              >
-                <img
-                  style="width: 100%; height: 400px"
-                  src="@/assets/nodata.png"
-                  alt=""
-                />
-                <div>暂无数据</div>
-              </div>
-            </template> -->
-        </el-table>
-      </div>
-      <el-pagination
-        background
-        v-model:page-size="pageSize"
-        v-model:current-page="currentPage"
-        layout="total, prev, pager, next, jumper"
-        :total="total"
-        @current-change="handleCurrentChange"
-      />
-    </div>
-    <div class="MingXi" v-else-if="footerMenuIndex == 1">
-      <div class="footer">
-        <el-table
-          :row-class-name="tableRowClassName"
-          :data="tableData.list2"
-          style="width: 100%; height: 550px"
-          :header-cell-style="{
-            background: 'rgba(240, 243, 247, 1)',
-            border: 0,
-          }"
-          @selection-change="handleSelectionChange"
-        >
           <el-table-column
             align="center"
-            width="250"
-            prop="yy_time"
-            label="下单时间"
-          />
-          <el-table-column align="center" prop="ci_time" label="发车时间" />
-          <el-table-column align="center" prop="user_name" label="预约人" />
-          <el-table-column align="center" prop="user_zz" label="身份" />
-          <el-table-column
-            align="center"
-            width="150"
-            prop="user_phone"
-            label="手机号码"
-          />
-
-          <el-table-column
-            width="150"
-            align="center"
+            width="120"
             prop="car_number"
             label="车牌号"
           />
-          <el-table-column align="center" prop="contain" label="容量" />
-
           <el-table-column
             align="center"
-            prop="remark"
-            width="450"
-            label="变更信息"
+            width="100"
+            prop="contain"
+            label="容量"
           />
 
+          <el-table-column align="center" prop="route" label="路线" />
+          <el-table-column align="center" prop="route_end" label="终点" />
+
           <el-table-column
             align="center"
-            width="200"
-            prop="by_time"
-            label="通行时间"
-          />
-          <el-table-column align="center" label="状态" width="150">
+            prop="before_state"
+            width="100"
+            label="是否提前"
+          >
             <template #default="scope">
-              <div v-if="scope.row.state == 1" style="color: blue">
-                预约成功
-              </div>
+              <div>{{ scope.row.before_state == 1 ? "是" : "否" }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="状态" width="120">
+            <template #default="scope">
+              <div v-if="scope.row.state == 1" style="color: blue">预约中</div>
               <div
                 v-if="scope.row.state == 2"
                 style="color: rgba(67, 207, 124, 1)"
               >
-                已乘车
+                已截止
               </div>
               <div v-if="scope.row.state == 3" style="color: red">候补中</div>
-              <div v-if="scope.row.state == 4" style="color: #ccc">已取消</div>
+              <div v-if="scope.row.state == 4" style="color: #ccc">已分车</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="操作" width="120">
+            <template #default="scope">
+              <el-button link type="primary" @click="sendBus(scope.row)"
+                ><div class="look">调度</div></el-button
+              >
             </template>
           </el-table-column>
-          <!-- <el-table-column align="center" label="操作">
-              <template #default="scope">
-                <el-button link type="primary" @click="look(scope.row)"
-                  ><div class="look">查看</div></el-button
-                >
-              </template>
-            </el-table-column> -->
         </el-table>
       </div>
-      <el-pagination
-        background
-        v-model:page-size="pageSize2"
-        v-model:current-page="currentPage2"
-        layout="total, prev, pager, next, jumper"
-        :total="total2"
-        @current-change="handleCurrentChange2"
-      />
     </div>
+    <el-pagination
+      background
+      v-model:page-size="pageSize"
+      v-model:current-page="currentPage"
+      layout="total, prev, pager, next, jumper"
+      :total="total"
+      @current-change="handleCurrentChange"
+    />
   </div>
 </template>
 
@@ -403,10 +224,9 @@ const endNum = reactive({ list: [] }); // 终点站
 // 表格数据
 const tableData = reactive({
   list: [], //汇总数据
-  list2: [], //明细列表数据
 });
 
-const dialongTitle = ref("候补派车"); // 弹窗标题
+const dialongTitle = ref("车辆调度"); // 弹窗标题
 const centerDialogVisible = ref(false); // 候补弹窗显示
 const initials = reactive({
   list: [],
@@ -418,17 +238,11 @@ const options = ref(
   }))
 ); //候补弹窗多选车牌号逻辑
 
-// 汇总
-const pageSize = ref(10);
+const pageSize = ref(12);
 const currentPage = ref(1); // 当前页
 const total = ref(10); // 当前总数
 const selectData = reactive({ list: [] }); // 多选框选择的数据
-// 明细列表
-const pageSize2 = ref(10);
-const currentPage2 = ref(1); // 当前页
-const total2 = ref(10); // 当前总数
 
-const footerMenuIndex = ref(0); // 控制汇总和明细列表
 // 表单数据
 const formSize = ref("default");
 const ruleFormRef = ref();
@@ -438,9 +252,19 @@ const ruleForm = reactive({
   volume: "",
   route: "黄家湖校区-墨轩湖校区",
   destination: "",
+  ci_time: "",
+  state: "",
+  id: "",
 });
 // 表单验证
 const rules = reactive({
+  ci_time: [
+    {
+      required: true,
+      message: "时间不能为空",
+      trigger: "blur",
+    },
+  ],
   busname: [
     {
       required: true,
@@ -478,43 +302,34 @@ const rules = reactive({
 
 // 获取数据列表
 const getList = async () => {
-  if (footerMenuIndex.value == 0) {
+  {
     let data = new FormData();
-    // if (searchInput.createTime == null) {
-    //   searchInput.createTime = "";
-    // }
-    // data.set("name", searchInput.name);
-    // data.set("create_time", searchInput.createTime); //前面的key记得对应!
-    // data.set("page", currentPage.value);
-    // data.set("rows", pageSize.value); //前面的key记得对应!
+    let time = dayjs().format("YYYY-MM-DD");
+    data.set("date", time);
     let res = await axios({
       method: "post",
-      url: api.value + "/carBook/brecqueryT.action",
+      url: api.value + "/carBook/schequeryYlist.action",
       headers: {
         token: sessionStorage.getItem("token"),
       },
       data: data,
     });
     console.log(res);
-    if (res.status == 200) {
-      // ElMessage({
-      //   type: "success",
-      //   showClose: true,
-      //   message: res.data.message,
-      //   center: true,
-      // });
 
+    if (res.status == 200) {
+      // if (message) {
+      //   ElMessage({
+      //     type: "success",
+      //     showClose: true,
+      //     message: message,
+      //     center: true,
+      //   });
+      // }
       tableData.list = res.data.data;
       // currentPage.value = res.data.currentPage;
-      console.log(res.data);
-
-      if (res.data.code == 205) {
-        total.value = 0;
-      } else {
-        total.value = res.data.data.length;
-      }
+      total.value = res.data.total;
     } else {
-      tableData.list2 = res.data.rows;
+      tableData.list = res.data.rows;
       currentPage.value = 1;
       total.value = res.data.total;
       ElMessage({
@@ -529,65 +344,13 @@ const getList = async () => {
         });
       }
     }
-  } else if (footerMenuIndex.value == 1) {
-    let data = new FormData();
-    // if (searchInput.createTime == null) {
-    //   searchInput.createTime = "";
-    // }
-    if (searchInput.car_number) {
-      data.set("car_number", searchInput.car_number);
-    }
-    data.set("state", searchInput.state);
-    data.set("yy_date", searchInput.yy_date);
-    data.set("page", currentPage2.value);
-    data.set("rows", pageSize2.value); //前面的key记得对应!
-    let res = await axios({
-      method: "post",
-      url: api.value + "/carBook/brecblist.action",
-      headers: {
-        token: sessionStorage.getItem("token"),
-      },
-      data: data,
-    });
-    console.log(res);
-    if (res.status == 200) {
-      // ElMessage({
-      //   type: "success",
-      //   showClose: true,
-      //   message: res.data.message,
-      //   center: true,
-      // });
-      tableData.list2 = res.data.rows;
-      if (res.data.currentPage) {
-        currentPage2.value = res.data.currentPage;
-      } else {
-        currentPage2.value = 1;
-      }
-
-      total2.value = res.data.total;
-    } else {
-      tableData.list2 = res.data.rows;
-      currentPage2.value = 1;
-      total2.value = res.data.total;
-      ElMessage({
-        type: "error",
-        showClose: true,
-        message: res.data.message,
-        center: true,
-      });
-      if (res.data.message == "token错误") {
-        router.push({
-          path: `/login`,
-        });
-      }
-    }
   }
 };
 
 // 搜索按钮
-const search = lodash.debounce(() => {
-  getList();
-}, 300);
+// const search = lodash.debounce(() => {
+//   getList();
+// }, 300);
 // 重置搜索框
 const resetInput = lodash.debounce(() => {
   searchInput.state = "";
@@ -601,32 +364,13 @@ const handleSelectionChange = (val) => {
   selectData.list = val;
 };
 
-// 汇总按钮
-const collectMenu = () => {
-  footerMenuIndex.value = 0;
-  searchInput.yy_date = "";
-  searchInput.car_number = "";
-  searchInput.state = "";
-  getList();
-};
-//明细列表按钮
-const detailMenu = () => {
-  footerMenuIndex.value = 1;
-  getList();
-};
-
-// 详情按钮
-const info = (row) => {
-  console.log(row);
-  searchInput.yy_date = row.yy_date;
-  searchInput.car_number = row.car_number;
-  footerMenuIndex.value = 1;
-  getList();
-};
 // 派车按钮
 const sendBus = (row) => {
   console.log(row);
   centerDialogVisible.value = true;
+  ruleForm.id = row.id;
+  ruleForm.state = row.state;
+  ruleForm.ci_time = row.ci_time;
 };
 // 派车弹窗关闭
 const editClose = () => {
@@ -638,40 +382,41 @@ const submitAdd = async (formEl) => {
   if (!formEl) return;
   await formEl.validate(async (valid, fields) => {
     if (valid) {
-      if (dialongTitle.value == "候补派车") {
-        let data = new FormData();
-        data.set("car_number", ruleForm.busname.join(",f"));
-        data.set("route", ruleForm.route); //前面的key记得对应!
-        data.set("contain", ruleForm.volume);
-        data.set("route_end", ruleForm.destination); //前面的key记得对应!
-        let res = await axios({
-          method: "post",
-          url: api.value + "/carBook/brecfen.action",
-          headers: {
-            token: sessionStorage.getItem("token"),
-          },
-          data: data,
+      let data = {
+        car_number: ruleForm.busname.join(",f"),
+        route: ruleForm.route,
+        contain: ruleForm.volume,
+        route_end: ruleForm.destination,
+        ci_time: ruleForm.ci_time,
+        id: ruleForm.id,
+      };
+      let res = await axios({
+        method: "post",
+        url: api.value + "/carBook/scheupdate.action",
+        headers: {
+          "Content-Type": "application/json;charset=utf-8",
+          token: sessionStorage.getItem("token"),
+        },
+        data: data,
+      });
+      // console.log(res, "添加账号");
+      if (res.data.code == 200) {
+        getList();
+        ElMessage({
+          type: "success",
+          showClose: true,
+          message: res.data.message,
+          center: true,
         });
-        // console.log(res, "添加账号");
-        if (res.data.code == 200) {
-          getList();
-          ElMessage({
-            type: "success",
-            showClose: true,
-            message: res.data.message,
-            center: true,
-          });
-          addDialogVisible.value = false;
-          ruleFormRef.value.resetFields();
-        } else {
-          ElMessage({
-            type: "error",
-            showClose: true,
-            message: res.data.message,
-            center: true,
-          });
-        }
+        addDialogVisible.value = false;
+        ruleFormRef.value.resetFields();
       } else {
+        ElMessage({
+          type: "error",
+          showClose: true,
+          message: res.data.message,
+          center: true,
+        });
       }
     } else {
       console.log("error submit!", fields);
@@ -680,47 +425,56 @@ const submitAdd = async (formEl) => {
 };
 
 // 导出按钮
-const downLoad = lodash.debounce(async () => {
-  let data = new FormData();
-  if (searchInput.car_number) {
-    data.set("car_number", searchInput.car_number);
-  }
-  data.set("state", searchInput.state);
-  data.set("yy_date", searchInput.yy_date);
-  let res = await axios({
-    method: "post",
-    url: api.value + "/carBook/brectoExcel.action",
-    headers: {
-      token: sessionStorage.getItem("token"),
-    },
-    data: data,
-  });
-  console.log(res);
-  if (res.status == 200) {
-    const elt = document.createElement("a");
-    elt.setAttribute(
-      "href",
-      "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
-    );
-    elt.setAttribute("download", "file.png");
-    elt.style.display = "none";
-    document.body.appendChild(elt);
-    elt.click();
-    ElMessage({
-      type: "success",
-      showClose: true,
-      message: res.data.message,
-      center: true,
-    });
-  } else {
-    ElMessage({
-      type: "error",
-      showClose: true,
-      message: res.data.message,
-      center: true,
-    });
-  }
-}, 300);
+// const downLoad = lodash.debounce(async () => {
+//   let data = new FormData();
+//   if (searchInput.car_number) {
+//     data.set("car_number", searchInput.car_number);
+//   }
+//   data.set("state", searchInput.state);
+//   data.set("yy_date", searchInput.yy_date);
+//   let res = await axios({
+//     method: "post",
+//     url: api.value + "/carBook/brectoExcel.action",
+//     headers: {
+//       token: sessionStorage.getItem("token"),
+//     },
+//     data: data,
+//   });
+//   console.log(res);
+//   if (res.status == 200) {
+//     // const elt = document.createElement("a");
+//     // elt.setAttribute(
+//     //   "href",
+//     //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
+//     // );
+//     // elt.setAttribute("download", "file.png");
+//     // elt.style.display = "none";
+//     // document.body.appendChild(elt);
+//     // elt.click();
+//     var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
+//     console.log("获得地址数据:", downloadPath);
+//     var downloadLink = document.createElement("a");
+//     downloadLink.style.display = "none"; // 使其隐藏
+//     downloadLink.href = downloadPath;
+//     downloadLink.download = "";
+//     downloadLink.click();
+//     document.body.appendChild(downloadLink);
+//     document.body.removeChild(downloadLink);
+//     ElMessage({
+//       type: "success",
+//       showClose: true,
+//       message: res.data.message,
+//       center: true,
+//     });
+//   } else {
+//     ElMessage({
+//       type: "error",
+//       showClose: true,
+//       message: res.data.message,
+//       center: true,
+//     });
+//   }
+// }, 300);
 
 // 表格斑马纹颜色修改
 const tableRowClassName = ({ row, rowIndex }) => {
@@ -735,11 +489,6 @@ const tableRowClassName = ({ row, rowIndex }) => {
 const handleCurrentChange = (value) => {
   currentPage.value = value;
 };
-// 分页
-const handleCurrentChange2 = (value) => {
-  console.log(value);
-  currentPage2.value = value;
-};
 // 监控派车弹窗选择车牌时容量发生变化
 watch(
   () => ruleForm.busname,
@@ -761,7 +510,8 @@ onBeforeMount(() => {
   api.value = store.state.user.api;
   pathNum.list = JSON.parse(sessionStorage.getItem("pathSelect"));
   busNum.list = JSON.parse(sessionStorage.getItem("busSelect"));
-  pathNum.list.forEach((item) => {
+  let route_endSelect = JSON.parse(sessionStorage.getItem("route_endSelect"));
+  route_endSelect.forEach((item) => {
     endNum.list.push(item.route_end);
   });
   busNum.list.forEach((item) => {

+ 4 - 1
src/views/classes/classes.vue

@@ -769,7 +769,10 @@ watch(
         return item.car_number == newValue;
       });
       console.log(arr);
-      ruleFormBus.contain = arr[0].contain;
+      if (arr == []) {
+      } else {
+        ruleFormBus.contain = arr[0].contain;
+      }
     }
   }
 );

+ 21 - 22
src/views/staff/staff.vue

@@ -89,7 +89,7 @@
         <!-- <el-table-column align="center" type="selection" width="80" /> -->
         <el-table-column
           type="index"
-          width="80"
+          width="100"
           align="center"
           label="序号"
           index="1"
@@ -101,18 +101,8 @@
           label="职位"
           width="200"
         />
-        <el-table-column
-          align="center"
-          prop="user_phone"
-          label="电话号码"
-          width="200"
-        />
-        <el-table-column
-          align="center"
-          prop="create_time"
-          label="创建时间"
-          width="250"
-        />
+        <el-table-column align="center" prop="user_phone" label="电话号码" />
+        <el-table-column align="center" prop="create_time" label="创建时间" />
 
         <el-table-column align="center" label="操作" width="220">
           <template #default="scope">
@@ -536,15 +526,24 @@ const importExcel = async () => {
   });
   // console.log(res, "导出账号");
   if (res.data.code == 200) {
-    const elt = document.createElement("a");
-    elt.setAttribute(
-      "href",
-      "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
-    );
-    elt.setAttribute("download", "file.png");
-    elt.style.display = "none";
-    document.body.appendChild(elt);
-    elt.click();
+    // const elt = document.createElement("a");
+    // elt.setAttribute(
+    //   "href",
+    //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
+    // );
+    // // elt.setAttribute("download", "file.xlsx");
+    // // elt.style.display = "none";
+    // document.body.appendChild(elt);
+    // elt.click();
+    var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
+    console.log("获得地址数据:", downloadPath);
+    var downloadLink = document.createElement("a");
+    downloadLink.style.display = "none"; // 使其隐藏
+    downloadLink.href = downloadPath;
+    downloadLink.download = "";
+    downloadLink.click();
+    document.body.appendChild(downloadLink);
+    document.body.removeChild(downloadLink);
     ElMessage({
       type: "success",
       showClose: true,

+ 155 - 56
src/views/statement/statement.vue

@@ -4,6 +4,82 @@
       <!-- <el-icon :size="23" class="camera"><UserFilled /></el-icon> -->
       <span class="cameratxt">报表统计</span>
     </div>
+    <!-- 汇总搜索框 -->
+    <div class="middle" v-if="footerMenuIndex == 0">
+      <div class="filter">
+        <div class="condition">
+          <span>车牌号 : </span>
+          <el-input
+            clearable
+            v-model="searchInputHZ.car_number"
+            class="w-50 m-2"
+            placeholder="请输入车牌号"
+            style="width: 150px"
+          />
+        </div>
+        <div class="condition">
+          <span>汇总日期 : </span>
+          <!-- <el-date-picker
+            v-model="searchData.input5"
+            type="datetimerange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="YYYY-MM-DD HH:mm:ss"
+            value-format="YYYY-MM-DD HH:mm:ss"
+          /> -->
+          <el-date-picker
+            v-model="searchInputHZ.date"
+            type="date"
+            placeholder="请选择日期"
+            format="YYYY-MM-DD"
+            value-format="YYYY-MM-DD"
+          />
+        </div>
+        <div class="condition">
+          <span>状态 : </span>
+          <el-select
+            v-model="searchInputHZ.state"
+            class="m-2"
+            placeholder="请选择状态"
+          >
+            <el-option label="预约中" value="1" />
+            <el-option label="已截止" value="2" />
+            <el-option label="候补中" value="3" />
+            <el-option label="已分车" value="4" />
+          </el-select>
+        </div>
+
+        <el-button
+          style="margin-left: 20px"
+          color="rgba(61, 81, 232, 1)"
+          type="primary"
+          class="search"
+          @click="searchHZ"
+          ><el-icon><Search /></el-icon><span>搜索</span></el-button
+        >
+        <el-button
+          style="margin-left: 20px"
+          color="rgba(61, 81, 232, 1)"
+          type="primary"
+          class="search"
+          @click="resetInputHZ"
+          ><el-icon><Search /></el-icon><span>重置</span></el-button
+        >
+      </div>
+      <!-- <el-button
+        color="rgba(61, 81, 232, 1)"
+        class="import"
+        type="primary"
+        @click="downLoad"
+        ><img
+          src="@/assets/import.png"
+          style="width: 14px; height: 14px; margin-right: 4px"
+          alt=""
+        />
+        <span>导出表单</span></el-button
+      > -->
+    </div>
+    <!-- 明细列表搜索框 -->
     <div class="middle" v-if="footerMenuIndex == 1">
       <div class="filter">
         <div class="condition">
@@ -39,12 +115,12 @@
           <el-select
             v-model="searchInput.state"
             class="m-2"
-            placeholder="请选择职位"
+            placeholder="请选择状态"
           >
             <el-option label="预约成功" value="1" />
-            <el-option label="已乘车" value="2" />
-            <el-option label="候补" value="3" />
-            <el-option label="取消" value="4" />
+            <el-option label="车" value="2" />
+            <el-option label="候补" value="3" />
+            <el-option label="取消" value="4" />
           </el-select>
         </div>
 
@@ -194,7 +270,7 @@
           <el-table-column
             align="center"
             width="250"
-            prop="yy_date"
+            prop="s_date"
             label="创建时间"
           />
           <el-table-column
@@ -220,28 +296,28 @@
           <el-table-column align="center" label="状态">
             <template #default="scope">
               <div
-                v-if="scope.row.state == '已乘车'"
+                v-if="scope.row.state == 1"
                 style="color: rgba(67, 207, 124, 1)"
               >
-                {{ scope.row.state }}
+                预约中
               </div>
               <div
-                v-if="scope.row.state == '候补'"
+                v-if="scope.row.state == 2"
                 style="color: rgba(212, 48, 48, 1)"
               >
-                {{ scope.row.state }}
+                已截止
               </div>
               <div
-                v-if="scope.row.state == '已分配'"
+                v-if="scope.row.state == 3"
                 style="color: rgba(61, 81, 232, 1)"
               >
-                {{ scope.row.state }}
+                候补中
               </div>
               <div
-                v-if="scope.row.state == '已通行'"
+                v-if="scope.row.state == 4"
                 style="color: rgba(77, 77, 77, 1)"
               >
-                {{ scope.row.state }}
+                已分车
               </div>
             </template>
           </el-table-column>
@@ -250,15 +326,8 @@
               <el-button link type="primary" @click="info(scope.row)"
                 ><div class="look">详情</div></el-button
               >
-              <el-button
-                v-if="scope.row.state == '候补'"
-                link
-                type="primary"
-                @click="sendBus(scope.row)"
-                ><div class="look">派车</div></el-button
-              >
               <!-- <el-button
-                v-if="scope.row.state == '已乘车'"
+                v-if="scope.row.state == '候补'"
                 link
                 type="primary"
                 @click="sendBus(scope.row)"
@@ -304,7 +373,7 @@
         >
           <el-table-column
             align="center"
-            width="250"
+            width="200"
             prop="yy_time"
             label="下单时间"
           />
@@ -339,7 +408,7 @@
             prop="by_time"
             label="通行时间"
           />
-          <el-table-column align="center" label="状态" width="150">
+          <el-table-column align="center" label="状态" width="100">
             <template #default="scope">
               <div v-if="scope.row.state == 1" style="color: blue">
                 预约成功
@@ -348,10 +417,10 @@
                 v-if="scope.row.state == 2"
                 style="color: rgba(67, 207, 124, 1)"
               >
-                已乘
+                
               </div>
-              <div v-if="scope.row.state == 3" style="color: red">候补</div>
-              <div v-if="scope.row.state == 4" style="color: #ccc">取消</div>
+              <div v-if="scope.row.state == 3" style="color: red">候补</div>
+              <div v-if="scope.row.state == 4" style="color: #ccc">取消</div>
             </template>
           </el-table-column>
           <!-- <el-table-column align="center" label="操作">
@@ -388,8 +457,15 @@ import adminApi from "@/api/admin.js";
 import { useStore } from "vuex";
 const store = useStore();
 const router = useRouter();
+
+// 汇总搜索框数据
+const searchInputHZ = reactive({
+  state: "",
+  date: "",
+  car_number: "",
+});
 const api = ref("");
-// 搜索框数据
+// 明细列表搜索框数据
 const searchInput = reactive({
   state: "",
   yy_date: "",
@@ -419,7 +495,7 @@ const options = ref(
 ); //候补弹窗多选车牌号逻辑
 
 // 汇总
-const pageSize = ref(10);
+const pageSize = ref(9);
 const currentPage = ref(1); // 当前页
 const total = ref(10); // 当前总数
 const selectData = reactive({ list: [] }); // 多选框选择的数据
@@ -480,16 +556,21 @@ const rules = reactive({
 const getList = async () => {
   if (footerMenuIndex.value == 0) {
     let data = new FormData();
-    // if (searchInput.createTime == null) {
-    //   searchInput.createTime = "";
-    // }
-    // data.set("name", searchInput.name);
-    // data.set("create_time", searchInput.createTime); //前面的key记得对应!
-    // data.set("page", currentPage.value);
-    // data.set("rows", pageSize.value); //前面的key记得对应!
+    if (searchInputHZ.state == "") {
+    } else {
+      data.set("state", searchInputHZ.state);
+    }
+    if (searchInputHZ.date == "") {
+      data.set("date", "");
+    } else {
+      data.set("date", searchInputHZ.date);
+    }
+    data.set("car_number", searchInputHZ.car_number); //前面的key记得对应!
+    data.set("page", currentPage.value);
+    data.set("rows", pageSize.value); //前面的key记得对应!
     let res = await axios({
       method: "post",
-      url: api.value + "/carBook/brecqueryT.action",
+      url: api.value + "/carBook/schelist.action",
       headers: {
         token: sessionStorage.getItem("token"),
       },
@@ -503,16 +584,9 @@ const getList = async () => {
       //   message: res.data.message,
       //   center: true,
       // });
-
-      tableData.list = res.data.data;
+      tableData.list = res.data.rows;
       // currentPage.value = res.data.currentPage;
-      console.log(res.data);
-
-      if (res.data.code == 205) {
-        total.value = 0;
-      } else {
-        total.value = res.data.data.length;
-      }
+      total.value = res.data.total;
     } else {
       tableData.list2 = res.data.rows;
       currentPage.value = 1;
@@ -584,6 +658,18 @@ const getList = async () => {
   }
 };
 
+// 汇总搜索按钮
+const searchHZ = lodash.debounce(() => {
+  getList();
+}, 300);
+// 汇总重置搜索框
+const resetInputHZ = lodash.debounce(() => {
+  searchInputHZ.state = "";
+  searchInputHZ.date = "";
+  searchInputHZ.car_number = "";
+  getList();
+}, 300);
+
 // 搜索按钮
 const search = lodash.debounce(() => {
   getList();
@@ -618,7 +704,7 @@ const detailMenu = () => {
 // 详情按钮
 const info = (row) => {
   console.log(row);
-  searchInput.yy_date = row.yy_date;
+  searchInput.yy_date = row.s_date;
   searchInput.car_number = row.car_number;
   footerMenuIndex.value = 1;
   getList();
@@ -697,15 +783,24 @@ const downLoad = lodash.debounce(async () => {
   });
   console.log(res);
   if (res.status == 200) {
-    const elt = document.createElement("a");
-    elt.setAttribute(
-      "href",
-      "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
-    );
-    elt.setAttribute("download", "file.png");
-    elt.style.display = "none";
-    document.body.appendChild(elt);
-    elt.click();
+    // const elt = document.createElement("a");
+    // elt.setAttribute(
+    //   "href",
+    //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
+    // );
+    // elt.setAttribute("download", "file.png");
+    // elt.style.display = "none";
+    // document.body.appendChild(elt);
+    // elt.click();
+    var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
+    console.log("获得地址数据:", downloadPath);
+    var downloadLink = document.createElement("a");
+    downloadLink.style.display = "none"; // 使其隐藏
+    downloadLink.href = downloadPath;
+    downloadLink.download = "";
+    downloadLink.click();
+    document.body.appendChild(downloadLink);
+    document.body.removeChild(downloadLink);
     ElMessage({
       type: "success",
       showClose: true,
@@ -734,11 +829,13 @@ const tableRowClassName = ({ row, rowIndex }) => {
 // 分页
 const handleCurrentChange = (value) => {
   currentPage.value = value;
+  getList();
 };
 // 分页
 const handleCurrentChange2 = (value) => {
   console.log(value);
   currentPage2.value = value;
+  getList();
 };
 // 监控派车弹窗选择车牌时容量发生变化
 watch(
@@ -761,7 +858,9 @@ onBeforeMount(() => {
   api.value = store.state.user.api;
   pathNum.list = JSON.parse(sessionStorage.getItem("pathSelect"));
   busNum.list = JSON.parse(sessionStorage.getItem("busSelect"));
-  pathNum.list.forEach((item) => {
+  busNum.list = JSON.parse(sessionStorage.getItem("busSelect"));
+  let route_endSelect = JSON.parse(sessionStorage.getItem("route_endSelect"));
+  route_endSelect.forEach((item) => {
     endNum.list.push(item.route_end);
   });
   busNum.list.forEach((item) => {

+ 10 - 9
src/views/waiting/waiting.vue

@@ -25,40 +25,41 @@
           <h3>截止预约时间设置</h3>
           <div>
             <span>正常发车前</span>
-            <!-- <el-input
+            <el-input
               clearable
               v-model="ruleForm.yy_end"
               class="w-50 m-2"
               style="width: 100px"
-            /> -->
-            <el-time-picker
+              @blur="timeUpdata"
+            />
+            <!-- <el-time-picker
               v-model="ruleForm.hh_end"
               format="HH:mm"
               value-format="HH:mm"
               @change="timeUpdata"
-            />
-            <!-- <span>&nbsp;&nbsp;分钟</span> -->
+            /> -->
+            <span>&nbsp;&nbsp;分钟</span>
           </div>
         </div>
         <div class="condition">
           <h3>候补截止预约时间设置</h3>
           <div>
             <span>候补截止时间</span>
-            <!-- <el-time-picker
+            <el-time-picker
               v-model="ruleForm.hh_end"
               placeholder="请选择时间"
               format="HH:mm"
               value-format="HH:mm"
               @change="timeUpdata"
-            /> -->
-            <el-input
+            />
+            <!-- <el-input
               clearable
               v-model="ruleForm.yy_end"
               class="w-50 m-2"
               style="width: 100px"
               @blur="timeUpdata"
             />
-            <span>&nbsp;&nbsp;分钟</span>
+            <span>&nbsp;&nbsp;分钟</span> -->
           </div>
         </div>
         <div class="condition">