business-order.vue 7.7 KB

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