diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 1d944498..ffe4b578 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -57,3 +57,8 @@ export const deleteContract = async (id: number) => { export const exportContract = async (params) => { return await request.download({ url: `/crm/contract/export-excel`, params }) } + +// 提交审核 +export const handleApprove = async (id: number) => { + return await request.put({ url: `/crm/contract/approve?id=${id}` }) +} diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index 28e49301..7a272c1c 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -145,15 +145,12 @@ - - - + 查看工作流 @@ -165,7 +162,6 @@ 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() // 消息弹窗 @@ -176,7 +172,11 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加 const formType = ref('') // 表单的类型:create - 新增;update - 修改 const formData = ref({} as ContractApi.ContractVO) const formRules = reactive({ - name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }] + name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }], + customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }], + orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }], + ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }], + no: [{ required: true, message: '合同编号不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref watch( @@ -219,7 +219,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 -const submitForm = async (status: number) => { +const submitForm = async () => { // 校验表单 if (!formRef) return const valid = await formRef.value.validate() @@ -227,8 +227,7 @@ const submitForm = async (status: number) => { // 提交请求 formLoading.value = true try { - const data = cloneDeep(unref(formData.value)) as unknown as ContractApi.ContractVO - data.status = status + const data = unref(formData.value) as unknown as ContractApi.ContractVO if (formType.value === 'create') { await ContractApi.createContract(data) message.success(t('common.createSuccess')) diff --git a/src/views/crm/contract/index.vue b/src/views/crm/contract/index.vue index 26ff403a..49ea53a9 100644 --- a/src/views/crm/contract/index.vue +++ b/src/views/crm/contract/index.vue @@ -2,44 +2,52 @@ - 搜索 - 重置 - - 新增 + + + 搜索 + + + + 重置 + + + + 新增 - 导出 + + 导出 @@ -48,70 +56,78 @@ - - - - - - + + + + + + - - + + - - - - - + + + + + - + -