Commit 03b7abc3 authored by 高滢's avatar 高滢

feat(月度合同): 累计支付数的逻辑

parent f6c798f0
......@@ -94,8 +94,8 @@ export function getBasicColumns(): BasicColumn[] {
width: 200,
},
{
title: '投资金额',
dataIndex: 'investmentAount',
title: '累计支付数',
dataIndex: 'accumulatePayment',
width: 180,
},
{
......
......@@ -170,9 +170,10 @@
name: '合同:' + content.contrcatName,
form: from,
});
console.log('222',content)
setFormData(from[1], content);
setFormData(from[1], {
accumulatePaymentReserve: content.accumulatePayment,
accumulatePaymentReserve: content.accumulatepaymentreserve,
});
}
}
......@@ -204,71 +205,7 @@
async function handleNewDataLastPlan(info: any) {
if (info) {
info.map((i) => {
handleNewLastPlan(i);
});
}
}
/* 往表单page页里带入上月计划的数据*/
async function handleNewLastPlan(info: any) {
let item = {};
let res = tabsFormSchema.filter((item) => item.projectId == info.proId && item.show == true);
if (res.length) {
item = res[0];
let from = useForm(Object.assign({ schemas: subFormSchema }, baseFormConfig) as FormProps);
item.list.push({
show: true,
name: '合同:' + info.contrcatName,
form: from,
contractId: info.contractId,
});
setFormData(from[1], {
contractId: info.contractId,
contrcatName: info.contrcatName,
collectingUnit: info.collectingUnit,
contractAmount: info.contractAmount,
investmentAmount: info.investmentAmount,
paymentLevel: info.paymentLevel,
completionValueActual: info.completionValueActual,
accumulateCompletionValue: info.accumulateCompletionValue,
planCompletionValue: info.planCompletionValue,
lastMonthPlan: info.lastMonthPlan,
accumulatePaymentReserve: info.accumulatePayment,
accumulatePayment: info.accumulatePayment,
});
} else {
item = {
name: '项目:' + info.projectName,
projectId: info.proId,
forceRender: true,
Form: useForm(Object.assign({ schemas: formSchema }, baseFormConfig) as FormProps),
list: [],
show: true,
};
item.list.push({
show: true,
name: '合同:' + info.contrcatName,
form: useForm(Object.assign({ schemas: subFormSchema }, baseFormConfig) as FormProps),
contractId: info.contractId,
});
tabsFormSchema.push(item);
setFormData(item.Form[1], {
proId: info.proId,
projectName: info.projectName,
sourceType: info.fundingSource,
});
setFormData(item.list[0].form[1], {
contractId: info.contractId,
contrcatName: info.contrcatName,
collectingUnit: info.collectingUnit,
contractAmount: info.contractAmount,
investmentAmount: info.investmentAmount,
paymentLevel: info.paymentLevel,
completionValueActual: info.completionValueActual,
accumulateCompletionValue: info.accumulateCompletionValue,
planCompletionValue: info.planCompletionValue,
lastMonthPlan: info.lastMonthPlan,
accumulatePaymentReserve: info.accumulatePayment,
accumulatePayment: info.accumulatePayment,
handleNew(i);
});
}
}
......@@ -281,10 +218,12 @@
}
/* 往表单page页里带入新建合同的数据*/
async function handleNew(info: any) {
console.log('333',info);
let item = {};
let res = tabsFormSchema.filter(
(item) => item.projectId == info.projectId && item.show == true,
);
console.log('5555',tabsFormSchema);
if (res.length) {
item = res[0];
let from = useForm(Object.assign({ schemas: subFormSchema }, baseFormConfig) as FormProps);
......@@ -295,6 +234,7 @@
contractId: info.id,
});
setFormData(from[1], {
contractId: info.id,
contrcatName: info.contrcatName,
collectingUnit: info.collectingUnit,
contractAmount: info.contractAmount,
......@@ -513,6 +453,20 @@
});
console.log('历史记录');
}
function getPreviousMonth(monthYear) {
// 将输入的字符串转换为 Date 对象
let date = new Date(monthYear + '-01');
// 设置日期为当前月份的前一个月
date.setMonth(date.getMonth() - 1);
// 获取年份和月份,并格式化为两位数
let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0');
// 返回格式化的日期字符串
return `${year}-${month}`;
}
</script>
<style scoped>
.subCard {
......
......@@ -174,6 +174,7 @@ export const subFormSchema: FormSchema[] = [
componentProps: ({ formModel}) => ({
addonAfter: '万元',
onChange: (value) => {
console.log(formModel.accumulatePaymentReserve)
formModel.accumulatePayment = (formModel.accumulatePaymentReserve || 0) + value;
},
}),
......
......@@ -372,16 +372,16 @@ export const columns: BasicColumn[] = [
dataIndex: 'fundingSource',
width: 180,
},
{
title: '建设目的及项目功能',
dataIndex: 'constructionPurpose',
width: 180,
},
{
title: '建设规模',
dataIndex: 'constructionScale',
width: 180,
},
// {
// title: '建设目的及项目功能',
// dataIndex: 'constructionPurpose',
// width: 180,
// },
// {
// title: '建设规模',
// dataIndex: 'constructionScale',
// width: 180,
// },
{
title: '上报单位',
dataIndex: 'departmentName',
......
......@@ -999,6 +999,11 @@ export const contractColumns = [
dataIndex: 'investmentAmount',
width: 180,
},
{
title: '累计支付数',
dataIndex: 'accumulatePayment',
width: 180,
},
{
title: '收款单位',
dataIndex: 'collectingUnit',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment