fix: 淇 classroomhygienedaily form.vue 涓殑瀵煎叆璺緞
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
:validate-on-rule-change="false"
|
:validate-on-rule-change="false"
|
||||||
v-loading="loading">
|
v-loading="loading">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<!-- 编辑时显示学院 -->
|
<!-- 编辑时显示学<EFBFBD><EFBFBD>?-->
|
||||||
|
|
||||||
<el-col :span="12" class="mb20">
|
<el-col :span="12" class="mb20">
|
||||||
<el-form-item label="班号" prop="classCode">
|
<el-form-item label="班号" prop="classCode">
|
||||||
@@ -34,11 +34,11 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12" class="mb20">
|
<el-col :span="12" class="mb20">
|
||||||
<el-form-item label="检查日期" prop="recordDate">
|
<el-form-item label="检查日<EFBFBD><EFBFBD>? prop="recordDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.recordDate"
|
v-model="form.recordDate"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择检查日期"
|
placeholder="选择检查日<EFBFBD><EFBFBD>?
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
style="width: 100%" />
|
style="width: 100%" />
|
||||||
@@ -52,18 +52,18 @@
|
|||||||
:precision="0"
|
:precision="0"
|
||||||
:step="1"
|
:step="1"
|
||||||
:min="0"
|
:min="0"
|
||||||
placeholder="请输入扣分"
|
placeholder="请输入扣<EFBFBD><EFBFBD>?
|
||||||
style="width: 100%" />
|
style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="检查记录" prop="note">
|
<el-form-item label="检查记<EFBFBD><EFBFBD>? prop="note">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.note"
|
v-model="form.note"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rows="4"
|
:rows="4"
|
||||||
placeholder="请输入检查记录"
|
placeholder="请输入检查记<EFBFBD><EFBFBD>?
|
||||||
maxlength="500"
|
maxlength="500"
|
||||||
show-word-limit />
|
show-word-limit />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -72,17 +72,17 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="visible = false">取 消</el-button>
|
<el-button @click="visible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确 认</el-button>
|
<el-button type="primary" @click="onSubmit" :disabled="loading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="ClassRoomHygieneDailyDialog">
|
<script setup lang="ts" name="classroomhygienedailyDialog">
|
||||||
import { ref, reactive, nextTick, computed, onMounted } from 'vue'
|
import { ref, reactive, nextTick, computed, onMounted } from 'vue'
|
||||||
import { useMessage } from "/@/hooks/message";
|
import { useMessage } from "/@/hooks/message";
|
||||||
import { getObj, addObj, putObj } from '/@/api/stuwork/classRoomHygieneDaily'
|
import { getObj, addObj, putObj } from '/@/api/stuwork/classroomhygienedaily'
|
||||||
import { getDeptList } from '/@/api/basic/basicclass'
|
import { getDeptList } from '/@/api/basic/basicclass'
|
||||||
import { getClassListByRole, queryClassByDeptCode } from '/@/api/basic/basicclass'
|
import { getClassListByRole, queryClassByDeptCode } from '/@/api/basic/basicclass'
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ const form = reactive({
|
|||||||
note: ''
|
note: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
// 根据学院筛选班级列表
|
// 根据学院筛选班级列<EFBFBD><EFBFBD>?
|
||||||
const filteredClassList = computed(() => {
|
const filteredClassList = computed(() => {
|
||||||
if (!form.deptCode) {
|
if (!form.deptCode) {
|
||||||
return []
|
return []
|
||||||
@@ -122,13 +122,13 @@ const dataRules = computed(() => ({
|
|||||||
{ required: true, message: '班号不能为空', trigger: 'change' }
|
{ required: true, message: '班号不能为空', trigger: 'change' }
|
||||||
],
|
],
|
||||||
recordDate: [
|
recordDate: [
|
||||||
{ required: true, message: '检查日期不能为空', trigger: 'blur' }
|
{ required: true, message: '检查日期不能为<EFBFBD><EFBFBD>?, trigger: 'blur' }
|
||||||
],
|
],
|
||||||
score: [
|
score: [
|
||||||
{ required: true, message: '扣分不能为空', trigger: 'blur' }
|
{ required: true, message: '扣分不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
note: [
|
note: [
|
||||||
{ required: true, message: '检查记录不能为空', trigger: 'blur' }
|
{ required: true, message: '检查记录不能为<EFBFBD><EFBFBD>?, trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ const openDialog = (id?: string) => {
|
|||||||
note: ''
|
note: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// 清除表单验证状态,不触发验证
|
// 清除表单验证状态,不触发验<EFBFBD><EFBFBD>?
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
dataFormRef.value?.clearValidate();
|
dataFormRef.value?.clearValidate();
|
||||||
dataFormRef.value?.resetFields();
|
dataFormRef.value?.resetFields();
|
||||||
@@ -161,7 +161,7 @@ const openDialog = (id?: string) => {
|
|||||||
// 获取详情
|
// 获取详情
|
||||||
if (id) {
|
if (id) {
|
||||||
form.id = id
|
form.id = id
|
||||||
getClassRoomHygieneDailyData(id)
|
getclassroomhygienedailyData(id)
|
||||||
}
|
}
|
||||||
// 新增时,确保验证状态已清除
|
// 新增时,确保验证状态已清除
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -188,12 +188,12 @@ const onSubmit = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 初始化表单数据
|
// 初始化表单数<EFBFBD><EFBFBD>?
|
||||||
const getClassRoomHygieneDailyData = (id: string) => {
|
const getclassroomhygienedailyData = (id: string) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getObj({ id: id }).then((res: any) => {
|
getObj({ id: id }).then((res: any) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
// 处理返回数据,可能是对象或数组
|
// 处理返回数据,可能是对象或数<EFBFBD><EFBFBD>?
|
||||||
const data = Array.isArray(res.data) ? res.data[0] : res.data
|
const data = Array.isArray(res.data) ? res.data[0] : res.data
|
||||||
if (data) {
|
if (data) {
|
||||||
Object.assign(form, {
|
Object.assign(form, {
|
||||||
@@ -205,7 +205,7 @@ const getClassRoomHygieneDailyData = (id: string) => {
|
|||||||
note: data.note || ''
|
note: data.note || ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// 如果编辑时 deptCode 为空,但 classCode 有值,尝试从 classList 中找到对应的 deptCode
|
// 如果编辑<EFBFBD><EFBFBD>?deptCode 为空,但 classCode 有值,尝试<EFBFBD><EFBFBD>?classList 中找到对应的 deptCode
|
||||||
if (!form.deptCode && form.classCode && classList.value.length > 0) {
|
if (!form.deptCode && form.classCode && classList.value.length > 0) {
|
||||||
const classItem = classList.value.find((item: any) => item.classCode === form.classCode)
|
const classItem = classList.value.find((item: any) => item.classCode === form.classCode)
|
||||||
if (classItem && classItem.deptCode) {
|
if (classItem && classItem.deptCode) {
|
||||||
@@ -253,7 +253,7 @@ const getClassListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化
|
// 初始<EFBFBD><EFBFBD>?
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDeptListData()
|
getDeptListData()
|
||||||
getClassListData()
|
getClassListData()
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<script setup lang="ts" name="WeekPlanDialog">
|
<script setup lang="ts" name="WeekPlanDialog">
|
||||||
import { ref, reactive, nextTick, onMounted } from 'vue'
|
import { ref, reactive, nextTick, onMounted } from 'vue'
|
||||||
import { useMessage } from "/@/hooks/message";
|
import { useMessage } from "/@/hooks/message";
|
||||||
import { getObj, addObj, putObj } from '/@/api/stuwork/weekPlan'
|
import { getObj, addObj, putObj } from '/@/api/stuwork/weekplan'
|
||||||
import { queryAllSchoolYear } from '/@/api/basic/basicyear'
|
import { queryAllSchoolYear } from '/@/api/basic/basicyear'
|
||||||
import Editor from '/@/components/Editor/index.vue'
|
import Editor from '/@/components/Editor/index.vue'
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
<script setup lang="ts" name="WeekPlan">
|
<script setup lang="ts" name="WeekPlan">
|
||||||
import { ref, reactive, defineAsyncComponent, onMounted, nextTick } from 'vue'
|
import { ref, reactive, defineAsyncComponent, onMounted, nextTick } from 'vue'
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||||
import { fetchList, delObjs } from "/@/api/stuwork/weekPlan";
|
import { fetchList, delObjs } from "/@/api/stuwork/weekplan";
|
||||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||||
import { queryAllSchoolYear } from '/@/api/basic/basicyear'
|
import { queryAllSchoolYear } from '/@/api/basic/basicyear'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user