index.vue 19 KB

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