statement.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491
  1. <template>
  2. <div class="content-box">
  3. <div class="left">
  4. <!-- <el-icon :size="23" class="camera"><UserFilled /></el-icon> -->
  5. <div class="cameratxt">报表统计</div>
  6. </div>
  7. <!-- 汇总搜索框 -->
  8. <div class="middle" v-if="footerMenuIndex == 0">
  9. <div class="filter">
  10. <div class="condition">
  11. <span>车牌号 : </span>
  12. <!-- <el-input
  13. clearable
  14. v-model="searchInputHZ.car_number"
  15. class="w-50 m-2"
  16. placeholder="请输入车牌号"
  17. style="width: 150px"
  18. /> -->
  19. <el-select
  20. v-model="searchInputHZ.car_number"
  21. class="m-2"
  22. placeholder="请选择车牌号"
  23. >
  24. <el-option
  25. v-for="item in busNum.list"
  26. :label="item.car_number"
  27. :value="item.car_number"
  28. />
  29. </el-select>
  30. </div>
  31. <div class="condition">
  32. <span>汇总日期 : </span>
  33. <!-- <el-date-picker
  34. v-model="searchData.input5"
  35. type="datetimerange"
  36. start-placeholder="开始日期"
  37. end-placeholder="结束日期"
  38. format="YYYY-MM-DD HH:mm:ss"
  39. value-format="YYYY-MM-DD HH:mm:ss"
  40. /> -->
  41. <el-date-picker
  42. v-model="searchInputHZ.date"
  43. type="date"
  44. placeholder="请选择日期"
  45. format="YYYY-MM-DD"
  46. value-format="YYYY-MM-DD"
  47. :clearable="false"
  48. />
  49. </div>
  50. <div class="condition">
  51. <span>状态 : </span>
  52. <el-select
  53. v-model="searchInputHZ.state"
  54. class="m-2"
  55. placeholder="请选择状态"
  56. >
  57. <el-option label="预约中" value="1" />
  58. <el-option label="已截止" value="2" />
  59. <el-option label="候补中" value="3" />
  60. <el-option label="已分车" value="4" />
  61. </el-select>
  62. </div>
  63. <el-button
  64. style="margin-left: 20px"
  65. color="rgba(61, 81, 232, 1)"
  66. type="primary"
  67. class="search"
  68. @click="searchHZ"
  69. ><el-icon> <Search /> </el-icon><span>搜索</span></el-button
  70. >
  71. <el-button
  72. style="margin-left: 20px"
  73. color="rgba(61, 81, 232, 1)"
  74. type="primary"
  75. class="search"
  76. @click="resetInputHZ"
  77. ><el-icon> <Refresh /> </el-icon><span>重置</span></el-button
  78. >
  79. </div>
  80. <!-- <el-button
  81. color="rgba(61, 81, 232, 1)"
  82. class="import"
  83. type="primary"
  84. @click="downLoad"
  85. ><img
  86. src="@/assets/import.png"
  87. style="width: 14px; height: 14px; margin-right: 4px"
  88. alt=""
  89. />
  90. <span>导出表单</span></el-button
  91. > -->
  92. </div>
  93. <!-- 明细列表搜索框 -->
  94. <div class="middle" v-if="footerMenuIndex == 1">
  95. <div class="filter">
  96. <div class="condition">
  97. <span>车牌号 : </span>
  98. <!-- <el-input
  99. clearable
  100. v-model="searchInput.car_number"
  101. class="w-50 m-2"
  102. placeholder="请输入车牌号"
  103. style="width: 150px"
  104. /> -->
  105. <el-select
  106. v-model="searchInput.car_number"
  107. class="m-2"
  108. placeholder="请选择车牌号"
  109. >
  110. <el-option
  111. v-for="item in busNum.list"
  112. :label="item.car_number"
  113. :value="item.car_number"
  114. />
  115. </el-select>
  116. </div>
  117. <div class="condition">
  118. <span>发车日期 : </span>
  119. <!-- <el-date-picker
  120. v-model="searchData.input5"
  121. type="datetimerange"
  122. start-placeholder="开始日期"
  123. end-placeholder="结束日期"
  124. format="YYYY-MM-DD HH:mm:ss"
  125. value-format="YYYY-MM-DD HH:mm:ss"
  126. /> -->
  127. <el-date-picker
  128. v-model="searchInput.yy_date"
  129. type="date"
  130. placeholder="请选择日期"
  131. format="YYYY-MM-DD"
  132. value-format="YYYY-MM-DD"
  133. />
  134. </div>
  135. <div class="condition">
  136. <span>发车时间 : </span>
  137. <el-time-picker
  138. v-model="searchInput.ci_time"
  139. placeholder="请选择发车时间"
  140. format="HH:mm"
  141. value-format="HH:mm"
  142. :disabled-hours="disabledQueryHours"
  143. :disabled-minutes="disabledQueryMinutes"
  144. :disabled-seconds="disabledQuerySeconds"
  145. @change="addQueryTime"
  146. />
  147. </div>
  148. <div class="condition">
  149. <span>状态 : </span>
  150. <el-select
  151. v-model="searchInput.state"
  152. class="m-2"
  153. placeholder="请选择状态"
  154. >
  155. <el-option label="预约成功" value="1" />
  156. <el-option label="上车" value="2" />
  157. <el-option label="候补" value="3" />
  158. <el-option label="取消" value="4" />
  159. <el-option label="爽约" value="5" />
  160. <el-option label="爽约已核销" value="6" />
  161. </el-select>
  162. </div>
  163. <el-button
  164. style="margin-left: 20px"
  165. color="rgba(61, 81, 232, 1)"
  166. type="primary"
  167. class="search"
  168. @click="search"
  169. ><el-icon> <Search /> </el-icon><span>搜索</span></el-button
  170. >
  171. <el-button
  172. style="margin-left: 20px"
  173. color="rgba(61, 81, 232, 1)"
  174. type="primary"
  175. class="search"
  176. @click="resetInput"
  177. ><el-icon> <Search /> </el-icon><span>重置</span></el-button
  178. >
  179. </div>
  180. <el-button
  181. color="rgba(61, 81, 232, 1)"
  182. class="import"
  183. type="primary"
  184. @click="downLoad"
  185. ><img
  186. src="@/assets/import.png"
  187. style="width: 14px; height: 14px; margin-right: 4px"
  188. alt=""
  189. />
  190. <span>导出表单</span></el-button
  191. >
  192. </div>
  193. <div class="footerMenu">
  194. <div
  195. class="menuList"
  196. @click="collectMenu"
  197. :class="footerMenuIndex == 0 ? 'menuListActive' : ''"
  198. >
  199. 汇总
  200. </div>
  201. <div
  202. class="menuList"
  203. @click="detailMenu"
  204. :class="footerMenuIndex == 1 ? 'menuListActive' : ''"
  205. >
  206. 明细列表
  207. </div>
  208. </div>
  209. <!-- 候补派车 -->
  210. <el-dialog
  211. class="sendBus"
  212. v-model="centerDialogVisible"
  213. :close-on-click-modal="false"
  214. :close-on-press-escape="false"
  215. :title="dialongTitle"
  216. align-center
  217. width="500"
  218. :before-close="editClose"
  219. >
  220. <el-form
  221. ref="ruleFormRef"
  222. :model="ruleForm"
  223. :rules="rules"
  224. label-width="100px"
  225. class="demo-ruleForm"
  226. :size="formSize"
  227. label-position="left"
  228. status-icon
  229. >
  230. <el-form-item label="车牌 :" prop="busname">
  231. <el-select-v2
  232. validate-event
  233. v-model="ruleForm.busname"
  234. :options="options"
  235. placeholder="请选择车牌号"
  236. style="width: 260px"
  237. multiple
  238. />
  239. </el-form-item>
  240. <el-form-item label="容量 :" prop="volume">
  241. <el-input
  242. v-model="ruleForm.volume"
  243. placeholder="请输入容量"
  244. clearable
  245. :disabled="true"
  246. />
  247. </el-form-item>
  248. <el-form-item label="路线 :" prop="route">
  249. <el-input
  250. v-model="ruleForm.route"
  251. placeholder="请输入路线"
  252. :disabled="true"
  253. clearable
  254. />
  255. </el-form-item>
  256. <el-form-item
  257. label="终点站 :"
  258. prop="destination"
  259. style="
  260. padding-bottom: 40px;
  261. border-bottom: 1px solid rgba(230, 230, 230, 1);
  262. "
  263. >
  264. <el-select
  265. v-model="ruleForm.destination"
  266. class="m-2"
  267. placeholder="请选择终点站"
  268. >
  269. <el-option
  270. :label="item"
  271. :value="item"
  272. v-for="item in endNum.list"
  273. />
  274. </el-select>
  275. </el-form-item>
  276. <el-form-item class="options">
  277. <el-button class="congzhi" @click="editClose(ruleFormRef)"
  278. >取消</el-button
  279. >
  280. <el-button
  281. color="rgba(61, 81, 232, 1)"
  282. class="queding"
  283. type="primary"
  284. @click="submitAdd(ruleFormRef)"
  285. >
  286. 确定
  287. </el-button>
  288. </el-form-item>
  289. </el-form>
  290. </el-dialog>
  291. <div class="MingXi" v-if="footerMenuIndex == 0">
  292. <div class="footer mingxi">
  293. <el-table
  294. :row-class-name="tableRowClassName"
  295. :data="tableData.list"
  296. style="width: 100%; height: 500px"
  297. :header-cell-style="{
  298. background: 'rgba(240, 243, 247, 1)',
  299. border: 0,
  300. }"
  301. @selection-change="handleSelectionChange"
  302. >
  303. <!-- <el-table-column align="center" type="selection" width="80" /> -->
  304. <el-table-column
  305. align="center"
  306. width="250"
  307. prop="s_date"
  308. label="创建时间"
  309. />
  310. <el-table-column align="center" prop="ci_time" label="发车时间" />
  311. <el-table-column align="center" label="预约人数">
  312. <template #default="scope">
  313. <div
  314. v-if="scope.row.yy_num == scope.row.contain"
  315. style="color: red"
  316. >
  317. {{ scope.row.yy_num }}
  318. </div>
  319. <div v-else>{{ scope.row.yy_num }}</div>
  320. </template>
  321. </el-table-column>
  322. <el-table-column align="center" prop="by_num" label="乘车人数" />
  323. <el-table-column align="center" prop="contain" label="容量" />
  324. <el-table-column align="center" prop="car_number" label="车牌号" />
  325. <el-table-column
  326. align="center"
  327. prop="route"
  328. width="250"
  329. label="路线"
  330. />
  331. <el-table-column align="center" label="状态">
  332. <template #default="scope">
  333. <div
  334. v-if="scope.row.state == 1"
  335. style="color: rgba(67, 207, 124, 1)"
  336. >
  337. 预约中
  338. </div>
  339. <div
  340. v-if="scope.row.state == 2"
  341. style="color: rgba(212, 48, 48, 1)"
  342. >
  343. 已截止
  344. </div>
  345. <div
  346. v-if="scope.row.state == 3"
  347. style="color: rgba(61, 81, 232, 1)"
  348. >
  349. 候补中
  350. </div>
  351. <div
  352. v-if="scope.row.state == 4"
  353. style="color: rgba(77, 77, 77, 1)"
  354. >
  355. 已分车
  356. </div>
  357. </template>
  358. </el-table-column>
  359. <el-table-column align="center" label="操作">
  360. <template #default="scope">
  361. <el-button link type="primary" @click="info(scope.row)">
  362. <div class="look">详情</div>
  363. </el-button>
  364. <!-- <el-button
  365. v-if="scope.row.state == '候补'"
  366. link
  367. type="primary"
  368. @click="sendBus(scope.row)"
  369. ><div class="look">派车</div></el-button
  370. > -->
  371. </template>
  372. </el-table-column>
  373. </el-table>
  374. </div>
  375. <div style="width: 100%; height: 34px">
  376. <el-pagination
  377. background
  378. v-model:page-size="pageSize"
  379. v-model:current-page="currentPage"
  380. layout="total, prev, pager, next, jumper"
  381. :total="total"
  382. @current-change="handleCurrentChange"
  383. />
  384. <!-- 往返校区预约和乘车人数 -->
  385. <div
  386. class="nowday"
  387. style="
  388. position: relative;
  389. width: 1200px;
  390. color: #000;
  391. top: -47px;
  392. font-size: 18px;
  393. "
  394. >
  395. <div>
  396. <div style="display: inline-block; margin-left: 30px">
  397. <span style="padding-right: 10px">{{
  398. gobacknum.list1.s_date
  399. }}</span>
  400. <span style="font-size: 18px; font-weight: 800">{{
  401. gobacknum.list1.route
  402. }}</span>
  403. <div
  404. style="display: inline-block; width: 320px; margin-left: 20px"
  405. >
  406. <span style="font-size: 16px; font-weight: 800">教职工</span
  407. >&nbsp; 预约人数:<span style="color: red">{{
  408. gobacknum.list1.yy_num
  409. }}</span>
  410. , 乘车人数:<span style="color: red">{{
  411. gobacknum.list1.by_num
  412. }}</span>
  413. </div>
  414. </div>
  415. <div style="display: inline-block">
  416. <span style="font-size: 16px; font-weight: 800">报备人员</span
  417. >&nbsp;&nbsp; 预约人数:<span style="color: red">{{
  418. gobacknum.list2.yy_num
  419. }}</span>
  420. , 乘车人数:<span style="color: red">{{
  421. gobacknum.list2.by_num
  422. }}</span>
  423. </div>
  424. </div>
  425. <div>
  426. <div style="display: inline-block; margin-left: 30px">
  427. <span style="color: transparent; padding-right: 10px">{{
  428. gobacknum.list3.s_date
  429. }}</span>
  430. <span style="font-size: 18px; font-weight: 800">{{
  431. gobacknum.list3.route
  432. }}</span>
  433. <div
  434. style="display: inline-block; width: 320px; margin-left: 20px"
  435. >
  436. <span style="font-size: 16px; font-weight: 800">教职工</span
  437. >&nbsp; 预约人数:<span style="color: red">{{
  438. gobacknum.list3.yy_num
  439. }}</span>
  440. , 乘车人数:<span style="color: red">{{
  441. gobacknum.list3.by_num
  442. }}</span>
  443. </div>
  444. </div>
  445. <div style="display: inline-block">
  446. <span style="font-size: 16px; font-weight: 800">报备人员</span
  447. >&nbsp;&nbsp; 预约人数:<span style="color: red">{{
  448. gobacknum.list4.yy_num
  449. }}</span>
  450. , 乘车人数:<span style="color: red">{{
  451. gobacknum.list4.by_num
  452. }}</span>
  453. </div>
  454. </div>
  455. </div>
  456. </div>
  457. </div>
  458. <div class="MingXi" v-else-if="footerMenuIndex == 1">
  459. <div class="footers footer">
  460. <el-table
  461. :row-class-name="tableRowClassName"
  462. :data="tableData.list2"
  463. style="width: 100%; height: 550px"
  464. :header-cell-style="{
  465. background: 'rgba(240, 243, 247, 1)',
  466. border: 0,
  467. }"
  468. @selection-change="handleSelectionChange"
  469. >
  470. <el-table-column
  471. align="center"
  472. width="200"
  473. prop="yy_time"
  474. label="下单时间"
  475. />
  476. <el-table-column
  477. align="center"
  478. width="120"
  479. prop="yy_date"
  480. label="发车日期"
  481. />
  482. <el-table-column align="center" prop="ci_time" label="发车时间" />
  483. <el-table-column align="center" prop="user_name" label="预约人" />
  484. <el-table-column align="center" prop="user_zz" label="身份" />
  485. <el-table-column
  486. align="center"
  487. width="150"
  488. prop="user_phone"
  489. label="手机号码"
  490. />
  491. <el-table-column
  492. width="130"
  493. align="center"
  494. prop="car_number"
  495. label="车牌号"
  496. />
  497. <el-table-column
  498. align="center"
  499. width="40"
  500. prop="contain"
  501. label="容量"
  502. />
  503. <el-table-column
  504. align="center"
  505. prop="route"
  506. width="200"
  507. label="路线"
  508. /><el-table-column
  509. align="center"
  510. prop="route_end"
  511. width="330"
  512. label="终点站"
  513. />
  514. <!-- <el-table-column
  515. align="center"
  516. prop="remark"
  517. width="450"
  518. label="变更信息"
  519. /> -->
  520. <el-table-column
  521. align="center"
  522. width="180"
  523. prop="by_time"
  524. label="通行时间"
  525. />
  526. <el-table-column align="center" label="状态" width="100">
  527. <template #default="scope">
  528. <div v-if="scope.row.state == 1" style="color: blue">
  529. 预约成功
  530. </div>
  531. <div v-if="scope.row.state == 2" style="color: rgb(50, 201, 110)">
  532. 上车
  533. </div>
  534. <div v-if="scope.row.state == 3" style="color: rgb(236, 168, 22)">
  535. 候补
  536. </div>
  537. <div v-if="scope.row.state == 4" style="color: #ccc">取消</div>
  538. <div v-if="scope.row.state == 5" style="color: rgb(255, 0, 0)">
  539. 爽约
  540. </div>
  541. <div v-if="scope.row.state == 6" style="color: rgb(42, 228, 200)">
  542. 爽约已核销
  543. </div>
  544. </template>
  545. </el-table-column>
  546. <!-- <el-table-column align="center" label="操作">
  547. <template #default="scope">
  548. <el-button link type="primary" @click="look(scope.row)"
  549. ><div class="look">查看</div></el-button
  550. >
  551. </template>
  552. </el-table-column> -->
  553. </el-table>
  554. </div>
  555. <el-pagination
  556. background
  557. v-model:page-size="pageSize2"
  558. v-model:current-page="currentPage2"
  559. layout="total, prev, pager, next, jumper"
  560. :total="total2"
  561. @current-change="handleCurrentChange2"
  562. />
  563. </div>
  564. </div>
  565. </template>
  566. <script setup>
  567. import { ref, reactive, watch, onBeforeMount } from "vue";
  568. import { useRouter } from "vue-router";
  569. import { Select, Pointer, Upload } from "@element-plus/icons-vue";
  570. import { JSEncrypt } from "jsencrypt"; // 加密密码
  571. import { ElMessage, ElMessageBox } from "element-plus";
  572. import { dayjs } from "element-plus";
  573. import axios from "axios";
  574. import lodash from "lodash";
  575. import adminApi from "@/api/admin.js";
  576. import { useStore } from "vuex";
  577. const store = useStore();
  578. const router = useRouter();
  579. // 汇总搜索框数据
  580. const searchInputHZ = reactive({
  581. state: "",
  582. date: dayjs().format("YYYY-MM-DD"),
  583. car_number: "",
  584. });
  585. const gobacknum = reactive({ list1: {}, list2: {}, list3: {}, list4: {} }); // 当日黄家湖-墨轩湖人数
  586. const api = ref("");
  587. // 明细列表搜索框数据
  588. const searchInput = reactive({
  589. ci_time: "",
  590. state: "",
  591. yy_date: "",
  592. car_number: "",
  593. });
  594. const busNum = reactive({ list: [] }); // 车牌号
  595. const pathNum = reactive({ list: [] }); // 路线
  596. const endNum = reactive({ list: [] }); // 终点站
  597. // 表格数据
  598. const tableData = reactive({
  599. list: [], //汇总数据
  600. list2: [], //明细列表数据
  601. });
  602. const dialongTitle = ref("候补派车"); // 弹窗标题
  603. const centerDialogVisible = ref(false); // 候补弹窗显示
  604. const initials = reactive({
  605. list: [],
  606. }); // 候补弹窗多选车牌号数据
  607. const options = ref(
  608. Array.from({ length: initials.list.length }).map((_, idx) => ({
  609. value: `${initials.list[idx % 10]}`,
  610. label: `${initials.list[idx % 10]}`,
  611. }))
  612. ); //候补弹窗多选车牌号逻辑
  613. // 汇总
  614. const pageSize = ref(9);
  615. const currentPage = ref(1); // 当前页
  616. const total = ref(10); // 当前总数
  617. const selectData = reactive({ list: [] }); // 多选框选择的数据
  618. // 明细列表
  619. const pageSize2 = ref(10);
  620. const currentPage2 = ref(1); // 当前页
  621. const total2 = ref(10); // 当前总数
  622. const footerMenuIndex = ref(0); // 控制汇总和明细列表
  623. // 表单数据
  624. const formSize = ref("default");
  625. const ruleFormRef = ref();
  626. const ruleForm = reactive({
  627. busname: [], //候补弹窗车牌绑定数据
  628. volume: "",
  629. route: "黄家湖校区-墨轩湖校区",
  630. destination: "",
  631. });
  632. // 表单验证
  633. const rules = reactive({
  634. busname: [
  635. {
  636. required: true,
  637. message: "至少选择一个车牌号",
  638. trigger: "change",
  639. },
  640. ],
  641. volume: [
  642. {
  643. required: true,
  644. message: "容量不能为空",
  645. trigger: "blur",
  646. },
  647. {
  648. pattern: /^(0|[1-9][0-9]*)$/,
  649. message: "请输入正确数字",
  650. trigger: "blur",
  651. },
  652. ],
  653. route: [
  654. {
  655. required: true,
  656. message: "路线不能为空",
  657. trigger: "blur",
  658. },
  659. ],
  660. destination: [
  661. {
  662. required: true,
  663. message: "请选择终点站",
  664. trigger: "change",
  665. },
  666. ],
  667. });
  668. // 获取数据列表
  669. const getList = async (message) => {
  670. if (footerMenuIndex.value == 0) {
  671. let data = new FormData();
  672. if (searchInputHZ.state) {
  673. data.set("state", searchInputHZ.state);
  674. }
  675. if (searchInputHZ.date) {
  676. data.set("date", searchInputHZ.date);
  677. }
  678. data.set("car_number", searchInputHZ.car_number); //前面的key记得对应!
  679. data.set("page", currentPage.value);
  680. data.set("rows", pageSize.value); //前面的key记得对应!
  681. let res = await axios({
  682. method: "post",
  683. url: api.value + "/carBook/schelist.action",
  684. headers: {
  685. token: sessionStorage.getItem("token"),
  686. },
  687. data: data,
  688. });
  689. console.log(res);
  690. if (res.status == 200) {
  691. if (message) {
  692. ElMessage({
  693. type: "success",
  694. showClose: true,
  695. message: message,
  696. center: true,
  697. });
  698. }
  699. tableData.list = res.data.rows;
  700. // currentPage.value = res.data.currentPage;
  701. total.value = res.data.total;
  702. } else {
  703. tableData.list2 = res.data.rows;
  704. currentPage.value = 1;
  705. total.value = res.data.total;
  706. ElMessage({
  707. type: "error",
  708. showClose: true,
  709. message: res.data.message,
  710. center: true,
  711. });
  712. if (res.data.message == "token错误") {
  713. router.push({
  714. path: `/login`,
  715. });
  716. }
  717. }
  718. // 单独获取今日预约人数和乘车人数
  719. // {
  720. // let datas = new FormData();
  721. // datas.set("page", 1);
  722. // datas.set("rows", 100); //前面的key记得对应!
  723. // // if (searchInputHZ.date) {
  724. // // datas.set("date", searchInputHZ.date);
  725. // // }
  726. // let resdata = await axios({
  727. // method: "post",
  728. // url: api.value + "/carBook/schelist.action",
  729. // headers: {
  730. // token: sessionStorage.getItem("token"),
  731. // },
  732. // data: datas,
  733. // });
  734. // console.log(resdata.data.rows, "单独数据");
  735. // nowDayH_M.H_Mby = 0;
  736. // nowDayH_M.H_Myy = 0;
  737. // nowDayM_H.M_Hyy = 0;
  738. // nowDayM_H.M_Hby = 0;
  739. // resdata.data.rows.forEach((item) => {
  740. // if (item.route == "黄家湖校区-墨轩湖校区") {
  741. // nowDayH_M.H_Myy = nowDayH_M.H_Myy + Number(item.yy_num);
  742. // nowDayH_M.H_Mby = nowDayH_M.H_Mby + Number(item.by_num);
  743. // } else if (item.route == "墨轩湖校区-黄家湖校区") {
  744. // nowDayM_H.M_Hyy = nowDayM_H.M_Hyy + Number(item.yy_num);
  745. // nowDayM_H.M_Hby = nowDayM_H.M_Hby + Number(item.by_num);
  746. // }
  747. // });
  748. // }
  749. } else if (footerMenuIndex.value == 1) {
  750. let data = new FormData();
  751. // if (searchInput.createTime == null) {
  752. // searchInput.createTime = "";
  753. // }
  754. if (searchInput.car_number) {
  755. data.set("car_number", searchInput.car_number);
  756. }
  757. data.set("state", searchInput.state);
  758. if (searchInput.ci_time) {
  759. data.set("ci_time", searchInput.ci_time);
  760. }
  761. if (searchInput.yy_date) {
  762. data.set("yy_date", searchInput.yy_date);
  763. }
  764. data.set("page", currentPage2.value);
  765. data.set("rows", pageSize2.value); //前面的key记得对应!
  766. let res = await axios({
  767. method: "post",
  768. url: api.value + "/carBook/brecblist.action",
  769. headers: {
  770. token: sessionStorage.getItem("token"),
  771. },
  772. data: data,
  773. });
  774. console.log(res);
  775. if (res.status == 200) {
  776. if (message) {
  777. ElMessage({
  778. type: "success",
  779. showClose: true,
  780. message: message,
  781. center: true,
  782. });
  783. }
  784. tableData.list2 = res.data.rows;
  785. if (res.data.currentPage) {
  786. currentPage2.value = res.data.currentPage;
  787. } else {
  788. currentPage2.value = 1;
  789. }
  790. total2.value = res.data.total;
  791. } else {
  792. tableData.list2 = res.data.rows;
  793. currentPage2.value = 1;
  794. total2.value = res.data.total;
  795. ElMessage({
  796. type: "error",
  797. showClose: true,
  798. message: res.data.message,
  799. center: true,
  800. });
  801. if (res.data.message == "token错误") {
  802. router.push({
  803. path: `/login`,
  804. });
  805. }
  806. }
  807. }
  808. };
  809. // 获取往返黄家湖-墨轩湖的预约人数乘车人数
  810. const goBackNum = async () => {
  811. let data = new FormData();
  812. data.set("date", searchInputHZ.date); //日期参数
  813. let res = await axios({
  814. method: "post",
  815. url: api.value + "/carBook/scheroutetj.action",
  816. headers: {
  817. token: sessionStorage.getItem("token"),
  818. },
  819. data: data,
  820. });
  821. console.log(res, "往返校区的人数");
  822. // 墨轩湖 到 黄家湖
  823. res.data.data.forEach((item) => {
  824. if (item.route == "靖安-南昌") {
  825. if (item.user_zz == "教职工") {
  826. gobacknum.list1 = res.data.data[0]; // 教职工
  827. } else if (item.user_zz == "报备人员") {
  828. gobacknum.list2 = res.data.data[1]; // 报备人员
  829. }
  830. } else if (item.route == "南昌-靖安") {
  831. if (item.user_zz == "教职工") {
  832. gobacknum.list3 = res.data.data[2]; // 教职工
  833. } else if (item.user_zz == "报备人员") {
  834. gobacknum.list4 = res.data.data[3]; // 报备人员
  835. }
  836. }
  837. });
  838. };
  839. // 汇总搜索按钮
  840. const searchHZ = lodash.debounce(() => {
  841. getList("查询成功");
  842. goBackNum();
  843. }, 300);
  844. // 汇总重置搜索框
  845. const resetInputHZ = lodash.debounce(() => {
  846. searchInputHZ.state = "";
  847. searchInputHZ.date = dayjs().format("YYYY-MM-DD");
  848. searchInputHZ.car_number = "";
  849. getList();
  850. goBackNum();
  851. }, 300);
  852. // 搜索按钮
  853. const search = lodash.debounce(() => {
  854. getList("查询成功");
  855. }, 300);
  856. // 重置搜索框
  857. const resetInput = lodash.debounce(() => {
  858. searchInput.state = "";
  859. searchInput.yy_date = "";
  860. searchInput.car_number = "";
  861. searchInput.ci_time = "";
  862. getList();
  863. }, 300);
  864. // 多选框功能
  865. const handleSelectionChange = (val) => {
  866. console.log(val);
  867. selectData.list = val;
  868. };
  869. // 汇总按钮
  870. const collectMenu = () => {
  871. footerMenuIndex.value = 0;
  872. searchInput.yy_date = "";
  873. searchInput.car_number = "";
  874. searchInput.state = "";
  875. getList();
  876. };
  877. //明细列表按钮
  878. const detailMenu = () => {
  879. footerMenuIndex.value = 1;
  880. getList();
  881. };
  882. // 详情按钮
  883. const info = (row) => {
  884. console.log(row);
  885. searchInput.yy_date = row.s_date;
  886. searchInput.ci_time = row.ci_time;
  887. searchInput.car_number = row.car_number;
  888. footerMenuIndex.value = 1;
  889. currentPage2.value = 1;
  890. getList();
  891. };
  892. // 派车按钮
  893. const sendBus = (row) => {
  894. console.log(row);
  895. centerDialogVisible.value = true;
  896. };
  897. // 派车弹窗关闭
  898. const editClose = () => {
  899. centerDialogVisible.value = false;
  900. ruleFormRef.value.resetFields();
  901. };
  902. // 确认派车
  903. const submitAdd = async (formEl) => {
  904. if (!formEl) return;
  905. await formEl.validate(async (valid, fields) => {
  906. if (valid) {
  907. if (dialongTitle.value == "候补派车") {
  908. let data = new FormData();
  909. data.set("car_number", ruleForm.busname.join(",f"));
  910. data.set("route", ruleForm.route); //前面的key记得对应!
  911. data.set("contain", ruleForm.volume);
  912. data.set("route_end", ruleForm.destination); //前面的key记得对应!
  913. let res = await axios({
  914. method: "post",
  915. url: api.value + "/carBook/brecfen.action",
  916. headers: {
  917. token: sessionStorage.getItem("token"),
  918. },
  919. data: data,
  920. });
  921. // console.log(res, "添加账号");
  922. if (res.data.code == 200) {
  923. getList();
  924. ElMessage({
  925. type: "success",
  926. showClose: true,
  927. message: res.data.message,
  928. center: true,
  929. });
  930. addDialogVisible.value = false;
  931. ruleFormRef.value.resetFields();
  932. } else {
  933. ElMessage({
  934. type: "error",
  935. showClose: true,
  936. message: res.data.message,
  937. center: true,
  938. });
  939. }
  940. } else {
  941. }
  942. } else {
  943. console.log("error submit!", fields);
  944. }
  945. });
  946. };
  947. // 导出按钮
  948. const downLoad = lodash.debounce(async () => {
  949. let data = new FormData();
  950. if (searchInput.car_number) {
  951. data.set("car_number", searchInput.car_number);
  952. }
  953. data.set("state", searchInput.state);
  954. data.set("yy_date", searchInput.yy_date);
  955. let res = await axios({
  956. method: "post",
  957. url: api.value + "/carBook/brectoExcel.action",
  958. headers: {
  959. token: sessionStorage.getItem("token"),
  960. },
  961. data: data,
  962. });
  963. console.log(res);
  964. if (res.status == 200) {
  965. // const elt = document.createElement("a");
  966. // elt.setAttribute(
  967. // "href",
  968. // "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
  969. // );
  970. // elt.setAttribute("download", "file.png");
  971. // elt.style.display = "none";
  972. // document.body.appendChild(elt);
  973. // elt.click();
  974. var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
  975. console.log("获得地址数据:", downloadPath);
  976. var downloadLink = document.createElement("a");
  977. downloadLink.style.display = "none"; // 使其隐藏
  978. downloadLink.href = downloadPath;
  979. downloadLink.download = "";
  980. downloadLink.click();
  981. document.body.appendChild(downloadLink);
  982. document.body.removeChild(downloadLink);
  983. ElMessage({
  984. type: "success",
  985. showClose: true,
  986. message: res.data.message,
  987. center: true,
  988. });
  989. } else {
  990. ElMessage({
  991. type: "error",
  992. showClose: true,
  993. message: res.data.message,
  994. center: true,
  995. });
  996. }
  997. }, 300);
  998. // 表格斑马纹颜色修改
  999. const tableRowClassName = ({ row, rowIndex }) => {
  1000. if (rowIndex % 2 === 0) {
  1001. return "even";
  1002. } else if (rowIndex % 2 !== 0) {
  1003. return "odd";
  1004. }
  1005. return "";
  1006. };
  1007. // 分页
  1008. const handleCurrentChange = (value) => {
  1009. currentPage.value = value;
  1010. getList();
  1011. };
  1012. // 分页
  1013. const handleCurrentChange2 = (value) => {
  1014. console.log(value);
  1015. currentPage2.value = value;
  1016. getList();
  1017. };
  1018. // 监控派车弹窗选择车牌时容量发生变化
  1019. watch(
  1020. () => ruleForm.busname,
  1021. (newValue, oldValue) => {
  1022. // console.log("person的job变化了", newValue);
  1023. let volume = 0;
  1024. newValue.forEach((item) => {
  1025. busNum.list.forEach((i) => {
  1026. if (item == i.car_number) {
  1027. volume = volume + i.contain;
  1028. }
  1029. });
  1030. });
  1031. // console.log(volume);
  1032. ruleForm.volume = volume;
  1033. }
  1034. );
  1035. onBeforeMount(() => {
  1036. api.value = store.state.user.api;
  1037. pathNum.list = JSON.parse(sessionStorage.getItem("pathSelect"));
  1038. busNum.list = JSON.parse(sessionStorage.getItem("busSelect"));
  1039. // busNum.list = JSON.parse(sessionStorage.getItem("busSelect"));
  1040. let route_endSelect = JSON.parse(sessionStorage.getItem("route_endSelect"));
  1041. route_endSelect.forEach((item) => {
  1042. endNum.list.push(item.route_end);
  1043. });
  1044. busNum.list.forEach((item) => {
  1045. initials.list.push(item.car_number);
  1046. });
  1047. options.value = Array.from({ length: initials.list.length }).map(
  1048. (_, idx) => ({
  1049. value: `${initials.list[idx % 10]}`,
  1050. label: `${initials.list[idx % 10]}`,
  1051. })
  1052. );
  1053. getList();
  1054. goBackNum();
  1055. });
  1056. </script>
  1057. <style scoped lang="scss">
  1058. .content-box {
  1059. width: 97.5%;
  1060. height: 89%;
  1061. margin: 20px auto;
  1062. background-color: #fff;
  1063. color: #fff;
  1064. display: flex;
  1065. flex-direction: column;
  1066. .left {
  1067. width: calc(100wh - 40px);
  1068. display: flex;
  1069. align-items: center;
  1070. height: 60px !important;
  1071. margin: 0 30px;
  1072. // padding: 10px 0;
  1073. border-bottom: 1px solid #ccc;
  1074. color: #000;
  1075. font-size: 18px;
  1076. font-weight: 600;
  1077. .cameratxt {
  1078. margin-right: 15px;
  1079. display: flex;
  1080. align-items: center;
  1081. height: 60px !important;
  1082. }
  1083. }
  1084. :deep(.sendBus) {
  1085. // height: 420px;
  1086. border-radius: 11px;
  1087. .el-dialog__header {
  1088. border-radius: 11px 11px 0 0;
  1089. background: rgba(237, 241, 245, 1);
  1090. font-weight: 600;
  1091. margin: 0;
  1092. .el-dialog__headerbtn {
  1093. outline: none;
  1094. }
  1095. }
  1096. .el-dialog__body {
  1097. padding: 30px 20px 10px 20px;
  1098. .el-form-item--feedback {
  1099. .el-input__validateIcon {
  1100. color: rgba(61, 81, 232, 1);
  1101. }
  1102. }
  1103. .el-form-item.is-error .el-input__validateIcon {
  1104. color: red;
  1105. }
  1106. .el-input {
  1107. width: 200px;
  1108. }
  1109. .options {
  1110. margin-left: 200px;
  1111. }
  1112. }
  1113. }
  1114. .middle {
  1115. width: 96%;
  1116. margin: 0 auto;
  1117. display: flex;
  1118. flex-wrap: wrap;
  1119. align-items: center;
  1120. justify-content: space-between;
  1121. color: #000;
  1122. border-bottom: 1px solid rgb(231, 231, 231);
  1123. padding: 10px 0;
  1124. // 添加员工弹窗样式
  1125. .filter {
  1126. display: flex;
  1127. flex-wrap: wrap;
  1128. align-items: center;
  1129. // width: 100%;
  1130. .condition {
  1131. display: flex;
  1132. align-items: center;
  1133. margin: 10px 20px 10px 0;
  1134. :deep(.el-input .el-input__inner) {
  1135. font-size: 16px;
  1136. }
  1137. span {
  1138. margin: 0 5px 0 0;
  1139. }
  1140. }
  1141. }
  1142. .import {
  1143. margin: 10px 0;
  1144. }
  1145. .gongneng {
  1146. margin: 10px 0;
  1147. }
  1148. :deep(.cont) {
  1149. width: 60%;
  1150. margin: 20px auto;
  1151. }
  1152. :deep(.download) {
  1153. display: flex;
  1154. align-items: center;
  1155. margin: 10px;
  1156. }
  1157. :deep(.download span) {
  1158. font-size: 16px;
  1159. margin-left: 20px;
  1160. }
  1161. :deep(.cont .el-button) {
  1162. margin-left: 60px;
  1163. margin-bottom: 30px;
  1164. }
  1165. :deep(.cont .accomplish) {
  1166. width: 100%;
  1167. display: flex;
  1168. justify-content: center;
  1169. }
  1170. :deep(.cont .accomplish .el-button) {
  1171. width: 50%;
  1172. margin: 0;
  1173. }
  1174. }
  1175. .footerMenu {
  1176. width: 96%;
  1177. margin: 10px auto 0;
  1178. display: flex;
  1179. align-items: center;
  1180. // height: 40px;
  1181. .menuList {
  1182. padding: 5px 12px;
  1183. border-bottom: 2px solid transparent;
  1184. // color: rgba(61, 81, 232, 1);
  1185. color: rgba(128, 128, 128, 1);
  1186. cursor: pointer;
  1187. // font-size: 16px;
  1188. font-weight: 600;
  1189. }
  1190. .menuListActive {
  1191. border-bottom: 2px solid rgba(61, 81, 232, 1);
  1192. color: rgba(61, 81, 232, 1);
  1193. font-size: 17px;
  1194. }
  1195. }
  1196. .footer.mingxi {
  1197. :deep(.el-table__header-wrapper) {
  1198. height: 50px;
  1199. .el-table__header {
  1200. height: 50px;
  1201. }
  1202. }
  1203. .el-table--fit {
  1204. height: 100%;
  1205. :deep(.el-table__row) {
  1206. height: 50px;
  1207. }
  1208. }
  1209. }
  1210. .footer {
  1211. width: 96%;
  1212. height: 510px;
  1213. margin: 20px auto 20px;
  1214. :deep(.el-table__header-wrapper) {
  1215. height: 48px;
  1216. .el-table__header {
  1217. height: 48px;
  1218. font-size: 16px;
  1219. color: #000;
  1220. }
  1221. }
  1222. .el-table--fit {
  1223. height: 100%;
  1224. :deep(.el-table__row) {
  1225. height: 48px;
  1226. font-size: 16px;
  1227. color: #000;
  1228. }
  1229. :deep(.el-table__row td) {
  1230. padding: 0;
  1231. border: 0;
  1232. }
  1233. :deep(.look) {
  1234. padding: 3px 10px;
  1235. border-radius: 40px;
  1236. border: 0.74px solid rgba(30, 125, 251, 1);
  1237. }
  1238. // 输出链接弹窗样式
  1239. :deep(.link .el-dialog__header) {
  1240. text-align: left;
  1241. font-size: 20px;
  1242. font-weight: 600;
  1243. }
  1244. :deep(.link .el-dialog__body) {
  1245. padding: 10px 20px;
  1246. height: 100px;
  1247. margin-bottom: 10px;
  1248. }
  1249. .link {
  1250. .linkcontent {
  1251. text-align: left;
  1252. height: 100px;
  1253. border: 1px solid #ccc;
  1254. p {
  1255. margin: 5px 10px;
  1256. }
  1257. }
  1258. }
  1259. :deep(.playVideo .el-dialog__header) {
  1260. text-align: left;
  1261. font-size: 20px;
  1262. font-weight: 600;
  1263. background-color: #ccc;
  1264. margin-right: 0;
  1265. }
  1266. :deep(.playVideo .el-dialog__body) {
  1267. height: 600px;
  1268. }
  1269. .el-button--primary {
  1270. margin-left: 5px;
  1271. }
  1272. :deep(.el-table__body .even) {
  1273. background-color: #fff;
  1274. }
  1275. :deep(.el-table__body .odd) {
  1276. background-color: rgba(240, 243, 247, 1);
  1277. }
  1278. }
  1279. }
  1280. .footers {
  1281. width: 96%;
  1282. height: 550px;
  1283. margin: 20px auto 20px;
  1284. :deep(.el-table__header-wrapper) {
  1285. height: 48px;
  1286. .el-table__header {
  1287. height: 48px;
  1288. font-size: 16px;
  1289. color: #000;
  1290. }
  1291. }
  1292. .el-table--fit {
  1293. height: 100%;
  1294. :deep(.el-table__row) {
  1295. height: 48px;
  1296. font-size: 16px;
  1297. color: #000;
  1298. }
  1299. :deep(.el-table__row td) {
  1300. padding: 0;
  1301. border: 0;
  1302. }
  1303. :deep(.look) {
  1304. padding: 3px 10px;
  1305. border-radius: 40px;
  1306. border: 0.74px solid rgba(30, 125, 251, 1);
  1307. }
  1308. // 输出链接弹窗样式
  1309. :deep(.link .el-dialog__header) {
  1310. text-align: left;
  1311. font-size: 20px;
  1312. font-weight: 600;
  1313. }
  1314. :deep(.link .el-dialog__body) {
  1315. padding: 10px 20px;
  1316. height: 100px;
  1317. margin-bottom: 10px;
  1318. }
  1319. .link {
  1320. .linkcontent {
  1321. text-align: left;
  1322. height: 100px;
  1323. border: 1px solid #ccc;
  1324. p {
  1325. margin: 5px 10px;
  1326. }
  1327. }
  1328. }
  1329. :deep(.playVideo .el-dialog__header) {
  1330. text-align: left;
  1331. font-size: 20px;
  1332. font-weight: 600;
  1333. background-color: #ccc;
  1334. margin-right: 0;
  1335. }
  1336. :deep(.playVideo .el-dialog__body) {
  1337. height: 600px;
  1338. }
  1339. .el-button--primary {
  1340. margin-left: 5px;
  1341. }
  1342. :deep(.el-table__body .even) {
  1343. background-color: #fff;
  1344. }
  1345. :deep(.el-table__body .odd) {
  1346. background-color: rgba(240, 243, 247, 1);
  1347. }
  1348. }
  1349. }
  1350. .el-pagination {
  1351. // width: 1600px;
  1352. width: 96%;
  1353. margin: 0 auto 18px;
  1354. justify-content: flex-end;
  1355. :deep(.el-pagination__total) {
  1356. color: #000;
  1357. }
  1358. :deep(.el-pagination__goto) {
  1359. color: #000;
  1360. }
  1361. :deep(.el-pagination__classifier) {
  1362. color: #000;
  1363. }
  1364. :deep(.el-input__wrapper) {
  1365. border: 1px solid rgba(0, 0, 0, 1);
  1366. border-radius: 5px;
  1367. box-shadow: none;
  1368. }
  1369. :deep(.el-pager li) {
  1370. margin: 0 5px;
  1371. border: 1px solid rgba(0, 0, 0, 1);
  1372. border-radius: 5px;
  1373. background-color: transparent;
  1374. }
  1375. :deep(.el-pager li.is-active) {
  1376. background-color: rgba(30, 125, 251, 1);
  1377. }
  1378. :deep(.btn-prev) {
  1379. margin-right: 5px;
  1380. border: 1px solid rgba(0, 0, 0, 1);
  1381. border-radius: 5px;
  1382. background-color: transparent;
  1383. }
  1384. :deep(.btn-next) {
  1385. margin-left: 5px;
  1386. border: 1px solid rgba(0, 0, 0, 1);
  1387. border-radius: 5px;
  1388. background-color: transparent;
  1389. }
  1390. }
  1391. }
  1392. .el-input {
  1393. width: 192px;
  1394. }
  1395. </style>