ordernews.docx
- 文档编号:10945656
- 上传时间:2023-02-23
- 格式:DOCX
- 页数:20
- 大小:19.29KB
ordernews.docx
《ordernews.docx》由会员分享,可在线阅读,更多相关《ordernews.docx(20页珍藏版)》请在冰豆网上搜索。
ordernews
//检查货币类型整数部分2007-12-06xuhj
functionMoneyIntegerCheck(str,IntLength,FloatLength)
{
varreg=eval("/^[\\d]{1,"+String(IntLength)+"}(\\.[\\d]{0,"+String(FloatLength+1)+"})?
$/");
returnreg.test(str);
}
functionBackUnitPrice(obj)
{
varoUnitPrice=obj.parentElement.parentElement.cells(3).children(0);
varoUnit=obj.parentElement.parentElement.cells(4).children(0);
if(oUnit.value=="0")
oUnit.value=1;
oUnitPrice.value=formatFloat((parseFloat(obj.value)/parseFloat(oUnit.value)),2);
}
//num表示要四舍五入的数,v表示要保留的小数位数。
functionformatFloat(num,v)
{
num=parseFloat(num);
varvv=Math.pow(10,v);
returnMath.round(num*vv)/vv;
}
//拼组商品数据
functionSelectGoods()
{
//取得选择的商品信息
varobjGoodTB=document.getElementById("ProdTB");
varGoodsData="
xmlversion=\"1.0\"encoding=\"GB2312\"?
>
for(i=0;i { if(objGoodTB.rows(i).cells(7).children(0).value! ="") { GoodsData=GoodsData+" //合同号 GoodsData=GoodsData+" [CDATA["; GoodsData=GoodsData+"]]> //产品id GoodsData=GoodsData+" [CDATA["; GoodsData=GoodsData+objGoodTB.rows(i).cells(7).children(0).value; GoodsData=GoodsData+"]]> //产品单价 GoodsData=GoodsData+" [CDATA["; GoodsData=GoodsData+objGoodTB.rows(i).cells(3).children(0).value; GoodsData=GoodsData+"]]> //产品金额 GoodsData=GoodsData+" [CDATA["; GoodsData=GoodsData+objGoodTB.rows(i).cells(5).children(0).value; GoodsData=GoodsData+"]]> //产品数量 GoodsData=GoodsData+" [CDATA["; GoodsData=GoodsData+objGoodTB.rows(i).cells(4).children(0).value; GoodsData=GoodsData+"]]> //用户数 GoodsData=GoodsData+" [CDATA["; GoodsData=GoodsData+objGoodTB.rows(i).cells (2).children(0).value; GoodsData=GoodsData+"]]> //销售单据总金额 GoodsData=GoodsData+" [CDATA["; GoodsData=GoodsData+document.getElementById("txtSum").value; GoodsData=GoodsData+"]]> //销售单备注 GoodsData=GoodsData+" [CDATA["; GoodsData=GoodsData+objGoodTB.rows(i).cells(6).children(0).value; GoodsData=GoodsData+"]]> GoodsData=GoodsData+""; } } GoodsData=GoodsData+""; //vara=window.open("","",""); //a.document.write(GoodsData); //alert(GoodsData); document.getElementById("GoodsData").value=GoodsData; } /************************************** 检索指定ID的商品是否已经选过 **************************************/ functionIsProdExist(ProdID) { varResult=false; varProdTBobj=document.getElementById("ProdTB"); for(k=0;k { if(ProdTBobj.rows(k).cells(7).children(0).value==ProdID) { Result=true; break; } } returnResult; } functionInsertColumn(FatherObj,ClmWidth,ClmCssClass,ClmInnerHTML) { CellObj=FatherObj.insertCell(-1); CellObj.setAttribute("width",ClmWidth); CellObj.className=ClmCssClass; if(ClmInnerHTML.trim()=="") { ClmInnerHTML=" "; } CellObj.innerHTML=ClmInnerHTML; } functionDelEmpyRow() { varProdTBobj=document.getElementById("ProdTB"); for(j=0;j { if(ProdTBobj.rows(j).cells(7).children(0).value.trim()=="") { DelTBRowByIndex(j); } } } functionSelectProduct(){ if(ProductDisabled) returnfalse; //修改人: lizl修改时间: 2009-2-23修改内容: 选择产品新增取消按钮,点击取消按钮,清空值;BtnType=sel: 只显示选择按钮,BtnType=all: 显示选择和取消按钮 //vark=window.showModalDialog("../JHSoft.Web.CrmProduct/ProductSelect.aspx? SelectType=OrderNew&BtnType=sel",window,"dialogWidth: 820px;dialogHeight: 520px;dialogTop: 160px;dialogLeft: 200px;status: no;help: no"); vark=openModalDialog("../JHSoft.Web.CrmProduct/ProductSelect.aspx? SelectType=OrderNew&BtnType=sel",window,{width: 780,height: 520},ProductSelectDataCallBack,null,null,null); } functionProductSelectDataCallBack(k){ top.Dialog.Close(); //varxmlDoc=newActiveXObject("Microsoft.XMLDOM"); ////加载XML //varXMLContent=k; //xmlDoc.loadXML(XMLContent); varxmlDoc=stringtoxml(k); //20110817panqiang //多浏览器兼容$(xmlDoc).find("rec"); //varrootElemnet=xmlDoc.selectSingleNode("root"); varrootElemnet=$(xmlDoc).find("rec"); //清楚预保留行 DelEmpyRow(); varProdTBobj=document.getElementById("ProdTB"); for(i=0;i //检索改商品是否已经存在 if(window.ActiveXObject){//IE if(! IsProdExist(rootElemnet[i].childNodes(0).text)){ varNewRow=ProdTBobj.insertRow(ProdTBobj.rows.length); NewRow.setAttribute("style","height: 25px;background: #FFFFFF;"); InsertColumn(NewRow,"20%","GridTD",rootElemnet[i].childNodes (2).text);//商品名称 InsertColumn(NewRow,"10%","GridTD",rootElemnet[i].childNodes(3).text);//商品规格 InsertColumn(NewRow,"10%","GridTD"," InsertColumn(NewRow,"10%","GridTD"," InsertColumn(NewRow,"10%","GridTD"," InsertColumn(NewRow,"10%","GridTD"," (2)+"\">");//金额modify: lijftime: 2009-12-1 InsertColumn(NewRow,"25%","GridTD"," InsertColumn(NewRow,"5%","GridTD"," } }else{//! IE if(! IsProdExist(rootElemnet[i].childNodes(0).textContent)){ varNewRow=ProdTBobj.insertRow(ProdTBobj.rows.length); NewRow.setAttribute("style","height: 25px;background: #FFFFFF;"); InsertColumn(NewRow,"20%","GridTD",rootElemnet[i].childNodes (2).textContent);//商品名称 InsertColumn(NewRow,"10%","GridTD",rootElemnet[i].childNodes(3).textContent);//商品规格 InsertColumn(NewRow,"10%","GridTD"," InsertColumn(NewRow,"10%","GridTD"," InsertColumn(NewRow,"10%","GridTD"," InsertColumn(NewRow,"10%","GridTD"," (2)+"\">");//金额modify: lijftime: 2009-12-1 InsertColumn(NewRow,"25%","GridTD"," InsertColumn(NewRow,"5%","GridTD"," } } } AddSumCount(); returnfalse; } /************************************ 点击删除图片删除TB行 ************************************/ functionDelTBRowByObj(obj){ //if(window.confirm("确实要删除此项吗? "))//add: lijftime: 2009-12-19 //{ //varCurrentRowIndex=obj.parentElement.parentElement.rowIndex; //DelTBRowByIndex(CurrentRowIndex); //AddSumCount(); //} openConfirmDialog({ contents: "确实要删除此项吗? ",//提示内容 icon: "alert",//图标样式,可用值alert,error,help,ok,info; bottons: {//定制弹出窗口按钮 "确定": function(){ varCurrentRowIndex=obj.parentElement.parentElement.rowIndex; DelTBRowByIndex(CurrentRowIndex); AddSumCount(); },//指定按钮名称及绑定的事件 "取消": null } }); } /************************************* 删除指定index位置TB行 *************************************/ functionDelTBRowByIndex(index) { if(ProductDisabled) returnfalse; varProdTBobj=document.getElementById("ProdTB"); if(ProdTBobj.rows.length>index) { ProdTBobj.deleteRow(index); } } //数量变动金额重计 functionSubSumProdCount(obj) { if(obj.value.trim()=="") { obj.value="1"; } varrowObj=obj.parentElement.parentElement; varDisCount=rowObj.children(4).children(0).value; varPrice=rowObj.children(3).children(0).value; varSumCount=formatFloat(parseFloat(Price)*parseFloat(DisCount),2); rowObj.children(5).children(0).value=SumCount;//Round(String(SumCount));modify: lijftime: 2009-12-1 AddSumCount(); } //折扣变动金额重计 functionSubSumDisCount(obj) { if(obj.value.trim()=="") { obj.value="1"; } varrowObj=obj.parentElement.parentElement; //取得数量数值 varProdCount=rowObj.children(5).children(0).value; varPrice=rowObj.children(4).innerText; if(ProdCount.trim()=="") { ProdCount="0"; } if(Price.trim()=="") { Price="0"; } varSumCount=parseFloat(Price)*parseFloat(ProdCount)*parseFloat(obj.value)/10;//单价*数量*折扣 rowObj.children(7).innerText=Round(String(SumCount)); //rowObj.children(4).innerText=Round(String(ProdCount)); //rowObj.children(5).innerText=Round(String(Price)); AddSumCount(); } functionAddSumCount() { vartem=parseFloat(0); varSumCount=parseFloat(0); varProdTBobj=document.getElementById("ProdTB"); for(f=0;f
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ordernews