orderconfirm.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. <view class="view-btn">
  19. <button style="background-color: lightcoral;" type="default" @click="toOrderProcess()">工单处理填报</button>
  20. </view>
  21. <uni-section title="工单详情" titleFontSize="0.8rem" type="circle">
  22. <uni-group style="margin-top: 0px;">
  23. <view class="items-line">
  24. <view class="item-text-lable">工单发起人:</view>
  25. </view>
  26. <view class="items-line">
  27. <view class="item-text-content" style="margin-left: 0px;color: deepskyblue;">
  28. {{orderInfo.createOrderPersonName}}
  29. </view>
  30. </view>
  31. <view class="items-line line-space">
  32. <view class="item-text-lable">发起时间:</view>
  33. </view>
  34. <view class="items-line line-space">
  35. <view class="item-text-content" style="margin-left: 0px;color: deepskyblue;">
  36. {{orderInfo.createTime}}
  37. </view>
  38. </view>
  39. <view class="items-line line-space">
  40. <view class="item-text-lable">问题描述:</view>
  41. </view>
  42. <view class="items-line line-space">
  43. <view class="item-text-content" style="margin-left: 0px;color: deepskyblue;">
  44. {{orderInfo.orderDesc}}
  45. </view>
  46. </view>
  47. </uni-group>
  48. <uni-card title="工单照片">
  49. <view class="view-flex-rs-flex-wrap">
  50. <view v-for="(path, index) in orderInfo.orderPhotoList" :key="index"
  51. class="view-flex-cc" style="width: 80px;">
  52. <view class="img-container">
  53. <view class="note-image-box">
  54. <view class="note-image-item">
  55. <view class="image-box">
  56. <image :src="toOss(path)" mode="widthFix"
  57. @click="openPhoto(path)">
  58. </image>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- <view class="view-flex-block-center">
  66. <image v-for="(path, index) in orderInfo.orderPhotoList" :key="index" mode="widthFix"
  67. style="width: 80%;margin-top: 10px;" :src="toOss(path)">
  68. </image>
  69. </view> -->
  70. </uni-card>
  71. <uni-card title="工单视频" sub-title="点击视频图标可进行播放预览">
  72. <view class="view-flex-rs-flex-wrap">
  73. <view v-for="(item, index) in orderInfo.orderVideoList" :key="index" class="view-flex-cc"
  74. style="width: 80px;">
  75. <view class="img-container">
  76. <view class="note-image-box">
  77. <view class="note-image-item">
  78. <view class="image-box">
  79. <image :src="videoImg" mode="widthFix" @click="openVideo(item)">
  80. </image>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </uni-card>
  88. </uni-section>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. import http from '@/http/api.js';
  94. import {
  95. oss,
  96. } from '@/common/setting';
  97. export default {
  98. components: {
  99. },
  100. data() {
  101. return {
  102. title: '工单详情',
  103. orderId: '',
  104. orderInfo: {
  105. createOrderPersonName: '',
  106. createTime: '',
  107. orderDesc: '',
  108. },
  109. orderType: 1,
  110. videoImg: '/static/images/video.png',
  111. }
  112. },
  113. computed: {},
  114. onLoad(option) {
  115. this.orderId = option.orderId;
  116. this.orderType = option.orderType;
  117. this.getDetail();
  118. },
  119. onShow() {},
  120. methods: {
  121. toOss(url) {
  122. return oss + url;
  123. },
  124. toBack() {
  125. uni.navigateBack({
  126. delta: 1
  127. })
  128. },
  129. openPhoto(file) {
  130. let url = '/pages/check-order/photoView?url=' + file;
  131. uni.navigateTo({
  132. url: url
  133. })
  134. },
  135. openVideo(file) {
  136. let url = '/pages/check-order/videoView?url=' + file;
  137. uni.navigateTo({
  138. url: url
  139. })
  140. },
  141. getDetail() {
  142. let that = this;
  143. let postData = {};
  144. postData['id'] = this.orderId;
  145. http.request({
  146. url: '/galaxy-business/order/detail',
  147. method: 'GET',
  148. data: postData
  149. }).then(res => {
  150. console.log(res)
  151. if (res.data != null) {
  152. that.orderInfo = res.data;
  153. }
  154. }).catch(err => {
  155. console.log(err)
  156. })
  157. },
  158. toOrderProcess() {
  159. var url = '/pages/check-order/orderprocessreport?skipPage=2&costsApprove=1&orderType=' + this.orderType +
  160. '&orderId=' + this.orderId;
  161. uni.navigateTo({
  162. url: url
  163. })
  164. },
  165. toOrderConfirm() {
  166. let that = this;
  167. uni.showModal({
  168. content: '确定接受该维修任务?',
  169. showCancel: true,
  170. success(res) {
  171. if (res.confirm) {
  172. let postData = {};
  173. postData['id'] = that.id;
  174. http.request({
  175. url: '/galaxy-business/rtu/check/order/confirm',
  176. method: 'POST',
  177. data: postData
  178. }).then(res => {
  179. console.log(res)
  180. if (res.success) {
  181. uni.showModal({
  182. content: '任务已确认,是否立即填报?',
  183. showCancel: true,
  184. cancelText: "返回",
  185. success(res) {
  186. if (res.confirm) {
  187. that.toOrderProcessReport();
  188. } else {
  189. that.toBack();
  190. }
  191. }
  192. });
  193. }
  194. }).catch(err => {
  195. console.log(err)
  196. })
  197. }
  198. }
  199. });
  200. },
  201. toOrderProcessReport() {
  202. var url = '/pages/check-order/orderprocessreport?orderId=' + this.id + '&skipPage=2';
  203. uni.navigateTo({
  204. url: url
  205. })
  206. },
  207. }
  208. }
  209. </script>
  210. <style>
  211. /* page {
  212. background-color: rgb(240, 242, 244);
  213. } */
  214. </style>
  215. <style lang="scss" scoped>
  216. .view-btn {
  217. margin-top: 20px;
  218. margin-bottom: 20px;
  219. padding-left: 10px;
  220. padding-right: 10px;
  221. }
  222. .line-space {
  223. margin-top: 4px;
  224. }
  225. </style>