|
@@ -3,25 +3,31 @@
|
|
|
<u-navbar title="请假条详情"></u-navbar>
|
|
|
<view class="head">
|
|
|
<view class="photo">
|
|
|
- <img src="../../../assets/img/photo2.png" alt="">
|
|
|
+ <u-avatar class="avatar" mode="square"
|
|
|
+ :src="leaveDetail.headPhoto != null ? leaveDetail.headPhoto : '../../assets/img/head.png'" size="84">
|
|
|
+ </u-avatar>
|
|
|
</view>
|
|
|
<view class="title">
|
|
|
- 周梓轩的请假条
|
|
|
+ {{leaveDetail.studentName}}的请假条
|
|
|
</view>
|
|
|
- <view class="state">
|
|
|
- 待查收
|
|
|
+ <view class="state1" v-if="leaveDetail.status == 0">
|
|
|
+ 待处理
|
|
|
+ </view>
|
|
|
+ <view class="state2" v-if="leaveDetail.status == 1">
|
|
|
+ 已审核
|
|
|
+ </view>
|
|
|
+ <view class="state3" v-if="leaveDetail.status == -1">
|
|
|
+ 已取消
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
<view class="main">
|
|
|
<view class="item">
|
|
|
<view class="title">
|
|
|
所属班级
|
|
|
</view>
|
|
|
<view class="value">
|
|
|
- 郭健康毛笔楷书班
|
|
|
+ {{leaveDetail.className}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="item">
|
|
@@ -29,7 +35,7 @@
|
|
|
请假日期
|
|
|
</view>
|
|
|
<view class="value">
|
|
|
- 2023-01-03
|
|
|
+ {{leaveDetail.courseDate}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="item">
|
|
@@ -37,7 +43,7 @@
|
|
|
请假课次
|
|
|
</view>
|
|
|
<view class="value">
|
|
|
- 第20节
|
|
|
+ {{leaveDetail.coursePeriods}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="item">
|
|
@@ -45,7 +51,7 @@
|
|
|
授课老师
|
|
|
</view>
|
|
|
<view class="value">
|
|
|
- 郭健康
|
|
|
+ {{leaveDetail.teacherName}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="reason">
|
|
@@ -53,116 +59,243 @@
|
|
|
请假事由
|
|
|
</view>
|
|
|
<view class="value">
|
|
|
- 阳了!
|
|
|
+ {{leaveDetail.leaveReason}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="accessory">
|
|
|
+ <!-- <view class="accessory">
|
|
|
<view class="title">
|
|
|
图片附件
|
|
|
</view>
|
|
|
<view class="value">
|
|
|
<img src="../../../assets/img/reason.png" alt="">
|
|
|
</view>
|
|
|
- </view>
|
|
|
-
|
|
|
+ </view> -->
|
|
|
+
|
|
|
<view class="item">
|
|
|
- <view class="title">
|
|
|
- 提交时间
|
|
|
- </view>
|
|
|
- <view class="value">
|
|
|
- 2023-01-01 18:00
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view class="title">
|
|
|
+ 提交时间
|
|
|
+ </view>
|
|
|
+ <view class="value">
|
|
|
+ {{leaveDetail.createTime}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="btn">
|
|
|
+ <button @click="leaveCancel" v-if="leaveDetail.status == 0">撤销</button>
|
|
|
+ <button style="background-color: #DBDBDB" v-if="leaveDetail.status == -1" disabled>已撤销</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as sickNoteApi from '@/apis/parents/sickNote.js'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ leaveId: '',
|
|
|
+ leaveDetail: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad(op) {
|
|
|
+ if (op.id) {
|
|
|
+ this.leaveId = op.id;
|
|
|
+ this.getLeaveDetail();
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ leaveCancel() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ sickNoteApi.cancelStudentLeaveLog({
|
|
|
+ leaveId: this.leaveId
|
|
|
+ }).then((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.navigateBack({
|
|
|
+
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getLeaveDetail() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ sickNoteApi.getStudentLeaveLog({
|
|
|
+ leaveId: this.leaveId
|
|
|
+ }).then((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.leaveDetail = res.data;
|
|
|
+ this.leaveDetail.createTime = this.getFormatDate(res.data.createTime);
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getFormatDate(val) {
|
|
|
+ let date = new Date(val);
|
|
|
+ let myyear = date.getFullYear();
|
|
|
+ let mymonth = date.getMonth() + 1;
|
|
|
+ let myweekday = date.getDate();
|
|
|
+ let hour = date.getHours();
|
|
|
+ let minute = date.getMinutes();
|
|
|
+ let second = date.getSeconds();
|
|
|
+ if (mymonth < 10) {
|
|
|
+ mymonth = '0' + mymonth;
|
|
|
+ }
|
|
|
+ if (myweekday < 10) {
|
|
|
+ myweekday = '0' + myweekday;
|
|
|
+ }
|
|
|
+ if(hour < 10) {
|
|
|
+ hour = '0' + hour;
|
|
|
+ }
|
|
|
+ if(minute < 10) {
|
|
|
+ minute = '0' + minute;
|
|
|
+ }
|
|
|
+ if(second < 10) {
|
|
|
+ second = '0' + second;
|
|
|
+ }
|
|
|
|
|
|
+ return (myyear + '-' + mymonth + '-' + myweekday + ' ' + hour + ':' + minute + ':' + second);
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .head{
|
|
|
+ .head {
|
|
|
margin: 12px 16px;
|
|
|
padding: 12px;
|
|
|
border-radius: 12px;
|
|
|
background-color: rgba(255, 255, 255, 1);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- .photo{
|
|
|
+
|
|
|
+ .photo {
|
|
|
width: 84rpx;
|
|
|
height: 84rpx;
|
|
|
border-radius: 4px;
|
|
|
overflow: hidden;
|
|
|
- img{
|
|
|
+
|
|
|
+ img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
- .title{
|
|
|
+
|
|
|
+ .title {
|
|
|
color: rgba(51, 51, 51, 1);
|
|
|
font-size: 16px;
|
|
|
font-weight: bold;
|
|
|
margin-left: 24rpx;
|
|
|
}
|
|
|
- .state{
|
|
|
+
|
|
|
+ .state1 {
|
|
|
+ margin-left: auto;
|
|
|
+ border-radius: 50px;
|
|
|
+ background-color: rgba(255, 255, 255, 1);
|
|
|
+ color: rgba(22, 119, 255, 1);
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: center;
|
|
|
+ border: 1px solid 1px solid rgba(22, 119, 255, 1);
|
|
|
+ padding: 7rpx 26rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .state2 {
|
|
|
+ margin-left: auto;
|
|
|
+ border-radius: 50px;
|
|
|
+ background-color: rgba(255, 255, 255, 1);
|
|
|
+ color: rgba(0, 187, 170, 1);
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: center;
|
|
|
+ border: 1px solid rgba(0, 187, 170, 1);
|
|
|
+ padding: 7rpx 26rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .state3 {
|
|
|
margin-left: auto;
|
|
|
border-radius: 50px;
|
|
|
background-color: rgba(255, 255, 255, 1);
|
|
|
- color: rgba(13, 186, 199, 1);
|
|
|
+ color: rgba(153, 153, 153, 1);
|
|
|
font-size: 12px;
|
|
|
text-align: center;
|
|
|
- border: 1px solid rgba(13, 186, 199, 1);
|
|
|
+ border: 1px solid 1px solid rgba(153, 153, 153, 1);
|
|
|
padding: 7rpx 26rpx;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .main{
|
|
|
- border-radius: 12px;
|
|
|
- background-color: #fff;
|
|
|
- margin: 0 16px;
|
|
|
- .item{
|
|
|
- padding: 11px 15px 14px 15px;
|
|
|
- border-bottom: 1px solid rgba(244, 244, 244, 1);
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- .title{
|
|
|
- color: rgba(119, 119, 119, 1);
|
|
|
- }
|
|
|
- .value{
|
|
|
- color: rgba(51, 51, 51, 1);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .reason,.accessory{
|
|
|
- padding: 11px 15px;
|
|
|
- border-bottom: 1px solid rgba(244, 244, 244, 1);
|
|
|
- .title{
|
|
|
- color: rgba(119, 119, 119, 1);
|
|
|
- }
|
|
|
- .value{
|
|
|
- margin-top: 8px;
|
|
|
- color: rgba(51, 51, 51, 1);
|
|
|
- img{
|
|
|
- width: 120rpx;
|
|
|
- height: 120rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .accessory{
|
|
|
- .value{
|
|
|
- margin-top: 12px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ .main {
|
|
|
+ border-radius: 12px;
|
|
|
+ background-color: #fff;
|
|
|
+ margin: 0 16px;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ padding: 11px 15px 14px 15px;
|
|
|
+ border-bottom: 1px solid rgba(244, 244, 244, 1);
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ color: rgba(119, 119, 119, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ .value {
|
|
|
+ color: rgba(51, 51, 51, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .reason,
|
|
|
+ .accessory {
|
|
|
+ padding: 11px 15px;
|
|
|
+ border-bottom: 1px solid rgba(244, 244, 244, 1);
|
|
|
+
|
|
|
+ .title {
|
|
|
+ color: rgba(119, 119, 119, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ .value {
|
|
|
+ margin-top: 8px;
|
|
|
+ color: rgba(51, 51, 51, 1);
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 120rpx;
|
|
|
+ height: 120rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .accessory {
|
|
|
+ .value {
|
|
|
+ margin-top: 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn {
|
|
|
+ position: fixed;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ padding: 10px 12px;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ button {
|
|
|
+ border-radius: 50px;
|
|
|
+ background-color: rgba(13, 186, 199, 1);
|
|
|
+ color: rgba(255, 255, 255, 1);
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|