order-confirm.vue 4.9 KB

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