Merge branch 'master' of https://gitee.com/guochang-hongyun/warm-kingdom-vue3-oa
commit
224e82c0f8
|
|
@ -5,9 +5,9 @@
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"type": "msedge",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch Edge against localhost",
|
"name": "Launch chrome against localhost",
|
||||||
"url": "http://localhost",
|
"url": "http://localhost",
|
||||||
"webRoot": "${workspaceFolder}/src",
|
"webRoot": "${workspaceFolder}/src",
|
||||||
"sourceMaps": true
|
"sourceMaps": true
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,41 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 票据模版 VO
|
||||||
|
export interface BillTemplateVO {
|
||||||
|
id: number // 主键
|
||||||
|
name: string // 名称
|
||||||
|
status: number // 状态
|
||||||
|
}
|
||||||
|
|
||||||
|
// 票据模版 API
|
||||||
|
export const BillTemplateApi = {
|
||||||
|
// 查询票据模版分页
|
||||||
|
getBillTemplatePage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/crm/bill-template/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询票据模版详情
|
||||||
|
getBillTemplate: async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/bill-template/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增票据模版
|
||||||
|
createBillTemplate: async (data: BillTemplateVO) => {
|
||||||
|
return await request.post({ url: `/crm/bill-template/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改票据模版
|
||||||
|
updateBillTemplate: async (data: BillTemplateVO) => {
|
||||||
|
return await request.put({ url: `/crm/bill-template/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除票据模版
|
||||||
|
deleteBillTemplate: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/crm/bill-template/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出票据模版 Excel
|
||||||
|
exportBillTemplate: async (params) => {
|
||||||
|
return await request.download({ url: `/crm/bill-template/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 票据模版产品关联 VO
|
||||||
|
export interface BillTemplateProductVO {
|
||||||
|
id: number // 主键
|
||||||
|
billTemplateId: number // 票据模版ID
|
||||||
|
productId: number // 产品ID
|
||||||
|
productInvoice: number // 产品票据
|
||||||
|
productInvoiceItems: number // 产品开票项目
|
||||||
|
serviceFeeInvoice: number // 服务费票据
|
||||||
|
serviceFeeInvoiceItems: number // 服务费开票项目
|
||||||
|
status: number // 状态
|
||||||
|
}
|
||||||
|
|
||||||
|
// 票据模版产品关联 API
|
||||||
|
export const BillTemplateProductApi = {
|
||||||
|
// 查询票据模版产品关联分页
|
||||||
|
getBillTemplateProductPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/crm/bill-template-product/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询票据模版产品关联详情
|
||||||
|
getBillTemplateProduct: async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/bill-template-product/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增票据模版产品关联
|
||||||
|
createBillTemplateProduct: async (data: BillTemplateProductVO) => {
|
||||||
|
return await request.post({ url: `/crm/bill-template-product/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改票据模版产品关联
|
||||||
|
updateBillTemplateProduct: async (data: BillTemplateProductVO) => {
|
||||||
|
return await request.put({ url: `/crm/bill-template-product/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除票据模版产品关联
|
||||||
|
deleteBillTemplateProduct: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/crm/bill-template-product/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出票据模版产品关联 Excel
|
||||||
|
exportBillTemplateProduct: async (params) => {
|
||||||
|
return await request.download({ url: `/crm/bill-template-product/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,6 @@ export interface BusinessVO {
|
||||||
dealTime: Date
|
dealTime: Date
|
||||||
totalProductPrice: number
|
totalProductPrice: number
|
||||||
totalPrice: number
|
totalPrice: number
|
||||||
discountPercent: number
|
|
||||||
remark: string
|
remark: string
|
||||||
creator: string // 创建人
|
creator: string // 创建人
|
||||||
creatorName?: string // 创建人名称
|
creatorName?: string // 创建人名称
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,45 @@
|
||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import { TransferReqVO } from '@/api/crm/permission'
|
import { TransferReqVO } from '@/api/crm/permission'
|
||||||
|
import { ContractAAuthorizedCompanyVO } from '@/api/crm/contractaauthorizedcompany'
|
||||||
|
import { ContractAAuthorizedPersonVO } from '@/api/crm/contractaauthorizedperson'
|
||||||
|
import { ContractBAuthorizedPersonVO } from '@/api/crm/contractbauthorizedperson'
|
||||||
|
|
||||||
export interface ContractVO {
|
export interface ContractVO {
|
||||||
id: number
|
id: number // 编号,主键自增
|
||||||
name: string
|
name: string // 合同名称
|
||||||
no: string
|
no: string // 合同编号
|
||||||
customerId: number
|
customerId: number // 客户编号
|
||||||
customerName?: string
|
quotationId: number // 报价单编号
|
||||||
businessId: number
|
invoiceTemplateId: number // 票据模板Id
|
||||||
businessName: string
|
processInstanceId: string // 工作流编号
|
||||||
contactLastTime: Date
|
auditStatus: number // 审批状态
|
||||||
ownerUserId: number
|
startTime: Date // 合同签订日期
|
||||||
ownerUserName?: string
|
endTime: Date // 合同结束时间
|
||||||
ownerUserDeptName?: string
|
penaltyRate: number // 违约金比例
|
||||||
processInstanceId: number
|
latePaymentRate: number // 延期付款利率
|
||||||
auditStatus: number
|
settleMethod: string // 财务结算方式 1按月 2按项目
|
||||||
orderDate: Date
|
lastPayDate: Date // 最晚付款日期
|
||||||
startTime: Date
|
contractTerm: number // 合同期限(月)
|
||||||
endTime: Date
|
signUserId: number // 报价签约人
|
||||||
totalProductPrice: number
|
signPhoneNumber: number // 签约人联系电话
|
||||||
discountPercent: number
|
signEmail: string // 签约人Email
|
||||||
totalPrice: number
|
signWechat: string // 签约人微信
|
||||||
totalReceivablePrice: number
|
offlinePrice: number // 线下总金额,单位:元
|
||||||
signContactId: number
|
onlinePrice: number // 线上总金额,单位:元
|
||||||
signContactName?: string
|
ownerUserId: number // 商机负责人
|
||||||
signUserId: number
|
expanderUserId: number // 拓展人
|
||||||
signUserName: string
|
pricingUserId: number // 方案报价人
|
||||||
remark: string
|
afterSaleUserId: number // 售后维护人
|
||||||
createTime?: Date
|
collUserId: number // 协作人id
|
||||||
creator: string
|
totalPrice: number // 合同总金额
|
||||||
creatorName: string
|
contractBody: string // 合同正文
|
||||||
updateTime?: Date
|
contractAgreement: string // 合同补充协议
|
||||||
|
creditMethod: number // 授信方式
|
||||||
|
creditCalcCycle: number // 授信计算周期
|
||||||
|
creditLimit: number // 授信额度
|
||||||
|
partnerCompanyId: number // 合作主体 关联部门id
|
||||||
|
deptId: number // 归属部门Id
|
||||||
|
quotationTimes: number // 第几次报价
|
||||||
products?: [
|
products?: [
|
||||||
{
|
{
|
||||||
id: number
|
id: number
|
||||||
|
|
@ -44,6 +53,9 @@ export interface ContractVO {
|
||||||
totalPrice: number
|
totalPrice: number
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
contractAAuthorizedCompanys? : ContractAAuthorizedCompanyVO[]
|
||||||
|
contractAAuthorizedPersons? : ContractAAuthorizedPersonVO[]
|
||||||
|
contractBAuthorizedPersons? : ContractBAuthorizedPersonVO[]
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询 CRM 合同列表
|
// 查询 CRM 合同列表
|
||||||
|
|
@ -112,3 +124,30 @@ export const getAuditContractCount = async () => {
|
||||||
export const getRemindContractCount = async () => {
|
export const getRemindContractCount = async () => {
|
||||||
return await request.get({ url: '/crm/contract/remind-count' })
|
return await request.get({ url: '/crm/contract/remind-count' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(CRM 合同产品关联) ====================
|
||||||
|
|
||||||
|
// 获得CRM 合同产品关联列表
|
||||||
|
export const getContractProductListByContractId = async (contractId) => {
|
||||||
|
return await request.get({ url: `/crm/contract/contract-product/list-by-contract-id?contractId=` + contractId })
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(合同甲方关联单位) ====================
|
||||||
|
|
||||||
|
// 获得合同甲方关联单位列表
|
||||||
|
export const getContractAAuthorizedCompanyListByContractId = async (contractId) => {
|
||||||
|
return await request.get({ url: `/crm/contract/contract-A-authorized-company/list-by-contract-id?contractId=` + contractId })
|
||||||
|
}
|
||||||
|
// ==================== 子表(合同甲方授权人信息) ====================
|
||||||
|
|
||||||
|
// 获得合同甲方授权人信息列表
|
||||||
|
export const getContractAAuthorizedPersonListByContractId = async (contractId) => {
|
||||||
|
return await request.get({ url: `/crm/contract/contract-A-authorized-person/list-by-contract-id?contractId=` + contractId })
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(合同乙方授权人信息) ====================
|
||||||
|
|
||||||
|
// 获得合同乙方授权人信息列表
|
||||||
|
export const getContractBAuthorizedPersonListByContractId = async (contractId) => {
|
||||||
|
return await request.get({ url: `/crm/contract/contract-B-authorized-person/list-by-contract-id?contractId=` + contractId })
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 合同甲方关联单位 VO
|
||||||
|
export interface ContractAAuthorizedCompanyVO {
|
||||||
|
id: number // ID
|
||||||
|
contractId: number // 合同ID
|
||||||
|
customerName: string // 单位名称
|
||||||
|
unifiedCreditCode: string // 统一社会信用代码
|
||||||
|
invoicingAddress: string // 开票地址
|
||||||
|
invoicingTelephone: string // 开票电话
|
||||||
|
companyBank: string // 开户行
|
||||||
|
companyAccount: string // 开户账号
|
||||||
|
companyAddress: string // 通讯地址
|
||||||
|
deleted: number // 删除标记:1-正常,-1-已删除
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同甲方关联单位 API
|
||||||
|
export const ContractAAuthorizedCompanyApi = {
|
||||||
|
// 查询合同甲方关联单位分页
|
||||||
|
getContractAAuthorizedCompanyPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/crm/contract-A-authorized-company/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询合同甲方关联单位详情
|
||||||
|
getContractAAuthorizedCompany: async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/contract-A-authorized-company/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增合同甲方关联单位
|
||||||
|
createContractAAuthorizedCompany: async (data: ContractAAuthorizedCompanyVO) => {
|
||||||
|
return await request.post({ url: `/crm/contract-A-authorized-company/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改合同甲方关联单位
|
||||||
|
updateContractAAuthorizedCompany: async (data: ContractAAuthorizedCompanyVO) => {
|
||||||
|
return await request.put({ url: `/crm/contract-A-authorized-company/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除合同甲方关联单位
|
||||||
|
deleteContractAAuthorizedCompany: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/crm/contract-A-authorized-company/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出合同甲方关联单位 Excel
|
||||||
|
exportContractAAuthorizedCompany: async (params) => {
|
||||||
|
return await request.download({ url: `/crm/contract-A-authorized-company/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 合同甲方授权人信息 VO
|
||||||
|
export interface ContractAAuthorizedPersonVO {
|
||||||
|
id: number // ID
|
||||||
|
contractId: number // 合同ID
|
||||||
|
customerContactId: number // 客户联系人ID
|
||||||
|
customerName: string // 姓名
|
||||||
|
authPersonType: number // 授权人类型
|
||||||
|
phoneNumber: string // 手机号
|
||||||
|
wechat: string // 微信号
|
||||||
|
idNumber: string // 身份证号
|
||||||
|
email: string // 电子邮箱
|
||||||
|
deleted: number // 删除标记:1-正常,-1-已删除
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同甲方授权人信息 API
|
||||||
|
export const ContractAAuthorizedPersonApi = {
|
||||||
|
// 查询合同甲方授权人信息分页
|
||||||
|
getContractAAuthorizedPersonPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/crm/contract-A-authorized-person/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询合同甲方授权人信息详情
|
||||||
|
getContractAAuthorizedPerson: async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/contract-A-authorized-person/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增合同甲方授权人信息
|
||||||
|
createContractAAuthorizedPerson: async (data: ContractAAuthorizedPersonVO) => {
|
||||||
|
return await request.post({ url: `/crm/contract-A-authorized-person/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改合同甲方授权人信息
|
||||||
|
updateContractAAuthorizedPerson: async (data: ContractAAuthorizedPersonVO) => {
|
||||||
|
return await request.put({ url: `/crm/contract-A-authorized-person/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除合同甲方授权人信息
|
||||||
|
deleteContractAAuthorizedPerson: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/crm/contract-A-authorized-person/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出合同甲方授权人信息 Excel
|
||||||
|
exportContractAAuthorizedPerson: async (params) => {
|
||||||
|
return await request.download({ url: `/crm/contract-A-authorized-person/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 合同乙方授权人信息 VO
|
||||||
|
export interface ContractBAuthorizedPersonVO {
|
||||||
|
id: number // ID
|
||||||
|
contractId: number // 合同ID
|
||||||
|
userId: number // 用户ID
|
||||||
|
name: string // 姓名
|
||||||
|
authType: number // 类别:商旅负责人、技术负责人、服务对接人
|
||||||
|
postId: number // 岗位
|
||||||
|
userRank: number // 职级
|
||||||
|
authDesc: string // 权限说明
|
||||||
|
phoneNumber: string // 手机号
|
||||||
|
wechat: string // 微信号
|
||||||
|
email: string // 电子邮箱
|
||||||
|
deleted: number // 删除标记:1-正常,-1-已删除
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同乙方授权人信息 API
|
||||||
|
export const ContractBAuthorizedPersonApi = {
|
||||||
|
// 查询合同乙方授权人信息分页
|
||||||
|
getContractBAuthorizedPersonPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/crm/contract-B-authorized-person/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询合同乙方授权人信息详情
|
||||||
|
getContractBAuthorizedPerson: async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/contract-B-authorized-person/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增合同乙方授权人信息
|
||||||
|
createContractBAuthorizedPerson: async (data: ContractBAuthorizedPersonVO) => {
|
||||||
|
return await request.post({ url: `/crm/contract-B-authorized-person/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改合同乙方授权人信息
|
||||||
|
updateContractBAuthorizedPerson: async (data: ContractBAuthorizedPersonVO) => {
|
||||||
|
return await request.put({ url: `/crm/contract-B-authorized-person/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除合同乙方授权人信息
|
||||||
|
deleteContractBAuthorizedPerson: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/crm/contract-B-authorized-person/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出合同乙方授权人信息 Excel
|
||||||
|
exportContractBAuthorizedPerson: async (params) => {
|
||||||
|
return await request.download({ url: `/crm/contract-B-authorized-person/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,9 @@ export interface ProductVO {
|
||||||
price: number
|
price: number
|
||||||
status: number
|
status: number
|
||||||
categoryId: number
|
categoryId: number
|
||||||
|
offlinePrice: number
|
||||||
|
onlinePrice: number
|
||||||
|
totalPrice: number
|
||||||
categoryName?: string
|
categoryName?: string
|
||||||
description: string
|
description: string
|
||||||
ownerUserId: number
|
ownerUserId: number
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// CRM 方案报价 VO
|
||||||
|
export interface QuotationVO {
|
||||||
|
no: string // 报价单编号
|
||||||
|
customerId: number // 客户id
|
||||||
|
businessId: number // 商机编号
|
||||||
|
invoiceTemplateId: number // 票据模板Id
|
||||||
|
processInstanceId: string // 工作流编号
|
||||||
|
auditStatus: number // 审批状态
|
||||||
|
ownerUserId: number // 商机负责人
|
||||||
|
expanderUserId: number // 拓展人
|
||||||
|
pricingUserId: number // 方案报价人
|
||||||
|
signUserId: number // 报价签约人
|
||||||
|
signPhoneNumber: number // 签约人联系电话
|
||||||
|
signEmail: string // 签约人Email
|
||||||
|
signWechat: string // 签约人微信
|
||||||
|
startTime: Date // 开始时间
|
||||||
|
totalPrice: number // 合同总金额
|
||||||
|
paymentTerm: string // 账期
|
||||||
|
creditMethod: number // 授信方式
|
||||||
|
creditCalcCycle: number // 授信计算周期
|
||||||
|
creditLimit: number // 授信额度
|
||||||
|
partnerCompanyId: number // 合作主体 关联部门id
|
||||||
|
deptId: number // 归属部门Id
|
||||||
|
creator: string // 创建者
|
||||||
|
createTime: Date // 创建时间
|
||||||
|
updater: string // 更新者
|
||||||
|
}
|
||||||
|
|
||||||
|
// CRM 方案报价 API
|
||||||
|
export const QuotationApi = {
|
||||||
|
// 查询CRM 方案报价分页
|
||||||
|
getQuotationPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/crm/quotation/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询CRM 方案报价详情
|
||||||
|
getQuotation: async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/quotation/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获得 CRM 方案列表(精简)
|
||||||
|
getSimpleQuotationList : async () => {
|
||||||
|
return await request.get({ url: `/crm/quotation/simple-all-list` })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增CRM 方案报价
|
||||||
|
createQuotation: async (data: QuotationVO) => {
|
||||||
|
return await request.post({ url: `/crm/quotation/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改CRM 方案报价
|
||||||
|
updateQuotation: async (data: QuotationVO) => {
|
||||||
|
return await request.put({ url: `/crm/quotation/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除CRM 方案报价
|
||||||
|
deleteQuotation: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/crm/quotation/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出CRM 方案报价 Excel
|
||||||
|
exportQuotation: async (params) => {
|
||||||
|
return await request.download({ url: `/crm/quotation/export-excel`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// ==================== 子表(CRM 报价产品关联) ====================
|
||||||
|
|
||||||
|
// 获得CRM 报价产品关联列表
|
||||||
|
getQuotationProductListByQuotationId: async (quotationId) => {
|
||||||
|
return await request.get({ url: `/crm/quotation/quotation-product/list-by-quotation-id?quotationId=` + quotationId })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -212,6 +212,11 @@ export enum DICT_TYPE {
|
||||||
CRM_PERMISSION_LEVEL = 'crm_permission_level', // CRM 数据权限的级别
|
CRM_PERMISSION_LEVEL = 'crm_permission_level', // CRM 数据权限的级别
|
||||||
CRM_PRODUCT_UNIT = 'crm_product_unit', // CRM 产品单位
|
CRM_PRODUCT_UNIT = 'crm_product_unit', // CRM 产品单位
|
||||||
CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type', // CRM 跟进方式
|
CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type', // CRM 跟进方式
|
||||||
|
CRM_PRODUCT_INVOICE='crm_product_invoice',// 产品票据
|
||||||
|
CRM_PRODUCT_INVOICE_ITEMS='crm_product_invoice_items',// 产品开票项目
|
||||||
|
CRM_SERVICE_FEE_INVOICE='crm_service_fee_invoice',// 服务费票据
|
||||||
|
CRM_SERVICE_FEE_INVOICE_ITEMS='crm_service_fee_invoice_items',// 服务费开票项目
|
||||||
|
|
||||||
CRM_PRODUCT_CATEGORY = "crm_product_category", //CRM 产品类型
|
CRM_PRODUCT_CATEGORY = "crm_product_category", //CRM 产品类型
|
||||||
CRM_PRODUCT_DETAIL_TYPE = "crm_product_detail_type", //CRM 产品明细类型
|
CRM_PRODUCT_DETAIL_TYPE = "crm_product_detail_type", //CRM 产品明细类型
|
||||||
CRM_COOPERATION_TYPE = "crm_cooperation_type", //CRM 合作类型
|
CRM_COOPERATION_TYPE = "crm_cooperation_type", //CRM 合作类型
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="formData.status" 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-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||||
|
|
||||||
|
/** 票据模版 表单 */
|
||||||
|
defineOptions({ name: 'BillTemplateForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
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,
|
||||||
|
status: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await BillTemplateApi.getBillTemplate(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as BillTemplateVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await BillTemplateApi.createBillTemplate(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await BillTemplateApi.updateBillTemplate(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
status: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,210 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="票据模板名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="请选择模板状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<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-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.createTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-220px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['crm:bill-template:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['crm:bill-template:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<!-- <el-table-column label="主键" align="center" prop="id" /> -->
|
||||||
|
<el-table-column label="名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status" >
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建人" align="center" prop="creator" />
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['crm:bill-template:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['crm:bill-template:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<BillTemplateForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||||
|
import BillTemplateForm from './BillTemplateForm.vue'
|
||||||
|
|
||||||
|
/** 票据模版 列表 */
|
||||||
|
defineOptions({ name: 'BillTemplate' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<BillTemplateVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
status: undefined,
|
||||||
|
createTime: [],
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await BillTemplateApi.getBillTemplatePage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await BillTemplateApi.deleteBillTemplate(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await BillTemplateApi.exportBillTemplate(queryParams)
|
||||||
|
download.excel(data, '票据模版.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,160 @@
|
||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="120px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="票据模版ID" prop="billTemplateId">
|
||||||
|
<el-input v-model="formData.billTemplateId" placeholder="请输入票据模版ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品ID" prop="productId">
|
||||||
|
<el-input v-model="formData.productId" placeholder="请输入产品ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品票据" prop="productInvoice">
|
||||||
|
<el-select v-model="formData.status" clearable placeholder="请选择产品票据">
|
||||||
|
<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 label="产品开票项目" prop="productInvoiceItems">
|
||||||
|
<el-select v-model="formData.status" clearable placeholder="请选择产品开票项目">
|
||||||
|
<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 label="服务费票据" prop="serviceFeeInvoice">
|
||||||
|
<el-select v-model="formData.status" clearable placeholder="请选择服务费票据">
|
||||||
|
<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 label="服务费开票项目" prop="serviceFeeInvoiceItems">
|
||||||
|
<el-select v-model="formData.status" clearable placeholder="请选择服务费开票项目">
|
||||||
|
<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 label="状态" prop="status">
|
||||||
|
<el-select v-model="formData.status" clearable placeholder="请选择状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { BillTemplateProductApi, BillTemplateProductVO } from '@/api/crm/billtemplateproduct'
|
||||||
|
|
||||||
|
/** 票据模版产品关联 表单 */
|
||||||
|
defineOptions({ name: 'BillTemplateProductForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
billTemplateId: undefined,
|
||||||
|
productId: undefined,
|
||||||
|
productInvoice: undefined,
|
||||||
|
productInvoiceItems: undefined,
|
||||||
|
serviceFeeInvoice: undefined,
|
||||||
|
serviceFeeInvoiceItems: undefined,
|
||||||
|
status: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
billTemplateId: [{ required: true, message: '票据模版ID不能为空', trigger: 'blur' }],
|
||||||
|
productId: [{ required: true, message: '产品ID不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await BillTemplateProductApi.getBillTemplateProduct(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as BillTemplateProductVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await BillTemplateProductApi.createBillTemplateProduct(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await BillTemplateProductApi.updateBillTemplateProduct(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
billTemplateId: undefined,
|
||||||
|
productId: undefined,
|
||||||
|
productInvoice: undefined,
|
||||||
|
productInvoiceItems: undefined,
|
||||||
|
serviceFeeInvoice: undefined,
|
||||||
|
serviceFeeInvoiceItems: undefined,
|
||||||
|
status: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,210 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="票据模版名称" prop="billTemplateId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.billTemplateId"
|
||||||
|
placeholder="请输入票据模版名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="请选择状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['crm:bill-template-product:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['crm:bill-template-product:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="序号" align="center" prop="id" />
|
||||||
|
<!-- <el-table-column label="票据模版ID" align="center" prop="billTemplateId" /> -->
|
||||||
|
<!-- <el-table-column label="产品ID" align="center" prop="productId" /> -->
|
||||||
|
<el-table-column label="产品名称" align="center" prop="productId" />
|
||||||
|
<el-table-column label="产品分类" align="center" prop="productId" />
|
||||||
|
<el-table-column label="产品明细分类" align="center" prop="productId" />
|
||||||
|
<el-table-column label="单位" align="center" prop="productId" />
|
||||||
|
|
||||||
|
<el-table-column label="产品票据" align="center" prop="productInvoice" />
|
||||||
|
<el-table-column label="产品开票项目" align="center" prop="productInvoiceItems" />
|
||||||
|
<el-table-column label="服务费票据" align="center" prop="serviceFeeInvoice" />
|
||||||
|
<el-table-column label="服务费开票项目" align="center" prop="serviceFeeInvoiceItems" />
|
||||||
|
<!-- <el-table-column label="状态" align="center" prop="status" /> -->
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['crm:bill-template-product:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['crm:bill-template-product:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<BillTemplateProductForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { BillTemplateProductApi, BillTemplateProductVO } from '@/api/crm/billtemplateproduct'
|
||||||
|
import BillTemplateProductForm from './BillTemplateProductForm.vue'
|
||||||
|
|
||||||
|
/** 票据模版产品关联 列表 */
|
||||||
|
defineOptions({ name: 'BillTemplateProduct' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<BillTemplateProductVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
billTemplateId: undefined,
|
||||||
|
productId: undefined,
|
||||||
|
productInvoice: undefined,
|
||||||
|
productInvoiceItems: undefined,
|
||||||
|
serviceFeeInvoice: undefined,
|
||||||
|
serviceFeeInvoiceItems: undefined,
|
||||||
|
status: undefined,
|
||||||
|
createTime: [],
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await BillTemplateProductApi.getBillTemplateProductPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await BillTemplateProductApi.deleteBillTemplateProduct(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await BillTemplateProductApi.exportBillTemplateProduct(queryParams)
|
||||||
|
download.excel(data, '票据模版产品关联.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
@ -18,6 +18,24 @@
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.ownerUserId"
|
v-model="formData.ownerUserId"
|
||||||
:disabled="formType !== 'create'"
|
:disabled="formType !== 'create'"
|
||||||
|
placeholder="请选择负责人"
|
||||||
|
class="w-1/1"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in userOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.nickname"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="需求提交人" prop="requestorUserId">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.requestorUserId"
|
||||||
|
:disabled="formType !== 'create'"
|
||||||
|
placeholder="请选择需求提交人"
|
||||||
class="w-1/1"
|
class="w-1/1"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
|
|
@ -46,6 +64,20 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="归属部门" prop="deptId">
|
||||||
|
<el-tree-select
|
||||||
|
v-model="formData.deptId"
|
||||||
|
:data="deptTree"
|
||||||
|
:props="defaultProps"
|
||||||
|
filterable
|
||||||
|
check-strictly
|
||||||
|
node-key="id"
|
||||||
|
placeholder="请选择归属部门"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
@ -77,6 +109,76 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="销售阶段" prop="saleStage">
|
||||||
|
<el-select v-model="formData.saleStage" placeholder="请选择销售阶段">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions('sale_stage')"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="账期" prop="paymentTerm">
|
||||||
|
<el-select v-model="formData.paymentTerm" placeholder="请选择账期">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions('payment_term')"
|
||||||
|
: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="creditMethod">
|
||||||
|
<el-select v-model="formData.creditMethod" placeholder="请选择授信方式">
|
||||||
|
<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="请选择授信计算周期">
|
||||||
|
<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="请输入授信额度" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="是否技术需求支持" prop="techSupport">
|
||||||
|
<el-radio-group v-model="formData.techSupport">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in getBoolDictOptions('tech_support')"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<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" placeholder="请输入备注" />
|
||||||
|
|
@ -97,32 +199,28 @@
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="产品总金额" prop="totalProductPrice">
|
<el-form-item label="线上总金额" prop="onlinePrice">
|
||||||
<el-input
|
<el-input
|
||||||
disabled
|
disabled
|
||||||
v-model="formData.totalProductPrice"
|
v-model="formData.onlinePrice"
|
||||||
:formatter="erpPriceInputFormatter"
|
:formatter="erpPriceInputFormatter"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="整单折扣(%)" prop="discountPercent">
|
<el-form-item label="线下总金额" prop="offlinePrice">
|
||||||
<el-input-number
|
<el-input
|
||||||
v-model="formData.discountPercent"
|
disabled
|
||||||
placeholder="请输入整单折扣"
|
v-model="formData.offlinePrice"
|
||||||
controls-position="right"
|
:formatter="erpPriceInputFormatter"
|
||||||
:min="0"
|
|
||||||
:precision="2"
|
|
||||||
class="!w-1/1"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="折扣后金额" prop="price">
|
<el-form-item label="总金额" prop="totalPrice">
|
||||||
<el-input
|
<el-input
|
||||||
disabled
|
disabled
|
||||||
v-model="formData.totalPrice"
|
v-model="formData.totalPrice"
|
||||||
placeholder="请输入商机金额"
|
|
||||||
:formatter="erpPriceInputFormatter"
|
:formatter="erpPriceInputFormatter"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -136,13 +234,17 @@
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
import * as BusinessStatusApi from '@/api/crm/business/status'
|
import * as BusinessStatusApi from '@/api/crm/business/status'
|
||||||
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 { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
import BusinessProductForm from './components/BusinessProductForm.vue'
|
import BusinessProductForm from './components/BusinessProductForm.vue'
|
||||||
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
||||||
|
const deptTree = ref() // 部门树形结构
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
@ -155,16 +257,26 @@ const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
customerId: undefined,
|
customerId: undefined,
|
||||||
|
followUpStatus: undefined,
|
||||||
|
contactLastTime: undefined,
|
||||||
|
contactNextTime: undefined,
|
||||||
ownerUserId: undefined,
|
ownerUserId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
requestorUserId: undefined,
|
||||||
statusTypeId: undefined,
|
statusTypeId: undefined,
|
||||||
|
statusId: undefined,
|
||||||
|
endStatus: undefined,
|
||||||
dealTime: undefined,
|
dealTime: undefined,
|
||||||
discountPercent: 0,
|
onlinePrice: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
totalProductPrice: undefined,
|
totalProductPrice: undefined,
|
||||||
totalPrice: undefined,
|
totalPrice: undefined,
|
||||||
remark: undefined,
|
saleStage: undefined,
|
||||||
products: [],
|
paymentTerm: undefined,
|
||||||
contactId: undefined,
|
creditMethod: undefined,
|
||||||
customerDefault: false
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
techSupport: undefined
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
name: [{ required: true, message: '商机名称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '商机名称不能为空', trigger: 'blur' }],
|
||||||
|
|
@ -188,15 +300,12 @@ watch(
|
||||||
if (!val) {
|
if (!val) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const totalProductPrice = val.products.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
const totalOnlinePrice = val.products.reduce((prev, curr) => prev + curr.onlinePrice, 0)
|
||||||
const discountPrice =
|
const totalOfflinePrice = val.products.reduce((prev, curr) => prev + curr.offlinePrice, 0)
|
||||||
val.discountPercent != null
|
|
||||||
? erpPriceMultiply(totalProductPrice, val.discountPercent / 100.0)
|
|
||||||
: 0
|
|
||||||
const totalPrice = totalProductPrice - discountPrice
|
|
||||||
// 赋值
|
// 赋值
|
||||||
formData.value.totalProductPrice = totalProductPrice
|
formData.value.onlinePrice = totalOnlinePrice
|
||||||
formData.value.totalPrice = totalPrice
|
formData.value.offlinePrice = totalOfflinePrice
|
||||||
|
formData.value.totalPrice = totalOnlinePrice + totalOfflinePrice
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
)
|
)
|
||||||
|
|
@ -231,6 +340,8 @@ const open = async (type: string, id?: number, customerId?: number, contactId?:
|
||||||
statusTypeList.value = await BusinessStatusApi.getBusinessStatusTypeSimpleList()
|
statusTypeList.value = await BusinessStatusApi.getBusinessStatusTypeSimpleList()
|
||||||
// 获得用户列表
|
// 获得用户列表
|
||||||
userOptions.value = await UserApi.getSimpleUserList()
|
userOptions.value = await UserApi.getSimpleUserList()
|
||||||
|
// 获得部门树
|
||||||
|
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||||
// 默认新建时选中自己
|
// 默认新建时选中自己
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
formData.value.ownerUserId = useUserStore().getUser.id
|
formData.value.ownerUserId = useUserStore().getUser.id
|
||||||
|
|
@ -274,10 +385,7 @@ const resetForm = () => {
|
||||||
ownerUserId: undefined,
|
ownerUserId: undefined,
|
||||||
statusTypeId: undefined,
|
statusTypeId: undefined,
|
||||||
dealTime: undefined,
|
dealTime: undefined,
|
||||||
discountPercent: 0,
|
|
||||||
totalProductPrice: undefined,
|
|
||||||
totalPrice: undefined,
|
totalPrice: undefined,
|
||||||
remark: undefined,
|
|
||||||
products: [],
|
products: [],
|
||||||
contactId: undefined,
|
contactId: undefined,
|
||||||
customerDefault: false
|
customerDefault: false
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,13 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="产品分类" min-width="150">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-form-item class="mb-0px!">
|
||||||
|
<el-input disabled v-model="row.productCategoryId" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="条码" min-width="150">
|
<el-table-column label="条码" min-width="150">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-form-item class="mb-0px!">
|
<el-form-item class="mb-0px!">
|
||||||
|
|
@ -42,18 +49,11 @@
|
||||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="row.productUnit" />
|
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="row.productUnit" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="价格(元)" min-width="120">
|
<el-table-column label="线上价格(元)" fixed="right" min-width="140">
|
||||||
<template #default="{ row }">
|
|
||||||
<el-form-item class="mb-0px!">
|
|
||||||
<el-input disabled v-model="row.productPrice" :formatter="erpPriceInputFormatter" />
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="售价(元)" fixed="right" min-width="140">
|
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.businessPrice`" class="mb-0px!">
|
<el-form-item :prop="`${$index}.onlinePrice`" class="mb-0px!">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="row.businessPrice"
|
v-model="row.onlinePrice"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:min="0.001"
|
:min="0.001"
|
||||||
:precision="2"
|
:precision="2"
|
||||||
|
|
@ -62,14 +62,14 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="数量" prop="count" fixed="right" min-width="120">
|
<el-table-column label="线下价格(元)" fixed="right" min-width="140">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.count`" :rules="formRules.count" class="mb-0px!">
|
<el-form-item :prop="`${$index}.offlinePrice`" class="mb-0px!">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="row.count"
|
v-model="row.offlinePrice"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:min="0.001"
|
:min="0.001"
|
||||||
:precision="3"
|
:precision="2"
|
||||||
class="!w-100%"
|
class="!w-100%"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -130,10 +130,10 @@ watch(
|
||||||
}
|
}
|
||||||
// 循环处理
|
// 循环处理
|
||||||
val.forEach((item) => {
|
val.forEach((item) => {
|
||||||
if (item.businessPrice != null && item.count != null) {
|
if (item.offlinePrice != null && item.onlinePrice != null) {
|
||||||
item.totalPrice = erpPriceMultiply(item.businessPrice, item.count)
|
item.totalPrice = item.offlinePrice + item.onlinePrice
|
||||||
} else {
|
} else {
|
||||||
item.totalPrice = undefined
|
item.totalPrice = 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -145,9 +145,14 @@ const handleAdd = () => {
|
||||||
const row = {
|
const row = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
productId: undefined,
|
productId: undefined,
|
||||||
|
productName: undefined,
|
||||||
|
productCategoryId: undefined, //产品分类编号
|
||||||
productUnit: undefined, // 产品单位
|
productUnit: undefined, // 产品单位
|
||||||
productNo: undefined, // 产品条码
|
productNo: undefined, // 产品条码
|
||||||
productPrice: undefined, // 产品价格
|
productPrice: undefined, // 产品价格
|
||||||
|
onlinePrice: undefined, // 产品价格
|
||||||
|
offlinePrice: undefined, // 产品价格
|
||||||
|
totalPrice: undefined,
|
||||||
businessPrice: undefined,
|
businessPrice: undefined,
|
||||||
count: 1
|
count: 1
|
||||||
}
|
}
|
||||||
|
|
@ -163,7 +168,13 @@ const handleDelete = (index: number) => {
|
||||||
const onChangeProduct = (productId, row) => {
|
const onChangeProduct = (productId, row) => {
|
||||||
const product = productList.value.find((item) => item.id === productId)
|
const product = productList.value.find((item) => item.id === productId)
|
||||||
if (product) {
|
if (product) {
|
||||||
|
row.productId = product.id
|
||||||
|
row.productName = product.name
|
||||||
|
row.productCategoryId = 1
|
||||||
row.productUnit = product.unit
|
row.productUnit = product.unit
|
||||||
|
row.onlinePrice = product.onlinePrice
|
||||||
|
row.offlinePrice = product.offlinePrice
|
||||||
|
row.totalPrice = product.totalPrice
|
||||||
row.productNo = product.no
|
row.productNo = product.no
|
||||||
row.productPrice = product.price
|
row.productPrice = product.price
|
||||||
row.businessPrice = product.price
|
row.businessPrice = product.price
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,8 @@
|
||||||
/>
|
/>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-row class="mt-10px" justify="end">
|
<el-row class="mt-10px" justify="end">
|
||||||
<el-col :span="3"> 整单折扣:{{ erpPriceInputFormatter(business.discountPercent) }}% </el-col>
|
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
产品总金额:{{ erpPriceInputFormatter(business.totalProductPrice) }} 元
|
总金额:{{ erpPriceInputFormatter(business.totalPrice) }} 元
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<doc-alert title="【商机】商机管理、商机状态" url="https://doc.iocoder.cn/crm/business/" />
|
|
||||||
<doc-alert title="【通用】数据权限" url="https://doc.iocoder.cn/crm/permission/" />
|
|
||||||
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<el-form
|
<el-form
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="合同编号" prop="no">
|
<el-form-item label="合同编号" prop="no">
|
||||||
<el-input disabled v-model="formData.no" placeholder="保存时自动生成" />
|
<el-input v-model="formData.no" placeholder="请输入合同编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
@ -18,34 +18,35 @@
|
||||||
<el-input v-model="formData.name" placeholder="请输入合同名称" />
|
<el-input v-model="formData.name" placeholder="请输入合同名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="负责人" prop="ownerUserId">
|
<el-form-item label="报价单编号" prop="quotationId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.ownerUserId"
|
@change="handleQuotationChange"
|
||||||
:disabled="formType !== 'create'"
|
v-model="formData.quotationId"
|
||||||
class="w-1/1"
|
class="w-1/1"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userOptions"
|
v-for="item in quotationList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.nickname"
|
:label="item.no"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</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
|
<el-select
|
||||||
v-model="formData.customerId"
|
v-model="formData.customerId"
|
||||||
|
disabled=""
|
||||||
placeholder="请选择客户"
|
placeholder="请选择客户"
|
||||||
class="w-1/1"
|
class="w-1/1"
|
||||||
@change="handleCustomerChange"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in customerList"
|
v-for="item in contactList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
|
|
@ -53,91 +54,286 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="商机名称" prop="businessId">
|
|
||||||
<el-select
|
|
||||||
@change="handleBusinessChange"
|
|
||||||
:disabled="!formData.customerId"
|
|
||||||
v-model="formData.businessId"
|
|
||||||
class="w-1/1"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in getBusinessOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id!"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="下单日期" prop="orderDate">
|
<el-form-item label="合同签订日期" prop="startTime">
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.orderDate"
|
|
||||||
placeholder="选择下单日期"
|
|
||||||
type="date"
|
|
||||||
value-format="x"
|
|
||||||
class="!w-1/1"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="开始时间" prop="startTime">
|
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.startTime"
|
v-model="formData.startTime"
|
||||||
placeholder="选择开始时间"
|
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
class="!w-1/1"
|
placeholder="选择合同签订日期"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<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"
|
||||||
placeholder="选择结束时间"
|
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
class="!w-1/1"
|
placeholder="选择合同结束时间"
|
||||||
/>
|
/>
|
||||||
</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="signUserId">
|
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||||
<el-select v-model="formData.signUserId" class="w-1/1">
|
<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" placeholder="请输入违约金比例" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="延期付款利率" prop="latePaymentRate">
|
||||||
|
<el-input v-model="formData.latePaymentRate" placeholder="请输入延期付款利率" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="财务结算方式" prop="settleMethod">
|
||||||
|
<el-select v-model="formData.settleMethod" placeholder="请选择财务结算方式">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userOptions"
|
v-for="dict in getIntDictOptions('settle_method')"
|
||||||
:key="item.id"
|
:key="dict.value"
|
||||||
:label="item.nickname"
|
:label="dict.label"
|
||||||
:value="item.id!"
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="最晚付款日期" prop="lastPayDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.lastPayDate"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择最晚付款日期"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合同期限(月)" prop="contractTerm">
|
||||||
|
<el-input v-model="formData.contractTerm" 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-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="客户签约人" prop="signContactId">
|
<el-form-item label="拓展人" prop="expanderUserId">
|
||||||
<el-select
|
<el-select v-model="formData.expanderUserId" placeholder="请选择拓展人" disabled>
|
||||||
v-model="formData.signContactId"
|
|
||||||
:disabled="!formData.customerId"
|
|
||||||
class="w-1/1"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in getContactOptions"
|
v-for="dict in userOptions"
|
||||||
:key="item.id"
|
:key="dict.id"
|
||||||
:label="item.name"
|
:label="dict.nickname"
|
||||||
:value="item.id"
|
:value="dict.id"
|
||||||
/>
|
/>
|
||||||
</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="remark">
|
<el-form-item label="方案报价人" prop="pricingUserId">
|
||||||
<el-input v-model="formData.remark" placeholder="请输入备注" type="textarea" />
|
<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" 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" 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-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<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-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||||
|
<el-select v-model="formData.partnerCompanyId" placeholder="请选择合作主体" disabled >
|
||||||
|
<el-option
|
||||||
|
v-for="dict in deptList"
|
||||||
|
: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" placeholder="请输入第几次报价" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同正文" prop="contractBody">
|
||||||
|
<el-input v-model="formData.contractBody" placeholder="请输入合同正文" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同补充协议" prop="contractAgreement">
|
||||||
|
<el-input v-model="formData.contractAgreement" 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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -151,41 +347,17 @@
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="合同甲方关联单位" name="contractAAuthorizedCompany">
|
||||||
|
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef" :contract-id="formData.id" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="合同甲方授权人信息" name="contractAAuthorizedPerson">
|
||||||
|
<ContractAAuthorizedPersonForm ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="合同乙方授权人信息" name="contractBAuthorizedPerson">
|
||||||
|
<ContractBAuthorizedPersonForm ref="contractBAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<el-row>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="产品总金额" prop="totalProductPrice">
|
|
||||||
<el-input
|
|
||||||
disabled
|
|
||||||
v-model="formData.totalProductPrice"
|
|
||||||
:formatter="erpPriceInputFormatter"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="整单折扣(%)" prop="discountPercent">
|
|
||||||
<el-input-number
|
|
||||||
v-model="formData.discountPercent"
|
|
||||||
placeholder="请输入整单折扣"
|
|
||||||
controls-position="right"
|
|
||||||
:min="0"
|
|
||||||
:precision="2"
|
|
||||||
class="!w-1/1"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="折扣后金额" prop="totalPrice">
|
|
||||||
<el-input
|
|
||||||
disabled
|
|
||||||
v-model="formData.totalPrice"
|
|
||||||
placeholder="请输入商机金额"
|
|
||||||
:formatter="erpPriceInputFormatter"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">保存</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">保存</el-button>
|
||||||
|
|
@ -194,14 +366,18 @@
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
import * as ContractApi from '@/api/crm/contract'
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
import * as UserApi from '@/api/system/user'
|
|
||||||
import * as ContactApi from '@/api/crm/contact'
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
import * as UserApi from '@/api/system/user'
|
||||||
|
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
||||||
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue'
|
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'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
@ -212,19 +388,40 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
no: undefined,
|
|
||||||
name: undefined,
|
name: undefined,
|
||||||
|
no: undefined,
|
||||||
customerId: undefined,
|
customerId: undefined,
|
||||||
businessId: undefined,
|
quotationId: undefined,
|
||||||
orderDate: undefined,
|
invoiceTemplateId: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
auditStatus: undefined,
|
||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime: undefined,
|
endTime: undefined,
|
||||||
|
penaltyRate: undefined,
|
||||||
|
latePaymentRate: undefined,
|
||||||
|
settleMethod: undefined,
|
||||||
|
lastPayDate: undefined,
|
||||||
|
contractTerm: undefined,
|
||||||
signUserId: undefined,
|
signUserId: undefined,
|
||||||
signContactId: undefined,
|
signPhoneNumber: undefined,
|
||||||
|
signEmail: undefined,
|
||||||
|
signWechat: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
|
onlinePrice: undefined,
|
||||||
ownerUserId: undefined,
|
ownerUserId: undefined,
|
||||||
discountPercent: 0,
|
expanderUserId: undefined,
|
||||||
totalProductPrice: undefined,
|
pricingUserId: undefined,
|
||||||
remark: undefined,
|
afterSaleUserId: undefined,
|
||||||
|
collUserId: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
contractBody: undefined,
|
||||||
|
contractAgreement: undefined,
|
||||||
|
creditMethod: undefined,
|
||||||
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
quotationTimes: undefined,
|
||||||
products: []
|
products: []
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
|
|
@ -236,12 +433,15 @@ const formRules = reactive({
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
const customerList = ref([]) // 客户列表的数据
|
const customerList = ref([]) // 客户列表的数据
|
||||||
const businessList = ref<BusinessApi.BusinessVO[]>([])
|
const quotationList = ref<QuotationVO[]>([])
|
||||||
const contactList = ref<ContactApi.ContactVO[]>([])
|
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||||
|
|
||||||
/** 子表的表单 */
|
/** 子表的表单 */
|
||||||
const subTabsName = ref('product')
|
const subTabsName = ref('product')
|
||||||
const productFormRef = ref()
|
const productFormRef = ref()
|
||||||
|
const contractAAuthorizedCompanyFormRef = ref()
|
||||||
|
const contractAAuthorizedPersonFormRef = ref()
|
||||||
|
const contractBAuthorizedPersonFormRef = ref()
|
||||||
|
|
||||||
/** 计算 discountPrice、totalPrice 价格 */
|
/** 计算 discountPrice、totalPrice 价格 */
|
||||||
watch(
|
watch(
|
||||||
|
|
@ -250,15 +450,9 @@ watch(
|
||||||
if (!val) {
|
if (!val) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const totalProductPrice = val.products.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
// const totalPrice = val.products.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
||||||
const discountPrice =
|
|
||||||
val.discountPercent != null
|
|
||||||
? erpPriceMultiply(totalProductPrice, val.discountPercent / 100.0)
|
|
||||||
: 0
|
|
||||||
const totalPrice = totalProductPrice - discountPrice
|
|
||||||
// 赋值
|
// 赋值
|
||||||
formData.value.totalProductPrice = totalProductPrice
|
// formData.value.totalPrice = totalPrice
|
||||||
formData.value.totalPrice = totalPrice
|
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
)
|
)
|
||||||
|
|
@ -282,14 +476,15 @@ const open = async (type: string, id?: number) => {
|
||||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
// 获得用户列表
|
// 获得用户列表
|
||||||
userOptions.value = await UserApi.getSimpleUserList()
|
userOptions.value = await UserApi.getSimpleUserList()
|
||||||
|
// 获得报价列表
|
||||||
|
quotationList.value = await QuotationApi.getSimpleQuotationList()
|
||||||
|
|
||||||
// 默认新建时选中自己
|
// 默认新建时选中自己
|
||||||
if (formType.value === 'create') {
|
// if (formType.value === 'create') {
|
||||||
formData.value.ownerUserId = useUserStore().getUser.id
|
// formData.value.ownerUserId = useUserStore().getUser.id
|
||||||
}
|
// }
|
||||||
// 获取联系人
|
// 获取联系人
|
||||||
contactList.value = await ContactApi.getSimpleContactList()
|
contactList.value = await ContactApi.getSimpleContactList()
|
||||||
// 获得商机列表
|
|
||||||
businessList.value = await BusinessApi.getSimpleBusinessList()
|
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
|
@ -305,6 +500,10 @@ const submitForm = async () => {
|
||||||
productFormRef.value.validate()
|
productFormRef.value.validate()
|
||||||
try {
|
try {
|
||||||
const data = unref(formData.value) as unknown as ContractApi.ContractVO
|
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 === 'create') {
|
if (formType.value === 'create') {
|
||||||
await ContractApi.createContract(data)
|
await ContractApi.createContract(data)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(t('common.createSuccess'))
|
||||||
|
|
@ -324,46 +523,115 @@ const submitForm = async () => {
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
no: undefined,
|
|
||||||
name: undefined,
|
name: undefined,
|
||||||
|
no: undefined,
|
||||||
customerId: undefined,
|
customerId: undefined,
|
||||||
businessId: undefined,
|
quotationId: undefined,
|
||||||
orderDate: undefined,
|
invoiceTemplateId: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
auditStatus: undefined,
|
||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime: undefined,
|
endTime: undefined,
|
||||||
|
penaltyRate: undefined,
|
||||||
|
latePaymentRate: undefined,
|
||||||
|
settleMethod: undefined,
|
||||||
|
lastPayDate: undefined,
|
||||||
|
contractTerm: undefined,
|
||||||
signUserId: undefined,
|
signUserId: undefined,
|
||||||
signContactId: undefined,
|
signPhoneNumber: undefined,
|
||||||
|
signEmail: undefined,
|
||||||
|
signWechat: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
|
onlinePrice: undefined,
|
||||||
ownerUserId: undefined,
|
ownerUserId: undefined,
|
||||||
discountPercent: 0,
|
expanderUserId: undefined,
|
||||||
totalProductPrice: undefined,
|
pricingUserId: undefined,
|
||||||
remark: undefined,
|
afterSaleUserId: undefined,
|
||||||
|
collUserId: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
contractBody: undefined,
|
||||||
|
contractAgreement: undefined,
|
||||||
|
creditMethod: undefined,
|
||||||
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
quotationTimes: undefined,
|
||||||
products: []
|
products: []
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理切换客户 */
|
|
||||||
const handleCustomerChange = () => {
|
|
||||||
formData.value.businessId = undefined
|
|
||||||
formData.value.signContactId = undefined
|
|
||||||
formData.value.products = []
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 处理商机变化 */
|
/** 处理商机变化 */
|
||||||
const handleBusinessChange = async (businessId: number) => {
|
const handleQuotationChange = async (quotationId: number) => {
|
||||||
const business = await BusinessApi.getBusiness(businessId)
|
if (!quotationId) return
|
||||||
business.products.forEach((item) => {
|
try {
|
||||||
item.contractPrice = item.businessPrice
|
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||||
})
|
formData.value.products = quotation.products;
|
||||||
formData.value.products = business.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(() =>
|
const getContactOptions = computed(() =>
|
||||||
contactList.value.filter((item) => item.customerId == formData.value.customerId)
|
contactList.value.filter((item) => item.customerId == formData.value.customerId)
|
||||||
)
|
)
|
||||||
/** 动态获取商机 */
|
|
||||||
const getBusinessOptions = computed(() =>
|
|
||||||
businessList.value.filter((item) => item.customerId == formData.value.customerId)
|
|
||||||
)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,145 @@
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
v-loading="formLoading"
|
||||||
|
label-width="0px"
|
||||||
|
:inline-message="true"
|
||||||
|
>
|
||||||
|
<el-table :data="formData" class="-mt-10px">
|
||||||
|
<el-table-column label="序号" type="index" width="100" />
|
||||||
|
<el-table-column label="单位名称" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.customerName`" :rules="formRules.customerName" class="mb-0px!">
|
||||||
|
<el-input v-model="row.customerName" placeholder="请输入单位名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="统一社会信用代码" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.unifiedCreditCode`" :rules="formRules.unifiedCreditCode" class="mb-0px!">
|
||||||
|
<el-input v-model="row.unifiedCreditCode" placeholder="请输入统一社会信用代码" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="开票地址" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.invoicingAddress`" :rules="formRules.invoicingAddress" class="mb-0px!">
|
||||||
|
<el-input v-model="row.invoicingAddress" placeholder="请输入开票地址" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="开票电话" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.invoicingTelephone`" :rules="formRules.invoicingTelephone" class="mb-0px!">
|
||||||
|
<el-input v-model="row.invoicingTelephone" placeholder="请输入开票电话" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="开户行" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.companyBank`" :rules="formRules.companyBank" class="mb-0px!">
|
||||||
|
<el-input v-model="row.companyBank" placeholder="请输入开户行" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="开户账号" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.companyAccount`" :rules="formRules.companyAccount" class="mb-0px!">
|
||||||
|
<el-input v-model="row.companyAccount" placeholder="请输入开户账号" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="通讯地址" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.companyAddress`" :rules="formRules.companyAddress" class="mb-0px!">
|
||||||
|
<el-input v-model="row.companyAddress" placeholder="请输入通讯地址" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
<el-row justify="center" class="mt-3">
|
||||||
|
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
contractId: undefined // 合同ID(主表的关联字段)
|
||||||
|
}>()
|
||||||
|
const formLoading = ref(false) // 表单的加载中
|
||||||
|
const formData = ref([])
|
||||||
|
const formRules = reactive({
|
||||||
|
contractId: [{ required: true, message: '合同ID不能为空', trigger: 'blur' }],
|
||||||
|
customerName: [{ required: true, message: '单位名称不能为空', trigger: 'blur' }],
|
||||||
|
unifiedCreditCode: [{ required: true, message: '统一社会信用代码不能为空', trigger: 'blur' }],
|
||||||
|
invoicingAddress: [{ required: true, message: '开票地址不能为空', trigger: 'blur' }],
|
||||||
|
invoicingTelephone: [{ required: true, message: '开票电话不能为空', trigger: 'blur' }],
|
||||||
|
companyBank: [{ required: true, message: '开户行不能为空', trigger: 'blur' }],
|
||||||
|
companyAccount: [{ required: true, message: '开户账号不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||||
|
watch(
|
||||||
|
() => props.contractId,
|
||||||
|
async (val) => {
|
||||||
|
// 1. 重置表单
|
||||||
|
formData.value = []
|
||||||
|
// 2. val 非空,则加载数据
|
||||||
|
if (!val) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
formLoading.value = true
|
||||||
|
formData.value = await ContractApi.getContractAAuthorizedCompanyListByContractId(val)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
const row = {
|
||||||
|
id: undefined,
|
||||||
|
contractId: undefined,
|
||||||
|
customerName: undefined,
|
||||||
|
unifiedCreditCode: undefined,
|
||||||
|
invoicingAddress: undefined,
|
||||||
|
invoicingTelephone: undefined,
|
||||||
|
companyBank: undefined,
|
||||||
|
companyAccount: undefined,
|
||||||
|
companyAddress: undefined,
|
||||||
|
deletedFlag: undefined
|
||||||
|
}
|
||||||
|
row.contractId = props.contractId
|
||||||
|
formData.value.push(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = (index) => {
|
||||||
|
formData.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单校验 */
|
||||||
|
const validate = () => {
|
||||||
|
return formRef.value.validate()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单值 */
|
||||||
|
const getData = () => {
|
||||||
|
return formData.value
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ validate, getData })
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,150 @@
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
v-loading="formLoading"
|
||||||
|
label-width="0px"
|
||||||
|
:inline-message="true"
|
||||||
|
>
|
||||||
|
<el-table :data="formData" class="-mt-10px">
|
||||||
|
<el-table-column label="序号" type="index" width="100" />
|
||||||
|
<el-table-column label="客户联系人ID" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.customerContactId`" :rules="formRules.customerContactId" class="mb-0px!">
|
||||||
|
<el-input v-model="row.customerContactId" placeholder="请输入客户联系人ID" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="姓名" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.customerName`" :rules="formRules.customerName" class="mb-0px!">
|
||||||
|
<el-input v-model="row.customerName" placeholder="请输入姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="授权人类型" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.authPersonType`" :rules="formRules.authPersonType" class="mb-0px!">
|
||||||
|
<el-select v-model="row.authPersonType" placeholder="请选择授权人类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions('auth_person_type')"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="手机号" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.phoneNumber`" :rules="formRules.phoneNumber" class="mb-0px!">
|
||||||
|
<el-input v-model="row.phoneNumber" placeholder="请输入手机号" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="微信号" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.wechat`" :rules="formRules.wechat" class="mb-0px!">
|
||||||
|
<el-input v-model="row.wechat" placeholder="请输入微信号" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="身份证号" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.idNumber`" :rules="formRules.idNumber" class="mb-0px!">
|
||||||
|
<el-input v-model="row.idNumber" placeholder="请输入身份证号" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="电子邮箱" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.email`" :rules="formRules.email" class="mb-0px!">
|
||||||
|
<el-input v-model="row.email" placeholder="请输入电子邮箱" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
<el-row justify="center" class="mt-3">
|
||||||
|
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
|
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
contractId: undefined // 合同ID(主表的关联字段)
|
||||||
|
}>()
|
||||||
|
const formLoading = ref(false) // 表单的加载中
|
||||||
|
const formData = ref([])
|
||||||
|
const formRules = reactive({
|
||||||
|
contractId: [{ required: true, message: '合同ID不能为空', trigger: 'blur' }],
|
||||||
|
customerContactId: [{ required: true, message: '客户联系人ID不能为空', trigger: 'blur' }],
|
||||||
|
customerName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
||||||
|
phoneNumber: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||||
|
watch(
|
||||||
|
() => props.contractId,
|
||||||
|
async (val) => {
|
||||||
|
// 1. 重置表单
|
||||||
|
formData.value = []
|
||||||
|
// 2. val 非空,则加载数据
|
||||||
|
if (!val) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
formLoading.value = true
|
||||||
|
formData.value = await ContractApi.getContractAAuthorizedPersonListByContractId(val)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
const row = {
|
||||||
|
id: undefined,
|
||||||
|
contractId: undefined,
|
||||||
|
customerContactId: undefined,
|
||||||
|
customerName: undefined,
|
||||||
|
authPersonType: undefined,
|
||||||
|
phoneNumber: undefined,
|
||||||
|
wechat: undefined,
|
||||||
|
idNumber: undefined,
|
||||||
|
email: undefined,
|
||||||
|
deletedFlag: undefined
|
||||||
|
}
|
||||||
|
row.contractId = props.contractId
|
||||||
|
formData.value.push(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = (index) => {
|
||||||
|
formData.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单校验 */
|
||||||
|
const validate = () => {
|
||||||
|
return formRef.value.validate()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单值 */
|
||||||
|
const getData = () => {
|
||||||
|
return formData.value
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ validate, getData })
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,166 @@
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
v-loading="formLoading"
|
||||||
|
label-width="0px"
|
||||||
|
:inline-message="true"
|
||||||
|
>
|
||||||
|
<el-table :data="formData" class="-mt-10px">
|
||||||
|
<el-table-column label="序号" type="index" width="100" />
|
||||||
|
<el-table-column label="用户ID" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.userId`" :rules="formRules.userId" class="mb-0px!">
|
||||||
|
<el-input v-model="row.userId" placeholder="请输入用户ID" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="姓名" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.name`" :rules="formRules.name" class="mb-0px!">
|
||||||
|
<el-input v-model="row.name" placeholder="请输入姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="类别" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.authType`" :rules="formRules.authType" class="mb-0px!">
|
||||||
|
<el-select v-model="row.authType" placeholder="请选择类别">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions('auth_type')"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="岗位" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.postId`" :rules="formRules.postId" class="mb-0px!">
|
||||||
|
<el-input v-model="row.postId" placeholder="请输入岗位" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="职级" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.userRank`" :rules="formRules.userRank" class="mb-0px!">
|
||||||
|
<el-input v-model="row.userRank" placeholder="请输入职级" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="权限说明" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.authDesc`" :rules="formRules.authDesc" class="mb-0px!">
|
||||||
|
<el-input v-model="row.authDesc" placeholder="请输入权限说明" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="手机号" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.phoneNumber`" :rules="formRules.phoneNumber" class="mb-0px!">
|
||||||
|
<el-input v-model="row.phoneNumber" placeholder="请输入手机号" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="微信号" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.wechat`" :rules="formRules.wechat" class="mb-0px!">
|
||||||
|
<el-input v-model="row.wechat" placeholder="请输入微信号" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="电子邮箱" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.email`" :rules="formRules.email" class="mb-0px!">
|
||||||
|
<el-input v-model="row.email" placeholder="请输入电子邮箱" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
<el-row justify="center" class="mt-3">
|
||||||
|
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
|
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
contractId: undefined // 合同ID(主表的关联字段)
|
||||||
|
}>()
|
||||||
|
const formLoading = ref(false) // 表单的加载中
|
||||||
|
const formData = ref([])
|
||||||
|
const formRules = reactive({
|
||||||
|
contractId: [{ required: true, message: '合同ID不能为空', trigger: 'blur' }],
|
||||||
|
userId: [{ required: true, message: '用户ID不能为空', trigger: 'blur' }],
|
||||||
|
name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
||||||
|
phoneNumber: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||||
|
watch(
|
||||||
|
() => props.contractId,
|
||||||
|
async (val) => {
|
||||||
|
// 1. 重置表单
|
||||||
|
formData.value = []
|
||||||
|
// 2. val 非空,则加载数据
|
||||||
|
if (!val) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
formLoading.value = true
|
||||||
|
formData.value = await ContractApi.getContractBAuthorizedPersonListByContractId(val)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
const row = {
|
||||||
|
id: undefined,
|
||||||
|
contractId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
name: undefined,
|
||||||
|
authType: undefined,
|
||||||
|
postId: undefined,
|
||||||
|
userRank: undefined,
|
||||||
|
authDesc: undefined,
|
||||||
|
phoneNumber: undefined,
|
||||||
|
wechat: undefined,
|
||||||
|
email: undefined,
|
||||||
|
deletedFlag: undefined
|
||||||
|
}
|
||||||
|
row.contractId = props.contractId
|
||||||
|
formData.value.push(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = (index) => {
|
||||||
|
formData.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单校验 */
|
||||||
|
const validate = () => {
|
||||||
|
return formRef.value.validate()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单值 */
|
||||||
|
const getData = () => {
|
||||||
|
return formData.value
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ validate, getData })
|
||||||
|
</script>
|
||||||
|
|
@ -8,77 +8,82 @@
|
||||||
:inline-message="true"
|
:inline-message="true"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
>
|
>
|
||||||
<el-table :data="formData" class="-mt-10px">
|
<el-table :data="formData" class="-mt-10px">
|
||||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
<el-table-column label="序号" type="index" width="100" />
|
||||||
<el-table-column label="产品名称" min-width="180">
|
<el-table-column label="产品编号" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
||||||
<el-select
|
<el-input v-model="row.productId" placeholder="请输入产品编号" disabled />
|
||||||
v-model="row.productId"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
@change="onChangeProduct($event, row)"
|
|
||||||
placeholder="请选择产品"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in productList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</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 }">
|
|
||||||
<el-form-item class="mb-0px!">
|
|
||||||
<el-input disabled v-model="row.productNo" />
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="单位" min-width="80">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="row.productUnit" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="价格(元)" min-width="120">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-form-item class="mb-0px!">
|
|
||||||
<el-input disabled v-model="row.productPrice" :formatter="erpPriceInputFormatter" />
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="售价(元)" fixed="right" min-width="140">
|
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.contractPrice`" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
||||||
<el-input-number
|
<el-input v-model="row.productName" placeholder="请输入产品名称" disabled />
|
||||||
v-model="row.contractPrice"
|
|
||||||
controls-position="right"
|
|
||||||
:min="0.001"
|
|
||||||
:precision="2"
|
|
||||||
class="!w-100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="数量" prop="count" fixed="right" min-width="120">
|
<el-table-column label="产品分类编号" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.count`" :rules="formRules.count" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productCategoryId`" :rules="formRules.productCategoryId" class="mb-0px!">
|
||||||
<el-input-number
|
<el-input v-model="row.productCategoryId" placeholder="请输入产品分类编号" disabled />
|
||||||
v-model="row.count"
|
|
||||||
controls-position="right"
|
|
||||||
:min="0.001"
|
|
||||||
:precision="3"
|
|
||||||
class="!w-100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="合计" prop="totalPrice" fixed="right" min-width="140">
|
<el-table-column label="产品单位" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.totalPrice`" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productUnit`" :rules="formRules.productUnit" class="mb-0px!">
|
||||||
<el-input disabled v-model="row.totalPrice" :formatter="erpPriceInputFormatter" />
|
<el-input v-model="row.productUnit" placeholder="请输入产品单位" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="线上价格" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.onlinePrice" placeholder="请输入线上价格" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="线下价格" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.offlinePrice" placeholder="请输入线下价格" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="总计价格" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品票据" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.productInvoice" placeholder="请输入产品票据" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品开具项目" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.productInvoiceItem`" :rules="formRules.productInvoiceItem" class="mb-0px!">
|
||||||
|
<el-input v-model="row.productInvoiceItem" placeholder="请输入产品开具项目" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="服务费票据" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.serviceInvoice`" :rules="formRules.serviceInvoice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.serviceInvoice" placeholder="请输入服务费票据" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="服务开具项目" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.serviceInvoiceItem`" :rules="formRules.serviceInvoiceItem" class="mb-0px!">
|
||||||
|
<el-input v-model="row.serviceInvoiceItem" placeholder="请输入服务开具项目" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -89,9 +94,6 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row justify="center" class="mt-3" v-if="!disabled">
|
|
||||||
<el-button @click="handleAdd" round>+ 添加产品</el-button>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as ProductApi from '@/api/crm/product'
|
import * as ProductApi from '@/api/crm/product'
|
||||||
|
|
@ -121,25 +123,6 @@ watch(
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
/** 监听合同产品变化,计算合同产品总价 */
|
|
||||||
watch(
|
|
||||||
() => formData.value,
|
|
||||||
(val) => {
|
|
||||||
if (!val || val.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 循环处理
|
|
||||||
val.forEach((item) => {
|
|
||||||
if (item.contractPrice != null && item.count != null) {
|
|
||||||
item.totalPrice = erpPriceMultiply(item.contractPrice, item.count)
|
|
||||||
} else {
|
|
||||||
item.totalPrice = undefined
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
{ deep: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
const row = {
|
const row = {
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,8 @@
|
||||||
/>
|
/>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-row class="mt-10px" justify="end">
|
<el-row class="mt-10px" justify="end">
|
||||||
<el-col :span="3"> 整单折扣:{{ erpPriceInputFormatter(contract.discountPercent) }}% </el-col>
|
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
产品总金额:{{ erpPriceInputFormatter(contract.totalProductPrice) }} 元
|
总金额:{{ erpPriceInputFormatter(contract.totalPrice) }} 元
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<doc-alert title="【合同】合同管理、合同提醒" url="https://doc.iocoder.cn/crm/contract/" />
|
|
||||||
<doc-alert title="【通用】数据权限" url="https://doc.iocoder.cn/crm/permission/" />
|
|
||||||
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<el-form
|
<el-form
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,599 @@
|
||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1280">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="报价单编号" prop="no">
|
||||||
|
<el-input v-model="formData.no" placeholder="请输入报价单编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="选择商机" prop="businessId">
|
||||||
|
<el-select v-model="formData.businessId" placeholder="请选择商机" @change="onBusinessChange">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in businessList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="客户" prop="customerId">
|
||||||
|
<el-select v-model="formData.customerId" placeholder="请选择客户" @change="onCustomerChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in customerList"
|
||||||
|
: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="cooperationType">
|
||||||
|
<el-input v-model="formData.cooperationType" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="公司类型" prop="companyType">
|
||||||
|
<el-input v-model="formData.companyType" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="上市情况" prop="listingStatus">
|
||||||
|
<el-input v-model="formData.listingStatus" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="融资信息" prop="financingInfo">
|
||||||
|
<el-input v-model="formData.financingInfo" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="实缴资金" prop="paidInCapital">
|
||||||
|
<el-input v-model="formData.paidInCapital" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="参保人数" prop="insuredCount">
|
||||||
|
<el-input v-model="formData.insuredCount" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="成立日期" prop="establishmentDate">
|
||||||
|
<el-input v-model="formData.establishmentDate" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="企业类型" prop="enterpriseType">
|
||||||
|
<el-input v-model="formData.enterpriseType" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="营业状态" prop="businessStatus">
|
||||||
|
<el-input v-model="formData.businessStatus" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="被告记录" prop="defendantRecord">
|
||||||
|
<el-radio-group v-model="formData.defendantRecord" :disabled="true">
|
||||||
|
<el-radio :label="true">是</el-radio>
|
||||||
|
<el-radio :label="false">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="经营异常" prop="businessAbnormal">
|
||||||
|
<el-radio-group v-model="formData.businessAbnormal" :disabled="true">
|
||||||
|
<el-radio :label="true">是</el-radio>
|
||||||
|
<el-radio :label="false">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="股权出质" prop="equityPledge">
|
||||||
|
<el-radio-group v-model="formData.equityPledge" :disabled="true">
|
||||||
|
<el-radio :label="true">是</el-radio>
|
||||||
|
<el-radio :label="false">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="失信记录" prop="dishonestRecord">
|
||||||
|
<el-radio-group v-model="formData.dishonestRecord" :disabled="true">
|
||||||
|
<el-radio :label="true">是</el-radio>
|
||||||
|
<el-radio :label="false">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="融资记录" prop="financingRecord">
|
||||||
|
<el-radio-group v-model="formData.financingRecord" :disabled="true">
|
||||||
|
<el-radio :label="true">是</el-radio>
|
||||||
|
<el-radio :label="false">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="被执行记录" prop="enforcementRecord">
|
||||||
|
<el-radio-group v-model="formData.enforcementRecord" :disabled="true">
|
||||||
|
<el-radio :label="true">是</el-radio>
|
||||||
|
<el-radio :label="false">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||||
|
<el-select v-model="formData.partnerCompanyId" placeholder="请选择合作主体" @change="onPartnerChange">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in deptList"
|
||||||
|
: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="bBankName">
|
||||||
|
<el-input v-model="formData.bBankName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="银行账号" prop="bBankAccount">
|
||||||
|
<el-input v-model="formData.bBankAccount" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="法人代表" prop="bLegalRepresentative">
|
||||||
|
<el-input v-model="formData.bLegalRepresentative" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="营业执照号" prop="bBusinessLicenseNumber">
|
||||||
|
<el-input v-model="formData.bBusinessLicenseNumber" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="营业执照" prop="bBusinessLicense">
|
||||||
|
<el-input v-model="formData.bBusinessLicense" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||||
|
<el-select v-model="formData.invoiceTemplateId" 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="ownerUserId">
|
||||||
|
<el-select v-model="formData.ownerUserId" 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="expanderUserId">
|
||||||
|
<el-select v-model="formData.expanderUserId" 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="pricingUserId">
|
||||||
|
<el-select v-model="formData.pricingUserId" 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="signUserId">
|
||||||
|
<el-select v-model="formData.signUserId" 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="signPhoneNumber">
|
||||||
|
<el-input v-model="formData.signPhoneNumber" placeholder="请输入签约人联系电话" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="签约人Email" prop="signEmail">
|
||||||
|
<el-input v-model="formData.signEmail" placeholder="请输入签约人Email" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="签约人微信" prop="signWechat">
|
||||||
|
<el-input v-model="formData.signWechat" placeholder="请输入签约人微信" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="账期" prop="paymentTerm">
|
||||||
|
<el-select v-model="formData.paymentTerm" placeholder="请选择账期">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions('payment_term')"
|
||||||
|
: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="creditMethod">
|
||||||
|
<el-select v-model="formData.creditMethod" placeholder="请选择授信方式">
|
||||||
|
<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="请选择授信计算周期">
|
||||||
|
<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="请输入授信额度" />
|
||||||
|
</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
|
||||||
|
check-strictly
|
||||||
|
node-key="id"
|
||||||
|
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"
|
||||||
|
:formatter="erpPriceInputFormatter"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="线下总金额" prop="offlinePrice">
|
||||||
|
<el-input
|
||||||
|
disabled
|
||||||
|
v-model="formData.offlinePrice"
|
||||||
|
:formatter="erpPriceInputFormatter"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="总金额" prop="totalPrice">
|
||||||
|
<el-input
|
||||||
|
disabled
|
||||||
|
v-model="formData.totalPrice"
|
||||||
|
:formatter="erpPriceInputFormatter"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<!-- 子表的表单 -->
|
||||||
|
<el-tabs v-model="subTabsName">
|
||||||
|
<el-tab-pane label="报价产品关联" name="quotationProduct">
|
||||||
|
<QuotationProductForm ref="quotationProductFormRef" :quotation-id="formData.id" :business-id="formData.businessId" />
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
||||||
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
|
import QuotationProductForm from './components/QuotationProductForm.vue'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
import * as UserApi from '@/api/system/user'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
|
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
||||||
|
|
||||||
|
/** CRM 方案报价 表单 */
|
||||||
|
defineOptions({ name: 'QuotationForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const customerList = ref([]) // 客户列表的数据
|
||||||
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
const businessList = ref([])
|
||||||
|
const deptTree = ref() // 部门树形结构
|
||||||
|
const deptList = ref() // 部门
|
||||||
|
|
||||||
|
const invoiceTemplateList = ref([])
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
no: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
businessId: undefined,
|
||||||
|
invoiceTemplateId: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
auditStatus: undefined,
|
||||||
|
ownerUserId: undefined,
|
||||||
|
expanderUserId: undefined,
|
||||||
|
pricingUserId: undefined,
|
||||||
|
signUserId: undefined,
|
||||||
|
signPhoneNumber: undefined,
|
||||||
|
signEmail: undefined,
|
||||||
|
signWechat: undefined,
|
||||||
|
paymentTerm: undefined,
|
||||||
|
creditMethod: undefined,
|
||||||
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updater: undefined,
|
||||||
|
onlinePrice: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
cooperationType: undefined, // 合作类型
|
||||||
|
companyType: undefined, // 公司类型
|
||||||
|
listingStatus: undefined, // 上市情况
|
||||||
|
financingInfo: undefined, // 融资信息
|
||||||
|
paidInCapital: undefined, // 实缴资金
|
||||||
|
insuredCount: undefined, // 参保人数
|
||||||
|
establishmentDate: undefined, // 成立日期
|
||||||
|
enterpriseType: undefined, // 企业类型
|
||||||
|
businessStatus: undefined, // 营业状态
|
||||||
|
defendantRecord: undefined, // 被告记录
|
||||||
|
businessAbnormal: undefined, // 经营异常
|
||||||
|
equityPledge: undefined, // 股权出质
|
||||||
|
dishonestRecord: undefined, // 失信记录
|
||||||
|
financingRecord: undefined, // 融资记录
|
||||||
|
enforcementRecord: undefined, // 被执行记录
|
||||||
|
bBankName: undefined, // 开户行
|
||||||
|
bBankAccount: undefined, // 银行账号
|
||||||
|
bLegalRepresentative: undefined, // 法人代表
|
||||||
|
bBusinessLicenseNumber: undefined, // 营业执照号
|
||||||
|
bBusinessLicense: undefined // 营业执照
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
no: [{ required: true, message: '报价单编号不能为空', trigger: 'blur' }],
|
||||||
|
customerId: [{ required: true, message: '客户id不能为空', trigger: 'change' }],
|
||||||
|
businessId: [{ required: true, message: '商机编号不能为空', trigger: 'change' }],
|
||||||
|
invoiceTemplateId: [{ required: true, message: '票据模板Id不能为空', trigger: 'change' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 子表的表单 */
|
||||||
|
const subTabsName = ref('quotationProduct')
|
||||||
|
const quotationProductFormRef = ref()
|
||||||
|
|
||||||
|
const onBusinessChange = async (businessId: string) => {
|
||||||
|
if (!businessId) return
|
||||||
|
try {
|
||||||
|
formLoading.value = true;
|
||||||
|
const res = await BusinessApi.getBusiness(businessId);
|
||||||
|
formData.value.customerId = res.customerId;
|
||||||
|
formData.value.creditLimit = res.creditLimit; // 保存详情信息
|
||||||
|
formData.value.ownerUserId = res.ownerUserId; // 保存详情信息
|
||||||
|
formData.value.paymentTerm = res.paymentTerm;
|
||||||
|
formData.value.creditMethod = res.creditMethod;
|
||||||
|
formData.value.creditCalcCycle = res.creditCalcCycle;
|
||||||
|
formData.value.deptId = res.deptId;
|
||||||
|
formData.value.offlinePrice = res.offlinePrice;
|
||||||
|
formData.value.onlinePrice = res.onlinePrice;
|
||||||
|
formData.value.totalPrice = res.totalPrice;
|
||||||
|
// 🔁 自动加载客户详情
|
||||||
|
await onCustomerChange(res.customerId);
|
||||||
|
} catch (err) {
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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 onPartnerChange = async (id: string) => {
|
||||||
|
if (!id) return
|
||||||
|
try {
|
||||||
|
formLoading.value = true;
|
||||||
|
const res = await DeptApi.getDept(id);
|
||||||
|
formData.value.bBankName = res.bankName;
|
||||||
|
formData.value.bBankAccount = res.bankAccount;
|
||||||
|
formData.value.bLegalRepresentative = res.legalRepresentative;
|
||||||
|
formData.value.bBusinessLicenseNumber = res.businessLicenseNumber;
|
||||||
|
formData.value.bBusinessLicense = res.businessLicense;
|
||||||
|
} catch (err) {
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await QuotationApi.getQuotation(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获得客户列表
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
|
// 获得用户列表
|
||||||
|
userOptions.value = await UserApi.getSimpleUserList()
|
||||||
|
|
||||||
|
businessList.value = await BusinessApi.getSimpleBusinessList()
|
||||||
|
// 获得部门树
|
||||||
|
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||||
|
deptList.value = await DeptApi.getSimpleDeptList()
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 校验子表单
|
||||||
|
try {
|
||||||
|
await quotationProductFormRef.value.validate()
|
||||||
|
} catch (e) {
|
||||||
|
subTabsName.value = 'quotationProduct'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as QuotationVO
|
||||||
|
// 拼接子表的数据
|
||||||
|
data.quotationProducts = quotationProductFormRef.value.getData()
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await QuotationApi.createQuotation(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await QuotationApi.updateQuotation(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
no: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
businessId: undefined,
|
||||||
|
invoiceTemplateId: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
auditStatus: undefined,
|
||||||
|
ownerUserId: undefined,
|
||||||
|
expanderUserId: undefined,
|
||||||
|
pricingUserId: undefined,
|
||||||
|
signUserId: undefined,
|
||||||
|
signPhoneNumber: undefined,
|
||||||
|
signEmail: undefined,
|
||||||
|
signWechat: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
paymentTerm: undefined,
|
||||||
|
creditMethod: undefined,
|
||||||
|
creditCalcCycle: undefined,
|
||||||
|
creditLimit: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updater: undefined
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,183 @@
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
v-loading="formLoading"
|
||||||
|
label-width="0px"
|
||||||
|
:inline-message="true"
|
||||||
|
>
|
||||||
|
<el-table :data="formData" class="-mt-10px">
|
||||||
|
<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">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
||||||
|
<el-input v-model="row.productName" placeholder="请输入产品名称" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品分类编号" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.productCategoryId`" :rules="formRules.productCategoryId" class="mb-0px!">
|
||||||
|
<el-input v-model="row.productCategoryId" placeholder="请输入产品分类编号" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品单位" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.productUnit`" :rules="formRules.productUnit" class="mb-0px!">
|
||||||
|
<el-input v-model="row.productUnit" placeholder="请输入产品单位" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="线上价格" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.onlinePrice" placeholder="请输入线上价格" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="线下价格" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.offlinePrice" placeholder="请输入线下价格" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="总计价格" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品票据" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.productInvoice" placeholder="请输入产品票据" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品开具项目" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.productInvoiceItem`" :rules="formRules.productInvoiceItem" class="mb-0px!">
|
||||||
|
<el-input v-model="row.productInvoiceItem" placeholder="请输入产品开具项目" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="服务费票据" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.serviceInvoice`" :rules="formRules.serviceInvoice" class="mb-0px!">
|
||||||
|
<el-input v-model="row.serviceInvoice" placeholder="请输入服务费票据" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="服务开具项目" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.serviceInvoiceItem`" :rules="formRules.serviceInvoiceItem" class="mb-0px!">
|
||||||
|
<el-input v-model="row.serviceInvoiceItem" placeholder="请输入服务开具项目" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
<el-row justify="center" class="mt-3">
|
||||||
|
<!-- <el-button @click="handleAdd" round>+ 添加CRM 报价产品关联</el-button> -->
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { QuotationApi } from '@/api/crm/quotation'
|
||||||
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
quotationId: undefined, // 报价编号(主表的关联字段)
|
||||||
|
businessId: undefined
|
||||||
|
}>()
|
||||||
|
const formLoading = ref(false) // 表单的加载中
|
||||||
|
const formData = ref([])
|
||||||
|
const formRules = reactive({
|
||||||
|
quotationId: [{ required: true, message: '报价编号不能为空', trigger: 'blur' }],
|
||||||
|
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
|
||||||
|
productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
|
||||||
|
productCategoryId: [{ required: true, message: '产品分类编号不能为空', trigger: 'blur' }],
|
||||||
|
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
|
||||||
|
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
|
||||||
|
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],
|
||||||
|
totalPrice: [{ required: true, message: '总计价格不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||||
|
watch(
|
||||||
|
() => props.businessId,
|
||||||
|
async (val) => {
|
||||||
|
// 1. 重置表单
|
||||||
|
formData.value = []
|
||||||
|
// 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 BusinessApi.getBusiness(val);
|
||||||
|
formData.value = business.products
|
||||||
|
// }
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
const row = {
|
||||||
|
quotationId: undefined,
|
||||||
|
productId: undefined,
|
||||||
|
productName: undefined,
|
||||||
|
productCategoryId: undefined,
|
||||||
|
productUnit: undefined,
|
||||||
|
onlinePrice: undefined,
|
||||||
|
offlinePrice: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
productInvoice: undefined,
|
||||||
|
productInvoiceItem: undefined,
|
||||||
|
serviceInvoice: undefined,
|
||||||
|
serviceInvoiceItem: undefined
|
||||||
|
}
|
||||||
|
row.quotationId = props.quotationId
|
||||||
|
formData.value.push(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = (index) => {
|
||||||
|
formData.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单校验 */
|
||||||
|
const validate = () => {
|
||||||
|
return formRef.value.validate()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单值 */
|
||||||
|
const getData = () => {
|
||||||
|
return formData.value
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ validate, getData })
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,285 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="报价单编号" prop="no">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.no"
|
||||||
|
placeholder="请输入报价单编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户" prop="customerId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.customerId"
|
||||||
|
placeholder="请选择客户"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in customerList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商机负责人" prop="ownerUserId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.ownerUserId"
|
||||||
|
placeholder="请选择商机负责人"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in userOptions"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.nickName"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.createTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-220px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['crm:quotation:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['crm:quotation:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="报价单编号" align="center" prop="no" />
|
||||||
|
<el-table-column label="客户名称" align="center" prop="customerId">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
:underline="false"
|
||||||
|
type="primary"
|
||||||
|
@click="openCustomerDetail(scope.row.customerId)"
|
||||||
|
>
|
||||||
|
{{ scope.row.customerName }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商机负责人" align="center" prop="ownerUserId">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
:underline="false"
|
||||||
|
type="primary"
|
||||||
|
@click="openContactDetail(scope.row.ownerUserId)"
|
||||||
|
>
|
||||||
|
{{ scope.row.ownerUserName }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="账期" align="center" prop="paymentTerm">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="'payment_term'" :value="scope.row.paymentTerm" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="授信方式" align="center" prop="creditMethod">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="'credit_method'" :value="scope.row.creditMethod" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="授信计算周期" align="center" prop="creditCalcCycle">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="'credit_calc_cycle'" :value="scope.row.creditCalcCycle" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="授信额度" align="center" prop="creditLimit" />
|
||||||
|
<el-table-column label="合作主体" align="center" prop="partnerCompanyName" />
|
||||||
|
<el-table-column label="审批状态" align="center" prop="auditStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.auditStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['crm:quotation:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['crm:quotation:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<QuotationForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
||||||
|
import QuotationForm from './QuotationForm.vue'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
import * as UserApi from '@/api/system/user'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
|
||||||
|
/** CRM 方案报价 列表 */
|
||||||
|
defineOptions({ name: 'Quotation' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
const customerList = ref([]) // 客户列表的数据
|
||||||
|
|
||||||
|
const { push } = useRouter()
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<QuotationVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
no: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
ownerUserId: undefined,
|
||||||
|
partnerCompanyId: undefined,
|
||||||
|
createTime: []
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await QuotationApi.getQuotationPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await QuotationApi.deleteQuotation(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await QuotationApi.exportQuotation(queryParams)
|
||||||
|
download.excel(data, 'CRM 方案报价.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 打开联系人详情 */
|
||||||
|
const openContactDetail = (id: number) => {
|
||||||
|
push({ name: 'CrmContactDetail', params: { id } })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 打开客户详情 */
|
||||||
|
const openCustomerDetail = (id: number) => {
|
||||||
|
push({ name: 'CrmCustomerDetail', params: { id } })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(async () => {
|
||||||
|
getList()
|
||||||
|
// 获得客户列表
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
|
// 获得用户列表
|
||||||
|
userOptions.value = await UserApi.getSimpleUserList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue