(function () { var urlParams=Utils.url2hash(); var tgId=urlParams.id; var apply_type=urlParams.tg_type; //申请类型 $(function () { if(tgId){ getInfo(tgId,function (data) { init(data); }); }else{ init(); } }); function init(info) { if(info){ apply_type=info.apply_type; } if(!tgId||(info&&info.apply_status==2)){//添加或审核不通过,显示提交按钮 $("#TgApplbutWrap").show(); } setFormTab(info); //buildFjList(info); if(apply_type==3&&!info){ $("#fj_list .listborder:last-child").find('.xuzhi').addClass('must'); $("#fj_list .listborder:last-child .file_name").attr('required',true); $("#file_one_36,#file_one_33").parents('.listborder').find('.xuzhi').addClass('must'); $("#file_one_36,#file_one_33").parents('.listborder').find('.file_name').attr('required',true); } if(apply_type==3&&typeof info!='undefined'){ if(typeof info.hoster_type!='undefined'&&info.hoster_type==2){ var txts=[["法人身份证正面照片","法人身份证反面照片"],["权属人身份证正面照片","权属人身份证反面照片"]]; //$(".poster").eq(2).hide(); $(".poster").eq(2).find('.xuzhi').removeClass('must'); $(".poster .file_name").eq(2).attr('required',false); var txt=txts[1]; $(".poster .txt").eq(0).html(txt[0]); $(".poster .txt").eq(1).html(txt[1]); $(".poster").eq(0).find(".file_name").attr('data-fname',txt[0]); $(".poster").eq(1).find(".file_name").attr('data-fname',txt[1]); $("#fj_list .listborder:last-child").find('.must').removeClass('must'); $("#fj_list .listborder:last-child .file_name").attr('required',false); $("#buscode").find('i').remove(); $("#natural_name_label").append('*'); $("#file_one_36,#file_one_33").parents('.listborder').find('.xuzhi').removeClass('must'); $("#file_one_36,#file_one_33").parents('.listborder').find('.file_name').attr('required',false); } } if(apply_type==4&&typeof info!='undefined'){ if(typeof info.hoster_type!='undefined'&&info.hoster_type==2){ var txts=[["法人身份证正面照片","法人身份证反面照片"],["权属人身份证正面照片","权属人身份证反面照片"]]; //$(".poster").eq(2).hide(); $(".poster").eq(2).find('.xuzhi').removeClass('must'); $(".poster .file_name").eq(2).attr('required',false); var txt=txts[1]; $(".poster .txt").eq(0).html(txt[0]); $(".poster .txt").eq(1).html(txt[1]); $(".poster").eq(0).find(".file_name").attr('data-fname',txt[0]); $(".poster").eq(1).find(".file_name").attr('data-fname',txt[1]); $("#fj_list .listborder").eq(7).find('.must').removeClass('must'); $("#fj_list .listborder").eq(7).find(".file_name").attr('required',false); $("#buscode").find('i').remove(); $(".person").append('*'); $(".org i").remove(); // $("#file_one_34,#file_one_37").parents('.listborder').find('.xuzhi').removeClass('must'); //$("#file_one_34,#file_one_37").parents('.listborder').find('.file_name').attr('required',false); } } bindFileUpload(); var TgApplbutEl=$("#TgApplbut"); TgApplbutEl.click(function (e) { e.preventDefault(); if(tgId&&apply_type==1){ toReUploadFile(); }else{ goTgApply(); } }); TgApplbutEl.attr('disabled',false); } function setFormTab(info) { var tgApplyFormEl=$("#tgapply_form"); var formTitle=''; var owner_role='托管方'; var hoster_reason_json=[ {key: "1",name:"资产背书"}, {key: "2",name:"协议转让"}, {key: "3",name:"资产拍卖"}, ]; var capital_type_json=[]; var tg_type_json=[]; if(apply_type==1){ formTitle='文化'; capital_type_json=[ {key: "10",name:"媒体"}, {key:"20",name:"音乐"}, {key:"30",name:"影视"}, {key:"40",name:"文旅"}, {key:"50",name:"动漫"}, {key:"60",name:"IP"}, {key:"0",name:"其他"}, ]; tgApplyFormEl.find('.tgtype2').remove(); tgApplyFormEl.find('.tgtype3').remove(); $("#base_info").attr('rowspan',11); $("#hoster_type").change(function(){ var htype=$("#hoster_type").val(); if(htype==1){ $("#buscode,").append('*'); $("#natural_name_label").find('i').remove(); $("#fj_list .listborder:last-child").find('.xuzhi').addClass('must'); $("#fj_list .listborder:last-child .file_name").attr('required',true); }else{ $("#fj_list .listborder:last-child").find('.must').removeClass('must'); $("#fj_list .listborder:last-child .file_name").attr('required',false); $("#buscode").find('i').remove(); $("#natural_name_label").append('*'); } }); }else if(apply_type==2){ formTitle='艺术品'; capital_type_json=[ {key:'70',name:'古旧艺术品'}, {key:'80',name:'民间工艺品'}, {key:'90',name:'当代艺术品'}, {key:'99',name:'当代工艺美术品'}, ]; tg_type_json=[ {key:'1',name:'托管申请'}, {key:'2',name:'拍卖申请'} ]; tgApplyFormEl.find('.tgtype1').remove(); tgApplyFormEl.find('.tgtype3').remove(); $("#buscode,#legperson").append('*'); $("#hoster_type").change(function(){ var htype=$("#hoster_type").val(); if(htype==1){ $("#buscode,#legperson").append('*'); $("#natural_name_label,#cardno").find('i').remove(); }else{ $("#buscode,#legperson").find('i').remove(); $("#natural_name_label,#cardno").append('*'); } }); }else if(apply_type==3){ formTitle='古建'; owner_role='权属方'; capital_type_json=[ {key:'5',name:'构件类'}, {key:'15',name:'在建类'}, {key:'35',name:'仿古类'}, {key:'45',name:'产权类'}, {key:'55',name:'现存独立古建'}, ]; hoster_reason_jsons=[ [ {key: "4",name:"资产托管"}, {key: "5",name:"资产管理"}, {key: "7",name:"资产转让"}, {key: "6",name:"资产利用"}, ] ]; var hoster_type=1; hoster_reason_json=hoster_reason_jsons[0]; $("#capital_type").change(function(){ var val=$("#capital_type option:selected").val(); hoster_reason_json=hoster_reason_jsons[0]; if(val==15||val==45){ hoster_reason_json=hoster_reason_jsons[1]; } $("#hoster_reason").html(""); hoster_reason_json.forEach(function (item,key) { $("#hoster_reason").append(''); }); }); $("#hoster_type").change(function(){ var htype=$("#hoster_type").val(); if(htype==1){ $("#fj_list .listborder:last-child").find('.xuzhi').addClass('must'); $("#fj_list .listborder:last-child .file_name").attr('required',true); $("#file_one_36,#file_one_33").parents('.listborder').find('.xuzhi').addClass('must'); $("#file_one_36,#file_one_33").parents('.listborder').find('.file_name').attr('required',true); $(".org").append('*'); $(".person i").remove(); }else{ $("#fj_list .listborder:last-child").find('.must').removeClass('must'); $("#fj_list .listborder:last-child .file_name").attr('required',false); $(".person").append('*'); $(".org i").remove(); $("#file_one_36,#file_one_33").parents('.listborder').find('.xuzhi').removeClass('must'); $("#file_one_36,#file_one_33").parents('.listborder').find('.file_name').attr('required',false); } hoster_reason_json=hoster_reason_jsons[0]; $("#hoster_reason").find("option").remove(); hoster_reason_json.forEach(function (item,key) { $("#hoster_reason").append(''); }); }); $("#natural_name_label").text('权属方姓名'); //$("#legal_tel").closest('tr').show(); $("#base_info").attr('rowspan',11); tgApplyFormEl.find('.tgtype1').remove(); }else if(apply_type==4){ formTitle='乡村振兴'; owner_role='权属方'; capital_type_json=[ {key:'5',name:'构件类'}, {key:'15',name:'在建类'}, {key:'35',name:'仿古类'}, {key:'45',name:'产权类'}, {key:'55',name:'现存独立古建'}, ]; $("#hoster_type").change(function(){ var htype=$("#hoster_type").val(); if(htype==1){ $(".org").append('*'); $(".person i").remove(); }else{ $(".person").append('*'); $(".org i").remove(); } }); $("#natural_name_label").text('权属方姓名'); $("#base_info").attr('rowspan',11); tgApplyFormEl.find('.tgtype1').remove(); } $("#form_title").text(formTitle); $(".owner_role").text(owner_role); if(apply_type==1||apply_type==3){ hoster_reason_json.forEach(function (item,key) { $("#hoster_reason").append(''); }); } capital_type_json.forEach(function (item,key) { if(apply_type==2){ // $("#capital_type").append('  '+item.name); }else{ $("#capital_type").append('') } }); tg_type_json.forEach(function (item,key) { $("#tg_type").append('  '+item.name); }); if(apply_type==3){ var childs={"5":{"A11":"A\u7c7b \u6784\u4ef6\u7c7b\u6807\u7684 A-1 \u539f\u6001\u6784\u4ef6 A-1-1 \u539f\u6001\u6574\u4f53\u6784\u4ef6","A12":"A\u7c7b \u6784\u4ef6\u7c7b\u6807\u7684 A-1 \u539f\u6001\u6784\u4ef6 A-1-2 \u539f\u6001\u6563\u843d\u6784\u4ef6","A21":"A\u7c7b \u6784\u4ef6\u7c7b\u6807\u7684 A-2 \u5efa\u6210\u590d\u5efa\u7c7b\u53e4\u5efa A-2-1 \u5f02\u5730\u8fc1\u5efa\u4fee\u590d\u53e4\u5efa","A22":"A\u7c7b \u6784\u4ef6\u7c7b\u6807\u7684 A-2 \u5efa\u6210\u590d\u5efa\u7c7b\u53e4\u5efa A-2-2 \u62fc\u5efa\u6539\u9020\u53e4\u5efa","A23":"A\u7c7b \u6784\u4ef6\u7c7b\u6807\u7684 A-2 \u5efa\u6210\u590d\u5efa\u7c7b\u53e4\u5efa A-2-3 \u5d4c\u5165\u5f0f\u6539\u9020\u53e4\u5efa","A24":"A\u7c7b \u6784\u4ef6\u7c7b\u6807\u7684 A-2 \u5efa\u6210\u590d\u5efa\u7c7b\u53e4\u5efa A-2-4 \u56ed\u6797\u690d\u5165\u5f0f\u6539\u9020\u53e4\u5efa","A3":"A\u7c7b \u6784\u4ef6\u7c7b\u6807\u7684 A-3 \u9644\u52a0\u4ea7\u4e1a\u76c8\u5229\u6a21\u5f0f\u53e4\u5efa"},"15":{"B1":"B\u7c7b \u5728\u5efa\u7c7b\u53e4\u5efa\u6807\u7684 B-1 \u6574\u4f53\u6027\u53e4\u6751\u3001\u53e4\u9547\u3001\u53e4\u8857\u533a\u8d44\u4ea7","B2":"B\u7c7b \u5728\u5efa\u7c7b\u53e4\u5efa\u6807\u7684 B-2 \u72ec\u7acb\u53e4\u5efa"},"35":{"C1":"C\u7c7b \u4eff\u53e4\u7c7b\u53e4\u5efa\u6807\u7684 C-1 \u6574\u4f53\u8d44\u4ea7","C2":"C\u7c7b \u4eff\u53e4\u7c7b\u53e4\u5efa\u6807\u7684 C-2 \u72ec\u7acb\u4ea7\u6743"},"45":{"D11":"D\u7c7b \u4ea7\u6743\u7c7b\u53e4\u5efa\u6807\u7684 D-1 \u6240\u6709\u6743 D-1-1 \u57ce\u9547\u6240\u6709\u6743\u5f62\u5f0f","D12":"D\u7c7b \u4ea7\u6743\u7c7b\u53e4\u5efa\u6807\u7684 D-1 \u6240\u6709\u6743 D-1-2 \u4e61\u6751\u5b85\u57fa\u5730\u5f62\u5f0f","D21":"D\u7c7b \u4ea7\u6743\u7c7b\u53e4\u5efa\u6807\u7684 D-2 \u7ecf\u8425\u6743 D-2-1 \u79df\u8d41\u6743","D22":"D\u7c7b \u4ea7\u6743\u7c7b\u53e4\u5efa\u6807\u7684 D-2 \u7ecf\u8425\u6743 D-2-2 \u6536\u76ca\u6743","D23":"D\u7c7b \u4ea7\u6743\u7c7b\u53e4\u5efa\u6807\u7684 D-2 \u7ecf\u8425\u6743 D-2-3 \u7269\u4e1a\u4ea7\u6743\u5f62\u6001\uff1a\u4f4f\u5b85\u3001\u5546 \u4e1a"}}; var child=childs[5]; $.each(child, function (key, item) { $("#capital_child").append(''); }); $("#capital_type").change(function(){ var index=$("#capital_type option:selected").val(); $("#capital_child").html(""); var child=childs[index]; $.each(child, function (key, item) { $("#capital_child").append(''); }); }); } if(apply_type==4){ var childs={ "B11":"B-1资产资源类 B-1-1宅基地", "B12":"B-1资产资源类 B-1-2集体建设用地", "B13":"B-1资产资源类 B-1-3流转土地", "B14":"B-1资产资源类 B-1-4房屋及各类物理空间", "B21":"B-2商品版权类 B-2-1地理特产", "B22":"B-2商品版权类 B-2-2地标特产", "B23":"B-2商品版权类 B-2-3本土民间工艺和手工艺", "B24":"B-2商品版权类 B-2-4本地非遗及历史文化名产", "B31":"B-3项目类 B-3-1整体古村","B32":"B-3项目类 B-3-2整体园区" }; $.each(childs, function (key, item) { $("#capital_child").append(''); }); $("#capital_type").change(function(){ var index=$("#capital_type option:selected").val(); $("#capital_child").html(""); var child=childs[index]; $.each(child, function (key, item) { $("#capital_child").append(''); }); }); } tgApplyFormEl.show(); if(tgId){ var status=info?info.status:'-1'; status=parseInt(status); var showinfo=$("#showinfo").val(); tgApplyFormEl.find('input').attr('disabled',true); tgApplyFormEl.find('select').attr('disabled',true); tgApplyFormEl.find('textarea').attr('disabled',true); console.log("apply_type",apply_type); if(info){ $("#hoster_type").val(info.hoster_type||''); $("#hoster_name").val(info.hoster_name||''); $("#company_addr").val(info.company_addr||''); $("#legal_person").val(info.legal_person||''); $("#legal_cardno").val(info.legal_cardno||''); if(info.reg_capital>0)$("#reg_capital").val(info.reg_capital||''); $("#eco_nature").val(info.eco_nature||''); $("#leader_cardtype").val(info.leader_cardtype||''); $("#leader_cardno").val(info.leader_cardno||''); $("#natural_name").val(info.natural_name||''); $("#natural_addr").val(info.natural_addr||''); $("#natural_tel").val(info.natural_tel||''); $("#natural_fax").val(info.natural_fax||''); $("#natural_email").val(info.natural_email||''); $("#natural_code").val(info.natural_code||''); $("#capital_num").val(info.capital_num||''); if(apply_type==1){ $("#capital_type").val(info.capital_type||''); //资产权属 $("#capital_own").val(info.capital_own||''); $("#capital_class").val(info.capital_class||''); $("#capital_name").val(info.capital_name||''); $("#capital_cycle").val(info.capital_cycle||''); $("#capital_unit").val(info.capital_unit||''); $("#capital_price").val(Utils.accDiv(info.capital_price||0,100)||''); $("#assessment").val(info.assessment||''); $("#assessment_date").val(info.assessment_date||''); $("#legal_cardno").val(info.legal_cardno||''); $("#business_code").val(info.business_code||''); $("#company_name").val(info.company_name||''); $("#leader_name").val(info.leader_name||''); } else if(apply_type==2){ if(info.hoster_type==2){ var txts=[["法人身份证正面照片","法人身份证反面照片"],["权属人身份证正面照片","权属人身份证反面照片"]]; //$(".poster").eq(2).hide(); $(".poster").eq(2).find('.xuzhi').removeClass('must'); $(".poster .file_name").eq(2).attr('required',false); var txt=txts[1]; $(".poster .txt").eq(0).html(txt[0]); $(".poster .txt").eq(1).html(txt[1]); $(".poster").eq(0).find(".file_name").attr('data-fname',txt[0]); $(".poster").eq(1).find(".file_name").attr('data-fname',txt[1]); } $("#business_code").val(info.business_code||''); var capital_type=info.capital_type||''; var tg_type=info.tg_type||''; var hoster_reason=info.hoster_reason||''; hoster_reason=hoster_reason.split(','); tg_type=tg_type.split(','); if(tg_type.length){ $('input[name="tg_type[]"]').each(function(){ var tmp=$(this).val(); for(var i=0;i'; html+='
'; if(path){ html+='
'+ftypedescr+'
'; }else{ html+='
'+ftypedescr+'
'; } if(ftemp_id){ html+='
'; html+='
下载模板
'; } if(ftemp_url) { html+='
'; html+='
下载模板
'; } html+='
'; html+='
'+ftype+'
'; html+='
'; html+='
'; if(flag==1){ html+='审核通过'; }else if(flag==0){ if(!tgId||apply_status=='2'){ html+='
'; html+='
'; html+='
选择文件
'; html+='
'; html+='
资产托管申请表'; html+='托管方名称  '+hoster_name+''; html+='托管方类别  '+hoster_type+''; //html+='托管资产类别  '+typestr+''; //html+='托管资产子类别  '+childstr+''; html+='托管方诉求  '+hoster_reason+''; html+='托管资产数量  '+capital_num+''; html+='
基本情况
权属方为“企业法人”的填写以下内容:'; html+='单位名称  '+company_name+''; html+='单位地址  '+company_addr+''; html+='法定代表人  '+legal_person+''; html+='法人身份证  '+legal_cardno+''; html+='营业执照代码  '+business_code+''; //html+='联系方式  '+legal_tel+''; html+='注册资本  '+reg_capital+'万元'; html+='经济性质  '+eco_nature+''; html+='权属方为“自然人”的填写以下内容:'; html+='证件类型  '+leader_cardtype+'证件号码  '+leader_cardno+''; html+='
联系方式
权属方姓名  '+natural_name+''; html+='通讯地址  '+natural_addr+''; html+='联系电话  '+natural_tel+'传真  '+natural_fax+''; html+='电子邮件  '+natural_email+'邮编  '+natural_code+''; html+='推荐机构  '+recom_agency+''; html+='
'; html+='
'; //页面层 layer.open({ type: 1, offset: '50px', title:"确定信息", //不显示标题 skin: 'layui-layer-rim', //加上边框 area: ['70%','auto'], //宽高 content:html }); $("#TgSurebut").click(function(){ var self=$("#TgSurebut"); self.attr('disabled',true); saveTgData(params,function (v) { self.attr('disabled',false); if(v){ setTimeout(function(){ window.location.replace('/home/center/mytg.html'); },500); } }) }); } function goxcTgSure(params){ var hoster_type=$("#hoster_type").val(); if(hoster_type==1){ hoster_type='机构/公司'; }else{ hoster_type='个人'; } //托管方类别 var hoster_name=$("#hoster_name").val().trim(); //托管方名称 var capital_type=$("#capital_type").val(); //托管资产类别 var capital_child=$("#capital_child").val(); //托管资产类别 var company_addr=$("#company_addr").val().trim(); var company_name=$("#company_name").val().trim(); //单位地址 var legal_person=$("#legal_person").val().trim(); var legal_cardno=$("#legal_cardno").val().trim(); var business_code=$("#business_code").val().trim(); //法定代表人 //var legal_tel=$("#legal_tel").val(); //法定代表人 var reg_capital=$("#reg_capital").val(); //注册资本(万元) var eco_nature=$("#eco_nature").val().trim(); //经济性质 var leader_cardtype=$("#leader_cardtype").val(); if(leader_cardtype=='000'){ leader_cardtype='身份证'; }else if(leader_cardtype=='001'){ leader_cardtype='护照'; }else{ leader_cardtype='户口簿'; } //证件类型 var leader_cardno=$("#leader_cardno").val().trim(); //证件号码 var natural_name=$("#natural_name").val().trim(); //联系人 var natural_addr=$("#natural_addr").val().trim(); //通讯地址 var natural_tel=$("#natural_tel").val().trim(); //联系电话 var natural_fax=$("#natural_fax").val().trim(); //传真 var natural_email=$("#natural_email").val().trim(); //电子邮件 var natural_code=$("#natural_code").val().trim(); //邮编 var capital_num=$("#capital_num").val(); var recom_agency=$("#recom_agency").val(); var hoster_reason=$("#hoster_reason").val(); var hr_jsons=[]; hr_jsons[4]="资产托管"; hr_jsons[5]="资产管理"; hr_jsons[6]="资产利用"; hr_jsons[7]="资产转让"; hr_jsons[8]="项目咨询"; hr_jsons[9]="资源导入"; hr_jsons[10]="资金导入"; hr_jsons[11]="其他诉求"; if(typeof hr_jsons[hoster_reason]!='undefined'){ hoster_reason=hr_jsons[hoster_reason]; } var ftitle='古建'; if(apply_type==4){ftitle='乡村振兴';} var html='
'; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+='
'+ftitle+'资产托管申请表
托管方名称  '+hoster_name+'
托管方类别  '+hoster_type+'
托管方诉求  '+hoster_reason+'
托管资产数量  '+capital_num+'
基本情况
权属方为“企业法人”的填写以下内容:
单位名称  '+company_name+'
单位地址  '+company_addr+'
法定代表人  '+legal_person+'
法人身份证  '+legal_cardno+'
营业执照代码  '+business_code+'
注册资本  '+reg_capital+'万元
经济性质  '+eco_nature+'
权属方为“自然人”的填写以下内容:
证件类型  '+leader_cardtype+'证件号码  '+leader_cardno+'
联系方式
权属方姓名  '+natural_name+'
通讯地址  '+natural_addr+'
联系电话  '+natural_tel+'传真  '+natural_fax+'
电子邮件  '+natural_email+'邮编  '+natural_code+'
推荐机构  '+recom_agency+'
'; html+='
'; //页面层 layer.open({ type: 1, offset: '50px', title:"确定信息", //不显示标题 skin: 'layui-layer-rim', //加上边框 area: ['70%','auto'], //宽高 content:html }); $("#TgSurebut").click(function(){ var self=$("#TgSurebut"); self.attr('disabled',true); saveTgData(params,function (v) { self.attr('disabled',false); if(v){ setTimeout(function(){ window.location.replace('/home/center/mytg.html'); },500); } }) }); } function goTgApply(){ var hoster_typeEl=$("#hoster_type"); var hoster_type=hoster_typeEl.val(); //托管方类别 var hoster_nameEl=$("#hoster_name"); var hoster_name=hoster_nameEl.val().trim(); //托管方名称 var capital_typeEl=$("#capital_type"); var capital_type=capital_typeEl.val(); //托管资产类别 var company_addrEl=$("#company_addr"); var company_addr=''; if(company_addrEl.length)company_addr=company_addrEl.val().trim(); //单位地址 var legal_personEl=$("#legal_person"); var legal_person=legal_personEl.val().trim(); var legal_cardnoEl=$("#legal_cardno"); var legal_cardno=""; if(typeof legal_cardnoEl!='undefined'){ legal_cardno=legal_cardnoEl.val(); if(legal_cardno)legal_cardno=legal_cardno.trim(); } //法定代表人 var reg_capitalEl=$("#reg_capital"); var reg_capital=reg_capitalEl.val(); //注册资本(万元) var eco_natureEl=$("#eco_nature"); var eco_nature=eco_natureEl.val().trim(); //经济性质 var leader_cardtypeEl=$("#leader_cardtype"); var leader_cardtype=leader_cardtypeEl.val(); //证件类型 var leader_cardnoEl=$("#leader_cardno"); var leader_cardno=leader_cardnoEl.val().trim(); //证件号码 var natural_nameEl=$("#natural_name"); var natural_name=natural_nameEl.val().trim(); //联系人 var natural_addrEl=$("#natural_addr"); var natural_addr=natural_addrEl.val().trim(); //通讯地址 var natural_telEl=$("#natural_tel"); var natural_tel=natural_telEl.val().trim(); //联系电话 var natural_faxEl=$("#natural_fax"); var natural_fax=natural_faxEl.val().trim(); //传真 var natural_emailEl=$("#natural_email"); var natural_email=natural_emailEl.val().trim(); //电子邮件 var natural_codeEl=$("#natural_code"); var natural_code=natural_codeEl.val().trim(); //邮编 var capital_numEl=$("#capital_num"); var capital_num=capital_numEl.val(); //托管资产数量 if(!hoster_name){ hoster_nameEl.focus(); return layerAlert('请输入托管方名称'); } //个人 if(hoster_type==2){ if(!leader_cardno){ leader_cardnoEl.focus(); return layerAlert('请输入证件号码'); } if(leader_cardtype=='000'&&leader_cardno){ if(!validate_id(leader_cardno)){ leader_cardnoEl.focus(); return layerAlert('请输入有效的身份证号'); } } } if(hoster_type==1&&apply_type!=2){ if(!legal_cardno){ legal_cardnoEl.focus(); return layerAlert('请输入法人证件号码'); } if(!validate_id(legal_cardno)){ legal_cardnoEl.focus(); return layerAlert('请输入有效的身份证号'); } } if(!natural_name&&apply_type!=3&&hoster_type!=1){ natural_nameEl.focus(); var text=$("#natural_name_label").text()||''; return layerAlert('请填写'+text); } if(!natural_addr){ natural_addrEl.focus(); return layerAlert('请填写通讯地址'); } if(!natural_tel){ natural_telEl.focus(); return layerAlert('请填写联系电话'); } //有小数位 if(reg_capital){ if(isNaN(reg_capital)||reg_capital<0){ reg_capitalEl.focus(); return layerAlert('注册资本输入不合法'); }else if((reg_capital+'').indexOf('.')!=-1&&(reg_capital+'').split('.')[1].length>4){ reg_capitalEl.focus(); return layerAlert('注册资本最多保留四位小数'); } } if(capital_num){ if(isNaN(capital_num)||capital_num<0||capital_num%1>0) { capital_numEl.focus(); return layerAlert('托管资产数量输入不合法'); } } if(capital_num==0){ capital_numEl.focus(); return layerAlert('输入托管资产数量'); } if(apply_type==2||apply_type==3||apply_type==4){ var products=getProducts(); if(typeof products=='undefined'||products==''){ layerAlert("请添加资产托管清单",'error'); return false; } } var unique_code=getFiles(); if(!unique_code.code&&unique_code.has){return;} var params={ apply_type:apply_type, hoster_type:hoster_type, hoster_name:hoster_name, capital_type:capital_type, company_addr:company_addr, legal_person:legal_person, legal_cardno:legal_cardno, reg_capital:reg_capital, eco_nature:eco_nature, leader_cardtype:leader_cardtype, leader_cardno:leader_cardno, natural_name:natural_name, natural_addr:natural_addr, natural_tel:natural_tel, natural_fax:natural_fax, natural_email:natural_email, natural_code:natural_code, capital_num:capital_num, unique_code:unique_code.code, unique_has:unique_code.has }; if(apply_type==1){ //资产权属 var capital_own=$("#capital_own").val(); var capital_ownEl=$("#capital_class"); //托管资产类型 var capital_class=capital_ownEl.val(); var capital_nameEl=$("#capital_name"); //托管资产名称 var capital_name=capital_nameEl.val().trim(); var capital_cycleEl=$("#capital_cycle"); //托管周期 var capital_cycle=capital_cycleEl.val().trim(); var capital_unitEl=$("#capital_unit"); //托管资产交易单位 var capital_unit=capital_unitEl.val().trim(); var capital_priceEl=$("#capital_price"); //托管资产价格 var capital_price=capital_priceEl.val(); var assessmentEl=$("#assessment"); //评估机构 var assessment=assessmentEl.val().trim(); var assessment_dateEl=$("#assessment_date"); //评估基准日 var assessment_date=assessment_dateEl.val().trim(); var company_name=$("#company_name").val(); var htype=$("#hoster_type").val(); if(htype==2){ var leader_nameEl=$("#leader_name"); var leader_name=leader_nameEl.val().trim(); if(!leader_name){ leader_nameEl.focus(); var text=$("#leader_name_label").text()||''; return layerAlert('请填写'+text); } } var legal_cardno=$("#legal_cardno").val(); var business_code=$("#business_code").val(); if(htype==1){ if(!company_name){ $("#company_name").focus(); return layerAlert('请填写单位名称'); } if(!legal_cardno){ $("#legal_cardno").focus(); return layerAlert('请填写法人身份证'); } if(!business_code){ $("#business_code").focus(); return layerAlert('请填写营业执照代码'); } } if(!capital_name){ capital_nameEl.focus(); return layerAlert('请填写托管资产名称'); } if(!capital_cycle) { capital_cycleEl.focus(); return layerAlert('请输入托管周期'); } else if(isNaN(capital_cycle)||capital_cycle<0||capital_cycle%1>0){ capital_cycleEl.focus(); return layerAlert('托管周期输入不合法'); } //有小数位 if(capital_price){ if(isNaN(capital_price)||capital_price<0){ capital_priceEl.focus(); return layerAlert('托管资产价格输入不合法'); }else if((capital_price+'').indexOf('.')!=-1&&(capital_price+'').split('.')[1].length>2){ capital_priceEl.focus(); return layerAlert('托管资产价格最多保留两位小数'); } //分 capital_price=Utils.accMul(capital_price,100); } $.extend( params, { capital_own:capital_own, capital_class:capital_class, capital_name:capital_name, capital_cycle:capital_cycle, capital_unit:capital_unit, capital_price:capital_price, assessment:assessment, assessment_date:assessment_date, leader_name:leader_name, company_name:company_name, business_code:business_code }); } else if(apply_type==2){ //托管方诉求 var hoster_reason =[];//定义一个数组 //托管资产类别 var business_codeEl=$("#business_code"); var business_code=business_codeEl.val().trim(); var legal_personEl=$("#legal_person"); var legal_person=legal_personEl.val().trim(); var natural_nameEl=$("#natural_name"); var natural_name=natural_nameEl.val().trim(); var htype=$("#hoster_type").val(); if(htype==1){ if(typeof business_code=='undefined'||business_code==''){ layerAlert("请输入营业执照代码",'error'); return false; } if(typeof legal_person=='undefined'||legal_person==''){ layerAlert("请输入法定代表人",'error'); return false; } }else{ if(typeof natural_name=='undefined'||natural_name==''){ layerAlert("请输入联系人",'error'); return false; } } tgtype=$("[name='tg_type[]']:checked").val(); if(typeof tgtype=='undefined'||tgtype==''){ layerAlert("请选择申请类型",'error'); return false; } var tg_type =[];//定义一个数组 $('input[name="tg_type[]"]:checked').each(function(){ tg_type.push($(this).val()); }); tg_type=tg_type.join(","); $.extend( params, { tg_type:tg_type, }); $.extend( params, { business_code:business_code, products:products }); var assagreeEl=$("input[name='assagree']:checked"); if(typeof assagreeEl!=undefined&&assagreeEl!=''){ var assagree=assagreeEl.val(); if(assagree!=''){ $.extend( params, { assagree:assagree }); } } }else if(apply_type==3||apply_type==4){ //托管方名称 var capital_childEl=$("#capital_child"); var capital_child=capital_childEl.val(); //托管方诉求 var hoster_reason=$("#hoster_reason").val(); var recom_agency=$("#recom_agency").val(); var legal_cardno=$("#legal_cardno").val(); var business_code=$("#business_code").val(); var company_name=$("#company_name").val(); if(legal_cardno){ if(!validate_id(legal_cardno)){ $("#legal_cardno").focus(); return layerAlert('请输入有效的法人身份证'); } } if(hoster_type==1){ if(!company_name){ $("#company_name").focus(); return layerAlert('请填写单位名称'); } if(!company_addr){ company_addrEl.focus(); return layerAlert('请填写单位地址'); } if(!legal_person){ legal_personEl.focus(); return layerAlert('请填写法定代表人'); } if(!legal_cardno){ $("#legal_cardno").focus(); return layerAlert('请填写法人身份证'); } if(!business_code){ $("#business_code").focus(); return layerAlert('请填写营业执照代码'); } /* if(!legal_tel){ legal_tel.focus(); return layerAlert('请填写联系方式'); } */ if(!reg_capital){ reg_capitalEl.focus(); return layerAlert('请填写注册资本'); } if(!eco_nature){ eco_natureEl.focus(); return layerAlert('请填写经济性质'); } }else{ if(!natural_name){ natural_nameEl.focus(); var text=$("#natural_name_label").text()||''; return layerAlert('请填写'+text); } } $.extend( params, { company_name:company_name, business_code:business_code, hoster_reason:hoster_reason, //legal_tel:legal_tel, capital_child:capital_child, recom_agency:recom_agency, products:products } ); } if(tgId)params.apply_id=tgId; if(apply_type==3){ goTgSure(params); }else if(apply_type==4){ goxcTgSure(params); }else{ var self=$("#TgApplbut"); self.attr('disabled',true); saveTgData(params,function (v) { self.attr('disabled',false); if(v){ //$("#tgapply_form")[0].reset(); setTimeout(function(){ window.location.replace('/home/center/mytg.html'); },500); } }) } } function layerAlert(msg,type,call) { var icon=0; if(type=='error'){ icon=5; }else if(type=='success'){ icon=6; } layer.alert(msg, {icon: icon, cancel:function () { call&&call(); }}, function (index) { layer.close(index); call&&call(); } ); } function getInfo(tgId,call) { $.ajax({ url:'/api/Capital/getInfo/apply_id/'+tgId, type:'POST', dataType:'json', success:function (rs) { try{if(rs && typeof(rs)=="string"){rs=JSON.parse(rs);}}catch(ex){} if(rs.code==200){ call&&call(rs.data); if(rs.data.status==40 &&rs.data.apply_status ==0&&rs.data.apply_type == 3){ window.layer&&layer.open({ title: '审核通过' ,content: '
'+ '
请在三个工作日内一次性支付托管服务费用
'+ '深圳文化产权交易所收款账户及开户银行:
'+ '开户名:深圳文化产权交易所有限公司
'+ '开户银行:平安银行深圳南头支行
'+ '开户账号:11015844492008
'+ '
' }); } }else{ call&&call(); layerAlert(rs.msg||'获取托管申请信息失败','error'); } }, error:function (e) { call&&call(); layerAlert('获取托管申请信息失败','error') } }) } function toReUploadFile(call) { var unique_code=getFiles(); if(!unique_code.code&&unique_code.has){ return; } var self=$("#TgApplbut"); self.attr('disabled',true); $.ajax({ url:'/api/Capital/reUpload', type:'POST', dataType:'json', data:{apply_id:tgId,unique_code:unique_code.code,unique_has:unique_code.has}, success:function (rs) { self.attr('disabled',false); try{if(rs && typeof(rs)=="string"){rs=rs=JSON.parse(rs);}}catch(ex){} console.log(rs); if(rs.code==200){ layerAlert('附件提交成功','success',function(){ call&&call(true); window.location.replace('/home/center/mytg.html'); }) }else{ layerAlert(rs.msg||'附件提交失败','error',function(){ call&&call(false); }); } }, error:function (e) { self.attr('disabled',false); call&&call(false); layerAlert('附件提交失败','error') } }) } function saveTgData(info,call) { $.ajax({ url:'/api/capital/apply', type:'POST', dataType:'json', data:info, success:function (rs) { try{ if(rs && typeof(rs)=="string"){ rs=rs=JSON.parse(rs); } }catch(ex){} if(rs.code==200||rs.status==1||rs.status=='success'){ layerAlert('托管申请提交成功','success',function(){ call&&call(true); }) }else{ layerAlert(rs.msg||'托管申请提交失败','error',function(){ call&&call(false); }); } }, error:function (e) { call&&call(false); layerAlert('托管申请提交失败','error') } }) } function validate_id(value){ var isIDNumber15 = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/; var isIDNumber18 = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/; if (isIDNumber15.test(value)) { return true; } else if (isIDNumber18.test(value)) { return true; } return false; } function validate_tel(value){ var mobile = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/; var length=value.length; return length == 11 && mobile.test(value); } function uploadProgress(currDiv) { var id=currDiv.attr('id'); var accept=currDiv.attr('accept'); var ftype_id=id.replace('file_one_',''); var fileId=''; var etags=[]; var chunks=1; var percentage=0; var timer=''; var typetext=currDiv.parent().parent().prev().text().toUpperCase(); var uformData={ftype_id:ftype_id,'step':2}; if(typeof tgId!='undefined')uformData.apply_id=tgId; var uploader=WebUploader.create({ chunked:true, //10M chunkSize:10485760, threads:5, //auto: true, fileVal:'file', formData:uformData, pick: '#'+id, server: '/api/capital/aliUpload', accept: { title: currDiv.attr('data-fname'), extensions: 'gif,jpg,jpeg,bmp,png,pdf,rar,zip', mimeTypes: accept }, }); if(typetext=='RAR/ZIP'){ uploader.option('duplicate',true); } uploader.on('fileQueued', function(file) { uploader.option('duplicate',false); console.log('fileQueued...',file,uploader.options.formData); etags=[]; percentage=0; chunks=1; var name = file.name; var filetype = name.substring(name.lastIndexOf(".")+1).toUpperCase(); currDiv.parent().prev().css("text-align","left"); var error=0; if(typetext=='PDF'){ if(filetype!='PDF'){ name ='文件类型错误';error=1; } }else if(typetext=='JPG'){ if(filetype!='JPG'){ name ='文件类型错误';error=2; } }else if(typetext=='DOC'){ if(filetype!='DOC' && filetype!='DOCX' ){ name ='文件类型错误';error=3; } }else if(typetext=='RAR/ZIP'){ if(filetype!='ZIP' && filetype!='RAR' ){ name ='文件类型错误';error=4; } }else if(typetext=='JPG/PDF'){ if(filetype!='JPG' && filetype!='PDF' ){ name ='文件类型错误';error=5; } } var textobj=currDiv.parent().prev(); if(error>0){ textobj.text(name); uploader.cancelFile(file); currDiv.attr("data-url",""); currDiv.find("input").val(""); currDiv.attr("data-uniquecode",""); return false; } if(typetext=='RAR/ZIP'){ layer.msg('上传中', { icon: 16 ,shade: 0.01 ,time: 6000*1000 }); uploader.md5File(file).progress(function(percent) { // 及时显示进度 percent=Math.round(percent*10000)/100; percent=percent/20; percent=percent.toFixed(2); //currDiv.parent().prev().text(file.name+" "+percent+'%'); }).then(function(unique_code) { // 完成 percentage=5; console.log('md5 result:', unique_code); var filesize=file.size; if(typeof tgId=='undefined')tgId=''; $.get('/api/capital/aliUpload?step=1&&ftype_id='+ftype_id+'&&fileName='+file.name+'&&filesize='+filesize+'&&unique_code='+unique_code+'&&apply_id='+tgId,function(result){ if(result){ result=JSON.parse(result); if(result&&result.code==200&&result.data){ if(typeof result.data!='undefined'){ var data=result.data; if(typeof data.img_url!='undefined'&&data.img_url){ layer.closeAll(); textobj.text(file.name); currDiv.attr("data-url",data.img_url); currDiv.find("input").val(""); currDiv.attr("data-uniquecode",data.unique_code); }else{ if(typeof data.etags!='undefined'&&data.etags){ etags=data.etags; chunks=etags.length-1; } var formData={ftype_id:ftype_id,'step':2}; fileId=formData.fileId=data.fileId; formData.uploadId=data.uploadId; formData.filesize=filesize; formData.unique_code=unique_code; uploader.options.formData=formData; uploader.upload(file); } } }else{ textobj.text('上传失败'); currDiv.attr("data-url",""); currDiv.find("input").val(""); currDiv.attr("data-uniquecode",""); } } }); }); }else{ if(typeof tgId!='undefined'){ uploader.options.server='/api/capital/upload/apply_id/'+tgId; }else{ uploader.options.server='/api/capital/upload'; } uploader.upload(file); } }); uploader.on('uploadProgress',function (file,percentage) { if(typetext=='RAR/ZIP'){return false;} var percent=Math.round(percentage*10000)/100; currDiv.parent().prev().text(file.name+" "+percent+'%'); }); uploader.on('uploadBeforeSend',function (object,data,headers) { }); uploader.on('uploadAccept',function (object ,reason) { if(typetext=='RAR/ZIP'&&(typeof reason.code!='undefined'&&reason.code==200)){ /* var total=object.chunks; var curtotal=percentage+(95/total)*chunks; curtotal=Math.floor(curtotal); if(curtotal>100)curtotal=100; if(timer)clearInterval(timer); timer=setInterval(function(){ percentage++; currDiv.parent().prev().text(object.file.name+" "+percentage+'%'); if(percentage>=curtotal){ clearInterval(timer); } },300); chunks++; console.log('uploadAccept',curtotal,chunks,total); */ } console.log('uploadAccept',object,reason,chunks); }); uploader.on('uploadSuccess',function (file,result) { layer.closeAll(); var textobj=currDiv.parent().prev(); console.log('uploadSuccess',result,currDiv); var filetype = name.substring(name.lastIndexOf(".")+1).toUpperCase(); if(timer)clearInterval(timer); if(result&&result.code==200&&result.data){ var filesize=file.size; if(typetext=='RAR/ZIP'){ $.get('/api/capital/aliUpload?step=3&&ftype_id='+ftype_id+'&&fileId='+fileId+'&&fileName='+file.name+'&&filesize='+filesize+'&&apply_id='+tgId,function(res){ if(res){ res=JSON.parse(res); console.log('uploadSuccess',res); if(res&&res.code==200&&res.data){ textobj.text(file.name); currDiv.attr("data-url",res.data.img_url); currDiv.find("input").val(""); currDiv.attr("data-uniquecode",res.data.unique_code); }else{ textobj.text('上传失败'); currDiv.attr("data-url",""); currDiv.find("input").val(""); currDiv.attr("data-uniquecode",""); } } }); }else{ textobj.text(file.name); currDiv.attr("data-url",result.data.img_url); currDiv.find("input").val(""); currDiv.attr("data-uniquecode",result.data.unique_code); } }else{ currDiv.attr("data-url",""); currDiv.attr("data-uniquecode",""); currDiv.find("input").val(""); textobj.text('上传失败'); } }); uploader.on( 'uploadError', function( file,reason) { console.log('uploadError',reason); if(timer)clearInterval(timer); currDiv.parent().prev().text("上传文件出错"); currDiv.attr("data-url",""); currDiv.find("input").val(""); currDiv.attr("data-uniquecode",""); }); } function bindFileUpload() { var file_nameEl= $(".file_name"); for(var i=0,len=file_nameEl.length;i