rushfee/build/classes/html/revisit/questionList.html

88 lines
3.1 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="autocomplete" name="typeId" label="问题分类" popupEmptyText="请选择"
textfield="text" valuefield="id" url="revisit/question/getType"
showClose="true" oncloseclick ="conCloseClick" />
<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="revisit/question/getQuestionList" allowalternating="true">
<div type="indexcolumn" width="15" header="序号"></div>
<div field="question_id" visible="false"></div>
<div field="question_type_name" width="30" header="分类"></div>
<div field="question_name" width="30" header="问题描述"></div>
</div>
</div>
<script type="text/javascript">
var grid = aos.get('grid');
grid.load();
function search(){
var params={typeId:aos.get('typeId').value};
grid.load(params);
}
function add(){
var param = {};
param['pageState'] = 'editnew';
aos.showWindow('canvas/revisit/questionAdd', param, '400px', '300px', '问题添加', function(rtnValue){
grid.reload();
});
}
function edit(){
var data = grid.getSelected();
if(!data){
alert("请选择一条数据");
return;
}
var param = {};
param['pageState'] = 'editold';
param['question_id'] = data.question_id;
param['question_type_name'] = data.question_type_name;
param['question_name'] = data.question_name;
aos.showWindow('canvas/revisit/questionEdit', 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:"revisit/question/deleteQuestion",
data:{question_id:data.question_id},
success:function(data){
if(data==1){
aos.tip('删除成功。');
grid.reload();
}else{
aos.tip('删除失败。');
}
}
});
}
}
function conCloseClick (e){
var obj =e.sender;
obj.setText("");
obj.setValue("");
}
</script>
</body>
</html>