the_fuel_filling.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="content1-top">
  5. <view class="top2">
  6. <view class="left">
  7. <view @click='tabcarchange(0)' class='line' :class='searchType==0?"active":""'>全部</view>
  8. <view @click='tabcarchange(1)' class='line' :class='searchType==1?"active":""'>未完成</view>
  9. <view @click='tabcarchange(3)' class='line' :class='searchType==3?"active":""'>已完成</view>
  10. </view>
  11. <view class="right uni-button">
  12. <button style="line-height: 28px;" class="right-contrent1" @click="trackAddition">添加</button>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <mescroll-body ref="mescrollRef" :down="downOption" @down="downCallback" @up="upCallback" @init="mescrollInit">
  18. <view v-for="(item,index) in fuelFilling" :key="index" @click.stop="getInfo(item)">
  19. <view class="good-list">
  20. <view style="padding: 0 35rpx 20rpx 35rpx;position: relative;">
  21. <view class="flex top">
  22. <view class="flex left">
  23. <view class="item1">
  24. <view class="ssx">{{$helper.getProvinceAbbreviation(item.originProvince)}}</view>
  25. <view class="level2-title" style="font-size: 14px;">
  26. {{$helper.filterUrban(item.originCity)}}
  27. {{$helper.filterArea(item.originArea)}}
  28. </view>
  29. </view>
  30. <image class="jt-icon item2" src="@/static/images/fuel/jt.png" mode='widthFix'>
  31. </image>
  32. <view class="item3">
  33. <view class="ssx">{{$helper.getProvinceAbbreviation(item.destinationProvince)}}
  34. </view>
  35. <view class="level2-title">{{$helper.filterUrban(item.destinationCity)}}
  36. {{$helper.filterArea(item.destinationArea)}}
  37. </view>
  38. </view>
  39. </view>
  40. <view class="flex">
  41. <view class="audit1" v-if="item.travelStatus == '已开始'">已开始</view>
  42. <view class="audit2" v-if="item.travelStatus == '已结束'">{{item.status?item.status:'已结束'}}
  43. </view>
  44. <view class="audit3" v-if="item.travelStatus == '已报销'">已报销</view>
  45. </view>
  46. </view>
  47. <view class="car-info">
  48. <view class="car-num">车牌号 : {{item.carNo}}</view>
  49. <view class="car-date">{{item.createDate.split(" ")[0]}}</view>
  50. </view>
  51. <view v-if='item.tfc&&item.totalCost' class="car-yh">
  52. <view class="row">
  53. 总油耗
  54. <view class="text">
  55. {{item.tfc}}L
  56. </view>
  57. </view>
  58. <view class="row">
  59. 总价
  60. <view class="text">
  61. {{item.totalCost}}元
  62. </view>
  63. </view>
  64. </view>
  65. <view class="see" v-if="item.status=='已申请'||item.travelStatus=='已结束'" @click.stop="seeInfo(item.id)">
  66. <view class="btn">
  67. 查看
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </mescroll-body>
  74. </view>
  75. </template>
  76. <script>
  77. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  78. export default {
  79. mixins: [MescrollMixin],
  80. data() {
  81. return {
  82. canReset:"",
  83. mescroll: null,
  84. downOption: {
  85. auto: false //是否在初始化后,自动执行downCallback; 默认true
  86. },
  87. searchType: 0,
  88. // fuelFilling: [{
  89. // destinationProvince: "辽宁省",
  90. // destinationCity: "营口市",
  91. // destinationArea: "鲅鱼圈区",
  92. // destinationAddress: '鲅鱼圈5号门',
  93. // carNo: "辽H11111",
  94. // originProvince: "辽宁省",
  95. // originCity: "营口",
  96. // originArea: "鲅鱼圈区",
  97. // originAddress: '中天昊元',
  98. // createDate: "2022-01-01 15:30:20",
  99. // travelStatus: "已开始",
  100. // totalCost: "233.20",
  101. // tfc: "60L"
  102. // }],
  103. fuelFilling: [],
  104. }
  105. },
  106. onShow() {
  107. // this.mescroll.endSuccess()
  108. // this.mescroll.resetUpScroll()
  109. // this.fuelFilling = []
  110. // this.getList(10, 1, 'down')
  111. this.$nextTick(function() {
  112. this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页
  113. this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题
  114. this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
  115. });
  116. },
  117. methods: {
  118. mescrollInit(mescroll) {
  119. console.log("mescroll", mescroll)
  120. this.mescroll = mescroll;
  121. },
  122. seeInfo(id) {
  123. uni.navigateTo({
  124. url: '/pages/fuelfilling/apply_see_reimbursement?id=' + id
  125. })
  126. },
  127. /*下拉刷新的回调 */
  128. downCallback() {
  129. this.mescroll.resetUpScroll();
  130. },
  131. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  132. upCallback(page) {
  133. console.log(page)
  134. // if(page.num==1) this.fuelFilling = []
  135. this.$api.doRequest('get', '/fuelFillingInfo/selectFilling', {
  136. pageSize: page.size,
  137. currentPage: page.num,
  138. // pcFlag: 0,
  139. searchType: this.searchType,
  140. compId: uni.getStorageSync('pcUserInfo').compId,
  141. commonId: uni.getStorageSync('pcUserInfo').userId,
  142. }).then(res => {
  143. if (res.data.code == 200) {
  144. let curPageData = res.data.data.records;
  145. let curPageLen = curPageData.length;
  146. let totalPage = res.data.data.total;
  147. if (page.num == 1) this.fuelFilling = [];
  148. this.fuelFilling = this.fuelFilling.concat(curPageData);
  149. console.log(curPageLen, totalPage)
  150. this.mescroll.endByPage(curPageLen, totalPage);
  151. // if (type == 'down') {
  152. // this.mescroll.endSuccess();
  153. // this.fuelFilling = []
  154. // }
  155. // this.mescroll.endBySize(res.data.data.records.length, res.data.data.total);
  156. // this.fuelFilling = this.fuelFilling.concat(res.data.data.records)
  157. }
  158. })
  159. //联网加载数据
  160. // this.getList(page.size, page.num, 'up')
  161. },
  162. tabcarchange(searchType) {
  163. this.searchType = searchType
  164. this.mescroll.resetUpScroll()
  165. },
  166. trackAddition() {
  167. uni.navigateTo({
  168. url: '/pages/fuelfilling/track_addition'
  169. })
  170. },
  171. getList(size, page, type) {
  172. },
  173. getInfo(item) {
  174. if (item.travelStatus == '已报销') {
  175. return
  176. } else if(item.travelStatus == '已开始'&&!item.status||item.travelStatus == '已结束'&&!item.status||item.status=='已驳回') {
  177. uni.navigateTo({
  178. url: '/pages/fuelfilling/track_addition?id=' + item.id
  179. })
  180. }else{
  181. uni.navigateTo({
  182. url: '/pages/fuelfilling/apply_see_reimbursement?id=' + item.id
  183. })
  184. }
  185. },
  186. }
  187. }
  188. </script>
  189. <style lang="scss" scoped>
  190. .content {
  191. padding-bottom: 50rpx;
  192. }
  193. .tag {
  194. background: #F5F6F9;
  195. padding: 5px;
  196. color: #333333;
  197. display: inline-flex;
  198. font-size: 22rpx;
  199. border-radius: 3px;
  200. margin: 3px;
  201. }
  202. .introduce-section .title {
  203. justify-content: space-between;
  204. align-items: flex-start;
  205. }
  206. .introduce-section .title text {
  207. font-size: 28rpx;
  208. }
  209. .introduce-section .title .title-tip {
  210. flex: 1;
  211. font-size: 28rpx;
  212. color: #FE6430;
  213. font-weight: 500;
  214. height: 50px;
  215. line-height: 50px;
  216. border-bottom: 1px solid #EEEEEE;
  217. }
  218. .introduce-section .title .title-tip-a {
  219. flex: 1;
  220. font-size: 15px;
  221. color: #AFB3BF;
  222. font-weight: 500;
  223. height: 50px;
  224. line-height: 50px;
  225. border-bottom: 1px solid #EEEEEE;
  226. }
  227. .line {
  228. display: inline-block;
  229. padding: 5px;
  230. position: relative;
  231. font-size: 17px;
  232. }
  233. .line.active {
  234. font-size: 19px;
  235. font-weight: 900;
  236. }
  237. .line.active:after {
  238. content: '';
  239. display: block;
  240. position: absolute;
  241. width: 18px;
  242. left: 50%;
  243. transform: translateX(-50%);
  244. bottom: 0;
  245. border-bottom: 3px solid #22C572;
  246. }
  247. /deep/.u-action-active {
  248. margin-right: 6px;
  249. }
  250. .content1-top {
  251. background: white;
  252. padding: 10px 16px 0 10px;
  253. border-radius: 0 0 15px 15px;
  254. padding-bottom: 10px;
  255. position:fixed;
  256. width:100%;
  257. z-index:10;
  258. }
  259. .top2 {
  260. display: flex;
  261. align-items: center;
  262. justify-content: space-between;
  263. .right.uni-button {
  264. display: flex;
  265. align-items: center;
  266. font-weight: normal;
  267. .right-contrent1 {
  268. background: #22C572;
  269. height: 27px;
  270. font-size: 14px;
  271. color: #fff;
  272. }
  273. uni-button.right-contrent1:after{
  274. border: 1px solid #22C572;
  275. }
  276. }
  277. }
  278. .good-list {
  279. background-color: white;
  280. margin: 0px 10px 20px 10px;
  281. padding: 20px 0px 8px 0px;
  282. border-radius: 30rpx;
  283. box-shadow: 0px 5rpx 20rpx #E3E3E3;
  284. .item1,
  285. .item3 {
  286. // width: 40%;
  287. display: flex;
  288. .text {
  289. text-overflow: ellipsis;
  290. overflow: hidden;
  291. white-space: nowrap;
  292. }
  293. }
  294. .item1 .text {
  295. text-align: left;
  296. }
  297. .item3 .text {
  298. text-align: right;
  299. }
  300. }
  301. .xf-iamge {
  302. width: 74rpx;
  303. height: 43rpx;
  304. position: absolute;
  305. top: -20rpx;
  306. right: 0;
  307. }
  308. .level2-title {
  309. font-size: 28rpx;
  310. }
  311. .jt-icon {
  312. position: relative;
  313. top: 6rpx;
  314. width: 60rpx;
  315. margin: 0 20rpx;
  316. }
  317. .ssx {
  318. width: 20px;
  319. height: 20px;
  320. background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
  321. font-size: 13px;
  322. font-family: PingFangSC-Medium, PingFang SC;
  323. font-weight: 500;
  324. color: #FFFFFF;
  325. border-radius: 50%;
  326. display: flex;
  327. justify-content: center;
  328. align-items: center;
  329. margin-right: 5px;
  330. }
  331. .level2-title {
  332. font-weight: 700;
  333. color: #000000;
  334. }
  335. .wenzi {
  336. text-align: right;
  337. border-radius: 10rpx;
  338. // margin-right: 30rpx;
  339. height: 10rpx;
  340. padding: 10px 0px 5px 128px;
  341. }
  342. .audit1 {
  343. color: #22C572;
  344. }
  345. .audit2 {
  346. color: #22C572;
  347. }
  348. .audit3 {
  349. color: #AFB3BF;
  350. }
  351. .top {
  352. justify-content: space-between;
  353. align-items: center;
  354. .left {
  355. align-items: center;
  356. }
  357. }
  358. .car-info {
  359. background: #F9F9FA;
  360. padding: 20rpx;
  361. display: flex;
  362. border-radius: 20rpx;
  363. flex-direction: column;
  364. .car-num {
  365. font-size: 26rpx;
  366. font-weight: 700;
  367. }
  368. .car-date {
  369. margin-top: 10rpx;
  370. color: #878C9C;
  371. }
  372. }
  373. .car-yh {
  374. display: flex;
  375. justify-content: flex-end;
  376. margin-top: 20rpx;
  377. .row {
  378. display: flex;
  379. align-items: center;
  380. .text {
  381. font-weight: 700;
  382. margin: 0 20rpx;
  383. }
  384. }
  385. }
  386. .see {
  387. display: flex;
  388. justify-content: flex-end;
  389. .btn {
  390. display: flex;
  391. justify-content: center;
  392. align-items: center;
  393. background: #FFFFFF;
  394. border-radius: 33px;
  395. border: 1px solid #CDCDCD;
  396. padding: 15rpx 40rpx;
  397. box-sizing: border-box;
  398. margin-top: 20rpx;
  399. }
  400. }
  401. /deep/.mescroll-body{
  402. margin-top:50px;
  403. }
  404. </style>