details.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. <template>
  2. <!-- 保养计划审批 -->
  3. <div class="page" v-loading="pageLoading">
  4. <el-form label-width="130px">
  5. <div class="content-detail">
  6. <div class="basic-details">
  7. <HeaderTitle title="基本信息" size="16px"></HeaderTitle>
  8. <el-row>
  9. <el-col :span="12">
  10. <el-col :span="12">
  11. <el-form-item label="计划单号">
  12. <span> {{ data.code }} </span>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :span="12">
  16. <el-form-item label="保养名称">
  17. <span> {{ data.name }} </span>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="12">
  21. <el-form-item label="保养部门">
  22. <span v-if="data.executor && data.executor.length">
  23. {{ data.executor[0].groupName }}
  24. </span>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="12">
  28. <el-form-item label="保养人员">
  29. <span v-if="data.executor && data.executor.length">
  30. {{ data.executor.map((i) => i.name).join(',') }}
  31. </span>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="12">
  35. <el-form-item label="计划完成时长">
  36. <span v-if="data.duration >= 0">{{ data.duration }}分钟</span>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="12">
  40. <el-form-item label="设备分类">
  41. <span> {{ data.categoryLevelName }} </span>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="12">
  45. <el-form-item label="规则名称">
  46. <span> {{ data.ruleInfo && data.ruleInfo.name }} </span>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="12">
  50. <el-form-item label="创建人">
  51. <span> {{ data.createUserName }} </span>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="12">
  55. <el-form-item label="创建部门">
  56. <span> {{ data.createUserGroupName }} </span>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="12">
  60. <el-form-item label="创建时间">
  61. <span> {{ data.createTime }} </span>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="24">
  65. <el-form-item label="备注">
  66. <span> {{ data.remark }} </span>
  67. </el-form-item>
  68. </el-col>
  69. </el-col>
  70. <el-col :span="12">
  71. <img :src="data.imageUrl" alt="" />
  72. </el-col>
  73. </el-row>
  74. </div>
  75. <!-- 保养、保养设备 -->
  76. <div class="maintain_equipment_info">
  77. <HeaderTitle title="保养设备" size="16px"></HeaderTitle>
  78. <div class="maintain_equipment_info_content">
  79. <div
  80. class="equipment_item"
  81. v-for="item in data.planDeviceList"
  82. :key="item.id"
  83. >
  84. <div class="equipment_info" v-if="item.substance">
  85. <div class="item_info">
  86. <span class="item_label">设备编码</span>
  87. <span class="item_value">{{ item.substance.code }}</span>
  88. </div>
  89. <div class="item_info">
  90. <span class="item_label">设备名称</span>
  91. <span class="item_value">{{ item.substance.name }}</span>
  92. </div>
  93. <div class="item_info">
  94. <span class="item_label">设备型号</span>
  95. <span class="item_value">{{ item.substance.model }}</span>
  96. </div>
  97. <div class="item_info">
  98. <span class="item_label">设备位置</span>
  99. <span class="item_value">{{
  100. item.substance.positionNames
  101. }}</span>
  102. </div>
  103. </div>
  104. <p>操作事项</p>
  105. <div class="matter_info">
  106. <el-table :data="item.workItems" border>
  107. <el-table-column label="序号" align="center" width="80">
  108. <template slot-scope="scope">
  109. <span>{{ scope.$index + 1 }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="事项" prop="item" />
  113. <el-table-column label="内容" prop="content" />
  114. <el-table-column label="标准" prop="standard" />
  115. </el-table>
  116. </div>
  117. <p>备品备件</p>
  118. <div class="matter_info">
  119. <el-table :data="item.sparePart" border>
  120. <el-table-column label="序号" align="center" width="80">
  121. <template slot-scope="scope">
  122. <span>{{ scope.$index + 1 }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column
  126. label="备件名称"
  127. align="center"
  128. prop="categoryName"
  129. >
  130. </el-table-column>
  131. <el-table-column
  132. label="规格型号"
  133. align="center"
  134. prop="modelType"
  135. >
  136. <template slot-scope="{ row }">
  137. {{ row.specification }}/{{ row.model }}
  138. </template>
  139. </el-table-column>
  140. <el-table-column
  141. label="所需数量"
  142. align="center"
  143. prop="needNum"
  144. >
  145. </el-table-column>
  146. <el-table-column label="单位" align="center" prop="unit">
  147. </el-table-column>
  148. </el-table>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. <!-- 保养、审批信息 -->
  154. <div class="examine_info">
  155. <HeaderTitle title="审批信息" size="16px"></HeaderTitle>
  156. <div class="item_row">
  157. <div class="item_info">
  158. <span class="item_label border_top">审批结果</span>
  159. <span class="item_value" v-if="data.approvalResult == 0"
  160. >驳回</span
  161. >
  162. <span class="item_value" v-if="data.approvalResult == 1"
  163. >通过</span
  164. >
  165. </div>
  166. <div class="item_info border_top">
  167. <span class="item_label">审批人</span>
  168. <!-- <span class="item_value">{{ data.verifyUserName }}</span> -->
  169. </div>
  170. <div class="item_info border_right border_top">
  171. <span class="item_label">审批时间</span>
  172. <span class="item_value">{{ data.approvalTime }}</span>
  173. </div>
  174. <div
  175. class="item_info reason border_right"
  176. v-if="data.auditResult == 0"
  177. >
  178. <span class="item_label">驳回原因</span>
  179. <span class="item_value">{{ data.rejectCause }}</span>
  180. </div>
  181. </div>
  182. </div>
  183. <!-- 保养、执行信息 -->
  184. <div class="execute_info">
  185. <HeaderTitle title="执行信息" size="16px"></HeaderTitle>
  186. <el-table :data="data.planWorkOrderList">
  187. <el-table-column label="序号" align="center" width="60">
  188. <template slot-scope="scope">
  189. <span>{{ scope.$index + 1 }}</span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column
  193. label="工单编号"
  194. align="center"
  195. prop="workOrderCode"
  196. />
  197. <el-table-column label="状态" align="center">
  198. <template slot-scope="scope">
  199. <span>{{ scope.row.status.descp }}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column
  203. label="执行部门"
  204. align="center"
  205. prop="executorDeptName"
  206. />
  207. <el-table-column
  208. label="执行人员"
  209. align="center"
  210. prop="executeUserName"
  211. />
  212. <!-- <el-table-column
  213. label="开始时间"
  214. align="center"
  215. prop="acceptTime"
  216. />
  217. <el-table-column
  218. label="完成时间"
  219. align="center"
  220. prop="finishTime"
  221. />
  222. <el-table-column
  223. label="计划工时"
  224. align="center"
  225. prop="planManhour"
  226. />
  227. <el-table-column
  228. label="实际工时"
  229. align="center"
  230. prop="practicalManhour"
  231. /> -->
  232. <el-table-column
  233. label="开始时间"
  234. align="center"
  235. prop="acceptTime"
  236. width="160"
  237. >
  238. <template slot-scope="scope">
  239. {{ scope.row.acceptTime ? scope.row.acceptTime : '-' }}
  240. </template>
  241. </el-table-column>
  242. <el-table-column
  243. label="完成时间"
  244. align="center"
  245. prop="finishTime"
  246. width="160"
  247. >
  248. <template slot-scope="scope">
  249. {{ scope.row.finishTime ? scope.row.finishTime : '-' }}
  250. </template>
  251. </el-table-column>
  252. <el-table-column label="计划工时" align="center" prop="planManhour">
  253. <template slot-scope="{ row }">
  254. <span>{{
  255. row.planManhour ? row.planManhour + '分钟' : '-'
  256. }}</span>
  257. </template>
  258. </el-table-column>
  259. <el-table-column
  260. label="实际工时"
  261. align="center"
  262. prop="practicalManhour"
  263. >
  264. <template slot-scope="{ row }">
  265. <span>{{
  266. row.practicalManhour ? row.practicalManhour + '分钟' : '-'
  267. }}</span>
  268. </template>
  269. </el-table-column>
  270. </el-table>
  271. </div>
  272. <div class="btnbox" v-if="$route.query.isshow">
  273. <el-button class="confirm-btn" type="danger" plain @click="reject"
  274. >驳回</el-button
  275. >
  276. <el-button class="confirm-btn" type="success" plain @click="pass"
  277. >通过</el-button
  278. >
  279. <!-- <el-button class="cancel-btn">关闭</el-button> -->
  280. </div>
  281. <div class="textbox" v-if="showtext" ref="rejectContent">
  282. <el-input
  283. type="textarea"
  284. placeholder="请输入驳回原因"
  285. v-model="cause"
  286. maxlength="30"
  287. rows="5"
  288. show-word-limit
  289. >
  290. </el-input>
  291. <div class="textbtnbox">
  292. <el-button size="small" round @click="cancelreject">取消</el-button>
  293. <el-button size="small" round @click="surereject">提交</el-button>
  294. </div>
  295. </div>
  296. </div>
  297. </el-form>
  298. </div>
  299. </template>
  300. <script>
  301. // import { getDetail, sendAudit } from '@/api/stockManagement/stocking'
  302. // import { useDictLabel, patrolMatterStatus } from '@/utils/dict/index'
  303. import { getById } from '@/api/maintenance/patrol_maintenance';
  304. export default {
  305. data () {
  306. return {
  307. num: 1,
  308. infoData: {
  309. type: '',
  310. area: { province: {}, area: {}, city: {} },
  311. mgrOrg: {},
  312. manager: {}
  313. },
  314. dialogVisible: false,
  315. data: {},
  316. pageLoading: false,
  317. typeValue: null,
  318. contract_type: [],
  319. cycleOptObj: {
  320. 1: '时/次',
  321. 2: '天/次',
  322. //3: '周/次',
  323. 4: '月/次',
  324. 5: '年/次',
  325. 11: '次/天',
  326. //12: '次/周',
  327. 13: '次/月',
  328. 14: '次/年'
  329. },
  330. status: [
  331. {
  332. value: true,
  333. label: '失效'
  334. },
  335. {
  336. value: false,
  337. label: '生效'
  338. }
  339. ],
  340. ruleItem: [],
  341. cause: '',
  342. showtext: false
  343. };
  344. },
  345. async created () {
  346. this.getInfo();
  347. },
  348. methods: {
  349. // getStatus: useDictLabel(patrolMatterStatus),
  350. delete () {},
  351. // 点击切换事件
  352. tab (index) {
  353. this.num = index;
  354. },
  355. // 表格数据
  356. async getInfo () {
  357. let res = await getById(this.$route.query.id).catch(() => {
  358. this.pageLoading = false;
  359. });
  360. if (res?.data) {
  361. this.data = res.data;
  362. this.data.planEquiList = this.data.planEquiList.filter(
  363. (item) => item.itemList && item.itemList.length > 0
  364. );
  365. }
  366. this.pageLoading = false;
  367. },
  368. //通过按钮事件
  369. pass () {
  370. let params = {
  371. id: this.$route.query.id,
  372. checked: true,
  373. myHandleId: this.$route.query.dbid,
  374. cause: '',
  375. type: 2,
  376. handleType: 0
  377. };
  378. sendAudit(params).then((res) => {
  379. if (res.success) {
  380. this.$message.success('审批通过!');
  381. this.$router.back();
  382. }
  383. });
  384. },
  385. //驳回按钮事件
  386. reject () {
  387. this.showtext = true;
  388. let bodyscrollHeight = document.body.scrollHeight;
  389. this.$nextTick(() => {
  390. document.documentElement.scrollTop = bodyscrollHeight;
  391. });
  392. },
  393. cancelreject () {
  394. this.showtext = false;
  395. this.cause = '';
  396. },
  397. surereject () {
  398. if (!this.cause) {
  399. this.$message.info('请填写驳回原因!');
  400. } else {
  401. let params = {
  402. id: this.$route.query.id,
  403. checked: false,
  404. myHandleId: this.$route.query.dbid,
  405. cause: this.cause,
  406. type: 2,
  407. handleType: 0
  408. };
  409. sendAudit(params).then((res) => {
  410. if (res.success) {
  411. this.$message.success('驳回成功!');
  412. this.$router.back();
  413. }
  414. });
  415. }
  416. }
  417. }
  418. };
  419. </script>
  420. <style lang="scss" scoped>
  421. // @import '@/assets/css/oaa.scss';
  422. .page {
  423. padding: 10px;
  424. }
  425. .page-title {
  426. background: #fff;
  427. font-size: 18px;
  428. padding: 6px 20px;
  429. font-weight: 500;
  430. .page-title-div {
  431. margin: 5px 0;
  432. height: 30px;
  433. line-height: 30px;
  434. border-bottom: 1px solid #eaeefb;
  435. .title-div-no {
  436. margin-left: 10px;
  437. font-weight: 400;
  438. color: #909090;
  439. font-size: 14px;
  440. }
  441. }
  442. }
  443. .page-data {
  444. padding-top: 10px;
  445. }
  446. .content-detail {
  447. background: #fff;
  448. padding: 20px;
  449. }
  450. .flows {
  451. .flow-left {
  452. width: 156px;
  453. height: 70px;
  454. border: 1px dashed #ccc;
  455. padding: 10px;
  456. }
  457. .row {
  458. margin-top: 13px;
  459. }
  460. }
  461. .basic-details-title {
  462. margin-bottom: 12px;
  463. margin-top: 20px;
  464. border-bottom: 1px solid #1890ff;
  465. padding-bottom: 8px;
  466. display: flex;
  467. justify-content: space-between;
  468. }
  469. .basic-details-title .border-span {
  470. height: 18px;
  471. font-size: 16px;
  472. border-left: 4px solid #1890ff;
  473. padding-left: 8px;
  474. font-weight: 500;
  475. }
  476. .heade-right {
  477. // float: right;
  478. .heade-right-content {
  479. margin-right: 12px;
  480. font-size: 14px;
  481. display: inline-block;
  482. .content-key {
  483. color: #3e3e3e;
  484. margin-right: 12px;
  485. font-weight: 500;
  486. }
  487. .content-value {
  488. color: #000;
  489. }
  490. }
  491. }
  492. .list-title {
  493. font-size: 14px;
  494. color: #3e3e3e;
  495. margin: 10px 0px;
  496. }
  497. .goods {
  498. background: #a30014;
  499. border: 1px solid #a30014;
  500. }
  501. .details-title {
  502. display: inline-block;
  503. color: #6e6e6e;
  504. font-size: 14px;
  505. font-weight: bold;
  506. margin-right: 13px;
  507. width: 70px;
  508. text-align: right;
  509. }
  510. .details-con {
  511. color: #3e3e3e;
  512. font-size: 14px;
  513. }
  514. .detailed-tab {
  515. margin-left: 10px;
  516. margin-top: 10px;
  517. }
  518. ::v-deep .el-form-item--medium .el-form-item__label {
  519. color: #6e6e6e;
  520. font-size: 14px;
  521. font-weight: bold;
  522. }
  523. .warehouse {
  524. display: block;
  525. border-bottom: 1px solid #eaeefb;
  526. padding: 10px 0;
  527. }
  528. .box-card {
  529. .store-box {
  530. width: 80%;
  531. .store-box-span {
  532. display: inline-block;
  533. font-size: 14px;
  534. height: 50px;
  535. width: 50px;
  536. text-align: center;
  537. line-height: 50px;
  538. color: #fff;
  539. margin: 2px;
  540. }
  541. }
  542. }
  543. .vacant {
  544. background: #3196fb;
  545. }
  546. .inUse {
  547. background: #157a2c;
  548. }
  549. .invalid {
  550. background: #cccccc;
  551. }
  552. .full {
  553. background: #cc3300;
  554. }
  555. .maintain_equipment_info {
  556. .maintain_equipment_info_title {
  557. border-bottom: 1px solid #1890ff;
  558. padding-bottom: 3px;
  559. margin-bottom: 20px;
  560. > span {
  561. display: inline-block;
  562. line-height: 16px;
  563. border-left: 6px solid #1890ff;
  564. padding-left: 6px;
  565. }
  566. }
  567. .maintain_equipment_info_content {
  568. padding: 0 30px;
  569. .equipment_item {
  570. border: 1px solid #ccc;
  571. font-size: 14px;
  572. padding: 15px;
  573. margin-bottom: 30px;
  574. .equipment_info {
  575. display: flex;
  576. flex-wrap: wrap;
  577. border: 1px solid #ddd;
  578. .item_info {
  579. width: 33.33%;
  580. height: 24px;
  581. line-height: 24px;
  582. display: flex;
  583. .item_label {
  584. width: 90px;
  585. text-align: center;
  586. background-color: #f2f2f2;
  587. font-weight: 700;
  588. }
  589. .item_value {
  590. border-bottom: 1px solid #f2f2f2;
  591. flex: 1;
  592. padding-left: 5px;
  593. }
  594. &:last-child {
  595. width: 100%;
  596. .item_value {
  597. border: 0;
  598. }
  599. }
  600. }
  601. }
  602. > p {
  603. margin-top: 20px;
  604. color: #797979;
  605. }
  606. .matter_info {
  607. ::v-deep .el-table {
  608. th.el-table__cell {
  609. background-color: #f2f2f2;
  610. padding: 0;
  611. }
  612. td.el-table__cell {
  613. padding: 0;
  614. }
  615. }
  616. }
  617. }
  618. }
  619. }
  620. .examine_info {
  621. margin-bottom: 30px;
  622. .examine_info_title {
  623. border-bottom: 1px solid #1890ff;
  624. padding-bottom: 3px;
  625. margin-bottom: 20px;
  626. > span {
  627. display: inline-block;
  628. line-height: 16px;
  629. border-left: 6px solid #1890ff;
  630. padding-left: 6px;
  631. }
  632. }
  633. .item_row {
  634. display: flex;
  635. flex-wrap: wrap;
  636. font-size: 14px;
  637. padding: 0 15px;
  638. box-sizing: border-box;
  639. .item_info {
  640. width: 33.33%;
  641. height: 24px;
  642. line-height: 24px;
  643. display: flex;
  644. &.border_right {
  645. border-right: 1px solid #f2f2f2;
  646. }
  647. &.border_top {
  648. border-top: 1px solid #f2f2f2;
  649. }
  650. &.reason {
  651. width: 100%;
  652. }
  653. .item_label {
  654. width: 90px;
  655. text-align: center;
  656. background-color: #f2f2f2;
  657. font-weight: 700;
  658. }
  659. .item_value {
  660. border-bottom: 1px solid #f2f2f2;
  661. flex: 1;
  662. padding-left: 5px;
  663. }
  664. }
  665. }
  666. }
  667. .execute_info {
  668. .execute_info_title {
  669. border-bottom: 1px solid #1890ff;
  670. padding-bottom: 3px;
  671. margin-bottom: 20px;
  672. > span {
  673. display: inline-block;
  674. line-height: 16px;
  675. border-left: 6px solid #1890ff;
  676. padding-left: 6px;
  677. }
  678. }
  679. ::v-deep .el-table th.el-table__cell {
  680. background-color: #f2f2f2;
  681. }
  682. ::v-deep .el-table .el-table__cell {
  683. padding: 5px 0;
  684. }
  685. }
  686. .btnbox {
  687. display: flex;
  688. justify-content: center;
  689. margin-top: 10px;
  690. }
  691. ::v-deep .el-button {
  692. padding: 10px 20px;
  693. margin-right: 10px;
  694. }
  695. .textbox {
  696. margin-top: 10px;
  697. }
  698. .textbtnbox {
  699. margin-top: 10px;
  700. display: flex;
  701. justify-content: center;
  702. }
  703. </style>