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

2

parent b42c30ac
...@@ -344,9 +344,9 @@ export default { ...@@ -344,9 +344,9 @@ export default {
lower(e) { lower(e) {
if (data.msg.pageIndex < data.PageCount) { if (data.msg.pageIndex < data.PageCount) {
data.pageState = "loading"; data.pageState = "loading";
data.msg.pageIndex++;
if (data.timer) clearTimeout(data.timer); if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => { data.timer = setTimeout(() => {
data.msg.pageIndex++;
that.getList(); that.getList();
}, 1000); }, 1000);
} else { } else {
......
<template> <template>
<view class="con"> <view class="con">
<van-empty description="暂无请假申请" v-if="data.length === 0" /> <van-empty description="暂无请假申请" v-if="data.length === 0" />
<scroll-view <scroll-view :scroll-top="0" scroll-y="true" class="scroll-box" @scrolltolower="lower" v-if="data.length > 0">
:scroll-top="0" <view v-for="(item, index) in data" :key="index" class="leave-item">
scroll-y="true" <view class="top flex flex_start_center" @click="jumpPage(item)">
class="scroll-box" <van-image round width="55rpx" fit="cover" height="55rpx"
@scrolltolower="lower" :src="userInfo.UserIcon ? userInfo.UserIcon : userInfo.GroupLogo" style="margin-right: 20rpx"
v-if="data.length > 0" class="flex flex_start_center" />
> <view class="grow one_line name">{{ item.CreateByName }}的请假</view>
<view v-for="(item, index) in data" :key="index" class="leave-item"> <view class="date">{{ item.CreateTime }}</view>
<view class="top flex flex_start_center" @click="jumpPage(item)"> </view>
<van-image <view class="flex flex_between_center margin-t-b-15">
round <view class="flex label-next">
width="55rpx" <view class="label">请假类型</view>
fit="cover" <text v-if="item.DataObj.LeaveType === 1">事假</text>
height="55rpx" <text v-if="item.DataObj.LeaveType === 2">病假</text>
:src="userInfo.UserIcon ? userInfo.UserIcon : userInfo.GroupLogo" </view>
style="margin-right: 20rpx" <view class="status" :class="{
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>
<text v-if="item.DataObj.LeaveType === 1">事假</text>
<text v-if="item.DataObj.LeaveType === 2">病假</text>
</view>
<view
class="status"
:class="{
status1: item.VerifyStatus === 4, status1: item.VerifyStatus === 4,
status2: item.VerifyStatus === 6, status2: item.VerifyStatus === 6,
status3: item.VerifyStatus === 0, status3: item.VerifyStatus === 0,
}" }">{{ item.AuditStatusName }}</view>
>{{ item.AuditStatusName }}</view </view>
> <view class="flex label-next margin-t-b-15">
</view> <view class="label">开始时间</view>{{ item.DataObj.LeaveInfoList[0].ClassDate }}
<view class="flex label-next margin-t-b-15" {{ item.DataObj.LeaveInfoList[0].StartTime }}
><view class="label">开始时间</view </view>
>{{ item.DataObj.LeaveInfoList[0].ClassDate }} <view class="flex label-next margin-t-b-15">
{{ item.DataObj.LeaveInfoList[0].StartTime }}</view <view class="label">结束时间</view>{{
>
<view class="flex label-next margin-t-b-15"
><view class="label">结束时间</view
>{{
item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1] item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1]
.ClassDate .ClassDate
}} }}
{{ {{
item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1] item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1]
.EndTime .EndTime
}}</view }}
> </view>
<view class="flex label-next margin-t-b-15 one_line" style="width: 80%" <view class="flex label-next margin-t-b-15 one_line" style="width: 80%">
><view class="label">请假事由</view <view class="label">请假事由</view>{{ item.DataObj.Remarks || "无" }}
>{{ item.DataObj.Remarks || "无" }}</view </view>
>
<van-button <van-button type="danger" size="mini" class="invalid-btn" plain v-if="item.VerifyStatus === 0"
type="danger" @click="invalidApply(item)">作废</van-button>
size="mini" </view>
class="invalid-btn" <Loadmore :state="pageState" />
plain </scroll-view>
v-if="item.VerifyStatus === 0" <van-toast id="van-toast" />
@click="invalidApply(item)" <van-dialog id="van-dialog" />
>作废</van-button </view>
>
</view>
<Loadmore :state="pageState" />
</scroll-view>
<van-toast id="van-toast" />
<van-dialog id="van-dialog" />
</view>
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
toRef, toRef,
getCurrentInstance, getCurrentInstance,
watch, watch,
computed, computed,
onMounted, onMounted,
inject, inject,
} from "vue"; } from "vue";
import { getStudentLeaveList, invalidReceiptInfo } from "../../api/index"; import {
import Loadmore from "../../components/loadmore.vue"; getStudentLeaveList,
export default { invalidReceiptInfo
components: { } from "../../api/index";
Loadmore, import Loadmore from "../../components/loadmore.vue";
}, export default {
setup() { components: {
let userInfo = uni.getStorageSync("userInfo"); Loadmore,
let Toast = inject("$toast"); },
let Dialog = inject("$dialog"); setup() {
let data = reactive({ let userInfo = uni.getStorageSync("userInfo");
data: [], let Toast = inject("$toast");
pageState: "more", let Dialog = inject("$dialog");
msg: { let data = reactive({
PageIndex: 1, data: [],
PageSize: 10, pageState: "more",
rowsPerPage: 10, msg: {
}, PageIndex: 1,
PageCount: 0, PageSize: 10,
userInfo, rowsPerPage: 10,
timer: null, //防抖 },
}); PageCount: 0,
userInfo,
timer: null, //防抖
});
let methods = { let methods = {
jumpPage(item) { jumpPage(item) {
uni.navigateTo({ uni.navigateTo({
url: url: "/pages/course/askForLeaveDetail?data=" +
"/pages/course/askForLeaveDetail?data=" + encodeURIComponent(JSON.stringify(item)),
encodeURIComponent(JSON.stringify(item)), });
}); },
}, lower(e) {
lower(e) { if (data.msg.PageIndex < data.PageCount) {
if (data.msg.PageIndex < data.PageCount) { data.pageState = "loading";
data.pageState = "loading"; if (data.timer) clearTimeout(data.timer);
data.msg.PageIndex++; data.timer = setTimeout(() => {
if (data.timer) clearTimeout(data.timer); data.msg.PageIndex++;
data.timer = setTimeout(() => { that.getList();
that.getList(); }, 1000);
}, 1000); } else {
} else { data.pageState = "none";
data.pageState = "none"; }
} },
}, reload() {
reload() { data.msg.PageIndex = 1;
data.msg.PageIndex = 1; that.getList();
that.getList(); },
}, async getList() {
async getList() { let res = await getStudentLeaveList(data.msg);
let res = await getStudentLeaveList(data.msg); if (res) {
if (res) { if (data.timer) data.timer = null;
if (data.timer) data.timer = null; data.PageCount = res.Data.PageCount;
data.PageCount = res.Data.PageCount; if (data.msg.PageIndex === 1) {
if (data.msg.PageIndex === 1) { data.data = res.Data.PageData;
data.data = res.Data.PageData; } else {
} else { data.data = [...data.data, ...res.Data.PageData];
data.data = [...res.Data.PageData, ...data.data]; }
} if (data.msg.PageIndex >= res.Data.PageCount) {
if (data.msg.PageIndex >= res.Data.PageCount) { data.pageState = "none";
data.pageState = "none"; } else {
} else { data.pageState = "more";
data.pageState = "more"; }
} }
} },
}, invalidApply(item) {
invalidApply(item) { Dialog.confirm({
Dialog.confirm({ title: "提示信息",
title: "提示信息", message: "是否要作废此申请?",
message: "是否要作废此申请?", })
}) .then(async (e) => {
.then(async (e) => { //确认
//确认 let delMsg = {
let delMsg = { Id: item.Id,
Id: item.Id, };
}; let res = await invalidReceiptInfo(delMsg);
let res = await invalidReceiptInfo(delMsg); if (res) {
if (res) { Toast.success(res.Message);
Toast.success(res.Message); that.reload();
that.reload(); }
} })
}) .catch(() => {
.catch(() => { //取消
//取消 });
}); },
}, };
}; onMounted(() => {
onMounted(() => { that.getList();
that.getList(); console.log("12343434");
console.log("12343434"); });
}); let that = methods;
let that = methods; return {
return { ...toRefs(data),
...toRefs(data), ...methods,
...methods, };
}; },
}, onLoad() {
onLoad() { uni.setNavigationBarTitle({
uni.setNavigationBarTitle({ title: "请假列表",
title: "请假列表", });
}); },
}, };
};
</script> </script>
<style scoped> <style scoped>
.con { .con {
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
font-family: PingFang SC; font-family: PingFang SC;
padding: 30rpx 0; padding: 30rpx 0;
} }
.leave-item {
box-sizing: border-box; .leave-item {
width: 690rpx; box-sizing: border-box;
padding: 20rpx 30rpx; width: 690rpx;
margin: 0 auto; padding: 20rpx 30rpx;
margin-bottom: 30rpx; margin: 0 auto;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2); margin-bottom: 30rpx;
position: relative; box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2);
} position: relative;
.top { }
border-bottom: 1rpx solid #e2e2e2;
padding-bottom: 20rpx; .top {
margin-bottom: 20rpx; border-bottom: 1rpx solid #e2e2e2;
} padding-bottom: 20rpx;
.name { margin-bottom: 20rpx;
font-size: 24rpx; }
font-family: PingFang SC;
font-weight: bold; .name {
color: #111111; font-size: 24rpx;
} font-family: PingFang SC;
.date { font-weight: bold;
font-size: 22rpx; color: #111111;
font-family: PingFang SC; }
font-weight: 500;
color: #999999; .date {
} font-size: 22rpx;
.status { font-family: PingFang SC;
font-size: 24rpx; font-weight: 500;
font-family: PingFang SC; color: #999999;
font-weight: 500; }
color: #00df9f;
} .status {
.status1 { font-size: 24rpx;
color: #ff3816; font-family: PingFang SC;
} font-weight: 500;
.status2 { color: #00df9f;
color: #111111; }
}
.status3 { .status1 {
color: #4fc08d; color: #ff3816;
} }
.label {
font-size: 24rpx; .status2 {
font-family: PingFang SC; color: #111111;
font-weight: 500; }
color: #999999;
margin-right: 30rpx; .status3 {
} color: #4fc08d;
.label-next { }
font-size: 24rpx;
font-family: PingFang SC; .label {
font-weight: 500; font-size: 24rpx;
color: #111111; font-family: PingFang SC;
} font-weight: 500;
.margin-t-b-15 { color: #999999;
margin-top: 15rpx; margin-right: 30rpx;
margin-bottom: 15rpx; }
}
.scroll-box { .label-next {
height: 100%; font-size: 24rpx;
width: 100%; font-family: PingFang SC;
} font-weight: 500;
.invalid-btn { color: #111111;
position: absolute; }
right: 30rpx;
bottom: 20rpx; .margin-t-b-15 {
z-index: 10; margin-top: 15rpx;
} margin-bottom: 15rpx;
}
.scroll-box {
height: 100%;
width: 100%;
}
.invalid-btn {
position: absolute;
right: 30rpx;
bottom: 20rpx;
z-index: 10;
}
</style> </style>
...@@ -140,9 +140,9 @@ export default { ...@@ -140,9 +140,9 @@ export default {
lower(e) { lower(e) {
if (data.msg.PageIndex < data.PageCount) { if (data.msg.PageIndex < data.PageCount) {
data.pageState = "loading"; data.pageState = "loading";
data.msg.PageIndex++;
if (data.timer) clearTimeout(data.timer); if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => { data.timer = setTimeout(() => {
data.msg.PageIndex++;
that.getList(); that.getList();
}, 1000); }, 1000);
} else { } else {
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
if (data.msg.PageIndex === 1) { if (data.msg.PageIndex === 1) {
data.examList = res.Data.PageData; data.examList = res.Data.PageData;
} else { } else {
data.examList = [...res.Data.PageData, ...data.examList]; data.examList = [...data.examList,...res.Data.PageData];
} }
if (data.msg.PageIndex >= res.Data.PageCount) { if (data.msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none"; data.pageState = "none";
......
<template> <template>
<view class=""> <view class="">
<van-toast id="van-toast" /> <van-toast id="van-toast" />
<view class="list-con"> <view class="list-con">
<van-empty description="暂无数据" v-if="dataList.length === 0" /> <van-empty description="暂无数据" v-if="dataList.length === 0" />
<scroll-view <scroll-view :scroll-top="0" scroll-y="true" class="scroll-box" @scrolltolower="lower"
:scroll-top="0" v-if="dataList.length > 0">
scroll-y="true" <view v-for="(item, index) in dataList" :key="index" class="list-item flex flex_between_center"
class="scroll-box" @click="jumpPage(item.Id)">
@scrolltolower="lower" <image class="left" :src="item.Img"></image>
v-if="dataList.length > 0" <view class="right">
> <view class="one_line title">{{ item.Title }}</view>
<view <view class="one_line digest">{{ item.Digest }}</view>
v-for="(item, index) in dataList" </view>
:key="index" </view>
class="list-item flex flex_between_center" <Loadmore :state="pageState" />
@click="jumpPage(item.Id)" </scroll-view>
> </view>
<image class="left" :src="item.Img"></image> </view>
<view class="right">
<view class="one_line title">{{ item.Title }}</view>
<view class="one_line digest">{{ item.Digest }}</view>
</view>
</view>
<Loadmore :state="pageState" />
</scroll-view>
</view>
</view>
</template> </template>
<script> <script>
import { reactive, toRefs, getCurrentInstance, onMounted } from "vue"; import {
import { getLearningGardenList } from "../../api/index"; reactive,
import { debounce } from "../../utils/index"; toRefs,
import Loadmore from "../../components/loadmore.vue"; getCurrentInstance,
export default { onMounted
components: { } from "vue";
Loadmore, import {
}, getLearningGardenList
setup(props, context) { } from "../../api/index";
let data = reactive({ import {
pageTitle: "日语学习园地", debounce
msg: { } from "../../utils/index";
PageIndex: 1, import Loadmore from "../../components/loadmore.vue";
PageSize: 10, export default {
rowsPerPage: 10, components: {
Title: "", Loadmore,
}, },
dataList: [], setup(props, context) {
pageState: "more", let data = reactive({
pageCount: 0, pageTitle: "日语学习园地",
timer: null, //防抖 msg: {
}); PageIndex: 1,
let methods = { PageSize: 10,
back() { rowsPerPage: 10,
uni.navigateBack(); Title: "",
}, },
jumpPage(id) { dataList: [],
uni.navigateTo({ pageState: "more",
url: "/pages/learningGarden/learningGardenDetails?Id=" + id, pageCount: 0,
}); timer: null, //防抖
}, });
async getList() { let methods = {
let res = await getLearningGardenList(data.msg); back() {
if (res) { uni.navigateBack();
if (data.timer) data.timer = null; },
if (data.msg.PageIndex === 1) { jumpPage(id) {
data.dataList = res.Data.PageData; uni.navigateTo({
} else { url: "/pages/learningGarden/learningGardenDetails?Id=" + id,
data.dataList = [...res.Data.PageData, ...data.dataList]; });
} },
data.pageCount = res.Data.PageCount; async getList() {
if (data.msg.PageIndex >= res.Data.PageCount) { let res = await getLearningGardenList(data.msg);
data.pageState = "none"; if (res) {
} else { if (data.timer) data.timer = null;
data.pageState = "more"; if (data.msg.PageIndex === 1) {
} data.dataList = res.Data.PageData;
} } else {
}, data.dataList = [...data.dataList, ...res.Data.PageData];
lower(e) { }
if (data.msg.PageIndex < data.pageCount) { data.pageCount = res.Data.PageCount;
data.pageState = "loading"; if (data.msg.PageIndex >= res.Data.PageCount) {
data.msg.PageIndex++; data.pageState = "none";
if (data.timer) clearTimeout(data.timer); } else {
data.timer = setTimeout(() => { data.pageState = "more";
that.getList(); }
}, 1000); }
} else { },
data.pageState = "none"; lower(e) {
} if (data.msg.PageIndex < data.pageCount) {
}, data.pageState = "loading";
}; if (data.timer) clearTimeout(data.timer);
onMounted(() => { data.timer = setTimeout(() => {
that.getList(); data.msg.PageIndex++;
}); that.getList();
let that = methods; }, 1000);
return { } else {
...toRefs(data), data.pageState = "none";
...methods, }
}; },
}, };
onLoad() { onMounted(() => {
uni.setNavigationBarTitle({ that.getList();
title: this.pageTitle, });
}); let that = methods;
}, return {
}; ...toRefs(data),
...methods,
};
},
onLoad() {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
};
</script> </script>
<style scoped> <style scoped>
.list-con { .list-con {
height: calc(100vh - 20rpx); height: calc(100vh - 20rpx);
box-sizing: border-box; box-sizing: border-box;
padding: 15rpx 30rpx; padding: 15rpx 30rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
.scroll-box {
height: 100%; .scroll-box {
width: 100%; height: 100%;
} width: 100%;
.list-item { }
margin: 20rpx 0;
} .list-item {
.left { margin: 20rpx 0;
width: 220rpx; }
height: 120rpx;
border-radius: 20rpx; .left {
box-shadow: 0rpx 10rpx 30rpx 0rpx rgba(36, 36, 36, 0.2); width: 220rpx;
} height: 120rpx;
.right { border-radius: 20rpx;
width: 440rpx; box-shadow: 0rpx 10rpx 30rpx 0rpx rgba(36, 36, 36, 0.2);
height: 120rpx; }
}
.right .title { .right {
font-size: 30rpx; width: 440rpx;
font-family: PingFang SC; height: 120rpx;
font-weight: bold; }
color: #111111;
line-height: 70rpx; .right .title {
} font-size: 30rpx;
.right .digest { font-family: PingFang SC;
font-size: 24rpx; font-weight: bold;
font-family: PingFang SC; color: #111111;
font-weight: 500; line-height: 70rpx;
color: #999999; }
line-height: 30rpx;
} .right .digest {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
line-height: 30rpx;
}
</style> </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