合理化建议增加查询条件
This commit is contained in:
parent
69e61000ac
commit
3de9d6f2e9
|
@ -35,6 +35,10 @@
|
|||
class="easyui-datebox" editable=false></div>
|
||||
<div style="margin-top:6px"><label>结束时间</label><input name='jssj' style="width:300px"
|
||||
class="easyui-datebox" editable=false></div>
|
||||
<div style="margin-top:6px"><label>建议部门</label><input name='jybm' style="width:300px" id="sjybm"
|
||||
class="easyui-combobox" editable=false></div>
|
||||
<div style="margin-top:6px"><label>建议人</label><input name='jyrname' style="width:300px"
|
||||
class="easyui-textbox"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div id='southdiv' data-options="region:'south'" style="height:46px;text-align:center;padding:6px">
|
||||
|
@ -50,6 +54,22 @@
|
|||
var option = $('#main').attr('value')
|
||||
$('#jytable').datagrid({url:'api/suggest',queryParams:{a:option}});
|
||||
$("#searchjyff").form('clear');
|
||||
$("#sjybm").combotree({
|
||||
url: 'parthandle?a=tree',
|
||||
editable: false,
|
||||
loadFilter: function (rows) {
|
||||
return convert(rows);
|
||||
},
|
||||
formatter: function (node) {
|
||||
var s = node.text;
|
||||
if (node.children) {
|
||||
s += ' <span style=\'color:blue\'>(' + node.children.length + ')</span>';
|
||||
}
|
||||
return s;
|
||||
},
|
||||
onSelect: function (node) {
|
||||
}
|
||||
});
|
||||
})
|
||||
$('#kjcxjy').combobox({
|
||||
editable:false,
|
||||
|
@ -59,6 +79,7 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
function jysearch() {
|
||||
var querydata = $('#searchjyff').serializeJSON();
|
||||
querydata['a'] = 'listsearch'
|
||||
|
|
|
@ -4702,6 +4702,12 @@ def apisuggest(req):
|
|||
startnum, endnum = fenye(req)
|
||||
a = Suggest.objects.filter(usecomp=Partment.objects.get(
|
||||
partid=companyid)).order_by('-submittime')
|
||||
if req.GET.get('jyrname', None):
|
||||
a = a.filter(jyr__name__contains=req.GET.get('jyrname'))
|
||||
if req.GET.get('jybm'):
|
||||
parts = Partment.objects.filter(partlink__contains=','+req.GET.get(
|
||||
'jybm')+',') | Partment.objects.filter(partid=req.GET.get('jybm'))
|
||||
a = a.filter(jybm__in=parts)
|
||||
total = a.count()
|
||||
startnum, endnum = fenye(req)
|
||||
a = a[startnum:endnum].values('jyid', 'jylb__dickeyname', 'jyr__name', 'jybm__partname', 'dqxz', 'jynr',
|
||||
|
@ -4765,6 +4771,12 @@ def apisuggest(req):
|
|||
a = a.filter(submittime__gte=req.GET.get('qssj'))
|
||||
if req.GET.get('jssj'):
|
||||
a = a.filter(submittime__lte=req.GET.get('jssj'))
|
||||
if req.GET.get('jyrname', None):
|
||||
a = a.filter(jyr__name__contains=req.GET.get('jyrname'))
|
||||
if req.GET.get('jybm'):
|
||||
parts = Partment.objects.filter(partlink__contains=','+req.GET.get(
|
||||
'jybm')+',') | Partment.objects.filter(partid=req.GET.get('jybm'))
|
||||
a = a.filter(jybm__in=parts)
|
||||
total = a.count()
|
||||
a = a.order_by('-submittime')[startnum:endnum].values('jyid', 'jylb__dickeyname', 'jyr__name', 'jybm__partname',
|
||||
'dqxz', 'jynr', 'jynum', 'jyzt', 'todouser__userid', 'todouser__name', 'jyqy__name', 'jydd', 'submittime', 'accept')
|
||||
|
|
Loading…
Reference in New Issue