first commit

This commit is contained in:
2026-01-08 14:58:16 +08:00
commit 556e5d64aa
9575 changed files with 1621095 additions and 0 deletions
@@ -0,0 +1,151 @@
const branchUnionCadreAudit = {
template: /*language=HTML*/ `
<el-card shadow="never" class="mt10">
<table-tool label="基层干部">
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
<!-- <el-button size="small" @click="doAudit(true)" :disabled="!multipleSelection.length" type="primary"-->
<!-- icon="el-icon-check">批量通过-->
<!-- </el-button>-->
<!-- <el-button size="small" @click="doAudit(false)" :disabled="!multipleSelection.length" type="danger"-->
<!-- icon="el-icon-check">批量拒绝-->
<!-- </el-button>-->
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
style="width: 100%" @selection-change="handleSelectionChange" height="65vh">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column align="center" header-align="center" type="index" :index="indexMethod"
label="序号" width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='isJoin'" scope="{row:{isJoin}}">
<span v-if="isJoin" class="text-info">加入</span>
<span v-else class="text-danger">退出</span>
</template>
<template scope="{row}" v-else-if="column.prop=='instanceState'">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="180px" v-if="!pageForm.audit">
<template scope="{row}">
<template v-if="row.taskState === 10">
<el-button @click="handleTaskAction(row, 1)" size="mini" type="primary">通过</el-button>
<el-button @click="handleTaskAction(row, 2)" size="mini" type="danger">拒绝</el-button>
</template>
<el-button v-if="row.canRevoke" @click="openRevoke(row)" size="mini" type="danger">
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
`,
mixins: [initTableMixins],
data() {
return {
pageForm: {
audit: false
},
tableColumns: [
{ prop: 'loginName', label: '工号' },
{ prop: 'userName', label: '姓名' },
{ prop: 'unionName', label: '所属工会' },
{ prop: 'mobile', label: '联系方式' },
{ prop: 'roleName', label: '职务' },
{ prop: 'isJoin', label: '申请类型' },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
multipleSelection: [],
}
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
doAudit(pass) {
this.$confirm('是否确认提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const ids = JSON.stringify(this.multipleSelection.map(v => v.id))
this.$axios.post('/platform/sys/union/cadreDoAudit', {ids, pass})
.then(resp => {
if (resp.code === 0) {
this.pageData()
this.$refs.table.clearSelection();
this.$message.success(resp.msg)
}else{
this.$message.error(resp.msg)
}
})
})
},
handleTaskAction(row, val) {
const msg = val === 1 ? "通过" : "拒绝"
this.$confirm("您确定要" + msg + "吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const loading = createLoading()
this.formData = {
origin: row.origin,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
},
pageData() {
this.$axios.post('/platform/sys/union/cadrePageData', this.pageForm)
.then(resp => {
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
})
}
}
}
@@ -0,0 +1,163 @@
const branchUnionCommitteeMemberManage = {
template: /*language=HTML*/ `
<div>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-row :gutter="10" type="flex">
<el-select placeholder="请选择届次" v-model="pageForm.sessionId" style="width: 15%"
size="small">
<el-option v-for="item in sessionOptions" :label="item.fullName" :value="item.id"
:key="item.id"></el-option>
</el-select>
<el-input placeholder="请输入姓名或工号" clearable size="small"
style="width: 300px;margin-left: 10px;"
v-model="pageForm.searchKeyword"></el-input>
<el-button type="primary" class="ml5" size="small" icon="el-icon-search"
@click="doSearch"></el-button>
<el-button @click="openAdd" icon="ti-plus" type="primary" size="small" style="margin-left: auto">
添加委员
</el-button>
<el-button @click="deleteRole" icon="el-icon-delete" type="danger" size="small" style="margin-left: 10px">
删除当前届次委员角色
</el-button>
</el-row>
</el-card>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-table :data="tableData" border>
<el-table-column label="序号" type="index" width="50" :index="indexMethod"></el-table-column>
<el-table-column prop="loginName" label="工号"></el-table-column>
<el-table-column prop="userName" label="姓名"></el-table-column>
<!-- <el-table-column prop="mobile" label="联系方式"></el-table-column>-->
<el-table-column prop="position" label="职务"></el-table-column>
<el-table-column prop="sessionName" label="届次"></el-table-column>
<el-table-column label="操作" width="100px">
<template scope="scope">
<el-button size="mini" type="danger" icon="el-icon-delete"
@click="doDelete(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container mt20">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount"
></el-pagination>
</el-row>
</el-card>
<el-dialog title="添加" :visible.sync="dialogFormVisible" width="600px" :close-on-click-modal="false">
<el-form :model="formData" ref="formRef" size="small" label-width="80px" :rules="formRules">
<el-form-item prop="sessionId" label="届次">
<el-select placeholder="请选择届次" v-model="formData.sessionId" clearable style="width: 100%">
<el-option v-for="item in sessionOptions" :label="item.fullName" :value="item.id"
:key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="userId" label="人员">
<user-select
v-model="formData.userId"
style="width: 100%"
api="/platform/sys/committeeMember/listUserSelect"
:api_params="{ sessionId: pageForm.sessionId }"
:option_label_func="
(item) => {
return item.username + item.loginname + '(' + item.unitName + ')'
}
"
></user-select>
</el-form-item>
<el-form-item prop="position" label="职务">
<el-input v-model="formData.position" placeholder="请输入职务"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="doSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
mixins: [initTableMixins],
data() {
return {
dialogFormVisible: false,
formData: {},
formRules: {
sessionId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
userId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
},
sessionOptions: []
}
},
methods: {
listSession() {
this.$axios.post("/platform/teacherCongress/common/listSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions.length > 0) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.pageData()
}
}
})
},
pageData() {
$.get("/platform/sys/committeeMember/pageData", this.pageForm).then((res) => {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
})
},
openAdd() {
this.dialogFormVisible = true
this.$nextTick(() => {
this.formData = {}
})
},
doSubmit() {
this.$refs.formRef.validate((valid) => {
if (!valid) return
const session = this.sessionOptions.find(item => item.id === this.formData.sessionId)
this.formData.sessionName = session.fullName
$.post("/platform/sys/committeeMember/insert", this.formData).then((res) => {
this.dialogFormVisible = false
this.$message.success(res.msg)
this.pageData()
})
})
},
doDelete(id) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
$.post("/platform/sys/committeeMember/delete", {id}).then((res) => {
this.$message.success(res.msg)
this.pageData()
})
})
},
deleteRole() {
this.$confirm("您当前操作委员信息不会删除,只会删除当前届次委员的角色,确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
$.post("/platform/sys/committeeMember/deleteRole", {sessionId:this.pageForm.sessionId}).then((res) => {
this.$message.success(res.msg)
this.pageData()
})
})
}
},
created() {
this.listSession()
}
}
@@ -0,0 +1,192 @@
const branchUnionGroupManage = {
template: /*language=HTML*/ `
<div>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-row type="flex" style="column-gap: 10px">
<el-input
placeholder="可输入名称查询"
size="small"
style="width: 400px"
clearable
v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch"
></el-input>
<el-button type="primary" size="small" icon="el-icon-search" @click="doSearch"></el-button>
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: auto"
@click="openAdd">
新增
</el-button>
</el-row>
</el-card>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-table :data="tableData" border>
<el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="code" label="小组编码" width="120px"></el-table-column>
<el-table-column prop="name" label="小组名称" width="200px"></el-table-column>
<el-table-column prop="leaderInfos" label="组长信息"></el-table-column>
<el-table-column prop="unitInfos" label="组成单位"></el-table-column>
<el-table-column label="操作" width="200px">
<template slot-scope="{row}">
<el-button type="primary" size="mini" @click="onEdit(row)">
编辑
</el-button>
<el-button type="danger" size="mini" @click="onDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog :title="formData.id ? '编辑' : '新增'" :visible.sync="dialogFormVisible" width="600px"
:close-on-click-modal="false">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="100px">
<el-form-item label="小组编码" prop="code">
<el-input v-model="formData.code" placeholder="小组编码" maxlength="10"
show-word-limit></el-input>
</el-form-item>
<el-form-item label="小组名称" prop="name">
<el-input v-model="formData.name" placeholder="小组名称" maxlength="100"></el-input>
</el-form-item>
<el-form-item label="组成单位" prop="unitIds">
<el-select clearable filterable placeholder="请选择组成单位" multiple
style="width: 100%" v-model="formData.unitIds">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in units"></el-option>
</el-select>
</el-form-item>
<el-form-item label="小组长" prop="leaders">
<el-select
v-model="formData.leaders"
filterable
remote multiple
reserve-keyword
placeholder="请输入姓名查询"
:remote-method="getUserOptions"
style="width: 100%">
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.username+'('+item.unitName+')'"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="onSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
mixins: [initTableMixins],
props: {
union_id: {
type: String,
required: true
}
},
data() {
return {
pageForm: {},
formData: {},
rules: {
code: [{ required: true, message: "请输入小组编码", trigger: "blur" }],
name: [{ required: true, message: "请输入小组名称", trigger: "blur" }],
leaders: [{ required: true, message: "请选择小组长", trigger: "change" }],
unitIds: [{ required: true, message: "请选择组成单位", trigger: "change" }],
},
userOptions: [],
units: [],
}
},
methods: {
async openAdd() {
this.dialogFormVisible = true
await this.getUnits()
this.$nextTick(() => {
this.formData = {}
this.$refs.formRef.clearValidate()
})
},
async onEdit(row) {
this.formData = { ...row }
this.formData.unitIds = JSON.parse(row.unitIds)
this.formData.leaders = JSON.parse(row.leaders)
await this.getUnits(row.id)
this.getUserOptions(null, this.formData.leaders)
this.dialogFormVisible = true
this.$nextTick(() => {
this.$refs.formRef.clearValidate()
})
},
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
const { id } = this.formData
const url = "/platform/sys/unionGroup" + (id ? "/update" : "/insert")
const formData = clone(this.formData)
formData.unitIds = JSON.stringify(formData.unitIds)
formData.leaders = JSON.stringify(formData.leaders)
$.post(url, { ...formData, unionId: this.union_id }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.dialogFormVisible = false
this.doSearch()
}
})
}
})
},
onDelete(id) {
this.$confirm("您确定要删除吗, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
$.post("/platform/sys/unionGroup/delete/" + id).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
})
.catch(() => {})
},
pageData() {
$.get("/platform/sys/unionGroup/pageData", { ...this.pageForm, unionId: this.union_id }).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
getUserOptions(keyword, userIds = null) {
$.get("/platform/sys/unionGroup/listUser", {
keyword,
unionId: this.union_id,
userIds: JSON.stringify(userIds)
}).then((res) => {
if (res.code === 0) {
this.userOptions = res.data
}
})
},
async getUnits(val) {
const resp = await this.$axios.post("/platform/sys/unionGroup/getUnits", {
unionId: this.union_id,
groupId: val
})
if (resp.code === 0) {
this.units = resp.data
}
}
}
}
@@ -0,0 +1,122 @@
const branchUnionManage = {
template: `
<div>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-row :gutter="10" type="flex">
<el-input placeholder="请输入分工会名称" clearable size="small" style="width: 300px" v-model="pageForm.searchKeyword"></el-input>
<el-button type="primary" class="ml5" size="small" icon="el-icon-search" @click="doSearch"></el-button>
<el-button @click="openAudit" icon="el-icon-s-check" type="primary" style="margin-left: auto" size="small">基层干部审核</el-button>
<el-button @click="openAdd" icon="ti-plus" type="primary" size="small" v-if="$auth.hasPermission('sys.manager.union.add')">新建分工会</el-button>
</el-row>
</el-card>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-table :data="tableData" border>
<el-table-column label="序号" type="index" width="50" :index="indexMethod"></el-table-column>
<el-table-column prop="name" label="工会名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="unionCode" label="工会编码"></el-table-column>
<el-table-column prop="campus" label="校区"></el-table-column>
<el-table-column prop="chairman" label="分工会主席" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="250" v-if="$auth.hasPermissionOr(['sys.manager.union.edit','sys.manager.union.delete'])">
<template scope="scope">
<!-- <el-button v-if="$auth.hasPermission('sys.manager.union.branchOfficer')" type="primary" size="mini">设置干部</el-button>-->
<el-button v-if="$auth.hasPermission('sys.manager.union.edit')" type="primary" size="mini" @click="openEdit(scope.row.id)">编辑</el-button>
<el-button v-if="$auth.hasPermission('sys.manager.union.delete')" type="danger" size="mini" @click="doDelete(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container mt20">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount"
></el-pagination>
</el-row>
</el-card>
<el-dialog :title="formData.id ? '编辑分工会' : '新增分工会'" :visible.sync="dialogFormVisible" width="600px">
<el-form :model="formData" ref="formRef" :rules="formRules" size="small" label-width="80px">
<el-form-item label="工会名称" prop="name">
<el-input v-model="formData.name" maxlength="100" placeholder="工会名称"></el-input>
</el-form-item>
<el-form-item label="工会编码" prop="unionCode">
<el-input v-model="formData.unionCode" maxlength="100" placeholder="工会编码"></el-input>
</el-form-item>
<el-form-item label="校区" prop="campus">
<dict-select v-model="formData.campus" code="USER_CAMPUS"></dict-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="doSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
mixins: [initTableMixins],
data() {
return {
dialogFormVisible: false,
formData: {},
formRules: {
name: [{ required: true, message: "请输入工会名称", trigger: ["change", "blur"] }],
unionCode: [{ required: true, message: "请输入工会编码", trigger: ["change", "blur"] }],
campus: [{ required: false, message: "请选择校区", trigger: ["change", "blur"] }]
}
}
},
methods: {
pageData() {
$.get("/platform/sys/union/pageData", this.pageForm).then((res) => {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
})
},
// 基层干部审核
openAudit() {
this.$emit('union-cadre')
},
openAdd() {
this.dialogFormVisible = true
this.$nextTick(() => {
this.formData = {}
})
},
openEdit(id) {
this.dialogFormVisible = true
$.get("/platform/sys/union/findOne", { id }).then((res) => {
this.formData = res.data
})
},
doSubmit() {
this.$refs.formRef.validate((valid) => {
if (!valid) return
$.post("/platform/sys/union/" + (this.formData.id ? "update" : "insert"), this.formData).then((res) => {
this.dialogFormVisible = false
this.$message.success(res.msg)
this.pageData()
this.$emit("refresh", null)
})
})
},
doDelete(id) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
$.post("/platform/sys/union/doDelete", { id }).then((res) => {
this.$message.success(res.msg)
this.pageData()
this.$emit("refresh", null)
})
})
}
},
created() {
this.pageData()
}
}
@@ -0,0 +1,104 @@
const branchUnionPartUnitManage = {
template: `
<div>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-row type="flex" style="column-gap: 10px">
<el-input
placeholder="请输入单位编码或单位名称查询"
size="small"
style="width: 400px"
clearable
v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch"
></el-input>
<el-button type="primary" size="small" icon="el-icon-search" @click="doSearch"></el-button>
<el-button type="primary" size="small" icon="el-icon-setting" style="margin-left: auto" @click="openAdd" v-if="$auth.hasPermission('sys.manager.union.partUnit')">设置组成单位</el-button>
</el-row>
</el-card>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-table :data="tableData" border>
<el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="unitcode" label="单位编码"></el-table-column>
<el-table-column prop="name" label="单位名称"></el-table-column>
</el-table>
</el-card>
<el-dialog title="设置组成单位" :visible.sync="dialogFormVisible" width="1000px" :close-on-click-modal="false">
<el-transfer
ref="transferRef"
:titles="['可选二级单位', '当前成员单位']"
filterable
:props="{
key: 'id',
label: 'name'
}"
:filter-method="filterUnit"
v-model="selectUnitsIds"
:data="allUnits"
></el-transfer>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="doSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
mixins: [initTableMixins],
props: {
union_id: {
type: String,
required: true
}
},
data() {
return {
dialogFormVisible: false,
selectUnitsIds: [],
allUnits: []
}
},
watch: {
union_id(val) {
// this.doSearch()
}
},
methods: {
openAdd() {
this.dialogFormVisible = true
if (this.$refs.transferRef) {
this.$refs.transferRef.clearQuery("left")
this.$refs.transferRef.clearQuery("right")
}
$.get("/platform/sys/union/branchUnionPartUnitTransferData", { unionId: this.union_id }).then((res) => {
this.selectUnitsIds = res.data.selectUnitIds
this.allUnits = res.data.allUnits
})
},
filterUnit(query, item) {
return item.name.indexOf(query) > -1
},
doSubmit() {
$.post("/platform/sys/union/branchUnionPartUnitSet", {
unitIds: JSON.stringify(this.selectUnitsIds),
unionId: this.union_id
}).then((res) => {
if (res.code === 0) {
this.dialogFormVisible = false
this.$message.success(res.msg)
this.doSearch()
}
})
},
pageData() {
$.get("/platform/sys/union/branchUnionPartUnitPageData", { ...this.pageForm, unionId: this.union_id }).then((res) => {
if (res.code === 0) {
this.tableData = res.data
}
})
}
}
}
@@ -0,0 +1,150 @@
const branchUnionUserManage = {
template:
/*language=HTML*/
`
<div>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-row type="flex" style="column-gap: 10px">
<el-input
placeholder="请输入内容"
size="small"
style="width: 400px"
clearable
v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch"
>
<el-select v-model="pageForm.searchName" slot="prepend" size="small" placeholder="查询类型"
style="width: 80px !important;">
<el-option label="角色" value="roleName"></el-option>
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
<el-button type="primary" size="small" icon="el-icon-search" @click="doSearch"></el-button>
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: auto"
@click="openAdd" v-if="$auth.hasPermission('sys.manager.union.branchOfficer')">添加
</el-button>
</el-row>
</el-card>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-table :data="tableData" border size="small">
<el-table-column prop="loginName" label="工号"></el-table-column>
<el-table-column prop="userName" label="姓名"></el-table-column>
<el-table-column prop="mobile" label="联系方式"></el-table-column>
<el-table-column prop="roleName" label="职务"></el-table-column>
<el-table-column prop="taskName" label="当前状态"></el-table-column>
<el-table-column label="操作" width="100px"
v-if="$auth.hasPermission('sys.manager.union.branchOfficer')">
<template scope="scope">
<el-button size="mini" type="danger" icon="el-icon-delete"
@click="doDelete(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog title="添加" :visible.sync="dialogFormVisible" width="600px" :close-on-click-modal="false">
<el-form :model="formData" ref="form" size="small" label-width="80px">
<el-form-item prop="roleCode" label="角色">
<dict-select v-model="formData.roleCode" code="BRANCH_UNION_ROLES" placeholder="请选择角色"></dict-select>
</el-form-item>
<el-form-item prop="userId" label="人员">
<user-select
v-model="formData.userId"
style="width: 100%"
api="/platform/sys/union/listUnion"
:api_params="{ unionId: union_id }"
:option_label_func="
(item) => {
return item.username + item.loginname + '(' + item.unitName + ')'
}
"
></user-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="doSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
mixins: [initTableMixins],
props: {
union_id: {
type: String,
required: true
}
},
data() {
return {
pageForm: {
searchName: "username"
},
dialogFormVisible: false,
formData: {}
}
},
watch: {
union_id(val) {
this.doSearch()
}
},
methods: {
openAdd() {
this.dialogFormVisible = true
this.$nextTick(() => {
this.formData = {}
})
},
doSubmit() {
this.$axios.post("/platform/sys/union/insertBranchUnionUserRole", {
...this.formData,
unionId: this.union_id
}).then((res) => {
if (res.code === 0) {
this.dialogFormVisible = false
this.$message.success(res.msg)
this.doSearch()
} else {
this.$message.error(res.msg)
}
})
},
doDelete({ userId, roleCode }) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then((res) => {
$.post("/platform/sys/union/deleteBranchUnionUserRole", {
userId,
roleCode,
unionId: this.union_id
}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
pageData() {
$.get("/platform/sys/union/branchUnionUserPageData", {
...this.pageForm,
unionId: this.union_id
}).then((res) => {
if (res.code === 0) {
this.tableData = res.data
}
})
}
},
created() {
this.pageData()
},
style: /*language=CSS*/ `
/deep/ .el-select {
width: 100% !important;
}
`
}
@@ -0,0 +1,184 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-row type="flex" :gutter="20" style="height: calc(100vh - 126px)">
<el-col :span="5">
<el-card shadow="never" style="height: 100%" body-style="{ height: '100%' }">
<el-input placeholder="输入关键字进行查找" v-model="filterText" clearable></el-input>
<div style="max-height: calc(100vh - 200px); overflow-y: auto">
<el-tree
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
children: 'children',
label: 'name'
}"
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
highlight-current
>
<template slot-scope="{ node, data }">
<span class="el-tree-node__label">
<i class="el-icon-folder-opened" v-if="node.level===1"></i>
<i class="el-icon-folder" v-else></i>
{{node.label}}
</span>
</template>
</el-tree>
</div>
</el-card>
</el-col>
<el-col :span="19">
<el-card shadow="never">
<el-tabs v-model="schoolUnionTabActive" type="card" v-if="currentTreeNode==null || currentTreeNode.level===1">
<el-tab-pane name="branchUnionManage">
<span slot="label">
<i class="el-icon-school"></i>
分工会信息
</span>
<sys-union-branch-union-manage @refresh="getTreeData()" @union-cadre="unionCadreInit"></sys-union-branch-union-manage>
</el-tab-pane>
<el-tab-pane name="schoolUnionInfo" v-if="$auth.hasPermission('sys.manager.union.schoolOfficer')">
<span slot="label">
<i class="el-icon-office-building"></i>
校工会信息
</span>
<sys-union-school-union-user-manage></sys-union-school-union-user-manage>
</el-tab-pane>
<el-tab-pane name="unionCommitteeMemberManage" v-if="$auth.hasPermission('sys.manager.union.committeeMember')">
<span slot="label">
<i class="el-icon-office-building"></i>
工会委员信息
</span>
<sys-union-committee-member-manage></sys-union-committee-member-manage>
</el-tab-pane>
</el-tabs>
<el-tabs v-model="branchUnionTabActive" @tab-click="branchTabChange" type="card" v-if="currentTreeNode && currentTreeNode.level===2">
<el-tab-pane name="branchUnionUserManage">
<span slot="label">
<i class="el-icon-school"></i>
分工会干部
</span>
<sys-union-branch-union-user-manage
ref="branchUnionUserManageRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-user-manage>
</el-tab-pane>
<el-tab-pane name="branchUnionPartUnitManage">
<span slot="label">
<i class="el-icon-school"></i>
组成单位
</span>
<sys-union-branch-union-part-unit-manage
ref="branchUnionPartUnitManageRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-part-unit-manage>
</el-tab-pane>
<el-tab-pane name="branchUnionGroup">
<span slot="label">
<i class="el-icon-school"></i>
工会小组
</span>
<sys-union-branch-union-group-manage
ref="branchUnionGroupRef"
:union_id="currentTreeData.id"
></sys-union-branch-union-group-manage>
</el-tab-pane>
</el-tabs>
</el-card>
</el-col>
</el-row>
</template>
<template #edit>
<sys-union-branch-union-cadre-audit ref="unionCadreAuditRef">
</sys-union-branch-union-cadre-audit>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include("branchUnionManage.js"){}#-->
<!--#include("schoolUnionUserManage.js"){}#-->
<!--#include("branchUnionUserManage.js"){}#-->
<!--#include("branchUnionPartUnitManage.js"){}#-->
<!--#include("branchUnionGroupManage.js"){}#-->
<!--#include("branchUnionCadreAudit.js"){}#-->
<!--#include("branchUnionCommitteeMemberManage.js"){}#-->
new Vue({
el: "#app",
components: {
"sys-union-branch-union-manage": branchUnionManage,
"sys-union-school-union-user-manage": schoolUnionUserManage,
"sys-union-branch-union-user-manage": branchUnionUserManage,
"sys-union-branch-union-part-unit-manage": branchUnionPartUnitManage,
"sys-union-branch-union-group-manage": branchUnionGroupManage,
"sys-union-branch-union-cadre-audit": branchUnionCadreAudit,
"sys-union-committee-member-manage": branchUnionCommitteeMemberManage,
},
data() {
return {
filterText: null,
treeData: [],
currentTreeNode: null,
currentTreeData: null,
schoolUnionTabActive: "branchUnionManage",
branchUnionTabActive: "branchUnionUserManage"
}
},
watch: {
filterText(val) {
this.$refs.treeRef.filter(val)
}
},
methods: {
treeNodeClick(data, node) {
this.currentTreeData = data
this.currentTreeNode = node
if (node.level === 2) {
this.$nextTick(() => {
this.$refs[this.branchUnionTabActive + "Ref"].doSearch()
})
}
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
getTreeData() {
$.get(loc() + "/tree").then((res) => {
this.treeData = res.data
})
},
branchTabChange(val) {
this.$nextTick(() => {
this.$refs[val.name + "Ref"].doSearch()
})
},
// 基层干部审核初始化
unionCadreInit() {
this.$refs.guava.edit(() => {
this.$refs.unionCadreAuditRef.pageData()
})
}
},
created() {
this.getTreeData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,110 @@
const schoolUnionUserManage = {
template:
/*language=HTML*/
`
<div>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-row type="flex" style="column-gap: 10px">
<el-input
placeholder="请输入内容"
size="small"
style="width: 400px"
clearable
v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch"
>
<el-select v-model="pageForm.searchName" size="small" slot="prepend" placeholder="查询类型"
style="width: 120px">
<el-option label="角色" value="roleName"></el-option>
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
<el-button type="primary" size="small" icon="el-icon-search" @click="doSearch"></el-button>
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: auto"
@click="openAdd">添加
</el-button>
</el-row>
</el-card>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter); margin-top: 10px">
<el-table :data="tableData" border>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="roleName" label="角色"></el-table-column>
<el-table-column label="操作" width="100px">
<template scope="scope">
<el-button size="mini" type="danger" icon="el-icon-delete"
@click="doDelete(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog title="添加" :visible.sync="dialogFormVisible" width="600px" :close-on-click-modal="false">
<el-form :model="formData" ref="form" size="small" label-width="80px">
<el-form-item prop="roleCode" label="角色">
<dict-select v-model="formData.roleCode" code="SCHOOL_UNION_ROLES"></dict-select>
</el-form-item>
<el-form-item prop="userId" label="人员">
<user-select v-model="formData.userId" api_input_key_name="query"></user-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="doSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
mixins: [initTableMixins],
props: {},
data() {
return {
pageForm: {
searchName: "username"
},
dialogFormVisible: false,
formData: {}
}
},
methods: {
openAdd() {
this.dialogFormVisible = true
this.$nextTick(() => {
this.formData = {}
})
},
doSubmit() {
$.post("/platform/sys/union/insertSchoolUnionUserRole", this.formData).then((res) => {
if (res.code === 0) {
this.dialogFormVisible = false
this.$message.success(res.msg)
this.doSearch()
}
})
},
doDelete({ userId, roleCode }) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then((res) => {
$.post("/platform/sys/union/deleteSchoolUnionUserRole", { userId, roleCode }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
pageData() {
$.get("/platform/sys/union/schoolUnionUserPageData", this.pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data
}
})
}
},
created() {
this.pageData()
}
}