123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467 |
- <template>
- <view>
- <view class="content">
- <view class="content1-top">
- <view class="top2">
- <view class="left">
- <view @click='tabcarchange(0)' class='line' :class='searchType==0?"active":""'>全部</view>
- <view @click='tabcarchange(1)' class='line' :class='searchType==1?"active":""'>未完成</view>
- <view @click='tabcarchange(3)' class='line' :class='searchType==3?"active":""'>已完成</view>
- </view>
- <view class="right uni-button">
- <button style="line-height: 28px;" class="right-contrent1" @click="trackAddition">添加</button>
- </view>
- </view>
- </view>
- </view>
- <mescroll-body ref="mescrollRef" :down="downOption" @down="downCallback" @up="upCallback" @init="mescrollInit">
- <view v-for="(item,index) in fuelFilling" :key="index">
- <view class="good-list">
- <view style="padding: 0 35rpx 20rpx 35rpx;position: relative;">
- <view class="flex top">
- <view class="flex">
- <view class="audit1">{{item.approveStatus?item.approveStatus:item.status}}</view>
- </view>
- </view>
- <view class="car-info">
- <view class="car-num">车牌号 : {{item.carNo}}</view>
- <view class="car-date">{{item.createDate}}</view>
- </view>
- <view class="car-yh">
- <view class="row">
- 油耗
- <view class="text">
- {{item.fillingDetailInfo?item.fillingDetailInfo.oilConsumption:''}}L
- </view>
- </view>
- <!-- <view class="row">
- 油价
- <view class="text">
- {{item.fillingDetailInfo.currentOilPrice}}元
- </view>
- </view> -->
- <view class="row">
- 申请费用
- <view class="text">
- {{item.fillingDetailInfo?item.fillingDetailInfo.currentConsumption:''}}元
- </view>
- </view>
- </view>
- <view class="see">
- <view class="btn" @click.stop="seeInfo(item.id)"
- v-if="item.approveStatus=='待加油审批'||item.status=='已通过'||item.status=='已驳回'">
- 查看
- </view>
- <view class="btn" @click.stop="backInfo(item)" v-if="item.approveStatus=='待加油审批'">
- 撤回
- </view>
- <view class="btn" @click.stop="editInfo(item.id)"
- v-if="item.approveStatus=='发起人撤回'||item.status=='已驳回'">
- 编辑
- </view>
- <view class="btn" @click.stop="delInfo(item.id)"
- v-if="item.approveStatus=='发起人撤回'||item.status=='已驳回'">
- 删除
- </view>
- </view>
- </view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- canReset: "",
- mescroll: null,
- downOption: {
- auto: false //是否在初始化后,自动执行downCallback; 默认true
- },
- searchType: 0,
- fuelFilling: [],
- }
- },
- onShow() {
- // this.mescroll.endSuccess()
- // this.mescroll.resetUpScroll()
- // this.fuelFilling = []
- // this.getList(10, 1, 'down')
- this.$nextTick(function() {
- this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页
- this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题
- this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
- });
- },
- methods: {
- mescrollInit(mescroll) {
- console.log("mescroll", mescroll)
- this.mescroll = mescroll;
- },
- seeInfo(id) {
- uni.navigateTo({
- url: '/pages/fuelfilling/apply_see_reimbursement?id=' + id
- })
- },
- backInfo(row) {
- uni.showLoading({
- mask: true,
- title: "撤回中..."
- })
- console.log(row)
- this.$api.doRequest('post', '/newWorkflow/api/stopInstance', {
- workflowId: row.workflowId,
- businessKey: row.id,
- }).then(res => {
- uni.hideLoading()
- console.log(res)
- if (res.data.code == 200) {
- this.mescroll.resetUpScroll()
- }
- })
- },
- editInfo(id) {
- uni.navigateTo({
- url: '/pages/fuelfilling/apply_for_edit_reimbursement?id=' + id
- })
- },
- delInfo(id) {
- uni.showLoading({
- title: "加载中",
- mask: true
- })
- this.$api.doRequest('post', '/fuelFillingInfo/api/deleteFilling', {
- id: id,
- }).then(res => {
- uni.hideLoading()
- console.log(res)
- if (res.data.code == 200) {
- this.mescroll.resetUpScroll()
- }
- })
- },
- /*下拉刷新的回调 */
- downCallback() {
- this.mescroll.resetUpScroll();
- },
- /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
- upCallback(page) {
- console.log(page)
- // if(page.num==1) this.fuelFilling = []
- this.$api.doRequest('get', '/fuelFillingInfo/selectFilling', {
- pageSize: page.size,
- currentPage: page.num,
- // pcFlag: 0,
- searchType: this.searchType,
- compId: uni.getStorageSync('pcUserInfo').compId,
- commonId: uni.getStorageSync('pcUserInfo').userId,
- }).then(res => {
- if (res.data.code == 200) {
- let curPageData = res.data.data.records;
- let curPageLen = curPageData.length;
- let totalPage = res.data.data.total;
- if (page.num == 1) this.fuelFilling = [];
- this.fuelFilling = this.fuelFilling.concat(curPageData);
- console.log(curPageLen, totalPage)
- this.mescroll.endByPage(curPageLen, totalPage);
- }
- })
- //联网加载数据
- // this.getList(page.size, page.num, 'up')
- },
- tabcarchange(searchType) {
- this.searchType = searchType
- this.mescroll.resetUpScroll()
- },
- trackAddition() {
- uni.navigateTo({
- url: '/pages/fuelfilling/apply_for_reimbursement'
- })
- },
- getList(size, page, type) {
- },
- getInfo(item) {
- if (item.travelStatus == '已报销') {
- return
- } else if (item.travelStatus == '已开始' && !item.status || item.travelStatus == '已结束' && !item.status || item
- .status == '已驳回') {
- uni.navigateTo({
- url: '/pages/fuelfilling/track_addition?id=' + item.id
- })
- } else {
- uni.navigateTo({
- url: '/pages/fuelfilling/apply_see_reimbursement?id=' + item.id
- })
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- padding-bottom: 50rpx;
- }
- .tag {
- background: #F5F6F9;
- padding: 5px;
- color: #333333;
- display: inline-flex;
- font-size: 22rpx;
- border-radius: 3px;
- margin: 3px;
- }
- .introduce-section .title {
- justify-content: space-between;
- align-items: flex-start;
- }
- .introduce-section .title text {
- font-size: 28rpx;
- }
- .introduce-section .title .title-tip {
- flex: 1;
- font-size: 28rpx;
- color: #FE6430;
- font-weight: 500;
- height: 50px;
- line-height: 50px;
- border-bottom: 1px solid #EEEEEE;
- }
- .introduce-section .title .title-tip-a {
- flex: 1;
- font-size: 15px;
- color: #AFB3BF;
- font-weight: 500;
- height: 50px;
- line-height: 50px;
- border-bottom: 1px solid #EEEEEE;
- }
- .line {
- display: inline-block;
- padding: 5px;
- position: relative;
- font-size: 17px;
- }
- .line.active {
- font-size: 19px;
- font-weight: 900;
- }
- .line.active:after {
- content: '';
- display: block;
- position: absolute;
- width: 18px;
- left: 50%;
- transform: translateX(-50%);
- bottom: 0;
- border-bottom: 3px solid #22C572;
- }
- /deep/.u-action-active {
- margin-right: 6px;
- }
- .content1-top {
- background: white;
- padding: 10px 16px 0 10px;
- border-radius: 0 0 15px 15px;
- padding-bottom: 10px;
- position: fixed;
- width: 100%;
- z-index: 10;
- }
- .top2 {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .right.uni-button {
- display: flex;
- align-items: center;
- font-weight: normal;
- .right-contrent1 {
- background: #22C572;
- height: 27px;
- font-size: 14px;
- color: #fff;
- }
- uni-button.right-contrent1:after {
- border: 1px solid #22C572;
- }
- }
- }
- .good-list {
- background-color: white;
- margin: 0px 10px 20px 10px;
- padding: 20rpx 0px 8px 0px;
- border-radius: 30rpx;
- box-shadow: 0px 5rpx 20rpx #E3E3E3;
- .item1,
- .item3 {
- // width: 40%;
- display: flex;
- .text {
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
- }
- .item1 .text {
- text-align: left;
- }
- .item3 .text {
- text-align: right;
- }
- }
- .xf-iamge {
- width: 74rpx;
- height: 43rpx;
- position: absolute;
- top: -20rpx;
- right: 0;
- }
- .level2-title {
- font-size: 28rpx;
- }
- .jt-icon {
- position: relative;
- top: 6rpx;
- width: 60rpx;
- margin: 0 20rpx;
- }
- .ssx {
- width: 20px;
- height: 20px;
- background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
- font-size: 13px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-right: 5px;
- }
- .level2-title {
- font-weight: 700;
- color: #000000;
- }
- .wenzi {
- text-align: right;
- border-radius: 10rpx;
- // margin-right: 30rpx;
- height: 10rpx;
- padding: 10px 0px 5px 128px;
- }
- .audit1 {
- color: #22C572;
- }
- .audit2 {
- color: #22C572;
- }
- .audit3 {
- color: #AFB3BF;
- }
- .top {
- justify-content: flex-end;
- align-items: center;
- margin-bottom: 10rpx;
- .left {
- align-items: center;
- }
- }
- .car-info {
- background: #F9F9FA;
- padding: 20rpx;
- display: flex;
- border-radius: 20rpx;
- flex-direction: column;
- .car-num {
- font-size: 26rpx;
- font-weight: 700;
- }
- .car-date {
- margin-top: 10rpx;
- color: #878C9C;
- }
- }
- .car-yh {
- display: flex;
- justify-content: flex-end;
- margin-top: 20rpx;
- .row {
- display: flex;
- align-items: center;
- .text {
- font-weight: 700;
- margin: 0 20rpx;
- }
- }
- }
- .see {
- display: flex;
- justify-content: flex-end;
- .btn {
- display: flex;
- justify-content: center;
- align-items: center;
- background: #FFFFFF;
- border-radius: 33px;
- border: 1px solid #CDCDCD;
- padding: 15rpx 40rpx;
- box-sizing: border-box;
- margin: 20rpx 0 0 20rpx;
- }
- }
- /deep/.mescroll-body {
- margin-top: 50px;
- }
- </style>
|