business-order.vue 9.0 KB

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