business-order.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">业务订单</text>
  6. </view>
  7. </view>
  8. <u-sticky offset-top="0">
  9. <u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
  10. </u-sticky>
  11. <view class="card-box">
  12. <view class="card" v-for="(businessItem,index) in businessItemList" :key="index">
  13. <view class="t">
  14. <image class="icon" src="../../static/home-icon-01.png"></image>
  15. <text class="title">{{businessItem.companyName}}</text>
  16. </view>
  17. <view class="c">
  18. <view class="item car-num-item">
  19. <text class="car-num">{{businessItem.carNum}}</text>
  20. </view>
  21. <view class="item">
  22. <text class="p1">车型:</text>
  23. <text class="p2">{{businessItem.carType}}</text>
  24. </view>
  25. <view class="item">
  26. <text class="p1">载重:</text>
  27. <text class="p2">{{businessItem.weight}}</text>
  28. </view>
  29. <view class="item">
  30. <text class="p1">状态:</text>
  31. <text class="p2">{{businessItem.state}}</text>
  32. </view>
  33. </view>
  34. <view class="b">
  35. <view class="btn b3" v-if="businessItem.btnShow==1" @click="fk(index)">确认付款</view>
  36. <view class="btn b1" v-if="businessItem.btnShow==1" @click="rc(index)">确认入场</view>
  37. <view class="btn b1" v-if="businessItem.btnShow==2" @click="cc(index)">确认出场</view>
  38. <view class="btn b3" v-if="businessItem.btnShow==2" @click="zd(index)">确认账单</view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 没有数据时显示noData -->
  43. <noData v-if="businessItemList.length==0"></noData>
  44. <u-loadmore style="margin: 30rpx;" :status="status"/>
  45. <uni-popup ref="fkpopup" type="dialog">
  46. <uni-popup-dialog type="success" title="确定已付款吗?" :duration="2000" @confirm="fkconfirm"></uni-popup-dialog>
  47. </uni-popup>
  48. <uni-popup ref="rcpopup" type="dialog">
  49. <uni-popup-dialog type="success" title="确定已入场吗?" :duration="2000" @confirm="rcconfirm"></uni-popup-dialog>
  50. </uni-popup>
  51. <uni-popup ref="ccpopup" type="dialog">
  52. <uni-popup-dialog type="success" title="确定已出场吗?" :duration="2000" @confirm="ccconfirm"></uni-popup-dialog>
  53. </uni-popup>
  54. <uni-popup ref="zdpopup" type="dialog">
  55. <uni-popup-dialog type="success" title="确认账单吗?" :duration="2000" @confirm="zdconfirm"></uni-popup-dialog>
  56. </uni-popup>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. current:0,
  64. status: 'loadmore',
  65. page: 0,
  66. tabs: [{
  67. name: '进场',
  68. }, {
  69. name: '出场',
  70. }
  71. ],
  72. businessItemList:[
  73. {
  74. companyName:'广西医科大一附院',
  75. carNum:'桂A.B5W61',
  76. carType:'小型汽车',
  77. weight:'5吨',
  78. state:'进场',
  79. btnShow:1
  80. },
  81. {
  82. companyName:'广西中医院',
  83. carNum:'桂A.A7JJ8',
  84. carType:'卡车',
  85. weight:'10吨',
  86. state:'出场',
  87. btnShow:2
  88. },
  89. {
  90. companyName:'广西中医院',
  91. carNum:'桂A.A7JJ8',
  92. carType:'卡车',
  93. weight:'10吨',
  94. state:'出场',
  95. btnShow:2
  96. },
  97. {
  98. companyName:'广西中医院',
  99. carNum:'桂A.A7JJ8',
  100. carType:'卡车',
  101. weight:'10吨',
  102. state:'出场',
  103. btnShow:2
  104. },
  105. {
  106. companyName:'广西中医院',
  107. carNum:'桂A.A7JJ8',
  108. carType:'卡车',
  109. weight:'10吨',
  110. state:'出场',
  111. btnShow:2
  112. }
  113. ]
  114. }
  115. },
  116. methods: {
  117. //点击上方切换栏,根据点击项重新加载数据
  118. change(index) {
  119. this.current = index;
  120. if(index==0){
  121. //只加载进场订单
  122. }
  123. if(index==1){
  124. //只加载出场订单
  125. }
  126. },
  127. //点击按钮
  128. //------------------------------------------
  129. fk(){
  130. this.$refs.fkpopup.open('center')
  131. },
  132. fkconfirm(index) {
  133. console.log('付款')
  134. this.$refs.fkpopup.close()
  135. },
  136. rc(){
  137. this.$refs.rcpopup.open('center')
  138. },
  139. rcconfirm(index) {
  140. console.log('入场')
  141. this.$refs.rcpopup.close()
  142. },
  143. cc(){
  144. this.$refs.ccpopup.open('center')
  145. },
  146. ccconfirm(index) {
  147. console.log('出场')
  148. this.$refs.ccpopup.close()
  149. },
  150. zd(){
  151. this.$refs.zdpopup.open('center')
  152. },
  153. zdconfirm(index) {
  154. console.log('账单')
  155. this.$refs.zdpopup.close()
  156. },
  157. //------------------------------------------
  158. //上拉加载更多,分页模拟数据
  159. onReachBottom() {
  160. if(this.page >= 3) return ;
  161. this.status = 'loading';
  162. this.page = ++ this.page;
  163. setTimeout(() => {
  164. this.businessItemList += 5;//接接口后把数据加上,懒得写假数据了
  165. if(this.page >= 3) this.status = 'nomore';
  166. else this.status = 'loading';
  167. }, 2000)
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. .card-box{
  174. display: flex;
  175. width: 100%;
  176. flex-direction: column;
  177. .card{
  178. background-color: #fff;
  179. border-radius: 20rpx;
  180. margin: 20rpx 20rpx 0 20rpx;
  181. padding: 30rpx;
  182. box-sizing: border-box;
  183. display: flex;
  184. flex-direction: column;
  185. .t{
  186. width: 100%;
  187. display: flex;
  188. align-items: center;
  189. padding-bottom: 30rpx;
  190. border-bottom: 1rpx solid #f5f5f5;
  191. .icon{
  192. width: 40rpx;
  193. height: 40rpx;
  194. }
  195. .title{
  196. font-size: 30rpx;
  197. font-weight: bold;
  198. margin-left: 20rpx;
  199. }
  200. }
  201. .c{
  202. padding:15rpx 0 30rpx 0;
  203. display: flex;
  204. flex-wrap: wrap;
  205. border-bottom: 1rpx solid #f5f5f5;
  206. .item{
  207. width: 50%;
  208. padding: 20rpx 0;
  209. .car-num{
  210. background-color: #edf6ff;
  211. color: #0080ff;
  212. font-size: 44rpx;
  213. padding: 15rpx 0;
  214. text-align: center;
  215. width: 100%;
  216. border-radius: 10rpx;
  217. font-weight: bold;
  218. letter-spacing: 20rpx;
  219. }
  220. .p1{
  221. font-size: 28rpx;
  222. color: #999;
  223. }
  224. .p2{
  225. font-size: 28rpx;
  226. color: #191919;
  227. font-weight: bold;
  228. margin-left: 20rpx;
  229. }
  230. }
  231. .car-num-item{
  232. width: 100%;
  233. display: flex;
  234. align-items: center;
  235. justify-content: center;
  236. }
  237. }
  238. .b{
  239. display: flex;
  240. width: 100%;
  241. align-items: center;
  242. justify-content: space-between;
  243. .btn{
  244. height: 70rpx;
  245. display: flex;
  246. align-items: center;
  247. justify-content: center;
  248. width: calc(50% - 15rpx);
  249. margin: 30rpx 0 0 0;
  250. border-radius: 10rpx;
  251. border-width: 1rpx;
  252. box-sizing: border-box;
  253. }
  254. .b1{
  255. background-color: #0080ff;
  256. color: #fff;
  257. }
  258. .b2{
  259. background-color: #f7f7f7;
  260. color: #191919;
  261. }
  262. .b3{
  263. background-color: #fff;
  264. color: #0080ff;
  265. border: 1rpx solid #0080ff;
  266. }
  267. }
  268. }
  269. }
  270. @import '@/common/common.scss'
  271. </style>