Skip to content

Commit 331b6c5

Browse files
author
puhui999
committed
CRM-合同:完善合同表单
1 parent ed94205 commit 331b6c5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/api/crm/contract/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ export interface ContractVO {
1515
price: number
1616
discountPercent: number
1717
productPrice: number
18-
roUserIds: string
19-
rwUserIds: string
2018
contactId: number
2119
signUserId: number
2220
contactLastTime: Date
21+
status: number
2322
remark: string
2423
productItems: ProductExpandVO[]
2524
}

src/views/crm/contract/ContractForm.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
v-loading="formLoading"
66
:model="formData"
77
:rules="formRules"
8-
label-width="100px"
8+
label-width="110px"
99
>
1010
<el-row>
1111
<el-col :span="24" class="mb-10px">
@@ -152,7 +152,8 @@
152152
</el-row>
153153
</el-form>
154154
<template #footer>
155-
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
155+
<el-button :disabled="formLoading" type="primary" @click="submitForm(1)">提交审核</el-button>
156+
<el-button :disabled="formLoading" type="primary" @click="submitForm(2)">保存草稿</el-button>
156157
<el-button @click="dialogVisible = false">取 消</el-button>
157158
</template>
158159
</Dialog>
@@ -164,6 +165,7 @@ import * as UserApi from '@/api/system/user'
164165
import * as ContactApi from '@/api/crm/contact'
165166
import * as BusinessApi from '@/api/crm/business'
166167
import ProductList from './components/ProductList.vue'
168+
import { cloneDeep } from 'lodash-es'
167169
168170
const { t } = useI18n() // 国际化
169171
const message = useMessage() // 消息弹窗
@@ -217,15 +219,16 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
217219
218220
/** 提交表单 */
219221
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
220-
const submitForm = async () => {
222+
const submitForm = async (status: number) => {
221223
// 校验表单
222224
if (!formRef) return
223225
const valid = await formRef.value.validate()
224226
if (!valid) return
225227
// 提交请求
226228
formLoading.value = true
227229
try {
228-
const data = formData.value as unknown as ContractApi.ContractVO
230+
const data = cloneDeep(unref(formData.value)) as unknown as ContractApi.ContractVO
231+
data.status = status
229232
if (formType.value === 'create') {
230233
await ContractApi.createContract(data)
231234
message.success(t('common.createSuccess'))

0 commit comments

Comments
 (0)