detail.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. <template>
  2. <view class="maintenance-container">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="保养工单详情" @clickLeft="back"
  4. @clickRight="HandlScanCode"></uni-nav-bar>
  5. <view class="maintenance-wrapper">
  6. <view class="maintenance-content">
  7. <u-subsection :list="tabList" :current="active" @change="handleTabChange" active-color="#157a2c"></u-subsection>
  8. <view class="kd-baseInfo" v-show="active === 0">
  9. <view class="kd-cell">
  10. <text class="kd-label">工单编号</text>
  11. <text class="kd-content">{{ worksheetInfo.code }}</text>
  12. </view>
  13. <view class="kd-cell">
  14. <text class="kd-label">保养名称</text>
  15. <text class="kd-content">{{ worksheetInfo.planName }}</text>
  16. </view>
  17. <view class="kd-cell">
  18. <text class="kd-label">设备分类</text>
  19. <text class="kd-content">{{ worksheetInfo.categoryName }}</text>
  20. </view>
  21. <view class="kd-cell">
  22. <text class="kd-label">保养设备总数</text>
  23. <text
  24. class="kd-content text-warning">{{ worksheetInfo.finishNum }}/{{ worksheetInfo.total }}</text>
  25. </view>
  26. <view class="kd-cell">
  27. <text class="kd-label">计划完成时长</text>
  28. <text class="kd-content">{{ worksheetInfo.duration }}分钟</text>
  29. </view>
  30. <view class="kd-cell">
  31. <text class="kd-label">实际完成时长</text>
  32. <text
  33. class="kd-content">{{ finishTime(worksheetInfo.acceptTime, worksheetInfo.finishTime) }}</text>
  34. </view>
  35. <view class="kd-cell">
  36. <text class="kd-label">实际开始时间</text>
  37. <text class="kd-content">{{ worksheetInfo.acceptTime }}</text>
  38. </view>
  39. <view class="kd-cell">
  40. <text class="kd-label">实际完成时间</text>
  41. <text class="kd-content">{{ worksheetInfo.finishTime }}</text>
  42. </view>
  43. <!-- <u-button type="primary" size="large" text="开始执行"></u-button> -->
  44. <template>
  45. <template v-if="worksheetInfo.orderStatus === 0">
  46. <button class="btn-execute" type="primary" @click="handleExecute">开始执行</button>
  47. <button class="btn-sparepart" type="warning" @click="handlbpbj">申请备品备件</button>
  48. <button class="btn-reassignment" type="primary" @click="handleAssign">转派</button>
  49. <!-- <div class="apply-box">
  50. <button
  51. class="btn-reassignment"
  52. type="primary"
  53. @click="sparepartApply"
  54. >
  55. 申请备品备件
  56. </button>
  57. </div> -->
  58. </template>
  59. <template v-else-if="worksheetInfo.orderStatus === 2">
  60. <button class="btn-execute" type="primary" @click="handleReport">报工</button>
  61. <button class="btn-sparepart" type="warning" @click="handlbpbj">申请备品备件</button>
  62. </template>
  63. <button v-else-if="worksheetInfo.orderStatus === 3" :disabled="true" class="btn-execute"
  64. type="primary">已报工</button>
  65. <!-- <div class="apply-box">
  66. <button
  67. v-if="worksheetInfo.status.code !== 3"
  68. class="btn-reassignment"
  69. type="primary"
  70. @click="sparepartApply"
  71. >
  72. 申请备品备件
  73. </button>
  74. <button
  75. v-if="worksheetInfo.status.code === 0"
  76. class="btn-reassignment"
  77. type="primary"
  78. @click="handleAssign"
  79. >
  80. 转派
  81. </button>
  82. </div> -->
  83. </template>
  84. </view>
  85. <view class="kd-equipment" v-show="active === 1">
  86. <view class="kd-type-box">
  87. <view :class="{ 'type—active': typeActive === index }" v-for="(item, index) in equpStatus"
  88. :key="index" @click="typeChange(index)">
  89. {{ item.name }}
  90. <text v-if="item.count > 0" class="count">{{ item.count }}</text>
  91. </view>
  92. </view>
  93. <view class="kd-list-container">
  94. <u-list @scrolltolower="scrolltolower">
  95. <u-list-item v-for="(item, index) in euqiList" :key="index">
  96. <view class="kd-card">
  97. <view class="kd-card-wrapper">
  98. <view class="kd-cell">
  99. <text class="kd-label">设备编码</text>
  100. <text class="kd-content">{{ item.code }}</text>
  101. </view>
  102. <view class="kd-cell">
  103. <text class="kd-label">设备名称</text>
  104. <text class="kd-content">{{ item.name }}</text>
  105. </view>
  106. <view class="kd-cell">
  107. <text class="kd-label">设备型号</text>
  108. <text class="kd-content">{{ item.model }}</text>
  109. </view>
  110. <view class="kd-cell">
  111. <text class="kd-label">设备位置</text>
  112. <text class="kd-content">{{ item.deviceLocationName.pathName }}</text>
  113. </view>
  114. <view class="kd-cell">
  115. <text class="kd-label">执行结果</text>
  116. <text class="kd-content">
  117. <text class="status-box text-warning"
  118. v-if="item.executeStatus === 0">待检</text>
  119. <text class="status-box text-primary"
  120. v-else-if="item.executeStatus === 1">已检</text>
  121. <text class="status-box text-danger"
  122. v-else-if="item.executeStatus === 2">异常</text>
  123. <text class="status-box text-primary"
  124. v-else-if="item.executeStatus === 3">已报修</text>
  125. </text>
  126. </view>
  127. </view>
  128. <view class="card-footer">
  129. <button v-if="item.orderStatus == 2 && item.executeStatus == 0" type="primary"
  130. class="primary-btn" @click="handleCheck(item)">检查</button>
  131. <!-- <button type="primary" class="primary-btn" @click="handleExecute" v-if="item.orderStatus == 2 && item.executeStatus == 0">开始执行</button> -->
  132. <template v-if="item.orderStatus && item.orderStatus === 3">
  133. <button type="default" v-if="item.resultStatus === 2"
  134. @click="handLbx(item)">报修</button>
  135. <button type="default" v-else-if="item.resultStatus === 3"
  136. @click="handLbxDetail(item)">报修详情</button>
  137. </template>
  138. <button type="default"
  139. v-if="[0, 2, 3].includes(item.orderStatus) && item.executeStatus != 0"
  140. @click="checkDetail(item)">保养详情</button>
  141. </view>
  142. </view>
  143. </u-list-item>
  144. </u-list>
  145. </view>
  146. </view>
  147. <view class="spare-parts" v-if="active == 2">
  148. <pickCard :list="sparePartsApply" />
  149. </view>
  150. <!-- <view class="spare-parts" v-show="active === 2">
  151. <Step>
  152. <StepItem v-for="(item, index) in repairInfoLogList" :key="index" :active="index == 0" :hideContent="Boolean(item.content)">
  153. <template v-slot:header>
  154. <view class="step-title">
  155. <view class="s1">{{ typeOptions[item.type] }}</view>
  156. <view class="s2">
  157. {{ item.createTime }}
  158. </view>
  159. </view>
  160. </template>
  161. <template v-slot:content v-if="item.content">
  162. <view class="list-xs" v-if="item.type == 'CREATE'">
  163. <view class="list-xs-item">
  164. <view class="label">报修人</view>
  165. <view class="value">
  166. {{ logs[item.id] ? logs[item.id].content.requestUserName : '' }}
  167. </view>
  168. </view>
  169. <view class="list-xs-item">
  170. <view class="label">故障描述</view>
  171. <view class="value">
  172. {{ logs[item.id] ? logs[item.id].content.remark : '' }}
  173. </view>
  174. </view>
  175. </view>
  176. <view class="list-xs" v-else-if="item.type == 'SPARE_PARTS_APPLY'">
  177. <view class="list-xs-item">
  178. <view class="label">申领清单</view>
  179. <view class="value bjsymx" @click="handlbjsymx('备件明细', item.content.infoList)">备件使用明细</view>
  180. </view>
  181. </view>
  182. <view class="list-xs" v-else-if="item.type == 'ACCEPTANCE_CHEK'">
  183. <view class="list-xs-item">
  184. <view class="label">验收人</view>
  185. <view class="value">
  186. {{ logs[item.id] ? logs[item.id].content.userName : '' }}
  187. </view>
  188. </view>
  189. <view class="list-xs-item">
  190. <view class="label">验收结果</view>
  191. <view class="value">
  192. {{ logs[item.id] ? (logs[item.id].content.orderStatus == 4 ? '通过' : '驳回') : '' }}
  193. </view>
  194. </view>
  195. </view>
  196. <view class="list-xs" v-else-if="item.type == 'WORK_REPORT'">
  197. <view class="list-xs-item">
  198. <view class="label">处理说明</view>
  199. <view class="value">
  200. {{ logs[item.id] ? logs[item.id].content.reason : '' }}
  201. </view>
  202. </view>
  203. </view>
  204. </template>
  205. </StepItem>
  206. </Step>
  207. <PopSparePart ref="PopSparePart" :workOrderCode="workOrderCode" :noRequest="true"></PopSparePart>
  208. </view> -->
  209. </view>
  210. </view>
  211. <uni-popup ref="inputDialog" type="dialog">
  212. <uni-popup-dialog ref="inputClose" mode="input" title="您当前已超出计划完成时间,请填写原因" placeholder="请输入内容"
  213. :before-close="true" @close="handleClose" @confirm="timeoutCauseConfirm"></uni-popup-dialog>
  214. </uni-popup>
  215. <u-modal :show="modalShow" title="提示" @confirm="modalShow = false">
  216. <view>
  217. 您还有
  218. <text class="text-warning">{{ worksheetInfo.awaitInspectSum }}</text>
  219. 台设备待检,不可报工
  220. </view>
  221. </u-modal>
  222. <Assign ref="assignRef" @success="assignSuccess" />
  223. <!-- <ScanCode @scancodedate="scancodedate" :model="'uni'"></ScanCode> -->
  224. </view>
  225. </template>
  226. <script>
  227. import Step from '@/components/Step/Step.vue'
  228. import StepItem from '@/components/Step/StepItem.vue'
  229. import PopSparePart from '../../maintenanceWorkorder/components/PopSparePart.vue'
  230. import {
  231. getWorkOrderDetail,
  232. getDeviceList,
  233. startExecuting,
  234. signingWork,
  235. devicestatistics
  236. } from '@/api/myTicket/index.js'
  237. import {
  238. getSpareParts,
  239. getSparePartsApply,
  240. getWordOrderDetail
  241. } from '@/api/repair'
  242. import {
  243. get,
  244. post,
  245. postJ
  246. } from '@/utils/api.js'
  247. import Assign from '@/components/Assign.vue'
  248. import CellInfo from '@/components/CellInfo.vue'
  249. import KdTabs from '@/components/KdTabs.vue'
  250. import dayjs from 'dayjs'
  251. import ScanCode from '@/components/ScanCode.vue'
  252. import pickCard from '@/pages/maintenanceWorkorder/components/pickCard.vue'
  253. export default {
  254. components: {
  255. CellInfo,
  256. KdTabs,
  257. Assign,
  258. ScanCode,
  259. Step,
  260. StepItem,
  261. PopSparePart,
  262. pickCard
  263. },
  264. data() {
  265. return {
  266. tabList: ['基本信息', '保养设备', '备品备件'],
  267. typeOptions: {
  268. CREATE: '生成工单',
  269. SPARE_PARTS_APPLY: '备品备件申请',
  270. ACCEPTANCE_CHEK: '验收',
  271. WORK_REPORT: '报工'
  272. },
  273. logs: {},
  274. modalShow: false,
  275. active: 0,
  276. typeActive: 0,
  277. statusList: {
  278. 0: '待接收',
  279. 1: '执行中',
  280. 3: '已完成'
  281. },
  282. pageId: '',
  283. workOrderCode: '',
  284. worksheetInfo: {
  285. equiList: [],
  286. workOrder: {}
  287. },
  288. repairInfoLogList: [],
  289. sparePartsApply: [],
  290. equpStatus: [
  291. // {
  292. // name: '全部',
  293. // value: []
  294. // },
  295. {
  296. name: '全部',
  297. value: -1
  298. },
  299. {
  300. name: '待检',
  301. value: 0
  302. },
  303. {
  304. name: '已检',
  305. value: 1
  306. },
  307. {
  308. name: '异常',
  309. value: 2
  310. }
  311. ],
  312. euqiList: [],
  313. equipPage: 1,
  314. isEnd: false,
  315. barType: 0,
  316. qrContent: null
  317. }
  318. },
  319. async onLoad(options) {
  320. this.pageId = options.id
  321. this.planId = options.planId
  322. // 设备台账跳转详情
  323. this.getInfo()
  324. },
  325. onShow() {
  326. this.getInfo()
  327. this.getCount()
  328. if (this.chooseTab) {
  329. this.active = 1
  330. this.typeChange(2)
  331. } else {
  332. this.typeChange(0)
  333. }
  334. },
  335. onHide() {
  336. uni.$off('scancodedate')
  337. },
  338. onUnload() {
  339. uni.$off('scancodedate')
  340. },
  341. methods: {
  342. // 跳转备品备件
  343. async handlbpbj() {
  344. let data = await getWordOrderDetail(this.worksheetInfo.id);
  345. data.deviceList = data.deviceList.map((item) => {
  346. return item.substance;
  347. });
  348. data['pageType'] = 'add'
  349. uni.navigateTo({
  350. url: `/pages/maintenanceWorkorder/sparepart/sparepart?data=${JSON.stringify(data)}`
  351. })
  352. },
  353. //获取备品备件
  354. async getSparePartsApply(id) {
  355. const list = await getSparePartsApply(id)
  356. this.sparePartsApply = list
  357. },
  358. getCount() {
  359. devicestatistics({
  360. planId: this.planId
  361. }).then(data => {
  362. this.equpStatus = this.equpStatus.map(item => {
  363. switch (item.name) {
  364. case '全部':
  365. return {
  366. ...item, count: data.total
  367. }
  368. case '待检':
  369. return {
  370. ...item, count: data.isInspectedNum
  371. }
  372. case '已检':
  373. return {
  374. ...item, count: data.checkedNum
  375. }
  376. case '异常':
  377. return {
  378. ...item, count: data.abnormalNum
  379. }
  380. }
  381. })
  382. })
  383. },
  384. // 扫码枪扫码
  385. cbScancodedate(data) {
  386. this.Scancodedate(data.code)
  387. },
  388. // 相机扫码
  389. HandlScanCode() {
  390. let _this = this
  391. uni.scanCode({
  392. onlyFromCamera: true,
  393. success: function(res) {
  394. _this.Scancodedate(res.result)
  395. }
  396. })
  397. },
  398. Scancodedate(code) {
  399. let _this = this
  400. if (this.worksheetInfo.status.code === 0) {
  401. uni.showModal({
  402. title: '提示',
  403. content: '工单未开启执行,不可进行保养操作,请先点击“开始执行”!',
  404. confirmText: '开始执行', //这块是确定按钮的文字
  405. cancelText: '取消', //这块是取消的文字
  406. success: function(res) {
  407. if (res.confirm) {
  408. _this.handleExecute() // 执行确认后的操作
  409. } else {
  410. // 执行取消后的操作
  411. }
  412. }
  413. })
  414. return
  415. }
  416. this.qrContent = code.trim()
  417. this.barType = this.setBarType(this.qrContent)
  418. _this.getData()
  419. },
  420. // 设置barType
  421. setBarType(val) {
  422. let index = val.indexOf('@_@')
  423. let result = 0
  424. if (index !== -1) {
  425. let item = val.substr(index + 3, 1)
  426. if (item) {
  427. result = Number(item)
  428. }
  429. }
  430. return result
  431. },
  432. // 根据条码请求设备数据
  433. getData() {
  434. let par = {
  435. barType: this.barType,
  436. qrContent: this.qrContent
  437. }
  438. uni.showLoading({
  439. title: '加载中',
  440. mask: true
  441. })
  442. postJ(this.apiUrl + '/scan/getAssetInfo', par)
  443. .then(res => {
  444. console.log('扫码接口返回', res)
  445. let data = res.data
  446. this.matchEquipment(data)
  447. })
  448. .finally(() => {
  449. uni.hideLoading()
  450. })
  451. },
  452. matchEquipment(data) {
  453. let par = {
  454. assetCode: data.assetCode,
  455. workOrderId: this.worksheetInfo.id
  456. }
  457. console.log('par', par)
  458. post(this.apiUrl + '/workOrder/scanMatching', par).then(res => {
  459. let data = res.data
  460. if (!data) {
  461. uni.showModal({
  462. title: '提示',
  463. content: '本工单中,无此设备!',
  464. confirmText: '好的', //这块是确定按钮的文字
  465. showCancel: false,
  466. success: function(res) {
  467. if (res.confirm) {
  468. // 执行确认后的操作
  469. } else {
  470. // 执行取消后的操作
  471. }
  472. }
  473. })
  474. } else {
  475. // 未报工
  476. if (this.worksheetInfo.status.code === 1) {
  477. this.handleCheck(data)
  478. }
  479. // 已报工
  480. if (this.worksheetInfo.status.code === 3) {
  481. this.checkDetail(data)
  482. }
  483. }
  484. })
  485. },
  486. back() {
  487. uni.navigateBack({
  488. delta: 1
  489. })
  490. },
  491. handleAssign() {
  492. this.$refs.assignRef.open(this.worksheetInfo.id)
  493. },
  494. assignSuccess() {
  495. this.back()
  496. },
  497. finishTime(start, end) {
  498. if (!end) return ''
  499. let dur = new Date(end).getTime() - new Date(start).getTime()
  500. return Math.ceil(dur / 1000 / 60) + '分钟'
  501. },
  502. // 申请备品备件
  503. sparepartApply() {
  504. uni.navigateTo({
  505. url: `/pages/maintenance/sparepart/sparepart?planCode=${this.worksheetInfo.planCode}&sourceId=${this.worksheetInfo.id}&sourceCode=${this.worksheetInfo.workOrderCode}`
  506. })
  507. },
  508. // 申请备品备件详情
  509. sparepartDetail() {
  510. uni.navigateTo({
  511. url: `/pages/maintenance/sparepart/sparepartDetail?applyOrder=${this.worksheetInfo.applyOrder}`
  512. })
  513. },
  514. // 报工
  515. handleReport() {
  516. if (this.worksheetInfo.finishNum !== this.worksheetInfo.total) {
  517. uni.showToast({
  518. title: '请完成巡检设备检查',
  519. icon: 'none'
  520. })
  521. this.active = 1
  522. //---------------------------------
  523. } else {
  524. if (new Date(this.worksheetInfo.acceptTime).getTime() + this.worksheetInfo.duration * 60 * 1000 <
  525. new Date().getTime()) {
  526. this.$refs.inputDialog.open()
  527. return
  528. }
  529. this._report()
  530. }
  531. },
  532. handleClose() {
  533. this.$refs.inputDialog.close()
  534. },
  535. timeoutCauseConfirm(value) {
  536. if (!value) {
  537. uni.showToast({
  538. title: '请输入超时原因',
  539. icon: 'none'
  540. })
  541. return
  542. }
  543. this.$refs.inputDialog.close()
  544. this._report(value)
  545. },
  546. _report(timeoutCause = '') {
  547. signingWork({
  548. id: this.pageId,
  549. timeoutCause: timeoutCause
  550. }).then(() => {
  551. uni.showToast({
  552. icon: 'success',
  553. title: '操作成功!',
  554. duration: 2000
  555. })
  556. this.getInfo()
  557. })
  558. },
  559. // 执行工单
  560. handleExecute() {
  561. startExecuting({
  562. id: this.pageId
  563. }).then(() => {
  564. uni.showToast({
  565. icon: 'success',
  566. title: '操作成功!',
  567. duration: 2000
  568. })
  569. this.getInfo()
  570. })
  571. },
  572. //巡点检设备加载更多
  573. scrolltolower() {
  574. if (this.isEnd) return
  575. this.equipPage++
  576. this.getEquipList()
  577. },
  578. // 巡点检设备列表
  579. getEquipList() {
  580. const params = {
  581. planId: this.planId,
  582. status: this.equpStatus[this.typeActive].value,
  583. pageNum: 1,
  584. size: 9999
  585. }
  586. getDeviceList(params).then(data => {
  587. if (this.equipPage === 1) {
  588. this.euqiList = data.list
  589. } else {
  590. this.euqiList.push(...data.list)
  591. }
  592. this.isEnd = this.euqiList.length >= data.count
  593. })
  594. },
  595. handleTabChange(value) {
  596. console.log(value, 'value')
  597. this.active = value
  598. if (value === 1) {
  599. this.typeChange(0)
  600. }
  601. },
  602. // 设备状态切换
  603. typeChange(type) {
  604. this.typeActive = type
  605. this.equipPage = 1
  606. this.getEquipList()
  607. },
  608. // handleCheck({ id, equiName, equiCode, sparePartsJson }) {
  609. // this.$store.commit('maintenance/SET_SPAREPARTSJSON', sparePartsJson)
  610. // uni.navigateTo({
  611. // url: `/pages/maintenance/check/index?workOrderId=${this.pageId}&id=${id}&equiName=${equiName}&equiCode=${equiCode}&applyOrder=${this.worksheetInfo.applyOrder}&workOrderCode=${this.worksheetInfo.workOrderCode}`
  612. // })
  613. // },
  614. // checkDetail({ id, equiName, equiCode, sparePartsJson }) {
  615. // this.$store.commit('maintenance/SET_SPAREPARTSJSON', sparePartsJson)
  616. // uni.navigateTo({
  617. // url: `/pages/maintenance/check/detail?workOrderId=${this.pageId}&id=${id}&equiName=${equiName}&equiCode=${equiCode}&applyOrder=${this.worksheetInfo.applyOrder}&workOrderCode=${this.worksheetInfo.workOrderCode}`
  618. // })
  619. // },
  620. handleCheck({
  621. id
  622. }) {
  623. uni.navigateTo({
  624. url: `/pages/maintenance/check/index?id=${id}`
  625. })
  626. },
  627. checkDetail({
  628. id
  629. }) {
  630. uni.navigateTo({
  631. url: `/pages/maintenance/check/detail?id=${id}`
  632. })
  633. },
  634. getInfo() {
  635. getWorkOrderDetail({
  636. workId: this.pageId
  637. }).then(data => {
  638. this.worksheetInfo = data
  639. this.getSparePartsApply(data.id)
  640. })
  641. getSpareParts({
  642. workOrderId: this.pageId
  643. }).then(data => {
  644. let list = JSON.parse(JSON.stringify(data))
  645. this.repairInfoLogList = list.reverse()
  646. this.repairInfoLogList.forEach(item => {
  647. this.logs[item.id] = {
  648. id: item.id,
  649. content: item.content,
  650. createTime: item.createTime,
  651. type: item.type,
  652. remark: item.remark,
  653. requestUserName: item.requestUserName
  654. }
  655. if (item.type === 'SPARE_PARTS_APPLY') {
  656. this.logs[item.id].content.infoList =
  657. this.logs[item.id].content && this.logs[item.id].content.infoList && this
  658. .logs[item.id].content.infoList.length > 0 ?
  659. this.logs[item.id].content.infoList.map(item => {
  660. return {
  661. ...JSON.parse(item.sparePartsList),
  662. sparePartsId: item.sparePartsId
  663. }
  664. }) : []
  665. }
  666. console.log('this.logs---------------')
  667. console.log(this.logs)
  668. })
  669. })
  670. },
  671. // 报修
  672. handLbx(item) {
  673. uni.navigateTo({
  674. url: `/pages/repair/repair/index?source=4&workOrderCode=${this.workOrderCode}&equiCode=${item.equiCode}&equiId=${item.equiId}&workOrderId=${this.pageId}&equiName=${item.equiName}&equiModel=${item.equiModel}&equiLocation=${item.equiLocation}`
  675. })
  676. },
  677. // 报修详情
  678. handLbxDetail(item) {
  679. uni.navigateTo({
  680. url: `/pages/repair/detail/detail?id=${item.repairId}`
  681. })
  682. }
  683. }
  684. }
  685. </script>
  686. <style lang="scss" scoped>
  687. @import '@/components/submitted.scss';
  688. /deep/.u-subsection__item__text {
  689. font-size: 28rpx !important;
  690. }
  691. /deep/.u-cell__body {
  692. // {
  693. // font-size: 26rpx !important;
  694. // }
  695. // padding: 12rpx 12rpx;
  696. .u-cell__title-text,
  697. .input-value,
  698. .uni-input-wrapper {
  699. font-size: 26rpx !important;
  700. }
  701. }
  702. .list-cell {
  703. display: flex;
  704. align-items: center;
  705. justify-content: space-between;
  706. color: $uni-text-color-grey;
  707. padding: 5rpx 20rpx;
  708. }
  709. .font-sm {
  710. font-size: $uni-font-size-sm;
  711. }
  712. .font-text {
  713. color: $uni-text-color;
  714. }
  715. .btn-execute {
  716. background-color: $j-primary-border-green;
  717. width: 450rpx;
  718. margin-top: 10vh;
  719. }
  720. .btn-sparepart {
  721. width: 450rpx;
  722. margin-top: 20rpx;
  723. }
  724. .btn-reassignment {
  725. color: $uni-color-primary;
  726. background-color: transparent;
  727. border: none;
  728. box-shadow: none;
  729. &::after {
  730. display: none;
  731. }
  732. }
  733. .maintenance-container {
  734. position: fixed;
  735. top: 0;
  736. bottom: 0;
  737. width: 100vw;
  738. display: flex;
  739. flex-direction: column;
  740. /deep/.u-popup {
  741. flex: none !important;
  742. }
  743. }
  744. .maintenance-wrapper {
  745. position: relative;
  746. flex: 1;
  747. }
  748. .maintenance-content {
  749. padding-top: 12rpx;
  750. box-sizing: border-box;
  751. // height: calc(100vh - 88rpx);
  752. position: absolute;
  753. top: 0;
  754. bottom: 0;
  755. left: 0;
  756. right: 0;
  757. display: flex;
  758. flex-direction: column;
  759. }
  760. .kd-cell {
  761. line-height: 90rpx;
  762. border-bottom: 1px dashed #dadada;
  763. display: flex;
  764. justify-content: space-between;
  765. .kd-label {
  766. display: inline-block;
  767. width: 7em;
  768. font-weight: bold;
  769. }
  770. .kd-content {
  771. flex: 1;
  772. text-align: left;
  773. word-break: break-all;
  774. }
  775. }
  776. .kd-baseInfo {
  777. padding: 0 32rpx;
  778. font-size: 28rpx;
  779. overflow: auto;
  780. }
  781. .kd-equipment {
  782. flex: 1;
  783. display: flex;
  784. flex-direction: column;
  785. overflow: hidden;
  786. .kd-type-box {
  787. text-align: center;
  788. padding: 26rpx 0;
  789. view {
  790. position: relative;
  791. display: inline-block;
  792. width: 120rpx;
  793. padding: 4rpx 0;
  794. color: #747474;
  795. margin: 0 20rpx;
  796. background-color: rgba(215, 215, 215, 0.5);
  797. &.type—active {
  798. background-color: #1e7f35;
  799. color: #fff;
  800. }
  801. .count {
  802. position: absolute;
  803. top: -9px;
  804. right: -9px;
  805. width: 18px;
  806. height: 18px;
  807. border-radius: 50%;
  808. font-size: 12px;
  809. background-color: red;
  810. color: #fff;
  811. }
  812. }
  813. }
  814. .kd-list-container {
  815. flex: 1;
  816. display: flex;
  817. flex-direction: column;
  818. overflow: hidden;
  819. padding: 12rpx 18rpx;
  820. background-color: $page-bg;
  821. .u-list {
  822. flex: 1;
  823. height: 100% !important;
  824. }
  825. }
  826. }
  827. .spare-parts {
  828. flex: 1;
  829. overflow: hidden;
  830. }
  831. .kd-card {
  832. background-color: #fff;
  833. margin-bottom: 20rpx;
  834. padding: 8rpx 0;
  835. font-size: 28rpx;
  836. word-break: break-all;
  837. .kd-card-wrapper {
  838. padding: 0 30rpx;
  839. border-bottom: 1px solid #dadada;
  840. }
  841. .kd-cell {
  842. line-height: 60rpx;
  843. }
  844. .kd-cell:last-of-type {
  845. border-bottom: none;
  846. }
  847. .status-box {
  848. margin-right: 16rpx;
  849. }
  850. .card-footer {
  851. display: flex;
  852. justify-content: flex-end;
  853. align-items: center;
  854. padding: 8rpx 0 20rpx;
  855. button {
  856. width: 180rpx;
  857. height: 56rpx;
  858. line-height: 56rpx;
  859. font-size: 28rpx;
  860. margin: 0 8rpx;
  861. }
  862. .primary-btn {
  863. background-color: $j-primary-border-green;
  864. }
  865. }
  866. }
  867. .apply-box {
  868. width: 70%;
  869. margin: 0 auto;
  870. display: flex;
  871. align-items: center;
  872. justify-content: space-around;
  873. }
  874. </style>