business-order.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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.customerName}}</text>
  16. </view>
  17. <view style="line-height: 60rpx;">
  18. <view class="title">录入时间:{{businessItem.createTime}}</view>
  19. <view class="title">订单号:{{businessItem.no}}</view>
  20. </view>
  21. <view class="c">
  22. <view class="item car-num-item">
  23. <text class="car-num">{{businessItem.cardNo}}</text>
  24. </view>
  25. <view class="item">
  26. <text class="p1">车型:</text>
  27. <text class="p2">{{businessItem.cardSize}}(米)</text>
  28. </view>
  29. <view class="item">
  30. <text class="p1">载重:</text>
  31. <text class="p2">{{businessItem.netWeight}}(吨)</text>
  32. </view>
  33. <view class="item">
  34. <text class="p1">车辆状态:</text>
  35. <text class="p2">
  36. <text v-if="businessItem.realInTime==null">未入场</text>
  37. <text v-if="businessItem.realInTime!=null">已入场</text>
  38. <text v-if="businessItem.outDayTime!=null">已离场</text>
  39. </text>
  40. </view>
  41. <view class="item">
  42. <text class="p1">支付状态:</text>
  43. <text class="p2">
  44. <text v-if="businessItem.payStatus==1">未支付</text>
  45. <text v-if="businessItem.payStatus==2">已支付未确认</text>
  46. <text v-if="businessItem.payStatus==3">已确认支付</text>
  47. </text>
  48. </view>
  49. </view>
  50. <view class="b">
  51. <view class="btn b3" v-if="customemrId=='1'&&businessItem.payStatus<3" @click="fkFn(businessItem)">
  52. 确认付款</view>
  53. <view class="btn b1" v-if="customemrId=='1'&&businessItem.realInTime==null"
  54. @click="rcFn(businessItem)">确认入场</view>
  55. <view class="btn b1" v-if="businessItem.btnShow==2" @click="cc(index)">确认出场</view>
  56. <view class="btn b3" v-if="businessItem.btnShow==2" @click="zd(index)">确认账单</view>
  57. </view>
  58. </view>
  59. </view>
  60. <noData v-if="businessItemList.length==0"></noData>
  61. <u-loadmore style="margin: 30rpx;" :status="status" />
  62. <uni-popup ref="fkpopup" type="dialog">
  63. <uni-popup-dialog type="success" title="确定已付款吗?" :duration="2000" @confirm="fkconfirm"></uni-popup-dialog>
  64. </uni-popup>
  65. <u-modal :show="rc.visible" title="确认入场" showCancelButton @confirm="rcconfirm">
  66. <view>
  67. <view style="background-color: #fff;display: block;">
  68. <u-input type="text" placeholder="请输入入场通道" v-model="rc.inChannel" />
  69. </view>
  70. <view style="background-color: #fff;display: block;" @click="rc.showTime=true">
  71. <u-input type="text" placeholder="请选择是入场时间" v-model="rc.realInTime" readonly />
  72. </view>
  73. </view>
  74. </u-modal>
  75. <uni-popup ref="ccpopup" type="dialog">
  76. <uni-popup-dialog type="success" title="确定已出场吗?" :duration="2000" @confirm="ccconfirm"></uni-popup-dialog>
  77. </uni-popup>
  78. <uni-popup ref="zdpopup" type="dialog">
  79. <uni-popup-dialog type="success" title="确认账单吗?" :duration="2000" @confirm="zdconfirm"></uni-popup-dialog>
  80. </uni-popup>
  81. <u-datetime-picker :show="rc.showTime" v-model="rc.realInTime" mode="datetime">
  82. </u-datetime-picker>
  83. </view>
  84. </template>
  85. <script>
  86. export default {
  87. data() {
  88. return {
  89. p: {
  90. pageNo: 1,
  91. pageSize: 3,
  92. dataCount: 0
  93. },
  94. customemrId: '1',
  95. fk: {
  96. ids: '',
  97. },
  98. rc: {
  99. id: '',
  100. inChannel: '',
  101. showTime: false,
  102. visible: false,
  103. realInTime: ''
  104. },
  105. current: 0,
  106. status: 'loadmore',
  107. page: 0,
  108. tabs: [{
  109. name: '进场',
  110. }, {
  111. name: '出场',
  112. }],
  113. businessItemList: []
  114. }
  115. },
  116. created() {
  117. this.customemrId = uni.getStorageSync('customerId')
  118. },
  119. mounted() {
  120. this.getBusinessList();
  121. },
  122. methods: {
  123. getBusinessList() {
  124. this.$api.getBusinessList(this.p).then(resp => {
  125. this.status = 'loadmore';
  126. this.p.pageNo = resp.pageNo;
  127. this.p.pageSize = resp.pageSize;
  128. this.p.dataCount = resp.dataCount;
  129. this.businessItemList = resp.data;
  130. })
  131. },
  132. //点击上方切换栏,根据点击项重新加载数据
  133. change(index) {
  134. this.current = index;
  135. if (index == 0) {
  136. //只加载进场订单
  137. }
  138. if (index == 1) {
  139. //只加载出场订单
  140. }
  141. },
  142. //点击按钮
  143. //------------------------------------------
  144. fkFn(data) {
  145. this.fk.ids = data.id;
  146. this.$refs.fkpopup.open('center');
  147. },
  148. fkconfirm() {
  149. this.$api.adminConfirmPay(this.fk).then(resp => {
  150. this.$refs.fkpopup.close();
  151. this.getBusinessList();
  152. })
  153. },
  154. rcFn(data) {
  155. this.rc.id = data.id
  156. this.rc.visible = true;
  157. this.rc.showTime = false;
  158. },
  159. rcconfirm() {
  160. if (!this.rc.inChannel) {
  161. this.$common.toast('请填写入场通道');
  162. return false;
  163. }
  164. this.$api.adminConfirmIn(this.rc).then(resp => {
  165. this.$refs.rcpopup.close();
  166. this.getBusinessList();
  167. })
  168. },
  169. cc() {
  170. this.$refs.ccpopup.open('center')
  171. },
  172. ccconfirm(index) {
  173. console.log('出场')
  174. this.$refs.ccpopup.close()
  175. },
  176. zd() {
  177. this.$refs.zdpopup.open('center')
  178. },
  179. zdconfirm(index) {
  180. this.$refs.zdpopup.close()
  181. },
  182. //------------------------------------------
  183. //上拉加载更多,分页模拟数据
  184. onReachBottom() {
  185. if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
  186. this.status = 'loading';
  187. this.p.pageSize += 5;
  188. this.getBusinessList();
  189. } else {
  190. this.status = 'nomore';
  191. }
  192. }
  193. }
  194. }
  195. </script>
  196. <style lang="scss">
  197. .card-box {
  198. display: flex;
  199. width: 100%;
  200. flex-direction: column;
  201. .card {
  202. background-color: #fff;
  203. border-radius: 20rpx;
  204. margin: 20rpx 20rpx 0 20rpx;
  205. padding: 30rpx;
  206. box-sizing: border-box;
  207. display: flex;
  208. flex-direction: column;
  209. .t {
  210. width: 100%;
  211. display: flex;
  212. align-items: center;
  213. padding-bottom: 30rpx;
  214. border-bottom: 1rpx solid #f5f5f5;
  215. .icon {
  216. width: 40rpx;
  217. height: 40rpx;
  218. }
  219. .title {
  220. font-size: 30rpx;
  221. font-weight: bold;
  222. margin-left: 20rpx;
  223. }
  224. }
  225. .c {
  226. padding: 15rpx 0 30rpx 0;
  227. display: flex;
  228. flex-wrap: wrap;
  229. border-bottom: 1rpx solid #f5f5f5;
  230. .item {
  231. width: 50%;
  232. padding: 20rpx 0;
  233. .car-num {
  234. background-color: #edf6ff;
  235. color: #0080ff;
  236. font-size: 44rpx;
  237. padding: 15rpx 0;
  238. text-align: center;
  239. width: 100%;
  240. border-radius: 10rpx;
  241. font-weight: bold;
  242. letter-spacing: 20rpx;
  243. }
  244. .p1 {
  245. font-size: 28rpx;
  246. color: #999;
  247. }
  248. .p2 {
  249. font-size: 28rpx;
  250. color: #191919;
  251. font-weight: bold;
  252. margin-left: 20rpx;
  253. }
  254. }
  255. .car-num-item {
  256. width: 100%;
  257. display: flex;
  258. align-items: center;
  259. justify-content: center;
  260. }
  261. }
  262. .b {
  263. display: flex;
  264. width: 100%;
  265. align-items: center;
  266. justify-content: space-between;
  267. .btn {
  268. height: 70rpx;
  269. display: flex;
  270. align-items: center;
  271. justify-content: center;
  272. width: calc(50% - 15rpx);
  273. margin: 30rpx 0 0 0;
  274. border-radius: 10rpx;
  275. border-width: 1rpx;
  276. box-sizing: border-box;
  277. }
  278. .b1 {
  279. background-color: #0080ff;
  280. color: #fff;
  281. }
  282. .b2 {
  283. background-color: #f7f7f7;
  284. color: #191919;
  285. }
  286. .b3 {
  287. background-color: #fff;
  288. color: #0080ff;
  289. border: 1rpx solid #0080ff;
  290. }
  291. }
  292. }
  293. }
  294. @import '@/common/common.scss'
  295. </style>