合同变更
parent
d5190812ad
commit
1dd341393a
|
|
@ -112,6 +112,11 @@ export const getCustomer = async (id: number) => {
|
|||
return await request.get({ url: `/crm/customer/get?id=` + id })
|
||||
}
|
||||
|
||||
// 更新客户信息
|
||||
export const getChangeCustomer = async (id: number) => {
|
||||
return await request.get({ url: `/crm/customer/getRiskControl?id=` + id })
|
||||
}
|
||||
|
||||
// 查询客户详情带报价单
|
||||
export const getCustomerDetail = async (id: number) => {
|
||||
return await request.get({ url: `/crm/customer/get-contract-customer-detail?id=` + id })
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ const setSelections = async () => {
|
|||
id: item.customerContactId
|
||||
}
|
||||
})
|
||||
console.log('%csrc/components/product/index.vue:153 list.value', 'color: #007acc;', multipleSelection);
|
||||
|
||||
if (selections && selections.length > 0) {
|
||||
list.value.forEach((row: any) => {
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ if(contractFormRef.value) {
|
|||
} else if(formData.value.changeItem == 2) {
|
||||
let ids = []
|
||||
dataFormList.map(item => {
|
||||
ids.push(item.id)
|
||||
ids.push(item.customerContactId)
|
||||
})
|
||||
data.afterAuthorizerId = ids.join(',')
|
||||
} else if(formData.value.changeItem == 3) {
|
||||
|
|
@ -411,7 +411,7 @@ if(contractFormRef.value) {
|
|||
})
|
||||
data.afterAffiliateCompanyId = ids.join(',')
|
||||
} else if(formData.value.changeItem == 6) {
|
||||
data.newContract = data
|
||||
data.newContract = dataFormList
|
||||
}
|
||||
data.contractId = data.id
|
||||
delete data.id
|
||||
|
|
|
|||
|
|
@ -571,7 +571,7 @@
|
|||
<span style="color: #f56c6c">*</span> 合同甲方授权人信息
|
||||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<ContractAAuthorizedPersonForm :formFields="formFields" ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" :customerId="formData.customerId" />
|
||||
<ContractAAuthorizedPersonForm :formFields="formFields" ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" :data="formData.contractAAuthorizedPersons" :customerId="formData.customerId" />
|
||||
</ContentWrap>
|
||||
<!-- <ContentWrap style="border: none;font-weight:700">
|
||||
合同乙方授权人信息
|
||||
|
|
@ -769,8 +769,9 @@ const open = async (type: string) => {
|
|||
// data.registeredAddress = data.customerDO.registeredAddress
|
||||
// data.actualCapital = data.customerDO.actualCapital
|
||||
// data.socialEmployeeNum = data.customerDO.socialEmployeeNum
|
||||
handleQuotationChange(formData.value.quotationId)
|
||||
formData.value = data
|
||||
await handleQuotationChange(formData.value.quotationId)
|
||||
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
@ -784,6 +785,12 @@ const validate = () => {
|
|||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
if(contractAAuthorizedPersonFormRef.value.getData().length) {
|
||||
formData.value.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData()
|
||||
}
|
||||
if(contractAAuthorizedCompanyFormRef.value.getData().length) {
|
||||
formData.value.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||
}
|
||||
return formData.value
|
||||
}
|
||||
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
||||
|
|
@ -822,6 +829,7 @@ const submitForm = async () => {
|
|||
// 拼接子表的数据
|
||||
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||
data.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData()
|
||||
console.log('%csrc/views/crm/contract/ContractForm.vue:826 data.contractAAuthorizedPersons,444', 'color: #007acc;', data.contractAAuthorizedPersons,444);
|
||||
// data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData()
|
||||
if (!formType.value ) {
|
||||
await ContractApi.createContract(data)
|
||||
|
|
@ -892,7 +900,6 @@ const resetForm = () => {
|
|||
const handleQuotationChange = async (quotationId: number) => {
|
||||
if (!quotationId) return
|
||||
try {
|
||||
console.log('%csrc/views/crm/contract/ContractForm.vue:886 222', 'color: #007acc;', 222);
|
||||
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||
formData.value.products = quotation.products;
|
||||
// formData.value.customerId = quotation.customerId;
|
||||
|
|
@ -923,10 +930,12 @@ const handleQuotationChange = async (quotationId: number) => {
|
|||
formData.value.onlinePrice = quotation.onlinePrice;
|
||||
formData.value.totalPrice = quotation.totalPrice;
|
||||
|
||||
const customerRes = await ContractApi.quotationTimes(quotation.id);
|
||||
formData.value.quotationTimes = customerRes.quotationTimes;
|
||||
// await onCustomerChange(quotation.customerId);
|
||||
await onPartnerChange(quotation.partnerCompanyId);
|
||||
const customerRes = await ContractApi.quotationTimes(quotation.id);
|
||||
formData.value.quotationTimes = customerRes.quotationTimes;
|
||||
if(formType.value) {
|
||||
await onCustomerChange(quotation.customerId);
|
||||
}
|
||||
await onPartnerChange(quotation.partnerCompanyId);
|
||||
} catch (err) {
|
||||
} finally {
|
||||
|
||||
|
|
@ -939,16 +948,17 @@ const onCustomerChange = async (customerId: string) => {
|
|||
|
||||
try {
|
||||
formLoading.value = true;
|
||||
// let customerRes = {}
|
||||
// if(formType.value) {
|
||||
// customerRes = await CustomerApi.getCustomer(customerId);
|
||||
// }else {
|
||||
let customerRes = await CustomerApi.getCustomerDetail(customerId);
|
||||
formData.value.quotationId = customerRes.quotationId;
|
||||
formData.value.servicor = customerRes.servicor;
|
||||
formData.value.technicalLead = customerRes.technicalLead;
|
||||
formData.value.settlementLead = customerRes.settlementLead;
|
||||
// }
|
||||
let customerRes = {}
|
||||
if(formType.value) {
|
||||
customerRes = await CustomerApi.getCustomer(customerId);
|
||||
}else {
|
||||
customerRes = await CustomerApi.getCustomerDetail(customerId);
|
||||
formData.value.quotationId = customerRes.quotationId;
|
||||
formData.value.servicor = customerRes.servicor;
|
||||
formData.value.technicalLead = customerRes.technicalLead;
|
||||
formData.value.settlementLead = customerRes.settlementLead;
|
||||
handleQuotationChange(customerRes.quotationId);
|
||||
}
|
||||
formData.value.companyType = customerRes.companyType;
|
||||
formData.value.listingStatus = customerRes.listingStatus;
|
||||
formData.value.financingInfo = customerRes.financingInfo;
|
||||
|
|
@ -969,7 +979,6 @@ const onCustomerChange = async (customerId: string) => {
|
|||
formData.value.maintainer = customerRes.maintainer;
|
||||
formData.value.clueDeveloper = customerRes.clueDeveloper;
|
||||
|
||||
await handleQuotationChange(customerRes.quotationId);
|
||||
|
||||
} catch (err) {
|
||||
console.error('获取客户详情失败:', err);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,8 @@ const props = defineProps<{
|
|||
contractId: undefined, // 合同ID(主表的关联字段)
|
||||
type: undefined,
|
||||
customerId: undefined,
|
||||
formFields: {}
|
||||
formFields: {},
|
||||
data: []
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
@ -149,9 +150,8 @@ const formRules = reactive({
|
|||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||
watch(
|
||||
() => props.contractId,
|
||||
() => props.data,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = []
|
||||
|
|
@ -159,16 +159,32 @@ watch(
|
|||
if (!val) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
formLoading.value = true
|
||||
formData.value = await ContractApi.getContractAAuthorizedPersonListByContractId(val)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
formData.value = val
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||
// watch(
|
||||
// () => props.contractId,
|
||||
// async (val) => {
|
||||
// // 1. 重置表单
|
||||
// formData.value = []
|
||||
// // 2. val 非空,则加载数据
|
||||
// if (!val) {
|
||||
// return;
|
||||
// }
|
||||
// try {
|
||||
// formLoading.value = true
|
||||
// let data = await ContractApi.getContractAAuthorizedPersonListByContractId(val)
|
||||
// formData.value = data
|
||||
// } finally {
|
||||
// formLoading.value = false
|
||||
// }
|
||||
// },
|
||||
// { immediate: true }
|
||||
// )
|
||||
|
||||
/** 新增按钮操作 */
|
||||
// const handleAdd = () => {
|
||||
// const row = {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
<ContractStop ref="contractStopFormRef" :isTrue="false" :formFields="formFields" :formData="formData" v-if="formData.changeItem == 4" />
|
||||
</el-col>
|
||||
<ContractAAuthorizedCompanyForm :formFields="formFields" ref="contractAAuthorizedCompanyFormRef1" :type="true" v-if="formData.changeItem == 5" :data="formData.contractAAuthorizedCompanys" />
|
||||
<ContractForm ref="contractFormRef" :type="1" :id="formData.id" v-if="formData.changeItem == 6" />
|
||||
<ContractForm ref="contractFormRef" :type="1" :data="formData" :id="formData.contractId" v-if="formData.changeItem == 6" />
|
||||
</template>
|
||||
</processForm>
|
||||
|
||||
|
|
@ -302,6 +302,12 @@ const open = async (type: string) => {
|
|||
// formData.value = Object.assign(formData.value, data)
|
||||
let data = await ContractApi.getChangeContract(type)
|
||||
formData.value = data.contractDetail
|
||||
formData.value.contractAAuthorizedCompanys = data.contractAAuthorizedCompanys
|
||||
|
||||
//重签拿contractDetail字段
|
||||
if (data.changeItem == 6) formData.value = JSON.parse(data.newContract)
|
||||
|
||||
console.log('%csrc/views/crm/contract/detail/ContractChangeDetail.vue:309 object', 'color: red;', formData.value,12345);
|
||||
formData.value.contractId = data.contractDetail.id
|
||||
formData.value.changeItem = data.changeItem
|
||||
formData.value.changeAmount = data.changeAmount
|
||||
|
|
@ -312,9 +318,10 @@ const open = async (type: string) => {
|
|||
formData.value.extensionDate = data.extensionDate
|
||||
formData.value.note = data.note
|
||||
formData.value.id = data.id
|
||||
formData.value.contractAAuthorizedCompanys = data.contractAAuthorizedCompanys
|
||||
formData.value.creditAmount = data.creditAmount
|
||||
formData.value.creditLimit = data.beforeAmount
|
||||
console.log('%csrc/views/crm/contract/detail/ContractChangeDetail.vue:310 object', 'color: #007acc;', formData.value);
|
||||
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
@ -412,7 +419,6 @@ if(contractFormRef.value) {
|
|||
dataFormList.map(item => {
|
||||
ids.push(item.id)
|
||||
})
|
||||
console.log('%csrc/views/crm/contract/detail/ContractChangeDetail.vue:415 ids', 'color: #007acc;', ids);
|
||||
data.afterAuthorizerId = ids.join(',')
|
||||
} else if(formData.value.changeItem == 3) {
|
||||
data.agreementDeadline = dataFormList.agreementDeadline
|
||||
|
|
@ -430,10 +436,10 @@ if(contractFormRef.value) {
|
|||
})
|
||||
data.afterAffiliateCompanyId = ids.join(',')
|
||||
} else if(formData.value.changeItem == 6) {
|
||||
data.newContract = data
|
||||
data.newContract = dataFormList
|
||||
}
|
||||
dialogVisible.value = false
|
||||
return
|
||||
// return
|
||||
await ContractApi.changeContractUpdate(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
|
||||
|
|
|
|||
|
|
@ -669,7 +669,7 @@
|
|||
</ContentWrap>
|
||||
<el-col :span="24">
|
||||
<ContentWrap>
|
||||
<ContractAAuthorizedPersonForm :type="1" :formFields="formFields" ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||
<ContractAAuthorizedPersonForm :type="1" :formFields="formFields" ref="contractAAuthorizedPersonFormRef" :data="formData.contractAAuthorizedPersons" :contract-id="formData.id" />
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<!-- <ContentWrap style="border: none;font-weight:700">
|
||||
|
|
@ -711,6 +711,7 @@ const { proxy }: any = getCurrentInstance();
|
|||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined),
|
||||
type: propTypes.number.def(undefined),
|
||||
data : []
|
||||
})
|
||||
const templateOptions = ref([])
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
|
|
@ -784,6 +785,7 @@ const formFields = ref({
|
|||
productsserviceInvoiceItem: 1,
|
||||
productsother1: 1,
|
||||
contractAAuthorizedCompanysother: 1,
|
||||
contractAAuthorizedCompanyscustomerName: 1,
|
||||
contractAAuthorizedCompanysunifiedCreditCode: 1,
|
||||
contractAAuthorizedCompanysinvoicingAddress: 1,
|
||||
contractAAuthorizedCompanysinvoicingTelephone: 1,
|
||||
|
|
@ -911,6 +913,8 @@ const open = async (type: string) => {
|
|||
// data.bankAccount = data.customerDO.bankAccount
|
||||
// data.legalRepresentative = data.customerDO.legalRepresentative
|
||||
formData.value = data
|
||||
console.log('%csrc/views/crm/contract/detail/ContractDetail.vue:916 formData.value,999', 'color: #007acc;', formData.value,999);
|
||||
|
||||
handleQuotationChange(formData.value.quotationId)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
|
|
@ -920,7 +924,7 @@ const open = async (type: string) => {
|
|||
}
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
return formRef.value.innerFormRef.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
|
|
@ -1110,6 +1114,9 @@ const onPartnerChange = async (id: string) => {
|
|||
formData.value.businessLicenseNumber = res.businessLicenseNumber;
|
||||
formData.value.businessLicense = res.businessLicense;
|
||||
// formData.value.partnerCompanyId = res.partnerCompanyId;
|
||||
formData.value = props.data.quotationId ? Object.assign(formData.value, props.data) : formData.value
|
||||
console.log('%csrc/views/crm/contract/detail/ContractDetail.vue:1118 formData.value', 'color: #007acc;', formData.value);
|
||||
|
||||
} catch (err) {
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@
|
|||
>
|
||||
锁定
|
||||
</el-button> -->
|
||||
<el-button @click="handleChangeCustomer">
|
||||
更新用户信息
|
||||
</el-button>
|
||||
<el-button v-if="!customer.clueDeveloper" @click="handleReceive"> 领取</el-button>
|
||||
<el-button v-if="!customer.clueDeveloper" @click="handleDistributeForm">
|
||||
分配
|
||||
|
|
@ -205,6 +208,12 @@ const handlePutPool = async () => {
|
|||
close()
|
||||
}
|
||||
|
||||
/** 更新用户信息 */
|
||||
const handleChangeCustomer = async () => {
|
||||
await CustomerApi.getChangeCustomer(customerId.value)
|
||||
getCustomer()
|
||||
}
|
||||
|
||||
/** 获取操作日志 */
|
||||
const logList = ref<OperateLogVO[]>([]) // 操作日志列表
|
||||
const getOperateLog = async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue