rushfee/build/classes/html/revisit/hwPhoneList.html

87 lines
3.2 KiB
HTML
Raw Normal View History

2022-05-16 15:07:40 +00:00
<html login="false">
<head>
<title>华为电话账号</title>
</head>
<body >
<div widget="toolbar" style="padding:10px;border:0;">
<input widget="edit" name="username" label="姓名"/>
<input widget="edit" name="agentId" label="工号"/>
<input widget="edit" name="phoneNo" label="电话"/>
<a widget="button" iconCls="icon-search" onclick="search()">查询</a>
<a widget="button" iconCls="icon-add" onclick="add()">新增</a>
<a widget="button" iconCls="icon-edit" onclick="edit()">修改</a>
<a widget="button" iconCls="icon-delete" onclick="remove()">删除</a>
</div>
<div widget="autosize">
<div widget="datagrid" name="grid" style="width: 100%;height:100%" url="hwphone/getAccountList" allowalternating="true">
<div type="indexcolumn" width="5" header="序号"></div>
<div field="id" visible="false"></div>
<div field="user_id" visible="false"></div>
<div field="user_name" width="10" header="姓名"></div>
<div field="agent_id" width="10" header="工号"></div>
<div field="phone_no" width="30" header="分机号"></div>
</div>
</div>
<script type="text/javascript">
var grid = aos.get('grid');
grid.load();
function search(){
var params={username:aos.get('username').value,agentId:aos.get('agentId').value,
phoneNo:aos.get('phoneNo').value};
grid.load(params);
}
function add(){
var param = {};
param['pageState'] = 'editnew';
aos.showWindow('canvas/revisit/hwPhoneAdd', param, '400px', '300px', '电话账号添加', function(rtnValue){
grid.reload();
});
}
function edit(){
var data = grid.getSelected();
if(!data){
alert("请选择一条数据");
return;
}
var param = {};
param['pageState'] = 'editold';
param['id'] = data.id;
param['userId'] = data.user_id;
param['userName'] = data.user_name;
param['agentId'] = data.agent_id;
param['phoneNo'] = data.phone_no;
aos.showWindow('canvas/revisit/hwPhoneEdit', param, '400px', '300px', '电话账号修改', function(rtnValue){
grid.reload();
});
}
function remove() {
var data = grid.getSelected();
if(!data){
alert("请选择一条数据");
return;
}
var comfirmTure=confirm("确认删除该项数据吗?");
if(comfirmTure){
aos.post({
url:"hwphone/delAccount",
data:{id:data.id},
success:function(data){
if(data==1){
aos.tip('删除成功。');
grid.reload();
}else{
aos.tip('删除失败。');
}
}
});
}
}
</script>
</body>
</html>