Commit 7948207f authored by 罗超's avatar 罗超

2

parent b42c30ac
......@@ -344,9 +344,9 @@ export default {
lower(e) {
if (data.msg.pageIndex < data.PageCount) {
data.pageState = "loading";
data.msg.pageIndex++;
if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => {
data.msg.pageIndex++;
that.getList();
}, 1000);
} else {
......
<template>
<view class="con">
<van-empty description="暂无请假申请" v-if="data.length === 0" />
<scroll-view
:scroll-top="0"
scroll-y="true"
class="scroll-box"
@scrolltolower="lower"
v-if="data.length > 0"
>
<scroll-view :scroll-top="0" scroll-y="true" class="scroll-box" @scrolltolower="lower" v-if="data.length > 0">
<view v-for="(item, index) in data" :key="index" class="leave-item">
<view class="top flex flex_start_center" @click="jumpPage(item)">
<van-image
round
width="55rpx"
fit="cover"
height="55rpx"
:src="userInfo.UserIcon ? userInfo.UserIcon : userInfo.GroupLogo"
style="margin-right: 20rpx"
class="flex flex_start_center"
/>
<van-image round width="55rpx" fit="cover" height="55rpx"
:src="userInfo.UserIcon ? userInfo.UserIcon : userInfo.GroupLogo" style="margin-right: 20rpx"
class="flex flex_start_center" />
<view class="grow one_line name">{{ item.CreateByName }}的请假</view>
<view class="date">{{ item.CreateTime }}</view>
</view>
<view class="flex flex_between_center margin-t-b-15">
<view class="flex label-next"
><view class="label">请假类型</view>
<view class="flex label-next">
<view class="label">请假类型</view>
<text v-if="item.DataObj.LeaveType === 1">事假</text>
<text v-if="item.DataObj.LeaveType === 2">病假</text>
</view>
<view
class="status"
:class="{
<view class="status" :class="{
status1: item.VerifyStatus === 4,
status2: item.VerifyStatus === 6,
status3: item.VerifyStatus === 0,
}"
>{{ item.AuditStatusName }}</view
>
}">{{ item.AuditStatusName }}</view>
</view>
<view class="flex label-next margin-t-b-15"
><view class="label">开始时间</view
>{{ item.DataObj.LeaveInfoList[0].ClassDate }}
{{ item.DataObj.LeaveInfoList[0].StartTime }}</view
>
<view class="flex label-next margin-t-b-15"
><view class="label">结束时间</view
>{{
<view class="flex label-next margin-t-b-15">
<view class="label">开始时间</view>{{ item.DataObj.LeaveInfoList[0].ClassDate }}
{{ item.DataObj.LeaveInfoList[0].StartTime }}
</view>
<view class="flex label-next margin-t-b-15">
<view class="label">结束时间</view>{{
item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1]
.ClassDate
}}
{{
item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1]
.EndTime
}}</view
>
<view class="flex label-next margin-t-b-15 one_line" style="width: 80%"
><view class="label">请假事由</view
>{{ item.DataObj.Remarks || "无" }}</view
>
}}
</view>
<view class="flex label-next margin-t-b-15 one_line" style="width: 80%">
<view class="label">请假事由</view>{{ item.DataObj.Remarks || "无" }}
</view>
<van-button
type="danger"
size="mini"
class="invalid-btn"
plain
v-if="item.VerifyStatus === 0"
@click="invalidApply(item)"
>作废</van-button
>
<van-button type="danger" size="mini" class="invalid-btn" plain v-if="item.VerifyStatus === 0"
@click="invalidApply(item)">作废</van-button>
</view>
<Loadmore :state="pageState" />
</scroll-view>
......@@ -77,7 +51,7 @@
</template>
<script>
import {
import {
ref,
reactive,
toRefs,
......@@ -87,10 +61,13 @@ import {
computed,
onMounted,
inject,
} from "vue";
import { getStudentLeaveList, invalidReceiptInfo } from "../../api/index";
import Loadmore from "../../components/loadmore.vue";
export default {
} from "vue";
import {
getStudentLeaveList,
invalidReceiptInfo
} from "../../api/index";
import Loadmore from "../../components/loadmore.vue";
export default {
components: {
Loadmore,
},
......@@ -114,17 +91,16 @@ export default {
let methods = {
jumpPage(item) {
uni.navigateTo({
url:
"/pages/course/askForLeaveDetail?data=" +
url: "/pages/course/askForLeaveDetail?data=" +
encodeURIComponent(JSON.stringify(item)),
});
},
lower(e) {
if (data.msg.PageIndex < data.PageCount) {
data.pageState = "loading";
data.msg.PageIndex++;
if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => {
data.msg.PageIndex++;
that.getList();
}, 1000);
} else {
......@@ -143,7 +119,7 @@ export default {
if (data.msg.PageIndex === 1) {
data.data = res.Data.PageData;
} else {
data.data = [...res.Data.PageData, ...data.data];
data.data = [...data.data, ...res.Data.PageData];
}
if (data.msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none";
......@@ -188,18 +164,19 @@ export default {
title: "请假列表",
});
},
};
};
</script>
<style scoped>
.con {
.con {
height: 100vh;
box-sizing: border-box;
font-family: PingFang SC;
padding: 30rpx 0;
}
.leave-item {
}
.leave-item {
box-sizing: border-box;
width: 690rpx;
padding: 20rpx 30rpx;
......@@ -207,64 +184,76 @@ export default {
margin-bottom: 30rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2);
position: relative;
}
.top {
}
.top {
border-bottom: 1rpx solid #e2e2e2;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.name {
}
.name {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.date {
}
.date {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
.status {
}
.status {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #00df9f;
}
.status1 {
}
.status1 {
color: #ff3816;
}
.status2 {
}
.status2 {
color: #111111;
}
.status3 {
}
.status3 {
color: #4fc08d;
}
.label {
}
.label {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
margin-right: 30rpx;
}
.label-next {
}
.label-next {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.margin-t-b-15 {
}
.margin-t-b-15 {
margin-top: 15rpx;
margin-bottom: 15rpx;
}
.scroll-box {
}
.scroll-box {
height: 100%;
width: 100%;
}
.invalid-btn {
}
.invalid-btn {
position: absolute;
right: 30rpx;
bottom: 20rpx;
z-index: 10;
}
}
</style>
......@@ -140,9 +140,9 @@ export default {
lower(e) {
if (data.msg.PageIndex < data.PageCount) {
data.pageState = "loading";
data.msg.PageIndex++;
if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => {
data.msg.PageIndex++;
that.getList();
}, 1000);
} else {
......@@ -158,7 +158,7 @@ export default {
if (data.msg.PageIndex === 1) {
data.examList = res.Data.PageData;
} else {
data.examList = [...res.Data.PageData, ...data.examList];
data.examList = [...data.examList,...res.Data.PageData];
}
if (data.msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none";
......
......@@ -3,19 +3,10 @@
<van-toast id="van-toast" />
<view class="list-con">
<van-empty description="暂无数据" v-if="dataList.length === 0" />
<scroll-view
:scroll-top="0"
scroll-y="true"
class="scroll-box"
@scrolltolower="lower"
v-if="dataList.length > 0"
>
<view
v-for="(item, index) in dataList"
:key="index"
class="list-item flex flex_between_center"
@click="jumpPage(item.Id)"
>
<scroll-view :scroll-top="0" scroll-y="true" class="scroll-box" @scrolltolower="lower"
v-if="dataList.length > 0">
<view v-for="(item, index) in dataList" :key="index" class="list-item flex flex_between_center"
@click="jumpPage(item.Id)">
<image class="left" :src="item.Img"></image>
<view class="right">
<view class="one_line title">{{ item.Title }}</view>
......@@ -29,11 +20,20 @@
</template>
<script>
import { reactive, toRefs, getCurrentInstance, onMounted } from "vue";
import { getLearningGardenList } from "../../api/index";
import { debounce } from "../../utils/index";
import Loadmore from "../../components/loadmore.vue";
export default {
import {
reactive,
toRefs,
getCurrentInstance,
onMounted
} from "vue";
import {
getLearningGardenList
} from "../../api/index";
import {
debounce
} from "../../utils/index";
import Loadmore from "../../components/loadmore.vue";
export default {
components: {
Loadmore,
},
......@@ -67,7 +67,7 @@ export default {
if (data.msg.PageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...res.Data.PageData, ...data.dataList];
data.dataList = [...data.dataList, ...res.Data.PageData];
}
data.pageCount = res.Data.PageCount;
if (data.msg.PageIndex >= res.Data.PageCount) {
......@@ -80,9 +80,9 @@ export default {
lower(e) {
if (data.msg.PageIndex < data.pageCount) {
data.pageState = "loading";
data.msg.PageIndex++;
if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => {
data.msg.PageIndex++;
that.getList();
}, 1000);
} else {
......@@ -104,45 +104,51 @@ export default {
title: this.pageTitle,
});
},
};
};
</script>
<style scoped>
.list-con {
.list-con {
height: calc(100vh - 20rpx);
box-sizing: border-box;
padding: 15rpx 30rpx;
margin-top: 10rpx;
}
.scroll-box {
}
.scroll-box {
height: 100%;
width: 100%;
}
.list-item {
}
.list-item {
margin: 20rpx 0;
}
.left {
}
.left {
width: 220rpx;
height: 120rpx;
border-radius: 20rpx;
box-shadow: 0rpx 10rpx 30rpx 0rpx rgba(36, 36, 36, 0.2);
}
.right {
}
.right {
width: 440rpx;
height: 120rpx;
}
.right .title {
}
.right .title {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
line-height: 70rpx;
}
.right .digest {
}
.right .digest {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
line-height: 30rpx;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment