Skip to content

Instantly share code, notes, and snippets.

@ageback
Created November 28, 2012 08:31
Show Gist options
  • Save ageback/4159887 to your computer and use it in GitHub Desktop.
Save ageback/4159887 to your computer and use it in GitHub Desktop.
内网“其他操作”页面
function Reprint(busId)
{
OpenFormPage('补打','','CompanyBusID='+busId,'bussIframe');
}
$(document).ready(function(){
var companyName = GetURLParameter("txtCompanyName");
var acceptNo = GetURLParameter("AcceptNo");
var serialNo = GetURLParameter("SerialNo");
$("#txtProductName").val(unescape(GetURLParameter("ProductName")));
$("#txtCompanyName").val(unescape(companyName));
$("#txtAcceptNo").val(unescape(acceptNo));
$("#txtSerialNo").val(unescape(serialNo));
$("#txtRegDateFrom").val(unescape(GetURLParameter("RegStartDate")));
$("#txtRegDateTo").val(unescape(GetURLParameter("RegEndDate")));
$("#ddlBusType").val(unescape(GetURLParameter("BusinessType")));
if ($('input[id="MultiSelectBox"][checked]').length == 0)
{
$('.subbus').attr('disabled','disabled');
}
else
{
$('.subbus').removeAttr('disabled');
}
$('input[id="MultiSelectBox"]').bind('click', function(){
// if(this.checked)
// {
//$('input[type="checkbox"]').not(this).removeAttr("Checked");
if ($('input[id="MultiSelectBox"][checked]').length == 0)
{
$('.subbus').attr('disabled','disabled');
}
else if($('input[id="MultiSelectBox"][checked]').length == 1)
{
$('.subbus').removeAttr('disabled');
}
else if ($('input[id="MultiSelectBox"][checked]').length > 1)
{
$('.subbus').attr('disabled','disabled');
$('#btnKDZC').removeAttr('disabled');
}
var selectedTR$ = $(GetParentElementByTagName(this, "TR"));
var status = selectedTR$.attr("Status");
//$('.subbus').removeAttr('disabled');
// }
// else
// {
// $('.subbus').attr('disabled','disabled');
// }
})
});
function RegMaterial()
{
$('input[id="MultiSelectBox"][checked]').each(function()
{
var selectedTR$ = $(GetParentElementByTagName(this, "TR"));
var tableAlia = selectedTR$.attr("id").replace("TR_","").split("_");
var companyBusID = tableAlia[1];
var keyFieldID=selectedTR$.attr("KeyFieldID");
//OpenFormPage('材料接收登记','','0.JSTCCOMPANYBUSINESS_ID='+companyBusID+'&CompanyBusID='+companyBusID+'&0.JSTCMATERIALMANAGE_ID=-1');
OpenFormPage('材料接收管理(单独)','','0.JSTCCOMPANYBUSINESS_ID='+companyBusID);
});
}
function SearchData()
{
var acceptNo = $("#txtAcceptNo").val();
if (acceptNo != '' && !isNumber(acceptNo))
{
alert('受理号必须是数字!');
$("#txtAcceptNo").focus();
return;
}
var serialNo = $("#txtSerialNo").val();
if (serialNo != '' && !isNumber(serialNo))
{
alert('流水号必须是数字!');
$("#txtSerialNo").focus();
return;
}
var regStartDate = $("#txtRegDateFrom").val();
var regEndDate = $("#txtRegDateTo").val();
if (regStartDate != '' && !regStartDate.isDate())
{
alert('请输入正确的日期格式!');
$("#txtRegDateFrom").focus();
return;
}
if (regEndDate != '' && !regEndDate.isDate())
{
alert('请输入正确的日期格式!');
$("#txtRegDateTo").focus();
return;
}
var productName = $("#txtProductName").val();
var companyName = $("#txtCompanyName").val();
var businessType = $("#ddlBusType").val();
RefreshFormPage(undefined,"AcceptNo=" + escape(acceptNo) + "&ProductName=" + escape(productName) + "&RegStartDate=" + escape(regStartDate) + "&RegEndDate=" + escape(regEndDate) + "&BusinessType=" + escape(businessType) + "&CompanyName="+escape(companyName) + "&SerialNo=" + escape(serialNo));
}
function ClearSearchCondition()
{
$("#txtAcceptNo").val("");
$("#txtSerialNo").val("");
$("#txtProductName").val("");
$("#txtCompanyName").val("");
$("#txtRegDateFrom").val("");
$("#txtRegDateTo").val("");
$("#ddlBusType").val(0);
}
function RegExpress()
{
var busIDs='';
var productNames='';
var applyAddress;
var contactName;
var applyCompany = null;
var isSameCompany=true;
$('input[id="MultiSelectBox"][checked]').each(function()
{
var selectedTR$ = $(GetParentElementByTagName(this, "TR"));
var tableAlia = selectedTR$.attr("id").replace("TR_","").split("_");
var companyBusID = tableAlia[1];
if (applyCompany != null)
{
if (selectedTR$.attr("ApplyCompany") != applyCompany)
{
alert('所选产品不属于同一家单位,不能同时寄出!');
isSameCompany=false;
return false;
}
}
applyCompany = selectedTR$.attr("ProductName");
var productName = selectedTR$.attr("ProductName");
applyCompany = selectedTR$.attr("ApplyCompany");
applyAddress = selectedTR$.attr("ApplyAddress");
contactName = selectedTR$.attr("ContactName");
busIDs += companyBusID + ',';
productNames += productName + ',';
//OpenFormPage("快递寄出材料列表",undefined,"0.JSTCCOMPANYBUSINESS_ID="+companyBusID+"&0.JSTCEXPRESSDELIVER_ID=-1&CompanyBusID="+companyBusID)
});
busIDs = busIDs.substr(0, busIDs.length-1);
productNames = productNames.substr(0, productNames.length-1);
if ($('input[id="MultiSelectBox"][checked]').length > 1)
{
if (isSameCompany)
{
OpenFormPage("快递寄出登记",undefined,"0.JSTCEXPRESSDELIVER_ID=-1&CompanyBusID="+busIDs+"&ProductNames="+escape(productNames)+"&ApplyAddress="+escape(applyAddress)+"&ApplyCompany="+escape(applyCompany)+"&ContactName="+escape(contactName));
}
}
if ($('input[id="MultiSelectBox"][checked]').length == 1)
{
OpenFormPage("快递寄出材料列表",undefined,"0.JSTCCOMPANYBUSINESS_ID="+busIDs+"&CompanyBusID="+busIDs+"&ProductNames="+escape(productNames)+"&ApplyAddress="+escape(applyAddress)+"&ApplyCompany="+escape(applyCompany)+"&ContactName="+escape(contactName));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment