orderconfirm.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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.orderType = option.orderType;
  106. this.getDetail();
  107. },
  108. onShow() {},
  109. methods: {
  110. toOss(url) {
  111. return oss + url;
  112. },
  113. toBack() {
  114. uni.navigateBack({
  115. delta: 1
  116. })
  117. },
  118. openPhoto(file) {
  119. let url = '/pages/check-order/photoView?url=' + file;
  120. uni.navigateTo({
  121. url: url
  122. })
  123. },
  124. openVideo(file) {
  125. let url = '/pages/check-order/videoView?url=' + file;
  126. uni.navigateTo({
  127. url: url
  128. })
  129. },
  130. getDetail() {
  131. let that = this;
  132. let postData = {};
  133. postData['id'] = this.orderId;
  134. http.request({
  135. url: '/galaxy-business/order/detail',
  136. method: 'GET',
  137. data: postData
  138. }).then(res => {
  139. console.log(res)
  140. if (res.data != null) {
  141. that.orderInfo = res.data;
  142. }
  143. }).catch(err => {
  144. console.log(err)
  145. })
  146. },
  147. toOrderConfirm() {
  148. let that = this;
  149. uni.showModal({
  150. content: '确定接受该工单?',
  151. showCancel: true,
  152. success(res) {
  153. if (res.confirm) {
  154. let postData = {};
  155. postData['id'] = that.orderId;
  156. http.request({
  157. url: '/galaxy-business/order/confirm',
  158. method: 'POST',
  159. data: postData
  160. }).then(res => {
  161. console.log(res)
  162. if (res.success) {
  163. uni.showModal({
  164. content: '已接单,是否立即填报?',
  165. showCancel: true,
  166. cancelText: "返回",
  167. success(res) {
  168. if (res.confirm) {
  169. that.toOrderProcessReport();
  170. } else {
  171. that.toBack();
  172. }
  173. }
  174. });
  175. }
  176. }).catch(err => {
  177. console.log(err)
  178. })
  179. }
  180. }
  181. });
  182. },
  183. toOrderProcessReport() {
  184. var url = '/pages/check-order/orderprocessreport?orderId=' + this.id + '&skipPage=2';
  185. uni.navigateTo({
  186. url: url
  187. })
  188. },
  189. }
  190. }
  191. </script>
  192. <style>
  193. /* page {
  194. background-color: rgb(240, 242, 244);
  195. } */
  196. </style>
  197. <style lang="scss" scoped>
  198. .view-btn {
  199. margin-top: 20px;
  200. margin-bottom: 20px;
  201. padding-left: 10px;
  202. padding-right: 10px;
  203. }
  204. .line-space {
  205. margin-top: 4px;
  206. }
  207. </style>