service-detail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <template>
  2. <view class="container">
  3. <u-tabs :list="list" :is-scroll="true" :current="current" @change="change"></u-tabs>
  4. <view v-if="current == 0">
  5. <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
  6. <equipment-line title="报修单号" :content="infoData.no" />
  7. <equipment-line title="设备名称" :content="infoData.sbName" />
  8. <equipment-line title="是否停机" :content="$BaseTool.Object.getField(needStopMap, infoData.needStop)" />
  9. <equipment-line title="报修人" :content="infoData.userName" />
  10. <equipment-line title="报修来源" :content="$BaseTool.Object.getField(sourceMap, infoData.source)" />
  11. <equipment-line title="紧急等级" :content="$BaseTool.Object.getField(levelMap, infoData.level)" />
  12. <equipment-line title="报修时间" :content="infoData.applyTime" />
  13. <equipment-line title="状态" :content="$BaseTool.Object.getField(levelMap, infoData.status)" />
  14. <view class="d-flex py3 border-bottom">
  15. <view class="f-size-26 text-color-9 w200">图片</view>
  16. <view class="f-size-26 text-color-3 d-flex">
  17. <block v-for="(item, index) in imagesList" :key="index">
  18. <u-image width="100" class="mr-2" :src="item" @click="handlePre(index)"
  19. mode="widthFix"><u-loading slot="loading"></u-loading></u-image>
  20. </block>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view v-if="current == 1">
  26. <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
  27. <template v-if="infoData">
  28. <equipment-line title="故障类别" :content="infoData.repairErrorTypeName" />
  29. <equipment-line title="维修开始时间" :content="infoData.repairStartTime" />
  30. <equipment-line title="维修结束时间" :content="infoData.repairEndTime" />
  31. <equipment-line title="维修耗时" :content="infoData.repairMinutes + ''" />
  32. <equipment-line title="维修人员" :content="infoData.repairUserName" />
  33. <equipment-line v-if="infoData.secondRepairUser" title="维修人员2"
  34. :content="getUserName(infoData.secondRepairUser)" />
  35. <equipment-line v-if="infoData.threeRepairUser" title="维修人员3"
  36. :content="getUserName(infoData.threeRepairUser)" />
  37. <equipment-line v-if="infoData.fourRepairUser" title="维修人员4"
  38. :content="getUserName(infoData.fourRepairUser)" />
  39. <!--<equipment-line title="维修次数" :content="infoData.repairTimes + ''" />-->
  40. <equipment-line title="维修描述" :content="descripitionMap[infoData.repairContent]" />
  41. <equipment-line title="备注" :content="infoData.repairRemark" />
  42. <view class="d-flex py3 border-bottom">
  43. <view class="f-size-26 text-color-9 w200">图片</view>
  44. <view class="f-size-26 text-color-3 d-flex">
  45. <block v-for="(item, index) in repairImagesList" :key="index">
  46. <u-image width="100" class="mr-2" :src="item" @click="handlePreRepair(index)"
  47. mode="widthFix"><u-loading slot="loading"></u-loading></u-image>
  48. </block>
  49. </view>
  50. </view>
  51. </template>
  52. </view>
  53. </view>
  54. <view v-if="current == 2">
  55. <view v-for="(item, index) in dispatchList" :key="index" class="mx3 my2 p3 bg-color-white"
  56. style="border-radius: 16rpx">
  57. <view>
  58. <equipment-line title="转派人" :content="item.username" />
  59. <equipment-line title="转派时间" :content="item.time" />
  60. <equipment-line title="转派备注" :content="item.repairDispatchRemark" />
  61. </view>
  62. </view>
  63. </view>
  64. <view v-if="current == 3">
  65. <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
  66. <template v-if="infoData">
  67. <equipment-line title="验收开始时间" :content="infoData.checkStartTime" />
  68. <equipment-line title="验收结束时间" :content="infoData.checkEndTime" />
  69. <equipment-line title="维修人员" :content="infoData.checkUserName" />
  70. <equipment-line title="验收描述" :content="infoData.checkContent" />
  71. </template>
  72. </view>
  73. </view>
  74. <view v-if="current == 4">
  75. <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
  76. <u-time-line>
  77. <u-time-line-item>
  78. <template v-slot:content>
  79. <view>
  80. <view class="u-order-desc">报修时间</view>
  81. <view class="u-order-time">{{ infoData.applyTime }}</view>
  82. </view>
  83. </template>
  84. </u-time-line-item>
  85. <u-time-line-item>
  86. <template v-slot:content>
  87. <view>
  88. <view class="u-order-desc">派工时间</view>
  89. <view class="u-order-time">{{ infoData.applyTime }}</view>
  90. </view>
  91. </template>
  92. </u-time-line-item>
  93. <u-time-line-item>
  94. <template v-slot:content>
  95. <view>
  96. <view class="u-order-desc">维修开始时间</view>
  97. <view class="u-order-time">{{ infoData.repairStartTime ? infoData.repairStartTime : ''
  98. }}
  99. </view>
  100. </view>
  101. </template>
  102. </u-time-line-item>
  103. <u-time-line-item>
  104. <template v-slot:content>
  105. <view>
  106. <view class="u-order-desc">维修结束时间</view>
  107. <view class="u-order-time">{{ infoData.repairEndTime ? infoData.repairEndTime : '' }}
  108. </view>
  109. </view>
  110. </template>
  111. </u-time-line-item>
  112. <u-time-line-item>
  113. <template v-slot:content>
  114. <view>
  115. <view class="u-order-desc">验收开始时间</view>
  116. <view class="u-order-time">{{ infoData.checkStartTime ? infoData.checkStartTime : '' }}
  117. </view>
  118. </view>
  119. </template>
  120. </u-time-line-item>
  121. <u-time-line-item>
  122. <template v-slot:content>
  123. <view>
  124. <view class="u-order-desc">验收结束时间</view>
  125. <view class="u-order-time">{{ infoData.checkEndTime ? infoData.checkEndTime : '' }}
  126. </view>
  127. </view>
  128. </template>
  129. </u-time-line-item>
  130. </u-time-line>
  131. </view>
  132. </view>
  133. <!-- <view v-if="current == 5">
  134. <view v-for="(item, index) in dataReason" :key="index" class="mx3 my2 p3 bg-color-white"
  135. style="border-radius: 16rpx" @tap="handleEditReport(item)">
  136. <view>
  137. <equipment-line title="分析时间" :content="item.analyzeTime" />
  138. <equipment-line title="故障部位" :content="item.sbPartName" />
  139. <equipment-line title="故障现象" :content="item.problemDesc" />
  140. <equipment-line title="检查处理过程" :content="item.checkProcess" />
  141. <equipment-line title="原因分析" :content="item.reasonAnalysis" />
  142. </view>
  143. </view>
  144. </view> -->
  145. <view class="p-fixed d-flex j-around a-center footer">
  146. <view class="common btn-primary" @tap="handleAdd" v-show="infoData.status ===
  147. 2 ||
  148. infoData.status ===
  149. 5">完成</view>
  150. <view class="common btn-primary" v-show="infoData.status === 1" @tap="handleDealEdit">接收
  151. </view>
  152. <view class="common btn-plain" v-show="!infoData.fourRepairUser && infoData.repairUserId"
  153. @tap="handleDetail">转派
  154. </view>
  155. <view class="common btn-primary" v-show="infoData.status === 3 ||
  156. infoData.status === 5" @tap="handleExamine">提交审核</view>
  157. <!-- <view class="common btn-plain" v-show="(dataReason === null) || (dataReason.length === 0)"
  158. @tap="handleEditReport()">填写维修报告</view> -->
  159. </view>
  160. </view>
  161. </template>
  162. <script>
  163. export default {
  164. data() {
  165. return {
  166. list: [
  167. {
  168. name: '报修'
  169. },
  170. {
  171. name: '维修'
  172. },
  173. {
  174. name: '派工'
  175. },
  176. {
  177. name: '验收'
  178. },
  179. {
  180. name: '时间轴'
  181. },
  182. // {
  183. // name: '维修报告'
  184. // }
  185. ],
  186. current: 0,
  187. detailId: '',
  188. infoData: {},
  189. needStopMap: {},
  190. sourceMap: {},
  191. levelMap: {},
  192. statusMap: {},
  193. dispatchList: [],
  194. id: '',
  195. imagesList: [],
  196. repairImagesList: [],
  197. dataReason: [],
  198. zjList: []
  199. }
  200. },
  201. onShow() {
  202. if (this.infoData.id) {
  203. this.getDataReason()
  204. }
  205. },
  206. onLoad(options) {
  207. this.id = options.id
  208. this.initData()
  209. this.needStopMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.YES_NO)
  210. this.sourceMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
  211. this.levelMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
  212. this.statusMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
  213. this.descripitionMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIRE_ACTION)
  214. this.$Http
  215. .queryUserDept({
  216. deptCode: this.$DictCache.VALUE.SYS_DEPT_CODE.SYS_DEPT_CODE_XIAN_CHANG_WEI_XIU_ZU,
  217. userStatus: 1
  218. })
  219. .then((res) => {
  220. console.log(res.data);
  221. const temp = []
  222. res.data.forEach((item, index) => {
  223. temp.push({
  224. label: item.realName,
  225. value: item.userId
  226. })
  227. })
  228. this.zjList.push(...temp)
  229. });
  230. this.$Http
  231. .queryUserDept({
  232. deptCode: this.$DictCache.VALUE.SYS_DEPT_CODE.SYS_DEPT_CODE_CHANG_NEI_WEI_XIU_ZU,
  233. userStatus: 1
  234. })
  235. .then((res) => {
  236. console.log(res.data);
  237. const temp = []
  238. res.data.forEach((item, index) => {
  239. temp.push({
  240. label: item.realName,
  241. value: item.userId
  242. })
  243. })
  244. this.zjList.push(...temp)
  245. });
  246. },
  247. methods: {
  248. handlePre(index) {
  249. uni.previewImage({
  250. urls: this.imagesList,
  251. current: this.imagesList[index],
  252. success() { }
  253. })
  254. },
  255. handlePreRepair(index) {
  256. uni.previewImage({
  257. urls: this.repairImagesList,
  258. current: this.repairImagesList[index],
  259. success() { }
  260. })
  261. },
  262. handleDealEdit() {
  263. this.$Http
  264. .repairFormDeal({
  265. id: this.infoData.id
  266. })
  267. .then(res => {
  268. console.log(res)
  269. })
  270. },
  271. change(index) {
  272. this.current = index
  273. },
  274. handleDetail() {
  275. uni.navigateTo({
  276. url: '/pages/repair-detail/transfer?id=' + this.id
  277. })
  278. },
  279. // 提交审批验收
  280. handleExamine() {
  281. uni.showModal({
  282. title: '提示',
  283. content: '确认提交审核?',
  284. success: function (res) {
  285. if (res.confirm) {
  286. that.$Http
  287. .examine({
  288. id: that.id
  289. })
  290. .then(res => {
  291. that.infoData.status = that.$DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT
  292. that.toastSuccess('已提交,请等待审核')
  293. })
  294. }
  295. }
  296. })
  297. },
  298. handleAdd() {
  299. uni.navigateTo({
  300. url: '/pages/service-add/service-add?id=' + this.id
  301. })
  302. },
  303. handleEditReport(item) {
  304. if (item) {
  305. uni.navigateTo({
  306. url: `/pages/repair-reason/repair-reason-form?id=${item.id}`
  307. })
  308. } else {
  309. uni.navigateTo({
  310. url: `/pages/repair-reason/repair-reason-form?sbId=${this.infoData.sbId}&repairId=${this.infoData.id}&no=${this.infoData.no}`
  311. })
  312. }
  313. },
  314. initData() {
  315. this.$Http
  316. .fetchRepairApplicationForm({
  317. id: this.id
  318. })
  319. .then(res => {
  320. console.log(res)
  321. this.infoData = res.data
  322. this.imagesList = res.data.applicationFileList.map(item => {
  323. return this.$BaseTool.UserUtil.getFileUrl(item.url)
  324. })
  325. this.repairImagesList = res.data.repairFileList.map(item => {
  326. return this.$BaseTool.UserUtil.getFileUrl(item.url)
  327. })
  328. this.dispatchList = JSON.parse(res.data.repairDispatchList)
  329. this.getDataReason()
  330. })
  331. },
  332. getUserName(userId) {
  333. var name = ''
  334. this.zjList.forEach(item => {
  335. if (item.value == userId) {
  336. name = item.label
  337. }
  338. })
  339. return name
  340. },
  341. getDataReason() {
  342. this.$Http.queryRepairReason({ repairId: this.infoData.id }).then(res => {
  343. this.dataReason = res.data
  344. })
  345. }
  346. }
  347. }
  348. </script>
  349. <style scoped lang="less">
  350. page {
  351. background-color: #f4f4f4;
  352. }
  353. .container {
  354. padding-bottom: 160rpx;
  355. .footer {
  356. bottom: 0;
  357. left: 0;
  358. right: 0;
  359. background-color: #fff;
  360. z-index: 10000;
  361. border-top: 1rpx solid #f4f4f4;
  362. padding: 16rpx 24rpx;
  363. // 兼容 iPhone 底部安全区
  364. padding-bottom: calc(16rpx + constant(safe-area-inset-bottom));
  365. padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
  366. .common {
  367. flex: 1;
  368. margin: 0 10rpx;
  369. height: 80rpx;
  370. line-height: 78rpx;
  371. text-align: center;
  372. font-size: 28rpx;
  373. border-radius: 40rpx;
  374. white-space: nowrap;
  375. overflow: hidden;
  376. text-overflow: ellipsis;
  377. }
  378. // 主操作:实心
  379. .btn-primary {
  380. background-color: #0082ff;
  381. color: #fff;
  382. }
  383. // 辅助操作:描边
  384. .btn-plain {
  385. background-color: #fff;
  386. color: #0082ff;
  387. border: 1rpx solid #0082ff;
  388. }
  389. }
  390. .title {
  391. border-bottom: 1rpx solid #f4f4f4;
  392. color: #0082ff;
  393. }
  394. .img {
  395. width: 100rpx;
  396. height: 100rpx;
  397. }
  398. }
  399. </style>