修复待办更新时的异常

This commit is contained in:
ywyonui 2025-09-26 10:34:48 +08:00
parent 4a4573e51c
commit c5fc913a27
5 changed files with 175 additions and 149 deletions

View File

@ -52,7 +52,9 @@ const handleQjDataLoaded = (data: any) => {
QjPageUtils.updateXxts();
}
nextTick(() => {
if (dkRef.value) {
dkRef.value.init();
}
});
};

View File

@ -67,6 +67,12 @@ const spParams = computed(() => {
const handleQjDataLoaded = async (data: any) => {
data = data || {};
//
if (!data.id) {
uni.reLaunch({ url: '/pages/base/message/index' });
QjPageUtils.updateXxts();
return;
}
const dkfs = typeof (data.dkfs) === "string" ? parseInt(data.dkfs) : (data.dkfs || 2);
data.dkfs = dkfs;
qjData.value = data;
@ -77,7 +83,9 @@ const handleQjDataLoaded = async (data: any) => {
return;
}
nextTick(() => {
if (dkRef.value) {
dkRef.value.init();
}
});
};

View File

@ -5,9 +5,10 @@ import { useDataStore } from "@/store/modules/data";
const { loginByOpenId } = useUserStore();
const { getGwData, setXxts, setGwData, getXxts } = useDataStore();
export const GwPageUtils = {
// 初始化校验
async init(data?: any) {
let xxtsId = "";
const init = async (data?: any) => {
xxtsId = '';
setXxts({});
let ret = {
success: true,
@ -33,6 +34,7 @@ export const GwPageUtils = {
}
let url = "/pages/base/message/index";
try {
xxtsId = data.id;
// 优先从后端根据url中的id去查询Xxts
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
if (xxtsRes && xxtsRes.result) {
@ -71,19 +73,23 @@ export const GwPageUtils = {
return ret;
}
}
},
// 检查待办状态是否需要更新
async updateXxts() {
};
const updateXxts = async () => {
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
if (!getXxts || !getXxts.id) {
if (!xxtsId || !xxtsId.length) {
return false;
}
console.log("更新待办状态getXxts", getXxts);
// 更新待办状态
await xxtsSaveApi({
id: getXxts.id,
id: xxtsId,
dbZt: "B",
});
return true;
},
};
export const GwPageUtils = {
init,
updateXxts
}

View File

@ -31,7 +31,10 @@ const qrStatus: any = {
"rejected": "拒绝",
};
let xxtsId = "";
const init = async (data?: any) => {
xxtsId = '';
setXxts({});
let ret = {
success: true,
@ -52,6 +55,7 @@ const init = async (data?: any) => {
}
let url = "/pages/base/message/index";
try {
xxtsId = data.id;
// 优先从后端根据url中的id去查询Xxts
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
if (xxtsRes && xxtsRes.result) {
@ -94,13 +98,13 @@ const init = async (data?: any) => {
const updateXxts = async () => {
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
if (!getXxts || !getXxts.id) {
if (!xxtsId || !xxtsId.length) {
return false;
}
console.log("更新待办状态getXxts", getXxts);
// 更新待办状态
await xxtsSaveApi({
id: getXxts.id,
id: xxtsId,
dbZt: "B",
});
return true;

View File

@ -5,9 +5,10 @@ import { useDataStore } from "@/store/modules/data";
const { loginByOpenId } = useUserStore();
const { getData, setXxts, setData, getXxts } = useDataStore();
export const XkTfPageUtils = {
// 初始化校验
async init(data?: any) {
let xxtsId = '';
const init = async (data?: any) => {
xxtsId = '';
setXxts({});
let ret = {
success: true,
@ -28,6 +29,7 @@ export const XkTfPageUtils = {
}
let url = "/pages/base/message/index";
try {
xxtsId = data.id;
// 优先从后端根据url中的id去查询Xxts
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
if (xxtsRes && xxtsRes.result) {
@ -63,18 +65,22 @@ export const XkTfPageUtils = {
return ret;
}
}
},
// 检查待办状态是否需要更新
async updateXxts() {
};
const updateXxts = async () => {
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
if (!getXxts || !getXxts.id) {
if (!xxtsId || !xxtsId.length) {
return false;
}
console.log("更新待办状态getXxts", getXxts);
// 更新待办状态
await xxtsSaveApi({
id: getXxts.id,
dbZt: "B",
id: xxtsId,
});
return true;
},
}
export const XkTfPageUtils = {
init,
updateXxts
}