This commit is contained in:
2026-08-26 13:55:08 +08:00
parent 9503b5aa73
commit 368c0b2ec8
13 changed files with 605 additions and 267 deletions
@@ -39,7 +39,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never">
<table-tool>
<el-button size="small" type="primary" icon="el-icon-plus" @click="doAllocateDelegation">
根据单位分配代表团
{{ allocateButtonText }}
</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" @click="excelImportDialog = true">导入代表</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" @click="$refs.addFormRef.onOpen(pageForm.sessionId,pageForm.delegationId)">新增代表</el-button>
@@ -138,19 +138,34 @@ layout("/layouts/platform.html"){
roleOptions: [],
formRules: {},
excelImportDialog: false
excelImportDialog: false,
compositionMode: "${config.dbtzc!'unit'}"
}
},
computed: {
compositionLabel() {
return this.compositionMode === "union" ? "分工会" : "单位"
},
allocateButtonText() {
return "根据" + this.compositionLabel + "分配代表团"
}
},
methods: {
doAllocateDelegation() {
this.$confirm("确定要一键给没有代表团的代表,根据单位所在代表团设置代表团吗?", "提示", {
this.$confirm("确定要给尚未归团的代表,根据" + this.compositionLabel + "组成关系设置代表团吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post(loc() + "/doAllocateDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
let message = "已分配" + res.data.assignedCount + "人"
if (res.data.unassignedCount > 0) {
message += ",另有" + res.data.unassignedCount + "人未找到对应代表团"
this.$message.warning(message)
} else {
this.$message.success(message)
}
this.doSearch()
}
})
@@ -35,7 +35,7 @@ layout("/layouts/platform.html"){
设置团长
</el-link>
<el-link @click="$refs.partUnitRef.onOpen(scope.row.id,scope.row.sessionId)" size="mini" type="primary">
设置组成单位
{{ compositionButtonText }}
</el-link>
<el-link @click="doDelete(scope.row.id)" size="mini" type="danger">删除</el-link>
</template>
@@ -46,11 +46,12 @@ layout("/layouts/platform.html"){
</template>
<template v-else>
<el-tabs v-model="secondLevelTabActive">
<el-tab-pane label="组成单位" name="partUnitTable">
<el-tab-pane :label="compositionTabLabel" name="partUnitTable">
<el-card class="mt10" shadow="never" style="border: 1px solid var(--border-color-lighter)">
<part-unit-table
:delegation_id="currentTreeData.id"
:session_id="pageForm.sessionId"
:composition_mode="compositionMode"
@open="(delegation_id,session_id)=>{$refs.partUnitRef.onOpen(delegation_id,session_id)}"
ref="partUnitTableRef"
></part-unit-table>
@@ -73,7 +74,7 @@ layout("/layouts/platform.html"){
</el-row>
<au-form @refresh="refresh" ref="auFormRef"></au-form>
<part-unit @refresh="refresh" ref="partUnitRef"></part-unit>
<part-unit :composition_mode="compositionMode" @refresh="refresh" ref="partUnitRef"></part-unit>
<head-form @refresh="refresh" ref="headFormRef"></head-form>
</div>
@@ -95,7 +96,19 @@ layout("/layouts/platform.html"){
currentTreeData: null,
currentTreeSessionId: null,
secondLevelTabActive: "partUnitTable"
secondLevelTabActive: "partUnitTable",
compositionMode: "${config.dbtzc!'unit'}"
}
},
computed: {
compositionLabel() {
return this.compositionMode === "union" ? "分工会" : "单位"
},
compositionButtonText() {
return "设置组成" + this.compositionLabel
},
compositionTabLabel() {
return "组成" + this.compositionLabel
}
},
components: {
@@ -1,35 +1,45 @@
const PART_UNIT_TEMPLATE = {
template: `
<el-dialog title="设置组成单位" :visible.sync="partUnitDialogFormVisible" width="1000px" :close-on-click-modal="false">
<el-transfer
ref="transferRef"
:titles="['可选二级单位', '当前成员单位']"
filterable
:props="{
key: 'id',
label: 'name'
}"
:filter-method="(query,item)=>{return item.name.indexOf(query) > -1}"
v-model="selectUnitsIds"
:data="allUnits"
></el-transfer>
<div slot="footer" class="dialog-footer">
<el-button @click="partUnitDialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="doSubmitPartUnit">确 定</el-button>
</div>
</el-dialog>
`,
template: [
'<el-dialog :title="dialogTitle" :visible.sync="partUnitDialogFormVisible" width="1000px" :close-on-click-modal="false">',
'<el-transfer ref="transferRef" :titles="transferTitles" filterable ',
':props="{key: \'id\', label: \'name\'}" ',
':filter-method="filterItem" v-model="selectedIds" :data="allItems"></el-transfer>',
'<div slot="footer" class="dialog-footer">',
'<el-button @click="partUnitDialogFormVisible = false">取 消</el-button>',
'<el-button type="primary" @click="doSubmitPartUnit">确 定</el-button>',
'</div><slot></slot></el-dialog>'
].join(''),
props: {
composition_mode: {
type: String,
default: "unit"
}
},
data() {
return {
partUnitDialogFormVisible: false,
selectUnitsIds: [],
allUnits: [],
selectedIds: [],
allItems: [],
delegationId: null,
sessionId: null
}
},
computed: {
compositionLabel() {
return this.composition_mode === "union" ? "分工会" : "单位"
},
dialogTitle() {
return "设置组成" + this.compositionLabel
},
transferTitles() {
return ["可选" + this.compositionLabel, "当前组成" + this.compositionLabel]
}
},
methods: {
filterItem(query, item) {
return item.name.indexOf(query) > -1
},
onOpen(delegationId, sessionId) {
if (!delegationId || !sessionId) {
return
@@ -43,21 +53,21 @@ const PART_UNIT_TEMPLATE = {
}
this.$axios
.post("/platform/teacherCongress/delegation/partUnitTransferData", {
.post("/platform/teacherCongress/delegation/compositionTransferData", {
delegationId,
sessionId
})
.then((res) => {
if (res.code === 0) {
this.selectUnitsIds = res.data.selectUnitIds
this.allUnits = res.data.allUnits
this.selectedIds = res.data.selectedIds
this.allItems = res.data.allItems
}
})
},
doSubmitPartUnit() {
this.$axios
.post(loc() + "/partUnitSet", {
unitIds: JSON.stringify(this.selectUnitsIds),
.post(loc() + "/compositionSet", {
itemIds: JSON.stringify(this.selectedIds),
delegationId: this.delegationId,
sessionId: this.sessionId
})
@@ -1,16 +1,18 @@
const PART_UNIT_TABLE_TEMPLATE = {
template: `
<div>
<table-tool>
<el-button size="small" type="primary" icon="el-icon-edit" @click="open">设置组成单位</el-button>
</table-tool>
<el-table :data="tableData" border>
<el-table-column type="index" label="序号" width="100px"></el-table-column>
<el-table-column prop="name" label="名称"></el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</div>
`,
template: [
'<div><table-tool>',
'<el-button size="small" type="primary" icon="el-icon-edit" @click="open">{{ buttonText }}</el-button>',
'</table-tool><el-table :data="tableData" border>',
'<el-table-column type="index" label="序号" width="100px"></el-table-column>',
'<el-table-column prop="code" label="编码"></el-table-column>',
'<el-table-column prop="name" label="名称"></el-table-column>',
'</el-table><el-row class="el-pagination-container" style="margin-top: 20px">',
'<el-pagination @size-change="pageSizeChange" @current-change="pageNumberChange" ',
':current-page="pageForm.pageNumber" :page-sizes="[5,10,20,30,50]" ',
':page-size="pageForm.pageSize" layout="total, sizes, prev, pager, next" ',
':total="pageForm.totalCount"></el-pagination>',
'</el-row><slot></slot></div>'
].join(''),
mixins: [initTableMixins],
props: {
session_id: {
@@ -20,6 +22,15 @@ const PART_UNIT_TABLE_TEMPLATE = {
delegation_id: {
type: String,
required: true
},
composition_mode: {
type: String,
default: "unit"
}
},
computed: {
buttonText() {
return "设置组成" + (this.composition_mode === "union" ? "分工会" : "单位")
}
},
data() {
@@ -49,7 +60,7 @@ const PART_UNIT_TABLE_TEMPLATE = {
methods: {
pageData() {
this.$axios
.post("/platform/teacherCongress/delegation/partUnitPageData", {
.post("/platform/teacherCongress/delegation/compositionPageData", {
...this.pageForm,
sessionId: this.session_id,
delegationId: this.delegation_id