item-detail.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">业务详情</text>
  6. </view>
  7. </view>
  8. <view class="card-box">
  9. <view class="card">
  10. <view class="t">
  11. 订单号:
  12. <text class="title">{{ businessItem.no }}</text>
  13. </view>
  14. <view class="c">
  15. <view class="item car-num-item">
  16. <text class="car-num">{{ businessItem.goodsName }}</text>
  17. </view>
  18. </view>
  19. <view class="c">
  20. <view class="item">
  21. <text class="p1">类型:</text>
  22. <text class="p2">{{ businessItem.itemTypeName }}</text>
  23. </view>
  24. </view>
  25. <view class="c">
  26. <view class="item">
  27. <text class="p1">作业项:</text>
  28. <text class="p2">{{ businessItem.itemName }}</text>
  29. </view>
  30. </view>
  31. <view class="c" v-if="businessItem.cardNo">
  32. <view class="item">
  33. <text class="p1">越南车:</text>
  34. <text class="p2">{{ businessItem.cardNo }}</text>
  35. </view>
  36. </view>
  37. <view class="c" v-if="businessItem.chinaCarNo">
  38. <view class="item">
  39. <text class="p1">中国车:</text>
  40. <text class="p2">{{ businessItem.chinaCarNo }}</text>
  41. </view>
  42. </view>
  43. <view class="c">
  44. <view class="item">
  45. <text class="p1">录入时间:</text>
  46. <text class="p2">{{ businessItem.createTime }}</text>
  47. </view>
  48. </view>
  49. <view class="c">
  50. <view class="item">
  51. <text class="p1">状态:</text>
  52. <text class="p2">
  53. <text v-if="businessItem.pick==1">已接单</text>
  54. <text v-else>未接单</text>
  55. </text>
  56. </view>
  57. </view>
  58. <view class="c">
  59. <view class="item" v-if="businessItem.pickTime">
  60. <text class="p1">接单时间:</text>
  61. <text class="p2">
  62. <text>{{ businessItem.pickTime }}</text>
  63. </text>
  64. </view>
  65. </view>
  66. <view class="c" v-if="businessItem.pick==1">
  67. <view class="item">
  68. <text class="p1">确认状态:</text>
  69. <text class="p2">
  70. <text v-if="businessItem.confirm==1">已确认</text>
  71. <text v-else>未确认</text>
  72. </text>
  73. </view>
  74. </view>
  75. <view class="c" v-if="businessItem.confirm==1">
  76. <view class="item">
  77. <text class="p1">确认时间:</text>
  78. <text class="p2">
  79. <text>{{ businessItem.confirmTime }}</text>
  80. </text>
  81. </view>
  82. </view>
  83. <view class="b">
  84. <view class="btn b3" v-if="businessItem.pick==0" @click="pickFn">
  85. 接单
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. export default {
  94. data() {
  95. return {
  96. openid: '',
  97. businessItem: {}
  98. }
  99. },
  100. onLoad(option) {
  101. this.businessItem.id = option.itemId;
  102. this.openid = option.openid;
  103. this.getBusinessItem();
  104. },
  105. onBackPress() {
  106. this.$common.to('/pages/index/index')
  107. return true;
  108. },
  109. methods: {
  110. getBusinessItem() {
  111. this.$api.getBusinessItem({
  112. id: this.businessItem.id
  113. }).then(resp => {
  114. let data = resp.data;
  115. if (!data) {
  116. this.$common.toast('该业务已取消或删除');
  117. setTimeout(() => {
  118. this.$common.to('/pages/index/index')
  119. }, 2000)
  120. return;
  121. }
  122. this.businessItem = resp.data;
  123. })
  124. },
  125. pickFn() {
  126. let that = this;
  127. uni.showModal({
  128. title: '提示',
  129. content: '是否确认接单?',
  130. success(resp) {
  131. if (resp.confirm) {
  132. that.surePick();
  133. }
  134. }
  135. })
  136. },
  137. surePick() {
  138. let obj = {
  139. openid: this.openid,
  140. id: this.businessItem.id
  141. };
  142. this.$api.pickBusinessItem(obj).then(resp => {
  143. if (resp.code == 200) {
  144. this.$common.toast('已接单');
  145. this.getBusinessItem();
  146. }
  147. })
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss">
  153. .card-box {
  154. display: flex;
  155. width: 100%;
  156. flex-direction: column;
  157. .card {
  158. background-color: #fff;
  159. border-radius: 20rpx;
  160. margin: 20rpx 20rpx 0 20rpx;
  161. padding: 30rpx;
  162. box-sizing: border-box;
  163. display: flex;
  164. flex-direction: column;
  165. .t {
  166. width: 100%;
  167. display: flex;
  168. align-items: center;
  169. padding-bottom: 30rpx;
  170. border-bottom: 1rpx solid #f5f5f5;
  171. .icon {
  172. width: 40rpx;
  173. height: 40rpx;
  174. }
  175. .title {
  176. font-size: 35rpx;
  177. font-weight: bold;
  178. margin-left: 20rpx;
  179. }
  180. }
  181. .c {
  182. padding: 15rpx 0 30rpx 0;
  183. display: flex;
  184. flex-wrap: wrap;
  185. border-bottom: 1rpx solid #f5f5f5;
  186. .item {
  187. padding: 20rpx 0;
  188. .car-num {
  189. background-color: #edf6ff;
  190. color: #0080ff;
  191. font-size: 38rpx;
  192. padding: 15rpx 0;
  193. text-align: center;
  194. width: 100%;
  195. border-radius: 10rpx;
  196. font-weight: bold;
  197. }
  198. .p1 {
  199. font-size: 28rpx;
  200. color: #999;
  201. }
  202. .p2 {
  203. font-size: 28rpx;
  204. color: #191919;
  205. font-weight: bold;
  206. margin-left: 20rpx;
  207. }
  208. }
  209. .car-num-item {
  210. width: 100%;
  211. display: flex;
  212. align-items: center;
  213. justify-content: center;
  214. }
  215. }
  216. .b {
  217. display: flex;
  218. width: 100%;
  219. align-items: center;
  220. justify-content: space-between;
  221. .btn {
  222. height: 70rpx;
  223. display: flex;
  224. align-items: center;
  225. justify-content: center;
  226. width: calc(100% - 15rpx);
  227. margin: 30rpx 0 0 0;
  228. border-radius: 10rpx;
  229. border-width: 1rpx;
  230. box-sizing: border-box;
  231. }
  232. .b1 {
  233. background-color: #0080ff;
  234. color: #fff;
  235. }
  236. .b2 {
  237. background-color: #f7f7f7;
  238. color: #191919;
  239. }
  240. .b3 {
  241. background-color: #fff;
  242. color: #0080ff;
  243. border: 1rpx solid #0080ff;
  244. }
  245. .b4 {
  246. background-color: #ff0000;
  247. color: #fff;
  248. }
  249. }
  250. }
  251. }
  252. @import '@/common/common.scss'
  253. </style>