选课调整

This commit is contained in:
hebo 2025-08-13 16:35:20 +08:00
parent 24de489ba8
commit f02f5d06e5
10 changed files with 260 additions and 215 deletions

View File

@ -84,8 +84,8 @@ onMounted(async () => {
title: "加载中...",
});
try {
await loadCourseList();
await loadDmBeforeMinute();
await loadCourseList();
await loadDmBeforeMinute();
} catch (error) {
console.error('页面初始化失败:', error);
uni.showToast({
@ -93,7 +93,7 @@ onMounted(async () => {
icon: 'none'
});
} finally {
uni.hideLoading();
uni.hideLoading();
}
});
@ -101,14 +101,14 @@ onMounted(async () => {
const loadCourseList = async () => {
try {
const res = await getCurrentSemesterTeacherCoursesApi(getJs.id);
if (res.resultCode == 1) {
if (res.result && res.result.length) {
if (res.resultCode == 1) {
if (res.result && res.result.length) {
xkkcList.value = res.result;
//
processCoursePeriods();
} else {
xkkcList.value = [];
}
} else {
xkkcList.value = [];
}
} else {
xkkcList.value = [];
uni.showToast({
@ -130,23 +130,23 @@ const loadCourseList = async () => {
const processCoursePeriods = () => {
for (let i = 0; i < xkkcList.value.length; i++) {
let xkkc = xkkcList.value[i];
//
switch (xkkc.skzqlx) {
case '每天':
xkkc.skzqmc = "每天";
break;
case '每周':
const daysOfWeek = xkkc.skzq.split(',').map(Number);
// wdNameListdaysOfWeek
xkkc.skzqmc = daysOfWeek.map((day: number) => wdNameList[day - 1]).join(',');
break;
case '每月':
const daysOfMonth = xkkc.skzq.split(',').map(Number);
//
xkkc.skzqmc = daysOfMonth.map((day: number) => day + "号").join(',');
break;
}
}
//
switch (xkkc.skzqlx) {
case '每天':
xkkc.skzqmc = "每天";
break;
case '每周':
const daysOfWeek = xkkc.skzq.split(',').map(Number);
// wdNameListdaysOfWeek
xkkc.skzqmc = daysOfWeek.map((day: number) => wdNameList[day - 1]).join(',');
break;
case '每月':
const daysOfMonth = xkkc.skzq.split(',').map(Number);
//
xkkc.skzqmc = daysOfMonth.map((day: number) => day + "号").join(',');
break;
}
}
};
//
@ -212,42 +212,42 @@ const goDm = (xkkc: any) => {
}
let mDay = now.date();
const strDate = now.format('YYYY-MM-DD') + ' ';
let dmFlag = false;
let msg = "";
//
switch (xkkc.skzqlx) {
case '每天':
dmFlag = true;
break;
case '每周':
const daysOfWeek = xkkc.skzq.split(',').map(Number);
dmFlag = daysOfWeek.includes(wDay);
// wdNameListdaysOfWeek
xkkc.skzqmc = daysOfWeek.map((day: number) => wdNameList[day - 1]).join(',');
break;
case '每月':
const daysOfMonth = xkkc.skzq.split(',').map(Number);
dmFlag = daysOfMonth.includes(mDay);
//
xkkc.skzqmc = daysOfMonth.map((day: number) => day + "号").join(',');
break;
}
//
if (dmFlag) {
// xkkc.skkstimedmBeforeMinute
let dmFlag = false;
let msg = "";
//
switch (xkkc.skzqlx) {
case '每天':
dmFlag = true;
break;
case '每周':
const daysOfWeek = xkkc.skzq.split(',').map(Number);
dmFlag = daysOfWeek.includes(wDay);
// wdNameListdaysOfWeek
xkkc.skzqmc = daysOfWeek.map((day: number) => wdNameList[day - 1]).join(',');
break;
case '每月':
const daysOfMonth = xkkc.skzq.split(',').map(Number);
dmFlag = daysOfMonth.includes(mDay);
//
xkkc.skzqmc = daysOfMonth.map((day: number) => day + "号").join(',');
break;
}
//
if (dmFlag) {
// xkkc.skkstimedmBeforeMinute
const startTime = dayjs(strDate + xkkc.skkstime).subtract(dmBeforeMinute.value, 'minute').format('YYYY-MM-DD HH:mm:ss');
const endTime = dayjs(strDate + xkkc.skjstime, 'YYYY-MM-DD HH:mm:ss');
dmFlag = now.isBefore(endTime) && now.isAfter(startTime)
} else {
const endTime = dayjs(strDate + xkkc.skjstime, 'YYYY-MM-DD HH:mm:ss');
dmFlag = now.isBefore(endTime) && now.isAfter(startTime)
} else {
msg = "上课时间未到,无法点名";
}
if (dmFlag) {
setData(xkkc);
uni.navigateTo({
url: `/pages/base/groupTeaching/dmXkkcDetail`,
});
} else {
if (msg === "") {
}
if (dmFlag) {
setData(xkkc);
uni.navigateTo({
url: `/pages/base/groupTeaching/dmXkkcDetail`,
});
} else {
if (msg === "") {
msg = "上课时间未到,无法点名";
}
uni.showToast({
@ -359,13 +359,13 @@ const goPhoto = (xkkc: any) => {
} else {
if (msg === "") {
msg = "上课时间未到,无法随拍";
}
uni.showToast({
title: msg,
icon: 'none',
duration: 2000
});
}
}
uni.showToast({
title: msg,
icon: 'none',
duration: 2000
});
}
};
//

View File

@ -52,6 +52,8 @@ import {navigateBack, navigateTo} from "@/utils/uniapp";
import { gzjlFindPageApi } from "@/api/base/gzjlApi";
import {cloneDeep, map} from "lodash";
import { useUserStore } from "@/store/modules/user";
import dayjs from "dayjs";
import { showToast, showLoading, hideLoading } from "@/utils/uniapp";
const { getJs, setJs } = useUserStore();
const schema = reactive<FormsSchema[]>([
@ -61,6 +63,8 @@ const schema = reactive<FormsSchema[]>([
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
},
}, {
field: "gzjstime",
@ -68,6 +72,8 @@ const schema = reactive<FormsSchema[]>([
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
},
},
{
@ -99,6 +105,7 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
showLoading({ title: "正在加载家庭成员信息..." });
setJs({
...getJs,
gzjlList: map(education.xl, (item) => {
@ -106,6 +113,7 @@ function submit() {
}),
});
navigateTo("/pages/view/hr/teacherProfile/FamilyInfo");
hideLoading();
}
onMounted(async () => {
@ -121,6 +129,20 @@ onMounted(async () => {
education.xl = map(getJs.gzjlList, (item) => {
return { value: item };
});
//
showToast({
title: `已加载 ${getJs.gzjlList.length} 条工作经历信息`,
icon: "success",
duration: 2000
});
} else {
//
showToast({
title: "暂无工作经历信息,请添加",
icon: "none",
duration: 2000
});
}
})
</script>

View File

@ -52,6 +52,7 @@ import { cloneDeep, map } from "lodash";
import { jtcyFindPageApi } from "@/api/base/jtcyApi";
import { useUserStore } from "@/store/modules/user";
import { useDicStore } from "@/store/modules/dic";
import { showToast, showLoading, hideLoading } from "@/utils/uniapp";
const { findByPid } = useDicStore();
const { getJs, setJs } = useUserStore();
@ -113,6 +114,7 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
showLoading({ title: "正在加载档案材料信息..." });
setJs({
...getJs,
jtcyList: map(education.xl, (item) => {
@ -121,6 +123,7 @@ function submit() {
});
// navigateTo("/pages/view/hr/teacherProfile/PersonalHonor");
navigateTo("/pages/view/hr/teacherProfile/RecordMaterials");
hideLoading();
}
@ -137,6 +140,20 @@ onMounted(async () => {
education.xl = map(getJs.jtcyList, (item) => {
return { value: item };
});
//
showToast({
title: `已加载 ${getJs.jtcyList.length} 条家庭成员信息`,
icon: "success",
duration: 2000
});
} else {
//
showToast({
title: "暂无家庭成员信息,请添加",
icon: "none",
duration: 2000
});
}
})
</script>

View File

@ -54,6 +54,7 @@ import { gwqkFindPageApi } from "@/api/base/gwqkApi";
import { cloneDeep, map } from "lodash";
import { useUserStore } from "@/store/modules/user";
import { useDicStore } from "@/store/modules/dic";
import { showToast, showLoading, hideLoading } from "@/utils/uniapp";
const { findByPid } = useDicStore();
const { getJs, setJs } = useUserStore();
import dayjs from "dayjs";
@ -110,6 +111,8 @@ const schema = reactive<FormsSchema[]>([
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
ok: (e: any, attrs: any) => {
console.log("岗位聘用开始时间选择:", e, attrs);
const formIndex = attrs.index;
@ -137,6 +140,8 @@ const schema = reactive<FormsSchema[]>([
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
ok: (e: any, attrs: any) => {
console.log("岗位聘用结束时间选择:", e, attrs);
const formIndex = attrs.index;
@ -169,64 +174,33 @@ const schema = reactive<FormsSchema[]>([
placeholder: "请选择岗位聘用时间",
},
},
// {
// field: "zrxk",
// label: "",
// component: "BasicInput",
// componentProps: {},
// },
// {
// field: "jrxk",
// label: "",
// component: "BasicInput",
// componentProps: {},
// },
// {
// field: "bzrBjId",
// label: "",
// component: "BasicDataPicker",
// componentProps: {
// api: findAllNjBjTreeApi,
// rangeKey: "title",
// savaKey: "key",
// },
// },
/*{
field: "dzzw",
label: "职务",
component: "BasicPicker",
componentProps: {
api: findByPid,
param: { pid: 1063530116 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},*/
]);
const education = reactive<any>({
xl: [{ value: {} }],
});
if (getJs.rgqkList && getJs.rgqkList.length > 0) {
education.xl = map(getJs.rgqkList, (item) => {
return { value: item };
});
//
// if (getJs.rgqkList && getJs.rgqkList.length > 0) {
// education.xl = map(getJs.rgqkList, (item) => {
// return { value: item };
// });
// 使gwrznx
nextTick(() => {
education.xl.forEach((item: any, index: number) => {
console.log(`回显数据-表单项${index}数据:`, {
gwrzkstime: item.value.gwrzkstime,
gwrzjstime: item.value.gwrzjstime,
gwrznx: item.value.gwrznx, // 使
来源: "数据库回显",
});
});
//
forceUpdateKey.value++;
});
}
// // 使gwrznx
// nextTick(() => {
// education.xl.forEach((item: any, index: number) => {
// console.log(`-${index}:`, {
// gwrzkstime: item.value.gwrzkstime,
// gwrzjstime: item.value.gwrzjstime,
// gwrznx: item.value.gwrznx, // 使
// : "",
// });
// });
// //
// forceUpdateKey.value++;
// });
// }
function addEducation() {
education.xl.push({ value: {} });
@ -243,6 +217,7 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
showLoading({ title: "正在加载工作经历信息..." });
setJs({
...getJs,
rgqkList: map(education.xl, (item) => {
@ -250,6 +225,7 @@ function submit() {
}),
});
navigateTo("/pages/view/hr/teacherProfile/ExperienceInfo");
hideLoading();
}
//
@ -262,18 +238,33 @@ onMounted(async () => {
});
getJs.rgqkList = res.rows || [];
}
if (getJs.rgqkList && getJs.rgqkList.length > 0) {
nextTick(() => {
console.log("组件挂载后处理回显数据直接使用数据库返回的gwrznx值");
education.xl.forEach((item: any, index: number) => {
console.log(`挂载后-表单项${index}数据:`, {
gwrzkstime: item.value.gwrzkstime,
gwrzjstime: item.value.gwrzjstime,
gwrznx: item.value.gwrznx, // 使
来源: "数据库回显-挂载后",
});
});
forceUpdateKey.value++;
//
education.xl = map(getJs.rgqkList, (item) => {
return { value: item };
});
console.log("数据回显成功,共", getJs.rgqkList.length, "条记录");
console.log("回显的数据:", getJs.rgqkList);
//
showToast({
title: `已加载 ${getJs.rgqkList.length} 条岗位情况信息`,
icon: "success",
duration: 2000
});
//
forceUpdateKey.value++;
} else {
console.log("没有岗位情况数据,使用默认空表单");
//
showToast({
title: "暂无岗位情况信息,请添加",
icon: "none",
duration: 2000
});
}
});

View File

@ -29,6 +29,7 @@ import {
hideLoading,
navigateBack,
showLoading,
showToast,
} from "@/utils/uniapp";
const signCompRef = ref<any>(null);
import { imagUrl } from "@/utils";
@ -139,6 +140,13 @@ const srcData = {
setValue(srcData);
//
showToast({
title: "档案材料信息已加载",
icon: "success",
duration: 2000
});
const sign_file = ref<string>("");
async function submit() {

View File

@ -52,6 +52,8 @@ import { cloneDeep, get, map } from "lodash";
import { zcxxFindPageApi } from "@/api/base/zcxxApi";
import { useUserStore } from "@/store/modules/user";
import { useDicStore } from "@/store/modules/dic";
import dayjs from "dayjs";
import { showToast, showLoading, hideLoading } from "@/utils/uniapp";
const { findByPid } = useDicStore();
const { getJs, setJs } = useUserStore();
@ -102,6 +104,8 @@ const schema = reactive<FormsSchema[]>([
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
},
},
{
@ -127,6 +131,8 @@ const schema = reactive<FormsSchema[]>([
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
},
},
{
@ -136,7 +142,7 @@ const schema = reactive<FormsSchema[]>([
componentProps: {},
},
{
field: "sczczs",
field: "zczs",
label: "上传职称证书",
component: "BasicUpload",
itemProps: {
@ -144,7 +150,7 @@ const schema = reactive<FormsSchema[]>([
},
componentProps: {},
}, {
field: "pywjh",
field: "rzwj",
label: "上传任职文件",
component: "BasicUpload",
itemProps: {
@ -153,7 +159,7 @@ const schema = reactive<FormsSchema[]>([
componentProps: {},
},
{
field: "pywjh",
field: "pywj",
label: "上传聘用文件",
component: "BasicUpload",
itemProps: {
@ -178,6 +184,7 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
showLoading({ title: "正在加载岗位情况信息..." });
setJs({
...getJs,
zcxxList: map(education.xl, (item) => {
@ -185,6 +192,7 @@ function submit() {
}),
});
navigateTo("/pages/view/hr/teacherProfile/PositionInfo");
hideLoading();
}
onMounted(async () => {
@ -200,6 +208,20 @@ onMounted(async () => {
education.xl = map(getJs.zcxxList, (item) => {
return { value: item };
});
//
showToast({
title: `已加载 ${getJs.zcxxList.length} 条职称信息`,
icon: "success",
duration: 2000
});
} else {
//
showToast({
title: "暂无职称信息,请添加",
icon: "none",
duration: 2000
});
}
})

View File

@ -17,6 +17,7 @@ import { navigateBack, navigateTo } from "@/utils/uniapp";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { useUserStore } from "@/store/modules/user";
import { useDicStore } from "@/store/modules/dic";
import dayjs from "dayjs";
const { findByPid } = useDicStore();
const { getJs, setJs } = useUserStore();
@ -51,9 +52,11 @@ const [register, { getValue, setValue }] = useForm({
{
field: 'dybynytime',
label: '全日制学历毕业年月',
component: 'BasicDateTimes',
component: 'BasicDateTime',
componentProps: {
mode: 'month',
mode: 'year-month',
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
placeholder: '请选择月份',
},
},
@ -82,9 +85,11 @@ const [register, { getValue, setValue }] = useForm({
{
field: 'zhbynytime',
label: '最后毕业年月',
component: 'BasicDateTimes',
component: 'BasicDateTime',
componentProps: {
mode: 'month',
mode: 'year-month',
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
placeholder: '请选择月份',
},
},

View File

@ -29,7 +29,6 @@ const calculateYearDiff = (startDate: string) => {
if (!startDate) return "";
const start = dayjs(startDate);
const now = dayjs();
console.log(now.diff(start, "year"));
return now.diff(start, "year");
};
@ -61,6 +60,18 @@ const [register, { getValue, setValue, setSchema }] = useForm({
savaKey: "dictionaryCode",
},
},
{
field: "age",
label: "年龄",
component: "BasicInput",
componentProps: {},
},
{
field: "cstime",
label: "出生日期",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "jsjgId",
label: "籍贯",
@ -94,18 +105,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({
component: "BasicInput",
componentProps: {},
},
{
field: "age",
label: "年龄",
component: "BasicInput",
componentProps: {},
},
{
field: "cstime",
label: "出生日期",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "zzmmId",
label: "政治面貌",
@ -123,6 +123,8 @@ const [register, { getValue, setValue, setSchema }] = useForm({
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
},
},
{
@ -143,6 +145,8 @@ const [register, { getValue, setValue, setSchema }] = useForm({
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
ok: (e: any) => {
const yearDiff = calculateYearDiff(e.value);
setValue({ jsgl: yearDiff });
@ -163,6 +167,8 @@ const [register, { getValue, setValue, setSchema }] = useForm({
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
ok: (e: any) => {
const yearDiff = calculateYearDiff(e.value);
setValue({ jl: yearDiff });
@ -174,8 +180,8 @@ const [register, { getValue, setValue, setSchema }] = useForm({
label: "教龄",
component: "BasicInput",
componentProps: {
disabled: true,
placeholder: "请选择教龄时间",
disabled: true,
},
},
{
@ -184,6 +190,8 @@ const [register, { getValue, setValue, setSchema }] = useForm({
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
ok: (e: any) => {
const yearDiff = calculateYearDiff(e.value);
setValue({ jrdwnx: yearDiff });
@ -232,7 +240,15 @@ const [register, { getValue, setValue, setSchema }] = useForm({
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
ok: (e: any, form: any, attrs: any) => {
if (attrs[e].dictionaryValue == "调出") {
const selectedValue = form?.value;
if (selectedValue === "调出") {
setSchema([
{
field: "dcyy",
ifShow: true,
},
]);
} else {
setSchema([
{
field: "dcyy",
@ -246,32 +262,12 @@ const [register, { getValue, setValue, setSchema }] = useForm({
{
field: "dcyy",
label: "调出原因",
ifShow: true,
component: "BasicInput",
componentProps: {},
},
/* {
field: "gwjbId",
label: "岗位级别",
component: "BasicPicker",
componentProps: {
api: findByPid,
param: { pid: 260783972 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
placeholder: "请输入调出原因",
},
},
{
field: "xqxjId",
label: "薪级",
component: "BasicPicker",
componentProps: {
api: findByPid,
param: { pid: 434953981 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},*/
{
field: "sbkh",
label: "社保卡号",
@ -290,7 +286,12 @@ if (getJs.zdqkId == "调出") {
ifShow: false,
},
]);
}
}else setSchema([
{
field: "dcyy",
ifShow: true,
},
]);
async function submit() {
try {
@ -309,3 +310,5 @@ async function submit() {
z-index: 1;
}
</style>

View File

@ -16,6 +16,7 @@
import { navigateBack, navigateTo } from "@/utils/uniapp";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { useUserStore } from "@/store/modules/user";
import { showLoading, hideLoading } from "@/utils/uniapp";
const { getJs, setJs } = useUserStore();
import { zwGetListByLxApi, findAllXxXqNjTree } from "@/api/base/server";
@ -55,46 +56,6 @@ const formSchema: any = [
}
},
},
// {
// field: "zrxk",
// label: "",
// component: "BasicPicker",
// componentProps: {
// api: kmFindAllApi,
// rangeKey: "kmmc",
// savaKey: "id",
// },
// },
// {
// field: "zrbj",
// label: "",
// component: "BasicPicker",
// componentProps: {
// api: findAllNjBjTreeApi,
// rangeKey: "title",
// savaKey: "key",
// },
// },
// {
// field: "jrxk",
// label: "",
// component: "BasicPicker",
// componentProps: {
// api: kmFindAllApi,
// rangeKey: "kmmc",
// savaKey: "id",
// },
// },
// {
// field: "jrbj",
// label: "",
// component: "BasicPicker",
// componentProps: {
// api: findAllNjBjTreeApi,
// rangeKey: "title",
// savaKey: "key",
// },
// },
{
field: "njId",
label: "所属年级",
@ -139,9 +100,23 @@ async function submit() {
if (Array.isArray(value.qtzw)) {
value.qtzw = value.qtzw.join(',');
}
//
setJs({ ...getJs, ...value });
navigateTo("/pages/view/hr/teacherProfile/TitleInfo");
} catch (error) { }
//
showLoading("正在加载职称信息...");
//
setTimeout(() => {
hideLoading();
navigateTo("/pages/view/hr/teacherProfile/TitleInfo");
}, 500);
} catch (error) {
hideLoading();
console.error("提交失败:", error);
}
}
onMounted(async () => {

View File

@ -70,6 +70,8 @@ const [register, { getValue, setValue }] = useForm({
component: "BasicDateTime",
componentProps: {
mode: "year-month",
minDate: dayjs('1950-01-01').valueOf(), //
maxDate: dayjs().valueOf(), //
},
},
{