Commit 4b93afa9 authored by xishifeng's avatar xishifeng Committed by hujun

bug处理

parent 8e977995
...@@ -302,8 +302,16 @@ ...@@ -302,8 +302,16 @@
<option value="5">合作方</option> <option value="5">合作方</option>
</select> </select>
</div> </div>
<div> <div class="po-relative">
<span>业务员:</span><input class="form-control" type="text" id="addmaid_input_ywy" /> <span>业务员:</span><input class="form-control" type="text" id="addmaid_input_ywy" />
<ul>
<li data-id="5755">5755-测试-小杨业务员-17621975554</li>
<li data-id="5755">5755-测试-小杨业务员-17621975554</li>
<li data-id="5755">5755-测试-小杨业务员-17621975554</li>
<li data-id="5755">5755-测试-小杨业务员-17621975554</li>
<li data-id="5755">5755-测试-小杨业务员-17621975554</li>
<li data-id="5755">5755-测试-小杨业务员-17621975554</li>
</ul>
</div> </div>
<div> <div>
<span>所属门店:</span><input class="form-control" type="text" id="addmaid_input_shop" /> <span>所属门店:</span><input class="form-control" type="text" id="addmaid_input_shop" />
......
...@@ -224,6 +224,10 @@ a:hover{ ...@@ -224,6 +224,10 @@ a:hover{
text-align: right; text-align: right;
} }
.po-relative{
position: relative;
}
.table-haveborder td{ .table-haveborder td{
border: 1px solid #000; border: 1px solid #000;
} }
......
...@@ -207,7 +207,7 @@ addtax_ ...@@ -207,7 +207,7 @@ addtax_
#addmaid_input_area>div>select, #addmaid_input_area>div>select,
#addmaid_input_area>div>input{ #addmaid_input_area>div>input{
float: left; float: left;
width: 40%; width: 60%;
} }
#addmaid_input_area>div>span:nth-of-type(1){ #addmaid_input_area>div>span:nth-of-type(1){
display: inline-block; display: inline-block;
...@@ -222,12 +222,17 @@ addtax_ ...@@ -222,12 +222,17 @@ addtax_
#addmaid_select_ul{ #addmaid_select_ul{
list-style: none; list-style: none;
padding: 0;
margin: 0;
} }
#addmaid_select_ul>li{ #addmaid_select_ul>li{
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
cursor: pointer; cursor: pointer;
} }
#addmaid_select_ul>li:hover{
background-color: rgba(0, 0, 0, .2);
}
/****************************************************************/ /****************************************************************/
...@@ -240,10 +245,23 @@ addtax_ ...@@ -240,10 +245,23 @@ addtax_
margin-top: -20px; margin-top: -20px;
} }
/*新增分佣提成*/
#addmaid_input_ywy+ul{
width: 60%;
margin-left: 80px;
list-style: none;
padding-left: 0;
border: 1px solid #ccc;
border-top: none;
background-color: white;
display: none;
}
#addmaid_input_ywy+ul>li{
line-height: 40px;
}
/*******************/
.clear { .clear {
clear: both; clear: both;
} }
......
...@@ -147,4 +147,15 @@ function dealJineNum(num){ ...@@ -147,4 +147,15 @@ function dealJineNum(num){
}else{ }else{
return 0; return 0;
}; };
}; };
\ No newline at end of file
//隐藏手机号码中间四位数
function hideTel(str){
if(str !== '' && str !== null && str !== undefined){
var _arr = String(str).split('');
_arr.splice(3,4,'****');
return _arr.join('');
}else{
return str;
}
}
\ No newline at end of file
...@@ -7,6 +7,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -7,6 +7,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
mainTabIndex: 0, mainTabIndex: 0,
detailTabIndex: 0, detailTabIndex: 0,
bargain_id: '', bargain_id: '',
order_id: 0,//订单id
panfangData: null, panfangData: null,
maidTotalCommission: 0,//应收总佣金 maidTotalCommission: 0,//应收总佣金
init: function() { init: function() {
...@@ -186,7 +187,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -186,7 +187,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
}else{ }else{
var _rateTemp = bargain.getDefaultRadio(_this.val()); var _rateTemp = bargain.getDefaultRadio(_this.val());
$('#addmaid_input_ratio').val(_rateTemp); $('#addmaid_input_ratio').val(_rateTemp);
$('#addmaid_input_cash').val(_rateTemp*bargain.maidTotalCommission); $('#addmaid_input_cash').val(dealJineNum(_rateTemp*bargain.maidTotalCommission/100));
var _arrTemp = bargain.panfangData.filter(function(item, index, array){ var _arrTemp = bargain.panfangData.filter(function(item, index, array){
return (item.role == _this.val()); return (item.role == _this.val());
}); });
...@@ -272,12 +273,78 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -272,12 +273,78 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
content: '确认增加吗?', content: '确认增加吗?',
btn: ['确定', '取消'], btn: ['确定', '取消'],
yes: function(_index){ yes: function(_index){
$('.detail-modal-maid-mix-td').append('<div class="oh"><span contenteditable></span><span contenteditable></span><span contenteditable></span><span contenteditable></span><span contenteditable></span><span class="detail-modal-maid-span-time"></span></div>'); $('.detail-modal-maid-mix-td').append('<div class="oh"><span contenteditable class="detail-modal-maid-span-real-fee"></span><span contenteditable class="detail-modal-maid-span-service-charge"></span><span contenteditable class="detail-modal-maid-span-charity-fund"></span><span contenteditable class="detail-modal-maid-span-cash"></span><span contenteditable class="detail-modal-maid-span-practical-fee"></span><span class="detail-modal-maid-span-time"></span></div>');
layer.close(_index); layer.close(_index);
} }
}); });
}; };
}); });
//新增分佣提成,业务员input输入搜索,点击之后赋值
_doc.on('click', '#addmaid_input_ywy+ul>li', function() {
var _this = $(this);
var _id = _this.attr('data-id');
_this.parent().prev().val(_this.html()).attr('data-id', _id);
bargain.getDepart(_id, function(obj){
$('#addmaid_input_shop').val(obj.district_name+'-'+obj.store_name);
});
_this.parent().html('').hide();
});
//新增分佣提成,业务员input输入搜索
var _ajaxObjTel = null;
_doc.on('input', '#addmaid_input_ywy', function() {
var _this = $(this),
_thisVal = $.trim(_this.val());
_this.removeAttr('data-id'); //移除之前携带的信息
if(_thisVal != '') {
_ajaxObjTel && _ajaxObjTel.abort();
_ajaxObjTel = $.ajax({
type: 'GET',
url: '/index/getBroker_new',
data: {
'phone': $.trim(_this.val())
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
if(data['data'].length > 0) {
var _htmlTemp = '';
$.each(data['data'], function(i, item) {
_htmlTemp += '<li data-id="{3}">{0}-{1}<li>'.stringFormatObj({
'0': item['name'],
'1': item['phone'],
'3': item['id']
});
});
_this.next().show().html(_htmlTemp);
} else {
_this.next().html('');
};
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
//alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
}else{
_this.next().hide();
}
});
}, },
getDefaultRadio: function(v){ getDefaultRadio: function(v){
switch (Number(v)){ switch (Number(v)){
...@@ -358,7 +425,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -358,7 +425,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
$('#bargaininfo_shop_type').html(data.data.shop_type=='1'?'街铺':'商场'); $('#bargaininfo_shop_type').html(data.data.shop_type=='1'?'街铺':'商场');
$('#bargaininfo_is_open').val(data.data.is_open); $('#bargaininfo_is_open').val(data.data.is_open);
$('#bargaininfo_beizhu').val(data.data.content); $('#bargaininfo_beizhu').val(data.data.content);
$("#bargaininfo_user_phone").html(data.data.user_phone); $("#bargaininfo_user_phone").html(hideTel(data.data.user_phone));
$("#bargaininfo_user_name").html(data.data.user_name); $("#bargaininfo_user_name").html(data.data.user_name);
$("#bargaininfo_internal_address").html(data.data.internal_address); $("#bargaininfo_internal_address").html(data.data.internal_address);
$("#bargaininfo_shop_num").html(data.data.house_number); $("#bargaininfo_shop_num").html(data.data.house_number);
...@@ -366,7 +433,8 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -366,7 +433,8 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
$("#bargaininfo_total_commission").val(data.data.commission); $("#bargaininfo_total_commission").val(data.data.commission);
$("#bargaininfo_create_time").html(data.data.create_time); $("#bargaininfo_create_time").html(data.data.create_time);
bargain.maidTotalCommission = Number(data.data.commission); bargain.maidTotalCommission = Number(data.data.commission);//总佣金
bargain.order_id = Number(data.data.order_id);//订单id
var _inputAreaTempObj = $('.detail-modal-bargaininfo-commission-addarea'); var _inputAreaTempObj = $('.detail-modal-bargaininfo-commission-addarea');
if(data.data.practical_fee && data.data.practical_fee.length > 0){ if(data.data.practical_fee && data.data.practical_fee.length > 0){
...@@ -393,7 +461,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -393,7 +461,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
'commission': $.trim($('#bargaininfo_total_commission').val()), 'commission': $.trim($('#bargaininfo_total_commission').val()),
'content': $.trim($('#bargaininfo_beizhu').val()), 'content': $.trim($('#bargaininfo_beizhu').val()),
'is_open': $('#bargaininfo_is_open').val(), 'is_open': $('#bargaininfo_is_open').val(),
'trade_type': $('.left-deal').val() 'trade_type': $('#bargaininfo_type').val()
}; };
$.each($('.detail-modal-bargaininfo-commission-sec'), function(i, v) { $.each($('.detail-modal-bargaininfo-commission-sec'), function(i, v) {
_data['practical_fee['+i+']'] = { _data['practical_fee['+i+']'] = {
...@@ -528,9 +596,9 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -528,9 +596,9 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
newAddMaid: function(){ newAddMaid: function(){
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: '/index/searchBargainAgents', url: '/index/searchOrderAgents',
data: { data: {
'bargain_id': bargain.bargain_id 'order_id': bargain.order_id
}, },
timeout: 30000, timeout: 30000,
dataType: 'json', dataType: 'json',
...@@ -601,11 +669,13 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -601,11 +669,13 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
var _stopFlag = false; var _stopFlag = false;
var _data = []; var _data = [];
var _parObj = $('#maid_new_table_list>tr'); var _parObj = $('#maid_new_table_list>tr');
var _errorTips = '请填写完整';
var _scaleTotal = 0;
if(_parObj.length > 0){ if(_parObj.length > 0){
$.each(_parObj, function(i, v) { $.each(_parObj, function(i, v) {
console.count('$v'); console.count('$v');
var _$v = $(v); var _$v = $(v);
var _agendId = _$v.attr('data-agentid');//经纪人id var _agentId = _$v.attr('data-agentid');//经纪人id
var _role = _$v.attr('data-role');//盘方等类型 var _role = _$v.attr('data-role');//盘方等类型
var _scaleVal = $.trim(_$v.find('.detail-modal-maid-span-scale').html());//分佣比例 var _scaleVal = $.trim(_$v.find('.detail-modal-maid-span-scale').html());//分佣比例
var _shouldCommissionVal = $.trim(_$v.find('.detail-modal-maid-td-should-commission').html());//应分佣金 var _shouldCommissionVal = $.trim(_$v.find('.detail-modal-maid-td-should-commission').html());//应分佣金
...@@ -633,7 +703,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -633,7 +703,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
_stopFlag = true; _stopFlag = true;
}else{ }else{
_dataTemp['commission_date['+i2+']'] = { _dataTemp['commission_date['+i2+']'] = {
'agent_id': _agendId,//业务员id 'agent_id': _agentId,//业务员id
'role': _role,//盘方等角色类型 'role': _role,//盘方等角色类型
'scale': Number(_scaleVal),//分佣比例 'scale': Number(_scaleVal),//分佣比例
'should_commission': _shouldCommissionVal,//应分佣金 'should_commission': _shouldCommissionVal,//应分佣金
...@@ -654,8 +724,16 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -654,8 +724,16 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
_data.push(_dataTemp); _data.push(_dataTemp);
}); });
}; };
$.each($('.detail-modal-maid-span-scale'), function(i, v) {
_scaleTotal += Number($.trim(v.innerHTML));
});
if(_scaleTotal != 100){
_stopFlag = true;
_errorTips = '分佣比例一定要是100%,否则无法提交';
};
return { return {
'flag': _stopFlag, 'flag': _stopFlag,
'tips': _errorTips,
'list': _data 'list': _data
} }
}, },
...@@ -700,7 +778,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s ...@@ -700,7 +778,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
} }
}(0); }(0);
}else{ }else{
alert('请填写完整'); alert(_back.tips);
} }
}, },
newAddTax: function(obj) { newAddTax: function(obj) {
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
[% }else{ %] [% }else{ %]
<div class="oh"> <div class="oh">
<span contenteditable class="detail-modal-maid-span-real-fee"></span> <span contenteditable class="detail-modal-maid-span-real-fee"></span>
<span contenteditable class="detail-modal-maid-span-service-charge"></span> <span contenteditable class="detail-modal-maid-span-service-charge">0</span>
<span contenteditable class="detail-modal-maid-span-charity-fund"></span> <span contenteditable class="detail-modal-maid-span-charity-fund">0</span>
<span contenteditable class="detail-modal-maid-span-cash"></span> <span contenteditable class="detail-modal-maid-span-cash">0</span>
<span contenteditable class="detail-modal-maid-span-practical-fee"></span> <span contenteditable class="detail-modal-maid-span-practical-fee"></span>
<span class="detail-modal-maid-span-time"></span> <span class="detail-modal-maid-span-time"></span>
</div> </div>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<td>[%= it["list"][item]['internal_address'] %]</td> <td>[%= it["list"][item]['internal_address'] %]</td>
<td>[%= it["list"][item]['internal_title'] %]</td> <td>[%= it["list"][item]['internal_title'] %]</td>
<td>[%= it["list"][item]['user_name'] %]</td> <td>[%= it["list"][item]['user_name'] %]</td>
<td>[%= it["list"][item]['user_phone'] %]</td> <td>[%= hideTel(it["list"][item]['user_phone']) %]</td>
<td>[%= sw(it["list"][item]['trade_type']) %]</td> <td>[%= sw(it["list"][item]['trade_type']) %]</td>
<td>[%= it["list"][item]['commission'] %]</td> <td>[%= it["list"][item]['commission'] %]</td>
<td> <td>
......
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