the_fuel_filling.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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">
  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=='已申请'" @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. downOption: {
  83. auto: false //是否在初始化后,自动执行downCallback; 默认true
  84. },
  85. searchType: 0,
  86. // fuelFilling: [{
  87. // destinationProvince: "辽宁省",
  88. // destinationCity: "营口市",
  89. // destinationArea: "鲅鱼圈区",
  90. // destinationAddress: '鲅鱼圈5号门',
  91. // carNo: "辽H11111",
  92. // originProvince: "辽宁省",
  93. // originCity: "营口",
  94. // originArea: "鲅鱼圈区",
  95. // originAddress: '中天昊元',
  96. // createDate: "2022-01-01 15:30:20",
  97. // travelStatus: "已开始",
  98. // totalCost: "233.20",
  99. // tfc: "60L"
  100. // }],
  101. fuelFilling: [],
  102. }
  103. },
  104. onShow() {
  105. // this.getList()
  106. },
  107. methods: {
  108. seeInfo(id) {
  109. uni.navigateTo({
  110. url: '/pages/fuelfilling/apply_see_reimbursement?id=' + id
  111. })
  112. },
  113. /*下拉刷新的回调 */
  114. downCallback() {
  115. this.getList(10, 1, 'down')
  116. },
  117. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  118. upCallback(page) {
  119. //联网加载数据
  120. this.getList(page.size, page.num, 'up')
  121. },
  122. tabcarchange(searchType) {
  123. this.searchType = searchType
  124. this.getList(10, 1, 'down')
  125. },
  126. trackAddition() {
  127. uni.navigateTo({
  128. url: '/pages/fuelfilling/track_addition'
  129. })
  130. },
  131. getList(size, page, type) {
  132. this.$api.doRequest('get', '/fuelFillingInfo/selectFilling', {
  133. pageSize: size,
  134. currentPage: page,
  135. // pcFlag: 0,
  136. searchType: this.searchType,
  137. compId: uni.getStorageSync('pcUserInfo').compId,
  138. commonId: uni.getStorageSync('pcUserInfo').userId,
  139. }).then(res => {
  140. if (res.data.code == 200) {
  141. if (type == 'down') {
  142. this.mescroll.endSuccess();
  143. this.fuelFilling = []
  144. } else {
  145. this.mescroll.endBySize(res.data.data.records.length, res.data.data.records
  146. .length); //必传参数(当前页的数据个数, 总数据量)
  147. }
  148. this.fuelFilling = this.fuelFilling.concat(res.data.data.records)
  149. }
  150. })
  151. },
  152. getInfo(item) {
  153. if (item.travelStatus == '已报销') {
  154. return
  155. } else {
  156. uni.navigateTo({
  157. url: '/pages/fuelfilling/track_addition?id=' + item.id
  158. })
  159. }
  160. },
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .content {
  166. padding-bottom: 50rpx;
  167. }
  168. .tag {
  169. background: #F5F6F9;
  170. padding: 5px;
  171. color: #333333;
  172. display: inline-flex;
  173. font-size: 22rpx;
  174. border-radius: 3px;
  175. margin: 3px;
  176. }
  177. .introduce-section .title {
  178. justify-content: space-between;
  179. align-items: flex-start;
  180. }
  181. .introduce-section .title text {
  182. font-size: 28rpx;
  183. }
  184. .introduce-section .title .title-tip {
  185. flex: 1;
  186. font-size: 28rpx;
  187. color: #FE6430;
  188. font-weight: 500;
  189. height: 50px;
  190. line-height: 50px;
  191. border-bottom: 1px solid #EEEEEE;
  192. }
  193. .introduce-section .title .title-tip-a {
  194. flex: 1;
  195. font-size: 15px;
  196. color: #AFB3BF;
  197. font-weight: 500;
  198. height: 50px;
  199. line-height: 50px;
  200. border-bottom: 1px solid #EEEEEE;
  201. }
  202. .line {
  203. display: inline-block;
  204. padding: 5px;
  205. position: relative;
  206. font-size: 17px;
  207. }
  208. .line.active {
  209. font-size: 19px;
  210. font-weight: 900;
  211. }
  212. .line.active:after {
  213. content: '';
  214. display: block;
  215. position: absolute;
  216. width: 18px;
  217. left: 50%;
  218. transform: translateX(-50%);
  219. bottom: 0;
  220. border-bottom: 3px solid #22C572;
  221. }
  222. /deep/.u-action-active {
  223. margin-right: 6px;
  224. }
  225. .content1-top {
  226. background: white;
  227. padding: 10px 16px 0 10px;
  228. border-radius: 0 0 15px 15px;
  229. padding-bottom: 10px;
  230. }
  231. .top2 {
  232. display: flex;
  233. align-items: center;
  234. justify-content: space-between;
  235. .right.uni-button {
  236. display: flex;
  237. align-items: center;
  238. font-weight: normal;
  239. .right-contrent1 {
  240. background: #22C572;
  241. height: 25px;
  242. font-size: 14px;
  243. color: #fff;
  244. }
  245. }
  246. }
  247. .good-list {
  248. background-color: white;
  249. margin: -10px 10px 20px 10px;
  250. padding: 20px 0px 8px 0px;
  251. border-radius: 30rpx;
  252. box-shadow: 0px 5rpx 20rpx #E3E3E3;
  253. .item1,
  254. .item3 {
  255. // width: 40%;
  256. display: flex;
  257. .text {
  258. text-overflow: ellipsis;
  259. overflow: hidden;
  260. white-space: nowrap;
  261. }
  262. }
  263. .item1 .text {
  264. text-align: left;
  265. }
  266. .item3 .text {
  267. text-align: right;
  268. }
  269. }
  270. .xf-iamge {
  271. width: 74rpx;
  272. height: 43rpx;
  273. position: absolute;
  274. top: -20rpx;
  275. right: 0;
  276. }
  277. .level2-title {
  278. font-size: 28rpx;
  279. }
  280. .jt-icon {
  281. position: relative;
  282. top: 6rpx;
  283. width: 60rpx;
  284. margin: 0 20rpx;
  285. }
  286. .ssx {
  287. width: 20px;
  288. height: 20px;
  289. background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
  290. font-size: 13px;
  291. font-family: PingFangSC-Medium, PingFang SC;
  292. font-weight: 500;
  293. color: #FFFFFF;
  294. border-radius: 50%;
  295. display: flex;
  296. justify-content: center;
  297. align-items: center;
  298. margin-right: 5px;
  299. }
  300. .level2-title {
  301. font-weight: 700;
  302. color: #000000;
  303. }
  304. .wenzi {
  305. text-align: right;
  306. border-radius: 10rpx;
  307. // margin-right: 30rpx;
  308. height: 10rpx;
  309. padding: 10px 0px 5px 128px;
  310. }
  311. .audit1 {
  312. color: #22C572;
  313. }
  314. .audit2 {
  315. color: #22C572;
  316. }
  317. .audit3 {
  318. color: #AFB3BF;
  319. }
  320. .top {
  321. justify-content: space-between;
  322. align-items: center;
  323. .left {
  324. align-items: center;
  325. }
  326. }
  327. .car-info {
  328. background: #F9F9FA;
  329. padding: 20rpx;
  330. display: flex;
  331. border-radius: 20rpx;
  332. flex-direction: column;
  333. .car-num {
  334. font-size: 26rpx;
  335. font-weight: 700;
  336. }
  337. .car-date {
  338. margin-top: 10rpx;
  339. color: #878C9C;
  340. }
  341. }
  342. .car-yh {
  343. display: flex;
  344. justify-content: flex-end;
  345. margin-top: 20rpx;
  346. .row {
  347. display: flex;
  348. align-items: center;
  349. .text {
  350. font-weight: 700;
  351. margin: 0 20rpx;
  352. }
  353. }
  354. }
  355. .see {
  356. display: flex;
  357. justify-content: flex-end;
  358. .btn {
  359. display: flex;
  360. justify-content: center;
  361. align-items: center;
  362. background: #FFFFFF;
  363. border-radius: 33px;
  364. border: 1px solid #CDCDCD;
  365. padding: 15rpx 40rpx;
  366. box-sizing: border-box;
  367. margin-top: 20rpx;
  368. }
  369. }
  370. </style>