feat: 完善人员数据同步与筛选

- 在人员来源表中保存专业技术职务代码 ZYJSZWDM
- 支持按所属单位、在职状态和人员类型筛选空数据
- 在获取信息中心数据和更新系统用户数据页面添加搜索重置按钮
- 同步人员时按人员类型或在职状态设置工会会员标记
This commit is contained in:
2026-11-03 17:30:29 +08:00
parent ffe782e538
commit fa019786d6
7 changed files with 77 additions and 12 deletions
@@ -3,6 +3,7 @@
<slot></slot>
<div class="search-query" v-if="isSearchButton">
<el-button type="primary" icon="el-icon-search" @click="$emit('search', null)">搜索</el-button>
<slot name="actions"></slot>
</div>
</div>
</template>
@@ -38,13 +38,13 @@ layout("/layouts/platform.html"){
<el-input placeholder="请输入工号" clearable v-model="pageForm.loginName" style="width: 100%"></el-input>
</search-item>
<search-item label="所属单位">
<el-select placeholder="请选择所属单位" v-model="pageForm.unitName" clearable filterable>
<el-option v-for="item in unitNameOptions" :key="item" :label="item" :value="item"></el-option>
<el-select placeholder="全部" v-model="pageForm.unitName" clearable filterable>
<el-option v-for="item in unitNameOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</search-item>
<search-item label="在职状态">
<el-select v-model="pageForm.userState" clearable filterable>
<el-option v-for="item in userStateOptions" :label="item" :value="item"></el-option>
<el-select placeholder="全部" v-model="pageForm.userState" clearable filterable>
<el-option v-for="item in userStateOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</search-item>
<!-- 暂停用人方式筛选,保留查询控件供后续恢复。
@@ -55,10 +55,11 @@ layout("/layouts/platform.html"){
</search-item>
-->
<search-item label="人员类型">
<el-select v-model="pageForm.personType" clearable filterable>
<el-option v-for="item in personTypeOptions" :label="item" :value="item"></el-option>
<el-select placeholder="全部" v-model="pageForm.personType" clearable filterable>
<el-option v-for="item in personTypeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</search-item>
<el-button slot="actions" icon="el-icon-refresh-left" @click="resetSearch">重置</el-button>
</search>
</el-card>
@@ -125,6 +126,16 @@ layout("/layouts/platform.html"){
}
},
methods: {
resetSearch() {
this.$set(this.pageForm, "userName", "")
this.$set(this.pageForm, "loginName", "")
this.$set(this.pageForm, "unitName", "")
this.$set(this.pageForm, "userState", "")
this.$set(this.pageForm, "personType", "")
this.$set(this.pageForm, "preparedBy", "")
this.$set(this.pageForm, "pullTime", (this.pullTimeOptions[0] || {}).pullTime || "")
this.doSearch()
},
pull() {
// 拉取未结束时不再打开确认框或发送重复请求。
if (this.pullLoading) return
@@ -149,6 +160,7 @@ layout("/layouts/platform.html"){
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.getSearchOptions()
this.getPullTimeOptions()
this.doSearch()
}
@@ -162,12 +174,24 @@ layout("/layouts/platform.html"){
.catch(() => {})
},
buildSearchOptions(values) {
const optionValues = new Set(values.map(value =>
value == null || /^(?:null)?$/i.test(value.trim()) ? "__EMPTY__" : value
))
const hasEmpty = optionValues.delete("__EMPTY__")
const options = Array.from(optionValues, value => ({ label: value, value }))
if (hasEmpty) {
options.push({ label: "空数据", value: "__EMPTY__" })
}
return options
},
getSearchOptions() {
this.$axios.post("/platform/sys/data/user/pull/searchOptions").then((resp) => {
if (resp.code === 0) {
this.unitNameOptions = resp.data.unitNames
this.userStateOptions = resp.data.userStates
this.personTypeOptions = resp.data.personTypes
this.unitNameOptions = this.buildSearchOptions(resp.data.unitNames)
this.userStateOptions = this.buildSearchOptions(resp.data.userStates)
this.personTypeOptions = this.buildSearchOptions(resp.data.personTypes)
this.preparedByOptions = resp.data.preparedBys
}
})
@@ -206,6 +230,7 @@ layout("/layouts/platform.html"){
if (resp.code === 0) {
this.$message.success(resp.msg)
this.pullTimeDialogVisible = false
this.getSearchOptions()
this.doSearch()
}
})
@@ -42,6 +42,7 @@ layout("/layouts/platform.html"){
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" code="USER_PERSON_TYPE" style="width: 100%"></dict-select>
</search-item>
<el-button slot="actions" icon="el-icon-refresh-left" @click="resetSearch">重置</el-button>
</search>
</el-card>
@@ -173,6 +174,14 @@ layout("/layouts/platform.html"){
"member-all-change-info": MEMBER_ALL_CHANGE_INFO
},
methods: {
resetSearch() {
this.$set(this.pageForm, "userName", "")
this.$set(this.pageForm, "loginName", "")
this.$set(this.pageForm, "unitId", "")
this.$set(this.pageForm, "userState", "")
this.$set(this.pageForm, "personType", "")
this.doSearch()
},
// 更新单位数据
updateUnits() {
if (this.unitUpdateLoading || this.updateLoading) return