Commit 572821c2 authored by xishifeng's avatar xishifeng Committed by hujun

分佣3

parent cc25c6f5
......@@ -236,30 +236,42 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
_doc.on('click', '#maid_ok_btn', function(e){
e.preventDefault();
e.stopPropagation();
bargain.MaidOk();
bargain.maidConfirmOk();
});
//详情弹出框,分佣提成里,点击保存触发的事件
_doc.on('click', '#maid_save_btn', function(e){
e.preventDefault();
e.stopPropagation();
bargain.MaidSave();
bargain.maidSave();
});
//详情弹出框,分佣提成里,点击增加实收按钮
_doc.on('click', '#maid_new_btn', function(e){
e.preventDefault();
e.stopPropagation();
layer.open({
content: '确认增加吗?',
btn: ['确定', '取消'],
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>');
layer.close(_index);
}
});
var _temp = $('.detail-modal-maid-span-time');
var _flag = false;
if(_temp && _temp.length && _temp.length>0){
$.each(_temp, function(i, v) {
if(v.innerHTML == ''){
_flag = true;
};
});
};
if(_flag){
alert('前边一组收佣尚未确认分佣或成交信息里没有对应的实收佣金');
}else{
layer.open({
content: '确认增加吗?',
btn: ['确定', '取消'],
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>');
layer.close(_index);
}
});
};
});
},
getDefaultRadio: function(v){
switch (Number(v)){
......@@ -547,9 +559,52 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
url: '/index/addBargain',
data: {
'id': bargain.bargain_id,
'agent_id': $('#addmaid_input_ywy').attr('data-id'),
'scale_fee': $('#addmaid_input_cash').val(),
'role': $('#addmaid_input_servant').val(),
'scale': $('#addmaid_input_ratio').val()
'scale': $('#addmaid_input_ratio').val(),
'source': 1
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
alert('新增成功!');
bargain.maidShow();
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
maidConfirmOk: function(){
$.ajax({
type: 'POST',
url: '/index/addRealIncome',
data: {
'bargain_id': bargain.bargain_id,
'practical_fee': bargain.bargain_id,
'cash': bargain.bargain_id,
'service_charge': bargain.bargain_id,
'charity_fund': bargain.bargain_id,
'real_fee': bargain.bargain_id,
'confirm_date': bargain.bargain_id,
'should_commission': bargain.bargain_id,
'scale': bargain.bargain_id
},
timeout: 30000,
dataType: 'json',
......@@ -575,6 +630,9 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
};
}
});
},
maidSave: function(){
},
newAddTax: function(obj) {
var _tempTableObj = $('.addtax-modal-tax-table');
......@@ -690,47 +748,6 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
}
});
},
newCommission: function() { //新增分佣提成
$.ajax({
'type': 'POST',
'url': '/index/addBargain',
data: {
"id": bargain.bargain_id,
"role": $("#is_carefully_chosen").val(),
"scale": $("#commission-rate").val(),
"scale_fee": $("#should-commission").val(),
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
if(data.data) {
console.log(666);
}
} else {
alert('获取失败!');
}
}
});
},
Submit_follow: function() { //提交
$.ajax({
'type': 'POST',
'url': '/index/pcEditClient',
data: {
"id": bargain.bargain_id,
"user_nick": $("#cus_name").val(),
"user_phone": $("#cus_phone").html(),
"agent_id": bargain.agent_id, //客方
"sex": $("#sex").val()
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
if(data.data) {}
} else {}
}
});
},
//转到一级审核
transFirstExamine: function(){
$.ajax({
......
......@@ -5,25 +5,25 @@
<td>[%= it['data'][i]['role_name'] %]</td>
<td>[%= it['data'][i]['agent'] %]</td>
<td>[%= it['data'][i]['district_store'] %]</td>
<td contenteditable>[%= it['data'][i]['scale'] %]%</td>
<td contenteditable>[%= it['data'][i]['scale_fee'] %]</td>
<td contenteditable class="detail-modal-maid-span-scale">[%= it['data'][i]['scale'] %]%</td>
<td contenteditable class="detail-modal-maid-span-should-commission">[%= it['data'][i]['scale_fee'] %]</td>
<td colspan="6" class="detail-modal-maid-mix-td oh">
[% if(it['data'][i]['partial_commission'] && it['data'][i]['partial_commission'].length && it['data'][i]['partial_commission'].length>0) { %]
<div class="oh">
<span contenteditable>2</span>
<span contenteditable>2</span>
<span contenteditable>2</span>
<span contenteditable>2</span>
<span contenteditable>2</span>
<span contenteditable class="detail-modal-maid-span-real-fee">2</span>
<span contenteditable class="detail-modal-maid-span-service-charge">2</span>
<span contenteditable class="detail-modal-maid-span-charity-fund">2</span>
<span contenteditable class="detail-modal-maid-span-cash">2</span>
<span contenteditable class="detail-modal-maid-span-practical-fee">2</span>
<span class="detail-modal-maid-span-time">4</span>
</div>
[% }else{ %]
<div class="oh">
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></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-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>
[% } %]
......
<script id="reportList_list_tpl" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %]
[% var sw=function(s){switch(Number(s)){case 10:return"出租";case 20:return"增佣";case 30:return"代理";case 40:return"好处费";default:return s}}; %]
[% for(var item in it["list"]){ %]
<tr class="text-center" data-id='[%= it["list"][item]["id"] %]'>
<td>[%= it["list"][item]['create_time'] %]</td>
......@@ -7,8 +8,8 @@
<td>[%= it["list"][item]['internal_title'] %]</td>
<td>[%= it["list"][item]['user_name'] %]</td>
<td>[%= it["list"][item]['user_phone'] %]</td>
<td>[%= sw(it["list"][item]['trade_type']) %]</td>
<td>[%= it["list"][item]['commission'] %]</td>
<td>[%= it["list"][item]['practical_fee'] %]</td>
<td>
[% if(check_auth('index/bargainInfo')) { %]
<a class="btn1 btn-success details-btn" href="#modal_detail" data-toggle="modal">详情</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