ordercostsapprove.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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 style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  14. <text style="color: white;font-size: 1rem;">{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <uni-forms ref="baseForm" :model="formData">
  19. <uni-section title="审批意见" type="circle">
  20. <view style="margin-top: 20px;margin-bottom: 40px;;padding-left: 10px;padding-right: 10px;">
  21. <uni-easyinput :styles="inputStyles" type="textarea" v-model="formData.processDesc"
  22. placeholder="请录入审批意见">
  23. </uni-easyinput>
  24. </view>
  25. </uni-section>
  26. <view style="margin-top: 5px;margin-bottom: 10px;padding-left: 10px;padding-right: 10px;">
  27. <button style="background-color: lightcoral;" type="default"
  28. @click="onOrderCostsApproveSubmitClick()">审批确认</button>
  29. </view>
  30. </uni-forms>
  31. <uni-section title="工单处理详情" type="circle">
  32. <uni-list>
  33. <uni-list-item v-for="(item,index) in orderProcessList" :key="item.id" direction="column">
  34. <template v-slot:body>
  35. <view class="point">
  36. <view class="dot">
  37. {{index+1}}
  38. </view>
  39. <view class="time-title">{{item.createTime}}【{{item.orderStatusName}}】</view>
  40. </view>
  41. <view class="time-info">
  42. <view class="time-line">
  43. <view v-if="item.orderStatusCode ==2" class="list-item-block">
  44. <view class="line" style="padding-left:12px">
  45. <view v-if="orderType==1" class="text" style="color: gray;">工单类型:<span
  46. style="margin-left: 5px;color: cornflowerblue;">维修工单</span></view>
  47. <view v-else-if="orderType==2" class="text" style="color: gray;">工单类型:<span
  48. style="margin-left: 5px;color: cornflowerblue;">服务工单</span></view>
  49. <view v-else></view>
  50. </view>
  51. <view class="line" style="padding-left:12px">
  52. <view class="text" style="width: 90%;color: gray;">
  53. 工单创建人:<span
  54. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessUserName}}</span>
  55. </view>
  56. </view>
  57. <!-- <view class="line">
  58. <view class="text" style="width: 90%;color: gray;">
  59. 创建时间:<span
  60. style="margin-left: 5px;color: cornflowerblue;">{{item.createTime}}</span>
  61. </view>
  62. </view> -->
  63. <uni-card title="问题描述">
  64. <view class="text" style="color: cornflowerblue;">{{item.processDesc}}
  65. </view>
  66. </uni-card>
  67. <!-- <view class="line">
  68. <view class="text" style="width: 90%;color: gray;">
  69. 问题描述:<span
  70. style="margin-left: 5px;color: cornflowerblue;">{{item.processDesc}}</span>
  71. </view>
  72. </view> -->
  73. <uni-card title="处理照片">
  74. <view class="view-flex-rs-flex-wrap">
  75. <view v-for="(path, index) in item.failureProcessPhotoList" :key="index"
  76. class="view-flex-cc" style="width: 80px;">
  77. <view class="img-container">
  78. <view class="note-image-box">
  79. <view class="note-image-item">
  80. <view class="image-box">
  81. <image :src="toOss(path)" mode="widthFix"
  82. @click="openPhoto(path)">
  83. </image>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </uni-card>
  91. <uni-card title="处理视频">
  92. <view class="view-flex-inline">
  93. <image v-for="(path, index) in item.failureProcessVideoList"
  94. :key="index" mode="widthFix" style="width: 80px;" :src="videoImg"
  95. @click="openVideo(path)">
  96. </image>
  97. </view>
  98. </uni-card>
  99. </view>
  100. <view v-else-if="item.orderStatusCode ==3" class="list-item-block">
  101. <view class="line" style="padding-left:12px">
  102. <view class="text" style="width: 90%;color: gray;">
  103. 工单处理人:<span
  104. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessUserName}}</span>
  105. </view>
  106. </view>
  107. <!-- <view class="line" style="padding-left:12px">
  108. <view class="text" style="width: 90%;color: gray;">
  109. 处理时间:<span
  110. style="margin-left: 5px;color: cornflowerblue;">{{item.createTime}}</span>
  111. </view>
  112. </view> -->
  113. <uni-card v-if="orderType==1" title="故障现象描述">
  114. <view class="text" style="color: cornflowerblue;">{{item.failureCheckDesc}}
  115. </view>
  116. </uni-card>
  117. <uni-card v-else-if="orderType==2" title="服务内容描述">
  118. <view class="text" style="color: cornflowerblue;">{{item.failureCheckDesc}}
  119. </view>
  120. </uni-card>
  121. <!-- <view v-else></view> -->
  122. <uni-card title="解决措施说明">
  123. <view class="text" style="color: cornflowerblue;">{{item.processDesc}}
  124. </view>
  125. </uni-card>
  126. <!-- <view class="line">
  127. <view class="text" style="width: 90%;color: gray;">
  128. 解决措施说明:<span
  129. style="margin-left: 5px;color: cornflowerblue;">{{item.processDesc}}</span>
  130. </view>
  131. </view> -->
  132. <uni-card v-if="orderType==1 && item.costsReport==2" title="费用说明">
  133. <view class="text" style="color: cornflowerblue;">{{item.costsReportDesc}}
  134. </view>
  135. </uni-card>
  136. <uni-card title="处理照片">
  137. <view class="view-flex-rs-flex-wrap">
  138. <view v-for="(path, index) in item.failureProcessPhotoList" :key="index"
  139. class="view-flex-cc" style="width: 80px;">
  140. <view class="img-container">
  141. <view class="note-image-box">
  142. <view class="note-image-item">
  143. <view class="image-box">
  144. <image :src="toOss(path)" mode="widthFix"
  145. @click="openPhoto(path)">
  146. </image>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </uni-card>
  154. </view>
  155. <view v-else-if="item.orderStatusCode ==5" class="list-item-block">
  156. <view class="line" style="padding-left:12px">
  157. <view class="text" style="width: 90%;color: gray;">
  158. 费用审批人:<span
  159. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessUserName}}</span>
  160. </view>
  161. </view>
  162. <!-- <view class="line">
  163. <view class="text" style="width: 90%;color: gray;">
  164. 审批时间:<span
  165. style="margin-left: 5px;color: cornflowerblue;">{{item.createTime}}</span>
  166. </view>
  167. </view> -->
  168. <uni-card title="审批意见">
  169. <view class="text" style="color: cornflowerblue;">{{item.processDesc}}
  170. </view>
  171. </uni-card>
  172. </view>
  173. </view>
  174. </view>
  175. <!-- <view v-else-if="item.orderStatusCode ==7" class="list-item-block">
  176. <view class="line">
  177. <view class="text" style="width: 90%;color: gray;">
  178. 工单完结审批人:<span
  179. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessUserName}}</span>
  180. </view>
  181. </view>
  182. <view class="line">
  183. <view class="text" style="width: 90%;color: gray;">
  184. 审批时间:<span
  185. style="margin-left: 5px;color: cornflowerblue;">{{item.createTime}}</span>
  186. </view>
  187. </view>
  188. <view class="line">
  189. <view class="text" style="width: 90%;color: gray;">
  190. 审批意见:<span
  191. style="margin-left: 5px;color: cornflowerblue;">{{item.processDesc}}</span>
  192. </view>
  193. </view>
  194. </view> -->
  195. </template>
  196. </uni-list-item>
  197. </uni-list>
  198. </uni-section>
  199. <view style="margin-top: 5px;margin-bottom: 10px;padding-left: 10px;padding-right: 10px;">
  200. <button style="background-color: lightcoral;" type="default" @click="toTopClick()">返回顶部</button>
  201. </view>
  202. </view>
  203. </view>
  204. </template>
  205. <script>
  206. import http from '@/http/api.js';
  207. import {
  208. oss,
  209. devUrl,
  210. prodUrl
  211. } from '@/common/setting';
  212. export default {
  213. components: {
  214. },
  215. data() {
  216. return {
  217. title: '工单费用审批',
  218. inputStyles: {
  219. color: '#808080',
  220. borderColor: '#d3d3d3'
  221. },
  222. formData: {
  223. orderId: '',
  224. processDesc: '',
  225. costsApproveType: 0,
  226. },
  227. query: {},
  228. orderId: '',
  229. orderType: 1,
  230. costsApproveItems: {
  231. items: [{
  232. 'value': 1,
  233. 'text': '通过'
  234. }, {
  235. 'value': 2,
  236. 'text': '退回'
  237. }],
  238. current: 0,
  239. },
  240. orderProcessList: [],
  241. baseURL: '',
  242. baseOSS: '',
  243. videoImg: '/static/images/video.png',
  244. }
  245. },
  246. computed: {},
  247. onLoad(option) {
  248. this.orderId = option.orderId;
  249. this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
  250. this.baseOSS = oss;
  251. this.orderType = option.orderType;
  252. this.getDetail();
  253. },
  254. onShow() {},
  255. methods: {
  256. toOss(path) {
  257. let url = this.baseOSS + path;
  258. //console.log("tooss " + url)
  259. return url;
  260. },
  261. toBack() {
  262. uni.navigateBack({
  263. delta: 1
  264. })
  265. },
  266. toTopClick() {
  267. uni.pageScrollTo({
  268. scrollTop: 0,
  269. duration: 100,
  270. });
  271. },
  272. openPhoto(file) {
  273. let url = '/pages/check-order/photoView?url=' + file;
  274. uni.navigateTo({
  275. url: url
  276. })
  277. },
  278. openVideo(file) {
  279. let url = '/pages/check-order/videoView?url=' + file;
  280. uni.navigateTo({
  281. url: url
  282. })
  283. },
  284. getDetail() {
  285. let that = this;
  286. let postData = {};
  287. postData['orderId'] = this.orderId;
  288. http.request({
  289. url: '/galaxy-business/order/process/list',
  290. method: 'GET',
  291. data: postData,
  292. }).then(res => {
  293. if (res.data != null) {
  294. console.log(JSON.stringify(res.data))
  295. that.orderProcessList = res.data;
  296. }
  297. }).catch(err => {
  298. console.log(JOSN.stringify(err))
  299. })
  300. },
  301. onOrderCostsApproveSubmitClick() {
  302. let that = this;
  303. this.formData['orderId'] = this.orderId;
  304. let postData = Object.assign(this.formData, this.query);
  305. http.request({
  306. url: '/galaxy-business/order/process/costsapprove',
  307. method: 'POST',
  308. params: postData
  309. }).then(res => {
  310. if (res.success) {
  311. uni.showModal({
  312. content: '操作成功!',
  313. showCancel: true,
  314. success(res) {
  315. if (res.confirm) {
  316. that.toBack();
  317. }
  318. }
  319. });
  320. } else {
  321. uni.showModal({
  322. content: '操作失败!',
  323. showCancel: true,
  324. success(res) {
  325. }
  326. });
  327. }
  328. }).catch(err => {
  329. console.log(err)
  330. })
  331. },
  332. }
  333. }
  334. </script>
  335. <style>
  336. /* page {
  337. background-color: rgb(240, 242, 244);
  338. } */
  339. </style>
  340. <style lang="scss" scoped>
  341. .container {
  342. padding: 0 0 150rpx;
  343. }
  344. .point {
  345. display: flex;
  346. flex-direction: row;
  347. align-items: center;
  348. margin: 15rpx 0;
  349. }
  350. .dot {
  351. //margin-left: -22rpx;
  352. background-color: #19be6b;
  353. box-shadow: 0 0 5rpx 5rpx #71d5a1;
  354. color: white;
  355. width: 50rpx;
  356. height: 50rpx;
  357. padding: 5rpx;
  358. font-size: 28rpx;
  359. text-align: center;
  360. border-radius: 50rpx;
  361. }
  362. .time-title {
  363. font-size: 30rpx;
  364. margin-left: 15rpx;
  365. background-color: whitesmoke;
  366. padding: 12rpx 25rpx;
  367. border-radius: 50rpx;
  368. color: orangered;
  369. }
  370. .time-info {
  371. padding: 0rpx 0rpx 0rpx 25rpx;
  372. }
  373. .time-line {
  374. border-left: 3rpx solid #71d5a1;
  375. padding: 10rpx 10rpx 30rpx 20rpx;
  376. }
  377. </style>