business-order.vue 8.6 KB

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