diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java index 8a2d336..9d40628 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java @@ -104,7 +104,8 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl imp """).setParam("id", id); NutMap info = (NutMap) dao().execute(sql.setCallback(Sqls.callback.map())).getResult(); if (StrUtil.isNotBlank(info.getString("suggestUnits"))) { - info.put("suggestUnits", String.join(",", Json.fromJson(ArrayList.class, info.getString("suggestUnits")))); + // 分号仅分隔不同单位,保留每个单位名称内部的顿号等标点。 + info.put("suggestUnits", String.join(";", Json.fromJson(ArrayList.class, info.getString("suggestUnits")))); } // 并案提案 diff --git a/src/main/resources/views/platform/zhgh/democratic/proposal/common/info.js b/src/main/resources/views/platform/zhgh/democratic/proposal/common/info.js index 97fa23c..7598812 100644 --- a/src/main/resources/views/platform/zhgh/democratic/proposal/common/info.js +++ b/src/main/resources/views/platform/zhgh/democratic/proposal/common/info.js @@ -189,7 +189,7 @@ const PROPOSAL_INFO = { {{task.ext.tf_masterUnitName}} - {{task?.ext?.tf_slaveUnitNameStr}} + {{getSlaveUnitNames(task)}} {{getBranchSchoolLeaderName(task)}} @@ -222,8 +222,13 @@ const PROPOSAL_INFO = { - {{task.ext.underTakeName}} + v-if="isReplyTask(task)" :span="3"> + {{getReplyUnitName(task)}} + + + + 未记录 {{ task.taskFormData.userName @@ -235,6 +240,9 @@ const PROPOSAL_INFO = { + + {{getSchoolLeaderResult(task)}} + @@ -249,7 +257,7 @@ const PROPOSAL_INFO = { `, - dicts: ["PROPOSAL_TYPE", "PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_SUGGESTION_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE", "PROCESS_TASK_SUBMIT_TYPE", "PROPOSAL_FEEDBACK"], + dicts: ["PROPOSAL_TYPE", "PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_SUGGESTION_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE", "PROCESS_TASK_SUBMIT_TYPE", "PROPOSAL_FEEDBACK", "PROPOSAL_REPLY_IMPLEMENT"], props: { hide_slave: false }, @@ -261,12 +269,18 @@ const PROPOSAL_INFO = { viewDialogVisible: false, positiveSecondList: [], branchSchoolLeaderOptions: [], + detailRequestVersion: 0, } }, methods: { // 打开 onOpen(row) { - this.row = row + // 每次打开递增版本,阻止前一次查看的迟到响应覆盖当前提案(包括 A→B→A)。 + this.$set(this, "detailRequestVersion", this.detailRequestVersion + 1) + this.$set(this, "row", row) + this.$set(this, "viewData", {}) + this.$set(this, "doneTasks", []) + this.$set(this, "positiveSecondList", []) this.visible = true this.getInfo() this.getDoneTasks() @@ -276,9 +290,10 @@ const PROPOSAL_INFO = { // 获取申请信息 getInfo() { + const requestVersion = this.detailRequestVersion this.$axios.post("/platform/proposal/common/proposalInfo", {id: this.row.id}).then((res) => { - if (res.code === 0) { - this.viewData = res.data + if (res.code === 0 && requestVersion === this.detailRequestVersion) { + this.$set(this, "viewData", res.data) } }) }, @@ -293,22 +308,57 @@ const PROPOSAL_INFO = { // 获取已办任务审批记录 getDoneTasks() { + const requestVersion = this.detailRequestVersion this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => { - if (res.code === 0) { - this.doneTasks = res.data + if (res.code === 0 && requestVersion === this.detailRequestVersion) { + this.$set(this, "doneTasks", res.data) } }) }, // 获取主动附议信息 listPositiveSeconded() { + const requestVersion = this.detailRequestVersion this.$axios.post("/platform/proposal/positiveSeconded/listPositiveSeconded", {bizId: this.row.id}).then((res) => { - if (res.code === 0) { - this.positiveSecondList = res.data + if (res.code === 0 && requestVersion === this.detailRequestVersion) { + this.$set(this, "positiveSecondList", res.data) } }) }, + // task 为主任已办任务;返回分号分隔的单位名称,旧记录仅转换原拼接用的英文逗号,不拆分单位内部顿号。 + getSlaveUnitNames(task) { + const ext = task.ext || {} + if (Array.isArray(ext.tf_slaveUnitNames)) { + return ext.tf_slaveUnitNames.join(";") + } + return (ext.tf_slaveUnitNameStr || "").split(",").join(";") + }, + + // 三类答复节点均展示单位和落实情况,其他节点不能展示继承的答复字段。 + isReplyTask(task) { + return ["master_reply", "slave_reply", "opinion_master_reply"].includes(task.taskName) + }, + + // task 为已办任务;返回单位名称。仅主办允许使用本任务保存的主办名称补齐历史缺失值。 + getReplyUnitName(task) { + const ext = task.ext || {} + if (ext.underTakeName) { + return ext.underTakeName + } + return ["master_reply", "opinion_master_reply"].includes(task.taskName) + ? (ext.tf_masterUnitName || "未记录") : "未记录" + }, + + // task 为已办任务;校领导返回实际审批动作文本,其他节点或旧记录缺少动作时返回空串沿用提交结果。 + getSchoolLeaderResult(task) { + if (!["school_leader", "school_leader_instruction"].includes(task.taskName)) { + return "" + } + const approval = task.ext?.tf_approval + return approval === "back" ? "退回重新答复" : (approval === "agree" ? "同意" : "") + }, + // 查询分管校领导,用于把流程任务中保存的 userId 显示成姓名。 listBranchSchoolLeader() { if (this.branchSchoolLeaderOptions.length > 0) { diff --git a/src/main/resources/views/platform/zhghh5/democratic/proposal/common/info.js b/src/main/resources/views/platform/zhghh5/democratic/proposal/common/info.js index d4adaea..217e5b0 100644 --- a/src/main/resources/views/platform/zhghh5/democratic/proposal/common/info.js +++ b/src/main/resources/views/platform/zhghh5/democratic/proposal/common/info.js @@ -162,7 +162,7 @@ const PROPOSAL_INFO = { {{ task.ext.tf_masterUnitName }} - {{ task?.ext?.tf_slaveUnitNameStr }} + {{ getSlaveUnitNames(task) }} {{ getBranchSchoolLeaderName(task) }} @@ -191,8 +191,13 @@ const PROPOSAL_INFO = { - - {{task.ext.underTakeName}} + + {{getReplyUnitName(task)}} + + + + 未记录 {{ task.taskFormData.userName }}({{task.taskFormData.loginName}}) @@ -203,6 +208,9 @@ const PROPOSAL_INFO = { + + {{getSchoolLeaderResult(task)}} + @@ -217,7 +225,7 @@ const PROPOSAL_INFO = { `, - dicts: ["PROPOSAL_TYPE", "PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_SUGGESTION_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE", "PROCESS_TASK_SUBMIT_TYPE", "PROPOSAL_FEEDBACK"], + dicts: ["PROPOSAL_TYPE", "PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_SUGGESTION_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE", "PROCESS_TASK_SUBMIT_TYPE", "PROPOSAL_FEEDBACK", "PROPOSAL_REPLY_IMPLEMENT"], data() { return { visible:false, @@ -227,12 +235,18 @@ const PROPOSAL_INFO = { originalRow: null, // 用于保存原始数据,支持返回功能 positiveSecondList: [], branchSchoolLeaderOptions: [], + detailRequestVersion: 0, } }, methods: { // 打开 onOpen(row) { - this.row = row + // 每次打开递增版本,阻止前一次查看的迟到响应覆盖当前提案(包括 A→B→A)。 + this.$set(this, "detailRequestVersion", this.detailRequestVersion + 1) + this.$set(this, "row", row) + this.$set(this, "viewData", {}) + this.$set(this, "doneTasks", []) + this.$set(this, "positiveSecondList", []) this.visible = true this.getInfo() this.getDoneTasks() @@ -247,9 +261,10 @@ const PROPOSAL_INFO = { // 获取申请信息 getInfo() { + const requestVersion = this.detailRequestVersion this.$axios.post("/platform/proposal/common/proposalInfo", {id: this.row.id}).then((res) => { - if (res.code === 0) { - this.viewData = res.data + if (res.code === 0 && requestVersion === this.detailRequestVersion) { + this.$set(this, "viewData", res.data) } }) }, @@ -258,16 +273,9 @@ const PROPOSAL_INFO = { openView(row) { // 如果传入的是并案对象,则打开新的详情页面 if (row && typeof row === 'object' && row.id) { - // 创建一个新的提案详情组件实例来显示并案详情 - this.$nextTick(() => { - // 可以通过事件总线或者其他方式来打开新的详情页面 - // 这里暂时使用简单的方式,直接在当前组件中显示 - const currentRow = this.row; - this.row = row; - this.getInfo(); - // 保存原来的数据,以便返回时恢复 - this.originalRow = currentRow; - }) + // 并案切换必须同步刷新基础信息、流程记录和主动附议,避免展示原提案的意见。 + this.$set(this, "originalRow", this.row) + this.onOpen(row) } else { // 原有的逻辑,通过ID查看 this.$nextTick(() => { @@ -280,22 +288,57 @@ const PROPOSAL_INFO = { // 获取已办任务审批记录 getDoneTasks() { + const requestVersion = this.detailRequestVersion this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => { - if (res.code === 0) { - this.doneTasks = res.data + if (res.code === 0 && requestVersion === this.detailRequestVersion) { + this.$set(this, "doneTasks", res.data) } }) }, // 获取主动附议信息 listPositiveSeconded() { + const requestVersion = this.detailRequestVersion this.$axios.post("/platform/proposal/positiveSeconded/listPositiveSeconded", {bizId: this.row.id}).then((res) => { - if (res.code === 0) { - this.positiveSecondList = res.data + if (res.code === 0 && requestVersion === this.detailRequestVersion) { + this.$set(this, "positiveSecondList", res.data) } }) }, + // task 为主任已办任务;返回分号分隔的单位名称,旧记录仅转换原拼接用的英文逗号,不拆分单位内部顿号。 + getSlaveUnitNames(task) { + const ext = task.ext || {} + if (Array.isArray(ext.tf_slaveUnitNames)) { + return ext.tf_slaveUnitNames.join(";") + } + return (ext.tf_slaveUnitNameStr || "").split(",").join(";") + }, + + // 三类答复节点均展示单位和落实情况,其他节点不能展示继承的答复字段。 + isReplyTask(task) { + return ["master_reply", "slave_reply", "opinion_master_reply"].includes(task.taskName) + }, + + // task 为已办任务;返回单位名称。仅主办允许使用本任务保存的主办名称补齐历史缺失值。 + getReplyUnitName(task) { + const ext = task.ext || {} + if (ext.underTakeName) { + return ext.underTakeName + } + return ["master_reply", "opinion_master_reply"].includes(task.taskName) + ? (ext.tf_masterUnitName || "未记录") : "未记录" + }, + + // task 为已办任务;校领导返回实际审批动作文本,其他节点或旧记录缺少动作时返回空串沿用提交结果。 + getSchoolLeaderResult(task) { + if (!["school_leader", "school_leader_instruction"].includes(task.taskName)) { + return "" + } + const approval = task.ext?.tf_approval + return approval === "back" ? "退回重新答复" : (approval === "agree" ? "同意" : "") + }, + // 查询分管校领导,用于把流程任务中保存的 userId 显示成姓名。 listBranchSchoolLeader() { if (this.branchSchoolLeaderOptions.length > 0) {