Bladeren bron

路线接口调整

hzj18279462576@163.com 2 jaren geleden
bovenliggende
commit
9391a0a69b
2 gewijzigde bestanden met toevoegingen van 339 en 95 verwijderingen
  1. 35 14
      src/views/busquery/busquery.vue
  2. 304 81
      src/views/statement/statement.vue

+ 35 - 14
src/views/busquery/busquery.vue

@@ -246,14 +246,27 @@
           />
         </el-form-item> -->
         <el-form-item label="车牌 :" prop="busname">
-          <el-select-v2
+          <!-- <el-select-v2
             validate-event
             v-model="ruleForm.busname"
             :options="options"
             placeholder="请选择车牌号"
             style="width: 260px"
             multiple
-          />
+          /> -->
+          <el-select
+            v-model="ruleForm.busname"
+            multiple
+            placeholder="请选择车牌号"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="item in busNum.list"
+              :key="item.id"
+              :label="item.car_number"
+              :value="item.car_number"
+            />
+          </el-select>
         </el-form-item>
 
         <el-form-item label="容量 :" prop="volume">
@@ -591,9 +604,11 @@
             class="m-2"
             placeholder="请选择车牌号"
             :clearable="true"
+            @clear="search"
           >
             <el-option
               v-for="item in busNum.list"
+              :key="item.id"
               :label="item.car_number"
               :value="item.car_number"
             />
@@ -811,12 +826,12 @@ const centerDialogVisible = ref(false); // 候补弹窗显示
 const initials = reactive({
   list: [],
 }); // 候补弹窗多选车牌号数据
-const options = ref(
-  Array.from({ length: initials.list.length }).map((_, idx) => ({
-    value: `${initials.list[idx % 10]}`,
-    label: `${initials.list[idx % 10]}`,
-  }))
-); //候补弹窗多选车牌号逻辑
+// const options = ref(
+//   Array.from({ length: initials.list.length }).map((_, idx) => ({
+//     value: `${initials.list[idx % 10]}`,
+//     label: `${initials.list[idx % 10]}`,
+//   }))
+// ); //候补弹窗多选车牌号逻辑
 
 const pageSize = ref(10);
 const currentPage = ref(1); // 当前页
@@ -1782,23 +1797,29 @@ onMounted(() => {
   api.value = store.state.user.api;
   pathNum.list = JSON.parse(sessionStorage.getItem("pathSelect"));
   busNum.list = JSON.parse(sessionStorage.getItem("busSelect"));
+  console.log(busNum.list, "车辆列表");
+
   // let route_endSelect = JSON.parse(sessionStorage.getItem("route_endSelect"));
   // console.log(route_endSelect);
   // endNum.list = route_endSelect.filter((item) => {
   //   return item.route == ruleForm.route;
   // });
+
   if (busNum.list) {
     busNum.list.forEach((item) => {
       initials.list.push(item.car_number);
     });
   }
+  console.log(initials.list, "候补弹窗多选车牌号数据");
+
+  // options.value = Array.from({ length: initials.list.length }).map(
+  //   (_, idx) => ({
+  //     value: `${initials.list[idx % 10]}`,
+  //     label: `${initials.list[idx % 10]}`,
+  //   })
+  // );
+  // console.log(options.value, "候补弹窗多选车牌号逻辑");
 
-  options.value = Array.from({ length: initials.list.length }).map(
-    (_, idx) => ({
-      value: `${initials.list[idx % 10]}`,
-      label: `${initials.list[idx % 10]}`,
-    })
-  );
   getList();
 });
 </script>

+ 304 - 81
src/views/statement/statement.vue

@@ -16,8 +16,16 @@
             placeholder="请输入车牌号"
             style="width: 150px"
           /> -->
-          <el-select v-model="searchInputHZ.car_number" class="m-2" placeholder="请选择车牌号">
-            <el-option v-for="item in busNum.list" :label="item.car_number" :value="item.car_number" />
+          <el-select
+            v-model="searchInputHZ.car_number"
+            class="m-2"
+            placeholder="请选择车牌号"
+          >
+            <el-option
+              v-for="item in busNum.list"
+              :label="item.car_number"
+              :value="item.car_number"
+            />
           </el-select>
         </div>
         <div class="condition">
@@ -30,12 +38,22 @@
             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" :clearable="false" />
+          <el-date-picker
+            v-model="searchInputHZ.date"
+            type="date"
+            placeholder="请选择日期"
+            format="YYYY-MM-DD"
+            value-format="YYYY-MM-DD"
+            :clearable="false"
+          />
         </div>
         <div class="condition">
           <span>状态 : </span>
-          <el-select v-model="searchInputHZ.state" class="m-2" placeholder="请选择状态">
+          <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" />
@@ -43,14 +61,22 @@
           </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>
-            <Refresh />
-          </el-icon><span>重置</span></el-button>
+        <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> <Refresh /> </el-icon><span>重置</span></el-button
+        >
       </div>
       <!-- <el-button
         color="rgba(61, 81, 232, 1)"
@@ -77,8 +103,16 @@
             placeholder="请输入车牌号"
             style="width: 150px"
           /> -->
-          <el-select v-model="searchInput.car_number" class="m-2" placeholder="请选择车牌号">
-            <el-option v-for="item in busNum.list" :label="item.car_number" :value="item.car_number" />
+          <el-select
+            v-model="searchInput.car_number"
+            class="m-2"
+            placeholder="请选择车牌号"
+          >
+            <el-option
+              v-for="item in busNum.list"
+              :label="item.car_number"
+              :value="item.car_number"
+            />
           </el-select>
         </div>
         <div class="condition">
@@ -91,18 +125,34 @@
             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" />
+          <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-time-picker v-model="searchInput.ci_time" placeholder="请选择发车时间" format="HH:mm" value-format="HH:mm"
-            :disabled-hours="disabledQueryHours" :disabled-minutes="disabledQueryMinutes"
-            :disabled-seconds="disabledQuerySeconds" @change="addQueryTime" />
+          <el-time-picker
+            v-model="searchInput.ci_time"
+            placeholder="请选择发车时间"
+            format="HH:mm"
+            value-format="HH:mm"
+            :disabled-hours="disabledQueryHours"
+            :disabled-minutes="disabledQueryMinutes"
+            :disabled-seconds="disabledQuerySeconds"
+            @change="addQueryTime"
+          />
         </div>
         <div class="condition">
           <span>状态 : </span>
-          <el-select v-model="searchInput.state" class="m-2" placeholder="请选择状态">
+          <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" />
@@ -112,55 +162,131 @@
           </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>
+        <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>
+      <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
+        class="menuList"
+        @click="collectMenu"
+        :class="footerMenuIndex == 0 ? 'menuListActive' : ''"
+      >
         汇总
       </div>
-      <div class="menuList" @click="detailMenu" :class="footerMenuIndex == 1 ? 'menuListActive' : ''">
+      <div
+        class="menuList"
+        @click="detailMenu"
+        :class="footerMenuIndex == 1 ? 'menuListActive' : ''"
+      >
         明细列表
       </div>
     </div>
     <!-- 候补派车 -->
-    <el-dialog class="sendBus" v-model="centerDialogVisible" :close-on-click-modal="false" :close-on-press-escape="false"
-      :title="dialongTitle" align-center width="500" :before-close="editClose">
-      <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm"
-        :size="formSize" label-position="left" status-icon>
+    <el-dialog
+      class="sendBus"
+      v-model="centerDialogVisible"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :title="dialongTitle"
+      align-center
+      width="500"
+      :before-close="editClose"
+    >
+      <el-form
+        ref="ruleFormRef"
+        :model="ruleForm"
+        :rules="rules"
+        label-width="100px"
+        class="demo-ruleForm"
+        :size="formSize"
+        label-position="left"
+        status-icon
+      >
         <el-form-item label="车牌 :" prop="busname">
-          <el-select-v2 validate-event v-model="ruleForm.busname" :options="options" placeholder="请选择车牌号"
-            style="width: 260px" multiple />
+          <el-select-v2
+            validate-event
+            v-model="ruleForm.busname"
+            :options="options"
+            placeholder="请选择车牌号"
+            style="width: 260px"
+            multiple
+          />
         </el-form-item>
 
         <el-form-item label="容量 :" prop="volume">
-          <el-input v-model="ruleForm.volume" placeholder="请输入容量" clearable :disabled="true" />
+          <el-input
+            v-model="ruleForm.volume"
+            placeholder="请输入容量"
+            clearable
+            :disabled="true"
+          />
         </el-form-item>
         <el-form-item label="路线 :" prop="route">
-          <el-input v-model="ruleForm.route" placeholder="请输入路线" :disabled="true" clearable />
+          <el-input
+            v-model="ruleForm.route"
+            placeholder="请输入路线"
+            :disabled="true"
+            clearable
+          />
         </el-form-item>
-        <el-form-item label="终点站 :" prop="destination" style="
+        <el-form-item
+          label="终点站 :"
+          prop="destination"
+          style="
             padding-bottom: 40px;
             border-bottom: 1px solid rgba(230, 230, 230, 1);
-          ">
-          <el-select v-model="ruleForm.destination" class="m-2" placeholder="请选择终点站">
-            <el-option :label="item" :value="item" v-for="item in endNum.list" />
+          "
+        >
+          <el-select
+            v-model="ruleForm.destination"
+            class="m-2"
+            placeholder="请选择终点站"
+          >
+            <el-option
+              :label="item"
+              :value="item"
+              v-for="item in endNum.list"
+            />
           </el-select>
         </el-form-item>
 
         <el-form-item class="options">
-          <el-button class="congzhi" @click="editClose(ruleFormRef)">取消</el-button>
-          <el-button color="rgba(61, 81, 232, 1)" class="queding" type="primary" @click="submitAdd(ruleFormRef)">
+          <el-button class="congzhi" @click="editClose(ruleFormRef)"
+            >取消</el-button
+          >
+          <el-button
+            color="rgba(61, 81, 232, 1)"
+            class="queding"
+            type="primary"
+            @click="submitAdd(ruleFormRef)"
+          >
             确定
           </el-button>
         </el-form-item>
@@ -168,17 +294,30 @@
     </el-dialog>
     <div class="MingXi" v-if="footerMenuIndex == 0">
       <div class="footer mingxi">
-        <el-table :row-class-name="tableRowClassName" :data="tableData.list" style="width: 100%; height: 500px"
+        <el-table
+          :row-class-name="tableRowClassName"
+          :data="tableData.list"
+          style="width: 100%; height: 500px"
           :header-cell-style="{
             background: 'rgba(240, 243, 247, 1)',
             border: 0,
-          }" @selection-change="handleSelectionChange">
+          }"
+          @selection-change="handleSelectionChange"
+        >
           <!-- <el-table-column align="center" type="selection" width="80" /> -->
-          <el-table-column align="center" width="250" prop="s_date" label="创建时间" />
+          <el-table-column
+            align="center"
+            width="250"
+            prop="s_date"
+            label="创建时间"
+          />
           <el-table-column align="center" prop="ci_time" label="发车时间" />
           <el-table-column align="center" label="预约人数">
             <template #default="scope">
-              <div v-if="scope.row.yy_num == scope.row.contain" style="color: red">
+              <div
+                v-if="scope.row.yy_num == scope.row.contain"
+                style="color: red"
+              >
                 {{ scope.row.yy_num }}
               </div>
               <div v-else>{{ scope.row.yy_num }}</div>
@@ -187,19 +326,36 @@
           <el-table-column align="center" prop="by_num" label="乘车人数" />
           <el-table-column align="center" prop="contain" label="容量" />
           <el-table-column align="center" prop="car_number" label="车牌号" />
-          <el-table-column align="center" prop="route" width="250" label="路线" />
+          <el-table-column
+            align="center"
+            prop="route"
+            width="250"
+            label="路线"
+          />
           <el-table-column align="center" label="状态">
             <template #default="scope">
-              <div v-if="scope.row.state == 1" style="color: rgba(67, 207, 124, 1)">
+              <div
+                v-if="scope.row.state == 1"
+                style="color: rgba(67, 207, 124, 1)"
+              >
                 预约中
               </div>
-              <div v-if="scope.row.state == 2" style="color: rgba(212, 48, 48, 1)">
+              <div
+                v-if="scope.row.state == 2"
+                style="color: rgba(212, 48, 48, 1)"
+              >
                 已截止
               </div>
-              <div v-if="scope.row.state == 3" style="color: rgba(61, 81, 232, 1)">
+              <div
+                v-if="scope.row.state == 3"
+                style="color: rgba(61, 81, 232, 1)"
+              >
                 候补中
               </div>
-              <div v-if="scope.row.state == 4" style="color: rgba(77, 77, 77, 1)">
+              <div
+                v-if="scope.row.state == 4"
+                style="color: rgba(77, 77, 77, 1)"
+              >
                 已分车
               </div>
             </template>
@@ -221,16 +377,25 @@
         </el-table>
       </div>
       <div style="width: 100%; height: 34px">
-        <el-pagination background v-model:page-size="pageSize" v-model:current-page="currentPage"
-          layout="total, prev, pager, next, jumper" :total="total" @current-change="handleCurrentChange" />
+        <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 class="nowday" style="
+        <div
+          class="nowday"
+          style="
             position: relative;
             width: 1200px;
             color: #000;
             top: -47px;
             font-size: 18px;
-          ">
+          "
+        >
           <div>
             <div style="display: inline-block; margin-left: 30px">
               <span style="padding-right: 10px">{{
@@ -239,8 +404,11 @@
               <span style="font-size: 18px; font-weight: 800">{{
                 gobacknum.list1.route
               }}</span>
-              <div style="display: inline-block; width: 320px; margin-left: 20px">
-                <span style="font-size: 16px; font-weight: 800">教职工</span>&nbsp; 预约人数:<span style="color: red">{{
+              <div
+                style="display: inline-block; width: 320px; margin-left: 20px"
+              >
+                <span style="font-size: 16px; font-weight: 800">教职工</span
+                >&nbsp; 预约人数:<span style="color: red">{{
                   gobacknum.list1.yy_num
                 }}</span>
                 , 乘车人数:<span style="color: red">{{
@@ -249,7 +417,8 @@
               </div>
             </div>
             <div style="display: inline-block">
-              <span style="font-size: 16px; font-weight: 800">报备人员</span>&nbsp;&nbsp; 预约人数:<span style="color: red">{{
+              <span style="font-size: 16px; font-weight: 800">报备人员</span
+              >&nbsp;&nbsp; 预约人数:<span style="color: red">{{
                 gobacknum.list2.yy_num
               }}</span>
               , 乘车人数:<span style="color: red">{{
@@ -265,8 +434,11 @@
               <span style="font-size: 18px; font-weight: 800">{{
                 gobacknum.list3.route
               }}</span>
-              <div style="display: inline-block; width: 320px; margin-left: 20px">
-                <span style="font-size: 16px; font-weight: 800">教职工</span>&nbsp; 预约人数:<span style="color: red">{{
+              <div
+                style="display: inline-block; width: 320px; margin-left: 20px"
+              >
+                <span style="font-size: 16px; font-weight: 800">教职工</span
+                >&nbsp; 预约人数:<span style="color: red">{{
                   gobacknum.list3.yy_num
                 }}</span>
                 , 乘车人数:<span style="color: red">{{
@@ -275,7 +447,8 @@
               </div>
             </div>
             <div style="display: inline-block">
-              <span style="font-size: 16px; font-weight: 800">报备人员</span>&nbsp;&nbsp; 预约人数:<span style="color: red">{{
+              <span style="font-size: 16px; font-weight: 800">报备人员</span
+              >&nbsp;&nbsp; 预约人数:<span style="color: red">{{
                 gobacknum.list4.yy_num
               }}</span>
               , 乘车人数:<span style="color: red">{{
@@ -288,22 +461,61 @@
     </div>
     <div class="MingXi" v-else-if="footerMenuIndex == 1">
       <div class="footers footer">
-        <el-table :row-class-name="tableRowClassName" :data="tableData.list2" style="width: 100%; height: 550px"
+        <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="200" prop="yy_time" label="下单时间" />
-          <el-table-column align="center" width="120" prop="yy_date" label="发车日期" />
+          }"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column
+            align="center"
+            width="200"
+            prop="yy_time"
+            label="下单时间"
+          />
+          <el-table-column
+            align="center"
+            width="120"
+            prop="yy_date"
+            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
+            align="center"
+            width="150"
+            prop="user_phone"
+            label="手机号码"
+          />
 
-          <el-table-column width="130" align="center" prop="car_number" label="车牌号" />
-          <el-table-column align="center" width="40" prop="contain" label="容量" />
-          <el-table-column align="center" prop="route" width="200" label="路线" /><el-table-column align="center"
-            prop="route_end" width="300" label="终点站" />
+          <el-table-column
+            width="130"
+            align="center"
+            prop="car_number"
+            label="车牌号"
+          />
+          <el-table-column
+            align="center"
+            width="40"
+            prop="contain"
+            label="容量"
+          />
+          <el-table-column
+            align="center"
+            prop="route"
+            width="200"
+            label="路线"
+          /><el-table-column
+            align="center"
+            prop="route_end"
+            width="330"
+            label="终点站"
+          />
           <!-- <el-table-column
             align="center"
             prop="remark"
@@ -311,7 +523,12 @@
             label="变更信息"
           /> -->
 
-          <el-table-column align="center" width="180" prop="by_time" label="通行时间" />
+          <el-table-column
+            align="center"
+            width="180"
+            prop="by_time"
+            label="通行时间"
+          />
           <el-table-column align="center" label="状态" width="100">
             <template #default="scope">
               <div v-if="scope.row.state == 1" style="color: blue">
@@ -341,8 +558,14 @@
           </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" />
+      <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>
   </div>
 </template>
@@ -616,13 +839,13 @@ const goBackNum = async () => {
 
   // 墨轩湖 到 黄家湖
   res.data.data.forEach((item) => {
-    if (item.route == "墨轩湖校区-黄家湖校区") {
+    if (item.route == "靖安-南昌") {
       if (item.user_zz == "教职工") {
         gobacknum.list1 = res.data.data[0]; // 教职工
       } else if (item.user_zz == "报备人员") {
         gobacknum.list2 = res.data.data[1]; // 报备人员
       }
-    } else if (item.route == "黄家湖校区-墨轩湖校区") {
+    } else if (item.route == "南昌-靖安") {
       if (item.user_zz == "教职工") {
         gobacknum.list3 = res.data.data[2]; // 教职工
       } else if (item.user_zz == "报备人员") {