RepairDetailsDialog.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. <template>
  2. <!-- 维修工单弹框 -->
  3. <el-dialog
  4. :title="dialogTitle"
  5. :visible.sync="equipmentdialog"
  6. :before-close="handleClose"
  7. :close-on-click-modal="false"
  8. :close-on-press-escape="false"
  9. width="60%"
  10. :fullscreen="fullscreen"
  11. class="fullscreen"
  12. >
  13. <template slot="title">
  14. <modalTitle
  15. :title="dialogTitle"
  16. @setFullscreen="fullscreen = !fullscreen"
  17. ></modalTitle>
  18. </template>
  19. <el-tabs
  20. v-model="detailsTabsActiveName"
  21. type="border-card"
  22. v-if="row.title == '工单详情'"
  23. >
  24. <el-tab-pane :label="tabLabel" name="keepInRepair">
  25. <WorkOrderTab
  26. :repairInfoLogList="repairInfoLogs"
  27. :workOrderInfo="workOrderInfo"
  28. :planInfo="planInfo"
  29. :equipmentInfo="equipmentInfo"
  30. v-if="tabLabel === '工单信息'"
  31. />
  32. <RepairNotesTab
  33. :repairInfoLogList="repairInfoLogs"
  34. v-if="tabLabel === '维修信息'"
  35. />
  36. </el-tab-pane>
  37. <el-tab-pane label="设备信息" name="equipment">
  38. <el-row class="repair_row">
  39. <el-col :span="12" class="repair_column">
  40. <span>设备编码:</span>
  41. <span>{{ equipmentInfo ? equipmentInfo.code : '' }}</span>
  42. </el-col>
  43. <el-col :span="12" class="repair_column">
  44. <span>权属部门:</span>
  45. <span>{{
  46. equipmentInfo ? equipmentInfo.ownershipGroupName : ''
  47. }}</span>
  48. </el-col>
  49. </el-row>
  50. <el-row class="repair_row">
  51. <el-col :span="12" class="repair_column">
  52. <span>设备名称:</span>
  53. <span>{{ equipmentInfo ? equipmentInfo.name : '' }}</span>
  54. </el-col>
  55. <el-col :span="12" class="repair_column">
  56. <span>权属人:</span>
  57. <span>{{
  58. equipmentInfo ? equipmentInfo.ownershipUserName : ''
  59. }}</span>
  60. </el-col>
  61. </el-row>
  62. <el-row class="repair_row">
  63. <el-col :span="12" class="repair_column">
  64. <span>设备分类:</span>
  65. <span>{{
  66. equipmentInfo.category
  67. ? equipmentInfo.category?.category?.categoryLevelPath
  68. : ''
  69. }}</span>
  70. </el-col>
  71. <el-col :span="12" class="repair_column">
  72. <span>权属人电话:</span>
  73. <span>{{
  74. equipmentInfo ? equipmentInfo.ownershipUserMobile : ''
  75. }}</span>
  76. </el-col>
  77. </el-row>
  78. <el-row class="repair_row">
  79. <el-col :span="12" class="repair_column">
  80. <span>固定资产编码:</span>
  81. <span>{{ equipmentInfo ? equipmentInfo.fixCode : '' }}</span>
  82. </el-col>
  83. <el-col :span="12" class="repair_column">
  84. <span>设备位置:</span>
  85. <span>{{
  86. equipmentInfo.deviceLocationName +
  87. '-' +
  88. equipmentInfo.deviceDetailAddress
  89. }}</span>
  90. </el-col>
  91. </el-row>
  92. <el-row class="repair_row">
  93. <el-col :span="12" class="repair_column">
  94. <span>规格型号:</span>
  95. <span>
  96. {{
  97. equipmentInfo.category &&
  98. equipmentInfo.category.category.specification
  99. }}|{{
  100. equipmentInfo.category &&
  101. equipmentInfo.category.category.modelType
  102. }}
  103. </span>
  104. </el-col>
  105. </el-row>
  106. </el-tab-pane>
  107. <el-tab-pane label="报修信息" name="repairApplication">
  108. <el-row class="repair_row">
  109. <el-col :span="12" class="repair_column">
  110. <span>编号:</span>
  111. <span>{{ infoData ? infoData.code : '' }}</span>
  112. </el-col>
  113. <el-col :span="12" class="repair_column">
  114. <span>报修时间:</span>
  115. <span>{{ infoData ? infoData.createTime : '' }}</span>
  116. </el-col>
  117. </el-row>
  118. <el-row class="repair_row">
  119. <el-col :span="12" class="repair_column">
  120. <span>来源:</span>
  121. <span>{{
  122. infoData && infoData.sourceType ? infoData.sourceType : ''
  123. }}</span>
  124. </el-col>
  125. <el-col :span="12" class="repair_column">
  126. <span>来源编码:</span>
  127. <span>{{ infoData ? infoData.sourceCode : '' }}</span>
  128. </el-col>
  129. </el-row>
  130. <el-row class="repair_row">
  131. <el-col :span="12" class="repair_column">
  132. <span>报修部门:</span>
  133. <span>{{ infoData ? infoData.requestDeptName : '' }}</span>
  134. </el-col>
  135. <el-col :span="12" class="repair_column">
  136. <span>报修人:</span>
  137. <span>{{ infoData ? infoData.requestUserName : '' }}</span>
  138. </el-col>
  139. </el-row>
  140. <el-row class="repair_row">
  141. <el-col :span="12" class="repair_column">
  142. <span>报修人电话:</span>
  143. <span>{{ infoData ? infoData.requestUserPhone : '' }}</span>
  144. </el-col>
  145. <el-col :span="12" class="repair_column">
  146. <span>期望完成时间:</span>
  147. <span>{{ infoData ? infoData.expectedTime : '' }}</span>
  148. </el-col>
  149. </el-row>
  150. <el-row class="repair_row">
  151. <el-col :span="24" class="repair_column">
  152. <span>故障描述:</span>
  153. <span>{{ infoData ? infoData.remark : '' }}</span>
  154. </el-col>
  155. </el-row>
  156. <el-row class="repair_row">
  157. <el-col :span="24" class="repair_column">
  158. <span>图片:</span>
  159. <el-image
  160. v-for="(item, index) in infoData.images"
  161. :key="index"
  162. style="width: 100px; height: 100px; margin-right: 5px"
  163. :src="item"
  164. :preview-src-list="infoData.images"
  165. />
  166. </el-col>
  167. </el-row>
  168. </el-tab-pane>
  169. <el-tab-pane label="备品备件申请单" name="sparePartsApply">
  170. <editd :id="workOrderInfo.id" v-if="workOrderInfo" />
  171. </el-tab-pane>
  172. <el-tab-pane label="上报流程" name="flowableTaskId" v-if="workOrderInfo.flowableTaskId">
  173. <Detail
  174. v-if="workOrderInfo.flowableTaskId&&detailsTabsActiveName==='flowableTaskId'"
  175. :id="workOrderInfo.flowableTaskId"
  176. ></Detail>
  177. </el-tab-pane>
  178. </el-tabs>
  179. <el-tabs v-model="detailsTabsActiveName" type="border-card" v-else>
  180. <el-tab-pane label="报修信息" name="repairApplication">
  181. <el-row class="repair_row">
  182. <el-col :span="12" class="repair_column">
  183. <span>编号:</span>
  184. <span>{{ infoData ? infoData.code : '' }}</span>
  185. </el-col>
  186. <el-col :span="12" class="repair_column">
  187. <span>报修时间:</span>
  188. <span>{{ infoData ? infoData.createTime : '' }}</span>
  189. </el-col>
  190. </el-row>
  191. <el-row class="repair_row">
  192. <el-col :span="12" class="repair_column">
  193. <span>来源:</span>
  194. <span>{{
  195. infoData ? getDictValue('报修来源', infoData.sourceType) : ''
  196. }}</span>
  197. </el-col>
  198. <el-col :span="12" class="repair_column">
  199. <span>来源编码:</span>
  200. <span>{{ infoData ? infoData.sourceCode : '' }}</span>
  201. </el-col>
  202. </el-row>
  203. <el-row class="repair_row">
  204. <el-col :span="12" class="repair_column">
  205. <span>报修部门:</span>
  206. <span>{{ infoData ? infoData.requestDeptName : '' }}</span>
  207. </el-col>
  208. <el-col :span="12" class="repair_column">
  209. <span>报修人:</span>
  210. <span>{{ infoData ? infoData.requestUserName : '' }}</span>
  211. </el-col>
  212. </el-row>
  213. <el-row class="repair_row">
  214. <el-col :span="12" class="repair_column">
  215. <span>报修人电话:</span>
  216. <span>{{ infoData ? infoData.repairsDeptPhone : '' }}</span>
  217. </el-col>
  218. <el-col :span="12" class="repair_column">
  219. <span>期望完成时间:</span>
  220. <span>{{ infoData ? infoData.expectedTime : '' }}</span>
  221. </el-col>
  222. </el-row>
  223. <el-row class="repair_row">
  224. <el-col :span="12" class="repair_column">
  225. <span>故障类别:</span>
  226. <span>{{ infoData ? infoData.faultType : '' }}</span>
  227. </el-col>
  228. <el-col :span="12" class="repair_column">
  229. <span>影响度:</span>
  230. <span>{{ infoData ? infoData.impact : '' }}</span>
  231. </el-col>
  232. </el-row>
  233. <el-row class="repair_row">
  234. <el-col :span="24" class="repair_column">
  235. <span>故障描述:</span>
  236. <span>{{ infoData ? infoData.remark : '' }}</span>
  237. </el-col>
  238. </el-row>
  239. <el-row class="repair_row">
  240. <el-col :span="24" class="repair_column">
  241. <span>图片:</span>
  242. <el-image
  243. v-for="(item, index) in infoData.images"
  244. :key="index"
  245. style="width: 100px; height: 100px; margin-right: 5px"
  246. :src="item"
  247. :preview-src-list="infoData.images"
  248. />
  249. </el-col>
  250. </el-row>
  251. <!-- <el-row class="repair_row">
  252. <el-col :span="24" class="repair_column">
  253. <span>图片:</span>
  254. <el-image
  255. v-for="(item, index) in infoData.repairsImg"
  256. :key="index"
  257. style="width: 100px; height: 100px; margin-right: 5px"
  258. :src="item.url"
  259. :preview-src-list="[item.url]"
  260. />
  261. </el-col>
  262. </el-row> -->
  263. <!-- <el-row class="repair_row">
  264. <el-col :span="24" class="repair_column">
  265. <span class="label">视频:</span>
  266. <span>{{ infoData ? infoData.repairsVideo : '' }}</span>
  267. </el-col>
  268. </el-row> -->
  269. </el-tab-pane>
  270. <el-tab-pane label="设备信息" name="equipment">
  271. <el-row class="repair_row">
  272. <el-col :span="12" class="repair_column">
  273. <span>设备编码:</span>
  274. <span>{{ equipmentInfo ? equipmentInfo.code : '' }}</span>
  275. </el-col>
  276. <el-col :span="12" class="repair_column">
  277. <span>权属部门:</span>
  278. <span>{{
  279. equipmentInfo ? equipmentInfo.ownershipGroupName : ''
  280. }}</span>
  281. </el-col>
  282. </el-row>
  283. <el-row class="repair_row">
  284. <el-col :span="12" class="repair_column">
  285. <span>设备名称:</span>
  286. <span>{{ equipmentInfo ? equipmentInfo.name : '' }}</span>
  287. </el-col>
  288. <el-col :span="12" class="repair_column">
  289. <span>权属人:</span>
  290. <span>{{
  291. equipmentInfo ? equipmentInfo.ownershipUserName : ''
  292. }}</span>
  293. </el-col>
  294. </el-row>
  295. <el-row class="repair_row">
  296. <el-col :span="12" class="repair_column">
  297. <span>设备分类:</span>
  298. <span>{{
  299. equipmentInfo.category
  300. ? equipmentInfo.category?.category?.categoryLevelPath
  301. : ''
  302. }}</span>
  303. </el-col>
  304. <el-col :span="12" class="repair_column">
  305. <span>权属人电话:</span>
  306. <span>{{
  307. equipmentInfo ? equipmentInfo.ownershipUserMobile : ''
  308. }}</span>
  309. </el-col>
  310. </el-row>
  311. <el-row class="repair_row">
  312. <el-col :span="12" class="repair_column">
  313. <span>固定资产编码:</span>
  314. <span>{{ equipmentInfo ? equipmentInfo.fixCode : '' }}</span>
  315. </el-col>
  316. <el-col :span="12" class="repair_column">
  317. <span>设备位置:</span>
  318. <span>{{ equipmentInfo.position }}</span>
  319. </el-col>
  320. </el-row>
  321. <el-row class="repair_row">
  322. <el-col :span="12" class="repair_column">
  323. <span>规格型号:</span>
  324. <span>
  325. {{
  326. equipmentInfo.category && equipmentInfo.category.specification
  327. }}|{{
  328. equipmentInfo.category && equipmentInfo.category.modelType
  329. }}
  330. </span>
  331. </el-col>
  332. </el-row>
  333. </el-tab-pane>
  334. <el-tab-pane :label="tabLabel" name="keepInRepair">
  335. <WorkOrderTab
  336. :repairInfoLogList="repairInfoLogs"
  337. :workOrderInfo="workOrderInfo"
  338. :planInfo="planInfo"
  339. v-if="tabLabel === '工单信息'"
  340. />
  341. <RepairNotesTab
  342. :repairInfoLogList="repairInfoLogs"
  343. v-if="tabLabel === '维修信息'"
  344. />
  345. </el-tab-pane>
  346. </el-tabs>
  347. <!-- <div class="btnbox" v-if="row.isshow">
  348. <el-button class="confirm-btn" type="danger" plain @click="reject"
  349. >驳回</el-button
  350. >
  351. <el-button
  352. :loading="passLoading"
  353. class="confirm-btn"
  354. type="success"
  355. plain
  356. @click="pass"
  357. >验收</el-button
  358. >
  359. <el-button class="cancel-btn" @click="handleClose">关闭</el-button>
  360. </div> -->
  361. <!-- <div class="textbox" v-if="showtext">
  362. <el-input
  363. type="textarea"
  364. placeholder="请输入驳回原因"
  365. v-model="cause"
  366. maxlength="30"
  367. rows="5"
  368. show-word-limit
  369. >
  370. </el-input>
  371. <div class="textbtnbox">
  372. <el-button size="small" round @click="cancelreject">取消</el-button>
  373. <el-button
  374. :loading="errorLoading"
  375. size="small"
  376. round
  377. @click="surereject"
  378. >提交</el-button
  379. >
  380. </div>
  381. </div> -->
  382. <div class="textbox" v-if="row.isshow">
  383. <el-input
  384. type="textarea"
  385. placeholder="请输入理由"
  386. v-model="cause"
  387. maxlength="30"
  388. rows="5"
  389. show-word-limit
  390. >
  391. </el-input>
  392. <div class="textbtnbox">
  393. <el-button
  394. class="confirm-btn"
  395. type="danger"
  396. plain
  397. @click="surereject(5)"
  398. >驳回</el-button
  399. >
  400. <el-button
  401. class="confirm-btn"
  402. type="success"
  403. plain
  404. @click="surereject(4)"
  405. >验收</el-button
  406. >
  407. <el-button size="small" plain @click="cancelreject">取消</el-button>
  408. </div>
  409. </div>
  410. <div slot="footer" v-if="!row.isshow">
  411. <el-button size="small" @click="handleClose">关闭</el-button>
  412. </div>
  413. </el-dialog>
  414. </template>
  415. <script>
  416. import modalTitle from '@/components/modalTitle.vue';
  417. import RepairNotesTab from './RepairNotesTab.vue';
  418. import WorkOrderTab from './WorkOrderTab.vue';
  419. import { getAssetInfo } from '@/api/ledgerAssets';
  420. import { getRepairById } from '@/api/maintenance/repair_report';
  421. import { getWorkOrderDetail,acceptance } from '@/api/maintenance/repair';
  422. import dictMixins from '@/mixins/dictMixins';
  423. import editd from '@/views/sparePartsApply/components/editd';
  424. import Detail from '@/views/processInstance/detail.vue';
  425. export default {
  426. mixins: [dictMixins],
  427. props: {},
  428. components: { RepairNotesTab, WorkOrderTab, editd, modalTitle, Detail },
  429. data() {
  430. return {
  431. fullscreen: false,
  432. errorLoading: false,
  433. passLoading: false,
  434. equipmentdialog: false,
  435. detailsTabsActiveName: 'repairApplication',
  436. workOrderInfo: {},
  437. planInfo: {},
  438. infoData: {},
  439. equipmentInfo: {},
  440. repairInfoLogs: [],
  441. tabLabel: '',
  442. dialogTitle: '',
  443. row: {},
  444. cause: '',
  445. showtext: false
  446. };
  447. },
  448. created() {
  449. this.requestDict('报修来源');
  450. this.requestDict('报修状态');
  451. },
  452. methods: {
  453. handleClose() {
  454. this.equipmentdialog = false;
  455. if (this.row.title === '工单详情') {
  456. this.detailsTabsActiveName = 'keepInRepair';
  457. } else {
  458. this.detailsTabsActiveName = 'repairApplication';
  459. }
  460. },
  461. async init(row) {
  462. this.row = row;
  463. console.log('row----------------------------------');
  464. console.log(row);
  465. this.equipmentdialog = true;
  466. this.dialogTitle = row.title;
  467. this.tabLabel = row.tabLabel;
  468. if (row.title === '工单详情') {
  469. this.detailsTabsActiveName = 'keepInRepair';
  470. }
  471. if (row.title === '报修记录详情') {
  472. this.getSbinfo(this.row.deviceId);
  473. const res = await getRepairById(row.id);
  474. console.log('报修记录详情', res);
  475. this.infoData = res ? res : {};
  476. this.repairInfoLogs = res.repairLogVOList.reverse();
  477. // 处理图片
  478. if (this.infoData && this.infoData?.images?.length) {
  479. this.infoData.images.forEach((url) => window.location.origin + url);
  480. }
  481. } else if (row.title === '消息信息详情') {
  482. this.getSbinfo(this.row.deviceId);
  483. const res = await getRepairById(row.id);
  484. this.infoData = res ? res : {};
  485. this.repairInfoLogs = res.repairLogVOList.reverse();
  486. // 处理图片
  487. // if (this.infoData && this.infoData.repairsImg) {
  488. // const repairsImg = this.infoData.repairsImg
  489. // this.infoData.repairsImg = []
  490. // repairsImg.split(',').map(item => {
  491. // imageView(item).then(res => {
  492. // this.infoData.repairsImg.push({
  493. // name: item.substring('/download/'.length),
  494. // url: res
  495. // })
  496. // })
  497. // return
  498. // })
  499. // }
  500. } else {
  501. console.log('----------');
  502. console.log(row);
  503. const res = await getWorkOrderDetail(row.code);
  504. console.log(res, 'resresresresres');
  505. this.workOrderInfo = res.ticketsInfoResponse;
  506. this.infoData = res.repairRequestResponse;
  507. this.getSbinfo(res.ticketsInfoResponse.deviceId);
  508. // this.planInfo = res.data.planInfo;
  509. // this.planInfo.executeUserName = res.data.executeUserName;
  510. // this.planInfo.executorDeptName = res.data.executorDeptName;
  511. // this.infoData = res.data.repairInfo ? res.data.repairInfo : {};
  512. // // 处理图片
  513. // if (this.infoData && this.infoData.repairsImg) {
  514. // const repairsImg = this.infoData.repairsImg;
  515. // this.infoData.repairsImg = [];
  516. // repairsImg.split(',').map((item) => {
  517. // imageView(item).then((res) => {
  518. // this.infoData.repairsImg.push({
  519. // name: item.substring('/download/'.length),
  520. // url: res
  521. // });
  522. // });
  523. // return;
  524. // });
  525. // }
  526. let repairInfoLogs =
  527. res.ticketsInfoResponse.repairLogVOS?.length > 0
  528. ? res.ticketsInfoResponse.repairLogVOS.map((item) => {
  529. return {
  530. ...item,
  531. requestUserName: res.repairRequestResponse.requestUserName,
  532. remark: res.repairRequestResponse.remark
  533. };
  534. })
  535. : [];
  536. this.repairInfoLogs = repairInfoLogs.reverse();
  537. }
  538. },
  539. getSbinfo(params) {
  540. getAssetInfo(params).then((res) => {
  541. if (res) {
  542. this.equipmentInfo = res;
  543. this.$set(
  544. this.equipmentInfo,
  545. 'position',
  546. res.positionList?.length > 0 && res.positionList[0].pathName
  547. ? res.positionList[0].pathName
  548. : ''
  549. );
  550. }
  551. });
  552. },
  553. //通过按钮事件
  554. pass() {
  555. this.passLoading = true;
  556. let params = {
  557. id: this.row.id,
  558. checked: true,
  559. myHandleId: this.row.dbid,
  560. handleType: 1,
  561. type: 1,
  562. cause: ''
  563. };
  564. sendAudit(params).then((res) => {
  565. if (res.success) {
  566. this.$message.success('验收成功!');
  567. this.$emit('refesh');
  568. this.passLoading = false;
  569. this.equipmentdialog = false;
  570. }
  571. });
  572. },
  573. //驳回按钮事件
  574. reject() {
  575. this.showtext = true;
  576. let ele = document.getElementsByClassName('el-dialog__wrapper');
  577. let bodyscrollHeight = document.body.scrollHeight;
  578. this.$nextTick(() => {
  579. ele.forEach((element) => {
  580. if (element.style.display !== 'none') {
  581. element.scrollTop = bodyscrollHeight;
  582. }
  583. });
  584. });
  585. },
  586. cancelreject() {
  587. this.showtext = false;
  588. this.cause = '';
  589. },
  590. surereject(orderStatus) {
  591. this.btnLoading = true;
  592. let params = {
  593. orderStatus,
  594. remark: this.cause,
  595. workOrderId: this.row.id
  596. };
  597. acceptance(params).then((res) => {
  598. if (res.code == 0) {
  599. this.$message.success(
  600. orderStatus == 4 ? '审核通过!' : '驳回成功!'
  601. );
  602. this.$emit('refresh');
  603. this.equipmentdialog = false;
  604. }
  605. });
  606. }
  607. },
  608. watch: {
  609. equipmentdialog(nVal, oVal) {
  610. if (!nVal) {
  611. this.cause = '';
  612. this.showtext = false;
  613. }
  614. }
  615. }
  616. };
  617. </script>
  618. <style lang="scss" scoped>
  619. .repair_row {
  620. margin-bottom: 15px;
  621. .repair_column {
  622. display: flex;
  623. > span {
  624. &:first-child {
  625. font-weight: 700;
  626. text-align: right;
  627. width: 120px;
  628. }
  629. }
  630. }
  631. }
  632. .btnbox {
  633. display: flex;
  634. justify-content: center;
  635. margin-top: 10px;
  636. }
  637. ::v-deep .el-button {
  638. padding: 10px 20px;
  639. margin-right: 10px;
  640. }
  641. .textbox {
  642. margin-top: 10px;
  643. }
  644. .textbtnbox {
  645. margin-top: 10px;
  646. display: flex;
  647. justify-content: center;
  648. }
  649. </style>