This commit is contained in:
ywyonui 2025-09-26 19:59:19 +08:00
commit 4a16852cac
3 changed files with 53 additions and 11 deletions

View File

@ -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);
}; };

View File

@ -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" });

View File

@ -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}`,
}); });
}; };