maintain-detail-ignore.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="container py2">
  3. <view class="mx3 p3 bg-color-white" style="border-radius: 16rpx">
  4. <equipment-line title="状态" :content="statusMap[infoData.status]" />
  5. <equipment-line title="检查项目" :content="infoData.requirement" />
  6. <equipment-line title="执行标准" :content="infoData.remark" />
  7. </view>
  8. <view class="mx3 p3 bg-color-white" style="border-radius: 16rpx">
  9. <view class="d-flex py3 border-bottom">
  10. <view class="f-size-26 text-color-9 w200">维护步骤</view>
  11. <view class="f-size-26 text-color-3 d-flex ">
  12. <block v-for="(item,index) in checkImgList" :key="index">
  13. <u-image width="100" class="mr-2" :src="item" @click="handlePre(index)" mode="widthFix"><u-loading slot="loading"></u-loading></u-image>
  14. </block>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="mx3 p3 bg-color-white" style="border-radius: 16rpx">
  19. <equipment-line title="检查结果" :content="infoData.feedback" />
  20. </view>
  21. <view class="p-fixed d-flex j-around a-center footer">
  22. <view
  23. v-if="infoData.status === 1||
  24. infoData.status === 4"
  25. class="main-color-bg text-color-white common"
  26. @tap="handleExecute"
  27. >接收</view
  28. >
  29. <view
  30. v-if="infoData.status === 2"
  31. class="main-color-bg text-color-white common"
  32. @tap="handleFinish"
  33. >完成</view
  34. >
  35. <view
  36. v-if="infoData.status === 3"
  37. class="main-color-bg text-color-white common"
  38. @tap="handleFinish"
  39. >发起报修</view
  40. >
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. infoData: {},
  49. detailId: '',
  50. statusMap: null,
  51. sbStatusMap: null,
  52. checkImgList: []
  53. };
  54. },
  55. onLoad(options) {
  56. this.detailId = options.detailId;
  57. this.statusMap = this.$DictCache.getLabelByValueMapByType(
  58. this.$DictCache.TYPE.CHECK_JOB_STATUS
  59. );
  60. this.sbStatusMap = this.$DictCache.getLabelByValueMapByType(
  61. this.$DictCache.TYPE.SB_INFO_STATUS
  62. );
  63. },
  64. onShow() {
  65. this.initData();
  66. },
  67. methods: {
  68. handlePre(index) {
  69. uni.previewImage({
  70. urls: this.checkImgList,
  71. current: this.checkImgList[index],
  72. success() {
  73. }
  74. });
  75. },
  76. handleExecute() {
  77. this.$Http.requireLogin(() => {
  78. this.$Http.executeJobIgnores(this.infoData).then((res) => {
  79. this.initData();
  80. uni.showToast({ title: '已接收,请及时完成任务' });
  81. });
  82. }, '接收保养任务需要先登录,是否登录?');
  83. },
  84. handleFinish() {
  85. this.$Http.requireLogin(() => {
  86. uni.navigateTo({
  87. url: '/pages/maintain-add/maintain-add-ignore?detailId=' + this.detailId
  88. });
  89. }, '完成保养任务需要先登录,是否登录?');
  90. },
  91. handleRepair() {
  92. this.$Http.requireLogin(() => {
  93. uni.navigateTo({
  94. url: '/pages/repair-add/repair-add?detailId=' + this.infoData.sbId
  95. });
  96. }, '发起报修需要先登录,是否登录?');
  97. },
  98. initData() {
  99. this.$Http
  100. .fetchCheckJobIgnores({
  101. id: this.detailId
  102. })
  103. .then((res) => {
  104. this.infoData = res.data;
  105. if (res.data.checkImgList.length > 0) {
  106. this.checkImgList = res.data.checkImgList.map(item => {
  107. return this.$BaseTool.UserUtil.getFileUrl(item.url);
  108. })
  109. }
  110. });
  111. }
  112. }
  113. };
  114. </script>
  115. <style lang="less">
  116. page {
  117. background-color: #f4f4f4;
  118. }
  119. .container {
  120. padding-bottom: 100rpx;
  121. .footer {
  122. bottom: 0;
  123. left: 0;
  124. right: 0;
  125. background-color: #fff;
  126. z-index: 10000;
  127. }
  128. .title {
  129. border-bottom: 1rpx solid #f4f4f4;
  130. }
  131. .img {
  132. width: 100rpx;
  133. height: 100rpx;
  134. }
  135. .p-fixed {
  136. border-top: 1rpx solid #f4f4f4;
  137. height: 100rpx;
  138. .common {
  139. padding: 15rpx 200rpx;
  140. border-radius: 30rpx;
  141. background-color: #0082ff;
  142. color: #fff;
  143. }
  144. }
  145. }
  146. </style>