diff --git a/Application/Admin/View/AggregateRelation/edit.html b/Application/Admin/View/AggregateRelation/edit.html index 96a3a7a87..eddd8017f 100644 --- a/Application/Admin/View/AggregateRelation/edit.html +++ b/Application/Admin/View/AggregateRelation/edit.html @@ -296,6 +296,52 @@ $(function(){ } return companyinfostr; } + $("#collection").on("change",function() { + var get_collection = $(this).find("option:selected").val(); + var companyinfo; + + if (get_collection == 1) { + companyinfo = first_company; + } else if (get_collection == 2) { + companyinfo = second_company; + } + setAggregateInfo(companyinfo.invoice_item,companyinfo.withdraw_type,companyinfo.invoice_type,get_collection); + }); + function setAggregateInfo(invoice_content,settlement_type,invoice_type,collection) { + var get_collection = $("#collection").find("option:selected").val(); + if (collection == get_collection) { + + + $('.invoice_content').val(invoice_content); + $('#invoice_content').val(invoice_content); + + $('#settlement_type').find("option").each(function() { + $(this).removeAttr("selected"); + }); + // if (!settlement_type) { + // $('#settlement_type').removeAttr("disabled"); + // } else { + // $('#settlement_type').prop("disabled",true); + // } + $('#invoice_type').find("option").each(function() { + $(this).removeAttr("selected"); + }); + + // if (!invoice_type) { + // $('#invoice_type').removeAttr("disabled"); + // } else { + // $('#invoice_type').prop("disabled",true); + // } + $("#settlement_type").find("option[value="+settlement_type+"]").prop("selected",true); + + $("#invoice_type").find("option[value="+invoice_type+"]").prop("selected",true); + $("#settlement_type").change(); + $("#invoice_type").change(); + + } + + } + });