|
@@ -1,20 +1,110 @@
|
|
|
import OHeader from '@/components/o-header'
|
|
|
import OSticky from '@/components/o-sticky'
|
|
|
-import { Tabs, Tab } from 'vant'
|
|
|
-import { defineComponent, reactive, ref } from 'vue'
|
|
|
-import styles from './index.module.less'
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
-
|
|
|
+import { Tabs, Tab, showToast, Icon, Field, Button } from 'vant'
|
|
|
+import { defineComponent, onMounted, reactive, ref } from 'vue'
|
|
|
+import styles from './student-leave.module.less'
|
|
|
+import { useRouter, useRoute } from 'vue-router'
|
|
|
+import request from '@/helpers/request'
|
|
|
+import ApprovalItem from './approval-item'
|
|
|
+import cardICon from '../images/card-icon.png'
|
|
|
+import dateICon from '../images/date-icon.png'
|
|
|
+import eiditICon from '../images/eidit-icon.png'
|
|
|
+import questICon from '../images/quest-icon.png'
|
|
|
+import StudentCourseItem from './student-course-item'
|
|
|
const activeName = ref('wait')
|
|
|
+const item = ref({} as any)
|
|
|
+const courseScheduleList = ref([] as any)
|
|
|
export default defineComponent({
|
|
|
name: 'approval-manage',
|
|
|
setup() {
|
|
|
const router = useRouter()
|
|
|
+ const route = useRoute()
|
|
|
const state = reactive({})
|
|
|
|
|
|
+ const getLeaveDetail = async () => {
|
|
|
+ try {
|
|
|
+ const { data } = await request.get(
|
|
|
+ `/api-school/userLeaveRecord/detail/${route.query.id}`,
|
|
|
+ {}
|
|
|
+ )
|
|
|
+ item.value = data
|
|
|
+ courseScheduleList.value = data.courseScheduleList || []
|
|
|
+ } catch (e: any) {
|
|
|
+ // console.log(e, 'e')
|
|
|
+ const message = e.message
|
|
|
+ showToast(message)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ onMounted(() => {
|
|
|
+ getLeaveDetail()
|
|
|
+ })
|
|
|
return () => (
|
|
|
<>
|
|
|
- <div></div>
|
|
|
+ <div class={styles.leaveWrap}>
|
|
|
+ <OSticky>
|
|
|
+ <OHeader isBack={true}></OHeader>
|
|
|
+ </OSticky>
|
|
|
+ <ApprovalItem item={item.value} type="doing"></ApprovalItem>
|
|
|
+ <div class={styles.leaveInfo}>
|
|
|
+ <p class={styles.subTitle}>
|
|
|
+ <Icon class={styles.subTitleIcon} name={dateICon}></Icon>
|
|
|
+ <span>请假日期</span>
|
|
|
+ </p>
|
|
|
+ <p class={styles.leaveDate}>2022-10-25 - 2022-10-28</p>
|
|
|
+ <p class={styles.subTitle}>
|
|
|
+ <Icon class={styles.subTitleIcon} name={questICon}></Icon>
|
|
|
+ <span>请假原因</span>
|
|
|
+ </p>
|
|
|
+ <p class={styles.leaveReason}>请假</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={styles.courseWrap}>
|
|
|
+ <div class={styles.courseWrapTitlte}>
|
|
|
+ {' '}
|
|
|
+ <p class={styles.subTitle}>
|
|
|
+ <Icon class={styles.subTitleIcon} name={cardICon}></Icon>
|
|
|
+ <span>涉及课程</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={styles.courseList}>
|
|
|
+ {courseScheduleList.value.map((item) => (
|
|
|
+ <StudentCourseItem item={item}></StudentCourseItem>
|
|
|
+ ))}
|
|
|
+ {/* {item.value?.courseScheduleList} */}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={styles.reasonWrap}>
|
|
|
+ <Field
|
|
|
+ label-align="top"
|
|
|
+ maxlength={400}
|
|
|
+ autosize
|
|
|
+ type="textarea"
|
|
|
+ rows={5}
|
|
|
+ placeholder="请输入你的审批意见"
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ label: () => (
|
|
|
+ <div>
|
|
|
+ <div class={styles.reasonLabelLeft}>
|
|
|
+ {' '}
|
|
|
+ <Icon class={styles.bottomIcon} name={eiditICon}></Icon> <span>意见审批</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </Field>
|
|
|
+ </div>
|
|
|
+ <div class={['btnGroup btnMore', styles.btnWrap]}>
|
|
|
+ <Button color="#ccc" class={styles.unpassBtn}>
|
|
|
+ 拒绝
|
|
|
+ </Button>
|
|
|
+ <Button color="#FF8057" class={styles.unpassBtn}>
|
|
|
+ 通过
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</>
|
|
|
)
|
|
|
}
|