maintain-detail-ignore.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.executeJobIgnores(this.infoData).then((res) => {
  78. this.initData();
  79. uni.showToast({ title: '已接收,请及时完成任务' });
  80. });
  81. },
  82. handleFinish() {
  83. uni.navigateTo({
  84. url: '/pages/maintain-add/maintain-add-ignore?detailId=' + this.detailId
  85. });
  86. },
  87. handleRepair() {
  88. uni.navigateTo({
  89. url: '/pages/repair-add/repair-add?detailId=' + this.infoData.sbId
  90. });
  91. },
  92. initData() {
  93. this.$Http
  94. .fetchCheckJobIgnores({
  95. id: this.detailId
  96. })
  97. .then((res) => {
  98. this.infoData = res.data;
  99. if (res.data.checkImgList.length > 0) {
  100. this.checkImgList = res.data.checkImgList.map(item => {
  101. return this.$BaseTool.UserUtil.getFileUrl(item.url);
  102. })
  103. }
  104. });
  105. }
  106. }
  107. };
  108. </script>
  109. <style lang="less">
  110. page {
  111. background-color: #f4f4f4;
  112. }
  113. .container {
  114. padding-bottom: 100rpx;
  115. .footer {
  116. bottom: 0;
  117. left: 0;
  118. right: 0;
  119. background-color: #fff;
  120. z-index: 10000;
  121. }
  122. .title {
  123. border-bottom: 1rpx solid #f4f4f4;
  124. }
  125. .img {
  126. width: 100rpx;
  127. height: 100rpx;
  128. }
  129. .p-fixed {
  130. border-top: 1rpx solid #f4f4f4;
  131. height: 100rpx;
  132. .common {
  133. padding: 15rpx 200rpx;
  134. border-radius: 30rpx;
  135. background-color: #0082ff;
  136. color: #fff;
  137. }
  138. }
  139. }
  140. </style>