"use strict"; const common_vendor = require("../../common/vendor.js"); const utils_dict = require("../../utils/dict.js"); if (!Array) { const _easycom_u_input2 = common_vendor.resolveComponent("u-input"); const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon"); const _easycom_u_loading_icon2 = common_vendor.resolveComponent("u-loading-icon"); (_easycom_u_input2 + _easycom_u_icon2 + _easycom_u_loading_icon2)(); } const _easycom_u_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js"; const _easycom_u_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_u_loading_icon = () => "../../uni_modules/uview-plus/components/u-loading-icon/u-loading-icon.js"; if (!Math) { (_easycom_u_input + _easycom_u_icon + _easycom_u_loading_icon)(); } const _sfc_main = { __name: "index", setup(__props) { const loading = common_vendor.ref(false); const refreshing = common_vendor.ref(false); const hasMore = common_vendor.ref(true); const pageNum = common_vendor.ref(1); const pageSize = common_vendor.ref(10); const dict = common_vendor.ref({}); const currentStatus = common_vendor.ref("all"); const searchKeyword = common_vendor.ref(""); const stats = common_vendor.ref({ count: 0, throughCount: 0, rejectCount: 0, waiveCount: 0 }); const reviewList = common_vendor.ref([]); const total = common_vendor.ref(0); const statusOptions = common_vendor.ref([ { label: "全部", value: "all" }, { label: "待审查", value: "pending" }, { label: "审查通过", value: "approved" }, { label: "审查驳回", value: "rejected" }, { label: "已放弃", value: "abandoned" } ]); const conclusionDict = { 0: "未审核", 1: "审查通过", 2: "审查驳回", 3: "放弃", 4: "修改后同意" }; const getDictLabel = (dictType, dictValue) => { if (!dict.value[dictType] || !dictValue) return ""; const dictItem = dict.value[dictType].find( (item) => item.dictValue == String(dictValue) ); return dictItem ? dictItem.dictLabel : dictValue; }; const getAgeWithUnit = (review) => { if (!review.age) return "未知"; const unit = getDictLabel("sys_AgeUnit", review.ageunit) || "岁"; return `${review.age}${unit}`; }; const formatDate = (dateString) => { if (!dateString) return ""; const date = new Date(dateString); return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")} ${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`; }; const getReviewStatusText = (review) => { if (review.receiveStatus == 0) return "待推送"; if (review.receiveStatus == 1) return "未阅读"; if (review.receiveStatus == 2) return "已阅读"; if (review.receiveStatus == 3) return "超时"; if (review.receiveStatus == 4) return "中止"; if (review.receiveStatus == 5) return "完成"; if (!review.receiveStatus && review.receiveStatus !== 0) return "待推送"; return "待推送"; }; const getReviewStatusClass = (review) => { if (review.receiveStatus == 0) return "abandoned"; if (review.receiveStatus == 1) return "abandoned"; if (review.receiveStatus == 2) return "pending"; if (review.receiveStatus == 3) return "unknown"; if (review.receiveStatus == 4) return "unknown"; if (review.receiveStatus == 5) return "approved"; if (!review.receiveStatus && review.receiveStatus !== 0) return "pending"; return "unknown"; }; const getConclusionText = (conclusion) => { return conclusionDict[conclusion] || "未知结论"; }; const selectStatus = (status) => { currentStatus.value = status; resetAndLoad(); }; const handleSearch = () => { resetAndLoad(); }; const resetFilters = () => { currentStatus.value = "all"; searchKeyword.value = ""; resetAndLoad(); }; const buildQueryParams = () => { const params = { pageNum: pageNum.value, pageSize: pageSize.value // receiveStatus: "1,2,3,4,5", }; if (searchKeyword.value) { params.name = searchKeyword.value; } if (currentStatus.value !== "all") { switch (currentStatus.value) { case "pending": params.expertconclusion = null; break; case "approved": params.expertconclusion = 1; break; case "rejected": params.expertconclusion = 2; break; case "abandoned": params.expertconclusion = 3; break; } } return params; }; const resetAndLoad = () => { pageNum.value = 1; hasMore.value = true; loadCaseData(); }; const onRefresh = async () => { refreshing.value = true; await resetAndLoad(); refreshing.value = false; }; const onLoadMore = async () => { if (!hasMore.value || loading.value) return; pageNum.value++; await loadCaseData(true); }; const stateTotal = async () => { const resTotal = await common_vendor.index.$uapi.get( `/project/ethicalreviewopinions/stateTotal` ); if (resTotal.code == 200) stats.value = resTotal.data[0]; }; const loadCaseData = async (isLoadMore = false) => { if (loading.value) return; loading.value = true; try { const params = buildQueryParams(); const res = await common_vendor.index.$uapi.get( `/project/ethicalreviewopinions/listnew`, params ); common_vendor.index.__f__("log", "at pages/ethicalReview/index.vue:419", res, "11"); if (res.code == 200) { const list = res.rows || []; const totalCount = res.total || 0; if (isLoadMore) { reviewList.value = [...reviewList.value, ...list]; } else { reviewList.value = list; } common_vendor.index.__f__("log", "at pages/ethicalReview/index.vue:430", reviewList.value, "reviewList.value"); total.value = totalCount; hasMore.value = reviewList.value.length < totalCount; } else { common_vendor.index.showToast({ title: res.msg || "加载失败", icon: "none" }); } } catch (error) { common_vendor.index.__f__("error", "at pages/ethicalReview/index.vue:441", "加载案例数据失败:", error); common_vendor.index.showToast({ title: "数据加载失败,请重试", icon: "none" }); } finally { loading.value = false; common_vendor.index.stopPullDownRefresh(); } }; const viewDetail = (review) => { common_vendor.index.navigateTo({ url: `/pages/ethicalReview/ethicalInfo?fcid=${review.fcid}&type=review&status=${review.expertconclusion || "pending"}&id=${review.id}` }); }; const downloadReport = async (review) => { if (!review.conclusionannex) { common_vendor.index.showToast({ title: "暂无报告可下载", icon: "none" }); return; } try { const annexes = review.conclusionannex.split(";").filter((item) => item.trim()); if (annexes.length == 0) { common_vendor.index.showToast({ title: "暂无报告可下载", icon: "none" }); return; } common_vendor.index.showLoading({ title: "下载中...", mask: true }); const fileUrl = annexes[0]; const downloadTask = common_vendor.index.downloadFile({ url: fileUrl, success: (downloadRes) => { if (downloadRes.statusCode == 200) { const tempFilePath = downloadRes.tempFilePath; common_vendor.index.saveFile({ tempFilePath, success: (saveRes) => { common_vendor.index.hideLoading(); common_vendor.index.showToast({ title: "下载成功", icon: "success", duration: 2e3 }); if (common_vendor.index.getSystemInfoSync().platform == "weixin") { common_vendor.index.openDocument({ filePath: saveRes.savedFilePath, showMenu: true, success: () => { common_vendor.index.__f__("log", "at pages/ethicalReview/index.vue:516", "打开文档成功"); }, fail: (err) => { common_vendor.index.__f__("error", "at pages/ethicalReview/index.vue:519", "打开文档失败", err); } }); } }, fail: (saveErr) => { common_vendor.index.hideLoading(); common_vendor.index.showToast({ title: "保存文件失败", icon: "error", duration: 2e3 }); } }); } else { common_vendor.index.hideLoading(); common_vendor.index.showToast({ title: "下载失败", icon: "error", duration: 2e3 }); } }, fail: (err) => { common_vendor.index.hideLoading(); common_vendor.index.showToast({ title: "下载失败", icon: "error", duration: 2e3 }); common_vendor.index.__f__("error", "at pages/ethicalReview/index.vue:549", "下载文件失败:", err); } }); downloadTask.onProgressUpdate((res) => { common_vendor.index.__f__("log", "at pages/ethicalReview/index.vue:555", "下载进度:", res.progress); }); } catch (error) { common_vendor.index.hideLoading(); common_vendor.index.__f__("error", "at pages/ethicalReview/index.vue:559", "下载报告失败:", error); common_vendor.index.showToast({ title: "下载失败", icon: "error", duration: 2e3 }); } }; const submitAppeal = (review) => { common_vendor.index.navigateTo({ url: `/pages/ethics/appeal?id=${review.fcid || review.id}&caseNo=${review.caseNo || ""}&name=${review.name || ""}` }); }; const restartReview = async (review) => { common_vendor.index.showModal({ title: "重新开始审查", content: "确定要重新开始这个审查流程吗?", success: async (res) => { if (res.confirm) { try { common_vendor.index.showLoading({ title: "处理中...", mask: true }); const response = await common_vendor.index.$uapi.put( `/project/ethicalreviewopinions/reset/${review.fcid || review.id}` ); common_vendor.index.hideLoading(); if (response.code == 200) { common_vendor.index.showToast({ title: "审查已重新开始", icon: "success", duration: 2e3 }); resetAndLoad(); } else { common_vendor.index.showToast({ title: response.msg || "操作失败", icon: "none", duration: 2e3 }); } } catch (error) { common_vendor.index.hideLoading(); common_vendor.index.__f__("error", "at pages/ethicalReview/index.vue:614", "重新开始审查失败:", error); common_vendor.index.showToast({ title: "操作失败", icon: "error", duration: 2e3 }); } } } }); }; common_vendor.onLoad(async () => { dict.value = await utils_dict.useDict( "sys_IDType", "sys_user_sex", "sys_Nation", "sys_BloodType", "sys_Infectious", "sys_AgeUnit", "ReviewForm_status", "sys_ethical", "expert_Conclusion" ); await loadCaseData(); await stateTotal(); }); common_vendor.onShow(() => { resetAndLoad(); }); common_vendor.onPullDownRefresh(() => { onRefresh(); }); common_vendor.onReachBottom(() => { onLoadMore(); }); return (_ctx, _cache) => { return common_vendor.e({ a: common_vendor.t(stats.value.count), b: common_vendor.t(stats.value.throughCount), c: common_vendor.t(stats.value.rejectCount), d: common_vendor.t(stats.value.waiveCount), e: common_vendor.f(statusOptions.value, (status, k0, i0) => { return { a: common_vendor.t(status.label), b: status.value, c: currentStatus.value == status.value ? 1 : "", d: common_vendor.o(($event) => selectStatus(status.value), status.value) }; }), f: common_vendor.o(handleSearch), g: common_vendor.o(($event) => searchKeyword.value = $event), h: common_vendor.p({ placeholder: "搜索捐献者姓名或住院号", ["prefix-icon"]: "search", clearable: true, modelValue: searchKeyword.value }), i: common_vendor.f(reviewList.value, (review, index, i0) => { return common_vendor.e({ a: "4d58215f-1-" + i0, b: common_vendor.t(review.name || "未填写姓名"), c: common_vendor.t(review.inpatientno || "无住院号"), d: review.expertname }, review.expertname ? { e: common_vendor.t(review.expertname) } : {}, { f: common_vendor.t(getReviewStatusText(review)), g: common_vendor.n(getReviewStatusClass(review)), h: common_vendor.t(review.sex == 1 ? "男" : "女"), i: common_vendor.t(getAgeWithUnit(review)), j: common_vendor.t(getDictLabel("sys_BloodType", review.bloodtype) || "未知"), k: common_vendor.t(review.diagnosisname || "未填写"), l: review.createTime }, review.createTime ? { m: "4d58215f-2-" + i0, n: common_vendor.p({ name: "clock", size: "14", color: "#909399" }), o: common_vendor.t(formatDate(review.createTime)) } : {}, { p: review.conclusiontime }, review.conclusiontime ? { q: "4d58215f-3-" + i0, r: common_vendor.p({ name: "checkmark-circle", size: "14", color: "#909399" }), s: common_vendor.t(formatDate(review.conclusiontime)) } : {}, { t: review.expertname }, review.expertname ? { v: "4d58215f-4-" + i0, w: common_vendor.p({ name: "account", size: "14", color: "#909399" }), x: common_vendor.t(review.expertname) } : {}, { y: review.expertconclusion && review.expertconclusion !== 2 }, review.expertconclusion && review.expertconclusion !== 2 ? { z: common_vendor.t(getConclusionText(review.expertconclusion)) } : {}, { A: review.expertopinion }, review.expertopinion ? { B: common_vendor.t(review.expertopinion) } : {}, { C: "4d58215f-5-" + i0, D: common_vendor.o(($event) => viewDetail(review), review.id || index), E: review.expertconclusion == 1 }, review.expertconclusion == 1 ? { F: "4d58215f-6-" + i0, G: common_vendor.p({ name: "download", size: "14", color: "#52c41a" }), H: common_vendor.o(($event) => downloadReport(review), review.id || index) } : {}, { I: review.expertconclusion == 2 }, review.expertconclusion == 2 ? { J: "4d58215f-7-" + i0, K: common_vendor.p({ name: "arrow-up", size: "14", color: "#fa8c16" }), L: common_vendor.o(($event) => submitAppeal(review), review.id || index) } : {}, { M: review.expertconclusion == 2 || review.expertconclusion == 3 }, review.expertconclusion == 2 || review.expertconclusion == 3 ? { N: "4d58215f-8-" + i0, O: common_vendor.p({ name: "play-circle", size: "14", color: "#747CF9" }), P: common_vendor.o(($event) => restartReview(review), review.id || index) } : {}, { Q: review.id || index, R: common_vendor.o(($event) => viewDetail(review), review.id || index) }); }), j: common_vendor.p({ name: "order", size: "16", color: "#fff" }), k: common_vendor.p({ name: "eye", size: "14", color: "#747CF9" }), l: common_vendor.p({ show: loading.value, text: "加载中..." }), m: !loading.value && reviewList.value.length == 0 }, !loading.value && reviewList.value.length == 0 ? { n: common_vendor.t(loading.value), o: common_vendor.t(reviewList.value.length), p: common_vendor.p({ name: "file-remove", size: "80", color: "#C0C4CC" }), q: common_vendor.o(resetFilters) } : {}, { r: !hasMore.value && reviewList.value.length > 0 }, !hasMore.value && reviewList.value.length > 0 ? {} : {}, { s: refreshing.value, t: common_vendor.o(onRefresh), v: common_vendor.o(onLoadMore), w: common_vendor.gei(_ctx, "") }); }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4d58215f"]]); wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/ethicalReview/index.js.map