feat(M08-B): 补保洁员资料细节
This commit is contained in:
+2
-1
@@ -462,11 +462,12 @@ async function handleCreateCleaner(
|
||||
}
|
||||
|
||||
async function handleUpdateCleaner(
|
||||
input: { userId: string; nickname: string; storeIds: string[]; note?: string }
|
||||
input: { userId: string; nickname: string; phone?: string; storeIds: string[]; note?: string }
|
||||
) {
|
||||
await runAction(async () => {
|
||||
await updateStaffUser(session.value, input.userId, {
|
||||
nickname: input.nickname,
|
||||
phone: input.phone,
|
||||
roles: ['CLEANER'],
|
||||
storeIds: input.storeIds,
|
||||
note: input.note
|
||||
|
||||
@@ -41,6 +41,18 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="资料" width="150">
|
||||
<template #default="{ row }">
|
||||
<div class="profile-badges">
|
||||
<el-tag :type="row.wechatMiniappBound ? 'success' : 'warning'" effect="light">
|
||||
{{ row.wechatMiniappBound ? '已绑微信' : '未绑微信' }}
|
||||
</el-tag>
|
||||
<el-tag :type="profileComplete(row) ? 'success' : 'info'" effect="plain">
|
||||
{{ profileComplete(row) ? '资料完整' : '待补资料' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="门店范围" min-width="150">
|
||||
<template #default="{ row }">{{ row.storeIds.join(', ') || '未配置' }}</template>
|
||||
</el-table-column>
|
||||
@@ -108,6 +120,9 @@
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="editDialog.nickname" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="editDialog.phone" inputmode="tel" placeholder="留空则不修改" />
|
||||
</el-form-item>
|
||||
<el-form-item label="门店 ID,逗号分隔">
|
||||
<el-input v-model="editDialog.storeIdsText" />
|
||||
</el-form-item>
|
||||
@@ -151,7 +166,7 @@ const emit = defineEmits<{
|
||||
'search-change': [string];
|
||||
'page-change': [number];
|
||||
create: [{ nickname: string; phone: string; storeIds: string[]; note?: string }];
|
||||
update: [{ userId: string; nickname: string; storeIds: string[]; note?: string }];
|
||||
update: [{ userId: string; nickname: string; phone?: string; storeIds: string[]; note?: string }];
|
||||
'status-toggle': [{ userId: string; status: UserStatus }];
|
||||
'reset-sessions': [string];
|
||||
}>();
|
||||
@@ -173,6 +188,7 @@ const editDialog = reactive({
|
||||
open: false,
|
||||
userId: '',
|
||||
nickname: '',
|
||||
phone: '',
|
||||
storeIdsText: '',
|
||||
note: ''
|
||||
});
|
||||
@@ -204,6 +220,7 @@ function openEdit(row: ManagedUser) {
|
||||
editDialog.open = true;
|
||||
editDialog.userId = row.id;
|
||||
editDialog.nickname = row.nickname;
|
||||
editDialog.phone = '';
|
||||
editDialog.storeIdsText = row.storeIds.join(', ');
|
||||
editDialog.note = row.note;
|
||||
}
|
||||
@@ -212,9 +229,14 @@ function submitEdit() {
|
||||
emit('update', {
|
||||
userId: editDialog.userId,
|
||||
nickname: editDialog.nickname,
|
||||
phone: editDialog.phone.trim() || undefined,
|
||||
storeIds: parseStoreIds(editDialog.storeIdsText),
|
||||
note: editDialog.note
|
||||
});
|
||||
editDialog.open = false;
|
||||
}
|
||||
|
||||
function profileComplete(row: ManagedUser) {
|
||||
return row.wechatMiniappBound && row.storeIds.length > 0 && Boolean(row.nickname);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -206,6 +206,12 @@ textarea {
|
||||
width: min(240px, 100%);
|
||||
}
|
||||
|
||||
.profile-badges {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -26,11 +26,13 @@ export interface ManagedUser {
|
||||
userType: string;
|
||||
status: UserStatus;
|
||||
nickname: string;
|
||||
avatarUrl: string;
|
||||
maskedPhone: string;
|
||||
maskedLastIp: string;
|
||||
note: string;
|
||||
roles: StaffRole[];
|
||||
storeIds: string[];
|
||||
wechatMiniappBound: boolean;
|
||||
registeredAt: string;
|
||||
lastLoginAt: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user