123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- $(function() {
- $('button[node-qmk="tm"]').click(function(){
- var id=$(this).attr('data');
- $('#'+id).attr('value',$('#'+id).attr('data-tm'));
- });
-
- $('a[receiptWasteDetail]').click(function(){
-
- var ridKey=$(this).attr('data');
- var url="/ajaxGetReceiptDetailByJson";
- $.ajax({
- url:url,
- type: "post",
- cache: false,
- dataType: "json",
- data: {
- ridKey:ridKey
- },
- global: true,
- success: function(data){
- if(data.status==1){
- $('#ridKey').val(data.detail.ridKey);
-
- $("#receiptTrainType").hide();
- $("#receiptType").show();
- $("#receiptTrainPrice").hide();
- $("#receiptPrice").show();
- $("#paymentAuthCode").val('');
- $("#receiptPrice").html('¥'+Math.abs(data.detail.sum).toFixed(2));
-
- if(data.detail.Rtype==0){
- $("#Rtype").html('报销单');
- $("#receiptType").html('<span class="colRed">支出</span>');
- }else if(data.detail.Rtype==1){
- if(data.detail.isBK==0){
- $("#Rtype").html('借款');
- $("#receiptType").html('<span class="colRed">支出</span>');
- }else if(data.detail.isBK==1){
- $("#Rtype").html('借款(报销)');
- var rsum =Math.abs((data.detail.sum-data.detail.loanSum));
- $("#receiptPrice").html('¥'+rsum.toFixed(2));
- if(rsum>=0){
- $("#receiptType").html('<span class="colGreen">收入</span>');
- }else{
- $("#receiptType").html('<span class="colRed">支出</span>');
- }
- }
- }else if(data.detail.Rtype==2){
- $("#Rtype").html('对公汇款');
- $("#receiptType").html('<span class="colRed">支出</span>');
- //-------------------------------------------------------------
- }else if(data.detail.Rtype==3){
- $("#Rtype").html('培训班费用');
- if(data.detail.payment>=0){
- $("#receiptType").html('<span class="colGreen">收入</span>');
- }else{
- $("#receiptType").html('<span class="colRed">支出</span>');
- }
- $("#receiptPrice").html('¥'+Math.abs(data.detail.payment).toFixed(2));
- $("#paymentAuthCode").val(data.detail.paymentAuthCode);
- // $("#receiptTrainType").show();
- // $("#receiptType").hide();
- // $("#receiptTrainPrice").show();
- // $("#receiptPrice").hide();
- }
-
- if(data.detail.status==2){
- $("#status").html('审批中');
- }else if(data.detail.status==1 || data.detail.status==6){
- $("#status").html('执行中');
- }
-
- data.detail.amount=Math.abs(data.detail.amount);
- $("#sum").html('¥'+data.detail.sum);
- if(data.detail.amount!=null){
- if(data.detail.isBK==1){
- $("#amount").html('¥'+rsum.toFixed(2));
- }else{
- $("#amount").html('¥'+data.detail.amount.toFixed(2));
- }
- }else{
- $("#amount").html('¥0');
- }
-
-
- }
- },
- error:function(err){
- }
- });
- });
-
-
-
-
-
- })
|