mirror of
https://github.com/yudaocode/yudao-ui-admin-vue3.git
synced 2026-05-14 06:38:35 +00:00
CRM:完善回款集成客户详情和合同详情
This commit is contained in:
@@ -150,9 +150,8 @@ const formRef = ref() // 表单 Ref
|
||||
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
|
||||
const contractList = ref<ContractApi.ContractVO[]>([]) // 合同列表
|
||||
const receivablePlanList = ref<ReceivablePlanApi.ReceivablePlanVO[]>([]) // 回款计划列表
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
const open = async (type: string, id?: number, planData?: ReceivablePlanApi.ReceivablePlanVO) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
@@ -174,6 +173,12 @@ const open = async (type: string, id?: number) => {
|
||||
if (formType.value === 'create') {
|
||||
formData.value.ownerUserId = useUserStore().getUser.id
|
||||
}
|
||||
// 从回款计划创建回款
|
||||
if (planData) {
|
||||
formData.value.customerId = planData.customerId
|
||||
formData.value.contractId = planData.contractId
|
||||
formData.value.planId = planData.id
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
@@ -249,9 +254,12 @@ watch(
|
||||
return
|
||||
}
|
||||
const receivablePlan = receivablePlanList.value.find((item) => item.id === newVal)
|
||||
if (!receivablePlan) {
|
||||
return
|
||||
}
|
||||
// 只有没有金额的时候才设置
|
||||
if (!formData.value.price || formData.value.price === 0) {
|
||||
formData.value.price = receivablePlan!.price
|
||||
formData.value.price = receivablePlan.price
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user