Commit 0712e882 authored by hujun's avatar hujun

成交报告-增加搜索条件

parent 7312631c
......@@ -100,6 +100,22 @@ class Finance extends Basic
$where['d.shop_type'] = $this->params['shop_type'];
}
if (!empty($this->params['district_id'])) {
$where['e.district_id'] = $this->params['district_id'];
}
if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id'];
}
if (!empty($this->params['agent_phone'])) {
$where['e.phone'] = ['LIKE', '%'.$this->params['agent_phone'].'%'];
}
if (!empty($this->params['agent_name'])) {
$where['e.name'] = ['LIKE', '%'.$this->params['agent_name'].'%'];
}
switch ($check_status) {
case 2 :
//成交报告列表-第二级审核
......@@ -140,7 +156,7 @@ class Finance extends Basic
$data['data']['total'] = $bargain->getBargainTotal($where, $audit_level);
$data['data']['step'] = $check_status;
} catch (\Exception $e) {
return $this->response(101, '内部错误,获取列表失败!请联系运营。');
return $this->response(101, '内部错误,获取列表失败!请联系运营。'.$e->getMessage());
}
return $this->response($data['code'], $data['msg'], $data['data']);
......
......@@ -41,6 +41,14 @@
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_internal_address" placeholder="商铺地址" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_shop_num" placeholder="商铺号" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_user_phone" placeholder="客户电话" type="text" value="">
<select name="district_id" class="form-control btn2">
<option value="">约带看人所在部门</option>
</select>
<select name="store_id" class="form-control btn2">
<option value="">约带看人所在门店</option>
</select>
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="agent_name" placeholder="约带看人姓名" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="agent_phone" placeholder="约带看人手机号" type="text" value="">
<span class="btn btn-info btn3 search" id="maintable_search">搜索</span>
<span class="btn btn-info btn3" id="maintable_reset">重置</span>
<!--<span class="btn btn-info btn3" id="maintable_export">导出excel</span>-->
......
......@@ -348,6 +348,7 @@ class OBargainModel extends Model
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.report_agent_id=e.id','left')
->where($params)
->having('count(e.order_id) = 1')
->order($order_)
......@@ -360,6 +361,7 @@ class OBargainModel extends Model
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.report_agent_id=e.id','left')
->where($params)
->group('a.id')
->order($order_)
......@@ -406,6 +408,7 @@ class OBargainModel extends Model
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.report_agent_id=e.id','left')
->where($params)
->having('count(e.order_id) = 1')
->group('e.order_id')
......@@ -415,6 +418,7 @@ class OBargainModel extends Model
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.report_agent_id=e.id','left')
->where($params)
->group('a.id')
->count();
......
......@@ -377,6 +377,30 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
console.log(_id);
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id='+_id);
});
var _doc = $(document);
bargain.getDistrict(function() {
_doc.on('input', '[name=district_id],#district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
//新增 编辑
var _objTemp = _this.parent().next().find('select');
_objTemp.html(''); //先清空
if(_id && _id != '0') {
bargain.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_objTemp.html(_str);
_this.next().html(_str);
});
} else {};
});
});
},
getDefaultRadio: function(v){
//1,盘方
......@@ -1170,7 +1194,11 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
'end_time': $.trim($('#maintable_end_time').val()),
'internal_address': $.trim($('#maintable_internal_address').val()),
'user_phone': $.trim($('#maintable_user_phone').val()),
'house_number': $.trim($('#maintable_shop_num').val())
'house_number': $.trim($('#maintable_shop_num').val()),
'district_id' : $("select[name='district_id'] option:selected").val(),
'store_id' : $("select[name='store_id'] option:selected").val(),
'agent_name': $.trim($('#agent_name').val()),
'agent_phone': $.trim($('#agent_phone').val())
};
$.ajax({
type: 'GET',
......@@ -1204,7 +1232,47 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
};
}
});
},
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$('[name=district_id]').append(str);
$('#district_id2').append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
},
};
return bargain;
});
\ No newline at end of file
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