index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <el-form-item prop="unitId">
  11. <!-- <el-input
  12. v-model="queryParams.unitId"
  13. placeholder="请输入单位"
  14. clearable
  15. size="small"
  16. @keyup.enter.native="handleQuery"
  17. /> -->
  18. <el-select
  19. v-model="queryParams.peopleId"
  20. placeholder="请选择用车人姓名"
  21. @change="handleQuery"
  22. filterable
  23. class="input_xiala"
  24. >
  25. <el-option
  26. v-for="item in renYuans"
  27. :key="item.id"
  28. :label="item.name"
  29. :value="item.id"
  30. class="input_xiala"
  31. >
  32. </el-option>
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item>
  36. <!-- <el-button
  37. type="primary"
  38. icon="el-icon-search"
  39. size="mini"
  40. @click="handleQuery"
  41. >搜索</el-button
  42. > -->
  43. <el-button size="btr" @click="resetQuery"
  44. >重置</el-button
  45. >
  46. </el-form-item>
  47. </el-form>
  48. <!-- 列表选项 -->
  49. <el-table
  50. v-loading="loading"
  51. :data="thebusApplyList"
  52. @selection-change="handleSelectionChange"
  53. :header-cell-style="{ background: '#003C69', color: 'white' }"
  54. >
  55. <el-table-column type="selection" width="55" align="center" />
  56. <el-table-column label="序号" align="center" prop="id">
  57. <template scope="scope">
  58. <span>{{
  59. (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
  60. }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="车辆型号" align="center" prop="unitName" />
  64. <el-table-column label="用车人员单位" align="center" prop="unitName" />
  65. <el-table-column label="用车人员姓名" align="center" prop="peopleName" />
  66. <el-table-column label="联系方式" align="center" prop="contact" />
  67. <!-- <el-table-column label="事由" align="center" prop="cause" /> -->
  68. <el-table-column label="出车路线" align="center" prop="route" />
  69. <el-table-column label="出车状态" align="center" prop="">
  70. <template slot-scope="scope">
  71. <el-col v-if="scope.row.outstatus == 0" style="color: #ffba00"
  72. >未出车</el-col
  73. >
  74. <el-col v-if="scope.row.outstatus == 1" style="color: #13ce66"
  75. >已出车</el-col
  76. >
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="出车时间" align="center" prop="authEtime">
  80. <template slot-scope="scope">
  81. <span>{{ parseTime(scope.row.authEtime, "{y}-{m}-{d}") }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column
  85. label="操作"
  86. align="center"
  87. class-name="small-padding fixed-width"
  88. width="200"
  89. >
  90. <template slot-scope="scope">
  91. <el-button
  92. v-if="scope.row.outstatus == 0"
  93. size="btu"
  94. type="text"
  95. @click="handleAdd(scope.row)"
  96. v-hasPermi="['militaryvehicleManagement:thebusApply:edit']"
  97. >出车</el-button
  98. >
  99. <el-button
  100. class="a1"
  101. v-else
  102. size=""
  103. type="text"
  104. @click="singles(scope.row)"
  105. v-hasPermi="['militaryvehicleManagement:thebusApply:edit']"
  106. >查看</el-button
  107. >
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. <pagination
  112. v-show="total > 0"
  113. :total="total"
  114. :page.sync="queryParams.pageNum"
  115. :limit.sync="queryParams.pageSize"
  116. @pagination="getList"
  117. />
  118. <!-- 出车会话框 -->
  119. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
  120. <el-form
  121. ref="form"
  122. :model="form"
  123. :rules="rules"
  124. label-width="80px"
  125. inline
  126. >
  127. <el-form-item label="单位" prop="unitId">
  128. <el-input
  129. placeholder="选择单位"
  130. v-model="form.unitName"
  131. readonly
  132. ></el-input>
  133. </el-form-item>
  134. <el-form-item label="人员名称" prop="peopleId">
  135. <el-input
  136. placeholder="请选择人员名称"
  137. v-model="form.peopleName"
  138. readonly
  139. ></el-input>
  140. </el-form-item>
  141. <el-form-item label="人数" prop="peopleCount">
  142. <el-input
  143. v-model="form.peopleCount"
  144. placeholder="请输入人数"
  145. readonly
  146. />
  147. </el-form-item>
  148. <el-form-item label="联系方式" prop="contact">
  149. <el-input
  150. v-model="form.contact"
  151. placeholder="请输入联系方式"
  152. readonly
  153. />
  154. </el-form-item>
  155. <el-form-item label="外出事由" prop="cause">
  156. <el-input
  157. v-model="form.cause"
  158. placeholder="请输入外出事由"
  159. readonly
  160. />
  161. </el-form-item>
  162. <div class="box3">
  163. <el-form v-for="(item1, e) in checkShop" :key="e">
  164. <el-form-item label="" prop="bdglThebusId">
  165. <el-select
  166. v-model="item1.bdglThebusId"
  167. placeholder="请选择车辆车牌"
  168. filterable
  169. >
  170. <el-option
  171. v-for="(item, i) in chucarlist"
  172. :key="i"
  173. :label="item.vehiclenumber"
  174. :value="item.id"
  175. @click.native="chuche"
  176. >
  177. </el-option>
  178. </el-select>
  179. </el-form-item>
  180. <el-form-item label="" prop="twoshenpirenid">
  181. <el-select
  182. v-model="item1.driverId"
  183. placeholder="请选择司机"
  184. filterable
  185. >
  186. <el-option
  187. v-for="(item, i) in driverList"
  188. :key="i"
  189. :label="item.peopleName"
  190. :value="item.id"
  191. >
  192. </el-option>
  193. </el-select>
  194. </el-form-item>
  195. <el-form-item>
  196. <el-button
  197. type="primary"
  198. icon="el-icon-plus"
  199. size="btc"
  200. @click="addForms"
  201. v-if="e == checkShop.length - 1"
  202. ></el-button>
  203. <el-button
  204. type="primary"
  205. icon="el-icon-delete"
  206. size="btd"
  207. v-if="e > 0"
  208. @click="delForms(e)"
  209. ></el-button>
  210. </el-form-item>
  211. </el-form>
  212. </div>
  213. <div class="jiben">出车路线</div>
  214. <el-form-item prop="route">
  215. <el-input
  216. v-model="form.route"
  217. type="textarea"
  218. placeholder="请输入出车路线"
  219. disabled
  220. />
  221. </el-form-item>
  222. </el-form>
  223. <div slot="footer" class="dialog-footer">
  224. <el-button type="primary" @click="submitForm">确 定</el-button>
  225. <el-button @click="cancel" size="btn">取 消</el-button>
  226. </div>
  227. </el-dialog>
  228. <!-- 查看会话框 -->
  229. <el-dialog
  230. title="查看可出车列表"
  231. :visible.sync="opens"
  232. width="500px"
  233. append-to-body
  234. :close-on-click-modal="false"
  235. >
  236. <el-form
  237. ref="form"
  238. :model="forms"
  239. :rules="rules"
  240. label-width="80px"
  241. inline
  242. >
  243. <el-form-item label="单位" prop="unitId">
  244. <el-input v-model="forms.unitName"></el-input>
  245. </el-form-item>
  246. <el-form-item label="人员名称" prop="peopleId">
  247. <el-input v-model="forms.peopleName"></el-input>
  248. </el-form-item>
  249. <el-form-item label="人数" prop="peopleCount">
  250. <el-input v-model="forms.peopleCount" />
  251. </el-form-item>
  252. <el-form-item label="联系方式" prop="contact">
  253. <el-input v-model="forms.contact" />
  254. </el-form-item>
  255. <el-form-item label="外出事由" prop="cause">
  256. <el-input v-model="forms.cause" />
  257. </el-form-item>
  258. <div class="box4">
  259. <table border="1"
  260. style="
  261. border-collapse: collapse;
  262. border: none;
  263. mso-border-left-alt: 0.5pt solid windowtext;
  264. mso-border-top-alt: 0.5pt solid windowtext;
  265. mso-border-right-alt: 0.5pt solid windowtext;
  266. mso-border-bottom-alt: 0.5pt solid windowtext;
  267. mso-border-insideh: 0.5pt solid windowtext;
  268. mso-border-insidev: 0.5pt solid windowtext;
  269. mso-padding-alt: 0pt 0pt 0pt 0pt;
  270. "
  271. width="907px"
  272. >
  273. <tbody style="">
  274. <tr align="center" class="tr">
  275. <td width="220" height="40">车牌型号</td>
  276. <td width="220" height="40">号牌号码</td>
  277. <td width="220" height="40">司机</td>
  278. <td width="220" height="40">司机联系方式</td>
  279. </tr>
  280. <tr
  281. align="center"
  282. class="tr"
  283. v-for="(item, i) in chaCarLists"
  284. :key="i"
  285. >
  286. <td width="220" height="40">
  287. <template>
  288. {{ names }}
  289. </template>
  290. </td>
  291. <td width="220" height="40">{{ item.vehiclenumber }}</td>
  292. <td width="220" height="40">{{ item.driverName }}</td>
  293. <td width="220" height="40">{{ item.driverPhone }}</td>
  294. </tr>
  295. </tbody>
  296. </table>
  297. </div>
  298. </el-form>
  299. </el-dialog>
  300. </div>
  301. </template>
  302. <script>
  303. import {
  304. listThebusApply,
  305. getThebusApply,
  306. delThebusApply,
  307. exportThebusApply,
  308. exportThebusCar,
  309. exportThebusCha,
  310. zaiweiCar,
  311. } from "@/api/militaryvehicleManagement/thebusApply";
  312. // 查询字典
  313. import { getDicts } from "@/api/system/dict/data";
  314. import { listDriver } from "@/api/militaryvehicleManagement/driver";
  315. import { getAll } from "@/api/grassrootsregistration/bdglmeeting";
  316. // import {} from "@/api/militaryvehicleManagement/thebus";
  317. export default {
  318. name: "ThebusApply",
  319. data() {
  320. return {
  321. // 遮罩层
  322. loading: true,
  323. // 导出遮罩层
  324. exportLoading: false,
  325. // 选中数组
  326. ids: [],
  327. // 非单个禁用
  328. single: true,
  329. // 非多个禁用
  330. multiple: true,
  331. // 显示搜索条件
  332. showSearch: true,
  333. // 总条数
  334. total: 0,
  335. // 用车申请表格数据
  336. thebusApplyList: [],
  337. // 弹出层标题
  338. title: "",
  339. // 是否显示弹出层
  340. open: false,
  341. // 查询参数
  342. queryParams: {
  343. pageNum: 1,
  344. pageSize: 10,
  345. },
  346. // 表单参数
  347. form: {},
  348. // 表单校验
  349. rules: {},
  350. // 人员列表
  351. renYuan: [],
  352. //出车对话框司机
  353. checkShop: [
  354. {
  355. vehiclemodel: null,
  356. driverId: null,
  357. },
  358. ],
  359. // 车牌型号
  360. brand: [],
  361. // 司机
  362. driverList: [],
  363. // 查看
  364. forms: {},
  365. // 查看框显示
  366. opens: false,
  367. // 外面的人员
  368. renYuans: [],
  369. // 查看司机,车辆列表
  370. chaCarLists: [],
  371. // 出车获取车辆列表
  372. chucarlist: [],
  373. // 车牌型号的保存
  374. names: "",
  375. };
  376. },
  377. created() {
  378. this.getList();
  379. this.getSuo();
  380. getDicts("brand").then((response) => {
  381. this.brand = response.data;
  382. });
  383. },
  384. methods: {
  385. // 翻译车牌型号
  386. car(value) {
  387. console.log(value, 1);
  388. this.brand.map((item) => {
  389. if (item.dictValue == value) {
  390. this.names = item.dictLabel;
  391. }
  392. console.log(this.names);
  393. // return this.names;
  394. });
  395. },
  396. chuche(data) {
  397. console.log(data);
  398. },
  399. // 获取搜索所有人
  400. getSuo() {
  401. getAll().then((res) => {
  402. this.renYuans = res.rows;
  403. });
  404. },
  405. // 查看
  406. singles(row) {
  407. this.form = row;
  408. exportThebusCha(this.form).then((res) => {
  409. this.forms = res.data;
  410. this.opens = true;
  411. this.chaCarLists = res.data.bdglDepartureInfos;
  412. this.car(this.chaCarLists[0].vehiclemodel);
  413. });
  414. },
  415. // 获取司机
  416. getSi() {
  417. listDriver().then((response) => {
  418. this.driverList = response.rows;
  419. });
  420. },
  421. // 获取车辆型号
  422. getCar() {
  423. zaiweiCar().then((res) => {
  424. this.chucarlist = res.rows;
  425. console.log(res);
  426. });
  427. },
  428. // 删除对话框查铺
  429. delForms(i) {
  430. this.checkShop.splice(i, 1);
  431. },
  432. // 增加对话框查铺
  433. addForms() {
  434. this.checkShop.push({
  435. driverId: null,
  436. vehiclemodel: null,
  437. });
  438. },
  439. /** 查询出车申请列表 */
  440. getList() {
  441. this.loading = true;
  442. listThebusApply(this.queryParams).then((response) => {
  443. this.thebusApplyList = response.rows;
  444. this.total = response.total;
  445. this.loading = false;
  446. });
  447. },
  448. // 取消按钮
  449. cancel() {
  450. this.open = false;
  451. this.reset();
  452. },
  453. // 表单重置
  454. reset() {
  455. this.form = {};
  456. this.resetForm("form");
  457. },
  458. /** 搜索按钮操作 */
  459. handleQuery() {
  460. this.queryParams.pageNum = 1;
  461. this.getList();
  462. },
  463. /** 重置按钮操作 */
  464. resetQuery() {
  465. this.queryParams.peopleId = null;
  466. this.resetForm("queryForm");
  467. this.handleQuery();
  468. },
  469. // 多选框选中数据
  470. handleSelectionChange(selection) {
  471. this.ids = selection.map((item) => item.id);
  472. this.single = selection.length !== 1;
  473. this.multiple = !selection.length;
  474. },
  475. /** 出车按钮操作 */
  476. handleAdd(row) {
  477. this.form.id = row.id;
  478. this.form = row;
  479. this.getCar();
  480. this.getSi();
  481. this.open = true;
  482. this.title = "选择司机";
  483. },
  484. /** 修改按钮操作 */
  485. handleUpdate(row) {
  486. this.reset();
  487. this.getTreeList();
  488. const id = row.id || this.ids;
  489. getThebusApply(id).then((response) => {
  490. this.form = response.data;
  491. this.getRen(this.form.unitId);
  492. this.open = true;
  493. this.title = "修改用车申请";
  494. });
  495. },
  496. /** 提交按钮 */
  497. submitForm() {
  498. this.form.bdglDepartureInfos = this.checkShop;
  499. this.form.outstatus = "1";
  500. exportThebusCar(this.form).then((response) => {
  501. this.$modal.msgSuccess("新增成功");
  502. this.open = false;
  503. this.getList();
  504. });
  505. },
  506. /** 删除按钮操作 */
  507. handleDelete(row) {
  508. const ids = row.id || this.ids;
  509. this.$modal
  510. .confirm("是否确认删除用车申请的数据项?")
  511. .then(function () {
  512. return delThebusApply(ids);
  513. })
  514. .then(() => {
  515. this.getList();
  516. this.$modal.msgSuccess("删除成功");
  517. })
  518. .catch(() => {});
  519. },
  520. /** 导出按钮操作 */
  521. handleExport() {
  522. const queryParams = this.queryParams;
  523. this.$modal
  524. .confirm("是否确认导出所有用车申请数据项?")
  525. .then(() => {
  526. this.exportLoading = true;
  527. return exportThebusApply(queryParams);
  528. })
  529. .then((response) => {
  530. this.$download.name(response.msg);
  531. this.exportLoading = false;
  532. })
  533. .catch(() => {});
  534. },
  535. },
  536. };
  537. </script>
  538. <style scoped>
  539. /* 对话框背景颜色 */
  540. ::v-deep .el-dialog {
  541. background: #004d86 !important;
  542. width: 800px !important;
  543. }
  544. ::v-deep .el-textarea__inner {
  545. width: 920px;
  546. height: 104px;
  547. margin: auto;
  548. }
  549. ::v-deep .el-dialog__header {
  550. border-bottom: 1px solid #718a9d;
  551. }
  552. ::v-deep .el-dialog__title {
  553. color: #fff;
  554. font: 18px;
  555. }
  556. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  557. color: #fff;
  558. }
  559. ::v-deep .el-form-item__label {
  560. font: 16px;
  561. color: #fff;
  562. width: 100px !important;
  563. }
  564. ::v-deep .el-input__inner {
  565. /* width: 200px !important;
  566. height: 36px; */
  567. background: transparent;
  568. color: #fff;
  569. border: 1px solid white !important;
  570. }
  571. /* 单位框背景颜色 */
  572. ::v-deep .vue-treeselect__control {
  573. background: #004d86 !important;
  574. }
  575. /* 基本信息背景 */
  576. .jiben {
  577. width: 920px;
  578. height: 32px;
  579. background-image: url(../../../images/小标题底.png);
  580. margin-bottom: 25px;
  581. color: #fff;
  582. padding-left: 16px;
  583. line-height: 32px;
  584. }
  585. /*调整表单间距 */
  586. ::v-deep .el-form-item__content {
  587. width: 200px;
  588. }
  589. ::v-deep .el-input__inner {
  590. cursor: pointer !important;
  591. }
  592. /* 底部确定取消按钮 */
  593. ::v-deep .el-dialog__footer {
  594. padding: 30px 50px;
  595. }
  596. ::v-deep .el-dialog__body {
  597. margin: 10px 24px 20px 30px;
  598. padding-top: 20px !important;
  599. box-sizing: border-box;
  600. /* padding: 30px 12px 30px 28px; */
  601. }
  602. .contents {
  603. padding: 0px 40px !important;
  604. }
  605. /* 下拉菜单 */
  606. .el-dropdown-link {
  607. cursor: pointer;
  608. color: #409eff;
  609. }
  610. .el-icon-arrow-down {
  611. font-size: 12px;
  612. }
  613. /* 下拉菜单字体/背景颜色 */
  614. .el-select-dropdown__item.hover,
  615. .el-select-dropdown__item:hover {
  616. background-color: #004d86;
  617. color: #111;
  618. }
  619. .el-select-dropdown__item {
  620. color: #111;
  621. }
  622. /* 时间选择 */
  623. ::v-deep .el-input--small .el-input__inner {
  624. width: 200px;
  625. height: 36px;
  626. line-height: 36px;
  627. }
  628. .el-date-editor.el-input {
  629. width: 200px;
  630. height: 36px;
  631. line-height: 36px;
  632. }
  633. ::v-deep .el-date-editor.el-input .el-input__inner {
  634. height: 36px;
  635. line-height: 36px;
  636. }
  637. /* 单位框背景颜色 */
  638. ::v-deep .vue-treeselect__control {
  639. background: #004d86 !important;
  640. color: #fff;
  641. }
  642. /* 单位下拉菜单选中字体颜色 */
  643. ::v-deep .vue-treeselect__single-value {
  644. color: #fff !important;
  645. }
  646. /* 分页按钮 */
  647. ::v-deep .el-pagination.is-background .el-pager li {
  648. background-color: #004d86;
  649. color: #fff;
  650. }
  651. ::v-deep .el-pagination.is-background .btn-next {
  652. background-color: #004d86;
  653. color: #fff;
  654. }
  655. /* 底部确定取消按钮 */
  656. ::v-deep .el-dialog__footer {
  657. padding: 18px 50px;
  658. margin-right: 28px;
  659. }
  660. /* 增加按钮弹框 */
  661. ::v-deep .el-dialog {
  662. width: 1060px !important;
  663. }
  664. ::v-deep .el-dialog__body {
  665. padding: 30px 35px;
  666. }
  667. /* 小手样式 */
  668. ::v-deep .el-table__cell {
  669. cursor: pointer;
  670. }
  671. .el-button--mini {
  672. width: 80px !important;
  673. border: 1px solid transparent;
  674. padding: 3px 8px;
  675. font-size: 14px;
  676. line-height: 1.5;
  677. border-radius: 3px;
  678. color: #fff;
  679. background-color: #1890ff;
  680. }
  681. .box3 {
  682. width: 920px;
  683. min-height: 70px;
  684. border: 1px solid white;
  685. border-radius: 5px;
  686. /* background: #409eff; */
  687. margin-bottom: 30px;
  688. padding-top: 15px;
  689. padding-left: 15px;
  690. }
  691. /* 调整输入框提示文字颜色 */
  692. ::v-deep .vue-treeselect__placeholder {
  693. color: #bdbdbd4f !important;
  694. }
  695. ::v-deep input::-webkit-input-placeholder {
  696. color: #bdbdbd4f !important;
  697. }
  698. ::v-deep input:-moz-placeholder {
  699. color: #bdbdbd4f !important;
  700. }
  701. /* 查看表格 */
  702. .box4 {
  703. width: 923px;
  704. min-height: 70px;
  705. border-radius: 5px;
  706. /* background: #409eff; */
  707. margin-bottom: 30px;
  708. padding-top: 15px;
  709. padding-left: 15px;
  710. }
  711. .box4 tr {
  712. color: #fff;
  713. }
  714. .box4 .tr td {
  715. border-bottom: 1px solid #fff;
  716. }
  717. .box4 table {
  718. border-color: #fff;
  719. }
  720. ::v-deep .box4 table td {
  721. border-bottom: 1px solid white !important;
  722. }
  723. .a1{
  724. width: 46px !important;
  725. border: 1px solid transparent;
  726. padding: 3px 8px;
  727. font-size: 14px;
  728. line-height: 1.5;
  729. border-radius: 3px;
  730. color: #fff;
  731. background-color: #1890ff;
  732. }
  733. </style>