business-order.vue 7.8 KB

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