方案报价
parent
33c57d2328
commit
b4dbadc0a6
|
|
@ -29,6 +29,11 @@ export const BillTemplateApi = {
|
|||
return await request.put({ url: `/crm/bill-template/update`, data })
|
||||
},
|
||||
|
||||
// 获取模版产品信息
|
||||
getTemplateProduct: async (params: any) => {
|
||||
return await request.get({ url: `crm/bill-template/getBusBillProductItems`, params })
|
||||
},
|
||||
|
||||
// 删除票据模版
|
||||
deleteBillTemplate: async (id: number) => {
|
||||
return await request.delete({ url: `/crm/bill-template/delete?id=` + id })
|
||||
|
|
@ -38,4 +43,4 @@ export const BillTemplateApi = {
|
|||
exportBillTemplate: async (params) => {
|
||||
return await request.download({ url: `/crm/bill-template/export-excel`, params })
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// 组织机构 VO
|
||||
export interface OrganizationsVO {
|
||||
id: number // 主键
|
||||
orgName: string // 机构名称
|
||||
workplace: string // 工作地址
|
||||
corpId: string // 企业微信凭证
|
||||
corpSecret: string // 企业微信凭证密钥
|
||||
subjectName: string // 主体名称
|
||||
creditCode: string // 统一信用代码
|
||||
legalRepresentative: string // 法人代表
|
||||
registeredAddress: string // 注册地址
|
||||
bankName: string // 开户行
|
||||
bankAccount: string // 银行账号
|
||||
businessLicense: string // 营业执照文件路径
|
||||
}
|
||||
|
||||
// 组织机构 API
|
||||
export const OrganizationsApi = {
|
||||
// 查询组织机构分页
|
||||
getOrganizationsPage: async (params: any) => {
|
||||
return await request.get({ url: `/system/organizations/page`, params })
|
||||
},
|
||||
|
||||
// 查询组织机构详情
|
||||
getOrganizations: async (id: number) => {
|
||||
return await request.get({ url: `/system/organizations/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增组织机构
|
||||
createOrganizations: async (data: OrganizationsVO) => {
|
||||
return await request.post({ url: `/system/organizations/create`, data })
|
||||
},
|
||||
|
||||
// 修改组织机构
|
||||
updateOrganizations: async (data: OrganizationsVO) => {
|
||||
return await request.put({ url: `/system/organizations/update`, data })
|
||||
},
|
||||
|
||||
// 删除组织机构
|
||||
deleteOrganizations: async (id: number) => {
|
||||
return await request.delete({ url: `/system/organizations/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出组织机构 Excel
|
||||
exportOrganizations: async (params) => {
|
||||
return await request.download({ url: `/system/organizations/export-excel`, params })
|
||||
}
|
||||
}
|
||||
|
|
@ -556,6 +556,39 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
},
|
||||
component: () => import('@/views/crm/billtemplate/BillTemplateForm.vue')
|
||||
},
|
||||
{
|
||||
path: 'business/quotationAdd',
|
||||
name: 'QuotationAdd',
|
||||
meta: {
|
||||
title: '方案报价新增',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/business'
|
||||
},
|
||||
component: () => import('@/views/crm/quotation/QuotationForm.vue')
|
||||
},
|
||||
{
|
||||
path: 'business/quotationEdit',
|
||||
name: 'QuotationEdit',
|
||||
meta: {
|
||||
title: '方案报价编辑',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/business'
|
||||
},
|
||||
component: () => import('@/views/crm/quotation/QuotationForm.vue')
|
||||
},
|
||||
{
|
||||
path: 'business/quotationDetail',
|
||||
name: 'QuotationDetail',
|
||||
meta: {
|
||||
title: '方案报价详情',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
activeMenu: '/crm/business'
|
||||
},
|
||||
component: () => import('@/views/crm/quotation/QuotationDetail.vue')
|
||||
},
|
||||
{
|
||||
path: 'business/add',
|
||||
name: 'CrmBusinessAdd',
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ const submitForm = async () => {
|
|||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// await productFormRef.value.validate()
|
||||
const validPro = await productFormRef.value.validate()
|
||||
if (!validPro) return
|
||||
// console.log(formData.value,444); // 检查 ref 的值
|
||||
await nextTick(() => {
|
||||
if (productFormRef.value) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="产品票据" fixed="right" min-width="140">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoice`" class="mb-0px!">
|
||||
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
||||
<el-select v-model="row.productInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE)"
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ const onChangeProduct = (productId, row) => {
|
|||
|
||||
// 表单校验
|
||||
const validate = () => {
|
||||
return formData.value
|
||||
return formRef.value.validate()
|
||||
};
|
||||
defineExpose({ validate });
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,611 @@
|
|||
<template>
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="110px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报价单编号" prop="no">
|
||||
<el-input v-model="formData.no" placeholder="请输入报价单编号" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="选择商机" prop="businessId">
|
||||
<el-select v-model="formData.businessId" placeholder="请选择商机" @change="onBusinessChange" disabled>
|
||||
<el-option
|
||||
v-for="dict in businessList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户" prop="customerId">
|
||||
<el-select v-model="formData.customerId" disabled placeholder="请选择客户" @change="onCustomerChange">
|
||||
<el-option
|
||||
v-for="item in customerList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作类型" prop="cooperationType">
|
||||
<el-input v-model="formData.cooperationType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司类型" prop="companyType">
|
||||
<el-input v-model="formData.companyType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="上市情况" prop="listingStatus">
|
||||
<el-input v-model="formData.listingStatus" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="融资信息" prop="financingInfo">
|
||||
<el-input v-model="formData.financingInfo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实缴资金" prop="paidInCapital">
|
||||
<el-input v-model="formData.paidInCapital" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参保人数" prop="insuredCount">
|
||||
<el-input v-model="formData.insuredCount" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="成立日期" prop="establishmentDate">
|
||||
<el-input v-model="formData.establishmentDate" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="企业类型" prop="enterpriseType">
|
||||
<el-input v-model="formData.enterpriseType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业状态" prop="businessStatus">
|
||||
<el-input v-model="formData.businessStatus" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="被告记录" prop="defendantRecord">
|
||||
<el-radio-group v-model="formData.defendantRecord" :disabled="true">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="经营异常" prop="businessAbnormal">
|
||||
<el-radio-group v-model="formData.businessAbnormal" :disabled="true">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="股权出质" prop="equityPledge">
|
||||
<el-radio-group v-model="formData.equityPledge" :disabled="true">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="失信记录" prop="dishonestRecord">
|
||||
<el-radio-group v-model="formData.dishonestRecord" :disabled="true">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="融资记录" prop="financingRecord">
|
||||
<el-radio-group v-model="formData.financingRecord" :disabled="true">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="被执行记录" prop="enforcementRecord">
|
||||
<el-radio-group v-model="formData.enforcementRecord" :disabled="true">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作主体" prop="partnerCompanyId">
|
||||
<el-select v-model="formData.partnerCompanyId" disabled placeholder="请选择合作主体" @change="onPartnerChange">
|
||||
<el-option
|
||||
v-for="dict in deptList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户行" prop="bBankName">
|
||||
<el-input v-model="formData.bBankName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行账号" prop="bBankAccount">
|
||||
<el-input v-model="formData.bBankAccount" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="法人代表" prop="bLegalRepresentative">
|
||||
<el-input v-model="formData.bLegalRepresentative" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业执照号" prop="bBusinessLicenseNumber">
|
||||
<el-input v-model="formData.bBusinessLicenseNumber" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业执照" prop="bBusinessLicense">
|
||||
<el-input v-model="formData.bBusinessLicense" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
disabled
|
||||
v-model="formData.deptId"
|
||||
:data="deptTree"
|
||||
:props="defaultProps"
|
||||
filterable
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="商机负责人" prop="ownerUserId">
|
||||
<el-select v-model="formData.ownerUserId" disabled placeholder="请选择商机负责人">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="拓展人" prop="expanderUserId">
|
||||
<el-select v-model="formData.expanderUserId" disabled placeholder="请选择拓展人">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="方案报价人" prop="pricingUserId">
|
||||
<el-select v-model="formData.pricingUserId" disabled placeholder="请选择方案报价人">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报价签约人" prop="signUserId">
|
||||
<el-select v-model="formData.signUserId" disabled placeholder="请选择报价签约人">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签约人联系电话" prop="signPhoneNumber">
|
||||
<el-input v-model="formData.signPhoneNumber" disabled placeholder="请输入签约人联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签约人Email" prop="signEmail">
|
||||
<el-input v-model="formData.signEmail" disabled placeholder="请输入签约人Email" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签约人微信" prop="signWechat">
|
||||
<el-input v-model="formData.signWechat" disabled placeholder="请输入签约人微信" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账期" prop="paymentTerm">
|
||||
<el-select v-model="formData.paymentTerm" disabled placeholder="请选择账期">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions('payment_term')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信方式" prop="creditMethod">
|
||||
<el-select v-model="formData.creditMethod" disabled placeholder="请选择授信方式">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_method')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信计算周期" prop="creditCalcCycle">
|
||||
<el-select v-model="formData.creditCalcCycle" disabled placeholder="请选择授信计算周期">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_calc_cycle')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信额度" prop="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" disabled placeholder="请输入授信额度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||
<el-select v-model="formData.invoiceTemplateId" disabled placeholder="请选择票据模板">
|
||||
<el-option
|
||||
v-for="dict in templateOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线上总金额" prop="onlinePrice">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.onlinePrice"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线下总金额" prop="offlinePrice">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.offlinePrice"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="总金额" prop="totalPrice">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.totalPrice"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 子表的表单 -->
|
||||
<el-tabs v-model="subTabsName">
|
||||
<el-tab-pane label="报价产品关联" name="quotationProduct">
|
||||
<QuotationProductForm ref="quotationProductFormRef" :quotation-id="formData.id" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</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 QuotationProductForm from './components/QuotationProductDetail.vue'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import * as BusinessApi from '@/api/crm/business'
|
||||
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
|
||||
|
||||
/** CRM 方案报价 表单 */
|
||||
defineOptions({ name: 'QuotationForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const templateOptions = ref([])
|
||||
const businessList = ref([])
|
||||
const deptTree = ref() // 部门树形结构
|
||||
const deptList = ref() // 部门
|
||||
|
||||
const invoiceTemplateList = ref([])
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
businessId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
ownerUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
pricingUserId: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
signEmail: undefined,
|
||||
signWechat: undefined,
|
||||
paymentTerm: undefined,
|
||||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
creator: undefined,
|
||||
createTime: undefined,
|
||||
updater: undefined,
|
||||
onlinePrice: undefined,
|
||||
offlinePrice: undefined,
|
||||
totalPrice: undefined,
|
||||
cooperationType: undefined, // 合作类型
|
||||
companyType: undefined, // 公司类型
|
||||
listingStatus: undefined, // 上市情况
|
||||
financingInfo: undefined, // 融资信息
|
||||
paidInCapital: undefined, // 实缴资金
|
||||
insuredCount: undefined, // 参保人数
|
||||
establishmentDate: undefined, // 成立日期
|
||||
enterpriseType: undefined, // 企业类型
|
||||
businessStatus: undefined, // 营业状态
|
||||
defendantRecord: undefined, // 被告记录
|
||||
businessAbnormal: undefined, // 经营异常
|
||||
equityPledge: undefined, // 股权出质
|
||||
dishonestRecord: undefined, // 失信记录
|
||||
financingRecord: undefined, // 融资记录
|
||||
enforcementRecord: undefined, // 被执行记录
|
||||
bBankName: undefined, // 开户行
|
||||
bBankAccount: undefined, // 银行账号
|
||||
bLegalRepresentative: undefined, // 法人代表
|
||||
bBusinessLicenseNumber: undefined, // 营业执照号
|
||||
bBusinessLicense: undefined // 营业执照
|
||||
})
|
||||
const formRules = reactive({
|
||||
no: [{ required: true, message: '报价单编号不能为空', trigger: 'blur' }],
|
||||
customerId: [{ required: true, message: '客户id不能为空', trigger: 'change' }],
|
||||
businessId: [{ required: true, message: '商机编号不能为空', trigger: 'change' }],
|
||||
invoiceTemplateId: [{ required: true, message: '票据模板Id不能为空', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 子表的表单 */
|
||||
const subTabsName = ref('quotationProduct')
|
||||
const quotationProductFormRef = ref()
|
||||
|
||||
const onBusinessChange = async (businessId: string) => {
|
||||
if (!businessId) return
|
||||
try {
|
||||
formLoading.value = true;
|
||||
const res = await BusinessApi.getBusiness(businessId);
|
||||
formData.value.customerId = res.customerId;
|
||||
formData.value.creditLimit = res.creditLimit; // 保存详情信息
|
||||
formData.value.ownerUserId = res.ownerUserId; // 保存详情信息
|
||||
formData.value.paymentTerm = res.paymentTerm;
|
||||
formData.value.creditMethod = res.creditMethod;
|
||||
formData.value.creditCalcCycle = res.creditCalcCycle;
|
||||
formData.value.deptId = res.deptId;
|
||||
formData.value.offlinePrice = res.offlinePrice;
|
||||
formData.value.onlinePrice = res.onlinePrice;
|
||||
formData.value.totalPrice = res.totalPrice;
|
||||
// 🔁 自动加载客户详情
|
||||
await onCustomerChange(res.customerId);
|
||||
} catch (err) {
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const onCustomerChange = async (customerId: string) => {
|
||||
if (!customerId) return;
|
||||
|
||||
try {
|
||||
formLoading.value = true;
|
||||
const customerRes = await CustomerApi.getCustomer(customerId);
|
||||
formData.value.cooperationType = customerRes.cooperationType;
|
||||
formData.value.companyType = customerRes.companyType;
|
||||
formData.value.listingStatus = customerRes.listingStatus;
|
||||
formData.value.financingInfo = customerRes.financingInfo;
|
||||
formData.value.paidInCapital = customerRes.paidInCapital;
|
||||
formData.value.insuredCount = customerRes.insuredCount;
|
||||
formData.value.establishmentDate = customerRes.establishmentDate;
|
||||
formData.value.enterpriseType = customerRes.enterpriseType;
|
||||
formData.value.businessStatus = customerRes.businessStatus;
|
||||
formData.value.defendantRecord = customerRes.defendantRecord;
|
||||
formData.value.businessAbnormal = customerRes.businessAbnormal;
|
||||
formData.value.equityPledge = customerRes.equityPledge;
|
||||
formData.value.dishonestRecord = customerRes.dishonestRecord;
|
||||
formData.value.financingRecord = customerRes.financingRecord;
|
||||
formData.value.enforcementRecord = customerRes.enforcementRecord;
|
||||
} catch (err) {
|
||||
console.error('获取客户详情失败:', err);
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const onPartnerChange = async (id: string) => {
|
||||
if (!id) return
|
||||
try {
|
||||
formLoading.value = true;
|
||||
const res = await DeptApi.getDept(id);
|
||||
formData.value.bBankName = res.bankName;
|
||||
formData.value.bBankAccount = res.bankAccount;
|
||||
formData.value.bLegalRepresentative = res.legalRepresentative;
|
||||
formData.value.bBusinessLicenseNumber = res.businessLicenseNumber;
|
||||
formData.value.bBusinessLicense = res.businessLicense;
|
||||
} catch (err) {
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string) => {
|
||||
dialogVisible.value = true
|
||||
// 修改时,设置数据
|
||||
if (type) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await QuotationApi.getQuotation(type)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
deptList.value = await DeptApi.getSimpleDeptList()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 校验子表单
|
||||
try {
|
||||
await quotationProductFormRef.value.validate()
|
||||
} catch (e) {
|
||||
subTabsName.value = 'quotationProduct'
|
||||
return
|
||||
}
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as QuotationVO
|
||||
// 拼接子表的数据
|
||||
data.quotationProducts = quotationProductFormRef.value.getData()
|
||||
if (!formType.value) {
|
||||
await QuotationApi.createQuotation(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await QuotationApi.updateQuotation(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
no: undefined,
|
||||
customerId: undefined,
|
||||
businessId: undefined,
|
||||
invoiceTemplateId: undefined,
|
||||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
ownerUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
pricingUserId: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
signEmail: undefined,
|
||||
signWechat: undefined,
|
||||
startTime: undefined,
|
||||
totalPrice: undefined,
|
||||
paymentTerm: undefined,
|
||||
creditMethod: undefined,
|
||||
creditCalcCycle: undefined,
|
||||
creditLimit: undefined,
|
||||
partnerCompanyId: undefined,
|
||||
deptId: undefined,
|
||||
creator: undefined,
|
||||
createTime: undefined,
|
||||
updater: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
onMounted(async () => {
|
||||
formType.value = route.query.id;
|
||||
|
||||
if (formType.value) open(formType.value)
|
||||
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
//票据
|
||||
const data = await BillTemplateApi.getBillTemplatePage({
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
})
|
||||
templateOptions.value = data.list
|
||||
businessList.value = await BusinessApi.getSimpleBusinessList()
|
||||
// 获得部门树
|
||||
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1280">
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
label-width="110px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
|
|
@ -179,16 +179,18 @@
|
|||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||
<el-select v-model="formData.invoiceTemplateId" placeholder="请选择票据模板">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="formData.deptId"
|
||||
:data="deptTree"
|
||||
:props="defaultProps"
|
||||
filterable
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
|
|
@ -297,16 +299,15 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="formData.deptId"
|
||||
:data="deptTree"
|
||||
:props="defaultProps"
|
||||
filterable
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||
<el-select v-model="formData.invoiceTemplateId" placeholder="请选择票据模板">
|
||||
<el-option
|
||||
v-for="dict in templateOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -343,19 +344,20 @@
|
|||
<!-- 子表的表单 -->
|
||||
<el-tabs v-model="subTabsName">
|
||||
<el-tab-pane label="报价产品关联" name="quotationProduct">
|
||||
<QuotationProductForm ref="quotationProductFormRef" :quotation-id="formData.id" :business-id="formData.businessId" />
|
||||
<QuotationProductForm ref="quotationProductFormRef" :quotation-id="formData.id" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
<div style="text-align: right">
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="goBack">取 消</el-button>
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script 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 QuotationProductForm from './components/QuotationProductForm.vue'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
|
|
@ -370,11 +372,13 @@ 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 invoiceTemplateList = ref([])
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
|
@ -507,28 +511,18 @@ const onPartnerChange = async (id: string) => {
|
|||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
const open = async (type: string) => {
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
if (type) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await QuotationApi.getQuotation(id)
|
||||
formData.value = await QuotationApi.getQuotation(type)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
|
||||
businessList.value = await BusinessApi.getSimpleBusinessList()
|
||||
// 获得部门树
|
||||
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
|
||||
deptList.value = await DeptApi.getSimpleDeptList()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
|
@ -551,7 +545,7 @@ const submitForm = async () => {
|
|||
const data = formData.value as unknown as QuotationVO
|
||||
// 拼接子表的数据
|
||||
data.quotationProducts = quotationProductFormRef.value.getData()
|
||||
if (formType.value === 'create') {
|
||||
if (!formType.value) {
|
||||
await QuotationApi.createQuotation(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
|
|
@ -561,9 +555,15 @@ const submitForm = async () => {
|
|||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
goBack()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const goBack = ()=> {
|
||||
proxy.$router.go(-1)
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
|
|
@ -596,4 +596,26 @@ const resetForm = () => {
|
|||
}
|
||||
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())
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
v-loading="formLoading"
|
||||
label-width="0px"
|
||||
:inline-message="true"
|
||||
>
|
||||
<el-table :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" width="100" />
|
||||
<el-table-column label="产品名称" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
||||
{{row.productName}}
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品类型" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.category`" :rules="formRules.category" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_CATEGORY" :value="row.category" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="产品明细类型" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE" :value="row.detailType" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品单位" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productUnit`" :rules="formRules.productUnit" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="row.productUnit" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线上价格" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
||||
{{row.onlinePrice}}
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线下价格" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
||||
{{row.offlinePrice}}
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总计价格" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
||||
{{row.totalPrice}}
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品票据" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_INVOICE" :value="row.productInvoice" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品开具项目" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoiceItems`" :rules="formRules.productInvoiceItems" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_INVOICE_ITEMS" :value="row.productInvoiceItems" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务费票据" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoice`" :rules="formRules.serviceFeeInvoice" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_SERVICE_FEE_INVOICE" :value="row.serviceFeeInvoice" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务开具项目" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoiceItems`" :rules="formRules.serviceFeeInvoiceItems" class="mb-0px!">
|
||||
<dict-tag :type="DICT_TYPE.CRM_SERVICE_FEE_INVOICE_ITEMS" :value="row.serviceFeeInvoiceItems" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-form>
|
||||
<el-row justify="center" class="mt-3">
|
||||
<!-- <el-button @click="handleAdd" round>+ 添加CRM 报价产品关联</el-button> -->
|
||||
</el-row>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { QuotationApi } from '@/api/crm/quotation'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as BusinessApi from '@/api/crm/business'
|
||||
|
||||
const props = defineProps<{
|
||||
quotationId: undefined, // 报价编号(主表的关联字段)
|
||||
businessId: undefined,
|
||||
billTemplateId: undefined
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
const formRules = reactive({
|
||||
quotationId: [{ required: true, message: '报价编号不能为空', trigger: 'blur' }],
|
||||
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
|
||||
productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
|
||||
detailType: [{ required: true, message: '产品分类编号不能为空', trigger: 'blur' }],
|
||||
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
|
||||
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
|
||||
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],
|
||||
totalPrice: [{ required: true, message: '总计价格不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||
watch(
|
||||
() => props.businessId,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = []
|
||||
// 2. val 非空,则加载数据
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
formLoading.value = true
|
||||
// if(val.quotationId) {
|
||||
// formData.value = await QuotationApi.getQuotationProductListByQuotationId(val.quotationId)
|
||||
// } else if(val.businessId) {
|
||||
const business = await BusinessApi.getBusiness(val);
|
||||
formData.value = business.products
|
||||
// }
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.billTemplateId,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = []
|
||||
// 2. val 非空,则加载数据
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
formLoading.value = true
|
||||
// if(val.quotationId) {
|
||||
// formData.value = await QuotationApi.getQuotationProductListByQuotationId(val.quotationId)
|
||||
// } else if(val.businessId) {
|
||||
const business = await BillTemplateApi.getTemplateProduct({
|
||||
businessId: props.businessId,
|
||||
billTemplateId: val,
|
||||
});
|
||||
console.log('%csrc/views/crm/quotation/components/QuotationProductForm.vue:167 business.data', 'color: #007acc;', business.data);
|
||||
formData.value = business
|
||||
// }
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
const row = {
|
||||
quotationId: undefined,
|
||||
productId: undefined,
|
||||
productName: undefined,
|
||||
detailType: undefined,
|
||||
productUnit: undefined,
|
||||
onlinePrice: undefined,
|
||||
offlinePrice: undefined,
|
||||
totalPrice: undefined,
|
||||
productInvoice: undefined,
|
||||
productInvoiceItems: undefined,
|
||||
serviceFeeInvoice: undefined,
|
||||
serviceFeeInvoiceItems: undefined
|
||||
}
|
||||
row.quotationId = props.quotationId
|
||||
formData.value.push(row)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = (index) => {
|
||||
formData.value.splice(index, 1)
|
||||
}
|
||||
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
|
||||
defineExpose({ validate, getData })
|
||||
</script>
|
||||
|
|
@ -9,13 +9,6 @@
|
|||
>
|
||||
<el-table :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" width="100" />
|
||||
<el-table-column label="产品编号" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
||||
<el-input v-model="row.productId" placeholder="请输入产品编号" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品名称" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
||||
|
|
@ -23,66 +16,123 @@
|
|||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品分类编号" min-width="150">
|
||||
<el-table-column label="产品类型" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productCategoryId`" :rules="formRules.productCategoryId" class="mb-0px!">
|
||||
<el-input v-model="row.productCategoryId" placeholder="请输入产品分类编号" disabled />
|
||||
<el-form-item :prop="`${$index}.category`" :rules="formRules.category" class="mb-0px!">
|
||||
<el-select v-model="row.category" placeholder="请选择状态" disabled class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_CATEGORY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="产品明细类型" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
|
||||
<el-select v-model="row.detailType" placeholder="请选择状态" disabled class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品单位" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productUnit`" :rules="formRules.productUnit" class="mb-0px!">
|
||||
<el-input v-model="row.productUnit" placeholder="请输入产品单位" disabled />
|
||||
<el-select v-model="row.productUnit" placeholder="请选择状态" disabled class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_UNIT)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线上价格" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
||||
<el-input v-model="row.onlinePrice" placeholder="请输入线上价格" />
|
||||
<el-input v-model="row.onlinePrice" placeholder="请输入线上价格" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线下价格" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
||||
<el-input v-model="row.offlinePrice" placeholder="请输入线下价格" />
|
||||
<el-input v-model="row.offlinePrice" placeholder="请输入线下价格" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总计价格" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
||||
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" />
|
||||
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品票据" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
||||
<el-input v-model="row.productInvoice" placeholder="请输入产品票据" />
|
||||
<el-select v-model="row.productInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品开具项目" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.productInvoiceItem`" :rules="formRules.productInvoiceItem" class="mb-0px!">
|
||||
<el-input v-model="row.productInvoiceItem" placeholder="请输入产品开具项目" />
|
||||
<el-form-item :prop="`${$index}.productInvoiceItems`" :rules="formRules.productInvoiceItems" class="mb-0px!">
|
||||
<el-select v-model="row.productInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE_ITEMS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务费票据" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceInvoice`" :rules="formRules.serviceInvoice" class="mb-0px!">
|
||||
<el-input v-model="row.serviceInvoice" placeholder="请输入服务费票据" />
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoice`" :rules="formRules.serviceFeeInvoice" class="mb-0px!">
|
||||
<el-select v-model="row.serviceFeeInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务开具项目" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.serviceInvoiceItem`" :rules="formRules.serviceInvoiceItem" class="mb-0px!">
|
||||
<el-input v-model="row.serviceInvoiceItem" placeholder="请输入服务开具项目" />
|
||||
<el-form-item :prop="`${$index}.serviceFeeInvoiceItems`" :rules="formRules.serviceFeeInvoiceItems" class="mb-0px!">
|
||||
<el-select v-model="row.serviceFeeInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE_ITEMS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -99,11 +149,14 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { QuotationApi } from '@/api/crm/quotation'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as BusinessApi from '@/api/crm/business'
|
||||
|
||||
const props = defineProps<{
|
||||
quotationId: undefined, // 报价编号(主表的关联字段)
|
||||
businessId: undefined
|
||||
businessId: undefined,
|
||||
billTemplateId: undefined
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
@ -111,7 +164,7 @@ const formRules = reactive({
|
|||
quotationId: [{ required: true, message: '报价编号不能为空', trigger: 'blur' }],
|
||||
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
|
||||
productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
|
||||
productCategoryId: [{ required: true, message: '产品分类编号不能为空', trigger: 'blur' }],
|
||||
detailType: [{ required: true, message: '产品分类编号不能为空', trigger: 'blur' }],
|
||||
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
|
||||
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
|
||||
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],
|
||||
|
|
@ -144,21 +197,49 @@ watch(
|
|||
{ immediate: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.billTemplateId,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = []
|
||||
// 2. val 非空,则加载数据
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
formLoading.value = true
|
||||
// if(val.quotationId) {
|
||||
// formData.value = await QuotationApi.getQuotationProductListByQuotationId(val.quotationId)
|
||||
// } else if(val.businessId) {
|
||||
const business = await BillTemplateApi.getTemplateProduct({
|
||||
businessId: props.businessId,
|
||||
billTemplateId: val,
|
||||
});
|
||||
console.log('%csrc/views/crm/quotation/components/QuotationProductForm.vue:167 business.data', 'color: #007acc;', business.data);
|
||||
formData.value = business
|
||||
// }
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
const row = {
|
||||
quotationId: undefined,
|
||||
productId: undefined,
|
||||
productName: undefined,
|
||||
productCategoryId: undefined,
|
||||
detailType: undefined,
|
||||
productUnit: undefined,
|
||||
onlinePrice: undefined,
|
||||
offlinePrice: undefined,
|
||||
totalPrice: undefined,
|
||||
productInvoice: undefined,
|
||||
productInvoiceItem: undefined,
|
||||
serviceInvoice: undefined,
|
||||
serviceInvoiceItem: undefined
|
||||
productInvoiceItems: undefined,
|
||||
serviceFeeInvoice: undefined,
|
||||
serviceFeeInvoiceItems: undefined
|
||||
}
|
||||
row.quotationId = props.quotationId
|
||||
formData.value.push(row)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="报价单编号" prop="no">
|
||||
<el-input
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-220px"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
@click="openFormAdd"
|
||||
v-hasPermi="['crm:quotation:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
|
|
@ -142,7 +142,14 @@
|
|||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
@click="openFormDetail(scope.row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openFormEdit(scope.row)"
|
||||
v-hasPermi="['crm:quotation:update']"
|
||||
>
|
||||
编辑
|
||||
|
|
@ -167,8 +174,6 @@
|
|||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<QuotationForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
|
@ -176,7 +181,6 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
||||
import QuotationForm from './QuotationForm.vue'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
|
|
@ -232,8 +236,17 @@ const resetQuery = () => {
|
|||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
const openFormEdit = (row: Object) => {
|
||||
|
||||
push({ name: 'QuotationEdit', query: { id: row.id} })
|
||||
}
|
||||
const openFormAdd = () => {
|
||||
push({ name: 'QuotationAdd' })
|
||||
}
|
||||
|
||||
const openFormDetail = (row: Object) => {
|
||||
|
||||
push({ name: 'QuotationDetail', query: { id: row.id, customerId: row.customerId } })
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,149 @@
|
|||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="机构名称" prop="orgName">
|
||||
<el-input v-model="formData.orgName" placeholder="请输入机构名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工作地址" prop="workplace">
|
||||
<el-input v-model="formData.workplace" placeholder="请输入工作地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="企业微信凭证" prop="corpId">
|
||||
<el-input v-model="formData.corpId" placeholder="请输入企业微信凭证" />
|
||||
</el-form-item>
|
||||
<el-form-item label="企业微信凭证密钥" prop="corpSecret">
|
||||
<el-input v-model="formData.corpSecret" placeholder="请输入企业微信凭证密钥" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主体名称" prop="subjectName">
|
||||
<el-input v-model="formData.subjectName" placeholder="请输入主体名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="统一信用代码" prop="creditCode">
|
||||
<el-input v-model="formData.creditCode" placeholder="请输入统一信用代码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="法人代表" prop="legalRepresentative">
|
||||
<el-input v-model="formData.legalRepresentative" placeholder="请输入法人代表" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册地址" prop="registeredAddress">
|
||||
<el-input v-model="formData.registeredAddress" placeholder="请输入注册地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开户行" prop="bankName">
|
||||
<el-input v-model="formData.bankName" placeholder="请输入开户行" />
|
||||
</el-form-item>
|
||||
<el-form-item label="银行账号" prop="bankAccount">
|
||||
<el-input v-model="formData.bankAccount" placeholder="请输入银行账号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="营业执照文件路径" prop="businessLicense">
|
||||
<el-input v-model="formData.businessLicense" placeholder="请输入营业执照文件路径" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { OrganizationsApi, OrganizationsVO } from '@/api/system/organizations'
|
||||
|
||||
/** 组织机构 表单 */
|
||||
defineOptions({ name: 'OrganizationsForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
orgName: undefined,
|
||||
workplace: undefined,
|
||||
corpId: undefined,
|
||||
corpSecret: undefined,
|
||||
subjectName: undefined,
|
||||
creditCode: undefined,
|
||||
legalRepresentative: undefined,
|
||||
registeredAddress: undefined,
|
||||
bankName: undefined,
|
||||
bankAccount: undefined,
|
||||
businessLicense: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
orgName: [{ required: true, message: '机构名称不能为空', trigger: 'blur' }],
|
||||
corpId: [{ required: true, message: '企业微信凭证不能为空', trigger: 'blur' }],
|
||||
corpSecret: [{ required: true, message: '企业微信凭证密钥不能为空', trigger: 'blur' }],
|
||||
subjectName: [{ required: true, message: '主体名称不能为空', trigger: 'blur' }],
|
||||
creditCode: [{ required: true, message: '统一信用代码不能为空', trigger: 'blur' }],
|
||||
legalRepresentative: [{ required: true, message: '法人代表不能为空', trigger: 'blur' }],
|
||||
registeredAddress: [{ required: true, message: '注册地址不能为空', trigger: 'blur' }],
|
||||
bankAccount: [{ required: true, message: '银行账号不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await OrganizationsApi.getOrganizations(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as OrganizationsVO
|
||||
if (formType.value === 'create') {
|
||||
await OrganizationsApi.createOrganizations(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await OrganizationsApi.updateOrganizations(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
orgName: undefined,
|
||||
workplace: undefined,
|
||||
corpId: undefined,
|
||||
corpSecret: undefined,
|
||||
subjectName: undefined,
|
||||
creditCode: undefined,
|
||||
legalRepresentative: undefined,
|
||||
registeredAddress: undefined,
|
||||
bankName: undefined,
|
||||
bankAccount: undefined,
|
||||
businessLicense: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,306 @@
|
|||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="机构名称" prop="orgName">
|
||||
<el-input
|
||||
v-model="queryParams.orgName"
|
||||
placeholder="请输入机构名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作地址" prop="workplace">
|
||||
<el-input
|
||||
v-model="queryParams.workplace"
|
||||
placeholder="请输入工作地址"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="企业微信凭证" prop="corpId">
|
||||
<el-input
|
||||
v-model="queryParams.corpId"
|
||||
placeholder="请输入企业微信凭证"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="企业微信凭证密钥" prop="corpSecret">
|
||||
<el-input
|
||||
v-model="queryParams.corpSecret"
|
||||
placeholder="请输入企业微信凭证密钥"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主体名称" prop="subjectName">
|
||||
<el-input
|
||||
v-model="queryParams.subjectName"
|
||||
placeholder="请输入主体名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="统一信用代码" prop="creditCode">
|
||||
<el-input
|
||||
v-model="queryParams.creditCode"
|
||||
placeholder="请输入统一信用代码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="法人代表" prop="legalRepresentative">
|
||||
<el-input
|
||||
v-model="queryParams.legalRepresentative"
|
||||
placeholder="请输入法人代表"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="注册地址" prop="registeredAddress">
|
||||
<el-input
|
||||
v-model="queryParams.registeredAddress"
|
||||
placeholder="请输入注册地址"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开户行" prop="bankName">
|
||||
<el-input
|
||||
v-model="queryParams.bankName"
|
||||
placeholder="请输入开户行"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="银行账号" prop="bankAccount">
|
||||
<el-input
|
||||
v-model="queryParams.bankAccount"
|
||||
placeholder="请输入银行账号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="营业执照文件路径" prop="businessLicense">
|
||||
<el-input
|
||||
v-model="queryParams.businessLicense"
|
||||
placeholder="请输入营业执照文件路径"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['system:organizations:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['system:organizations:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="机构名称" align="center" prop="orgName" />
|
||||
<el-table-column label="工作地址" align="center" prop="workplace" />
|
||||
<el-table-column label="企业微信凭证" align="center" prop="corpId" />
|
||||
<el-table-column label="企业微信凭证密钥" align="center" prop="corpSecret" />
|
||||
<el-table-column label="主体名称" align="center" prop="subjectName" />
|
||||
<el-table-column label="统一信用代码" align="center" prop="creditCode" />
|
||||
<el-table-column label="法人代表" align="center" prop="legalRepresentative" />
|
||||
<el-table-column label="注册地址" align="center" prop="registeredAddress" />
|
||||
<el-table-column label="开户行" align="center" prop="bankName" />
|
||||
<el-table-column label="银行账号" align="center" prop="bankAccount" />
|
||||
<el-table-column label="营业执照文件路径" align="center" prop="businessLicense" />
|
||||
<el-table-column label="创建者" align="center" prop="creator" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="更新者" align="center" prop="updater" />
|
||||
<el-table-column
|
||||
label="更新时间"
|
||||
align="center"
|
||||
prop="updateTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" min-width="120px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['system:organizations:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['system:organizations:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<OrganizationsForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { OrganizationsApi, OrganizationsVO } from '@/api/system/organizations'
|
||||
import OrganizationsForm from './OrganizationsForm.vue'
|
||||
|
||||
/** 组织机构 列表 */
|
||||
defineOptions({ name: 'Organizations' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<OrganizationsVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
orgName: undefined,
|
||||
workplace: undefined,
|
||||
corpId: undefined,
|
||||
corpSecret: undefined,
|
||||
subjectName: undefined,
|
||||
creditCode: undefined,
|
||||
legalRepresentative: undefined,
|
||||
registeredAddress: undefined,
|
||||
bankName: undefined,
|
||||
bankAccount: undefined,
|
||||
businessLicense: undefined,
|
||||
createTime: []
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await OrganizationsApi.getOrganizationsPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await OrganizationsApi.deleteOrganizations(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await OrganizationsApi.exportOrganizations(queryParams)
|
||||
download.excel(data, '组织机构.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue