<script>
var FieldCount = 0;
function check() {
var frm = document.mainfrm;
for(var i = 1; i <= FieldCount; i ++) {
var el = document.getElementById("FIELD" + i);
if(el.value == null || Trim(el.value) == '') {
alert("[" + el.name + "]不能为空!");
return;
}
if("报价(万元)" == el.name) {
if(!checkNumber(el)) {
alert("无效的报价,必须为有效的数字");
return;
}
var bj = parseFloat(el.value);
if(isNaN(bj) || bj <= 0.0) {
alert("无效的报价,必须>0的数字");
return;
}
}
}
if(Trim(frm.zbwj.value) == '') {
alert("投标文件不能为空!");
return;
}
//判断文件文件名是否为重复
var pos1=frm.zbwj.value.lastIndexOf("\\");
var zbwjName=frm.zbwj.value.substring(pos1+1);
var pos2=frm.zbwj1.value.lastIndexOf("\\");
var zbwj2Name=frm.zbwj1.value.substring(pos2+1);
var pos3=frm.zbwj2.value.lastIndexOf("\\");
var zbwj3Name=frm.zbwj2.value.substring(pos3+1);
var pos4=frm.zbwj3.value.lastIndexOf("\\");
var zbwj4Name=frm.zbwj3.value.substring(pos4+1);
if(zbwjName!=''&&zbwj2Name!=''){
if(zbwjName==zbwj2Name){
alert("不能上传相同的文件");
return false;
}
}
if(zbwjName!=''&&zbwj3Name!=''){
if(zbwjName==zbwj3Name){
alert("不能上传相同的文件");
return false;
}
}
if(zbwjName!=''&&zbwj4Name!=''){
if(zbwjName==zbwj4Name){
alert("不能上传相同的文件");
return false;
}
}
if(zbwj2Name!=''&&zbwj3Name!=''){
if(zbwj2Name==zbwj3Name){
alert("不能上传相同的文件");
return false;
}
}
if(zbwj2Name!=''&&zbwj4Name!=''){
if(zbwj2Name==zbwj4Name){
alert("不能上传相同的文件");
return false;
}
}
if(zbwj3Name!=''&&zbwj4Name!=''){
if(zbwj3Name==zbwj4Name){
alert("不能上传相同的文件");
return false;
}
}
//判断不能为exe后缀名不能上传
var ext=frm.zbwj.value.replace(/.+\./,"");
var ext1=frm.zbwj1.value.replace(/.+\./,"");
var ext2=frm.zbwj2.value.replace(/.+\./,"");
var ext3=frm.zbwj3.value.replace(/.+\./,"");
if(ext=='exe'||ext1=='exe'||ext2=='exe'||ext3=='exe'){
alert("不能上传后缀名为exe的文件");
return false;
}
if(Trim(frm.pwd.value) == '') {
alert("加密密码不能为空!");
return;
}
if(Trim(frm.pwdConfirm.value) == '') {
alert("请确认您的密码!");
return;
}
if(frm.pwdConfirm.value != frm.pwd.value) {
alert("您的密码不匹配,请重新输入!");
frm.pwd.value = '';
frm.pwdConfirm.value = '';
return;
}
if(confirm("确定要投标报价吗?")) {
document.mainfrm.submit();
}
}
//获取文件上传名字
function getFileName(file,u)
{
var pos=file.value.lastIndexOf("\\");
document.getElementById(u).innerText=file.value.substring(pos+1);//文件名
}
</script>
<tr><td align="right" nowrap class="title_form_bgwhite" ><span class="red">*</span>投标文件1</td>
<td width="80%" nowrap><input type="file" name="zbwj" size="50" οnkeydοwn="return false" style="ime-mode:disabled" οnpaste="return false" οnchange="getFileName(this,'u1');"/>(已上传文件:<span class="blue" id="u1"></span>)<br>(非 .exe格式文件,单个文件不能大于5MB)</td>
</tr>
<tr>
<td align="right" nowrap class="title_form_bgwhite" >投标文件2</td>
<td width="80%" nowrap><input type="file" name="zbwj1" size="50" οnkeydοwn="return false" style="ime-mode:disabled" οnpaste="return false" οnchange="getFileName(this,'u2');"/>(已上传文件:<span class="blue" id="u2"></span>)<br>(非 .exe格式文件,单个文件不能大于5MB)</td>
</tr>
<tr>
<td align="right" nowrap class="title_form_bgwhite" >投标文件3</td>
<td width="80%" nowrap><input type="file" name="zbwj2" size="50" οnkeydοwn="return false" style="ime-mode:disabled" οnpaste="return false" οnchange="getFileName(this,'u3');"/>(已上传文件:<span class="blue" id="u3"></span>)<br>(非 .exe格式文件,单个文件不能大于5MB)</td>
</tr>
<tr>
<td align="right" nowrap class="title_form_bgwhite" >投标文件4</td>
<td width="80%" nowrap><input type="file" name="zbwj3" size="50" οnkeydοwn="return false" style="ime-mode:disabled" οnpaste="return false" οnchange="getFileName(this,'u4');"/>(已上传文件:<span class="blue" id="u4"></span>)<br>(非 .exe格式文件,单个文件不能大于5MB)</td>
</tr>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>$!appdef.name</title>
<link href="$request.getContextPath()/zbjg/style.css" rel="stylesheet" type="text/css" />
</head>
#set($tbwjs=$prjProviders)
<script>
top.main_frame.main_frame_left.left_top.setTopic("YWGL_WTS");
function check(action) {
var flag = false;
flagAll=new Array($prjProviders.size());//处理子
#foreach($one in $prjProviders)
#set ($i = $velocityCount - 1)
flagAll[$i] = new Array ("$one.id","$one.isDecryptBidFile");
#end
for(k=0;k<flagAll.length;k++){
if(flagAll[k][1] == 0 && document.getElementById('file'+flagAll[k][0]).value.length == 0) flag = true;
}
//if($one.isDecryptBidFile != 10 || document.getElementById('file'+$!one.id).value.length == 0) flag = true;
//if(flag == true){
// alert("请添加文件!");
// return;
//}
//----------------------------------------------------------------------------------------------------------------
//循环判断文件的上传是否相同是否为exe文件
//判断文件文件名是否为重复
var frm = document.mainfrm;
#foreach($one in $prjProviders)
var ext$one.id=(frm.zbwj0$one.id).value.replace(/.+\./,"");
var ext1$one.id=(frm.zbwj1$one.id).value.replace(/.+\./,"");
var ext2$one.id=(frm.zbwj2$one.id).value.replace(/.+\./,"");
var ext3$one.id=(frm.zbwj3$one.id).value.replace(/.+\./,"");
if(ext$one.id=='exe'||ext1$one.id=='exe'||ext2$one.id=='exe'||ext3$one.id=='exe'){
alert("不能上传后缀名为exe的文件");
return false;
}
#end
#foreach($one in $prjProviders)
//判断文件文件名是否为重复
var pos1$one.id=(frm.zbwj0$one.id).value.lastIndexOf("\\");
var zbwjName$one.id=(frm.zbwj0$one.id).value.substring(pos1$one.id+1);
var pos2$one.id=(frm.zbwj1$one.id).value.lastIndexOf("\\");
var zbwj2Name$one.id=(frm.zbwj1$one.id).value.substring(pos2$one.id+1);
var pos3$one.id=(frm.zbwj2$one.id).value.lastIndexOf("\\");
var zbwj3Name$one.id=(frm.zbwj2$one.id).value.substring(pos3$one.id+1);
var pos4$one.id=(frm.zbwj3$one.id).value.lastIndexOf("\\");
var zbwj4Name$one.id=(frm.zbwj3$one.id).value.substring(pos4$one.id+1);
if(zbwjName$one.id!=''&&zbwj2Name$one.id!=''){
if(zbwjName$one.id==zbwj2Name$one.id){
alert("不能上传相同的文件");
return false;
}
}
if(zbwjName$one.id!=''&&zbwj3Name$one.id!=''){
if(zbwjName$one.id==zbwj3Name$one.id){
alert("不能上传相同的文件");
return false;
}
}
if(zbwjName$one.id!=''&&zbwj4Name$one.id!=''){
if(zbwjName$one.id==zbwj4Name$one.id){
alert("不能上传相同的文件");
return false;
}
}
if(zbwj2Name$one.id!=''&&zbwj3Name$one.id!=''){
if(zbwj2Name$one.id==zbwj3Name$one.id){
alert("不能上传相同的文件");
return false;
}
}
if(zbwj2Name$one.id!=''&&zbwj4Name$one.id!=''){
if(zbwj2Name$one.id==zbwj4Name$one.id){
alert("不能上传相同的文件");
return false;
}
}
if(zbwj3Name$one.id!=''&&zbwj4Name$one.id!=''){
if(zbwj3Name$one.id==zbwj4Name$one.id){
alert("不能上传相同的文件");
return false;
}
}
#end
mainfrm.action.value = action;
if(confirm("确认要$appdef.name吗?")) {
document.getElementById("submit3").disabled = "true";
mainfrm.submit();
}
}
//获取文件上传名字
function getFileName(file,u)
{
var pos=file.value.lastIndexOf("\\");
document.getElementById(u).innerText=file.value.substring(pos+1);//文件名
}
//获取文件上传文件后缀 并且判断如果为exe文件就不能上传
function GetFileExt(file)
{
var ext=file.value.replace(/.+\./,"");
if(ext=='exe'){
alert("禁止exe格式文件上传");
return false;
}else{
return true;
}
}
function ShowSize(files)
{
var fso,f;
fso=new ActiveXObject("Scripting.FileSystemObject");
f=fso.GetFile(files);
var fileSize = f.size ;
if((fileSize/1024) < 1024){
alert(fileSize/1024+"K");
}else if( ((fileSize/1024) > 1024) && ((fileSize/(1024*1024)) < 1024)){
alert(fileSize/(1024*1024)+"M");
}else{
alert(fileSize/(1024*1024*1024)+"G")
}
}
</script>
<link rel="stylesheet" type="text/css" media="all" href="$request.ContextPath/zbjg/scripts/calendar/calendar-green.css" title="green" />
<script type="text/javascript" src="$request.ContextPath/zbjg/scripts/calendar/calendar.js"></script>
<script type="text/javascript" src="$request.ContextPath/zbjg/scripts/calendar/calendar-setup.js"></script>
<script type="text/javascript" src="$request.ContextPath/zbjg/scripts/calendar/lang/calendar-zh.js"></script>
<body class="mainarea">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form name="mainfrm" action="$request.getContextPath()/zbjg/ywgl/runProject.do" method="post" enctype="multipart/form-data">
<input type="hidden" name="appId" value="$!app.id">
<input type="hidden" name="fileId" value="">
<input type="hidden" name="action" value="commitTask" />
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tab_bg">
<tr>
<td width="10" height="23" nowrap class="tab_left"></td>
<td width="260" nowrap class="tab_bg"><span class="tab_biao">$appdef.name</span></td>
<td align="right" nowrap class="tab_bg"> <input type="button" id="submit3" value="提 交" onClick="javascript:check('commitTask');"></td>
<td width="10" nowrap class="tab_rit"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center">
<td width="30%" align="center" nowrap bgcolor="#E7FCFE" class="title_form">投标商</td>
<td width="29%" align="center" nowrap bgcolor="#E7FCFE" class="title_form">代理商</td>
<td width="33%" align="center" nowrap bgcolor="#E7FCFE" class="title_form"><span class="red"></span>投标文件</td>
</tr>
#foreach($one in $prjProviders)
<tr align="center">
<td> $!one.providerName </td>
<td> $!one.agentName</td>
<td>
<table>
<tr><input id = "file$!one.id" name="zbwj0$!one.id" type="file" οnkeydοwn="return false" style="ime-mode:disabled" οnpaste="return false" οnchange="getFileName(this,'u1$!one.id');">(<font color="blue">上传:</font><span class="blue" id="u1$!one.id"></span>)
</tr>
<tr><input id = "file$!one.id" name="zbwj1$!one.id" type="file" οnkeydοwn="return false" style="ime-mode:disabled" οnpaste="return false" οnchange="getFileName(this,'u2$!one.id');">(<font color="blue">上传:</font><span class="blue" id="u2$!one.id"></span>)
</tr>
<tr><input id = "file$!one.id" name="zbwj2$!one.id" type="file" οnkeydοwn="return false" style="ime-mode:disabled" οnpaste="return false" οnchange="getFileName(this,'u3$!one.id');">(<font color="blue">上传:</font><span class="blue" id="u3$!one.id"></span>)
</tr>
<tr><input id = "file$!one.id" name="zbwj3$!one.id" type="file" οnkeydοwn="return false" style="ime-mode:disabled" οnpaste="return false" οnchange="getFileName(this,'u4$!one.id');">(<font color="blue">上传:</font><span class="blue" id="u4$!one.id"></span>)
<input type="hidden" name="ids" value="$!one.id"></tr>
</table>
</td>
</tr>
#end
</table>
</td>
</tr>
</form>
<!--捆绑节点列表-->
#parse("/zbjg/ywgl/COMM/bind_inc.vm")
<!--结束捆绑-->
</table>
</body>
</html>