staging #23
|
|
@ -72,3 +72,13 @@ export function PageList(data) {
|
||||||
export function StudentInfo(uid) {
|
export function StudentInfo(uid) {
|
||||||
return http.request<Res<any>>("get", `Student/Info?uid=${uid}`);
|
return http.request<Res<any>>("get", `Student/Info?uid=${uid}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 通过职位信息获取职位id
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
export function PosititonIds(data:any[]) {
|
||||||
|
return http.request<Res<number[]>>("post", `Student/PosititonIds`, {
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,20 +19,6 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="职务:" prop="studentId">
|
|
||||||
<el-input
|
|
||||||
type="text"
|
|
||||||
v-model="form.studentId"
|
|
||||||
autocomplete="off"
|
|
||||||
maxlength="16"
|
|
||||||
:show-word-limit="true"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="入班时间:" prop="joinTime">
|
<el-form-item label="入班时间:" prop="joinTime">
|
||||||
|
|
@ -198,14 +184,14 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row class="pt-4">
|
<el-row class="pt-4">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="就读班级:" prop="positionIds" :rules="ruleRequired">
|
<el-form-item label="就读班级:" prop="positionList" :rules="ruleRequired">
|
||||||
<el-button type="success" @click="AddPosition()">添加就读班级</el-button>
|
<el-button type="success" @click="AddPosition()">添加就读班级</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="max-h-[300px] overflow-auto pb-1">
|
<div class="max-h-[300px] overflow-auto pb-1">
|
||||||
<span class="pl-[120px]"
|
<span class="pl-[120px]"
|
||||||
>提示:任职信息所有项值<span class="text-red-500">必填</span>,
|
>提示:就读信息所有项值<span class="text-red-500">必填</span>,
|
||||||
如若查询不到对应班级,请先添加
|
如若查询不到对应班级,请先添加
|
||||||
</span>
|
</span>
|
||||||
<el-form :model="positionList" inline ref="positionEditForm">
|
<el-form :model="positionList" inline ref="positionEditForm">
|
||||||
|
|
@ -314,6 +300,8 @@ import { ElMessage, FormInstance } from "element-plus";
|
||||||
import { ComboModel, gradeComboModel } from "@/components/hTable/hTable";
|
import { ComboModel, gradeComboModel } from "@/components/hTable/hTable";
|
||||||
import { Check, Delete, Edit, Message, Search, Star } from "@element-plus/icons-vue";
|
import { Check, Delete, Edit, Message, Search, Star } from "@element-plus/icons-vue";
|
||||||
|
|
||||||
|
import { PosititonIds } from "@/api/student";
|
||||||
|
|
||||||
interface FormData {
|
interface FormData {
|
||||||
id: number;
|
id: number;
|
||||||
uId?: number;
|
uId?: number;
|
||||||
|
|
@ -343,7 +331,7 @@ interface FormData {
|
||||||
amountRelief?: number;
|
amountRelief?: number;
|
||||||
reliefSubTime?: number;
|
reliefSubTime?: number;
|
||||||
reliefType?: number;
|
reliefType?: number;
|
||||||
reliefApplication?: number;
|
reliefApplication?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DialogConfig {
|
interface DialogConfig {
|
||||||
|
|
@ -484,12 +472,14 @@ function AddPosition() {
|
||||||
gradeLevel: "",
|
gradeLevel: "",
|
||||||
classId: null,
|
classId: null,
|
||||||
subjectId: null,
|
subjectId: null,
|
||||||
positionType: 2,
|
positionType: 1,
|
||||||
positionLevel: null,
|
positionLevel: 4,
|
||||||
status: true,
|
status: true,
|
||||||
};
|
};
|
||||||
AddPositionArr.push((p as unknown) as Position);
|
let p1 = (p as unknown) as Position;
|
||||||
positionList.value.push((p as unknown) as Position);
|
form.value.positionList.push(p1);
|
||||||
|
AddPositionArr.push(p1);
|
||||||
|
positionList.value.push(p1);
|
||||||
}
|
}
|
||||||
const emit = defineEmits(["handlePagedCallback"]);
|
const emit = defineEmits(["handlePagedCallback"]);
|
||||||
const handlePagedCallback = () => {
|
const handlePagedCallback = () => {
|
||||||
|
|
@ -508,6 +498,34 @@ const handleSubmitForm = async () => {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
||||||
|
const postIdArr = positionList.value.map((s) => s.id).filter((s) => s != null);
|
||||||
|
const addPArr = positionList.value
|
||||||
|
.filter((s) => s.id == null)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
positionType: 1,
|
||||||
|
positionLevel: 4,
|
||||||
|
subjectId: s.subjectId,
|
||||||
|
schoolId: s.schoolId,
|
||||||
|
classId: s.classId,
|
||||||
|
gradeLevel: s.grade[0],
|
||||||
|
graduationYear: parseInt(s.grade.slice(1, 5)),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
if (addPArr.length > 0) {
|
||||||
|
const resPId = await PosititonIds(addPArr);
|
||||||
|
if (
|
||||||
|
resPId.code != 200 ||
|
||||||
|
resPId.data.length == 0 ||
|
||||||
|
resPId.data.length != addPArr.length
|
||||||
|
) {
|
||||||
|
ElMessage.warning("校验添加的职位数据异常,请删除后重新选择!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
postIdArr.push(...resPId.data);
|
||||||
|
}
|
||||||
|
|
||||||
const formData = {
|
const formData = {
|
||||||
id: form.value.uId || 0,
|
id: form.value.uId || 0,
|
||||||
userType: form.value.userType || 1,
|
userType: form.value.userType || 1,
|
||||||
|
|
@ -519,13 +537,13 @@ const handleSubmitForm = async () => {
|
||||||
templateId: form.value.templateId || 0,
|
templateId: form.value.templateId || 0,
|
||||||
subjectLevels: form.value.subjectLevels || [],
|
subjectLevels: form.value.subjectLevels || [],
|
||||||
subjectLevel: form.value.subjectLevel || { ...defaultSubjectLevel },
|
subjectLevel: form.value.subjectLevel || { ...defaultSubjectLevel },
|
||||||
positionIds: form.value.positionIds || [],
|
|
||||||
gLSubject: form.value.gLSubject,
|
gLSubject: form.value.gLSubject,
|
||||||
gSubject1: form.value.gSubject1,
|
gSubject1: form.value.gSubject1,
|
||||||
gSubject2: form.value.gSubject2,
|
gSubject2: form.value.gSubject2,
|
||||||
idCard: form.value.idCard,
|
idCard: form.value.idCard,
|
||||||
cloudSchoolId: form.value.cloudSchoolId,
|
cloudSchoolId: form.value.cloudSchoolId,
|
||||||
phone: form.value.phone,
|
phone: form.value.phone,
|
||||||
|
positionIds: postIdArr,
|
||||||
};
|
};
|
||||||
|
|
||||||
let res = await editUser(formData);
|
let res = await editUser(formData);
|
||||||
|
|
@ -578,7 +596,7 @@ const handleResetForm = () => {
|
||||||
amountRelief: null,
|
amountRelief: null,
|
||||||
reliefSubTime: null,
|
reliefSubTime: null,
|
||||||
reliefType: null,
|
reliefType: null,
|
||||||
reliefApplication: null,
|
reliefApplication: false,
|
||||||
};
|
};
|
||||||
positionList.value = [];
|
positionList.value = [];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -191,10 +191,12 @@ import {
|
||||||
} from "@/api/userCenter";
|
} from "@/api/userCenter";
|
||||||
import PositionForm from "./positionForm.vue";
|
import PositionForm from "./positionForm.vue";
|
||||||
import { getenum, getenumDic } from "@/api/enum";
|
import { getenum, getenumDic } from "@/api/enum";
|
||||||
|
import { PosititonIds } from "@/api/student";
|
||||||
import { ruleRequired, rulePhone } from "@/utils/rules";
|
import { ruleRequired, rulePhone } from "@/utils/rules";
|
||||||
import { ElMessage, FormInstance } from "element-plus";
|
import { ElMessage, FormInstance } from "element-plus";
|
||||||
import { ComboModel, gradeComboModel } from "@/components/hTable/hTable";
|
import { ComboModel, gradeComboModel } from "@/components/hTable/hTable";
|
||||||
import { Check, Delete, Edit, Message, Search, Star } from "@element-plus/icons-vue";
|
import { Check, Delete, Edit, Message, Search, Star } from "@element-plus/icons-vue";
|
||||||
|
import { de } from "element-plus/es/locales.mjs";
|
||||||
|
|
||||||
interface FormData {
|
interface FormData {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
@ -363,8 +365,10 @@ function AddPosition() {
|
||||||
positionLevel: null,
|
positionLevel: null,
|
||||||
status: true,
|
status: true,
|
||||||
};
|
};
|
||||||
AddPositionArr.push((p as unknown) as Position);
|
let p1 = (p as unknown) as Position;
|
||||||
positionList.value.push((p as unknown) as Position);
|
form.value.positionList.push(p1);
|
||||||
|
AddPositionArr.push(p1);
|
||||||
|
positionList.value.push(p1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePagedCallback = () => {
|
const handlePagedCallback = () => {
|
||||||
|
|
@ -382,10 +386,39 @@ const handleSubmitForm = async () => {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
debugger;
|
||||||
|
const postIdArr = positionList.value.map((s) => s.id).filter((s) => s != null);
|
||||||
|
|
||||||
|
const addPArr = positionList.value
|
||||||
|
.filter((s) => s.id == null)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
positionLevel: s.positionLevel,
|
||||||
|
subjectId: s.subjectId,
|
||||||
|
schoolId: s.schoolId,
|
||||||
|
classId: s.classId,
|
||||||
|
positionType: 2,
|
||||||
|
gradeLevel: s.grade[0],
|
||||||
|
graduationYear: parseInt(s.grade.slice(1, 5)),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
if (addPArr.length > 0) {
|
||||||
|
const resPId = await PosititonIds(addPArr);
|
||||||
|
if (
|
||||||
|
resPId.code != 200 ||
|
||||||
|
resPId.data.length == 0 ||
|
||||||
|
resPId.data.length != addPArr.length
|
||||||
|
) {
|
||||||
|
ElMessage.warning("校验添加的职位数据异常,请删除后重新选择!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
postIdArr.push(...resPId.data);
|
||||||
|
}
|
||||||
|
|
||||||
const formData = {
|
const formData = {
|
||||||
...form.value,
|
...form.value,
|
||||||
account: form.value.phone || "",
|
account: form.value.phone || "",
|
||||||
positionIds: positionList.value.map((s) => s.id),
|
positionIds: postIdArr,
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await editUser(formData);
|
const res = await editUser(formData);
|
||||||
|
|
@ -397,7 +430,7 @@ const handleSubmitForm = async () => {
|
||||||
ElMessage.error(res.message);
|
ElMessage.error(res.message);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ElMessage.error("请求失败!" + JSON.stringify(error));
|
ElMessage.error("请求失败!" + (error.message ?? JSON.stringify(error)));
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -430,7 +463,7 @@ const fetchInitData = async () => {
|
||||||
userTypeList.value = typeRes.data;
|
userTypeList.value = typeRes.data;
|
||||||
|
|
||||||
schoolList.value = (await getSchoolData()).data;
|
schoolList.value = (await getSchoolData()).data;
|
||||||
subjectList.value = (await getenum("SubjectEnum")).data;
|
subjectList.value = (await getenum("SubjectEnum")).data.filter((s) => s.value < 10);
|
||||||
|
|
||||||
// // 云校
|
// // 云校
|
||||||
// const schoolRes = await cloudSchoolCombo();
|
// const schoolRes = await cloudSchoolCombo();
|
||||||
|
|
@ -479,7 +512,7 @@ const fetchFormData = () => {
|
||||||
phone: res.data.phone,
|
phone: res.data.phone,
|
||||||
cloudSchoolId: res.data.cloudSchoolId,
|
cloudSchoolId: res.data.cloudSchoolId,
|
||||||
pointPenSN: res.data.pointPenSN,
|
pointPenSN: res.data.pointPenSN,
|
||||||
positionList: positionList.value,
|
positionList: positionList.value ?? [],
|
||||||
});
|
});
|
||||||
positionList.value = res.data.positions
|
positionList.value = res.data.positions
|
||||||
.filter((s: Position) => s.enable)
|
.filter((s: Position) => s.enable)
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,13 @@
|
||||||
:label="g.label"
|
:label="g.label"
|
||||||
:value="g.value"
|
:value="g.value"
|
||||||
/>
|
/>
|
||||||
</el-select >
|
</el-select>
|
||||||
<el-input-number v-show="query.grade" v-model="query.gradeYear" :min="2020" :max="2100"/>
|
<el-input-number
|
||||||
|
v-show="query.grade"
|
||||||
|
v-model="query.gradeYear"
|
||||||
|
:min="2020"
|
||||||
|
:max="2100"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="赴校人员">
|
<el-form-item label="赴校人员">
|
||||||
<el-select
|
<el-select
|
||||||
|
|
@ -133,10 +138,8 @@
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="年级" min-width="100" >
|
<el-table-column label="年级" min-width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }"> {{ row.gradeLevel + row.gradeYear }}届 </template>
|
||||||
{{ row.gradeLevel+row.gradeYear }}届
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="people" label="赴校人员" min-width="120" />
|
<el-table-column prop="people" label="赴校人员" min-width="120" />
|
||||||
<el-table-column label="赴校时间/解决时间" min-width="140">
|
<el-table-column label="赴校时间/解决时间" min-width="140">
|
||||||
|
|
@ -200,6 +203,8 @@ interface TableItem {
|
||||||
school: string;
|
school: string;
|
||||||
grade: string;
|
grade: string;
|
||||||
people: string;
|
people: string;
|
||||||
|
gradeLevel?: string;
|
||||||
|
gradeYear?: number;
|
||||||
canOperate: boolean; // 是否可以跟进
|
canOperate: boolean; // 是否可以跟进
|
||||||
times: string; // YYYY-MM-DD
|
times: string; // YYYY-MM-DD
|
||||||
endTime: string; //预计解决时间
|
endTime: string; //预计解决时间
|
||||||
|
|
@ -213,15 +218,19 @@ const schoolOptions = ref([]);
|
||||||
const peopleOptions = ref([]);
|
const peopleOptions = ref([]);
|
||||||
const isDetail = ref(false);
|
const isDetail = ref(false);
|
||||||
|
|
||||||
const tableRowClassName = ({ row, rowIndex }: { row: any; rowIndex: number }) => {
|
const tableRowClassName = ({ row, rowIndex }: { row: TableItem; rowIndex: number }) => {
|
||||||
if (row.endTime == null || row.endTime == "" || row.solutionEnd) return "";
|
if (row.endTime == null || row.endTime == "" || row.solutionEnd) return "";
|
||||||
const nD = new Date();
|
const nD = new Date();
|
||||||
const d = new Date(row.endTime + " ");
|
const d = new Date(row.endTime + " ");
|
||||||
|
const startTime = new Date(row.times + " ");
|
||||||
|
const daysDiff1 = Math.floor(
|
||||||
|
(nD.getTime() - startTime.getTime()) / (1000 * 60 * 60 * 24)
|
||||||
|
);
|
||||||
const daysDiff = Math.floor((d.getTime() - nD.getTime()) / (1000 * 60 * 60 * 24));
|
const daysDiff = Math.floor((d.getTime() - nD.getTime()) / (1000 * 60 * 60 * 24));
|
||||||
if (daysDiff >= 2) {
|
if (daysDiff < -1) {
|
||||||
return "warning-row";
|
|
||||||
} else if (daysDiff < 2) {
|
|
||||||
return "error-row";
|
return "error-row";
|
||||||
|
} else if (daysDiff1 > 7) {
|
||||||
|
return "warning-row";
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|
@ -310,7 +319,7 @@ const addOrEdit = () => {
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
school: "" as string | undefined,
|
school: "" as string | undefined,
|
||||||
grade: "" as string | undefined,
|
grade: "" as string | undefined,
|
||||||
gradeYear: 2025 as number ,
|
gradeYear: 2025 as number,
|
||||||
people: "" as string | undefined,
|
people: "" as string | undefined,
|
||||||
solutionEnd: undefined,
|
solutionEnd: undefined,
|
||||||
times: [] as string[],
|
times: [] as string[],
|
||||||
|
|
@ -357,7 +366,7 @@ async function loadList() {
|
||||||
orderBy: "startTime",
|
orderBy: "startTime",
|
||||||
};
|
};
|
||||||
if (query.school) payload.schoolId = query.school;
|
if (query.school) payload.schoolId = query.school;
|
||||||
if (query.grade && query.gradeYear) payload.grade = query.grade+query.gradeYear;
|
if (query.grade && query.gradeYear) payload.grade = query.grade + query.gradeYear;
|
||||||
if (query.people) {
|
if (query.people) {
|
||||||
payload.UserName = query.people;
|
payload.UserName = query.people;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue