feat(admin): 选人组件接入——UserCheckModal 加单选模式+UserSelectInput 单选封装;映射办理人/审批节点指定用户弃手输 ID 改弹窗选人 (/admin/user/tree);删休眠 UserCheckInput 死代码
build / build (push) Successful in 1m56s

This commit is contained in:
chenxing
2026-09-17 11:09:53 +08:00
parent 07275c6e3d
commit 2e591e7a54
6 changed files with 237 additions and 237 deletions
+14 -24
View File
@@ -1,7 +1,8 @@
<script setup lang="ts">
// 办理人映射管理(概览 §4.7/§六):DEPT_KEY → 办理人;成员检索经 UserBase /oapi/user/byId 补姓名
// 办理人映射管理(概览 §4.7/§六):DEPT_KEY → 办理人;办理人改为弹窗选人(参照 Notice 选人范式)
import { ref, onMounted } from "vue";
import { Message } from "view-ui-plus";
import UserSelectInput from "@/components/UserSelectInput.vue";
import { flowApi } from "@/api/module/flow";
import Utils from "@/utils";
@@ -12,7 +13,6 @@ const rows = ref<any[]>([]);
const saveVisible = ref(false);
const saving = ref(false);
const form = ref<any>({ deptKey: "", deptName: "", userId: null, userName: "" });
const lookingUp = ref(false);
// 一键拉取教师组(预览确认后批量导入)
const groupVisible = ref(false);
@@ -79,26 +79,14 @@ function onAdd() {
saveVisible.value = true;
}
async function onLookup() {
if (!form.value.userId) {
Message.warning("请先填用户ID");
return;
}
lookingUp.value = true;
try {
const u: any = await flowApi.mapLookupUser(form.value.userId).send();
form.value.userName = u?.name || "";
Message.success(`检索到用户:${u?.name || "-"}`);
} catch {
Message.error("UserBase 检索失败");
} finally {
lookingUp.value = false;
}
function onUserPick(u: any) {
// 选人组件回传 id+name 同帧快照(姓名不再自查)
form.value.userName = u?.name || "";
}
async function onSave() {
if (!form.value.deptKey.trim() || !form.value.userId) {
Message.warning("科室编码与用户ID必填");
Message.warning("科室编码与办理人必填");
return;
}
saving.value = true;
@@ -144,12 +132,14 @@ onMounted(load);
<FormItem label="科室名称">
<Input v-model="form.deptName" placeholder="如 医保办(可空)" />
</FormItem>
<FormItem label="用户ID">
<Input v-model="form.userId" placeholder="UserBase 用户主键" />
</FormItem>
<FormItem label="姓名快照">
<Input v-model="form.userName" placeholder="可留空,点检索自动补全" style="width: 180px" />
<Button :loading="lookingUp" @click="onLookup" style="margin-left: 8px">检索</Button>
<FormItem label="办理人">
<UserSelectInput
:model-value="form.userId"
:display-name="form.userName"
@update:model-value="form.userId = $event"
@update:display-name="form.userName = $event"
@on-change="onUserPick"
/>
</FormItem>
</Form>
<template #footer>