1.3.0前端:

feat(应收款):应收款新增功能
dev
xs 1 week ago
parent 12c3d31b8a
commit ca45a573cc

@ -74,3 +74,16 @@ export function getErpContractPaymentMethodList (query) {
params: query
});
};
/**
* ,left join base_payment_stage
* @param query
* @returns {*}
*/
export function getErpContractPaymentMethodJoinList (query) {
return request({
url: '/oa/erp/contractPaymentMethod/getErpContractPaymentMethodJoinList',
method: 'get',
params: query
});
};

@ -0,0 +1,76 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FinAccountInstallmentVO, FinAccountInstallmentForm, FinAccountInstallmentQuery } from '@/api/oa/erp/finAccountInstallment/types';
/**
*
* @param query
* @returns {*}
*/
export const listFinAccountInstallment = (query?: FinAccountInstallmentQuery): AxiosPromise<FinAccountInstallmentVO[]> => {
return request({
url: '/oa/erp/finAccountInstallment/list',
method: 'get',
params: query
});
};
/**
*
* @param accountInstallmentId
*/
export const getFinAccountInstallment = (accountInstallmentId: string | number): AxiosPromise<FinAccountInstallmentVO> => {
return request({
url: '/oa/erp/finAccountInstallment/' + accountInstallmentId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addFinAccountInstallment = (data: FinAccountInstallmentForm) => {
return request({
url: '/oa/erp/finAccountInstallment',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateFinAccountInstallment = (data: FinAccountInstallmentForm) => {
return request({
url: '/oa/erp/finAccountInstallment',
method: 'put',
data: data
});
};
/**
*
* @param accountInstallmentId
*/
export const delFinAccountInstallment = (accountInstallmentId: string | number | Array<string | number>) => {
return request({
url: '/oa/erp/finAccountInstallment/' + accountInstallmentId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getErpFinAccountInstallmentList (query) {
return request({
url: '/oa/erp/finAccountInstallment/getErpFinAccountInstallmentList',
method: 'get',
params: query
});
};

@ -0,0 +1,201 @@
export interface FinAccountInstallmentVO {
/**
* ID
*/
accountInstallmentId: string | number;
/**
*
*/
installmentCode: string;
/**
* IDcrm_customer_info
*/
customerId: string | number;
/**
*
*/
customerName: string;
/**
* (CNY/USD/EUR)CNY
*/
currency: string;
/**
*
*/
paymentAmount: number;
/**
*
*/
paymentDate: string;
/**
*
*/
remark: string;
/**
*
*/
dispatchUserId: string | number;
/**
*
*/
dispatchDeptId: string | number;
/**
*
*/
dispatchDate: string;
/**
* 0稿 1 2
*/
installmentStatus: string;
/**
*
*/
accountManageId: string | number;
}
export interface FinAccountInstallmentForm extends BaseEntity {
/**
* ID
*/
accountInstallmentId?: string | number;
/**
*
*/
installmentCode?: string;
/**
* IDcrm_customer_info
*/
customerId?: string | number;
/**
*
*/
customerName?: string;
/**
* (CNY/USD/EUR)CNY
*/
currency?: string;
/**
*
*/
paymentAmount?: number;
/**
*
*/
paymentDate?: string;
/**
*
*/
remark?: string;
/**
*
*/
dispatchUserId?: string | number;
/**
*
*/
dispatchDeptId?: string | number;
/**
*
*/
dispatchDate?: string;
/**
* 0稿 1 2
*/
installmentStatus?: string;
/**
*
*/
accountManageId?: string | number;
}
export interface FinAccountInstallmentQuery extends PageQuery {
/**
*
*/
installmentCode?: string;
/**
* IDcrm_customer_info
*/
customerId?: string | number;
/**
*
*/
customerName?: string;
/**
* (CNY/USD/EUR)CNY
*/
currency?: string;
/**
*
*/
paymentAmount?: number;
/**
*
*/
paymentDate?: string;
/**
*
*/
dispatchUserId?: string | number;
/**
*
*/
dispatchDeptId?: string | number;
/**
*
*/
dispatchDate?: string;
/**
* 0稿 1 2
*/
installmentStatus?: string;
/**
*
*/
accountManageId?: string | number;
/**
*
*/
params?: any;
}

@ -0,0 +1,105 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FinAccountReceivableVO, FinAccountReceivableForm, FinAccountReceivableQuery } from '@/api/oa/erp/finAccountReceivable/types';
/**
*
* @param query
* @returns {*}
*/
export const listFinAccountReceivable = (query?: FinAccountReceivableQuery): AxiosPromise<FinAccountReceivableVO[]> => {
return request({
url: '/oa/erp/finAccountReceivable/list',
method: 'get',
params: query
});
};
/**
*
* @param accountReceivableId
*/
export const getFinAccountReceivable = (accountReceivableId: string | number): AxiosPromise<FinAccountReceivableVO> => {
return request({
url: '/oa/erp/finAccountReceivable/' + accountReceivableId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addFinAccountReceivable = (data: FinAccountReceivableForm) => {
return request({
url: '/oa/erp/finAccountReceivable',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateFinAccountReceivable = (data: FinAccountReceivableForm) => {
return request({
url: '/oa/erp/finAccountReceivable',
method: 'put',
data: data
});
};
/**
*
* @param accountReceivableId
*/
export const delFinAccountReceivable = (accountReceivableId: string | number | Array<string | number>) => {
return request({
url: '/oa/erp/finAccountReceivable/' + accountReceivableId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getErpFinAccountReceivableList(query) {
return request({
url: '/oa/erp/finAccountReceivable/getErpFinAccountReceivableList',
method: 'get',
params: query
});
}
/**
* ,right join erp_fin_account_receivable_stage
* @param query
* @returns {*}
*/
export function getErpFinAccountReceivableStageList(query) {
return request({
url: '/oa/erp/finAccountReceivable/getErpFinAccountReceivableStageList',
method: 'get',
params: query
});
}
/**
* ,right join erp_fin_account_receivable_stage
* @param query
* @returns {*}
*/
export function getErpContractPaymentMethodJoinList(query) {
return request({
url: '/oa/erp/finAccountReceivable/getErpContractPaymentMethodJoinList',
method: 'get',
params: query
});
}

@ -0,0 +1,326 @@
export interface FinAccountReceivableVO {
/**
* ID
*/
accountReceivableId: string | number;
/**
*
*/
invoiceCode: string;
/**
* ID
*/
projectId: string | number;
/**
*
*/
projectCategory: number;
/**
*
*/
projectType: string;
/**
* ID
*/
contractId: string | number;
/**
*
*/
generalContractor: string;
/**
*
*/
customerAbbreviation: string;
/**
*
*/
contractParties: string;
/**
* WBS.
*/
wbsElement: string;
/**
*
*/
lineItem: string;
/**
*
*/
projectStatus: string;
/**
*
*/
settlementMonth: string;
/**
*
*/
income: number;
/**
*
*/
backToBackRatio: number;
/**
*
*/
currency: string;
/**
* 线
*/
invoiceAmount: number;
/**
*
*/
totalPrice: number;
/**
*
*/
totalPriceHighway: number;
/**
* -
*/
totalPriceOri: number;
/**
*
*/
exchangeRate: number;
}
export interface FinAccountReceivableForm extends BaseEntity {
/**
* ID
*/
accountReceivableId?: string | number;
/**
*
*/
invoiceCode?: string;
/**
* ID
*/
projectId?: string | number;
/**
*
*/
projectCategory?: number;
/**
*
*/
projectType?: string;
/**
* ID
*/
contractId?: string | number;
/**
*
*/
generalContractor?: string;
/**
*
*/
customerAbbreviation?: string;
/**
*
*/
contractParties?: string;
/**
* WBS.
*/
wbsElement?: string;
/**
*
*/
lineItem?: string;
/**
*
*/
projectStatus?: string;
/**
*
*/
settlementMonth?: string;
/**
*
*/
income?: number;
/**
*
*/
backToBackRatio?: number;
/**
*
*/
currency?: string;
/**
* 线
*/
invoiceAmount?: number;
/**
*
*/
totalPrice?: number;
/**
*
*/
totalPriceHighway?: number;
/**
* -
*/
totalPriceOri?: number;
/**
*
*/
exchangeRate?: number;
}
export interface FinAccountReceivableQuery extends PageQuery {
/**
*
*/
invoiceCode?: string;
/**
* ID
*/
projectId?: string | number;
/**
*
*/
projectCategory?: number;
/**
*
*/
projectType?: string;
/**
* ID
*/
contractId?: string | number;
/**
*
*/
generalContractor?: string;
/**
*
*/
customerAbbreviation?: string;
/**
*
*/
contractParties?: string;
/**
* WBS.
*/
wbsElement?: string;
/**
*
*/
lineItem?: string;
/**
*
*/
projectStatus?: string;
/**
*
*/
settlementMonth?: string;
/**
*
*/
income?: number;
/**
*
*/
backToBackRatio?: number;
/**
*
*/
currency?: string;
/**
* 线
*/
invoiceAmount?: number;
/**
*
*/
totalPrice?: number;
/**
*
*/
totalPriceHighway?: number;
/**
* -
*/
totalPriceOri?: number;
/**
*
*/
exchangeRate?: number;
/**
*
*/
params?: any;
}

@ -0,0 +1,76 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FinAccountReceivableStageVO, FinAccountReceivableStageForm, FinAccountReceivableStageQuery } from '@/api/oa/erp/finAccountReceivableStage/types';
/**
*
* @param query
* @returns {*}
*/
export const listFinAccountReceivableStage = (query?: FinAccountReceivableStageQuery): AxiosPromise<FinAccountReceivableStageVO[]> => {
return request({
url: '/oa/erp/finAccountReceivableStage/list',
method: 'get',
params: query
});
};
/**
*
* @param receivableStageId
*/
export const getFinAccountReceivableStage = (receivableStageId: string | number): AxiosPromise<FinAccountReceivableStageVO> => {
return request({
url: '/oa/erp/finAccountReceivableStage/' + receivableStageId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addFinAccountReceivableStage = (data: FinAccountReceivableStageForm) => {
return request({
url: '/oa/erp/finAccountReceivableStage',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateFinAccountReceivableStage = (data: FinAccountReceivableStageForm) => {
return request({
url: '/oa/erp/finAccountReceivableStage',
method: 'put',
data: data
});
};
/**
*
* @param receivableStageId
*/
export const delFinAccountReceivableStage = (receivableStageId: string | number | Array<string | number>) => {
return request({
url: '/oa/erp/finAccountReceivableStage/' + receivableStageId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getErpFinAccountReceivableStageList (query) {
return request({
url: '/oa/erp/finAccountReceivableStage/getErpFinAccountReceivableStageList',
method: 'get',
params: query
});
};

@ -0,0 +1,191 @@
export interface FinAccountReceivableStageVO {
/**
* ID
*/
receivableStageId: string | number;
/**
* ID
*/
accountReceivableId: string | number;
/**
* ID
*/
paymentStageId: string | number;
/**
*
*/
stageName: string;
/**
*
*/
paymentAmount: number;
/**
*
*/
paymentPercentage: string;
/**
*
*/
paymentDeadline: number;
/**
*
*/
paymentDescription: string;
/**
*
*/
stageRequiredDate: string;
/**
*
*/
stageRealDate: string;
/**
*
*/
settlementDate: string;
/**
*
*/
warrantyPeriod: number;
}
export interface FinAccountReceivableStageForm extends BaseEntity {
/**
* ID
*/
receivableStageId?: string | number;
/**
* ID
*/
accountReceivableId?: string | number;
/**
* ID
*/
paymentStageId?: string | number;
/**
*
*/
stageName?: string;
/**
*
*/
paymentAmount?: number;
/**
*
*/
paymentPercentage?: string;
/**
*
*/
paymentDeadline?: number;
/**
*
*/
paymentDescription?: string;
/**
*
*/
stageRequiredDate?: string;
/**
*
*/
stageRealDate?: string;
/**
*
*/
settlementDate?: string;
/**
*
*/
warrantyPeriod?: number;
}
export interface FinAccountReceivableStageQuery extends PageQuery {
/**
* ID
*/
accountReceivableId?: string | number;
/**
* ID
*/
paymentStageId?: string | number;
/**
*
*/
stageName?: string;
/**
*
*/
paymentAmount?: number;
/**
*
*/
paymentPercentage?: string;
/**
*
*/
paymentDeadline?: number;
/**
*
*/
paymentDescription?: string;
/**
*
*/
stageRequiredDate?: string;
/**
*
*/
stageRealDate?: string;
/**
*
*/
settlementDate?: string;
/**
*
*/
warrantyPeriod?: number;
/**
*
*/
params?: any;
}

@ -88,4 +88,16 @@ export function getErpProjectInfoList(query) {
}
/**
* ,使
* @param query
* @returns {*}
*/
export function getErpProjectInfoJoinList(query) {
return request({
url: '/oa/erp/projectInfo/getErpProjectInfoJoinList',
method: 'get',
params: query
});
}

@ -180,19 +180,6 @@ export const constantRoutes: RouteRecordRaw[] = [
}
]
},
{
path: '/oa/erp',
component: Layout,
hidden: true,
children: [
{
path: 'budgetInfo/edit',
component: () => import('@/views/oa/erp/budgetInfo/edit.vue'),
name: 'BudgetEdit',
meta: { title: '项目预算申请', activeMenu: '/erp/budgetInfo' }
}
]
},
{
path: '/customer',
component: Layout,

@ -0,0 +1,173 @@
<template>
<el-dialog v-model="dialogVisible" title="选择合同" width="880px">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="80px">
<el-form-item label="合同编号" prop="contractCode">
<el-input v-model="queryParams.contractCode" placeholder="请输入合同编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="合同名称" prop="contractName">
<el-input v-model="queryParams.contractName" placeholder="请输入合同名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="合同状态" prop="contractStatus">
<el-select v-model="queryParams.contractStatus" placeholder="请选择合同状态" clearable>
<el-option v-for="dict in contract_status" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-table :data="contractList" border @row-click="selectContract" style="width: 100%" v-loading="contractLoading" highlight-current-row>
<el-table-column prop="contractCode" label="合同编号" width="150" />
<el-table-column prop="contractName" label="合同名称" width="150" />
<el-table-column prop="businessDirection" label="业务方向" width="120">
<template #default="scope">
<dict-tag :options="business_direction" :value="scope.row.businessDirection" />
</template>
</el-table-column>
<el-table-column prop="contractStatus" label="合同状态" width="100">
<template #default="scope">
<dict-tag :options="contract_status" :value="scope.row.contractStatus" />
</template>
</el-table-column>
</el-table>
<div class="mt-4 flex justify-between items-center">
<pagination
v-show="contractTotal > 0"
:total="contractTotal"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getContractList"
/>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleCancel"></el-button>
<el-button type="primary" @click="confirmContractSelection"></el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="ContractSelectDialog">
import { ref, reactive, toRefs, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { getErpContractInfoList } from '@/api/oa/erp/contractInfo';
import { ContractInfoVO, ContractInfoQuery } from '@/api/oa/erp/contractInfo/types';
const props = defineProps({
visible: {
type: Boolean,
default: false
},
contractCategory: {
type: String,
default: ''
}
});
const emit = defineEmits(['update:visible', 'contract-selected']);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { business_direction, contract_status } = toRefs<any>(
proxy?.useDict('business_direction', 'contract_status')
);
//
const dialogVisible = ref(props.visible);
const selectedContract = ref<ContractInfoVO | null>(null);
const contractList = ref<ContractInfoVO[]>([]);
const contractTotal = ref(0);
const contractLoading = ref(true);
const data = reactive<{ queryParams: ContractInfoQuery }>({
queryParams: {
pageNum: 1,
pageSize: 10,
contractCode: undefined,
contractName: undefined,
contractCategory: undefined,
businessDirection: undefined,
contractStatus: undefined,
flowStatus: undefined,
activeFlag: undefined,
params: {}
}
});
const { queryParams } = toRefs(data);
const queryFormRef = ref<ElFormInstance>();
// visible
watch(() => props.visible, (newVal) => {
dialogVisible.value = newVal;
if (newVal) {
selectedContract.value = null;
queryParams.value.contractCategory = props.contractCategory;
getContractList();
}
});
// dialogVisible
watch(dialogVisible, (newVal) => {
emit('update:visible', newVal);
});
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getContractList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
queryParams.value.contractCategory = props.contractCategory;
handleQuery();
};
/** 查询合同信息列表 */
const getContractList = async () => {
contractLoading.value = true;
console.log(queryParams.value)
const res = await getErpContractInfoList(queryParams.value);
console.log(res)
contractList.value = res.rows;
contractTotal.value = res.total;
contractLoading.value = false;
};
//
const selectContract = (row: ContractInfoVO) => {
selectedContract.value = row;
};
//
const confirmContractSelection = () => {
if (!selectedContract.value) {
ElMessage.warning('请选择一个合同');
return;
}
emit('contract-selected', selectedContract.value);
dialogVisible.value = false;
};
//
const handleCancel = () => {
dialogVisible.value = false;
};
</script>
<style scoped>
/* 可以添加组件特定的样式 */
</style>

@ -0,0 +1,189 @@
<template>
<el-dialog v-model="dialogVisible" title="选择项目" width="880px">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="80px">
<el-form-item label="项目号" prop="projectCode">
<el-input v-model="queryParams.projectCode" placeholder="请输入项目编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="项目状态" prop="projectStatus">
<el-select v-model="queryParams.projectStatus" placeholder="请选择项目状态" clearable>
<el-option v-for="dict in project_status" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-table :data="projectList" border @row-click="selectProject" style="width: 100%" v-loading="projectLoading" highlight-current-row>
<el-table-column prop="projectCode" label="项目号" width="150" />
<el-table-column prop="projectName" label="项目名称" min-width="160" />
<el-table-column prop="businessDirection" label="业务方向" width="120">
<template #default="scope">
<dict-tag :options="business_direction" :value="scope.row.businessDirection" />
</template>
</el-table-column>
<el-table-column prop="contractCode" label="合同编号" width="150" />
<el-table-column prop="contractName" label="合同名称" width="150" />
<el-table-column prop="projectStatus" label="项目状态" width="100">
<template #default="scope">
<dict-tag :options="project_status" :value="scope.row.projectStatus" />
</template>
</el-table-column>
</el-table>
<div class="mt-4 flex justify-between items-center">
<pagination
v-show="projectTotal > 0"
:total="projectTotal"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getProjectList"
/>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleCancel"></el-button>
<el-button type="primary" @click="confirmProjectSelection"></el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="ProjectSelectDialog">
import { ref, reactive, toRefs, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { getErpProjectInfoJoinList } from '@/api/oa/erp/projectInfo';
import { getErpContractInfoList } from '@/api/oa/erp/contractInfo';
import { ProjectInfoVO, ProjectInfoQuery } from '@/api/oa/erp/projectInfo/types';
const props = defineProps({
visible: {
type: Boolean,
default: false
},
projectCategory: {
type: String,
default: ''
}
});
const emit = defineEmits(['update:visible', 'project-selected']);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { business_direction, project_status, project_category } = toRefs<any>(
proxy?.useDict('business_direction', 'project_status', 'project_category')
);
//
const dialogVisible = ref(props.visible);
const selectedProject = ref<ProjectInfoVO | null>(null);
const projectList = ref<ProjectInfoVO[]>([]);
const projectTotal = ref(0);
const projectLoading = ref(true);
const data = reactive<{ queryParams: ProjectInfoQuery }>({
queryParams: {
pageNum: 1,
pageSize: 10,
contractFlag: undefined,
projectCode: undefined,
projectName: undefined,
businessDirection: undefined,
projectCategory: props.projectCategory,
spareFlag: undefined,
projectTypeId: undefined,
paymentMethod: undefined,
deptId: undefined,
managerId: undefined,
chargeId: undefined,
deputyId: undefined,
peopleId: undefined,
amount: undefined,
projectStatus: undefined,
flowStatus: undefined,
sortOrder: undefined,
contractId: undefined,
activeFlag: undefined,
params: {}
}
});
const { queryParams } = toRefs(data);
const queryFormRef = ref<ElFormInstance>();
// visible
watch(() => props.visible, (newVal) => {
dialogVisible.value = newVal;
if (newVal) {
selectedProject.value = null;
queryParams.value.projectCategory = props.projectCategory;
getProjectList();
}
});
// dialogVisible
watch(dialogVisible, (newVal) => {
emit('update:visible', newVal);
});
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getProjectList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
queryParams.value.projectCategory = props.projectCategory;
handleQuery();
};
/** 查询项目信息列表 */
const getProjectList = async () => {
projectLoading.value = true;
console.log(queryParams.value)
const res = await getErpProjectInfoJoinList(queryParams.value);
console.log(res)
projectList.value = res.rows;
projectTotal.value = res.total;
projectLoading.value = false;
};
//
const selectProject = (row: ProjectInfoVO) => {
selectedProject.value = row;
};
//
const confirmProjectSelection = () => {
if (!selectedProject.value) {
ElMessage.warning('请选择一个项目');
return;
}
emit('project-selected', selectedProject.value);
dialogVisible.value = false;
};
//
const handleCancel = () => {
dialogVisible.value = false;
};
</script>
<style scoped>
/* 可以添加组件特定的样式 */
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,357 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width='100px'>
<el-form-item label="分款编号" prop="installmentCode">
<el-input v-model="queryParams.installmentCode" placeholder="请输入分款编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="客户ID关联crm_customer_info" prop="customerId">
<el-input v-model="queryParams.customerId" placeholder="请输入客户ID关联crm_customer_info" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="客户名称,冗余" prop="customerName">
<el-input v-model="queryParams.customerName" placeholder="请输入客户名称,冗余" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="货币类型(CNY/USD/EUR)默认CNY" prop="currency">
<el-input v-model="queryParams.currency" placeholder="请输入货币类型(CNY/USD/EUR)默认CNY" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="回款金额" prop="paymentAmount">
<el-input v-model="queryParams.paymentAmount" placeholder="请输入回款金额" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="回款日期" prop="paymentDate">
<el-date-picker clearable
v-model="queryParams.paymentDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择回款日期"
/>
</el-form-item>
<el-form-item label="发出人员" prop="dispatchUserId">
<el-input v-model="queryParams.dispatchUserId" placeholder="请输入发出人员" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="发出部门" prop="dispatchDeptId">
<el-input v-model="queryParams.dispatchDeptId" placeholder="请输入发出部门" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="发出日期" prop="dispatchDate">
<el-date-picker clearable
v-model="queryParams.dispatchDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择发出日期"
/>
</el-form-item>
<el-form-item label="客户经理" prop="accountManageId">
<el-input v-model="queryParams.accountManageId" placeholder="请输入客户经理" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['oa/erp:finAccountInstallment:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['oa/erp:finAccountInstallment:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['oa/erp:finAccountInstallment:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['oa/erp:finAccountInstallment:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" border :data="finAccountInstallmentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="分款ID" align="center" prop="accountInstallmentId" v-if="columns[0].visible"/>
<el-table-column label="分款编号" align="center" prop="installmentCode" v-if="columns[2].visible"/>
<el-table-column label="客户ID关联crm_customer_info" align="center" prop="customerId" v-if="columns[3].visible"/>
<el-table-column label="客户名称,冗余" align="center" prop="customerName" v-if="columns[4].visible"/>
<el-table-column label="货币类型(CNY/USD/EUR)默认CNY" align="center" prop="currency" v-if="columns[5].visible"/>
<el-table-column label="回款金额" align="center" prop="paymentAmount" v-if="columns[6].visible"/>
<el-table-column label="回款日期" align="center" prop="paymentDate" width="180" v-if="columns[7].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.paymentDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[8].visible"/>
<el-table-column label="发出人员" align="center" prop="dispatchUserId" v-if="columns[9].visible"/>
<el-table-column label="发出部门" align="center" prop="dispatchDeptId" v-if="columns[10].visible"/>
<el-table-column label="发出日期" align="center" prop="dispatchDate" width="180" v-if="columns[11].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.dispatchDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="分款状态" align="center" prop="installmentStatus" v-if="columns[12].visible"/>
<el-table-column label="客户经理" align="center" prop="accountManageId" v-if="columns[13].visible"/>
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['oa/erp:finAccountInstallment:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['oa/erp:finAccountInstallment:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改分款信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="finAccountInstallmentFormRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="分款编号" prop="installmentCode">
<el-input v-model="form.installmentCode" placeholder="请输入分款编号" />
</el-form-item>
<el-form-item label="客户ID关联crm_customer_info" prop="customerId">
<el-input v-model="form.customerId" placeholder="请输入客户ID关联crm_customer_info" />
</el-form-item>
<el-form-item label="客户名称,冗余" prop="customerName">
<el-input v-model="form.customerName" placeholder="请输入客户名称,冗余" />
</el-form-item>
<el-form-item label="货币类型(CNY/USD/EUR)默认CNY" prop="currency">
<el-input v-model="form.currency" placeholder="请输入货币类型(CNY/USD/EUR)默认CNY" />
</el-form-item>
<el-form-item label="回款金额" prop="paymentAmount">
<el-input v-model="form.paymentAmount" placeholder="请输入回款金额" />
</el-form-item>
<el-form-item label="回款日期" prop="paymentDate">
<el-date-picker clearable
v-model="form.paymentDate"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择回款日期">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="发出人员" prop="dispatchUserId">
<el-input v-model="form.dispatchUserId" placeholder="请输入发出人员" />
</el-form-item>
<el-form-item label="发出部门" prop="dispatchDeptId">
<el-input v-model="form.dispatchDeptId" placeholder="请输入发出部门" />
</el-form-item>
<el-form-item label="发出日期" prop="dispatchDate">
<el-date-picker clearable
v-model="form.dispatchDate"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择发出日期">
</el-date-picker>
</el-form-item>
<el-form-item label="客户经理" prop="accountManageId">
<el-input v-model="form.accountManageId" placeholder="请输入客户经理" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="FinAccountInstallment" lang="ts">
import { listFinAccountInstallment, getFinAccountInstallment, delFinAccountInstallment, addFinAccountInstallment, updateFinAccountInstallment } from '@/api/oa/erp/finAccountInstallment';
import { FinAccountInstallmentVO, FinAccountInstallmentQuery, FinAccountInstallmentForm } from '@/api/oa/erp/finAccountInstallment/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const finAccountInstallmentList = ref<FinAccountInstallmentVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const finAccountInstallmentFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `分款ID`, visible: true },
{ key: 1, label: `租户编号`, visible: true },
{ key: 2, label: `分款编号`, visible: true },
{ key: 3, label: `客户ID关联crm_customer_info`, visible: true },
{ key: 4, label: `客户名称,冗余`, visible: true },
{ key: 5, label: `货币类型(CNY/USD/EUR)默认CNY`, visible: true },
{ key: 6, label: `回款金额`, visible: true },
{ key: 7, label: `回款日期`, visible: true },
{ key: 8, label: `备注`, visible: true },
{ key: 9, label: `发出人员`, visible: true },
{ key: 10, label: `发出部门`, visible: true },
{ key: 11, label: `发出日期`, visible: true },
{ key: 12, label: `分款状态`, visible: true },
{ key: 13, label: `客户经理`, visible: true },
{ key: 14, label: `创建部门`, visible: true },
{ key: 15, label: `创建人`, visible: true },
{ key: 16, label: `创建时间`, visible: true },
{ key: 17, label: `更新人`, visible: true },
{ key: 18, label: `更新时间`, visible: true },
]);
const initFormData: FinAccountInstallmentForm = {
accountInstallmentId: undefined,
installmentCode: undefined,
customerId: undefined,
customerName: undefined,
currency: undefined,
paymentAmount: undefined,
paymentDate: undefined,
remark: undefined,
dispatchUserId: undefined,
dispatchDeptId: undefined,
dispatchDate: undefined,
installmentStatus: undefined,
accountManageId: undefined,
}
const data = reactive<PageData<FinAccountInstallmentForm, FinAccountInstallmentQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
installmentCode: undefined,
customerId: undefined,
customerName: undefined,
currency: undefined,
paymentAmount: undefined,
paymentDate: undefined,
dispatchUserId: undefined,
dispatchDeptId: undefined,
dispatchDate: undefined,
installmentStatus: undefined,
accountManageId: undefined,
params: {
}
},
rules: {
accountInstallmentId: [
{ required: true, message: "分款ID不能为空", trigger: "blur" }
],
currency: [
{ required: true, message: "货币类型(CNY/USD/EUR)默认CNY不能为空", trigger: "blur" }
],
installmentStatus: [
{ required: true, message: "分款状态不能为空", trigger: "change" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询分款信息列表 */
const getList = async () => {
loading.value = true;
const res = await listFinAccountInstallment(queryParams.value);
finAccountInstallmentList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
finAccountInstallmentFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: FinAccountInstallmentVO[]) => {
ids.value = selection.map(item => item.accountInstallmentId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加分款信息";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: FinAccountInstallmentVO) => {
reset();
const _accountInstallmentId = row?.accountInstallmentId || ids.value[0]
const res = await getFinAccountInstallment(_accountInstallmentId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改分款信息";
}
/** 提交按钮 */
const submitForm = () => {
finAccountInstallmentFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.accountInstallmentId) {
await updateFinAccountInstallment(form.value).finally(() => buttonLoading.value = false);
} else {
await addFinAccountInstallment(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: FinAccountInstallmentVO) => {
const _accountInstallmentIds = row?.accountInstallmentId || ids.value;
await proxy?.$modal.confirm('是否确认删除分款信息编号为"' + _accountInstallmentIds + '"的数据项?').finally(() => loading.value = false);
await delFinAccountInstallment(_accountInstallmentIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('oa/erp/finAccountInstallment/export', {
...queryParams.value
}, `finAccountInstallment_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>
Loading…
Cancel
Save