commit
a5e73d21b0
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://localhost:48080'
|
||||
VITE_BASE_URL='http://127.0.0.1:48080'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
|
|
|||
|
|
@ -125,6 +125,11 @@ 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 })
|
||||
}
|
||||
|
||||
// ==================== 子表(CRM 合同产品关联) ====================
|
||||
|
||||
// 获得CRM 合同产品关联列表
|
||||
|
|
|
|||
|
|
@ -557,11 +557,12 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
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/quotation'
|
||||
},
|
||||
|
|
@ -579,11 +580,12 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
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/quotation'
|
||||
},
|
||||
|
|
@ -645,11 +647,12 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
component: () => import('@/views/crm/contract/ContractChange.vue')
|
||||
},
|
||||
{
|
||||
path: 'contract/detail/:id',
|
||||
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>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
<div class="form-scroll-area">
|
||||
<el-scrollbar>
|
||||
<el-row>
|
||||
<el-col :span="17" class="!flex !flex-col formCol">
|
||||
<el-col :span="20" class="!flex !flex-col formCol">
|
||||
<!-- 表单信息 -->
|
||||
<div
|
||||
v-loading="processInstanceLoading"
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-col :span="4">
|
||||
<!-- 审批记录时间线 -->
|
||||
<ProcessInstanceTimeline :activity-nodes="activityNodes" />
|
||||
</el-col>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -165,9 +165,9 @@
|
|||
<el-form-item label="技术需求支持" prop="techSupport">
|
||||
<el-radio-group v-model="formData.techSupport">
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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 } })
|
||||
}
|
||||
|
||||
/** 变更商机状态 */
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
label-width="120px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="合同查询" prop="quotationId">
|
||||
<el-select
|
||||
@change="handleQuotationChange"
|
||||
|
|
@ -23,31 +23,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</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">
|
||||
<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> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<el-select
|
||||
|
|
@ -65,307 +41,72 @@
|
|||
</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 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="endTime">
|
||||
<el-form-item label="合同状态" prop="quotationId">
|
||||
<el-select v-model="formData.auditStatus" 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"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合同结束时间"
|
||||
placeholder="请选择协议截止日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</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-option
|
||||
v-for="dict in getIntDictOptions('settle_method')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最晚付款日期" prop="lastPayDate">
|
||||
<el-date-picker
|
||||
v-model="formData.lastPayDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择最晚付款日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同期限(月)" prop="contractTerm">
|
||||
<el-input v-model="formData.contractTerm" placeholder="请输入合同期限(月)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报价签约人" prop="signUserId">
|
||||
<el-select v-model="formData.signUserId" placeholder="请选择报价签约人" disabled >
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签约人联系电话" prop="signPhoneNumber">
|
||||
<el-input v-model="formData.signPhoneNumber" placeholder="请输入签约人联系电话" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签约人Email" prop="signEmail">
|
||||
<el-input v-model="formData.signEmail" placeholder="请输入签约人Email" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签约人微信" prop="signWechat">
|
||||
<el-input v-model="formData.signWechat" placeholder="请输入签约人微信" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="商机负责人" prop="ownerUserId">
|
||||
<el-select v-model="formData.ownerUserId" placeholder="请选择商机负责人" disabled>
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-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-option
|
||||
v-for="dict in getIntDictOptions('credit_method')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信计算周期" prop="creditCalcCycle" >
|
||||
<el-select v-model="formData.creditCalcCycle" placeholder="请选择授信计算周期" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_calc_cycle')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信额度" prop="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" placeholder="请输入授信额度" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" placeholder="请选择合作主体" disabled >
|
||||
<el-option
|
||||
v-for="dict in deptList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="归属部门" prop="deptId" >
|
||||
<el-tree-select
|
||||
v-model="formData.deptId"
|
||||
:data="deptTree"
|
||||
:props="defaultProps"
|
||||
filterable
|
||||
disabled
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="第几次报价" prop="quotationTimes">
|
||||
<el-input v-model="formData.quotationTimes" placeholder="请输入第几次报价" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同正文" prop="contractBody">
|
||||
<el-input v-model="formData.contractBody" placeholder="请输入合同正文" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同补充协议" prop="contractAgreement">
|
||||
<el-input v-model="formData.contractAgreement" placeholder="请输入合同补充协议" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线上总金额" prop="onlinePrice">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.onlinePrice"
|
||||
placeholder="请输入线上总金额,单位:元"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线下总金额" prop="offlinePrice">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.offlinePrice"
|
||||
placeholder="请输入线下总金额,单位:元"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="总金额" prop="price">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.totalPrice"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 子表的表单 -->
|
||||
<ContentWrap>
|
||||
<el-tabs v-model="subTabsName" class="-mt-15px -mb-10px">
|
||||
<el-tab-pane label="产品清单" name="product">
|
||||
<ContractProductForm
|
||||
ref="productFormRef"
|
||||
:products="formData.products"
|
||||
<el-tab-pane label="额度" name="limit">
|
||||
<ContractChangeLimit
|
||||
ref="limitFormRef"
|
||||
:formData="formData"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同甲方关联单位" name="contractAAuthorizedCompany">
|
||||
<el-tab-pane label="授权人" name="product">
|
||||
<ContentWrap style="border: none">
|
||||
甲方现授权人信息
|
||||
</ContentWrap>
|
||||
<ContractAuthPersonInfo
|
||||
ref="personDataRef"
|
||||
:products="formData.contractAAuthorizedPersons"
|
||||
/>
|
||||
<ContentWrap style="border: none">
|
||||
甲方授权人
|
||||
</ContentWrap>
|
||||
<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 label="延期" name="ContracExtension">
|
||||
<ContracExtension ref="contractExtensionFormRef" :formData="formData" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同乙方授权人信息" name="contractBAuthorizedPerson">
|
||||
<ContractBAuthorizedPersonForm ref="contractBAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||
<el-tab-pane label="终止" name="ContractStop">
|
||||
<ContractStop ref="contractStopFormRef" :formData="formData" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="甲方关联单位" name="contractAAuthorizedCompany">
|
||||
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef1" :contract-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="重签" name="ContractForm">
|
||||
<ContractForm ref="contractFormRef" :type="1" :formData="formData" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</ContentWrap>
|
||||
|
|
@ -385,10 +126,13 @@ 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 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 ContractAAuthorizedPersonForm from './components/ContractAAuthorizedPersonForm.vue'
|
||||
import ContractBAuthorizedPersonForm from './components/ContractBAuthorizedPersonForm.vue'
|
||||
import ContractForm from './ContractForm.vue'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
|
@ -399,6 +143,7 @@ const dialogTitle = ref('') // 弹窗的标题
|
|||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
authPerson: [],
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
no: undefined,
|
||||
|
|
@ -449,11 +194,13 @@ const quotationList = ref<QuotationVO[]>([])
|
|||
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||
|
||||
/** 子表的表单 */
|
||||
const subTabsName = ref('product')
|
||||
const productFormRef = ref()
|
||||
const subTabsName = ref('limit')
|
||||
const contractAAuthorizedCompanyFormRef = ref()
|
||||
const contractAAuthorizedPersonFormRef = ref()
|
||||
const contractBAuthorizedPersonFormRef = ref()
|
||||
const contractAAuthorizedCompanyFormRef1 = ref()
|
||||
const limitFormRef = ref()
|
||||
const contractExtensionFormRef = ref()
|
||||
const contractStopFormRef = ref()
|
||||
const contractFormRef = ref()
|
||||
|
||||
/** 计算 discountPrice、totalPrice 价格 */
|
||||
watch(
|
||||
|
|
@ -490,15 +237,38 @@ 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
|
||||
productFormRef.value.validate()
|
||||
try {
|
||||
const data = unref(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.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData()
|
||||
data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData()
|
||||
if (!formType.value ) {
|
||||
await ContractApi.createContract(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
|
|
|||
|
|
@ -8,19 +8,17 @@
|
|||
label-width="120px"
|
||||
>
|
||||
<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
|
||||
|
|
@ -54,9 +52,6 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同签订日期" prop="startTime">
|
||||
|
|
@ -65,6 +60,7 @@
|
|||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合同签订日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -75,12 +71,10 @@
|
|||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合同结束时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</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 />
|
||||
|
|
@ -111,15 +105,13 @@
|
|||
</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"
|
||||
style="width: 100%"
|
||||
placeholder="选择最晚付款日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -141,9 +133,6 @@
|
|||
</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 />
|
||||
|
|
@ -225,9 +214,6 @@
|
|||
</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>
|
||||
|
|
@ -257,14 +243,11 @@
|
|||
<el-input v-model="formData.creditLimit" placeholder="请输入授信额度" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" placeholder="请选择合作主体" disabled >
|
||||
<el-option
|
||||
v-for="dict in deptList"
|
||||
v-for="dict in orgList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
|
|
@ -359,7 +342,8 @@
|
|||
</el-tabs>
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<!-- 显示在其他页面时的判断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>
|
||||
|
|
@ -378,11 +362,15 @@ import ContractProductForm from '@/views/crm/contract/components/ContractProduct
|
|||
import ContractAAuthorizedCompanyForm from './components/ContractAAuthorizedCompanyForm.vue'
|
||||
import ContractAAuthorizedPersonForm from './components/ContractAAuthorizedPersonForm.vue'
|
||||
import ContractBAuthorizedPersonForm from './components/ContractBAuthorizedPersonForm.vue'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined),
|
||||
type: propTypes.number.def(undefined),
|
||||
})
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
|
|
@ -436,6 +424,7 @@ const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
|||
const customerList = ref([]) // 客户列表的数据
|
||||
const quotationList = ref<QuotationVO[]>([])
|
||||
const contactList = ref<ContactApi.ContactVO[]>([])
|
||||
const orgList = ref([])
|
||||
|
||||
/** 子表的表单 */
|
||||
const subTabsName = ref('product')
|
||||
|
|
@ -463,14 +452,25 @@ const open = async (type: string) => {
|
|||
if (type) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
console.log('%csrc/views/crm/contract/ContractForm.vue:456 type', 'color: #007acc;', type);
|
||||
formData.value = await ContractApi.getContract(type)
|
||||
console.log('%csrc/views/crm/contract/ContractForm.vue:458 formData.value', 'color: #007acc;', formData.value);
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
|
@ -626,9 +626,9 @@ const getContactOptions = computed(() =>
|
|||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
formType.value = route.query.id;
|
||||
formType.value = props.id || route.query.id
|
||||
|
||||
if (formType.value) open(formType.value)
|
||||
if (formType.value) await open(formType.value)
|
||||
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
|
|
@ -643,5 +643,10 @@ onMounted(async () => {
|
|||
// }
|
||||
// 获取联系人
|
||||
contactList.value = await ContactApi.getSimpleContactList()
|
||||
const data = await ContractApi.getOrg({
|
||||
pageNo: 1,
|
||||
pageSize: 1000
|
||||
})
|
||||
orgList.value = data.list
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,215 @@
|
|||
<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.lastPayDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="请选择终止日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="终止原因" prop="">
|
||||
<el-radio-group v-model="formData.defendantRecord" :disabled="true">
|
||||
<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="signEmail">
|
||||
<el-input v-model="formData.terminationReason" 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'
|
||||
|
||||
/** 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>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<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>
|
||||
|
|
@ -0,0 +1,420 @@
|
|||
<template>
|
||||
<ContentWrap class="mt-10px">
|
||||
<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" 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="请选择上市情况" @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="请选择融资信息" @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="signPhoneNumber">
|
||||
<el-input v-model="formData.signPhoneNumber" placeholder="请输入初始额度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="目前额度" prop="beforeAmount">
|
||||
<el-input v-model="formData.beforeAmount" placeholder="请输入目前额度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签约主体" prop="signWechat">
|
||||
<el-select v-model="formData.partnerCompanyId" 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" placeholder="请输入调整金额(元)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最终额度" prop="afterAmount">
|
||||
<el-input v-model="formData.afterAmount" placeholder="请输入最终额度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="调整金额截止日期" prop="establishmentDate">
|
||||
<el-date-picker
|
||||
v-model="formData.lastPayDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
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" :row="5" placeholder="请输入调额说明" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 子表的表单 -->
|
||||
|
||||
</ContentWrap>
|
||||
</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'
|
||||
|
||||
/** 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 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 = () => {
|
||||
console.log('%csrc/views/crm/contract/components/ContractChangeLimit.vue:352 object', 'color: #007acc;', formRef.value.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,348 @@
|
|||
<template>
|
||||
<ContentWrap class="mt-10px">
|
||||
<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" 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" 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" 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
|
||||
v-model="formData.lastPayDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
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" placeholder="请输入顺延年限" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="调整金额截止日期" prop="establishmentDate">
|
||||
<el-date-picker
|
||||
v-model="formData.lastPayDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
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" type="textarea" :row="5" placeholder="请输入延期说明" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 子表的表单 -->
|
||||
|
||||
</ContentWrap>
|
||||
</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'
|
||||
|
||||
/** 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 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' })
|
||||
}
|
||||
|
||||
/** 打开合同详情 */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,161 @@
|
|||
<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 {
|
||||
console.log('%csrc/views/crm/contract/components/QuotationList.vue:112 props.bizId', 'color: #007acc;', props.bizId);
|
||||
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>
|
||||
|
|
@ -1,17 +1,10 @@
|
|||
<!-- 合同详情页面组件-->
|
||||
<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="基本信息">
|
||||
<ContractDetailsInfo :contract="contract" />
|
||||
|
|
@ -21,12 +14,14 @@
|
|||
</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"
|
||||
/>
|
||||
|
|
@ -34,6 +29,7 @@
|
|||
<el-tab-pane label="团队成员">
|
||||
<PermissionList
|
||||
ref="permissionListRef"
|
||||
:type="1"
|
||||
:biz-id="contract.id!"
|
||||
:biz-type="BizTypeEnum.CRM_CONTRACT"
|
||||
:show-action="true"
|
||||
|
|
@ -45,10 +41,8 @@
|
|||
</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'
|
||||
|
|
@ -59,15 +53,14 @@ 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) => {
|
||||
|
|
@ -86,6 +81,7 @@ const openForm = (type: string, id?: number) => {
|
|||
const getContractData = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
console.log('%csrc/views/crm/contract/detail/index.vue:92 234', 'color: #007acc;', contractId.value,234);
|
||||
contract.value = await ContractApi.getContract(contractId.value)
|
||||
await getOperateLog(contractId.value)
|
||||
} finally {
|
||||
|
|
@ -127,7 +123,8 @@ const close = () => {
|
|||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
const id = props.id || route.params.id
|
||||
console.log('%csrc/views/crm/contract/detail/index.vue:134 props.id', 'color: #007acc;', props.id);
|
||||
const id = props.id || route.query.id
|
||||
if (!id) {
|
||||
message.warning('参数错误,合同不能为空!')
|
||||
close()
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
<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>
|
||||
|
|
@ -229,17 +229,17 @@
|
|||
<el-button
|
||||
v-else
|
||||
link
|
||||
v-hasPermi="['crm:contract:update']"
|
||||
v-hasPermi="['crm:customer-suggestion:query']"
|
||||
type="primary"
|
||||
@click="handleProcessDetail(scope.row)"
|
||||
>
|
||||
查看审批
|
||||
进度
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['crm:contract:query']"
|
||||
link
|
||||
type="primary"
|
||||
@click="openDetail(scope.row.id)"
|
||||
@click="openDetail(scope.row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
|
|
@ -327,10 +327,11 @@ const resetQuery = () => {
|
|||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const router = useRouter() // 路由
|
||||
|
||||
const openFormEdit = (row: Object) => {
|
||||
|
||||
push({ name: 'CrmContractEdit', query: { id: row.id} })
|
||||
router.push({ name: 'CrmContractEdit', query: { id: row.id} })
|
||||
}
|
||||
const openFormAdd = () => {
|
||||
push({ name: 'CrmContractAdd' })
|
||||
|
|
@ -340,8 +341,8 @@ const openFormDetail = (row: Object) => {
|
|||
|
||||
push({ name: 'CrmContractDetail', query: { id: row.id } })
|
||||
}
|
||||
const handleChange = (row: Object) => {
|
||||
push({ name: 'CrmContractChange', query: { id: row.id } })
|
||||
const handleChange = (row) => {
|
||||
router.push({ name: 'CrmContractChange', query: { id: row.id } })
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -382,19 +383,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 } })
|
||||
}
|
||||
|
||||
/** 打开联系人详情 */
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@
|
|||
</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 +58,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 +73,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 +86,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 +110,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 +121,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>-->
|
||||
<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 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,34 +162,7 @@
|
|||
<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="industryId">
|
||||
<el-select v-model="formData.industryId" placeholder="请选择客户行业" class="w-1/1">
|
||||
<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="请选择客户级别" class="w-1/1">
|
||||
<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">
|
||||
<el-form-item label="地址" prop="areaId">
|
||||
<el-cascader
|
||||
|
|
@ -202,6 +181,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 +215,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() // 消息弹窗
|
||||
|
|
@ -252,7 +243,7 @@ const formData = ref({
|
|||
source: undefined,
|
||||
remark: undefined,
|
||||
developer: undefined,
|
||||
assist: undefined,
|
||||
assist: [],
|
||||
clueDeveloper: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
|
|
@ -287,7 +278,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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -338,7 +329,7 @@ const resetForm = () => {
|
|||
source: undefined,
|
||||
reamark: undefined,
|
||||
developer: undefined,
|
||||
assist: undefined,
|
||||
assist: [],
|
||||
clueDeveloper: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
|
|
|||
|
|
@ -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' // 团队成员列表(权限)
|
||||
|
|
@ -169,19 +173,19 @@ const handleUnlock = async () => {
|
|||
await getCustomer()
|
||||
}
|
||||
|
||||
/** 领取客户 */
|
||||
const handleReceive = async () => {
|
||||
await message.confirm(`确定领取客户【${customer.value.name}】 吗?`)
|
||||
await CustomerApi.receiveCustomer([unref(customerId.value)])
|
||||
message.success(`领取客户【${customer.value.name}】成功`)
|
||||
await getCustomer()
|
||||
}
|
||||
// /** 领取客户 */
|
||||
// const handleReceive = async () => {
|
||||
// await message.confirm(`确定领取客户【${customer.value.name}】 吗?`)
|
||||
// await CustomerApi.receiveCustomer([unref(customerId.value)])
|
||||
// message.success(`领取客户【${customer.value.name}】成功`)
|
||||
// await getCustomer()
|
||||
// }
|
||||
|
||||
/** 分配客户 */
|
||||
const distributeForm = ref<InstanceType<typeof CustomerDistributeForm>>() // 分配客户表单 Ref
|
||||
const handleDistributeForm = async () => {
|
||||
distributeForm.value?.open(customerId.value)
|
||||
}
|
||||
// /** 分配客户 */
|
||||
// const distributeForm = ref<InstanceType<typeof CustomerDistributeForm>>() // 分配客户表单 Ref
|
||||
// const handleDistributeForm = async () => {
|
||||
// distributeForm.value?.open(customerId.value)
|
||||
// }
|
||||
|
||||
/** 客户放入公海 */
|
||||
const handlePutPool = async () => {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
<!-- 列表 -->
|
||||
|
|
|
|||
|
|
@ -161,6 +161,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 +190,10 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<CustomerForm ref="formRef" @success="getList" />
|
||||
<CustomerDistributeForm ref="distributeForm" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -177,6 +201,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 +266,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[]>([]) // 列表的数据
|
||||
|
|
|
|||
|
|
@ -361,6 +361,7 @@ 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' })
|
||||
|
|
@ -375,7 +376,9 @@ const deptTree = ref() // 部门树形结构
|
|||
const deptList = ref() // 部门
|
||||
|
||||
const invoiceTemplateList = ref([])
|
||||
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined)
|
||||
})
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
|
|
@ -590,8 +593,8 @@ const resetForm = () => {
|
|||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
formType.value = route.query.id;
|
||||
|
||||
console.log('%csrc/views/crm/quotation/QuotationDetail.vue:596 props.id', 'color: #007acc;', props.id);
|
||||
formType.value = props.id || route.query.id
|
||||
if (formType.value) open(formType.value)
|
||||
|
||||
// 获得客户列表
|
||||
|
|
|
|||
|
|
@ -30,6 +30,21 @@
|
|||
</el-row>
|
||||
|
||||
<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" 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">
|
||||
|
|
@ -142,7 +157,7 @@
|
|||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" placeholder="请选择合作主体" @change="onPartnerChange">
|
||||
<el-option
|
||||
v-for="dict in deptList"
|
||||
v-for="dict in orgList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
|
|
@ -360,6 +375,7 @@ 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'
|
||||
|
|
@ -376,6 +392,7 @@ const templateOptions = ref([])
|
|||
const businessList = ref([])
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const deptList = ref() // 部门
|
||||
const orgList = ref([])
|
||||
|
||||
const invoiceTemplateList = ref([])
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
|
@ -429,7 +446,9 @@ 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' }],
|
||||
|
|
@ -504,12 +523,17 @@ const onPartnerChange = async (id: string) => {
|
|||
formData.value.bLegalRepresentative = res.legalRepresentative;
|
||||
formData.value.bBusinessLicenseNumber = res.businessLicenseNumber;
|
||||
formData.value.bBusinessLicense = res.businessLicense;
|
||||
formData.value.partnerCompanyId = res.partnerCompanyId;
|
||||
} catch (err) {
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const changeNum = (val) => {
|
||||
console.log('%csrc/views/crm/quotation/QuotationForm.vue:534 val + formData.value.creditAmount || 0', 'color: #007acc;', Number(val) + (formData.value.creditAmount || 0));
|
||||
formData.value.creditLimit = (Number(val) + (formData.value.creditAmount || 0)).toFixed(2)
|
||||
}
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string) => {
|
||||
formType.value = type
|
||||
|
|
@ -601,7 +625,6 @@ 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;
|
||||
|
||||
if (formType.value) open(formType.value)
|
||||
|
|
@ -619,5 +642,10 @@ onMounted(async () => {
|
|||
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>
|
||||
|
|
@ -154,6 +154,14 @@
|
|||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['crm:customer-suggestion:query']"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleProcessDetail(scope.row)"
|
||||
>
|
||||
进度
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
|
|
@ -246,7 +254,7 @@ const openFormAdd = () => {
|
|||
|
||||
const openFormDetail = (row: Object) => {
|
||||
|
||||
push({ name: 'QuotationDetail', query: { id: row.id, customerId: row.customerId } })
|
||||
router.push({ name: 'QuotationDetail', query: { id: row.id } })
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
|
@ -262,6 +270,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 {
|
||||
|
|
|
|||
|
|
@ -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() // 消息弹窗
|
||||
|
|
|
|||
Loading…
Reference in New Issue