Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f63c3fe216 | ||
|
|
087f177a14 | ||
|
|
9f7ab62a06 |
@@ -33,4 +33,14 @@ export const employeeApi = {
|
|||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
body: { status },
|
body: { status },
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
/** 实习转正 / 调级 / 钻石设星 */
|
||||||
|
updateLevel: (
|
||||||
|
id: string,
|
||||||
|
body: { stage?: 'intern' | 'certified'; grade?: string; star?: number }
|
||||||
|
) =>
|
||||||
|
request<{ employee: Employee }>(`/health/employee/${id}/level`, {
|
||||||
|
method: 'PATCH',
|
||||||
|
body,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,12 @@ export const escortApi = {
|
|||||||
body,
|
body,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
assign: (id: string, employeeId: string) =>
|
||||||
|
request<{ record: EscortRecord }>(`/health/escort-record/${id}/assign`, {
|
||||||
|
method: 'POST',
|
||||||
|
body: { employeeId },
|
||||||
|
}),
|
||||||
|
|
||||||
updateStatus: (id: string, status: string, reason?: string) =>
|
updateStatus: (id: string, status: string, reason?: string) =>
|
||||||
request<{ record: EscortRecord; deleted?: boolean }>(`/health/escort-record/${id}/status`, {
|
request<{ record: EscortRecord; deleted?: boolean }>(`/health/escort-record/${id}/status`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
|
|||||||
@@ -191,6 +191,12 @@ export type Employee = {
|
|||||||
languages?: string[]
|
languages?: string[]
|
||||||
isOnline?: boolean
|
isOnline?: boolean
|
||||||
orderCount?: number
|
orderCount?: number
|
||||||
|
/** 陪诊师阶段:intern=实习,certified=正式 */
|
||||||
|
stage?: 'intern' | 'certified'
|
||||||
|
/** 等级仅用于展示与排序,不参与权限判定 */
|
||||||
|
grade?: 'bronze' | 'silver' | 'gold' | 'diamond'
|
||||||
|
/** 星级仅钻石等级有效(0-5) */
|
||||||
|
star?: number
|
||||||
}
|
}
|
||||||
emergencyContact?: {
|
emergencyContact?: {
|
||||||
name?: string
|
name?: string
|
||||||
|
|||||||
@@ -102,6 +102,24 @@ export const EMPLOYEE_STATUS_VARIANTS: Record<string, string> = {
|
|||||||
suspended: 'warning',
|
suspended: 'warning',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 陪诊师阶段:实习只看单,转正后才能接单 */
|
||||||
|
export const ATTENDANT_STAGE_LABELS: Record<string, string> = {
|
||||||
|
intern: '实习',
|
||||||
|
certified: '正式',
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ATTENDANT_STAGE_VARIANTS: Record<string, string> = {
|
||||||
|
intern: 'info',
|
||||||
|
certified: 'success',
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ATTENDANT_GRADE_LABELS: Record<string, string> = {
|
||||||
|
bronze: '青铜',
|
||||||
|
silver: '白银',
|
||||||
|
gold: '黄金',
|
||||||
|
diamond: '钻石',
|
||||||
|
}
|
||||||
|
|
||||||
export const ACCOUNT_STATUS_LABELS: Record<string, string> = {
|
export const ACCOUNT_STATUS_LABELS: Record<string, string> = {
|
||||||
normal: '正常',
|
normal: '正常',
|
||||||
lock: '已锁定',
|
lock: '已锁定',
|
||||||
|
|||||||
@@ -109,6 +109,19 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template #cell(level)="{ item }">
|
||||||
|
<template v-if="(item.role || 'attendant') === 'attendant'">
|
||||||
|
<span class="badge fs-xxs" :class="`badge-soft-${ATTENDANT_STAGE_VARIANTS[stageOf(item)]}`">
|
||||||
|
{{ ATTENDANT_STAGE_LABELS[stageOf(item)] }}
|
||||||
|
</span>
|
||||||
|
<p class="text-muted mb-0 fs-12 mt-1">
|
||||||
|
{{ ATTENDANT_GRADE_LABELS[gradeOf(item)] }}
|
||||||
|
<span v-if="gradeOf(item) === 'diamond' && starOf(item) > 0">{{ '★'.repeat(starOf(item)) }}</span>
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
<span v-else class="text-muted">-</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template #cell(service)="{ item }">
|
<template #cell(service)="{ item }">
|
||||||
<div>服务年限:{{ item.work?.workYears || 0 }} 年</div>
|
<div>服务年限:{{ item.work?.workYears || 0 }} 年</div>
|
||||||
<p class="text-muted mb-0 fs-12">累计接单:{{ item.attendantInfo?.orderCount || 0 }}</p>
|
<p class="text-muted mb-0 fs-12">累计接单:{{ item.attendantInfo?.orderCount || 0 }}</p>
|
||||||
@@ -128,6 +141,15 @@
|
|||||||
<BButton variant="light" class="btn btn-icon btn-sm rounded-circle" title="编辑" @click="openEdit(item)">
|
<BButton variant="light" class="btn btn-icon btn-sm rounded-circle" title="编辑" @click="openEdit(item)">
|
||||||
<Icon icon="edit" class="fs-lg" />
|
<Icon icon="edit" class="fs-lg" />
|
||||||
</BButton>
|
</BButton>
|
||||||
|
<BButton
|
||||||
|
v-if="(item.role || 'attendant') === 'attendant'"
|
||||||
|
variant="light"
|
||||||
|
class="btn btn-icon btn-sm rounded-circle"
|
||||||
|
title="阶段与等级"
|
||||||
|
@click="openLevel(item)"
|
||||||
|
>
|
||||||
|
<Icon icon="award" class="fs-lg" />
|
||||||
|
</BButton>
|
||||||
<BButton
|
<BButton
|
||||||
:variant="item.status === 'active' ? 'danger' : 'success'"
|
:variant="item.status === 'active' ? 'danger' : 'success'"
|
||||||
class="btn btn-icon btn-sm rounded-circle"
|
class="btn btn-icon btn-sm rounded-circle"
|
||||||
@@ -459,6 +481,41 @@
|
|||||||
通过后将自动为其创建(或启用)陪诊师档案,小程序端权限立即生效。
|
通过后将自动为其创建(或启用)陪诊师档案,小程序端权限立即生效。
|
||||||
</p>
|
</p>
|
||||||
</ConfirmModal>
|
</ConfirmModal>
|
||||||
|
|
||||||
|
<BModal v-model="levelVisible" title="阶段与等级" hide-footer>
|
||||||
|
<p class="mb-3">陪诊师:<strong>{{ levelTarget?.profile?.name || '-' }}</strong></p>
|
||||||
|
<BRow class="g-3">
|
||||||
|
<BCol md="6">
|
||||||
|
<label class="form-label">阶段</label>
|
||||||
|
<BFormSelect v-model="levelForm.stage">
|
||||||
|
<option value="intern">实习(仅可查看,不能接单)</option>
|
||||||
|
<option value="certified">正式(可接单)</option>
|
||||||
|
</BFormSelect>
|
||||||
|
</BCol>
|
||||||
|
<BCol md="6">
|
||||||
|
<label class="form-label">等级</label>
|
||||||
|
<BFormSelect v-model="levelForm.grade">
|
||||||
|
<option v-for="(label, value) in ATTENDANT_GRADE_LABELS" :key="value" :value="value">{{ label }}</option>
|
||||||
|
</BFormSelect>
|
||||||
|
</BCol>
|
||||||
|
<BCol v-if="levelForm.grade === 'diamond'" md="6">
|
||||||
|
<label class="form-label">星级</label>
|
||||||
|
<!-- 选项 value 绑定为数字,BFormSelect 原样回传,无需 .number 修饰符 -->
|
||||||
|
<BFormSelect v-model="levelForm.star">
|
||||||
|
<option v-for="n in 6" :key="n - 1" :value="n - 1">{{ n - 1 === 0 ? '无' : `${n - 1} 星` }}</option>
|
||||||
|
</BFormSelect>
|
||||||
|
</BCol>
|
||||||
|
</BRow>
|
||||||
|
<p class="text-muted fs-12 mt-3 mb-0">
|
||||||
|
等级只做展示与排序,不参与权限判定;实习转正后才可接单。
|
||||||
|
</p>
|
||||||
|
<div class="d-flex justify-content-end gap-2 mt-4">
|
||||||
|
<BButton variant="light" @click="levelVisible = false">取消</BButton>
|
||||||
|
<BButton variant="primary" :disabled="levelSaving" @click="confirmLevel">
|
||||||
|
{{ levelSaving ? '保存中...' : '保存' }}
|
||||||
|
</BButton>
|
||||||
|
</div>
|
||||||
|
</BModal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -477,6 +534,9 @@ import type { AttendantApplication, Employee } from '~/types/api'
|
|||||||
import { exportCsv } from '~/utils/csv'
|
import { exportCsv } from '~/utils/csv'
|
||||||
import { fetchAllPages } from '~/utils/paging'
|
import { fetchAllPages } from '~/utils/paging'
|
||||||
import {
|
import {
|
||||||
|
ATTENDANT_GRADE_LABELS,
|
||||||
|
ATTENDANT_STAGE_LABELS,
|
||||||
|
ATTENDANT_STAGE_VARIANTS,
|
||||||
EMPLOYEE_STATUS_LABELS,
|
EMPLOYEE_STATUS_LABELS,
|
||||||
EMPLOYEE_STATUS_VARIANTS,
|
EMPLOYEE_STATUS_VARIANTS,
|
||||||
ROLE_LABELS,
|
ROLE_LABELS,
|
||||||
@@ -509,6 +569,7 @@ const fields = [
|
|||||||
{ key: 'contact', label: '联系方式' },
|
{ key: 'contact', label: '联系方式' },
|
||||||
{ key: 'role', label: '角色' },
|
{ key: 'role', label: '角色' },
|
||||||
{ key: 'status', label: '状态' },
|
{ key: 'status', label: '状态' },
|
||||||
|
{ key: 'level', label: '阶段 / 等级' },
|
||||||
{ key: 'service', label: '服务数据' },
|
{ key: 'service', label: '服务数据' },
|
||||||
{ key: 'area', label: '服务区域 / 擅长' },
|
{ key: 'area', label: '服务区域 / 擅长' },
|
||||||
{ key: 'action', label: '操作' },
|
{ key: 'action', label: '操作' },
|
||||||
@@ -524,14 +585,17 @@ const {
|
|||||||
load,
|
load,
|
||||||
search,
|
search,
|
||||||
} = useTableQuery<Employee>(
|
} = useTableQuery<Employee>(
|
||||||
|
// 接口返回 { employees, total },表组件约定 { items, total },这里做一次映射
|
||||||
(p, size) =>
|
(p, size) =>
|
||||||
employeeApi.list({
|
employeeApi
|
||||||
|
.list({
|
||||||
page: p,
|
page: p,
|
||||||
pageSize: size,
|
pageSize: size,
|
||||||
keyword: filters.keyword.trim() || undefined,
|
keyword: filters.keyword.trim() || undefined,
|
||||||
role: filters.role || undefined,
|
role: filters.role || undefined,
|
||||||
status: filters.status || undefined,
|
status: filters.status || undefined,
|
||||||
}),
|
})
|
||||||
|
.then((d) => ({ items: d.employees, total: d.total })),
|
||||||
// 同页两个列表,页码监听由原有 watch 手动控制
|
// 同页两个列表,页码监听由原有 watch 手动控制
|
||||||
{ autoWatch: false }
|
{ autoWatch: false }
|
||||||
)
|
)
|
||||||
@@ -614,6 +678,51 @@ const form = reactive({
|
|||||||
const statusVisible = ref(false)
|
const statusVisible = ref(false)
|
||||||
const statusTarget = ref<Employee | null>(null)
|
const statusTarget = ref<Employee | null>(null)
|
||||||
|
|
||||||
|
// ==================== 阶段与等级 ====================
|
||||||
|
const stageOf = (item: Employee) => (item.attendantInfo?.stage === 'intern' ? 'intern' : 'certified')
|
||||||
|
const gradeOf = (item: Employee) => item.attendantInfo?.grade || 'bronze'
|
||||||
|
const starOf = (item: Employee) => Number(item.attendantInfo?.star) || 0
|
||||||
|
|
||||||
|
const levelVisible = ref(false)
|
||||||
|
const levelSaving = ref(false)
|
||||||
|
const levelTarget = ref<Employee | null>(null)
|
||||||
|
const levelForm = reactive<{ stage: 'intern' | 'certified'; grade: string; star: number }>({
|
||||||
|
stage: 'intern',
|
||||||
|
grade: 'bronze',
|
||||||
|
star: 0,
|
||||||
|
})
|
||||||
|
|
||||||
|
const openLevel = (employee: Employee) => {
|
||||||
|
levelTarget.value = employee
|
||||||
|
levelForm.stage = employee.attendantInfo?.stage === 'intern' ? 'intern' : 'certified'
|
||||||
|
levelForm.grade = employee.attendantInfo?.grade || 'bronze'
|
||||||
|
levelForm.star = Number(employee.attendantInfo?.star) || 0
|
||||||
|
levelVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmLevel = async () => {
|
||||||
|
const target = levelTarget.value
|
||||||
|
if (!target || levelSaving.value) return
|
||||||
|
|
||||||
|
levelSaving.value = true
|
||||||
|
try {
|
||||||
|
const payload: { stage: 'intern' | 'certified'; grade: string; star?: number } = {
|
||||||
|
stage: levelForm.stage,
|
||||||
|
grade: levelForm.grade,
|
||||||
|
}
|
||||||
|
// 星级只对钻石有效:其他等级不传,服务端会把旧星级归零
|
||||||
|
if (levelForm.grade === 'diamond') payload.star = Number(levelForm.star) || 0
|
||||||
|
await employeeApi.updateLevel(target._id, payload)
|
||||||
|
notify.success('阶段与等级已更新')
|
||||||
|
levelVisible.value = false
|
||||||
|
await load()
|
||||||
|
} catch {
|
||||||
|
// 请求层已统一提示
|
||||||
|
} finally {
|
||||||
|
levelSaving.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== 入驻审核 ====================
|
// ==================== 入驻审核 ====================
|
||||||
const appFields = [
|
const appFields = [
|
||||||
{ key: 'person', label: '申请人' },
|
{ key: 'person', label: '申请人' },
|
||||||
@@ -636,12 +745,14 @@ const {
|
|||||||
search: runApplicationSearch,
|
search: runApplicationSearch,
|
||||||
} = useTableQuery<AttendantApplication>(
|
} = useTableQuery<AttendantApplication>(
|
||||||
(p, size) =>
|
(p, size) =>
|
||||||
attendantApplicationApi.list({
|
attendantApplicationApi
|
||||||
|
.list({
|
||||||
page: p,
|
page: p,
|
||||||
pageSize: size,
|
pageSize: size,
|
||||||
status: appFilters.status || undefined,
|
status: appFilters.status || undefined,
|
||||||
keyword: appFilters.keyword.trim() || undefined,
|
keyword: appFilters.keyword.trim() || undefined,
|
||||||
}),
|
})
|
||||||
|
.then((d) => ({ items: d.applications, total: d.total })),
|
||||||
{ autoWatch: false }
|
{ autoWatch: false }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<div v-if="loading" class="text-center py-5">
|
<div v-if="loading" class="text-center py-5">
|
||||||
<BSpinner variant="primary" />
|
<BSpinner variant="primary" />
|
||||||
</div>
|
</div>
|
||||||
<EChart v-else :get-options="trendOptions" :extensions="CHART_EXTENSIONS" style="height: 280px; width: 100%" />
|
<EChart v-else :get-options="() => trendOptions" :extensions="CHART_EXTENSIONS" style="height: 280px; width: 100%" />
|
||||||
</BCardBody>
|
</BCardBody>
|
||||||
</BCard>
|
</BCard>
|
||||||
</BCol>
|
</BCol>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<div v-if="loading" class="text-center py-5">
|
<div v-if="loading" class="text-center py-5">
|
||||||
<BSpinner variant="primary" />
|
<BSpinner variant="primary" />
|
||||||
</div>
|
</div>
|
||||||
<EChart v-else :get-options="statusOptions" :extensions="CHART_EXTENSIONS" style="height: 280px; width: 100%" />
|
<EChart v-else :get-options="() => statusOptions" :extensions="CHART_EXTENSIONS" style="height: 280px; width: 100%" />
|
||||||
</BCardBody>
|
</BCardBody>
|
||||||
</BCard>
|
</BCard>
|
||||||
</BCol>
|
</BCol>
|
||||||
|
|||||||
+31
-26
@@ -49,7 +49,7 @@
|
|||||||
@click="openAssign"
|
@click="openAssign"
|
||||||
>
|
>
|
||||||
<Icon icon="user-check" class="me-1" />
|
<Icon icon="user-check" class="me-1" />
|
||||||
{{ record.attendant?.id || record.attendant?.name ? '更换陪诊师' : '指派陪诊师' }}
|
分配陪诊师
|
||||||
</BButton>
|
</BButton>
|
||||||
<BButton v-if="canRecordOffline" variant="success" :disabled="actionLoading" @click="openPayment">
|
<BButton v-if="canRecordOffline" variant="success" :disabled="actionLoading" @click="openPayment">
|
||||||
线下收款补录
|
线下收款补录
|
||||||
@@ -333,7 +333,7 @@
|
|||||||
<BButton variant="primary" @click="router.replace('/orders')">返回订单列表</BButton>
|
<BButton variant="primary" @click="router.replace('/orders')">返回订单列表</BButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<BModal v-model="assignVisible" title="指派陪诊师" hide-footer>
|
<BModal v-model="assignVisible" title="分配陪诊师" hide-footer>
|
||||||
<div v-if="assignLoading" class="text-center py-4">
|
<div v-if="assignLoading" class="text-center py-4">
|
||||||
<BSpinner variant="primary" />
|
<BSpinner variant="primary" />
|
||||||
</div>
|
</div>
|
||||||
@@ -348,15 +348,19 @@
|
|||||||
</option>
|
</option>
|
||||||
</BFormSelect>
|
</BFormSelect>
|
||||||
</BFormGroup>
|
</BFormGroup>
|
||||||
<BAlert v-if="assignTarget && !assignTarget.userId" variant="warning" show class="py-2 fs-12 mb-3">
|
<BAlert v-if="assignTarget && !assignTarget.userId" variant="danger" show class="py-2 fs-12 mb-3">
|
||||||
该陪诊师未关联登录账号,指派后其无法在小程序端看到该订单。
|
该陪诊师未关联登录账号,无法接收订单,请先绑定账号。
|
||||||
</BAlert>
|
</BAlert>
|
||||||
<p class="text-muted fs-12 mb-0">指派后陪诊师可在小程序端查看并处理该订单。</p>
|
<p class="text-muted fs-12 mb-0">分配后陪诊师可在小程序端查看并处理该订单。</p>
|
||||||
</template>
|
</template>
|
||||||
<div class="d-flex justify-content-end gap-2 mt-4">
|
<div class="d-flex justify-content-end gap-2 mt-4">
|
||||||
<BButton variant="light" @click="assignVisible = false">取消</BButton>
|
<BButton variant="light" @click="assignVisible = false">取消</BButton>
|
||||||
<BButton variant="primary" :disabled="assignSubmitting || !assignTarget" @click="submitAssign">
|
<BButton
|
||||||
{{ assignSubmitting ? '提交中...' : '确认指派' }}
|
variant="primary"
|
||||||
|
:disabled="assignSubmitting || !assignTarget || !assignTarget.userId"
|
||||||
|
@click="submitAssign"
|
||||||
|
>
|
||||||
|
{{ assignSubmitting ? '提交中...' : '确认分配' }}
|
||||||
</BButton>
|
</BButton>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -509,9 +513,10 @@ const canRecordOffline = computed(() => {
|
|||||||
&& ['pending', 'confirmed'].includes(record.value.status || '')
|
&& ['pending', 'confirmed'].includes(record.value.status || '')
|
||||||
})
|
})
|
||||||
|
|
||||||
// 指派陪诊师:仅未进入取消流程且服务未结束时允许
|
// 分配陪诊师:仅未分配且未进入取消流程的进行中订单允许
|
||||||
const canAssignAttendant = computed(() => {
|
const canAssignAttendant = computed(() => {
|
||||||
if (!record.value) return false
|
if (!record.value) return false
|
||||||
|
if (record.value.attendant?.id || record.value.attendant?.name) return false
|
||||||
return (record.value.cancelStatus || 'none') === 'none'
|
return (record.value.cancelStatus || 'none') === 'none'
|
||||||
&& ['pending', 'confirmed', 'in_progress'].includes(record.value.status || '')
|
&& ['pending', 'confirmed', 'in_progress'].includes(record.value.status || '')
|
||||||
})
|
})
|
||||||
@@ -523,16 +528,26 @@ const attendants = ref<Employee[]>([])
|
|||||||
const assignTarget = ref<Employee | null>(null)
|
const assignTarget = ref<Employee | null>(null)
|
||||||
|
|
||||||
const openAssign = async () => {
|
const openAssign = async () => {
|
||||||
const currentId = record.value?.attendant?.id
|
assignTarget.value = null
|
||||||
assignTarget.value = currentId
|
|
||||||
? attendants.value.find((emp) => emp.userId && String(emp.userId) === String(currentId)) || null
|
|
||||||
: null
|
|
||||||
assignVisible.value = true
|
assignVisible.value = true
|
||||||
if (!attendants.value.length) {
|
if (!attendants.value.length) {
|
||||||
assignLoading.value = true
|
assignLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await employeeApi.list({ page: 1, pageSize: 100, role: 'attendant', status: 'active' })
|
// 分页拉全量在职陪诊师:单页有上限,只拉一页会静默漏人
|
||||||
attendants.value = data.employees
|
const fetched: Employee[] = []
|
||||||
|
let page = 1
|
||||||
|
let total = Number.POSITIVE_INFINITY
|
||||||
|
while (fetched.length < total && page <= 20) {
|
||||||
|
const data = await employeeApi.list({ page, pageSize: 100, role: 'attendant', status: 'active' })
|
||||||
|
total = data.total
|
||||||
|
fetched.push(...data.employees)
|
||||||
|
if (!data.employees.length) break
|
||||||
|
page += 1
|
||||||
|
}
|
||||||
|
// 实习陪诊师不可被指派,后端同样会拦截
|
||||||
|
attendants.value = fetched.filter(
|
||||||
|
(emp) => (emp.attendantInfo?.stage || 'certified') !== 'intern'
|
||||||
|
)
|
||||||
} catch {
|
} catch {
|
||||||
// 错误提示由请求层统一弹出
|
// 错误提示由请求层统一弹出
|
||||||
} finally {
|
} finally {
|
||||||
@@ -543,20 +558,10 @@ const openAssign = async () => {
|
|||||||
|
|
||||||
const submitAssign = async () => {
|
const submitAssign = async () => {
|
||||||
if (!record.value || !assignTarget.value) return
|
if (!record.value || !assignTarget.value) return
|
||||||
const emp = assignTarget.value
|
|
||||||
// 后端 attendant.sex 枚举仅 none/male/female,员工档案里的 other 需归一到 none
|
|
||||||
const rawSex = emp.profile?.sex
|
|
||||||
const attendant = {
|
|
||||||
name: emp.profile?.name || '',
|
|
||||||
sex: rawSex === 'male' || rawSex === 'female' ? rawSex : 'none',
|
|
||||||
mobile: emp.profile?.phone || '',
|
|
||||||
...(emp.userId ? { id: emp.userId } : {}),
|
|
||||||
}
|
|
||||||
assignSubmitting.value = true
|
assignSubmitting.value = true
|
||||||
try {
|
try {
|
||||||
// 后端 attendant 子文档结构:{ id: 关联登录用户ID, name, sex, mobile }
|
await escortApi.assign(record.value._id, assignTarget.value._id)
|
||||||
await escortApi.update(record.value._id, { attendant })
|
notify.success('陪诊师已分配')
|
||||||
notify.success('陪诊师已指派')
|
|
||||||
assignVisible.value = false
|
assignVisible.value = false
|
||||||
await load()
|
await load()
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user