|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338 |
- //每页显示的数据个数
- var pagesize = 1;
- var tttHTML = '';
-
-
- window.onload = function(){
- $('.date-picker').datepicker({autoclose:true}).next().on("click", function(){$(this).prev().focus();});
- $('#timepicker1').timepicker({minuteStep: 1,showSeconds: false,showMeridian: false}).next().on("click", function(){$(this).prev().focus();});
- $('#timepicker2').timepicker({minuteStep: 1,showSeconds: false,showMeridian: false}).next().on("click", function(){$(this).prev().focus();});
- var cur = '';
- var currpage = getPar("currpage");
- var select_money_style = '';
- var select_sale_style = '';
- var start_time = '';
- var end_time = '';
- var keywords = '';
- var tradeId = '-1';
- var data = '';
- if(!currpage){
- cur = 1;
- select_money_style = $('#select_money_style').val();
-
- select_sale_style = $('#select_sale_style').val();
-
- start_time = '';
-
- end_time = '';
-
- tradeId = '-1';
-
- keywords = $('#keywords').val();
-
- data = '{type:"fina_log",select_money_style:'+select_money_style+',select_sale_style:'+select_sale_style+',start_time:'+start_time+',end_time:'+end_time+',keywords:'+keywords+',currpage:'+cur+',tradeId:'+tradeId+'}';
- }else{
- cur = currpage;
- select_money_style = getPar('select_money_style');
- $('#select_money_style').val(select_money_style);
-
- select_sale_style = getPar('select_sale_style');
- $('#select_sale_style').val(select_sale_style);
-
- start_time = getPar('start_time');
- $('#start_time').val(start_time);
-
- tradeId = getPar('tradeId');
-
- end_time = getPar('end_time');
- $('#end_time').val(end_time);
-
- keywords = getPar('keywords');
- $('#keywords').val(keywords);
-
- data = '{type:"fina_log",select_money_style:'+select_money_style+',select_sale_style:'+select_sale_style+',start_time:'+start_time+',end_time:'+end_time+',keywords:'+keywords+',currpage:'+cur+',tradeId:'+tradeId+'}';
- }
- tttHTML = $('#list').html();
-
- initdata(cur,select_money_style,select_sale_style,start_time,end_time,keywords,tradeId,data);
-
-
-
- }
- //请求列表
- function initdata(cur,select_money_style,select_sale_style,start_time,end_time,keywords,tradeId,data){
- if(!cur){
- cur = 1;
- }
- if(!select_money_style||!select_sale_style||!start_time||!end_time||!keywords){
-
- select_money_style = $('#select_money_style').val();
-
- select_sale_style = $('#select_sale_style').val();
- if(($("#start_time").val()=="")&&($("#end_time").val()=="")){
- start_time = '';
- end_time = '';
- }else{
- start_time = $("#start_time").val();
- end_time = $("#end_time").val();
- }
-
- keywords = $('#keywords').val();
- tradeId = getPar("tradeId");
- if(!tradeId){
- tradeId="-1";
- }
-
- }
-
- $.ajax({
- url:'./st-xm/control.php',
- type: "post",
- data: {type:"fina_log",
- start_time: start_time,
- end_time: end_time,
- keywords: keywords,
- pagesize: pagesize,
- money: select_money_style,
- channel: select_sale_style,
- cur:cur,
- id:tradeId
- },
- dataType: "json",
- success: function (data) {
- if(data.code == 0){
- console.log(data);
- var sum = data.totalNum;
- var tag = "test";
- var sendurl = './transaction_log.html?select_sale_style='+select_sale_style+'&start_time='+start_time+'&end_time='+end_time+'&keywords='+keywords+'&select_money_style='+select_money_style+'&tradeId='+tradeId;
- getPager(sendurl, sum, cur, pagesize,tag,'currpage');
- createHtml(data);
-
-
- }else if(data.code == -1){
-
- alert('没有相关数据');
- var sum = data.totalNum;
- var tag = "test";
- var sendurl = './transaction_log.html?select_sale_style='+select_sale_style+'&start_time='+start_time+'&end_time='+end_time+'&keywords='+keywords+'&select_money_style='+select_money_style+'&tradeId='+tradeId;
- getPager(sendurl, sum, cur, pagesize,tag,'currpage');
- createHtml(data);
-
- }
- },
- fail: function (data) {
- // 此处放失败后执行的代码
- }
- });
- }
-
- //拼接数据
- function createHtml(data){
- var list = data.list;
- console.log(tttHTML)
- var newHTML='';
- for(var i=0;i<list.length;i++){
- var tempHTML=tttHTML;
- tempHTML=tempHTML.replace('[渠道性质]',list[i].CHAN_QUALITY);
- tempHTML=tempHTML.replace('[渠道分类]',list[i].CHAN_TYPE);
- tempHTML=tempHTML.replace('[渠道名称]',list[i].CHAN_NAME);
- tempHTML=tempHTML.replace('[交易时间]',list[i].CREATE_TIME);
- tempHTML=tempHTML.replace('[交易金额]',list[i].ORDER_PRICE);
- tempHTML=tempHTML.replace('[对应订单号]',list[i].ID);
- tempHTML=tempHTML.replace('[支付方式]',list[i].TYPE_NAME);
- tempHTML=tempHTML.replace('[应收]',list[i].RECE_REE);
- tempHTML=tempHTML.replace('[佣金金额]',list[i].COMMISSION_REE);
- tempHTML=tempHTML.replace('[佣金结算]',list[i].ORDER_PAY_STATUS);
- tempHTML=tempHTML.replace('[ORDER_PAY_ID]',list[i].ORDER_PAY_ID);
- tempHTML=tempHTML.replace('[order_id]',list[i].ID);
- tempHTML=tempHTML.replace('[name]',list[i].ID);
- tempHTML=tempHTML.replace('[id]','ord_'+i);
- newHTML+=tempHTML;
- }
- $('#list').html(newHTML);
-
- //佣金结算
- $(".order_pay").click(function(){
- var ORDER_PAY_ID = $(this).attr("ORDER_PAY_ID");
- var order_id = $(this).attr("order_id");
- var ord_id = $(this).attr("id");
- if(ORDER_PAY_ID == 0){
- return;
- }else{
- if(confirm("该订单佣金已经结算完毕?")){
- $.ajax({
- url:'./st-xm/control.php',
- type: "post",
- data: {type:"fina_update",order_id: order_id},
- dataType: "json",
- success: function (data) {
- if(data.code == 0){
-
- $("#"+ord_id).text("已结");
-
- }else if(data.code == -1){
-
- alert("请检查网络!!!")
-
- }
- },
- fail: function (data) {
- // 此处放失败后执行的代码
- }
- });
- }else{
-
- return;
-
- }
-
- }
-
- });
- }
-
-
-
-
- //复选框判断
- function select_checked(index) {
- //index=0最上面的全选 index=1表示的是下面所有的
- var cur_check = $('.ace_check')[0];
- var checkList = $('.ace_check');
- var checkCount = checkList.length - 1;
- var true_count = 0;
- for (var i = 1; i < checkList.length; i++) {
- if (index == '0') {
- checkList[i].checked = cur_check.checked;
- } else {
- if (checkList[i].checked == false) {
- cur_check.checked = false
- } else {
- true_count = true_count + 1;
- }
- }
- }
- //判断下面是否选中完
- if (checkCount == true_count) {
- cur_check.checked = true;
- }
- }
-
- //得到url上的参数
- function getPar(par){
- var local_url = document.location.href;
- local_url = decodeURI(local_url);
- var get = local_url.indexOf(par +"=");
- if(get == -1){
- return false;
- }
- var get_par = local_url.slice(par.length + get + 1);
- var nextPar = get_par.indexOf("&");
- if(nextPar != -1){
- get_par = get_par.slice(0, nextPar);
- }
- return get_par;
- }
- //点击批量处理按钮
- function click_batch_manage() {
- var arr_manage = new Array();
- $('.ace_check').each(function(index, item) {
- if (this.checked && index != 0) {
- arr_manage.push($(this).attr('name'));
- }
- });
- if (arr_manage.length <= 0) {
- alert('请勾选!!!');
- return;
- }
- var arr_manage_str = arr_manage.join(',');
- alert(arr_manage_str);
- $.ajax({
- url:'./st-xm/control.php',
- type: "post",
- data: {type:"fina_update",order_id: arr_manage_str},
- dataType: "json",
- success: function (data) {
- if(data.code == 0){
-
- window.location.reload();
-
- }else if(data.code == -1){
-
- alert("请检查网络!!!")
-
- }
- },
- fail: function (data) {
- // 此处放失败后执行的代码
- }
- });
-
- }
-
- //批量导出
- function batch_export(){
- var select_money_style = $('#select_money_style').val();
-
- var select_sale_style = $('#select_sale_style').val();
-
- var start_time = $("#start_time").val();
-
- var end_time = $("#end_time").val();
-
- var keywords = $('#keywords').val();
- var arr_manage = new Array();
- var arr_manage_str = "";
- $('.ace_check').each(function(index, item) {
- if (this.checked && index != 0) {
- arr_manage.push($(this).attr('name'));
- }
- });
- if (arr_manage.length <= 0) {
- arr_manage_str = "-1";
-
- }else{
- arr_manage_str = arr_manage.join(',');
- }
-
- var url =
- "./st-xm/Model/fina/export.php?start_time=" + start_time +
- "&end_time=" + end_time +
- "&keywords=" + keywords +
- "&money=" + select_money_style +
- "&channel=" + select_sale_style +
- "&arr_manage_str=" + arr_manage_str;
- var listURL = url;
- window.location.href = listURL;
- // $.ajax({
- // url:'./st-xm/control.php',
- // type: "post",
- // data: {type:"fina_export",
- // start_time: start_time,
- // end_time: end_time,
- // keywords: keywords,
- // money: select_money_style,
- // channel: select_sale_style,
- // arr_manage_str:arr_manage_str
- // },
- // dataType: "json",
- // success: function (data) {
- // if(data.code == 0){
-
- // window.location.reload();
-
- // }else if(data.code == -1){
-
- // alert("请检查网络!!!")
-
- // }
- // },
- // fail: function (data) {
- // // 此处放失败后执行的代码
- // }
- // });
- }
-
-
-
-
|