Commit 2affb190 authored by agping's avatar agping

导出

parent 67844e78
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading breadcrumb"> <div class="panel-heading breadcrumb">
<li> <li>
<a href="#">业绩调整记录</a> <a href="#">黑名单列表</a>
</li> </li>
</div> </div>
......
...@@ -118,7 +118,9 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -118,7 +118,9 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$(document).delegate("#password", "click", function() { $(document).delegate("#password", "click", function() {
$(this).val('').attr('type', 'password'); $(this).val('').attr('type', 'password');
}); });
$(document).on("click", ".black-list", function() { //点击黑名单
agent.agent_id = $(this).attr("data-id");
});
$(document).on("click", ".phone-bundling", function() { //点击绑定手机 $(document).on("click", ".phone-bundling", function() { //点击绑定手机
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
agent.getPhoneBindingList(browser_version); agent.getPhoneBindingList(browser_version);
...@@ -291,7 +293,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -291,7 +293,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$('#file_input').on('change', function(){ $('#file_input').on('change', function(){
var _this = $(this); var _this = $(this);
var formData = new FormData(); var formData = new FormData();
formData.append('type', 'chat'); formData.append('type', 'agent_black_list_img');
formData.append('image', _this[0].files[0]); formData.append('image', _this[0].files[0]);
$.ajax({ $.ajax({
type: 'post', type: 'post',
...@@ -306,7 +308,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -306,7 +308,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
if(_data.code == 200) { if(_data.code == 200) {
$('#container_body_img_area').append('<div class="result"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del">删除</span></div>'.stringFormatObj({ $('#container_body_img_area').append('<div class="result"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path, '0': _data.data.img_path,
'1': _data.data.internet_img_name?urlDeal(_data.data.internet_img_name):_data.data.internet_img_name '1': '/'+_data.data.internet_img_name
// '1': _data.data.internet_img_name?urlDeal(_data.data.internet_img_name):_data.data.internet_img_name
})); }));
} else { } else {
alert(_data.msg); alert(_data.msg);
...@@ -347,24 +350,18 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -347,24 +350,18 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
var _this = $(this); var _this = $(this);
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var _data={};
_data['content']=$('.black-list-text').val();
_data['agents_id']=agent.agent_id;
var imgname = []; var imgname = [];
for(var i = 0; i < $('.result').length; i++) { for(var i = 0; i < $('.result').length; i++) {
imgname[i] = $('.result>img').eq(i).attr('data-imgname'); imgname[i] = $('.result>img').eq(i).attr('data-imgname');
}; };
console.log(imgname.join(',')); console.log(imgname.join(','));
var id_pic = agent.house_fatherid > 0?agent.house_fatherid:agent.house_id; _data['img_info'] = imgname.join(',');
var _data = {
img_id: id_pic
};
//无新的图片上传 不调用接口
if(imgname.join(',')) {
_data['img_name'] = imgname.join(',');
} else {
return
};
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: '/index/addReceiptImg', url: '/index/addAgentsBlackList',
data: _data, data: _data,
dataType: 'json', dataType: 'json',
beforeSend: function() {}, beforeSend: function() {},
......
...@@ -3,6 +3,9 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', ' ...@@ -3,6 +3,9 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', '
pageNo: 1, pageNo: 1,
/*第几页*/ /*第几页*/
pageSize: 15, pageSize: 15,
agent_id:'',
agents_id:'',
/*每页显示多少条*/ /*每页显示多少条*/
init: function() { init: function() {
//初始化dot //初始化dot
...@@ -18,6 +21,11 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', ' ...@@ -18,6 +21,11 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', '
$("#reset").click(function() { //重置 $("#reset").click(function() { //重置
document.getElementById("form_search").reset(); document.getElementById("form_search").reset();
}); });
$(document).on("click", ".black-list", function() { //点击详情
adjustment.agent_id = $(this).attr("data-id");
adjustment.agents_id = $(this).attr("data-ids");
adjustment.getaddPicList();
});
//收款图片-点击添加图片事件 //收款图片-点击添加图片事件
$('#file_input').on('change', function(){ $('#file_input').on('change', function(){
var _this = $(this); var _this = $(this);
...@@ -82,20 +90,17 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', ' ...@@ -82,20 +90,17 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', '
for(var i = 0; i < $('.result').length; i++) { for(var i = 0; i < $('.result').length; i++) {
imgname[i] = $('.result>img').eq(i).attr('data-imgname'); imgname[i] = $('.result>img').eq(i).attr('data-imgname');
}; };
console.log(imgname.join(',')); var _data = {};
var id_pic = adjustment.house_fatherid > 0?adjustment.house_fatherid:adjustment.house_id;
var _data = {
img_id: id_pic
};
//无新的图片上传 不调用接口 //无新的图片上传 不调用接口
if(imgname.join(',')) { if(imgname.join(',')){
_data['img_name'] = imgname.join(','); _data['img_info'] = imgname.join(',');
} else { }
return _data['content']=$('.black-list-text').val();
}; _data['agents_id']=adjustment.agent_id;
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: '/index/addReceiptImg', url: '/index/addAgentsBlackList',
data: _data, data: _data,
dataType: 'json', dataType: 'json',
beforeSend: function() {}, beforeSend: function() {},
...@@ -127,16 +132,15 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', ' ...@@ -127,16 +132,15 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', '
params.phone = $('#user_phone').val(); params.phone = $('#user_phone').val();
params.name = $('#user_name').val(); params.name = $('#user_name').val();
$.ajax({ $.ajax({
url: '/index/getPerformanceRecordList', //获取列表 url: '/index/getAgentsBlackList', //获取列表
type: 'GET', type: 'GET',
async: true, async: true,
data: params, data: params,
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
console.log(data);
var temp = document.getElementById('black_list_tpl').innerHTML; var temp = document.getElementById('black_list_tpl').innerHTML;
var doTtmpl = doT.template(temp); var doTtmpl = doT.template(temp);
$("#black_list_con").html(doTtmpl(data.data.data)); $("#black_list_con").html(doTtmpl(data.data.data_list));
/*分页代码*/ /*分页代码*/
add_page(data.data.total, pageNo, adjustment.pageSize, adjustment.getList); add_page(data.data.total, pageNo, adjustment.pageSize, adjustment.getList);
} }
...@@ -145,9 +149,9 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', ' ...@@ -145,9 +149,9 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', '
spandelList: function(n) { //删除已经保存的图片都调用 spandelList: function(n) { //删除已经保存的图片都调用
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
'url': '/index/deleteReceiptImg', 'url': '/index/delAgentsBlackListImg',
data: { data: {
id: n agents_black_list_img_id: n
}, },
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
...@@ -160,24 +164,22 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', ' ...@@ -160,24 +164,22 @@ define(['doT', 'text!temp/black_list_template_tpl.html', 'css!style/home.css', '
getaddPicList: function() { getaddPicList: function() {
//获取收款图片 //获取收款图片
$('#container_body_img_area').html('');//每回先清空所有图片 $('#container_body_img_area').html('');//每回先清空所有图片
var id_pic = follow.house_fatherid > 0?follow.house_fatherid:follow.house_id;
$('.result2,.result').remove(); //删除之前存在的图片 显示从接口获取的数据 用来区分新添加的 和 已经保存的 $('.result2,.result').remove(); //删除之前存在的图片 显示从接口获取的数据 用来区分新添加的 和 已经保存的
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
'url': '/index/receiptImgList', 'url': '/index/getBlackListInfo',
data: { data: {
"id": id_pic, "agents_black_list_id": adjustment.agent_id,
}, },
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
$('.black-list-text').val(data.data.content);
//渲染已经有的列表 //渲染已经有的列表
// <img src='[%= it[item]["agent_img"] %]' class="diagram-image J_preview" for(i = 0; i < data.data.img_list.length; i++) {
// data-bimg='[%= it[item]["agent_img"] %]'>
for(i = 0; i < data.data.length; i++) {
$('#container_body_img_area').append('<div class="result2"><img data-imgid="{0}" src="{1}" alt="" class="diagram-image J_preview" data-bimg="{1}"/> <span class="span-del2">删除</span></div>'.stringFormatObj({ $('#container_body_img_area').append('<div class="result2"><img data-imgid="{0}" src="{1}" alt="" class="diagram-image J_preview" data-bimg="{1}"/> <span class="span-del2">删除</span></div>'.stringFormatObj({
'0': data.data[i].id, '0': data.data.img_list[i].agents_black_list_img_id,
'1': data.data[i].img_name?urlDeal(data.data[i].img_name):data.data[i].img_name '1': data.data.img_list[i].internet_path?urlDeal(data.data.img_list[i].internet_path):data.data.img_list[i].internet_path
})); }));
}; };
......
...@@ -486,6 +486,7 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs ...@@ -486,6 +486,7 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs
var bargain_end_date = $('#end_dealtime').val(); var bargain_end_date = $('#end_dealtime').val();
var district_id = $("#district_id").val(); //部门id 添加字段 var district_id = $("#district_id").val(); //部门id 添加字段
var store_id = $('#guest_stores').val(); var store_id = $('#guest_stores').val();
var confirm_date = $('#confirm_commission').val();
var str = '/index/getCommissionTotalList?excel=1'; var str = '/index/getCommissionTotalList?excel=1';
if (name) { if (name) {
str += '&name=' + name; str += '&name=' + name;
...@@ -517,6 +518,9 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs ...@@ -517,6 +518,9 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs
if (store_id) { if (store_id) {
str += '&store_name=' + store_id; str += '&store_name=' + store_id;
} }
if (confirm_date) {
str += '&confirm_date=' + confirm_date;
}
window.open(str) window.open(str)
} }
......
...@@ -59,7 +59,13 @@ ...@@ -59,7 +59,13 @@
<a class="btn1 btn-success phone-bundling btn-default-hide-display" href="#modal-phonebundling" data-toggle="modal" data-id='[%= it[item]["id"] %]'>绑定手机/电脑</a> <a class="btn1 btn-success phone-bundling btn-default-hide-display" href="#modal-phonebundling" data-toggle="modal" data-id='[%= it[item]["id"] %]'>绑定手机/电脑</a>
<a class="btn1 btn-success btn-default-hide-display state-record" href="#modal-stateRecord" data-toggle="modal" data-id='[%= it[item]["id"] %]'>状态记录</a> <a class="btn1 btn-success btn-default-hide-display state-record" href="#modal-stateRecord" data-toggle="modal" data-id='[%= it[item]["id"] %]'>状态记录</a>
[% if(it[item]["status"] == 4) {%]
<a class="btn1 btn-default btn-default-hide-display" href="" data-toggle="modal" data-id='[%= it[item]["id"] %]'>已黑化</a>
[% }else{ %]
<a class="btn1 btn-success btn-default-hide-display black-list" href="#modal-blackList" data-toggle="modal" data-id='[%= it[item]["id"] %]'>加黑名单</a> <a class="btn1 btn-success btn-default-hide-display black-list" href="#modal-blackList" data-toggle="modal" data-id='[%= it[item]["id"] %]'>加黑名单</a>
[% } %]
[% } %] [% } %]
<a class="btn1 btn-default btn-default-hide-caozuo btn-default-hide-display"><<<</a> <a class="btn1 btn-default btn-default-hide-caozuo btn-default-hide-display"><<<</a>
[% } %] [% } %]
......
...@@ -3,13 +3,17 @@ ...@@ -3,13 +3,17 @@
[% for(var item in it){ %] [% for(var item in it){ %]
<tr> <tr>
<td>[%= it[item]['create_time'] %]</td> <td>[%= it[item]['create_time'] %]</td>
<td>[%= it[item]['id'] %]</td> <td>[%= it[item]['agents_id'] %]</td>
<td>[%= it[item]['name'] %]</td> <td class="text-center">
<td>[%= it[item]['phone']%]</td> <input type="hidden" value='[%= it[item]["agent_img"] %]'>
<td>[%= it[item]['store_name'] %]</td> <img src='[%= it[item]["head_portrait"] %]' class="diagram-image J_preview"
<td>[%= it[item]['performance_time']%]</td> data-bimg='[%= it[item]["head_portrait"] %]'>
</td>
<td>[%= it[item]['name']%]</td>
<td>[%= it[item]['phone'] %]</td>
<td>[%= it[item]['store_name']%]</td>
<td> <td>
<a class="btn1 btn-success black-list" href="#modal-blackList" data-toggle="modal" data-id='[%= it[item]["id"] %]'>详情</a> <a class="btn1 btn-success black-list" href="#modal-blackList" data-toggle="modal" data-id='[%= it[item]["agents_black_list_id"] %]' data-ids='[%= it[item]["agents_id"] %]'>详情</a>
</td> </td>
</tr> </tr>
[% } %] [% } %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment