Toberepaired.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="contain">
  3. <view class="main" style="padding: 0;">
  4. <view class="baoxiu"><span></span>报修信息</view>
  5. <u-cell-group>
  6. <u-cell title="报修时间" :value="details.shijian">
  7. </u-cell>
  8. <u-cell title="报修位置" :value="details.weizhi">
  9. </u-cell>
  10. <u-cell title="报修区域" :value="details.quyu">
  11. </u-cell>
  12. <u-cell title="报修类型" :value="details.leixing">
  13. </u-cell>
  14. <u-cell title="联系人" :value="details.lxr">
  15. </u-cell>
  16. <u-cell title="联系电话" :value="details.lxdh">
  17. </u-cell>
  18. <u--form labelPosition="left" >
  19. <u-form-item labelWidth='180' style="padding:0 32rpx;" label="故障描述:">
  20. </u-form-item>
  21. <u-form-item labelWidth='180' borderBottom style="padding:0 32rpx;">
  22. <view style="width:100%;padding: 0 20rpx;height:80px">{{details.gzms}}</view>
  23. </u-form-item>
  24. <u-form-item labelWidth='180' label="故障照片" style="padding:0 32rpx;">
  25. </u-form-item>
  26. <u-form-item labelWidth='180' borderBottom style="padding:0 32rpx;">
  27. <view class="uploadPart">
  28. <view class="allimg" v-for="img in details.gzimg">
  29. <image :src="img" mode="aspectFill" class="newimg"></image>
  30. </view>
  31. </view>
  32. </u-form-item>
  33. </u--form>
  34. </u-cell-group>
  35. <view class="baoxiu"><span></span>维修信息</view>
  36. <u-cell-group>
  37. <u-cell title="紧急程度" :value="details.jinji">
  38. </u-cell>
  39. <!-- <u-cell title="维修人员" :value="details.weixiury">
  40. </u-cell> -->
  41. <u-cell title="联系电话" :value="details.weixiudh">
  42. </u-cell>
  43. </u-cell-group>
  44. </view>
  45. <view class="tijiao">
  46. <view v-if="$has('app:MaintenanceCompleted')">
  47. <u-button type="primary" text="维修完成" @click="returndata"></u-button>
  48. </view>
  49. </view>
  50. <!--确定弹窗-->
  51. <u-modal :show="showqd" title="提示" content='请问是否确定维修完成?' :showCancelButton="true" @confirm="weixiuyes"
  52. @cancel="weixiuno"></u-modal>
  53. <u-notify ref="uNotify" message=""></u-notify>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. showqd: false,
  61. companyOrgId: '',
  62. details: {
  63. shijian: '',
  64. weizhi: '',
  65. quyu: '',
  66. leixing: '',
  67. lxr: '',
  68. lxdh: '',
  69. gzms: '',
  70. gzimg: [],
  71. jinji: '',
  72. weixiury: '',
  73. weixiudh: ''
  74. },
  75. }
  76. },
  77. onLoad(options) {
  78. this.companyOrgId = options.id;
  79. this.getdata();
  80. },
  81. methods: {
  82. getdata() {
  83. this.$api.get('/repairorder/' + this.companyOrgId, {})
  84. .then(res => {
  85. this.details.shijian = res.data.data.createDate;
  86. this.details.weizhi = res.data.data.repairPosition;
  87. this.details.lxr = res.data.data.contactPerson;
  88. this.details.lxdh = res.data.data.contactPhone;
  89. this.details.gzms = res.data.data.faultDes;
  90. this.details.weixiury = res.data.data.repairPersonName;
  91. res.data.data.faultPics = res.data.data.faultPics.split(",");
  92. this.details.gzimg = res.data.data.faultPics;
  93. if (res.data.data.repairRegion == 1) {
  94. this.details.quyu = '公共区域';
  95. } else if (res.data.data.repairRegion == 2) {
  96. this.details.quyu = '室内';
  97. }
  98. if (res.data.data.repairType == 1) {
  99. this.details.leixing = '水';
  100. } else if (res.data.data.repairType == 2) {
  101. this.details.leixing = '电';
  102. } else if (res.data.data.repairType == 3) {
  103. this.details.leixing = '其他';
  104. }
  105. if (res.data.data.urgency == 1) {
  106. this.details.jinji = '非常紧急';
  107. } else if (res.data.data.urgency == 2) {
  108. this.details.jinji = '紧急';
  109. } else if (res.data.data.urgency == 3) {
  110. this.details.jinji = '普通';
  111. }
  112. })
  113. },
  114. returndata() {
  115. this.showqd = true;
  116. },
  117. weixiuyes() {
  118. this.$api.post('/repairorder/finish/' + this.companyOrgId, {})
  119. .then(res => {
  120. if (res.data.code == 0) {
  121. this.$refs.uNotify.success('维修成功')
  122. setTimeout(function() {
  123. uni.navigateTo({
  124. url: '/pages/index/Workordertodone/Workordertodone'
  125. })
  126. }, 1000);
  127. } else {
  128. this.$refs.uNotify.error(res.data.msg)
  129. }
  130. })
  131. this.showqd = false;
  132. },
  133. weixiuno() {
  134. this.showqd = false;
  135. },
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. .baoxiu {
  141. padding: 18rpx 32rpx;
  142. font-size: 36rpx;
  143. span {
  144. display: inline-block;
  145. margin-right: 16rpx;
  146. width: 8rpx;
  147. height: 32rpx;
  148. background-color: #5776E6;
  149. border-radius: 5rpx;
  150. }
  151. }
  152. .uploadPart {
  153. display: flex;
  154. justify-content: center;
  155. width: 100%;
  156. .uploadBtn {
  157. width: 160rpx;
  158. height: 160rpx;
  159. background-color: #ECF0FF;
  160. text-align: center;
  161. border-radius: 4rpx;
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. }
  166. .allimg {
  167. position: relative;
  168. }
  169. .newimg {
  170. width: 160rpx;
  171. height: 160rpx;
  172. margin-right: 10rpx;
  173. border: 1px solid #eee;
  174. }
  175. }
  176. </style>