123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- /**
- * 功能:
- *
- *
- * @author
- * @date 2015/09/14
- */
- TranferAddEdit = function() {
- /**定义变量**/
- var _this = this;
- /**私有方法**/
- /***新增信息***/
- _this.save = function(){
-
- $form = $('#editForm');
- var valid = $form.validationEngine({returnIsValid: true});
- if(!valid){
- top.Dialog.alert(CHECKREDBOX);
- }
- if(valid){
- var teamPeopNo1 = $("#peopNO").val();//队伍总人数
- var teamPeopNo2 = $("#POPULATION_395").val();//人数输入框填的人数
- /*if(teamPeopNo2 > teamPeopNo1){
- top.Dialog.alert("您输入的人数不能大于队伍总人数!");
- return;
- }*/
- var teamCount = $("#count").val();
- if(teamCount==1){
- showProgressBar("正在提交中...");
- var teamRealName = $("#TEAM_NEAM_395").attr("relText");
- $("#TEAM_REAL_NEAM_395").val(teamRealName);//保存队伍名称的NAME
- var formValue = $(".teamMsgForm").serialize();
- //var url = 'nwyj/ws/crud/CRUDService/create/';
- $("body").eq(0).showLoading();
- $.ajax({
- //url : $.pathname() + '/ws/crud/CRUDService/create/',
- url : $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad",//附件保存
- type : 'post',
- timeout : 15000,
- data : formValue,
- dataType : 'json',
- success : function(result){
- $("body").eq(0).hideLoading();
- top.Dialog.alert("保存成功!");
- if(isWaitDo == 1){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/waitdo/waitDo.html");
- }else{
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/team/allotManage.jsp?pagenumber="+1);
- }
- //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/team/allotManage.jsp?pagenumber="+1);
-
- },
- error : function(e){
- top.Dialog.alert("保存失败");
- }
- });
-
- }else if(teamCount>1){
- for(var i=0;i<teamCount;i++){
- showProgressBar("正在提交中...");
- // var teamRealName = $("form:eq("+i+") #DCV_RANK_395").val();
- // var teamrenNum = $("form:eq("+i+") .teamRealName_0").val();
- // alert(teamrenNum +"********"+ teamRealName)
- var formValue = $("form:eq("+i+")").serialize();
- // $("body").eq(0).showLoading();
-
- $.ajax({
- // url : $.pathname() + '/ws/crud/CRUDService/create/',//保存的共用方法
- url : $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad",//附件保存
- type : 'post',
- timeout : 15000,
- async : false,
- data : formValue,
- dataType : 'json',
- success : function(result){
- //
- },
- error : function(e){
- top.Dialog.alert("保存失败!");
- return;
- }
- });
- }
- top.Dialog.alert("保存成功!");
- if(isWaitDo == 1){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/waitdo/waitDo.html");
- }else{
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/team/allotManage.jsp?pagenumber="+1);
- }
- //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/team/allotManage.jsp?pagenumber="+1);
- }
- }
- };
- return {
- init : function() {
- $('#save').bind('click',function(){
- _this.save();
- });
- $('#cancel').bind('click',function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/team/TeamAddEditTest.jsp?fd_id="+fd_id);
- });
- $('#back').bind('click',function(){
- $(top.document.body).find(".positionTab").eq(1);
- //alert(fd_id == "");
- /*if(fd_id == ""){*/
- if(isWaitDo == 1){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/waitdo/waitDo.html");
- }else{
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/team/allotManage.jsp?pagenumber="+1);
- }
- /*} else {
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/business/em/response/team/demandManage.jsp?pagenumber=');
- }*/
-
- });
- }
- };
- }();
- $(function() {
- TranferAddEdit.init();
- });
|