|
@@ -0,0 +1,372 @@
|
|
|
+<script setup>
|
|
|
+import { userInfo } from "~/store/user";
|
|
|
+const router = useRouter();
|
|
|
+const { uo_type, uo_name } = userInfo;
|
|
|
+const { currentRoute } = useRouter();
|
|
|
+const route = currentRoute.value;
|
|
|
+const grade_id = route.query.grade_id;
|
|
|
+const class_id = route.query.class_id;
|
|
|
+const isBureau = ref(false); // 当前用户是否局端
|
|
|
+isBureau.value = uo_type === "1";
|
|
|
+const list = ref([]);
|
|
|
+const loading = ref(false);
|
|
|
+const finished = ref(false);
|
|
|
+let page = 1;
|
|
|
+const firstForm = $ref({
|
|
|
+ xsxm: "",
|
|
|
+ xsxh: "",
|
|
|
+ tjjg: "",
|
|
|
+ tjlx: "",
|
|
|
+ time: "",
|
|
|
+});
|
|
|
+function getTimeFormat() {
|
|
|
+ var date = new Date();
|
|
|
+ var month = date.getMonth() + 1;
|
|
|
+ var strDate = date.getDate();
|
|
|
+ if (month >= 1 && month <= 9) {
|
|
|
+ month = "0" + month;
|
|
|
+ }
|
|
|
+ if (strDate >= 0 && strDate <= 9) {
|
|
|
+ strDate = "0" + strDate;
|
|
|
+ }
|
|
|
+ let time = [
|
|
|
+ date.getFullYear() + "-" + month + "-" + strDate,
|
|
|
+ date.getFullYear() + "-" + month + "-" + strDate,
|
|
|
+ ];
|
|
|
+ firstForm.time = time[0] + " - " + time[1];
|
|
|
+ console.log(firstForm.time);
|
|
|
+}
|
|
|
+getTimeFormat();
|
|
|
+function onLoad() {
|
|
|
+ loading.value = true;
|
|
|
+ request({
|
|
|
+ url: "/xddy/dygl_cjxt_tjdj/index",
|
|
|
+ data: {
|
|
|
+ page,
|
|
|
+ limit: 20,
|
|
|
+ grade_id: grade_id,
|
|
|
+ class_id: class_id,
|
|
|
+ xdct_xsxm: firstForm.xsxm,
|
|
|
+ xdct_xsxh: firstForm.xsxh,
|
|
|
+ xdct_tjjg: firstForm.tjjg,
|
|
|
+ xdct_xslx: firstForm.tjlx,
|
|
|
+ xdct_tjrq: firstForm.time,
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ const data = res.data;
|
|
|
+ list.value = [...list.value, ...data.page_data];
|
|
|
+ finished.value = data.total_page === page;
|
|
|
+ page++;
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+const resultOption = $ref([
|
|
|
+ { text: "结果", value: "" },
|
|
|
+ {
|
|
|
+ text: "良好",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "及格",
|
|
|
+ value: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "异常",
|
|
|
+ value: 3,
|
|
|
+ },
|
|
|
+]);
|
|
|
+const typeOption = $ref([
|
|
|
+ { text: "类别", value: "" },
|
|
|
+
|
|
|
+ {
|
|
|
+ text: "晨检",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "午检",
|
|
|
+ value: 2,
|
|
|
+ },
|
|
|
+]);
|
|
|
+
|
|
|
+const date = ref("");
|
|
|
+const show = ref(false);
|
|
|
+const formatDate = (date) =>
|
|
|
+ `${date.getFullYear()}-${
|
|
|
+ date.getMonth() + 1 >= 1 && date.getMonth() + 1 <= 9
|
|
|
+ ? "0" + (date.getMonth() + 1)
|
|
|
+ : date.getMonth() + 1
|
|
|
+ }-${
|
|
|
+ date.getDate() >= 0 && date.getDate() <= 9
|
|
|
+ ? "0" + date.getDate()
|
|
|
+ : date.getDate()
|
|
|
+ }`;
|
|
|
+const onConfirm = (values) => {
|
|
|
+ const [start, end] = values;
|
|
|
+ show.value = false;
|
|
|
+ firstForm.time = `${formatDate(start)} - ${formatDate(end)}`;
|
|
|
+ console.log(firstForm.time, typeof firstForm.time, " firstForm.time ");
|
|
|
+ dropItemChange();
|
|
|
+};
|
|
|
+const minDate = new Date(2010, 0, 1);
|
|
|
+const maxDate = new Date(2010, 0, 31);
|
|
|
+function dropItemChange() {
|
|
|
+ page = 1;
|
|
|
+ list.value = [];
|
|
|
+ finished.value = false;
|
|
|
+ onLoad();
|
|
|
+}
|
|
|
+function onClickSearch() {
|
|
|
+ dropItemChange();
|
|
|
+}
|
|
|
+let checkForm = $ref({
|
|
|
+ xdct_id: "",
|
|
|
+ xdct_xslx: 1,
|
|
|
+ grade_id: "",
|
|
|
+ grade_name: "",
|
|
|
+ class_id: "",
|
|
|
+ class_name: "",
|
|
|
+ xdct_xsxm: "",
|
|
|
+ xdct_xsxh: "",
|
|
|
+ xdct_sffb: "",
|
|
|
+ xdct_tjxx_tl: "",
|
|
|
+ xdct_tjxx_sg: "",
|
|
|
+ xdct_tjxx_tz: "",
|
|
|
+ xdct_tjxx_xw: "",
|
|
|
+ xdct_tjxx_fhl: "",
|
|
|
+ xdct_tjxx_xy: "",
|
|
|
+ xdct_tjxx_mb: "",
|
|
|
+ xdct_tjxx_sl: "",
|
|
|
+ xdct_qtzz: "",
|
|
|
+});
|
|
|
+let dialogShow = $ref(false);
|
|
|
+function checkPop(item) {
|
|
|
+ dialogShow = true;
|
|
|
+ checkForm = {
|
|
|
+ xdct_id: item.xdct_id,
|
|
|
+ xdct_xslx: Number(item.xdct_xslx_option_k),
|
|
|
+ grade_id: item.grade_id,
|
|
|
+ grade_name: item.grade_name,
|
|
|
+ class_id: item.class_id,
|
|
|
+ class_name: item.class_name,
|
|
|
+ xdct_xsxm: item.xdct_xsxm,
|
|
|
+ xdct_xsxh: item.xdct_xsxh,
|
|
|
+ xdct_sffb: Number(item.xdct_sffb_option_k),
|
|
|
+ xdct_tjxx_tl: item.xdct_tjxx_tl,
|
|
|
+ xdct_tjxx_sg: item.xdct_tjxx_sg,
|
|
|
+ xdct_tjxx_tz: item.xdct_tjxx_tz,
|
|
|
+ xdct_tjxx_xw: item.xdct_tjxx_xw,
|
|
|
+ xdct_tjxx_fhl: item.xdct_tjxx_fhl,
|
|
|
+ xdct_tjxx_xy: item.xdct_tjxx_xy,
|
|
|
+ xdct_tjxx_mb: item.xdct_tjxx_mb,
|
|
|
+ xdct_tjxx_sl: item.xdct_tjxx_sl,
|
|
|
+ xdct_qtzz: item.xdct_qtzz,
|
|
|
+ };
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="index">
|
|
|
+ <div class="flex">
|
|
|
+ <van-search
|
|
|
+ v-model="firstForm.xsxm"
|
|
|
+ :clearable="false"
|
|
|
+ show-action
|
|
|
+ placeholder="请输入学生姓名"
|
|
|
+ @search="onClickSearch"
|
|
|
+ >
|
|
|
+ <template #action>
|
|
|
+ <!-- <div @click="onClickSearch"></div> -->
|
|
|
+ </template>
|
|
|
+ </van-search>
|
|
|
+ <van-search
|
|
|
+ v-model="firstForm.xsxh"
|
|
|
+ :clearable="false"
|
|
|
+ show-action
|
|
|
+ placeholder="请输入姓名"
|
|
|
+ @search="onClickSearch"
|
|
|
+ >
|
|
|
+ <template #action>
|
|
|
+ <div @click="onClickSearch">搜索</div>
|
|
|
+ </template>
|
|
|
+ </van-search>
|
|
|
+ </div>
|
|
|
+ <div class="flex">
|
|
|
+ <van-dropdown-menu>
|
|
|
+ <van-dropdown-item
|
|
|
+ v-model="firstForm.tjjg"
|
|
|
+ :options="resultOption"
|
|
|
+ @change="dropItemChange"
|
|
|
+ />
|
|
|
+ <van-dropdown-item
|
|
|
+ v-model="firstForm.tjlx"
|
|
|
+ :options="typeOption"
|
|
|
+ @change="dropItemChange"
|
|
|
+ />
|
|
|
+ </van-dropdown-menu>
|
|
|
+
|
|
|
+ <van-cell
|
|
|
+ class="dateSearch"
|
|
|
+ title="日期:"
|
|
|
+ :value="firstForm.time"
|
|
|
+ @click="show = true"
|
|
|
+ /><van-calendar
|
|
|
+ v-model:show="show"
|
|
|
+ type="range"
|
|
|
+ :min-date="new Date('1970/01/01')"
|
|
|
+ :max-date="new Date('2099/01/31')"
|
|
|
+ @confirm="onConfirm"
|
|
|
+ allow-same-day
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <van-button class="w-full" type="primary" size="large">一键签到</van-button>
|
|
|
+ <van-list
|
|
|
+ v-model:loading="loading"
|
|
|
+ :finished="finished"
|
|
|
+ finished-text="没有更多了"
|
|
|
+ @load="onLoad"
|
|
|
+ >
|
|
|
+ <van-cell v-for="item in list" :key="item">
|
|
|
+ <template #title>
|
|
|
+ <div
|
|
|
+ style="display: flex; justify-content: space-between; color: black"
|
|
|
+ >
|
|
|
+ <span>{{
|
|
|
+ `${item.xdct_xslx}\u00A0\u00A0\u00A0\u00A0\u00A0${item.class_name}\u00A0\u00A0\u00A0\u00A0\u00A0${item.xdct_tjrq}`
|
|
|
+ }}</span>
|
|
|
+ <span style="color: #4351ff" @click="checkPop(item)">体检登记</span>
|
|
|
+ <span style="color: #4351ff" v-if="item.xdct_sfqd_option_k != 1"
|
|
|
+ >签到</span
|
|
|
+ >
|
|
|
+ <span style="color: #c0c4cc" v-else disabled>已签</span>
|
|
|
+ <!-- <van-button
|
|
|
+ class="w-66px "
|
|
|
+
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="handleAudit(item.xm_id)"
|
|
|
+ >体检登记</van-button
|
|
|
+ >
|
|
|
+ <van-button
|
|
|
+ class="w-45px "
|
|
|
+
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="handleAudit(item.xm_id)"
|
|
|
+ >签到</van-button
|
|
|
+ > -->
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #label>
|
|
|
+ <div>
|
|
|
+ <span class="mr-50px">{{ item.xdct_xsxm }}</span>
|
|
|
+ <span>{{ item.xdct_xsxh }} </span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="display: flex; justify-content: space-between; color: black"
|
|
|
+ >
|
|
|
+ <span>性别:{{ item.xdct_xsxb }}</span>
|
|
|
+ <span> 年龄:{{ item.xdct_nl }} </span>
|
|
|
+ <span
|
|
|
+ >体检结果:
|
|
|
+ <span v-if="item.xdct_tjjg_option_k == 0">--</span>
|
|
|
+ <span v-if="item.xdct_tjjg_option_k == 1">良好</span>
|
|
|
+ <span v-if="item.xdct_tjjg_option_k == 2">及格</span>
|
|
|
+ <span v-if="item.xdct_tjjg_option_k == 3" class="color-red"
|
|
|
+ >异常</span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-list>
|
|
|
+ </div>
|
|
|
+ <van-dialog
|
|
|
+ v-model:show="dialogShow"
|
|
|
+ title="体检登记"
|
|
|
+ show-cancel-button
|
|
|
+ :before-close="onBeforeClose"
|
|
|
+ >
|
|
|
+ <van-radio-group class="mb-10px mt-20px" v-model="checkForm.xdct_xslx" direction="horizontal">
|
|
|
+ <span class="ml-30px ">体检类型:</span>
|
|
|
+ <van-radio name="1" icon-size="16px">晨检</van-radio>
|
|
|
+ <van-radio name="2" icon-size="16px">午检</van-radio>
|
|
|
+ </van-radio-group>
|
|
|
+ <van-cell-group inset>
|
|
|
+ <van-field
|
|
|
+ v-model="checkForm.xdct_xsxm"
|
|
|
+ label="学生姓名"
|
|
|
+ size="large"
|
|
|
+ placeholder="请输入学生姓名"
|
|
|
+ />
|
|
|
+ <van-field v-model="checkForm.xdct_xsxh" size="large" label="学籍号" placeholder="请输入学籍号" />
|
|
|
+ <van-field
|
|
|
+ v-model="checkForm.xdct_tjxx_sg"
|
|
|
+ size="large"
|
|
|
+ label="身高"
|
|
|
+ placeholder="请输入身高"
|
|
|
+ /><van-field
|
|
|
+ v-model="checkForm.xdct_tjxx_tz"
|
|
|
+ size="large"
|
|
|
+ label="体重"
|
|
|
+ placeholder="请输入体重"
|
|
|
+ /><van-field
|
|
|
+ v-model="checkForm.xdct_tjxx_xw"
|
|
|
+ size="large"
|
|
|
+ label="胸围"
|
|
|
+ placeholder="请输入胸围"
|
|
|
+ /><van-field v-model="checkForm.xdct_tjxx_fhl" label="肺活量" placeholder="请输入肺活量" />
|
|
|
+ <van-field
|
|
|
+ v-model="checkForm.xdct_tjxx_xy"
|
|
|
+ label="血压"
|
|
|
+ size="large"
|
|
|
+ placeholder="请输入血压"
|
|
|
+ /><van-field
|
|
|
+ size="large"
|
|
|
+ v-model="checkForm.xdct_tjxx_mb"
|
|
|
+ label="脉搏"
|
|
|
+ placeholder="请输入脉搏"
|
|
|
+ /><van-field
|
|
|
+ v-model="checkForm.xdct_tjxx_sl"
|
|
|
+ size="large"
|
|
|
+ label="视力"
|
|
|
+ placeholder="请输入视力"
|
|
|
+ /><van-field v-model="checkForm.xdct_tjxx_tl" size="large" label="听力" placeholder="请输入听力" />
|
|
|
+ </van-cell-group>
|
|
|
+ <van-radio-group v-model="checkForm.xdct_sffb" direction="horizontal">
|
|
|
+ <span class="ml-30px">是否发病:</span>
|
|
|
+ <van-radio name="1" icon-size="16px">是</van-radio>
|
|
|
+ <van-radio name="2" icon-size="16px">否</van-radio>
|
|
|
+ </van-radio-group>
|
|
|
+ </van-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.search {
|
|
|
+ box-shadow: 0 0.05333rem 0.32rem rgba(100, 101, 102, 0.12);
|
|
|
+}
|
|
|
+:deep(.van-dropdown-menu) {
|
|
|
+ width: 70%;
|
|
|
+}
|
|
|
+:deep(.van-dropdown-menu__item) {
|
|
|
+ flex: none;
|
|
|
+ padding: 0 10px;
|
|
|
+}
|
|
|
+::v-deep .dateSearch {
|
|
|
+ font-size: 15.4px;
|
|
|
+ padding: 10.4px 5px;
|
|
|
+}
|
|
|
+::v-deep .dateSearch .van-cell__title {
|
|
|
+ width: 20%;
|
|
|
+ flex: auto;
|
|
|
+}
|
|
|
+::v-deep .dateSearch .van-cell__value {
|
|
|
+ width: 80%;
|
|
|
+ font-size: 13px;
|
|
|
+ flex: auto;
|
|
|
+}
|
|
|
+::v-deep .van-radio-group {
|
|
|
+display: flex;
|
|
|
+}
|
|
|
+</style>
|