日期:2014-05-16 浏览次数:20365 次
<script language="javascript">
function lc() {
//代入值
dd=Number(document.getElementById("dd").value); //尺寸精确到几位
ddd=Number(document.getElementById("ddd").value); //比值精确到几位
bianhao=document.getElementById("inputbainhao").value;
basem = Number(document.getElementById("basem").value);
minm = Number(document.getElementById("minm").value);
maxm= Number(document.getElementById("maxm").value);
basex= Number(document.getElementById("basex").value);
basey= Number(document.getElementById("basey").value);
basez= Number(document.getElementById("basez").value);
mcx= Number(document.getElementById("mcx").value);
mcy= Number(document.getElementById("mcy").value);
mcz= Number(document.getElementById("mcz").value);
//先得最小码
zxx=basex-(basem-minm)*mcx;
//alert('x'+zxx);//测试
zxy=basey-(basem-minm)*mcy;
//alert('y'+zxy);//测试
zxz=basez-(basem-minm)*mcz;
//alert('z'+zxz);//测试
//alert(bianhao);//测试
//计算全部
j=0 ; //码差增加倍数
for (var i=minm; i<=maxm; i++) {
if(i==basem){ //等于本码CSS为红色,粗体
document.getElementById("tableid").innerHTML +='<tr><td class="td2"><input type="text" id="m'+i+'" value="'+i+'码" class="td00"></td><td class="td2"><input type="text" id="x'+i+'" value="'+Number(zxx+mcx*j).toFixed(dd)+'" class="td00"></td><td class="td2"><input type="text" id="y'+i+'" value="'+Number(zxy+mcy*j).toFixed(dd)+'" class="td00"></td><td class="td2"><input type="text" id="z'+i+'" value="'+Number(zxz+mcz*j).toFixed(dd)+'" class="td00"></td><td class="td2"><input type="text" id="bx'+i+'" value="" class="td00"></td><td class="td2"><input type="text" id="by'+i+'" value="" class="td00"></td><td class="td2"><input type="text" id="bz'+i+'" value="" class="td00"></td><td class="td2"><input type="text" id="" value="这是本码" class="td00"></td></tr>';
j+=1;
}else{
document.getElementById("tableid").innerHTML +='<tr><td class="td2"><input type="text" id="m'+i+'" value="'+i+'码" class="td3"></td><td class="td2"><input type="text" id="x'+i+'" value="'+Number(zxx+mcx*j).toFixed(dd)+'" class="td3"></td><td class="td2"><input type="text" id="y'+i+'" value="'+Number(zxy+mcy*j).toFixed(dd)+'" class="td3"></td><td class="td2"><input type="text" id="z'+i+'" value="'+Number(zxz+mcz*j).toFixed(dd)+'" class="td3"></td><td class="td2"><input type="text" id="bx'+i+'" value="" class="td3"></td><td class="td2"><input type="text" id="by'+i+'" value="" class="td3"></td><td class="td2"><input type="text" id="bz'+i+'" value="" class="td3"></td><td class="td2"><input type="text" id="" value="备注" class="td4"></td></tr>';
//alert(document.getElementById("m"+i).value);//测试
//alert(document.getElementById("x"+i).value);