|
- //每页显示的数据个数
- var pagesize = 10;
- var tttHTML = '';
-
-
- window.onload = function(){
- var cur = '';
- var currpage = getPar("currpage");
- var keywords = '';
- var data = '';
-
- if(!currpage){
- cur = 1;
- keywords = $('#keywords').val();
-
- data = '{type:"fina_apply",keywords:'+keywords+',currpage:'+cur+'}';
- }else{
- cur = currpage;
-
- keywords = getPar('keywords');
- $('#keywords').val(keywords);
-
- data = '{type:"fina_apply",keywords:'+keywords+',currpage:'+cur+'}';
- }
- tttHTML = $('#list').html();
-
- initdata(cur,keywords,data);
-
- }
-
- //请求列表
- function initdata(cur,keywords,data) {
- if (!cur) {
- cur = 1;
- }
- if (!keywords) {
-
- keywords = $('#keywords').val();
-
- }
-
- $.ajax({
- url: './st-xm/control.php',
- type: "post",
- data: {
- type: "fina_apply",
- keywords: keywords,
- pagesize: pagesize,
- cur: cur
- },
- dataType: "json",
- success: function (data) {
- if (data.code == 0) {
- console.log(data);
- var sum = data.totalNum;
- var tag = "test";
- var sendurl = './money_applyfor.html?keywords=' + keywords;
- getPager(sendurl, sum, cur, pagesize, tag, 'currpage');
- createHtml(data);
- document.getElementById("aaa").innerHTML = "共"+sum+"条数据";
-
- } else if (data.code == -1) {
-
- alert('没有相关数据');
- var sum = data.totalNum;
- var tag = "test";
- var sendurl = './money_applyfor.html?keywords=' + keywords;
- 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].APPLY_TIME);
- tempHTML=tempHTML.replace('[申请事项]','佣金提现');
- tempHTML=tempHTML.replace('[申请金额]',list[i].APPLY_MONEY);
- tempHTML=tempHTML.replace('[账号]',list[i].BANK_ACCOUNT);
- tempHTML=tempHTML.replace('[银行]',list[i].BANK_NAME);
- tempHTML=tempHTML.replace('[状态]',list[i].STUTAS);
- tempHTML=tempHTML.replace('[APPLYID]',list[i].ID);
- tempHTML=tempHTML.replace('[STUTA]',list[i].STUTA);
- tempHTML=tempHTML.replace('[name]',list[i].ID);
- tempHTML=tempHTML.replace('[ids]',"ids"+i);
- tempHTML=tempHTML.replace('[tradeId]',list[i].ID);
- if(list[i].STUTA==0){
- tempHTML=tempHTML.replace('[处理]',"");
- }else{
- tempHTML=tempHTML.replace('[处理]',"处理");
- }
- // tempHTML=tempHTML.replace('[佣金金额]',list[i].COMMISSION_REE);
- newHTML+=tempHTML;
-
-
- }
- $('#list').html(newHTML);
-
- $(".deal").click(function(){
-
- var applyid = $(this).attr("APPLYID");
- if(confirm("该条佣金申请已经进行打款处理?")){
- $.ajax({
- url:'./st-xm/control.php',
- type: "post",
- data: {type:"fina_updateapply",id:applyid},
- dataType: "json",
- success: function (data) {
- if(data.code == 0){
-
- window.location.reload();
-
- }else if(data.code == -1){
-
- alert("请检查网络!!!")
-
- }
- },
- fail: function (data) {
- // 此处放失败后执行的代码
- }
- });
- }else{
-
- return;
-
- }
-
-
- });
- // $(".trade").click(function(){
-
- // var tradeId = $(this).attr("tradeId");
- // setStorage("tradeId",tradeId);
- // window.location.href="";
-
- // });
-
-
- //window.location.href="sell_manage.html";
-
- }
-
- //复选框判断
- 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(',');
- $.ajax({
- url:'./st-xm/control.php',
- data: {type:"fina_updateapply",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) {
- // 此处放失败后执行的代码
- }
- });
- }
|