解决登录显示、首页显示bug
This commit is contained in:
@@ -6,11 +6,19 @@ import { rpcOrNull, rpcOrValue } from '@/services/analytics/rpc.uts'
|
||||
export type DeliveryStaff = {
|
||||
id: string
|
||||
uid: string | null
|
||||
station_id: string | null
|
||||
station_name: string | null
|
||||
staff_no: string | null
|
||||
nickname: string
|
||||
avatar: string | null
|
||||
phone: string
|
||||
status: number
|
||||
is_active: boolean
|
||||
online_status: string
|
||||
certificate_status: string
|
||||
certificate_expire_at: string | null
|
||||
service_area: string | null
|
||||
skills: Array<string> | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
@@ -60,12 +68,29 @@ export async function fetchDeliveryStaffPage(
|
||||
* 保存配送员
|
||||
*/
|
||||
export async function saveDeliveryStaff(staff: any): Promise<string | null> {
|
||||
const rawSkills = typeof staff.skillsText === 'string' ? staff.skillsText : ''
|
||||
const parts = rawSkills.split(',')
|
||||
const skills = [] as Array<string>
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
const item = parts[i].trim()
|
||||
if (item != '') {
|
||||
skills.push(item)
|
||||
}
|
||||
}
|
||||
const res = await rpcOrValue('rpc_admin_save_delivery_staff', {
|
||||
p_id: staff.id,
|
||||
p_uid: staff.uid,
|
||||
p_station_id: staff.station_id,
|
||||
p_staff_no: staff.staff_no,
|
||||
p_nickname: staff.nickname,
|
||||
p_avatar: staff.avatar,
|
||||
p_phone: staff.phone,
|
||||
p_status: staff.status
|
||||
p_status: staff.status,
|
||||
p_online_status: staff.online_status,
|
||||
p_certificate_status: staff.certificate_status,
|
||||
p_certificate_expire_at: staff.certificate_expire_at,
|
||||
p_service_area: staff.service_area,
|
||||
p_skills: skills
|
||||
} as any)
|
||||
return res != null ? String(res) : null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user