detail.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view class="app-container">
  3. <no-data v-if="noData" :showText="'暂无工单信息'"></no-data>
  4. <block v-else>
  5. <view class="top-container">
  6. <uni-steps :options="steps" :active="orderState" active-color="#FF3F42"></uni-steps>
  7. </view>
  8. <view class="detail-container">
  9. <view class="card">
  10. <view class="title">订单信息</view>
  11. <view class="item">
  12. <view class="label">销售单号</view>
  13. <view class="value">{{detail.orderId || ''}}</view>
  14. </view>
  15. <view class="item">
  16. <view class="label">购买日期</view>
  17. <view class="value">{{detail.payTime || ''}}</view>
  18. </view>
  19. <view class="item">
  20. <view class="label">产品类型</view>
  21. <view class="value">{{detail.mainName || ''}}</view>
  22. </view>
  23. <block v-for="(item, index) in detail.goods" :key='index'>
  24. <view class="item">
  25. <view class="label">产品机型</view>
  26. <view class="value">{{item.pname}}</view>
  27. </view>
  28. <view class="item">
  29. <view class="label">产品数量</view>
  30. <view class="value">{{item.number}}</view>
  31. </view>
  32. </block>
  33. </view>
  34. <view class="card">
  35. <view class="title">服务信息</view>
  36. <view class="item">
  37. <view class="label">工单编号</view>
  38. <view class="value">{{detail.workerOrder || ''}}</view>
  39. </view>
  40. <view class="item">
  41. <view class="label">派单日期</view>
  42. <view class="value">{{detail.createTime || ''}}</view>
  43. </view>
  44. <view class="item">
  45. <view class="label">服务内容</view>
  46. <view class="value">{{detail.serverContent || ''}}</view>
  47. </view>
  48. <view class="item">
  49. <view class="label">服务网点</view>
  50. <view class="value">{{detail.installName || ''}}</view>
  51. </view>
  52. <view class="item">
  53. <view class="label">预约时间</view>
  54. <view class="value">{{detail.reserveTime || ''}}</view>
  55. </view>
  56. <view class="item">
  57. <view class="label">主要服务人员</view>
  58. <view class="value">{{detail.workerName || ''}} {{detail.workerPhone || ''}} <image src="/static/mine/call.png" v-if="detail.workerPhone" @tap="callPhone(detail.workerPhone)"></image></view>
  59. </view>
  60. <view class="item">
  61. <view class="label">辅助服务人员</view>
  62. <view class="value">{{detail.assistName || ''}}</view>
  63. </view>
  64. </view>
  65. <view class="card">
  66. <view class="title">其他信息</view>
  67. <view class="item">
  68. <view class="label">支架</view>
  69. <view class="value">{{detail.bracket || 0}}</view>
  70. </view>
  71. <view class="item">
  72. <view class="label">加长管</view>
  73. <view class="value">{{detail.pipe || 0}}</view>
  74. </view>
  75. <view class="item">
  76. <view class="label">空气开关</view>
  77. <view class="value">{{detail.switchFlag || 0}}</view>
  78. </view>
  79. <view class="item">
  80. <view class="label">一次成型墙孔</view>
  81. <view class="value">{{detail.hole || 0}}</view>
  82. </view>
  83. <view class="item">
  84. <view class="label">高空作业</view>
  85. <view class="value">{{detail.highAltitude || 0}}</view>
  86. </view>
  87. <view class="item item2">
  88. <view class="label">服务备注</view>
  89. <view class="value">{{detail.remark || ''}}</view>
  90. </view>
  91. </view>
  92. <view class="card" v-if="orderState > 0">
  93. <view class="title">辅材信息</view>
  94. <block v-if="detail.fcxxs && detail.fcxxs.length > 0">
  95. <view class="item">
  96. <view class="label">支付单号</view>
  97. <view class="value">{{detail.fcxxs[0].orderNo}}</view>
  98. </view>
  99. <view class="item">
  100. <view class="label">支付时间</view>
  101. <view class="value">{{detail.fcxxs[0].payTime}}</view>
  102. </view>
  103. <view class="goods">
  104. <view class="it" v-for="(item, index) in fc_list" :key='index'>
  105. <view class="name">{{item.goods_name}}</view>
  106. <view class="num">x{{item.number}}</view>
  107. <view class="price">¥{{item.sub_amount}}</view>
  108. </view>
  109. <view class="bottom">
  110. <view class="left">合计:</view>
  111. <view class="price">¥{{fc_total}}</view>
  112. </view>
  113. </view>
  114. </block>
  115. <block v-else>
  116. <no-data :showText="'暂无辅材信息'"></no-data>
  117. </block>
  118. </view>
  119. </view>
  120. </block>
  121. </view>
  122. </template>
  123. <script>
  124. import {mapState} from 'vuex';
  125. export default {
  126. data() {
  127. return {
  128. id: null, // id
  129. detail: {}, // 详情数据
  130. steps: [{title: '已派单'}, {title: '服务中'}, {title: '已完工'}],
  131. orderState: 0,
  132. fc_list: [],
  133. noData: false,
  134. }
  135. },
  136. computed:{
  137. ...mapState(['userInfo', 'isLogin', 'userId']),
  138. fc_total() {
  139. if(this.fc_list && this.fc_list.length > 0) {
  140. let total = 0;
  141. this.fc_list.forEach(item => {
  142. total = total + Number(item.sub_amount);
  143. })
  144. return total;
  145. }else {
  146. return 0
  147. }
  148. },
  149. },
  150. onLoad({id}) {
  151. this.id = id;
  152. this.getOrderDetail();
  153. },
  154. methods: {
  155. stateFilter(item) {
  156. let orderState = Number(item.orderState);
  157. if(item.serverContent == '安装服务') {
  158. if(orderState == 6) {
  159. return 1;
  160. }else if(orderState == 7 || orderState == 10) {
  161. return 2;
  162. }else {
  163. return 0;
  164. }
  165. } else {
  166. if(orderState < 7) {
  167. return 0;
  168. }else if(orderState == 7) {
  169. return 1;
  170. }else {
  171. return 2;
  172. }
  173. }
  174. },
  175. getOrderDetail() {
  176. this.$axios({
  177. url: '/order/work/list',
  178. method: 'get',
  179. params: {
  180. pageNo: 1,
  181. pageSize: 1,
  182. userId: this.userId,
  183. workerOrderNo: this.id,
  184. },
  185. }).then(res => {
  186. if(res.data && res.data.records) {
  187. this.noData = false;
  188. this.detail = res.data.records[0];
  189. this.orderState = this.stateFilter(this.detail);
  190. if(this.detail.fcxxs && this.detail.fcxxs.length > 0) {
  191. let list = [];
  192. for(let i=0; i<this.detail.fcxxs.length; i++) {
  193. if(this.detail.fcxxs[i].details && this.detail.fcxxs[i].details.length > 0) {
  194. this.detail.fcxxs[i].details.forEach(item => {
  195. list.push(item);
  196. })
  197. }
  198. }
  199. this.fc_list = list;
  200. }else {
  201. this.fc_list = [];
  202. }
  203. }else {
  204. this.noData = true;
  205. }
  206. })
  207. },
  208. callPhone(val) {
  209. uni.makePhoneCall({
  210. phoneNumber: val
  211. });
  212. },
  213. }
  214. }
  215. </script>
  216. <style lang="scss">
  217. .app-container {
  218. background: #F4F2F2;
  219. box-sizing: border-box;
  220. }
  221. .top-container {
  222. background: #FFFFFF;
  223. padding: 30rpx 0;
  224. }
  225. .detail-container {
  226. padding: 20rpx;
  227. .card {
  228. background: #FFFFFF;
  229. border-radius: 20rpx;
  230. margin-bottom: 20rpx;
  231. padding: 30rpx 20rpx 20rpx;
  232. .title {
  233. font-size: 32rpx;
  234. color: #333333;
  235. line-height: 32rpx;
  236. padding-bottom: 20rpx;
  237. font-weight: 600;
  238. }
  239. .item {
  240. display: flex;
  241. justify-content: space-between;
  242. align-items: center;
  243. padding: 10rpx 0;
  244. &.item2 {
  245. flex-direction: column;
  246. align-items: flex-start;
  247. .value {
  248. padding-top: 10rpx;
  249. }
  250. }
  251. .label {
  252. color: #666666;
  253. flex-shrink: 0;
  254. }
  255. .value {
  256. color: #333333;
  257. display: flex;
  258. image {
  259. width: 40rpx;
  260. height: 40rpx;
  261. margin-left: 10rpx;
  262. }
  263. }
  264. }
  265. .goods {
  266. background: #F4F2F2;
  267. border-radius: 10rpx;
  268. padding: 10rpx 20rpx;
  269. margin-top: 10rpx;
  270. color: #666666;
  271. .it {
  272. display: flex;
  273. padding: 10rpx 0;
  274. .name {
  275. flex: 1;
  276. }
  277. .num {
  278. margin-left: 20rpx;
  279. }
  280. .price {
  281. margin-left: 20rpx;
  282. }
  283. }
  284. .bottom {
  285. display: flex;
  286. justify-content: space-between;
  287. align-items: center;
  288. padding: 10rpx 0;
  289. .price {
  290. color: #FF3F42;
  291. }
  292. }
  293. }
  294. }
  295. }
  296. </style>