feat: 桌面端表单必填项标记 * + 提交校验

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-12 20:30:43 +08:00
parent ff0a38a369
commit 1e0f77d4e6
5 changed files with 12 additions and 4 deletions
+3 -1
View File
@@ -129,6 +129,7 @@ function openEdit(item: any) {
}
async function handleSave() {
if (!form.value.customer_id) { ElMessage.warning('请选择客户单位'); return }
try {
if (dialogMode.value === 'create') {
await api.post('/work-plans/', form.value)
@@ -263,7 +264,7 @@ async function quickStatusChange(row: any, newStatus: string) {
<!-- Dialog -->
<el-dialog v-model="dialogVisible" :title="(dialogMode === 'create' ? '新建' : '编辑') + ' 工作计划'" width="500px">
<el-form label-position="top">
<el-form-item label="客户单位">
<el-form-item label="客户单位 *">
<el-select v-model="form.customer_id" filterable remote :remote-method="handleCustomerSearch" placeholder="搜索选择客户" style="width:100%">
<el-option v-for="c in customers" :key="c.id" :label="c.name" :value="c.id" />
<template #empty>
@@ -327,4 +328,5 @@ async function quickStatusChange(row: any, newStatus: string) {
.quick-create-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1px dashed var(--gold); padding: 6px 12px; color: var(--gold-dark); font-family: var(--font-body); font-size: 12px; cursor: pointer; transition: all 0.2s; }
.quick-create-btn:hover { border-color: var(--vermilion); color: var(--vermilion); background: rgba(184,71,46,0.03); }
.select-empty-create { padding: 8px 12px; text-align: center; }
.required-star { color: var(--vermilion); font-weight: 700; }
</style>