654 lines
27 KiB
JavaScript
654 lines
27 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const request_api = require("../../request/api.js");
|
|
const utils_draftCache = require("../../utils/draftCache.js");
|
|
const utils_useDraftCache = require("../../utils/useDraftCache.js");
|
|
const components_hazard_hazardForm = require("../../components/hazard/hazardForm.js");
|
|
if (!Array) {
|
|
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
|
const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
|
|
const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
|
|
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
|
(_easycom_up_icon2 + _easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
|
}
|
|
const _easycom_up_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js";
|
|
const _easycom_u_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
|
|
const _easycom_u_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
|
|
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
|
if (!Math) {
|
|
(_easycom_up_icon + _easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea + HazardFormPopup + _easycom_u_popup)();
|
|
}
|
|
const HazardFormPopup = () => "../../components/hazard/HazardFormPopup.js";
|
|
const TASK_STATUS_SUBMITTED = 2;
|
|
const _sfc_main = {
|
|
__name: "detail",
|
|
setup(__props) {
|
|
const oneTableId = common_vendor.ref("");
|
|
const tableId = common_vendor.ref("");
|
|
const taskDate = common_vendor.ref("");
|
|
const planName = common_vendor.ref("");
|
|
const loading = common_vendor.ref(true);
|
|
const checkItemList = common_vendor.ref([]);
|
|
const answerList = common_vendor.ref([]);
|
|
const sessionSubmittedTaskIds = common_vendor.ref(/* @__PURE__ */ new Set());
|
|
const showHazardPopup = common_vendor.ref(false);
|
|
const showCheckSheet = common_vendor.ref(false);
|
|
const activeHazardIndex = common_vendor.ref(-1);
|
|
const hazardFormRef = common_vendor.ref(null);
|
|
const editingHazardPayload = common_vendor.ref(components_hazard_hazardForm.createEmptyHazardPayload());
|
|
const resultOptions = [
|
|
{ name: "正常", value: 1 },
|
|
{ name: "异常", value: 2 },
|
|
{ name: "不涉及", value: 3 }
|
|
];
|
|
const syncSubmittedTaskIds = (list) => {
|
|
const next = new Set(sessionSubmittedTaskIds.value);
|
|
(list || []).forEach((item) => {
|
|
if ((item == null ? void 0 : item.status) === TASK_STATUS_SUBMITTED && item.taskId != null) {
|
|
next.add(item.taskId);
|
|
}
|
|
});
|
|
sessionSubmittedTaskIds.value = next;
|
|
};
|
|
const isItemSubmitted = (item) => {
|
|
if (!item)
|
|
return false;
|
|
if (item.status === TASK_STATUS_SUBMITTED)
|
|
return true;
|
|
if (item.taskId != null && sessionSubmittedTaskIds.value.has(item.taskId))
|
|
return true;
|
|
return false;
|
|
};
|
|
const getResultLabel = (result) => {
|
|
const opt = resultOptions.find((o) => o.value === result);
|
|
return (opt == null ? void 0 : opt.name) || "-";
|
|
};
|
|
const getResultTagClass = (result) => {
|
|
if (result === 1)
|
|
return "result-tag--normal";
|
|
if (result === 2)
|
|
return "result-tag--abnormal";
|
|
if (result === 3)
|
|
return "result-tag--na";
|
|
return "";
|
|
};
|
|
const viewHazardDetail = (item) => {
|
|
if (!(item == null ? void 0 : item.hazardId)) {
|
|
common_vendor.index.showToast({ title: "暂无隐患信息", icon: "none" });
|
|
return;
|
|
}
|
|
common_vendor.index.navigateTo({
|
|
url: `/pages/hiddendanger/process-chain?hazardId=${item.hazardId}`
|
|
});
|
|
};
|
|
common_vendor.computed(() => {
|
|
var _a;
|
|
return planName.value || ((_a = checkItemList.value[0]) == null ? void 0 : _a.itemName) || "检查表";
|
|
});
|
|
common_vendor.computed(() => {
|
|
var _a;
|
|
return ((_a = checkItemList.value[0]) == null ? void 0 : _a.industryName) || "";
|
|
});
|
|
const createEmptyAnswer = () => ({
|
|
resultLabel: "",
|
|
result: null,
|
|
remark: "",
|
|
hazardPayload: components_hazard_hazardForm.createEmptyHazardPayload()
|
|
});
|
|
const normalizeSheetAnswer = (answer) => {
|
|
if (!answer)
|
|
return createEmptyAnswer();
|
|
const hazardPayload = answer.hazardPayload || components_hazard_hazardForm.createEmptyHazardPayload();
|
|
const empty = components_hazard_hazardForm.createEmptyHazardPayload();
|
|
return {
|
|
resultLabel: answer.resultLabel || "",
|
|
result: answer.result ?? null,
|
|
remark: answer.remark || "",
|
|
hazardPayload: {
|
|
formData: {
|
|
...empty.formData,
|
|
...hazardPayload.formData || {}
|
|
},
|
|
address: hazardPayload.address || "",
|
|
lng: hazardPayload.lng || 0,
|
|
lat: hazardPayload.lat || 0,
|
|
areaId: hazardPayload.areaId || "",
|
|
areaName: hazardPayload.areaName || "",
|
|
fileList: Array.isArray(hazardPayload.fileList) ? [...hazardPayload.fileList] : [],
|
|
tagOptions: Array.isArray(hazardPayload.tagOptions) ? [...hazardPayload.tagOptions] : []
|
|
}
|
|
};
|
|
};
|
|
const syncAnswerFields = (answer) => {
|
|
const normalized = normalizeSheetAnswer(answer);
|
|
if (!normalized.resultLabel && normalized.result != null) {
|
|
const opt = resultOptions.find((o) => o.value === normalized.result);
|
|
if (opt)
|
|
normalized.resultLabel = opt.name;
|
|
} else if (normalized.resultLabel && normalized.result == null) {
|
|
const opt = resultOptions.find((o) => o.name === normalized.resultLabel);
|
|
if (opt)
|
|
normalized.result = opt.value;
|
|
}
|
|
return normalized;
|
|
};
|
|
const buildAnswerFromTask = (item) => {
|
|
const answer = createEmptyAnswer();
|
|
if (!isItemSubmitted(item)) {
|
|
return answer;
|
|
}
|
|
answer.result = item.result;
|
|
answer.remark = item.remark || "";
|
|
const opt = resultOptions.find((o) => o.value === item.result);
|
|
if (opt) {
|
|
answer.resultLabel = opt.name;
|
|
}
|
|
if (item.result === 2 && item.hazardName) {
|
|
const sourceIndex = components_hazard_hazardForm.SOURCE_OPTIONS.findIndex((o) => o.title === item.source);
|
|
const hazardSourceCode = item.hazardSourceCode ?? (item.hazardSource != null && item.hazardSource !== "" && !Number.isNaN(Number(item.hazardSource)) ? Number(item.hazardSource) : null);
|
|
answer.hazardPayload = {
|
|
...components_hazard_hazardForm.createEmptyHazardPayload(),
|
|
formData: {
|
|
...components_hazard_hazardForm.createEmptyHazardPayload().formData,
|
|
title: item.hazardName || "",
|
|
description: item.hazardDesc || "",
|
|
source: sourceIndex >= 0 ? sourceIndex : 0,
|
|
hazardSourceCode,
|
|
hazardSourceName: item.hazardSourceName || ""
|
|
},
|
|
address: item.hazardAddress || ""
|
|
};
|
|
}
|
|
return syncAnswerFields(answer);
|
|
};
|
|
const isAnswerFilled = (answer) => {
|
|
if (!answer)
|
|
return false;
|
|
return !!(answer.resultLabel || answer.result != null);
|
|
};
|
|
const hasAnswerDraftContent = (answer) => {
|
|
var _a, _b;
|
|
if (!answer)
|
|
return false;
|
|
const normalized = normalizeSheetAnswer(answer);
|
|
const hazard = normalized.hazardPayload;
|
|
return !!(normalized.resultLabel || normalized.result != null || normalized.remark || ((_a = hazard.formData) == null ? void 0 : _a.title) || ((_b = hazard.formData) == null ? void 0 : _b.description) || hazard.fileList && hazard.fileList.length > 0);
|
|
};
|
|
const buildDraftAnswers = () => {
|
|
return checkItemList.value.map((item, index) => {
|
|
if (isItemSubmitted(item))
|
|
return null;
|
|
const answer = answerList.value[index] || createEmptyAnswer();
|
|
if (!hasAnswerDraftContent(answer))
|
|
return null;
|
|
return {
|
|
taskId: item.taskId,
|
|
...JSON.parse(JSON.stringify(answer))
|
|
};
|
|
}).filter(Boolean);
|
|
};
|
|
const pruneDraftSubmitted = (taskIds = []) => {
|
|
var _a;
|
|
const key = utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.INSPECTION_SHEET, oneTableId.value, taskDate.value);
|
|
const { data } = utils_draftCache.loadDraftWithFallback(key);
|
|
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length))
|
|
return;
|
|
const submittedSet = new Set(taskIds);
|
|
const remainingAnswers = data.answers.filter(
|
|
(answer) => (answer == null ? void 0 : answer.taskId) == null || !submittedSet.has(answer.taskId)
|
|
);
|
|
if (!remainingAnswers.length) {
|
|
utils_draftCache.removeDraft(key);
|
|
return;
|
|
}
|
|
utils_draftCache.saveDraftToStorage(key, {
|
|
...data,
|
|
answers: remainingAnswers
|
|
});
|
|
};
|
|
const isItemPendingSubmit = (index) => {
|
|
const item = checkItemList.value[index];
|
|
return !isItemSubmitted(item) && isAnswerFilled(answerList.value[index]);
|
|
};
|
|
const submittedCount = common_vendor.computed(() => {
|
|
return checkItemList.value.filter(isItemSubmitted).length;
|
|
});
|
|
const pendingSubmitCount = common_vendor.computed(() => {
|
|
return checkItemList.value.filter((item, index) => isItemPendingSubmit(index)).length;
|
|
});
|
|
const uncheckedCount = common_vendor.computed(() => {
|
|
return Math.max(checkItemList.value.length - submittedCount.value - pendingSubmitCount.value, 0);
|
|
});
|
|
const getSheetCellClass = (index) => {
|
|
const item = checkItemList.value[index];
|
|
if (isItemSubmitted(item))
|
|
return "check-sheet-cell--submitted";
|
|
if (isItemPendingSubmit(index))
|
|
return "check-sheet-cell--pending";
|
|
return "";
|
|
};
|
|
const progressPercent = common_vendor.computed(() => {
|
|
if (!checkItemList.value.length)
|
|
return 0;
|
|
return Math.round(submittedCount.value / checkItemList.value.length * 100);
|
|
});
|
|
const sheetDraftHasContent = (data) => {
|
|
var _a;
|
|
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length))
|
|
return false;
|
|
return data.answers.some((answer) => hasAnswerDraftContent(answer));
|
|
};
|
|
const {
|
|
showRestoreBanner,
|
|
clear: clearDraft,
|
|
restore: restoreDraft,
|
|
bindAutoSave
|
|
} = utils_useDraftCache.useDraftCache({
|
|
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.INSPECTION_SHEET, oneTableId.value, taskDate.value),
|
|
getPayload: () => ({
|
|
oneTableId: oneTableId.value,
|
|
taskDate: taskDate.value,
|
|
planName: planName.value,
|
|
answers: buildDraftAnswers()
|
|
}),
|
|
hasContent: sheetDraftHasContent,
|
|
applyPayload: (data) => {
|
|
var _a;
|
|
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length) || !checkItemList.value.length)
|
|
return;
|
|
answerList.value = checkItemList.value.map((item, index) => {
|
|
if (isItemSubmitted(item)) {
|
|
return buildAnswerFromTask(item);
|
|
}
|
|
const savedByIndex = data.answers[index];
|
|
if (savedByIndex && sheetDraftHasContent({ answers: [savedByIndex] })) {
|
|
return syncAnswerFields(savedByIndex);
|
|
}
|
|
if (item.taskId != null && item.taskId !== "") {
|
|
const savedByTaskId = data.answers.find((a) => a.taskId === item.taskId);
|
|
if (savedByTaskId) {
|
|
return syncAnswerFields(savedByTaskId);
|
|
}
|
|
}
|
|
return createEmptyAnswer();
|
|
});
|
|
if (data.planName && !planName.value) {
|
|
planName.value = data.planName;
|
|
}
|
|
},
|
|
clearForm: () => {
|
|
answerList.value = checkItemList.value.map((item) => isItemSubmitted(item) ? buildAnswerFromTask(item) : createEmptyAnswer());
|
|
},
|
|
canSave: () => !!oneTableId.value && !!taskDate.value && checkItemList.value.length > 0,
|
|
requireInitialized: true
|
|
});
|
|
bindAutoSave(() => answerList.value);
|
|
const onResultChange = (index, label) => {
|
|
const answer = answerList.value[index];
|
|
if (!answer)
|
|
return;
|
|
answer.resultLabel = label;
|
|
const selected = resultOptions.find((opt) => opt.name === label);
|
|
answer.result = selected ? selected.value : null;
|
|
if (label !== "异常") {
|
|
answer.hazardPayload = components_hazard_hazardForm.createEmptyHazardPayload();
|
|
}
|
|
};
|
|
const hazardFormExtraParams = common_vendor.computed(() => {
|
|
var _a;
|
|
const index = activeHazardIndex.value;
|
|
const taskId = index >= 0 ? (_a = checkItemList.value[index]) == null ? void 0 : _a.taskId : "";
|
|
return {
|
|
locationDraftKey: `hazard_location_${oneTableId.value}_${taskDate.value}_${taskId || index}`
|
|
};
|
|
});
|
|
const hasHazardData = (index) => {
|
|
var _a;
|
|
return components_hazard_hazardForm.hasValidHazardPayload((_a = answerList.value[index]) == null ? void 0 : _a.hazardPayload);
|
|
};
|
|
const openHazardPopup = (index) => {
|
|
var _a;
|
|
activeHazardIndex.value = index;
|
|
editingHazardPayload.value = JSON.parse(JSON.stringify(
|
|
((_a = answerList.value[index]) == null ? void 0 : _a.hazardPayload) ?? components_hazard_hazardForm.createEmptyHazardPayload()
|
|
));
|
|
showHazardPopup.value = true;
|
|
};
|
|
const closeHazardPopup = () => {
|
|
showHazardPopup.value = false;
|
|
activeHazardIndex.value = -1;
|
|
editingHazardPayload.value = components_hazard_hazardForm.createEmptyHazardPayload();
|
|
};
|
|
const onHazardConfirm = (payload) => {
|
|
const index = activeHazardIndex.value;
|
|
const data = payload || editingHazardPayload.value;
|
|
if (index >= 0 && data && answerList.value[index]) {
|
|
answerList.value[index].hazardPayload = JSON.parse(JSON.stringify(data));
|
|
}
|
|
closeHazardPopup();
|
|
};
|
|
const clearHazard = (index) => {
|
|
if (answerList.value[index]) {
|
|
answerList.value[index].hazardPayload = components_hazard_hazardForm.createEmptyHazardPayload();
|
|
}
|
|
};
|
|
const openCheckSheet = () => {
|
|
showCheckSheet.value = true;
|
|
};
|
|
const closeCheckSheet = () => {
|
|
showCheckSheet.value = false;
|
|
};
|
|
const handleSheetSubmit = () => {
|
|
closeCheckSheet();
|
|
handleSubmitAll();
|
|
};
|
|
const scrollToItem = (index) => {
|
|
closeCheckSheet();
|
|
common_vendor.nextTick$1(() => {
|
|
common_vendor.index.pageScrollTo({
|
|
selector: `#check-item-${index}`,
|
|
duration: 300,
|
|
offsetTop: -80
|
|
});
|
|
});
|
|
};
|
|
const getFilledAnswerIndices = () => {
|
|
const indices = [];
|
|
for (let i = 0; i < checkItemList.value.length; i++) {
|
|
if (!isItemSubmitted(checkItemList.value[i]) && isAnswerFilled(answerList.value[i])) {
|
|
indices.push(i);
|
|
}
|
|
}
|
|
return indices;
|
|
};
|
|
const validateFilledAnswers = () => {
|
|
const indices = getFilledAnswerIndices();
|
|
if (!indices.length) {
|
|
common_vendor.index.showToast({ title: "请先填写待提交的检查项", icon: "none" });
|
|
return null;
|
|
}
|
|
for (const index of indices) {
|
|
const answer = answerList.value[index];
|
|
if (answer.resultLabel === "异常" && !components_hazard_hazardForm.hasValidHazardPayload(answer.hazardPayload)) {
|
|
common_vendor.index.showToast({ title: `第 ${index + 1} 项为异常,请填写隐患信息`, icon: "none" });
|
|
return null;
|
|
}
|
|
}
|
|
return indices;
|
|
};
|
|
const buildSubmitPayload = (filledIndices) => {
|
|
return filledIndices.filter((index) => !isItemSubmitted(checkItemList.value[index])).map((index) => {
|
|
const item = checkItemList.value[index];
|
|
const answer = syncAnswerFields(answerList.value[index]);
|
|
const payload = {
|
|
taskId: item.taskId,
|
|
result: answer.result,
|
|
remark: answer.remark || ""
|
|
};
|
|
if (answer.resultLabel === "异常" && components_hazard_hazardForm.hasValidHazardPayload(answer.hazardPayload)) {
|
|
payload.hazard = components_hazard_hazardForm.buildHiddenDangerParams(answer.hazardPayload, {
|
|
taskId: item.taskId,
|
|
checkPointId: item.checkPointId
|
|
});
|
|
}
|
|
return payload;
|
|
});
|
|
};
|
|
const goToListPage = () => {
|
|
common_vendor.index.navigateBack();
|
|
};
|
|
const handleSubmitAll = async () => {
|
|
const filledIndices = validateFilledAnswers();
|
|
if (!filledIndices)
|
|
return;
|
|
const submitList = buildSubmitPayload(filledIndices);
|
|
if (!submitList.length) {
|
|
common_vendor.index.showToast({ title: "没有可提交的新检查项", icon: "none" });
|
|
return;
|
|
}
|
|
try {
|
|
common_vendor.index.showLoading({ title: "提交中..." });
|
|
const res = await request_api.submitAllTask(submitList);
|
|
common_vendor.index.hideLoading();
|
|
if (res.code === 0) {
|
|
const nextSubmitted = new Set(sessionSubmittedTaskIds.value);
|
|
submitList.forEach((item) => {
|
|
if (item.taskId != null) {
|
|
nextSubmitted.add(item.taskId);
|
|
}
|
|
});
|
|
sessionSubmittedTaskIds.value = nextSubmitted;
|
|
pruneDraftSubmitted(submitList.map((item) => item.taskId));
|
|
common_vendor.index.showToast({
|
|
title: `已成功提交 ${submitList.length} 项`,
|
|
icon: "success"
|
|
});
|
|
setTimeout(() => {
|
|
goToListPage();
|
|
}, 1500);
|
|
} else {
|
|
common_vendor.index.showToast({ title: res.msg || "提交失败", icon: "none" });
|
|
}
|
|
} catch (error) {
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.__f__("error", "at pages/Inspectionresult/detail.vue:745", "提交失败:", error);
|
|
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
|
|
}
|
|
};
|
|
const fetchDetail = async () => {
|
|
var _a;
|
|
if (!oneTableId.value || !taskDate.value) {
|
|
loading.value = false;
|
|
common_vendor.index.showToast({ title: "缺少任务参数", icon: "none" });
|
|
return;
|
|
}
|
|
loading.value = true;
|
|
try {
|
|
const res = await request_api.getAllTask(oneTableId.value, taskDate.value);
|
|
if (res.code === 0) {
|
|
const list = Array.isArray(res.data) ? res.data : ((_a = res.data) == null ? void 0 : _a.records) || [];
|
|
syncSubmittedTaskIds(list);
|
|
checkItemList.value = list;
|
|
answerList.value = list.map((item) => buildAnswerFromTask(item));
|
|
restoreDraft();
|
|
} else {
|
|
common_vendor.index.showToast({ title: res.msg || "获取检查项失败", icon: "none" });
|
|
}
|
|
} catch (error) {
|
|
common_vendor.index.__f__("error", "at pages/Inspectionresult/detail.vue:769", "获取检查项失败:", error);
|
|
common_vendor.index.showToast({ title: "获取检查项失败", icon: "none" });
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
};
|
|
common_vendor.onLoad((options) => {
|
|
if (options.oneTableId) {
|
|
oneTableId.value = options.oneTableId;
|
|
} else if (options.id) {
|
|
oneTableId.value = options.id;
|
|
}
|
|
if (options.taskDate) {
|
|
taskDate.value = decodeURIComponent(options.taskDate).split(" ")[0];
|
|
}
|
|
if (options.name) {
|
|
planName.value = decodeURIComponent(options.name);
|
|
}
|
|
if (options.tableId) {
|
|
tableId.value = options.tableId;
|
|
}
|
|
fetchDetail();
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: loading.value
|
|
}, loading.value ? {} : !checkItemList.value.length ? {} : common_vendor.e({
|
|
c: common_vendor.t(checkItemList.value.length),
|
|
d: common_vendor.t(submittedCount.value),
|
|
e: common_vendor.t(pendingSubmitCount.value),
|
|
f: common_vendor.t(uncheckedCount.value),
|
|
g: progressPercent.value + "%",
|
|
h: common_vendor.p({
|
|
name: "grid",
|
|
size: "22",
|
|
color: "#2667E9"
|
|
}),
|
|
i: common_vendor.o(openCheckSheet),
|
|
j: common_vendor.unref(showRestoreBanner)
|
|
}, common_vendor.unref(showRestoreBanner) ? {
|
|
k: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true))
|
|
} : {}, {
|
|
l: common_vendor.f(checkItemList.value, (item, index, i0) => {
|
|
var _a, _b;
|
|
return common_vendor.e({
|
|
a: common_vendor.t(index + 1),
|
|
b: isItemSubmitted(item)
|
|
}, isItemSubmitted(item) ? {} : isItemPendingSubmit(index) ? {} : {}, {
|
|
c: isItemPendingSubmit(index),
|
|
d: common_vendor.t(item.name),
|
|
e: item.point || "",
|
|
f: isItemSubmitted(item)
|
|
}, isItemSubmitted(item) ? common_vendor.e({
|
|
g: common_vendor.t(getResultLabel(item.result)),
|
|
h: common_vendor.n(getResultTagClass(item.result)),
|
|
i: item.remark
|
|
}, item.remark ? {
|
|
j: common_vendor.t(item.remark)
|
|
} : {}, {
|
|
k: item.result === 2
|
|
}, item.result === 2 ? common_vendor.e({
|
|
l: item.hazardName
|
|
}, item.hazardName ? {
|
|
m: common_vendor.t(item.hazardName)
|
|
} : {}, {
|
|
n: item.source
|
|
}, item.source ? {
|
|
o: common_vendor.t(item.source)
|
|
} : {}, {
|
|
p: item.hazardSource
|
|
}, item.hazardSource ? {
|
|
q: common_vendor.t(item.hazardSource)
|
|
} : {}, {
|
|
r: item.hazardAddress
|
|
}, item.hazardAddress ? {
|
|
s: common_vendor.t(item.hazardAddress)
|
|
} : {}, {
|
|
t: item.hazardDesc
|
|
}, item.hazardDesc ? {
|
|
v: common_vendor.t(item.hazardDesc)
|
|
} : {}) : {}, {
|
|
w: item.result === 2 && item.hazardId
|
|
}, item.result === 2 && item.hazardId ? {
|
|
x: common_vendor.o(($event) => viewHazardDetail(item), "check-item-" + index)
|
|
} : {}) : common_vendor.e({
|
|
y: common_vendor.f(resultOptions, (opt, optIndex, i1) => {
|
|
return {
|
|
a: optIndex,
|
|
b: "1b3bf21b-2-" + i0 + "-" + i1 + "," + ("1b3bf21b-1-" + i0),
|
|
c: common_vendor.p({
|
|
customStyle: {
|
|
marginBottom: "8px",
|
|
marginRight: "24rpx"
|
|
},
|
|
label: opt.name,
|
|
name: opt.name
|
|
})
|
|
};
|
|
}),
|
|
z: common_vendor.o((label) => onResultChange(index, label), "check-item-" + index),
|
|
A: "1b3bf21b-1-" + i0,
|
|
B: common_vendor.o(($event) => answerList.value[index].resultLabel = $event, "check-item-" + index),
|
|
C: common_vendor.p({
|
|
placement: "row",
|
|
modelValue: answerList.value[index].resultLabel
|
|
}),
|
|
D: answerList.value[index].resultLabel === "异常"
|
|
}, answerList.value[index].resultLabel === "异常" ? common_vendor.e({
|
|
E: !hasHazardData(index)
|
|
}, !hasHazardData(index) ? {
|
|
F: common_vendor.o(($event) => openHazardPopup(index), "check-item-" + index)
|
|
} : common_vendor.e({
|
|
G: common_vendor.t(answerList.value[index].hazardPayload.formData.title),
|
|
H: common_vendor.t((_a = common_vendor.unref(components_hazard_hazardForm.LEVEL_OPTIONS)[answerList.value[index].hazardPayload.formData.level]) == null ? void 0 : _a.title),
|
|
I: answerList.value[index].hazardPayload.formData.level === 0 ? 1 : "",
|
|
J: answerList.value[index].hazardPayload.formData.level === 1 ? 1 : "",
|
|
K: answerList.value[index].hazardPayload.formData.level === 2 ? 1 : "",
|
|
L: common_vendor.t(((_b = common_vendor.unref(components_hazard_hazardForm.SOURCE_OPTIONS)[answerList.value[index].hazardPayload.formData.source]) == null ? void 0 : _b.title) || "-"),
|
|
M: common_vendor.t(answerList.value[index].hazardPayload.formData.hazardSourceName || "-"),
|
|
N: common_vendor.t(answerList.value[index].hazardPayload.address || "-"),
|
|
O: common_vendor.t(answerList.value[index].hazardPayload.formData.description || "-"),
|
|
P: answerList.value[index].hazardPayload.fileList.length > 0
|
|
}, answerList.value[index].hazardPayload.fileList.length > 0 ? {
|
|
Q: common_vendor.t(answerList.value[index].hazardPayload.fileList.length)
|
|
} : {}, {
|
|
R: common_vendor.o(($event) => openHazardPopup(index), "check-item-" + index),
|
|
S: common_vendor.o(($event) => clearHazard(index), "check-item-" + index)
|
|
})) : {}, {
|
|
T: "1b3bf21b-3-" + i0,
|
|
U: common_vendor.o(($event) => answerList.value[index].remark = $event, "check-item-" + index),
|
|
V: common_vendor.p({
|
|
placeholder: "请输入备注信息",
|
|
modelValue: answerList.value[index].remark
|
|
})
|
|
}), {
|
|
W: "check-item-" + index,
|
|
X: "check-item-" + index,
|
|
Y: isItemSubmitted(item) ? 1 : ""
|
|
});
|
|
}),
|
|
m: pendingSubmitCount.value > 0
|
|
}, pendingSubmitCount.value > 0 ? {
|
|
n: common_vendor.t(pendingSubmitCount.value),
|
|
o: common_vendor.o(handleSubmitAll)
|
|
} : {}), {
|
|
b: !checkItemList.value.length,
|
|
p: activeHazardIndex.value >= 0
|
|
}, activeHazardIndex.value >= 0 ? {
|
|
q: common_vendor.sr(hazardFormRef, "1b3bf21b-4", {
|
|
"k": "hazardFormRef"
|
|
}),
|
|
r: common_vendor.o(onHazardConfirm),
|
|
s: common_vendor.o(($event) => showHazardPopup.value = $event),
|
|
t: common_vendor.o(($event) => editingHazardPayload.value = $event),
|
|
v: common_vendor.p({
|
|
title: "填写隐患信息",
|
|
mode: "collect",
|
|
["body-height"]: "60vh",
|
|
["extra-params"]: hazardFormExtraParams.value,
|
|
show: showHazardPopup.value,
|
|
modelValue: editingHazardPayload.value
|
|
})
|
|
} : {}, {
|
|
w: common_vendor.t(checkItemList.value.length),
|
|
x: common_vendor.f(checkItemList.value, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(index + 1),
|
|
b: "sheet-nav-" + index,
|
|
c: common_vendor.n(getSheetCellClass(index)),
|
|
d: common_vendor.o(($event) => scrollToItem(index), "sheet-nav-" + index)
|
|
};
|
|
}),
|
|
y: common_vendor.t(submittedCount.value),
|
|
z: common_vendor.t(pendingSubmitCount.value),
|
|
A: common_vendor.t(uncheckedCount.value),
|
|
B: pendingSubmitCount.value > 0
|
|
}, pendingSubmitCount.value > 0 ? {
|
|
C: common_vendor.o(handleSheetSubmit)
|
|
} : {}, {
|
|
D: common_vendor.o(closeCheckSheet),
|
|
E: common_vendor.p({
|
|
show: showCheckSheet.value,
|
|
mode: "bottom",
|
|
round: "20",
|
|
["safe-area-inset-bottom"]: true
|
|
}),
|
|
F: common_vendor.gei(_ctx, "")
|
|
});
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1b3bf21b"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionresult/detail.js.map
|