123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429 |
- <template>
- <!-- 考勤审批列表 -->
- <div>
- <van-nav-bar title="考勤审批" left-text="返回" left-arrow @click-left="$route_back" />
- <div class="approveRecord">
- <van-tabs v-model="status" @change="handleClick">
- <van-tab name="waiting" :title="'待我审批(' + reviewTotal + ')'"></van-tab>
- <van-tab name="dealed" title="我已审批"></van-tab>
- <van-tab name="all" title="抄送给我"></van-tab>
- </van-tabs>
- <div class="head-Nav">
- <van-row>
- <van-col span="22"><van-search v-model="keyword" class="leftkep" placeholder="搜索审批内容" @input="keyInp()" /></van-col>
- <van-col span="2" @click="showFillter"><van-icon name="filter-o" class="rightsx" /></van-col>
- </van-row>
- </div>
- <div style="position: relative;height: calc(100% - 2rem) !important;">
- <scroller ref="scroller" :isInitRefresh="false" :onRefresh="refresh" :onInfinite="infinite" noDataText="没有了噢" :list="reviewList">
- <div v-for="item of reviewList" :key="item.id" class="item" @click="$router.push({ name: 'RecordDetail', query: { id: item.id } })">
- <div class="content">
- <div class="title">
- <div class="detail">{{ item.employee_name }}提交的{{ filterType(item.type) }}申请</div>
- <div :class="{ wait: item.status == 0, refuse: item.status == -1 }" class="status">{{ filterStatus(item.status) }}</div>
- </div>
- <div v-if="item.type == 5" class="desc">申请类型:{{ item.holiday_name }}</div>
- <div class="desc">申请时间:{{ formatTime(item.create_time) }}</div>
- <template v-if="item.type == 0">
- <div class="desc">补卡时间:{{ item.start_time }}</div>
- <!-- <div class="desc">结束时间:{{ item.end_time }}</div> -->
- </template>
- <template v-else>
- <div class="desc">开始时间:{{ item.start_time }}</div>
- <div class="desc">结束时间:{{ item.end_time }}</div>
- </template>
- </div>
- </div>
- <van-empty description="暂无数据" v-if="reviewList.length == 0" />
- <div style="height: 1rem;"></div>
- </scroller>
- </div>
- <!-- 筛选 -->
- <div v-show="fillterVisibale" class="fillterWrapper" :style="setNavstyle">
- <div class="fillter">
- <div class="fillterTitle">申请类型</div>
- <div class="fillterItems">
- <div :class="{ active: type == -1 }" @click="type = -1" class="fillterItem type">全部</div>
- <div :class="{ active: type == 5 }" class="fillterItem type" @click="type = 5">请假</div>
- <div :class="{ active: type == 4 }" class="fillterItem type" @click="type = 4">外出</div>
- <div :class="{ active: type == 3 }" class="fillterItem type" @click="type = 3">出差</div>
- <div :class="{ active: type == 2 }" class="fillterItem type" @click="type = 2">加班</div>
- <div :class="{ active: type == 1 }" class="fillterItem type" @click="type = 1">补卡</div>
- </div>
- </div>
- <div @click="getReviewHistroy()" class="confirmBtn">确认</div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Vue from 'vue';
- import { _debounce } from '@/utils/auth';
- import { Tab, Tabs, Search } from 'vant';
- Vue.use(Tab)
- .use(Tabs)
- .use(Search);
- export default {
- data() {
- return {
- reviewList: [],
- keyword: '',
- fillterVisibale: false,
- status: 'waiting',
- type: -1,
- page: 1,
- reviewTotal: 0,
- setNavstyle: '',
- };
- },
- watch: {
- '$route.query.goFillter'(val) {
- if (!val) {
- this.fillterVisibale = false;
- }
- }
- },
- created() {
- if (this.$route.query.type != undefined) {
- this.type = this.$route.query.type;
- }
- },
- mounted() {
- this.isApp();
- },
- activated() {
- this.pullDown()
- },
- methods: {
- pullDown(){
- setTimeout(() => {
- this.$refs.scroller.triggerPullToRefresh();
- }, 50);
- },
- keyInp: _debounce(function() {
- // 搜索
- this.pullDown()
- }),
- handleClick(name, title) {
- this.pullDown()
- },
- isApp() {
- if (window.plus) {
- this.setNavstyle = 'top: calc(0.88rem + 1px + ' + plus.navigator.getStatusbarHeight() + 'px);';
- }
- },
- formatTime(val) {
- return this.$moment(val * 1000).format('YYYY-MM-DD HH:mm');
- },
- // 上拉刷新
- refresh (done) {
- this.getReviewHistroy(false,done)
- },
- // 下拉加载
- infinite (done) {
- this.page++;
- this.getReviewHistroy(true,done)
- },
- filterVacationType(type) {
- switch (type) {
- case 0:
- return '年假';
- case 1:
- return '事假';
- case 2:
- return '病假';
- case 3:
- return '调休';
- case 4:
- return '产假';
- case 5:
- return '婚假';
- case 6:
- return '例假';
- case 7:
- return '丧假';
- }
- },
- filterStatus(status) {
- if (status === 0) {
- return '待审批';
- }
- if (status === 1) {
- return '审批通过';
- }
- if (status === -1) {
- return '审批驳回';
- }
- },
- filterType(type) {
- switch (type) {
- case 0:
- return '补卡';
- case 1:
- return '加班';
- case 2:
- return '出差';
- case 3:
- return '外出';
- case 4:
- return '请假';
- }
- },
- getReviewHistroy(is,callback) {
- let hasMore = false
- is? '':this.page=1;
- if (this.fillterVisibale) {
- this.fillterVisibale = false;
- }
- let params = {
- page: this.page,
- type: this.type,
- status: this.status,
- page_size: 10,
- keyword: this.keyword,
- is_reviewer:this.status=='all'? 2:1,
- };
- this.$axiosKq('post', '/ad/review', params).then(res => {
- if (res.data.code === 1) {
- let data = res.data.data;
- if (this.status == 'waiting' && this.type == -1) {
- this.reviewTotal = data.total;
- }
- if (this.page === 1) {
- this.reviewList = data.review_list
- } else {
- this.reviewList = this.reviewList.concat(data.review_list)
- }
- hasMore = data.review_list.length !== 10
- callback && callback(hasMore)
- }
- });
- },
- showFillter() {
- this.fillterVisibale = true;
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- .approveRecord /deep/ .mint-tab-item .mint-tab-item-label {
- font-size: 0.32rem;
- }
- .fillterWrapper {
- z-index: 1;
- position: fixed;
- top: 0.88rem;
- .confirmBtn {
- position: fixed;
- left: 0;
- bottom: 0;
- height: 1rem;
- line-height: 1rem;
- text-align: center;
- color: #fff;
- background: rgb(55, 171, 254);
- width: 100%;
- }
- background-color: #fff;
- height: 100%;
- .fillterTitle {
- line-height: 0.8rem;
- position: relative;
- padding-left: 0.4rem;
- margin-left: 0.15rem;
- margin-top: 0.2rem;
- font-size: 0.3rem;
- &::after {
- content: '';
- position: absolute;
- top: 0.26rem;
- left: 0;
- width: 0.24rem;
- height: 0.24rem;
- border-radius: 50%;
- background-color: rgb(72, 169, 239);
- }
- }
- .fillter:nth-of-type(2) .fillterTitle::after {
- background-color: rgb(22, 195, 149);
- }
- .fillterItems {
- display: flex;
- flex-wrap: wrap;
- .fillterItem {
- width: 2rem;
- height: 1rem;
- text-align: center;
- line-height: 1rem;
- background: rgb(243, 243, 243);
- border-radius: 0.2rem;
- font-size: 0.28rem;
- margin-left: 0.36rem;
- margin-bottom: 0.36rem;
- &.type {
- width: 3.2rem;
- }
- &.active {
- background-color: rgb(228, 240, 250);
- color: rgb(119, 191, 241);
- }
- }
- }
- .fillter:nth-of-type(2) .fillterItems .fillterItem.active {
- background-color: rgb(220, 245, 239);
- color: rgb(75, 208, 172);
- }
- }
- .searchItems {
- display: flex;
- padding-top: 0.4rem;
- .searchItem {
- flex: 1;
- font-size: 0.24rem;
- color: #909399;
- text-align: center;
- .searchItemIcon {
- width: 0.5rem;
- margin-bottom: 0.18rem;
- }
- }
- }
- .searchTip {
- margin-top: 1.2rem;
- padding: 0 0.8rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 0.28rem;
- color: #909399;
- span {
- width: 26%;
- height: 0.02rem;
- background-color: #eee;
- }
- }
- .searchWrapper {
- background-color: #fff;
- height: 100%;
- position: fixed;
- top: 0.88rem;
- left: 0;
- width: 100%;
- .search {
- flex: 0 0 1rem;
- color: #26a2ff;
- padding-right: 0.2rem;
- text-align: center;
- background-color: #f5f7fa;
- height: 0.96rem;
- line-height: 0.96rem;
- font-size: 0.32rem;
- }
- }
- .topBar {
- height: 0.88rem;
- background-color: #fff;
- border-bottom: 0.02rem solid #eee;
- display: flex;
- align-items: center;
- font-size: 0.3rem;
- line-height: 0.5rem;
- .left {
- flex: 1;
- text-align: center;
- color: #909399;
- .searchIcon {
- width: 0.4rem;
- margin-right: 0.1rem;
- }
- }
- .right {
- flex: 1;
- text-align: center;
- color: #909399;
- .fillterIcon {
- width: 0.4rem;
- margin-right: 0.1rem;
- }
- }
- }
- .approveRecord {
- background-color: #f5f7fa;
- position: relative;
- height: calc(100% - 0.92rem) !important;
- }
- .wraper {
- // padding:0 0.32rem;
- // background-color: #fff;
- }
- .item {
- display: flex;
- padding: 0 0.32rem 0.26rem;
- margin-bottom: 0.24rem;
- background-color: #fff;
- }
- .avatar {
- width: 0.86rem;
- height: 0.86rem;
- border-radius: 50%;
- margin: 0.4rem 0.2rem 0 0;
- flex-shrink: 0;
- }
- .content {
- // padding-top: 0.2rem;
- width: 100%;
- }
- .content .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- // padding-bottom: 0.12rem;
- margin: 0.32rem 0 0.16rem 0;
- .detail {
- font-size: 0.34rem;
- flex: 0 0 4.5rem;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .content .desc {
- font-size: 0.28rem;
- color: #909399;
- margin-bottom: 0.08rem;
- }
- .content .status {
- font-size: 0.34rem;
- color: rgb(70, 211, 173);
- }
- .content .status.wait {
- color: rgb(235, 179, 102);
- }
- .content .status.refuse {
- color: rgb(246, 138, 119);
- }
- .content .status.cancel {
- color: rgb(101, 101, 101);
- }
- .title .time {
- padding-right: 0.2rem;
- font-size: 0.28rem;
- color: #909399;
- }
- .head-Nav {
- background-color: #fff;
- border-bottom: 1px solid #f1f1f1;
- .leftkep {
- padding: 0.2rem 0.12rem 0.2rem 0.32rem;
- }
- .rightsx {
- margin: 0.35rem 0 0 0.1rem;
- }
- }
- </style>
- <style>
- .searchIcon path {
- fill: rgb(51, 51, 51);
- }
- </style>
|