| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import { getInspectOrderGet } from "@/api/inspection";
- import { getRepairDetail } from "@/api/repair";
- /**
- * 根据不同类型的消息跳转目标页面
- * @param data
- */
- export const messageNavigate = async (data) => {
- if (!data.userId) {
- data.userId = "";
- }
- if (data.type === "generateInspect") {
- // 巡检工单填写页面
- const detail = (await getInspectOrderGet({ id: data.id })).data;
- if (detail.status === "finished") {
- uni.navigateTo({
- url: `/pages/inspection/detail?id=${data.id}&reloginUserId=${data.userId}`,
- });
- } else {
- uni.navigateTo({
- url: `/pages/inspection/edit?id=${data.id}&reloginUserId=${data.userId}`,
- });
- }
- } else if (data.type === "failureReport") {
- // 故障上报审批页面
- uni.navigateTo({
- url: `/pages/message/detail/index?processInstanceId=${data.id}&reloginUserId=${data.userId}`,
- });
- } else if (data.type === "generateMaintain") {
- // 维修工单填写页面
- const detail = (await getRepairDetail({ id: data.id })).data;
- if (detail.status !== "tx") {
- uni.navigateTo({
- url: `/pages/repair/detail?id=${data.id}&reloginUserId=${data.userId}`,
- });
- } else {
- uni.navigateTo({
- url: `/pages/repair/edit?id=${data.id}&reloginUserId=${data.userId}`,
- });
- }
- } else if (data.type === "maintainOut") {
- // 维修工单委外流程审批页面
- uni.navigateTo({
- url: `/pages/message/detail/index?processInstanceId=${data.id}&reloginUserId=${data.userId}`,
- });
- } else if (data.type === "generateMaintenance") {
- // 保养工单填写页面
- uni.navigateTo({
- url: `/pages/maintenance/edit?id=${data.id}&reloginUserId=${data.userId}`,
- });
- } else if (data.type === "generateOperation") {
- // 运行记录填写页面
- const json = JSON.stringify({
- deptId: data.deptId,
- userId: data.userId,
- createTime: data.createTime,
- orderId: data.id,
- orderStatus: data.orderStatus,
- orderName: data.orderName,
- userName: data.userName,
- });
- // {0: '待填写', 1: '已完成', 2: '填写中', 3: '忽略'}
- uni.navigateTo({
- url: `/pages/recordFilling/detail?view=${
- data.orderStatus % 2 == 0 ? 1 : 0
- }¶m=${json}&reloginUserId=${data.userId}`,
- });
- }
- };
|