statement.vue 36 KB

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