processcheckorderlistview.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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 v-if="permission.orgAdmin && orderClose==0" class="view-flex-inline-center">
  19. <view style="width: 90%;margin-top: 20px;margin-bottom: 20px;">
  20. <button type="warn" @click="toCancelOrder">取消工单</button>
  21. </view>
  22. </view>
  23. <view v-if="orderClose==1">
  24. <uni-card title="工单评分">
  25. <uni-rate :value="orderRate" color="#bbb" active-color="coral" />
  26. </uni-card>
  27. </view>
  28. <uni-list style="width: 100%;">
  29. <uni-list-item v-for="(item,index) in list" :key="item.id" direction="column">
  30. <template v-slot:body>
  31. <view class="point">
  32. <view class="dot">
  33. {{index+1}}
  34. </view>
  35. <view class="time-title">{{item.createTime}}【{{item.orderStatusName}}】</view>
  36. </view>
  37. <view class="time-info">
  38. <view class="time-line">
  39. <!-- 工单下发 -->
  40. <view v-if="item.orderStatusCode ==2" class="list-item-block">
  41. <view class="line" style="padding-left:12px">
  42. <view v-if="orderType==1" class="text" style="color: gray;width: 90%;">
  43. 工单类型:<span style="margin-left: 5px;color: cornflowerblue;">维修工单</span>
  44. </view>
  45. <view v-else-if="orderType==2" class="text" style="color: gray;width: 90%;">
  46. 工单类型:<span style="margin-left: 5px;color: cornflowerblue;">服务工单</span>
  47. </view>
  48. <view v-else></view>
  49. </view>
  50. <view class="line" style="padding-left:12px">
  51. <view class="text" style="color: gray;width: 90%;">
  52. 工单创建人:<span
  53. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessUserName}}</span>
  54. </view>
  55. </view>
  56. <uni-card title="问题描述">
  57. <view class="text" style="color: cornflowerblue;">{{item.processDesc}}
  58. </view>
  59. </uni-card>
  60. <uni-card title="照片">
  61. <view class="view-flex-rs-flex-wrap">
  62. <view v-for="(path, index) in item.failureProcessPhotoList" :key="index"
  63. class="view-flex-cc" 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="toOss(path)" mode="widthFix"
  69. @click="openPhoto(path)">
  70. </image>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </uni-card>
  78. <uni-card title="视频">
  79. <view class="view-flex-inline">
  80. <image v-for="(path, index) in item.failureProcessVideoList" :key="index"
  81. mode="widthFix" style="width: 80px;" :src="videoImg"
  82. @click="openVideo(path)">
  83. </image>
  84. </view>
  85. </uni-card>
  86. </view>
  87. <!-- 工单处理中 -->
  88. <view v-else-if="item.orderStatusCode ==3" class="list-item-block">
  89. <view class="line" style="padding-left:12px">
  90. <view class="text" style="width: 90%;color: gray;">
  91. 工单处理人:<span
  92. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessUserName}}</span>
  93. </view>
  94. </view>
  95. <!-- <view v-if="orderType==1" class="line"> -->
  96. <uni-card v-if="orderType==1" title="故障现象描述">
  97. <view class="text" style="color: cornflowerblue;">{{item.failureCheckDesc}}
  98. </view>
  99. </uni-card>
  100. <!-- </view> -->
  101. <!-- <view v-else-if="orderType==2" class="line"> -->
  102. <uni-card v-else-if="orderType==2" title="服务内容描述">
  103. <view class="text" style="color: cornflowerblue;">{{item.failureCheckDesc}}
  104. </view>
  105. </uni-card>
  106. <!-- </view> -->
  107. <!-- <view v-else></view> -->
  108. <uni-card title="解决措施说明">
  109. <view class="text" style="color: cornflowerblue;">{{item.processDesc}}
  110. </view>
  111. </uni-card>
  112. <uni-card v-if="orderType==1 && item.costsReport==2" title="费用说明">
  113. <view class="text" style="color: cornflowerblue;">{{item.costsReportDesc}}
  114. </view>
  115. </uni-card>
  116. <uni-card title="照片">
  117. <view class="view-flex-rs-flex-wrap">
  118. <view v-for="(path, index) in item.failureProcessPhotoList" :key="index"
  119. class="view-flex-cc" style="width: 80px;">
  120. <view class="img-container">
  121. <view class="note-image-box">
  122. <view class="note-image-item">
  123. <view class="image-box">
  124. <image :src="toOss(path)" mode="widthFix"
  125. @click="openPhoto(path)">
  126. </image>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. <!-- <view class="view-flex-block-center">
  134. <image v-for="(path, index) in item.failureProcessPhotoList" :key="index"
  135. mode="widthFix" style="width: 80%;margin-top: 10px;" :src="toOss(path)">
  136. </image>
  137. </view> -->
  138. </uni-card>
  139. </view>
  140. <!-- 费用审批 -->
  141. <view v-else-if="item.orderStatusCode ==5" class="list-item-block">
  142. <view class="line" style="padding-left:12px">
  143. <view class="text" style="width: 90%;color: gray;">
  144. 费用审批人:<span
  145. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessUserName}}</span>
  146. </view>
  147. </view>
  148. <uni-card title="审批意见">
  149. <view class="text" style="color: cornflowerblue;">{{item.processDesc}}
  150. </view>
  151. </uni-card>
  152. </view>
  153. <!-- 关闭审批 -->
  154. <view v-else-if="item.orderStatusCode ==7" class="list-item-block">
  155. <view class="line" style="padding-left:12px">
  156. <view class="text" style="width: 90%;color: gray;">
  157. 工单完结审批人:<span
  158. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessUserName}}</span>
  159. </view>
  160. </view>
  161. <uni-card title="审批意见">
  162. <view class="text" style="color: cornflowerblue;">{{item.processDesc}}
  163. </view>
  164. </uni-card>
  165. </view>
  166. </view>
  167. </view>
  168. </template>
  169. </uni-list-item>
  170. </uni-list>
  171. </view>
  172. </view>
  173. </template>
  174. <script>
  175. import {
  176. role
  177. } from "@/api/role.js";
  178. import http from '@/http/api.js';
  179. import {
  180. oss,
  181. devUrl,
  182. prodUrl
  183. } from '@/common/setting';
  184. export default {
  185. components: {},
  186. data() {
  187. return {
  188. title: '工单处理记录详情',
  189. permission: {
  190. 'admin': false,
  191. 'orgAdmin': false,
  192. 'companyAdmin': false,
  193. 'companyServciePerson': false,
  194. },
  195. pageSize: 10,
  196. pageCurrent: 1,
  197. total: 0,
  198. list: [],
  199. query: {},
  200. orderId: '',
  201. orderType: 1,
  202. orderRate: 0,
  203. baseURL: '',
  204. baseOSS: '',
  205. videoImg: '/static/images/video.png',
  206. orderClose: 0,
  207. }
  208. },
  209. computed: {},
  210. onLoad(option) {
  211. this.permission.admin = false;
  212. this.permission.orgAdmin = false;
  213. this.permission.companyAdmin = false;
  214. this.permission.companyServciePerson = false;
  215. if (this.userInfo.role_name === role.admin) {
  216. this.permission.admin = true;
  217. } else if (this.userInfo.role_name === role.orgAdmin) {
  218. this.permission.orgAdmin = true;
  219. } else if (this.userInfo.role_name === role.companyAdmin) {
  220. this.permission.companyAdmin = true;
  221. } else if (this.userInfo.role_name === role.companyServciePerson) {
  222. this.permission.companyServciePerson = true;
  223. if (this.userInfo.post_id == '1706859505948098562') {
  224. this.postName = "engineer";
  225. } else if (this.userInfo.post_id == '1730535542909140993') {
  226. this.postName = "servicePerson";
  227. }
  228. }
  229. this.orderClose = option.orderClose;
  230. this.orderId = option.orderId;
  231. this.orderType = option.orderType;
  232. if (this.orderClose == 1) {
  233. this.orderRate = option.orderRate;
  234. }
  235. this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
  236. this.baseOSS = oss;
  237. this.query = {};
  238. this.query['orderId'] = this.orderId;
  239. this.pageCurrent = 1;
  240. this.getPage()
  241. },
  242. onShow() {},
  243. methods: {
  244. toOss(path) {
  245. return this.baseOSS + path;
  246. },
  247. toBack() {
  248. uni.navigateBack({
  249. delta: 1
  250. })
  251. },
  252. onBackPress() {
  253. // #ifdef APP-PLUS
  254. plus.key.hideSoftKeybord();
  255. // #endif
  256. },
  257. pageChange(e) {
  258. this.pageCurrent = e.current;
  259. this.getPage()
  260. },
  261. toCancelOrder() {
  262. uni.navigateTo({
  263. url: '/pages/check-order/ordercancel?id=' + this.orderId
  264. })
  265. },
  266. openPhoto(file) {
  267. let url = '/pages/check-order/photoView?url=' + file;
  268. uni.navigateTo({
  269. url: url
  270. })
  271. },
  272. openVideo(file) {
  273. let url = '/pages/check-order/videoView?url=' + file;
  274. uni.navigateTo({
  275. url: url
  276. })
  277. },
  278. getPage(params = {}) {
  279. let postData = Object.assign(params, this.query);
  280. let that = this;
  281. http.request({
  282. url: '/galaxy-business/order/process/list',
  283. method: 'GET',
  284. data: postData,
  285. }).then(res => {
  286. if (res.data != null) {
  287. console.log(JSON.stringify(res.data))
  288. that.list = res.data;
  289. }
  290. }).catch(err => {
  291. console.log(err)
  292. })
  293. },
  294. }
  295. }
  296. </script>
  297. <style lang="scss" scoped>
  298. .point {
  299. display: flex;
  300. flex-direction: row;
  301. align-items: center;
  302. margin: 15rpx 0;
  303. }
  304. .dot {
  305. //margin-left: -22rpx;
  306. background-color: #19be6b;
  307. box-shadow: 0 0 5rpx 5rpx #71d5a1;
  308. color: white;
  309. width: 50rpx;
  310. height: 50rpx;
  311. padding: 5rpx;
  312. font-size: 28rpx;
  313. text-align: center;
  314. border-radius: 50rpx;
  315. }
  316. .time-title {
  317. font-size: 30rpx;
  318. margin-left: 15rpx;
  319. background-color: whitesmoke;
  320. padding: 12rpx 25rpx;
  321. border-radius: 50rpx;
  322. color: orangered;
  323. }
  324. .time-info {
  325. padding: 0rpx 0rpx 0rpx 25rpx;
  326. }
  327. .time-line {
  328. border-left: 3rpx solid #71d5a1;
  329. padding: 10rpx 10rpx 30rpx 20rpx;
  330. }
  331. </style>