business-order.vue 7.6 KB

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