This commit is contained in:
那些花儿
2025-06-13 17:41:22 +08:00
parent 1f763c6f5f
commit 96a9b8aa27
26 changed files with 1154 additions and 522 deletions
@@ -7,10 +7,9 @@ layout("/layouts/platform.html"){
width: 100%;
margin-bottom: 10px;
}
.pullTimeRadioGroup .el-radio.is-bordered + .el-radio.is-bordered{
.pullTimeRadioGroup .el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
</style>
<div id="app" v-cloak>
@@ -52,10 +51,10 @@ layout("/layouts/platform.html"){
<el-card shadow="never">
<table-tool :label="pageForm.pullTime ? pageForm.pullTime + '数据' : '全部数据'">
<el-button type="primary" size="mini" @click="pull" icon="el-icon-download">拉取信息中心数据</el-button>
<el-button type="primary" size="mini" :loading="pullLoading" @click="pull" icon="el-icon-download">拉取信息中心数据</el-button>
<el-button type="danger" size="mini" @click="openDelete" icon="el-icon-delete">删除本地数据源</el-button>
</table-tool>
<el-table :key="tableKey" :data="tableData" @sort-change="pageOrder" header-align="center">
<el-table :key="tableKey" :data="tableData" @sort-change="pageOrder" header-align="center" v-loading="tableLoading">
<el-table-column type="index" width="70" label="序号" fixed="left"></el-table-column>
<el-table-column prop="pullTime" label="拉取时间" width="170" fixed="left"></el-table-column>
<el-table-column prop="loginname" label="工号" width="100" fixed="left"></el-table-column>
@@ -103,11 +102,12 @@ layout("/layouts/platform.html"){
return {
unitNameOptions: [],
userStateOptions: [],
preparedByOptions:[],
personTypeOptions: [],
preparedByOptions: [],
personTypeOptions: [],
pullTimeOptions: false,
sourceTime: null,
pullTimeDialogVisible: false
pullTimeDialogVisible: false,
pullLoading: false
}
},
methods: {
@@ -118,12 +118,18 @@ layout("/layouts/platform.html"){
cancelButtonText: "取消"
})
.then(() => {
this.$axios.post("/platform/sys/data/user/pull/pullData").then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.doSearch()
}
})
this.pullLoading = true
this.$axios
.post("/platform/sys/data/user/pull/pullData")
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.doSearch()
}
})
.finally(() => {
this.pullLoading = false
})
})
.catch(() => {})
},
@@ -7,9 +7,37 @@ layout("/layouts/platform.html"){
width: 100%;
margin-bottom: 10px;
}
.pullTimeRadioGroup .el-radio.is-bordered + .el-radio.is-bordered{
.pullTimeRadioGroup .el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
.condition-builder {
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 10px;
margin-bottom: 10px;
}
.condition-group {
border-left: 2px solid #409eff;
padding-left: 10px;
margin-bottom: 10px;
}
.condition-row {
margin-bottom: 10px;
display: flex;
align-items: center;
}
.condition-row .el-select {
margin-right: 10px;
}
.condition-actions {
margin-top: 10px;
}
</style>
<div id="app" v-cloak>
@@ -50,8 +78,8 @@ layout("/layouts/platform.html"){
<el-table-column prop="username" label="姓名" fixed="left" width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="changeTypes" label="变更类型" width="140">
<template slot-scope="{row}">
<span style="color: #0e78c5;cursor: pointer" @click="openCurrentUserChangeInfo(row)">
{{getChangeTypes(row.changeTypes)}}
<span style="color: #0e78c5; cursor: pointer" @click="openCurrentUserChangeInfo(row)">
{{getChangeTypes(row.changeTypes)}}
</span>
</template>
</el-table-column>
@@ -75,12 +103,8 @@ layout("/layouts/platform.html"){
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<member-audit-change-info ref="memberAuditChangeInfoRef" is_default_url></member-audit-change-info>
</template>
</guava>
<el-dialog title="选择数据源" :visible.sync="updateDialog" width="50%">
<el-dialog title="选择数据源" :visible.sync="updateDialog" width="70%">
<el-timeline>
<el-timeline-item timestamp="数据源" placement="top">
<el-radio-group v-model="updateFromData.pullTime" style="width: 100%" class="pullTimeRadioGroup">
@@ -101,6 +125,20 @@ layout("/layouts/platform.html"){
</el-row>
</el-radio-group>
</el-timeline-item>
<el-timeline-item timestamp="高级条件筛选" placement="top">
<el-switch v-model="enableAdvancedConditions" active-text="启用高级条件"></el-switch>
<div v-if="enableAdvancedConditions" class="condition-builder">
<!-- 条件构建器组件 -->
<condition-group
:group="updateFromData.conditionGroup"
:field-options="fieldOptions"
:operator-options="operatorOptions"
@remove="removeRootGroup"
></condition-group>
</div>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer" v-loading="updateLoading">
<el-button @click="updateDialog = false" :disabled="updateLoading">取 消</el-button>
@@ -109,8 +147,110 @@ layout("/layouts/platform.html"){
</el-dialog>
</div>
<!-- 条件组组件模板 -->
<script type="text/x-template" id="condition-group-template">
<div class="condition-group">
<div class="condition-row">
<el-select v-model="group.logic" size="small" style="width: 80px">
<el-option label="AND" value="AND"></el-option>
<el-option label="OR" value="OR"></el-option>
</el-select>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="$emit('remove')"
v-if="canRemove"></el-button>
</div>
<!-- 条件列表 -->
<div v-for="(condition, index) in group.conditions" :key="'c-'+index" class="condition-row">
<el-select v-model="condition.field" placeholder="字段" size="small" style="width: 120px">
<el-option v-for="field in fieldOptions" :key="field.value" :label="field.label"
:value="field.value"></el-option>
</el-select>
<el-select v-model="condition.operator" placeholder="操作符" size="small" style="width: 100px">
<el-option v-for="op in operatorOptions" :key="op.value" :label="op.label"
:value="op.value"></el-option>
</el-select>
<el-input v-if="!isNullOperator(condition.operator)" v-model="condition.value" placeholder="值" size="small"
style="width: 150px"></el-input>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="removeCondition(index)"></el-button>
</div>
<!-- 嵌套条件组 -->
<div v-for="(nestedGroup, index) in group.groups" :key="'g-'+index">
<condition-group
:group="nestedGroup"
:field-options="fieldOptions"
:operator-options="operatorOptions"
:can-remove="true"
@remove="removeGroup(index)">
</condition-group>
</div>
<!-- 操作按钮 -->
<div class="condition-actions">
<el-button type="primary" size="mini" @click="addCondition">添加条件</el-button>
<el-button type="success" size="mini" @click="addGroup">添加条件组</el-button>
</div>
</div>
</script>
<script>
<!--#include("../../../zhgh/staffmanage/member/common/audit/memberAuditChangeInfo.js"){}#-->
// 条件组组件
Vue.component("condition-group", {
template: "#condition-group-template",
props: {
group: {
type: Object,
required: true
},
fieldOptions: {
type: Array,
required: true
},
operatorOptions: {
type: Array,
required: true
},
canRemove: {
type: Boolean,
default: false
}
},
methods: {
addCondition() {
if (!this.group.conditions) {
this.$set(this.group, "conditions", [])
}
this.group.conditions.push({
field: "",
operator: "=",
value: ""
})
},
removeCondition(index) {
this.group.conditions.splice(index, 1)
},
addGroup() {
if (!this.group.groups) {
this.$set(this.group, "groups", [])
}
this.group.groups.push({
logic: "AND",
conditions: [],
groups: []
})
},
removeGroup(index) {
this.group.groups.splice(index, 1)
},
isNullOperator(operator) {
return operator === "IS NULL" || operator === "IS NOT NULL"
}
}
})
new Vue({
el: "#app",
dicts: ["MEMBER_CHANGE_TYPE"],
@@ -121,20 +261,51 @@ layout("/layouts/platform.html"){
pullTimeOptions: false,
updateFromData: {
pullTime: null,
updateMode: "all"
updateMode: "ALL",
conditionGroup: {
logic: "AND",
conditions: [],
groups: []
}
},
updateLoading: false,
unitOptions: [],
changeTypeData: [],
enableAdvancedConditions: false,
// 可选字段列表
fieldOptions: [
{ label: "姓名", value: "username" },
{ label: "工号", value: "loginname" },
{ label: "性别", value: "sex" },
{ label: "生日", value: "birthday" },
{ label: "手机号", value: "mobile" },
{ label: "在职状态", value: "userState" },
{ label: "人事编制", value: "preparedBy" },
{ label: "人员类型", value: "personType" },
{ label: "来校年月", value: "arrivalAtSchoolDate" },
{ label: "单位", value: "unitName" },
{ label: "单位编码", value: "unitId" },
{ label: "学历", value: "education" },
{ label: "学位", value: "academicDegree" }
],
// 操作符列表
operatorOptions: [
{ label: "等于", value: "=" },
{ label: "不等于", value: "!=" },
{ label: "大于", value: ">" },
{ label: "小于", value: "<" },
{ label: "大于等于", value: ">=" },
{ label: "小于等于", value: "<=" },
{ label: "包含", value: "LIKE" },
{ label: "为空", value: "IS NULL" },
{ label: "不为空", value: "IS NOT NULL" }
]
}
},
components: {
'member-audit-change-info':MEMBER_AUDIT_CHANGE_INFO
},
methods: {
openCurrentUserChangeInfo(row) {
this.$refs.guava.view(() => {
this.$refs.memberAuditChangeInfoRef.onOpen({userId: row.id, recordId:row.userHistoryId})
this.$refs.memberAuditChangeInfoRef.onOpen({ userId: row.id, recordId: row.userHistoryId })
})
},
getChangeTypes(changeTypes) {
@@ -153,9 +324,15 @@ layout("/layouts/platform.html"){
this.updateLoading = false
this.$nextTick(() => {
this.updateFromData = {
updateMode: null,
pullTime: null
updateMode: "ALL",
pullTime: null,
conditionGroup: {
logic: "AND",
conditions: [],
groups: []
}
}
this.enableAdvancedConditions = false
})
},
getPullTimeOptions() {
@@ -175,6 +352,11 @@ layout("/layouts/platform.html"){
return
}
// 如果未启用高级条件,则移除条件组
if (!this.enableAdvancedConditions) {
this.updateFromData.conditionGroup = null
}
this.$confirm("确定要更新数据吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -182,12 +364,14 @@ layout("/layouts/platform.html"){
})
.then(() => {
this.updateLoading = true
this.$axios.post("/platform/sys/data/user/update/updateUserFormSource", this.updateFromData).then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.updateDialog = false
}
})
this.$axios
.post("/platform/sys/data/user/update/updateUserFormSource", { param: JSON.stringify(this.updateFromData) })
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.updateDialog = false
}
})
})
.finally(() => {
this.updateLoading = false
@@ -197,13 +381,21 @@ layout("/layouts/platform.html"){
this.$businessTool.listUnit(this.pageForm.unionId).then((res) => {
this.unitOptions = res
})
},
removeRootGroup() {
// 重置根条件组
this.updateFromData.conditionGroup = {
logic: "AND",
conditions: [],
groups: []
}
}
},
created() {
this.listUnit()
this.getPullTimeOptions()
this.pageData()
this.$businessTool.getAllDictOptions("MEMBER_CHANGE_TYPE").then(data => {
this.$businessTool.getAllDictOptions("MEMBER_CHANGE_TYPE").then((data) => {
this.changeTypeData = data
})
}
@@ -142,7 +142,7 @@ const filterUser = {
<template #footer>
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="onSubmit">确认添加到福利名单</el-button>
<el-button type="primary" @click="onSubmit" :loading="submitLoading">确认添加到福利名单</el-button>
</template>
</el-dialog>
@@ -152,6 +152,7 @@ const filterUser = {
return {
visible: false,
projectId: null,
submitLoading: false,
pageForm: {
birthMonths: [],
userStates: [],
@@ -223,16 +224,21 @@ const filterUser = {
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const { code, data, msg } = await this.$axios.post("/platform/welfare/project/mange/addWelfareUser", {
pageForm: JSON.stringify(this.pageForm),
projectId: this.projectId
})
if (code === 0) {
this.$message.success(msg)
this.visible = false
this.$emit("refresh")
} else {
this.$message.error(msg)
this.submitLoading = true;
try {
const { code, data, msg } = await this.$axios.post("/platform/welfare/project/mange/addWelfareUser", {
pageForm: JSON.stringify(this.pageForm),
projectId: this.projectId
})
if (code === 0) {
this.$message.success(msg)
this.visible = false
this.$emit("refresh")
} else {
this.$message.error(msg)
}
} finally {
this.submitLoading = false;
}
})
}
@@ -20,7 +20,13 @@ layout("/layouts/platform.html"){
<search-item label="福利项目">
<el-select :clearable="false" filterable placeholder="请选择福利项目" style="width: 100%" v-model="pageForm.projectId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in projectSelectOptions"></el-option>
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in projectOptions"></el-option>
</el-select>
</search-item>
<search-item label="福利选项">
<el-select clearable filterable placeholder="请选择福利选项" style="width: 100%" v-model="pageForm.welfareOptionId">
<el-option :key="item.id" :label="item.optionName" :value="item.id" v-for="item in welfareOptions"></el-option>
</el-select>
</search-item>
@@ -113,11 +119,12 @@ layout("/layouts/platform.html"){
},
unionOptions: [],
unitOptions: [],
projectSelectOptions: [],
projectOptions: [],
tableColumns: [
{ prop: "loginName", label: "工号" },
{ prop: "userName", label: "姓名" },
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
{ prop: "welfareUnitName", label: "所属单位", sortable: true },
{ prop: "selectedOptions", label: "所选福利", sortable: true },
@@ -125,10 +132,18 @@ layout("/layouts/platform.html"){
]
}
},
computed: {
welfareOptions() {
if (this.pageForm.projectId) {
return this.projectOptions.find((item) => item.id === this.pageForm.projectId).options
}
return []
}
},
methods: {
getWelfareList() {
this.$axios.post("/platform/welfare/common/list", { year: this.pageForm.year }).then((res) => {
this.projectSelectOptions = res.data
this.projectOptions = res.data
if (res.data && res.data.length > 0) {
this.$set(this.pageForm, "projectId", res.data[0].id)
} else {
@@ -25,7 +25,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="所属工会">
<el-select :clearable="clearable" clearable filterable placeholder="所属工会" style="width: 100%" v-model="pageForm.unionId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unions"></el-option>
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unionOptions"></el-option>
</el-select>
</search-item>
</search>
@@ -93,47 +93,16 @@ layout("/layouts/platform.html"){
},
data() {
return {
unions: [],
pageForm: {
searchName: "username",
year: new Date().getFullYear().toString()
},
unionOptions: [],
welfareProjectList: [],
welfareOptions: [],
projectInfo: {},
clearable: false,
tableColumns: [],
receive_tableColumns: [
{ label: "工号", prop: "loginName" },
{ label: "姓名", prop: "userName" },
{ label: "单位", prop: "unitName" },
{ label: "所选福利", prop: "optionName" }
],
receiveTableData: [],
receivePageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
unclaimedDialog: false,
unclaimedTableData: [],
unclaimedPageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
unclaimed_tableColumns: [
{ label: "姓名", prop: "userName" },
{ label: "工号", prop: "loginName" },
{ label: "单位", prop: "unitName" },
{ label: "工会", prop: "unionName" }
]
tableColumns: []
}
},
methods: {
@@ -171,15 +140,14 @@ layout("/layouts/platform.html"){
this.tableLoading = false
},
async getWelfareProjectList() {
const resp = await this.$axios.post("/platform/welfare/project/mange/getWelfareList", { year: this.pageForm.year })
this.welfareProjectList = resp.data
if (this.welfareProjectList && this.welfareProjectList.length > 0) {
this.$set(this.pageForm, "projectId", this.welfareProjectList[0].id)
this.getWelfareOptions()
const res = await this.$axios.post("/platform/welfare/project/mange/getWelfareList", { year: this.pageForm.year })
this.welfareProjectList = res.data
if (res.data && res.data.length > 0) {
this.$set(this.pageForm, "projectId", res.data[0].id)
} else {
this.tableData = []
this.tableColumns = []
this.$set(this.pageForm, "projectId", null)
}
this.doSearch()
},
getWelfareOptions() {
const data = this.welfareProjectList.find((p) => p.id === this.pageForm.projectId)
@@ -191,14 +159,13 @@ layout("/layouts/platform.html"){
!this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN", "SCHOOL_UNION_WELFARE_ADMIN"]) &&
this.$auth.hasRoleOr(["BRANCH_UNION_CHAIRMAN"])
) {
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.unionOptions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.$set(this.pageForm, "unionId", this.unions[0].id)
this.clearable = true
} else {
this.unions = await this.$businessTool.listUnion()
this.unionOptions = await this.$businessTool.listUnion()
this.clearable = true
}
this.pageForm.year = new Date().getFullYear().toString()
await this.getWelfareProjectList()
await this.pageData()
}
@@ -15,6 +15,7 @@ layout("/layouts/platform.html"){
type="year"
v-model="pageForm.year"
value-format="yyyy"
@change="getWelfareList"
></el-date-picker>
</search-item>
@@ -117,6 +118,9 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="福利名单">
<el-button :disabled="!pageForm.projectId" @click="openExport" icon="el-icon-download" size="small" type="primary">
导出名单
</el-button>
<el-button :disabled="!pageForm.projectId" @click="openImport" icon="el-icon-document-add" size="small" type="primary">
导入名单
</el-button>
@@ -251,10 +255,13 @@ layout("/layouts/platform.html"){
}
},
methods: {
openWelfareListUser() {
this.$refs.addWelfareListUser.welfareListUserDrawer = true
this.$refs.addWelfareListUser.selectNotWelfareList(this.pageForm.projectId)
// 导出名单
openExport() {
this.$downLoad("/platform/welfare/list/mange/exportXlsx", {
pageForm: JSON.stringify(this.pageForm)
})
},
successImport() {
this.doSearch()
this.importDialog = false
@@ -286,7 +293,10 @@ layout("/layouts/platform.html"){
this.projectSelectOptions = res.data
if (res.data && res.data.length > 0) {
this.$set(this.pageForm, "projectId", res.data[0].id)
} else {
this.$set(this.pageForm, "projectId", null)
}
this.doSearch()
})
},
pageData() {