Merge branch 'master' of https://gitee.com/guochang-hongyun/warm-kingdom-vue3-oa
commit
eef3422c43
2
.env
2
.env
|
|
@ -2,7 +2,7 @@
|
|||
VITE_APP_TITLE=暖界办公
|
||||
|
||||
# 项目本地运行端口号
|
||||
VITE_PORT=81
|
||||
VITE_PORT=80
|
||||
|
||||
# open 运行 npm run dev 时自动打开浏览器
|
||||
VITE_OPEN=true
|
||||
|
|
|
|||
2
.env.dev
2
.env.dev
|
|
@ -34,4 +34,4 @@ VITE_MALL_H5_DOMAIN='http://8.130.12.151'
|
|||
VITE_APP_CAPTCHA_ENABLE=false
|
||||
|
||||
# GoView域名
|
||||
VITE_GOVIEW_URL='http://127.0.0.1:3000'
|
||||
VITE_GOVIEW_URL='http://8.130.12.151:3000'
|
||||
|
|
@ -4,7 +4,7 @@ NODE_ENV=development
|
|||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://172.22.3.6:48080'
|
||||
VITE_BASE_URL='http://127.0.0.1:48080'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ NODE_ENV=production
|
|||
VITE_DEV=false
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
VITE_BASE_URL='http://172.22.3.168:48080'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
|
|
|||
|
|
@ -61,6 +61,11 @@ export const getSimpleBusinessList = async () => {
|
|||
return await request.get({ url: `/crm/business/simple-all-list` })
|
||||
}
|
||||
|
||||
// 获得 CRM 我的商机列表
|
||||
export const getSelfSimpleBusinessList = async () => {
|
||||
return await request.get({ url: `/crm/business/self-simple-list` })
|
||||
}
|
||||
|
||||
// 新增 CRM 商机
|
||||
export const createBusiness = async (data: BusinessVO) => {
|
||||
return await request.post({ url: `/crm/business/create`, data })
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export const DEFAULT_STATUSES = [
|
|||
{
|
||||
endStatus: 1,
|
||||
key: '结束',
|
||||
name: '赢单',
|
||||
name: '成交',
|
||||
percent: 100
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ export const getContract = async (id: number) => {
|
|||
return await request.get({ url: `/crm/contract/get?id=` + id })
|
||||
}
|
||||
|
||||
// 查询 CRM 合同详情
|
||||
export const getChangeContract = async (id: number) => {
|
||||
return await request.get({ url: `/crm/contract/getChangeContract?contractChangeId=` + id })
|
||||
}
|
||||
|
||||
// 查询 CRM 合同下拉列表
|
||||
export const getContractSimpleList = async (customerId: number) => {
|
||||
return await request.get({
|
||||
|
|
@ -115,6 +120,11 @@ export const transferContract = async (data: TransferReqVO) => {
|
|||
return await request.put({ url: '/crm/contract/transfer', data })
|
||||
}
|
||||
|
||||
// 合同变更
|
||||
export const changeContract = async (data: TransferReqVO) => {
|
||||
return await request.put({ url: '/crm/contract/changeContract', data })
|
||||
}
|
||||
|
||||
// 获得待审核合同数量
|
||||
export const getAuditContractCount = async () => {
|
||||
return await request.get({ url: '/crm/contract/audit-count' })
|
||||
|
|
@ -125,6 +135,16 @@ export const getRemindContractCount = async () => {
|
|||
return await request.get({ url: '/crm/contract/remind-count' })
|
||||
}
|
||||
|
||||
// 合作主主体
|
||||
export const getOrg = async (params) => {
|
||||
return await request.get({ url: '/system/organizations/page', params })
|
||||
}
|
||||
|
||||
// 合作主主体详情
|
||||
export const getOrgInfo = async (params) => {
|
||||
return await request.get({ url: '/system/organizations/get?id=' + params })
|
||||
}
|
||||
|
||||
// ==================== 子表(CRM 合同产品关联) ====================
|
||||
|
||||
// 获得CRM 合同产品关联列表
|
||||
|
|
@ -151,3 +171,8 @@ export const getContractAAuthorizedPersonListByContractId = async (contractId) =
|
|||
export const getContractBAuthorizedPersonListByContractId = async (contractId) => {
|
||||
return await request.get({ url: `/crm/contract/contract-B-authorized-person/list-by-contract-id?contractId=` + contractId })
|
||||
}
|
||||
|
||||
// 获得合同乙方授权人信息列表
|
||||
export const quotationTimes = async (contractId) => {
|
||||
return await request.get({ url: `/crm/contract/quotationTimes?id=` + contractId })
|
||||
}
|
||||
|
|
@ -29,6 +29,57 @@ export interface CustomerVO {
|
|||
creatorName?: string // 创建人名称
|
||||
createTime: Date // 创建时间
|
||||
updateTime: Date // 更新时间
|
||||
|
||||
|
||||
cooperationType?: number // 合作类型
|
||||
cooperationArea?: number // 合作地区
|
||||
leadSource?: number // 线索来源
|
||||
customerStatus?: number // 客户状态
|
||||
dataType?: number // 是否为公海数据
|
||||
serviceStatus?: string // 经营状态
|
||||
developer?: number // 商务拓展人
|
||||
contractor?: number // 商务签约人
|
||||
clueDeveloper?: number // 线索拓展人
|
||||
maintainer?: number // 售后维护人
|
||||
assist?: number // 协助人
|
||||
customerOwner?: number // 客户归属人
|
||||
website?: string // 网站
|
||||
contactAddress?: string // 通讯地址
|
||||
customerDetails?: string // 客户详情
|
||||
rejectionReason?: string // 客户退回原因
|
||||
claim?: number // 是否领取
|
||||
claimTime?: Date // 领取时间
|
||||
startDate?: string // 成立日期
|
||||
registerCapital?: string // 注册资本
|
||||
legalPersonName?: string // 法定代表人
|
||||
actualCapital?: string // 实缴注册资本
|
||||
registerCapitalCurrency?: string // 注册资本币种
|
||||
bankName?: string // 开户行名称
|
||||
bankAccount?: string // 银行账号
|
||||
taxQualification?: string // 纳税人资质
|
||||
socialEmployeeNum?: string // 参保人数
|
||||
creditNo?: string // 社会统一信用代码
|
||||
businessTerm?: string // 营业期限
|
||||
belongOrg?: string // 登记机关
|
||||
regType?: string // 公司类型
|
||||
actualCharacters?: string // 实缴字符数
|
||||
registerNo?: string // 工商注册号
|
||||
registeredAddress?: string // 注册地址
|
||||
businessScope?: string // 经营范围
|
||||
partnerTotal?: string // 股东数量
|
||||
changeRecordDataTotal?: string // 变更数量
|
||||
employeeDataTotal?: string // 董事会成员数量
|
||||
attention?: number // 是否关注(1关注,0不关注)
|
||||
creditAmount?: number // 授信额度
|
||||
accountPeriod?: number // 账期(天)
|
||||
creditGrantingMethod?: number // 授信方式
|
||||
creditCalculationCycle?: number // 授信计算周期
|
||||
equityPledge?: number // 股权出质
|
||||
judgmentRecord?: number // 被执行记录
|
||||
defendantRecord?: number // 被告记录
|
||||
dishonestyRecord?: number // 失信记录
|
||||
abnormalService?: number // 经营异常
|
||||
financeRecord?: number // 融资记录
|
||||
}
|
||||
|
||||
// 查询客户列表
|
||||
|
|
@ -101,6 +152,16 @@ export const getCustomerSimpleList = async () => {
|
|||
return await request.get({ url: `/crm/customer/simple-list` })
|
||||
}
|
||||
|
||||
// 我的客户列表
|
||||
export const getSelfCustomerSimpleList = async () => {
|
||||
return await request.get({ url: `/crm/customer/self-simple-list` })
|
||||
}
|
||||
|
||||
// 模糊查询公司
|
||||
export const getCompanyList = async (params) => {
|
||||
return await request.get({ url: `/crm/customer/fuzzyQueryCompany`, params })
|
||||
}
|
||||
|
||||
// ======================= 业务操作 =======================
|
||||
|
||||
// 客户转移
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ export enum BizTypeEnum {
|
|||
CRM_CONTRACT = 5, // 合同
|
||||
CRM_PRODUCT = 6, // 产品
|
||||
CRM_RECEIVABLE = 7, // 回款
|
||||
CRM_RECEIVABLE_PLAN = 8 // 回款计划
|
||||
CRM_RECEIVABLE_PLAN = 8, // 回款计划
|
||||
CRM_QUOTATION = 9 // 报价
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -65,6 +65,11 @@ export const QuotationApi = {
|
|||
return await request.download({ url: `/crm/quotation/export-excel`, params })
|
||||
},
|
||||
|
||||
// 提交审核
|
||||
submitContract: async (id: number) => {
|
||||
return await request.put({ url: `/crm/quotation/submit?id=${id}` })
|
||||
},
|
||||
|
||||
// ==================== 子表(CRM 报价产品关联) ====================
|
||||
|
||||
// 获得CRM 报价产品关联列表
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import request from '@/config/axios'
|
|||
export interface CrmStatisticFunnelRespVO {
|
||||
customerCount: number // 客户数
|
||||
businessCount: number // 商机数
|
||||
businessWinCount: number // 赢单数
|
||||
businessWinCount: number // 成交数
|
||||
}
|
||||
|
||||
export interface CrmStatisticsBusinessSummaryByDateRespVO {
|
||||
|
|
@ -15,7 +15,7 @@ export interface CrmStatisticsBusinessSummaryByDateRespVO {
|
|||
export interface CrmStatisticsBusinessInversionRateSummaryByDateRespVO {
|
||||
time: string // 时间
|
||||
businessCount: number // 商机数量
|
||||
businessWinCount: number // 赢单商机数
|
||||
businessWinCount: number // 成交商机数
|
||||
}
|
||||
|
||||
// 客户分析 API
|
||||
|
|
|
|||
|
|
@ -0,0 +1,158 @@
|
|||
<template>
|
||||
<Dialog title="添加联系人" v-model="dialogVisible" width="50%">
|
||||
<!-- 搜索工作栏 -->
|
||||
<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"
|
||||
class="!w-240px"
|
||||
clearable
|
||||
placeholder="请输入姓名"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
重置
|
||||
</el-button>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table ref="multipleTableRef" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :row-key="getRowKey" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" type="selection" :reserve-selection="true" />
|
||||
<el-table-column label="联系人姓名" align="center" prop="name" />
|
||||
<el-table-column align="center" label="电话" prop="telephone" width="130" />
|
||||
<el-table-column align="center" label="职位" prop="post" width="120" />
|
||||
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
<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 * as ContactApi from '@/api/crm/contact'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
|
||||
/** 票据模版 列表 */
|
||||
defineOptions({ name: 'BillTemplate' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<BillTemplateVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const multipleSelection = ref([])
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const multipleTableRef = ref()
|
||||
const selectedRowKeys = ref<number[]>([]);
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
customerId: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
/** 打开弹窗 */
|
||||
const open = async (data: [], id) => {
|
||||
dialogVisible.value = true
|
||||
multipleSelection.value = data
|
||||
console.log('%csrc/components/contact/index.vue:91 id', 'color: #007acc;', id);
|
||||
queryParams.customerId = id
|
||||
await getList()
|
||||
await setSelections()
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
// 跨页唯一id
|
||||
const getRowKey = (row) => {
|
||||
return row.id
|
||||
}
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await ContactApi.getContactPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const handleSelectionChange = (val: []) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
multipleTableRef.value.clearSelection()
|
||||
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 提交请求
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success', multipleSelection.value)
|
||||
}
|
||||
const setSelections = async () => {
|
||||
const selections = multipleSelection.value.map(item => {
|
||||
return {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
console.log('%csrc/components/product/index.vue:153 list.value', 'color: #007acc;', multipleSelection);
|
||||
|
||||
if (selections && selections.length > 0) {
|
||||
list.value.forEach((row: any) => {
|
||||
if (selections.some(item => item.id === row.id)) {
|
||||
multipleTableRef.value.toggleRowSelection(row, true); // 设置选择状态。
|
||||
}
|
||||
});
|
||||
} else {
|
||||
multipleTableRef.value.clearSelection(); // 如果没有保存的选择,则清空当前页的选择。
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
<template>
|
||||
<Dialog title="添加员工" v-model="dialogVisible" width="50%">
|
||||
<!-- 搜索工作栏 -->
|
||||
<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
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
重置
|
||||
</el-button>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table ref="multipleTableRef" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :row-key="getRowKey" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" type="selection" :reserve-selection="true" />
|
||||
<el-table-column label="姓名" align="center" prop="nickname" />
|
||||
<el-table-column label="部门" align="center" prop="deptName" width="160" />
|
||||
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<!-- <Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/> -->
|
||||
</ContentWrap>
|
||||
<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 * as ProductApi from '@/api/crm/product'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
|
||||
/** 票据模版 列表 */
|
||||
defineOptions({ name: 'BillTemplate' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<BillTemplateVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const multipleSelection = ref([])
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const multipleTableRef = ref()
|
||||
const selectedRowKeys = ref<number[]>([]);
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
status: 1,
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
/** 打开弹窗 */
|
||||
const open = async (data: []) => {
|
||||
console.log('%csrc/components/product/index.vue:102 data', 'color: #007acc;', data);
|
||||
dialogVisible.value = true
|
||||
multipleSelection.value = data
|
||||
await getList()
|
||||
await setSelections()
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
// 跨页唯一id
|
||||
const getRowKey = (row) => {
|
||||
return row.id
|
||||
}
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
// 获得用户列表
|
||||
// userOptions.value = await UserApi.getSimpleUserList()
|
||||
const data = await UserApi.getSimpleUserList()
|
||||
list.value = data
|
||||
// total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const handleSelectionChange = (val: []) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
multipleTableRef.value.clearSelection()
|
||||
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 提交请求
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success', multipleSelection.value)
|
||||
}
|
||||
const setSelections = async () => {
|
||||
const selections = multipleSelection.value.map(item => {
|
||||
return {
|
||||
id: item.productId
|
||||
}
|
||||
})
|
||||
console.log('%csrc/components/product/index.vue:153 list.value', 'color: #007acc;', list.value);
|
||||
|
||||
if (selections && selections.length > 0) {
|
||||
list.value.forEach((row: any) => {
|
||||
if (selections.some(item => item.id === row.id)) {
|
||||
multipleTableRef.value.toggleRowSelection(row, true); // 设置选择状态。
|
||||
}
|
||||
});
|
||||
} else {
|
||||
multipleTableRef.value.clearSelection(); // 如果没有保存的选择,则清空当前页的选择。
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -541,7 +541,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
title: '票据模版新增',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/business'
|
||||
activeMenu: '/crm/bill-template'
|
||||
},
|
||||
component: () => import('@/views/crm/billtemplate/BillTemplateForm.vue')
|
||||
},
|
||||
|
|
@ -552,18 +552,19 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
title: '票据模版编辑',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/business'
|
||||
activeMenu: '/crm/bill-template'
|
||||
},
|
||||
component: () => import('@/views/crm/billtemplate/BillTemplateForm.vue')
|
||||
},
|
||||
{
|
||||
path: 'business/quotationAdd',
|
||||
path: 'quotation/QuotationForm',
|
||||
name: 'QuotationAdd',
|
||||
meta: {
|
||||
title: '方案报价新增',
|
||||
noCache: true,
|
||||
canTo: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/business'
|
||||
activeMenu: '/crm/quotation'
|
||||
},
|
||||
component: () => import('@/views/crm/quotation/QuotationForm.vue')
|
||||
},
|
||||
|
|
@ -574,18 +575,19 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
title: '方案报价编辑',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/business'
|
||||
activeMenu: '/crm/quotation'
|
||||
},
|
||||
component: () => import('@/views/crm/quotation/QuotationForm.vue')
|
||||
},
|
||||
{
|
||||
path: 'business/quotationDetail',
|
||||
path: 'quotation/QuotationDetail',
|
||||
name: 'QuotationDetail',
|
||||
meta: {
|
||||
title: '方案报价详情',
|
||||
noCache: true,
|
||||
canTo: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/business'
|
||||
activeMenu: '/crm/quotation'
|
||||
},
|
||||
component: () => import('@/views/crm/quotation/QuotationDetail.vue')
|
||||
},
|
||||
|
|
@ -612,11 +614,57 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
component: () => import('@/views/crm/business/BusinessForm.vue')
|
||||
},
|
||||
{
|
||||
path: 'contract/detail/:id',
|
||||
path: 'contract/add',
|
||||
name: 'CrmContractAdd',
|
||||
meta: {
|
||||
title: '合同新增',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/contract'
|
||||
},
|
||||
component: () => import('@/views/crm/contract/ContractForm.vue')
|
||||
},
|
||||
{
|
||||
path: 'contract/edit',
|
||||
name: 'CrmContractEdit',
|
||||
meta: {
|
||||
title: '合同编辑',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/contract'
|
||||
},
|
||||
component: () => import('@/views/crm/contract/ContractForm.vue')
|
||||
},
|
||||
{
|
||||
path: 'contract/ContractChange',
|
||||
name: 'CrmContractChange',
|
||||
meta: {
|
||||
title: '合同变更',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/contract'
|
||||
},
|
||||
component: () => import('@/views/crm/contract/ContractChange.vue')
|
||||
},
|
||||
{
|
||||
path: 'contract/detail/ContractChangeDetail',
|
||||
name: 'CrmContractChangeDetail',
|
||||
meta: {
|
||||
title: '合同变更详情',
|
||||
noCache: true,
|
||||
canTo: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/contract'
|
||||
},
|
||||
component: () => import('@/views/crm/contract/detail/ContractChangeDetail.vue')
|
||||
},
|
||||
{
|
||||
path: 'contract/detail/index',
|
||||
name: 'CrmContractDetail',
|
||||
meta: {
|
||||
title: '合同详情',
|
||||
noCache: true,
|
||||
canTo: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/contract'
|
||||
},
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ export enum DICT_TYPE {
|
|||
CRM_RETURN_VISIT_STSTUS = "crm_return_visit_type", //CRM 回访类型
|
||||
CRM_COMPLAINT_METHOD = "crm_complaint_method", // 投诉方式
|
||||
CRM_COMPLAINT_LEVEL = "crm_complaint_level", // 投诉级别
|
||||
TECH_SUPPORT = "tech_support", // 是否
|
||||
|
||||
// 商机账期
|
||||
PAYMENT_TERM = "payment_term", // 投诉级别
|
||||
|
|
|
|||
|
|
@ -1,339 +1,11 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-row :gutter="16" justify="space-between">
|
||||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
||||
<div class="flex items-center">
|
||||
<el-avatar :src="avatar" :size="70" class="mr-16px">
|
||||
<img src="@/assets/imgs/avatar.gif" alt="" />
|
||||
</el-avatar>
|
||||
<div>
|
||||
<div class="text-20px">
|
||||
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
|
||||
</div>
|
||||
<div class="mt-10px text-14px text-gray-500">
|
||||
{{ t('workplace.toady') }},20℃ - 32℃!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
<useWatermark />
|
||||
</div>
|
||||
|
||||
<el-row class="mt-8px" :gutter="8" justify="space-between">
|
||||
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-8px">
|
||||
<el-card shadow="never" class="mt-8px">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-row :gutter="20" justify="space-between">
|
||||
<el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24">
|
||||
<el-card shadow="hover" class="mb-8px">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<Echart :options="pieOptionsData" :height="280" />
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
|
||||
<el-card shadow="hover" class="mb-8px">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<Echart :options="barOptionsData" :height="280" />
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-8px">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="h-3 flex justify-between">
|
||||
<span>{{ t('workplace.shortcutOperation') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-row>
|
||||
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
|
||||
<div class="flex items-center">
|
||||
<Icon :icon="item.icon" class="mr-8px" :style="{ color: item.color }" />
|
||||
<el-link type="default" :underline="false" @click="handleShortcutClick(item.url)">
|
||||
{{ item.name }}
|
||||
</el-link>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt-8px">
|
||||
<template #header>
|
||||
<div class="h-3 flex justify-between">
|
||||
<span>{{ t('workplace.notice') }}</span>
|
||||
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
|
||||
</div>
|
||||
</template>
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<div v-for="(item, index) in notice" :key="`dynamics-${index}`">
|
||||
<div class="flex items-center">
|
||||
<el-avatar :src="avatar" :size="35" class="mr-16px">
|
||||
<img src="@/assets/imgs/avatar.gif" alt="" />
|
||||
</el-avatar>
|
||||
<div>
|
||||
<div class="text-14px">
|
||||
<Highlight :keys="item.keys.map((v) => t(v))">
|
||||
{{ item.type }} : {{ item.title }}
|
||||
</Highlight>
|
||||
</div>
|
||||
<div class="mt-16px text-12px text-gray-400">
|
||||
{{ formatTime(item.date, 'yyyy-MM-dd') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider />
|
||||
</div>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { set } from 'lodash-es'
|
||||
import { EChartsOption } from 'echarts'
|
||||
import { formatTime } from '@/utils'
|
||||
import useWatermark from '@/views/bpm/processInstance/create/index.vue'
|
||||
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { useWatermark } from '@/hooks/web/useWatermark'
|
||||
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
|
||||
import { pieOptions, barOptions } from './echarts-data'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
defineOptions({ name: 'Home' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
const { setWatermark } = useWatermark()
|
||||
const loading = ref(true)
|
||||
const avatar = userStore.getUser.avatar
|
||||
const username = userStore.getUser.nickname
|
||||
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
|
||||
// 获取统计数
|
||||
let totalSate = reactive<WorkplaceTotal>({
|
||||
project: 0,
|
||||
access: 0,
|
||||
todo: 0
|
||||
})
|
||||
|
||||
const getCount = async () => {
|
||||
const data = {
|
||||
project: 40,
|
||||
access: 2340,
|
||||
todo: 10
|
||||
}
|
||||
totalSate = Object.assign(totalSate, data)
|
||||
}
|
||||
|
||||
// 获取项目数
|
||||
let projects = reactive<Project[]>([])
|
||||
const getProject = async () => {
|
||||
const data = [
|
||||
{
|
||||
name: 'ruoyi-vue-pro',
|
||||
icon: 'simple-icons:springboot',
|
||||
message: 'github.com/YunaiV/ruoyi-vue-pro',
|
||||
personal: 'Spring Boot 单体架构',
|
||||
time: new Date('2025-01-02'),
|
||||
color: '#6DB33F'
|
||||
},
|
||||
{
|
||||
name: 'yudao-ui-admin-vue3',
|
||||
icon: 'ep:element-plus',
|
||||
message: 'github.com/yudaocode/yudao-ui-admin-vue3',
|
||||
personal: 'Vue3 + element-plus 管理后台',
|
||||
time: new Date('2025-02-03'),
|
||||
color: '#409EFF'
|
||||
},
|
||||
{
|
||||
name: 'yudao-ui-mall-uniapp',
|
||||
icon: 'icon-park-outline:mall-bag',
|
||||
message: 'github.com/yudaocode/yudao-ui-mall-uniapp',
|
||||
personal: 'Vue3 + uniapp 商城手机端',
|
||||
time: new Date('2025-03-04'),
|
||||
color: '#ff4d4f'
|
||||
},
|
||||
{
|
||||
name: 'yudao-cloud',
|
||||
icon: 'material-symbols:cloud-outline',
|
||||
message: 'github.com/YunaiV/yudao-cloud',
|
||||
personal: 'Spring Cloud 微服务架构',
|
||||
time: new Date('2025-04-05'),
|
||||
color: '#1890ff'
|
||||
},
|
||||
{
|
||||
name: 'yudao-ui-admin-vben',
|
||||
icon: 'devicon:antdesign',
|
||||
message: 'github.com/yudaocode/yudao-ui-admin-vben',
|
||||
personal: 'Vue3 + vben5(antd) 管理后台',
|
||||
time: new Date('2025-05-06'),
|
||||
color: '#e18525'
|
||||
},
|
||||
{
|
||||
name: 'yudao-ui-admin-uniapp',
|
||||
icon: 'ant-design:mobile',
|
||||
message: 'github.com/yudaocode/yudao-ui-admin-uniapp',
|
||||
personal: 'Vue3 + uniapp 管理手机端',
|
||||
time: new Date('2025-06-01'),
|
||||
color: '#2979ff'
|
||||
}
|
||||
]
|
||||
projects = Object.assign(projects, data)
|
||||
}
|
||||
|
||||
// 获取通知公告
|
||||
let notice = reactive<Notice[]>([])
|
||||
const getNotice = async () => {
|
||||
const data = [
|
||||
// {
|
||||
// title: '系统支持 JDK 8/17/21,Vue 2/3',
|
||||
// type: '技术兼容性',
|
||||
// keys: ['JDK', 'Vue'],
|
||||
// date: new Date()
|
||||
// },
|
||||
// {
|
||||
// title: '后端提供 Spring Boot 2.7/3.2 + Cloud 双架构',
|
||||
// type: '架构灵活性',
|
||||
// keys: ['Boot', 'Cloud'],
|
||||
// date: new Date()
|
||||
// },
|
||||
// {
|
||||
// title: '全部开源,个人与企业可 100% 直接使用,无需授权',
|
||||
// type: '开源免授权',
|
||||
// keys: ['无需授权'],
|
||||
// date: new Date()
|
||||
// },
|
||||
// {
|
||||
// title: '国内使用最广泛的快速开发平台,远超 10w+ 企业使用',
|
||||
// type: '广泛企业认可',
|
||||
// keys: ['最广泛', '10w+'],
|
||||
// date: new Date()
|
||||
// }
|
||||
]
|
||||
notice = Object.assign(notice, data)
|
||||
}
|
||||
|
||||
// 获取快捷入口
|
||||
let shortcut = reactive<Shortcut[]>([])
|
||||
|
||||
const getShortcut = async () => {
|
||||
const data = [
|
||||
{
|
||||
name: '首页',
|
||||
icon: 'ion:home-outline',
|
||||
url: '/',
|
||||
color: '#1fdaca'
|
||||
},
|
||||
{
|
||||
name: '商城中心',
|
||||
icon: 'ep:shop',
|
||||
url: '/mall/home',
|
||||
color: '#ff6b6b'
|
||||
},
|
||||
{
|
||||
name: 'AI 大模型',
|
||||
icon: 'tabler:ai',
|
||||
url: '/ai/chat',
|
||||
color: '#7c3aed'
|
||||
},
|
||||
{
|
||||
name: 'ERP 系统',
|
||||
icon: 'simple-icons:erpnext',
|
||||
url: '/erp/home',
|
||||
color: '#3fb27f'
|
||||
},
|
||||
{
|
||||
name: 'CRM 系统',
|
||||
icon: 'simple-icons:civicrm',
|
||||
url: '/crm/backlog',
|
||||
color: '#4daf1bc9'
|
||||
},
|
||||
{
|
||||
name: 'IoT 物联网',
|
||||
icon: 'fa-solid:hdd',
|
||||
url: '/iot/home',
|
||||
color: '#1a73e8'
|
||||
}
|
||||
]
|
||||
shortcut = Object.assign(shortcut, data)
|
||||
}
|
||||
|
||||
// 用户来源
|
||||
const getUserAccessSource = async () => {
|
||||
const data = [
|
||||
{ value: 335, name: 'analysis.directAccess' },
|
||||
{ value: 310, name: 'analysis.mailMarketing' },
|
||||
{ value: 234, name: 'analysis.allianceAdvertising' },
|
||||
{ value: 135, name: 'analysis.videoAdvertising' },
|
||||
{ value: 1548, name: 'analysis.searchEngines' }
|
||||
]
|
||||
set(
|
||||
pieOptionsData,
|
||||
'legend.data',
|
||||
data.map((v) => t(v.name))
|
||||
)
|
||||
pieOptionsData!.series![0].data = data.map((v) => {
|
||||
return {
|
||||
name: t(v.name),
|
||||
value: v.value
|
||||
}
|
||||
})
|
||||
}
|
||||
const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
|
||||
|
||||
// 周活跃量
|
||||
const getWeeklyUserActivity = async () => {
|
||||
const data = [
|
||||
{ value: 13253, name: 'analysis.monday' },
|
||||
{ value: 34235, name: 'analysis.tuesday' },
|
||||
{ value: 26321, name: 'analysis.wednesday' },
|
||||
{ value: 12340, name: 'analysis.thursday' },
|
||||
{ value: 24643, name: 'analysis.friday' },
|
||||
{ value: 1322, name: 'analysis.saturday' },
|
||||
{ value: 1324, name: 'analysis.sunday' }
|
||||
]
|
||||
set(
|
||||
barOptionsData,
|
||||
'xAxis.data',
|
||||
data.map((v) => t(v.name))
|
||||
)
|
||||
set(barOptionsData, 'series', [
|
||||
{
|
||||
name: t('analysis.activeQuantity'),
|
||||
data: data.map((v) => v.value),
|
||||
type: 'bar'
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
const getAllApi = async () => {
|
||||
await Promise.all([
|
||||
getCount(),
|
||||
getProject(),
|
||||
getNotice(),
|
||||
getShortcut(),
|
||||
getUserAccessSource(),
|
||||
getWeeklyUserActivity()
|
||||
])
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
const handleProjectClick = (message: string) => {
|
||||
window.open(`https://${message}`, '_blank')
|
||||
}
|
||||
|
||||
const handleShortcutClick = (url: string) => {
|
||||
router.push(url)
|
||||
}
|
||||
|
||||
getAllApi()
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -116,8 +116,8 @@
|
|||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<!-- <el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider> -->
|
||||
<!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item>
|
||||
<div class="w-[100%] flex justify-between">
|
||||
<Icon
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
prop="processInstanceId"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column align="center" label="任务编号" prop="id" :show-overflow-tooltip="true" />
|
||||
<!-- <el-table-column align="center" label="任务编号" prop="id" :show-overflow-tooltip="true" /> -->
|
||||
<el-table-column align="center" label="操作" fixed="right" width="80">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleAudit(scope.row)">办理</el-button>
|
||||
|
|
|
|||
|
|
@ -31,21 +31,22 @@
|
|||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="160">
|
||||
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="220">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||
{{ scope.row.name }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="信用统一代码" prop="creditNo" width="180" />
|
||||
<el-table-column align="center" label="客户来源" prop="source" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机" align="center" prop="mobile" width="120" />
|
||||
<el-table-column label="电话" align="center" prop="telephone" width="130" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" width="180" />
|
||||
<!-- <el-table-column label="手机" align="center" prop="mobile" width="120" />-->
|
||||
<!-- <el-table-column label="电话" align="center" prop="telephone" width="130" />-->
|
||||
<!-- <el-table-column label="邮箱" align="center" prop="email" width="180" />-->
|
||||
<el-table-column align="center" label="客户级别" prop="level" width="135">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
|
||||
|
|
|
|||
|
|
@ -29,21 +29,22 @@
|
|||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="160">
|
||||
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="220">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||
{{ scope.row.name }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="信用统一代码" prop="creditNo" width="180" />
|
||||
<el-table-column align="center" label="客户来源" prop="source" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机" align="center" prop="mobile" width="120" />
|
||||
<el-table-column label="电话" align="center" prop="telephone" width="130" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" width="180" />
|
||||
<!-- <el-table-column label="手机" align="center" prop="mobile" width="120" />-->
|
||||
<!-- <el-table-column label="电话" align="center" prop="telephone" width="130" />-->
|
||||
<!-- <el-table-column label="邮箱" align="center" prop="email" width="180" />-->
|
||||
<el-table-column align="center" label="客户级别" prop="level" width="135">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
|
||||
|
|
|
|||
|
|
@ -43,21 +43,22 @@
|
|||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="160">
|
||||
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="220">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||
{{ scope.row.name }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="信用统一代码" prop="creditNo" width="180" />
|
||||
<el-table-column align="center" label="客户来源" prop="source" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机" align="center" prop="mobile" width="120" />
|
||||
<el-table-column label="电话" align="center" prop="telephone" width="130" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" width="180" />
|
||||
<!-- <el-table-column label="手机" align="center" prop="mobile" width="120" />-->
|
||||
<!-- <el-table-column label="电话" align="center" prop="telephone" width="130" />-->
|
||||
<!-- <el-table-column label="邮箱" align="center" prop="email" width="180" />-->
|
||||
<el-table-column align="center" label="客户级别" prop="level" width="135">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
|
||||
|
|
|
|||
|
|
@ -93,11 +93,11 @@ const leftSides = ref([
|
|||
// menu: 'receivablePlanRemind',
|
||||
// count: receivablePlanRemindCount
|
||||
// },
|
||||
// {
|
||||
// name: '即将到期的合同',
|
||||
// menu: 'contractRemind',
|
||||
// count: contractRemindCount
|
||||
// }
|
||||
{
|
||||
name: '即将到期的合同',
|
||||
menu: 'contractRemind',
|
||||
count: contractRemindCount
|
||||
}
|
||||
])
|
||||
|
||||
/** 侧边点击 */
|
||||
|
|
@ -113,13 +113,13 @@ const getCount = () => {
|
|||
(count) => (customerPutPoolRemindCount.value = count)
|
||||
)
|
||||
CustomerApi.getFollowCustomerCount().then((count) => (customerFollowCount.value = count))
|
||||
ClueApi.getFollowClueCount().then((count) => (clueFollowCount.value = count))
|
||||
// ClueApi.getFollowClueCount().then((count) => (clueFollowCount.value = count))
|
||||
ContractApi.getAuditContractCount().then((count) => (contractAuditCount.value = count))
|
||||
ContractApi.getRemindContractCount().then((count) => (contractRemindCount.value = count))
|
||||
ReceivableApi.getAuditReceivableCount().then((count) => (receivableAuditCount.value = count))
|
||||
ReceivablePlanApi.getReceivablePlanRemindCount().then(
|
||||
(count) => (receivablePlanRemindCount.value = count)
|
||||
)
|
||||
// ContractApi.getRemindContractCount().then((count) => (contractRemindCount.value = count))
|
||||
// ReceivableApi.getAuditReceivableCount().then((count) => (receivableAuditCount.value = count))
|
||||
// ReceivablePlanApi.getReceivablePlanRemindCount().then(
|
||||
// (count) => (receivablePlanRemindCount.value = count)
|
||||
// )
|
||||
}
|
||||
|
||||
/** 激活时 */
|
||||
|
|
|
|||
|
|
@ -120,7 +120,19 @@ const open = async (id?: number, customerId?: number) => {
|
|||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await BillTemplateApi.getBillTemplate(id)
|
||||
formData.value.products = formData.value.productItems
|
||||
formData.value.products = formData.value.productItems.map(v => {
|
||||
return {
|
||||
category: v.category,
|
||||
detailType: v.detailType,
|
||||
productName: v.name,
|
||||
productId: v.productId,
|
||||
productInvoice: v.productInvoice,
|
||||
productInvoiceItems: v.productInvoiceItems,
|
||||
serviceFeeInvoice: v.serviceFeeInvoice,
|
||||
serviceFeeInvoiceItems: v.serviceFeeInvoiceItems,
|
||||
productUnit: v.unit
|
||||
}
|
||||
})
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="产品开具项目" fixed="right" min-width="140">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoiceItems`" class="mb-0px!">
|
||||
<el-form-item :prop="`${$index}.productInvoiceItems`" :rules="formRules.productInvoiceItems" class="mb-0px!">
|
||||
<el-select v-model="row.productInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE_ITEMS)"
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="服务费票据" prop="serviceFeeInvoice" fixed="right" min-width="140">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoice`" class="mb-0px!">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoice`" :rules="formRules.serviceFeeInvoice" class="mb-0px!">
|
||||
<el-select v-model="row.serviceFeeInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE)"
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="服务开具项目" prop="serviceFeeInvoiceItems" fixed="right" min-width="140">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoiceItems`" class="mb-0px!">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoiceItems`" :rules="formRules.serviceFeeInvoiceItems" class="mb-0px!">
|
||||
<el-select v-model="row.serviceFeeInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE_ITEMS)"
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
</el-table>
|
||||
</el-form>
|
||||
<el-row justify="center" class="mt-3" v-if="!disabled">
|
||||
<el-button @click="handleAdd" round>+ 添加产品</el-button>
|
||||
<el-button @click="handleAdd" type="primary" round>+ 添加产品</el-button>
|
||||
</el-row>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
|
|
@ -112,7 +112,7 @@ const formLoading = ref(false) // 表单的加载中
|
|||
const formData = ref([])
|
||||
const formRules = reactive({
|
||||
productInvoice: [{ required: true, message: '产品票据不能为空', trigger: 'change' }],
|
||||
getIntDictOptions: [{ required: true, message: '产品开具项目不能为空', trigger: 'change' }],
|
||||
productInvoiceItems: [{ required: true, message: '产品开具项目不能为空', trigger: 'change' }],
|
||||
serviceFeeInvoice: [{ required: true, message: '服务费票据不能为空', trigger: 'change' }],
|
||||
serviceFeeInvoiceItems: [{ required: true, message: '服务开具项目不能为空', trigger: 'change' }]
|
||||
})
|
||||
|
|
@ -130,7 +130,6 @@ watch(
|
|||
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const getList = (val: []) => {
|
||||
console.log('%csrc/views/crm/billtemplate/components/index.vue:133 object', 'color: #007acc;', formData.value);
|
||||
for(let i = formData.value.length - 1; i >= 0; i--) {
|
||||
let obj = formData.value[i]
|
||||
if(!val.some(v => v.id === obj.productId)) formData.value.splice(i, 1)
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="creator" />
|
||||
<el-table-column label="创建人" align="center" prop="creatorName" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@
|
|||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="商机名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入商机名称" />
|
||||
<el-input v-model="formData.name" :disabled="type" clearable placeholder="请输入商机名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="负责人" prop="ownerUserId">
|
||||
<el-form-item label="线索拓展人" prop="ownerUserId">
|
||||
<el-select
|
||||
v-model="formData.ownerUserId"
|
||||
:disabled="formType"
|
||||
placeholder="请选择负责人"
|
||||
disabled
|
||||
placeholder="请选择线索拓展人"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
|
|
@ -34,7 +34,9 @@
|
|||
<el-form-item label="需求提交人" prop="requestorUserId">
|
||||
<el-select
|
||||
v-model="formData.requestorUserId"
|
||||
:disabled="formType"
|
||||
clearable
|
||||
|
||||
:disabled="formType || type"
|
||||
placeholder="请选择需求提交人"
|
||||
class="w-1/1"
|
||||
>
|
||||
|
|
@ -50,8 +52,10 @@
|
|||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<el-select
|
||||
:disabled="formData.customerDefault"
|
||||
:disabled="formData.customerDefault || type"
|
||||
v-model="formData.customerId"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择客户"
|
||||
class="w-1/1"
|
||||
>
|
||||
|
|
@ -70,8 +74,10 @@
|
|||
<el-tree-select
|
||||
v-model="formData.deptId"
|
||||
:data="deptTree"
|
||||
:disabled="type"
|
||||
:props="defaultProps"
|
||||
filterable
|
||||
clearable
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
|
|
@ -85,7 +91,7 @@
|
|||
placeholder="请选择商机状态组"
|
||||
clearable
|
||||
class="w-1/1"
|
||||
:disabled="formType"
|
||||
:disabled="formType || type"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusTypeList"
|
||||
|
|
@ -101,6 +107,7 @@
|
|||
<el-date-picker
|
||||
v-model="formData.dealTime"
|
||||
type="date"
|
||||
:disabled="type"
|
||||
value-format="x"
|
||||
placeholder="选择预计成交日期"
|
||||
class="!w-1/1"
|
||||
|
|
@ -109,7 +116,7 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="销售阶段" prop="saleStage">
|
||||
<el-select v-model="formData.saleStage" placeholder="请选择销售阶段">
|
||||
<el-select v-model="formData.saleStage" :disabled="type" clearable placeholder="请选择销售阶段">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('sale_stage')"
|
||||
:key="dict.value"
|
||||
|
|
@ -119,11 +126,12 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账期" prop="paymentTerm">
|
||||
<el-select v-model="formData.paymentTerm" @change="changePayment" placeholder="请选择账期">
|
||||
<el-form-item label="授信方式" prop="creditMethod">
|
||||
<el-select v-model="formData.creditMethod" :disabled="type" clearable placeholder="请选择授信方式">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PAYMENT_TERM)"
|
||||
v-for="dict in getIntDictOptions('credit_method')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -132,10 +140,10 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信方式" prop="creditMethod">
|
||||
<el-select v-model="formData.creditMethod" placeholder="请选择授信方式">
|
||||
<el-form-item label="账期" prop="paymentTerm">
|
||||
<el-select v-model="formData.paymentTerm" :disabled="type" @change="changePayment" clearable placeholder="请选择账期">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_method')"
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PAYMENT_TERM)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -163,20 +171,20 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="技术需求支持" prop="techSupport">
|
||||
<el-radio-group v-model="formData.techSupport">
|
||||
<el-radio-group v-model="formData.techSupport" :disabled="type">
|
||||
<el-radio
|
||||
v-for="dict in getBoolDictOptions('tech_support')"
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.TECH_SUPPORT)"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
:value="dict.value == 2 ? true : false"
|
||||
>
|
||||
{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="formData.remark" placeholder="请输入备注" />
|
||||
<el-input type="textarea" :disabled="type" v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -187,7 +195,7 @@
|
|||
<BusinessProductForm
|
||||
ref="productFormRef"
|
||||
:products="formData.products"
|
||||
:disabled="disabled"
|
||||
:disabled="type"
|
||||
@success="setList"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
|
@ -195,7 +203,7 @@
|
|||
</ContentWrap>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线上总金额" prop="onlinePrice">
|
||||
<el-form-item label="线上总金额(元)" prop="onlinePrice">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.onlinePrice"
|
||||
|
|
@ -204,7 +212,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线下总金额" prop="offlinePrice">
|
||||
<el-form-item label="线下总金额(元)" prop="offlinePrice">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.offlinePrice"
|
||||
|
|
@ -213,7 +221,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="总金额" prop="totalPrice">
|
||||
<el-form-item label="总金额(元)" prop="totalPrice">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.totalPrice"
|
||||
|
|
@ -223,7 +231,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<div style="text-align: right" v-if="!type">
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="goBack">取 消</el-button>
|
||||
</div>
|
||||
|
|
@ -242,7 +250,7 @@ import { useUserStore } from '@/store/modules/user';
|
|||
import { defaultProps, handleTree } from '@/utils/tree';
|
||||
import BusinessProductForm from './components/BusinessProductForm.vue';
|
||||
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils';
|
||||
import { number } from 'vue-types';
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
const { t } = useI18n();
|
||||
|
|
@ -275,21 +283,28 @@ const formData = ref({
|
|||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
techSupport: undefined,
|
||||
techSupport: false,
|
||||
products: []
|
||||
});
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '商机名称不能为空', trigger: 'blur' }],
|
||||
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||
ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
||||
statusTypeId: [{ required: true, message: '商机状态组不能为空', trigger: 'blur' }]
|
||||
statusTypeId: [{ required: true, message: '商机状态组不能为空', trigger: 'blur' }],
|
||||
saleStage: [{ required: true, message: '销售阶段不能为空', trigger: 'change' }],
|
||||
paymentTerm: [{ required: true, message: '账期不能为空', trigger: 'change' }],
|
||||
creditMethod: [{ required: true, message: '授信方式不能为空', trigger: 'change' }],
|
||||
techSupport: [{ required: true, message: '技术需求支持不能为空', trigger: 'change' }],
|
||||
|
||||
});
|
||||
const formRef = ref();
|
||||
const userOptions = ref<UserApi.UserVO[]>([]);
|
||||
const statusTypeList = ref([]);
|
||||
const customerList = ref([]);
|
||||
const deptTree = ref();
|
||||
|
||||
const props = defineProps({
|
||||
type: propTypes.number.def(undefined)
|
||||
})
|
||||
const subTabsName = ref('product');
|
||||
const productFormRef = ref();
|
||||
|
||||
|
|
@ -323,8 +338,7 @@ watch(
|
|||
watch(
|
||||
() => formData.value.totalPrice,
|
||||
(newProducts) => {
|
||||
console.log('%csrc/views/crm/business/BusinessForm.vue:326 111', 'color: #007acc;', 111);
|
||||
formData.value.creditLimit = parseInt(newProducts / 365 * formData.value.creditCalcCycle)
|
||||
formData.value.creditLimit = parseInt(newProducts / 365 * formData.value.creditCalcCycle) || ''
|
||||
|
||||
},
|
||||
{ deep: true }
|
||||
|
|
@ -349,9 +363,6 @@ const open = async (id?: number, customerId?: number) => {
|
|||
}
|
||||
}
|
||||
|
||||
if (!formType.value) {
|
||||
formData.value.ownerUserId = useUserStore().getUser.id;
|
||||
}
|
||||
};
|
||||
|
||||
const setList = (newProducts) => {
|
||||
|
|
@ -370,10 +381,12 @@ const daysInMonth = new Date(currentDate.getFullYear(), currentMonth, 0).getDate
|
|||
const { push } = useRouter()
|
||||
|
||||
const submitForm = async () => {
|
||||
if (!productFormRef.value) return;
|
||||
const valid = await productFormRef.value.validate();
|
||||
const productFormRef1 = await productFormRef.value.validate();
|
||||
if (!productFormRef1) return;
|
||||
const valid = await formRef.value.validate();
|
||||
if (!valid) return;
|
||||
|
||||
|
||||
formLoading.value = true;
|
||||
try {
|
||||
const data = formData.value as unknown as BusinessApi.BusinessVO;
|
||||
|
|
@ -407,6 +420,7 @@ const resetForm = () => {
|
|||
totalPrice: 0,
|
||||
products: [],
|
||||
contactId: undefined,
|
||||
techSupport: 1,
|
||||
customerDefault: false
|
||||
};
|
||||
formRef.value?.resetFields();
|
||||
|
|
@ -414,11 +428,11 @@ const resetForm = () => {
|
|||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
console.log('%csrc/views/crm/business/BusinessForm.vue:406 getStrDictOptions(DICT_TYPE.PAYMENT_TERM)', 'color: #007acc;', getStrDictOptions(DICT_TYPE.PAYMENT_TERM));
|
||||
const customerId = route.query.customerId;
|
||||
formType.value = route.query.id;
|
||||
formData.value.ownerUserId = customerId ? '' : useUserStore().getUser.id;
|
||||
formType.value = route.query.id || route.params.id;
|
||||
if (formType.value) open(formType.value, customerId)
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList();
|
||||
customerList.value = await CustomerApi.getSelfCustomerSimpleList();
|
||||
statusTypeList.value = await BusinessStatusApi.getBusinessStatusTypeSimpleList();
|
||||
userOptions.value = await UserApi.getSimpleUserList();
|
||||
deptTree.value = handleTree(await DeptApi.getSimpleDeptList());
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@
|
|||
<el-option
|
||||
v-for="item in statusList"
|
||||
:key="item.id"
|
||||
:label="item.name + '(赢单率:' + item.percent + '%)'"
|
||||
:label="item.name + '(成交率:' + item.percent + '%)'"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option
|
||||
v-for="item in BusinessStatusApi.DEFAULT_STATUSES"
|
||||
:key="item.endStatus"
|
||||
:label="item.name + '(赢单率:' + item.percent + '%)'"
|
||||
:label="item.name + '(成交率:' + item.percent + '%)'"
|
||||
:value="-item.endStatus"
|
||||
/>
|
||||
</el-select>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<Icon class="mr-5px" icon="ep:opportunity" />
|
||||
创建商机
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
@click="openBusinessModal"
|
||||
v-hasPermi="['crm:contact:create-business']"
|
||||
v-if="queryParams.contactId"
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
v-if="queryParams.contactId"
|
||||
>
|
||||
<Icon class="mr-5px" icon="ep:remove" />解除关联
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
<el-table-column
|
||||
label="商机金额"
|
||||
align="center"
|
||||
prop="price"
|
||||
prop="totalPrice"
|
||||
:formatter="erpPriceTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column label="客户名称" align="center" prop="customerName" />
|
||||
|
|
@ -57,19 +57,13 @@
|
|||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 关联商机选择弹框 -->
|
||||
<BusinessListModal
|
||||
ref="businessModalRef"
|
||||
:customer-id="props.customerId"
|
||||
@success="createContactBusinessList"
|
||||
/>
|
||||
<BusinessForm ref="businessModalRef" :customerId="props.bizId" @success="getData" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as BusinessApi from '@/api/crm/business'
|
||||
import * as ContactApi from '@/api/crm/contact'
|
||||
import BusinessForm from './../BusinessForm.vue'
|
||||
import BusinessForm from './BusinessListModal.vue'
|
||||
import { BizTypeEnum } from '@/api/crm/permission'
|
||||
import BusinessListModal from './BusinessListModal.vue'
|
||||
import { erpPriceTableColumnFormatter } from '@/utils'
|
||||
|
||||
const message = useMessage() // 消息
|
||||
|
|
@ -120,6 +114,11 @@ const getList = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
const getData = (val,data) => {
|
||||
list.value = data
|
||||
console.log('%csrc/views/crm/business/components/BusinessList.vue:118 val', 'color: #007acc;', val, data.value);
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<Dialog title="关联商机" v-model="dialogVisible">
|
||||
<Dialog title="关联商机" v-model="dialogVisible" width="50%">
|
||||
<!-- 搜索工作栏 -->
|
||||
<ContentWrap>
|
||||
<el-form
|
||||
|
|
@ -21,9 +21,7 @@
|
|||
<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" @click="openForm()" v-hasPermi="['crm:business:create']">
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
|
@ -69,7 +67,7 @@
|
|||
</template>
|
||||
|
||||
<!-- 表单弹窗:添加 -->
|
||||
<BusinessForm ref="formRef" @success="getList" />
|
||||
<!-- <BusinessForm ref="formRef" @success="getList" /> -->
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
|
|||
|
|
@ -10,26 +10,35 @@
|
|||
>
|
||||
<el-table :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||
<el-table-column label="产品名称" align="left" prop="productName" width="200" />
|
||||
|
||||
<el-table-column label="产品类别" align="center" prop="category" width="160">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_CATEGORY" :value="scope.row.category" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品明细" align="center" prop="detailType" width="160">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE" :value="scope.row.detailType" />
|
||||
<el-table-column label="产品明细" align="center" prop="detailType" width="240">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
|
||||
<el-select v-model="row.detailType" placeholder="请选择状态" >
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" min-width="80">
|
||||
<el-table-column label="单位" align="center" min-width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="scope.row.productUnit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线上价格(元)" fixed="right" min-width="140">
|
||||
<el-table-column label="线上价格(元)" fixed="right" min-width="100">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.onlinePrice`" class="mb-0px!">
|
||||
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
||||
<el-input-number
|
||||
v-model="row.onlinePrice"
|
||||
controls-position="right"
|
||||
|
|
@ -40,9 +49,9 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线下价格(元)" fixed="right" min-width="140">
|
||||
<el-table-column label="线下价格(元)" fixed="right" min-width="100">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.offlinePrice`" class="mb-0px!">
|
||||
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
||||
<el-input-number
|
||||
v-model="row.offlinePrice"
|
||||
controls-position="right"
|
||||
|
|
@ -53,14 +62,14 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合计" prop="totalPrice" fixed="right" min-width="140">
|
||||
<el-table-column label="合计(元)" prop="totalPrice" fixed="right" min-width="100">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.totalPrice`" class="mb-0px!">
|
||||
<el-input disabled v-model="row.totalPrice" :formatter="erpPriceInputFormatter" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!disabled">
|
||||
<template #default="{ $index }">
|
||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||
</template>
|
||||
|
|
@ -68,7 +77,7 @@
|
|||
</el-table>
|
||||
</el-form>
|
||||
<el-row justify="center" class="mt-3" v-if="!disabled">
|
||||
<el-button @click="handleAdd" round>+ 添加产品</el-button>
|
||||
<el-button @click="handleAdd" type="primary" round>+ 添加产品</el-button>
|
||||
</el-row>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ProductForm ref="productRef" @success="getList" />
|
||||
|
|
@ -84,8 +93,11 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict';
|
|||
const formLoading = ref(false); // 表单的加载中
|
||||
const formData = ref([]); // 表单数据
|
||||
const formRules = reactive({
|
||||
detailType: [{ required: true, message: '产品明细不能为空', trigger: 'blur' }],
|
||||
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
|
||||
businessPrice: [{ required: true, message: '合同价格不能为空', trigger: 'blur' }]
|
||||
businessPrice: [{ required: true, message: '合同价格不能为空', trigger: 'blur' }],
|
||||
onlinePrice: [{ required: true, message: '线上价格(元)不能为空', trigger: 'blur' }],
|
||||
offlinePrice: [{ required: true, message: '线下价格(元)不能为空', trigger: 'blur' }]
|
||||
});
|
||||
const formRef = ref(null); // 表单 Ref
|
||||
const productList = ref<ProductApi.ProductVO[]>([]); // 产品列表
|
||||
|
|
|
|||
|
|
@ -1,55 +1,11 @@
|
|||
<template>
|
||||
<ContentWrap>
|
||||
<el-collapse v-model="activeNames">
|
||||
<el-collapse-item name="basicInfo">
|
||||
<template #title>
|
||||
<span class="text-base font-bold">基本信息</span>
|
||||
</template>
|
||||
<el-descriptions :column="4">
|
||||
<el-descriptions-item label="商机姓名">{{ business.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="客户名称">{{ business.customerName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="商机金额(元)">
|
||||
{{ erpPriceInputFormatter(business.totalPrice) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预计成交日期">
|
||||
{{ formatDate(business.dealTime) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="下次联系时间">
|
||||
{{ formatDate(business.contactNextTime) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="商机状态组">
|
||||
{{ business.statusTypeName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="商机阶段">{{ business.statusName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{ business.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item name="systemInfo">
|
||||
<template #title>
|
||||
<span class="text-base font-bold">系统信息</span>
|
||||
</template>
|
||||
<el-descriptions :column="4">
|
||||
<el-descriptions-item label="负责人">{{ business.ownerUserName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="最后跟进时间">
|
||||
{{ formatDate(business.contactLastTime) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label=""> </el-descriptions-item>
|
||||
<el-descriptions-item label=""> </el-descriptions-item>
|
||||
<el-descriptions-item label="创建人">{{ business.creatorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ formatDate(business.createTime) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间">
|
||||
{{ formatDate(business.updateTime) }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<BusinessForm :type="1" />
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as BusinessApi from '@/api/crm/business'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import BusinessForm from '../BusinessForm.vue'
|
||||
import { erpPriceInputFormatter } from '@/utils'
|
||||
|
||||
const { business } = defineProps<{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<BusinessDetailsHeader v-loading="loading" :business="business">
|
||||
<el-button v-if="permissionListRef?.validateWrite" @click="openForm('update', business.id)">
|
||||
<!-- <el-button v-if="permissionListRef?.validateWrite" @click="openForm('update', business.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
<el-button
|
||||
v-if="permissionListRef?.validateWrite"
|
||||
:disabled="business.endStatus"
|
||||
|
|
@ -31,12 +31,12 @@
|
|||
:customer-id="business.customerId"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="产品">
|
||||
<!-- <el-tab-pane label="产品">
|
||||
<BusinessProductList :business="business" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同" lazy>
|
||||
</el-tab-pane> -->
|
||||
<!-- <el-tab-pane label="合同" lazy>
|
||||
<ContractList :biz-id="business.id!" :biz-type="BizTypeEnum.CRM_BUSINESS" />
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="操作日志">
|
||||
<OperateLogV2 :log-list="logList" />
|
||||
</el-tab-pane>
|
||||
|
|
@ -53,7 +53,6 @@
|
|||
</el-col>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<BusinessForm ref="formRef" @success="getBusiness" />
|
||||
<BusinessUpdateStatusForm ref="statusFormRef" @success="getBusiness" />
|
||||
<CrmTransferForm ref="transferFormRef" :biz-type="BizTypeEnum.CRM_BUSINESS" @success="close" />
|
||||
</template>
|
||||
|
|
@ -95,9 +94,10 @@ const getBusiness = async () => {
|
|||
}
|
||||
|
||||
/** 编辑 */
|
||||
const { push } = useRouter()
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
push({ name: 'CrmBusinesseEdit', query: { id: business.id, customerId: business.value.customerId } })
|
||||
}
|
||||
|
||||
/** 变更商机状态 */
|
||||
|
|
|
|||
|
|
@ -52,15 +52,15 @@
|
|||
<el-tab-pane label="下属负责的" name="3" />
|
||||
</el-tabs>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||
<el-table-column align="center" fixed="left" label="商机名称" prop="name" width="160">
|
||||
<el-table-column align="center" fixed="left" label="商机名称" prop="name" width="200">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||
{{ scope.row.name }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="left" label="客户名称" prop="customerName" width="120">
|
||||
<template #default="scope">
|
||||
<el-table-column align="center" label="客户名称" prop="customerName" width="220">
|
||||
<!-- <template #default="scope">
|
||||
<el-link
|
||||
:underline="false"
|
||||
type="primary"
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
>
|
||||
{{ scope.row.customerName }}
|
||||
</el-link>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:formatter="erpPriceTableColumnFormatter"
|
||||
|
|
@ -118,14 +118,12 @@
|
|||
<el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
fixed="right"
|
||||
label="商机状态组"
|
||||
prop="statusTypeName"
|
||||
width="140"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
fixed="right"
|
||||
label="商机阶段"
|
||||
prop="statusName"
|
||||
width="120"
|
||||
|
|
|
|||
|
|
@ -42,12 +42,12 @@
|
|||
<el-text v-else>{{ row.name }}</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="140" align="center" label="赢单率(%)" prop="percent">
|
||||
<el-table-column width="140" align="center" label="成交率(%)" prop="percent">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-if="!row.endStatus"
|
||||
v-model="row.percent"
|
||||
placeholder="请输入赢单率"
|
||||
placeholder="请输入成交率"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
:max="100"
|
||||
|
|
|
|||
|
|
@ -74,13 +74,6 @@
|
|||
<el-input v-model="formData.wechat" placeholder="请输入微信" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="QQ" prop="qq">
|
||||
<el-input v-model="formData.qq" placeholder="请输入 QQ" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职位" prop="post">
|
||||
<el-input v-model="formData.post" placeholder="请输入职位" />
|
||||
|
|
@ -99,8 +92,6 @@
|
|||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select v-model="formData.sex" placeholder="请选择" class="w-1/1">
|
||||
|
|
@ -113,7 +104,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="直属上级" prop="parentId">
|
||||
<el-select v-model="formData.parentId" filterable placeholder="请选择直属上级" class="w-1/1">
|
||||
<el-option
|
||||
|
|
@ -125,7 +116,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信" prop="wechat">
|
||||
<!-- <el-form-item label="微信" prop="wechat">
|
||||
<el-input
|
||||
v-model="queryParams.wechat"
|
||||
class="!w-240px"
|
||||
|
|
@ -64,8 +64,8 @@
|
|||
placeholder="请输入微信"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子邮箱" prop="email">
|
||||
</el-form-item>-->
|
||||
<!-- <el-form-item label="电子邮箱" prop="email">
|
||||
<el-input
|
||||
v-model="queryParams.email"
|
||||
class="!w-240px"
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
placeholder="请输入电子邮箱"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
|
|
@ -116,8 +116,8 @@
|
|||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="left" label="客户名称" prop="customerName" width="120">
|
||||
<template #default="scope">
|
||||
<el-table-column align="center" fixed="left" label="客户名称" prop="customerName" width="220">
|
||||
<!-- <template #default="scope">
|
||||
<el-link
|
||||
:underline="false"
|
||||
type="primary"
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
>
|
||||
{{ scope.row.customerName }}
|
||||
</el-link>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="手机" prop="mobile" width="120" />
|
||||
<el-table-column align="center" label="电话" prop="telephone" width="130" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,489 @@
|
|||
<template>
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-row>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="合同查询" prop="quotationId">
|
||||
<el-select
|
||||
@change="handleQuotationChange"
|
||||
v-model="formData.quotationId"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in quotationList"
|
||||
:key="item.id"
|
||||
:label="item.no"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<el-select
|
||||
v-model="formData.customerId"
|
||||
disabled=""
|
||||
placeholder="请选择客户"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in contactList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="协议编码" prop="name">
|
||||
<el-input v-model="formData.processInstanceId" disabled placeholder="协议编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同状态" prop="quotationId">
|
||||
<el-select v-model="formData.auditStatus" disabled clearable placeholder="请选择合同状态">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="协议截止日期" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
disabled
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="请选择协议截止日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="变更项目" prop="endTime">
|
||||
<el-radio-group v-model="formData.changeItem">
|
||||
<el-radio :value="1">额度</el-radio>
|
||||
<el-radio :value="2">授权人</el-radio>
|
||||
<el-radio :value="3">延期</el-radio>
|
||||
<el-radio :value="4">终止</el-radio>
|
||||
<el-radio :value="5">关联</el-radio>
|
||||
<el-radio :value="6">重签</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 子表的表单 -->
|
||||
<ContentWrap>
|
||||
<ContractChangeLimit
|
||||
v-if="formData.changeItem == 1"
|
||||
ref="limitFormRef"
|
||||
:data="formData"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
<div v-if="formData.changeItem == 2">
|
||||
<ContentWrap style="border: none">
|
||||
甲方现授权人信息
|
||||
</ContentWrap>
|
||||
<ContractAuthPersonInfo
|
||||
ref="personDataRef"
|
||||
:products="formData.contractAAuthorizedPersons"
|
||||
/>
|
||||
<ContentWrap style="border: none">
|
||||
甲方授权人
|
||||
</ContentWrap>
|
||||
<ContractBAuthorizedPersonForm ref="ContractBAuthorizedPersonFormRef" :customerId="formData.customerId" :contract-id="formData.id" />
|
||||
</div>
|
||||
<ContracExtension ref="contractExtensionFormRef" v-if="formData.changeItem == 3" :data="formData" />
|
||||
<ContractStop ref="contractStopFormRef" :formData="formData" v-if="formData.changeItem == 4" />
|
||||
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef1" v-if="formData.changeItem == 5" :data="formData.contractAAuthorizedCompanys" />
|
||||
<ContractForm ref="contractFormRef" :type="1" :formData="formData" v-if="formData.changeItem == 6" />
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="goBack">取 消</el-button>
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import * as ContactApi from '@/api/crm/contact'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
||||
import { erpPriceMultiply, erpPriceInputFormatter, jsonParse } from '@/utils'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import ContractChangeLimit from '@/views/crm/contract/components/ContractChangeLimit.vue'
|
||||
import ContractAuthPersonInfo from '@/views/crm/contract/components/ContractAuthPersonInfo.vue'
|
||||
import ContracExtension from '@/views/crm/contract/components/ContractExtension.vue'
|
||||
import ContractStop from '@/views/crm/contract/components/ContracStop.vue'
|
||||
import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue'
|
||||
import ContractAAuthorizedCompanyForm from './components/ContractAAuthorizedCompanyForm.vue'
|
||||
import ContractBAuthorizedPersonForm from './components/ContractAAuthorizedPersonForm.vue'
|
||||
import ContractForm from './ContractForm.vue'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
authPerson: [],
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
quotationId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
penaltyRate: undefined,
|
||||
latePaymentRate: undefined,
|
||||
settleMethod: undefined,
|
||||
lastPayDate: undefined,
|
||||
contractTerm: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
signEmail: undefined,
|
||||
signWechat: undefined,
|
||||
offlinePrice: undefined,
|
||||
onlinePrice: undefined,
|
||||
ownerUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
pricingUserId: undefined,
|
||||
afterSaleUserId: undefined,
|
||||
collUserId: undefined,
|
||||
totalPrice: undefined,
|
||||
contractBody: undefined,
|
||||
contractAgreement: undefined,
|
||||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
changeItem: 1,
|
||||
products: []
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||
orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }],
|
||||
ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const quotationList = ref<QuotationVO[]>([])
|
||||
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||
|
||||
/** 子表的表单 */
|
||||
const subTabsName = ref('limit')
|
||||
const ContractBAuthorizedPersonFormRef = ref()
|
||||
const contractAAuthorizedCompanyFormRef1 = ref()
|
||||
const limitFormRef = ref()
|
||||
const contractExtensionFormRef = ref()
|
||||
const contractStopFormRef = ref()
|
||||
const contractFormRef = ref()
|
||||
|
||||
/** 计算 discountPrice、totalPrice 价格 */
|
||||
watch(
|
||||
() => formData.value,
|
||||
(val) => {
|
||||
if (!val) {
|
||||
return
|
||||
}
|
||||
// const totalPrice = val.products.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
||||
// 赋值
|
||||
// formData.value.totalPrice = totalPrice
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string) => {
|
||||
if (type) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
let data = await ContractApi.getContract(type)
|
||||
formData.value = Object.assign(formData.value, data)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
// const Authalid = await contractAAuthorizedCompanyFormRef.value.validate()
|
||||
// if (!Authalid) return
|
||||
|
||||
// const Authalid1 = await contractAAuthorizedCompanyFormRef1.value.validate()
|
||||
// if (!Authalid1) return
|
||||
|
||||
if(ContractBAuthorizedPersonFormRef.value) {
|
||||
const Authalid = await ContractBAuthorizedPersonFormRef.value.validate()
|
||||
if (!Authalid) return
|
||||
}
|
||||
|
||||
if(contractAAuthorizedCompanyFormRef1.value) {
|
||||
const Authalid1 = await contractAAuthorizedCompanyFormRef1.value.validate()
|
||||
if (!Authalid1) return
|
||||
}
|
||||
|
||||
if(limitFormRef.value) {
|
||||
const limitValid = await limitFormRef.value.validate()
|
||||
if (!limitValid) return
|
||||
}
|
||||
|
||||
if(contractExtensionFormRef.value) {
|
||||
const extensionValid = await contractExtensionFormRef.value.validate()
|
||||
if (!extensionValid) return
|
||||
|
||||
}
|
||||
|
||||
if(contractStopFormRef.value) {
|
||||
const stopValid = await contractStopFormRef.value.validate()
|
||||
if (!stopValid) return
|
||||
|
||||
}
|
||||
|
||||
if(contractFormRef.value) {
|
||||
const contractValid = await contractFormRef.value.validate()
|
||||
if (!contractValid) return
|
||||
|
||||
}
|
||||
|
||||
|
||||
// const stopValid = await contractStopFormRef.value.validate()
|
||||
// if (!stopValid) return
|
||||
|
||||
// const contractValid = await contractFormRef.value.validate()
|
||||
// if (!contractValid) return
|
||||
|
||||
|
||||
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = unref(JSON.parse(JSON.stringify(formData.value))) as unknown as ContractApi.ContractVO
|
||||
// 拼接子表的数据
|
||||
let proChangeObj = {
|
||||
1: limitFormRef,
|
||||
2: ContractBAuthorizedPersonFormRef,
|
||||
3: contractExtensionFormRef,
|
||||
4: contractStopFormRef,
|
||||
5: contractAAuthorizedCompanyFormRef1,
|
||||
6: contractFormRef
|
||||
}
|
||||
let dataFormList = proChangeObj[formData.value.changeItem].value.getData()
|
||||
data[proChangeObj[formData.value.changeItem]] = dataFormList
|
||||
if(formData.value.changeItem == 1) {
|
||||
data.changeAmount = dataFormList.changeAmount
|
||||
data.changeAmountDeadline = dataFormList.changeAmountDeadline
|
||||
} else if(formData.value.changeItem == 2) {
|
||||
let ids = []
|
||||
dataFormList.map(item => {
|
||||
ids.push(item.id)
|
||||
})
|
||||
data.afterAuthorizerId = ids.join(',')
|
||||
} else if(formData.value.changeItem == 3) {
|
||||
data.agreementDeadline = dataFormList.agreementDeadline
|
||||
data.extensionYears = dataFormList.extensionYears
|
||||
data.extensionDate = dataFormList.extensionDate
|
||||
data.note = dataFormList.note
|
||||
} else if(formData.value.changeItem == 4) {
|
||||
data.terminationDate = dataFormList.terminationDate
|
||||
data.terminationReason = dataFormList.terminationReason
|
||||
data.note = dataFormList.note
|
||||
} else if(formData.value.changeItem == 5) {
|
||||
let ids = []
|
||||
dataFormList.map(item => {
|
||||
ids.push(item.id)
|
||||
})
|
||||
data.afterAffiliateCompanyId = ids.join(',')
|
||||
} else if(formData.value.changeItem == 6) {
|
||||
data.newContract = data
|
||||
}
|
||||
data.contractId = data.id
|
||||
delete data.id
|
||||
await ContractApi.changeContract(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
goBack()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const goBack = ()=> {
|
||||
proxy.$router.go(-1)
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
quotationId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
penaltyRate: undefined,
|
||||
latePaymentRate: undefined,
|
||||
settleMethod: undefined,
|
||||
lastPayDate: undefined,
|
||||
contractTerm: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
signEmail: undefined,
|
||||
signWechat: undefined,
|
||||
offlinePrice: undefined,
|
||||
onlinePrice: undefined,
|
||||
ownerUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
pricingUserId: undefined,
|
||||
afterSaleUserId: undefined,
|
||||
collUserId: undefined,
|
||||
totalPrice: undefined,
|
||||
contractBody: undefined,
|
||||
contractAgreement: undefined,
|
||||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
changeItem: 1,
|
||||
products: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
|
||||
/** 处理商机变化 */
|
||||
const handleQuotationChange = async (quotationId: number) => {
|
||||
if (!quotationId) return
|
||||
try {
|
||||
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||
formData.value.products = quotation.products;
|
||||
formData.value.customerId = quotation.customerId;
|
||||
|
||||
formData.value.invoiceTemplateId = quotation.invoiceTemplateId;
|
||||
|
||||
formData.value.ownerUserId = quotation.ownerUserId;
|
||||
formData.value.expanderUserId = quotation.expanderUserId;
|
||||
formData.value.pricingUserId = quotation.pricingUserId;
|
||||
formData.value.signUserId = quotation.signUserId;
|
||||
formData.value.signPhoneNumber = quotation.signPhoneNumber;
|
||||
formData.value.signEmail = quotation.signEmail;
|
||||
formData.value.signWechat = quotation.signWechat;
|
||||
|
||||
formData.value.partnerCompanyId = quotation.partnerCompanyId;
|
||||
|
||||
formData.value.creditLimit = quotation.creditLimit;
|
||||
formData.value.creditMethod = quotation.creditMethod;
|
||||
formData.value.creditCalcCycle = quotation.creditCalcCycle;
|
||||
|
||||
formData.value.deptId = quotation.deptId;
|
||||
formData.value.offlinePrice = quotation.offlinePrice;
|
||||
formData.value.onlinePrice = quotation.onlinePrice;
|
||||
formData.value.totalPrice = quotation.totalPrice;
|
||||
|
||||
// 🔁 自动加载客户详情
|
||||
await onCustomerChange(quotation.customerId);
|
||||
} catch (err) {
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const onCustomerChange = async (customerId: string) => {
|
||||
if (!customerId) return;
|
||||
|
||||
try {
|
||||
formLoading.value = true;
|
||||
const customerRes = await CustomerApi.getCustomer(customerId);
|
||||
formData.value.cooperationType = customerRes.cooperationType;
|
||||
formData.value.companyType = customerRes.companyType;
|
||||
formData.value.listingStatus = customerRes.listingStatus;
|
||||
formData.value.financingInfo = customerRes.financingInfo;
|
||||
formData.value.paidInCapital = customerRes.paidInCapital;
|
||||
formData.value.insuredCount = customerRes.insuredCount;
|
||||
formData.value.establishmentDate = customerRes.establishmentDate;
|
||||
formData.value.enterpriseType = customerRes.enterpriseType;
|
||||
formData.value.businessStatus = customerRes.businessStatus;
|
||||
formData.value.defendantRecord = customerRes.defendantRecord;
|
||||
formData.value.businessAbnormal = customerRes.businessAbnormal;
|
||||
formData.value.equityPledge = customerRes.equityPledge;
|
||||
formData.value.dishonestRecord = customerRes.dishonestRecord;
|
||||
formData.value.financingRecord = customerRes.financingRecord;
|
||||
formData.value.enforcementRecord = customerRes.enforcementRecord;
|
||||
} catch (err) {
|
||||
console.error('获取客户详情失败:', err);
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 动态获取客户联系人 */
|
||||
const getContactOptions = computed(() =>
|
||||
contactList.value.filter((item) => item.customerId == formData.value.customerId)
|
||||
)
|
||||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
formType.value = route.query.id;
|
||||
|
||||
if (formType.value) open(formType.value)
|
||||
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
// 获得报价列表
|
||||
quotationList.value = await QuotationApi.getSimpleQuotationList()
|
||||
|
||||
// 默认新建时选中自己
|
||||
// if (formType.value === 'create') {
|
||||
// formData.value.ownerUserId = useUserStore().getUser.id
|
||||
// }
|
||||
// 获取联系人
|
||||
contactList.value = await ContactApi.getSimpleContactList()
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle" width="1280">
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
|
|
@ -7,25 +7,26 @@
|
|||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
基础信息
|
||||
</ContentWrap>
|
||||
<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="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8" v-if="formType">
|
||||
<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="quotationId">
|
||||
<el-select
|
||||
@change="handleQuotationChange"
|
||||
v-model="formData.quotationId"
|
||||
placeholder="请选择报价单编号"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
|
|
@ -42,7 +43,7 @@
|
|||
<el-select
|
||||
v-model="formData.customerId"
|
||||
disabled=""
|
||||
placeholder="请选择客户"
|
||||
placeholder="客户"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
|
|
@ -54,183 +55,30 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同签订日期" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="formData.startTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合同签订日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合同结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||
<el-input v-model="formData.invoiceTemplateId" placeholder="请输入票据模板" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="违约金比例" prop="penaltyRate">
|
||||
<el-input v-model="formData.penaltyRate" 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-form-item label="方案签约人" prop="pricingUserId">
|
||||
<el-select
|
||||
v-model="formData.pricingUserId"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('settle_method')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in quotationList"
|
||||
:key="item.id"
|
||||
:label="item.no"
|
||||
:value="item.id"
|
||||
/>
|
||||
</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 label="授信额度" prop="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" placeholder="授信额度" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同期限(月)" prop="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-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="拓展人" prop="expanderUserId">
|
||||
<el-select v-model="formData.expanderUserId" placeholder="请选择拓展人" disabled>
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="方案报价人" prop="pricingUserId">
|
||||
<el-select v-model="formData.pricingUserId" placeholder="请选择方案报价人" disabled>
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="售后维护人" prop="afterSaleUserId">
|
||||
<el-select v-model="formData.afterSaleUserId" 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-select v-model="formData.creditMethod" placeholder="授信方式" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_method')"
|
||||
:key="dict.value"
|
||||
|
|
@ -242,7 +90,7 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信计算周期" prop="creditCalcCycle" >
|
||||
<el-select v-model="formData.creditCalcCycle" placeholder="请选择授信计算周期" disabled>
|
||||
<el-select v-model="formData.creditCalcCycle" placeholder="授信计算周期" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_calc_cycle')"
|
||||
:key="dict.value"
|
||||
|
|
@ -253,18 +101,27 @@
|
|||
</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 label="第几次报价" prop="quotationTimes">
|
||||
<el-input v-model="formData.quotationTimes" disabled placeholder="第几次报价" />
|
||||
</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-form-item label="账期" prop="paymentTerm">
|
||||
<el-select v-model="formData.paymentTerm" disabled placeholder="账期">
|
||||
<el-option
|
||||
v-for="dict in deptList"
|
||||
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="invoiceTemplateId">
|
||||
<el-select v-model="formData.invoiceTemplateId" disabled placeholder="请选择票据模板">
|
||||
<el-option
|
||||
v-for="dict in templateOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
|
|
@ -272,40 +129,7 @@
|
|||
</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">
|
||||
|
|
@ -331,42 +155,323 @@
|
|||
<el-form-item label="总金额" prop="price">
|
||||
<el-input
|
||||
disabled
|
||||
placeholder="总金额"
|
||||
v-model="formData.totalPrice"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
甲方基本信息
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="甲方名称" prop="partyName">
|
||||
<el-select v-model="formData.partyName" disabled 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="customerId">
|
||||
<el-input v-model="formData.customerId" disabled placeholder="客户编号" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="法人代表" prop="legalPersonName">
|
||||
<el-input v-model="formData.legalPersonName" placeholder="法人代表" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="统一信用代码" prop="creditNo">
|
||||
<el-input v-model="formData.creditNo" placeholder="统一信用代码" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="企业类型" prop="regType">
|
||||
<el-input v-model="formData.regType" placeholder="企业类型" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-form-item label="融资信息" prop="financingInfo">
|
||||
<el-input v-model="formData.financingInfo" placeholder="融资信息" disabled />
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实缴资金" prop="actualCapital">
|
||||
<el-input v-model="formData.actualCapital" placeholder="实缴资金" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参保人数" prop="socialEmployeeNum">
|
||||
<el-input v-model="formData.socialEmployeeNum" placeholder="参保人数" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-form-item label="上市情况" prop="listingStatus">
|
||||
<el-input v-model="formData.listingStatus" placeholder="上市情况" disabled />
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="注册地址" prop="registeredAddress">
|
||||
<el-input v-model="formData.registeredAddress" placeholder="注册地址" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
乙方基本信息
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" placeholder="合作主体" disabled >
|
||||
<el-option
|
||||
v-for="dict in orgList"
|
||||
:key="dict.id"
|
||||
:label="dict.orgName"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户行" prop="bankName">
|
||||
<el-input v-model="formData.bankName" placeholder="开户行" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行账号" prop="bankAccount">
|
||||
<el-input v-model="formData.bankAccount" placeholder="银行账号" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="法人代表" prop="legalRepresentative">
|
||||
<el-input v-model="formData.legalRepresentative" placeholder="法人代表" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="商务负责人" prop="ownerUserId">
|
||||
<el-input v-model="formData.ownerUserId" placeholder="商务负责人" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input
|
||||
v-model="formData.ownerUserMobile"
|
||||
placeholder="手机号"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="E-mail" prop="email">
|
||||
<el-input
|
||||
v-model="formData.ownerUserEmail"
|
||||
placeholder="E-mail"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="微信号" prop="wechat">
|
||||
<el-input
|
||||
v-model="formData.ownerUserWechat"
|
||||
placeholder="微信号"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="formData.deptId"
|
||||
:data="deptTree"
|
||||
disabled
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
合同信息
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同类型" prop="contractType">
|
||||
<el-radio-group v-model="formData.contractType">
|
||||
<el-radio :label="1">单次合同</el-radio>
|
||||
<el-radio :label="2">框架合同</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同签订日期" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="formData.startTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合同签订日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合同结束时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同期限(月)" prop="contractTerm">
|
||||
<el-input v-model="formData.contractTerm" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入合同期限(月)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账单日" prop="statementDate">
|
||||
<el-select v-model="formData.statementDate" placeholder="请选择账单日" >
|
||||
<el-option
|
||||
v-for="(dict, index) in statement"
|
||||
:key="index"
|
||||
:label="index + 1"
|
||||
:value="index + 1"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最晚付款日" prop="lastPayDate">
|
||||
<el-select v-model="formData.lastPayDate" placeholder="请选择最晚付款日" >
|
||||
<el-option
|
||||
v-for="(dict, index) in statement"
|
||||
:key="index"
|
||||
:label="index + 1"
|
||||
:value="index + 1"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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="invoiceTemplateId">
|
||||
<el-input v-model="formData.invoiceTemplateId" placeholder="请输入票据模板" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row> -->
|
||||
<el-col :span="24">
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
财务与客服对接信息
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="财务结算方式" prop="settleMethod">
|
||||
<el-radio-group v-model="formData.settleMethod">
|
||||
<el-radio :label="1">按月结算</el-radio>
|
||||
<el-radio :label="0">按项目结算</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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-col :span="24">
|
||||
<el-form-item label="合同正文" prop="contractBody">
|
||||
<el-input v-model="formData.contractBody" type="textarea" rows="5" placeholder="请输入合同正文" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="合同补充协议" prop="contractAgreement">
|
||||
<el-input v-model="formData.contractAgreement" type="textarea" rows="5" placeholder="请输入合同补充协议" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<ContentWrap style="border: none;font-weight:700">
|
||||
产品清单
|
||||
</ContentWrap>
|
||||
<!-- 子表的表单 -->
|
||||
<ContentWrap>
|
||||
<el-tabs v-model="subTabsName" class="-mt-15px -mb-10px">
|
||||
<el-tab-pane label="产品清单" name="product">
|
||||
<ContractProductForm
|
||||
ref="productFormRef"
|
||||
:products="formData.products"
|
||||
:disabled="disabled"
|
||||
:type="1"
|
||||
/>
|
||||
</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>
|
||||
</ContentWrap>
|
||||
<ContentWrap style="border: none;font-weight:700">
|
||||
合同甲方关联单位
|
||||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef" :data="formData.contractAAuthorizedCompanys" :contract-id="formData.id" />
|
||||
</ContentWrap>
|
||||
<ContentWrap style="border: none;font-weight:700">
|
||||
合同甲方授权人信息
|
||||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<ContractAAuthorizedPersonForm ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" :customerId="formData.customerId" />
|
||||
</ContentWrap>
|
||||
<ContentWrap style="border: none;font-weight:700">
|
||||
合同乙方授权人信息
|
||||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<ContractBAuthorizedPersonForm ref="contractBAuthorizedPersonFormRef" :userOptions="userOptions" :contract-id="formData.id" />
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">保存</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
<!-- 显示在其他页面时的判断type -->
|
||||
<div style="text-align: right" v-if="!type">
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="goBack">取 消</el-button>
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import * as ContactApi from '@/api/crm/contact'
|
||||
|
|
@ -374,23 +479,39 @@ import * as UserApi from '@/api/system/user'
|
|||
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
||||
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue'
|
||||
import ContractAAuthorizedCompanyForm from './components/ContractAAuthorizedCompanyForm.vue'
|
||||
import ContractAAuthorizedPersonForm from './components/ContractAAuthorizedPersonForm.vue'
|
||||
import ContractBAuthorizedPersonForm from './components/ContractBAuthorizedPersonForm.vue'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined),
|
||||
type: propTypes.number.def(undefined),
|
||||
})
|
||||
const templateOptions = ref([])
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
partyName: undefined,
|
||||
lastPayDate: undefined,
|
||||
partAddress: undefined,
|
||||
secPartyPerson: undefined,
|
||||
wechat: undefined,
|
||||
quotationId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
|
|
@ -422,19 +543,29 @@ const formData = ref({
|
|||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
statementDate: undefined,
|
||||
contractAAuthorizedCompanys: [],
|
||||
products: []
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||
quotationId: [{ required: true, message: '报价单编号不能为空', trigger: 'blur' }],
|
||||
orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }],
|
||||
ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }]
|
||||
// ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
||||
statementDate: [{ required: true, message: '账单日不能为空', trigger: 'change' }],
|
||||
contractType: [{ required: true, message: '合同类型不能为空', trigger: 'change' }],
|
||||
penaltyRate: [{ required: true, message: '违约金比例不能为空', trigger: 'blur' }],
|
||||
latePaymentRate: [{ required: true, message: '延期付款利率不能为空', trigger: 'blur' }],
|
||||
collUserId: [{ required: true, message: '协作人不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const quotationList = ref<QuotationVO[]>([])
|
||||
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||
const orgList = ref([])
|
||||
const statement = ref(new Array(31).fill(null))
|
||||
|
||||
/** 子表的表单 */
|
||||
const subTabsName = ref('product')
|
||||
|
|
@ -458,35 +589,27 @@ watch(
|
|||
)
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
const open = async (type: string) => {
|
||||
if (type) {
|
||||
// formLoading.value = true
|
||||
try {
|
||||
formData.value = await ContractApi.getContract(id)
|
||||
formData.value = await ContractApi.getContract(type)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
// 获得报价列表
|
||||
quotationList.value = await QuotationApi.getSimpleQuotationList()
|
||||
|
||||
// 默认新建时选中自己
|
||||
// if (formType.value === 'create') {
|
||||
// formData.value.ownerUserId = useUserStore().getUser.id
|
||||
// }
|
||||
// 获取联系人
|
||||
contactList.value = await ContactApi.getSimpleContactList()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
|
@ -496,15 +619,36 @@ const submitForm = async () => {
|
|||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
if(contractAAuthorizedCompanyFormRef.value.getData().length) {
|
||||
const contractAAuthorizedCompanyValid = await contractAAuthorizedCompanyFormRef.value.validate()
|
||||
if (!contractAAuthorizedCompanyValid) return message.warning('请完善合同甲方关联单位')
|
||||
} else {
|
||||
return message.warning('请完善合同甲方关联单位')
|
||||
}
|
||||
|
||||
if(contractAAuthorizedPersonFormRef.value.getData().length) {
|
||||
const contractAAuthorizedPerson = await contractAAuthorizedPersonFormRef.value.validate()
|
||||
if (!contractAAuthorizedPerson) return message.warning('请完善合同甲方授权人信息')
|
||||
} else {
|
||||
return message.warning('请完善合同甲方授权人信息')
|
||||
}
|
||||
|
||||
if(contractBAuthorizedPersonFormRef.value.getData().length) {
|
||||
const contractBAuthorizedPersonPerson = await contractBAuthorizedPersonFormRef.value.validate()
|
||||
if (!contractBAuthorizedPersonPerson) return message.warning('请完善合同乙方授权人信息')
|
||||
} else {
|
||||
return message.warning('请完善合同乙方授权人信息')
|
||||
}
|
||||
|
||||
formLoading.value = true
|
||||
productFormRef.value.validate()
|
||||
|
||||
try {
|
||||
const data = unref(formData.value) as unknown as ContractApi.ContractVO
|
||||
// 拼接子表的数据
|
||||
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||
data.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData()
|
||||
data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData()
|
||||
if (formType.value === 'create') {
|
||||
if (!formType.value ) {
|
||||
await ContractApi.createContract(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
|
|
@ -514,11 +658,16 @@ const submitForm = async () => {
|
|||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
goBack()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const goBack = ()=> {
|
||||
proxy.$router.go(-1)
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
|
|
@ -557,6 +706,7 @@ const resetForm = () => {
|
|||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
paymentTerm: undefined,
|
||||
products: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
|
@ -574,12 +724,14 @@ const handleQuotationChange = async (quotationId: number) => {
|
|||
formData.value.invoiceTemplateId = quotation.invoiceTemplateId;
|
||||
|
||||
formData.value.ownerUserId = quotation.ownerUserId;
|
||||
formData.value.ownerUserMobile = quotation.ownerUserMobile;
|
||||
formData.value.ownerUserWechat = quotation.ownerUserWechat;
|
||||
formData.value.ownerUserEmail = quotation.ownerUserEmail;
|
||||
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.paymentTerm = quotation.paymentTerm;
|
||||
|
||||
formData.value.partnerCompanyId = quotation.partnerCompanyId;
|
||||
|
||||
|
|
@ -592,8 +744,10 @@ const handleQuotationChange = async (quotationId: number) => {
|
|||
formData.value.onlinePrice = quotation.onlinePrice;
|
||||
formData.value.totalPrice = quotation.totalPrice;
|
||||
|
||||
// 🔁 自动加载客户详情
|
||||
const customerRes = await ContractApi.quotationTimes(quotation.id);
|
||||
formData.value.quotationTimes = customerRes.quotationTimes;
|
||||
await onCustomerChange(quotation.customerId);
|
||||
await onPartnerChange(quotation.partnerCompanyId);
|
||||
} catch (err) {
|
||||
} finally {
|
||||
|
||||
|
|
@ -615,13 +769,16 @@ const onCustomerChange = async (customerId: string) => {
|
|||
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;
|
||||
formData.value.actualCapital = customerRes.actualCapital;
|
||||
|
||||
formData.value.partAddress = customerRes.partAddress;
|
||||
formData.value.listingStatus = customerRes.listingStatus;
|
||||
formData.value.legalPersonName = customerRes.legalPersonName;
|
||||
formData.value.creditCode = customerRes.creditCode;
|
||||
formData.value.regType = customerRes.regType;
|
||||
formData.value.financingInfo = customerRes.financingInfo;
|
||||
formData.value.socialEmployeeNum = customerRes.socialEmployeeNum;
|
||||
formData.value.registeredAddress = customerRes.registeredAddress;
|
||||
} catch (err) {
|
||||
console.error('获取客户详情失败:', err);
|
||||
} finally {
|
||||
|
|
@ -629,9 +786,62 @@ const onCustomerChange = async (customerId: string) => {
|
|||
}
|
||||
}
|
||||
|
||||
const onPartnerChange = async (id: string) => {
|
||||
if (!id) return
|
||||
try {
|
||||
formLoading.value = true;
|
||||
const res = await ContractApi.getOrgInfo(id);
|
||||
formData.value.bankName = res.bankName;
|
||||
formData.value.bankAccount = res.bankAccount;
|
||||
formData.value.legalRepresentative = res.legalRepresentative;
|
||||
formData.value.businessLicenseNumber = res.businessLicenseNumber;
|
||||
formData.value.businessLicense = res.businessLicense;
|
||||
// formData.value.partnerCompanyId = res.partnerCompanyId;
|
||||
} catch (err) {
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 动态获取客户联系人 */
|
||||
const getContactOptions = computed(() =>
|
||||
contactList.value.filter((item) => item.customerId == formData.value.customerId)
|
||||
)
|
||||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
formType.value = props.id || route.query.id
|
||||
|
||||
if (formType.value) await open(formType.value)
|
||||
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
// 获得报价列表
|
||||
quotationList.value = await QuotationApi.getSimpleQuotationList()
|
||||
|
||||
//票据
|
||||
const tempData = await BillTemplateApi.getBillTemplatePage({
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
})
|
||||
templateOptions.value = tempData.list
|
||||
|
||||
|
||||
// 获得部门树
|
||||
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
// 默认新建时选中自己
|
||||
// if (formType.value === 'create') {
|
||||
// formData.value.ownerUserId = useUserStore().getUser.id
|
||||
// }
|
||||
// 获取联系人
|
||||
contactList.value = await ContactApi.getSimpleContactList()
|
||||
const data = await ContractApi.getOrg({
|
||||
pageNo: 1,
|
||||
pageSize: 1000
|
||||
})
|
||||
orgList.value = data.list
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,217 @@
|
|||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="130px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="终止日期" prop="terminationDate">
|
||||
<el-date-picker
|
||||
v-model="formData.terminationDate"
|
||||
type="date"
|
||||
:disabled="!!type"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择终止日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="终止原因" prop="terminationReason">
|
||||
<el-radio-group v-model="formData.terminationReason" :disabled="!!type">
|
||||
<el-radio :label="1">合同到期</el-radio>
|
||||
<el-radio :label="2">甲方违反协议</el-radio>
|
||||
<el-radio :label="3">乙方不可抗力</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="终止说明" prop="note">
|
||||
<el-input v-model="formData.note" :disabled="!!type" type="textarea" :row="5" placeholder="必须确保账款已全部回收" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 子表的表单 -->
|
||||
|
||||
</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 { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
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 { propTypes } from '@/utils/propTypes'
|
||||
|
||||
/** CRM 方案报价 表单 */
|
||||
defineOptions({ name: 'QuotationForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const templateOptions = ref([])
|
||||
const businessList = ref([])
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const deptList = ref() // 部门
|
||||
const orgList = ref([])
|
||||
|
||||
const invoiceTemplateList = ref([])
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
||||
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({
|
||||
// cooperationType: [{ required: true, message: '合作类型不能为空', trigger: 'change' }],
|
||||
// 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 open = async (type: string) => {
|
||||
formType.value = type
|
||||
// 修改时,设置数据
|
||||
if (type) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await QuotationApi.getQuotation(type)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
deptList.value = await DeptApi.getSimpleDeptList()
|
||||
// 获得用户列表
|
||||
invoiceTemplateList.value = await BillTemplateApi.getSimpleList()
|
||||
}
|
||||
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
</script>
|
||||
|
|
@ -58,74 +58,68 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||
<template #default="{ $index }">
|
||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<el-row justify="center" class="mt-3">
|
||||
<el-row justify="center" class="mt-3" v-if="!type">
|
||||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||
</el-row>
|
||||
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
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' }]
|
||||
// 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 contactRef = ref() // 表单 Ref
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
const row = {
|
||||
id: undefined,
|
||||
contractId: undefined,
|
||||
customerName: undefined,
|
||||
unifiedCreditCode: undefined,
|
||||
invoicingAddress: undefined,
|
||||
customerName: undefined,
|
||||
invoicingTelephone: undefined,
|
||||
companyBank: undefined,
|
||||
companyAccount: undefined,
|
||||
companyAddress: undefined,
|
||||
deletedFlag: undefined
|
||||
companyAccount: undefined
|
||||
}
|
||||
row.contractId = props.contractId
|
||||
formData.value.push(row)
|
||||
}
|
||||
|
||||
|
||||
const props = defineProps<{
|
||||
data: undefined,
|
||||
type: undefined
|
||||
}>()
|
||||
|
||||
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||
watch(
|
||||
() => props.data,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = val
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = (index) => {
|
||||
formData.value.splice(index, 1)
|
||||
|
|
|
|||
|
|
@ -9,20 +9,20 @@
|
|||
>
|
||||
<el-table :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" width="100" />
|
||||
<el-table-column label="客户联系人ID" min-width="150">
|
||||
<el-table-column label="授权人姓名" 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">
|
||||
<!-- <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> -->
|
||||
<el-table-column label="授权人类型" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.authPersonType`" :rules="formRules.authPersonType" class="mb-0px!">
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号" min-width="150">
|
||||
<el-table-column label="授权人手机号" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.phoneNumber`" :rules="formRules.phoneNumber" class="mb-0px!">
|
||||
<el-input v-model="row.phoneNumber" placeholder="请输入手机号" />
|
||||
|
|
@ -65,23 +65,28 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||
<template #default="{ $index }">
|
||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<el-row justify="center" class="mt-3">
|
||||
<el-row justify="center" class="mt-3" v-if="!type">
|
||||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||
</el-row>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ContactForm ref="contactRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||
import ContactForm from '@/components/contact/index.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
contractId: undefined // 合同ID(主表的关联字段)
|
||||
contractId: undefined, // 合同ID(主表的关联字段)
|
||||
type: undefined,
|
||||
customerId: undefined
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
@ -114,21 +119,55 @@ watch(
|
|||
)
|
||||
|
||||
/** 新增按钮操作 */
|
||||
// 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 message = useMessage() // 消息弹窗
|
||||
const contactRef = ref() // 表单 Ref
|
||||
const handleAdd = () => {
|
||||
const row = {
|
||||
id: undefined,
|
||||
contractId: undefined,
|
||||
customerContactId: undefined,
|
||||
customerName: undefined,
|
||||
authPersonType: undefined,
|
||||
phoneNumber: undefined,
|
||||
wechat: undefined,
|
||||
idNumber: undefined,
|
||||
email: undefined,
|
||||
deletedFlag: undefined
|
||||
console.log('%csrc/views/crm/contract/components/ContractAAuthorizedPersonForm.vue:140 props.customerId', 'color: #007acc;', props.customerId);
|
||||
if(!props.customerId) {
|
||||
return message.warning('请先选择报价单')
|
||||
}
|
||||
row.contractId = props.contractId
|
||||
formData.value.push(row)
|
||||
contactRef.value.open(formData.value, props.customerId)
|
||||
}
|
||||
|
||||
const getList = (val: []) => {
|
||||
for(let i = val.length - 1; i >= 0; i--) {
|
||||
let obj = val[i]
|
||||
if(formData.value.some(v => v.id === obj.id)) val.splice(i, 1)
|
||||
}
|
||||
val.forEach(item => {
|
||||
if(!formData.value.some(v => v.id === item.id)) {
|
||||
val.forEach(item => {
|
||||
formData.value.push({
|
||||
"name": item.name,
|
||||
"postId": item.post,
|
||||
"userRank": item.userRank,
|
||||
"phoneNumber": item.mobile,
|
||||
"authDesc": item.authDesc,
|
||||
"wechat":item. wechat,
|
||||
"email":item. email,
|
||||
"id": item.id
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
<template>
|
||||
|
||||
<el-table :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" width="100" />
|
||||
<el-table-column label="是否授权人" prop="authPersonType" min-width="150" />
|
||||
<el-table-column label="姓名" prop="customerName" min-width="150" />
|
||||
<el-table-column label="手机号" prop="phoneNumber" min-width="150" />
|
||||
<el-table-column label="微信号" prop="wechat" min-width="150" />
|
||||
<el-table-column label="单位名称" prop="customerName" min-width="150" />
|
||||
<el-table-column label="职务" prop="name" min-width="150" />
|
||||
<el-table-column label="联系地址" prop="name" min-width="150" />
|
||||
<el-table-column label="类别" prop="name" min-width="150" />
|
||||
<el-table-column label="邮箱" prop="email" min-width="150" />
|
||||
<el-table-column label="身份证号" prop="name" min-width="150" />
|
||||
<el-table-column label="生日" prop="name" min-width="150" />
|
||||
<el-table-column label="性别" prop="name" min-width="150" />
|
||||
</el-table>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||
|
||||
const props = defineProps<{
|
||||
products: [] // 合同ID(主表的关联字段)
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||
watch(
|
||||
() => props.products,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = val
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
|
||||
defineExpose({ getData })
|
||||
</script>
|
||||
|
|
@ -9,20 +9,13 @@
|
|||
>
|
||||
<el-table :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" width="100" />
|
||||
<el-table-column label="用户" min-width="150">
|
||||
<!-- <el-table-column label="用户" 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="请输入用户" />
|
||||
</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> -->
|
||||
<el-table-column label="类别" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.authType`" :rules="formRules.authType" class="mb-0px!">
|
||||
|
|
@ -37,6 +30,21 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.userId`" :rules="formRules.name" class="mb-0px!">
|
||||
<el-select v-model="row.userId" placeholder="请选择售后维护人" @change="changeUser($index, row.userId)">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</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!">
|
||||
|
|
@ -79,23 +87,28 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||
<template #default="{ $index }">
|
||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<el-row justify="center" class="mt-3">
|
||||
<el-row justify="center" class="mt-3" v-if="!type">
|
||||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||
</el-row>
|
||||
|
||||
<ContactForm ref="contactRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||
import ContactForm from '@/components/user/index.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
contractId: undefined // 合同ID(主表的关联字段)
|
||||
contractId: undefined, // 合同ID(主表的关联字段)
|
||||
type: undefined,
|
||||
userOptions: undefined
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
@ -147,6 +160,47 @@ const handleAdd = () => {
|
|||
formData.value.push(row)
|
||||
}
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const contactRef = ref() // 表单 Ref
|
||||
// const handleAdd = () => {
|
||||
|
||||
// contactRef.value.open(formData.value, props.customerId)
|
||||
// }
|
||||
const changeUser = (i, val) => {
|
||||
console.log('%csrc/views/crm/contract/components/ContractBAuthorizedPersonForm.vue:170 i,val', 'color: #007acc;',props.userOptions.filter(v => v.id === val), i,val);
|
||||
let arr = props.userOptions.filter(v => v.id === val)
|
||||
if(arr.length) {
|
||||
formData.value[i].name = arr[0].nickname
|
||||
formData.value[i].postId = arr[0].deptName
|
||||
}
|
||||
}
|
||||
const getList = (val: []) => {
|
||||
for(let i = val.length - 1; i >= 0; i--) {
|
||||
let obj = val[i]
|
||||
if(formData.value.some(v => v.id === obj.id)) val.splice(i, 1)
|
||||
}
|
||||
val.forEach(item => {
|
||||
if(!formData.value.some(v => v.id === item.id)) {
|
||||
val.forEach(item => {
|
||||
formData.value.push({
|
||||
"name": item.name,
|
||||
"authType": item.post,
|
||||
"postId": item.userRank,
|
||||
"userRank": item.mobile,
|
||||
"authDesc": item.authDesc,
|
||||
"wechat":item. wechat,
|
||||
"email":item. email,
|
||||
"id": item.id,
|
||||
phoneNumber: item.phoneNumber
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = (index) => {
|
||||
formData.value.splice(index, 1)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,413 @@
|
|||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="130px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作类型" prop="cooperationType">
|
||||
<el-select v-model="formData.cooperationType" disabled filterable placeholder="请选择合作类型" class="w-1/1">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="企业类型" prop="">
|
||||
<el-input v-model="formData.regType" disabled placeholder="自动获取" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="上市情况" prop="customerId">
|
||||
<el-select v-model="formData.customerId" placeholder="请选择上市情况" disabled @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-select v-model="formData.customerId" placeholder="请选择融资信息" disabled @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="paidInCapital">
|
||||
<el-input v-model="formData.actualCapital" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参保人数" prop="insuredCount">
|
||||
<el-input v-model="formData.socialEmployeeNum" 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="abnormalService">
|
||||
<el-radio-group v-model="formData.abnormalService" :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="dishonestyRecord">
|
||||
<el-radio-group v-model="formData.dishonestyRecord" :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="financeRecord">
|
||||
<el-radio-group v-model="formData.financeRecord" :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="judgmentRecord">
|
||||
<el-radio-group v-model="formData.judgmentRecord" :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="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" placeholder="请输入初始额度" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="目前额度" prop="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" placeholder="请输入目前额度" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" disabled placeholder="请选择签约主体" @change="onPartnerChange">
|
||||
<el-option
|
||||
v-for="dict in orgList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="调整金额(元)" prop="changeAmount">
|
||||
<el-input v-model="formData.changeAmount" type="number" :disabled="!!type" placeholder="请输入调整金额(元)" @input="onChangeAmount" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最终额度" prop="afterAmount">
|
||||
<el-input v-model="formData.afterAmount" type="number" disabled placeholder="请输入最终额度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="调整金额截止日期" prop="changeAmountDeadline">
|
||||
<el-date-picker
|
||||
v-model="formData.changeAmountDeadline"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="date"
|
||||
:disabled="!!type"
|
||||
placeholder="请选择调整金额截止日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="调额说明" prop="note">
|
||||
<el-input v-model="formData.note" type="textarea" :disabled="!!type" :row="5" placeholder="请输入调额说明" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 子表的表单 -->
|
||||
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
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 { propTypes } from '@/utils/propTypes'
|
||||
|
||||
/** CRM 方案报价 表单 */
|
||||
defineOptions({ name: 'QuotationForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const templateOptions = ref([])
|
||||
const businessList = ref([])
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const deptList = ref() // 部门
|
||||
const orgList = ref([])
|
||||
|
||||
const invoiceTemplateList = ref([])
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
||||
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: 0,
|
||||
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({
|
||||
changeAmount: [{ required: true, message: '调整额度不能为空', trigger: 'change' }],
|
||||
changeAmountDeadline: [{ 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 props = defineProps<{
|
||||
data: undefined
|
||||
}>()
|
||||
|
||||
watch(
|
||||
() => props.data,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = val
|
||||
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
const onChangeAmount = async (amount: number) => {
|
||||
formData.value.afterAmount = Number(formData.value.creditLimit) + Number(amount);
|
||||
}
|
||||
|
||||
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) => {
|
||||
formType.value = type
|
||||
// 修改时,设置数据
|
||||
if (type) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await ContractApi.getContract(type)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
deptList.value = await DeptApi.getSimpleDeptList()
|
||||
// 获得用户列表
|
||||
invoiceTemplateList.value = await BillTemplateApi.getSimpleList()
|
||||
}
|
||||
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
|
||||
/** 重置表单 */
|
||||
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()
|
||||
}
|
||||
|
||||
// const route = useRoute();
|
||||
// onMounted(async () => {
|
||||
// console.log('%csrc/views/crm/quotation/QuotationForm.vue:596 route', 'color: #007acc;', route);
|
||||
// formType.value = route.query.id;
|
||||
|
||||
// if (formType.value) open(formType.value)
|
||||
|
||||
// // 获得客户列表
|
||||
// customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
// // 获得用户列表
|
||||
// userOptions.value = await UserApi.getSimpleUserList()
|
||||
// //票据
|
||||
// const data = await BillTemplateApi.getBillTemplatePage({
|
||||
// pageNo: 1,
|
||||
// pageSize: 1000,
|
||||
// })
|
||||
// templateOptions.value = data.list
|
||||
// businessList.value = await BusinessApi.getSimpleBusinessList()
|
||||
// // 获得部门树
|
||||
// deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
// const org = await ContractApi.getOrg({
|
||||
// pageNo: 1,
|
||||
// pageSize: 1000
|
||||
// })
|
||||
// orgList.value = org.list
|
||||
// });
|
||||
</script>
|
||||
|
|
@ -0,0 +1,365 @@
|
|||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="130px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作类型" prop="cooperationType">
|
||||
<el-select v-model="formData.cooperationType" :disabled="!!type" filterable placeholder="请选择合作类型" class="w-1/1">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="企业类型" prop="">
|
||||
<el-input v-model="formData.no" disabled placeholder="自动获取" />
|
||||
</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" :disabled="!!type" 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-select v-model="formData.customerId" :disabled="!!type" 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="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="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="agreementDeadline">
|
||||
<el-date-picker
|
||||
:disabled="!!type"
|
||||
v-model="formData.agreementDeadline"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择协议截止日"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="顺延年限" prop="extensionYears">
|
||||
<el-input v-model="formData.extensionYears" :disabled="!!type" placeholder="请输入顺延年限" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="调整金额截止日期" prop="extensionDate">
|
||||
<el-date-picker
|
||||
v-model="formData.extensionDate"
|
||||
:disabled="!!type"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="调整金额截止日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="延期说明" prop="signEmail">
|
||||
<el-input v-model="formData.signEmail" :disabled="!!type" type="textarea" :row="5" placeholder="请输入延期说明" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 子表的表单 -->
|
||||
|
||||
</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 { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
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 { propTypes } from '@/utils/propTypes'
|
||||
|
||||
/** CRM 方案报价 表单 */
|
||||
defineOptions({ name: 'QuotationForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const templateOptions = ref([])
|
||||
const businessList = ref([])
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const deptList = ref() // 部门
|
||||
const orgList = ref([])
|
||||
|
||||
|
||||
const invoiceTemplateList = ref([])
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
||||
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({
|
||||
// cooperationType: [{ required: true, message: '合作类型不能为空', trigger: 'change' }],
|
||||
// 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 props = defineProps<{
|
||||
data: undefined
|
||||
}>()
|
||||
|
||||
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||
watch(
|
||||
() => props.data,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = val
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
|
||||
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) => {
|
||||
formType.value = type
|
||||
// 修改时,设置数据
|
||||
if (type) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await QuotationApi.getQuotation(type)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
deptList.value = await DeptApi.getSimpleDeptList()
|
||||
// 获得用户列表
|
||||
invoiceTemplateList.value = await BillTemplateApi.getSimpleList()
|
||||
}
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
|
||||
</script>
|
||||
|
|
@ -54,12 +54,9 @@
|
|||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加 -->
|
||||
<ContractForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import ContractForm from './../ContractForm.vue'
|
||||
import { BizTypeEnum } from '@/api/crm/permission'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
|
|
@ -116,7 +113,7 @@ const handleQuery = () => {
|
|||
/** 添加 */
|
||||
const formRef = ref()
|
||||
const openForm = () => {
|
||||
formRef.value.open('create')
|
||||
push({ name: 'CrmContractAdd' })
|
||||
}
|
||||
|
||||
/** 打开合同详情 */
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@
|
|||
>
|
||||
<el-table :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" width="100" />
|
||||
<el-table-column label="产品编号" min-width="150">
|
||||
<!-- <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> -->
|
||||
<el-table-column label="产品名称" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
||||
|
|
@ -41,7 +41,14 @@
|
|||
<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-select v-model="row.productUnit" placeholder="产品单位" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_UNIT)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -69,32 +76,60 @@
|
|||
<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-select v-model="row.productInvoice" placeholder="请选择状态" disabled>
|
||||
<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>
|
||||
</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-select v-model="row.productInvoiceItem" placeholder="请选择状态" disabled>
|
||||
<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>
|
||||
</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-select v-model="row.serviceInvoice" placeholder="服务费票据" disabled>
|
||||
<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>
|
||||
</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-select v-model="row.serviceInvoiceItem" placeholder="服务开具项目" disabled>
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||
<template #default="{ $index }">
|
||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||
</template>
|
||||
|
|
@ -105,11 +140,12 @@
|
|||
<script setup lang="ts">
|
||||
import * as ProductApi from '@/api/crm/product'
|
||||
import { erpPriceInputFormatter, erpPriceMultiply } from '@/utils'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
|
||||
const props = defineProps<{
|
||||
products: undefined
|
||||
disabled: false
|
||||
disabled: false,
|
||||
type: undefined
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
|
|||
|
|
@ -0,0 +1,160 @@
|
|||
<template>
|
||||
<!-- 操作栏 -->
|
||||
<el-row justify="end">
|
||||
<el-button @click="openFormAdd">
|
||||
<Icon class="mr-5px" icon="clarity:contract-line" />
|
||||
创建方案报价
|
||||
</el-button>
|
||||
</el-row>
|
||||
<!-- 列表 -->
|
||||
<ContentWrap class="mt-10px">
|
||||
<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>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
</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 * as CustomerApi from '@/api/crm/customer'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
/** CRM 方案报价 列表 */
|
||||
defineOptions({ name: 'Quotation' })
|
||||
const props = defineProps({
|
||||
bizId: propTypes.number.def(undefined),
|
||||
})
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
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 {
|
||||
queryParams.customerId = props.bizId
|
||||
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 openFormAdd = () => {
|
||||
push({ name: 'QuotationAdd' })
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await QuotationApi.deleteQuotation(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,428 @@
|
|||
<template>
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-row>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="合同查询" prop="quotationId">
|
||||
<el-select
|
||||
@change="handleQuotationChange"
|
||||
v-model="formData.quotationId"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in quotationList"
|
||||
:key="item.id"
|
||||
:label="item.no"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<el-select
|
||||
v-model="formData.customerId"
|
||||
disabled=""
|
||||
placeholder="请选择客户"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in contactList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="协议编码" prop="name">
|
||||
<el-input v-model="formData.processInstanceId" disabled placeholder="协议编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同状态" prop="quotationId">
|
||||
<el-select v-model="formData.auditStatus" disabled clearable placeholder="请选择合同状态">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="协议截止日期" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
disabled
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="请选择协议截止日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="变更项目" prop="endTime">
|
||||
<el-radio-group v-model="formData.radio" disabled>
|
||||
<el-radio :value="1">额度</el-radio>
|
||||
<el-radio :value="2">授权人</el-radio>
|
||||
<el-radio :value="3">延期</el-radio>
|
||||
<el-radio :value="4">终止</el-radio>
|
||||
<el-radio :value="5">甲方关联单位</el-radio>
|
||||
<el-radio :value="6">重签</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<!-- 子表的表单 -->
|
||||
<ContentWrap>
|
||||
<ContractChangeLimit
|
||||
v-if="formData.radio == 1"
|
||||
:type="1"
|
||||
ref="limitFormRef"
|
||||
:formData="formData"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
<div v-if="formData.radio == 2">
|
||||
<ContentWrap style="border: none">
|
||||
甲方现授权人信息
|
||||
</ContentWrap>
|
||||
<ContractAuthPersonInfo
|
||||
ref="personDataRef"
|
||||
:products="formData.contractAAuthorizedPersons"
|
||||
/>
|
||||
<!-- <ContentWrap style="border: none">
|
||||
甲方授权人
|
||||
</ContentWrap>
|
||||
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef" :contract-id="formData.id" /> -->
|
||||
</div>
|
||||
<ContracExtension ref="contractExtensionFormRef" :type="1" :formData="formData" v-if="formData.radio == 3" />
|
||||
<ContractStop ref="contractStopFormRef" :type="1" :formData="formData" v-if="formData.radio == 4" />
|
||||
<ContractAAuthorizedCompanyForm :type="1" ref="contractAAuthorizedCompanyFormRef1" v-if="formData.radio == 5" :contract-id="formData.id" />
|
||||
<ContractForm ref="contractFormRef" :type="1" :id="formType" :formData="formData" v-if="formData.radio == 6" />
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import * as ContactApi from '@/api/crm/contact'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
||||
import { erpPriceMultiply, erpPriceInputFormatter, jsonParse } from '@/utils'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import ContractChangeLimit from '@/views/crm/contract/components/ContractChangeLimit.vue'
|
||||
import ContractAuthPersonInfo from '@/views/crm/contract/components/ContractAuthPersonInfo.vue'
|
||||
import ContracExtension from '@/views/crm/contract/components/ContractExtension.vue'
|
||||
import ContractStop from '@/views/crm/contract/components/ContracStop.vue'
|
||||
import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue'
|
||||
import ContractAAuthorizedCompanyForm from '../components/ContractAAuthorizedCompanyForm.vue'
|
||||
import ContractForm from './ContractDetail.vue'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined)
|
||||
})
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
authPerson: [],
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
quotationId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
penaltyRate: undefined,
|
||||
latePaymentRate: undefined,
|
||||
settleMethod: undefined,
|
||||
lastPayDate: undefined,
|
||||
contractTerm: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
signEmail: undefined,
|
||||
signWechat: undefined,
|
||||
offlinePrice: undefined,
|
||||
onlinePrice: undefined,
|
||||
ownerUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
pricingUserId: undefined,
|
||||
afterSaleUserId: undefined,
|
||||
collUserId: undefined,
|
||||
totalPrice: undefined,
|
||||
contractBody: undefined,
|
||||
contractAgreement: undefined,
|
||||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
products: []
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||
orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }],
|
||||
ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const quotationList = ref<QuotationVO[]>([])
|
||||
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||
|
||||
/** 子表的表单 */
|
||||
const subTabsName = ref('limit')
|
||||
const contractAAuthorizedCompanyFormRef = ref()
|
||||
const contractAAuthorizedCompanyFormRef1 = ref()
|
||||
const limitFormRef = ref()
|
||||
const contractExtensionFormRef = ref()
|
||||
const contractStopFormRef = ref()
|
||||
const contractFormRef = ref()
|
||||
|
||||
/** 计算 discountPrice、totalPrice 价格 */
|
||||
watch(
|
||||
() => formData.value,
|
||||
(val) => {
|
||||
if (!val) {
|
||||
return
|
||||
}
|
||||
// const totalPrice = val.products.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
||||
// 赋值
|
||||
// formData.value.totalPrice = totalPrice
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string) => {
|
||||
if (type) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await ContractApi.getChangeContract(type)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
// const Authalid = await contractAAuthorizedCompanyFormRef.value.validate()
|
||||
// if (!Authalid) return
|
||||
|
||||
// const Authalid1 = await contractAAuthorizedCompanyFormRef1.value.validate()
|
||||
// if (!Authalid1) return
|
||||
|
||||
// const limitValid = await limitFormRef.value.validate()
|
||||
// if (!limitValid) return
|
||||
// const extensionValid = await contractExtensionFormRef.value.validate()
|
||||
// if (!extensionValid) return
|
||||
|
||||
// const stopValid = await contractStopFormRef.value.validate()
|
||||
// if (!stopValid) return
|
||||
|
||||
// const contractValid = await contractFormRef.value.validate()
|
||||
// if (!contractValid) return
|
||||
|
||||
|
||||
// console.log('%csrc/views/crm/contract/ContractChange.vue:247 123', 'color: #007acc;', extensionValid,123);
|
||||
// return
|
||||
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = unref(JSON.parse(JSON.stringify(formData.value))) as unknown as ContractApi.ContractVO
|
||||
// 拼接子表的数据
|
||||
data.contractAAuthorizedCompanys = limitFormRef.value.getData()
|
||||
data.contractAAuthorizedCompanys = contractExtensionFormRef.value.getData()
|
||||
data.contractAAuthorizedCompanys = contractStopFormRef.value.getData()
|
||||
data.contractAAuthorizedCompanys = contractFormRef.value.getData()
|
||||
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||
data.contractId = data.id
|
||||
delete data.id
|
||||
await ContractApi.changeContract(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
goBack()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const goBack = ()=> {
|
||||
proxy.$router.go(-1)
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
quotationId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
penaltyRate: undefined,
|
||||
latePaymentRate: undefined,
|
||||
settleMethod: undefined,
|
||||
lastPayDate: undefined,
|
||||
contractTerm: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
signEmail: undefined,
|
||||
signWechat: undefined,
|
||||
offlinePrice: undefined,
|
||||
onlinePrice: undefined,
|
||||
ownerUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
pricingUserId: undefined,
|
||||
afterSaleUserId: undefined,
|
||||
collUserId: undefined,
|
||||
totalPrice: undefined,
|
||||
contractBody: undefined,
|
||||
contractAgreement: undefined,
|
||||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
products: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
|
||||
/** 处理商机变化 */
|
||||
const handleQuotationChange = async (quotationId: number) => {
|
||||
if (!quotationId) return
|
||||
try {
|
||||
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||
formData.value.products = quotation.products;
|
||||
formData.value.customerId = quotation.customerId;
|
||||
|
||||
formData.value.invoiceTemplateId = quotation.invoiceTemplateId;
|
||||
|
||||
formData.value.ownerUserId = quotation.ownerUserId;
|
||||
formData.value.expanderUserId = quotation.expanderUserId;
|
||||
formData.value.pricingUserId = quotation.pricingUserId;
|
||||
formData.value.signUserId = quotation.signUserId;
|
||||
formData.value.signPhoneNumber = quotation.signPhoneNumber;
|
||||
formData.value.signEmail = quotation.signEmail;
|
||||
formData.value.signWechat = quotation.signWechat;
|
||||
|
||||
formData.value.partnerCompanyId = quotation.partnerCompanyId;
|
||||
|
||||
formData.value.creditLimit = quotation.creditLimit;
|
||||
formData.value.creditMethod = quotation.creditMethod;
|
||||
formData.value.creditCalcCycle = quotation.creditCalcCycle;
|
||||
|
||||
formData.value.deptId = quotation.deptId;
|
||||
formData.value.offlinePrice = quotation.offlinePrice;
|
||||
formData.value.onlinePrice = quotation.onlinePrice;
|
||||
formData.value.totalPrice = quotation.totalPrice;
|
||||
|
||||
// 🔁 自动加载客户详情
|
||||
await onCustomerChange(quotation.customerId);
|
||||
} catch (err) {
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const onCustomerChange = async (customerId: string) => {
|
||||
if (!customerId) return;
|
||||
|
||||
try {
|
||||
formLoading.value = true;
|
||||
const customerRes = await CustomerApi.getCustomer(customerId);
|
||||
formData.value.cooperationType = customerRes.cooperationType;
|
||||
formData.value.companyType = customerRes.companyType;
|
||||
formData.value.listingStatus = customerRes.listingStatus;
|
||||
formData.value.financingInfo = customerRes.financingInfo;
|
||||
formData.value.paidInCapital = customerRes.paidInCapital;
|
||||
formData.value.insuredCount = customerRes.insuredCount;
|
||||
formData.value.establishmentDate = customerRes.establishmentDate;
|
||||
formData.value.enterpriseType = customerRes.enterpriseType;
|
||||
formData.value.businessStatus = customerRes.businessStatus;
|
||||
formData.value.defendantRecord = customerRes.defendantRecord;
|
||||
formData.value.businessAbnormal = customerRes.businessAbnormal;
|
||||
formData.value.equityPledge = customerRes.equityPledge;
|
||||
formData.value.dishonestRecord = customerRes.dishonestRecord;
|
||||
formData.value.financingRecord = customerRes.financingRecord;
|
||||
formData.value.enforcementRecord = customerRes.enforcementRecord;
|
||||
} catch (err) {
|
||||
console.error('获取客户详情失败:', err);
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 动态获取客户联系人 */
|
||||
const getContactOptions = computed(() =>
|
||||
contactList.value.filter((item) => item.customerId == formData.value.customerId)
|
||||
)
|
||||
|
||||
const route = useRoute();
|
||||
onBeforeMount(async () => {
|
||||
console.log('%csrc/views/crm/contract/detail/ContractChangeDetail.vue:409 props.id,route.query.id', 'color: #007acc;', props.id,route.query.id);
|
||||
formType.value = props.id || route.query.id;
|
||||
|
||||
if (formType.value) open(formType.value)
|
||||
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
// 获得报价列表
|
||||
quotationList.value = await QuotationApi.getSimpleQuotationList()
|
||||
|
||||
// 默认新建时选中自己
|
||||
// if (formType.value === 'create') {
|
||||
// formData.value.ownerUserId = useUserStore().getUser.id
|
||||
// }
|
||||
// 获取联系人
|
||||
contactList.value = await ContactApi.getSimpleContactList()
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,842 @@
|
|||
<template>
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
基础信息
|
||||
</ContentWrap>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="name">
|
||||
<el-input v-model="formData.name" disabled placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="formType">
|
||||
<el-form-item label="合同编号" prop="no">
|
||||
<el-input v-model="formData.no" disabled placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报价单编号" prop="quotationId">
|
||||
<el-select
|
||||
@change="handleQuotationChange"
|
||||
v-model="formData.quotationId"
|
||||
placeholder="请选择报价单编号"
|
||||
disabled
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in quotationList"
|
||||
:key="item.id"
|
||||
:label="item.no"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<el-select
|
||||
v-model="formData.customerId"
|
||||
disabled=""
|
||||
placeholder="客户"
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in contactList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="方案签约人" prop="pricingUserId">
|
||||
<el-select
|
||||
@change="handleQuotationChange"
|
||||
v-model="formData.pricingUserId"
|
||||
disabled
|
||||
class="w-1/1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in quotationList"
|
||||
:key="item.id"
|
||||
:label="item.no"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信额度" prop="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" placeholder="授信额度" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信方式" prop="creditMethod" >
|
||||
<el-select v-model="formData.creditMethod" placeholder="授信方式" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_method')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信计算周期" prop="creditCalcCycle" >
|
||||
<el-select v-model="formData.creditCalcCycle" placeholder="授信计算周期" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_calc_cycle')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="第几次报价" prop="quotationTimes">
|
||||
<el-input v-model="formData.quotationTimes" disabled placeholder="第几次报价" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账期" prop="paymentTerm">
|
||||
<el-select v-model="formData.paymentTerm" disabled 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="invoiceTemplateId">
|
||||
<el-select v-model="formData.invoiceTemplateId" disabled placeholder="请选择票据模板">
|
||||
<el-option
|
||||
v-for="dict in templateOptions"
|
||||
: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="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
|
||||
placeholder="总金额"
|
||||
v-model="formData.totalPrice"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
甲方基本信息
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="甲方名称" prop="partyName">
|
||||
<el-select v-model="formData.partyName" disabled 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="customerId">
|
||||
<el-input v-model="formData.customerId" disabled placeholder="客户编号" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="法人代表" prop="legalPersonName">
|
||||
<el-input v-model="formData.legalPersonName" placeholder="法人代表" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="统一信用代码" prop="creditNo">
|
||||
<el-input v-model="formData.creditNo" placeholder="统一信用代码" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="企业类型" prop="regType">
|
||||
<el-input v-model="formData.regType" placeholder="企业类型" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-form-item label="融资信息" prop="financingInfo">
|
||||
<el-input v-model="formData.financingInfo" placeholder="融资信息" disabled />
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实缴资金" prop="actualCapital">
|
||||
<el-input v-model="formData.actualCapital" placeholder="实缴资金" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参保人数" prop="socialEmployeeNum">
|
||||
<el-input v-model="formData.socialEmployeeNum" placeholder="参保人数" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-form-item label="上市情况" prop="listingStatus">
|
||||
<el-input v-model="formData.listingStatus" placeholder="上市情况" disabled />
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="注册地址" prop="registeredAddress">
|
||||
<el-input v-model="formData.registeredAddress" placeholder="注册地址" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
乙方基本信息
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" placeholder="合作主体" disabled >
|
||||
<el-option
|
||||
v-for="dict in orgList"
|
||||
:key="dict.id"
|
||||
:label="dict.orgName"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户行" prop="bankName">
|
||||
<el-input v-model="formData.bankName" placeholder="开户行" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行账号" prop="bankAccount">
|
||||
<el-input v-model="formData.bankAccount" placeholder="银行账号" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="法人代表" prop="legalRepresentative">
|
||||
<el-input v-model="formData.legalRepresentative" placeholder="法人代表" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="商务负责人" prop="ownerUserId">
|
||||
<el-input v-model="formData.ownerUserId" placeholder="商务负责人" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input
|
||||
v-model="formData.ownerUserMobile"
|
||||
placeholder="手机号"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="E-mail" prop="email">
|
||||
<el-input
|
||||
v-model="formData.ownerUserEmail"
|
||||
placeholder="E-mail"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="微信号" prop="wechat">
|
||||
<el-input
|
||||
v-model="formData.ownerUserWechat"
|
||||
placeholder="微信号"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="formData.deptId"
|
||||
:data="deptTree"
|
||||
disabled
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
合同信息
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同类型" prop="contractType">
|
||||
<el-radio-group v-model="formData.contractType" disabled>
|
||||
<el-radio :label="1">单次合同</el-radio>
|
||||
<el-radio :label="2">框架合同</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同签订日期" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="formData.startTime"
|
||||
disabled
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合同签订日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
type="date"
|
||||
disabled
|
||||
value-format="x"
|
||||
placeholder="选择合同结束时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同期限(月)" prop="contractTerm">
|
||||
<el-input v-model="formData.contractTerm" disabled oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入合同期限(月)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账单日" prop="statementDate">
|
||||
<el-select v-model="formData.statementDate" disabled placeholder="请选择账单日" >
|
||||
<el-option
|
||||
v-for="(dict, index) in statement"
|
||||
:key="index"
|
||||
:label="index + 1"
|
||||
:value="index + 1"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最晚付款日" prop="lastPayDate">
|
||||
<el-select v-model="formData.lastPayDate" disabled placeholder="请选择最晚付款日" >
|
||||
<el-option
|
||||
v-for="(dict, index) in statement"
|
||||
:key="index"
|
||||
:label="index + 1"
|
||||
:value="index + 1"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="违约金比例" prop="penaltyRate">
|
||||
<el-input v-model="formData.penaltyRate" disabled placeholder="请输入违约金比例" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="延期付款利率" prop="latePaymentRate">
|
||||
<el-input v-model="formData.latePaymentRate" disabled placeholder="请输入延期付款利率" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||
<el-input v-model="formData.invoiceTemplateId" placeholder="请输入票据模板" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row> -->
|
||||
<el-col :span="24">
|
||||
<ContentWrap style="border: none;font-weight: 700">
|
||||
财务与客服对接信息
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="财务结算方式" prop="settleMethod">
|
||||
<el-radio-group v-model="formData.settleMethod" disabled>
|
||||
<el-radio :label="1">按月结算</el-radio>
|
||||
<el-radio :label="0">按项目结算</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="售后维护人" prop="afterSaleUserId">
|
||||
<el-select v-model="formData.afterSaleUserId" disabled placeholder="请选择售后维护人">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="协作人" prop="collUserId">
|
||||
<el-select v-model="formData.collUserId" disabled placeholder="请选择协作人">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="合同正文" prop="contractBody">
|
||||
<el-input v-model="formData.contractBody" disabled type="textarea" rows="5" placeholder="请输入合同正文" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="合同补充协议" prop="contractAgreement">
|
||||
<el-input v-model="formData.contractAgreement" disabled type="textarea" rows="5" placeholder="请输入合同补充协议" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
<!-- 子表的表单 -->
|
||||
<ContentWrap>
|
||||
<el-tabs v-model="subTabsName" class="-mt-15px -mb-10px">
|
||||
<el-tab-pane label="产品清单" name="product">
|
||||
<ContractProductForm
|
||||
:type="1"
|
||||
ref="productFormRef"
|
||||
:products="formData.products"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同甲方关联单位" name="contractAAuthorizedCompany">
|
||||
<ContractAAuthorizedCompanyForm :type="1" ref="contractAAuthorizedCompanyFormRef" :contract-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同甲方授权人信息" name="contractAAuthorizedPerson">
|
||||
<ContractAAuthorizedPersonForm :type="1" ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同乙方授权人信息" name="contractBAuthorizedPerson">
|
||||
<ContractBAuthorizedPersonForm :type="1" ref="contractBAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
<!-- 显示在其他页面时的判断type -->
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import * as ContactApi from '@/api/crm/contact'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import { QuotationApi,QuotationVO } from '@/api/crm/quotation'
|
||||
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue'
|
||||
import ContractAAuthorizedCompanyForm from '../components/ContractAAuthorizedCompanyForm.vue'
|
||||
import ContractAAuthorizedPersonForm from '../components/ContractAAuthorizedPersonForm.vue'
|
||||
import ContractBAuthorizedPersonForm from '../components/ContractBAuthorizedPersonForm.vue'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined),
|
||||
type: propTypes.number.def(undefined),
|
||||
})
|
||||
const templateOptions = ref([])
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
partyName: undefined,
|
||||
lastPayDate: undefined,
|
||||
partAddress: undefined,
|
||||
secPartyPerson: undefined,
|
||||
wechat: undefined,
|
||||
quotationId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
penaltyRate: undefined,
|
||||
latePaymentRate: undefined,
|
||||
settleMethod: undefined,
|
||||
lastPayDate: undefined,
|
||||
contractTerm: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
signEmail: undefined,
|
||||
signWechat: undefined,
|
||||
offlinePrice: undefined,
|
||||
onlinePrice: undefined,
|
||||
ownerUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
pricingUserId: undefined,
|
||||
afterSaleUserId: undefined,
|
||||
collUserId: undefined,
|
||||
totalPrice: undefined,
|
||||
contractBody: undefined,
|
||||
contractAgreement: undefined,
|
||||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
statementDate: undefined,
|
||||
products: []
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||
quotationId: [{ required: true, message: '报价单编号不能为空', trigger: 'blur' }],
|
||||
orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }],
|
||||
// ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
||||
statementDate: [{ required: true, message: '账单日不能为空', trigger: 'change' }],
|
||||
contractType: [{ required: true, message: '合同类型不能为空', trigger: 'change' }],
|
||||
penaltyRate: [{ required: true, message: '违约金比例不能为空', trigger: 'blur' }],
|
||||
latePaymentRate: [{ required: true, message: '延期付款利率不能为空', trigger: 'blur' }],
|
||||
collUserId: [{ required: true, message: '协作人不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const quotationList = ref<QuotationVO[]>([])
|
||||
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||
const orgList = ref([])
|
||||
const statement = ref(new Array(31).fill(null))
|
||||
|
||||
/** 子表的表单 */
|
||||
const subTabsName = ref('product')
|
||||
const productFormRef = ref()
|
||||
const contractAAuthorizedCompanyFormRef = ref()
|
||||
const contractAAuthorizedPersonFormRef = ref()
|
||||
const contractBAuthorizedPersonFormRef = ref()
|
||||
|
||||
/** 计算 discountPrice、totalPrice 价格 */
|
||||
watch(
|
||||
() => formData.value,
|
||||
(val) => {
|
||||
if (!val) {
|
||||
return
|
||||
}
|
||||
// const totalPrice = val.products.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
||||
// 赋值
|
||||
// formData.value.totalPrice = totalPrice
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string) => {
|
||||
if (type) {
|
||||
// formLoading.value = true
|
||||
try {
|
||||
formData.value = await ContractApi.getContract(type)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
if(contractAAuthorizedCompanyFormRef.value.getData().length) {
|
||||
const contractAAuthorizedCompanyValid = await contractAAuthorizedCompanyFormRef.value.validate()
|
||||
if (!contractAAuthorizedCompanyValid) return message.warning('请完善合同甲方关联单位')
|
||||
} else {
|
||||
return message.warning('请完善合同甲方关联单位')
|
||||
}
|
||||
|
||||
if(contractAAuthorizedPersonFormRef.value.getData().length) {
|
||||
const contractAAuthorizedPerson = await contractAAuthorizedPersonFormRef.value.validate()
|
||||
if (!contractAAuthorizedPerson) return message.warning('请完善合同甲方授权人信息')
|
||||
} else {
|
||||
return message.warning('请完善合同甲方授权人信息')
|
||||
}
|
||||
|
||||
if(contractBAuthorizedPersonFormRef.value.getData().length) {
|
||||
const contractBAuthorizedPersonPerson = await contractBAuthorizedPersonFormRef.value.validate()
|
||||
if (!contractBAuthorizedPersonPerson) return message.warning('请完善合同乙方授权人信息')
|
||||
} else {
|
||||
return message.warning('请完善合同乙方授权人信息')
|
||||
}
|
||||
|
||||
return
|
||||
formLoading.value = true
|
||||
|
||||
try {
|
||||
const data = unref(formData.value) as unknown as ContractApi.ContractVO
|
||||
// 拼接子表的数据
|
||||
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||
data.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData()
|
||||
data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData()
|
||||
if (!formType.value ) {
|
||||
await ContractApi.createContract(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ContractApi.updateContract(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
goBack()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const goBack = ()=> {
|
||||
proxy.$router.go(-1)
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
quotationId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
penaltyRate: undefined,
|
||||
latePaymentRate: undefined,
|
||||
settleMethod: undefined,
|
||||
lastPayDate: undefined,
|
||||
contractTerm: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
signEmail: undefined,
|
||||
signWechat: undefined,
|
||||
offlinePrice: undefined,
|
||||
onlinePrice: undefined,
|
||||
ownerUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
pricingUserId: undefined,
|
||||
afterSaleUserId: undefined,
|
||||
collUserId: undefined,
|
||||
totalPrice: undefined,
|
||||
contractBody: undefined,
|
||||
contractAgreement: undefined,
|
||||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
paymentTerm: undefined,
|
||||
products: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
|
||||
/** 处理商机变化 */
|
||||
const handleQuotationChange = async (quotationId: number) => {
|
||||
if (!quotationId) return
|
||||
try {
|
||||
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||
formData.value.products = quotation.products;
|
||||
formData.value.customerId = quotation.customerId;
|
||||
|
||||
formData.value.invoiceTemplateId = quotation.invoiceTemplateId;
|
||||
|
||||
formData.value.ownerUserId = quotation.ownerUserId;
|
||||
formData.value.ownerUserMobile = quotation.ownerUserMobile;
|
||||
formData.value.ownerUserWechat = quotation.ownerUserWechat;
|
||||
formData.value.ownerUserEmail = quotation.ownerUserEmail;
|
||||
formData.value.expanderUserId = quotation.expanderUserId;
|
||||
formData.value.signUserId = quotation.signUserId;
|
||||
formData.value.signPhoneNumber = quotation.signPhoneNumber;
|
||||
formData.value.signEmail = quotation.signEmail;
|
||||
formData.value.paymentTerm = quotation.paymentTerm;
|
||||
|
||||
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;
|
||||
|
||||
const customerRes = await ContractApi.quotationTimes(quotation.id);
|
||||
formData.value.quotationTimes = customerRes.quotationTimes;
|
||||
await onCustomerChange(quotation.customerId);
|
||||
await onPartnerChange(quotation.partnerCompanyId);
|
||||
} 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.actualCapital = customerRes.actualCapital;
|
||||
|
||||
formData.value.partAddress = customerRes.partAddress;
|
||||
formData.value.listingStatus = customerRes.listingStatus;
|
||||
formData.value.legalPersonName = customerRes.legalPersonName;
|
||||
formData.value.creditCode = customerRes.creditCode;
|
||||
formData.value.regType = customerRes.regType;
|
||||
formData.value.financingInfo = customerRes.financingInfo;
|
||||
formData.value.socialEmployeeNum = customerRes.socialEmployeeNum;
|
||||
formData.value.registeredAddress = customerRes.registeredAddress;
|
||||
} catch (err) {
|
||||
console.error('获取客户详情失败:', err);
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const onPartnerChange = async (id: string) => {
|
||||
if (!id) return
|
||||
try {
|
||||
formLoading.value = true;
|
||||
const res = await ContractApi.getOrgInfo(id);
|
||||
formData.value.bankName = res.bankName;
|
||||
formData.value.bankAccount = res.bankAccount;
|
||||
formData.value.legalRepresentative = res.legalRepresentative;
|
||||
formData.value.businessLicenseNumber = res.businessLicenseNumber;
|
||||
formData.value.businessLicense = res.businessLicense;
|
||||
// formData.value.partnerCompanyId = res.partnerCompanyId;
|
||||
} catch (err) {
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 动态获取客户联系人 */
|
||||
const getContactOptions = computed(() =>
|
||||
contactList.value.filter((item) => item.customerId == formData.value.customerId)
|
||||
)
|
||||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
formType.value = props.id || route.query.id
|
||||
|
||||
if (formType.value) await open(formType.value)
|
||||
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
// 获得报价列表
|
||||
quotationList.value = await QuotationApi.getSimpleQuotationList()
|
||||
|
||||
//票据
|
||||
const tempData = await BillTemplateApi.getBillTemplatePage({
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
})
|
||||
templateOptions.value = tempData.list
|
||||
|
||||
|
||||
// 获得部门树
|
||||
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
// 默认新建时选中自己
|
||||
// if (formType.value === 'create') {
|
||||
// formData.value.ownerUserId = useUserStore().getUser.id
|
||||
// }
|
||||
// 获取联系人
|
||||
contactList.value = await ContactApi.getSimpleContactList()
|
||||
const data = await ContractApi.getOrg({
|
||||
pageNo: 1,
|
||||
pageSize: 1000
|
||||
})
|
||||
orgList.value = data.list
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,39 +1,35 @@
|
|||
<!-- 合同详情页面组件-->
|
||||
<template>
|
||||
<ContractDetailsHeader v-loading="loading" :contract="contract">
|
||||
<el-button v-if="permissionListRef?.validateWrite" @click="openForm('update', contract.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-if="permissionListRef?.validateOwnerUser" type="primary" @click="transferContract">
|
||||
转移
|
||||
</el-button>
|
||||
</ContractDetailsHeader>
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-col>
|
||||
<el-tabs>
|
||||
<el-tab-pane label="跟进记录">
|
||||
<FollowUpList :biz-id="contract.id" :biz-type="BizTypeEnum.CRM_CONTRACT" />
|
||||
<FollowUpList :biz-id="contract.id" :type="1" :biz-type="BizTypeEnum.CRM_CONTRACT" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="基本信息">
|
||||
<el-tab-pane label="合同信息">
|
||||
<ContractDetailsInfo :contract="contract" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="产品">
|
||||
<!-- <el-tab-pane label="产品">
|
||||
<ContractProductList :contract="contract" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="回款">
|
||||
</el-tab-pane> -->
|
||||
<!-- <el-tab-pane label="回款">
|
||||
<ReceivablePlanList
|
||||
:type="1"
|
||||
:contract-id="contract.id!"
|
||||
:customer-id="contract.customerId"
|
||||
@create-receivable="createReceivable"
|
||||
/>
|
||||
<ReceivableList
|
||||
ref="receivableListRef"
|
||||
:type="1"
|
||||
:contract-id="contract.id!"
|
||||
:customer-id="contract.customerId"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="团队成员">
|
||||
<PermissionList
|
||||
ref="permissionListRef"
|
||||
:type="1"
|
||||
:biz-id="contract.id!"
|
||||
:biz-type="BizTypeEnum.CRM_CONTRACT"
|
||||
:show-action="true"
|
||||
|
|
@ -45,29 +41,26 @@
|
|||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ContractForm ref="formRef" @success="getContractData" />
|
||||
<CrmTransferForm ref="transferFormRef" :biz-type="BizTypeEnum.CRM_CONTRACT" @success="close" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||
import { OperateLogVO } from '@/api/system/operatelog'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import ContractDetailsInfo from './ContractDetailsInfo.vue'
|
||||
import ContractDetailsInfo from './ContractDetail.vue'
|
||||
import ContractDetailsHeader from './ContractDetailsHeader.vue'
|
||||
import ContractProductList from './ContractProductList.vue'
|
||||
import { BizTypeEnum } from '@/api/crm/permission'
|
||||
import { getOperateLogPage } from '@/api/crm/operateLog'
|
||||
import ContractForm from '@/views/crm/contract/ContractForm.vue'
|
||||
import CrmTransferForm from '@/views/crm/permission/components/TransferForm.vue'
|
||||
import PermissionList from '@/views/crm/permission/components/PermissionList.vue'
|
||||
import FollowUpList from '@/views/crm/followup/index.vue'
|
||||
import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue'
|
||||
import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
defineOptions({ name: 'CrmContractDetail' })
|
||||
const props = defineProps<{ id?: number }>()
|
||||
|
||||
|
||||
const route = useRoute()
|
||||
const message = useMessage()
|
||||
|
|
@ -75,7 +68,9 @@ const contractId = ref(0) // 编号
|
|||
const loading = ref(true) // 加载中
|
||||
const contract = ref<ContractApi.ContractVO>({} as ContractApi.ContractVO) // 详情
|
||||
const permissionListRef = ref<InstanceType<typeof PermissionList>>() // 团队成员列表 Ref
|
||||
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined)
|
||||
})
|
||||
/** 编辑 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
|
|
@ -127,7 +122,8 @@ const close = () => {
|
|||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
const id = props.id || route.params.id
|
||||
console.log('%csrc/views/crm/contract/detail/index.vue:125 props.id', 'color: #007acc;', props.id);
|
||||
const id = props.id || route.query.id
|
||||
if (!id) {
|
||||
message.warning('参数错误,合同不能为空!')
|
||||
close()
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
重置
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['crm:contract:create']" type="primary" @click="openForm('create')">
|
||||
<el-button v-hasPermi="['crm:contract:create']" type="primary" @click="openFormAdd">
|
||||
<Icon class="mr-5px" icon="ep:plus" />
|
||||
新增
|
||||
</el-button>
|
||||
|
|
@ -79,16 +79,16 @@
|
|||
<el-tab-pane label="下属负责的" name="3" />
|
||||
</el-tabs>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||
<el-table-column align="center" fixed="left" label="合同编号" prop="no" width="180" />
|
||||
<el-table-column align="center" fixed="left" label="合同名称" prop="name" width="160">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row)">
|
||||
{{ scope.row.name }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合同编号" prop="no" width="180" />
|
||||
<el-table-column align="center" label="客户名称" prop="customerName" width="120">
|
||||
<template #default="scope">
|
||||
<!-- <template #default="scope">
|
||||
<el-link
|
||||
:underline="false"
|
||||
type="primary"
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
>
|
||||
{{ scope.row.customerName }}
|
||||
</el-link>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="商机名称" prop="businessName" width="130">
|
||||
<template #default="scope">
|
||||
|
|
@ -192,23 +192,24 @@
|
|||
width="180px"
|
||||
/>
|
||||
<el-table-column align="center" label="创建人" prop="creatorName" width="120" />
|
||||
<el-table-column align="center" fixed="right" label="合同状态" prop="auditStatus" width="120">
|
||||
<el-table-column align="center" label="合同状态" prop="auditStatus" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="250">
|
||||
<template #default="scope">
|
||||
<div style="display:flex">
|
||||
<el-button
|
||||
v-if="scope.row.auditStatus === 0"
|
||||
v-hasPermi="['crm:contract:update']"
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
@click="openFormEdit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
v-if="scope.row.auditStatus === 0"
|
||||
v-hasPermi="['crm:contract:update']"
|
||||
link
|
||||
|
|
@ -218,23 +219,34 @@
|
|||
提交审核
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
link
|
||||
v-if="scope.row.auditStatus === 0"
|
||||
v-hasPermi="['crm:contract:update']"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleProcessDetail(scope.row)"
|
||||
@click="handleChange(scope.row)"
|
||||
>
|
||||
查看审批
|
||||
</el-button>
|
||||
合同变更
|
||||
</el-button> -->
|
||||
<el-button
|
||||
v-hasPermi="['crm:contract:query']"
|
||||
link
|
||||
type="primary"
|
||||
@click="openDetail(scope.row.id)"
|
||||
@click="openDetail(scope.row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.auditStatus !== 0"
|
||||
link
|
||||
v-hasPermi="['crm:customer-suggestion:query']"
|
||||
type="primary"
|
||||
@click="handleProcessDetail(scope.row)"
|
||||
>
|
||||
进度
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-if="scope.row.auditStatus !== 0 && scope.row.auditStatus !== 10"
|
||||
v-hasPermi="['crm:contract:delete']"
|
||||
link
|
||||
type="danger"
|
||||
|
|
@ -242,6 +254,39 @@
|
|||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
v-if="scope.row.auditStatus === 0"
|
||||
@command="(command) => handleCommand(command, scope.row)"
|
||||
v-hasPermi="[
|
||||
'crm:contract:update',
|
||||
'crm:contract:delete'
|
||||
]"
|
||||
>
|
||||
<el-button type="primary" link><Icon icon="ep:d-arrow-right" /> 更多</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
command="handleSubmit"
|
||||
v-if="checkPermi(['crm:contract:update']) && scope.row.auditStatus === 0"
|
||||
>
|
||||
提交审核
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="handleChange"
|
||||
v-if="checkPermi(['crm:contract:update']) && scope.row.auditStatus === 0"
|
||||
>
|
||||
合同变更
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="handleDelete"
|
||||
v-if="checkPermi(['crm:contract:delete']) && scope.row.auditStatus === 0"
|
||||
>
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -254,17 +299,15 @@
|
|||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ContractForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import ContractForm from './ContractForm.vue'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
import { TabsPaneContext } from 'element-plus'
|
||||
|
||||
defineOptions({ name: 'CrmContract' })
|
||||
|
|
@ -321,8 +364,39 @@ const resetQuery = () => {
|
|||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
const router = useRouter() // 路由
|
||||
|
||||
const openFormEdit = (row: Object) => {
|
||||
|
||||
router.push({ name: 'CrmContractEdit', query: { id: row.id} })
|
||||
}
|
||||
const openFormAdd = () => {
|
||||
push({ name: 'CrmContractAdd' })
|
||||
}
|
||||
|
||||
const openFormDetail = (row: Object) => {
|
||||
|
||||
push({ name: 'CrmContractDetail', query: { id: row.id } })
|
||||
}
|
||||
const handleChange = (row) => {
|
||||
router.push({ name: 'CrmContractChange', query: { id: row.id } })
|
||||
|
||||
}
|
||||
/** 操作分发 */
|
||||
const handleCommand = (command: string, row: UserApi.UserVO) => {
|
||||
switch (command) {
|
||||
case 'handleSubmit':
|
||||
handleSubmit(row)
|
||||
break
|
||||
case 'handleChange':
|
||||
handleChange(row)
|
||||
break
|
||||
case 'handleDelete':
|
||||
handleDelete(row.id)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
|
@ -362,19 +436,19 @@ const handleSubmit = async (row: ContractApi.ContractVO) => {
|
|||
}
|
||||
|
||||
/** 查看审批 */
|
||||
const handleProcessDetail = (row: ContractApi.ContractVO) => {
|
||||
push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
|
||||
const handleProcessDetail = (row) => {
|
||||
router.push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
|
||||
}
|
||||
|
||||
/** 打开合同详情 */
|
||||
const { push } = useRouter()
|
||||
const openDetail = (id: number) => {
|
||||
push({ name: 'CrmContractDetail', params: { id } })
|
||||
const openDetail = (row: Object) => {
|
||||
router.push({ name: 'CrmContractDetail', query: { id: row.id } })
|
||||
}
|
||||
|
||||
/** 打开客户详情 */
|
||||
const openCustomerDetail = (id: number) => {
|
||||
push({ name: 'CrmCustomerDetail', params: { id } })
|
||||
router.push({ name: 'CrmCustomerDetail', query: { id } })
|
||||
}
|
||||
|
||||
/** 打开联系人详情 */
|
||||
|
|
@ -392,4 +466,7 @@ onMounted(async () => {
|
|||
await getList()
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
})
|
||||
onActivated(()=>{
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -10,14 +10,26 @@
|
|||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入客户名称" />
|
||||
<el-autocomplete
|
||||
v-model="formData.name"
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
:trigger-on-focus="false"
|
||||
clearable
|
||||
class="inline-input w-50"
|
||||
placeholder="请输入客户名称"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<div class="value">{{ item.name }}</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商务拓展人" prop="developer">
|
||||
<el-form-item label="线索拓展人" prop="developer">
|
||||
<el-select
|
||||
class="w-1/1"
|
||||
placeholder="请选择商务拓展人"
|
||||
placeholder="请选择线索拓展人"
|
||||
v-model="formData.developer"
|
||||
filterable
|
||||
>
|
||||
|
|
@ -58,7 +70,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="负责人" prop="ownerUserId">
|
||||
<el-select
|
||||
v-model="formData.ownerUserId"
|
||||
|
|
@ -73,24 +85,10 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="协助人" prop="">
|
||||
<el-select v-model="formData.assist" filterable 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-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="线索拓展人" prop="">
|
||||
<el-select v-model="formData.clueDeveloper" filterable placeholder="请选择线索拓展人" class="w-1/1">
|
||||
<el-select v-model="formData.assist" collapse-tags collapse-tags-tooltip multiple filterable placeholder="请选择协助人" class="w-1/1">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
|
|
@ -100,6 +98,18 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="线索拓展人" prop="">-->
|
||||
<!-- <el-select v-model="formData.clueDeveloper" filterable 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="12">
|
||||
<el-form-item label="客户来源" prop="source">
|
||||
<el-select v-model="formData.source" filterable placeholder="请选择客户来源" class="w-1/1">
|
||||
|
|
@ -112,10 +122,8 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input v-model="formData.mobile" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
|
|
@ -125,25 +133,35 @@
|
|||
<el-input v-model="formData.telephone" placeholder="请输入电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="formData.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="下次联系时间" prop="contactNextTime">
|
||||
<el-date-picker
|
||||
v-model="formData.contactNextTime"
|
||||
placeholder="选择下次联系时间"
|
||||
type="datetime"
|
||||
value-format="x"
|
||||
class="!w-1/1"
|
||||
</el-col>-->
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="客户行业" prop="industryId">
|
||||
<el-select v-model="formData.industryId" placeholder="请选择客户行业" >
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户级别" prop="level">
|
||||
<el-select v-model="formData.level" placeholder="请选择客户级别" >
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_LEVEL)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
|
|
@ -156,11 +174,35 @@
|
|||
<el-input v-model="formData.qq" placeholder="请输入 QQ" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
</el-row>-->
|
||||
<!-- <el-col :span="12"> -->
|
||||
<!-- <el-form-item label="统一信用代码" prop="creditNo">
|
||||
<el-input v-model="formData.creditNo" disabled placeholder="请输入详细地址" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="营业状态" prop="serviceStatus">
|
||||
<el-input v-model="formData.serviceStatus" disabled placeholder="营业状态" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户行业" prop="industryId">
|
||||
<el-select v-model="formData.industryId" placeholder="请选择客户行业" class="w-1/1">
|
||||
<el-form-item label="法人代表" prop="legalPersonName">
|
||||
<el-input v-model="formData.legalPersonName" disabled placeholder="法人代表" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注册资本" prop="registerCapital">
|
||||
<el-input v-model="formData.registerCapital" disabled placeholder="注册资本" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="网站" prop="">
|
||||
<el-input v-model="formData.website" placeholder="请输入网站" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="所属行业" prop="industryId">
|
||||
<el-select v-model="formData.industryId" placeholder="所属行业" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY)"
|
||||
:key="dict.value"
|
||||
|
|
@ -169,10 +211,10 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户级别" prop="level">
|
||||
<el-select v-model="formData.level" placeholder="请选择客户级别" class="w-1/1">
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="注册地址" prop="registeredAddress">
|
||||
<el-select v-model="formData.registeredAddress" placeholder="请选择注册地址" >
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_LEVEL)"
|
||||
:key="dict.value"
|
||||
|
|
@ -181,9 +223,19 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注册日期" prop="contactNextTime">
|
||||
<el-date-picker
|
||||
disabled
|
||||
v-model="formData.startDate"
|
||||
placeholder="选择下次联系时间"
|
||||
type="date"
|
||||
value-format="x"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地址" prop="areaId">
|
||||
<el-cascader
|
||||
|
|
@ -202,6 +254,17 @@
|
|||
<el-input v-model="formData.detailAddress" placeholder="请输入详细地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="下次联系时间" prop="contactNextTime">
|
||||
<el-date-picker
|
||||
v-model="formData.contactNextTime"
|
||||
placeholder="选择下次联系时间"
|
||||
type="datetime"
|
||||
value-format="x"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
|
|
@ -225,6 +288,7 @@ import * as AreaApi from '@/api/system/area'
|
|||
import { defaultProps } from '@/utils/tree'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { json } from 'stream/consumers'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
|
@ -238,6 +302,7 @@ const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
|||
const formData = ref({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
startDate: undefined,
|
||||
contactNextTime: undefined,
|
||||
ownerUserId: 0,
|
||||
mobile: undefined,
|
||||
|
|
@ -252,8 +317,14 @@ const formData = ref({
|
|||
source: undefined,
|
||||
remark: undefined,
|
||||
developer: undefined,
|
||||
assist: undefined,
|
||||
assist: [],
|
||||
creditNo: undefined,
|
||||
clueDeveloper: undefined,
|
||||
serviceStatus: undefined,
|
||||
legalPersonName: undefined,
|
||||
registerCapital: undefined,
|
||||
website: undefined,
|
||||
registeredAddress: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }],
|
||||
|
|
@ -261,6 +332,7 @@ const formRules = reactive({
|
|||
developer: [{ required: true, message: '商务拓展人不能为空', trigger: 'change' }],
|
||||
cooperationType: [{ required: true, message: '合作类型不能为空', trigger: 'change' }],
|
||||
cooperationArea: [{ required: true, message: '合作地区不能为空', trigger: 'change' }],
|
||||
website: [{ required: true, message: '网站不能为空', trigger: 'change' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
|
|
@ -279,6 +351,7 @@ const open = async (type: string, id?: number) => {
|
|||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
restaurants.value = await CustomerApi.getCompanyList({companyName: '小米科技有限责任公司'})
|
||||
// 获得地区列表
|
||||
areaList.value = await AreaApi.getAreaTree()
|
||||
// 获得用户列表
|
||||
|
|
@ -287,7 +360,7 @@ const open = async (type: string, id?: number) => {
|
|||
if (formType.value === 'create') {
|
||||
formData.value.ownerUserId = useUserStore().getUser.id
|
||||
formData.value.developer = useUserStore().getUser.id
|
||||
formData.value.assist = useUserStore().getUser.id
|
||||
// formData.value.assist = useUserStore().getUser.id
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -319,11 +392,54 @@ const submitForm = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
// const loadAll = async (val) => {
|
||||
// restaurants.value = await CustomerApi.getCompanyList({
|
||||
// companyName: val
|
||||
// })
|
||||
// }
|
||||
|
||||
interface RestaurantItem {
|
||||
value: string
|
||||
link: string
|
||||
}
|
||||
let timeout: ReturnType<typeof setTimeout>
|
||||
const restaurants = ref<RestaurantItem[]>([])
|
||||
const querySearchAsync = async (queryString: string, cb: (arg: any) => void) => {
|
||||
let data = await CustomerApi.getCompanyList({
|
||||
companyName: queryString
|
||||
})
|
||||
restaurants.value = data.list.map(v => {
|
||||
return Object.assign(v, {value: v.name})
|
||||
})
|
||||
const results = queryString
|
||||
? restaurants.value.filter(createFilter(queryString))
|
||||
: restaurants.value
|
||||
|
||||
clearTimeout(timeout)
|
||||
timeout = setTimeout(() => {
|
||||
cb(results)
|
||||
}, 3000 * Math.random())
|
||||
}
|
||||
const createFilter = (queryString: string) => {
|
||||
return (restaurant: RestaurantItem) => {
|
||||
return (
|
||||
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const handleSelect = (item: Record<string, any>) => {
|
||||
formData.value.legalPersonName = item.legalPersonName
|
||||
formData.value.registerCapital = item.regCapital
|
||||
formData.value.startDate = item.regDate
|
||||
}
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
regCapital: undefined,
|
||||
regDate: undefined,
|
||||
contactNextTime: undefined,
|
||||
ownerUserId: 0,
|
||||
mobile: undefined,
|
||||
|
|
@ -338,7 +454,7 @@ const resetForm = () => {
|
|||
source: undefined,
|
||||
reamark: undefined,
|
||||
developer: undefined,
|
||||
assist: undefined,
|
||||
assist: [],
|
||||
clueDeveloper: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@
|
|||
<el-descriptions-item label="线索拓展人">{{ customer.clueDeveloperName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="协助人">{{ customer.assistName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属行业">{{ customer.industryId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="售后维护人">{{ customer.maintainerName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="商务签约人">{{ customer.contractorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="信用统一代码">{{ customer.creditNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号">{{ customer.mobile }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电话">{{ customer.telephone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">{{ customer.email }}</el-descriptions-item>
|
||||
|
|
|
|||
|
|
@ -63,6 +63,9 @@
|
|||
<el-tab-pane label="商机" lazy>
|
||||
<BusinessList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="方案报价" lazy>
|
||||
<QuotationList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同" lazy>
|
||||
<ContractList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
|
|
@ -95,6 +98,7 @@ import ReturnVisitrecord from './returnvisitrecord/index.vue' // 回访
|
|||
import ContactList from '@/views/crm/contact/components/ContactList.vue' // 联系人列表
|
||||
import ContractList from '@/views/crm/contract/components/ContractList.vue' // 合同列表
|
||||
import BusinessList from '@/views/crm/business/components/BusinessList.vue' // 商机列表
|
||||
import QuotationList from '@/views/crm/contract/components/QuotationList.vue' // 报价列表
|
||||
import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue' // 回款列表
|
||||
import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' // 回款计划列表
|
||||
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<el-form-item label="回访类型" prop="type">
|
||||
<el-select v-model="formData.type" placeholder="请选择回访类型">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_RETURN_VISIT_STSTUS)"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_FOLLOW_UP_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
<el-row class="mb-10px" justify="end">
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm"
|
||||
class="ml-5px"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
<Icon class="mr-5px" icon="ep:edit" />
|
||||
写回访
|
||||
</el-button>
|
||||
</el-row>
|
||||
<!-- 列表 -->
|
||||
|
|
@ -26,7 +25,19 @@
|
|||
width="180px"
|
||||
/>
|
||||
<el-table-column label="图片" align="center" prop="picUrls" />
|
||||
<el-table-column label="附件" align="center" prop="fileUrls" />
|
||||
<el-table-column label="附件" align="center" prop="fileUrls">
|
||||
<!-- <template #default="scope">
|
||||
<el-link
|
||||
v-if="scope.row.fileUrls"
|
||||
:underline="false"
|
||||
type="primary"
|
||||
@click="previewFile(scope.row.fileUrls)"
|
||||
>
|
||||
预览
|
||||
</el-link>
|
||||
<span v-else>无附件</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="关联的联系人编号数组" align="center" prop="contactIds" />
|
||||
<el-table-column label="创建者" align="center" prop="creator" />
|
||||
<el-table-column
|
||||
|
|
@ -165,6 +176,36 @@ const handleExport = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
const previewFile = (fileUrls) => {
|
||||
// 假设 fileUrls 是一个字符串,包含文件的完整 URL
|
||||
if (!fileUrls) {
|
||||
message.error('没有附件');
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查文件类型
|
||||
const fileExtension = fileUrls.split('.').pop().toLowerCase();
|
||||
switch (fileExtension) {
|
||||
case 'pdf':
|
||||
// 预览 PDF 文件
|
||||
window.open(fileUrls, '_blank');
|
||||
break;
|
||||
case 'xlsx':
|
||||
case 'xls':
|
||||
// 预览 Excel 文件
|
||||
window.open(fileUrls, '_blank');
|
||||
break;
|
||||
case 'doc':
|
||||
case 'docx':
|
||||
// 预览 Word 文件
|
||||
window.open(fileUrls, '_blank');
|
||||
break;
|
||||
default:
|
||||
message.error('不支持的文件类型');
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@
|
|||
<el-tab-pane label="下属负责的" name="3" />
|
||||
</el-tabs>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||
<el-table-column align="center" fixed="left" label="客户名称" prop="name" width="160">
|
||||
<el-table-column align="center" fixed="left" label="客户名称" prop="name" width="250">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||
{{ scope.row.name }}
|
||||
|
|
@ -125,14 +125,41 @@
|
|||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="手机" prop="mobile" width="120" />
|
||||
<el-table-column align="center" label="电话" prop="telephone" width="130" />
|
||||
<el-table-column align="center" label="邮箱" prop="email" width="180" />
|
||||
<el-table-column align="center" label="客户级别" prop="level" width="135">
|
||||
<el-table-column align="center" label="客户状态" prop="serviceStatus" width="120" />
|
||||
<!-- <el-table-column align="center" label="电话" prop="telephone" width="130" />
|
||||
<el-table-column align="center" label="邮箱" prop="email" width="180" /> -->
|
||||
<el-table-column align="center" label="客户级别" prop="level" width="145">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="商务拓展人" prop="developerName" width="120">
|
||||
<template #default="scope">
|
||||
{{scope.row.developerName || '暂无'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="商务签约人" prop="contractorName" width="120">
|
||||
<template #default="scope">
|
||||
{{scope.row.contractorName || '暂无'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="归属部门" prop="ownerUserDeptName" width="120">
|
||||
<template #default="scope">
|
||||
{{scope.row.ownerUserDeptName || '暂无'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="售后维护人" prop="maintainerName" width="120">
|
||||
<template #default="scope">
|
||||
{{scope.row.maintainerName || '暂无'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="协助人" prop="assistName" width="250">
|
||||
<template #default="scope">
|
||||
{{scope.row.assistName || '暂无'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="信用统一代码" prop="creditNo" width="180" />
|
||||
|
||||
<el-table-column align="center" label="客户行业" prop="industryId" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@
|
|||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="160">
|
||||
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="220">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||
{{ scope.row.name }}
|
||||
|
|
@ -112,9 +112,16 @@
|
|||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机" align="center" prop="mobile" width="120" />
|
||||
<el-table-column label="电话" align="center" prop="telephone" width="130" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" width="180" />
|
||||
<el-table-column label="合作类型" align="center" prop="mobile" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_COOPERATION_TYPE" :value="scope.row.cooperationType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合作地区" align="center" prop="telephone" width="130">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_COOPERATION_AREA" :value="scope.row.cooperationArea" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="客户级别" prop="level" width="135">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
|
||||
|
|
@ -125,6 +132,7 @@
|
|||
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="信用统一代码" prop="creditNo" width="180" />
|
||||
<el-table-column
|
||||
:formatter="dateFormatter"
|
||||
align="center"
|
||||
|
|
@ -161,6 +169,26 @@
|
|||
width="180px"
|
||||
/>
|
||||
<el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
|
||||
<el-table-column align="center" fixed="right" label="操作" min-width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPermi="['crm:customer:receive']"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleReceive(scope.row)"
|
||||
>
|
||||
领取
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['crm:customer:distribute']"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleDistributeForm(scope.row)"
|
||||
>
|
||||
分配
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
|
|
@ -170,6 +198,10 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<CustomerForm ref="formRef" @success="getList" />
|
||||
<CustomerDistributeForm ref="distributeForm" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -177,6 +209,8 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import CustomerForm from '@/views/crm/customer/CustomerForm.vue'
|
||||
import CustomerDistributeForm from '@/views/crm/customer/pool/CustomerDistributeForm.vue'
|
||||
|
||||
defineOptions({ name: 'CrmCustomerPool' })
|
||||
|
||||
|
|
@ -240,6 +274,20 @@ const openDetail = (id: number) => {
|
|||
push({ name: 'CrmCustomerDetail', params: { id } })
|
||||
}
|
||||
|
||||
/** 领取客户 */
|
||||
const handleReceive = async (row) => {
|
||||
await message.confirm(`确定领取客户【${row.name}】 吗?`)
|
||||
await CustomerApi.receiveCustomer([unref(row.id)])
|
||||
message.success(`领取客户【${row.name}】成功`)
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 分配客户 */
|
||||
const distributeForm = ref<InstanceType<typeof CustomerDistributeForm>>() // 分配客户表单 Ref
|
||||
const handleDistributeForm = async (row) => {
|
||||
distributeForm.value?.open(row.id)
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 某个记录的跟进记录列表,目前主要用于 CRM 客户、商机等详情界面 -->
|
||||
<template>
|
||||
<!-- 操作栏 -->
|
||||
<el-row class="mb-10px" justify="end">
|
||||
<el-row class="mb-10px" justify="end" v-if="!type">
|
||||
<el-button @click="openForm">
|
||||
<Icon class="mr-5px" icon="ep:edit" />
|
||||
写跟进
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<el-table-column align="center" label="操作" v-if="!type">
|
||||
<template #default="scope">
|
||||
<el-button link type="danger" @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
||||
</template>
|
||||
|
|
@ -99,7 +99,8 @@ import { BizTypeEnum } from '@/api/crm/permission'
|
|||
defineOptions({ name: 'FollowUpRecord' })
|
||||
const props = defineProps<{
|
||||
bizType: number
|
||||
bizId: number
|
||||
bizId: number,
|
||||
type: number
|
||||
}>()
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<!-- 操作栏 -->
|
||||
<el-row v-if="showAction" justify="end">
|
||||
<el-row v-if="showAction && !type" justify="end">
|
||||
<el-button v-if="validateOwnerUser" type="primary" @click="openForm">
|
||||
<Icon class="mr-5px" icon="ep:plus" />
|
||||
新增
|
||||
|
|
@ -57,7 +57,8 @@ const message = useMessage() // 消息
|
|||
const props = defineProps<{
|
||||
bizType: number // 模块类型
|
||||
bizId: number | undefined // 模块数据编号
|
||||
showAction: boolean //是否展示操作按钮
|
||||
showAction: boolean, //是否展示操作按钮
|
||||
type: number
|
||||
}>()
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<PermissionApi.PermissionVO[]>([]) // 列表的数据
|
||||
|
|
|
|||
|
|
@ -8,15 +8,11 @@
|
|||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报价单编号" prop="no">
|
||||
<el-input v-model="formData.no" placeholder="请输入报价单编号" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="选择商机" prop="businessId">
|
||||
<el-select v-model="formData.businessId" placeholder="请选择商机" @change="onBusinessChange" disabled>
|
||||
<el-select v-model="formData.businessId" disabled clearable placeholder="请选择商机" @change="onBusinessChange">
|
||||
<el-option
|
||||
v-for="dict in businessList"
|
||||
:key="dict.id"
|
||||
|
|
@ -26,12 +22,32 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="formType">
|
||||
<el-form-item label="报价单编号" prop="">
|
||||
<el-input v-model="formData.no" disabled placeholder="自动获取" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<ContentWrap style="border: none; font-weight: 700">风控信息</ContentWrap>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="系统授信额度" prop="customerId">
|
||||
<el-input v-model="formData.creditAmount" disabled placeholder="自动获取" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信额度调整" prop="creditLimitNum">
|
||||
<el-input v-model="formData.creditLimitNum" disabled @input="changeNum" clearable placeholder="请输入授信额度调整" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最终授信额度" prop="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" disabled placeholder="自动获取" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户" prop="customerId">
|
||||
<el-select v-model="formData.customerId" disabled placeholder="请选择客户" @change="onCustomerChange">
|
||||
<el-select v-model="formData.customerId" disabled placeholder="请选择客户" clearable @change="onCustomerChange">
|
||||
<el-option
|
||||
v-for="item in customerList"
|
||||
:key="item.id"
|
||||
|
|
@ -43,135 +59,143 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作类型" prop="cooperationType">
|
||||
<el-input v-model="formData.cooperationType" disabled />
|
||||
<el-select v-model="formData.cooperationType" disabled filterable clearable placeholder="请选择合作类型" class="w-1/1">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司类型" prop="companyType">
|
||||
<el-input v-model="formData.companyType" disabled />
|
||||
<el-form-item label="公司类型" prop="regType">
|
||||
<el-input v-model="formData.regType" disabled clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="上市情况" prop="listingStatus">
|
||||
<el-input v-model="formData.listingStatus" disabled />
|
||||
<el-input v-model="formData.listingStatus" disabled clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="融资信息" prop="financingInfo">
|
||||
<el-input v-model="formData.financingInfo" disabled />
|
||||
<el-input v-model="formData.financingInfo" disabled clearable />
|
||||
</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 label="实缴资金" prop="actualCapital">
|
||||
<el-input v-model="formData.actualCapital" disabled clearable />
|
||||
</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 label="参保人数" prop="socialEmployeeNum">
|
||||
<el-input v-model="formData.socialEmployeeNum" disabled clearable />
|
||||
</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 label="成立日期" prop="startDate">
|
||||
<el-input v-model="formData.startDate" disabled clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="企业类型" prop="enterpriseType">
|
||||
<el-input v-model="formData.enterpriseType" disabled />
|
||||
<el-input v-model="formData.enterpriseType" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业状态" prop="businessStatus">
|
||||
<el-input v-model="formData.businessStatus" disabled />
|
||||
<el-form-item label="营业状态" prop="serviceStatus">
|
||||
<el-input v-model="formData.serviceStatus" disabled clearable />
|
||||
</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 v-model="formData.defendantRecord" disabled>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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-form-item label="经营异常" prop="abnormalService">
|
||||
<el-radio-group v-model="formData.abnormalService" disabled>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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 v-model="formData.equityPledge" disabled>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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-form-item label="失信记录" prop="dishonestyRecord">
|
||||
<el-radio-group v-model="formData.dishonestyRecord" disabled>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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-form-item label="融资记录" prop="financeRecord">
|
||||
<el-radio-group v-model="formData.financeRecord" disabled>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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-form-item label="被执行记录" prop="judgmentRecord">
|
||||
<el-radio-group v-model="formData.judgmentRecord" disabled>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<ContentWrap style="border: none; font-weight: 700">需求信息</ContentWrap>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" disabled placeholder="请选择合作主体" @change="onPartnerChange">
|
||||
<el-select v-model="formData.partnerCompanyId" clearable disabled placeholder="请选择合作主体" @change="onPartnerChange">
|
||||
<el-option
|
||||
v-for="dict in deptList"
|
||||
v-for="dict in orgList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:label="dict.orgName"
|
||||
: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 label="开户行" prop="bankName">
|
||||
<el-input v-model="formData.bankName" 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 label="银行账号" prop="bankAccount">
|
||||
<el-input v-model="formData.bankAccount" 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 label="法人代表" prop="legalRepresentative">
|
||||
<el-input v-model="formData.legalRepresentative" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="营业执照号" prop="bBusinessLicenseNumber">
|
||||
<el-input v-model="formData.bBusinessLicenseNumber" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业执照" prop="bBusinessLicense">
|
||||
<el-input v-model="formData.bBusinessLicense" disabled />
|
||||
<el-form-item label="营业执照" prop="businessLicense">
|
||||
<el-input v-model="formData.businessLicense" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
|
@ -181,8 +205,8 @@
|
|||
<el-col :span="8">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
disabled
|
||||
v-model="formData.deptId"
|
||||
disabled
|
||||
:data="deptTree"
|
||||
:props="defaultProps"
|
||||
filterable
|
||||
|
|
@ -242,21 +266,21 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="签约人联系电话" prop="signPhoneNumber">
|
||||
<el-input v-model="formData.signPhoneNumber" disabled placeholder="请输入签约人联系电话" />
|
||||
<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" disabled placeholder="请输入签约人Email" />
|
||||
<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" disabled placeholder="请输入签约人微信" />
|
||||
<el-input v-model="formData.signWechat" placeholder="请输入签约人微信" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账期" prop="paymentTerm">
|
||||
|
|
@ -345,7 +369,7 @@
|
|||
<!-- 子表的表单 -->
|
||||
<el-tabs v-model="subTabsName">
|
||||
<el-tab-pane label="报价产品关联" name="quotationProduct">
|
||||
<QuotationProductForm ref="quotationProductFormRef" :quotation-id="formData.id" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" />
|
||||
<QuotationProductForm ref="quotationProductFormRef" :products="formData.products" :quotation-id="formData.id" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</ContentWrap>
|
||||
|
|
@ -356,11 +380,12 @@ import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
|||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import QuotationProductForm from './components/QuotationProductDetail.vue'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
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'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
/** CRM 方案报价 表单 */
|
||||
defineOptions({ name: 'QuotationForm' })
|
||||
|
|
@ -373,8 +398,12 @@ const templateOptions = ref([])
|
|||
const businessList = ref([])
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const deptList = ref() // 部门
|
||||
|
||||
const orgList = ref([])
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined),
|
||||
})
|
||||
const invoiceTemplateList = ref([])
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
|
@ -425,13 +454,27 @@ const formData = ref({
|
|||
bBankAccount: undefined, // 银行账号
|
||||
bLegalRepresentative: undefined, // 法人代表
|
||||
bBusinessLicenseNumber: undefined, // 营业执照号
|
||||
bBusinessLicense: undefined // 营业执照
|
||||
bBusinessLicense: undefined, // 营业执照
|
||||
creditAmount: undefined,
|
||||
creditLimitNum: 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' }]
|
||||
// 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' }],
|
||||
// actualCapital: [{ required: true, message: '实缴资金不能为空', trigger: 'blur' }],
|
||||
// socialEmployeeNum: [{ required: true, message: '参保人数不能为空', trigger: 'blur' }],
|
||||
// defendantRecord: [{ required: true, message: '被告记录不能为空', trigger: 'blur' }],
|
||||
// abnormalService: [{ required: true, message: '经营异常不能为空', trigger: 'blur' }],
|
||||
// equityPledge: [{ required: true, message: '股权出质不能为空', trigger: 'blur' }],
|
||||
// dishonestyRecord: [{ required: true, message: '失信记录不能为空', trigger: 'blur' }],
|
||||
// financeRecord: [{ required: true, message: '融资记录不能为空', trigger: 'blur' }],
|
||||
// judgmentRecord: [{ required: true, message: '被执行记录不能为空', trigger: 'blur' }],
|
||||
// paymentTerm: [{ required: true, message: '账期不能为空', trigger: 'change' }],
|
||||
// partnerCompanyId: [{ required: true, message: '合作主体不能为空', trigger: 'change' }],
|
||||
// creditMethod: [{ required: true, message: '授信方式不能为空', trigger: 'change' }],
|
||||
// creditCalcCycle: [{ required: true, message: '授信计算周期不能为空', trigger: 'change' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
|
|
@ -468,6 +511,10 @@ const onCustomerChange = async (customerId: string) => {
|
|||
try {
|
||||
formLoading.value = true;
|
||||
const customerRes = await CustomerApi.getCustomer(customerId);
|
||||
formData.value.actualCapital = customerRes.actualCapital
|
||||
formData.value.socialEmployeeNum = customerRes.socialEmployeeNum
|
||||
formData.value.startDate = customerRes.startDate
|
||||
formData.value.actualCapital = customerRes.actualCapital
|
||||
formData.value.cooperationType = customerRes.cooperationType;
|
||||
formData.value.companyType = customerRes.companyType;
|
||||
formData.value.listingStatus = customerRes.listingStatus;
|
||||
|
|
@ -494,21 +541,25 @@ 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;
|
||||
const res = await ContractApi.getOrgInfo(id);
|
||||
formData.value.bankName = res.bankName;
|
||||
formData.value.bankAccount = res.bankAccount;
|
||||
formData.value.legalRepresentative = res.legalRepresentative;
|
||||
formData.value.businessLicenseNumber = res.businessLicenseNumber;
|
||||
formData.value.businessLicense = res.businessLicense;
|
||||
// formData.value.partnerCompanyId = res.partnerCompanyId;
|
||||
} catch (err) {
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const changeNum = (val) => {
|
||||
formData.value.creditLimit = (Number(val) + (formData.value.creditAmount || 0)).toFixed(2)
|
||||
}
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string) => {
|
||||
dialogVisible.value = true
|
||||
formType.value = type
|
||||
// 修改时,设置数据
|
||||
if (type) {
|
||||
formLoading.value = true
|
||||
|
|
@ -520,6 +571,8 @@ const open = async (type: string) => {
|
|||
}
|
||||
|
||||
deptList.value = await DeptApi.getSimpleDeptList()
|
||||
// 获得用户列表
|
||||
invoiceTemplateList.value = await BillTemplateApi.getSimpleList()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
|
|
@ -551,12 +604,17 @@ const submitForm = async () => {
|
|||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
goBack()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const goBack = ()=> {
|
||||
proxy.$router.go(-1)
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
|
|
@ -590,7 +648,8 @@ const resetForm = () => {
|
|||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
formType.value = route.query.id;
|
||||
console.log('%csrc/views/crm/quotation/QuotationDetail.vue:651 props.id', 'color: #007acc;', props.id, route.query.id);
|
||||
formType.value = props.id || route.query.id;
|
||||
|
||||
if (formType.value) open(formType.value)
|
||||
|
||||
|
|
@ -604,8 +663,13 @@ onMounted(async () => {
|
|||
pageSize: 1000,
|
||||
})
|
||||
templateOptions.value = data.list
|
||||
businessList.value = await BusinessApi.getSimpleBusinessList()
|
||||
businessList.value = await BusinessApi.getSelfSimpleBusinessList()
|
||||
// 获得部门树
|
||||
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
const org = await ContractApi.getOrg({
|
||||
pageNo: 1,
|
||||
pageSize: 1000
|
||||
})
|
||||
orgList.value = org.list
|
||||
});
|
||||
</script>
|
||||
|
|
@ -8,15 +8,11 @@
|
|||
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-select v-model="formData.businessId" clearable placeholder="请选择商机" @change="onBusinessChange">
|
||||
<el-option
|
||||
v-for="dict in businessList"
|
||||
:key="dict.id"
|
||||
|
|
@ -26,12 +22,32 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="formType">
|
||||
<el-form-item label="报价单编号" prop="">
|
||||
<el-input v-model="formData.no" disabled placeholder="自动获取" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<ContentWrap style="border: none; font-weight: 700">风控信息</ContentWrap>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="系统授信额度" prop="customerId">
|
||||
<el-input v-model="formData.creditAmount" disabled placeholder="自动获取" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信额度调整" prop="creditLimitNum">
|
||||
<el-input v-model="formData.creditLimitNum" @input="changeNum" clearable placeholder="请输入授信额度调整" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最终授信额度" prop="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" disabled placeholder="自动获取" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户" prop="customerId">
|
||||
<el-select v-model="formData.customerId" placeholder="请选择客户" @change="onCustomerChange">
|
||||
<el-select v-model="formData.customerId" placeholder="请选择客户" disabled clearable @change="onCustomerChange">
|
||||
<el-option
|
||||
v-for="item in customerList"
|
||||
:key="item.id"
|
||||
|
|
@ -43,137 +59,145 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作类型" prop="cooperationType">
|
||||
<el-input v-model="formData.cooperationType" disabled />
|
||||
<el-select v-model="formData.cooperationType" filterable clearable placeholder="请选择合作类型" class="w-1/1">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司类型" prop="companyType">
|
||||
<el-input v-model="formData.companyType" disabled />
|
||||
<el-form-item label="公司类型" prop="regType">
|
||||
<el-input v-model="formData.regType" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="上市情况" prop="listingStatus">
|
||||
<el-input v-model="formData.listingStatus" disabled />
|
||||
<el-input v-model="formData.listingStatus" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="融资信息" prop="financingInfo">
|
||||
<el-input v-model="formData.financingInfo" disabled />
|
||||
<el-input v-model="formData.financingInfo" clearable />
|
||||
</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 label="实缴资金" prop="actualCapital">
|
||||
<el-input v-model="formData.actualCapital" clearable />
|
||||
</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 label="参保人数" prop="socialEmployeeNum">
|
||||
<el-input v-model="formData.socialEmployeeNum" clearable />
|
||||
</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 label="成立日期" prop="startDate">
|
||||
<el-input v-model="formData.startDate" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="企业类型" prop="enterpriseType">
|
||||
<el-input v-model="formData.enterpriseType" disabled />
|
||||
<el-input v-model="formData.enterpriseType" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业状态" prop="businessStatus">
|
||||
<el-input v-model="formData.businessStatus" disabled />
|
||||
<el-form-item label="营业状态" prop="serviceStatus">
|
||||
<el-input v-model="formData.serviceStatus" clearable />
|
||||
</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 v-model="formData.defendantRecord">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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-form-item label="经营异常" prop="abnormalService">
|
||||
<el-radio-group v-model="formData.abnormalService">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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 v-model="formData.equityPledge">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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-form-item label="失信记录" prop="dishonestyRecord">
|
||||
<el-radio-group v-model="formData.dishonestyRecord">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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-form-item label="融资记录" prop="financeRecord">
|
||||
<el-radio-group v-model="formData.financeRecord">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</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-form-item label="被执行记录" prop="judgmentRecord">
|
||||
<el-radio-group v-model="formData.judgmentRecord">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<ContentWrap style="border: none; font-weight: 700">需求信息</ContentWrap>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" placeholder="请选择合作主体" @change="onPartnerChange">
|
||||
<el-select v-model="formData.partnerCompanyId" clearable placeholder="请选择合作主体" @change="onPartnerChange">
|
||||
<el-option
|
||||
v-for="dict in deptList"
|
||||
v-for="dict in orgList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:label="dict.orgName"
|
||||
: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 label="开户行" prop="bankName">
|
||||
<el-input v-model="formData.bankName" 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 label="银行账号" prop="bankAccount">
|
||||
<el-input v-model="formData.bankAccount" 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 label="法人代表" prop="legalRepresentative">
|
||||
<el-input v-model="formData.legalRepresentative" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <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-col> -->
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="营业执照" prop="businessLicense">
|
||||
<el-input v-model="formData.businessLicense" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col>-->
|
||||
|
||||
</el-row>
|
||||
|
||||
|
|
@ -241,7 +265,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="签约人联系电话" prop="signPhoneNumber">
|
||||
<el-input v-model="formData.signPhoneNumber" placeholder="请输入签约人联系电话" />
|
||||
</el-form-item>
|
||||
|
|
@ -255,7 +279,7 @@
|
|||
<el-form-item label="签约人微信" prop="signWechat">
|
||||
<el-input v-model="formData.signWechat" placeholder="请输入签约人微信" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账期" prop="paymentTerm">
|
||||
|
|
@ -300,7 +324,7 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||
<el-select v-model="formData.invoiceTemplateId" placeholder="请选择票据模板">
|
||||
<el-select v-model="formData.invoiceTemplateId" :disabled="!formData.businessId" @change="changeTemplate" placeholder="请选择票据模板">
|
||||
<el-option
|
||||
v-for="dict in templateOptions"
|
||||
:key="dict.id"
|
||||
|
|
@ -310,6 +334,12 @@
|
|||
</el-select>
|
||||
</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="8">
|
||||
|
|
@ -344,7 +374,7 @@
|
|||
<!-- 子表的表单 -->
|
||||
<el-tabs v-model="subTabsName">
|
||||
<el-tab-pane label="报价产品关联" name="quotationProduct">
|
||||
<QuotationProductForm ref="quotationProductFormRef" :quotation-id="formData.id" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" />
|
||||
<QuotationProductForm ref="quotationProductFormRef" :handleType="handleType" :quotation-id="formData.id" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" :products="formData.products" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div style="text-align: right">
|
||||
|
|
@ -359,16 +389,18 @@ import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
|||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import QuotationProductForm from './components/QuotationProductForm.vue'
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
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 {BillTemplateApi } from '@/api/crm/billtemplate'
|
||||
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
/** CRM 方案报价 表单 */
|
||||
defineOptions({ name: 'QuotationForm' })
|
||||
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined),
|
||||
})
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
|
|
@ -377,6 +409,8 @@ const templateOptions = ref([])
|
|||
const businessList = ref([])
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const deptList = ref() // 部门
|
||||
const orgList = ref([])
|
||||
const handleType = ref('')
|
||||
|
||||
const invoiceTemplateList = ref([])
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
|
@ -430,13 +464,29 @@ const formData = ref({
|
|||
bBankAccount: undefined, // 银行账号
|
||||
bLegalRepresentative: undefined, // 法人代表
|
||||
bBusinessLicenseNumber: undefined, // 营业执照号
|
||||
bBusinessLicense: undefined // 营业执照
|
||||
bBusinessLicense: undefined, // 营业执照
|
||||
creditAmount: undefined,
|
||||
creditLimitNum: undefined,
|
||||
quotationTimes: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' }]
|
||||
invoiceTemplateId: [{ required: true, message: '票据模板Id不能为空', trigger: 'change' }],
|
||||
actualCapital: [{ required: true, message: '实缴资金不能为空', trigger: 'blur' }],
|
||||
socialEmployeeNum: [{ required: true, message: '参保人数不能为空', trigger: 'blur' }],
|
||||
defendantRecord: [{ required: true, message: '被告记录不能为空', trigger: 'blur' }],
|
||||
abnormalService: [{ required: true, message: '经营异常不能为空', trigger: 'blur' }],
|
||||
equityPledge: [{ required: true, message: '股权出质不能为空', trigger: 'blur' }],
|
||||
dishonestyRecord: [{ required: true, message: '失信记录不能为空', trigger: 'blur' }],
|
||||
financeRecord: [{ required: true, message: '融资记录不能为空', trigger: 'blur' }],
|
||||
judgmentRecord: [{ required: true, message: '被执行记录不能为空', trigger: 'blur' }],
|
||||
paymentTerm: [{ required: true, message: '账期不能为空', trigger: 'change' }],
|
||||
partnerCompanyId: [{ required: true, message: '合作主体不能为空', trigger: 'change' }],
|
||||
creditMethod: [{ required: true, message: '授信方式不能为空', trigger: 'change' }],
|
||||
creditCalcCycle: [{ required: true, message: '授信计算周期不能为空', trigger: 'change' }],
|
||||
quotationTimes: [{ required: true, message: '第几次报价不能为空', trigger: 'change' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
|
|
@ -446,6 +496,8 @@ const quotationProductFormRef = ref()
|
|||
|
||||
const onBusinessChange = async (businessId: string) => {
|
||||
if (!businessId) return
|
||||
|
||||
handleType.value = 1
|
||||
try {
|
||||
formLoading.value = true;
|
||||
const res = await BusinessApi.getBusiness(businessId);
|
||||
|
|
@ -473,6 +525,10 @@ const onCustomerChange = async (customerId: string) => {
|
|||
try {
|
||||
formLoading.value = true;
|
||||
const customerRes = await CustomerApi.getCustomer(customerId);
|
||||
formData.value.actualCapital = customerRes.actualCapital
|
||||
formData.value.socialEmployeeNum = customerRes.socialEmployeeNum
|
||||
formData.value.startDate = customerRes.startDate
|
||||
formData.value.actualCapital = customerRes.actualCapital
|
||||
formData.value.cooperationType = customerRes.cooperationType;
|
||||
formData.value.companyType = customerRes.companyType;
|
||||
formData.value.listingStatus = customerRes.listingStatus;
|
||||
|
|
@ -488,6 +544,7 @@ const onCustomerChange = async (customerId: string) => {
|
|||
formData.value.dishonestRecord = customerRes.dishonestRecord;
|
||||
formData.value.financingRecord = customerRes.financingRecord;
|
||||
formData.value.enforcementRecord = customerRes.enforcementRecord;
|
||||
formData.value.creditAmount = customerRes.creditAmount || 0;
|
||||
} catch (err) {
|
||||
console.error('获取客户详情失败:', err);
|
||||
} finally {
|
||||
|
|
@ -499,18 +556,22 @@ 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;
|
||||
const res = await ContractApi.getOrgInfo(id);
|
||||
formData.value.bankName = res.bankName;
|
||||
formData.value.bankAccount = res.bankAccount;
|
||||
formData.value.legalRepresentative = res.legalRepresentative;
|
||||
formData.value.businessLicenseNumber = res.businessLicenseNumber;
|
||||
formData.value.businessLicense = res.businessLicense;
|
||||
// formData.value.partnerCompanyId = res.partnerCompanyId;
|
||||
} catch (err) {
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const changeNum = (val) => {
|
||||
formData.value.creditLimit = (Number(val) + (formData.value.creditAmount || 0)).toFixed(2)
|
||||
}
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string) => {
|
||||
formType.value = type
|
||||
|
|
@ -565,6 +626,11 @@ const submitForm = async () => {
|
|||
|
||||
}
|
||||
|
||||
const changeTemplate = async() => {
|
||||
handleType.value = 1
|
||||
console.log('%csrc/views/crm/quotation/QuotationForm.vue:631 handleType.value,222', 'color: #007acc;', handleType.value,222);
|
||||
}
|
||||
|
||||
const goBack = ()=> {
|
||||
proxy.$router.go(-1)
|
||||
}
|
||||
|
|
@ -602,13 +668,12 @@ const resetForm = () => {
|
|||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
console.log('%csrc/views/crm/quotation/QuotationForm.vue:596 route', 'color: #007acc;', route);
|
||||
formType.value = route.query.id;
|
||||
formType.value = props.id || route.query.id;
|
||||
|
||||
if (formType.value) open(formType.value)
|
||||
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
customerList.value = await CustomerApi.getSelfCustomerSimpleList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
//票据
|
||||
|
|
@ -617,8 +682,13 @@ onMounted(async () => {
|
|||
pageSize: 1000,
|
||||
})
|
||||
templateOptions.value = data.list
|
||||
businessList.value = await BusinessApi.getSimpleBusinessList()
|
||||
businessList.value = await BusinessApi.getSelfSimpleBusinessList()
|
||||
// 获得部门树
|
||||
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
const org = await ContractApi.getOrg({
|
||||
pageNo: 1,
|
||||
pageSize: 1000
|
||||
})
|
||||
orgList.value = org.list
|
||||
});
|
||||
</script>
|
||||
|
|
@ -62,28 +62,57 @@
|
|||
<el-table-column label="产品票据" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_INVOICE" :value="row.productInvoice" />
|
||||
<el-select v-model="row.productInvoice" placeholder="请选择状态" disabled class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品开具项目" min-width="150">
|
||||
<el-table-column label="产品开具项目" min-width="250">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoiceItems`" :rules="formRules.productInvoiceItems" class="mb-0px!">
|
||||
<el-form-item :prop="`${$index}.productInvoiceItem`" :rules="formRules.productInvoiceItems" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_INVOICE_ITEMS" :value="row.productInvoiceItems" />
|
||||
<el-select v-model="row.productInvoiceItem" placeholder="请选择状态" disabled>
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务费票据" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoice`" :rules="formRules.serviceFeeInvoice" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_SERVICE_FEE_INVOICE" :value="row.serviceFeeInvoice" />
|
||||
<el-form-item :prop="`${$index}.serviceInvoice`" :rules="formRules.serviceFeeInvoice" class="mb-0px!">
|
||||
<el-select v-model="row.serviceInvoice" placeholder="请选择状态" disabled class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务开具项目" min-width="150">
|
||||
<el-table-column label="服务开具项目" min-width="250">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoiceItems`" :rules="formRules.serviceFeeInvoiceItems" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_SERVICE_FEE_INVOICE_ITEMS" :value="row.serviceFeeInvoiceItems" />
|
||||
<el-form-item :prop="`${$index}.serviceInvoiceItem`" :rules="formRules.serviceFeeInvoiceItems" class="mb-0px!">
|
||||
<el-select v-model="row.serviceInvoiceItem" placeholder="请选择状态" disabled class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE_ITEMS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -103,7 +132,9 @@ import * as BusinessApi from '@/api/crm/business'
|
|||
const props = defineProps<{
|
||||
quotationId: undefined, // 报价编号(主表的关联字段)
|
||||
businessId: undefined,
|
||||
billTemplateId: undefined
|
||||
billTemplateId: undefined,
|
||||
products: undefined
|
||||
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
@ -120,57 +151,21 @@ const formRules = reactive({
|
|||
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 }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.billTemplateId,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = []
|
||||
// 2. val 非空,则加载数据
|
||||
if (!val) {
|
||||
() => props.products,
|
||||
(val) => {
|
||||
if (!val || val.length === 0) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
formLoading.value = true
|
||||
// if(val.quotationId) {
|
||||
// formData.value = await QuotationApi.getQuotationProductListByQuotationId(val.quotationId)
|
||||
// } else if(val.businessId) {
|
||||
const business = await BillTemplateApi.getTemplateProduct({
|
||||
businessId: props.businessId,
|
||||
billTemplateId: val,
|
||||
});
|
||||
console.log('%csrc/views/crm/quotation/components/QuotationProductForm.vue:167 business.data', 'color: #007acc;', business.data);
|
||||
formData.value = business
|
||||
// }
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
nextTick(() => {
|
||||
formData.value = val
|
||||
console.log('%csrc/views/crm/quotation/components/QuotationProductDetail.vue:134 val', 'color: #007acc;', val);
|
||||
})
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
|
|
|
|||
|
|
@ -8,12 +8,13 @@
|
|||
: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">
|
||||
<el-table-column label="序号" type="index" width="80" />
|
||||
<el-table-column label="产品名称" min-width="240">
|
||||
<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">
|
||||
|
|
@ -31,10 +32,10 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="产品明细类型" min-width="150">
|
||||
<el-table-column label="产品明细" min-width="220">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
|
||||
<el-select v-model="row.detailType" placeholder="请选择状态" disabled class="!w-240px">
|
||||
<el-select v-model="row.detailType" placeholder="请选择状态" class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE)"
|
||||
:key="dict.value"
|
||||
|
|
@ -59,21 +60,21 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线上价格" min-width="150">
|
||||
<el-table-column label="线上价格(元)" min-width="120">
|
||||
<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-input v-model="row.onlinePrice" placeholder="请输入线上价格" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线下价格" min-width="150">
|
||||
<el-table-column label="线下价格(元)" min-width="120">
|
||||
<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-input v-model="row.offlinePrice" placeholder="请输入线下价格" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总计价格" min-width="150">
|
||||
<el-table-column label="总计价格(元)" min-width="120">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
||||
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" disabled />
|
||||
|
|
@ -94,10 +95,10 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品开具项目" min-width="150">
|
||||
<el-table-column label="产品开具项目" min-width="220">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoiceItems`" :rules="formRules.productInvoiceItems" class="mb-0px!">
|
||||
<el-select v-model="row.productInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-form-item :prop="`${$index}.productInvoiceItem`" :rules="formRules.productInvoiceItem" class="mb-0px!">
|
||||
<el-select v-model="row.productInvoiceItem" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE_ITEMS)"
|
||||
:key="dict.value"
|
||||
|
|
@ -110,8 +111,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="服务费票据" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoice`" :rules="formRules.serviceFeeInvoice" class="mb-0px!">
|
||||
<el-select v-model="row.serviceFeeInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-form-item :prop="`${$index}.serviceInvoice`" :rules="formRules.serviceInvoice" class="mb-0px!">
|
||||
<el-select v-model="row.serviceInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE)"
|
||||
:key="dict.value"
|
||||
|
|
@ -122,10 +123,10 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务开具项目" min-width="150">
|
||||
<el-table-column label="服务开具项目" min-width="240">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoiceItems`" :rules="formRules.serviceFeeInvoiceItems" class="mb-0px!">
|
||||
<el-select v-model="row.serviceFeeInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-form-item :prop="`${$index}.serviceInvoiceItem`" :rules="formRules.serviceInvoiceItem" class="mb-0px!">
|
||||
<el-select v-model="row.serviceInvoiceItem" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE_ITEMS)"
|
||||
:key="dict.value"
|
||||
|
|
@ -156,7 +157,9 @@ import * as BusinessApi from '@/api/crm/business'
|
|||
const props = defineProps<{
|
||||
quotationId: undefined, // 报价编号(主表的关联字段)
|
||||
businessId: undefined,
|
||||
billTemplateId: undefined
|
||||
billTemplateId: undefined,
|
||||
products: undefined,
|
||||
handleType: undefined
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
@ -169,14 +172,21 @@ const formRules = reactive({
|
|||
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
|
||||
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
|
||||
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],
|
||||
totalPrice: [{ required: true, message: '总计价格不能为空', trigger: 'blur' }]
|
||||
totalPrice: [{ required: true, message: '总计价格不能为空', trigger: 'blur' }],
|
||||
productInvoiceItem: [{ required: true, message: '产品开具项目不能为空', trigger: 'blur' }],
|
||||
serviceInvoice: [{ required: true, message: '服务费票据不能为空', trigger: 'blur' }],
|
||||
serviceInvoiceItem: [{ required: true, message: '服务开具项目不能为空', trigger: 'blur' }],
|
||||
productInvoice: [{ required: true, message: '产品票据不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const emit = defineEmits(['update:handleType'])
|
||||
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||
watch(
|
||||
() => props.businessId,
|
||||
async (val) => {
|
||||
|
||||
if(!props.handleType) return
|
||||
// 1. 重置表单
|
||||
formData.value = []
|
||||
// 2. val 非空,则加载数据
|
||||
|
|
@ -190,6 +200,8 @@ watch(
|
|||
// } else if(val.businessId) {
|
||||
const business = await BusinessApi.getBusiness(val);
|
||||
formData.value = business.products
|
||||
// console.log('%csrc/views/crm/quotation/components/QuotationProductForm.vue:214 1111', 'color: #007acc;', 2222);
|
||||
emit('update:handleType', 0)
|
||||
// }
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
|
|
@ -201,9 +213,11 @@ watch(
|
|||
watch(
|
||||
() => props.billTemplateId,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = []
|
||||
// 2. val 非空,则加载数据
|
||||
if(!props.handleType) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -216,8 +230,25 @@ watch(
|
|||
businessId: props.businessId,
|
||||
billTemplateId: val,
|
||||
});
|
||||
console.log('%csrc/views/crm/quotation/components/QuotationProductForm.vue:167 business.data', 'color: #007acc;', business.data);
|
||||
formData.value = business
|
||||
for(let i = 0; i < business.length; i++) {
|
||||
let data = business[i]
|
||||
if(!data.productId) {
|
||||
data.productInvoice = ''
|
||||
data.productInvoiceItem = ''
|
||||
data.serviceInvoice = ''
|
||||
data.serviceInvoiceItem = ''
|
||||
}
|
||||
let foundItem = formData.value.find(item => item.productId == data.productId);
|
||||
if (foundItem) {
|
||||
foundItem.productInvoice = data.productInvoice
|
||||
foundItem.productInvoiceItem = data.productInvoiceItems
|
||||
foundItem.serviceInvoice = data.serviceFeeInvoice
|
||||
foundItem.serviceInvoiceItem = data.serviceFeeInvoiceItems
|
||||
}
|
||||
}
|
||||
emit('update:handleType', 0)
|
||||
|
||||
// formData.value = business
|
||||
// }
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
|
|
@ -225,7 +256,39 @@ watch(
|
|||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
// 监听合同产品变化,计算合同产品总价
|
||||
watch(
|
||||
() => formData.value,
|
||||
(val) => {
|
||||
if (!val || val.length === 0) {
|
||||
return;
|
||||
}
|
||||
// 循环处理
|
||||
val.forEach((item) => {
|
||||
if (item.offlinePrice != null && item.onlinePrice != null) {
|
||||
item.totalPrice = Number((Number(item.offlinePrice) + Number(item.onlinePrice)).toFixed(2));
|
||||
} else {
|
||||
item.totalPrice = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.products,
|
||||
async (val) => {
|
||||
if (!val || val.length === 0) {
|
||||
return;
|
||||
}
|
||||
await nextTick(() => {
|
||||
formData.value = val
|
||||
})
|
||||
},
|
||||
{ immediate: true },
|
||||
|
||||
|
||||
);
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
const row = {
|
||||
|
|
@ -238,8 +301,8 @@ const handleAdd = () => {
|
|||
offlinePrice: undefined,
|
||||
totalPrice: undefined,
|
||||
productInvoice: undefined,
|
||||
productInvoiceItems: undefined,
|
||||
serviceFeeInvoice: undefined,
|
||||
productInvoiceItem: undefined,
|
||||
serviceInvoice: undefined,
|
||||
serviceFeeInvoiceItems: undefined
|
||||
}
|
||||
row.quotationId = props.quotationId
|
||||
|
|
|
|||
|
|
@ -84,17 +84,28 @@
|
|||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-tabs v-model="activeName" @tab-click="handleTabClick">
|
||||
<el-tab-pane label="我负责的" name="1" />
|
||||
<el-tab-pane label="我参与的" name="2" />
|
||||
<el-tab-pane label="下属负责的" name="3" />
|
||||
</el-tabs>
|
||||
<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">
|
||||
<el-table-column label="报价单编号" align="center" prop="no" width="200" >
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
|
||||
{{ scope.row.no }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户名称" align="center" prop="customerId" width="220">
|
||||
<template #default="scope">
|
||||
<!-- <el-link
|
||||
:underline="false"
|
||||
type="primary"
|
||||
@click="openCustomerDetail(scope.row.customerId)"
|
||||
>
|
||||
> -->
|
||||
{{ scope.row.customerName }}
|
||||
</el-link>
|
||||
<!-- </el-link> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商机负责人" align="center" prop="ownerUserId">
|
||||
|
|
@ -139,6 +150,7 @@
|
|||
/>
|
||||
<el-table-column label="操作" align="center" min-width="120px">
|
||||
<template #default="scope">
|
||||
<div style="display:flex">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
|
|
@ -154,14 +166,40 @@
|
|||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['crm:quotation:delete']"
|
||||
<el-dropdown
|
||||
@command="(command) => handleCommand(command, scope.row)"
|
||||
v-hasPermi="[
|
||||
'crm:quotation:delete',
|
||||
'crm:customer-suggestion:query',
|
||||
'system:permission:assign-user-role'
|
||||
]"
|
||||
>
|
||||
<el-button type="primary" link><Icon icon="ep:d-arrow-right" /> 更多</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
command="handleSubmit"
|
||||
v-if="checkPermi(['crm:contract:update']) && scope.row.auditStatus === 0"
|
||||
>
|
||||
提交审核
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="handleProcessDetail"
|
||||
v-if="checkPermi(['crm:customer-suggestion:query'])"
|
||||
>
|
||||
进度
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="handleDelete"
|
||||
v-if="checkPermi(['crm:quotation:delete'])"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -184,6 +222,8 @@ import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
|||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import { TabsPaneContext } from 'element-plus'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
/** CRM 方案报价 列表 */
|
||||
defineOptions({ name: 'Quotation' })
|
||||
|
|
@ -202,6 +242,7 @@ const queryParams = reactive({
|
|||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
no: undefined,
|
||||
sceneType: '1', // 默认和 activeName 相等
|
||||
customerId: undefined,
|
||||
ownerUserId: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
|
|
@ -209,6 +250,7 @@ const queryParams = reactive({
|
|||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
const activeName = ref('1') // 列表 tab
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
|
|
@ -228,25 +270,59 @@ const handleQuery = () => {
|
|||
getList()
|
||||
}
|
||||
|
||||
const openDetail = (id: number) => {
|
||||
router.push({ name: 'QuotationDetail', query: { id: id } })
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** tab 切换 */
|
||||
const handleTabClick = (tab: TabsPaneContext) => {
|
||||
queryParams.sceneType = tab.paneName
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openFormEdit = (row: Object) => {
|
||||
|
||||
push({ name: 'QuotationEdit', query: { id: row.id} })
|
||||
router.push({ name: 'QuotationEdit', query: { id: row.id} })
|
||||
}
|
||||
const openFormAdd = () => {
|
||||
push({ name: 'QuotationAdd' })
|
||||
router.push({ name: 'QuotationAdd' })
|
||||
}
|
||||
|
||||
const openFormDetail = (row: Object) => {
|
||||
|
||||
push({ name: 'QuotationDetail', query: { id: row.id, customerId: row.customerId } })
|
||||
router.push({ name: 'QuotationDetail', query: { id: row.id } })
|
||||
}
|
||||
/** 操作分发 */
|
||||
const handleCommand = (command: string, row: UserApi.UserVO) => {
|
||||
switch (command) {
|
||||
case 'handleSubmit':
|
||||
handleSubmit(row)
|
||||
break
|
||||
case 'handleDelete':
|
||||
handleDelete(row.id)
|
||||
break
|
||||
case 'handleProcessDetail':
|
||||
handleProcessDetail(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交审核 **/
|
||||
const handleSubmit = async (row: QuotationVO) => {
|
||||
await message.confirm(`您确定提交【${row.name}】审核吗?`)
|
||||
await QuotationApi.submitContract(row.id)
|
||||
message.success('提交审核成功!')
|
||||
await getList()
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
|
@ -262,6 +338,16 @@ const handleDelete = async (id: number) => {
|
|||
} catch {}
|
||||
}
|
||||
|
||||
/** 审批进度 */
|
||||
const router = useRouter() // 路由
|
||||
const handleProcessDetail = (row) => {
|
||||
router.push({
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
query: {
|
||||
id: row.processInstanceId
|
||||
}
|
||||
})
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
|
|
@ -295,4 +381,7 @@ onMounted(async () => {
|
|||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
})
|
||||
onActivated(()=>{
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<!-- 操作栏 -->
|
||||
<el-row justify="end">
|
||||
<el-row justify="end" v-if="!type">
|
||||
<el-button @click="openForm('create')">
|
||||
<Icon class="mr-5px" icon="icon-park:income-one" />
|
||||
创建回款
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
/>
|
||||
<el-table-column align="center" label="负责人" prop="ownerUserName" />
|
||||
<el-table-column align="center" label="备注" prop="remark" />
|
||||
<el-table-column align="center" fixed="right" label="操作" width="130px">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="130px" v-if="!type">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPermi="['crm:receivable:update']"
|
||||
|
|
@ -78,6 +78,7 @@ defineOptions({ name: 'CrmReceivableList' })
|
|||
const props = defineProps<{
|
||||
customerId?: number // 客户编号
|
||||
contractId?: number // 合同编号
|
||||
type: number
|
||||
}>()
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<!-- 操作栏 -->
|
||||
<el-row justify="end">
|
||||
<el-row justify="end" v-if="!type">
|
||||
<el-button @click="openForm('create', undefined)">
|
||||
<Icon class="mr-5px" icon="icon-park:income" />
|
||||
创建回款计划
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
/>
|
||||
<el-table-column label="负责人" prop="ownerUserName" width="120" />
|
||||
<el-table-column align="center" label="备注" prop="remark" />
|
||||
<el-table-column align="center" fixed="right" label="操作" width="200px">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="200px" v-if="!type">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPermi="['crm:receivable:create']"
|
||||
|
|
@ -89,6 +89,8 @@ defineOptions({ name: 'CrmReceivablePlanList' })
|
|||
const props = defineProps<{
|
||||
customerId?: number // 客户编号
|
||||
contractId?: number // 合同编号
|
||||
type: number
|
||||
|
||||
}>()
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ const echartsOption = reactive<EChartsOption>({
|
|||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['赢单转化率', '商机总数', '赢单商机数'],
|
||||
data: ['成交转化率', '商机总数', '成交商机数'],
|
||||
bottom: '0px',
|
||||
itemWidth: 14
|
||||
},
|
||||
|
|
@ -178,7 +178,7 @@ const echartsOption = reactive<EChartsOption>({
|
|||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '赢单转化率',
|
||||
name: '成交转化率',
|
||||
axisTick: {
|
||||
alignWithLabel: true,
|
||||
lineStyle: { width: 0 }
|
||||
|
|
@ -217,7 +217,7 @@ const echartsOption = reactive<EChartsOption>({
|
|||
],
|
||||
series: [
|
||||
{
|
||||
name: '赢单转化率',
|
||||
name: '成交转化率',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: []
|
||||
|
|
@ -230,7 +230,7 @@ const echartsOption = reactive<EChartsOption>({
|
|||
data: []
|
||||
},
|
||||
{
|
||||
name: '赢单商机数',
|
||||
name: '成交商机数',
|
||||
type: 'bar',
|
||||
yAxisIndex: 1,
|
||||
barWidth: 15,
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ const echartsOption = reactive<EChartsOption>({
|
|||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['客户', '商机', '赢单']
|
||||
data: ['客户', '商机', '成交']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
|
|
@ -97,7 +97,7 @@ const echartsOption = reactive<EChartsOption>({
|
|||
data: [
|
||||
{ value: 60, name: '客户-0个' },
|
||||
{ value: 40, name: '商机-0个' },
|
||||
{ value: 20, name: '赢单-0个' }
|
||||
{ value: 20, name: '成交-0个' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
@ -127,11 +127,11 @@ const loadData = async () => {
|
|||
if (active.value) {
|
||||
list.push({ value: 60, name: `客户-${data.customerCount || 0}个` })
|
||||
list.push({ value: 40, name: `商机-${data.businessCount || 0}个` })
|
||||
list.push({ value: 20, name: `赢单-${data.businessWinCount || 0}个` })
|
||||
list.push({ value: 20, name: `成交-${data.businessWinCount || 0}个` })
|
||||
} else {
|
||||
list.push({ value: data.customerCount || 0, name: `客户-${data.customerCount || 0}个` })
|
||||
list.push({ value: data.businessCount || 0, name: `商机-${data.businessCount || 0}个` })
|
||||
list.push({ value: data.businessWinCount || 0, name: `赢单-${data.businessWinCount || 0}个` })
|
||||
list.push({ value: data.businessWinCount || 0, name: `成交-${data.businessWinCount || 0}个` })
|
||||
}
|
||||
|
||||
echartsOption.series[0]['data'] = list
|
||||
|
|
|
|||
Loading…
Reference in New Issue