Merge remote-tracking branch 'origin/main'

This commit is contained in:
2026-05-18 10:37:25 +08:00
40 changed files with 470 additions and 185 deletions
@@ -48,6 +48,19 @@ const businessTool = {
}
})
},
// 查询当前用户可管理的协会,供活动人员范围筛选使用
listManageClubByRole() {
return commonUtil
.axiosService()
.post("/platform/club/common/listManageClubByRole", {})
.then((resp) => {
if (resp.code === 0) {
return resp.data
} else {
return []
}
})
},
/**
* 获取字典数据,不包含禁用
* @param code
@@ -228,12 +228,12 @@
</template>
<el-row class="query-row"
v-if="is_A06===true||is_sysadmin===true||is_H02===true">
v-if="is_A06===true||is_sysadmin===true||is_H02===true||is_CLUB_PRESIDENT===true">
<el-col class="query-title">协会:</el-col>
<el-col class="query-content">
<el-select v-model="pageForm.clubId" placeholder="请选择协会" @change="doSearch"
filterable
:clearable="is_A06===true||is_sysadmin===true||(is_H04===true&&is_H02===true)"
:clearable="is_A06===true||is_sysadmin===true||is_CLUB_PRESIDENT===true||(is_H04===true&&is_H02===true)"
style="width: 100%">
<el-option
v-for="item in clubOptions"
@@ -482,6 +482,9 @@ module.exports = {
is_H02() {
return this.roleData.is_H02
},
is_CLUB_PRESIDENT() {
return this.roleData.is_CLUB_PRESIDENT
},
is_sysadmin() {
return this.roleData.is_sysadmin
},
@@ -661,9 +664,13 @@ module.exports = {
async created() {
this.listSession()
await this.getRolesAndUnion()
this.clubOptions = await this.$businessTool.listCLubByRole()
if ((this.is_sysadmin || this.is_A06 || this.is_H02) === false && this.is_H04 === true) {
this.unions = this.$businessTool.listUnion(this.unionid)
if (this.is_CLUB_PRESIDENT === true && (this.is_sysadmin || this.is_A06 || this.is_H02) === false) {
this.clubOptions = await this.$businessTool.listManageClubByRole()
} else {
this.clubOptions = await this.$businessTool.listCLubByRole()
}
if ((this.is_sysadmin || this.is_A06 || this.is_H02 || this.is_CLUB_PRESIDENT) === false && this.is_H04 === true) {
this.unions = await this.$businessTool.listUnion(this.unionid)
this.$set(this.pageForm, "unionId", this.unions[0].id)
} else {
this.unions = await this.$businessTool.listUnion()
@@ -673,6 +680,9 @@ module.exports = {
this.$set(this.pageForm, "clubId", this.clubOptions[0].id)
}
}
if (this.is_H04 === false && this.is_H02 === false && this.is_CLUB_PRESIDENT === true && this.clubOptions.length === 1) {
this.$set(this.pageForm, "clubId", this.clubOptions[0].id)
}
await this.flushUnits()
await this.getActivityGroup()
this.personTypeOptions = await this.$businessTool.getDictOptions("USER_PERSON_TYPE")
@@ -207,7 +207,7 @@
<el-table-column v-if="!is_view" label="操作" width="100px">
<template v-slot="{row,$index}">
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id !== null)" type="danger" icon="el-icon-delete"
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger" icon="el-icon-delete"
@click="nr.bzs.splice($index,1)"></el-button>
</template>
</el-table-column>
@@ -1,10 +1,18 @@
<template>
<div>
<div class="h5-file-upload">
<div v-if="upload_mode === 'file' && fileList.length" class="h5-file-list">
<div class="h5-file-item" v-for="(file, index) in fileList" :key="file.url || file.name || index">
<van-icon name="description" class="h5-file-icon"></van-icon>
<div class="h5-file-name van-ellipsis">{{ getFileDisplayName(file) }}</div>
<van-icon name="cross" class="h5-file-delete" @click.stop="deleteFile(index)"></van-icon>
</div>
</div>
<van-uploader
v-model="fileList"
:before-read="beforeRead"
:after-read="afterRead"
:before-delete="beforeDelete"
:preview-image="upload_mode !== 'file'"
multiple
progress
:accept="accept"
@@ -142,6 +150,15 @@ module.exports = {
}
},
methods: {
// 文件模式使用自定义预览格,优先展示上传时记录的原始文件名。
getFileDisplayName(file) {
return file.displayName || file.originalName || file.name || (file.file ? file.file.name : "") || ""
},
// 自定义预览格删除后同步父组件,避免表单继续提交已删除附件。
deleteFile(index) {
this.fileList.splice(index, 1)
this.$emit("update:value", this.fileList)
},
beforeDelete(file) {
this.fileList = this.fileList.filter((f) => f.url !== file.url)
this.$emit("update:value", this.fileList)
@@ -178,33 +195,43 @@ module.exports = {
if (valid) {
return true
}
this.$toast(`文件只能是 ${this.accept} 格式!`)
this.$toast("文件只能是 " + this.accept + " 格式!")
return false
},
afterRead(files) {
this.fileList.map((f) => {
if (f.file && f.file.name === files.file.name) {
f.status = "loading"
}
})
const uploadPromises = this.fileList
.filter((f) => f.status === "loading")
const readFiles = Array.isArray(files) ? files : [files]
const uploadPromises = readFiles
.filter((f) => f.file)
.map((f) => {
const formData = new FormData()
formData.append("file", f.file)
this.$set(f, "status", "loading")
return this.$axios.post(this.action, formData).then((resp) => {
if (resp.code === 0) {
f.name = f.file.name
f.size = f.file.size
f.status = null
f.url = resp.data
f.response = resp
f.percentage = 100
f.isImage = true
delete f.file
delete f.content
const fileName = f.file.name
const fileExt = fileName.split(".").pop().toLowerCase()
let fileIndex = this.fileList.indexOf(f)
if (fileIndex === -1) {
fileIndex = this.fileList.findIndex((item) => {
return item.file && item.file.name === fileName && item.file.size === f.file.size
})
}
const uploadFile = {
displayName: fileName,
originalName: fileName,
name: fileName,
size: f.file.size,
status: null,
url: resp.data,
response: resp,
percentage: 100,
isImage: ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(fileExt)
}
if (fileIndex > -1) {
this.$set(this.fileList, fileIndex, uploadFile)
}
} else {
f.status = "fail"
this.$set(f, "status", "fail")
}
})
})
@@ -241,4 +268,47 @@ module.exports = {
.van-uploader__wrapper {
margin-left: 0;
}
.h5-file-upload {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.h5-file-list {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.h5-file-item {
position: relative;
box-sizing: border-box;
width: 80px;
height: 80px;
padding: 14px 6px 8px;
color: #646566;
text-align: center;
background-color: #f7f8fa;
}
.h5-file-icon {
margin-top: 8px;
font-size: 22px;
}
.h5-file-name {
margin-top: 8px;
font-size: 12px;
}
.h5-file-delete {
position: absolute;
top: 0;
right: 0;
padding: 2px;
color: #fff;
font-size: 12px;
background-color: rgba(0, 0, 0, .65);
}
</style>
@@ -36,15 +36,17 @@ const UNIT_LEADER_MANAGE_TEMPLATE = {
<el-dialog title="添加" :visible.sync="dialogFormVisible" width="600px" :close-on-click-modal="false">
<el-form :model="formData" ref="form" size="small" label-width="60px">
<el-form-item prop="roleCode" label="角色">
<dict-select placeholder="请选择角色" v-model="formData.roleCode" code="UNIT_ROLES"></dict-select>
<!-- <dict-select placeholder="请选择角色" v-model="formData.roleCode" code="UNIT_ROLES"></dict-select> -->
<dict-select placeholder="请选择角色" v-model="formData.roleCode" code="UNIT_ROLES" @change="onRoleChange"></dict-select>
</el-form-item>
<el-form-item prop="userId" label="人员">
<!-- 原人员查询范围只传当前单位::api_params="{ unitId: currentData?.id }" -->
<user-select
placeholder="请选择人员"
style="width: 100%"
v-model="formData.userId"
api="/platform/sys/unit/listUserSelect"
:api_params="{ unitId: currentData?.id }"
:api_params="{ unitId: currentData?.id, roleCode: formData.roleCode }"
:option_label_func="
(item) => {
return item.username + item.loginname + '(' + item.unitName + ')'
@@ -86,6 +88,10 @@ const UNIT_LEADER_MANAGE_TEMPLATE = {
},
computed: {},
methods: {
onRoleChange() {
// 切换角色后人员查询范围可能变化,清空已选人员避免保存到旧范围里的人员。
this.$set(this.formData, "userId", "")
},
doDelete({ userId, roleCode }) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
@@ -3,8 +3,9 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
<div>
<template>
<custom-card>
<!-- :define_key="activity_type===40002?'FGHWHHD':'XHWHHD'" -->
<snaker-start slot="header" label="文化活动申报"
:define_key="activity_type===40002?'FGHWHHD':'XHWHHD'"
define_key="WHHD"
v-if="activity_type===40002||activity_type===40003"></snaker-start>
<el-form :model="formData" :rules="formRules" label-suffix=":" label-width="170px"
ref="addForm" v-loading="formLoading">
@@ -17,7 +17,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
<el-card shadow="never" class="mt10">
<table-tool label="会员信息">
<template v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
<template v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_CHAIRMAN'])">
<el-button size="small" type="primary" icon="el-icon-download" @click="exportRegistrationDoc">导出登记表</el-button>
<el-button @click="openImport" size="small" type="primary">导入成员</el-button>
<el-button size="small" type="primary" @click="openUserAdd(true)">录入成员</el-button>
@@ -57,7 +57,7 @@ const SCHOOL_CLUB_MANAGE_TEMPLATE = {
<el-dropdown-item :command="{type:'edit',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])" :command="{type:'delete',data:row}">
<el-dropdown-item v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_CHAIRMAN'])" :command="{type:'delete',data:row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
@@ -342,11 +342,12 @@ layout("/layouts/platform.html"){
}).then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions) {
/*if (this.sessionOptions) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.listDelegation()
this.pageData()
}
}*/
this.pageData()
}
})
},
@@ -13,7 +13,7 @@ layout("/layouts/platform.html"){
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="代表团列表" :columns.sync="tableColumns"></table-tool>
<table-tool label="代表团列表:" :columns.sync="tableColumns"></table-tool>
<el-table :data="tableData" ref="tableRef" header-align="center" style="width: 100%" row-key="id" show-summary>
<el-table-column
:index="indexMethod"
@@ -141,18 +141,6 @@ layout("/layouts/platform.html"){
placeholder="请输入您的办理意见"
></el-input>
</el-descriptions-item>
<el-descriptions-item label="通讯地址" :span="2">
<el-input v-model="task.taskFormData.tf_address" placeholder="请输入通讯地址"
clearable></el-input>
</el-descriptions-item>
<el-descriptions-item label="联系电话" :span="2">
<el-input v-model="task.taskFormData.tf_phone" placeholder="请输入联系电话"
clearable></el-input>
</el-descriptions-item>
<el-descriptions-item label="邮政编码" :span="2">
<el-input v-model="task.taskFormData.tf_postcode" placeholder="请输入邮政编码"
clearable></el-input>
</el-descriptions-item>
</el-descriptions>
</template>
<el-row type="flex" justify="end" slot="footer">
@@ -219,21 +219,14 @@ layout("/layouts/platform.html"){
},
methods: {
async onSave() {
const valid = await this.$refs["addForm"].validate()
if (valid) {
if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$message.warning("请填写提案名称")
return
// 保存草稿不做必填校验,提交时再统一校验完整表单。
this.$axios.post("/platform/proposal/write/save", {info: JSON.stringify(this.formData)}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.formData = res.data
commonUtil.pjaxPush('/platform/proposal/mine')
}
this.$axios.post("/platform/proposal/write/save", {info: JSON.stringify(this.formData)}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.formData = res.data
commonUtil.pjaxPush('/platform/proposal/mine')
}
})
}
})
},
@@ -1,10 +1,10 @@
const HEAD_TABLE_TEMPLATE = {
template: `
<div>
<div style="height: 100%; display: flex; flex-direction: column; min-height: 0;">
<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 :data="tableData" border max-height="528" style="width: 100%;">
<el-table-column type="index" label="序号" width="100px"></el-table-column>
<el-table-column prop="loginName" label="工号"></el-table-column>
<el-table-column prop="userName" label="姓名"></el-table-column>
@@ -2,6 +2,38 @@
layout("/layouts/platform.html"){
#-->
<style>
.delegation-detail-tabs {
height: 100%;
display: flex;
flex-direction: column;
min-height: 0;
}
.delegation-detail-tabs > .el-tabs__content {
flex: 1;
min-height: 0;
overflow: hidden;
}
.delegation-detail-tabs > .el-tabs__content > .el-tab-pane {
height: 100%;
min-height: 0;
}
.delegation-tab-card {
height: calc(100% - 10px);
}
.delegation-tab-card > .el-card__body {
height: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
min-height: 0;
}
</style>
<div id="app" v-cloak>
<el-row :gutter="10" style="height: calc(100vh - 84px)" type="flex">
<el-col :span="5">
@@ -45,9 +77,9 @@ layout("/layouts/platform.html"){
</el-card>
</template>
<template v-else>
<el-tabs v-model="secondLevelTabActive">
<el-tabs class="delegation-detail-tabs" v-model="secondLevelTabActive">
<el-tab-pane label="组成单位" name="partUnitTable">
<el-card class="mt10" shadow="never" style="border: 1px solid var(--border-color-lighter)">
<el-card class="mt10 delegation-tab-card" shadow="never" style="border: 1px solid var(--border-color-lighter)">
<part-unit-table
:delegation_id="currentTreeData.id"
:session_id="pageForm.sessionId"
@@ -57,7 +89,7 @@ layout("/layouts/platform.html"){
</el-card>
</el-tab-pane>
<el-tab-pane label="设置团长" name="head">
<el-card class="mt10" shadow="never" style="border: 1px solid var(--border-color-lighter)">
<el-card class="mt10 delegation-tab-card" shadow="never" style="border: 1px solid var(--border-color-lighter)">
<head-table
:delegation_id="currentTreeData.id"
:session_id="pageForm.sessionId"
@@ -1,10 +1,10 @@
const PART_UNIT_TABLE_TEMPLATE = {
template: `
<div>
<div style="height: 100%; display: flex; flex-direction: column; min-height: 0;">
<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 :data="tableData" border max-height="528" style="width: 100%;">
<el-table-column type="index" label="序号" width="100px"></el-table-column>
<el-table-column prop="name" label="名称"></el-table-column>
</el-table>
@@ -83,37 +83,6 @@ layout("/layouts/platform_h5.html"){
show-word-limit
></van-field>
<template v-if="['SATISFIED','FAIRLY_SATISFIED'].includes(formData.tf_feedback)">
<van-field
v-model="formData.tf_address"
name="tf_address"
label="通讯地址"
placeholder="请输入通讯地址"
:rules="[{ required: true, message: '请输入通讯地址' }]"
required
show-word-limit
></van-field>
<!--联系电话-->
<van-field
v-model="formData.tf_phone"
name="tf_phone"
label="联系电话"
placeholder="请输入联系电话"
:rules="[{ required: true, message: '请输入联系电话' }]"
required
show-word-limit
></van-field>
<!--邮政编码-->
<van-field
v-model="formData.tf_postcode"
name="tf_postcode"
label="邮政编码"
placeholder="请输入邮政编码"
:rules="[{ required: true, message: '请输入邮政编码' }]"
required
show-word-limit
></van-field>
</template>
</van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="danger" block @click="$refs.proposalInfoRef.onClose()">取消</van-button>
@@ -4,15 +4,18 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
<van-search
v-model="pageForm.searchKeyword"
:show-action="false"
clearable
placeholder="请输入工号或者姓名查询"
@input="onSearchInput"
@search="doSearch"
@clear="clearSearch"
></van-search>
<van-tabs v-model="isInvite" @click="isInviteClick">
<van-tab title="已邀请" name="1"></van-tab>
<van-tab title="可邀请" name="0"></van-tab>
</van-tabs>
<van-checkbox-group v-model="tableSelection" v-if="tableData && tableData.length>0">
<van-checkbox-group v-model="selectedLoginNames" v-if="tableData && tableData.length>0">
<van-cell-group >
<van-cell
v-for="(item, index) in tableData"
@@ -28,9 +31,10 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
{{item.unitName}}
</span>
<van-checkbox
:name="item"
:name="item.loginName"
:ref="'checkboxes'+item.loginName"
slot="right-icon"
@click.stop
v-if="!pageForm.isInvite"></van-checkbox>
</van-cell>
</van-cell-group>
@@ -62,13 +66,21 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
},
config: {},
isInvite: "0",
tableSelection: []
selectedLoginNames: [],
selectedSeconders: {},
searchTimer: null
}
},
methods: {
async onOpen(record) {
this.visible = true
this.record = record
this.isInvite = "0"
this.pageForm.isInvite = false
this.pageForm.pageNumber = 1
this.pageForm.searchKeyword = null
this.selectedLoginNames = []
this.selectedSeconders = {}
await this.getConfig()
this.pageData()
@@ -77,15 +89,15 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
detail(id) {
},
invite() {
if (this.tableSelection.length === 0) {
if (this.selectedLoginNames.length === 0) {
this.$toast("请先选择附议人后在点击邀请")
return
}
const loginNames = [...new Set(this.tableSelection.map((s) => s.loginName))]
const userName = [...new Set(this.tableSelection.map((s) => s.userName))]
console.log(this.tableSelection)
const loginNames = [...new Set(this.selectedLoginNames)]
const userName = loginNames.map((loginName) => {
return this.selectedSeconders[loginName]?.userName || loginName
})
this.$dialog.confirm({
title: '提示',
@@ -98,7 +110,8 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
if (res.code === 0) {
this.pageData()
this.$toast.success(res.msg)
this.tableSelection = []
this.selectedLoginNames = []
this.selectedSeconders = {}
// this.visible = false
this.$emit("refresh", null)
}
@@ -117,20 +130,14 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
this.echoCheckBox()
this.cacheCurrentPageSeconders()
}
})
},
// 翻页回显勾选
echoCheckBox() {
this.$nextTick(() => {
this.tableData.forEach((item) => {
const checkboxRef = this.$refs['checkboxes' + item.loginName]
if (checkboxRef && this.tableSelection.map((s) => s.loginName).includes(item.loginName)) {
checkboxRef[0].toggle()
}
})
cacheCurrentPageSeconders() {
this.tableData.forEach((item) => {
this.$set(this.selectedSeconders, item.loginName, item)
})
},
@@ -139,13 +146,39 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
this.pageData()
},
onSearchInput(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.doSearch()
}, 300)
},
clearSearch() {
clearTimeout(this.searchTimer)
this.pageForm.searchKeyword = null
this.doSearch()
},
isInviteClick(index, title) {
this.pageForm.isInvite = index === "1"
this.doSearch()
},
tableRowToggle(index) {
console.log(index)
if (this.pageForm.isInvite) {
return
}
const item = this.tableData[index]
if (!item) {
return
}
this.$set(this.selectedSeconders, item.loginName, item)
const checkedIndex = this.selectedLoginNames.indexOf(item.loginName)
if (checkedIndex > -1) {
this.selectedLoginNames.splice(checkedIndex, 1)
} else {
this.selectedLoginNames.push(item.loginName)
}
},
async getConfig() {
@@ -463,33 +463,26 @@ layout("/layouts/platform_h5.html"){
},
async onSave() {
// 表单验证
try {
await this.$refs.formRef.validate();
// 保存草稿不做必填校验,提交时再统一校验完整表单。
this.$toast.loading({
message: '保存中...',
forbidClick: true,
});
this.$toast.loading({
message: '保存中...',
forbidClick: true,
this.$axios.post("/platform/proposal/write/save", {info: JSON.stringify(this.formData)})
.then((res) => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success(res.msg);
pjaxReplace('/platform/proposal/mine/h5')
} else {
this.$toast.fail(res.msg || '保存失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
this.$axios.post("/platform/proposal/write/save", {info: JSON.stringify(this.formData)})
.then((res) => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success(res.msg);
pjaxReplace('/platform/proposal/mine/h5')
} else {
this.$toast.fail(res.msg || '保存失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
} catch (error) {
// 表单验证失败
console.log('表单验证失败', error);
}
},
// 提交