service-detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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. </view>
  99. </view>
  100. </template>
  101. </u-time-line-item>
  102. <u-time-line-item>
  103. <template v-slot:content>
  104. <view>
  105. <view class="u-order-desc">维修结束时间</view>
  106. <view class="u-order-time">{{ infoData.repairEndTime ? infoData.repairEndTime : '' }}</view>
  107. </view>
  108. </template>
  109. </u-time-line-item>
  110. <u-time-line-item>
  111. <template v-slot:content>
  112. <view>
  113. <view class="u-order-desc">验收开始时间</view>
  114. <view class="u-order-time">{{ infoData.checkStartTime ? infoData.checkStartTime : '' }}
  115. </view>
  116. </view>
  117. </template>
  118. </u-time-line-item>
  119. <u-time-line-item>
  120. <template v-slot:content>
  121. <view>
  122. <view class="u-order-desc">验收结束时间</view>
  123. <view class="u-order-time">{{ infoData.checkEndTime ? infoData.checkEndTime : '' }}</view>
  124. </view>
  125. </template>
  126. </u-time-line-item>
  127. </u-time-line>
  128. </view>
  129. </view>
  130. <view v-if="current == 5">
  131. <view v-for="(item, index) in dataReason" :key="index" class="mx3 my2 p3 bg-color-white"
  132. style="border-radius: 16rpx" @tap="handleEditReport(item)">
  133. <view>
  134. <equipment-line title="分析时间" :content="item.analyzeTime" />
  135. <equipment-line title="故障部位" :content="item.sbPartName" />
  136. <equipment-line title="故障现象" :content="item.problemDesc" />
  137. <equipment-line title="检查处理过程" :content="item.checkProcess" />
  138. <equipment-line title="原因分析" :content="item.reasonAnalysis" />
  139. </view>
  140. </view>
  141. </view>
  142. <view class="p-fixed d-flex j-around a-center footer">
  143. <view class="main-color-bg text-color-white common" @tap="handleAdd" v-show="infoData.status ===
  144. 2 ||
  145. infoData.status ===
  146. 5">维修</view>
  147. <view class="main-color-bg text-color-white common" v-show="infoData.status === 1" @tap="handleDealEdit">接收</view>
  148. <view class="main-color-bg text-color-white common" v-show="!infoData.fourRepairUser && infoData.repairUserId" @tap="handleDetail">转派</view>
  149. <view class="main-color-bg text-color-white common" v-show="infoData.status === 3 ||
  150. infoData.status === 5" @tap="handleExamine">提交审核</view>
  151. <view class="main-color-bg text-color-white common"
  152. v-show="(dataReason === null) || (dataReason.length === 0)" @tap="handleEditReport()">填写维修报告</view>
  153. </view>
  154. </view>
  155. </template>
  156. <script>
  157. export default {
  158. data() {
  159. return {
  160. list: [
  161. {
  162. name: '报修'
  163. },
  164. {
  165. name: '维修'
  166. },
  167. {
  168. name: '派工'
  169. },
  170. {
  171. name: '验收'
  172. },
  173. {
  174. name: '时间轴'
  175. },
  176. {
  177. name: '维修报告'
  178. }
  179. ],
  180. current: 0,
  181. detailId: '',
  182. infoData: {},
  183. needStopMap: {},
  184. sourceMap: {},
  185. levelMap: {},
  186. statusMap: {},
  187. dispatchList: [],
  188. id: '',
  189. imagesList: [],
  190. repairImagesList: [],
  191. dataReason: [],
  192. zjList: []
  193. }
  194. },
  195. onShow() {
  196. if (this.infoData.id) {
  197. this.getDataReason()
  198. }
  199. },
  200. onLoad(options) {
  201. this.id = options.id
  202. this.initData()
  203. this.needStopMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.YES_NO)
  204. this.sourceMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
  205. this.levelMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
  206. this.statusMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
  207. this.descripitionMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIRE_ACTION)
  208. this.$Http
  209. .queryUserDept({
  210. deptCode: this.$DictCache.VALUE.SYS_DEPT_CODE.SYS_DEPT_CODE_XIAN_CHANG_WEI_XIU_ZU,
  211. userStatus: 1
  212. })
  213. .then((res) => {
  214. console.log(res.data);
  215. const temp = []
  216. res.data.forEach((item, index) => {
  217. temp.push({
  218. label: item.realName,
  219. value: item.userId
  220. })
  221. })
  222. this.zjList.push(...temp)
  223. });
  224. this.$Http
  225. .queryUserDept({
  226. deptCode: this.$DictCache.VALUE.SYS_DEPT_CODE.SYS_DEPT_CODE_CHANG_NEI_WEI_XIU_ZU,
  227. userStatus: 1
  228. })
  229. .then((res) => {
  230. console.log(res.data);
  231. const temp = []
  232. res.data.forEach((item, index) => {
  233. temp.push({
  234. label: item.realName,
  235. value: item.userId
  236. })
  237. })
  238. this.zjList.push(...temp)
  239. });
  240. },
  241. methods: {
  242. handlePre(index) {
  243. uni.previewImage({
  244. urls: this.imagesList,
  245. current: this.imagesList[index],
  246. success() { }
  247. })
  248. },
  249. handlePreRepair(index) {
  250. uni.previewImage({
  251. urls: this.repairImagesList,
  252. current: this.repairImagesList[index],
  253. success() { }
  254. })
  255. },
  256. handleDealEdit() {
  257. this.$Http
  258. .repairFormDeal({
  259. id: this.infoData.id
  260. })
  261. .then(res => {
  262. console.log(res)
  263. })
  264. },
  265. change(index) {
  266. this.current = index
  267. },
  268. handleDetail() {
  269. uni.navigateTo({
  270. url: '/pages/repair-detail/transfer?id=' + this.id
  271. })
  272. },
  273. // 提交审批验收
  274. handleExamine() {
  275. var that = this
  276. if (!this.dataReason || this.dataReason.length === 0) {
  277. uni.showToast({
  278. title: '请填写维修报告',
  279. icon: 'none'
  280. })
  281. return
  282. }
  283. uni.showModal({
  284. title: '提示',
  285. content: '确认提交审核?',
  286. success: function (res) {
  287. if (res.confirm) {
  288. that.$Http
  289. .examine({
  290. id: that.id
  291. })
  292. .then(res => {
  293. that.infoData.status = that.$DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT
  294. that.toastSuccess('已提交,请等待审核')
  295. })
  296. }
  297. }
  298. })
  299. },
  300. handleAdd() {
  301. uni.navigateTo({
  302. url: '/pages/service-add/service-add?id=' + this.id
  303. })
  304. },
  305. handleEditReport(item) {
  306. if (item) {
  307. uni.navigateTo({
  308. url: `/pages/repair-reason/repair-reason-form?id=${item.id}`
  309. })
  310. } else {
  311. uni.navigateTo({
  312. url: `/pages/repair-reason/repair-reason-form?sbId=${this.infoData.sbId}&repairId=${this.infoData.id}&no=${this.infoData.no}`
  313. })
  314. }
  315. },
  316. initData() {
  317. this.$Http
  318. .fetchRepairApplicationForm({
  319. id: this.id
  320. })
  321. .then(res => {
  322. console.log(res)
  323. this.infoData = res.data
  324. this.imagesList = res.data.applicationFileList.map(item => {
  325. return this.$BaseTool.UserUtil.getFileUrl(item.url)
  326. })
  327. this.repairImagesList = res.data.repairFileList.map(item => {
  328. return this.$BaseTool.UserUtil.getFileUrl(item.url)
  329. })
  330. this.dispatchList = JSON.parse(res.data.repairDispatchList)
  331. this.getDataReason()
  332. })
  333. },
  334. getUserName(userId) {
  335. var name = ''
  336. this.zjList.forEach(item => {
  337. if (item.value == userId) {
  338. name = item.label
  339. }
  340. })
  341. return name
  342. },
  343. getDataReason() {
  344. this.$Http.queryRepairReason({ repairId: this.infoData.id }).then(res => {
  345. this.dataReason = res.data
  346. })
  347. }
  348. }
  349. }
  350. </script>
  351. <style scoped lang="less">
  352. page {
  353. background-color: #f4f4f4;
  354. }
  355. .container {
  356. padding-bottom: 100rpx;
  357. .footer {
  358. bottom: 0;
  359. left: 0;
  360. right: 0;
  361. background-color: #fff;
  362. z-index: 10000;
  363. }
  364. .title {
  365. border-bottom: 1rpx solid #f4f4f4;
  366. color: #0082ff;
  367. }
  368. .img {
  369. width: 100rpx;
  370. height: 100rpx;
  371. }
  372. .p-fixed {
  373. border-top: 1rpx solid #f4f4f4;
  374. height: 100rpx;
  375. .common {
  376. padding: 15rpx 100rpx;
  377. border-radius: 40rpx;
  378. background-color: #0082ff;
  379. color: #fff;
  380. &:last-child {
  381. background-color: #fff;
  382. color: #0082ff;
  383. border: 1rpx solid #0082ff;
  384. }
  385. }
  386. }
  387. }
  388. </style>