修复待办更新时的异常
This commit is contained in:
parent
4a4573e51c
commit
c5fc913a27
@ -52,7 +52,9 @@ const handleQjDataLoaded = (data: any) => {
|
|||||||
QjPageUtils.updateXxts();
|
QjPageUtils.updateXxts();
|
||||||
}
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
if (dkRef.value) {
|
||||||
dkRef.value.init();
|
dkRef.value.init();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -67,6 +67,12 @@ const spParams = computed(() => {
|
|||||||
|
|
||||||
const handleQjDataLoaded = async (data: any) => {
|
const handleQjDataLoaded = async (data: any) => {
|
||||||
data = data || {};
|
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);
|
const dkfs = typeof (data.dkfs) === "string" ? parseInt(data.dkfs) : (data.dkfs || 2);
|
||||||
data.dkfs = dkfs;
|
data.dkfs = dkfs;
|
||||||
qjData.value = data;
|
qjData.value = data;
|
||||||
@ -77,7 +83,9 @@ const handleQjDataLoaded = async (data: any) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
if (dkRef.value) {
|
||||||
dkRef.value.init();
|
dkRef.value.init();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,10 @@ import { useDataStore } from "@/store/modules/data";
|
|||||||
const { loginByOpenId } = useUserStore();
|
const { loginByOpenId } = useUserStore();
|
||||||
const { getGwData, setXxts, setGwData, getXxts } = useDataStore();
|
const { getGwData, setXxts, setGwData, getXxts } = useDataStore();
|
||||||
|
|
||||||
export const GwPageUtils = {
|
let xxtsId = "";
|
||||||
// 初始化校验
|
|
||||||
async init(data?: any) {
|
const init = async (data?: any) => {
|
||||||
|
xxtsId = '';
|
||||||
setXxts({});
|
setXxts({});
|
||||||
let ret = {
|
let ret = {
|
||||||
success: true,
|
success: true,
|
||||||
@ -33,6 +34,7 @@ export const GwPageUtils = {
|
|||||||
}
|
}
|
||||||
let url = "/pages/base/message/index";
|
let url = "/pages/base/message/index";
|
||||||
try {
|
try {
|
||||||
|
xxtsId = data.id;
|
||||||
// 优先从后端根据url中的id去查询Xxts
|
// 优先从后端根据url中的id去查询Xxts
|
||||||
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
|
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
|
||||||
if (xxtsRes && xxtsRes.result) {
|
if (xxtsRes && xxtsRes.result) {
|
||||||
@ -71,19 +73,23 @@ export const GwPageUtils = {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
// 检查待办状态是否需要更新
|
|
||||||
async updateXxts() {
|
const updateXxts = async () => {
|
||||||
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
|
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
|
||||||
if (!getXxts || !getXxts.id) {
|
if (!xxtsId || !xxtsId.length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log("更新待办状态:getXxts", getXxts);
|
console.log("更新待办状态:getXxts", getXxts);
|
||||||
// 更新待办状态
|
// 更新待办状态
|
||||||
await xxtsSaveApi({
|
await xxtsSaveApi({
|
||||||
id: getXxts.id,
|
id: xxtsId,
|
||||||
dbZt: "B",
|
dbZt: "B",
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export const GwPageUtils = {
|
||||||
|
init,
|
||||||
|
updateXxts
|
||||||
}
|
}
|
||||||
@ -31,7 +31,10 @@ const qrStatus: any = {
|
|||||||
"rejected": "拒绝",
|
"rejected": "拒绝",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let xxtsId = "";
|
||||||
|
|
||||||
const init = async (data?: any) => {
|
const init = async (data?: any) => {
|
||||||
|
xxtsId = '';
|
||||||
setXxts({});
|
setXxts({});
|
||||||
let ret = {
|
let ret = {
|
||||||
success: true,
|
success: true,
|
||||||
@ -52,6 +55,7 @@ const init = async (data?: any) => {
|
|||||||
}
|
}
|
||||||
let url = "/pages/base/message/index";
|
let url = "/pages/base/message/index";
|
||||||
try {
|
try {
|
||||||
|
xxtsId = data.id;
|
||||||
// 优先从后端根据url中的id去查询Xxts
|
// 优先从后端根据url中的id去查询Xxts
|
||||||
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
|
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
|
||||||
if (xxtsRes && xxtsRes.result) {
|
if (xxtsRes && xxtsRes.result) {
|
||||||
@ -94,13 +98,13 @@ const init = async (data?: any) => {
|
|||||||
|
|
||||||
const updateXxts = async () => {
|
const updateXxts = async () => {
|
||||||
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
|
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
|
||||||
if (!getXxts || !getXxts.id) {
|
if (!xxtsId || !xxtsId.length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log("更新待办状态:getXxts", getXxts);
|
console.log("更新待办状态:getXxts", getXxts);
|
||||||
// 更新待办状态
|
// 更新待办状态
|
||||||
await xxtsSaveApi({
|
await xxtsSaveApi({
|
||||||
id: getXxts.id,
|
id: xxtsId,
|
||||||
dbZt: "B",
|
dbZt: "B",
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -5,9 +5,10 @@ import { useDataStore } from "@/store/modules/data";
|
|||||||
const { loginByOpenId } = useUserStore();
|
const { loginByOpenId } = useUserStore();
|
||||||
const { getData, setXxts, setData, getXxts } = useDataStore();
|
const { getData, setXxts, setData, getXxts } = useDataStore();
|
||||||
|
|
||||||
export const XkTfPageUtils = {
|
let xxtsId = '';
|
||||||
// 初始化校验
|
|
||||||
async init(data?: any) {
|
const init = async (data?: any) => {
|
||||||
|
xxtsId = '';
|
||||||
setXxts({});
|
setXxts({});
|
||||||
let ret = {
|
let ret = {
|
||||||
success: true,
|
success: true,
|
||||||
@ -28,6 +29,7 @@ export const XkTfPageUtils = {
|
|||||||
}
|
}
|
||||||
let url = "/pages/base/message/index";
|
let url = "/pages/base/message/index";
|
||||||
try {
|
try {
|
||||||
|
xxtsId = data.id;
|
||||||
// 优先从后端根据url中的id去查询Xxts
|
// 优先从后端根据url中的id去查询Xxts
|
||||||
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
|
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
|
||||||
if (xxtsRes && xxtsRes.result) {
|
if (xxtsRes && xxtsRes.result) {
|
||||||
@ -63,18 +65,22 @@ export const XkTfPageUtils = {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
// 检查待办状态是否需要更新
|
|
||||||
async updateXxts() {
|
const updateXxts = async () => {
|
||||||
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
|
// 如果没有查询过消息推送,表示不是从待办进入的,不自动更新,
|
||||||
if (!getXxts || !getXxts.id) {
|
if (!xxtsId || !xxtsId.length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
console.log("更新待办状态:getXxts", getXxts);
|
||||||
// 更新待办状态
|
// 更新待办状态
|
||||||
await xxtsSaveApi({
|
await xxtsSaveApi({
|
||||||
id: getXxts.id,
|
id: xxtsId,
|
||||||
dbZt: "B",
|
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
},
|
}
|
||||||
|
|
||||||
|
export const XkTfPageUtils = {
|
||||||
|
init,
|
||||||
|
updateXxts
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user