From 23c312e6589e5cf9f27cd5b3ee9e2abddbe2c880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A3=AE?= Date: Fri, 28 Jun 2024 15:10:26 +0800 Subject: [PATCH] =?UTF-8?q?commit=201.=20=E9=A1=B9=E7=9B=AE=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6-=E7=BB=AD=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/project_list_inherit.html | 63 +++++++++++++++++-- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/application/pjt_mgnt/templates/project_list_inherit.html b/application/pjt_mgnt/templates/project_list_inherit.html index cde7b5a..87b554b 100644 --- a/application/pjt_mgnt/templates/project_list_inherit.html +++ b/application/pjt_mgnt/templates/project_list_inherit.html @@ -523,11 +523,8 @@ name="supply_party">
- - + +
@@ -841,6 +838,23 @@ document.getElementById(`${formId}CooperationParty`).value = data.cooperation_party; document.getElementById(`${formId}ServicePeriod`).value = data.service_period; } else if (primary_department === '星海') { + // 根据项目类型显示相应字段 + updateFieldsVisibility(); + + // 设置字段值 + document.getElementById(`${formId}CapitalDemandParty`).value = data.capital_demand_party; + document.getElementById(`${formId}CapitalProvider`).value = data.capital_provider; + document.getElementById(`${formId}FinancingMethod`).value = data.financing_method; + document.getElementById(`${formId}TargetAmount`).value = data.target_amount; + document.getElementById(`${formId}Term`).value = data.term; + document.getElementById(`${formId}NominalRate`).value = data.nominal_rate; + document.getElementById(`${formId}TotalCost`).value = data.total_cost; + document.getElementById(`${formId}TradeType`).value = data.trade_type; + document.getElementById(`${formId}TradeEntity`).value = data.trade_entity; + document.getElementById(`${formId}TradeServiceProvider`).value = data.trade_service_provider; + document.getElementById(`${formId}TradeVariety`).value = data.trade_variety; + document.getElementById(`${formId}DemandParty`).value = data.demand_party; + document.getElementById(`${formId}SupplyParty`).value = data.supply_party; } @@ -903,6 +917,45 @@ .catch(error => console.error('Error fetching continued details:', error)); } + function updateFieldsVisibility() { + const projectType = document.getElementById('childProjectLedgerDFormProjectType').value; + const allFields = [ + 'capitalDemandPartyContainer', 'capitalProviderContainer', 'financingMethodContainer', + 'targetAmountContainer', 'termContainer', 'nominalRateContainer', 'totalCostContainer', + 'tradeTypeContainer', 'tradeEntityContainer', 'tradeServiceProviderContainer', + 'tradeVarietyContainer', 'demandPartyContainer', 'supplyPartyContainer' + ]; + + // 隐藏所有字段 + allFields.forEach(field => { + document.getElementById(field).style.display = 'none'; + }); + + // 根据项目类型显示相应字段 + if (projectType === '非标') { + ['capitalDemandPartyContainer', 'capitalProviderContainer', 'financingMethodContainer', + 'targetAmountContainer', 'termContainer', 'nominalRateContainer', 'totalCostContainer' + ].forEach(field => { + document.getElementById(field).style.display = 'block'; + }); + } else if (projectType === '贸易') { + ['tradeTypeContainer', 'tradeEntityContainer', 'tradeServiceProviderContainer', + 'targetAmountContainer', 'tradeVarietyContainer' + ].forEach(field => { + document.getElementById(field).style.display = 'block'; + }); + } else if (projectType === '其他') { + ['demandPartyContainer', 'supplyPartyContainer'].forEach(field => { + document.getElementById(field).style.display = 'block'; + }); + } + } + + document.addEventListener('DOMContentLoaded', function () { + const projectTypeField = document.getElementById('childProjectLedgerDFormProjectType'); + projectTypeField.addEventListener('change', updateFieldsVisibility); +}); + window.showTotalModal = showTotalModal; window.showRepayModal = showRepayModal; window.showAlert = showAlert;