the_fuel_filling.vue 10 KB

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