This commit is contained in:
@jyuhsin
2025-12-23 10:34:29 +08:00
parent d765edf331
commit 572c9b2df7
9 changed files with 101 additions and 8 deletions
@@ -16,6 +16,7 @@ import com.budwk.app.sys.models.Sys_role;
import com.budwk.app.sys.models.Sys_unit;
import com.budwk.app.sys.models.Sys_user_role;
import com.budwk.app.sys.services.SysRoleService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConfig;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake;
import lombok.extern.slf4j.Slf4j;
@@ -240,5 +241,18 @@ public class ProposalConfigUnitController {
return Result.success(Map.of("allUsers", allUsers, "selectUserIds", selectUserIds));
}
@At
@SaCheckPermission("proposal.config.unit")
@Aop(TransAop.READ_COMMITTED)
@SLog(tag = "提案管理-承办单位管理", msg = "删除承办单位")
public Result delete(@Valid String id) {
// 删除承办单位表
dao.delete(ProposalUndertake.class, id);
// 删除角色表中有关
dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getUnderTakeId, "=", id));
log.info("工号:{}, 姓名:{}, 删除了承办单位,Id等于:{}", SecurityUtil.getUserLoginname(), SecurityUtil.getUserUsername(), id);
return Result.success();
}
}
@@ -29,7 +29,9 @@ const initTableMixins = {
dialogFormVisible: false,
viewData: {},
viewDialogVisible: false
viewDialogVisible: false,
_approvalInitialized: false
}
},
methods: {
@@ -95,6 +97,26 @@ const initTableMixins = {
title: "错误",
message: msg
})
},
initApprovalFromUrl() {
if (this._approvalInitialized) return;
if (!this.pageForm) {
return;
}
// 从 URL 读取 approval 参数(适用于独立页面)
const urlParams = new URLSearchParams(window.location.search);
const approvalParam = urlParams.get('tab');
if (approvalParam !== null) {
this.$set(this.pageForm, 'approval', approvalParam === 'done')
this.$set(this.pageForm, 'isAudit', approvalParam === 'done')
this._approvalInitialized = true;
}
}
}
},
created() {
this.initApprovalFromUrl();
},
}
@@ -172,6 +172,26 @@
historyBack: function(func = ()=>{}) {
historyBack(func);
}
},
created() {
// 只处理有 pageForm 且 pageForm 有 approval 字段的组件
if (
this.pageForm &&
typeof this.pageForm === 'object' &&
('approval' in this.pageForm || 'isAudit' in this.pageForm)
) {
// 从 URL 查询参数中读取 approval
const urlParams = new URLSearchParams(window.location.search);
const approvalParam = urlParams.get('tab');
if (approvalParam === 'done') {
this.$set(this.pageForm, 'approval', true);
this.$set(this.pageForm, 'isAudit', true);
} else if (approvalParam === 'todo') {
this.$set(this.pageForm, 'approval', false);
this.$set(this.pageForm, 'isAudit', false);
}
}
}
})
</script>
@@ -258,7 +258,7 @@ const user = {
this.$message.warning("当前流程没有配置地址")
return
}
window.open(formKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey)
window.open(formKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey + "&tab=" + this.activeTab)
},
getRoleNames() {
$.post("/platform/sys/role/getRoleNames").then(res => {
@@ -33,7 +33,7 @@ layout("/layouts/platform.html"){
<template slot-scope="{row}">
<!-- <el-button size="mini" type="primary" @click="$refs.userRef.onOpen(row.id,true)">设置分管校领导</el-button>-->
<el-button size="mini" type="primary" @click="$refs.userRef.onOpen(row.id,false)">设置单位领导</el-button>
<el-button size="mini" type="danger">删除</el-button>
<el-button size="mini" type="danger" @click="onDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -85,7 +85,23 @@ layout("/layouts/platform.html"){
this.$refs.treeRef.listTree()
}
})
}
},
onDelete (row) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
$.post(loc() + "/delete", { id: row.id }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
this.$refs.treeRef.listTree()
}
})
})
},
},
created() {
this.pageData()
@@ -36,13 +36,21 @@ const TREE_COMPONENT = {
treeData: []
}
},
watch: {
name(val) {
this.$refs.treeRef.filter(val)
}
},
methods: {
treeNodeClick(data, node) {
this.currentTreeData = data
this.currentTreeNode = node
this.$emit("node-click", data, node)
},
filterNode() {},
filterNode(value, data, node) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
listTree() {
this.$axios.post("/platform/proposal/config/unit/tree").then((res) => {
if (res.code === 0) {
@@ -204,6 +204,13 @@ layout("/layouts/platform.html"){
async meetingChange(val) {
this.doSearch()
},
listDelegation() {
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
if (res.code === 0) {
this.delegationOptions = res.data
}
})
},
// 查询开启的教代会
listOpenSession() {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
@@ -182,7 +182,13 @@ layout("/layouts/platform.html"){
this.formData.committeeId = null
this.doSearch()
},
listDelegation() {
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
if (res.code === 0) {
this.delegationOptions = res.data
}
})
},
// 查询开启的教代会
listOpenSession() {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
@@ -182,7 +182,7 @@ const todo = {
this.$toast("当前流程没有配置地址");
return;
}
this.$pjaxReplace(h5FormKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey)
this.$pjaxReplace(h5FormKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey+ "&tab=" + this.activeTab)
},
// 获取空状态文本