detail.vue 23 KB

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