- 注册时间
- 2013-1-11
- 最后登录
- 2015-1-9
- 阅读权限
- 10
- 积分
- 74
- 精华
- 0
- 帖子
- 22
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>合同管理系统</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<!--引入MiniUI样式-->
<link href="demo.css" rel="stylesheet" type="text/css" />
<!--引入MiniUI脚本-->
<script src="scripts/boot.js" type="text/javascript"></script>
<!--引入MiniUI皮肤样式-->
<link href="scripts/miniui/themes/blue/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div style="text-align:center;width:1000">
<h1>合同管理系统</h1>
</div>
<div style="width:1000">
<fieldset style="border-color: #FF9900;">
<legend>承揽比例</legend>
<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
<table style="width:100%;">
<tr>
<td style="width:100%;">
<a class="mini-button" iconCls="icon-add" plain="true">增加</a>
<span class="separator"></span>
<a class="mini-button" iconCls="icon-remove" plain="true">删除</a>
</td>
<td style="white-space:nowrap;"></td>
</tr>
</table>
</div>
<div id="dgRate" class="mini-datagrid" showPager= "false" multiSelect="true"
showSummaryRow="true" >
<div property="columns">
<div type="checkcolumn" width="30" headerAlign="center"></div>
<div type="indexcolumn" width="50" headerAlign="center">状况</div>
<div name="headDept" field="headDept_ID" displayField="headDept_NAME" width="150" headerAlign="center" >部门
<input property="editor" class="mini-combobox" valueField="ID" textField="NAME" style="width:100%;"
url="JsonService/CMS_Service.aspx?method=QueryHeadDepts" />
</div>
<div name="dept" field="dept_ID" displayField="dept_NAME" width="150" headerAlign="center" >职位
<input property="editor" class="mini-combobox" valueField="ID" textField="NAME" style="width:100%;" />
</div>
<div field="rate1" width="120" headerAlign="center" allowSort="true">承揽比例%
<input property="editor" class="mini-spinner" minValue="0" maxValue="100" decimalPlaces="2" style="width:100%;"/>
</div>
<div field="rate2" width="120" headerAlign="center" allowSort="true">销售比例%
<input property="editor" class="mini-spinner" minValue="0" maxValue="100" decimalPlaces="2" style="width:100%;"/>
</div>
</div>
</div>
</fieldset>
</div>
<script type="text/javascript">
mini.parse();
/////////////////////////////////////////////////
// 新增记录
function addRow(dg) {
var grid = mini.get(dg);
var row = {};
grid.addRow(row);
grid.beginEditRow(row);
}
// 编辑记录
function editRow(dg) {
var grid = mini.get(dg);
var rows = grid.getSelecteds();
if (rows.length > 0) {
for (var i = 0, l = rows.length; i < l; i++) {
var row = rows;
grid.beginEditRow(row);
}
}
}
// 删除记录
function removeRow(dg) {
var grid = mini.get(dg);
var rows = grid.getSelecteds();
if (rows.length > 0) {
grid.removeRows(rows, true);
} else {
alert("请选中一条记录!");
}
}
//选择“本部”,设置“部门”
function onHeadDeptChanged(e) {
var grid = mini.get("dgRate");
var combo = e.sender;
var row = grid.getEditorOwnerRow(combo);
var editor = grid.getCellEditor("dept", row);
var id = combo.getValue();
var url = "JsonService/CMS_Service.aspx?method=QueryDepts&HeadDeptCode=" + id
editor.setUrl(url);
editor.setValue("");
}
// 承揽比例部分
function onDrawSummaryCellRate(e) {
var result = e.result;
var grid = e.sender;
//客户端汇总计算
if (e.field == "rate1") {
e.cellHtml = "合计: " + e.cellHtml;
}
if (e.field == "rate2") {
e.cellHtml = "合计: " + e.value;
}
}
/////////////////////////////////////////////////
</script>
</body>
</html>
|
|