123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751 |
- function check(){
- if (confirm("确认是否提交本次报销单,点击确定提交开始审批,点击取消关闭本窗口。"))
- return true;
- else return false;
- }
- function receiptYear(){
- var form = $('#up');
- $('#year').val($('#Y').val());
- form.submit();
- }
- function receiptDate(){
- var form = $('#up');
- //$('#year').val($('#date').val());
- form.submit();
- }
- function reportCatePM(){
- var name=$('#reportCate').val();
- $("option[node-all='true']").show();
- if(name=='ALL'){
- $("tr[node-all='true']").show();
- $("option[node-all='true']").show();
- }else{
- $("tr[node-all='true']").hide();
- $("option[node-all='true']").hide();
- $("option[node-cate='"+name+"']").show();
- $("tr[node-boxCate='"+name+"']").show();
- }
- }
- function reportPM(){
- var name=$('#report').val();
- if(name=='ALL')
- $("tr[node-all='true']").show();
- else{
- $("tr[node-all='true']").hide();
- $("tr[node-box='"+name+"']").show();
- }
- }
- function receiptMoth(){
- var form = $('#up');
- $('#year').val($('#Y').val());
- $('#month').val($('#M').val());
- //alert($('#M').val());
- form.submit();
- }
- function receiptDay(){
- var form = $('#up');
- $('#year').val($('#Y').val());
- $('#month').val($('#M').val());
- $('#day').val($('#D').val());
- form.submit();
- }
- function receiptSop(){
- var form = $('#up');
- $('#year').val($('#Y').val());
- $('#month').val($('#M').val());
- $('#day').val($('#D').val());
- $('#sop').val($('#S').val());
- form.submit();
- }
- function updateApprovalReceipt(status,rid){
- var form = $('#verifyOpinion_'+rid);
- $('#status_'+rid).val(status);
- $("input[name='amount']").val($('#amount').val());
-
- form.submit();
- }
- function setExeReceipt(tr,rid){
- var form = $('#implement'+tr);
- var amount=$('#amount'+tr).val();
-
- var accountBank=$('#accountBankSelect'+tr).val();
-
- console.log(amount);
- if(amount=='')
- return alert('请填写汇款金额');
- $("#amountInp"+tr).val(amount);
- $("#accountBank"+tr).val(accountBank);
- form.submit();
- }
- function expensesDefray(status,rid){
- var form = $('#verifyOpinion_'+rid);
- $('#status_'+rid).val(status);
- form.submit();
- }
- function showOpinion(receiptOrder){
- //console.log(receiptOrder);
- $('#orderBody').html('读取中');
- var url="/ajaxGetReceiptOrder";
-
- $.ajax({
- url:url,
- type: "post",
- cache: false,
- dataType: "json",
- data: {
- receiptOrder:receiptOrder
- },
- global: true,
- success: function(data){
- if(data.status==1)
- $('#orderBody').html(data.receiptHtml);
- else
- $('#orderBody').html('没找到信息');
- },
- error:function(err){
- }
- });
- }
- $(function() {
- $('select[node-implement]').change(function(){
- //$item=$(this).attr('value');
-
- // var action = $('#up').attr("action");
- // action=encodeURI(action+'/'+$item);
- // $('#up').attr("action",action);
- $('#up').submit();
-
-
-
- console.log();
- });
-
- $('button[node-qmk="tm"]').click(function(){
- var id=$(this).attr('data');
- $('#'+id).attr('value',$('#'+id).attr('data-tm'));
- });
-
- $('a[node-ReceiptBack="true"]').click(function(){
- var rid=$(this).attr("p-d");
- var opinion=$('#opinion_'+rid).val();
-
- var url="/approvalChe";
- $.ajax({
- url:url,
- type: "post",
- cache: false,
- dataType: "json",
- data: {
- rid:rid,
- opinion:opinion
- },
- global: true,
- success: function(data){
- if(data.status==2){
- alert('参数错误');
- }else{
- window.location.href="/approvalExpenses/pendApproval";
- }
- },
- error:function(err){
- }
- });
- });
-
- $("a[id^=examine]").click(function(){
- var rid=$(this).attr('data');
- var url="/ajaxExamine";
-
- $.ajax({
- url:url,
- type: "post",
- cache: false,
- dataType: "json",
- data: {
- rid:rid
- },
- global: true,
- success: function(data){
- if(data.status==0){
- alert('参数错误');
- }
- var count=data.receipt.length;
- if(count!=0){
- if(data.receipt.Rtype==1){
- window.location.href="/expensesEdi/"+data.receipt.rid;
- }else if(data.receipt.Rtype==0){
- window.location.href="/receiptburEdi/"+data.receipt.rid;
- }else if(data.receipt.Rtype==2){
- window.location.href="/remitApproval/"+data.receipt.rid;
- }
- }else
- alert('没有需要审批的费用');
- },
- error:function(err){
- }
- });
- });
-
-
- $("a[id^=examineExe]").click(function(){
- var rid=$(this).attr('data');
- var url="/ajaxExamineExe";
-
- $.ajax({
- url:url,
- type: "post",
- cache: false,
- dataType: "json",
- data: {
- rid:rid
- },
- global: true,
- success: function(data){
-
- if(data.status==0){
- alert('参数错误');
- }
-
- var count=data.receipt.length;
-
- if(count!=0){
- window.location.href="/implement/"+data.receipt.ridKey+".html";
-
- }else
- alert('没有需要审批的费用');
-
-
- console.log(data);
-
- },
- error:function(err){
- }
- });
-
-
- });
-
-
-
-
- $("input[id^='agency_']").change(function() {
-
- $i=0;
- $("input[id^='agency_']").each(function(i){
- $i+=parseFloat(this.value);
-
- });
- $("#agencyResult").html("¥"+$i.toFixed(2));
- $("#agencyR").val($i.toFixed(2));
-
- var travelR=parseFloat($("#travelR").val());
- var trainR=parseFloat($("#trainR").val());
- var otherR=parseFloat($("#otherR").val());
- var RS=parseFloat($i)+parseFloat(travelR)+parseFloat(trainR)+parseFloat(otherR);
-
- $("#RS").html("¥"+RS.toFixed(2));
- });
-
- $("input[id^='travel_']").change(function() {
-
- $i=0;
- $("input[id^='travel_']").each(function(i){
- $i+=parseFloat(this.value);
-
- });
- $("#travelResult").html("¥"+$i.toFixed(2));
- $("#travelR").val($i.toFixed(2));
-
- var agencyR=$("#agencyR").val();
- var trainR=parseFloat($("#trainR").val());
- var otherR=parseFloat($("#otherR").val());
- var RS=parseFloat($i)+parseFloat(agencyR)+trainR+otherR;
-
- $("#RS").html("¥"+RS.toFixed(2));
- });
-
- $("input[id^='train_']").change(function() {
-
- $i=0;
- $("input[id^='train_']").each(function(i){
- $i+=parseFloat(this.value);
-
- });
- $("#trainResult").html("¥"+$i.toFixed(2));
- $("#trainR").val($i.toFixed(2));
-
- var agencyR=$("#agencyR").val();
- var otherR=parseFloat($("#otherR").val());
- var travelR=parseFloat($("#travelR").val());
- var RS=parseFloat($i)+parseFloat(agencyR)+travelR+otherR;
-
- $("#RS").html("¥"+RS.toFixed(2));
- });
-
- $("input[id^='other_']").change(function() {
-
- $i=0;
- $("input[id^='other_']").each(function(i){
- $i+=parseFloat(this.value);
-
- });
- $("#otherResult").html("¥"+$i.toFixed(2));
- $("#otherR").val($i.toFixed(2));
-
- var agencyR=$("#agencyR").val();
- var travelR=parseFloat($("#travelR").val());
- var trainR=parseFloat($("#trainR").val());
- var RS=parseFloat($i)+parseFloat(agencyR)+parseFloat(travelR)+parseFloat(trainR);
-
- $("#RS").html("¥"+RS.toFixed(2));
- });
-
- $("a[id^='getStaffInfo']").click(function(){
-
- var username=$(this).attr('data');
-
- var url="/getStaffInfo";
-
- $.ajax({
- url:url,
- type: "post",
- cache: false,
- dataType: "json",
- data: {
- username:username
- },
- global: true,
- success: function(data){
-
- if(data.success){
- alert('请重新登录');
- }
-
- $('#staffInfo').html(data.html);
- $('#staffInfo').show();
- $('#longleLog').hide();
- $('#clientInfo').hide();
- $('#changeCompany').hide();
- },
- error:function(err){
- }
- });
- });
-
- $("a[id^='getClientInfo']").click(function(){
- var client=$(this).attr('data');
-
- var url="/getClientInfo";
-
- $.ajax({
- url:url,
- type: "post",
- cache: false,
- dataType: "json",
- data: {
- client:client
- },
- global: true,
- success: function(data){
-
- if(data.success){
- alert('请重新登录');
- }
-
- $('#clientInfo').html(data.html);
- $('#clientInfo').show();
- $('#staffInfo').hide();
- $('#longleLog').hide();
- $('#addClient').hide();
- $('#changeCompany').hide();
- autoFlashHeight();
- },
- error:function(err){
- autoFlashHeight();
- }
- });
-
- });
-
- $("a[id^='getCompanyInfo']").click(function(){
- alert('dd');
- });
-
- $("a[id^='getLongleLog_']").click(function() {
-
- var lid=$(this).attr('data');
-
- var url="/ajaxGetLongle";
-
- $.ajax({
- url:url,
- type: "post",
- cache: false,
- dataType: "json",
- data: {
- lid:lid
- },
- global: true,
- success: function(data){
-
- if(data.success==false){
- alert('请重新登录');
- }
-
- $("#klid").val(data.klid);
-
- $("#longleTitle").html(data.longle.key_num);
-
- var lka='<a href="javascript:void(0)" onclick="getStaffInfo(\''+data.longle.responsible+'\')" >'+data.longle.responsible+'</a>';
-
- $("#longleResponsible").html(lka);
-
- var kk="";
- if(data.longle.alloted_time!="")
- kk="期限:"+data.longle.alloted_time;
-
- $("#longleStatus").html(data.longle.statusT+"/"+data.longle.product+"/("+data.longle.version+")"+kk);
-
- $("#LongleLogHtml").html(data.longleLogHtml);
-
- if(data.longle.status>=3){
- $("#longleStatus_5").attr('disabled',false);
- $("#longleStatus_6").attr('disabled',false);
- $("#longleStatus_7").attr('disabled',false);
- $("#longleStatus_8").attr('disabled',false);
- }
- $('#staffInfo').hide();
- $("#longleLog").show();
- $('#clientInfo').hide();
- autoFlashHeight();
- },
- error:function(err){
- // easyDialog.open({
- // container : { content : '请输入正确的参数'},
- // autoClose : 1500,
- // overlay : false
- // });
- }
- });
-
- });
-
-
-
- $("a[node-invoice='INFO']").click(function() {
- var postData = $(this).attr("data-isKey");
-
- $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
- $("#nc").html('illegal request');
- var url = "/ajaxGetReceiptDetails";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : postData
-
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- //$("div[loading-msg='true']").html("");
-
- $("#nc").html(data.html);
- }
- },
- error : function(err) {
- $("div[loading-msg='true']").html("");
- }
- });
- });
-
-
- $("form[name='recepitAdd']").validator({
- timely: 3,
- focusCleanup: true,
- theme:"yellow_top",
- rules: {
- remittanceBankType: function() {
- var rbt=$('select[node-rbt]').val();
- if(rbt==0)
- return false;
- return true;
- }
- },
- fields: {
- 'verify': 'required; ',
- 'explanation':'required; ',
-
- 'remittanceName':'required; ',
- 'bankName':'required; ',
- 'bankNumber':'required; ',
- 'coupletNumber':'required(remittanceBankType); '
-
- }
- });
-
- $("select[node-rbt]").change(function(){
- var rbt=$(this).val();
- if(rbt==0){
- $("tr[node-cn]").hide();
- }else if(rbt==1){
- $("tr[node-cn]").show();
- }
- });
-
- //培训班结算
- $("form[name='receiptTrainAdd']").validator({
- timely: 3,
- focusCleanup: true,
- theme:"yellow_top",
- rules: {
- remittanceBankType: function() {
- var rbt=$('select[node-rbt]').val();
- if(rbt==0)
- return false;
- return true;
- }
- },
- fields: {
- 'verify': 'required; ',
- 'explanation':'required; ',
-
- 'remittanceName':'required; ',
- 'bankName':'required; ',
- 'bankNumber':'required; ',
- 'coupletNumber':'required(remittanceBankType); ',
-
- 'trainName':'required; ',
- 'trainStartDate':'required; ',
- 'trainEndDate':'required; ',
- 'participants':'required; ',
- 'trainAddress':'required; ',
- }
- });
- //培训班结算-添加支出
- $("form[name='receiptTrainItemAdd']").validator({
- timely: 3,
- focusCleanup: true,
- theme:"yellow_right",
-
- fields: {
- 'price': 'required; ',
- 'date':'required; ',
- 'inputer':'required; '
- }
- });
-
- //培训班结算-添加讲师
- $("form[name='receiptTrainLecturerAdd']").validator({
- timely: 3,
- focusCleanup: true,
- theme:"yellow_right",
-
- fields: {
- 'ltype':'required; ',
- 'lecturerName':'required; ',
- 'price': 'required; ',
- 'schoolDay':'required; '
- }
- });
-
- $("a[getReceiptLoan]").click(function() {
- $.ajax({
- url:"/ajaxGetReceiptTrainLoan",
- type: "post",
- cache: false,
- dataType: "json",
- data: {
-
- },
- global: true,
- success: function(data){
- var html='';
- for(var i=0;i<data.receiptLoanList.length;i++){
- html +='<option value="'+data.receiptLoanList[i].ridKey+'">'+data.receiptLoanList[i].receiptOrder+' ¥'+data.receiptLoanList[i].sum+'</option>';
- }
- $("select[receiptLoanSelect]").html(html);
- },
- error:function(err){}
- });
- });
-
- $("a[getReceiptInvoice]").click(function() {
- $.ajax({
- url:"/ajaxGetInvoiceTrainByEnd",
- type: "post",
- cache: false,
- dataType: "json",
- data: {
-
- },
- global: true,
- success: function(data){
- var html='';
- for(var i=0;i<data.invoiceTrainingList.length;i++){
- html +='<option value="'+data.invoiceTrainingList[i].itidKey+'">'+data.invoiceTrainingList[i].trainName+'</option>';
- }
- $("select[receiptInvoieSelect]").html(html);
- },
- error:function(err){}
- });
- });
-
- //h5文件上传
- var numFilesUploaded=0;
- $("input[enclosurFile]").change(function() {
-
- var form_data = new FormData();
- var file_data = $(this).prop("files")[0];
-
- form_data.append("Filename", file_data.name);
- form_data.append("Filedata", file_data);
-
- $.ajax({
- type: "POST",
- url: "/swfupload",
- dataType : "json",
- processData: false, // 注意:让jQuery不要处理数据
- contentType: false, // 注意:让jQuery不要设置contentType
- data: form_data
- }).success(function(msg) {
- var status = document.getElementById("divStatus");
- numFilesUploaded+=1;
- status.innerHTML = file_data.name+"上传成功 <br/>"+numFilesUploaded+" 个文件已上传.";
-
- var en=$('#enclosurName').val();
- if (en!='')
- $('#enclosurName').val(en+'-'+msg.filename);
- else
- $('#enclosurName').val(msg.filename);
-
-
- //页面展示上传内容
- var tr = document.createElement("tr");
- tr.id=msg.id;
- var td1 = document.createElement("td");
- td1.innerHTML = '<a href="#" target="_blank">'+file_data.name+'</a>';
- var td2 = document.createElement("td");
- td2.innerHTML = toDecimal2(file_data.size/1024)+'kb';
- var td3 = document.createElement("td");
- td3.innerHTML = '<a href="javascript:void(0)" onclick="delEnclosurName(\''+msg.filename+'\',\''+msg.id+'\')" >删除</a>';
- tr.appendChild(td1);
- tr.appendChild(td2);
- tr.appendChild(td3);
- var kt=document.getElementById('KT');
-
- if(kt!=null)
- kt.appendChild(tr);
-
- }).fail(function(msg) {
- //console.log(msg);
- });
- });
- })
- function delEnclosurByKey(id){
-
- var url = "/ajaxRemEnclousur";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- key : id
- },
- global : true,
- success : function(data) {
-
- if (data.status == 1) {
- $('#'+id).remove();
- }
- },
- error : function(err) {
- }
- });
- }
- function toDecimal2(x) {
- var f = parseFloat(x);
- if (isNaN(f)) {
- return false;
- }
- var f = Math.round(x*100)/100;
- var s = f.toString();
- var rs = s.indexOf('.');
- if (rs < 0) {
- rs = s.length;
- s += '.';
- }
- while (s.length <= rs + 2) {
- s += '0';
- }
- return s;
- }
- function delEnclosurName(name,id){
- var en=$('#enclosurName').val();
- var newName=en.replace(name,'');
- $('#enclosurName').val(newName);
- $('#'+id).remove();
-
- }
- function selectToolTipCl(name){
- var e = is_ie ? event : selectToolTipCl.caller.arguments[0];
- obj = is_ie ? e.srcElement : e.target;
- var arr = document.getElementsByName(name);
- var k = arr.length;
- for ( var i = 0; i < k; i++) {
- arr[i].checked = obj.checked;
- }
- $('#addToolTag').hide();
- }
- function selectTagCl(name){
- var e = is_ie ? event : selectTagCl.caller.arguments[0];
- obj = is_ie ? e.srcElement : e.target;
- var arr = document.getElementsByName(name);
- var k = arr.length;
- for ( var i = 0; i < k; i++) {
- arr[i].checked = obj.checked;
- }
- }
- function checkall(name) {
- var e = is_ie ? event : checkall.caller.arguments[0];
- obj = is_ie ? e.srcElement : e.target;
- var arr = document.getElementsByName(name);
- var k = arr.length;
- for ( var i = 0; i < k; i++) {
- arr[i].checked = obj.checked;
- }
- }
- if (is_ie)
- document.documentElement.addBehavior("#default#userdata");
- var userAgent = navigator.userAgent.toLowerCase();
- var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
|