rushfee/resource/html/rush/taskassign.html

250 lines
9.5 KiB
HTML

<html login="false">
<head>
<meta charset="UTF-8">
<title>任务分配</title>
</head>
<body >
<div name="tab2" title="任务分配" bodyStyle="margin-top:5px">
<div widget="toolbar" >
<a widget="button" iconCls="icon-search" onclick="search">查询</a>
<a widget="button" iconCls="icon-save" onclick="save" >保存</a>
<a widget="button" iconCls="icon-edit" onclick="shaixuan()">反馈筛选</a>
<a widget="button" iconCls="icon-exit" onclick="CloseWindow('close')">退出</a>
</div>
<input widget="combox" name="company" label="分公司" url="rush/org/getPersonOrgList"
emptyText="请选择" textField="text" valueField="id" allowInput="false" showNullItem="false"
style="width:502px;margin-top:5px" onvaluechanged="getRevenue" />
<br/>
<input widget="combox" name="revenue" label="税务机关" multiSelect="true" style="width:502px;" emptyText="请选择" textField="text" valueField="id" allowInput="false" showNullItem="true"/>
<br/>
<input widget="combox" name="end_date" label="到期情况" multiSelect="true" style="width:216px;" sqlid="rushfee_list.grouplist" showNullItem="true" />
<a widget="button" iconCls="icon-enabled" style="width:70px;" onclick="selectenddate()">全选</a>
<input widget="combox" name="last_date" label="距上次催缴天数" sqlid="search.getrushday" style="width:207px;"/>
<br/>
<input widget="combox" name="count" label="回访次数" multiSelect="true" sqlid="companycount.rushcount" showNullItem="true" style="width:400px;margin-top:5px" emptyText="请选择"/>
<a widget="button" iconCls="icon-enabled" style="width:70px;margin-top:5px" onclick="select()">全选</a>
<br/>
<input name="chargetype" widget=combox allowinput="f" style="width: 350px;" showNullItem="true" onValueChanged="tuoguan"
data="[{id:'0',text:'服务费'},{id:'1',text:'托管'}]" emptyText="请选择" label="催缴客户类型">
<div name="jiguichosoe" label="是否在机柜" widget="radiobuttonlist" onValueChanged="tuoguan"
repeatitems="2" repeatlayout="table" textfield="text" valuefield="id"
data="[{id:0,text:'否'},{id:1,text:'是'}]">
</div>
<div name="mianzhengchoose" label="是否免征" widget="radiobuttonlist" onValueChanged="tuoguan"
repeatitems="2" repeatlayout="table" textfield="text" valuefield="id"
data="[{id:0,text:'否'},{id:1,text:'是'}]">
</div>
<input widget="edit" name="feedback" label="筛选条件有" width="502"/> <br/>
<input widget="edit" name="all_task" allowinput="f" label="任务总数"/>
<input widget="edit" name="all_task2019" allowinput="f" label="2019积压任务总数"/>
<input widget="edit" name="assign_task" allowinput="true" label="预计分配任务"/>
<br/>
<div widget="toolbar" style="margin-left:35px;width:460px;margin-top:10px;">
<a widget="button" iconcls="icon-add" onclick="addRow()">新增</a>
<a widget="button" iconcls="icon-delete" onclick="remove">删除</a>
</div>
<div widget="autosize" style="margin-left:35px;height:510px;">
<div widget="datagrid" name="grid_user" style="width: 465px; height:240px;" url="" allowcelledit="true" allowcellselect="true" allowalternating="true" editnextonenterkey="true" editnextrowcell="true" >
<div type="indexcolumn" width="35" header="序号"></div>
<div field="user" width="50" header="人员" ></div>
<div field="tasknum" width="30" header="条数" ></div>
<div field="userid" visible="false"></div>
<div field="username" visible="false" ></div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
var combox = aos.get('person');
var num=0;
var taskNum =0;
var flag =1;
var url="rush/org/getRevenueByOrgId?companyid=";
var grid_user = aos.get('grid_user');
var userTemp="";
var user_id = new Array();
var user_task = new Array();
var user_name= new Array();
var count=0;
function init(param){
}
//到期情况全选
function selectenddate (){
var select=aos.get('end_date');
var asd ='-2,-3,-4,-5,-6,2,3';
select.setValue(asd);
//aos.alert(aos.get('end_date').getValue());
}
function select(){
var select=aos.get('count');
var asd ='0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26';
select.setValue(asd);
}
function tuoguan(e){
var typechoose = aos.get('chargetype').getValue();
if(typechoose==0){
aos.get('jiguichosoe').setValue();
aos.get('mianzhengchoose').setValue();
aos.tip("服务费不能选择是否机柜和免征!",3000);
}
}
function getRevenue(e){
var company = aos.get('company');
var revenue = aos.get('revenue');
revenue_url = url+company.getValue();
revenue.load(revenue_url)
}
function addRow(){
var param={};
aos.showWindow('canvas/rush/taskpeoplechoose', param, '280px', '246px', '分配人员', function(rtnValue){
if(rtnValue!='close'&&typeof(rtnValue)!="undefined"){
var newRow = {
user:rtnValue.username,
tasknum:rtnValue.tasknum,
userid:rtnValue.userid
};
grid_user.addRow(newRow,0);
}
});
}
function remove(){
var row=grid_user.getSelected();
if(!row){
aos.alert('选择一行后进行删除!');
return;
}
aos.confirm('确认删除吗?',null,function(action){
if(action == 'cancel')
return;
var numTemp=parseInt(aos.get('assign_task').getValue(), 10) - parseInt(row.tasknum, 10);
grid_user.removeRow(row, true);
});
}
function getTaskPeoplebyId(){
var Data ="";
for(i=0;i<parseInt(grid_user.data.length);i++)
{
var param = {};
param['user_id']=grid_user.getRow(i).user;
aos.post({
url:"rush/search/queryuserbyid",
data:param,
success:function(rtnData){
Data=rtnData+","+Data
return Data;
}
});
}
}
function save(){
if(parseInt(aos.get('assign_task').getValue())>parseInt(aos.get('all_task').getValue()))
{
aos.alert('预计分配任务条数大于任务总条数!');
return ;
}else{
var rtnData = {};
rtnData['company']=aos.get('company').getText();
rtnData['companyId']=aos.get('company').getValue(); //分公司id
rtnData['last_date']=aos.get('last_date').getValue(); //距上次催缴
rtnData['revenue']=aos.get('revenue').getValue(); //税务机关
rtnData['end_date']=aos.get('end_date').getValue(); //到期情况
//aos.alert(aos.get('end_date').getValue());
//return;
rtnData['end_date_name']=aos.get('end_date').getText(); //到期情况id
rtnData['tasknum']=aos.get('assign_task').getValue(); //分配数
rtnData['last_date_name']=aos.get('last_date').getText();
/* 回访次数 */
rtnData['count']=aos.get('count').getValue();
rtnData['injf']=aos.get('jiguichosoe').getValue();
rtnData['ifmz']= aos.get('mianzhengchoose').getValue();
rtnData['chargetype']=aos.get('chargetype').getText();
rtnData['chargetypeNum']=aos.get('chargetype').getValue();
rtnData['feedback']=aos.get('feedback').getValue();
if(aos.get('chargetype').getValue()==''){
aos.alert('请选择催缴客户类型!');
return;
}
for(i=0;i<parseInt(grid_user.data.length);i++)
{
count=parseInt(count*1+grid_user.getRow(i).tasknum*1);
user_id[i] =grid_user.getRow(i).userid;
userTemp=grid_user.getRow(i).user+","+userTemp;
user_task[i] =grid_user.getRow(i).tasknum;
user_name[i] =grid_user.getRow(i).user;
}
if(count!=parseInt(aos.get('assign_task').getValue()))
{
count=0;
userTemp="";
aos.alert('实际分配总数与预计分配数不相等!');
return;
}
rtnData['user_name']=user_name;
rtnData['user']=userTemp;
rtnData['user_id']=user_id;
rtnData['user_task']=user_task;
rtnData['grid']=grid_user.getData();
CloseWindow(rtnData);}
}
function search(){
var data={};
data['injf']=aos.get('jiguichosoe').getValue();
data['ifmz']=aos.get('mianzhengchoose').getValue();
data['company']=aos.get('company').getValue();
data['revenue']=aos.get('revenue').getValue();
data['expstate']=aos.get('end_date').getValue();
data['rushdaynum']=aos.get('last_date').getValue();
data['count']=aos.get('count').getValue();
data['feedback']=aos.get('feedback').getValue();
data['chargetype']=aos.get('chargetype').getValue();
var count = aos.get('count').getValue();
var feedback = aos.get('feedback').getValue();
if(feedback!=""&&(count==0||count=="")){
aos.tip('回访次数不能为空且不能为未回访');
return;
}
aos.post({
url:"rush/post/rushTaskListNum",
data:data,
success:function(rtnData){
aos.get('all_task').setValue(rtnData.totalnum);
}
});
aos.post({
url:"rush/post/rushTaskListNum2019",
data:data,
success:function(rtnData){
aos.get('all_task2019').setValue(rtnData.totalnum2019);
}
});
}
function shaixuan(){
var param = {};
param['pageState'] = 'editnew';
param['feedback']=aos.get('feedback').getValue();
aos.showWindow('canvas/tick/feedbacktask', param, '500px', '400px', '反馈类型筛选任务', function(params,RtnData){
aos.get('feedback').setValue(params['feedback']);
aos.get('feedback').setValue(RtnData['feedback']);
});
}
</script>
</html>