detail.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  1. <template>
  2. <view :class="{ popupShow: popupShow }">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="维修工单详情" @clickLeft="back"></uni-nav-bar>
  4. <view class="tab-title">
  5. <view>
  6. <text v-for="(item, index) in tabList" :key="index" class="tab-item" v-text="item.label"
  7. :class="index === pickTabIndex ? 'active' : ''" @click="changeChartsTab(index)">
  8. </text>
  9. </view>
  10. </view>
  11. <!-- <uni-list direction="row" >
  12. <uni-list-item v-for="(item, index) in tabList" :key="index" :title="item.label" ></uni-list-item>
  13. </uni-list> -->
  14. <view class="main">
  15. <!-- 工单信息 -->
  16. <view class="kd-baseInfo" v-if="pickTabIndex == 0">
  17. <view class="kd-cell">
  18. <text class="kd-label">工单编号</text>
  19. {{ worksheetInfo.code }}
  20. </view>
  21. <view class="kd-cell">
  22. <text class="kd-label">执行部门</text>
  23. {{ worksheetInfo.executeGroupName }}
  24. </view>
  25. <view class="kd-cell">
  26. <text class="kd-label">执行人</text>
  27. {{ worksheetInfo.executeUserName }}
  28. </view>
  29. <view class="kd-cell">
  30. <text class="kd-label">计划单号</text>
  31. {{ worksheetInfo.planCode }}
  32. </view>
  33. <view class="kd-cell">
  34. <text class="kd-label">计划名称</text>
  35. {{ worksheetInfo.planName }}
  36. </view>
  37. <view class="kd-cell" v-if="workOrderType.code != 10">
  38. <text class="kd-label">计划完成时间</text>
  39. {{ worksheetInfo.planFinishTime }}
  40. </view>
  41. <view class="kd-cell" v-if="workOrderType.code == 10">
  42. <text class="kd-label">计划开始时间</text>
  43. {{ worksheetInfo.planStartTime }}
  44. </view>
  45. <view class="kd-cell" v-if="workOrderType.code == 10">
  46. <text class="kd-label">计划完成时间</text>
  47. {{ worksheetInfo.planEndTime }}
  48. </view>
  49. <view class="kd-cell">
  50. <text class="kd-label">开工时间:</text>
  51. {{ worksheetInfo.acceptTime }}
  52. </view>
  53. <view class="kd-cell">
  54. <text class="kd-label">完工时间:</text>
  55. {{ worksheetInfo.finishTime }}
  56. </view>
  57. <view class="kd-cell">
  58. <text class="kd-label">实际工时:</text>
  59. {{ timeInterval(worksheetInfo.acceptTime, worksheetInfo.finishTime) }}
  60. </view>
  61. <!-- *** 新增 照片列表 -->
  62. <view class="kd-cell">
  63. <text class="kd-label">照片列表:</text>
  64. <PreviewPhoto type="view" :imageList="worksheetInfo.workOrderImg" />
  65. </view>
  66. <view class="zxpg-wrap" v-if="orderType == 1 && ParentIndex !=4">
  67. <template v-if="repairInfo.orderStatus == 0">
  68. <!-- <view class="zx-btn btns" @click="handleExecute">开始执行</view> -->
  69. <view class="zp-btn btns" @click="handlbpbj">申请备品备件</view>
  70. <view class="zx-btn btns" @click="handleNotice">开始执行</view>
  71. <view class="zp-btn btns" @click="handlZp">转派</view>
  72. </template>
  73. <template v-else-if="repairInfo.orderStatus == 2">
  74. <view class="zp-btn btns" @click="handlbpbj">申请备品备件</view>
  75. <view class="zx-btn btns" @click="handlbg">报工</view>
  76. <view class="zx-btn btns" style="margin-top: 20rpx;" @click="handlNobg">非完成报工</view>
  77. <view class="zp-btn btns" @click="handlZp">转派</view>
  78. <!-- <view class="zp-btn btns" @click="handlbpbj" v-if="!worksheetInfo.applyOrder">
  79. 申请备品备件
  80. </view>
  81. <view class="zp-btn btns" v-if="worksheetInfo.applyOrder" @click="handCkbpbj">
  82. 查看备品备件
  83. </view> -->
  84. </template>
  85. <template v-if="repairInfo.orderStatus == 3 && repairInfo.repairUserId == userId">
  86. <view class="zx-btn btns disabled">待验收</view>
  87. </template>
  88. <template v-if="repairInfo.orderStatus == 3 && repairInfo.requestUserId == userId">
  89. <view class="zx-btn btns" @click="searchShow = true">验收</view>
  90. </template>
  91. <!-- <div class="apply-box">
  92. <view class="zp-btn btns" @click="handlbpbj" v-if="worksheetInfo.status.code != 5 && worksheetInfo.status.code != 3 && worksheetInfo.status.code != 7">申请备品备件</view>
  93. <view class="zp-btn btns" @click="handlZp" v-if="worksheetInfo.status.code === 8">转派</view>
  94. </div> -->
  95. </view>
  96. <!-- <view class="zxpg-wrap"
  97. v-if="orderType == 1 && repairInfo.orderStatus == 3 && repairInfo.requestUserId == userId && ParentIndex !=4">
  98. <view class="zx-btn btns" @click="searchShow = true">验收</view>
  99. </view> -->
  100. <Assign ref="Assign" @success="handleAssign"></Assign>
  101. <SearchPopup mode="center" v-if="searchShow">
  102. <template v-slot:list>
  103. <maintain_course :repairInfoLogList="repairInfoLogs" :workOrderCode="workOrderCode">
  104. </maintain_course>
  105. </template>
  106. <template v-slot:operate>
  107. <view class="operate_box">
  108. <u--textarea v-model="remark" confirm-type="send" count placeholder="请输入内容"></u--textarea>
  109. </view>
  110. <!-- <u-input v-model="remark" type="textarea" border="true" placeholder="请输入内容" /> -->
  111. <!-- <u--textarea v-model="remark" placeholder="请输入内容"></u--textarea> -->
  112. <view class="operate_box">
  113. <u-button :loading="btnLoading" type="success" size="small" class="u-reset-button"
  114. @click="surereject(4)">验收</u-button>
  115. <u-button :loading="btnLoading" size="small" class="u-reset-button"
  116. @click="surereject(5)">驳回</u-button>
  117. <u-button size="small" class="u-reset-button" @click="searchShow = false">取消</u-button>
  118. </view>
  119. </template>
  120. </SearchPopup>
  121. </view>
  122. <!-- 报修信息 -->
  123. <view class="bg" v-if="pickTabIndex == 1">
  124. <view class="kd-baseInfo" v-if="workOrderType.code != 10">
  125. <view class="kd-cell">
  126. <text class="kd-label">报修记录编号</text>
  127. {{ repairInfo.code }}
  128. </view>
  129. <view class="kd-cell">
  130. <text class="kd-label">报修时间</text>
  131. {{ repairInfo.createTime }}
  132. </view>
  133. <view class="kd-cell">
  134. <text class="kd-label">来源编码</text>
  135. {{ repairInfo.sourceType }}
  136. </view>
  137. <view class="kd-cell">
  138. <text class="kd-label">固资编码</text>
  139. {{ equipmentInfo.fixCode }}
  140. </view>
  141. <view class="kd-cell">
  142. <text class="kd-label">内部编码</text>
  143. {{ equipmentInfo.codeNumber }}
  144. </view>
  145. <view class="kd-cell">
  146. <text class="kd-label">报修部门</text>
  147. {{ repairInfo.requestDeptName }}
  148. </view>
  149. <view class="kd-cell">
  150. <text class="kd-label">报修人</text>
  151. {{ repairInfo.requestUserName }}
  152. </view>
  153. <view class="kd-cell">
  154. <text class="kd-label">报修人电话</text>
  155. {{ repairInfo.requestUserPhone }}
  156. </view>
  157. <view class="kd-cell">
  158. <text class="kd-label">期望完成时间</text>
  159. {{ repairInfo.expectedTime }}
  160. </view>
  161. <!-- <view class="kd-cell">
  162. <text class="kd-label2">委托单位交底负责人</text>
  163. {{ repairInfo.code }}
  164. </view>
  165. <view class="kd-cell">
  166. <text class="kd-label2">交底时间</text>
  167. {{ repairInfo.code }}
  168. </view>
  169. <view class="kd-cell">
  170. <text class="kd-label2">接受交底负责人</text>
  171. {{ repairInfo.code }}
  172. </view> -->
  173. <view class="kd-cell">
  174. <text class="kd-label">故障描述</text>
  175. {{ repairInfo.remark }}
  176. </view>
  177. <!-- <view class="img-wrap" v-if="workOrderType.code != 10 && worksheetInfo.repairInfo.repairsImg">
  178. <image
  179. class="img"
  180. @click="clickImg(worksheetInfo.repairInfo.repairsImg.split(','), item_s)"
  181. :src="apiUrl + item_s"
  182. v-for="(item_s, index_s) in worksheetInfo.repairInfo.repairsImg.split(',')"
  183. :key="index_s"></image>
  184. </view> -->
  185. </view>
  186. <view class="kd-baseInfo" v-if="workOrderType.code == 10">
  187. <view class="kd-cell">
  188. <text class="kd-label">报修时间</text>
  189. {{ planRepair.createTime }}
  190. </view>
  191. <view class="kd-cell">
  192. <text class="kd-label">维修部门</text>
  193. {{ planRepair.executorDeptName }}
  194. </view>
  195. <view class="kd-cell">
  196. <text class="kd-label">维修人员</text>
  197. {{ planRepair.executorName }}
  198. </view>
  199. </view>
  200. </view>
  201. <!-- 设备信息 -->
  202. <view class="kd-baseInfo" v-if="pickTabIndex == 2">
  203. <view class="kd-cell">
  204. <text class="kd-label">设备编码</text>
  205. {{ equipmentInfo.code }}
  206. </view>
  207. <view class="kd-cell">
  208. <text class="kd-label">设备名称</text>
  209. {{ equipmentInfo.name }}
  210. </view>
  211. <view class="kd-cell">
  212. <text class="kd-label">设备分类</text>
  213. {{ equipmentInfo.category ? equipmentInfo.category.category.categoryLevelPath : '' }}
  214. </view>
  215. <view class="kd-cell">
  216. <text class="kd-label">固资编码</text>
  217. {{ equipmentInfo.fixCode }}
  218. </view>
  219. <view class="kd-cell">
  220. <text class="kd-label">内部编码</text>
  221. {{ equipmentInfo.codeNumber }}
  222. </view>
  223. <view class="kd-cell">
  224. <text class="kd-label">规格型号</text>
  225. {{ equipmentInfo.category && equipmentInfo.category.category.specification }}|{{ equipmentInfo.category && equipmentInfo.category.category.modelType }}
  226. </view>
  227. <view class="kd-cell" v-if="workOrderType.code != 10">
  228. <text class="kd-label">权属部门</text>
  229. {{ equipmentInfo.ownershipGroupName }}
  230. </view>
  231. <view class="kd-cell" v-if="workOrderType.code != 10">
  232. <text class="kd-label">权属人</text>
  233. {{ equipmentInfo.ownershipUserName }}
  234. </view>
  235. <view class="kd-cell" v-if="workOrderType.code != 10">
  236. <text class="kd-label">权属部门电话</text>
  237. {{ equipmentInfo.ownershipUserMobile }}
  238. </view>
  239. <view class="kd-cell" v-if="workOrderType.code != 10">
  240. <text class="kd-label">设备位置</text>
  241. {{ equipmentInfo.deviceLocationName + '-' + equipmentInfo.deviceDetailAddress }}
  242. </view>
  243. </view>
  244. <!-- 维修历程 -->
  245. <view class="" v-if="pickTabIndex == 3">
  246. <!-- 步骤条 -->
  247. <maintain_course :repairInfoLogList="repairInfoLogs" :workOrderCode="workOrderCode"></maintain_course>
  248. </view>
  249. <!-- 维修记录 -->
  250. <view class="wx-main" v-if="pickTabIndex == 4">
  251. <view class="wx-wrap">
  252. <view class="item" v-for="(item, index) in repairHistoryList" :key="index">
  253. <view class="bh-wrap">
  254. <view class="s1">
  255. <view class="title-md">工单编号:</view>
  256. <view class="b1">
  257. {{ item.workOrderCode }}
  258. </view>
  259. </view>
  260. <view class="s2">{{ item.createTime }}</view>
  261. </view>
  262. <fold :hide="false">
  263. <view class="title-wrap">
  264. <view class="s1 title-md">执行人</view>
  265. <view class="s2">
  266. {{ item.executeUserName }}
  267. </view>
  268. </view>
  269. <view class="bg-wrap-item">
  270. <view class="label title-md">故障描述</view>
  271. <view class="value-wrap">
  272. <view class="text">
  273. {{ item.remark }}
  274. </view>
  275. <view class="img-wrap" v-if="item.repairsImg">
  276. <image class="img" @click="clickImg(item.repairsImg.split(','), item_s)"
  277. :src="apiUrl + item_s"
  278. v-for="(item_s, index_s) in item.repairsImg.split(',')" :key="index_s">
  279. </image>
  280. </view>
  281. </view>
  282. </view>
  283. <view class="bg-wrap-item">
  284. <view class="label title-md">处理说明</view>
  285. <view class="value-wrap">
  286. <view class="text">
  287. {{ item.repairReportExplain }}
  288. </view>
  289. <view class="img-wrap" v-if="item.workOrderImg">
  290. <image class="img" @click="clickImg(item.workOrderImg.split(','), item_s)"
  291. :src="apiUrl + item_s"
  292. v-for="(item_s, index_s) in item.workOrderImg.split(',')" :key="index_s">
  293. </image>
  294. </view>
  295. </view>
  296. </view>
  297. <!-- <view class="bjsymx" @click="handlbjsymx(item.repairLogVOS, true)">备件使用明细</view> -->
  298. <view class="bjsymx" @click="handDetail(item.repairLogVOS)">详情流程</view>
  299. </fold>
  300. </view>
  301. </view>
  302. </view>
  303. <!-- 备品备件 sparePartsApply-->
  304. <view class="wx-main" v-if="pickTabIndex == 5">
  305. <pickCard :list="sparePartsApply" />
  306. </view>
  307. </view>
  308. <PopSparePart ref="PopSparePart" :workOrderCode="sparePartWorkOrderCode" :noRequest="true"></PopSparePart>
  309. <!-- <Approval v-if="isApproval && worksheetInfo.status && worksheetInfo.status.code == 5" :devOpsType="1" :planType="3" :myHandleId="myHandleId" :id="worksheetInfo.workOrderId" /> -->
  310. <HistoryRepairDetail ref="HistoryRepairDetail" @close="close"></HistoryRepairDetail>
  311. <Notice v-if="noticeShow" :id="worksheetInfo.id" :repairInfo="repairInfo" @agree="agree"></Notice>
  312. <unfinishedApplication ref="unfinishedA"></unfinishedApplication>
  313. </view>
  314. </template>
  315. <script>
  316. import PreviewPhoto from '@/pages/maintenance/check/components/PreviewPhoto.vue'
  317. import {
  318. startExecuting
  319. } from '@/api/myTicket/index.js'
  320. import Step from '@/components/Step/Step.vue'
  321. import StepItem from '@/components/Step/StepItem.vue'
  322. import Assign from '@/components/Assign.vue'
  323. import fold from '../components/fold.vue'
  324. import unfinishedApplication from '../components/unfinishedApplication.vue'
  325. import HistoryRepairDetail from '../components/historyRepairDetail.vue'
  326. import PopSparePart from '../components/PopSparePart.vue'
  327. import pickCard from '../components/pickCard.vue'
  328. // import Approval from '@/components/Approval.vue' // 审批组件
  329. import maintain_course from '../components/maintain_course.vue'
  330. import Notice from '../components/notice.vue'
  331. import {
  332. get,
  333. postJ,
  334. post
  335. } from '@/utils/api.js'
  336. import {
  337. getWorkOrderDetail,
  338. getAssetInfo,
  339. historyRepairList,
  340. acceptance,
  341. getSparePartsApply
  342. } from '@/api/repair'
  343. import SearchPopup from '@/pages/pda/components/searchPopup.vue'
  344. export default {
  345. components: {
  346. PreviewPhoto,
  347. Step,
  348. StepItem,
  349. Assign,
  350. fold,
  351. PopSparePart,
  352. // Approval,
  353. maintain_course,
  354. Notice,
  355. HistoryRepairDetail,
  356. SearchPopup,
  357. pickCard,
  358. unfinishedApplication
  359. },
  360. computed: {
  361. // 是否为自己的工单
  362. // isMygd() {
  363. // let userInfo = uni.getStorageSync('userInfo')
  364. // // 当前登录人id
  365. // let userId = userInfo.id
  366. // // 执行人id
  367. // let executeUserId = this.worksheetInfo.executeUserId
  368. // if (executeUserId == userId) {
  369. // return true
  370. // } else {
  371. // return false
  372. // }
  373. // }
  374. },
  375. data() {
  376. return {
  377. btnLoading: false,
  378. orderType: 1,
  379. remark: '',
  380. userId: '',
  381. searchShow: false,
  382. popupShow: false,
  383. repairHistoryList: [],
  384. repairInfoLogs: [],
  385. sparePartsApply: [],
  386. id: '',
  387. type: 1,
  388. sparePartWorkOrderCode: '',
  389. tabList: [{
  390. label: '工单信息',
  391. value: '0'
  392. },
  393. {
  394. label: '报修信息',
  395. value: '1'
  396. },
  397. {
  398. label: '设备信息',
  399. value: '2'
  400. },
  401. {
  402. label: '维修历程',
  403. value: '3'
  404. },
  405. {
  406. label: '维修记录',
  407. value: '4'
  408. },
  409. {
  410. label: '备品备件申请单',
  411. value: '5'
  412. }
  413. ],
  414. pickTabIndex: 0,
  415. workOrderCode: '',
  416. worksheetInfo: {},
  417. equipmentInfo: {},
  418. repairInfo: {},
  419. dict: {
  420. // 报修来源 1:手动创建;2:工单反工;3:告警通知;4:保养工单;5:巡点检工单)
  421. source: {
  422. 1: '手动创建',
  423. 2: '工单反工',
  424. 3: '告警通知',
  425. 4: '保养工单',
  426. 5: '巡点检工单'
  427. }
  428. },
  429. // 设备信息
  430. device: {},
  431. isApproval: false,
  432. myHandleId: '',
  433. equiCode: '',
  434. noticeShow: false,
  435. workOrderType: {},
  436. planRepair: {},
  437. ParentIndex: 0,
  438. }
  439. },
  440. onLoad(options) {
  441. this.id = options.id
  442. this.workOrderCode = options.code
  443. this.planId = options.planId
  444. this.orderType = options.orderType
  445. this.ParentIndex = options.ParentIndex
  446. let userInfo = uni.getStorageSync('userInfo')
  447. // 当前登录人id
  448. this.userId = userInfo.userId
  449. // this.isApproval = options.type === 'approval'
  450. // this.myHandleId = options.myHandleId
  451. },
  452. onShow() {
  453. if (this.workOrderCode) {
  454. this.getInfo()
  455. }
  456. },
  457. methods: {
  458. surereject(orderStatus) {
  459. this.btnLoading = true
  460. let params = {
  461. orderStatus,
  462. remark: this.remark,
  463. workOrderId: this.id
  464. }
  465. acceptance(params).then(res => {
  466. uni.showToast({
  467. icon: 'success',
  468. title: orderStatus == 4 ? '审核通过!' : '驳回成功!',
  469. duration: 2000
  470. })
  471. this.searchShow = false
  472. this.btnLoading = false
  473. this.getInfo()
  474. })
  475. },
  476. back() {
  477. uni.navigateBack({
  478. delta: 1
  479. })
  480. },
  481. close() {
  482. this.popupShow = false
  483. },
  484. handleAssign() {
  485. this.back()
  486. },
  487. // 获取历史维修记录
  488. getHistoryRepairList(deviceId) {
  489. historyRepairList({
  490. id: deviceId,
  491. pageNum: 1,
  492. size: 999
  493. }).then(data => {
  494. this.repairHistoryList = data.list
  495. })
  496. },
  497. // 获取设备信息
  498. getDeviceInfo(deviceId) {
  499. getAssetInfo(deviceId).then(res => {
  500. if (res) {
  501. this.equipmentInfo = res
  502. this.$set(this.equipmentInfo, 'position', res.positionList?.length > 0 && res.positionList[
  503. 0].pathName ? res.positionList[0].pathName : '')
  504. }
  505. })
  506. },
  507. //获取备品备件
  508. async getSparePartsApply(id) {
  509. const list = await getSparePartsApply(id)
  510. this.sparePartsApply = list
  511. },
  512. getInfo() {
  513. getWorkOrderDetail(this.workOrderCode).then(data => {
  514. // *** 新增 照片数据接收
  515. if (data.ticketsInfoResponse.workOrderImg) {
  516. data.ticketsInfoResponse.workOrderImg = JSON.parse(data.ticketsInfoResponse.workOrderImg);
  517. }
  518. console.log(data, '看看数据')
  519. this.worksheetInfo = data.ticketsInfoResponse
  520. this.repairInfo = data.repairRequestResponse
  521. this.getDeviceInfo(this.worksheetInfo.deviceId)
  522. this.getHistoryRepairList(this.worksheetInfo.deviceId)
  523. this.getSparePartsApply(this.worksheetInfo.id)
  524. let repairInfoLogs =
  525. data.ticketsInfoResponse.repairLogVOS?.length > 0 ?
  526. data.ticketsInfoResponse.repairLogVOS.map(item => {
  527. return {
  528. ...item,
  529. requestUserName: data.repairRequestResponse.requestUserName,
  530. remark: data.repairRequestResponse.remark
  531. }
  532. }) : []
  533. this.repairInfoLogs = repairInfoLogs.reverse()
  534. })
  535. // get(this.apiUrl + '/repair/info/getWorkOrderDetail/' + this.workOrderCode).then(res => {
  536. // if (res.success) {
  537. // res.data.repairInfoLogList = res.data.repairInfoLogList.reverse()
  538. // res.data.repairInfoLogList = res.data.repairInfoLogList.map(n => {
  539. // if (n.content) {
  540. // n.content = JSON.parse(n.content)
  541. // }
  542. // return n
  543. // })
  544. // this.worksheetInfo = res.data
  545. // this.workOrderType = res.data?.workOrderType
  546. // this.equiCode = res.data?.repairInfo?.equiCode
  547. // if (this.workOrderType.code == 10) {
  548. // this.planRepair = res.data?.planRepair
  549. // this.device = res.data.planRepairEqui
  550. // let districtManName = res.data?.planRepair.districtManName.split(',')
  551. // this.worksheetInfo.repairInfo = {
  552. // repairsPerson: districtManName[0]
  553. // }
  554. // } else {
  555. // this.getDevice()
  556. // }
  557. // }
  558. // })
  559. },
  560. changeChartsTab(index) {
  561. this.pickTabIndex = index
  562. },
  563. // 跳转备品备件
  564. handlbpbj() {
  565. this.equipmentInfo['category']['modelType'] = this.equipmentInfo.category && this.equipmentInfo.category
  566. .category.modelType
  567. let data = JSON.parse(JSON.stringify(this.worksheetInfo));
  568. data['deviceList'] = [this.equipmentInfo];
  569. data['pageType'] = 'add'
  570. uni.navigateTo({
  571. url: `/pages/maintenanceWorkorder/sparepart/sparepart?data=${JSON.stringify(data)}`
  572. })
  573. },
  574. // 查看备品备件 详情
  575. handCkbpbj() {
  576. uni.navigateTo({
  577. url: `/pages/maintain_service/sparepart/sparepartDetail?applyOrder=${this.worksheetInfo.applyOrder}`
  578. })
  579. },
  580. // 跳转报工
  581. handlbg() {
  582. uni.navigateTo({
  583. url: `/pages/maintenanceWorkorder/submitted_ministry/submitted_ministry?workOrderCode=${this.repairInfo.code}&code=${this.workOrderCode}&id=${this.id}&deviceName=${this.repairInfo.deviceName}`
  584. })
  585. },
  586. // 跳转非完成报工
  587. handlNobg() {
  588. this.$refs.unfinishedA.open(this.worksheetInfo.id)
  589. },
  590. // 保修须知
  591. handleNotice() {
  592. this.noticeShow = true
  593. },
  594. agree() {
  595. this.noticeShow = false
  596. this.handleExecute()
  597. },
  598. // 执行工单
  599. handleExecute() {
  600. startExecuting({
  601. id: this.id
  602. }).then(() => {
  603. uni.showToast({
  604. icon: 'success',
  605. title: '操作成功!',
  606. duration: 2000
  607. })
  608. this.getInfo()
  609. })
  610. },
  611. // 转派
  612. handlZp() {
  613. let id = this.worksheetInfo.id
  614. this.$refs.Assign.open(id, 'Transfer')
  615. },
  616. // 详情
  617. handDetail(data) {
  618. this.popupShow = true
  619. this.$refs.HistoryRepairDetail.open('历史维修详情', data)
  620. },
  621. // 备件使用明细
  622. handlbjsymx(data) {
  623. this.$refs.PopSparePart.open('备件使用明细', data)
  624. },
  625. // 获取设备信息
  626. getDevice() {
  627. try {
  628. let par = {
  629. code: this.worksheetInfo.repairInfo.equiCode
  630. }
  631. get(this.apiUrl + '/asset/detail', par).then(res => {
  632. if (res.success) {
  633. this.device = res.data
  634. }
  635. })
  636. } catch (e) {
  637. //TODO handle the exception
  638. }
  639. },
  640. // 查看图片
  641. clickImg(urls, indexUrl) {
  642. urls = urls.map(n => {
  643. return this.apiUrl + n
  644. })
  645. wx.previewImage({
  646. urls: urls, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  647. current: this.apiUrl + indexUrl, // 当前显示图片的http链接,默认是第一个
  648. success: function(res) {},
  649. fail: function(res) {},
  650. complete: function(res) {}
  651. })
  652. },
  653. // 计算实际工时
  654. timeInterval(dt1, dt2) {
  655. if (!dt1 || !dt2) {
  656. return ''
  657. }
  658. if (typeof dt1 == 'string') {
  659. dt1 = new Date(dt1.replace(/-/, '/'))
  660. dt2 = new Date(dt2.replace(/-/, '/'))
  661. }
  662. var res = dt2 - dt1
  663. if (isNaN(res)) throw Error('invalid dates arguments')
  664. let re = res / (1000 * 60 * 60)
  665. var h = parseInt(re)
  666. var m = parseInt((re - h) * 60)
  667. let result = ''
  668. if (h) {
  669. result += `${h} 小时`
  670. }
  671. if (m) {
  672. result += `${m} 分钟`
  673. }
  674. return result
  675. }
  676. }
  677. }
  678. </script>
  679. <style lang="scss" scoped>
  680. .operate_box {
  681. margin: 20rpx;
  682. display: flex;
  683. .u-reset-button {
  684. flex: 1;
  685. margin-right: 10rpx;
  686. }
  687. .u-textarea {
  688. border: 1px solid #ddd;
  689. }
  690. }
  691. .popupShow {
  692. overflow: hidden;
  693. position: fixed;
  694. width: 100%;
  695. }
  696. .img-wrap {
  697. flex: 1;
  698. display: flex;
  699. flex-wrap: wrap;
  700. .img {
  701. width: 80px;
  702. height: 60px;
  703. margin: 5px;
  704. }
  705. }
  706. .tab-title {
  707. position: fixed;
  708. width: 100%;
  709. // display: flex;
  710. // justify-content: space-between;
  711. overflow-x: auto;
  712. height: 82rpx;
  713. line-height: 82rpx;
  714. background-color: #ffffff;
  715. border-bottom: 1px solid #f2f2f2;
  716. z-index: 99;
  717. box-sizing: border-box;
  718. >view {
  719. width: 1050rpx;
  720. }
  721. .tab-item {
  722. // width: 50%;
  723. min-width: 65rpx;
  724. text-align: center;
  725. font-size: 32rpx;
  726. color: $uni-text-color-grey;
  727. margin-left: 15px;
  728. display: inline-block;
  729. }
  730. .tab-item.active {
  731. color: $j-primary-border-green;
  732. border-bottom: 1px solid $j-primary-border-green;
  733. }
  734. }
  735. .fixed {
  736. position: fixed;
  737. width: 100%;
  738. left: 0;
  739. }
  740. .add {
  741. bottom: 0;
  742. }
  743. .main {
  744. border-top: 10px solid #f0f0f0;
  745. margin-top: 42px;
  746. }
  747. .img-bar {
  748. padding: 10px 0;
  749. display: flex;
  750. .label {
  751. color: #999;
  752. text-align: right;
  753. max-width: 104px;
  754. font-size: 32rpx;
  755. padding: 0 15px;
  756. flex: 1;
  757. }
  758. .img-wrap {
  759. flex: 1;
  760. display: flex;
  761. flex-wrap: wrap;
  762. .img {
  763. width: 80px;
  764. height: 60px;
  765. margin: 5px;
  766. }
  767. }
  768. }
  769. .kd-baseInfo {
  770. padding: 0 32rpx;
  771. font-size: 28rpx;
  772. .kd-cell {
  773. line-height: 90rpx;
  774. border-bottom: 1px dashed #dadada;
  775. word-break: break-all;
  776. .kd-label {
  777. display: inline-block;
  778. width: 8em;
  779. font-weight: bold;
  780. }
  781. .kd-label2 {
  782. display: inline-block;
  783. width: 11em;
  784. font-weight: bold;
  785. }
  786. }
  787. }
  788. .wx-wrap {
  789. .item {
  790. padding: 20rpx;
  791. font-size: 28rpx;
  792. .bh-wrap {
  793. display: flex;
  794. margin-bottom: 10rpx;
  795. justify-content: space-between;
  796. .s1 {
  797. display: flex;
  798. align-items: center;
  799. .b1 {
  800. font-size: 28rpx;
  801. }
  802. }
  803. .s2 {
  804. font-size: 28rpx;
  805. }
  806. }
  807. .title-wrap {
  808. display: flex;
  809. justify-content: space-between;
  810. border-bottom: 1px dashed #dadada;
  811. padding-bottom: 10rpx;
  812. }
  813. .bg-wrap-item {
  814. margin-top: 20rpx;
  815. .value-wrap {
  816. .text {
  817. color: #7f7f7f;
  818. }
  819. .img-wrap {
  820. margin-top: 20rpx;
  821. display: flex;
  822. .img {
  823. width: 140rpx;
  824. height: 140rpx;
  825. &+.img {
  826. margin-left: 10rpx;
  827. }
  828. }
  829. }
  830. }
  831. }
  832. }
  833. }
  834. .title-md {
  835. font-weight: bold;
  836. }
  837. .zxpg-wrap {
  838. display: flex;
  839. flex-direction: column;
  840. align-items: center;
  841. margin-top: 100rpx;
  842. .btns {
  843. font-size: 32rpx;
  844. width: 420rpx;
  845. height: 80rpx;
  846. line-height: 80rpx;
  847. text-align: center;
  848. }
  849. .zx-btn {
  850. background-color: rgba(21, 122, 44, 1);
  851. color: #ffffff;
  852. }
  853. .zp-btn {
  854. color: #169bd5;
  855. }
  856. .disabled {
  857. background-color: rgba(127, 127, 127, 1);
  858. }
  859. }
  860. .bjsymx {
  861. color: #4f7f00;
  862. padding: 20rpx 0;
  863. }
  864. .apply-box {
  865. width: 70%;
  866. margin: 10rpx auto;
  867. display: flex;
  868. align-items: center;
  869. justify-content: space-around;
  870. }
  871. </style>