business-order.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  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&&businessItem.adminConfirmOut==0">已入场</text>
  38. <text v-if="businessItem.outDayTime!=null&&businessItem.adminConfirmOut==1">已离场</text>
  39. </text>
  40. </view>
  41. <view class="item">
  42. <text class="p1">账单确认:</text>
  43. <text class="p2">
  44. <text v-if="businessItem.confirmInput==0">未确认</text>
  45. <text v-else>已确认</text>
  46. </text>
  47. </view>
  48. <view class="item">
  49. <text class="p1">支付状态:</text>
  50. <text class="p2">
  51. <text v-if="businessItem.payStatus==1">未支付</text>
  52. <text v-if="businessItem.payStatus==2">已支付(未确认)</text>
  53. <text v-if="businessItem.payStatus==3">已支付(已确认)</text>
  54. </text>
  55. </view>
  56. </view>
  57. <view class="b">
  58. <view class="btn b3" v-if="businessItem.realInTime!=null
  59. &&businessItem.complete==0
  60. &&customemrId=='1'" @click="completeFn(businessItem)">
  61. 生成账单</view>
  62. <view class="btn b3" v-if="businessItem.confirmInput==0
  63. &&businessItem.payStatus==1
  64. &&businessItem.outDayTime!=null
  65. &&perList.indexOf('tb-business-confirm')!=-1
  66. &&customemrId!='1'" @click="sureZdFn(businessItem)">
  67. 确认账单</view>
  68. <view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1
  69. &&businessItem.payStatus==1&&businessItem.confirmInput==1&&customemrId!='1'" @click="fkFn(businessItem)">
  70. 马上支付</view>
  71. <view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1&&
  72. customemrId=='1'&&businessItem.payStatus<3&&businessItem.outDayTime!=null" @click="fkFn(businessItem)">
  73. 确认支付</view>
  74. <view class="btn b1" v-if="customemrId=='1'&&businessItem.realInTime==null"
  75. @click="rcFn(businessItem)">确认入场</view>
  76. <view class="btn b1"
  77. v-if="customemrId=='1'
  78. &&businessItem.complete==1
  79. &&businessItem.payStatus>1
  80. &&businessItem.adminConfirmPay==1
  81. &&businessItem.adminConfirmOut==0"
  82. @click="cc(businessItem)">确认离场</view>
  83. <view class="btn b1" v-if="businessItem.confirmInput==0" @click="editFn(businessItem)">修改</view>
  84. <view class="btn b3" @click="toDetail(businessItem)">详情</view>
  85. <view class="btn b4" v-if="businessItem.payStatus==1
  86. &&businessItem.confirmInput==0
  87. &&businessItem.realInTime==null
  88. &&businessItem.outDayTime==null
  89. &&perList.indexOf('tb-business-add')!=-1" @click="deleteFn(businessItem)">删除</view>
  90. </view>
  91. </view>
  92. </view>
  93. <noData v-if="businessItemList.length==0"></noData>
  94. <u-loadmore style="margin: 30rpx;" :status="status" />
  95. </view>
  96. </template>
  97. <script>
  98. export default {
  99. data() {
  100. return {
  101. p: {
  102. pageNo: 1,
  103. pageSize: 3,
  104. dataCount: 0
  105. },
  106. customemrId: '1',
  107. fk: {
  108. ids: '',
  109. },
  110. rc: {
  111. id: '',
  112. inChannel: '',
  113. showTime: false,
  114. visible: false,
  115. realInTime: ''
  116. },
  117. current: 0,
  118. status: 'loadmore',
  119. page: 0,
  120. tabs: [{
  121. name: '进场',
  122. }, {
  123. name: '出场',
  124. }],
  125. businessItemList: [],
  126. perList: []
  127. }
  128. },
  129. created() {
  130. this.customemrId = uni.getStorageSync('customerId')
  131. this.perList = uni.getStorageSync('perList')
  132. console.log('create')
  133. },
  134. onShow() {
  135. this.getBusinessList();
  136. console.log('show')
  137. },
  138. mounted() {
  139. console.log('mounted')
  140. },
  141. onBackPress() {
  142. this.$common.to('/pages/index/index')
  143. return true;
  144. },
  145. methods: {
  146. toDetail(data) {
  147. this.$common.to('/pages/business-entering/business-detail?id=' + data.id)
  148. },
  149. editFn(data) {
  150. this.$common.to('/pages/business-entering/business-edit?id=' + data.id)
  151. },
  152. deleteFn(data) {
  153. let that = this;
  154. uni.showModal({
  155. title: "警告",
  156. content: "是否删除该业务?",
  157. success(res) {
  158. if (res.confirm) {
  159. that.$api.deleteBusiness({
  160. id: data.id
  161. }).then(resp => {
  162. that.$common.toast('已删除');
  163. that.getBusinessList();
  164. })
  165. }
  166. }
  167. })
  168. },
  169. completeFn(data) {
  170. this.$common.to('/pages/business-order/createOrder?id=' + data.id)
  171. },
  172. sureZdFn(data) {
  173. this.$common.to('/pages/business-order/sureOrder?id=' + data.id)
  174. },
  175. fkFn(data) {
  176. this.$common.to('/pages/business-order/surePay?id=' + data.id)
  177. },
  178. rcFn(data) {
  179. this.$common.to('/pages/business-order/sureIn?id=' + data.id)
  180. },
  181. cc(data) {
  182. this.$common.to('/pages/business-order/sureOut?id=' + data.id)
  183. },
  184. getBusinessList() {
  185. this.$api.getBusinessList(this.p).then(resp => {
  186. this.status = 'loadmore';
  187. this.p.pageNo = resp.pageNo;
  188. this.p.pageSize = resp.pageSize;
  189. this.p.dataCount = resp.dataCount;
  190. this.businessItemList = resp.data;
  191. })
  192. },
  193. //点击上方切换栏,根据点击项重新加载数据
  194. change(index) {
  195. this.current = index;
  196. if (index == 0) {
  197. //只加载进场订单
  198. }
  199. if (index == 1) {
  200. //只加载出场订单
  201. }
  202. },
  203. //点击按钮
  204. //------------------------------------------
  205. fkconfirm() {
  206. this.$api.adminConfirmPay(this.fk).then(resp => {
  207. this.$refs.fkpopup.close();
  208. this.getBusinessList();
  209. })
  210. },
  211. rcconfirm() {
  212. if (!this.rc.inChannel) {
  213. this.$common.toast('请填写入场通道');
  214. return false;
  215. }
  216. this.$api.adminConfirmIn(this.rc).then(resp => {
  217. this.$refs.rcpopup.close();
  218. this.getBusinessList();
  219. })
  220. },
  221. ccconfirm(index) {
  222. console.log('出场')
  223. this.$refs.ccpopup.close()
  224. },
  225. zd() {
  226. this.$refs.zdpopup.open('center')
  227. },
  228. zdconfirm(index) {
  229. this.$refs.zdpopup.close()
  230. },
  231. //------------------------------------------
  232. //上拉加载更多,分页模拟数据
  233. onReachBottom() {
  234. if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
  235. this.status = 'loading';
  236. this.p.pageSize += 5;
  237. this.getBusinessList();
  238. } else {
  239. this.status = 'nomore';
  240. }
  241. }
  242. }
  243. }
  244. </script>
  245. <style lang="scss">
  246. .card-box {
  247. display: flex;
  248. width: 100%;
  249. flex-direction: column;
  250. .card {
  251. background-color: #fff;
  252. border-radius: 20rpx;
  253. margin: 20rpx 20rpx 0 20rpx;
  254. padding: 30rpx;
  255. box-sizing: border-box;
  256. display: flex;
  257. flex-direction: column;
  258. .t {
  259. width: 100%;
  260. display: flex;
  261. align-items: center;
  262. padding-bottom: 30rpx;
  263. border-bottom: 1rpx solid #f5f5f5;
  264. .icon {
  265. width: 40rpx;
  266. height: 40rpx;
  267. }
  268. .title {
  269. font-size: 30rpx;
  270. font-weight: bold;
  271. margin-left: 20rpx;
  272. }
  273. }
  274. .c {
  275. padding: 15rpx 0 30rpx 0;
  276. display: flex;
  277. flex-wrap: wrap;
  278. border-bottom: 1rpx solid #f5f5f5;
  279. .item {
  280. width: 50%;
  281. padding: 20rpx 0;
  282. .car-num {
  283. background-color: #edf6ff;
  284. color: #0080ff;
  285. font-size: 44rpx;
  286. padding: 15rpx 0;
  287. text-align: center;
  288. width: 100%;
  289. border-radius: 10rpx;
  290. font-weight: bold;
  291. letter-spacing: 20rpx;
  292. }
  293. .p1 {
  294. font-size: 28rpx;
  295. color: #999;
  296. }
  297. .p2 {
  298. font-size: 28rpx;
  299. color: #191919;
  300. font-weight: bold;
  301. margin-left: 20rpx;
  302. }
  303. }
  304. .car-num-item {
  305. width: 100%;
  306. display: flex;
  307. align-items: center;
  308. justify-content: center;
  309. }
  310. }
  311. .b {
  312. display: flex;
  313. width: 100%;
  314. align-items: center;
  315. justify-content: space-between;
  316. .btn {
  317. height: 70rpx;
  318. display: flex;
  319. align-items: center;
  320. justify-content: center;
  321. width: calc(50% - 15rpx);
  322. margin: 30rpx 0 0 0;
  323. border-radius: 10rpx;
  324. border-width: 1rpx;
  325. box-sizing: border-box;
  326. }
  327. .b1 {
  328. background-color: #0080ff;
  329. color: #fff;
  330. }
  331. .b2 {
  332. background-color: #f7f7f7;
  333. color: #191919;
  334. }
  335. .b3 {
  336. background-color: #fff;
  337. color: #0080ff;
  338. border: 1rpx solid #0080ff;
  339. }
  340. .b4 {
  341. background-color: #ff0000;
  342. color: #fff;
  343. }
  344. }
  345. }
  346. }
  347. @import '@/common/common.scss'
  348. </style>