| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491 |
- <template>
- <div class="content-box">
- <div class="left">
- <!-- <el-icon :size="23" class="camera"><UserFilled /></el-icon> -->
- <div class="cameratxt">报表统计</div>
- </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"
- /> -->
- <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">
- <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"
- :clearable="false"
- />
- </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> <Refresh /> </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">
- <span>车牌号 : </span>
- <!-- <el-input
- clearable
- v-model="searchInput.car_number"
- class="w-50 m-2"
- 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>
- </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-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-option label="预约成功" value="1" />
- <el-option label="上车" value="2" />
- <el-option label="候补" value="3" />
- <el-option label="取消" value="4" />
- <el-option label="爽约" value="5" />
- <el-option label="爽约已核销" value="6" />
- </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>
- </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-form-item label="车牌 :" prop="busname">
- <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-form-item>
- <el-form-item label="路线 :" prop="route">
- <el-input
- v-model="ruleForm.route"
- placeholder="请输入路线"
- :disabled="true"
- clearable
- />
- </el-form-item>
- <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>
- </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>
- </el-form-item>
- </el-form>
- </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"
- :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="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"
- >
- {{ scope.row.yy_num }}
- </div>
- <div v-else>{{ scope.row.yy_num }}</div>
- </template>
- </el-table-column>
- <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" label="状态">
- <template #default="scope">
- <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>
- <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>
- </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
- > -->
- </template>
- </el-table-column>
- </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"
- />
- <!-- 往返校区预约和乘车人数 -->
- <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">{{
- gobacknum.list1.s_date
- }}</span>
- <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
- > 预约人数:<span style="color: red">{{
- gobacknum.list1.yy_num
- }}</span>
- , 乘车人数:<span style="color: red">{{
- gobacknum.list1.by_num
- }}</span>
- </div>
- </div>
- <div style="display: inline-block">
- <span style="font-size: 16px; font-weight: 800">报备人员</span
- > 预约人数:<span style="color: red">{{
- gobacknum.list2.yy_num
- }}</span>
- , 乘车人数:<span style="color: red">{{
- gobacknum.list2.by_num
- }}</span>
- </div>
- </div>
- <div>
- <div style="display: inline-block; margin-left: 30px">
- <span style="color: transparent; padding-right: 10px">{{
- gobacknum.list3.s_date
- }}</span>
- <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
- > 预约人数:<span style="color: red">{{
- gobacknum.list3.yy_num
- }}</span>
- , 乘车人数:<span style="color: red">{{
- gobacknum.list3.by_num
- }}</span>
- </div>
- </div>
- <div style="display: inline-block">
- <span style="font-size: 16px; font-weight: 800">报备人员</span
- > 预约人数:<span style="color: red">{{
- gobacknum.list4.yy_num
- }}</span>
- , 乘车人数:<span style="color: red">{{
- gobacknum.list4.by_num
- }}</span>
- </div>
- </div>
- </div>
- </div>
- </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"
- :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="发车日期"
- />
- <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="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"
- width="450"
- 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">
- 预约成功
- </div>
- <div v-if="scope.row.state == 2" style="color: rgb(50, 201, 110)">
- 上车
- </div>
- <div v-if="scope.row.state == 3" style="color: rgb(236, 168, 22)">
- 候补
- </div>
- <div v-if="scope.row.state == 4" style="color: #ccc">取消</div>
- <div v-if="scope.row.state == 5" style="color: rgb(255, 0, 0)">
- 爽约
- </div>
- <div v-if="scope.row.state == 6" style="color: rgb(42, 228, 200)">
- 爽约已核销
- </div>
- </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>
- </div>
- </template>
- <script setup>
- import { ref, reactive, watch, onBeforeMount } from "vue";
- import { useRouter } from "vue-router";
- import { Select, Pointer, Upload } from "@element-plus/icons-vue";
- import { JSEncrypt } from "jsencrypt"; // 加密密码
- import { ElMessage, ElMessageBox } from "element-plus";
- import { dayjs } from "element-plus";
- import axios from "axios";
- import lodash from "lodash";
- import adminApi from "@/api/admin.js";
- import { useStore } from "vuex";
- const store = useStore();
- const router = useRouter();
- // 汇总搜索框数据
- const searchInputHZ = reactive({
- state: "",
- date: dayjs().format("YYYY-MM-DD"),
- car_number: "",
- });
- const gobacknum = reactive({ list1: {}, list2: {}, list3: {}, list4: {} }); // 当日黄家湖-墨轩湖人数
- const api = ref("");
- // 明细列表搜索框数据
- const searchInput = reactive({
- ci_time: "",
- state: "",
- yy_date: "",
- car_number: "",
- });
- const busNum = reactive({ list: [] }); // 车牌号
- const pathNum = reactive({ list: [] }); // 路线
- const endNum = reactive({ list: [] }); // 终点站
- // 表格数据
- const tableData = reactive({
- list: [], //汇总数据
- list2: [], //明细列表数据
- });
- const dialongTitle = ref("候补派车"); // 弹窗标题
- 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 pageSize = ref(9);
- 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();
- const ruleForm = reactive({
- busname: [], //候补弹窗车牌绑定数据
- volume: "",
- route: "黄家湖校区-墨轩湖校区",
- destination: "",
- });
- // 表单验证
- const rules = reactive({
- busname: [
- {
- required: true,
- message: "至少选择一个车牌号",
- trigger: "change",
- },
- ],
- volume: [
- {
- required: true,
- message: "容量不能为空",
- trigger: "blur",
- },
- {
- pattern: /^(0|[1-9][0-9]*)$/,
- message: "请输入正确数字",
- trigger: "blur",
- },
- ],
- route: [
- {
- required: true,
- message: "路线不能为空",
- trigger: "blur",
- },
- ],
- destination: [
- {
- required: true,
- message: "请选择终点站",
- trigger: "change",
- },
- ],
- });
- // 获取数据列表
- const getList = async (message) => {
- if (footerMenuIndex.value == 0) {
- let data = new FormData();
- if (searchInputHZ.state) {
- data.set("state", searchInputHZ.state);
- }
- if (searchInputHZ.date) {
- 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/schelist.action",
- headers: {
- token: sessionStorage.getItem("token"),
- },
- data: data,
- });
- console.log(res);
- if (res.status == 200) {
- if (message) {
- ElMessage({
- type: "success",
- showClose: true,
- message: message,
- center: true,
- });
- }
- tableData.list = res.data.rows;
- // currentPage.value = res.data.currentPage;
- total.value = res.data.total;
- } else {
- tableData.list2 = res.data.rows;
- currentPage.value = 1;
- total.value = res.data.total;
- ElMessage({
- type: "error",
- showClose: true,
- message: res.data.message,
- center: true,
- });
- if (res.data.message == "token错误") {
- router.push({
- path: `/login`,
- });
- }
- }
- // 单独获取今日预约人数和乘车人数
- // {
- // let datas = new FormData();
- // datas.set("page", 1);
- // datas.set("rows", 100); //前面的key记得对应!
- // // if (searchInputHZ.date) {
- // // datas.set("date", searchInputHZ.date);
- // // }
- // let resdata = await axios({
- // method: "post",
- // url: api.value + "/carBook/schelist.action",
- // headers: {
- // token: sessionStorage.getItem("token"),
- // },
- // data: datas,
- // });
- // console.log(resdata.data.rows, "单独数据");
- // nowDayH_M.H_Mby = 0;
- // nowDayH_M.H_Myy = 0;
- // nowDayM_H.M_Hyy = 0;
- // nowDayM_H.M_Hby = 0;
- // resdata.data.rows.forEach((item) => {
- // if (item.route == "黄家湖校区-墨轩湖校区") {
- // nowDayH_M.H_Myy = nowDayH_M.H_Myy + Number(item.yy_num);
- // nowDayH_M.H_Mby = nowDayH_M.H_Mby + Number(item.by_num);
- // } else if (item.route == "墨轩湖校区-黄家湖校区") {
- // nowDayM_H.M_Hyy = nowDayM_H.M_Hyy + Number(item.yy_num);
- // nowDayM_H.M_Hby = nowDayM_H.M_Hby + Number(item.by_num);
- // }
- // });
- // }
- } 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);
- if (searchInput.ci_time) {
- data.set("ci_time", searchInput.ci_time);
- }
- if (searchInput.yy_date) {
- 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) {
- if (message) {
- ElMessage({
- type: "success",
- showClose: true,
- message: 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 goBackNum = async () => {
- let data = new FormData();
- data.set("date", searchInputHZ.date); //日期参数
- let res = await axios({
- method: "post",
- url: api.value + "/carBook/scheroutetj.action",
- headers: {
- token: sessionStorage.getItem("token"),
- },
- data: data,
- });
- console.log(res, "往返校区的人数");
- // 墨轩湖 到 黄家湖
- res.data.data.forEach((item) => {
- 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 == "南昌-靖安") {
- if (item.user_zz == "教职工") {
- gobacknum.list3 = res.data.data[2]; // 教职工
- } else if (item.user_zz == "报备人员") {
- gobacknum.list4 = res.data.data[3]; // 报备人员
- }
- }
- });
- };
- // 汇总搜索按钮
- const searchHZ = lodash.debounce(() => {
- getList("查询成功");
- goBackNum();
- }, 300);
- // 汇总重置搜索框
- const resetInputHZ = lodash.debounce(() => {
- searchInputHZ.state = "";
- searchInputHZ.date = dayjs().format("YYYY-MM-DD");
- searchInputHZ.car_number = "";
- getList();
- goBackNum();
- }, 300);
- // 搜索按钮
- const search = lodash.debounce(() => {
- getList("查询成功");
- }, 300);
- // 重置搜索框
- const resetInput = lodash.debounce(() => {
- searchInput.state = "";
- searchInput.yy_date = "";
- searchInput.car_number = "";
- searchInput.ci_time = "";
- getList();
- }, 300);
- // 多选框功能
- const handleSelectionChange = (val) => {
- console.log(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.s_date;
- searchInput.ci_time = row.ci_time;
- searchInput.car_number = row.car_number;
- footerMenuIndex.value = 1;
- currentPage2.value = 1;
- getList();
- };
- // 派车按钮
- const sendBus = (row) => {
- console.log(row);
- centerDialogVisible.value = true;
- };
- // 派车弹窗关闭
- const editClose = () => {
- centerDialogVisible.value = false;
- ruleFormRef.value.resetFields();
- };
- // 确认派车
- 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,
- });
- // 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,
- });
- }
- } else {
- }
- } else {
- console.log("error submit!", fields);
- }
- });
- };
- // 导出按钮
- 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 }) => {
- if (rowIndex % 2 === 0) {
- return "even";
- } else if (rowIndex % 2 !== 0) {
- return "odd";
- }
- return "";
- };
- // 分页
- const handleCurrentChange = (value) => {
- currentPage.value = value;
- getList();
- };
- // 分页
- const handleCurrentChange2 = (value) => {
- console.log(value);
- currentPage2.value = value;
- getList();
- };
- // 监控派车弹窗选择车牌时容量发生变化
- watch(
- () => ruleForm.busname,
- (newValue, oldValue) => {
- // console.log("person的job变化了", newValue);
- let volume = 0;
- newValue.forEach((item) => {
- busNum.list.forEach((i) => {
- if (item == i.car_number) {
- volume = volume + i.contain;
- }
- });
- });
- // console.log(volume);
- ruleForm.volume = volume;
- }
- );
- onBeforeMount(() => {
- api.value = store.state.user.api;
- pathNum.list = JSON.parse(sessionStorage.getItem("pathSelect"));
- busNum.list = JSON.parse(sessionStorage.getItem("busSelect"));
- // 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) => {
- initials.list.push(item.car_number);
- });
- options.value = Array.from({ length: initials.list.length }).map(
- (_, idx) => ({
- value: `${initials.list[idx % 10]}`,
- label: `${initials.list[idx % 10]}`,
- })
- );
- getList();
- goBackNum();
- });
- </script>
- <style scoped lang="scss">
- .content-box {
- width: 97.5%;
- height: 89%;
- margin: 20px auto;
- background-color: #fff;
- color: #fff;
- display: flex;
- flex-direction: column;
- .left {
- width: calc(100wh - 40px);
- display: flex;
- align-items: center;
- height: 60px !important;
- margin: 0 30px;
- // padding: 10px 0;
- border-bottom: 1px solid #ccc;
- color: #000;
- font-size: 18px;
- font-weight: 600;
- .cameratxt {
- margin-right: 15px;
- display: flex;
- align-items: center;
- height: 60px !important;
- }
- }
- :deep(.sendBus) {
- // height: 420px;
- border-radius: 11px;
- .el-dialog__header {
- border-radius: 11px 11px 0 0;
- background: rgba(237, 241, 245, 1);
- font-weight: 600;
- margin: 0;
- .el-dialog__headerbtn {
- outline: none;
- }
- }
- .el-dialog__body {
- padding: 30px 20px 10px 20px;
- .el-form-item--feedback {
- .el-input__validateIcon {
- color: rgba(61, 81, 232, 1);
- }
- }
- .el-form-item.is-error .el-input__validateIcon {
- color: red;
- }
- .el-input {
- width: 200px;
- }
- .options {
- margin-left: 200px;
- }
- }
- }
- .middle {
- width: 96%;
- margin: 0 auto;
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: space-between;
- color: #000;
- border-bottom: 1px solid rgb(231, 231, 231);
- padding: 10px 0;
- // 添加员工弹窗样式
- .filter {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- // width: 100%;
- .condition {
- display: flex;
- align-items: center;
- margin: 10px 20px 10px 0;
- :deep(.el-input .el-input__inner) {
- font-size: 16px;
- }
- span {
- margin: 0 5px 0 0;
- }
- }
- }
- .import {
- margin: 10px 0;
- }
- .gongneng {
- margin: 10px 0;
- }
- :deep(.cont) {
- width: 60%;
- margin: 20px auto;
- }
- :deep(.download) {
- display: flex;
- align-items: center;
- margin: 10px;
- }
- :deep(.download span) {
- font-size: 16px;
- margin-left: 20px;
- }
- :deep(.cont .el-button) {
- margin-left: 60px;
- margin-bottom: 30px;
- }
- :deep(.cont .accomplish) {
- width: 100%;
- display: flex;
- justify-content: center;
- }
- :deep(.cont .accomplish .el-button) {
- width: 50%;
- margin: 0;
- }
- }
- .footerMenu {
- width: 96%;
- margin: 10px auto 0;
- display: flex;
- align-items: center;
- // height: 40px;
- .menuList {
- padding: 5px 12px;
- border-bottom: 2px solid transparent;
- // color: rgba(61, 81, 232, 1);
- color: rgba(128, 128, 128, 1);
- cursor: pointer;
- // font-size: 16px;
- font-weight: 600;
- }
- .menuListActive {
- border-bottom: 2px solid rgba(61, 81, 232, 1);
- color: rgba(61, 81, 232, 1);
- font-size: 17px;
- }
- }
- .footer.mingxi {
- :deep(.el-table__header-wrapper) {
- height: 50px;
- .el-table__header {
- height: 50px;
- }
- }
- .el-table--fit {
- height: 100%;
- :deep(.el-table__row) {
- height: 50px;
- }
- }
- }
- .footer {
- width: 96%;
- height: 510px;
- margin: 20px auto 20px;
- :deep(.el-table__header-wrapper) {
- height: 48px;
- .el-table__header {
- height: 48px;
- font-size: 16px;
- color: #000;
- }
- }
- .el-table--fit {
- height: 100%;
- :deep(.el-table__row) {
- height: 48px;
- font-size: 16px;
- color: #000;
- }
- :deep(.el-table__row td) {
- padding: 0;
- border: 0;
- }
- :deep(.look) {
- padding: 3px 10px;
- border-radius: 40px;
- border: 0.74px solid rgba(30, 125, 251, 1);
- }
- // 输出链接弹窗样式
- :deep(.link .el-dialog__header) {
- text-align: left;
- font-size: 20px;
- font-weight: 600;
- }
- :deep(.link .el-dialog__body) {
- padding: 10px 20px;
- height: 100px;
- margin-bottom: 10px;
- }
- .link {
- .linkcontent {
- text-align: left;
- height: 100px;
- border: 1px solid #ccc;
- p {
- margin: 5px 10px;
- }
- }
- }
- :deep(.playVideo .el-dialog__header) {
- text-align: left;
- font-size: 20px;
- font-weight: 600;
- background-color: #ccc;
- margin-right: 0;
- }
- :deep(.playVideo .el-dialog__body) {
- height: 600px;
- }
- .el-button--primary {
- margin-left: 5px;
- }
- :deep(.el-table__body .even) {
- background-color: #fff;
- }
- :deep(.el-table__body .odd) {
- background-color: rgba(240, 243, 247, 1);
- }
- }
- }
- .footers {
- width: 96%;
- height: 550px;
- margin: 20px auto 20px;
- :deep(.el-table__header-wrapper) {
- height: 48px;
- .el-table__header {
- height: 48px;
- font-size: 16px;
- color: #000;
- }
- }
- .el-table--fit {
- height: 100%;
- :deep(.el-table__row) {
- height: 48px;
- font-size: 16px;
- color: #000;
- }
- :deep(.el-table__row td) {
- padding: 0;
- border: 0;
- }
- :deep(.look) {
- padding: 3px 10px;
- border-radius: 40px;
- border: 0.74px solid rgba(30, 125, 251, 1);
- }
- // 输出链接弹窗样式
- :deep(.link .el-dialog__header) {
- text-align: left;
- font-size: 20px;
- font-weight: 600;
- }
- :deep(.link .el-dialog__body) {
- padding: 10px 20px;
- height: 100px;
- margin-bottom: 10px;
- }
- .link {
- .linkcontent {
- text-align: left;
- height: 100px;
- border: 1px solid #ccc;
- p {
- margin: 5px 10px;
- }
- }
- }
- :deep(.playVideo .el-dialog__header) {
- text-align: left;
- font-size: 20px;
- font-weight: 600;
- background-color: #ccc;
- margin-right: 0;
- }
- :deep(.playVideo .el-dialog__body) {
- height: 600px;
- }
- .el-button--primary {
- margin-left: 5px;
- }
- :deep(.el-table__body .even) {
- background-color: #fff;
- }
- :deep(.el-table__body .odd) {
- background-color: rgba(240, 243, 247, 1);
- }
- }
- }
- .el-pagination {
- // width: 1600px;
- width: 96%;
- margin: 0 auto 18px;
- justify-content: flex-end;
- :deep(.el-pagination__total) {
- color: #000;
- }
- :deep(.el-pagination__goto) {
- color: #000;
- }
- :deep(.el-pagination__classifier) {
- color: #000;
- }
- :deep(.el-input__wrapper) {
- border: 1px solid rgba(0, 0, 0, 1);
- border-radius: 5px;
- box-shadow: none;
- }
- :deep(.el-pager li) {
- margin: 0 5px;
- border: 1px solid rgba(0, 0, 0, 1);
- border-radius: 5px;
- background-color: transparent;
- }
- :deep(.el-pager li.is-active) {
- background-color: rgba(30, 125, 251, 1);
- }
- :deep(.btn-prev) {
- margin-right: 5px;
- border: 1px solid rgba(0, 0, 0, 1);
- border-radius: 5px;
- background-color: transparent;
- }
- :deep(.btn-next) {
- margin-left: 5px;
- border: 1px solid rgba(0, 0, 0, 1);
- border-radius: 5px;
- background-color: transparent;
- }
- }
- }
- .el-input {
- width: 192px;
- }
- </style>
|