统一店长参与制作与预约改派规则

This commit is contained in:
2026-07-26 00:05:47 +08:00
parent a35669026c
commit 602943efeb
8 changed files with 77 additions and 12 deletions
@@ -21,6 +21,7 @@
<div class="field"><label>员工编号</label><div class="field-value">{{ employee.userId || employee.id }}</div></div>
<div class="field"><label>身份/级别</label><div class="field-value">{{ employee.identity || employee.level || '美甲师' }}</div></div>
<div class="field"><label>状态</label><div class="field-value">{{ employee.status === 0 ? '休息中' : '可预约' }}</div></div>
<div class="field"><label>参与制作美甲</label><div class="field-value">{{ employee.participateProduction === 1 ? '是' : '否' }}</div></div>
<div class="field"><label>登录手机号</label><div class="field-value">{{ employee.phone || '未填写' }}</div></div>
<div class="field"><label>联系电话</label><div class="field-value">{{ employee.contactPhone || '未填写' }}</div></div>
<div class="field"><label>微信号</label><div class="field-value">{{ employee.wechatId || '未填写' }}</div></div>
@@ -123,6 +124,10 @@
<option :value="0">休息中</option>
</select>
</div>
<label class="field checkbox-field">
<span>参与制作美甲</span>
<input v-model="editForm.participateProduction" type="checkbox" />
</label>
<div class="reset-panel">
<div>
@@ -183,6 +188,7 @@ interface EditEmployeeForm {
wechatId: string
identity: string
status: number
participateProduction: boolean
}
const EDIT_EMPLOYEE_DRAFT_NAME_PREFIX = 'employee-edit'
@@ -218,7 +224,8 @@ const buildEmptyEditForm = (): EditEmployeeForm => ({
contactPhone: '',
wechatId: '',
identity: '',
status: 1
status: 1,
participateProduction: false
})
const editForm = reactive<EditEmployeeForm>(buildEmptyEditForm())
const originalEditForm = ref<EditEmployeeForm>(buildEmptyEditForm())
@@ -233,7 +240,8 @@ function buildEditFormFromEmployee(value: Artist): EditEmployeeForm {
contactPhone: value.contactPhone || '',
wechatId: value.wechatId || '',
identity: value.identity || value.level || '',
status: value.status === 0 ? 0 : 1
status: value.status === 0 ? 0 : 1,
participateProduction: value.participateProduction === 1
}
}
@@ -245,6 +253,7 @@ function sameEditForm(left: EditEmployeeForm, right: EditEmployeeForm): boolean
&& left.wechatId === right.wechatId
&& left.identity === right.identity
&& left.status === right.status
&& left.participateProduction === right.participateProduction
}
function snapshotEditForm(): EditEmployeeForm {
@@ -255,7 +264,8 @@ function snapshotEditForm(): EditEmployeeForm {
contactPhone: editForm.contactPhone,
wechatId: editForm.wechatId,
identity: editForm.identity,
status: editForm.status
status: editForm.status,
participateProduction: editForm.participateProduction
}
}
@@ -267,7 +277,8 @@ function normalizeEditForm(form: EditEmployeeForm): EditEmployeeForm {
contactPhone: String(form.contactPhone || ''),
wechatId: String(form.wechatId || ''),
identity: String(form.identity || ''),
status: Number(form.status) === 0 ? 0 : 1
status: Number(form.status) === 0 ? 0 : 1,
participateProduction: Boolean(form.participateProduction)
}
}
@@ -280,6 +291,7 @@ function applyEditForm(form: EditEmployeeForm): void {
editForm.wechatId = normalizedForm.wechatId
editForm.identity = normalizedForm.identity
editForm.status = normalizedForm.status
editForm.participateProduction = normalizedForm.participateProduction
}
function resetEditForm(): void {
@@ -414,7 +426,8 @@ const saveEdit = async (): Promise<void> => {
contactPhone: editForm.contactPhone.trim(),
wechatId: editForm.wechatId.trim(),
identity: editForm.identity.trim(),
status: editForm.status
status: editForm.status,
participateProduction: editForm.participateProduction ? 1 : 0
})
toast.success('员工信息已保存')
updateEditModalVisible(false)