- var ActorRoleIds=$("#AccountingFee_Table .AccountingFee_Edit_ActorRoleId");
- var episodes = $("#AccountingFee_Edit_SetCount").val();
- for(var i=0;i<ActorRoleIds.length;i++){
- var actorLevel =ActorRoleIds.eq(i).parents().siblings().children(".actorLevel").val();
- var ContributionFee=ActorRoleIds.eq(i).parent().siblings().children(".AccountingFee_ContributionFee");alert(ContributionFee.attr("id"));
- if(ActorRoleIds.eq(i).val()!=""){
- if(actorLevel!=undefined){
- $.post("AccountingFee/findContributionFee", { tvpartId:@Model.TVPartId,nature:@Model.Nature,actorLevel: actorLevel, actorRoleId: ActorRoleIds.eq(i).val() }, function (result) {
- if(result !=""){
- var arr = result.split('|');
- if(arr[0] == arr[1]){
- alert(arr[0] == arr[1]);
- ContributionFee.val((parseFloat(arr[0]) * episodes).toFixed(2));
- ContributionFee.addClass("readonly");
- ContributionFee.attr("readonly","true");
- }else{
- alert(ContributionFee.attr("id"));
- ContributionFee.attr("min",parseFloat(arr[0])* episodes); alert(ContributionFee.attr("id"));
- ContributionFee.attr("max",parseFloat(arr[1])* episodes);
- }
- }
- });
- }
- }
- alert(i);
- }
忽略了异步造成的延迟,使得取/赋值值混乱。