inspection-close-approve.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <!--
  2. * @Title:
  3. * @Description: 任务确认
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="wrap">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <uni-forms ref="baseForm" :model="formData">
  19. <uni-section title="审批意见" ftitleFontSize="0.8rem" style="width: 100%;">
  20. <template v-slot:decoration>
  21. <view class="decoration"></view>
  22. </template>
  23. <view style="padding-top: 10px;padding-bottom: 0px;padding-left: 15px;padding-right: 15px;">
  24. <uni-forms-item>
  25. <uni-easyinput :styles="styles" type="textarea" v-model="formData.approveDesc"
  26. placeholder="录入审批意见" />
  27. </uni-forms-item>
  28. </view>
  29. </uni-section>
  30. <uni-card title="评分">
  31. <uni-rate v-model="formData.orderRate" />
  32. </uni-card>
  33. </uni-forms>
  34. <view class="view-btn">
  35. <button style="background-color: lightcoral;" type="default"
  36. @click="onCloseConfirmClick()">工单关闭</button>
  37. </view>
  38. <uni-section title="巡检详情" type="line">
  39. <uni-list>
  40. <uni-list-item v-for="(item,index) in dataList" :key="item.id" direction="column">
  41. <template v-slot:body>
  42. <view class="point">
  43. <view class="dot">
  44. {{index+1}}
  45. </view>
  46. <view class="time-title">{{item.createTime}}</view>
  47. </view>
  48. <view class="time-info">
  49. <view class="time-line">
  50. <view class="line" style="padding-left:12px">
  51. <view class="text" style="width: 90%;color: gray;">
  52. 处理人:<span
  53. style="margin-left: 5px;color: cornflowerblue;">{{item.servicePersonName}}</span>
  54. </view>
  55. </view>
  56. <view class="line" style="padding-left:12px">
  57. <view class="text" style="width: 90%;color: gray;">
  58. 巡检内容:<span
  59. style="margin-left: 5px;color: cornflowerblue;">{{item.inspectionDesc}}</span>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. </uni-list-item>
  66. </uni-list>
  67. </uni-section>
  68. <view style="margin-top: 5px;margin-bottom: 10px;padding-left: 10px;padding-right: 10px;">
  69. <button style="background-color: lightcoral;" type="default" @click="toTopClick()">返回顶部</button>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. import http from '@/http/api.js';
  76. import {
  77. oss,
  78. devUrl,
  79. prodUrl
  80. } from '@/common/setting';
  81. export default {
  82. components: {
  83. },
  84. data() {
  85. return {
  86. title: '巡检完结审批',
  87. id: '',
  88. dataList: [],
  89. formData: {
  90. approveDesc: '',
  91. orderRate: 5,
  92. },
  93. styles: {
  94. color: '#333',
  95. borderColor: '#e5e5e5',
  96. disableColor: '#FFFFFF'
  97. },
  98. baseURL: '',
  99. baseOSS: '',
  100. videoImg: '/static/images/video.png',
  101. }
  102. },
  103. computed: {},
  104. onLoad(option) {
  105. this.id = option.id;
  106. this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
  107. this.baseOSS = oss;
  108. this.getDetail();
  109. },
  110. onShow() {},
  111. methods: {
  112. toOss(path) {
  113. let url = this.baseOSS + path;
  114. return url;
  115. },
  116. toBack() {
  117. uni.navigateBack({
  118. delta: 1
  119. })
  120. },
  121. toTopClick() {
  122. uni.pageScrollTo({
  123. scrollTop: 0,
  124. duration: 100,
  125. });
  126. },
  127. openPhoto(file) {
  128. let url = '/pages/check-order/photoView?url=' + file;
  129. uni.navigateTo({
  130. url: url
  131. })
  132. },
  133. openVideo(file) {
  134. let url = '/pages/check-order/videoView?url=' + file;
  135. uni.navigateTo({
  136. url: url
  137. })
  138. },
  139. getDetail() {
  140. let that = this;
  141. let postData = {};
  142. postData['inspectionId'] = this.id;
  143. http.request({
  144. url: '/galaxy-business/equipment/inspection/report/list',
  145. method: 'GET',
  146. data: postData,
  147. }).then(res => {
  148. if (res.data != null) {
  149. console.log(JSON.stringify(res.data))
  150. that.dataList = res.data;
  151. }
  152. }).catch(err => {
  153. console.log(JOSN.stringify(err))
  154. })
  155. },
  156. onCloseConfirmClick() {
  157. let that = this;
  158. uni.showModal({
  159. content: '确定关闭该工单?',
  160. showCancel: true,
  161. success(res) {
  162. if (res.confirm) {
  163. that.formData['id'] = that.id;
  164. http.request({
  165. url: '/galaxy-business/equipment/inspection/close',
  166. method: 'POST',
  167. params: that.formData
  168. }).then(res => {
  169. console.log(res)
  170. if (res.success) {
  171. that.toBack();
  172. }
  173. }).catch(err => {
  174. console.log(err)
  175. })
  176. }
  177. }
  178. });
  179. },
  180. }
  181. }
  182. </script>
  183. <style>
  184. /* page {
  185. background-color: rgb(240, 242, 244);
  186. } */
  187. </style>
  188. <style lang="scss" scoped>
  189. .view-btn {
  190. margin-top: 20px;
  191. margin-bottom: 20px;
  192. padding-left: 10px;
  193. padding-right: 10px;
  194. }
  195. .line-space {
  196. margin-top: 4px;
  197. }
  198. .point {
  199. display: flex;
  200. flex-direction: row;
  201. align-items: center;
  202. margin: 15rpx 0;
  203. }
  204. .dot {
  205. //margin-left: -22rpx;
  206. background-color: #19be6b;
  207. box-shadow: 0 0 5rpx 5rpx #71d5a1;
  208. color: white;
  209. width: 50rpx;
  210. height: 50rpx;
  211. padding: 5rpx;
  212. font-size: 28rpx;
  213. text-align: center;
  214. border-radius: 50rpx;
  215. }
  216. .time-title {
  217. font-size: 30rpx;
  218. margin-left: 15rpx;
  219. background-color: whitesmoke;
  220. padding: 12rpx 25rpx;
  221. border-radius: 50rpx;
  222. color: orangered;
  223. }
  224. .time-info {
  225. padding: 0rpx 0rpx 0rpx 25rpx;
  226. }
  227. .time-line {
  228. border-left: 3rpx solid #71d5a1;
  229. padding: 10rpx 10rpx 30rpx 20rpx;
  230. }
  231. </style>