From 331b6c5611001f622c70646883bd4fc8b62ff091 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 27 Jan 2024 23:18:52 +0800 Subject: [PATCH] =?UTF-8?q?CRM-=E5=90=88=E5=90=8C=EF=BC=9A=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=90=88=E5=90=8C=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/contract/index.ts | 3 +-- src/views/crm/contract/ContractForm.vue | 11 +++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 527eb5c7..1d944498 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -15,11 +15,10 @@ export interface ContractVO { price: number discountPercent: number productPrice: number - roUserIds: string - rwUserIds: string contactId: number signUserId: number contactLastTime: Date + status: number remark: string productItems: ProductExpandVO[] } diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index a9271ce5..28e49301 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -5,7 +5,7 @@ v-loading="formLoading" :model="formData" :rules="formRules" - label-width="100px" + label-width="110px" > @@ -152,7 +152,8 @@ @@ -164,6 +165,7 @@ import * as UserApi from '@/api/system/user' import * as ContactApi from '@/api/crm/contact' import * as BusinessApi from '@/api/crm/business' import ProductList from './components/ProductList.vue' +import { cloneDeep } from 'lodash-es' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -217,7 +219,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 -const submitForm = async () => { +const submitForm = async (status: number) => { // 校验表单 if (!formRef) return const valid = await formRef.value.validate() @@ -225,7 +227,8 @@ const submitForm = async () => { // 提交请求 formLoading.value = true try { - const data = formData.value as unknown as ContractApi.ContractVO + const data = cloneDeep(unref(formData.value)) as unknown as ContractApi.ContractVO + data.status = status if (formType.value === 'create') { await ContractApi.createContract(data) message.success(t('common.createSuccess'))