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