CRM-合同:完善合同表单

This commit is contained in:
puhui999 2024-01-27 23:18:52 +08:00
parent ed94205fa7
commit 331b6c5611
2 changed files with 8 additions and 6 deletions

View File

@ -15,11 +15,10 @@ export interface ContractVO {
price: number price: number
discountPercent: number discountPercent: number
productPrice: number productPrice: number
roUserIds: string
rwUserIds: string
contactId: number contactId: number
signUserId: number signUserId: number
contactLastTime: Date contactLastTime: Date
status: number
remark: string remark: string
productItems: ProductExpandVO[] productItems: ProductExpandVO[]
} }

View File

@ -5,7 +5,7 @@
v-loading="formLoading" v-loading="formLoading"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="100px" label-width="110px"
> >
<el-row> <el-row>
<el-col :span="24" class="mb-10px"> <el-col :span="24" class="mb-10px">
@ -152,7 +152,8 @@
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button> <el-button :disabled="formLoading" type="primary" @click="submitForm(1)">提交审核</el-button>
<el-button :disabled="formLoading" type="primary" @click="submitForm(2)">保存草稿</el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</template> </template>
</Dialog> </Dialog>
@ -164,6 +165,7 @@ import * as UserApi from '@/api/system/user'
import * as ContactApi from '@/api/crm/contact' import * as ContactApi from '@/api/crm/contact'
import * as BusinessApi from '@/api/crm/business' import * as BusinessApi from '@/api/crm/business'
import ProductList from './components/ProductList.vue' import ProductList from './components/ProductList.vue'
import { cloneDeep } from 'lodash-es'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -217,7 +219,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async (status: number) => {
// //
if (!formRef) return if (!formRef) return
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
@ -225,7 +227,8 @@ const submitForm = async () => {
// //
formLoading.value = true formLoading.value = true
try { 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') { if (formType.value === 'create') {
await ContractApi.createContract(data) await ContractApi.createContract(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))