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
@@ -140,6 +140,7 @@ function openEdit(item: any) {
}
async function handleSave() {
if (!form.value.customer_id) { ElMessage.warning('请选择客户单位'); return }
try {
if (dialogMode.value === 'create') {
await api.post('/mini-business/', form.value)
@@ -314,7 +315,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>
@@ -458,4 +459,5 @@ async function quickStatusChange(row: any, newStatus: string) {
.log-chip { padding: 4px 10px; border: 1px solid var(--warm-border); background: var(--surface); font-size: 12px; cursor: pointer; transition: all 0.2s; }
.log-chip:hover { border-color: var(--ink); }
.log-chip--active { font-weight: 600; }
.required-star { color: var(--vermilion); font-weight: 700; }
</style>