detail.vue 25 KB

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