|
|
|
|
@ -7,16 +7,16 @@
|
|
|
|
|
<h2>{{ title }}</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="header-right">
|
|
|
|
|
<el-button type="primary" @click="submitForm" :loading="buttonLoading">保存</el-button>
|
|
|
|
|
<el-button @click="resetForm">重置</el-button>
|
|
|
|
|
<!-- <el-button @click="handleCalculate" v-if="formData.id">重新计算</el-button>-->
|
|
|
|
|
<el-button type="primary" @click="submitForm" :loading="buttonLoading" v-if="!isFormDisabled">保存</el-button>
|
|
|
|
|
<el-button @click="resetForm" v-if="!isFormDisabled">重置</el-button>
|
|
|
|
|
<!-- <el-button @click="handleCalculate" v-if="formData.id">重新计算</el-button>-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-divider />
|
|
|
|
|
|
|
|
|
|
<!-- 表单内容 -->
|
|
|
|
|
<el-form ref="receivableFormRef" :model="formData" :rules="formRules" label-width="160px" class="receivable-form">
|
|
|
|
|
<el-form ref="receivableFormRef" :model="formData" :rules="formRules" :disabled="isFormDisabled" label-width="160px" class="receivable-form">
|
|
|
|
|
<!-- 合同信息区域 - 可折叠 -->
|
|
|
|
|
<div class="form-section" v-loading="loading">
|
|
|
|
|
<div class="section-header" @click="toggleSection('contract')">
|
|
|
|
|
@ -39,11 +39,7 @@
|
|
|
|
|
@click="showProjectSelectDialog"
|
|
|
|
|
suffix-icon="Search"
|
|
|
|
|
/>
|
|
|
|
|
<el-input
|
|
|
|
|
v-if="formData.accountReceivableId"
|
|
|
|
|
v-model="formData.projectCode"
|
|
|
|
|
readonly
|
|
|
|
|
/>
|
|
|
|
|
<el-input v-if="formData.accountReceivableId" v-model="formData.projectCode" readonly />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
@ -61,12 +57,7 @@
|
|
|
|
|
@click="showContractSelectDialog"
|
|
|
|
|
suffix-icon="Search"
|
|
|
|
|
/>
|
|
|
|
|
<el-input
|
|
|
|
|
v-else
|
|
|
|
|
v-model="formData.contractCode"
|
|
|
|
|
readonly
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<el-input v-else v-model="formData.contractCode" readonly />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
@ -75,8 +66,8 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="签单月份" prop="contractMonth">
|
|
|
|
|
<el-date-picker v-model="formData.contractMonth" type="month" readonly style="width: 100%" format="YYYY-MM" />
|
|
|
|
|
<el-form-item label="签单月份" prop="contractDate">
|
|
|
|
|
<el-date-picker v-model="formData.contractDate" type="month" readonly style="width: 100%" format="YYYY-MM" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
@ -95,13 +86,13 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="客户名称" prop="customerName">
|
|
|
|
|
<el-input v-model="formData.customerName" readonly />
|
|
|
|
|
<el-form-item label="客户名称" prop="oneCustomerName">
|
|
|
|
|
<el-input v-model="formData.oneCustomerName" readonly />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="签订主体" prop="contractingEntity">
|
|
|
|
|
<el-input v-model="formData.contractingEntity" readonly />
|
|
|
|
|
<el-form-item label="签订主体" prop="twoCustomerName">
|
|
|
|
|
<el-input v-model="formData.twoCustomerName" readonly />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
@ -115,18 +106,18 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="客户经理" prop="customerManager">
|
|
|
|
|
<el-input v-model="formData.customerManager" readonly />
|
|
|
|
|
<el-form-item label="客户经理" prop="managerName">
|
|
|
|
|
<el-input v-model="formData.managerName" readonly />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="软控-订单号" prop="mesnacOrderNo">
|
|
|
|
|
<el-input v-model="formData.mesnacOrderNo" />
|
|
|
|
|
<el-input v-model="formData.mesnacOrderNo" readonly />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="软控-项目号" prop="mesnacProjectCode">
|
|
|
|
|
<el-input v-model="formData.mesnacProjectCode" />
|
|
|
|
|
<el-input v-model="formData.mesnacProjectCode" readonly />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
@ -315,8 +306,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="6" v-if="finAccountReceivableStage.paymentStageId === PAYMENT_STAGE_ID.WARRANTY">
|
|
|
|
|
<el-form-item label="质保条款" prop="paymentDeadline" label-width="90px">
|
|
|
|
|
<el-input v-model="finAccountReceivableStage.paymentDeadline" placeholder="质保条款" readonly>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input v-model="finAccountReceivableStage.paymentDeadline" placeholder="质保条款" readonly> </el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
@ -334,17 +324,16 @@
|
|
|
|
|
<!-- 基准日期字段 - 根据节点类型显示不同标签 -->
|
|
|
|
|
<el-col :span="6" v-if="finAccountReceivableStage.paymentStageId === PAYMENT_STAGE_ID.DELIVERY">
|
|
|
|
|
<el-form-item label="合同交货期" prop="stageRequiredDate" label-width="90px">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="finAccountReceivableStage.stageRequiredDate"
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/>
|
|
|
|
|
<el-date-picker v-model="finAccountReceivableStage.stageRequiredDate" type="date" placeholder="选择日期" style="width: 100%" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="6" v-if="getStageConfig(finAccountReceivableStage.paymentStageId).showStageRealDate">
|
|
|
|
|
<el-form-item :label="getStageConfig(finAccountReceivableStage.paymentStageId).stageRealDateLabel" prop="stageRealDate" label-width="90px">
|
|
|
|
|
<el-form-item
|
|
|
|
|
:label="getStageConfig(finAccountReceivableStage.paymentStageId).stageRealDateLabel"
|
|
|
|
|
prop="stageRealDate"
|
|
|
|
|
label-width="90px"
|
|
|
|
|
>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="finAccountReceivableStage.stageRealDate"
|
|
|
|
|
type="date"
|
|
|
|
|
@ -355,7 +344,6 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 到期日显示 -->
|
|
|
|
|
<el-col :span="6" v-if="finAccountReceivableStage.paymentStageId !== PAYMENT_STAGE_ID.WARRANTY">
|
|
|
|
|
<el-form-item label="到期日" prop="dueDate" label-width="90px">
|
|
|
|
|
@ -635,7 +623,6 @@
|
|
|
|
|
|
|
|
|
|
<!-- 合同选择弹窗组件 -->
|
|
|
|
|
<ContractSelectDialog v-model:visible="contractSelectDialogVisible" @contract-selected="handleContractSelected" />
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -675,9 +662,9 @@ const buttonLoading = ref(false);
|
|
|
|
|
const title = ref('新增应收款项目');
|
|
|
|
|
|
|
|
|
|
const CONTRACT_FLAG = {
|
|
|
|
|
YES:'1',
|
|
|
|
|
NO:'2'
|
|
|
|
|
}
|
|
|
|
|
YES: '1',
|
|
|
|
|
NO: '2'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 折叠面板状态
|
|
|
|
|
const collapsed = ref({
|
|
|
|
|
@ -703,6 +690,10 @@ const PAYMENT_STAGE_ID = {
|
|
|
|
|
WARRANTY: 8 // 质保
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const isFormDisabled = computed(() => {
|
|
|
|
|
return routeParams.value.type === 'view' || routeParams.value.type === 'approval';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const finAccountReceivableStageList = ref<FinAccountReceivableStageVO[]>([]);
|
|
|
|
|
|
|
|
|
|
// 项目选择弹窗相关
|
|
|
|
|
@ -714,34 +705,42 @@ const showProjectSelectDialog = () => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 处理项目选择
|
|
|
|
|
const handleProjectSelected = (project: any) => {
|
|
|
|
|
const handleProjectSelected = (result: any) => {
|
|
|
|
|
const project = result.project;
|
|
|
|
|
const erpContractInfoList = project.erpContractInfoVoList;
|
|
|
|
|
let totalPrice = project.amount;
|
|
|
|
|
if (erpContractInfoList && erpContractInfoList.length > 1) {
|
|
|
|
|
totalPrice = result.contract?.totalPrice;
|
|
|
|
|
}
|
|
|
|
|
console.log(result.project);
|
|
|
|
|
console.log(result.contract)
|
|
|
|
|
Object.assign(formData.value, {
|
|
|
|
|
contractId: project.contractId,
|
|
|
|
|
contractFlag: project.contractFlag,
|
|
|
|
|
projectId: project.projectId,
|
|
|
|
|
projectName: project.projectName,
|
|
|
|
|
projectCode: project.projectCode,
|
|
|
|
|
contractCode: project.contractCode,
|
|
|
|
|
contractName: project.contractName,
|
|
|
|
|
contractMonth: project.contractDate,
|
|
|
|
|
contractDate: project.contractDate,
|
|
|
|
|
externalContractCode: project.externalContractCode,
|
|
|
|
|
internalContractCode: project.internalContractCode,
|
|
|
|
|
customerName: project.customerName,
|
|
|
|
|
contractingEntity: project.contractingEntity,
|
|
|
|
|
businessDirection: project.businessDirection,
|
|
|
|
|
customerManager: project.customerManager,
|
|
|
|
|
deptName: project.deptName,
|
|
|
|
|
orderContractCode: project.orderContractCode,
|
|
|
|
|
managerName: project.managerName,
|
|
|
|
|
projectStatus: project.projectStatus,
|
|
|
|
|
totalPrice: project.totalPrice,
|
|
|
|
|
totalPriceHighway: project.totalPrice,
|
|
|
|
|
totalPriceOri: project.totalPrice
|
|
|
|
|
contractId: result.contract?.contractId,
|
|
|
|
|
contractCode: result.contract?.contractCode,
|
|
|
|
|
contractName: result.contract?.contractName,
|
|
|
|
|
contractDate: result.contract?.contractDate,
|
|
|
|
|
externalContractCode: result.contract?.externalContractCode,
|
|
|
|
|
internalContractCode: result.contract?.internalContractCode,
|
|
|
|
|
oneCustomerName: result.contract?.oneCustomerName,
|
|
|
|
|
twoCustomerName: result.contract?.twoCustomerName,
|
|
|
|
|
businessDirection: result.contract?.businessDirection,
|
|
|
|
|
orderContractCode: project.projectCode,
|
|
|
|
|
mesnacOrderNo: result.contract?.orderContractCode,
|
|
|
|
|
mesnacProjectCode: result.contract?.projectContractCode,
|
|
|
|
|
totalPrice: totalPrice,
|
|
|
|
|
totalPriceHighway: totalPrice,
|
|
|
|
|
totalPriceOri: totalPrice
|
|
|
|
|
});
|
|
|
|
|
getErpFinAccountReceivableStages();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 合同选择弹窗相关
|
|
|
|
|
const contractSelectDialogVisible = ref(false);
|
|
|
|
|
|
|
|
|
|
@ -756,24 +755,18 @@ const handleContractSelected = (contract: any) => {
|
|
|
|
|
contractId: contract.contractId,
|
|
|
|
|
contractCode: contract.contractCode,
|
|
|
|
|
contractName: contract.contractName,
|
|
|
|
|
contractMonth: contract.contractDate,
|
|
|
|
|
contractDate: contract.contractDate,
|
|
|
|
|
externalContractCode: contract.externalContractCode,
|
|
|
|
|
internalContractCode: contract.internalContractCode,
|
|
|
|
|
// customerName: contract.customerName,
|
|
|
|
|
// contractingEntity: project.contractingEntity,
|
|
|
|
|
oneCustomerName: contract.oneCustomerName,
|
|
|
|
|
twoCustomerName: contract.twoCustomerName,
|
|
|
|
|
businessDirection: contract.businessDirection,
|
|
|
|
|
// customerManager: project.customerManager,
|
|
|
|
|
// deptName: project.deptName,
|
|
|
|
|
orderContractCode: contract.orderContractCode,
|
|
|
|
|
totalPrice: contract.totalPrice,
|
|
|
|
|
totalPriceHighway: contract.totalPrice,
|
|
|
|
|
totalPriceOri: contract.totalPrice,
|
|
|
|
|
mesnacOrderNo: contract.orderContractCode,
|
|
|
|
|
mesnacProjectCode: contract.projectContractCode,
|
|
|
|
|
});
|
|
|
|
|
getErpFinAccountReceivableStages();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 新增时查询应收款节点信息列表 */
|
|
|
|
|
const getErpFinAccountReceivableStages = async () => {
|
|
|
|
|
if (formData.value.contractId && formData.value.contractId !== '') {
|
|
|
|
|
@ -800,6 +793,7 @@ const initializeStageCalculations = () => {
|
|
|
|
|
stage.receivedAmount = '0';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stage.paymentAmount = formData.value.totalPrice*stage.paymentPercentage/100;
|
|
|
|
|
// 根据节点类型初始化相应字段
|
|
|
|
|
switch (stage.paymentStageId) {
|
|
|
|
|
case PAYMENT_STAGE_ID.WARRANTY:
|
|
|
|
|
@ -968,8 +962,7 @@ const agingData = computed(() => {
|
|
|
|
|
baseDate: getBaseDateForAging(stage),
|
|
|
|
|
aging: calculateStageAging(stage),
|
|
|
|
|
paymentStageId: stage.paymentStageId
|
|
|
|
|
}))
|
|
|
|
|
.filter((item) => item.owedAmount > 0); // 只显示有欠款的节点
|
|
|
|
|
})); // 只显示有欠款的节点
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 平均账龄
|
|
|
|
|
@ -1310,18 +1303,17 @@ const formData = ref<any>({
|
|
|
|
|
projectCode: '',
|
|
|
|
|
projectCategory: '',
|
|
|
|
|
projectType: '',
|
|
|
|
|
contractMonth: '',
|
|
|
|
|
contractDate: '',
|
|
|
|
|
externalContractCode: '',
|
|
|
|
|
internalContractCode: '',
|
|
|
|
|
generalContractor: '',
|
|
|
|
|
customerAbbreviation: '',
|
|
|
|
|
contractParties: '',
|
|
|
|
|
customerName: '',
|
|
|
|
|
contractingEntity: '',
|
|
|
|
|
oneCustomerName: '',
|
|
|
|
|
twoCustomerName: '',
|
|
|
|
|
businessDirection: '',
|
|
|
|
|
deptName: '',
|
|
|
|
|
customerManager: '',
|
|
|
|
|
managerName: '',
|
|
|
|
|
mesnacOrderNo: '',
|
|
|
|
|
mesnacProjectCode: '',
|
|
|
|
|
orderContractCode: '',
|
|
|
|
|
@ -1385,10 +1377,8 @@ const paymentRate = computed(() => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const paymentDescription = computed(() => {
|
|
|
|
|
return finAccountReceivableStageList.value
|
|
|
|
|
.map(item => `${item.paymentDescription}。`)
|
|
|
|
|
.join('\n') // 使用换行符连接
|
|
|
|
|
})
|
|
|
|
|
return finAccountReceivableStageList.value.map((item) => `${item.paymentDescription}。`).join('\n'); // 使用换行符连接
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 方法
|
|
|
|
|
const toggleSection = (section: string) => {
|
|
|
|
|
@ -1419,18 +1409,17 @@ const resetForm = () => {
|
|
|
|
|
projectCode: '',
|
|
|
|
|
projectCategory: '',
|
|
|
|
|
projectType: '',
|
|
|
|
|
contractMonth: '',
|
|
|
|
|
contractDate: '',
|
|
|
|
|
externalContractCode: '',
|
|
|
|
|
internalContractCode: '',
|
|
|
|
|
generalContractor: '',
|
|
|
|
|
customerAbbreviation: '',
|
|
|
|
|
contractParties: '',
|
|
|
|
|
customerName: '',
|
|
|
|
|
contractingEntity: '',
|
|
|
|
|
oneCustomerName: '',
|
|
|
|
|
twoCustomerName: '',
|
|
|
|
|
businessDirection: '',
|
|
|
|
|
deptName: '',
|
|
|
|
|
customerManager: '',
|
|
|
|
|
managerName: '',
|
|
|
|
|
mesnacOrderNo: '',
|
|
|
|
|
mesnacProjectCode: '',
|
|
|
|
|
orderContractCode: '',
|
|
|
|
|
@ -1461,18 +1450,17 @@ const loadData = async (accountReceivableId: string) => {
|
|
|
|
|
stageLoading.value = true;
|
|
|
|
|
try {
|
|
|
|
|
const res = await getFinAccountReceivable(accountReceivableId);
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
console.log(res.data);
|
|
|
|
|
const erpProjectInfo = res.data.erpProjectInfoVo;
|
|
|
|
|
Object.assign(formData.value, res.data, erpProjectInfo);
|
|
|
|
|
const erpContractInfo = res.data.erpContractInfoVo;
|
|
|
|
|
console.log("--")
|
|
|
|
|
Object.assign(formData.value, res.data, erpProjectInfo,erpContractInfo);
|
|
|
|
|
Object.assign(formData.value, {
|
|
|
|
|
projectCategory: res.data.projectCategory,
|
|
|
|
|
oneCustomerName: res.data.oneCustomerName,
|
|
|
|
|
twoCustomerName: res.data.twoCustomerName,
|
|
|
|
|
managerName: res.data.managerName,
|
|
|
|
|
remark: res.data.remark,
|
|
|
|
|
contractMonth: erpProjectInfo.contractDate,
|
|
|
|
|
orderContractCode: erpProjectInfo.orderContractCode,
|
|
|
|
|
totalPrice: erpProjectInfo.totalPrice,
|
|
|
|
|
totalPriceHighway: erpProjectInfo.totalPrice,
|
|
|
|
|
totalPriceOri: erpProjectInfo.totalPrice,
|
|
|
|
|
paymentMethod: erpProjectInfo.paymentMethod
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await getEditErpFinAccountReceivableStages();
|
|
|
|
|
@ -1496,7 +1484,7 @@ const submitForm = () => {
|
|
|
|
|
finAccountReceivableStageList: finAccountReceivableStageList.value
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
console.log(finAccountReceivableForm)
|
|
|
|
|
console.log(finAccountReceivableForm);
|
|
|
|
|
if (formData.value.accountReceivableId) {
|
|
|
|
|
await updateFinAccountReceivable(finAccountReceivableForm);
|
|
|
|
|
} else {
|
|
|
|
|
|