add 应收应付
parent
d436704756
commit
29882118c0
|
|
@ -0,0 +1,47 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// CRM 财务票据 VO
|
||||||
|
export interface FinanceInvoiceVO {
|
||||||
|
id: number // 主键
|
||||||
|
ticketNumber: string // 票据号
|
||||||
|
billDate: Date // 单据日期
|
||||||
|
invoiceType: number // 发票类型
|
||||||
|
auxiliaryType: number // 辅助类型
|
||||||
|
writeOffStatus: number // 核销状态
|
||||||
|
customerId: number // 往来单位
|
||||||
|
customerName?: string // 往来单位名称
|
||||||
|
amount: number // 金额
|
||||||
|
}
|
||||||
|
|
||||||
|
// CRM 财务票据 API
|
||||||
|
export const FinanceInvoiceApi = {
|
||||||
|
// 查询CRM 财务票据分页
|
||||||
|
getFinanceInvoicePage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/crm/finance/invoice/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询CRM 财务票据详情
|
||||||
|
getFinanceInvoice: async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/finance/invoice/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增CRM 财务票据
|
||||||
|
createFinanceInvoice: async (data: FinanceInvoiceVO) => {
|
||||||
|
return await request.post({ url: `/crm/finance/invoice/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改CRM 财务票据
|
||||||
|
updateFinanceInvoice: async (data: FinanceInvoiceVO) => {
|
||||||
|
return await request.put({ url: `/crm/finance/invoice/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除CRM 财务票据
|
||||||
|
deleteFinanceInvoice: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/crm/finance/invoice/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出CRM 财务票据 Excel
|
||||||
|
exportFinanceInvoice: async (params) => {
|
||||||
|
return await request.download({ url: `/crm/finance/invoice/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// CRM 财务票据核销 VO
|
||||||
|
export interface CrmFinanceWriteoffRespVO {
|
||||||
|
customerId: number; // 往来单位
|
||||||
|
customerName: string; // 往来单位名称
|
||||||
|
unwrittenOffIncomeInvoiceAmount: string; // 未核销收款票据金额
|
||||||
|
unwrittenOffIncomeAmount: string; // 未核销收款金额
|
||||||
|
unwrittenOffIncomeDiffAmount: string; // 未核销收款差额
|
||||||
|
unwrittenOffOutcomeInvoiceAmount: string; // 未核销付款票据金额
|
||||||
|
unwrittenOffOutcomeAmount: string; // 未核销付款金额
|
||||||
|
unwrittenOffOutcomeDiffAmount: string; // 未核销付款差额
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CRM 财务票据 API
|
||||||
|
export const FinanceWriteoffApi = {
|
||||||
|
// 查询CRM 财务票据核销分页
|
||||||
|
getFinanceInvoicePage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/crm/finance/writeoff/page`, params })
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -225,6 +225,9 @@ export enum DICT_TYPE {
|
||||||
CRM_PROJECT_TYPE = 'crm_project_type', // CRM 项目类型
|
CRM_PROJECT_TYPE = 'crm_project_type', // CRM 项目类型
|
||||||
CRM_PROJECT_POWER_SUPPLY_TYPE = 'crm_project_power_supply_type', // CRM 项目供电模式
|
CRM_PROJECT_POWER_SUPPLY_TYPE = 'crm_project_power_supply_type', // CRM 项目供电模式
|
||||||
CRM_PROJECT_DOCUMENT_CONFIG = 'crm_project_document_config', // CRM 项目文档配置
|
CRM_PROJECT_DOCUMENT_CONFIG = 'crm_project_document_config', // CRM 项目文档配置
|
||||||
|
CRM_FINANCE_INVOICE_TYPE = 'crm_finance_invoice_type', // CRM 票据发票类型
|
||||||
|
CRM_FINANCE_INVOICE_AUXILIARY_TYPE = 'crm_finance_invoice_auxiliary_type', // CRM 票据辅助类型
|
||||||
|
CRM_FINANCE_INVOICE_WRITE_OFF_STATUS = 'crm_finance_invoice_write_off_status', // CRM 票据核销状态
|
||||||
|
|
||||||
// ========== ERP - 企业资源计划模块 ==========
|
// ========== ERP - 企业资源计划模块 ==========
|
||||||
ERP_AUDIT_STATUS = 'erp_audit_status', // ERP 审批状态
|
ERP_AUDIT_STATUS = 'erp_audit_status', // ERP 审批状态
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,196 @@
|
||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="单据日期" prop="billDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.billDate"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择单据日期"
|
||||||
|
class="!w-100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="往来单位" prop="customerId">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.customerId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择往来单位"
|
||||||
|
class="!w-100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in customerList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发票类型" prop="invoiceType">
|
||||||
|
<el-select v-model="formData.invoiceType" placeholder="请选择发票类型" class="!w-100%">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_FINANCE_INVOICE_TYPE)"
|
||||||
|
: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="auxiliaryType">
|
||||||
|
<el-select v-model="formData.auxiliaryType" placeholder="请选择辅助类型" class="!w-100%">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_FINANCE_INVOICE_AUXILIARY_TYPE)"
|
||||||
|
: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="ticketNumber">
|
||||||
|
<el-input v-model="formData.ticketNumber" placeholder="请输入票据号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="金额" prop="amount">
|
||||||
|
<el-input type="number" v-model="formData.amount" placeholder="请输入金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="核销状态" prop="writeOffStatus">
|
||||||
|
<el-select v-model="formData.writeOffStatus" placeholder="请选择核销状态" class="!w-100%">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_FINANCE_INVOICE_WRITE_OFF_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</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 { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { FinanceInvoiceApi, FinanceInvoiceVO } from '@/api/crm/finance'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
|
||||||
|
/** CRM 财务票据 表单 */
|
||||||
|
defineOptions({ name: 'FinanceInvoiceForm' })
|
||||||
|
|
||||||
|
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,
|
||||||
|
ticketNumber: undefined,
|
||||||
|
billDate: undefined,
|
||||||
|
invoiceType: undefined,
|
||||||
|
auxiliaryType: undefined,
|
||||||
|
writeOffStatus: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
ticketNumber: [{ required: true, message: '票据号不能为空', trigger: 'blur' }],
|
||||||
|
billDate: [{ required: true, message: '单据日期不能为空', trigger: 'blur' }],
|
||||||
|
invoiceType: [{ required: true, message: '发票类型不能为空', trigger: 'change' }],
|
||||||
|
auxiliaryType: [{ required: true, message: '辅助类型不能为空', trigger: 'change' }],
|
||||||
|
writeOffStatus: [{ required: true, message: '核销状态不能为空', trigger: 'blur' }],
|
||||||
|
customerId: [{ required: true, message: '往来单位不能为空', trigger: 'blur' }],
|
||||||
|
amount: [{ required: true, message: '金额不能为空', trigger: 'blur' }],
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
const customerList = ref<CustomerApi.CustomerVO[]>([])
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 获取客户列表
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleAllList()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await FinanceInvoiceApi.getFinanceInvoice(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 FinanceInvoiceVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await FinanceInvoiceApi.createFinanceInvoice(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await FinanceInvoiceApi.updateFinanceInvoice(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
ticketNumber: undefined,
|
||||||
|
billDate: undefined,
|
||||||
|
invoiceType: undefined,
|
||||||
|
auxiliaryType: undefined,
|
||||||
|
writeOffStatus: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,298 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="单据日期" prop="billDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.billDate"
|
||||||
|
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 label="票据号" prop="ticketNumber">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.ticketNumber"
|
||||||
|
placeholder="请输入票据号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="往来单位" prop="customerId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.customerId"
|
||||||
|
class="!w-240px"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择往来单位"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in customerList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="金额" prop="amount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.amount"
|
||||||
|
placeholder="请输入金额"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="发票类型" prop="invoiceType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.invoiceType"
|
||||||
|
placeholder="请选择发票类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_FINANCE_INVOICE_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="辅助类型" prop="auxiliaryType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.auxiliaryType"
|
||||||
|
placeholder="请选择辅助类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_FINANCE_INVOICE_AUXILIARY_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="核销状态" prop="writeOffStatus">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.writeOffStatus"
|
||||||
|
placeholder="请选择核销状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_FINANCE_INVOICE_WRITE_OFF_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['crm:finance-invoice:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['crm:finance-invoice: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="billDate" :formatter="dateFormatter2" min-width="160px"/>
|
||||||
|
<el-table-column label="票据号" align="center" prop="ticketNumber" min-width="250px"/>
|
||||||
|
<el-table-column label="往来单位" align="center" prop="customerId" min-width="300px">
|
||||||
|
<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="amount" min-width="160px"/>
|
||||||
|
<el-table-column label="发票类型" align="center" prop="invoiceType" min-width="160px">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.CRM_FINANCE_INVOICE_TYPE" :value="scope.row.invoiceType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="辅助类型" align="center" prop="auxiliaryType" min-width="160px">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.CRM_FINANCE_INVOICE_AUXILIARY_TYPE" :value="scope.row.auxiliaryType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="核销状态" align="center" prop="writeOffStatus" min-width="160px">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.CRM_FINANCE_INVOICE_WRITE_OFF_STATUS" :value="scope.row.writeOffStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['crm:finance-invoice:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['crm:finance-invoice: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>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<FinanceInvoiceForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { FinanceInvoiceApi, FinanceInvoiceVO } from '@/api/crm/finance'
|
||||||
|
import FinanceInvoiceForm from './FinanceInvoiceForm.vue'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
|
||||||
|
/** CRM 财务票据 列表 */
|
||||||
|
defineOptions({ name: 'CrmFinanceInvoice' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<FinanceInvoiceVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
ticketNumber: undefined,
|
||||||
|
billDate: [],
|
||||||
|
invoiceType: undefined,
|
||||||
|
auxiliaryType: undefined,
|
||||||
|
writeOffStatus: undefined,
|
||||||
|
customerId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
createTime: [],
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
const customerList = ref<CustomerApi.CustomerVO[]>([])
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await FinanceInvoiceApi.getFinanceInvoicePage(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 { push } = useRouter()
|
||||||
|
const openCustomerDetail = (id: number) => {
|
||||||
|
push({ name: 'CrmCustomerDetail', params: { id } })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await FinanceInvoiceApi.deleteFinanceInvoice(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await FinanceInvoiceApi.exportFinanceInvoice(queryParams)
|
||||||
|
download.excel(data, 'CRM 财务票据.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(async () => {
|
||||||
|
await getList()
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,134 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="往来单位" prop="customerId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.customerId"
|
||||||
|
class="!w-240px"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择往来单位"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in customerList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
</el-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="customerName" min-width="200px">
|
||||||
|
<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="unwrittenOffIncomeInvoiceAmount" min-width="180px" />
|
||||||
|
<el-table-column label="未核销收款金额" align="center" prop="unwrittenOffIncomeAmount" min-width="180px" />
|
||||||
|
<el-table-column label="应收额" align="center" prop="unwrittenOffIncomeDiffAmount" min-width="180px">
|
||||||
|
<template #header>
|
||||||
|
<span class="diffAmount">应收额</span>
|
||||||
|
</template>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="diffAmount">{{ scope.row.unwrittenOffIncomeDiffAmount }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="未核销付款票据金额" align="center" prop="unwrittenOffOutcomeInvoiceAmount" min-width="180px" />
|
||||||
|
<el-table-column label="未核销付款金额" align="center" prop="unwrittenOffOutcomeAmount" min-width="180px" />
|
||||||
|
<el-table-column label="应付额" align="center" prop="unwrittenOffOutcomeDiffAmount" min-width="180px">
|
||||||
|
<template #header>
|
||||||
|
<span class="diffAmount">应付额</span>
|
||||||
|
</template>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="diffAmount">{{ scope.row.unwrittenOffOutcomeDiffAmount }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { FinanceWriteoffApi, CrmFinanceWriteoffRespVO } from '@/api/crm/finance/writeoff'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
|
||||||
|
defineOptions({ name: 'CrmFinanceWriteOff' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true)
|
||||||
|
const list = ref<CrmFinanceWriteoffRespVO[]>([])
|
||||||
|
const total = ref(0)
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
customerId: undefined
|
||||||
|
})
|
||||||
|
const queryFormRef = ref()
|
||||||
|
const customerList = ref<CustomerApi.CustomerVO[]>([])
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await FinanceWriteoffApi.getFinanceInvoicePage(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 { push } = useRouter()
|
||||||
|
const openCustomerDetail = (id: number) => {
|
||||||
|
push({ name: 'CrmCustomerDetail', params: { id } })
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getList()
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.diffAmount {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #55a8f6; // 蓝色
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,334 @@
|
||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="项目名称" prop="deptId">
|
||||||
|
<el-select
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
disabled
|
||||||
|
v-model="formData.deptId"
|
||||||
|
class="w-1/1"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in deptList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id ?? ''"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="场地租赁合同" prop="cooperationAgreementConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.cooperationAgreementConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="purchaseContractConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.purchaseContractConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="EPC施工合同" prop="epcContractConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.epcContractConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="buildPermitConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.buildPermitConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="ownershipProofConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.ownershipProofConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="projectRecordConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.projectRecordConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="powerSupplyReplyConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.powerSupplyReplyConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="investmentAgreementConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.investmentAgreementConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="investmentShareAgreementConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.investmentShareAgreementConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
: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="supplementaryMaterialsConfig">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.supplementaryMaterialsConfig"
|
||||||
|
placeholder="请选择配置"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_DOCUMENT_CONFIG)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</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 * as ProjectApi from '@/api/crm/project'
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
|
import * as StationSiteApi from '@/api/crm/stationsite'
|
||||||
|
|
||||||
|
/** CRM 项目信息 表单 */
|
||||||
|
defineOptions({ name: 'ProjectForm' })
|
||||||
|
|
||||||
|
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,
|
||||||
|
deptId: undefined,
|
||||||
|
siteId: undefined,
|
||||||
|
type: undefined,
|
||||||
|
projectStatus: undefined,
|
||||||
|
powerSupplyType: undefined,
|
||||||
|
purchaseContractConfig: undefined,
|
||||||
|
cooperationAgreementConfig:undefined,
|
||||||
|
epcContractConfig: undefined,
|
||||||
|
buildPermitConfig: undefined,
|
||||||
|
ownershipProofConfig: undefined,
|
||||||
|
projectRecordConfig: undefined,
|
||||||
|
powerSupplyReplyConfig: undefined,
|
||||||
|
investmentAgreementConfig: undefined,
|
||||||
|
investmentShareAgreementConfig: undefined,
|
||||||
|
supplementaryMaterialsConfig: undefined
|
||||||
|
})
|
||||||
|
const formRules = computed(() => ({
|
||||||
|
|
||||||
|
}))
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
const deptList = ref<DeptApi.DeptVO[]>([])
|
||||||
|
const contractOptions = ref<ContractApi.ContractVO[]>([]) // 合同列表
|
||||||
|
const siteOptions = ref<StationSiteApi.StationSiteVO[]>([]) // 场地列表
|
||||||
|
const estimatedPiles = ref<number | undefined>(undefined)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => formData.value.siteId,
|
||||||
|
async (siteId) => {
|
||||||
|
if (siteId) {
|
||||||
|
const site = await StationSiteApi.getStationSite(siteId)
|
||||||
|
estimatedPiles.value = site.estimatedPiles
|
||||||
|
} else {
|
||||||
|
estimatedPiles.value = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
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 ProjectApi.getProject(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 加载部门列表
|
||||||
|
deptList.value = await DeptApi.querySimpleDeptList(3)
|
||||||
|
// 获得合同列表
|
||||||
|
contractOptions.value = await ContractApi.getContractSimpleAllList()
|
||||||
|
// 获得场地列表
|
||||||
|
siteOptions.value = await StationSiteApi.getStationSiteSimpleList()
|
||||||
|
}
|
||||||
|
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 ProjectApi.ProjectVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await ProjectApi.createProject(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ProjectApi.updateProject(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
siteId: undefined,
|
||||||
|
type: undefined,
|
||||||
|
projectStatus: undefined,
|
||||||
|
powerSupplyType: undefined,
|
||||||
|
purchaseContractConfig: undefined,
|
||||||
|
cooperationAgreementConfig:undefined,
|
||||||
|
epcContractConfig: undefined,
|
||||||
|
buildPermitConfig: undefined,
|
||||||
|
ownershipProofConfig: undefined,
|
||||||
|
projectRecordConfig: undefined,
|
||||||
|
powerSupplyReplyConfig: undefined,
|
||||||
|
investmentAgreementConfig: undefined,
|
||||||
|
investmentShareAgreementConfig: undefined,
|
||||||
|
supplementaryMaterialsConfig: undefined
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,462 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="项目名称" prop="deptId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.deptId"
|
||||||
|
class="!w-240px"
|
||||||
|
placeholder="请选择项目名称"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in deptList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="项目合伙人" prop="ownerUserId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.ownerUserId"
|
||||||
|
placeholder="请输入项目合伙人"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="类型" prop="type">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.type"
|
||||||
|
placeholder="请选择类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PROJECT_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column align="center" label="项目名称" prop="deptName" min-width="250"/>
|
||||||
|
<el-table-column align="center" label="场地租赁合同" prop="cooperationAgreement" width="200">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.cooperationAgreement && scope.row.cooperationAgreementConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" @click="openContractDetail(scope.row.cooperationAgreement)" >
|
||||||
|
{{ scope.row.cooperationAgreementName }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.cooperationAgreement && scope.row.cooperationAgreementConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" @click="openContractDetail(scope.row.cooperationAgreement)" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.cooperationAgreementConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="设备采购合同" prop="purchaseContractId" width="200">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.purchaseContractId && scope.row.purchaseContractConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" @click="openContractDetail(scope.row.purchaseContractId)" >
|
||||||
|
{{ scope.row.purchaseContractName }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.purchaseContractId && scope.row.purchaseContractConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" @click="openContractDetail(scope.row.purchaseContractId)" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.purchaseContractConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="EPC施工合同" prop="epcContractId" width="200">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.epcContractId && scope.row.epcContractConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" @click="openContractDetail(scope.row.epcContractId)" >
|
||||||
|
{{ scope.row.epcContractName }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.epcContractId && scope.row.epcContractConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" @click="openContractDetail(scope.row.epcContractId)" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.epcContractConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column align="center" label="同意建桩证明" prop="buildPermit" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.buildPermit && scope.row.buildPermitConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" :href="scope.row.buildPermit" >
|
||||||
|
{{ extractFileName(scope.row.buildPermit) }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.buildPermit && scope.row.buildPermitConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" :href="scope.row.buildPermit" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.buildPermitConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column align="center" label="场地权属证明" prop="ownershipProof" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.ownershipProof && scope.row.ownershipProofConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" :href="scope.row.ownershipProof" >
|
||||||
|
{{ extractFileName(scope.row.ownershipProof) }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.ownershipProof && scope.row.ownershipProofConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" :href="scope.row.ownershipProof" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.ownershipProofConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="项目备案" prop="projectRecord" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.projectRecord && scope.row.projectRecordConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" :href="scope.row.projectRecord" >
|
||||||
|
{{ extractFileName(scope.row.projectRecord) }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.projectRecord && scope.row.projectRecordConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" :href="scope.row.projectRecord" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.projectRecordConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="合作投资协议" prop="investmentAgreement" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.investmentAgreement && scope.row.investmentAgreementConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" :href="scope.row.investmentAgreement" >
|
||||||
|
{{ extractFileName(scope.row.investmentAgreement) }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.investmentAgreement && scope.row.investmentAgreementConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" :href="scope.row.investmentAgreement" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.investmentAgreementConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="投资分成协议" prop="investmentShareAgreement" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.investmentShareAgreement && scope.row.investmentShareAgreementConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" :href="scope.row.investmentShareAgreement" >
|
||||||
|
{{ extractFileName(scope.row.investmentShareAgreement) }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.investmentShareAgreement && scope.row.investmentShareAgreementConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" :href="scope.row.investmentShareAgreement" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.investmentShareAgreementConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="供电答复单" prop="powerSupplyReply" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.powerSupplyReply && scope.row.powerSupplyReplyConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" :href="scope.row.powerSupplyReply" >
|
||||||
|
{{ extractFileName(scope.row.powerSupplyReply) }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.powerSupplyReply && scope.row.powerSupplyReplyConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" :href="scope.row.powerSupplyReply" >
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.powerSupplyReplyConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="其他补充材料" prop="supplementaryMaterials" min-width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.supplementaryMaterials && scope.row.supplementaryMaterialsConfig == undefined">
|
||||||
|
<el-link :underline="false" type="primary" @click="openSupplementaryDialog(scope.row.supplementaryMaterials)">
|
||||||
|
查看
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.supplementaryMaterials && scope.row.supplementaryMaterialsConfig == 1">
|
||||||
|
<el-link :underline="false" type="success" @click="openSupplementaryDialog(scope.row.supplementaryMaterials)">
|
||||||
|
已核验
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.supplementaryMaterialsConfig == 2">
|
||||||
|
<span style="color: gray;">无需</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span style="color: red;">缺项</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['crm:project:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ProjectDocumentForm ref="formRef" @success="getList" />
|
||||||
|
<!-- 其他补充材料弹窗 -->
|
||||||
|
<Dialog v-model="supplementaryDialogVisible" title="其他补充材料" width="500px" :close-on-click-modal="false">
|
||||||
|
<div v-if="Array.isArray(supplementaryFiles) && supplementaryFiles.length">
|
||||||
|
<ul>
|
||||||
|
<li v-for="(file) in supplementaryFiles" :key="file">
|
||||||
|
<el-link :href="file" target="_blank" :underline="false">{{ extractFileName(file) }}</el-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
暂无文件
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as ProjectApi from '@/api/crm/project'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
import ProjectDocumentForm from './ProjectDocumentForm.vue'
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
|
/** CRM 项目档案 列表 */
|
||||||
|
defineOptions({ name: 'CrmProjectDocument' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<ProjectApi.ProjectVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
deptId: undefined,
|
||||||
|
siteId: undefined,
|
||||||
|
ownerUserId: undefined,
|
||||||
|
type: undefined,
|
||||||
|
projectStatus: 0,
|
||||||
|
estimatedPiles: undefined,
|
||||||
|
createTime: [],
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
const deptList = ref<DeptApi.DeptVO[]>([])
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await ProjectApi.getProjectPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 打开场地详情 */
|
||||||
|
const { push } = useRouter()
|
||||||
|
const openSiteDetail = (id: number) => {
|
||||||
|
push({ name: 'CrmStationSiteDetail', params: { id } })
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
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 ProjectApi.deleteProject(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await ProjectApi.exportProject(queryParams)
|
||||||
|
download.excel(data, 'CRM 项目信息.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const calculateCostPerPile = (row) => {
|
||||||
|
// 检查枪数是否有效(非空、非零、数字类型)
|
||||||
|
if (!row.estimatedPiles || isNaN(row.estimatedPiles) || row.estimatedPiles <= 0) {
|
||||||
|
return ''; // 无效值返回空字符串
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查总投资额是否有效
|
||||||
|
if (!row.totalInvestment || isNaN(row.totalInvestment)) {
|
||||||
|
return ''; // 无效值返回空字符串
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算并保留两位小数
|
||||||
|
const cost = (row.totalInvestment / row.estimatedPiles).toFixed(2);
|
||||||
|
return parseFloat(cost); // 转为数字类型避免显示多余的0
|
||||||
|
};
|
||||||
|
|
||||||
|
// 从URL中提取文件名
|
||||||
|
const extractFileName = (url: any) => {
|
||||||
|
if (!url || typeof url !== 'string') return '';
|
||||||
|
let filename = '';
|
||||||
|
try {
|
||||||
|
const path = new URL(url).pathname;
|
||||||
|
filename = decodeURIComponent(path.substring(path.lastIndexOf('/') + 1));
|
||||||
|
} catch {
|
||||||
|
try {
|
||||||
|
filename = decodeURIComponent(url.substring(url.lastIndexOf('/') + 1));
|
||||||
|
} catch {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 处理类似 1_1752329278882.pdf => 1.pdf
|
||||||
|
const firstUnderscore = filename.indexOf('_');
|
||||||
|
const lastDot = filename.lastIndexOf('.');
|
||||||
|
if (firstUnderscore > 0 && lastDot > firstUnderscore) {
|
||||||
|
return filename.substring(0, firstUnderscore) + filename.substring(lastDot);
|
||||||
|
}
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 打开合同详情 */
|
||||||
|
const openContractDetail = (id: number) => {
|
||||||
|
push({ name: 'CrmContractDetail', params: { id } })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 其他补充材料弹窗相关
|
||||||
|
const supplementaryDialogVisible = ref(false)
|
||||||
|
const supplementaryFiles = ref([])
|
||||||
|
const openSupplementaryDialog = (files) => {
|
||||||
|
supplementaryFiles.value = Array.isArray(files) ? files : [files]
|
||||||
|
supplementaryDialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
openSupplementaryDialog,
|
||||||
|
supplementaryDialogVisible,
|
||||||
|
supplementaryFiles
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(async () => {
|
||||||
|
await getList()
|
||||||
|
// 加载部门列表
|
||||||
|
deptList.value = await DeptApi.querySimpleDeptList(3)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue