You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
7.9 KiB
Plaintext

11 months ago
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>资金事务控件属性</title>
<script type="text/javascript" src="../internal.js"></script>
<script type="text/javascript" src="../../../jquery.js"></script>
<script type="text/javascript" src="../../../bootstrap/bootstrap.js"></script>
<script type="text/javascript" src="listmenu.js"></script>
<link rel="stylesheet" href="../../../bootstrap/bootstrap.css">
<link rel="stylesheet" href="../../../bootstrap/bootstrap-responsive.css">
<style type="text/css">
*{color: #838383;margin: 0;padding: 0}
html,body {font-size: 12px;}
body {
padding-left: 20px;padding-right: 20px;
}
</style>
</head>
<body>
<table class="table table-striped table-bordered" style="margin-top:18px;margin-bottom: 0;">
<tr>
<th><span>控件类型</span><span class="label label-important">*</span></th>
<th><span>控件名称</span><span class="label label-important">*</span></th>
<th><span>控件样式</span></th>
</tr>
<tr>
<td>
<select id="selectType">
<!--option value="0" selected>选择类型</option-->
<option value="1">资金总计 [文本框]</option>
<option value="2">申请类别 [下拉框]</option>
</select>
</td>
<td>
<input id="itemName" placeholder="必填项" type="text" size="10" value="资金总计"/><br/>
</td>
<td>
<div class="input-prepend input-append">
<span class="add-on">宽</span><input class="span2" value="150" style="display:inline;width: 32px;" id="txtWidth" type="text"><span class="add-on">px</span>
<span class="add-on">高</span><input class="span2" value="20" style="display:inline;width: 32px;" id="txtHeight" type="text"><span class="add-on">px</span>
</div>
</td>
</tr>
<tr>
<td colspan="3"><p><span class="label label-important">*</span> 必须添加【资金总计、类别】控件才能正确统计资金申请数据。</p></td>
</tr>
</table>
<script type="text/javascript">
var oNode = null;
window.onload = function() {
//弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
if( UE.plugins['fund'].editdom ){
oNode = UE.plugins['fund'].editdom;
$G('itemName').value = oNode.getAttribute('title');
$G('selectType').value = oNode.getAttribute('selecttype');
var sWidth = oNode.style.width;
$G('txtWidth').value = sWidth.substr(0, sWidth.length - 2);//这里的substr是为了去掉末尾的'px'
var sHeight = oNode.style.height;
$G('txtHeight').value = sHeight.substr(0, sHeight.length - 2);
}else
{
//新增
$("#selectType").change(function(){
var sType = $G('selectType').value;
if(sType==1)
{
$G('itemName').value='资金总计';
}else if(sType==2)
{
$G('itemName').value='资金申请类别';
}
});
}
}
dialog.oncancel = function () {
if( UE.plugins['fund'].editdom ) {
delete UE.plugins['fund'].editdom;
}
};
dialog.onok = function (){
if( $G('itemName').value == '') {
alert('控件名称不能为空');
$G('itemName').focus();
return false;
}
if( !oNode ) {
var sUrl = parent.getItemUrl;
var nItemId = null;
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
try {
var sType = $G('selectType').value;
nItemId = xhr.responseText;
if(sType ==1)
{
oNode = document.createElement('input');
oNode.setAttribute('name','data_' + nItemId);
oNode.setAttribute('class','fund');
oNode.setAttribute('className','fund_count');
oNode.setAttribute('type','text');
oNode.setAttribute('title',$G('itemName').value.replace("\"","&quot;"));
oNode.setAttribute('selecttype',$G('selectType').value);
if( $G('txtWidth').value!=''){
oNode.style.width = $G('txtWidth').value + 'px';
oNode.setAttribute('fund_width',$G('txtWidth').value);
} else {
oNode.style.width = '148px';
oNode.setAttribute('fund_width','148');
}
if( $G('txtHeight').value!=''){
oNode.style.height = $G('txtHeight').value + 'px';
oNode.setAttribute('fund_height',$G('txtHeight').value);
} else {
oNode.style.height = '25px';
oNode.setAttribute('fund_height','25');
}
editor.execCommand('insertHtml',oNode.outerHTML + "(元)");
}else
{
oNode = document.createElement('select');
oNode.setAttribute('name','data_' + nItemId);
oNode.setAttribute('class','fund');
oNode.setAttribute('className','fund_cat');
oNode.setAttribute('title',$G('itemName').value.replace("\"","&quot;"));
//oNode.setAttribute('selecttype',$G('selectType').value);
if( $G('txtWidth').value!=''){
oNode.style.width = $G('txtWidth').value + 'px';
oNode.setAttribute('fund_width',$G('txtWidth').value);
}
var oOption = fnAddComboOption( oNode, "资金申请类别","0" ) ;
fnSetAttribute( oOption, 'selected', 'selected' ) ;
oOption.selected = true ;
editor.execCommand('insertHtml',oNode.outerHTML);
}
return true;
} catch (e) {
alert ( '插入控件出错请联系OA管理员解决 ');
return false;
}
},
error:function () {
alert('Request TimeOut');
return false;
}
})
} else {
if( $G('txtWidth').value!=''){
oNode.style.width = $G('txtWidth').value + 'px';
oNode.setAttribute('fund_width',$G('txtWidth').value);
} else {
oNode.style.width = '148px';
oNode.setAttribute('fund_width','148');
}
if( $G('txtHeight').value!=''){
oNode.style.height = $G('txtHeight').value + 'px';
oNode.setAttribute('fund_height',$G('txtHeight').value);
} else {
oNode.style.height = '25px';
oNode.setAttribute('fund_height','25');
}
oNode.setAttribute('title',$G('itemName').value.replace("\"","&quot;"));
oNode.setAttribute('selecttype',$G('selectType').value);
delete UE.plugins['fund'].editdom; //使用后清空这个对象,变回新增模式
}
};
</script>
</body>
</html>