business-order.vue 7.7 KB

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