mui.plusReady(function() { window.addEventListener('reload', function(e) { //执行刷新 location.reload(); }); var comName = "山东省全亮共信息科技有限公司"; var cardNum = "810102701421013395"; var cardBank = "日照银行股份有限公司泰安路支行"; $('.comName ').val(comName) $('.comNameBtn').attr("data-value", comName) $('.cardNum ').val(cardNum) $('.cardNumBtn').attr("data-value", cardNum) $('.cardBank ').val(cardBank) $('.cardBankBtn').attr("data-value", cardBank) var self = plus.webview.currentWebview(); //console.log(self); var shopId = self.id; var type = 0; //0 huozhe 1 if ("undefined" != typeof(self.type)) { type = self.type } if (0 == type) { getuncommitted(); } else if (1 == type) { getcommitted(); } $('.con_con_com').eq(type).show().siblings().hide(); $('.con_nav').on("tap", ".nav_header", function() { type = $(this).index(); $(this).addClass('active').siblings().removeClass('active'); $('.con_con_com').eq(type).show().siblings().hide(); if (0 == type) { getuncommitted(); } else if (1 == type) { getcommitted(); } }) $('.committed').on("tap", ".row_title", function() { var idx = $(this).index(); // //console.log(idx); $('.row_cont').eq(idx).toggle() }) $('.committed').on("tap", ".oper", function(e) { e.preventDefault(); e.stopPropagation() id = $(this).parents().parents().attr("data-id") id = parseInt(id); //console.log(id); JZL.openWindow("shoperUploadVoucher.html", "shoperUploadVoucher.html", { orderId: id, shopId: shopId }) }) // $('.btns').on('tap', '.bc_btn', function() { // var idx = $(this).index() // JZL.openWindow("uploadVoucher.html", "uploadVoucher.html") // }) // 获取未提交凭证 getuncommitted(); function getuncommitted() { JZL.ajax(qlgUrl('app/Shoporders/getCertificate'), { shopId: shopId, type: 0 }, function(data) { //console.log(data) if ("undefined" != typeof data.data) { var html = ''; var youhui = 0; var payable = 0; mui.each(data.data, function() { payable = Math.abs(this.payable); youhui = Math.abs(youhui) + payable; html += '
' + this.goodsName + '
' + this.goodsSpecNames + '
¥' + this.goodsPrice + '
没有更多订单了
'; // html = '' } $('.uncommitted .con_con_com_').html(html); }) } var i = 0; //全选或者全不选 $('body').on('change', '#checkall', function() { checkAll('.check1', $(this).prop("checked")); if (false == $(this).prop("checked")) { $('.orderNo').html("0") $('.youhuiNo').html("0") } else { var youhui = 0; $('.orderNo').html($('.check1').length) mui.each($('.indent_youhui span'), function() { youhui += Number($(this).text()) }) $('.youhuiNo').html(youhui) } // if (0 == i) { // $('input[name="check1"]').prop('checked', true); // i = 1; // } else { // / $('input[name="check1"]').prop('checked', false); // i = 0; // } }) // checkAll('.check1',$('#checkall').checked); function checkAll(domName, isChecked) { //console.log(isChecked); $(domName).prop("checked", isChecked); } function checkNum() { var length = $('input[name=check1]:checked').length; var len = $('input[name=check1]').length; if (length == len) { $('#checkall').prop('checked', true); } else { $('#checkall').prop('checked', false); } var youhui = 0; $.each($('input[name="check1"]:checked'), function() { youhui += Number($(this).attr('data-payable')); }) $('.orderNo').html(length); $('.youhuiNo').html(youhui); } $('body').on('change', '.check1', function() { checkNum(); }) var click = 0 $('body').on('tap', ".bc_btn", function() { if (0 == $('input[name="check1"]:checked').length) { mui.alert("请选择至少一个订单") return; } if (1 == click) { return; } click = 1; var orderIdsArr = []; $.each($('input[name="check1"]:checked'), function() { orderIdsArr.push($(this).parents().parents().parents().attr('data-id')) }) orderIds = orderIdsArr.join(',') JZL.openWindow("shoperUploadVoucher.html", "shoperUploadVoucher.html", { shopId: shopId, orderIds: orderIds }) }) var isjiazai = false; function getcommitted(page, PerPage) { var recommenddata = { page: page ? page : 1, PerPage: PerPage ? PerPage : 10 } if (isjiazai == true) { return; } isjiazai = true; JZL.ajax(qlgUrl('app/Shoporders/getCertificate'), { shopId: shopId, type: 1 }, function(data) { //console.log(data); if (1 == data.status) { var data = data.data; var html = ''; var totPayable = 0; if (data.Rows == '') { $('.committed ').append( '没有更多订单了
'); return; } $.each(data.Rows, function() { totPayable = 0; if ("已通过" == this.statusStr) { html += '