|
@@ -0,0 +1,157 @@
|
|
|
|
+<script setup>
|
|
|
|
+import { closeToast, showConfirmDialog, showFailToast, showSuccessToast } from 'vant'
|
|
|
|
+const { currentRoute } = useRouter()
|
|
|
|
+const route = currentRoute.value
|
|
|
|
+const xsxk_id = route.query.xsxk_id
|
|
|
|
+
|
|
|
|
+const list = ref([])
|
|
|
|
+const loading = ref(false)
|
|
|
|
+const finished = ref(false)
|
|
|
|
+let page = 1
|
|
|
|
+const param = $ref({
|
|
|
|
+ keyword: "",
|
|
|
|
+ grade_id: "",
|
|
|
|
+ class_id: "",
|
|
|
|
+});
|
|
|
|
+function onLoad() {
|
|
|
|
+ loading.value = true
|
|
|
|
+ request({
|
|
|
|
+ url: '/xdjx/stxkgl_xktj_xkqk/index',
|
|
|
|
+ data: {
|
|
|
|
+ page,
|
|
|
|
+ limit: 20,
|
|
|
|
+ xsxk_id,
|
|
|
|
+ ...param,
|
|
|
|
+ },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ const data = res.data
|
|
|
|
+ list.value = [...list.value, ...data.page_data]
|
|
|
|
+ finished.value = data.total_page === page
|
|
|
|
+ page++
|
|
|
|
+ loading.value = false
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function onClickSearch() {
|
|
|
|
+ reGetList()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function dropGradeChange() {
|
|
|
|
+ param.class_id = "";
|
|
|
|
+ initClass();
|
|
|
|
+
|
|
|
|
+ dropItemChange();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function dropItemChange() {
|
|
|
|
+ reGetList()
|
|
|
|
+}
|
|
|
|
+function reGetList() {
|
|
|
|
+ page = 1
|
|
|
|
+ list.value = []
|
|
|
|
+ finished.value = false
|
|
|
|
+ onLoad()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const gradeOption = $ref([{ text: '年级', value: '' }])
|
|
|
|
+initSelectData();
|
|
|
|
+async function initSelectData() {
|
|
|
|
+ let res = await request({ url: '/jcxx/grade/index', data: { limit: '999' } });
|
|
|
|
+ if (res.code == 1) {
|
|
|
|
+ res.data.page_data.map(item => {
|
|
|
|
+ gradeOption.push({
|
|
|
|
+ text: item.grade_name,
|
|
|
|
+ value: item.grade_id
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+let classOption = $ref([{ text: '班级', value: '' }])
|
|
|
|
+async function initClass() {
|
|
|
|
+ if (!param.grade_id)
|
|
|
|
+ return
|
|
|
|
+
|
|
|
|
+ let res = await request({
|
|
|
|
+ url: "/jcxx/class/index",
|
|
|
|
+ data: { grade_id: param.grade_id, limit: "100" },
|
|
|
|
+ });
|
|
|
|
+ if (res.code == 1) {
|
|
|
|
+ classOption = [{ text: '班级', value: '' }];
|
|
|
|
+ res.data.page_data.map(item => {
|
|
|
|
+ classOption.push({
|
|
|
|
+ text: item.class_name,
|
|
|
|
+ value: item.class_num
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const dialogVisible = ref(false)
|
|
|
|
+
|
|
|
|
+function beforeCloseDialog(action) {
|
|
|
|
+ if (action == 'confirm') {
|
|
|
|
+ showFailToast('请输入必填项!')
|
|
|
|
+ return
|
|
|
|
+ // if (dialogType.value != 1) {
|
|
|
|
+ // if (currentData.value.lc_bt == 1 && currentData.value.xmlc_bt_value == '') {
|
|
|
|
+ // showFailToast('请输入必填项!')
|
|
|
|
+ // return false
|
|
|
|
+ // }
|
|
|
|
+ // handleClose()
|
|
|
|
+ // } else {
|
|
|
|
+ // handleUpload()
|
|
|
|
+ // }
|
|
|
|
+ } else {
|
|
|
|
+ handleClose()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function handleClose() {
|
|
|
|
+ dialogVisible.value = false;
|
|
|
|
+ // currentData.value = {}
|
|
|
|
+ // dialogType.value = ''
|
|
|
|
+ // dialogTitle.value = ''
|
|
|
|
+ // fileData.value = []
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<template>
|
|
|
|
+ <div class="index">
|
|
|
|
+ <van-search v-model="param.keyword" :clearable="false" show-action placeholder="请输入搜索关键词" @search="onClickSearch">
|
|
|
|
+ <template #action>
|
|
|
|
+ <div @click="onClickSearch">
|
|
|
|
+ 搜索
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </van-search>
|
|
|
|
+ <van-dropdown-menu>
|
|
|
|
+ <van-dropdown-item v-model="param.grade_id" :options="gradeOption" @change="dropGradeChange" />
|
|
|
|
+ <van-dropdown-item v-model="param.class_id" :options="classOption" @change="dropItemChange" />
|
|
|
|
+ </van-dropdown-menu>
|
|
|
|
+ <van-cell style="padding-top: 0 !important;">
|
|
|
|
+ <van-button class="w-full" size="small" type="primary" @click="dialogVisible=true">新增</van-button>
|
|
|
|
+ </van-cell>
|
|
|
|
+ <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
|
|
|
+ <van-cell v-for="item in list" :key="item">
|
|
|
|
+ <template #title>
|
|
|
|
+ <span>{{ `${item.xsxx_xsxm}` }}</span>
|
|
|
|
+ <span class="text-12px ml-15px">学籍号:{{ `${item.xsxx_xsxh}` }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <template #label>
|
|
|
|
+ <div class="flex text-black space-x-15px">
|
|
|
|
+ <div><span>年级:{{ item.grade_name }}</span></div>
|
|
|
|
+ <div><span>班级:{{ item.class_name }}</span></div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </van-cell>
|
|
|
|
+ </van-list>
|
|
|
|
+
|
|
|
|
+ <van-dialog v-model:show="dialogVisible" title="课程报名" show-cancel-button :before-close="beforeCloseDialog">
|
|
|
|
+ 888
|
|
|
|
+ </van-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+</style>
|