rushfee/build/classes/html/revisit/itemSync.html

91 lines
3.4 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="itemId" popupEmptyText="请选择"
textfield="item_name" valuefield="item_id" label="商品名称"
url="revisit/itemSync/getItemName" 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/itemSync/getList" allowalternating="true">
<div type="indexcolumn" width="15" header="序号"></div>
<div field="id" visible="false"></div>
<div field="item_id" visible="false"></div>
<div field="item_name" width="50" header="商品名称"></div>
<div field="description" width="30" header="描述"></div>
<div field="is_sync" width="10" header="是否同步" renderer="trueFalseRenderer" trueFalseValue="truevalue:是;falsevalue:否"></div>
</div>
</div>
<script type="text/javascript">
var grid = aos.get('grid');
grid.load();
function search(){
var params={itemId:aos.get('itemId').getValue()};
grid.load(params);
}
function add(){
var param = {};
param['pageState'] = 'editnew';
aos.showWindow('canvas/revisit/itemSyncAdd', 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['item_id'] = data.item_id;
param['item_name'] = data.item_name;
param['description'] = data.description;
param['is_sync'] = data.is_sync;
aos.showWindow('canvas/revisit/itemSyncEdit', 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/itemSync/deleteItemSetting",
data:{id:data.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>