fix: 商机改为已流失时前端自动清空列收时间再提交
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -144,6 +144,7 @@ function openEdit(item: any) {
|
||||
async function handleSave() {
|
||||
if (!form.value.customer_id) { ElMessage.warning('请选择客户单位'); return }
|
||||
try {
|
||||
if (form.value.status === '已流失') form.value.expected_revenue_date = ''
|
||||
if (dialogMode.value === 'create') {
|
||||
await api.post('/mini-business/', form.value)
|
||||
} else {
|
||||
@@ -205,7 +206,9 @@ async function handleDeleteLog(logId: string) {
|
||||
async function quickStatusChange(row: any, newStatus: string) {
|
||||
try {
|
||||
await ElMessageBox.confirm(`确定将状态改为「${newStatus}」?`, '确认', { type: 'warning', confirmButtonText: '确定', cancelButtonText: '取消' })
|
||||
await api.put(`/mini-business/${row.id}`, { status: newStatus })
|
||||
const payload: any = { status: newStatus }
|
||||
if (newStatus === '已流失') payload.expected_revenue_date = ''
|
||||
await api.put(`/mini-business/${row.id}`, payload)
|
||||
ElMessage.success('状态已更新')
|
||||
await loadItems()
|
||||
} catch (e: any) {
|
||||
|
||||
@@ -78,6 +78,7 @@ async function handleQuickCreate() {
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!form.value.customer_id) { ElMessage.warning('请选择客户'); return }
|
||||
if (form.value.status === '已流失') form.value.expected_revenue_date = ''
|
||||
submitLoading.value = true
|
||||
try {
|
||||
if (isEdit.value) {
|
||||
|
||||
Reference in New Issue
Block a user