123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- function invoiceShow(){
-
- var chkRadio = $('input:radio[name="invoiceType"]:checked').val();
- if (chkRadio == null) {
- alert("没有选中项");
- return false;
- } else if(chkRadio==1) {
- $('#plainInvoice_box').hide();
- $('#specialInvoice_box').show();
- }else if(chkRadio==0){
- $('#plainInvoice_box').show();
- $('#specialInvoice_box').hide();
- }
-
- }
- function settlementTypeShow(){
- var chkRadio = $('input:radio[name="settlementType"]:checked').val();
- if (chkRadio == null) {
- alert("没有选中项");
- return false;
- } else if(chkRadio=='TRAINING') {
- $('#trainingSelect').show();
- }else if(chkRadio=='SOFTWARE'){
- $('#trainingSelect').hide();
- }
- }
- function mailShow(){
- var chkRadio = $('input:radio[name="doPost"]:checked').val();
- if (chkRadio == null) {
- alert("没有选中项");
- return false;
- } else if(chkRadio==1) {
- $('#mail_box').show();
- }else if(chkRadio==0){
- $('#mail_box').hide();
- }
- }
- $(function () {
-
- $('#invoiceReceivablesRefund').validator({
- timely: 3,
- focusCleanup: true,
-
- fields: {///ajaxCheckInvoicePrice, iidKey:#inKey
- refundCompany: 'required;'
- ,refundNumber: 'required;'
- ,refundPrice: 'required;remote[/ajaxCheckInvoiceReceivablesRefund, iridKey:#iridKey]'
-
- }
- });
-
- $('#invoice').validator({
- // timely: 3,
- // focusCleanup: true,
- rules: {
- invoiceTitle: function() {
- return $('#invoicePlain').prop('checked');
- },
- invoiceCompany: function() {
- return $('#invoiceSpecial').prop('checked');
- }
- ,isMail: function() {
- return $('#isMail').prop('checked');
- }
- ,isSettlementType: function() {
- return $('#settlementType').prop('checked');
- }
-
- // ,isInvoicePrice: function() {
- // var invoicePrice=$('#isInvoicePrice').val();
- // console.log(invoicePrice);
- // if(invoicePrice>10000){
- // return false;
- // }
- // //return $('#isMail').prop('checked');
- // }
-
- },
- fields: {//tel(invoiceCompany);digits(invoiceCompany)
- invoiceTitle: 'required(invoiceTitle);',
- invoiceCompany:'required(invoiceCompany);',
- TIN:'required(invoiceCompany);',
- address:'required(invoiceCompany);',
- phone:'required(invoiceCompany);',//mobile|tel;
- bank:'required(invoiceCompany);',
- bankAccount:'required(invoiceCompany);'
- ,invoicePrice: 'match(lte, 100001)'
- ,invoiceQuantity: ' required;'
- ,invoiceUnitPrice: 'required;'
-
- ,trainId:'required(isSettlementType); '
- // ,items: 'required(isItems); '
- // ,tx: 'required;'
- ,invoiceType: 'required'
- ,recipients: 'required(isMail); '
- ,recipientsPhone: 'required(isMail); '//digits(isMail);
- ,recipientsAddress: 'required(isMail); '
- }
- });
-
- $("form[name='invoiceApproval']").validator({
- timely: 3,
- focusCleanup: true,
- theme:"yellow_top",
- fields: {
- //'opinion': 'required; '
- }
- });
-
- $("form[name='invoicePrint']").validator({
- timely: 3,
- focusCleanup: true,
- theme:"yellow_top",
- fields: {
- 'invoiceNo': 'required;remote[/ajaxCheckInvoiceNoUniqueness]'
- }
- });
- $("form[name='invoiceExpress']").validator({
- timely: 3,
- focusCleanup: true,
- theme:"yellow_top",
- fields: {
- 'actualItems': 'required; ',
- 'nu': 'required; ',
- 'express': 'required; '
- }
- });
-
- $("form[name='untreadInvoice']").validator({
- timely: 3,
- focusCleanup: true,
- rules: {
- isUntread: function() {
- return $("input[node-untread='post']").prop('checked');
- }
- },
- fields: {
- untreadReason: 'required; '
- ,untreadPost: 'required; '
- ,untreadCompany: 'required(isUntread); '
- ,untreadNumber: 'required(isUntread); '
- ,untreadItems: 'required(isUntread); '
- }
- });
-
- //培训班添加
- $("form[name='invoiceTraining']").validator({
- timely: 3,
- focusCleanup: true,
- fields: {//remote[/ajaxCheckInvoicePrice]
- trainName: 'required;'
- ,trainDate: 'required; '
-
- }
- });
-
- //收款录入
- $("form[name='receivablesInvoice']").validator({
- timely: 3,
- focusCleanup: true,
- fields: {//remote[/ajaxCheckInvoicePrice]
- receivablesPrice: 'required;'
- ,receivablesMessage: 'required; '
- ,receivablesBank: 'required '
- ,receivablesDate: 'required '
- ,receivablesCategory: 'required '
- ,receivablesStaff: 'required '
- }
- });
-
- //入账
- $("form[name='receivablesInvoiceBind']").validator({
- // dataFilter: function(data) {
- // console.log(data);
- // return "ddd";
- //// if (data.status === 200) return "2333";
- //// else return data.msg;
- // },
- timely: 3,
- focusCleanup: true,
- fields: {//remote(/ajaxCheckInvoicePrice, iidKey:#inKey);
- receivablesPrice: 'required;'
- ,receivablesMessage: 'required; '
- ,receivablesBank: 'required '
- ,receivablesDate: 'required '
- ,receivablesCategory: 'required '
- ,receivablesStaff: 'required '
- }
- });
-
- $("input[checkInvoicePrice=true]").on('input',function(e){
- var inKey=$('#inKey').val();
- var receivablesPrice=$(this).val();
- var url = "/ajaxCheckInvoicePrice";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- iidKey : inKey,
- receivablesPrice:receivablesPrice
- },
- global : true,
- success : function(data) {
-
- if(data!=null)
- $('span[checkInvoicePrice=msg]').html(data.error);
- else
- $('span[checkInvoicePrice=msg]').html('');
-
-
- },
- error : function(err) {
- }
- });
- });
-
-
- $("form[name='receivablesAscription']").validator({
- timely: 3,
- focusCleanup: true,
- fields: {
- recepitTitleMark: 'required '
- }
- });
-
- $("#IPA").validator({
- timely: 3,
- focusCleanup: true,
- fields: {
- invoiceCode: 'required;',
- invoiceNoStart: 'required;digits; ',
- invoiceNoTotal: 'required;digits; ',
- }
- });
-
- $('#invoiceQuantity').on('input',function(e) {
- var invoiceUnitPrice=$('#invoiceUnitPrice').val();
- var invoiceQuantity=$(this).val();
- var tp=invoiceUnitPrice*invoiceQuantity;
- $("#tp").html('¥'+tp);
- });
-
- $('#invoiceUnitPrice').on('input',function(e) {
- var invoiceUnitPrice=$('#invoiceQuantity').val();
- var invoiceQuantity=$(this).val();
- var tp=invoiceUnitPrice*invoiceQuantity;
- $("#tp").html('¥'+tp);
- });
-
- })
|