接龙调整
This commit is contained in:
parent
8e5a894267
commit
8df527f0c0
@ -89,7 +89,12 @@ export const getByJlIdApi = async (params: any) => {
|
|||||||
|
|
||||||
// 推送清单相关API
|
// 推送清单相关API
|
||||||
// 根据接龙ID获取学生信息
|
// 根据接龙ID获取学生信息
|
||||||
export const jlzxFindByJlParamsApi = async (params: { jlId: string }) => {
|
export const jlzxFindByJlParamsApi = async (params: {
|
||||||
|
jlId: string;
|
||||||
|
njId?: string;
|
||||||
|
njmcId?: string;
|
||||||
|
bjId?: string;
|
||||||
|
}) => {
|
||||||
return await get("/api/jlzx/findByJlParams", params);
|
return await get("/api/jlzx/findByJlParams", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -90,6 +90,11 @@ const isLoading = ref(false);
|
|||||||
const studentList = ref<any[]>([]);
|
const studentList = ref<any[]>([]);
|
||||||
const descExpanded = ref(false);
|
const descExpanded = ref(false);
|
||||||
|
|
||||||
|
// 新增参数
|
||||||
|
const njId = ref<string>("");
|
||||||
|
const njmcId = ref<string>("");
|
||||||
|
const bjId = ref<string>("");
|
||||||
|
|
||||||
// 签名相关
|
// 签名相关
|
||||||
const signCompRef = ref<any>(null);
|
const signCompRef = ref<any>(null);
|
||||||
const signTitle = ref<string>("签名");
|
const signTitle = ref<string>("签名");
|
||||||
@ -157,11 +162,11 @@ async function onRelayClick() {
|
|||||||
// 提交接龙
|
// 提交接龙
|
||||||
async function submitRelay() {
|
async function submitRelay() {
|
||||||
const params: any = {
|
const params: any = {
|
||||||
jl_id: noticeId.value,
|
jlId: noticeId.value,
|
||||||
xsId: currentStudent.value?.id,
|
xsId: currentStudent.value?.id,
|
||||||
};
|
};
|
||||||
if (sign_file.value) {
|
if (sign_file.value) {
|
||||||
params.qm_file = sign_file.value;
|
params.qmFile = sign_file.value;
|
||||||
}
|
}
|
||||||
showLoading('提交中...');
|
showLoading('提交中...');
|
||||||
try {
|
try {
|
||||||
@ -182,7 +187,14 @@ async function submitRelay() {
|
|||||||
// 刷新学生完成状态
|
// 刷新学生完成状态
|
||||||
async function refreshStudentList() {
|
async function refreshStudentList() {
|
||||||
try {
|
try {
|
||||||
const stuRes = await jlzxFindByJlParamsApi({ jlId: noticeId.value });
|
const params: any = { jlId: noticeId.value };
|
||||||
|
|
||||||
|
// 添加筛选参数
|
||||||
|
if (njId.value) params.njId = njId.value;
|
||||||
|
if (njmcId.value) params.njmcId = njmcId.value;
|
||||||
|
if (bjId.value) params.bjId = bjId.value;
|
||||||
|
|
||||||
|
const stuRes = await jlzxFindByJlParamsApi(params);
|
||||||
studentList.value = stuRes?.rows || stuRes?.result || [];
|
studentList.value = stuRes?.rows || stuRes?.result || [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
uni.showToast({ title: "刷新学生状态失败", icon: "none" });
|
uni.showToast({ title: "刷新学生状态失败", icon: "none" });
|
||||||
@ -190,14 +202,19 @@ async function refreshStudentList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
if (options && options.id) {
|
if (options && options.jlId) {
|
||||||
noticeId.value = options.id;
|
noticeId.value = options.jlId;
|
||||||
|
|
||||||
|
// 接收新的参数
|
||||||
|
if (options.njId) njId.value = options.njId;
|
||||||
|
if (options.njmcId) njmcId.value = options.njmcId;
|
||||||
|
if (options.bjId) bjId.value = options.bjId;
|
||||||
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
if (options.openId) {
|
if (options.openId) {
|
||||||
// 检查登录状态
|
// 检查登录状态
|
||||||
const isLoggedIn = await userStore.loginByOpenId(options.openId);
|
const isLoggedIn = await userStore.loginByOpenId(options.openId);
|
||||||
if (!isLoggedIn) {
|
if (!isLoggedIn) {
|
||||||
console.log("用户未登录,跳过处理");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,7 +227,14 @@ onLoad(async (options) => {
|
|||||||
}
|
}
|
||||||
// 2. 获取学生完成状态
|
// 2. 获取学生完成状态
|
||||||
try {
|
try {
|
||||||
const stuRes = await jlzxFindByJlParamsApi({ jlId: noticeId.value });
|
const params: any = { jlId: noticeId.value };
|
||||||
|
|
||||||
|
// 添加筛选参数
|
||||||
|
if (njId.value) params.njId = njId.value;
|
||||||
|
if (njmcId.value) params.njmcId = njmcId.value;
|
||||||
|
if (bjId.value) params.bjId = bjId.value;
|
||||||
|
|
||||||
|
const stuRes = await jlzxFindByJlParamsApi(params);
|
||||||
studentList.value = stuRes?.rows || stuRes?.result || [];
|
studentList.value = stuRes?.rows || stuRes?.result || [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
uni.showToast({ title: "加载学生状态失败", icon: "none" });
|
uni.showToast({ title: "加载学生状态失败", icon: "none" });
|
||||||
|
|||||||
@ -155,10 +155,23 @@ watch(dataList, (val) => {
|
|||||||
|
|
||||||
// 跳转到接龙反馈(detail)页
|
// 跳转到接龙反馈(detail)页
|
||||||
const goToFeedback = (data: any) => {
|
const goToFeedback = (data: any) => {
|
||||||
// 优先使用 jlId,如果没有则使用 id
|
|
||||||
const jlId = data.jlId || data.id;
|
// 传递所有必要的参数
|
||||||
|
const params = {
|
||||||
|
jlId: data.jlId,
|
||||||
|
njId: data.njId,
|
||||||
|
njmcId: data.njmcId,
|
||||||
|
bjId: data.bjId
|
||||||
|
};
|
||||||
|
|
||||||
|
// 构建查询字符串
|
||||||
|
const queryString = Object.keys(params)
|
||||||
|
.filter(key => params[key as keyof typeof params])
|
||||||
|
.map(key => `${key}=${encodeURIComponent(params[key as keyof typeof params])}`)
|
||||||
|
.join('&');
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/base/jl/detail?id=${jlId}`,
|
url: `/pages/base/jl/detail?${queryString}`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user