Merge branch 'master' into wkz
# Conflicts: # src/views/crm/quotation/components/QuotationProductForm.vuepull/781/head
commit
33cf806121
|
|
@ -15,7 +15,7 @@ export const DEFAULT_STATUSES = [
|
||||||
{
|
{
|
||||||
endStatus: 1,
|
endStatus: 1,
|
||||||
key: '结束',
|
key: '结束',
|
||||||
name: '赢单',
|
name: '成交',
|
||||||
percent: 100
|
percent: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,11 @@ export const getContract = async (id: number) => {
|
||||||
return await request.get({ url: `/crm/contract/get?id=` + id })
|
return await request.get({ url: `/crm/contract/get?id=` + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询 CRM 合同详情
|
||||||
|
export const getChangeContract = async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/contract/getChangeContract?contractChangeId=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
// 查询 CRM 合同下拉列表
|
// 查询 CRM 合同下拉列表
|
||||||
export const getContractSimpleList = async (customerId: number) => {
|
export const getContractSimpleList = async (customerId: number) => {
|
||||||
return await request.get({
|
return await request.get({
|
||||||
|
|
@ -115,6 +120,11 @@ export const transferContract = async (data: TransferReqVO) => {
|
||||||
return await request.put({ url: '/crm/contract/transfer', data })
|
return await request.put({ url: '/crm/contract/transfer', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 合同变更
|
||||||
|
export const changeContract = async (data: TransferReqVO) => {
|
||||||
|
return await request.put({ url: '/crm/contract/changeContract', data })
|
||||||
|
}
|
||||||
|
|
||||||
// 获得待审核合同数量
|
// 获得待审核合同数量
|
||||||
export const getAuditContractCount = async () => {
|
export const getAuditContractCount = async () => {
|
||||||
return await request.get({ url: '/crm/contract/audit-count' })
|
return await request.get({ url: '/crm/contract/audit-count' })
|
||||||
|
|
@ -130,6 +140,11 @@ export const getOrg = async (params) => {
|
||||||
return await request.get({ url: '/system/organizations/page', params })
|
return await request.get({ url: '/system/organizations/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 合作主主体详情
|
||||||
|
export const getOrgInfo = async (params) => {
|
||||||
|
return await request.get({ url: '/system/organizations/get?id=' + params })
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== 子表(CRM 合同产品关联) ====================
|
// ==================== 子表(CRM 合同产品关联) ====================
|
||||||
|
|
||||||
// 获得CRM 合同产品关联列表
|
// 获得CRM 合同产品关联列表
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,11 @@ export const getCustomerSimpleList = async () => {
|
||||||
return await request.get({ url: `/crm/customer/simple-list` })
|
return await request.get({ url: `/crm/customer/simple-list` })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 模糊查询公司
|
||||||
|
export const getCompanyList = async (params) => {
|
||||||
|
return await request.get({ url: `/crm/customer/fuzzyQueryCompany`, params })
|
||||||
|
}
|
||||||
|
|
||||||
// ======================= 业务操作 =======================
|
// ======================= 业务操作 =======================
|
||||||
|
|
||||||
// 客户转移
|
// 客户转移
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import request from '@/config/axios'
|
||||||
export interface CrmStatisticFunnelRespVO {
|
export interface CrmStatisticFunnelRespVO {
|
||||||
customerCount: number // 客户数
|
customerCount: number // 客户数
|
||||||
businessCount: number // 商机数
|
businessCount: number // 商机数
|
||||||
businessWinCount: number // 赢单数
|
businessWinCount: number // 成交数
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CrmStatisticsBusinessSummaryByDateRespVO {
|
export interface CrmStatisticsBusinessSummaryByDateRespVO {
|
||||||
|
|
@ -15,7 +15,7 @@ export interface CrmStatisticsBusinessSummaryByDateRespVO {
|
||||||
export interface CrmStatisticsBusinessInversionRateSummaryByDateRespVO {
|
export interface CrmStatisticsBusinessInversionRateSummaryByDateRespVO {
|
||||||
time: string // 时间
|
time: string // 时间
|
||||||
businessCount: number // 商机数量
|
businessCount: number // 商机数量
|
||||||
businessWinCount: number // 赢单商机数
|
businessWinCount: number // 成交商机数
|
||||||
}
|
}
|
||||||
|
|
||||||
// 客户分析 API
|
// 客户分析 API
|
||||||
|
|
|
||||||
|
|
@ -636,7 +636,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||||
component: () => import('@/views/crm/contract/ContractForm.vue')
|
component: () => import('@/views/crm/contract/ContractForm.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'contract/change',
|
path: 'contract/ContractChange',
|
||||||
name: 'CrmContractChange',
|
name: 'CrmContractChange',
|
||||||
meta: {
|
meta: {
|
||||||
title: '合同变更',
|
title: '合同变更',
|
||||||
|
|
@ -646,6 +646,18 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||||
},
|
},
|
||||||
component: () => import('@/views/crm/contract/ContractChange.vue')
|
component: () => import('@/views/crm/contract/ContractChange.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'contract/detail/ContractChangeDetail',
|
||||||
|
name: 'CrmContractChangeDetail',
|
||||||
|
meta: {
|
||||||
|
title: '合同变更详情',
|
||||||
|
noCache: true,
|
||||||
|
canTo: true,
|
||||||
|
hidden: true,
|
||||||
|
activeMenu: '/crm/contract'
|
||||||
|
},
|
||||||
|
component: () => import('@/views/crm/contract/detail/ContractChangeDetail.vue')
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'contract/detail/index',
|
path: 'contract/detail/index',
|
||||||
name: 'CrmContractDetail',
|
name: 'CrmContractDetail',
|
||||||
|
|
|
||||||
|
|
@ -116,8 +116,8 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider>
|
<!-- <el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider> -->
|
||||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
<!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div class="w-[100%] flex justify-between">
|
<div class="w-[100%] flex justify-between">
|
||||||
<Icon
|
<Icon
|
||||||
|
|
@ -131,7 +131,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -113,13 +113,13 @@ const getCount = () => {
|
||||||
(count) => (customerPutPoolRemindCount.value = count)
|
(count) => (customerPutPoolRemindCount.value = count)
|
||||||
)
|
)
|
||||||
CustomerApi.getFollowCustomerCount().then((count) => (customerFollowCount.value = count))
|
CustomerApi.getFollowCustomerCount().then((count) => (customerFollowCount.value = count))
|
||||||
ClueApi.getFollowClueCount().then((count) => (clueFollowCount.value = count))
|
// ClueApi.getFollowClueCount().then((count) => (clueFollowCount.value = count))
|
||||||
ContractApi.getAuditContractCount().then((count) => (contractAuditCount.value = count))
|
ContractApi.getAuditContractCount().then((count) => (contractAuditCount.value = count))
|
||||||
ContractApi.getRemindContractCount().then((count) => (contractRemindCount.value = count))
|
// ContractApi.getRemindContractCount().then((count) => (contractRemindCount.value = count))
|
||||||
ReceivableApi.getAuditReceivableCount().then((count) => (receivableAuditCount.value = count))
|
// ReceivableApi.getAuditReceivableCount().then((count) => (receivableAuditCount.value = count))
|
||||||
ReceivablePlanApi.getReceivablePlanRemindCount().then(
|
// ReceivablePlanApi.getReceivablePlanRemindCount().then(
|
||||||
(count) => (receivablePlanRemindCount.value = count)
|
// (count) => (receivablePlanRemindCount.value = count)
|
||||||
)
|
// )
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 激活时 */
|
/** 激活时 */
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,19 @@ const open = async (id?: number, customerId?: number) => {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await BillTemplateApi.getBillTemplate(id)
|
formData.value = await BillTemplateApi.getBillTemplate(id)
|
||||||
formData.value.products = formData.value.productItems
|
formData.value.products = formData.value.productItems.map(v => {
|
||||||
|
return {
|
||||||
|
category: v.category,
|
||||||
|
detailType: v.detailType,
|
||||||
|
productName: v.name,
|
||||||
|
productId: v.productId,
|
||||||
|
productInvoice: v.productInvoice,
|
||||||
|
productInvoiceItems: v.productInvoiceItems,
|
||||||
|
serviceFeeInvoice: v.serviceFeeInvoice,
|
||||||
|
serviceFeeInvoiceItems: v.serviceFeeInvoiceItems,
|
||||||
|
productUnit: v.unit
|
||||||
|
}
|
||||||
|
})
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row justify="center" class="mt-3" v-if="!disabled">
|
<el-row justify="center" class="mt-3" v-if="!disabled">
|
||||||
<el-button @click="handleAdd" round>+ 添加产品</el-button>
|
<el-button @click="handleAdd" type="primary" round>+ 添加产品</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
|
@ -130,7 +130,6 @@ watch(
|
||||||
|
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const getList = (val: []) => {
|
const getList = (val: []) => {
|
||||||
console.log('%csrc/views/crm/billtemplate/components/index.vue:133 object', 'color: #007acc;', formData.value);
|
|
||||||
for(let i = formData.value.length - 1; i >= 0; i--) {
|
for(let i = formData.value.length - 1; i >= 0; i--) {
|
||||||
let obj = formData.value[i]
|
let obj = formData.value[i]
|
||||||
if(!val.some(v => v.id === obj.productId)) formData.value.splice(i, 1)
|
if(!val.some(v => v.id === obj.productId)) formData.value.splice(i, 1)
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建人" align="center" prop="creator" />
|
<el-table-column label="创建人" align="center" prop="creatorName" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="创建时间"
|
label="创建时间"
|
||||||
align="center"
|
align="center"
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,14 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="商机名称" prop="name">
|
<el-form-item label="商机名称" prop="name">
|
||||||
<el-input v-model="formData.name" placeholder="请输入商机名称" />
|
<el-input v-model="formData.name" clearable placeholder="请输入商机名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="负责人" prop="ownerUserId">
|
<el-form-item label="负责人" prop="ownerUserId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.ownerUserId"
|
v-model="formData.ownerUserId"
|
||||||
:disabled="formType"
|
disabled
|
||||||
placeholder="请选择负责人"
|
placeholder="请选择负责人"
|
||||||
class="w-1/1"
|
class="w-1/1"
|
||||||
>
|
>
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
<el-form-item label="需求提交人" prop="requestorUserId">
|
<el-form-item label="需求提交人" prop="requestorUserId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.requestorUserId"
|
v-model="formData.requestorUserId"
|
||||||
|
clearable
|
||||||
:disabled="formType"
|
:disabled="formType"
|
||||||
placeholder="请选择需求提交人"
|
placeholder="请选择需求提交人"
|
||||||
class="w-1/1"
|
class="w-1/1"
|
||||||
|
|
@ -52,6 +53,7 @@
|
||||||
<el-select
|
<el-select
|
||||||
:disabled="formData.customerDefault"
|
:disabled="formData.customerDefault"
|
||||||
v-model="formData.customerId"
|
v-model="formData.customerId"
|
||||||
|
clearable
|
||||||
placeholder="请选择客户"
|
placeholder="请选择客户"
|
||||||
class="w-1/1"
|
class="w-1/1"
|
||||||
>
|
>
|
||||||
|
|
@ -72,6 +74,7 @@
|
||||||
:data="deptTree"
|
:data="deptTree"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
filterable
|
filterable
|
||||||
|
clearable
|
||||||
check-strictly
|
check-strictly
|
||||||
node-key="id"
|
node-key="id"
|
||||||
placeholder="请选择归属部门"
|
placeholder="请选择归属部门"
|
||||||
|
|
@ -109,7 +112,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="销售阶段" prop="saleStage">
|
<el-form-item label="销售阶段" prop="saleStage">
|
||||||
<el-select v-model="formData.saleStage" placeholder="请选择销售阶段">
|
<el-select v-model="formData.saleStage" clearable placeholder="请选择销售阶段">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions('sale_stage')"
|
v-for="dict in getIntDictOptions('sale_stage')"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
@ -119,11 +122,12 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="账期" prop="paymentTerm">
|
<el-form-item label="授信方式" prop="creditMethod">
|
||||||
<el-select v-model="formData.paymentTerm" @change="changePayment" placeholder="请选择账期">
|
<el-select v-model="formData.creditMethod" clearable placeholder="请选择授信方式">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.PAYMENT_TERM)"
|
v-for="dict in getIntDictOptions('credit_method')"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
|
|
@ -132,10 +136,10 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="授信方式" prop="creditMethod">
|
<el-form-item label="账期" prop="paymentTerm">
|
||||||
<el-select v-model="formData.creditMethod" placeholder="请选择授信方式">
|
<el-select v-model="formData.paymentTerm" @change="changePayment" clearable placeholder="请选择账期">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions('credit_method')"
|
v-for="dict in getStrDictOptions(DICT_TYPE.PAYMENT_TERM)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
|
|
@ -174,9 +178,9 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input type="textarea" v-model="formData.remark" placeholder="请输入备注" />
|
<el-input type="textarea" v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -275,14 +279,19 @@ const formData = ref({
|
||||||
creditMethod: undefined,
|
creditMethod: undefined,
|
||||||
creditCalcCycle: undefined,
|
creditCalcCycle: undefined,
|
||||||
creditLimit: undefined,
|
creditLimit: undefined,
|
||||||
techSupport: undefined,
|
techSupport: false,
|
||||||
products: []
|
products: []
|
||||||
});
|
});
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
name: [{ required: true, message: '商机名称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '商机名称不能为空', trigger: 'blur' }],
|
||||||
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||||
ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
||||||
statusTypeId: [{ required: true, message: '商机状态组不能为空', trigger: 'blur' }]
|
statusTypeId: [{ required: true, message: '商机状态组不能为空', trigger: 'blur' }],
|
||||||
|
saleStage: [{ required: true, message: '销售阶段不能为空', trigger: 'change' }],
|
||||||
|
paymentTerm: [{ required: true, message: '账期不能为空', trigger: 'change' }],
|
||||||
|
creditMethod: [{ required: true, message: '授信方式不能为空', trigger: 'change' }],
|
||||||
|
techSupport: [{ required: true, message: '技术需求支持不能为空', trigger: 'change' }],
|
||||||
|
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const userOptions = ref<UserApi.UserVO[]>([]);
|
const userOptions = ref<UserApi.UserVO[]>([]);
|
||||||
|
|
@ -323,8 +332,7 @@ watch(
|
||||||
watch(
|
watch(
|
||||||
() => formData.value.totalPrice,
|
() => formData.value.totalPrice,
|
||||||
(newProducts) => {
|
(newProducts) => {
|
||||||
console.log('%csrc/views/crm/business/BusinessForm.vue:326 111', 'color: #007acc;', 111);
|
formData.value.creditLimit = parseInt(newProducts / 365 * formData.value.creditCalcCycle) || ''
|
||||||
formData.value.creditLimit = parseInt(newProducts / 365 * formData.value.creditCalcCycle)
|
|
||||||
|
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
|
|
@ -349,9 +357,6 @@ const open = async (id?: number, customerId?: number) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!formType.value) {
|
|
||||||
formData.value.ownerUserId = useUserStore().getUser.id;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const setList = (newProducts) => {
|
const setList = (newProducts) => {
|
||||||
|
|
@ -370,8 +375,9 @@ const daysInMonth = new Date(currentDate.getFullYear(), currentMonth, 0).getDate
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
|
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
if (!productFormRef.value) return;
|
const productFormRef1 = await productFormRef.value.validate();
|
||||||
const valid = await productFormRef.value.validate();
|
if (!productFormRef1) return;
|
||||||
|
const valid = await formRef.value.validate();
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
|
||||||
formLoading.value = true;
|
formLoading.value = true;
|
||||||
|
|
@ -407,6 +413,7 @@ const resetForm = () => {
|
||||||
totalPrice: 0,
|
totalPrice: 0,
|
||||||
products: [],
|
products: [],
|
||||||
contactId: undefined,
|
contactId: undefined,
|
||||||
|
techSupport: 1,
|
||||||
customerDefault: false
|
customerDefault: false
|
||||||
};
|
};
|
||||||
formRef.value?.resetFields();
|
formRef.value?.resetFields();
|
||||||
|
|
@ -414,8 +421,9 @@ const resetForm = () => {
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
console.log('%csrc/views/crm/business/BusinessForm.vue:406 getStrDictOptions(DICT_TYPE.PAYMENT_TERM)', 'color: #007acc;', getStrDictOptions(DICT_TYPE.PAYMENT_TERM));
|
|
||||||
const customerId = route.query.customerId;
|
const customerId = route.query.customerId;
|
||||||
|
console.log('%csrc/views/crm/business/BusinessForm.vue:425 formData.value', 'color: #007acc;', formData.value);
|
||||||
|
formData.value.ownerUserId = customerId ? '' : useUserStore().getUser.id;
|
||||||
formType.value = route.query.id;
|
formType.value = route.query.id;
|
||||||
if (formType.value) open(formType.value, customerId)
|
if (formType.value) open(formType.value, customerId)
|
||||||
customerList.value = await CustomerApi.getCustomerSimpleList();
|
customerList.value = await CustomerApi.getCustomerSimpleList();
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in statusList"
|
v-for="item in statusList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name + '(赢单率:' + item.percent + '%)'"
|
:label="item.name + '(成交率:' + item.percent + '%)'"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in BusinessStatusApi.DEFAULT_STATUSES"
|
v-for="item in BusinessStatusApi.DEFAULT_STATUSES"
|
||||||
:key="item.endStatus"
|
:key="item.endStatus"
|
||||||
:label="item.name + '(赢单率:' + item.percent + '%)'"
|
:label="item.name + '(成交率:' + item.percent + '%)'"
|
||||||
:value="-item.endStatus"
|
:value="-item.endStatus"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row justify="center" class="mt-3" v-if="!disabled">
|
<el-row justify="center" class="mt-3" v-if="!disabled">
|
||||||
<el-button @click="handleAdd" round>+ 添加产品</el-button>
|
<el-button @click="handleAdd" type="primary" round>+ 添加产品</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
<ProductForm ref="productRef" @success="getList" />
|
<ProductForm ref="productRef" @success="getList" />
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,12 @@
|
||||||
<el-text v-else>{{ row.name }}</el-text>
|
<el-text v-else>{{ row.name }}</el-text>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="140" align="center" label="赢单率(%)" prop="percent">
|
<el-table-column width="140" align="center" label="成交率(%)" prop="percent">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-if="!row.endStatus"
|
v-if="!row.endStatus"
|
||||||
v-model="row.percent"
|
v-model="row.percent"
|
||||||
placeholder="请输入赢单率"
|
placeholder="请输入成交率"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:min="0"
|
:min="0"
|
||||||
:max="100"
|
:max="100"
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,6 @@
|
||||||
<el-input v-model="formData.wechat" placeholder="请输入微信" />
|
<el-input v-model="formData.wechat" placeholder="请输入微信" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="QQ" prop="qq">
|
|
||||||
<el-input v-model="formData.qq" placeholder="请输入 QQ" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="职位" prop="post">
|
<el-form-item label="职位" prop="post">
|
||||||
<el-input v-model="formData.post" placeholder="请输入职位" />
|
<el-input v-model="formData.post" placeholder="请输入职位" />
|
||||||
|
|
@ -99,8 +92,6 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="性别" prop="sex">
|
<el-form-item label="性别" prop="sex">
|
||||||
<el-select v-model="formData.sex" placeholder="请选择" class="w-1/1">
|
<el-select v-model="formData.sex" placeholder="请选择" class="w-1/1">
|
||||||
|
|
@ -113,7 +104,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
<el-form-item label="直属上级" prop="parentId">
|
<el-form-item label="直属上级" prop="parentId">
|
||||||
<el-select v-model="formData.parentId" filterable placeholder="请选择直属上级" class="w-1/1">
|
<el-select v-model="formData.parentId" filterable placeholder="请选择直属上级" class="w-1/1">
|
||||||
<el-option
|
<el-option
|
||||||
|
|
@ -125,7 +116,7 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="合同状态" prop="quotationId">
|
<el-form-item label="合同状态" prop="quotationId">
|
||||||
<el-select v-model="formData.auditStatus" clearable placeholder="请选择合同状态">
|
<el-select v-model="formData.auditStatus" disabled clearable placeholder="请选择合同状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
@ -62,6 +62,7 @@
|
||||||
<el-form-item label="协议截止日期" prop="endTime">
|
<el-form-item label="协议截止日期" prop="endTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.endTime"
|
v-model="formData.endTime"
|
||||||
|
disabled
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
placeholder="请选择协议截止日期"
|
placeholder="请选择协议截止日期"
|
||||||
|
|
@ -69,46 +70,45 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="变更项目" prop="endTime">
|
||||||
|
<el-radio-group v-model="formData.radio">
|
||||||
|
<el-radio :value="1">额度</el-radio>
|
||||||
|
<el-radio :value="2">授权人</el-radio>
|
||||||
|
<el-radio :value="3">延期</el-radio>
|
||||||
|
<el-radio :value="4">终止</el-radio>
|
||||||
|
<el-radio :value="5">甲方关联单位</el-radio>
|
||||||
|
<el-radio :value="6">重签</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
变更项目
|
|
||||||
|
|
||||||
<!-- 子表的表单 -->
|
<!-- 子表的表单 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-tabs v-model="subTabsName" class="-mt-15px -mb-10px">
|
|
||||||
<el-tab-pane label="额度" name="limit">
|
|
||||||
<ContractChangeLimit
|
<ContractChangeLimit
|
||||||
|
v-if="formData.radio == 1"
|
||||||
ref="limitFormRef"
|
ref="limitFormRef"
|
||||||
:formData="formData"
|
:formData="formData"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
<div v-if="formData.radio == 2">
|
||||||
<el-tab-pane label="授权人" name="product">
|
<ContentWrap style="border: none">
|
||||||
<ContentWrap style="border: none">
|
甲方现授权人信息
|
||||||
甲方现授权人信息
|
</ContentWrap>
|
||||||
</ContentWrap>
|
<ContractAuthPersonInfo
|
||||||
<ContractAuthPersonInfo
|
ref="personDataRef"
|
||||||
ref="personDataRef"
|
:products="formData.contractAAuthorizedPersons"
|
||||||
:products="formData.contractAAuthorizedPersons"
|
/>
|
||||||
/>
|
<ContentWrap style="border: none">
|
||||||
<ContentWrap style="border: none">
|
甲方授权人
|
||||||
甲方授权人
|
</ContentWrap>
|
||||||
</ContentWrap>
|
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef" :contract-id="formData.id" />
|
||||||
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef" :contract-id="formData.id" />
|
</div>
|
||||||
</el-tab-pane>
|
<ContracExtension ref="contractExtensionFormRef" v-if="formData.radio == 3" :formData="formData" />
|
||||||
<el-tab-pane label="延期" name="ContracExtension">
|
<ContractStop ref="contractStopFormRef" :formData="formData" v-if="formData.radio == 4" />
|
||||||
<ContracExtension ref="contractExtensionFormRef" :formData="formData" />
|
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef1" v-if="formData.radio == 5" :contract-id="formData.id" />
|
||||||
</el-tab-pane>
|
<ContractForm ref="contractFormRef" :type="1" :formData="formData" v-if="formData.radio == 6" />
|
||||||
<el-tab-pane label="终止" name="ContractStop">
|
|
||||||
<ContractStop ref="contractStopFormRef" :formData="formData" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="甲方关联单位" name="contractAAuthorizedCompany">
|
|
||||||
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef1" :contract-id="formData.id" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="重签" name="ContractForm">
|
|
||||||
<ContractForm ref="contractFormRef" :type="1" :formData="formData" />
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
|
|
@ -124,7 +124,7 @@ import * as ContractApi from '@/api/crm/contract'
|
||||||
import * as ContactApi from '@/api/crm/contact'
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
||||||
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
import { erpPriceMultiply, erpPriceInputFormatter, jsonParse } from '@/utils'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import ContractChangeLimit from '@/views/crm/contract/components/ContractChangeLimit.vue'
|
import ContractChangeLimit from '@/views/crm/contract/components/ContractChangeLimit.vue'
|
||||||
import ContractAuthPersonInfo from '@/views/crm/contract/components/ContractAuthPersonInfo.vue'
|
import ContractAuthPersonInfo from '@/views/crm/contract/components/ContractAuthPersonInfo.vue'
|
||||||
|
|
@ -179,6 +179,7 @@ const formData = ref({
|
||||||
partnerCompanyId: undefined,
|
partnerCompanyId: undefined,
|
||||||
deptId: undefined,
|
deptId: undefined,
|
||||||
quotationTimes: undefined,
|
quotationTimes: undefined,
|
||||||
|
radio: 1,
|
||||||
products: []
|
products: []
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
|
|
@ -221,7 +222,8 @@ const open = async (type: string) => {
|
||||||
if (type) {
|
if (type) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await ContractApi.getContract(type)
|
let data = await ContractApi.getContract(type)
|
||||||
|
formData.value = Object.assign(formData.value, data)
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
@ -244,11 +246,18 @@ const submitForm = async () => {
|
||||||
// const Authalid1 = await contractAAuthorizedCompanyFormRef1.value.validate()
|
// const Authalid1 = await contractAAuthorizedCompanyFormRef1.value.validate()
|
||||||
// if (!Authalid1) return
|
// if (!Authalid1) return
|
||||||
|
|
||||||
// const limitValid = await limitFormRef.value.validate()
|
if(limitFormRef.value) {
|
||||||
// if (!limitValid) return
|
const limitValid = await limitFormRef.value.validate()
|
||||||
|
if (!limitValid) return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(contractExtensionFormRef.value) {
|
||||||
const extensionValid = await contractExtensionFormRef.value.validate()
|
const extensionValid = await contractExtensionFormRef.value.validate()
|
||||||
if (!extensionValid) return
|
if (!extensionValid) return
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// const stopValid = await contractStopFormRef.value.validate()
|
// const stopValid = await contractStopFormRef.value.validate()
|
||||||
// if (!stopValid) return
|
// if (!stopValid) return
|
||||||
|
|
||||||
|
|
@ -262,20 +271,18 @@ const submitForm = async () => {
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = unref(formData.value) as unknown as ContractApi.ContractVO
|
const data = unref(JSON.parse(JSON.stringify(formData.value))) as unknown as ContractApi.ContractVO
|
||||||
// 拼接子表的数据
|
// 拼接子表的数据
|
||||||
data.contractAAuthorizedCompanys = limitFormRef.value.getData()
|
data.contractAAuthorizedCompanys = limitFormRef.value.getData()
|
||||||
data.contractAAuthorizedCompanys = contractExtensionFormRef.value.getData()
|
data.contractAAuthorizedCompanys = contractExtensionFormRef.value.getData()
|
||||||
data.contractAAuthorizedCompanys = contractStopFormRef.value.getData()
|
data.contractAAuthorizedCompanys = contractStopFormRef.value.getData()
|
||||||
data.contractAAuthorizedCompanys = contractFormRef.value.getData()
|
data.contractAAuthorizedCompanys = contractFormRef.value.getData()
|
||||||
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||||
if (!formType.value ) {
|
data.contractId = data.id
|
||||||
await ContractApi.createContract(data)
|
delete data.id
|
||||||
message.success(t('common.createSuccess'))
|
await ContractApi.changeContract(data)
|
||||||
} else {
|
message.success(t('common.createSuccess'))
|
||||||
await ContractApi.updateContract(data)
|
|
||||||
message.success(t('common.updateSuccess'))
|
|
||||||
}
|
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
// 发送操作成功的事件
|
// 发送操作成功的事件
|
||||||
emit('success')
|
emit('success')
|
||||||
|
|
@ -327,6 +334,7 @@ const resetForm = () => {
|
||||||
partnerCompanyId: undefined,
|
partnerCompanyId: undefined,
|
||||||
deptId: undefined,
|
deptId: undefined,
|
||||||
quotationTimes: undefined,
|
quotationTimes: undefined,
|
||||||
|
radio: 1,
|
||||||
products: []
|
products: []
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
|
|
|
||||||
|
|
@ -75,14 +75,14 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<!-- <el-col :span="8">
|
||||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||||
<el-input v-model="formData.invoiceTemplateId" placeholder="请输入票据模板" disabled />
|
<el-input v-model="formData.invoiceTemplateId" placeholder="请输入票据模板" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row> -->
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="违约金比例" prop="penaltyRate">
|
<el-form-item label="违约金比例" prop="penaltyRate">
|
||||||
<el-input v-model="formData.penaltyRate" placeholder="请输入违约金比例" />
|
<el-input v-model="formData.penaltyRate" placeholder="请输入违约金比例" />
|
||||||
|
|
@ -452,9 +452,7 @@ const open = async (type: string) => {
|
||||||
if (type) {
|
if (type) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
console.log('%csrc/views/crm/contract/ContractForm.vue:456 type', 'color: #007acc;', type);
|
|
||||||
formData.value = await ContractApi.getContract(type)
|
formData.value = await ContractApi.getContract(type)
|
||||||
console.log('%csrc/views/crm/contract/ContractForm.vue:458 formData.value', 'color: #007acc;', formData.value);
|
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.lastPayDate"
|
v-model="formData.lastPayDate"
|
||||||
type="date"
|
type="date"
|
||||||
|
:disabled="!!type"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
placeholder="请选择终止日期"
|
placeholder="请选择终止日期"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
|
@ -20,7 +21,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="终止原因" prop="">
|
<el-form-item label="终止原因" prop="">
|
||||||
<el-radio-group v-model="formData.defendantRecord" :disabled="true">
|
<el-radio-group v-model="formData.defendantRecord" :disabled="!!type">
|
||||||
<el-radio :label="1">合同到期</el-radio>
|
<el-radio :label="1">合同到期</el-radio>
|
||||||
<el-radio :label="2">甲方违反协议</el-radio>
|
<el-radio :label="2">甲方违反协议</el-radio>
|
||||||
<el-radio :label="3">乙方不可抗力</el-radio>
|
<el-radio :label="3">乙方不可抗力</el-radio>
|
||||||
|
|
@ -32,7 +33,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="终止说明" prop="signEmail">
|
<el-form-item label="终止说明" prop="signEmail">
|
||||||
<el-input v-model="formData.terminationReason" type="textarea" :row="5" placeholder="必须确保账款已全部回收" />
|
<el-input v-model="formData.terminationReason" :disabled="!!type" type="textarea" :row="5" placeholder="必须确保账款已全部回收" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -50,6 +51,7 @@ import * as CustomerApi from '@/api/crm/customer'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
|
||||||
/** CRM 方案报价 表单 */
|
/** CRM 方案报价 表单 */
|
||||||
defineOptions({ name: 'QuotationForm' })
|
defineOptions({ name: 'QuotationForm' })
|
||||||
|
|
@ -63,7 +65,9 @@ const businessList = ref([])
|
||||||
const deptTree = ref() // 部门树形结构
|
const deptTree = ref() // 部门树形结构
|
||||||
const deptList = ref() // 部门
|
const deptList = ref() // 部门
|
||||||
const orgList = ref([])
|
const orgList = ref([])
|
||||||
|
const props = defineProps({
|
||||||
|
type: propTypes.string.def('')
|
||||||
|
})
|
||||||
const invoiceTemplateList = ref([])
|
const invoiceTemplateList = ref([])
|
||||||
const { proxy }: any = getCurrentInstance();
|
const { proxy }: any = getCurrentInstance();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,23 +58,26 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row justify="center" class="mt-3">
|
<el-row justify="center" class="mt-3" v-if="!type">
|
||||||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as ContractApi from '@/api/crm/contract'
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps({
|
||||||
contractId: undefined // 合同ID(主表的关联字段)
|
contractId: undefined, // 合同ID(主表的关联字段)
|
||||||
}>()
|
type: propTypes.string.def('')
|
||||||
|
|
||||||
|
})
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref([])
|
const formData = ref([])
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
|
|
|
||||||
|
|
@ -65,14 +65,14 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row justify="center" class="mt-3">
|
<el-row justify="center" class="mt-3" v-if="!type">
|
||||||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -81,7 +81,8 @@ import * as ContractApi from '@/api/crm/contract'
|
||||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
contractId: undefined // 合同ID(主表的关联字段)
|
contractId: undefined, // 合同ID(主表的关联字段)
|
||||||
|
type: undefined
|
||||||
}>()
|
}>()
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref([])
|
const formData = ref([])
|
||||||
|
|
|
||||||
|
|
@ -79,14 +79,14 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row justify="center" class="mt-3">
|
<el-row justify="center" class="mt-3" v-if="!type">
|
||||||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -95,7 +95,8 @@ import * as ContractApi from '@/api/crm/contract'
|
||||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
contractId: undefined // 合同ID(主表的关联字段)
|
contractId: undefined, // 合同ID(主表的关联字段)
|
||||||
|
type: undefined
|
||||||
}>()
|
}>()
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref([])
|
const formData = ref([])
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<ContentWrap class="mt-10px">
|
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
|
|
@ -10,7 +9,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="合作类型" prop="cooperationType">
|
<el-form-item label="合作类型" prop="cooperationType">
|
||||||
<el-select v-model="formData.cooperationType" filterable placeholder="请选择合作类型" class="w-1/1">
|
<el-select v-model="formData.cooperationType" disabled filterable placeholder="请选择合作类型" class="w-1/1">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
@ -27,7 +26,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="上市情况" prop="customerId">
|
<el-form-item label="上市情况" prop="customerId">
|
||||||
<el-select v-model="formData.customerId" placeholder="请选择上市情况" @change="onCustomerChange">
|
<el-select v-model="formData.customerId" placeholder="请选择上市情况" disabled @change="onCustomerChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in customerList"
|
v-for="item in customerList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
|
@ -44,7 +43,7 @@
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="融资信息" prop="companyType">
|
<el-form-item label="融资信息" prop="companyType">
|
||||||
<el-select v-model="formData.customerId" placeholder="请选择融资信息" @change="onCustomerChange">
|
<el-select v-model="formData.customerId" placeholder="请选择融资信息" disabled @change="onCustomerChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in customerList"
|
v-for="item in customerList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
|
@ -119,17 +118,17 @@
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="初始额度" prop="signPhoneNumber">
|
<el-form-item label="初始额度" prop="signPhoneNumber">
|
||||||
<el-input v-model="formData.signPhoneNumber" placeholder="请输入初始额度" />
|
<el-input v-model="formData.signPhoneNumber" placeholder="请输入初始额度" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="目前额度" prop="beforeAmount">
|
<el-form-item label="目前额度" prop="beforeAmount">
|
||||||
<el-input v-model="formData.beforeAmount" placeholder="请输入目前额度" />
|
<el-input v-model="formData.beforeAmount" placeholder="请输入目前额度" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="签约主体" prop="signWechat">
|
<el-form-item label="签约主体" prop="signWechat">
|
||||||
<el-select v-model="formData.partnerCompanyId" placeholder="请选择签约主体" @change="onPartnerChange">
|
<el-select v-model="formData.partnerCompanyId" disabled placeholder="请选择签约主体" @change="onPartnerChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in orgList"
|
v-for="dict in orgList"
|
||||||
:key="dict.id"
|
:key="dict.id"
|
||||||
|
|
@ -141,12 +140,12 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="调整金额(元)" prop="changeAmount">
|
<el-form-item label="调整金额(元)" prop="changeAmount">
|
||||||
<el-input v-model="formData.changeAmount" placeholder="请输入调整金额(元)" />
|
<el-input v-model="formData.changeAmount" :disabled="!!type" placeholder="请输入调整金额(元)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="最终额度" prop="afterAmount">
|
<el-form-item label="最终额度" prop="afterAmount">
|
||||||
<el-input v-model="formData.afterAmount" placeholder="请输入最终额度" />
|
<el-input v-model="formData.afterAmount" :disabled="!!type" placeholder="请输入最终额度" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
@ -154,6 +153,7 @@
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.lastPayDate"
|
v-model="formData.lastPayDate"
|
||||||
type="date"
|
type="date"
|
||||||
|
:disabled="!!type"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
placeholder="请选择调整金额截止日期"
|
placeholder="请选择调整金额截止日期"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
|
@ -162,14 +162,13 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="调额说明" prop="note">
|
<el-form-item label="调额说明" prop="note">
|
||||||
<el-input v-model="formData.note" type="textarea" :row="5" placeholder="请输入调额说明" />
|
<el-input v-model="formData.note" type="textarea" :disabled="!!type" :row="5" placeholder="请输入调额说明" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- 子表的表单 -->
|
<!-- 子表的表单 -->
|
||||||
|
|
||||||
</ContentWrap>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
|
@ -181,6 +180,7 @@ import * as CustomerApi from '@/api/crm/customer'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
|
||||||
/** CRM 方案报价 表单 */
|
/** CRM 方案报价 表单 */
|
||||||
defineOptions({ name: 'QuotationForm' })
|
defineOptions({ name: 'QuotationForm' })
|
||||||
|
|
@ -262,6 +262,9 @@ const formRef = ref() // 表单 Ref
|
||||||
const subTabsName = ref('quotationProduct')
|
const subTabsName = ref('quotationProduct')
|
||||||
const quotationProductFormRef = ref()
|
const quotationProductFormRef = ref()
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
type: propTypes.string.def('')
|
||||||
|
})
|
||||||
const onBusinessChange = async (businessId: string) => {
|
const onBusinessChange = async (businessId: string) => {
|
||||||
if (!businessId) return
|
if (!businessId) return
|
||||||
try {
|
try {
|
||||||
|
|
@ -349,7 +352,6 @@ const open = async (type: string) => {
|
||||||
|
|
||||||
/** 表单校验 */
|
/** 表单校验 */
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
console.log('%csrc/views/crm/contract/components/ContractChangeLimit.vue:352 object', 'color: #007acc;', formRef.value.validate());
|
|
||||||
return formRef.value.validate()
|
return formRef.value.validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<ContentWrap class="mt-10px">
|
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
|
|
@ -10,7 +9,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="合作类型" prop="cooperationType">
|
<el-form-item label="合作类型" prop="cooperationType">
|
||||||
<el-select v-model="formData.cooperationType" filterable placeholder="请选择合作类型" class="w-1/1">
|
<el-select v-model="formData.cooperationType" :disabled="!!type" filterable placeholder="请选择合作类型" class="w-1/1">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
@ -30,7 +29,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="上市情况" prop="customerId">
|
<el-form-item label="上市情况" prop="customerId">
|
||||||
<el-select v-model="formData.customerId" placeholder="请选择上市情况" @change="onCustomerChange">
|
<el-select v-model="formData.customerId" :disabled="!!type" placeholder="请选择上市情况" @change="onCustomerChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in customerList"
|
v-for="item in customerList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
|
@ -47,7 +46,7 @@
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="融资信息" prop="companyType">
|
<el-form-item label="融资信息" prop="companyType">
|
||||||
<el-select v-model="formData.customerId" placeholder="请选择融资信息" @change="onCustomerChange">
|
<el-select v-model="formData.customerId" :disabled="!!type" placeholder="请选择融资信息" @change="onCustomerChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in customerList"
|
v-for="item in customerList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
|
@ -123,6 +122,7 @@
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="协议截止日" prop="agreementDeadline">
|
<el-form-item label="协议截止日" prop="agreementDeadline">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
:disabled="!!type"
|
||||||
v-model="formData.lastPayDate"
|
v-model="formData.lastPayDate"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
|
|
@ -133,13 +133,14 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="顺延年限" prop="extensionYears">
|
<el-form-item label="顺延年限" prop="extensionYears">
|
||||||
<el-input v-model="formData.extensionYears" placeholder="请输入顺延年限" />
|
<el-input v-model="formData.extensionYears" :disabled="!!type" placeholder="请输入顺延年限" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="调整金额截止日期" prop="establishmentDate">
|
<el-form-item label="调整金额截止日期" prop="establishmentDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.lastPayDate"
|
v-model="formData.lastPayDate"
|
||||||
|
:disabled="!!type"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
placeholder="调整金额截止日期"
|
placeholder="调整金额截止日期"
|
||||||
|
|
@ -149,14 +150,13 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="延期说明" prop="signEmail">
|
<el-form-item label="延期说明" prop="signEmail">
|
||||||
<el-input v-model="formData.signEmail" type="textarea" :row="5" placeholder="请输入延期说明" />
|
<el-input v-model="formData.signEmail" :disabled="!!type" type="textarea" :row="5" placeholder="请输入延期说明" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- 子表的表单 -->
|
<!-- 子表的表单 -->
|
||||||
|
|
||||||
</ContentWrap>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
|
@ -168,6 +168,7 @@ import * as CustomerApi from '@/api/crm/customer'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
|
||||||
/** CRM 方案报价 表单 */
|
/** CRM 方案报价 表单 */
|
||||||
defineOptions({ name: 'QuotationForm' })
|
defineOptions({ name: 'QuotationForm' })
|
||||||
|
|
@ -181,7 +182,9 @@ const businessList = ref([])
|
||||||
const deptTree = ref() // 部门树形结构
|
const deptTree = ref() // 部门树形结构
|
||||||
const deptList = ref() // 部门
|
const deptList = ref() // 部门
|
||||||
const orgList = ref([])
|
const orgList = ref([])
|
||||||
|
const props = defineProps({
|
||||||
|
type: propTypes.string.def('')
|
||||||
|
})
|
||||||
const invoiceTemplateList = ref([])
|
const invoiceTemplateList = ref([])
|
||||||
const { proxy }: any = getCurrentInstance();
|
const { proxy }: any = getCurrentInstance();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -109,7 +109,8 @@ import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
products: undefined
|
products: undefined
|
||||||
disabled: false
|
disabled: false,
|
||||||
|
type: undefined
|
||||||
}>()
|
}>()
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref([])
|
const formData = ref([])
|
||||||
|
|
@ -167,6 +168,7 @@ defineExpose({ validate })
|
||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
console.log('%csrc/views/crm/contract/components/ContractProductForm.vue:171 props.type', 'color: #007acc;', props.type);
|
||||||
productList.value = await ProductApi.getProductSimpleList()
|
productList.value = await ProductApi.getProductSimpleList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,6 @@ const exportLoading = ref(false) // 导出的加载中
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
console.log('%csrc/views/crm/contract/components/QuotationList.vue:112 props.bizId', 'color: #007acc;', props.bizId);
|
|
||||||
queryParams.customerId = props.bizId
|
queryParams.customerId = props.bizId
|
||||||
const data = await QuotationApi.getQuotationPage(queryParams)
|
const data = await QuotationApi.getQuotationPage(queryParams)
|
||||||
list.value = data.list
|
list.value = data.list
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,428 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap class="mt-10px">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
v-loading="formLoading"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="120px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<!-- <el-col :span="8">
|
||||||
|
<el-form-item label="合同查询" prop="quotationId">
|
||||||
|
<el-select
|
||||||
|
@change="handleQuotationChange"
|
||||||
|
v-model="formData.quotationId"
|
||||||
|
class="w-1/1"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in quotationList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.no"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="客户名称" prop="customerId">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.customerId"
|
||||||
|
disabled=""
|
||||||
|
placeholder="请选择客户"
|
||||||
|
class="w-1/1"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in contactList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="协议编码" prop="name">
|
||||||
|
<el-input v-model="formData.processInstanceId" disabled placeholder="协议编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合同状态" prop="quotationId">
|
||||||
|
<el-select v-model="formData.auditStatus" disabled clearable placeholder="请选择合同状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="协议截止日期" prop="endTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.endTime"
|
||||||
|
disabled
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="请选择协议截止日期"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="变更项目" prop="endTime">
|
||||||
|
<el-radio-group v-model="formData.radio" disabled>
|
||||||
|
<el-radio :value="1">额度</el-radio>
|
||||||
|
<el-radio :value="2">授权人</el-radio>
|
||||||
|
<el-radio :value="3">延期</el-radio>
|
||||||
|
<el-radio :value="4">终止</el-radio>
|
||||||
|
<el-radio :value="5">甲方关联单位</el-radio>
|
||||||
|
<el-radio :value="6">重签</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 子表的表单 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<ContractChangeLimit
|
||||||
|
v-if="formData.radio == 1"
|
||||||
|
:type="1"
|
||||||
|
ref="limitFormRef"
|
||||||
|
:formData="formData"
|
||||||
|
:disabled="disabled"
|
||||||
|
/>
|
||||||
|
<div v-if="formData.radio == 2">
|
||||||
|
<ContentWrap style="border: none">
|
||||||
|
甲方现授权人信息
|
||||||
|
</ContentWrap>
|
||||||
|
<ContractAuthPersonInfo
|
||||||
|
ref="personDataRef"
|
||||||
|
:products="formData.contractAAuthorizedPersons"
|
||||||
|
/>
|
||||||
|
<!-- <ContentWrap style="border: none">
|
||||||
|
甲方授权人
|
||||||
|
</ContentWrap>
|
||||||
|
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef" :contract-id="formData.id" /> -->
|
||||||
|
</div>
|
||||||
|
<ContracExtension ref="contractExtensionFormRef" :type="1" :formData="formData" v-if="formData.radio == 3" />
|
||||||
|
<ContractStop ref="contractStopFormRef" :type="1" :formData="formData" v-if="formData.radio == 4" />
|
||||||
|
<ContractAAuthorizedCompanyForm :type="1" ref="contractAAuthorizedCompanyFormRef1" v-if="formData.radio == 5" :contract-id="formData.id" />
|
||||||
|
<ContractForm ref="contractFormRef" :type="1" :id="formType" :formData="formData" v-if="formData.radio == 6" />
|
||||||
|
</ContentWrap>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
|
import * as UserApi from '@/api/system/user'
|
||||||
|
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
||||||
|
import { erpPriceMultiply, erpPriceInputFormatter, jsonParse } from '@/utils'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import ContractChangeLimit from '@/views/crm/contract/components/ContractChangeLimit.vue'
|
||||||
|
import ContractAuthPersonInfo from '@/views/crm/contract/components/ContractAuthPersonInfo.vue'
|
||||||
|
import ContracExtension from '@/views/crm/contract/components/ContractExtension.vue'
|
||||||
|
import ContractStop from '@/views/crm/contract/components/ContracStop.vue'
|
||||||
|
import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue'
|
||||||
|
import ContractAAuthorizedCompanyForm from '../components/ContractAAuthorizedCompanyForm.vue'
|
||||||
|
import ContractForm from './ContractDetail.vue'
|
||||||
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { proxy }: any = getCurrentInstance();
|
||||||
|
const props = defineProps({
|
||||||
|
id: propTypes.number.def(undefined)
|
||||||
|
})
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
authPerson: [],
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
no: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
quotationId: undefined,
|
||||||
|
invoiceTemplateId: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
auditStatus: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
penaltyRate: undefined,
|
||||||
|
latePaymentRate: undefined,
|
||||||
|
settleMethod: undefined,
|
||||||
|
lastPayDate: undefined,
|
||||||
|
contractTerm: undefined,
|
||||||
|
signUserId: undefined,
|
||||||
|
signPhoneNumber: undefined,
|
||||||
|
signEmail: undefined,
|
||||||
|
signWechat: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
|
onlinePrice: undefined,
|
||||||
|
ownerUserId: undefined,
|
||||||
|
expanderUserId: undefined,
|
||||||
|
pricingUserId: undefined,
|
||||||
|
afterSaleUserId: undefined,
|
||||||
|
collUserId: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
contractBody: undefined,
|
||||||
|
contractAgreement: undefined,
|
||||||
|
creditMethod: undefined,
|
||||||
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
quotationTimes: undefined,
|
||||||
|
products: []
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||||
|
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||||
|
orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }],
|
||||||
|
ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
const customerList = ref([]) // 客户列表的数据
|
||||||
|
const quotationList = ref<QuotationVO[]>([])
|
||||||
|
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||||
|
|
||||||
|
/** 子表的表单 */
|
||||||
|
const subTabsName = ref('limit')
|
||||||
|
const contractAAuthorizedCompanyFormRef = ref()
|
||||||
|
const contractAAuthorizedCompanyFormRef1 = ref()
|
||||||
|
const limitFormRef = ref()
|
||||||
|
const contractExtensionFormRef = ref()
|
||||||
|
const contractStopFormRef = ref()
|
||||||
|
const contractFormRef = ref()
|
||||||
|
|
||||||
|
/** 计算 discountPrice、totalPrice 价格 */
|
||||||
|
watch(
|
||||||
|
() => formData.value,
|
||||||
|
(val) => {
|
||||||
|
if (!val) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// const totalPrice = val.products.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
||||||
|
// 赋值
|
||||||
|
// formData.value.totalPrice = totalPrice
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string) => {
|
||||||
|
if (type) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await ContractApi.getChangeContract(type)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
if (!formRef) return
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
|
||||||
|
// const Authalid = await contractAAuthorizedCompanyFormRef.value.validate()
|
||||||
|
// if (!Authalid) return
|
||||||
|
|
||||||
|
// const Authalid1 = await contractAAuthorizedCompanyFormRef1.value.validate()
|
||||||
|
// if (!Authalid1) return
|
||||||
|
|
||||||
|
// const limitValid = await limitFormRef.value.validate()
|
||||||
|
// if (!limitValid) return
|
||||||
|
// const extensionValid = await contractExtensionFormRef.value.validate()
|
||||||
|
// if (!extensionValid) return
|
||||||
|
|
||||||
|
// const stopValid = await contractStopFormRef.value.validate()
|
||||||
|
// if (!stopValid) return
|
||||||
|
|
||||||
|
// const contractValid = await contractFormRef.value.validate()
|
||||||
|
// if (!contractValid) return
|
||||||
|
|
||||||
|
|
||||||
|
// console.log('%csrc/views/crm/contract/ContractChange.vue:247 123', 'color: #007acc;', extensionValid,123);
|
||||||
|
// return
|
||||||
|
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = unref(JSON.parse(JSON.stringify(formData.value))) as unknown as ContractApi.ContractVO
|
||||||
|
// 拼接子表的数据
|
||||||
|
data.contractAAuthorizedCompanys = limitFormRef.value.getData()
|
||||||
|
data.contractAAuthorizedCompanys = contractExtensionFormRef.value.getData()
|
||||||
|
data.contractAAuthorizedCompanys = contractStopFormRef.value.getData()
|
||||||
|
data.contractAAuthorizedCompanys = contractFormRef.value.getData()
|
||||||
|
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||||
|
data.contractId = data.id
|
||||||
|
delete data.id
|
||||||
|
await ContractApi.changeContract(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
goBack()
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const goBack = ()=> {
|
||||||
|
proxy.$router.go(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
no: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
quotationId: undefined,
|
||||||
|
invoiceTemplateId: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
auditStatus: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
penaltyRate: undefined,
|
||||||
|
latePaymentRate: undefined,
|
||||||
|
settleMethod: undefined,
|
||||||
|
lastPayDate: undefined,
|
||||||
|
contractTerm: undefined,
|
||||||
|
signUserId: undefined,
|
||||||
|
signPhoneNumber: undefined,
|
||||||
|
signEmail: undefined,
|
||||||
|
signWechat: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
|
onlinePrice: undefined,
|
||||||
|
ownerUserId: undefined,
|
||||||
|
expanderUserId: undefined,
|
||||||
|
pricingUserId: undefined,
|
||||||
|
afterSaleUserId: undefined,
|
||||||
|
collUserId: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
contractBody: undefined,
|
||||||
|
contractAgreement: undefined,
|
||||||
|
creditMethod: undefined,
|
||||||
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
quotationTimes: undefined,
|
||||||
|
products: []
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 处理商机变化 */
|
||||||
|
const handleQuotationChange = async (quotationId: number) => {
|
||||||
|
if (!quotationId) return
|
||||||
|
try {
|
||||||
|
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||||
|
formData.value.products = quotation.products;
|
||||||
|
formData.value.customerId = quotation.customerId;
|
||||||
|
|
||||||
|
formData.value.invoiceTemplateId = quotation.invoiceTemplateId;
|
||||||
|
|
||||||
|
formData.value.ownerUserId = quotation.ownerUserId;
|
||||||
|
formData.value.expanderUserId = quotation.expanderUserId;
|
||||||
|
formData.value.pricingUserId = quotation.pricingUserId;
|
||||||
|
formData.value.signUserId = quotation.signUserId;
|
||||||
|
formData.value.signPhoneNumber = quotation.signPhoneNumber;
|
||||||
|
formData.value.signEmail = quotation.signEmail;
|
||||||
|
formData.value.signWechat = quotation.signWechat;
|
||||||
|
|
||||||
|
formData.value.partnerCompanyId = quotation.partnerCompanyId;
|
||||||
|
|
||||||
|
formData.value.creditLimit = quotation.creditLimit;
|
||||||
|
formData.value.creditMethod = quotation.creditMethod;
|
||||||
|
formData.value.creditCalcCycle = quotation.creditCalcCycle;
|
||||||
|
|
||||||
|
formData.value.deptId = quotation.deptId;
|
||||||
|
formData.value.offlinePrice = quotation.offlinePrice;
|
||||||
|
formData.value.onlinePrice = quotation.onlinePrice;
|
||||||
|
formData.value.totalPrice = quotation.totalPrice;
|
||||||
|
|
||||||
|
// 🔁 自动加载客户详情
|
||||||
|
await onCustomerChange(quotation.customerId);
|
||||||
|
} catch (err) {
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const onCustomerChange = async (customerId: string) => {
|
||||||
|
if (!customerId) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
formLoading.value = true;
|
||||||
|
const customerRes = await CustomerApi.getCustomer(customerId);
|
||||||
|
formData.value.cooperationType = customerRes.cooperationType;
|
||||||
|
formData.value.companyType = customerRes.companyType;
|
||||||
|
formData.value.listingStatus = customerRes.listingStatus;
|
||||||
|
formData.value.financingInfo = customerRes.financingInfo;
|
||||||
|
formData.value.paidInCapital = customerRes.paidInCapital;
|
||||||
|
formData.value.insuredCount = customerRes.insuredCount;
|
||||||
|
formData.value.establishmentDate = customerRes.establishmentDate;
|
||||||
|
formData.value.enterpriseType = customerRes.enterpriseType;
|
||||||
|
formData.value.businessStatus = customerRes.businessStatus;
|
||||||
|
formData.value.defendantRecord = customerRes.defendantRecord;
|
||||||
|
formData.value.businessAbnormal = customerRes.businessAbnormal;
|
||||||
|
formData.value.equityPledge = customerRes.equityPledge;
|
||||||
|
formData.value.dishonestRecord = customerRes.dishonestRecord;
|
||||||
|
formData.value.financingRecord = customerRes.financingRecord;
|
||||||
|
formData.value.enforcementRecord = customerRes.enforcementRecord;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('获取客户详情失败:', err);
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 动态获取客户联系人 */
|
||||||
|
const getContactOptions = computed(() =>
|
||||||
|
contactList.value.filter((item) => item.customerId == formData.value.customerId)
|
||||||
|
)
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
console.log('%csrc/views/crm/contract/detail/ContractChangeDetail.vue:409 props.id,route.query.id', 'color: #007acc;', props.id,route.query.id);
|
||||||
|
formType.value = props.id || route.query.id;
|
||||||
|
|
||||||
|
if (formType.value) open(formType.value)
|
||||||
|
|
||||||
|
// 获得客户列表
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
|
// 获得用户列表
|
||||||
|
userOptions.value = await UserApi.getSimpleUserList()
|
||||||
|
// 获得报价列表
|
||||||
|
quotationList.value = await QuotationApi.getSimpleQuotationList()
|
||||||
|
|
||||||
|
// 默认新建时选中自己
|
||||||
|
// if (formType.value === 'create') {
|
||||||
|
// formData.value.ownerUserId = useUserStore().getUser.id
|
||||||
|
// }
|
||||||
|
// 获取联系人
|
||||||
|
contactList.value = await ContactApi.getSimpleContactList()
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,652 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap class="mt-10px">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
v-loading="formLoading"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="120px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合同名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" disabled placeholder="请输入合同名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" v-if="formType">
|
||||||
|
<el-form-item label="合同编号" prop="no">
|
||||||
|
<el-input v-model="formData.no" disabled placeholder="请输入合同编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="报价单编号" prop="quotationId">
|
||||||
|
<el-select
|
||||||
|
disabled
|
||||||
|
@change="handleQuotationChange"
|
||||||
|
v-model="formData.quotationId"
|
||||||
|
class="w-1/1"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in quotationList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.no"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="客户名称" prop="customerId">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.customerId"
|
||||||
|
disabled=""
|
||||||
|
placeholder="请选择客户"
|
||||||
|
class="w-1/1"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in contactList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合同签订日期" prop="startTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.startTime"
|
||||||
|
type="date"
|
||||||
|
disabled
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择合同签订日期"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合同结束时间" prop="endTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.endTime"
|
||||||
|
type="date"
|
||||||
|
disabled
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择合同结束时间"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||||
|
<el-input v-model="formData.invoiceTemplateId" placeholder="请输入票据模板" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="违约金比例" prop="penaltyRate">
|
||||||
|
<el-input v-model="formData.penaltyRate" disabled placeholder="请输入违约金比例" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="延期付款利率" prop="latePaymentRate">
|
||||||
|
<el-input v-model="formData.latePaymentRate" disabled placeholder="请输入延期付款利率" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="财务结算方式" prop="settleMethod">
|
||||||
|
<el-select v-model="formData.settleMethod" disabled placeholder="请选择财务结算方式">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions('settle_method')"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="最晚付款日期" prop="lastPayDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.lastPayDate"
|
||||||
|
type="date"
|
||||||
|
disabled
|
||||||
|
value-format="x"
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="选择最晚付款日期"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合同期限(月)" prop="contractTerm">
|
||||||
|
<el-input v-model="formData.contractTerm" disabled placeholder="请输入合同期限(月)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="报价签约人" prop="signUserId">
|
||||||
|
<el-select v-model="formData.signUserId" placeholder="请选择报价签约人" disabled >
|
||||||
|
<el-option
|
||||||
|
v-for="dict in userOptions"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.nickname"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="签约人联系电话" prop="signPhoneNumber">
|
||||||
|
<el-input v-model="formData.signPhoneNumber" placeholder="请输入签约人联系电话" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="签约人Email" prop="signEmail">
|
||||||
|
<el-input v-model="formData.signEmail" placeholder="请输入签约人Email" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="签约人微信" prop="signWechat">
|
||||||
|
<el-input v-model="formData.signWechat" placeholder="请输入签约人微信" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="商机负责人" prop="ownerUserId">
|
||||||
|
<el-select v-model="formData.ownerUserId" placeholder="请选择商机负责人" disabled>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in userOptions"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.nickname"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="拓展人" prop="expanderUserId">
|
||||||
|
<el-select v-model="formData.expanderUserId" placeholder="请选择拓展人" disabled>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in userOptions"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.nickname"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="方案报价人" prop="pricingUserId">
|
||||||
|
<el-select v-model="formData.pricingUserId" placeholder="请选择方案报价人" disabled>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in userOptions"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.nickname"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="售后维护人" prop="afterSaleUserId">
|
||||||
|
<el-select v-model="formData.afterSaleUserId" disabled placeholder="请选择售后维护人">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in userOptions"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.nickname"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="协作人" prop="collUserId">
|
||||||
|
<el-select v-model="formData.collUserId" disabled placeholder="请选择协作人">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in userOptions"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.nickname"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="授信方式" prop="creditMethod" >
|
||||||
|
<el-select v-model="formData.creditMethod" placeholder="请选择授信方式" disabled>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions('credit_method')"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="授信计算周期" prop="creditCalcCycle" >
|
||||||
|
<el-select v-model="formData.creditCalcCycle" placeholder="请选择授信计算周期" disabled>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions('credit_calc_cycle')"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="授信额度" prop="creditLimit">
|
||||||
|
<el-input v-model="formData.creditLimit" placeholder="请输入授信额度" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||||
|
<el-select v-model="formData.partnerCompanyId" placeholder="请选择合作主体" disabled >
|
||||||
|
<el-option
|
||||||
|
v-for="dict in orgList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="归属部门" prop="deptId" >
|
||||||
|
<el-tree-select
|
||||||
|
v-model="formData.deptId"
|
||||||
|
:data="deptTree"
|
||||||
|
:props="defaultProps"
|
||||||
|
filterable
|
||||||
|
disabled
|
||||||
|
check-strictly
|
||||||
|
node-key="id"
|
||||||
|
placeholder="请选择归属部门"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="第几次报价" prop="quotationTimes">
|
||||||
|
<el-input v-model="formData.quotationTimes" disabled placeholder="请输入第几次报价" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="合同正文" prop="contractBody">
|
||||||
|
<el-input v-model="formData.contractBody" type="textarea" row="5" disabled placeholder="请输入合同正文" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="合同补充协议" prop="contractAgreement">
|
||||||
|
<el-input v-model="formData.contractAgreement" type="textarea" row="5" disabled placeholder="请输入合同补充协议" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="线上总金额" prop="onlinePrice">
|
||||||
|
<el-input
|
||||||
|
disabled
|
||||||
|
v-model="formData.onlinePrice"
|
||||||
|
placeholder="请输入线上总金额,单位:元"
|
||||||
|
:formatter="erpPriceInputFormatter"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="线下总金额" prop="offlinePrice">
|
||||||
|
<el-input
|
||||||
|
disabled
|
||||||
|
v-model="formData.offlinePrice"
|
||||||
|
placeholder="请输入线下总金额,单位:元"
|
||||||
|
:formatter="erpPriceInputFormatter"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="总金额" prop="price">
|
||||||
|
<el-input
|
||||||
|
disabled
|
||||||
|
v-model="formData.totalPrice"
|
||||||
|
:formatter="erpPriceInputFormatter"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!-- 子表的表单 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-tabs v-model="subTabsName" class="-mt-15px -mb-10px">
|
||||||
|
<el-tab-pane label="产品清单" name="product">
|
||||||
|
<ContractProductForm
|
||||||
|
ref="productFormRef"
|
||||||
|
:type="1"
|
||||||
|
:products="formData.products"
|
||||||
|
:disabled="disabled"
|
||||||
|
/>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="合同甲方关联单位" name="contractAAuthorizedCompany">
|
||||||
|
<ContractAAuthorizedCompanyForm :type="1" ref="contractAAuthorizedCompanyFormRef" :contract-id="formData.id" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="合同甲方授权人信息" name="contractAAuthorizedPerson">
|
||||||
|
<ContractAAuthorizedPersonForm :type="1" ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="合同乙方授权人信息" name="contractBAuthorizedPerson">
|
||||||
|
<ContractBAuthorizedPersonForm :type="1" ref="contractBAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</ContentWrap>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</ContentWrap>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
|
import * as UserApi from '@/api/system/user'
|
||||||
|
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
||||||
|
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue'
|
||||||
|
import ContractAAuthorizedCompanyForm from '../components/ContractAAuthorizedCompanyForm.vue'
|
||||||
|
import ContractAAuthorizedPersonForm from '../components/ContractAAuthorizedPersonForm.vue'
|
||||||
|
import ContractBAuthorizedPersonForm from '../components/ContractBAuthorizedPersonForm.vue'
|
||||||
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { proxy }: any = getCurrentInstance();
|
||||||
|
const props = defineProps({
|
||||||
|
id: propTypes.number.def(undefined),
|
||||||
|
type: propTypes.number.def(undefined),
|
||||||
|
})
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
no: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
quotationId: undefined,
|
||||||
|
invoiceTemplateId: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
auditStatus: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
penaltyRate: undefined,
|
||||||
|
latePaymentRate: undefined,
|
||||||
|
settleMethod: undefined,
|
||||||
|
lastPayDate: undefined,
|
||||||
|
contractTerm: undefined,
|
||||||
|
signUserId: undefined,
|
||||||
|
signPhoneNumber: undefined,
|
||||||
|
signEmail: undefined,
|
||||||
|
signWechat: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
|
onlinePrice: undefined,
|
||||||
|
ownerUserId: undefined,
|
||||||
|
expanderUserId: undefined,
|
||||||
|
pricingUserId: undefined,
|
||||||
|
afterSaleUserId: undefined,
|
||||||
|
collUserId: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
contractBody: undefined,
|
||||||
|
contractAgreement: undefined,
|
||||||
|
creditMethod: undefined,
|
||||||
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
quotationTimes: undefined,
|
||||||
|
products: []
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||||
|
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||||
|
orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }],
|
||||||
|
ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
const customerList = ref([]) // 客户列表的数据
|
||||||
|
const quotationList = ref<QuotationVO[]>([])
|
||||||
|
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||||
|
const orgList = ref([])
|
||||||
|
|
||||||
|
/** 子表的表单 */
|
||||||
|
const subTabsName = ref('product')
|
||||||
|
const productFormRef = ref()
|
||||||
|
const contractAAuthorizedCompanyFormRef = ref()
|
||||||
|
const contractAAuthorizedPersonFormRef = ref()
|
||||||
|
const contractBAuthorizedPersonFormRef = ref()
|
||||||
|
|
||||||
|
/** 计算 discountPrice、totalPrice 价格 */
|
||||||
|
watch(
|
||||||
|
() => formData.value,
|
||||||
|
(val) => {
|
||||||
|
if (!val) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// const totalPrice = val.products.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
||||||
|
// 赋值
|
||||||
|
// formData.value.totalPrice = totalPrice
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string) => {
|
||||||
|
if (type) {
|
||||||
|
// formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await ContractApi.getContract(type)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/** 表单校验 */
|
||||||
|
const validate = () => {
|
||||||
|
return formRef.value.validate()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单值 */
|
||||||
|
const getData = () => {
|
||||||
|
return formData.value
|
||||||
|
}
|
||||||
|
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
if (!formRef) return
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
productFormRef.value.validate()
|
||||||
|
try {
|
||||||
|
const data = unref(formData.value) as unknown as ContractApi.ContractVO
|
||||||
|
// 拼接子表的数据
|
||||||
|
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||||
|
data.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData()
|
||||||
|
data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData()
|
||||||
|
if (!formType.value ) {
|
||||||
|
await ContractApi.createContract(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ContractApi.updateContract(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
goBack()
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const goBack = ()=> {
|
||||||
|
proxy.$router.go(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
no: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
quotationId: undefined,
|
||||||
|
invoiceTemplateId: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
auditStatus: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
penaltyRate: undefined,
|
||||||
|
latePaymentRate: undefined,
|
||||||
|
settleMethod: undefined,
|
||||||
|
lastPayDate: undefined,
|
||||||
|
contractTerm: undefined,
|
||||||
|
signUserId: undefined,
|
||||||
|
signPhoneNumber: undefined,
|
||||||
|
signEmail: undefined,
|
||||||
|
signWechat: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
|
onlinePrice: undefined,
|
||||||
|
ownerUserId: undefined,
|
||||||
|
expanderUserId: undefined,
|
||||||
|
pricingUserId: undefined,
|
||||||
|
afterSaleUserId: undefined,
|
||||||
|
collUserId: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
contractBody: undefined,
|
||||||
|
contractAgreement: undefined,
|
||||||
|
creditMethod: undefined,
|
||||||
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
quotationTimes: undefined,
|
||||||
|
products: []
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 处理商机变化 */
|
||||||
|
const handleQuotationChange = async (quotationId: number) => {
|
||||||
|
if (!quotationId) return
|
||||||
|
try {
|
||||||
|
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||||
|
formData.value.products = quotation.products;
|
||||||
|
formData.value.customerId = quotation.customerId;
|
||||||
|
|
||||||
|
formData.value.invoiceTemplateId = quotation.invoiceTemplateId;
|
||||||
|
|
||||||
|
formData.value.ownerUserId = quotation.ownerUserId;
|
||||||
|
formData.value.expanderUserId = quotation.expanderUserId;
|
||||||
|
formData.value.pricingUserId = quotation.pricingUserId;
|
||||||
|
formData.value.signUserId = quotation.signUserId;
|
||||||
|
formData.value.signPhoneNumber = quotation.signPhoneNumber;
|
||||||
|
formData.value.signEmail = quotation.signEmail;
|
||||||
|
formData.value.signWechat = quotation.signWechat;
|
||||||
|
|
||||||
|
formData.value.partnerCompanyId = quotation.partnerCompanyId;
|
||||||
|
|
||||||
|
formData.value.creditLimit = quotation.creditLimit;
|
||||||
|
formData.value.creditMethod = quotation.creditMethod;
|
||||||
|
formData.value.creditCalcCycle = quotation.creditCalcCycle;
|
||||||
|
|
||||||
|
formData.value.deptId = quotation.deptId;
|
||||||
|
formData.value.offlinePrice = quotation.offlinePrice;
|
||||||
|
formData.value.onlinePrice = quotation.onlinePrice;
|
||||||
|
formData.value.totalPrice = quotation.totalPrice;
|
||||||
|
|
||||||
|
// 🔁 自动加载客户详情
|
||||||
|
await onCustomerChange(quotation.customerId);
|
||||||
|
} catch (err) {
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const onCustomerChange = async (customerId: string) => {
|
||||||
|
if (!customerId) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
formLoading.value = true;
|
||||||
|
const customerRes = await CustomerApi.getCustomer(customerId);
|
||||||
|
formData.value.cooperationType = customerRes.cooperationType;
|
||||||
|
formData.value.companyType = customerRes.companyType;
|
||||||
|
formData.value.listingStatus = customerRes.listingStatus;
|
||||||
|
formData.value.financingInfo = customerRes.financingInfo;
|
||||||
|
formData.value.paidInCapital = customerRes.paidInCapital;
|
||||||
|
formData.value.insuredCount = customerRes.insuredCount;
|
||||||
|
formData.value.establishmentDate = customerRes.establishmentDate;
|
||||||
|
formData.value.enterpriseType = customerRes.enterpriseType;
|
||||||
|
formData.value.businessStatus = customerRes.businessStatus;
|
||||||
|
formData.value.defendantRecord = customerRes.defendantRecord;
|
||||||
|
formData.value.businessAbnormal = customerRes.businessAbnormal;
|
||||||
|
formData.value.equityPledge = customerRes.equityPledge;
|
||||||
|
formData.value.dishonestRecord = customerRes.dishonestRecord;
|
||||||
|
formData.value.financingRecord = customerRes.financingRecord;
|
||||||
|
formData.value.enforcementRecord = customerRes.enforcementRecord;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('获取客户详情失败:', err);
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 动态获取客户联系人 */
|
||||||
|
const getContactOptions = computed(() =>
|
||||||
|
contactList.value.filter((item) => item.customerId == formData.value.customerId)
|
||||||
|
)
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
onMounted(async () => {
|
||||||
|
console.log('%csrc/views/crm/contract/detail/ContractDetail.vue:627 props.id', 'color: #007acc;', props.id);
|
||||||
|
formType.value = props.id || route.query.id
|
||||||
|
|
||||||
|
if (formType.value) await open(formType.value)
|
||||||
|
|
||||||
|
// 获得客户列表
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
|
// 获得用户列表
|
||||||
|
userOptions.value = await UserApi.getSimpleUserList()
|
||||||
|
// 获得报价列表
|
||||||
|
quotationList.value = await QuotationApi.getSimpleQuotationList()
|
||||||
|
|
||||||
|
// 默认新建时选中自己
|
||||||
|
// if (formType.value === 'create') {
|
||||||
|
// formData.value.ownerUserId = useUserStore().getUser.id
|
||||||
|
// }
|
||||||
|
// 获取联系人
|
||||||
|
contactList.value = await ContactApi.getSimpleContactList()
|
||||||
|
const data = await ContractApi.getOrg({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 1000
|
||||||
|
})
|
||||||
|
orgList.value = data.list
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -6,13 +6,13 @@
|
||||||
<el-tab-pane label="跟进记录">
|
<el-tab-pane label="跟进记录">
|
||||||
<FollowUpList :biz-id="contract.id" :type="1" :biz-type="BizTypeEnum.CRM_CONTRACT" />
|
<FollowUpList :biz-id="contract.id" :type="1" :biz-type="BizTypeEnum.CRM_CONTRACT" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="基本信息">
|
<el-tab-pane label="合同信息">
|
||||||
<ContractDetailsInfo :contract="contract" />
|
<ContractDetailsInfo :contract="contract" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="产品">
|
<!-- <el-tab-pane label="产品">
|
||||||
<ContractProductList :contract="contract" />
|
<ContractProductList :contract="contract" />
|
||||||
</el-tab-pane>
|
</el-tab-pane> -->
|
||||||
<el-tab-pane label="回款">
|
<!-- <el-tab-pane label="回款">
|
||||||
<ReceivablePlanList
|
<ReceivablePlanList
|
||||||
:type="1"
|
:type="1"
|
||||||
:contract-id="contract.id!"
|
:contract-id="contract.id!"
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
:contract-id="contract.id!"
|
:contract-id="contract.id!"
|
||||||
:customer-id="contract.customerId"
|
:customer-id="contract.customerId"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane> -->
|
||||||
<el-tab-pane label="团队成员">
|
<el-tab-pane label="团队成员">
|
||||||
<PermissionList
|
<PermissionList
|
||||||
ref="permissionListRef"
|
ref="permissionListRef"
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
import { OperateLogVO } from '@/api/system/operatelog'
|
import { OperateLogVO } from '@/api/system/operatelog'
|
||||||
import * as ContractApi from '@/api/crm/contract'
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
import ContractDetailsInfo from './ContractDetailsInfo.vue'
|
import ContractDetailsInfo from './ContractDetail.vue'
|
||||||
import ContractDetailsHeader from './ContractDetailsHeader.vue'
|
import ContractDetailsHeader from './ContractDetailsHeader.vue'
|
||||||
import ContractProductList from './ContractProductList.vue'
|
import ContractProductList from './ContractProductList.vue'
|
||||||
import { BizTypeEnum } from '@/api/crm/permission'
|
import { BizTypeEnum } from '@/api/crm/permission'
|
||||||
|
|
@ -81,7 +81,6 @@ const openForm = (type: string, id?: number) => {
|
||||||
const getContractData = async () => {
|
const getContractData = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
console.log('%csrc/views/crm/contract/detail/index.vue:92 234', 'color: #007acc;', contractId.value,234);
|
|
||||||
contract.value = await ContractApi.getContract(contractId.value)
|
contract.value = await ContractApi.getContract(contractId.value)
|
||||||
await getOperateLog(contractId.value)
|
await getOperateLog(contractId.value)
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -123,7 +122,7 @@ const close = () => {
|
||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
console.log('%csrc/views/crm/contract/detail/index.vue:134 props.id', 'color: #007acc;', props.id);
|
console.log('%csrc/views/crm/contract/detail/index.vue:125 props.id', 'color: #007acc;', props.id);
|
||||||
const id = props.id || route.query.id
|
const id = props.id || route.query.id
|
||||||
if (!id) {
|
if (!id) {
|
||||||
message.warning('参数错误,合同不能为空!')
|
message.warning('参数错误,合同不能为空!')
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column fixed="right" label="操作" width="250">
|
<el-table-column fixed="right" label="操作" width="250">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
<div style="display:flex">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.auditStatus === 0"
|
v-if="scope.row.auditStatus === 0"
|
||||||
v-hasPermi="['crm:contract:update']"
|
v-hasPermi="['crm:contract:update']"
|
||||||
|
|
@ -208,7 +209,7 @@
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<!-- <el-button
|
||||||
v-if="scope.row.auditStatus === 0"
|
v-if="scope.row.auditStatus === 0"
|
||||||
v-hasPermi="['crm:contract:update']"
|
v-hasPermi="['crm:contract:update']"
|
||||||
link
|
link
|
||||||
|
|
@ -225,16 +226,7 @@
|
||||||
@click="handleChange(scope.row)"
|
@click="handleChange(scope.row)"
|
||||||
>
|
>
|
||||||
合同变更
|
合同变更
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<el-button
|
|
||||||
v-else
|
|
||||||
link
|
|
||||||
v-hasPermi="['crm:customer-suggestion:query']"
|
|
||||||
type="primary"
|
|
||||||
@click="handleProcessDetail(scope.row)"
|
|
||||||
>
|
|
||||||
进度
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['crm:contract:query']"
|
v-hasPermi="['crm:contract:query']"
|
||||||
link
|
link
|
||||||
|
|
@ -243,14 +235,58 @@
|
||||||
>
|
>
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['crm:contract:delete']"
|
v-if="scope.row.auditStatus !== 0"
|
||||||
link
|
link
|
||||||
type="danger"
|
v-hasPermi="['crm:customer-suggestion:query']"
|
||||||
@click="handleDelete(scope.row.id)"
|
type="primary"
|
||||||
>
|
@click="handleProcessDetail(scope.row)"
|
||||||
删除
|
>
|
||||||
</el-button>
|
进度
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.auditStatus !== 0 && scope.row.auditStatus !== 10"
|
||||||
|
v-hasPermi="['crm:contract:delete']"
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown
|
||||||
|
v-if="scope.row.auditStatus === 0"
|
||||||
|
@command="(command) => handleCommand(command, scope.row)"
|
||||||
|
v-hasPermi="[
|
||||||
|
'crm:contract:update',
|
||||||
|
'crm:contract:delete'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<el-button type="primary" link><Icon icon="ep:d-arrow-right" /> 更多</el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item
|
||||||
|
command="handleSubmit"
|
||||||
|
v-if="checkPermi(['crm:contract:update']) && scope.row.auditStatus === 0"
|
||||||
|
>
|
||||||
|
提交审核
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item
|
||||||
|
command="handleChange"
|
||||||
|
v-if="checkPermi(['crm:contract:update']) && scope.row.auditStatus === 0"
|
||||||
|
>
|
||||||
|
合同变更
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item
|
||||||
|
command="handleDelete"
|
||||||
|
v-if="checkPermi(['crm:contract:delete']) && scope.row.auditStatus === 0"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -271,6 +307,7 @@ import * as ContractApi from '@/api/crm/contract'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
|
import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
import { TabsPaneContext } from 'element-plus'
|
import { TabsPaneContext } from 'element-plus'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmContract' })
|
defineOptions({ name: 'CrmContract' })
|
||||||
|
|
@ -345,6 +382,22 @@ const handleChange = (row) => {
|
||||||
router.push({ name: 'CrmContractChange', query: { id: row.id } })
|
router.push({ name: 'CrmContractChange', query: { id: row.id } })
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/** 操作分发 */
|
||||||
|
const handleCommand = (command: string, row: UserApi.UserVO) => {
|
||||||
|
switch (command) {
|
||||||
|
case 'handleSubmit':
|
||||||
|
handleSubmit(row)
|
||||||
|
break
|
||||||
|
case 'handleChange':
|
||||||
|
handleChange(row)
|
||||||
|
break
|
||||||
|
case 'handleDelete':
|
||||||
|
handleDelete(row.id)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (id: number) => {
|
const handleDelete = async (id: number) => {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,20 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="客户名称" prop="name">
|
<el-form-item label="客户名称" prop="name">
|
||||||
<el-input v-model="formData.name" placeholder="请输入客户名称" />
|
<el-autocomplete
|
||||||
|
v-model="formData.name"
|
||||||
|
:fetch-suggestions="querySearchAsync"
|
||||||
|
:trigger-on-focus="false"
|
||||||
|
clearable
|
||||||
|
class="inline-input w-50"
|
||||||
|
placeholder="请输入客户名称"
|
||||||
|
@select="handleSelect"
|
||||||
|
>
|
||||||
|
<template #default="{ item }">
|
||||||
|
<div class="value">{{ item.name }}</div>
|
||||||
|
<span class="link">{{ item.link }}</span>
|
||||||
|
</template>
|
||||||
|
</el-autocomplete>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -126,7 +139,7 @@
|
||||||
<el-input v-model="formData.email" placeholder="请输入邮箱" />
|
<el-input v-model="formData.email" placeholder="请输入邮箱" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>-->
|
</el-col>-->
|
||||||
<el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
<el-form-item label="客户行业" prop="industryId">
|
<el-form-item label="客户行业" prop="industryId">
|
||||||
<el-select v-model="formData.industryId" placeholder="请选择客户行业" >
|
<el-select v-model="formData.industryId" placeholder="请选择客户行业" >
|
||||||
<el-option
|
<el-option
|
||||||
|
|
@ -137,7 +150,7 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="客户级别" prop="level">
|
<el-form-item label="客户级别" prop="level">
|
||||||
<el-select v-model="formData.level" placeholder="请选择客户级别" >
|
<el-select v-model="formData.level" placeholder="请选择客户级别" >
|
||||||
|
|
@ -163,6 +176,55 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>-->
|
</el-row>-->
|
||||||
|
<!-- <el-col :span="12">
|
||||||
|
<el-form-item label="统一信用代码" prop="creditNo">
|
||||||
|
<el-input v-model="formData.creditNo" disabled placeholder="请输入详细地址" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="营业状态" prop="serviceStatus">
|
||||||
|
<el-input v-model="formData.serviceStatus" disabled placeholder="营业状态" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="法人代表" prop="legalPersonName">
|
||||||
|
<el-input v-model="formData.legalPersonName" disabled placeholder="法人代表" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="注册资本" prop="registerCapital">
|
||||||
|
<el-input v-model="formData.registerCapital" disabled placeholder="注册资本" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="网站" prop="">
|
||||||
|
<el-input v-model="formData.website" placeholder="请输入网站" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="12">
|
||||||
|
<el-form-item label="所属行业" prop="industryId">
|
||||||
|
<el-select v-model="formData.industryId" placeholder="所属行业" disabled>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
|
<!-- <el-col :span="12">
|
||||||
|
<el-form-item label="注册地址" prop="registeredAddress">
|
||||||
|
<el-select v-model="formData.registeredAddress" placeholder="请选择注册地址" >
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_LEVEL)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="地址" prop="areaId">
|
<el-form-item label="地址" prop="areaId">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
|
|
@ -244,7 +306,13 @@ const formData = ref({
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
developer: undefined,
|
developer: undefined,
|
||||||
assist: [],
|
assist: [],
|
||||||
|
creditNo: undefined,
|
||||||
clueDeveloper: undefined,
|
clueDeveloper: undefined,
|
||||||
|
serviceStatus: undefined,
|
||||||
|
legalPersonName: undefined,
|
||||||
|
registerCapital: undefined,
|
||||||
|
website: undefined,
|
||||||
|
registeredAddress: undefined,
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }],
|
||||||
|
|
@ -252,6 +320,7 @@ const formRules = reactive({
|
||||||
developer: [{ required: true, message: '商务拓展人不能为空', trigger: 'change' }],
|
developer: [{ required: true, message: '商务拓展人不能为空', trigger: 'change' }],
|
||||||
cooperationType: [{ required: true, message: '合作类型不能为空', trigger: 'change' }],
|
cooperationType: [{ required: true, message: '合作类型不能为空', trigger: 'change' }],
|
||||||
cooperationArea: [{ required: true, message: '合作地区不能为空', trigger: 'change' }],
|
cooperationArea: [{ required: true, message: '合作地区不能为空', trigger: 'change' }],
|
||||||
|
website: [{ required: true, message: '网站不能为空', trigger: 'change' }],
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
|
@ -269,7 +338,8 @@ const open = async (type: string, id?: number) => {
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
restaurants.value = await CustomerApi.getCompanyList({companyName: '小米科技有限责任公司'})
|
||||||
// 获得地区列表
|
// 获得地区列表
|
||||||
areaList.value = await AreaApi.getAreaTree()
|
areaList.value = await AreaApi.getAreaTree()
|
||||||
// 获得用户列表
|
// 获得用户列表
|
||||||
|
|
@ -310,6 +380,49 @@ const submitForm = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// const loadAll = async (val) => {
|
||||||
|
// restaurants.value = await CustomerApi.getCompanyList({
|
||||||
|
// companyName: val
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
interface RestaurantItem {
|
||||||
|
value: string
|
||||||
|
link: string
|
||||||
|
}
|
||||||
|
let timeout: ReturnType<typeof setTimeout>
|
||||||
|
const restaurants = ref<RestaurantItem[]>([])
|
||||||
|
const querySearchAsync = async (queryString: string, cb: (arg: any) => void) => {
|
||||||
|
let data = await CustomerApi.getCompanyList({
|
||||||
|
companyName: queryString
|
||||||
|
})
|
||||||
|
restaurants.value = data.list.map(v => {
|
||||||
|
return {
|
||||||
|
name: v.name,
|
||||||
|
value: v.name,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log('%csrc/views/crm/customer/CustomerForm.vue:400 restaurants.value', 'color: #007acc;', restaurants.value);
|
||||||
|
const results = queryString
|
||||||
|
? restaurants.value.filter(createFilter(queryString))
|
||||||
|
: restaurants.value
|
||||||
|
|
||||||
|
clearTimeout(timeout)
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
cb(results)
|
||||||
|
}, 3000 * Math.random())
|
||||||
|
}
|
||||||
|
const createFilter = (queryString: string) => {
|
||||||
|
return (restaurant: RestaurantItem) => {
|
||||||
|
return (
|
||||||
|
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSelect = (item: Record<string, any>) => {
|
||||||
|
console.log(item)
|
||||||
|
}
|
||||||
/** 重置表单 */
|
/** 重置表单 */
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@
|
||||||
<el-descriptions-item label="线索拓展人">{{ customer.clueDeveloperName }}</el-descriptions-item>
|
<el-descriptions-item label="线索拓展人">{{ customer.clueDeveloperName }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="协助人">{{ customer.assistName }}</el-descriptions-item>
|
<el-descriptions-item label="协助人">{{ customer.assistName }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="所属行业">{{ customer.industryId }}</el-descriptions-item>
|
<el-descriptions-item label="所属行业">{{ customer.industryId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="售后维护人">{{ customer.maintainerName }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="商务签约人">{{ customer.contractorName }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="信用统一代码">{{ customer.creditNo }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="手机号">{{ customer.mobile }}</el-descriptions-item>
|
<el-descriptions-item label="手机号">{{ customer.mobile }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="电话">{{ customer.telephone }}</el-descriptions-item>
|
<el-descriptions-item label="电话">{{ customer.telephone }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="邮箱">{{ customer.email }}</el-descriptions-item>
|
<el-descriptions-item label="邮箱">{{ customer.email }}</el-descriptions-item>
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
<el-tab-pane label="商机" lazy>
|
<el-tab-pane label="商机" lazy>
|
||||||
<BusinessList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
<BusinessList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="报价" lazy>
|
<el-tab-pane label="方案报价" lazy>
|
||||||
<QuotationList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
<QuotationList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="合同" lazy>
|
<el-tab-pane label="合同" lazy>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,19 @@
|
||||||
width="180px"
|
width="180px"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="图片" align="center" prop="picUrls" />
|
<el-table-column label="图片" align="center" prop="picUrls" />
|
||||||
<el-table-column label="附件" align="center" prop="fileUrls" />
|
<el-table-column label="附件" align="center" prop="fileUrls">
|
||||||
|
<!-- <template #default="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="scope.row.fileUrls"
|
||||||
|
:underline="false"
|
||||||
|
type="primary"
|
||||||
|
@click="previewFile(scope.row.fileUrls)"
|
||||||
|
>
|
||||||
|
预览
|
||||||
|
</el-link>
|
||||||
|
<span v-else>无附件</span>
|
||||||
|
</template> -->
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="关联的联系人编号数组" align="center" prop="contactIds" />
|
<el-table-column label="关联的联系人编号数组" align="center" prop="contactIds" />
|
||||||
<el-table-column label="创建者" align="center" prop="creator" />
|
<el-table-column label="创建者" align="center" prop="creator" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -164,6 +176,36 @@ const handleExport = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const previewFile = (fileUrls) => {
|
||||||
|
// 假设 fileUrls 是一个字符串,包含文件的完整 URL
|
||||||
|
if (!fileUrls) {
|
||||||
|
message.error('没有附件');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查文件类型
|
||||||
|
const fileExtension = fileUrls.split('.').pop().toLowerCase();
|
||||||
|
switch (fileExtension) {
|
||||||
|
case 'pdf':
|
||||||
|
// 预览 PDF 文件
|
||||||
|
window.open(fileUrls, '_blank');
|
||||||
|
break;
|
||||||
|
case 'xlsx':
|
||||||
|
case 'xls':
|
||||||
|
// 预览 Excel 文件
|
||||||
|
window.open(fileUrls, '_blank');
|
||||||
|
break;
|
||||||
|
case 'doc':
|
||||||
|
case 'docx':
|
||||||
|
// 预览 Word 文件
|
||||||
|
window.open(fileUrls, '_blank');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
message.error('不支持的文件类型');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
<el-tab-pane label="下属负责的" name="3" />
|
<el-tab-pane label="下属负责的" name="3" />
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||||
<el-table-column align="center" fixed="left" label="客户名称" prop="name" width="160">
|
<el-table-column align="center" fixed="left" label="客户名称" prop="name" width="250">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||||
{{ scope.row.name }}
|
{{ scope.row.name }}
|
||||||
|
|
@ -125,14 +125,41 @@
|
||||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
|
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="手机" prop="mobile" width="120" />
|
<el-table-column align="center" label="客户状态" prop="serviceStatus" width="120" />
|
||||||
<el-table-column align="center" label="电话" prop="telephone" width="130" />
|
<!-- <el-table-column align="center" label="电话" prop="telephone" width="130" />
|
||||||
<el-table-column align="center" label="邮箱" prop="email" width="180" />
|
<el-table-column align="center" label="邮箱" prop="email" width="180" /> -->
|
||||||
<el-table-column align="center" label="客户级别" prop="level" width="135">
|
<el-table-column align="center" label="客户级别" prop="level" width="135">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
|
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="商务拓展人" prop="developerName" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.developerName || '暂无'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="商务签约人" prop="contractorName" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.contractorName || '暂无'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="归属部门" prop="ownerUserDeptName" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.ownerUserDeptName || '暂无'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="售后维护人" prop="maintainerName" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.maintainerName || '暂无'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="协助人" prop="assistName" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.assistName || '暂无'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="信用统一代码" prop="creditNo" width="180" />
|
||||||
|
|
||||||
<el-table-column align="center" label="客户行业" prop="industryId" width="100">
|
<el-table-column align="center" label="客户行业" prop="industryId" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
|
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,14 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="合作类型" prop="cooperationType">
|
<el-form-item label="合作类型" prop="cooperationType">
|
||||||
<el-input v-model="formData.cooperationType" disabled />
|
<el-select v-model="formData.cooperationType" disabled filterable placeholder="合作类型" class="w-1/1">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
@ -593,7 +600,6 @@ const resetForm = () => {
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
console.log('%csrc/views/crm/quotation/QuotationDetail.vue:596 props.id', 'color: #007acc;', props.id);
|
|
||||||
formType.value = props.id || route.query.id
|
formType.value = props.id || route.query.id
|
||||||
if (formType.value) open(formType.value)
|
if (formType.value) open(formType.value)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="选择商机" prop="businessId">
|
<el-form-item label="选择商机" prop="businessId">
|
||||||
<el-select v-model="formData.businessId" placeholder="请选择商机" @change="onBusinessChange">
|
<el-select v-model="formData.businessId" clearable placeholder="请选择商机" @change="onBusinessChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in businessList"
|
v-for="dict in businessList"
|
||||||
:key="dict.id"
|
:key="dict.id"
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<ContentWrap style="border: none; font-weight: 700">风控信息</ContentWrap>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="系统授信额度" prop="customerId">
|
<el-form-item label="系统授信额度" prop="customerId">
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="授信额度调整" prop="creditLimitNum">
|
<el-form-item label="授信额度调整" prop="creditLimitNum">
|
||||||
<el-input v-model="formData.creditLimitNum" @input="changeNum" placeholder="请输入授信额度调整" />
|
<el-input v-model="formData.creditLimitNum" @input="changeNum" clearable placeholder="请输入授信额度调整" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="客户" prop="customerId">
|
<el-form-item label="客户" prop="customerId">
|
||||||
<el-select v-model="formData.customerId" placeholder="请选择客户" @change="onCustomerChange">
|
<el-select v-model="formData.customerId" placeholder="请选择客户" clearable @change="onCustomerChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in customerList"
|
v-for="item in customerList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
|
@ -59,52 +59,59 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="合作类型" prop="cooperationType">
|
<el-form-item label="合作类型" prop="cooperationType">
|
||||||
<el-input v-model="formData.cooperationType" disabled />
|
<el-select v-model="formData.cooperationType" filterable clearable placeholder="请选择合作类型" class="w-1/1">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="公司类型" prop="companyType">
|
<el-form-item label="公司类型" prop="companyType">
|
||||||
<el-input v-model="formData.companyType" disabled />
|
<el-input v-model="formData.companyType" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="上市情况" prop="listingStatus">
|
<el-form-item label="上市情况" prop="listingStatus">
|
||||||
<el-input v-model="formData.listingStatus" disabled />
|
<el-input v-model="formData.listingStatus" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="融资信息" prop="financingInfo">
|
<el-form-item label="融资信息" prop="financingInfo">
|
||||||
<el-input v-model="formData.financingInfo" disabled />
|
<el-input v-model="formData.financingInfo" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="实缴资金" prop="paidInCapital">
|
<el-form-item label="实缴资金" prop="paidInCapital">
|
||||||
<el-input v-model="formData.paidInCapital" disabled />
|
<el-input v-model="formData.paidInCapital" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="参保人数" prop="insuredCount">
|
<el-form-item label="参保人数" prop="insuredCount">
|
||||||
<el-input v-model="formData.insuredCount" disabled />
|
<el-input v-model="formData.insuredCount" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="成立日期" prop="establishmentDate">
|
<el-form-item label="成立日期" prop="establishmentDate">
|
||||||
<el-input v-model="formData.establishmentDate" disabled />
|
<el-input v-model="formData.establishmentDate" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="企业类型" prop="enterpriseType">
|
<el-form-item label="企业类型" prop="enterpriseType">
|
||||||
<el-input v-model="formData.enterpriseType" disabled />
|
<el-input v-model="formData.enterpriseType" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="营业状态" prop="businessStatus">
|
<el-form-item label="营业状态" prop="businessStatus">
|
||||||
<el-input v-model="formData.businessStatus" disabled />
|
<el-input v-model="formData.businessStatus" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="被告记录" prop="defendantRecord">
|
<el-form-item label="被告记录" prop="defendantRecord">
|
||||||
<el-radio-group v-model="formData.defendantRecord" :disabled="true">
|
<el-radio-group v-model="formData.defendantRecord">
|
||||||
<el-radio :label="true">是</el-radio>
|
<el-radio :label="true">是</el-radio>
|
||||||
<el-radio :label="false">否</el-radio>
|
<el-radio :label="false">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
@ -112,7 +119,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="经营异常" prop="businessAbnormal">
|
<el-form-item label="经营异常" prop="businessAbnormal">
|
||||||
<el-radio-group v-model="formData.businessAbnormal" :disabled="true">
|
<el-radio-group v-model="formData.businessAbnormal">
|
||||||
<el-radio :label="true">是</el-radio>
|
<el-radio :label="true">是</el-radio>
|
||||||
<el-radio :label="false">否</el-radio>
|
<el-radio :label="false">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
@ -120,7 +127,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="股权出质" prop="equityPledge">
|
<el-form-item label="股权出质" prop="equityPledge">
|
||||||
<el-radio-group v-model="formData.equityPledge" :disabled="true">
|
<el-radio-group v-model="formData.equityPledge">
|
||||||
<el-radio :label="true">是</el-radio>
|
<el-radio :label="true">是</el-radio>
|
||||||
<el-radio :label="false">否</el-radio>
|
<el-radio :label="false">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
@ -128,7 +135,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="失信记录" prop="dishonestRecord">
|
<el-form-item label="失信记录" prop="dishonestRecord">
|
||||||
<el-radio-group v-model="formData.dishonestRecord" :disabled="true">
|
<el-radio-group v-model="formData.dishonestRecord">
|
||||||
<el-radio :label="true">是</el-radio>
|
<el-radio :label="true">是</el-radio>
|
||||||
<el-radio :label="false">否</el-radio>
|
<el-radio :label="false">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
@ -136,7 +143,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="融资记录" prop="financingRecord">
|
<el-form-item label="融资记录" prop="financingRecord">
|
||||||
<el-radio-group v-model="formData.financingRecord" :disabled="true">
|
<el-radio-group v-model="formData.financingRecord">
|
||||||
<el-radio :label="true">是</el-radio>
|
<el-radio :label="true">是</el-radio>
|
||||||
<el-radio :label="false">否</el-radio>
|
<el-radio :label="false">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
@ -144,22 +151,23 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="被执行记录" prop="enforcementRecord">
|
<el-form-item label="被执行记录" prop="enforcementRecord">
|
||||||
<el-radio-group v-model="formData.enforcementRecord" :disabled="true">
|
<el-radio-group v-model="formData.enforcementRecord">
|
||||||
<el-radio :label="true">是</el-radio>
|
<el-radio :label="true">是</el-radio>
|
||||||
<el-radio :label="false">否</el-radio>
|
<el-radio :label="false">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<ContentWrap style="border: none; font-weight: 700">需求信息</ContentWrap>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||||
<el-select v-model="formData.partnerCompanyId" placeholder="请选择合作主体" @change="onPartnerChange">
|
<el-select v-model="formData.partnerCompanyId" clearable placeholder="请选择合作主体" @change="onPartnerChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in orgList"
|
v-for="dict in orgList"
|
||||||
:key="dict.id"
|
:key="dict.id"
|
||||||
:label="dict.name"
|
:label="dict.orgName"
|
||||||
:value="dict.id"
|
:value="dict.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
@ -257,7 +265,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<!-- <el-col :span="8">
|
||||||
<el-form-item label="签约人联系电话" prop="signPhoneNumber">
|
<el-form-item label="签约人联系电话" prop="signPhoneNumber">
|
||||||
<el-input v-model="formData.signPhoneNumber" placeholder="请输入签约人联系电话" />
|
<el-input v-model="formData.signPhoneNumber" placeholder="请输入签约人联系电话" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -271,7 +279,7 @@
|
||||||
<el-form-item label="签约人微信" prop="signWechat">
|
<el-form-item label="签约人微信" prop="signWechat">
|
||||||
<el-input v-model="formData.signWechat" placeholder="请输入签约人微信" />
|
<el-input v-model="formData.signWechat" placeholder="请输入签约人微信" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="账期" prop="paymentTerm">
|
<el-form-item label="账期" prop="paymentTerm">
|
||||||
|
|
@ -316,7 +324,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||||
<el-select v-model="formData.invoiceTemplateId" placeholder="请选择票据模板">
|
<el-select v-model="formData.invoiceTemplateId" :disabled="!formData.businessId" placeholder="请选择票据模板">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in templateOptions"
|
v-for="dict in templateOptions"
|
||||||
:key="dict.id"
|
:key="dict.id"
|
||||||
|
|
@ -517,7 +525,7 @@ const onPartnerChange = async (id: string) => {
|
||||||
if (!id) return
|
if (!id) return
|
||||||
try {
|
try {
|
||||||
formLoading.value = true;
|
formLoading.value = true;
|
||||||
const res = await DeptApi.getDept(id);
|
const res = await ContractApi.getOrgInfo(id);
|
||||||
formData.value.bBankName = res.bankName;
|
formData.value.bBankName = res.bankName;
|
||||||
formData.value.bBankAccount = res.bankAccount;
|
formData.value.bBankAccount = res.bankAccount;
|
||||||
formData.value.bLegalRepresentative = res.legalRepresentative;
|
formData.value.bLegalRepresentative = res.legalRepresentative;
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,6 @@
|
||||||
>
|
>
|
||||||
<el-table :data="formData" class="-mt-10px">
|
<el-table :data="formData" class="-mt-10px">
|
||||||
<el-table-column label="序号" type="index" width="100" />
|
<el-table-column label="序号" type="index" width="100" />
|
||||||
<el-table-column label="产品编号" min-width="150">
|
|
||||||
<template #default="{ row, $index }">
|
|
||||||
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
|
||||||
<el-input v-model="row.productId" placeholder="请输入产品编号" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="产品名称" min-width="150">
|
<el-table-column label="产品名称" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
||||||
|
|
@ -23,73 +16,123 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品类别" min-width="150">
|
<el-table-column label="产品类型" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.category`" :rules="formRules.category" class="mb-0px!">
|
<el-form-item :prop="`${$index}.category`" :rules="formRules.category" class="mb-0px!">
|
||||||
<el-input v-model="row.category" placeholder="请输入产品类别" disabled />
|
<el-select v-model="row.category" placeholder="请选择状态" disabled class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_CATEGORY)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品明细" min-width="150">
|
|
||||||
|
<el-table-column label="产品明细类型" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
|
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
|
||||||
<el-input v-model="row.detailType" placeholder="产品明细" disabled />
|
<el-select v-model="row.detailType" placeholder="请选择状态" class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品单位" min-width="150">
|
<el-table-column label="产品单位" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productUnit`" :rules="formRules.productUnit" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productUnit`" :rules="formRules.productUnit" class="mb-0px!">
|
||||||
<el-input v-model="row.productUnit" placeholder="请输入产品单位" disabled />
|
<el-select v-model="row.productUnit" placeholder="请选择状态" disabled class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_UNIT)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="线上价格" min-width="150">
|
<el-table-column label="线上价格" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
||||||
<el-input v-model="row.onlinePrice" placeholder="请输入线上价格" />
|
<el-input v-model="row.onlinePrice" placeholder="请输入线上价格" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="线下价格" min-width="150">
|
<el-table-column label="线下价格" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
||||||
<el-input v-model="row.offlinePrice" placeholder="请输入线下价格" />
|
<el-input v-model="row.offlinePrice" placeholder="请输入线下价格" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="总计价格" min-width="150">
|
<el-table-column label="总计价格" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
||||||
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" />
|
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品票据" min-width="150">
|
<el-table-column label="产品票据" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
||||||
<el-input v-model="row.productInvoice" placeholder="请输入产品票据" />
|
<el-select v-model="row.productInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品开具项目" min-width="150">
|
<el-table-column label="产品开具项目" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productInvoiceItem`" :rules="formRules.productInvoiceItem" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productInvoiceItems`" :rules="formRules.productInvoiceItems" class="mb-0px!">
|
||||||
<el-input v-model="row.productInvoiceItem" placeholder="请输入产品开具项目" />
|
<el-select v-model="row.productInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE_ITEMS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="服务费票据" min-width="150">
|
<el-table-column label="服务费票据" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.serviceInvoice`" :rules="formRules.serviceInvoice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.serviceFeeInvoice`" :rules="formRules.serviceFeeInvoice" class="mb-0px!">
|
||||||
<el-input v-model="row.serviceInvoice" placeholder="请输入服务费票据" />
|
<el-select v-model="row.serviceFeeInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="服务开具项目" min-width="150">
|
<el-table-column label="服务开具项目" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.serviceInvoiceItem`" :rules="formRules.serviceInvoiceItem" class="mb-0px!">
|
<el-form-item :prop="`${$index}.serviceFeeInvoiceItems`" :rules="formRules.serviceFeeInvoiceItems" class="mb-0px!">
|
||||||
<el-input v-model="row.serviceInvoiceItem" placeholder="请输入服务开具项目" />
|
<el-select v-model="row.serviceFeeInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE_ITEMS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -106,11 +149,14 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { QuotationApi } from '@/api/crm/quotation'
|
import { QuotationApi } from '@/api/crm/quotation'
|
||||||
|
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
quotationId: undefined, // 报价编号(主表的关联字段)
|
quotationId: undefined, // 报价编号(主表的关联字段)
|
||||||
businessId: undefined
|
businessId: undefined,
|
||||||
|
billTemplateId: undefined
|
||||||
}>()
|
}>()
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref([])
|
const formData = ref([])
|
||||||
|
|
@ -118,8 +164,8 @@ const formRules = reactive({
|
||||||
quotationId: [{ required: true, message: '报价编号不能为空', trigger: 'blur' }],
|
quotationId: [{ required: true, message: '报价编号不能为空', trigger: 'blur' }],
|
||||||
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
|
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
|
||||||
productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
|
productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
|
||||||
category: [{ required: true, message: '产品类别不能为空', trigger: 'blur' }],
|
category: [{ required: true, message: '产品类型不能为空', trigger: 'blur' }],
|
||||||
detailType: [{ required: true, message: '产品明细不能为空', trigger: 'blur' }],
|
detailType: [{ required: true, message: '产品明细类型不能为空', trigger: 'blur' }],
|
||||||
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
|
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
|
||||||
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
|
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
|
||||||
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],
|
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],
|
||||||
|
|
@ -152,21 +198,73 @@ watch(
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.billTemplateId,
|
||||||
|
async (val) => {
|
||||||
|
// 2. val 非空,则加载数据
|
||||||
|
if (!val) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
formLoading.value = true
|
||||||
|
// if(val.quotationId) {
|
||||||
|
// formData.value = await QuotationApi.getQuotationProductListByQuotationId(val.quotationId)
|
||||||
|
// } else if(val.businessId) {
|
||||||
|
const business = await BillTemplateApi.getTemplateProduct({
|
||||||
|
businessId: props.businessId,
|
||||||
|
billTemplateId: val,
|
||||||
|
});
|
||||||
|
for(let i = 0; i < business.length; i++) {
|
||||||
|
let data = business[i]
|
||||||
|
let foundItem = formData.value.find(item => item.productId == data.productId);
|
||||||
|
if (foundItem) {
|
||||||
|
foundItem.productInvoice = data.productInvoice
|
||||||
|
foundItem.productInvoiceItems = data.productInvoiceItems
|
||||||
|
foundItem.serviceFeeInvoice = data.serviceFeeInvoice
|
||||||
|
foundItem.serviceFeeInvoiceItems = data.serviceFeeInvoiceItems
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// formData.value = business
|
||||||
|
// }
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
// 监听合同产品变化,计算合同产品总价
|
||||||
|
watch(
|
||||||
|
() => formData.value,
|
||||||
|
(val) => {
|
||||||
|
if (!val || val.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 循环处理
|
||||||
|
val.forEach((item) => {
|
||||||
|
if (item.offlinePrice != null && item.onlinePrice != null) {
|
||||||
|
item.totalPrice = Number((Number(item.offlinePrice) + Number(item.onlinePrice)).toFixed(2));
|
||||||
|
} else {
|
||||||
|
item.totalPrice = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
const row = {
|
const row = {
|
||||||
quotationId: undefined,
|
quotationId: undefined,
|
||||||
productId: undefined,
|
productId: undefined,
|
||||||
productName: undefined,
|
productName: undefined,
|
||||||
productCategoryId: undefined,
|
detailType: undefined,
|
||||||
productUnit: undefined,
|
productUnit: undefined,
|
||||||
onlinePrice: undefined,
|
onlinePrice: undefined,
|
||||||
offlinePrice: undefined,
|
offlinePrice: undefined,
|
||||||
totalPrice: undefined,
|
totalPrice: undefined,
|
||||||
productInvoice: undefined,
|
productInvoice: undefined,
|
||||||
productInvoiceItem: undefined,
|
productInvoiceItems: undefined,
|
||||||
serviceInvoice: undefined,
|
serviceFeeInvoice: undefined,
|
||||||
serviceInvoiceItem: undefined
|
serviceFeeInvoiceItems: undefined
|
||||||
}
|
}
|
||||||
row.quotationId = props.quotationId
|
row.quotationId = props.quotationId
|
||||||
formData.value.push(row)
|
formData.value.push(row)
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,8 @@
|
||||||
/>
|
/>
|
||||||
<el-table-column label="操作" align="center" min-width="120px">
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<div style="display:flex">
|
||||||
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openFormDetail(scope.row)"
|
@click="openFormDetail(scope.row)"
|
||||||
|
|
@ -154,22 +155,34 @@
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-dropdown
|
||||||
v-hasPermi="['crm:customer-suggestion:query']"
|
@command="(command) => handleCommand(command, scope.row)"
|
||||||
link
|
v-hasPermi="[
|
||||||
type="primary"
|
'crm:quotation:delete',
|
||||||
@click="handleProcessDetail(scope.row)"
|
'crm:customer-suggestion:query',
|
||||||
|
'system:permission:assign-user-role'
|
||||||
|
]"
|
||||||
>
|
>
|
||||||
进度
|
<el-button type="primary" link><Icon icon="ep:d-arrow-right" /> 更多</el-button>
|
||||||
</el-button>
|
<template #dropdown>
|
||||||
<el-button
|
<el-dropdown-menu>
|
||||||
link
|
<el-dropdown-item
|
||||||
type="danger"
|
command="handleProcessDetail"
|
||||||
@click="handleDelete(scope.row.id)"
|
v-if="checkPermi(['crm:customer-suggestion:query'])"
|
||||||
v-hasPermi="['crm:quotation:delete']"
|
>
|
||||||
>
|
进度
|
||||||
删除
|
</el-dropdown-item>
|
||||||
</el-button>
|
<el-dropdown-item
|
||||||
|
command="handleDelete"
|
||||||
|
v-if="checkPermi(['crm:quotation:delete'])"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-dropdown-item>
|
||||||
|
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -192,6 +205,7 @@ import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
/** CRM 方案报价 列表 */
|
/** CRM 方案报价 列表 */
|
||||||
defineOptions({ name: 'Quotation' })
|
defineOptions({ name: 'Quotation' })
|
||||||
|
|
@ -256,6 +270,19 @@ const openFormDetail = (row: Object) => {
|
||||||
|
|
||||||
router.push({ name: 'QuotationDetail', query: { id: row.id } })
|
router.push({ name: 'QuotationDetail', query: { id: row.id } })
|
||||||
}
|
}
|
||||||
|
/** 操作分发 */
|
||||||
|
const handleCommand = (command: string, row: UserApi.UserVO) => {
|
||||||
|
switch (command) {
|
||||||
|
case 'handleDelete':
|
||||||
|
handleDelete(row.id)
|
||||||
|
break
|
||||||
|
case 'handleProcessDetail':
|
||||||
|
handleProcessDetail(row)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (id: number) => {
|
const handleDelete = async (id: number) => {
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ const echartsOption = reactive<EChartsOption>({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data: ['赢单转化率', '商机总数', '赢单商机数'],
|
data: ['成交转化率', '商机总数', '成交商机数'],
|
||||||
bottom: '0px',
|
bottom: '0px',
|
||||||
itemWidth: 14
|
itemWidth: 14
|
||||||
},
|
},
|
||||||
|
|
@ -178,7 +178,7 @@ const echartsOption = reactive<EChartsOption>({
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: '赢单转化率',
|
name: '成交转化率',
|
||||||
axisTick: {
|
axisTick: {
|
||||||
alignWithLabel: true,
|
alignWithLabel: true,
|
||||||
lineStyle: { width: 0 }
|
lineStyle: { width: 0 }
|
||||||
|
|
@ -217,7 +217,7 @@ const echartsOption = reactive<EChartsOption>({
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '赢单转化率',
|
name: '成交转化率',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
yAxisIndex: 0,
|
yAxisIndex: 0,
|
||||||
data: []
|
data: []
|
||||||
|
|
@ -230,7 +230,7 @@ const echartsOption = reactive<EChartsOption>({
|
||||||
data: []
|
data: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '赢单商机数',
|
name: '成交商机数',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
barWidth: 15,
|
barWidth: 15,
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ const echartsOption = reactive<EChartsOption>({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data: ['客户', '商机', '赢单']
|
data: ['客户', '商机', '成交']
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
|
|
@ -97,7 +97,7 @@ const echartsOption = reactive<EChartsOption>({
|
||||||
data: [
|
data: [
|
||||||
{ value: 60, name: '客户-0个' },
|
{ value: 60, name: '客户-0个' },
|
||||||
{ value: 40, name: '商机-0个' },
|
{ value: 40, name: '商机-0个' },
|
||||||
{ value: 20, name: '赢单-0个' }
|
{ value: 20, name: '成交-0个' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -127,11 +127,11 @@ const loadData = async () => {
|
||||||
if (active.value) {
|
if (active.value) {
|
||||||
list.push({ value: 60, name: `客户-${data.customerCount || 0}个` })
|
list.push({ value: 60, name: `客户-${data.customerCount || 0}个` })
|
||||||
list.push({ value: 40, name: `商机-${data.businessCount || 0}个` })
|
list.push({ value: 40, name: `商机-${data.businessCount || 0}个` })
|
||||||
list.push({ value: 20, name: `赢单-${data.businessWinCount || 0}个` })
|
list.push({ value: 20, name: `成交-${data.businessWinCount || 0}个` })
|
||||||
} else {
|
} else {
|
||||||
list.push({ value: data.customerCount || 0, name: `客户-${data.customerCount || 0}个` })
|
list.push({ value: data.customerCount || 0, name: `客户-${data.customerCount || 0}个` })
|
||||||
list.push({ value: data.businessCount || 0, name: `商机-${data.businessCount || 0}个` })
|
list.push({ value: data.businessCount || 0, name: `商机-${data.businessCount || 0}个` })
|
||||||
list.push({ value: data.businessWinCount || 0, name: `赢单-${data.businessWinCount || 0}个` })
|
list.push({ value: data.businessWinCount || 0, name: `成交-${data.businessWinCount || 0}个` })
|
||||||
}
|
}
|
||||||
|
|
||||||
echartsOption.series[0]['data'] = list
|
echartsOption.series[0]['data'] = list
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue