pref#ncu_代表推选限制推选名额

This commit is contained in:
Paidax
2025-12-11 10:21:23 +08:00
parent a97d05692f
commit 49251f5a4e
6 changed files with 67 additions and 10 deletions
@@ -23,7 +23,7 @@ layout("/layouts/platform.html"){
</el-card>
<el-card shadow="never">
<push-progress ref="pushProgressRef"></push-progress>
<push-progress ref="pushProgressRef" @max-count="setMaxCount"></push-progress>
</el-card>
<el-card shadow="never">
@@ -32,7 +32,7 @@ layout("/layouts/platform.html"){
icon="el-icon-plus"
size="small"
type="primary"
@click="$refs.pushFormalRef.onOpen(pageForm.sessionId,pageForm.unionId)"
@click="doPushFormal"
>正式代表预选
</el-button>
<el-button
@@ -206,7 +206,7 @@ layout("/layouts/platform.html"){
</template>
</guava>
<push-formal-dialog ref="pushFormalRef" @refresh="doSearch"></push-formal-dialog>
<push-formal-dialog ref="pushFormalRef" @refresh="doSearch" :max-push="formalPush"></push-formal-dialog>
<push-attendance-dialog ref="pushAttendanceRef" @refresh="doSearch"></push-attendance-dialog>
@@ -252,10 +252,27 @@ layout("/layouts/platform.html"){
writeDialog: false,
isRead: false,
userId: null
userId: null,
// 当前分工会的最大推选人员
maxPush: 0,
// 剩余正式代表推选名额
formalPush: 0
}
},
methods: {
doPushFormal() {
if (this.tableData.length >= this.maxPush) {
this.$message.warning("当前正式代表已超过最大推选人员数,如需调整请在表格数据列中选中【删除】按钮")
return
}
this.$refs.pushFormalRef.onOpen(this.pageForm.sessionId, this.pageForm.unionId)
},
setMaxCount(data) {
debugger
this.maxPush = data
},
doSearch() {
this.pageData()
const fullName = this.sessionOptions.find(v => v.id === this.pageForm.sessionId)?.fullName;
@@ -303,9 +320,22 @@ layout("/layouts/platform.html"){
}
}
})
}
},
async pageData() {
try {
const resp = await this.$axios.post("/platform/teacherCongress/delegate/push/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
this.formalPush = this.maxPush - this.tableData.length
}
} catch (e) {
console.log(e)
}
}
},
created() {
this.pageData()
this.listUnion()
this.listSession()
}
@@ -13,6 +13,7 @@ const pushFormalDialog = {
:props="{key: 'id',label: 'name'}"
:titles="['可报人员名单', '当前选择']"
filterable
@change="onTransferChange"
>
<div slot-scope="{ option }">
<div class="transfer-item">
@@ -35,6 +36,9 @@ const pushFormalDialog = {
</span>
</el-dialog>
`,
props: {
maxPush: { type: Number, default: 1}
},
data() {
return {
dialogVisible: false,
@@ -42,10 +46,23 @@ const pushFormalDialog = {
userData: [],
rightChecked: [],
attendanceRightChecked: [],
sessionId: null
sessionId: null,
}
},
methods: {
onTransferChange(targetKeys, direction, movedKeys) {
// targetKeys 是新的 userValue
if (targetKeys.length > this.maxPush) {
this.$message.warning("剩余正式代表名额为【" + this.maxPush + "】人,请合理调配!");
// 只保留前 maxSelectCount 个(或根据业务逻辑决定保留哪些)
const validKeys = targetKeys.slice(0, this.maxPush);
// 更新 model 值(注意:避免无限触发 change)
this.userValue = validKeys;
}
},
async onOpen(sessionId, unionId) {
this.dialogVisible = true
this.sessionId = sessionId
@@ -426,8 +426,13 @@ const pushProgress = {
<div class="legend-container">
<div class="legend-item">
<div class="legend-color bg-warning "></div>
<span class="legend-text">正式代表完成信息填写后才能进行上报,列席代表可直接上报且不计入名额</span>
<span class="legend-text">正式代表完成信息填写后才能进行上报,列席代表可直接上报且不计入名额</span>
</div>
<div class="legend-item">
<div class="legend-color bg-warning "></div>
<span class="legend-text" style="color: red">当前代表为预推选,不计入代表总额,需等待党委书记审核后方才记录</span>
</div>
</div>
</div>
@@ -540,6 +545,7 @@ const pushProgress = {
if (code === 0) {
if (data) {
this.metrics = data
this.$emit('max-count', this.metrics.total.target)
} else {
this.$message.error('暂未分配名额')
}
@@ -65,7 +65,7 @@ const HEAD_FORM_TEMPLATE = {
code: [{required: true, message: "必填", trigger: ["change", "blur"]}],
userId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
viceUserId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
contactUserId: [{required: true, message: "必填", trigger: ["change", "blur"]}]
// contactUserId: [{required: true, message: "必填", trigger: ["change", "blur"]}]
}
}
},
@@ -43,7 +43,9 @@ layout("/layouts/platform.html"){
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
<el-table-column type="index" width="50" :index="indexMethod" label="序号"></el-table-column>
<el-table-column prop="unionName" label="工会名称"></el-table-column>
<el-table-column prop="memberCount" label="会员人数"></el-table-column>
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')">
<el-table-column prop="memberCount" label="会员人数"></el-table-column>
</template>
<!-- <el-table-column prop="dbCount" label="代表人数"></el-table-column>-->
<el-table-column prop="allocationNum" label="名额分配人数"></el-table-column>
<el-table-column prop="seniorTeaNum" label="高级职称代表数"></el-table-column>
@@ -74,7 +74,9 @@ const MANUAL_ALLOCATION_DIALOG = {
<el-table :data="unionLimit" max-height="500" :summary-method="getSummaries"
width="100%" show-summary>
<el-table-column prop="unionName" label="分工会"></el-table-column>
<el-table-column prop="memberCount" label="会员人数"></el-table-column>
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')">
<el-table-column prop="memberCount" label="会员人数"></el-table-column>
</template>
<el-table-column align="center" prop="ratio" label="比例(%)">
<template v-slot="{$index, row}">
<el-input-number