Commit 6cf08438 authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/0702-v.2.2.0' into 0702-v.2.2.0

parents 536d6d55 dbdba08d
...@@ -77,7 +77,7 @@ class Collection extends Basic ...@@ -77,7 +77,7 @@ class Collection extends Basic
} }
if (empty($this->params['excel'])) { if (empty($this->params['excel'])) {
$field = 'a.id,a.order_id,a.create_time,c.user_name,c.user_phone,a.money,a.real_money,a.pay_type,a.house_number,a.type,d.internal_title,d.internal_address,a.source'; $field = 'a.id,a.father_id,a.order_id,a.create_time,c.user_name,c.user_phone,a.money,a.real_money,a.pay_type,a.house_number,a.type,d.internal_title,d.internal_address,a.source';
$data['data']['list'] = $order->getAddPayLogOrderListLmit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where); $data['data']['list'] = $order->getAddPayLogOrderListLmit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data['data']['total'] = $order->getAddPayLogOrderListLmitTotal($where); $data['data']['total'] = $order->getAddPayLogOrderListLmitTotal($where);
$data['data']['money_total'] = $order->getMoneyTotal(); //总额 $data['data']['money_total'] = $order->getMoneyTotal(); //总额
......
...@@ -97,83 +97,106 @@ ...@@ -97,83 +97,106 @@
margin-top: -350px; margin-top: -350px;
} }
/*上传图片列表 样式*/ /*上传图片列表 样式*/
.form-group { .form-group {
margin: 10px; margin: 10px;
} }
.input-100-width { .input-100-width {
width: 100px!important; width: 100px!important;
} }
.input-360-width { .input-360-width {
width: 360px!important; width: 360px!important;
} }
.textarea-500-width { .textarea-500-width {
width: 500px!important; width: 500px!important;
} }
.list-group-item>.full-width-100+.full-width-100 { .list-group-item>.full-width-100+.full-width-100 {
padding-top: 10px; padding-top: 10px;
} }
.list-group-item>.full-width-100>label { .list-group-item>.full-width-100>label {
width: 60px; width: 60px;
} }
.list-group-item>.full-pic-area>label { .list-group-item>.full-pic-area>label {
width: 120px; width: 120px;
} }
.delet-pic-btn{
color:red; .delet-pic-btn {
} color: red;
/*css样式*/ }
.img-cont{ /*css样式*/
width:1000px;
height:570px; .img-cont {
border:2px solid #317ef3; width: 1000px;
margin:50px auto; height: 570px;
} border: 2px solid #317ef3;
margin: 50px auto;
.img-cont>div{ }
width:300px;
height:260px; .img-cont>div {
border:1px solid #777; width: 300px;
float:left; height: 260px;
margin:20px 0 0 20px; border: 1px solid #777;
} float: left;
margin: 20px 0 0 20px;
.img-cont>div>div{ }
width:300px;
height:220px; .img-cont>div>div {
border:1px solid red; width: 300px;
} height: 220px;
border: 1px solid red;
.img-cont>div>a{ }
width:60px;
height:30px; .img-cont>div>a {
border-radius:4px; width: 60px;
height: 30px;
border-radius: 4px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
color:#fff; color: #fff;
display: block; display: block;
background: #317ef3; background: #317ef3;
margin:5px 0 0 0px; margin: 5px 0 0 0px;
cursor: pointer; cursor: pointer;
} }
.hide{ .hide {
display: none !important; display: none !important;
} }
.result{
.result,.result2 {
width: 600px; width: 600px;
} }
.result>img{
.result>img,.result2>img{
width: 200px; width: 200px;
height: 200px; height: 200px;
} }
/*css样式*/ #container_body{
position: relative;
}
#file_input {
opacity: 0;
position: absolute;
top: 0;
left: 145px;
height: 35px;
width: 80px;
}
.out-style {
position: absolute;
top: 0;
left: 60px;
}
/*css样式*/
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
...@@ -308,6 +331,7 @@ ...@@ -308,6 +331,7 @@
<!--input上传图片--> <!--input上传图片-->
<div id="container_body"> <div id="container_body">
<label>请选择一个图像文件:</label> <label>请选择一个图像文件:</label>
<button type="button btn2" class="btn btn-default">上传图片</button>
<input type="file" id="file_input"/> <input type="file" id="file_input"/>
</div> </div>
</div> </div>
...@@ -320,7 +344,7 @@ ...@@ -320,7 +344,7 @@
<div class="modal-footer"> <div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭 <!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>--> </button>-->
<button type="button" class="btn btn-primary" id="saveBtn" data-dismiss="modal"> <button type="button btn2" class="btn btn-primary" id="saveBtn" data-dismiss="modal">
保存 保存
</button> </button>
</div> </div>
...@@ -331,4 +355,4 @@ ...@@ -331,4 +355,4 @@
</div> </div>
<div id="img_mask_area" title="点击任意位置可关闭"> <div id="img_mask_area" title="点击任意位置可关闭">
<img /> <img />
</div> </div>
\ No newline at end of file \ No newline at end of file
...@@ -279,8 +279,11 @@ function loadMain(){ ...@@ -279,8 +279,11 @@ function loadMain(){
var _this = $(this); var _this = $(this);
if((_this.attr('data-markid') == '1') || (_this.attr('data-markid') == '4')){ if((_this.attr('data-markid') == '1') || (_this.attr('data-markid') == '4')){
//如果选择了未打通,或取消拨打,则直接关闭 //如果选择了未打通,或取消拨打,则直接关闭
if(_this.parent().parent().index() === 0){
//只有在.genjin-mark-area-putong,电话跟进特有,下的标签才会隐藏
_genjinModal.hide();//跟进模态框关闭 _genjinModal.hide();//跟进模态框关闭
return false; return false;
}
}; };
if(!_this.hasClass('genjin-mark-active')){ if(!_this.hasClass('genjin-mark-active')){
_this.addClass('genjin-mark-active').siblings().removeClass('genjin-mark-active'); _this.addClass('genjin-mark-active').siblings().removeClass('genjin-mark-active');
...@@ -292,8 +295,6 @@ function loadMain(){ ...@@ -292,8 +295,6 @@ function loadMain(){
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var _genjinMarkOBj = $('.genjin-mark-area-zhuangtai .genjin-mark-active'), var _genjinMarkOBj = $('.genjin-mark-area-zhuangtai .genjin-mark-active'),
_genjinMarkOBj2 = $('.genjin-mark-area-putong .genjin-mark-active'), _genjinMarkOBj2 = $('.genjin-mark-area-putong .genjin-mark-active'),
_beizhuObjVal = $.trim(_beizhuObj.val()), _beizhuObjVal = $.trim(_beizhuObj.val()),
...@@ -340,9 +341,6 @@ function loadMain(){ ...@@ -340,9 +341,6 @@ function loadMain(){
if(_isFreeFlag) { if(_isFreeFlag) {
freePhone(); freePhone();
}; };
layer.close(_index);
return false;
//如果是电话跟进,选择了没打通或者取消拨打,则关掉不进行提交
}else{ }else{
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
<li class="main-sec-li"> <li class="main-sec-li">
<div>应收佣金<span class="left">{{commission}}</span></div> <div>应收佣金<span class="left">{{commission}}</span></div>
</li> </li>
<li class="main-sec-li"> <li class="main-sec-li" v-if="!(estimated_receipt_date==''||estimated_receipt_date==null)">
<div>预计收款时间<span class="left">{{commission}}</span></div> <div>预计收款时间<span class="left">{{estimated_receipt_date}}</span></div>
</li> </li>
</ul> </ul>
<ul v-for="(item, index) in list"> <ul v-for="(item, index) in list">
...@@ -182,6 +182,7 @@ ...@@ -182,6 +182,7 @@
house_number: '', house_number: '',
price: '', price: '',
commission: '', commission: '',
estimated_receipt_date:'',
is_open: '', is_open: '',
trade_type: '', trade_type: '',
token: '', token: '',
...@@ -230,7 +231,14 @@ ...@@ -230,7 +231,14 @@
} }
if(e =='5') { if(e =='5') {
return '合作方' return '合作方'
}else{ }if(e =='6') {
return 'APP盘下载方'
}
if(e =='7') {
return 'APP客下载方'
}
else{
layer.tipsX('分佣方类型判断错误'); layer.tipsX('分佣方类型判断错误');
} }
}, },
...@@ -260,6 +268,7 @@ ...@@ -260,6 +268,7 @@
_this.house_number = response.data.data.bargainInfo.house_number; _this.house_number = response.data.data.bargainInfo.house_number;
_this.commission = response.data.data.bargainInfo.commission; _this.commission = response.data.data.bargainInfo.commission;
_this.price = response.data.data.bargainInfo.price; _this.price = response.data.data.bargainInfo.price;
_this.estimated_receipt_date=response.data.data.bargainInfo.estimated_receipt_date;
_this.list = response.data.data.bargainInfo.realIncome; _this.list = response.data.data.bargainInfo.realIncome;
_this.Datas = response.data.data.cent_commission; _this.Datas = response.data.data.cent_commission;
_this.taxDatas = response.data.data.taxes; _this.taxDatas = response.data.data.taxes;
......
define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_template_tpl.html','css!style/home.css', 'pagination', 'bootstrapJs','ckfinder', 'ckfinderStart', 'blow-up'], function (doT, template,template_binding) { define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_template_tpl.html', 'css!style/home.css', 'pagination', 'bootstrapJs', 'ckfinder', 'ckfinderStart', 'blow-up'], function(doT, template, template_binding) {
var agent = { var agent = {
pageNo : 1, pageNo: 1,
pageSize : 15, pageSize: 15,
agent_id : 0, agent_id: 0,
init: function () { idArray: '',
init: function() {
//初始化dot //初始化dot
$("body").append(template+template_binding); $("body").append(template + template_binding);
agent.getList(); agent.getList();
agent.event(); agent.event();
}, },
event: function () { event: function() {
var _doc = $(document); var _doc = $(document);
agent.getDistrict(function(){ agent.getDistrict(function() {
_doc.on('input', '[name=district_id]', function(){ _doc.on('input', '[name=district_id]', function() {
var _this = $(this); var _this = $(this);
var _id = _this.val(); var _id = _this.val();
var _objTemp = _this.parent().next().find('select'); var _objTemp = _this.parent().next().find('select');
_objTemp.html('');//先清空 _objTemp.html(''); //先清空
if(_id && _id != '0'){ if(_id && _id != '0') {
agent.getDistrictStoreList(_id, function(_data){ agent.getDistrictStoreList(_id, function(_data) {
// var _str = ''; // var _str = '';
var _str = '<option value="0">全部</option>'; var _str = '<option value="0">全部</option>';
$.each(_data, function(i,item) { $.each(_data, function(i, item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>'; _str += '<option value="' + item.id + '">' + item.store_name + '</option>';
}); });
_objTemp.html(_str); _objTemp.html(_str);
}); });
}else{ } else {};
};
}); });
}) })
$('#search').click(function (pageNo) { $('#search').click(function(pageNo) {
agent.getList(1); agent.getList(1);
}); });
$("#reset").click(function () {//重置 $("#reset").click(function() { //重置
document.getElementById("form_search").reset(); document.getElementById("form_search").reset();
}); });
$(document).delegate(".agent_add", "click", function () {//新增 $(document).delegate(".agent_add", "click", function() { //新增
$("#title").html("新增经纪人"); $("#title").html("新增经纪人");
$("#password").parent().addClass('hide'); //新增不显示密码 $("#password").parent().addClass('hide'); //新增不显示密码
$(".form-horizontal")[0].reset(); //重置表单 $(".form-horizontal")[0].reset(); //重置表单
agent.emptyInput();//清空表单 agent.emptyInput(); //清空表单
}); });
$(document).delegate(".edit", "click", function () {//点击编辑 $(document).delegate(".edit", "click", function() { //点击编辑
$("#title").html("编辑经纪人"); $("#title").html("编辑经纪人");
$(".form-horizontal")[0].reset(); //重置表单 $(".form-horizontal")[0].reset(); //重置表单
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
$("#password").parent().removeClass('hide'); //编辑显示密码 $("#password").parent().removeClass('hide'); //编辑显示密码
$("#password").attr('type','text'); $("#password").attr('type', 'text');
agent.emptyInput();//清空表单 agent.emptyInput(); //清空表单
agent.Edit(); agent.Edit();
}); });
$(document).delegate("#password", "click",function () { $(document).delegate("#password", "click", function() {
$(this).val('').attr('type','password'); $(this).val('').attr('type', 'password');
}); });
$(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(); agent.getPhoneBindingList();
}); });
$(document).delegate(".submit_edit", "click", function () {//提交编辑 $(document).delegate(".submit_edit", "click", function() { //提交编辑
agent.Submit_edit(); agent.Submit_edit();
}); });
$(document).delegate("#role", "click", function (e) {//变更角色 $(document).delegate("#role", "click", function(e) { //变更角色
var _this = $(this); var _this = $(this);
var _tempVal = _this.closest('tr').attr('data-groupname'); var _tempVal = _this.closest('tr').attr('data-groupname');
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
agent.getRole(_tempVal); agent.getRole(_tempVal);
}); });
$(document).delegate(".submit_user", "click", function () {//提交变更 $(document).delegate(".submit_user", "click", function() { //提交变更
agent.Submit_user(); agent.Submit_user();
}); });
$(document).delegate(".is_show", "click", function () {//点击禁用 $(document).delegate(".is_show", "click", function() { //点击禁用
if (!confirm('是否继续?')) { if(!confirm('是否继续?')) {
return; return;
} }
agent.id = $(this).attr("data-id"); agent.id = $(this).attr("data-id");
...@@ -88,55 +88,63 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -88,55 +88,63 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}; };
params.id = $(this).attr("data-id"); params.id = $(this).attr("data-id");
var str = $.trim($(this).html()); var str = $.trim($(this).html());
if (str === "正常") { if(str === "正常") {
$(this).attr('class','btn1 btn-default is_show'); $(this).attr('class', 'btn1 btn-default is_show');
params.type = 1; params.type = 1;
$(this).html('冻结'); $(this).html('冻结');
} else if (str === "冻结") { } else if(str === "冻结") {
$(this).attr('class','btn1 btn-info is_show'); $(this).attr('class', 'btn1 btn-info is_show');
params.type = 0; params.type = 0;
$(this).html('正常'); $(this).html('正常');
} else { } else {
params.type = 2; params.type = 2;
} }
$.ajax({//禁用 $.ajax({ //禁用
'type': 'POST', 'type': 'POST',
'url': '/index/updateStatus', 'url': '/index/updateStatus',
data: { "ids": agent.id, "status": params.type }, data: {
"ids": agent.id,
"status": params.type
},
dataType: "json", dataType: "json",
success: function (data) { success: function(data) {
if (data.code != 200) { if(data.code != 200) {
alert("禁用失败!") alert("禁用失败!")
} }
} }
}); });
}); });
//手机绑定状态切换 //手机绑定状态切换
$(document).delegate(".is_show2", "click", function () {//点击禁用 $(document).delegate(".is_show2", "click", function() { //点击禁用
if (!confirm('是否继续?')) { if(!confirm('是否继续?')) {
return; return;
} }
agent.id = $(this).attr("data-id"); agent.id = $(this).attr("data-id");
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存 var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
// console.log(user_info_obj); // console.log(user_info_obj);
var params = { var params = {
}; };
params.id = $(this).attr("data-id"); params.id = $(this).attr("data-id");
var str = $.trim($(this).html()); var str = $.trim($(this).html());
if (str === "允许") { if(str === "允许") {
$(this).attr('class','btn1 btn-default is_show2'); $(this).attr('class', 'btn1 btn-default is_show2');
params.type = 0; params.type = 0;
$(this).html('解绑'); $(this).html('解绑');
} else if (str === "解绑") { } else if(str === "解绑") {
$(this).attr('class','btn1 btn-info is_show2'); $(this).attr('class', 'btn1 btn-info is_show2');
params.type = 1; params.type = 1;
$(this).html('允许'); $(this).html('允许');
}; };
$.ajax({//禁用 $.ajax({ //禁用
'type': 'POST', 'type': 'POST',
'url': '/index/updateDevice', 'url': '/index/updateDevice',
data: { "agent_id": agent.agent_id, "id": params.id,"operator_id": user_info_obj.id,"is_forbidden": params.type }, data: {
"agent_id": agent.agent_id,
"id": params.id,
"operator_id": user_info_obj.id,
"is_forbidden": params.type
},
/* $params = array( /* $params = array(
"agent_id" => 1,//解绑或者绑定的经纪人id "agent_id" => 1,//解绑或者绑定的经纪人id
"id" => 1, //关系id "id" => 1, //关系id
...@@ -145,23 +153,26 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -145,23 +153,26 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
);*/ );*/
dataType: "json", dataType: "json",
success: function (data) { success: function(data) {
if (data.code != 200) { if(data.code != 200) {
alert("禁用失败!") alert("禁用失败!")
} }
} }
}); });
}); });
}, },
Submit_user: function () {//提交变更的信息 Submit_user: function() { //提交变更的信息
var group_id = $("#edit_role").val(); var group_id = $("#edit_role").val();
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
'url': '/index/updateRole', 'url': '/index/updateRole',
data: { 'ids': agent.agent_id, 'group_id': group_id }, data: {
'ids': agent.agent_id,
'group_id': group_id
},
dataType: "json", dataType: "json",
success: function (data) { success: function(data) {
if (data.code == 200) { if(data.code == 200) {
agent.getList(1); agent.getList(1);
} else { } else {
alert("重复提交"); alert("重复提交");
...@@ -169,39 +180,41 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -169,39 +180,41 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}); });
}, },
Edit: function () {//获取 Edit: function() { //获取
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
'url': '/index/saveAgent',//获取编辑数据 'url': '/index/saveAgent', //获取编辑数据
data: { "id": agent.agent_id }, data: {
"id": agent.agent_id
},
dataType: "json", dataType: "json",
success: function (data) { success: function(data) {
if (data.code == 200) { if(data.code == 200) {
if(data.data){ if(data.data) {
$("input[name = id]").val(data.data.id); $("input[name = id]").val(data.data.id);
$("input[name = phone]").val(data.data.phone); $("input[name = phone]").val(data.data.phone);
$("input[name = name]").val(data.data.name); $("input[name = name]").val(data.data.name);
$("[name = district_id]").val(data.data.district_id); $("[name = district_id]").val(data.data.district_id);
if(data.data.district_id){ if(data.data.district_id) {
agent.getDistrictStoreList(data.data.district_id, function(_data){ agent.getDistrictStoreList(data.data.district_id, function(_data) {
// var _str = ''; // var _str = '';
var _str = '<option value="0">全部</option>'; var _str = '<option value="0">全部</option>';
$.each(_data, function(i,item) { $.each(_data, function(i, item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>'; _str += '<option value="' + item.id + '">' + item.store_name + '</option>';
}); });
$("[name = store_id]").html(_str).val(data.data.store_id); $("[name = store_id]").html(_str).val(data.data.store_id);
}); });
}else{ } else {
} }
$("#remarks").val(data.data.remarks); $("#remarks").val(data.data.remarks);
$("#password").val(data.data.password); $("#password").val(data.data.password);
$("input[name='password']").attr('form-group'); $("input[name='password']").attr('form-group');
if (data.data.sex == '0') { if(data.data.sex == '0') {
$("#sex0").attr('checked', true); $("#sex0").attr('checked', true);
} else if (data.data.sex == '1') { } else if(data.data.sex == '1') {
$("#sex1").attr('checked', true); $("#sex1").attr('checked', true);
} else { } else {
$("#sex2").attr('checked', true); $("#sex2").attr('checked', true);
...@@ -215,7 +228,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -215,7 +228,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}); });
}, },
Submit_edit: function () { Submit_edit: function() {
//提交编辑的信息 //提交编辑的信息
var params = {} var params = {}
params.id = agent.agent_id; params.id = agent.agent_id;
...@@ -230,26 +243,24 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -230,26 +243,24 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
params.status = $("#status").val(); params.status = $("#status").val();
params.password = $("input[name='password']").val(); params.password = $("input[name='password']").val();
if(params.phone == '') {
if (params.phone == '') {
alert('手机号必填!'); alert('手机号必填!');
return false; return false;
} }
if (params.district_id == '') { if(params.district_id == '') {
alert('所属部门必填'); alert('所属部门必填');
$("#modal-edit").show(); $("#modal-edit").show();
return false; return false;
} }
if(params.store_id == '') {
if (params.store_id == '') {
alert('所属门店必填'); alert('所属门店必填');
$("#modal-edit").show(); $("#modal-edit").show();
return false; return false;
} }
if (params.phone.length != 11) { if(params.phone.length != 11) {
alert('手机号码错误!'); alert('手机号码错误!');
$("#modal-edit").show(); $("#modal-edit").show();
return false; return false;
...@@ -260,8 +271,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -260,8 +271,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
'url': '/index/saveAgent', 'url': '/index/saveAgent',
data: params, data: params,
dataType: "json", dataType: "json",
success: function (data) { success: function(data) {
if (data.code == 200) { if(data.code == 200) {
$("#modal-edit").modal('hide'); $("#modal-edit").modal('hide');
agent.getList(1); agent.getList(1);
} else { } else {
...@@ -271,7 +282,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -271,7 +282,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}); });
}, },
emptyInput: function(){ emptyInput: function() {
console.count('emptyInput'); console.count('emptyInput');
$("input[name = name]").val(''); $("input[name = name]").val('');
$("input[name = phone]").val(''); $("input[name = phone]").val('');
...@@ -282,7 +293,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -282,7 +293,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$("#admin_off").val('0'); $("#admin_off").val('0');
$("#remarks").val(''); $("#remarks").val('');
}, },
getList: function (pageNo) { getList: function(pageNo) {
agent.pageNo = pageNo; agent.pageNo = pageNo;
var params = {}; var params = {};
params.pageNo = agent.pageNo; params.pageNo = agent.pageNo;
...@@ -296,22 +307,32 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -296,22 +307,32 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
async: true, async: true,
data: params, data: params,
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
console.log(666);
console.log(data.data.list.length);
//获取对应的id
agent.idArray = new Array();
for(var m = 0; m < data.data.list.length; m++) {
agent.idArray[m] = data.data.list[m].id;
}
// console.log(agent.idArray);
//获取对应的id
var temp = document.getElementById('agent_tpl').innerHTML; var temp = document.getElementById('agent_tpl').innerHTML;
var doTempl = doT.template(temp); var doTempl = doT.template(temp);
$("#agentlist").html(doTempl(data.data.list)); $("#agentlist").html(doTempl(data.data.list));
agent.getEvaluationList(); agent.getEvaluationList(agent.idArray);
/*分页代码*/ /*分页代码*/
add_page(data.data.total, pageNo, agent.pageSize, agent.getList); add_page(data.data.total, pageNo, agent.pageSize, agent.getList);
$ ('.J_preview').preview (); $('.J_preview').preview();
} }
}) });
}, },
//手机绑定权限 //手机绑定权限
getPhoneBindingList: function (pageNo) { getPhoneBindingList: function(pageNo) {
var params = {}; var params = {};
params.agent_id =agent.agent_id; params.agent_id = agent.agent_id;
console.log(agent.agent_id); console.log(agent.agent_id);
$.ajax({ $.ajax({
url: '/index/deviceList', url: '/index/deviceList',
...@@ -319,30 +340,30 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -319,30 +340,30 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
async: true, async: true,
data: params, data: params,
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
var temp = document.getElementById('phone_binding_tpl').innerHTML; var temp = document.getElementById('phone_binding_tpl').innerHTML;
var doTempl = doT.template(temp); var doTempl = doT.template(temp);
$("#agent_phone_binding").html(doTempl(data.data)); $("#agent_phone_binding").html(doTempl(data.data));
/*分页代码*/ /*分页代码*/
add_page(data.data.total, pageNo, agent.pageSize, agent.getList); add_page(data.data.total, pageNo, agent.pageSize, agent.getList);
$ ('.J_preview').preview (); $('.J_preview').preview();
} }
}) })
}, },
getRole : function (tempval) { getRole: function(tempval) {
$.ajax({ $.ajax({
url: '/index/getAuth2', url: '/index/getAuth2',
type: 'GET', type: 'GET',
data:{}, data: {},
async: true, async: true,
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
var User_add=""; var User_add = "";
var _tempid; var _tempid;
$.each(data.data.list,function(i,item){ $.each(data.data.list, function(i, item) {
User_add+='<option value="'+item.id+'">'+item.title+'</option>'; User_add += '<option value="' + item.id + '">' + item.title + '</option>';
if(item.title == tempval){ if(item.title == tempval) {
_tempid = item.id; _tempid = item.id;
console.log(item.id); console.log(item.id);
}; };
...@@ -353,18 +374,20 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -353,18 +374,20 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}); });
}, },
getDistrict : function (fn) { getDistrict: function(fn) {
$.ajax ({ $.ajax({
url: '/index/getDistrict', url: '/index/getDistrict',
type: 'GET', type: 'GET',
async: true, async: true,
data: {"pageSize":1000}, data: {
"pageSize": 1000
},
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
if (data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
var str = ''; var str = '';
$.each(data.data, function(i,item) { $.each(data.data, function(i, item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>'; str += '<option value="' + item.id + '">' + item.district_name + '</option>';
}); });
$('[name=district_id]').append(str); $('[name=district_id]').append(str);
fn && fn(); fn && fn();
...@@ -372,55 +395,50 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -372,55 +395,50 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}); });
}, },
getDistrictStoreList: function(id, fn){ getDistrictStoreList: function(id, fn) {
$.ajax ({ $.ajax({
url: '/index/getDistrictStoreList', url: '/index/getDistrictStoreList',
type: 'GET', type: 'GET',
async: true, async: true,
data: { data: {
'id':id, 'id': id,
"pageSize":1000 "pageSize": 1000
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
if (data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
fn && fn(data.data); fn && fn(data.data);
} }
} }
}); });
}, },
getEvaluationList:function(){ getEvaluationList: function(n) {
console.log(n);
// var _data={};
// for(var i=0;i<n.length;i++){
// _data['agents_id['+i+']']=n[i];
// }
var _data = {
'agents_id': n.join(',')
}
console.log('经纪人列表加载完成'); console.log('经纪人列表加载完成');
console.log($('.number-evaluation').attr("data-id")); $.ajax({
var _data={
};
// var _imgUploadLunbo = $('#agentlist').find(tr).find(td).eq(6); //详情页轮播图ul
console.log(_imgUploadLunbo);
// var _xiangqingPicObj = _imgUploadLunbo.find('li>img');
// var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url
$.each(_imgUploadLunbo, function(i, item) {
_data['agents_id[' + i + ']'] = item.attr("data-id");
});
// console.log(_data);
$.ajax ({
url: '/index/agentEvaluateNumAndFraction', url: '/index/agentEvaluateNumAndFraction',
type: 'GET', type: 'GET',
async: true, async: true,
data: _data, data: _data,
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
if (data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
var str = ''; // console.log(data.data[0].agent_evaluate_num);
$.each(data.data, function(i,item) { $("#agentlist tr").each(function(e) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>'; //e代表索引 从0开始 eq(0)就是第一行
}); $("#agentlist").find("tr").eq(e).find("td").eq(6).html(data.data[e].agent_evaluate_num); //获取一列的值
$('[name=district_id]').append(str); $("#agentlist").find("tr").eq(e).find("td").eq(7).html(data.data[e].agent_evaluate_fraction);
fn && fn(); })
} }
} }
}); });
} }
}; };
return agent; return agent;
......
...@@ -17,6 +17,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -17,6 +17,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
$(document.body).append(template); $(document.body).append(template);
follow.getList(0); follow.getList(0);
follow.event(); follow.event();
follow.getaddPicList2();
}, },
event: function() { event: function() {
...@@ -56,6 +57,15 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -56,6 +57,15 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
e.stopPropagation(); e.stopPropagation();
$(this).parent().remove(); $(this).parent().remove();
}); });
_doc.on('click', '.span-del2', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).parent().remove();
$(this).prev().attr('class');
console.log($(this).prev().attr('class'));
follow.spandelList($(this).prev().attr('class'));
});
_doc.on('click', 'a[href="#modal-time"]', function(e) { _doc.on('click', 'a[href="#modal-time"]', function(e) {
follow.house_id = $(this).attr("data-id"); follow.house_id = $(this).attr("data-id");
e.preventDefault(); e.preventDefault();
...@@ -73,7 +83,9 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -73,7 +83,9 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
// follow.getaddPicList(); // follow.getaddPicList();
// }); // });
_doc.on('click', '.add-pic', function() { _doc.on('click', '.add-pic', function() {
follow.house_id = $(this).attr("data-id");
follow.getaddPicList(); follow.getaddPicList();
}); });
$("#reset").click(function() { //重置 $("#reset").click(function() { //重置
...@@ -108,37 +120,42 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -108,37 +120,42 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
_doc.on('click', '#saveBtn', function(e) { _doc.on('click', '#saveBtn', function(e) {
console.log(555); console.log(555);
var _this = $(this); var _this = $(this);
var _data = {
type: 1,
image1: follow.image_file
};
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
// $.ajax({ var imgname=[];
// type: 'GET', for(var i=0;i<$('.result').length;i++){
// url: '/index/uploadImg', imgname[i]=$('.result>img').get(i).getAttribute("class");
// data: _data, }
//// timeout: 30000, console.log(imgname.join(','));
// dataType: 'json', var _data = {
// beforeSend: function() {}, img_id: follow.house_id,
// success: function(_data) { img_name: imgname.join(',')
// if(typeof _data === 'object') {
// };
// } else { $.ajax({
// alert('数据错误'); type: 'GET',
// }; url: '/index/addReceiptImg',
// }, data: _data,
// error: function() { dataType: 'json',
// alert('enter error'); beforeSend: function() {},
// }, success: function(_data) {
// complete: function(xhr, textStatus){ if(typeof _data === 'object') {
// if(textStatus === 'timeout') { follow.getList(0);
// //处理超时的逻辑 } else {
// alert('请求超时,请重试'); alert('数据错误');
// }; };
// } },
// }); error: function() {
alert('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
}); });
//图片上传 2.2版本 //图片上传 2.2版本
...@@ -192,9 +209,49 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -192,9 +209,49 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
} }
}); });
}, },
//点击收款图片 调用的接口 spandelList: function(n) { //提交
getaddPicList: function() { $.ajax({
'type': 'POST',
'url': '/index/deleteReceiptImg',
data: {
id:n
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
} else {}
}
});
},
getaddPicList: function() {//获取收款图片
// container_body
$('.result2,.result').remove();
$.ajax({
'type': 'GET',
'url': '/index/receiptImgList',
data: {
"id": follow.house_id,
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
//渲染已经有的列表
for(i=0;i<data.data.length;i++){
var result = '<div class="result2"><img class="' + data.data[i].id + '" src="' + data.data[i].img_name + '" alt=""/> <span class="span-del2">删除</span></div>';
div = document.createElement('div');
div.innerHTML = result;
document.getElementById('container_body').appendChild(div);
}
 
} else {}
}
});
},
//点击收款图片 调用的接口 上传图片
getaddPicList2: function() {
var input = document.getElementById("file_input"); var input = document.getElementById("file_input");
var result, div; var result, div;
if(typeof FileReader === 'undefined') { if(typeof FileReader === 'undefined') {
...@@ -203,30 +260,21 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -203,30 +260,21 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
} else { } else {
input.addEventListener('change', readFile, false); input.addEventListener('change', readFile, false);
}; };
function readFile() { function readFile() {
console.log(this.files); console.log(this.files);
// var _this=$(this);
for(var i = 0; i < this.files.length; i++) { for(var i = 0; i < this.files.length; i++) {
if(!input['value'].match(/.jpg|.gif|.png|.bmp/i)) {   //判断上传文件格式 if(!input['value'].match(/.jpg|.gif|.png|.bmp/i)) {   //判断上传文件格式
return alert("上传的图片格式不正确,请重新选择")     return alert("上传的图片格式不正确,请重新选择")    
} }
var reader = new FileReader(); var reader = new FileReader();
reader.readAsDataURL(this.files[i]); reader.readAsDataURL(this.files[i]);
reader.onload = function(e) {
result = '<div class="result"><img src="' + this.result + '" alt=""/> <span class="span-del">删除</span></div>';
div = document.createElement('div');
div.innerHTML = result;
document.getElementById('container_body').appendChild(div);   
}
};
var formData = new FormData(); var formData = new FormData();
formData.append('type',1); formData.append('type', 'chat');
formData.append('image',this.files[0]); formData.append('image', this.files[0]);
console.log(this.files[0]); console.log(this.files[0]);
console.log(formData); console.log(formData);
reader.onload = function(e) {
var result2 = this.result;
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: '/index/uploadImg', url: '/index/uploadImg',
...@@ -234,13 +282,17 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -234,13 +282,17 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
dataType: 'json', dataType: 'json',
contentType: false, contentType: false,
cache: false, cache: false,
processData:false, processData: false,
beforeSend: function() {}, beforeSend: function() {},
success: function(_data) { success: function(_data) {
if(typeof _data === 'object') { if(_data.code == 200) {
result = '<div class="result"><img class="' + _data.data.img_path + '" src="' + result2 + '" alt=""/> <span class="span-del">删除</span></div>';
div = document.createElement('div');
div.innerHTML = result;
document.getElementById('container_body').appendChild(div); 
} else { } else {
alert('数据错误'); alert(_data.msg);
}; };
}, },
error: function() { error: function() {
...@@ -253,6 +305,9 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -253,6 +305,9 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
}; };
} }
}); });
 
}
};
}; };
}, },
......
...@@ -518,7 +518,7 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde ...@@ -518,7 +518,7 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
} }
}); });
}, },
add_news : function () {//新增文章 add_news : function () {//新增文章 编辑文章
var _imgUploadLiebiao = $('#liebiao_pic_ul');//列表页封面图ul var _imgUploadLiebiao = $('#liebiao_pic_ul');//列表页封面图ul
var _liebiaoPicObj = _imgUploadLiebiao.find('li>img'); var _liebiaoPicObj = _imgUploadLiebiao.find('li>img');
var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url
...@@ -538,6 +538,10 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde ...@@ -538,6 +538,10 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
// //
// }); // });
if(getUrlParam('id')){
_data.id = getUrlParam('id');
};
_data.title = $("#announcement_title").val(); _data.title = $("#announcement_title").val();
_data.s_label_id = $("#district_id2").val();//商学院标签id _data.s_label_id = $("#district_id2").val();//商学院标签id
_data.file_img = _liebiaoPicObj[0].src.replace(_urlCut, '');//封面图 剪切后的字符串 _data.file_img = _liebiaoPicObj[0].src.replace(_urlCut, '');//封面图 剪切后的字符串
......
...@@ -13,12 +13,9 @@ ...@@ -13,12 +13,9 @@
<td>[%= it[item]['house_number'] %]</td> <td>[%= it[item]['house_number'] %]</td>
<td> <td>
<!--增加收款图片 2.2版本--> <!--增加收款图片 2.2版本-->
<a class="btn1 btn-info add-pic" href="#modal-addPic" data-toggle="modal" <a class="btn1 btn-info add-pic" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["id"] %]'>收款图片</a>
data-id='[%= it[item]["order_id"] %]'>收款图片</a> <a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>时间轴</a>
<a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" <a class="btn1 btn-info submit_edit2" href="#modal-linetime" data-toggle="modal" data-id='[%= it[item]["id"]%]' data-money='[%= it[item]["real_money"] %]'>编辑</a>
data-id='[%= it[item]["order_id"] %]'>时间轴</a>
<a class="btn1 btn-info submit_edit2" href="#modal-linetime" data-toggle="modal"
data-id='[%= it[item]["id"]%]' data-money='[%= it[item]["real_money"] %]'>编辑</a>
</td> </td>
</tr> </tr>
[% } %] [% } %]
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<td>[%= it[item]["comment_number"] %]</td> <td>[%= it[item]["comment_number"] %]</td>
<td> <td>
_data.title = $("#announcement_title").val();
<a class="btn1 btn-success" href="new_text.html?id=[%= it[item]["id"] %]" data-createTime='[%= it[item]["create_time"] %]' data-title='[%= it[item]["title"] %]' data-id='[%= it[item]["id"] %]' data-content='[%= it[item]["content"] %]' target="_blank"> <a class="btn1 btn-success" href="new_text.html?id=[%= it[item]["id"] %]" data-createTime='[%= it[item]["create_time"] %]' data-title='[%= it[item]["title"] %]' data-id='[%= it[item]["id"] %]' data-content='[%= it[item]["content"] %]' target="_blank">
编辑 编辑
</a> </a>
......
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