Title
import="java.util.Date"%>
市局办公用品-新个人申领type="text/css">
//dwr.engine.setAsync(false);
var csbh="";
var goodsindex=0;
function submitButton(obj)
{
if(obj.value==""){
return;
}
OfficeSuppliesLogic.queryGoods(obj.value,csbh,setGoods);
}
function handleSetSelectIndexAsValue(destSideId,value){
var destSide=document.getElementById(destSideId);
if(destSide==null)return;
for(var j=0;j
if(destSide.options[j].value==value){
destSide.selectedIndex=j;
break;
}
}
}
function setGoods(data){
handleRemoveAll("goods");
if(data==null ||data=='null'){return;}
for(var i=0;i
var officeSuppliesModel=data[i];
if(officeSuppliesModel==null ||officeSuppliesModel=='null' ){continue;}
var goodsId=officeSuppliesModel.id;
var goodsName=officeSuppliesModel.name;
var goodsUnit=officeSuppliesModel.unit;
handleAdd("goods",goodsId+"|"+goodsUnit,goodsName);
}
}
function backClick()
{
document.forms[0].method.value="queryExamePersonSuppliesByUser";
return true;
}
function saveClick()
{
document.forms[0].typeName.value=document.forms[0].typeId.options[document.forms[0].typeId.selectedIndex].text;
document.forms[0].goodsName.value=document.forms[0].goods.options[document.forms[0].goods.selectedIndex].text;
count=document.forms[0].goodsName.value;
if(count==null || count.length<=0)
{
alert('物品名称不能为空!');
document.forms[0].goodsName.value='';
return false;
}
count=document.forms[0].applyCount.value;
if(count==null || count<='0')
{
alert('数量不能小(等)于零或为空!');
document.forms[0].applyCount.value='';
return false;
}
return true;
}
function startClick()
{
var checknum=0;
var checkBoxs=document.getElementsByName("applyid");
for(var i=0;i
if(checkBoxs[i].checked){
checknum=checknum+1;
}
}
if(checknum==0){
alert("可提交的申请项为空,请选择申请项后进行提交!");
return false;
}
document.forms[0].method.value="createPersonSuppliesDraw";
return true;
}
function goodChange()
{
var val=document.forms[0].goods.options[document.forms[0].goods.selectedIndex].value;
var arry=val.split('|');
try{
document.forms[0].unit.value=arry[1];
document.forms[0].goodsId.value=arry[0];
if(document.getElementById('display').hasChildNodes())
{
document.getElementById('display').removeChild(document.getElementById('display').childNodes[0]);
}
// document.getElementById('display').removeChild(document.getElementById('display'));
document.getElementById('display').appendChild(document.createTextNode(arry[1]));
}catch(e)
{}
}
function addGoods(){
if(!saveClick()){
return;
}
var opertype=document.forms[0].opertype.value;
var typeName=document.forms[0].typeId.options[document.forms[0].typeId.selectedIndex].text;
var typeId=document.forms[0].typeId.options[document.forms[0].typeId.selectedIndex].value;
var goodsName=document.forms[0].goods.options[document.forms[0].goods.selectedIndex].text;
var goods_id="-1";
var unit="";
var val=document.forms[0].goods.options[document.forms[0].goods.selectedIndex].value;
var arry=val.split('|');
try{
unit=arry[1];
goods_id=arry[0];
}catch(e)
{}
var applyCount=document.forms[0].applyCount.value;
var table=document.getElementById("bgyptable");
if(opertype==""){
var newTr = table.insertRow(table.rows.length-1);
newTr.id=goodsindex;
var newTd0 = newTr.insertCell();
newTd0.className="table2_td";
newTd0.innerHTML=typeName+""
+"";
var newTd1 = newTr.insertCell();
newTd1.className="table2_td";
newTd1.innerHTML=goodsName+""
+""
+"";
var newTd3 = newTr.insertCell();
newTd3.className="table2_td";
newTd3.innerHTML=applyCount+unit+"";
var newTd6 = newTr.insertCell();
newTd6.className="table2_td";
newTd6.innerHTML="修改";
goodsindex=goodsindex+1;
}else{
for(var i=0;i
obj=table.rows[i];
if(obj.cells.length<3||obj.cells[3].getElementsByTagName("input").length==0||obj.cells[3].getElementsByTagName("input")[0].type!="checkbox"){
continue;
}
var rowid=obj.cells[3].getElementsByTagName("input")[0].value;
if(rowid==opertype){
obj.cells[0].innerHTML=typeName+""
+"";
obj.cells[1].innerHTML=goodsName+""
+""
+"";
obj.cells[2].innerHTML=applyCount+unit+"";
document.forms[0].opertype.value="";
document.getElementById("okbutton").value="增加到申请列表";
}
}
}
document.forms[0].applyCount.value="";
// document.forms[0].guige.value="";
//document.forms[0].typeId.selectedIndex=0;
//document.forms[0].goods.selectedIndex=0;
}
function setModify(obj){
var id=obj.cells[3].getElementsByTagName("input")[0].value;
document.forms[0].opertype.value=id;
document.forms[0].applyCount.value=obj.cells[2].getElementsByTagName("input")[0].value;
//document.forms[0].guige.value=obj.cells[3].getElementsByTagName("input")[0].value;
handleSetSelectIndexAsValue("typeId",obj.cells[0].getElementsByTagName("input")[0].value);
submitButton(document.getElementById("typeId"));
handleSetSelectIndexAsValue("goods",obj.cells[1].getElementsByTagName("input")[1].value+"|"+obj.cells[1].getElementsByTagName("input")[2].value);
document.getElementById("okbutton").value="确定";
}
width="12" height="11"> 当前位置:北京市药监局 >> 辅助办公 >> 办公用品申请 |
cellspacing="0" class="table1_border">
width="26" height="23" align="absmiddle">
办公用品领用登记
var count=0;
align="center" cellpadding="0" cellspacing="1"
class="table2_border">
所属类别
名称
数量
是否提交
οnchange="submitButton(this);">
value=""
selected
/>
value="|"
selected />
οnclick="javascript:addGoods()">
cellpadding="0" cellspacing="1" class="table2_border">
src="btnSubmit.gif"
οnclick="return startClick()">
src="btnBack.gif"
οnclick="return backClick()">