This commit is contained in:
2026-06-18 15:33:11 +08:00
parent 47e971ebc8
commit bedf31bf0c
4 changed files with 215 additions and 12 deletions
@@ -42,6 +42,12 @@ layout("/layouts/platform.html"){
<el-option v-for="item in assignSourceOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</search-item>
<search-item label="是否退出">
<el-select v-model="pageForm.cancelled" clearable placeholder="请选择是否退出" style="width: 100%">
<el-option label="已退出" value="true"></el-option>
<el-option label="未退出" value="false"></el-option>
</el-select>
</search-item>
<search-item label="姓名/工号">
<el-input
v-model="pageForm.keyword"
@@ -64,6 +70,7 @@ layout("/layouts/platform.html"){
<i class="el-icon-user"></i>
人员分配
</el-button>
<el-button type="warning" size="medium" icon="el-icon-message" @click="openRemindDialog">发送提醒</el-button>
<el-button type="primary" size="medium" icon="el-icon-download" @click="exportData">导出</el-button>
</table-tool>
<el-table
@@ -109,6 +116,30 @@ layout("/layouts/platform.html"){
</el-card>
</guava>
<el-dialog
title="发送提醒"
:visible.sync="remindDialogVisible"
:close-on-click-modal="false"
width="560px"
@closed="resetRemindDialog">
<el-form :model="remindForm" :rules="remindRules" ref="remindFormRef" label-width="90px">
<el-form-item label="提醒内容" prop="content">
<el-input
v-model="remindForm.content"
type="textarea"
:rows="5"
maxlength="500"
show-word-limit
placeholder="请输入需要发送给当前查询结果人员的提醒内容">
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="remindDialogVisible = false">取消</el-button>
<el-button type="primary" :loading="remindSubmitting" @click="doSendReminder">发送</el-button>
</span>
</el-dialog>
<el-dialog
custom-class="tour-user-assignment-dialog"
title="人员分配"
@@ -310,6 +341,8 @@ layout("/layouts/platform.html"){
assignMatterOptions: [],
unionOptions: [],
assignDialogVisible: false,
remindDialogVisible: false,
remindSubmitting: false,
candidateLoading: false,
candidateSelectLoading: false,
candidateData: [],
@@ -332,6 +365,7 @@ layout("/layouts/platform.html"){
unionId: "",
personType: "",
assignSource: "SCHOOL_UNION",
cancelled: "false",
keyword: ""
},
assignForm: {
@@ -352,12 +386,18 @@ layout("/layouts/platform.html"){
matterId: "",
userName: ""
},
remindForm: {
content: ""
},
assignRules: {
year: [{required: true, message: "请选择年度", trigger: ["change", "blur"]}],
settingId: [{required: true, message: "请选择疗休养配置", trigger: ["change", "blur"]}]
},
selectMatterRules: {
matterId: [{required: true, message: "请选择分配线路", trigger: ["change", "blur"]}]
},
remindRules: {
content: [{required: true, message: "请输入提醒内容", trigger: ["blur"]}]
}
}
},
@@ -386,6 +426,11 @@ layout("/layouts/platform.html"){
userName: ""
}
},
defaultRemindForm() {
return {
content: ""
}
},
resetSearch() {
const currentYear = moment().format("YYYY")
this.pageForm.year = currentYear
@@ -395,6 +440,7 @@ layout("/layouts/platform.html"){
this.pageForm.personType = ""
// 页面打开和重置后默认查看校工会分配,清空该筛选项时后端会查询全部来源。
this.pageForm.assignSource = "SCHOOL_UNION"
this.pageForm.cancelled = "false"
this.pageForm.keyword = ""
this.loadSettingOptions()
},
@@ -442,9 +488,24 @@ layout("/layouts/platform.html"){
}
})
},
pageData() {
const params = Object.assign({}, this.pageForm)
if (params.cancelled === "") {
delete params.cancelled
}
this.tableLoading = true
this.$axios.post(loc() + "/pageData", params).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
}).finally(() => {
this.tableLoading = false
})
},
exportData() {
const params = new URLSearchParams()
;["year", "settingId", "matterId", "unionId", "personType", "assignSource", "keyword", "pageOrderName", "pageOrderBy"].forEach(key => {
;["year", "settingId", "matterId", "unionId", "personType", "assignSource", "cancelled", "keyword", "pageOrderName", "pageOrderBy"].forEach(key => {
const value = this.pageForm[key]
if (value !== undefined && value !== null && value !== "") {
params.append(key, value)
@@ -452,6 +513,56 @@ layout("/layouts/platform.html"){
})
window.location.href = loc() + "/exportData?" + params.toString()
},
buildCurrentQueryParams() {
const params = {}
;["year", "settingId", "matterId", "unionId", "personType", "assignSource", "cancelled", "keyword", "pageOrderName", "pageOrderBy"].forEach(key => {
const value = this.pageForm[key]
if (value !== undefined && value !== null && value !== "") {
params[key] = value
}
})
return params
},
openRemindDialog() {
if (!this.pageForm.settingId) {
this.$message.warning("请先选择疗休养配置")
return
}
this.remindForm = this.defaultRemindForm()
this.remindDialogVisible = true
},
resetRemindDialog() {
this.remindForm = this.defaultRemindForm()
this.remindSubmitting = false
if (this.$refs.remindFormRef) {
this.$refs.remindFormRef.clearValidate()
}
},
doSendReminder() {
this.$refs.remindFormRef.validate((valid) => {
if (!valid) return
const params = this.buildCurrentQueryParams()
params.content = this.remindForm.content
this.$confirm("确定给当前查询结果中的人员发送提醒吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.remindSubmitting = true
this.$axios.post(loc() + "/sendReminder", params).then((res) => {
if (res.code === 0) {
const data = res.data || {}
this.$message.success("提醒发送成功,共发送" + (data.receiverCount || 0) + "人")
this.remindDialogVisible = false
} else {
this.$message.warning(res.msg || "提醒发送失败")
}
}).finally(() => {
this.remindSubmitting = false
})
}).catch(() => {})
})
},
openAssign() {
const year = this.pageForm.year || moment().format("YYYY")
this.assignForm = this.defaultAssignForm(year)