123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436 |
- <template>
- <div class="vacationRecord">
- <van-nav-bar title="申请记录" left-text="返回" left-arrow @click-left="$route_back" />
- <van-search v-model="searchValue" class="leftkep" placeholder="搜索" @input="keyInp()" />
- <div class="typeItems">
- <div class="typeItem" v-for="(item, index) in headfl" :key="index" :class="{ active: type == item.key }" @click="type = item.key">{{ item.name }}</div>
- </div>
- <div class="headAll">
- <scroller :isInitRefresh="false" noDataText="没有了噢" ref="scroller" :onRefresh="refresh" :onInfinite="infinite" :list="applyList">
- <div class="wraper">
- <van-empty description="暂无数据" v-if="applyList.length == 0" />
- <div v-for="item of applyList" :key="item.id" class="item" @click="$router.push({ name: 'RecordDetail', query: { id: item.id } })">
- <div class="content">
- <div class="title">
- <div class="detail">{{ item.type_mark }}申请</div>
- <div :class="{ wait: item.status == 0, refuse: item.status == -1 }" class="status">{{ filterStatus(item.status) }}</div>
- </div>
- <div v-if="item.type == 4" class="desc">请假类型:{{ item.holiday_name }}</div>
- <div class="desc">申请时间:{{ item.application_time }}</div>
- <div v-if="item.type == 2">
- <div v-for="(innerItem, i) of item.travel_list" :key="i">
- <div class="desc">出差地点:{{ innerItem.name }}</div>
- <div class="desc">开始时间:{{ innerItem.start_time.date }}{{ innerItem.start_time.scope=='AM'? '早上':'下午' }}</div>
- <div class="desc">结束时间:{{ innerItem.end_time.date }}{{ innerItem.end_time.scope=='AM'? '早上':'下午' }}</div>
- </div>
- </div>
- <div v-else>
- <div class="desc">{{ item.type == 0 ? '补卡班次' : '开始时间' }}:{{ item.start_time }}</div>
- <div v-if="item.type != 0" class="desc">结束时间:{{ item.end_time }}</div>
- </div>
- </div>
- </div>
- </div>
- <div style="padding-bottom: 1rem;"></div>
- </scroller>
- </div>
- <!-- 申请搜索 -->
- <div v-show="searchVisibale" class="searchWrapper">
- <div style="display:flex;align-items: center;">
- <van-search v-model="searchValue" class="leftkep" placeholder="搜索" @input="keyInp()" />
- <div @click="getApplyHistroy" v-if="this.searchValue" class="search">搜索</div>
- </div>
- <div class="searchTip">
- <span></span>
- 在这里可以搜索到
- <span></span>
- </div>
- <div class="searchItems">
- <div class="searchItem">
- <icon class="searchItemIcon" name="title"></icon>
- <div>审批标题</div>
- </div>
- <div class="searchItem">
- <icon class="searchItemIcon" name="content"></icon>
- <div>正文内容</div>
- </div>
- <div class="searchItem">
- <icon class="searchItemIcon" name="suggess"></icon>
- <div>审批意见</div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { _debounce } from '@/utils/auth';
- export default {
- data() {
- return {
- applyList: [],
- searchValue: '',
- searchVisibale: false,
- fillterVisibale: false,
- profile: this.$userInfo(),
- applyHistoryList: [],
- status: 'all',
- type: -1,
- page: 1,
- headfl: [{ key: -1, name: '全部' }, { key: 3, name: '外出' }, { key: 2, name: '出差' }, { key: 4, name: '请假' }, { key: 1, name: '加班' }, { key: 0, name: '补卡' }],
- scroller: ''
- };
- },
- watch: {
- type() {
- this.pullDown();
- },
- '$route.query.goSearch'(val) {
- if (!val) {
- this.searchVisibale = false;
- }
- },
- '$route.query.goFillter'(val) {
- if (!val) {
- this.fillterVisibale = false;
- }
- }
- },
- created() {
- if (this.$route.query.type != undefined) {
- this.type = this.$route.query.type;
- }
- },
- activated() {
- this.pullDown();
- },
- methods: {
- pullDown(){
- setTimeout(() => {
- this.$refs.scroller.triggerPullToRefresh();
- }, 50);
- },
- keyInp: _debounce(function() {
- // 搜索
- this.pullDown();
- }),
- filterType(type) {
- switch (type) {
- case 0:
- return '补卡';
- case 1:
- return '加班';
- case 2:
- return '出差';
- case 3:
- return '外出';
- case 4:
- return '请假';
- }
- },
- infinite(done) {
- this.page += 1;
- this.getApplyHistroy(true,done)
- },
- refresh(done) {
- this.page = 1;
- this.getApplyHistroy(false,done)
- },
- filterStatus(status) {
- if (status === 0) {
- return '待审批';
- }
- if (status === 1) {
- return '审批通过';
- }
- if (status === -1) {
- return '审批驳回';
- }
- },
- getApplyHistroy(is,callback) {
- this.$toast.loading({
- mask: true,
- message: '加载中...'
- });
- let hasMore = false
- is? '':this.page=1;
- let data={
- type: this.type,
- page: this.page,
- status: this.status,
- page_size: 10,
- keyword: this.searchValue
- }
- this.$axiosKq('get', '/ad/review/history', data).then(res => {
- let list = res.data.data.review_list;
- if (this.page === 1) {
- this.applyList = list
- } else {
- this.applyList = this.applyList.concat(list)
- }
- hasMore = list.length !== 10
- callback && callback(hasMore)
- }) .finally(() => {
- this.$toast.clear();
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .vacationRecord .search /deep/ .mint-searchbar {
- padding: 0.32rem;
- background: #fff;
- }
- .vacationRecord .search /deep/ .mint-searchbar-inner {
- background: #f5f7fa;
- border-radius: 0.08rem;
- }
- .vacationRecord .search /deep/ .mint-searchbar-core {
- background: #f5f7fa;
- }
- .vacationRecord {
- .typeItems {
- display: flex;
- height: 0.98rem;
- align-items: center;
- justify-content: space-around;
- position: -webkit-sticky;
- position: sticky;
- top: 0.88rem;
- .typeItem {
- width: 0.88rem;
- height: 0.48rem;
- font-size: 0.28rem;
- color: rgba(96, 98, 102, 1);
- line-height: 0.48rem;
- text-align: center;
- &.active {
- color: #fff;
- padding: 0 0.16rem;
- background: rgba(38, 162, 255, 1);
- border-radius: 0.25rem;
- }
- }
- }
- .search {
- height: auto;
- }
- }
- .fillterWrapper {
- 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;
- }
- }
- }
- .vacationRecord {
- background-color: #f5f7fa;
- position: relative;
- }
- .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 3.6rem;
- 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);
- // line-height: 0.8rem;
- // padding: 0.1rem 0 0.28rem 0;
- }
- .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;
- }
- .leftkep {
- padding: 0.2rem 0.12rem 0.2rem 0.32rem;
- box-sizing: border-box;
- }
- .headAll {
- height: calc(100% - 3rem) !important;
- position: relative;
- }
- </style>
- <style>
- .searchIcon path {
- fill: rgb(51, 51, 51);
- }
- </style>
|