You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/js/WmsOutEdit.js

2131 lines
86 KiB
JavaScript

2 years ago
var commonGridObj_wmsin;
var comboCustomer;//货主
var comboCustomer2; //货主2
var comboOutCustomer;//出货对象
var combooutcustomer2; //货主2
var comboStorage;//仓库
var comboStorage2;//仓库2
var comboARCLIENT;
var comboTRUCKNAME;
var comboGoods;//品名
var pressRecord
var isLoad = 0;
var pressCount = 0;
var IsChangeCus=0;
var pressRecord;
function $(id){
return document.getElementById(id);
}
function Getcustomno(rId) {
//获得备案清单号
var url = "WmsRateGridSource.aspx?handle=getCustomno&id=" + rId + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(url);
var customno = loader.xmlDoc.responseText;
if (customno != "") {
$("txt_customno").value = customno;
}
else {
$("txt_customno").value = "";
}
//获得批次号
url = "WmsRateGridSource.aspx?handle=getBztchno&id=" + rId + "&val=" + newGuid();
loader = dhtmlxAjax.getSync(url);
var bztchno = loader.xmlDoc.responseText;
if (customno != "") {
$("txt_bztchno").value = bztchno;
}
else {
$("txt_bztchno").value = "";
}
}
function setOutInfo(rId,ischeck){
if(ischeck==true){
if ($("txt_outbsno").value == "") {
$("txt_blno").value = commonGridObj_wmsin.getGridObj().cellById(rId, 2).getValue();
$("h_blno").value = commonGridObj_wmsin.getGridObj().cellById(rId, 2).getValue();
$("h_opseaibsno").value = commonGridObj_wmsin.getGridObj().cellById(rId, 18).getValue();
//
var cusname=commonGridObj_wmsin.getGridObj().cellById(rId,1).getValue();
if(cusname!=""){
$("h_customer").value=cusname;
comboCustomer.setText($("h_customer").value);
initcombomblnonew2();
if($("h_Ischange").value=="1"){
comboOutCustomer.setComboText($("h_outcustomer").value); //setText 改为 setComboText by lcx
combomblnonew.setComboText($("h_mblnonew").value);
}
else {
$("h_outcustomer").value = $("h_customer").value;
comboOutCustomer.setComboText($("h_outcustomer").value);
$("h_mblnonew").value = $("h_blno").value;
combomblnonew.setComboText($("h_mblnonew").value);
}
}
Getcustomno(rId); //获得备案清单号,获得批次号
$("h_goods").value=commonGridObj_wmsin.getGridObj().cellById(rId,5).getValue();
if($("h_goods").value!=""){
comboGoods.setText($("h_goods").value);
}
$("txt_goodsmodel").value=commonGridObj_wmsin.getGridObj().cellById(rId,6).getValue();
$("h_goodsmodel").value = $("txt_goodsmodel").value;
//仓库
if($("h_storage").value==""){
$("h_storage").value=commonGridObj_wmsin.getGridObj().cellById(rId,17).getValue();
if($("h_storage").value!=""){
comboStorage.setText($("h_storage").value);
}
}
}
}
else{
if ($("txt_outbsno").value == "") {
$("txt_blno").value = "";
$("h_blno").value = "";
$("h_customer").value="";
$("h_outcustomer").value="";
comboCustomer.setText("");
$("h_mblnonew").value = "";
combomblnonew.setText("");
if($("h_Ischange").value=="1"){
comboOutCustomer.setComboText("");
}
else {
comboOutCustomer.setComboText("");
}
$("h_goods").value="";
comboGoods.setText("");
$("txt_goodsmodel").value="";
$("h_goodsmodel").value="";
$("h_storage").value="";
comboStorage.setText("");
$("hd_comboARCLIENT").value = "";
comboARCLIENT.setComboText($("hd_comboARCLIENT").value);
$("hd_comboTRUCKNAME").value = "";
comboTRUCKNAME.setComboText($("hd_comboTRUCKNAME").value);
$("hd_comboARCLIENTWMSOUT").value = "";
comboARCLIENTWMSOUT.setComboText($("hd_comboARCLIENTWMSOUT").value);
}
}
}
//初始化界面
function initTj(){
$("txt_blno").value = "";
$("h_blno").value = "";
$("txt_blno2").value = "";
$("h_blno2").value = "";
$("h_customer").value="";
comboCustomer.setText("");
$("h_customer2").value = "";
comboCustomer2.setText("");
$("h_storage").value="";
comboStorage.setText("");
$("h_storage2").value = "";
comboStorage2.setText("");
$("hd_comboARCLIENT").value = "";
comboARCLIENT.setComboText($("hd_comboARCLIENT").value);
$("hd_comboTRUCKNAME").value = "";
comboTRUCKNAME.setComboText($("hd_comboTRUCKNAME").value);
$("hd_comboARCLIENTWMSOUT").value = "";
comboARCLIENTWMSOUT.setComboText($("hd_comboARCLIENTWMSOUT").value);
$("txt_outbsno").value = ""
$("h_outcustomer").value = "";
comboOutCustomer.setComboText("");
$("h_mblnonew").value = "";
combomblnonew.setComboText("");
$("h_goods").value="";
comboGoods.setText("");
$("txt_goodsmodel").value="";
$("h_goodsmodel").value="";
$("h_goodspfsl").value="";
$("h_goodspfsl").value="";
//
$("txt_goodsmodel2").value = "";
$("txt_customno2").value = "";
$("txt_bztchno2").value = "";
//
createOrder();
}
function ReShowLabel_2(gridObj) {
var columnCount = gridObj.getGridObj().getColumnsNum();
var rowCount = gridObj.getGridObj().getRowsNum();
if (rowCount > 0) {
for (var i = 0; i < rowCount; i++) {
for (var j = 0; j < columnCount; j++) {
if (j == 7 ) {
var cellCurVal = gridObj.getGridObj().cellByIndex(i, j).getValue();
gridObj.getGridObj().cellByIndex(i, j).setLabel(cellCurVal);
}else if( j == 10 || j == 11 ){
var cellCurVal = gridObj.getGridObj().cellByIndex(i, j).getValue();
gridObj.getGridObj().cellByIndex(i, j).setValue(cellCurVal);
}
}
}
}
}
function SetRate(){
var openSet = "height=490, width=800, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-490)/2 + ",Left= "+(screen.width-800)/2
var openType = "_blank";
if($("h_opseaibsno").value!=null && $("h_opseaibsno").value!="" && $("h_newcust").value!=null && $("h_newcust").value!="" ){
var openUrl = "../SeaiFee/WmsRateEdit.aspx?handle=edit&id="+$("h_opseaibsno").value+"&cust="+escape($("h_newcust").value);
window.open (openUrl,openType,openSet);
}
else {
alert("货权转移之前,不能编辑仓储费率!");
return;
}
}
function createOrder(){
if ($("h_Handle").value == "edit")
{
$("dvtable_outtj").style.display="none";
$("divfee").style.display = "";
}
else
{
$("dvtable_outtj").style.display = "";
$("divfee").style.display = "none";
}
if($("h_IsSetRate").value=="0"){
$("btn_IsSetRate").style.display = "none";
}
else{
if($("h_opseaibsno").value!=null && $("h_opseaibsno").value!="" && $("h_newcust").value!=null && $("h_newcust").value!="" ){
$("btn_IsSetRate").style.display="";
}
else
{
$("btn_IsSetRate").style.display="none";
}
}
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
var headerArgs_wmsin = new Array("", "货主", "提单号", "入库日期", "开始计费日期", "品名", "牌号", "市场货值", "库位", "剩余件数", "剩余库存", "出库件数", "出库重量", "应收出库费", "应付出库费", "车号", "备注", "仓库名称", "进口委托单号", "单件吨数", "原货主", "入库GID", "出库明细GID", "应付开始计费日期", "计费单位", "剩余件数_EDIT", "剩余库存_EDIT", "市场货值单价");
//width
var widthArgs_wmsin = new Array("30", "80", "80", "80", "80", "80", "80", "80", "80", "80", "80", "80", "80", "80", "80", "200", "400", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0");
//column align
var colAlignArgs_wmsin = new Array("center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center", "center");
//column sort
var colSortArgs_wmsin = new Array("na", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str");
//column type
var colTypeArgs_wmsin = new Array("ch", "ro", "ro", "ro", "ro", "ro", "ro", "ro", "ro", "ro", "ro", "ed", "ed", "ed", "ed", "txt", "ed", "ro", "ro", "ro", "ro", "ro", "ro", "ro", "ro", "ro", "ro", "ro");
commonGridObj_wmsin = new TGridCommon("mygrid_container_wmsin","form1",headerArgs_wmsin,widthArgs_wmsin,colAlignArgs_wmsin,colSortArgs_wmsin,colTypeArgs_wmsin);
commonGridObj_wmsin.setResponseUrl("../SeaiFee/WmsRateGridSource.aspx");
if ($("h_Handle").value == "edit") {
if ($("h_searchJson").value != "") {
commonGridObj_wmsin.setRequest("../SeaiFee/WmsRateGridSource.aspx?handle=wmsinlistedit&search=" + escape($("h_searchJson").value) + "&wmsoutbsno=" + $("h_wmsoutbsno").value.trim());
} else {
commonGridObj_wmsin.setRequest("../SeaiFee/WmsRateGridSource.aspx?handle=wmsinlistedit&bsno=" + $("h_opseaibsno").value + "&wmsoutbsno=" + $("h_wmsoutbsno").value.trim());
}
}
else {
if ($("h_searchJson").value != "") {
commonGridObj_wmsin.setRequest("../SeaiFee/WmsRateGridSource.aspx?handle=wmsinlist&search=" + escape($("h_searchJson").value));
} else {
commonGridObj_wmsin.setRequest("../SeaiFee/WmsRateGridSource.aspx?handle=wmsinlist&bsno=" + $("h_opseaibsno").value);
}
}
commonGridObj_wmsin.setSourceType("json");
commonGridObj_wmsin.setSkin("xp");
commonGridObj_wmsin.setImageUrl("../images/");
commonGridObj_wmsin.initGrid();
commonGridObj_wmsin.bind();
commonGridObj_wmsin.getGridObj().enableEditEvents(true, false, true);
commonGridObj_wmsin.getGridObj().enableKeyboardSupport(true);
commonGridObj_wmsin.getGridObj().enableMultiselect(true);
commonGridObj_wmsin.getGridObj().attachEvent("onSelectStateChanged", function (id) {
doInitRecvGrid2();
});
var txtEdit;
commonGridObj_wmsin.getGridObj().attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) {
if ($("h_isdisabled").value == "true") {
return false;
}
//初始化状态
if (stage == 0) {
txtEdit = "";
return true;
} //stage == 0
if (stage == 1) {
txtEdit = "";
for (i = 0; i < document.all.length; i++) {
if (document.all(i).tagName == "TEXTAREA") {
txtEdit = document.all(i);
txtEdit.focus();
txtEdit.select();
break;
}
}
} //stage == 1
if (cInd == 11) {
if ($("h_Handle").value.trim() != "edit") {
var Num_Out = commonGridObj_wmsin.getGridObj().cellById(rId, cInd).getValue();
if (Num_Out != 0) {
var Num_Kc = parseFloat(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellById(rId, 9).getValue()));
if (Num_Out > Num_Kc) {
commonGridObj_wmsin.getGridObj().cellById(rId, cInd).setLabel(Num_Kc);
}
setOutInfo(rId, true);
//totalDynamicOutNum();
}
}
}
else if (cInd == 15) {
if (txtEdit != null) {
if (txtEdit.value != null) {
if (txtEdit.value != "") {
commonGridObj_wmsin.getGridObj().cellById(rId, cInd).setValue(txtEdit.value);
}
}
}
}
if (stage == 2) {//编辑结束
if (cInd == 15) {
if (txtEdit != null) {
if (txtEdit.value != null && txtEdit.value != "") {
var sdf = txtEdit.value;
commonGridObj_wmsin.getGridObj().cellById(rId, cInd).setValue(txtEdit.value);
}
}
else {
return true;
}
}
if (oValue == null || oValue == "" || oValue == "0") {
return true;
}
if (cInd == 16) {
commonGridObj_wmsin.getGridObj().cellById(rId, cInd).setValue(nValue);
}
else if (cInd == 11) {
commonGridObj_wmsin.getGridObj().cellById(rId, cInd).setLabel(nValue);
}
return true;
} //stage == 2
}); //onEditCell end
//键盘操作事件
commonGridObj_wmsin.getGridObj().attachEvent("onKeyPress", function (code, cFlag, sFlag) {
if ($("h_isdisabled").value == "true") {
return false;
}
//onKeyPress begin
//获取当前RowID
var selectedId = commonGridObj_wmsin.getGridObj().getSelectedRowId();
//获取当前RowIndex
var RowIndex = commonGridObj_wmsin.getGridObj().getRowIndex(selectedId);
//获取当前CellIndex(ind)
var ind = commonGridObj_wmsin.getGridObj().getSelectedCellIndex();
//触发操作事件前获取单元值
var oldVal = commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex, ind).getValue();
//获取编辑单元
var txtEdit;
for (i = 0; i < document.all.length; i++) {
if (document.all(i).tagName == "TEXTAREA") {
txtEdit = document.all(i);
break;
}
}
//enter 键
if (code == 13) {
if (ind == 11 || ind == 12 || ind == 13 || ind == 14 || ind == 15 || ind == 16) {
return true;
}
} //enter 键 end
//Tab键
else if (code == 9) {
//code9 begin
var colCount = commonGridObj_wmsin.getGridObj().getColumnsNum();
//获取当前RowIndex
//触发操作事件前获取单元值
if (ind < colCount) {
isExchange = false;
if (ind == 11 || ind == 12 || ind == 13 || ind == 14) {
var oldVal = commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex, ind).getValue();
commonGridObj_wmsin.getGridObj().editStop(true);
commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex, ind).setLabel(oldVal);
setOutInfo(selectedId, true);
//totalDynamicOutNum();
commonGridObj_wmsin.getGridObj().selectCell(RowIndex, ind + 1, true, true);
commonGridObj_wmsin.getGridObj().editCell();
}
else if (ind == 15) {
commonGridObj_wmsin.getGridObj().editStop(true);
if (txtEdit.value != null && txtEdit.value != "") {
commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex, ind).setValue(txtEdit.value);
}
commonGridObj_wmsin.getGridObj().selectCell(RowIndex, ind + 1, true, true);
commonGridObj_wmsin.getGridObj().editCell();
}
else if (ind == 16) {
commonGridObj_wmsin.getGridObj().editStop(true);
commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex, ind).setValue(oldVal);
commonGridObj_wmsin.getGridObj().selectCell(RowIndex, ind + 1, true, true);
commonGridObj_wmsin.getGridObj().editCell();
}
}
} //cdoe9 end
//向下方向键
else if (code == 40) {
//code40 begin
if (ind == 11 || ind == 12 || ind == 13 || ind == 14 || ind == 15 || ind == 16) {
var rowCount = commonGridObj_wmsin.getGridObj().getRowsNum();
commonGridObj_wmsin.getGridObj().editStop(true);
if (RowIndex != (rowCount - 1)) {
commonGridObj_wmsin.getGridObj().selectCell(RowIndex + 1, ind, true, true);
commonGridObj_wmsin.getGridObj().editCell();
}
}
else {
return true;
}
} //code40 end
//向上箭头
else if (code == 38) {
//code38 begin
if (ind == 11 || ind == 12 || ind == 13 || ind == 14 || ind == 15 || ind == 16) {
if (RowIndex > 0) {
commonGridObj_wmsin.getGridObj().clearSelection();
commonGridObj_wmsin.getGridObj().editStop(true);
commonGridObj_wmsin.getGridObj().selectCell(RowIndex - 1, ind, true, true);
commonGridObj_wmsin.getGridObj().editCell();
}
} else {
return true;
}
} //code38 end
//左箭头
else if (code == 37) {
//code37 begin
commonGridObj_wmsin.getGridObj().clearSelection();
commonGridObj_wmsin.getGridObj().editStop(true);
if (ind == 11) {
commonGridObj_wmsin.getGridObj().selectCell(RowIndex, 16, true, true);
}
else {
commonGridObj_wmsin.getGridObj().selectCell(RowIndex, ind - 1, true, true);
}
commonGridObj_wmsin.getGridObj().editCell();
return true;
} //code37 end
//右箭头
else if (code == 39) {
//code39 begin
commonGridObj_wmsin.getGridObj().clearSelection();
commonGridObj_wmsin.getGridObj().editStop(true);
if (ind == 16) {
commonGridObj_wmsin.getGridObj().selectCell(RowIndex, 11, true, true);
}
else {
commonGridObj_wmsin.getGridObj().selectCell(RowIndex, ind + 1, true, true);
}
commonGridObj_wmsin.getGridObj().editCell();
return true;
} //code39 end
else if (code == 46) {
if (ind == 11 || ind == 12 || ind == 13 || ind == 14) {
commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex, ind).setLabel("");
}
else if (ind == 15 || ind == 16) {
commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex, ind).setValue("");
}
} //end code == 46
//delete
else if (code == 8) {
//code8 begin
if (ind == 11 || ind == 12 || ind == 13 || ind == 14 || ind == 15 || ind == 16) {
var start = 0;
var end = 0;
if (document.selection) {
var range = document.selection.createRange();
if (range.parentElement().className == txtEdit.className) {
var range_all = document.body.createTextRange();
range_all.moveToElementText(txtEdit);
for (start = 0; range_all.compareEndPoints("StartToStart", range) < 0; start++) {
range_all.moveStart('character', 1);
}
for (var i = 0; i <= start; i++) {
if (txtEdit.value.charAt(i) == '\n')
start++;
}
var range_all = document.body.createTextRange();
range_all.moveToElementText(txtEdit);
for (end = 0; range_all.compareEndPoints('StartToEnd', range) < 0; end++)
range_all.moveStart('character', 1);
for (var i = 0; i <= end; i++) {
if (txtEdit.value.charAt(i) == '\n')
end++;
}
}
}
//未选中多个字符
if (start == end) {
if (start != 0) {
if (pressRecord != null) {
var firstVal = pressRecord.substring(0, start - 1);
var endVal = pressRecord.substring(start + 1, txtEdit.value.length - 1);
pressRecord = firstVal;
}
}
}
//选中多个字符
if (start != end) {
if (pressRecord != null) {
var firstVal = pressRecord.substring(0, start);
var endVal = pressRecord.substring(end - 1, txtEdit.value.length - 1);
pressRecord = firstVal + endVal;
}
}
setTimeout(function () {
if (pressRecord != null) {
if (pressRecord.trim().length > 0) {
var combo = commonGridObj_wmsin.getGridObj().getCustomCombo(selectedId, ind);
var comboArg = combo.getKeys();
var count = 0;
for (var i = 0; i < comboArg.length; i++) {
if (combo.get(comboArg[i]).toUpperCase().trim().indexOf(pressRecord) == 0) {
count++;
var oldVal = comboArg[i];
var oldLab = combo.get(comboArg[i]);
pressCount = 3;
commonGridObj_wmsin.getGridObj().editStop(true);
commonGridObj_wmsin.getGridObj().cellByIndex(rowIndex, ind).setValue(oldVal);
commonGridObj_wmsin.getGridObj().selectCell(rowIndex, ind, true, true);
commonGridObj_wmsin.getGridObj().editCell();
var old_length = oldLab.length;
for (i = 0; i < document.all.length; i++) {
if (document.all(i).tagName == "TEXTAREA") {
txtEdit = document.all(i);
var rt = txtEdit.createTextRange();
rt.collapse();
rt.select(); //光标置最前
var r = document.selection.createRange();
r.collapse(false);
r.moveStart("character", pressRecord.length); //从m位开始
r.moveEnd("character", old_length); //选取n位
//txtEdit.focus();
r.select();
}
}
break;
}
}
}
}
}, 500);
return true;
} else {
return true;
}
} //code8 end
//键盘输入数字
else if (code >= 48 && code <= 57 || code >= 96 && code <= 105 || code == 188 || code == 110 || code == 190 || code == 229) {
if (ind == 11 || ind == 12 || ind == 13 || ind == 14 || ind == 15 || ind == 16) {
return true;
}
}
else if (code >= 65 && code <= 90) {//如果是输入英文字符
if (ind == 15 || ind == 16) {
return true;
}
}
else {
return true;
}
});
//}
isLoad = 1;
}// createOrder() end
function outputMoney(number) {
number= number.replace(/\,/g,"");
if (isNaN(number)||number=="") return "";
number = Math.round( number*100) /100;
if(number<0)
return '-'+outputDollars(Math.floor(Math.abs(number)-0) + '') + outputCents(Math.abs(number) - 0);
else
return outputDollars(Math.floor(number-0) + '') + outputCents(number - 0);
}
function RecreateOrder(){
createOrder();
} //RecreateOrder() end
var newGuid = function(){
var guid = "";
for (var i = 1; i <= 32; i++){
var n = Math.floor(Math.random()*16.0).toString(16);
guid += n;
if((i==8)||(i==12)||(i==16)||(i==20))
guid += "-";
}
return guid.toUpperCase();
};
function doCheck(clickObj){
}
//初始化Combo
function initCombos()
{
if($("h_Mode").value=="0"){
if($("sel_customer")!=null){
initComboCustomer();//货主
}
if($("sel_customer2")!=null){
initComboCustomer2();//货主
}
if($("sel_storage")!=null){
initComboStorage();//仓库名称
}
if ($("sel_storage2") != null) {
initComboStorage2(); //仓库名称
}
if($("sel_goods")!=null){
initComboGoods();//品名ok
}
//
initcomboOutCustomer2();
initcombomblnonew2();
initComboARCLIENT2();
initComboTRUCKNAME2();
initComboARCLIENTWMSOUT2();
}
else if($("h_Mode").value=="1"){
if ($("sel_customer") != null) {
initComboCustomer(); //货主
}
if ($("sel_storage") != null) {
initComboStorage(); //仓库名称
}
if($("sel_goods")!=null){
initComboGoods();//品名ok
}
initcomboOutCustomer2();
comboOutCustomer.setComboText($("h_outcustomer").value);
initcombomblnonew2();
combomblnonew.setComboText($("h_mblnonew").value);
initComboARCLIENT2();
initComboTRUCKNAME2();
initComboARCLIENTWMSOUT2();
}
// finishLoading();
}
function initComboCustomer(){//货主
comboCustomer = new TCombo("sel_customer", "../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0", true, true, false, true, "h_customer");
comboCustomer.initComboEvent();
comboCustomer.bind();
if($("h_customer").value!="" && $("h_customer").value!=null)
{
comboCustomer.setText($("h_customer").value);
}
}
function initComboCustomer2() {//货主2
comboCustomer2 = new TCombo("sel_customer2", "../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0", true, true, false, true, "h_customer2");
comboCustomer2.initComboEvent();
comboCustomer2.bind();
if ($("h_customer2").value != "" && $("h_customer2").value != null) {
comboCustomer2.setText($("h_customer2").value);
}
}
//storage
function initComboStorage() {//仓库名称
comboStorage = new TCombo("sel_storage", "../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISWAREHOUSE", true, true, false, true, "h_storage");
comboStorage.initComboEvent();
comboStorage.bind();
if($("h_storage").value!="" && $("h_storage").value!=null)
{
comboStorage.setText($("h_storage").value);
}
}
//storage
function initComboStorage2() {//仓库名称
comboStorage2 = new TCombo("sel_storage2", "../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISWAREHOUSE", true, true, false, true, "h_storage2");
comboStorage2.initComboEvent();
comboStorage2.bind();
if($("h_storage2").value!="" && $("h_storage2").value!=null)
{
comboStorage2.setText($("h_storage2").value);
}
}
//
function initComboARCLIENT() {//应收
comboARCLIENT = new TCombo("ddlARCLIENT", "../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISWAREHOUSE&strIS2=ISCONTROLLER", true, true, false, true, "hd_comboARCLIENT");
comboARCLIENT.initComboEvent();
comboARCLIENT.bind();
if ($("hd_comboARCLIENT").value != "" && $("hd_comboARCLIENT").value != null)
{
comboARCLIENT.setText($("hd_comboARCLIENT").value);
}
}
//
function initComboTRUCKNAME() {//应付
comboTRUCKNAME = new TCombo("ddlTRUCKNAME", "../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISWAREHOUSE&strIS2=ISTRUCK", true, true, false, true, "hd_comboTRUCKNAME");
comboTRUCKNAME.initComboEvent();
comboTRUCKNAME.bind();
if ($("hd_comboTRUCKNAME").value != "" && $("hd_comboTRUCKNAME").value != null)
{
comboTRUCKNAME.setText($("hd_comboTRUCKNAME").value);
}
}
function initComboGoods() {//品名ok
comboGoods = new TCombo("sel_goods", "../SeaiFee/WmsRateGridSource.aspx?handle=goodslist", true, true, false, true, "h_goods");
comboGoods.initComboEvent();
comboGoods.bind();
if($("h_goods").value!="" && $("h_goods").value!=null)
{
comboGoods.setText($("h_goods").value);
}
}
function initcomboOutCustomer()//货主
{
comboOutCustomer = dhtmlXComboFromSelect("sel_outcustomer");
comboOutCustomer.loadXML("../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISCONTROLLER ");
}
function initcomboOutCustomer2()//货主
{
if ($("h_isdisabled").value == "true" || $("h_Handle").value == "edit") {
comboOutCustomer.disable(true);
}
//
comboOutCustomer.attachEvent("onChange", function() {
comboOutCustomer.setComboText($("h_outcustomer").value);
});
comboOutCustomer.attachEvent("onBlur", function() {
var s1 = comboOutCustomer.getComboText().trim();
var s2 = s1.indexOf("|");
if (s1 == "") {
$("h_outcustomer").value = "";
comboOutCustomer.setComboText($("h_outcustomer").value);
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
comboOutCustomer.setComboText(s3);
$("h_outcustomer").value = s3;
}
else {
comboOutCustomer.setComboText($("h_outcustomer").value);
}
}
});
comboOutCustomer.setOptionWidth(200);
comboOutCustomer.setComboText($("h_outcustomer").value);
comboOutCustomer.attachEvent("onKeyPressed", function(keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function() {
var filterCount = 0;
var is = -1;
var ishd = $("h_outcustomer").value.trim();
if ("" != comboOutCustomer.getComboText().trim()) {
while ("undefined" != typeof comboOutCustomer.getOptionByIndex(filterCount)) {
var comboValue = comboOutCustomer.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = comboOutCustomer.getComboText().trim().toUpperCase();
$("h_outcustomer").value = comboOutCustomer.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
comboOutCustomer.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
}
}, 10);
}
});
comboOutCustomer.attachEvent("onSelectionChange", function() {
$("h_outcustomer").value = comboOutCustomer.getComboText().trim();
});
}
var combomblnonew;
function initcombomblnonew()//转移单号
{
combomblnonew = dhtmlXComboFromSelect("sel_mblnonew");
combomblnonew.loadXML("WmsRateGridSource.aspx?mask=0&pos=0&handle=mblnonew");
}
function initcombomblnonew2()//转移单号
{
if ($("h_isdisabled").value == "true" || $("h_Handle").value == "edit") {
combomblnonew.disable(true);
}
combomblnonew.loadXML("WmsRateGridSource.aspx?mask=0&pos=0&handle=mblnonew&opseaibsno=" + $("h_opseaibsno").value);
//
combomblnonew.attachEvent("onChange", function () {
combomblnonew.setComboText($("h_mblnonew").value);
});
combomblnonew.attachEvent("onBlur", function () {
var s1 = combomblnonew.getComboText().trim();
$("h_mblnonew").value = s1;
//转移对象
var urls = "../SeaiFee/WmsRateGridSource.aspx?handle=getoutcustomer&mblnonew=" + $("h_mblnonew").value + "&val=" + newGuid();
loader = dhtmlxAjax.getSync(urls);
ls = loader.xmlDoc.responseText;
if (ls.trim() != "") {
$("h_outcustomer").value = ls.trim();
comboOutCustomer.setComboText($("h_outcustomer").value);
}
//审批单号
var urls = "../SeaiFee/WmsRateGridSource.aspx?handle=getinspectionno&mblnonew=" + $("h_mblnonew").value + "&val=" + newGuid();
loader = dhtmlxAjax.getSync(urls);
ls = loader.xmlDoc.responseText;
if (ls.trim() != "") {
$("txt_inspectionno").value = ls.trim();
}
});
combomblnonew.setOptionWidth(200);
combomblnonew.setComboText($("h_mblnonew").value);
combomblnonew.attachEvent("onKeyPressed", function (keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function () {
var filterCount = 0;
var is = -1;
var ishd = $("h_mblnonew").value.trim();
if ("" != combomblnonew.getComboText().trim()) {
while ("undefined" != typeof combomblnonew.getOptionByIndex(filterCount)) {
var comboValue = combomblnonew.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = combomblnonew.getComboText().trim().toUpperCase();
$("h_mblnonew").value = combomblnonew.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
combomblnonew.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
if (is == -1) {
var sklj = $("h_Ischange").value;
if ($("h_Ischange").value == "1") {
$("h_mblnonew").value = ishd;
alert("无此内容,请重新选择!");
}
//
}
}
}, 10);
}
});
combomblnonew.attachEvent("onSelectionChange", function () {
$("h_mblnonew").value = combomblnonew.getComboText().trim();
});
}
var comboARCLIENTWMSOUT;
function initComboARCLIENTWMSOUT()//应收仓库客户名称
{
comboARCLIENTWMSOUT = dhtmlXComboFromSelect("ddlARCLIENTWMSOUT");
comboARCLIENTWMSOUT.loadXML("../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISWAREHOUSE&strIS2=ISCONTROLLER");
}
function initComboARCLIENTWMSOUT2()//应收仓库客户名称
{
if ($("h_isdisabled").value == "True") {
comboARCLIENTWMSOUT.disable(true);
}
//
comboARCLIENTWMSOUT.setOptionWidth(200);
comboARCLIENTWMSOUT.attachEvent("onChange", function () {
comboARCLIENTWMSOUT.setComboText($("hd_comboARCLIENTWMSOUT").value);
});
comboARCLIENTWMSOUT.attachEvent("onBlur", function () {
var s1 = comboARCLIENTWMSOUT.getComboText().trim();
var s2 = s1.indexOf("|");
if (s1 == "") {
$("hd_comboARCLIENTWMSOUT").value = "";
comboARCLIENTWMSOUT.setComboText($("hd_comboARCLIENTWMSOUT").value);
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
comboARCLIENTWMSOUT.setComboText(s3);
$("hd_comboARCLIENTWMSOUT").value = s3;
}
else {
comboARCLIENTWMSOUT.setComboText($("hd_comboARCLIENTWMSOUT").value);
}
}
});
comboARCLIENTWMSOUT.setComboText($("hd_comboARCLIENTWMSOUT").value);
comboARCLIENTWMSOUT.attachEvent("onKeyPressed", function (keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function () {
var filterCount = 0;
var is = -1;
var ishd = $("hd_comboARCLIENTWMSOUT").value.trim();
if ("" != comboARCLIENTWMSOUT.getComboText().trim()) {
while ("undefined" != typeof comboARCLIENTWMSOUT.getOptionByIndex(filterCount)) {
var comboValue = comboARCLIENTWMSOUT.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = comboARCLIENTWMSOUT.getComboText().trim().toUpperCase();
$("hd_comboARCLIENTWMSOUT").value = comboARCLIENTWMSOUT.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
comboARCLIENTWMSOUT.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
if (is == -1) {
$("hd_comboARCLIENTWMSOUT").value = ishd;
alert("无此内容,请重新选择!");
}
}
}, 10);
}
});
comboARCLIENTWMSOUT.attachEvent("onSelectionChange", function () {
$("hd_comboARCLIENTWMSOUT").value = comboARCLIENTWMSOUT.getComboText().trim();
});
}
function initComboARCLIENT()//应收账款客户名称
{
comboARCLIENT = dhtmlXComboFromSelect("ddlARCLIENT");
comboARCLIENT.loadXML("../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISWAREHOUSE&strIS2=ISCONTROLLER");
}
function initComboARCLIENT2()//应收账款客户名称
{
if ($("h_isdisabled").value == "True") {
comboARCLIENT.disable(true);
}
//
comboARCLIENT.setOptionWidth(200);
comboARCLIENT.attachEvent("onChange", function () {
comboARCLIENT.setComboText($("hd_comboARCLIENT").value);
});
comboARCLIENT.attachEvent("onBlur", function () {
var s1 = comboARCLIENT.getComboText().trim();
var s2 = s1.indexOf("|");
if (s1 == "") {
$("hd_comboARCLIENT").value = "";
comboARCLIENT.setComboText($("hd_comboARCLIENT").value);
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
comboARCLIENT.setComboText(s3);
$("hd_comboARCLIENT").value = s3;
}
else {
comboARCLIENT.setComboText($("hd_comboARCLIENT").value);
}
}
});
comboARCLIENT.setComboText($("hd_comboARCLIENT").value);
comboARCLIENT.attachEvent("onKeyPressed", function (keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function () {
var filterCount = 0;
var is = -1;
var ishd = $("hd_comboARCLIENT").value.trim();
if ("" != comboARCLIENT.getComboText().trim()) {
while ("undefined" != typeof comboARCLIENT.getOptionByIndex(filterCount)) {
var comboValue = comboARCLIENT.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = comboARCLIENT.getComboText().trim().toUpperCase();
$("hd_comboARCLIENT").value = comboARCLIENT.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
comboARCLIENT.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
if (is == -1) {
$("hd_comboARCLIENT").value = ishd;
alert("无此内容,请重新选择!");
}
}
}, 10);
}
});
comboARCLIENT.attachEvent("onSelectionChange", function () {
$("hd_comboARCLIENT").value = comboARCLIENT.getComboText().trim();
});
}
function initComboTRUCKNAME()//应付账款客户名称
{
comboTRUCKNAME = dhtmlXComboFromSelect("ddlTRUCKNAME");
comboTRUCKNAME.loadXML("../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISWAREHOUSE&strIS2=ISTRUCK");
}
function initComboTRUCKNAME2()//应付账款客户名称
{
if ($("h_isdisabled").value == "True") {
comboTRUCKNAME.disable(true);
}
//
comboTRUCKNAME.setOptionWidth(200);
comboTRUCKNAME.attachEvent("onChange", function () {
comboTRUCKNAME.setComboText($("hd_comboTRUCKNAME").value);
});
comboTRUCKNAME.attachEvent("onBlur", function () {
var s1 = comboTRUCKNAME.getComboText().trim();
var s2 = s1.indexOf("|");
if (s1 == "") {
$("hd_comboTRUCKNAME").value = "";
comboTRUCKNAME.setComboText($("hd_comboTRUCKNAME").value);
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
comboTRUCKNAME.setComboText(s3);
$("hd_comboTRUCKNAME").value = s3;
}
else {
comboTRUCKNAME.setComboText($("hd_comboTRUCKNAME").value);
}
}
});
comboTRUCKNAME.setComboText($("hd_comboTRUCKNAME").value);
comboTRUCKNAME.attachEvent("onKeyPressed", function (keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function () {
var filterCount = 0;
var is = -1;
var ishd = $("hd_comboTRUCKNAME").value.trim();
if ("" != comboTRUCKNAME.getComboText().trim()) {
while ("undefined" != typeof comboTRUCKNAME.getOptionByIndex(filterCount)) {
var comboValue = comboTRUCKNAME.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = comboTRUCKNAME.getComboText().trim().toUpperCase();
$("hd_comboTRUCKNAME").value = comboTRUCKNAME.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
comboTRUCKNAME.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
if (is == -1) {
$("hd_comboTRUCKNAME").value = ishd;
alert("无此内容,请重新选择!");
}
}
}, 10);
}
});
comboTRUCKNAME.attachEvent("onSelectionChange", function () {
$("hd_comboTRUCKNAME").value = comboTRUCKNAME.getComboText().trim();
});
}
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); }
function outputMoney(number) {
number= number.replace(/\,/g,"");
if (isNaN(number)||number=="") return "";
number = Math.round( number*100) /100;
if(number<0)
return '-'+outputDollars(Math.floor(Math.abs(number)-0) + '') + outputCents(Math.abs(number) - 0);
else
return outputDollars(Math.floor(number-0) + '') + outputCents(number - 0);
}
function outputDollars(number)
{
if (number.length<= 3)
return (number == '' ? '0' : number);
else
{
var mod = number.length%3;
var output = (mod == 0 ? '' : (number.substring(0,mod)));
for (i=0 ; i< Math.floor(number.length/3) ; i++)
{
if ((mod ==0) && (i ==0))
output+= number.substring(mod+3*i,mod+3*i+3);
else
output+= ',' + number.substring(mod+3*i,mod+3*i+3);
}
return (output);
}
}
function outputCents(amount)
{
amount = Math.round( ( (amount) - Math.floor(amount) ) *100);
return (amount<10 ? '.0' + amount : '.' + amount);
}
function postEnterFee(){
var myForm = document.getElementById("form1");
myForm.submit() ;
}
function ConvertToMoney(strObj){
var result = strObj.replace(",","");
return result;
}
function clearNoNum(valObj)
{
//先把非数字的都替换掉,除了数字和.
valObj = valObj.replace(/[^\d.]/g,"");
//必须保证第一个为数字而不是.
valObj = valObj.replace(/^\./g,"");
//保证只有出现一个.而没有多个.
valObj = valObj.replace(/\.{2,}/g,".");
//保证.只出现一次,而不能出现两次以上
valObj = valObj.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
if(valObj.indexOf(".") == valObj.length-1){
valObj += "0";
}
return valObj;
}
function isObjNaN(Obj){
if(Obj.toString().toLowerCase() == "nan"){
return 0;
}else{
return Obj;
}
}
function search(){//查询入库wms_in信息
//sel_customer
var opseaibsno=$("h_opseaibsno").value;
var cus = $("h_customer2").value;
var blno = $("txt_blno2").value;
var store = $("h_storage2").value;
var gmodel = $("txt_goodsmodel2").value;
var customno2 = $("txt_customno2").value;
var bztchno2 = $("txt_bztchno2").value;
if(blno!=null && blno!=""){
$("h_blno2").value=blno;
}
var searchJson = "";
searchJson +="{";
searchJson += "[";
searchJson += "\"opseaibsno\":\""+opseaibsno+"\",";
searchJson += "\"cus\":\""+cus+"\",";
searchJson += "\"blno\":\""+blno+"\",";
searchJson += "\"goodsmodel\":\"" + gmodel + "\",";
searchJson += "\"store\":\""+store+"\",";
searchJson += "\"customno2\":\"" + customno2 + "\",";
searchJson += "\"bztchno2\":\"" + bztchno2 + "\"";
searchJson += "]";
searchJson +="}";
$("h_searchJson").value = searchJson;
// createOrder();
RecreateOrder();
}
function ChangeStorage(){ //货权转移
IsChangeCus=1;
if($("h_outbsno").value!="" && $("h_outbsno").value!=null)
{
alert("出库单已经生成!");
return;
}
var WoState=0;
WoState=saveWoChange();
var WoDetailState=0;
WoDetailState=saveWoDetailChange();
if($("WoContainer").value.trim() == "" || $("WoDetailContainer").value.trim() == ""){
return;
}
if (WoState==1 && WoDetailState==1){
msgBox();
//定时发送数据
setTimeout(postEnterFee,200);
$("h_post_2").value = 3;
}
}
function OutStorage() {//生成出库单
IsChangeCus=parseInt($("h_Ischange").value);
//保存后录入的数据
var truck;
var id;
for (var i = 0; i < commonGridObj_wmsin.getGridObj().getRowsNum(); i++) {
if ($("h_Handle").value.trim() != "edit") {
var Num_Out = commonGridObj_wmsin.getGridObj().cellByIndex(i, 11).getValue();
if (Num_Out != 0) {
var Num_Kc = parseFloat(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellByIndex(i, 9).getValue()));
if (Num_Out > Num_Kc) {
commonGridObj_wmsin.getGridObj().cellByIndex(i, 11).setLabel(Num_Kc);
}
id = commonGridObj_wmsin.getGridObj().getRowId(i);
setOutInfo(id, true);
//totalDynamicOutNum();
}
}
truckno = commonGridObj_wmsin.getGridObj().cellByIndex(i,15).getValue();
}
var WoState=0;
WoState=saveWoChange();
var WoDetailState=0;
WoDetailState=saveWoDetailChange();
if($("WoContainer").value.trim() == "" || $("WoDetailContainer").value.trim() == ""){
return;
}
if (WoState==1 && WoDetailState==1){
msgBox();
//定时发送数据
setTimeout(postEnterFee,200);
if(IsChangeCus==1){
$("h_post_2").value = 3;
}
else{
$("h_post_2").value = 2;
}
}
}
function dateF(sdate) {
var ih = sdate.toString().trim().indexOf(" ");
if (ih > -1) {
sdate = sdate.substr(0, ih);
}
return sdate;
}
function saveWoChange(){
var jsonFeeObj = null;
var outdate = dateF($("txt_outdate").value);
if(outdate==""){
alert("出库日期不能为空!");
return;
}
//
var oldcustfeedate = dateF($("txt_oldcustFeeDate").value.trim());
if (oldcustfeedate == "") {
alert("结束计费日期不能为空!");
return;
}
//
var cust="";
try
{
cust=comboCustomer.comboObj.getComboText().trim();
}
catch(e)
{
cust=$("txt_customer").value;
}
if(cust==""){
alert("货主不能为空!");
return;
}
//
var goodsname = $("h_goods").value;
if(goodsname==""){
alert("品名不能为空!");
return;
}
var goodsmodel = $("txt_goodsmodel").value;
if(goodsname==""){
alert("牌号不能为空!");
return;
}
//
var outcus = ""; //转移对象
if($("h_Ischange").value=="1"){
outcus = comboOutCustomer.getComboText().trim(); //comboObj. by lcx
if(cust==outcus)
{
alert("货主和货权转移对象不能相同");
return;
}
if (outcus != "") {
var isbool = setAddClient(outcus);
if (isbool == "-1") {
alert("货权转移对象名称有误,请重新填写!");
return;
}
}
}
else {
outcus=comboOutCustomer.getComboText().trim();
}
//转移单号
var mblnonew = combomblnonew.getComboText().trim();
if (mblnonew.toString().trim() == "") {
var mblnonew = $("h_blno").value.trim();
}
var ls = "";
if (mblnonew.indexOf("/") > -1) {
var strArray = new Array();
strArray = mblnonew.split("/");
for (var k = 0; k < strArray.length; k++) {
ls += strArray[k].toString().trim();
if (k != strArray.length - 1) {
ls += "·";
}
}
mblnonew = ls;
}
//
if(IsChangeCus==1)
{
if(outcus==""){
alert("货权转移对象不能为空!");
return;
}
}
var isJsFee=$("ck_jsfee").checked;
var outnum=0 ;//本次出库量
//outnum=parseFloat( $("txt_goodspfsl").value);
outnum = parseFloat($("h_goodspfsl").value);
if (outnum == 0) {
alert("出库量不能为零!");
return;
}
else {
outnum = 1; //本次出库量
}
var outpacknum = 0; //本次出库件数
//outpacknum = parseInt($("txt_packnum").value);
outpacknum = parseInt($("h_packnum").value);
if(outpacknum==""){
alert("出库件数不能为零!");
return;
}
else {
outpacknum = 1; //本次出库量
}
var arclient = $("hd_comboARCLIENT").value.trim();
var arclientwmsout = $("hd_comboARCLIENTWMSOUT").value.trim();
var truckname = $("hd_comboTRUCKNAME").value.trim();
//
var remark = $("txt_remark").value.replace(/,/ig, '');
var iscollecting = $("cbISCOLLECTING").checked;
var inspectionno = $("txt_inspectionno").value;
var validdate = $("txt_validdate").value;
var remark2 = $("txt_remark2").value.replace(/,/ig, '');
var totalno = $("txt_totalno").value;
var clientbsno = $("txt_clientbsno").value;
var customno = $("txt_customno").value;
var bztchno = $("txt_bztchno").value;
var custparent="";//原货主
var opseaibsno="";
var storage="";
var truckno = "";
//
if(storage==""){
for(var i=0;i<commonGridObj_wmsin.getGridObj().getRowsNum();i++){
// var checkState = commonGridObj_wmsin.getGridObj().cellByIndex(i,0).getValue();
var outnumdetail=clearNoNum(isObjNaN(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellByIndex(i,11).getValue())));
if(outnumdetail>0){
// if(checkState==1){
if(opseaibsno==""){
opseaibsno=commonGridObj_wmsin.getGridObj().cellByIndex(i,18).getValue();
storage=commonGridObj_wmsin.getGridObj().cellByIndex(i,17).getValue();
truckno = commonGridObj_wmsin.getGridObj().cellByIndex(i, 15).getValue().replace(/,/ig, '');
}
else if(opseaibsno!=commonGridObj_wmsin.getGridObj().cellByIndex(i,18).getValue())
{
alert("不能选择两个进口委托单出库");
return 0;
}
if (cust!=commonGridObj_wmsin.getGridObj().cellByIndex(i,1).getValue()){
alert("不能选择两个货主的货物出库");
return 0;
}
}
}
}
//
if (truckno.trim() != "") {
while (truckno.indexOf(" ") > 0) {
truckno = truckno.replace(" ", "");
}
while (truckno.indexOf("\r\n") > 0) {
truckno = truckno.replace("\r\n", "");
}
}
//
var chargeunit0 = commonGridObj_wmsin.getGridObj().cellByIndex(0, 24).getValue(); //计费单位
//
var cacheBuffer = "";
cacheBuffer += "{";
cacheBuffer += "\"cust\":\""+cust+"\",";
cacheBuffer += "\"outcus\":\""+outcus+"\",";
cacheBuffer += "\"outdate\":\""+outdate+"\",";
cacheBuffer += "\"goodsname\":\""+goodsname+"\",";
cacheBuffer += "\"goodsmodel\":\""+goodsmodel+"\",";
cacheBuffer += "\"outnum\":\""+outnum+"\","; //outpacknum
cacheBuffer += "\"outpacknum\":\"" + outpacknum + "\",";
cacheBuffer += "\"truckno\":\"" + truckno + "\",";
cacheBuffer += "\"storage\":\""+storage+"\",";
cacheBuffer += "\"opseaibsno\":\""+opseaibsno+"\",";
cacheBuffer += "\"isJsFee\":\""+isJsFee+"\",";
cacheBuffer += "\"remark\":\""+remark+"\",";
cacheBuffer += "\"inspectionno\":\"" + inspectionno + "\",";
cacheBuffer += "\"validdate\":\"" + validdate + "\",";
cacheBuffer += "\"remark2\":\"" + remark2 + "\",";
cacheBuffer += "\"totalno\":\"" + totalno + "\",";
cacheBuffer += "\"clientbsno\":\"" + clientbsno + "\",";
cacheBuffer += "\"customno\":\"" + customno + "\",";
cacheBuffer += "\"arclient\":\"" + arclient + "\",";
cacheBuffer += "\"arclientwmsout\":\"" + arclientwmsout + "\",";
cacheBuffer += "\"truckname\":\"" + truckname + "\",";
cacheBuffer += "\"mblnonew\":\"" + mblnonew + "\",";
cacheBuffer += "\"oldcustfeedate\":\"" + oldcustfeedate + "\",";
cacheBuffer += "\"chargeunit\":\"" + chargeunit0 + "\",";
cacheBuffer += "\"bztchno\":\"" + bztchno + "\",";
cacheBuffer += "\"iscollecting\":\"" + iscollecting + "\"";
cacheBuffer += "}";
var result = "";
result += "{\"fees\":[";
result += cacheBuffer;
result += "]}";
jsonFeeObj = eval('(' + result + ')');
$("WoContainer").value = JSON.stringify(jsonFeeObj);
return 1;
}
function saveWoDetailChange(){
var jsonFeeObj = null;
//
var cust = "";
try {
cust = comboCustomer.comboObj.getComboText().trim();
}
catch (e) {
cust = $("txt_customer").value;
}
if (cust == "") {
alert("货主不能为空!");
return;
}
//
var outcus = ""; //转移对象
if ($("h_Ischange").value == "1") {
outcus = comboOutCustomer.getComboText().trim(); //comboObj. by lcx
if (cust == outcus) {
alert("货主和货权转移对象不能相同");
return;
}
}
else {
outcus = comboOutCustomer.getComboText().trim();
}
//
var farfee = 0;
var fapfee = 0;
var wmsoutdetailgid = "";
//
for(var i=0;i<commonGridObj_wmsin.getGridObj().getRowsNum();i++){
var rowId = commonGridObj_wmsin.getGridObj().getRowId(i);
var RowIndex = commonGridObj_wmsin.getGridObj().getRowIndex(rowId);
//
var inbsno = rowId; //wms_in.bsno
if ($("h_Handle").value.trim() == "edit") {
inbsno = commonGridObj_wmsin.getGridObj().cellByIndex(i, 21).getValue(); //入库GID
wmsoutdetailgid = commonGridObj_wmsin.getGridObj().cellByIndex(i, 22).getValue(); //出库明细GID
}
var indate = commonGridObj_wmsin.getGridObj().cellByIndex(i, 3).getValue(); //入库日期
var startbillingdate = commonGridObj_wmsin.getGridObj().cellByIndex(i, 4).getValue();//计费开始日期
var goodsname = commonGridObj_wmsin.getGridObj().cellByIndex(i,5).getValue();
var goodsmodel = commonGridObj_wmsin.getGridObj().cellByIndex(i,6).getValue();
var outnum = clearNoNum(isObjNaN(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex,12).getValue())));
var outpacknum = clearNoNum(isObjNaN(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex,11).getValue())));
var arfee = clearNoNum(isObjNaN(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex,13).getValue())));
var apfee = clearNoNum(isObjNaN(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellByIndex(RowIndex, 14).getValue())));
farfee = parseFloat(farfee) + parseFloat(arfee);
fapfee = parseFloat(fapfee) + parseFloat(apfee);
var truckno = commonGridObj_wmsin.getGridObj().cellByIndex(i, 15).getValue().replace(/,/ig, '');
var remark = commonGridObj_wmsin.getGridObj().cellByIndex(i, 16).getValue().replace(/,/ig, '');
var storage=commonGridObj_wmsin.getGridObj().cellByIndex(i,17).getValue();
var opseaibsno=commonGridObj_wmsin.getGridObj().cellByIndex(i,18).getValue();
var custparent=commonGridObj_wmsin.getGridObj().cellByIndex(i,20).getValue();
var checkState = commonGridObj_wmsin.getGridObj().cellByIndex(i, 0).getValue();
var startbillingdateap = commonGridObj_wmsin.getGridObj().cellByIndex(i, 23).getValue(); //计费开始日期
var chargeunit = commonGridObj_wmsin.getGridObj().cellByIndex(i, 24).getValue(); //计费单位
var marketvalue = commonGridObj_wmsin.getGridObj().cellByIndex(i, 27).getValue(); //市场货值单价
var areaname = commonGridObj_wmsin.getGridObj().cellByIndex(i, 8).getValue().replace(/,/ig, ''); //库位名称
if(outnum>0){
//if(checkState==1){
if(jsonFeeObj == null){
var cacheBuffer = "";
cacheBuffer += "{";
cacheBuffer += "\"cust\":\"" + cust + "\",";
cacheBuffer += "\"outcus\":\"" + outcus + "\",";
cacheBuffer += "\"inbsno\":\""+inbsno+"\",";
cacheBuffer += "\"wmsoutdetailgid\":\"" + wmsoutdetailgid + "\",";
cacheBuffer += "\"indate\":\""+indate+"\",";
cacheBuffer += "\"startbillingdate\":\"" + startbillingdate + "\",";
cacheBuffer += "\"startbillingdateap\":\"" + startbillingdateap + "\",";
cacheBuffer += "\"goodsname\":\""+goodsname+"\",";
cacheBuffer += "\"goodsmodel\":\"" + goodsmodel + "\",";
//
if (truckno.trim() != "") {
while (truckno.indexOf(" ") > 0) {
truckno = truckno.replace(" ", "");
}
while (truckno.indexOf("\r\n") > 0) {
truckno = truckno.replace("\r\n", "");
}
}
//
cacheBuffer += "\"truckno\":\""+truckno+"\",";
cacheBuffer += "\"storage\":\""+storage+"\",";
cacheBuffer += "\"opseaibsno\":\""+opseaibsno+"\",";
cacheBuffer += "\"outnum\":\""+outnum+"\",";
cacheBuffer += "\"outpacknum\":\"" + outpacknum + "\",";
cacheBuffer += "\"arfee\":\"" + arfee + "\",";
cacheBuffer += "\"apfee\":\"" + apfee + "\",";
cacheBuffer += "\"remark\":\""+remark+"\",";
cacheBuffer += "\"custparent\":\""+custparent+"\",";
cacheBuffer += "\"chargeunit\":\"" + chargeunit + "\",";
cacheBuffer += "\"marketvalue\":\"" + marketvalue + "\","; //市场货值
cacheBuffer += "\"areaname\":\"" + areaname + "\""; //库位名称
cacheBuffer += "}";
var result = "";
result += "{\"fees\":[";
result += cacheBuffer;
result += "]}";
jsonFeeObj = eval('(' + result + ')');
}else{
var newFeeRow = jsonFeeObj.fees;
newFeeRow = { cust: cust, outcus: outcus, inbsno: inbsno, wmsoutdetailgid: wmsoutdetailgid, indate: indate, startbillingdate: startbillingdate, goodsname: goodsname, goodsmodel: goodsmodel, truckno: truckno, storage: storage, opseaibsno: opseaibsno, outnum: outnum, outpacknum: outpacknum, arfee: arfee, apfee: apfee, remark: remark, custparent: custparent, startbillingdateap: startbillingdateap, chargeunit: chargeunit, marketvalue: marketvalue, areaname: areaname };
jsonFeeObj.fees.push(newFeeRow);
}
}
}
if(jsonFeeObj!=null) {
if ($("hd_comboARCLIENT").value.trim() == "" && farfee != 0) {
$("WoDetailContainer").value = "";
alert("应收出库客户不能为空!");
return 3;
}
if ($("hd_comboTRUCKNAME").value.trim() == "" && fapfee != 0) {
$("WoDetailContainer").value = "";
alert("应付客户不能为空!");
return 3;
}
//
$("WoDetailContainer").value = JSON.stringify(jsonFeeObj);
return 1;
}
else
{
$("WoDetailContainer").value="";
alert("请输入本次出库重量!");
return 0;
}
}
//信息提示
function msgBox(){
var dg=new dialog();
dg.html="费用正在保存中,请稍等……";//"<input type=button onclick='new dialog().close();' value='确定'>";
dg.width=200;
dg.height=100;
dg.title="";
dg.show();
}
//对话框
function dialog()
{
// alert("打开dialog");
this.width=450;
this.height=360;
this.title_height=20;
this.html='';
this.title='';
var self = this;
var bgObj,msgObj,titleObj;
this.close=function()
{
document.body.removeChild(document.getElementById("bgDiv"));
document.getElementById("msgDiv").removeChild(document.getElementById("msgTitle"));
document.body.removeChild(document.getElementById("msgDiv"));
}
this.show=function()
{
var msgw,msgh,bordercolor;
msgw=self.width;
msgh=self.height;
bordercolor="#336699";
titlecolor="#99CCFF";
var sWidth,sHeight;
sWidth=document.body.offsetWidth;
sHeight=screen.height;
bgObj=document.createElement("div");
bgObj.setAttribute('id','bgDiv');
bgObj.style.position="absolute";
bgObj.style.top="0";
bgObj.style.background="#777";
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
bgObj.style.opacity="0.6";
bgObj.style.left="0";
bgObj.style.width=sWidth + "px";
bgObj.style.height=sHeight + "px";
bgObj.style.zIndex = "10000";
document.body.appendChild(bgObj);
msgObj=document.createElement("div")
msgObj.setAttribute("id","msgDiv");
msgObj.setAttribute("align","center");
msgObj.style.background="white";
msgObj.style.border="1px solid " + bordercolor;
msgObj.style.position = "absolute";
msgObj.style.left = "50%";
msgObj.style.top = "30%";
msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
msgObj.style.marginLeft = "-225px" ;
msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
msgObj.style.width = msgw + "px";
msgObj.style.height =msgh + "px";
msgObj.style.textAlign = "center";
msgObj.style.lineHeight ="25px";
msgObj.style.zIndex = "10001";
titleObj=document.createElement("h4");
titleObj.setAttribute("id","msgTitle");
titleObj.setAttribute("align","center");
titleObj.style.margin="0";
titleObj.style.padding="3px";
titleObj.style.background=bordercolor;
titleObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
titleObj.style.opacity="0.75";
titleObj.style.border="1px solid " + bordercolor;
titleObj.style.height=self.title_height+"px";
titleObj.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
titleObj.style.color="white";
titleObj.style.cursor="pointer";
titleObj.innerHTML=self.title;
//titleObj.onclick=function(){self.close();}
document.body.appendChild(msgObj);
document.getElementById("msgDiv").appendChild(titleObj);
var txt=document.createElement("div");
txt.style.margin="1em 0"
txt.setAttribute("id","msgTxt");
txt.innerHTML=self.html;
document.getElementById("msgDiv").appendChild(txt);
}
}
function fomatFloat(src,pos){
return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos);
}
function initLoading(){
$("progressBar").style.display = "";
}
function finishLoading(){
$("progressBar").style.display = "none";
}
function outputMoney(number) {
number= number.replace(/\,/g,"");
if (isNaN(number)||number=="") return "";
number = Math.round( number*100) /100;
if(number<0)
return '-'+outputDollars(Math.floor(Math.abs(number)-0) + '') + outputCents(Math.abs(number) - 0);
else
return outputDollars(Math.floor(number-0) + '') + outputCents(number - 0);
}
//动态计算本次出库重量信息
function totalDynamicOutNum(){
//获取出库列表行数
var rowCount_WmsOut = commonGridObj_wmsin.getGridObj().getRowsNum();
var Sum_Out = 0.0;//总吨数合计
var Sum_packOut = 0.0;//
var checkBox = 0;
var amount = 0;
var amountpack = 0;//件数合计
var rownum=0;//明细重量
var djds=0;//单件吨数
//计算应收费用
for(var i = 0;i<rowCount_WmsOut;i++){
// checkBox = commonGridObj_wmsin.getGridObj().cellByIndex(i,0).getValue();
rownum = parseFloat(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellByIndex(i,11).getValue()));
djds=parseFloat(ConvertToMoney(commonGridObj_wmsin.getGridObj().cellByIndex(i,19).getValue()));
if(rownum.toString().toLowerCase() == "nan"){
rownum = 0.0;
}
if(djds.toString().toLowerCase() == "nan"){
djds = 0.0;
}
if(rownum>0){
// if(checkBox == 1){
//获取总金额
if(amountpack.toString().toLowerCase() == "nan"){
amountpack = 0.0;
}
if(amount.toString().toLowerCase() == "nan"){
amount = 0.0;
}
if(Sum_Out.toString().toLowerCase() == "nan"){
Sum_Out = 0.0;
}
var Num_Out = commonGridObj_wmsin.getGridObj().cellByIndex(i,11).getValue();
if(Num_Out != 0)
{
var Num_Kc =parseFloat(ConvertToMoney( commonGridObj_wmsin.getGridObj().cellByIndex(i, 9).getValue()));
if(Num_Out>Num_Kc)
{
commonGridObj_wmsin.getGridObj().cellByIndex(i,11).setLabel(Num_Kc);
rownum=Num_Kc;
}
}
amountpack=amountpack+rownum;
//amount = amount + rownum * djds;
amount = rownum * djds;
Sum_Out = Sum_Out + amount;
var tmpjs=rownum*djds;
tmpjs=tmpjs.toFixed(4);
commonGridObj_wmsin.getGridObj().cellByIndex(i,12).setLabel(tmpjs.toString());
}
}
//$("txt_goodspfsl").value = outputMoney(Sum_Out.toString());
$("h_goodspfsl").value = outputMoney(Sum_Out.toString());
//$("txt_packnum").value = outputMoney(amountpack.toString());
$("h_packnum").value = outputMoney(amountpack.toString());
}
function AddWmsOut() { //添加出库单
reloadParentEdit($("h_outgid").value, 'add', 0, $("h_associatedno").value);
}
function DeleteWmsOut(){ //删除出库单
if($("txt_outbsno").value == ""){
return;
}
if(window.confirm("您确定要将选中的出库单删除")){
//
var urlVal = "../SeaiFee/WmsRateGridSource.aspx?handle=getislock&gids=" + $("txt_outbsno").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var ls = loader.xmlDoc.responseText;
if (ls.trim() != "0") {
alert("已入账的信息,不允许删除!");
return;
}
else {
var strREMARK = commonGridObj_wmsin.getGridObj().cellByIndex(0, 25).getValue();
if (strREMARK.trim() == "货权转移") {
urlVal = "../SeaiFee/WmsRateGridSource.aspx?handle=getiswmsin&gids=" + $("txt_outbsno").value + "&val=" + newGuid();
loader = dhtmlxAjax.getSync(urlVal);
ls = loader.xmlDoc.responseText;
if (ls.trim() != "0") {
alert("有已入库的货权转移信息,不允许删除!");
return;
}
}
//
var url = "../SeaiFee/WmsRateGridSource.aspx?handle=deletewmsout&wmsoutgid=" + $("h_outgid").value;
var loader = dhtmlxAjax.getSync(url);
var deleteState = parseInt(loader.xmlDoc.responseText);
if (deleteState == 1) {
alert("成功删除出库单:" + $("txt_outbsno").value);
//AddWmsOut();
window.parent.opener.location.href = window.parent.opener.location.href;
window.close();
}
else {
alert("删除出库单,失败!");
}
}
}
}
function reloadParentEdit(strBSNO, strHandle, ischangecust, sASSOCIATEDNO) {
var parentObj = window.parent.location;
var oldUrl = parentObj.href;
//
var isdisabled = false;
var urlVal = "../SeaiFee/WmsRateGridSource.aspx?handle=getislock&gids=" + strBSNO + "&bsno=" + sASSOCIATEDNO + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var ls = loader.xmlDoc.responseText;
if (ls.trim() != "0") {
alt = "已入账的信息,不允许修改!";
isdisabled = true;
}
else {
if (ischangecust == 1) {
urlVal = "../SeaiFee/WmsRateGridSource.aspx?handle=getiswmsin&gids=" + strBSNO + "&bsno=" + sASSOCIATEDNO + "&val=" + newGuid();
loader = dhtmlxAjax.getSync(urlVal);
ls = loader.xmlDoc.responseText;
if (ls.trim() != "0") {
alt = "已入库的货权转移信息,不允许修改!";
isdisabled = true;
}
}
}
//
var newUrl = "";
if (strHandle == "addwmsout") {
var handleIndex = oldUrl.indexOf("handle=");
newUrl = oldUrl.substring(0, handleIndex);
window.parent.opener.location.href = window.parent.opener.location.href;
parentObj.href = newUrl + "handle=edit&ischangecust=" + ischangecust + "&outgid=" + strBSNO + "&isdisabled=" + isdisabled;
alert('操作成功!');
}
else if (strHandle == "edit") {
var handleIndex = oldUrl.indexOf("handle=");
newUrl = oldUrl.substring(0, handleIndex);
window.parent.opener.location.href = window.parent.opener.location.href;
parentObj.href = newUrl + "handle=edit&ischangecust=" + ischangecust + "&outgid=" + strBSNO + "&isdisabled=" + isdisabled;
alert('操作成功!');
}
else if (strHandle == "add") {
var handleIndex = oldUrl.indexOf("handle=");
newUrl = oldUrl.substring(0, handleIndex);
window.parent.opener.location.href = window.parent.opener.location.href;
parentObj.href = newUrl + "handle=addwmsout&ischangecust=0&bsno=" + $("h_associatedno").value;
}
}
function reloadParent(strBSNO, strHandle, sINBSNO, sASSOCIATEDNO,isOldCustFeeDateEnter) {
var parentObj = window.parent.location;
var oldUrl = parentObj.href;
//
var isdisabled = false;
var urlVal = "../SeaiFee/WmsRateGridSource.aspx?handle=getislock&gids=" + strBSNO + "&bsno=" + sASSOCIATEDNO + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var ls = loader.xmlDoc.responseText;
if (ls.trim() != "0") {
alt = "已入账的信息,不允许修改!";
isdisabled = true;
}
else {
urlVal = "../SeaiFee/WmsRateGridSource.aspx?handle=getiswmsin&gids=" + strBSNO + "&bsno=" + sASSOCIATEDNO + "&val=" + newGuid();
loader = dhtmlxAjax.getSync(urlVal);
ls = loader.xmlDoc.responseText;
if (ls.trim() != "0") {
alt = "已入库的货权转移信息,不允许修改!";
isdisabled = true;
}
}
//
var newUrl = "";
if (strHandle == "addwmsout") {
var handleIndex = oldUrl.indexOf("handle=");
newUrl = oldUrl.substring(0, handleIndex);
window.parent.opener.location.href = window.parent.opener.location.href;
parentObj.href = newUrl + "handle=edit&ischangecust=1&outgid=" + strBSNO + "&isdisabled=" + isdisabled; ;
}
else if (strHandle == "edit") {
window.parent.opener.location.href = window.parent.opener.location.href;
}
//
alert('操作成功,请注意货转入库单的“开始计费日期”,并修改“仓储费率”及费率“结束计费日期”的正确性!');
//
var URLs = "../SeaiInfo/WmsInfo.aspx?handle=edit&id=" + sINBSNO + "&associatedno=" + sASSOCIATEDNO + "&val=" + newGuid();
if (isOldCustFeeDateEnter.toString().trim() == "1") {
URLs = "../SeaiInfo/WmsInfo.aspx?handle=edit&isenabled=false&id=" + sINBSNO + "&associatedno=" + sASSOCIATEDNO + "&val=" + newGuid();
}
window.open(URLs, "_blank", "height=700px, width=1200px,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=0,location=no,status=no,Top= " + (screen.height / 2 - 400) + ",Left= " + (screen.width / 2 - 600));
}
function setislock() {
var checked = $("h_outgid").value;
if (checked != null && checked != "") {
var urlVal = "../SeaiFee/WmsRateGridSource.aspx?handle=getislock&gids=" + checked + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var ls = loader.xmlDoc.responseText;
if (ls.trim() != "0") {
alert("已入账的信息,不允许操作!");
return;
}
//
if (confirm('费用确定入账吗?(入账后将不允许修改删除数据!)')) {
var urlVal = "WmsRateGridSource.aspx?handle=islock&gids=" + checked + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var strDel = loader.xmlDoc.responseText;
if (strDel.trim() != "") {
alert(strDel);
return;
}
// createOrder();
// window.parent.opener.location.href = window.parent.opener.location.href;
if ($("h_Ischange").value == "1") //货权转移
{
reloadParentEdit($("h_outgid").value, 'edit', 1, $("h_opseaibsno").value);
}
else {
reloadParentEdit($("h_outgid").value, 'edit', 0, $("h_opseaibsno").value);
}
}
}
else {
alert('未选中要操作的数据!');
return;
}
}
function setnotlock() {
var checked = $("h_outgid").value;
if (checked != null && checked != "") {
var urlVal = "../SeaiFee/WmsRateGridSource.aspx?handle=getislock&gids=" + checked + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var ls = loader.xmlDoc.responseText;
if (ls.trim() == "0") {
alert("未入账的信息,不允许操作!");
return;
}
//
if (confirm('确定取消入账吗?(只有“未申请开票、未开发票、未对帐”的入账数据允许取消!)')) {
var urlVal = "WmsRateGridSource.aspx?handle=notlock&gids=" + checked + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var strDel = loader.xmlDoc.responseText;
if (strDel.trim() != "") {
alert(strDel);
return;
}
//createOrder();
//window.parent.opener.location.href = window.parent.opener.location.href;
if ($("h_Ischange").value == "1") //货权转移
{
reloadParentEdit($("h_outgid").value, 'edit', 1, $("h_opseaibsno").value);
}
else {
reloadParentEdit($("h_outgid").value, 'edit', 0, $("h_opseaibsno").value);
}
}
}
else {
alert('未选中要操作的数据!');
return;
}
}
function setoldcustFeeDate() {
$("txt_oldcustFeeDate").value = $("txt_outdate").value;
}
function PrintWmsOut(){
var strOutBsno = "";
strOutBsno = $("h_outbsno").value;
if(strOutBsno == ""){
return;
}
var strBSNO = "";
strBSNO = $("h_outbsno").value;
var printUrl = "";
var companyID = "";
var typeName = "WMSOUTREPORT";
var dbSourceID = "";
var userID = "";
var url = "../Reports/ReportService.aspx?handle=printwmsout&bsno="+strBSNO+"&val="+newGuid();
typeName = "WMSOUTREPORT";
var loader = dhtmlxAjax.getSync(url);
var reportVal = loader.xmlDoc.responseText;
var reportObj = null;
if(reportVal != ""){
reportObj = eval('(' + reportVal + ')');
if(reportObj.reports.length > 0){
if(reportObj.reports[0].compid != ""){
companyID = reportObj.reports[0].compid;
}
if(reportObj.reports[0].sourceid != ""){
dbSourceID = reportObj.reports[0].sourceid;
}
if(reportObj.reports[0].compid != ""){
userID = reportObj.reports[0].userid;
}
printUrl = "print://?comp="+companyID+"&type="+typeName+"&dbid="+dbSourceID+"&uid="+userID;//alert(printUrl);
window.location.href = window.location.href;
location.href = printUrl;
}
}else{
alert("没有要打印的报表");
return;
}
}
//
function setAddClient(strClient) {
var url = "WmsRateGridSource.aspx?handle=setaddclient&client=" + escape(strClient) + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(url);
var ClientVal = loader.xmlDoc.responseText;
return ClientVal;
}
//应收仓储客户
function onclickARCLIENTWMSOUT() {
if ($("hd_comboARCLIENTWMSOUT").value == "") {
var URLs = "../Shipping/ExchangesUnitEdit.aspx?handle=add";
ret = window.open(URLs, "添加提单", "height=768, width=1024,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=no");
}
else {
var loader = dhtmlxAjax.getSync("../FeeCodes/CUSTOMERNAMEGIDAdapter.aspx?handle=gid&CUSTOMERNAME=" + escape($("hd_comboARCLIENTWMSOUT").value) + "&val=" + newGuid());
var selectedId = loader.xmlDoc.responseText;
var URLs = "../Shipping/ExchangesUnitEdit.aspx?handle=edit&id=" + selectedId;
ret = window.open(URLs, "_blank", "height=768, width=1024,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=no");
}
}
function lbARCLIENTWMSOUTonMouseOver() {
document.getElementById('lbARCLIENTWMSOUT').style.color = "#0000FF";
document.getElementById('lbARCLIENTWMSOUT').style.cursor = "hand";
document.getElementById('lbARCLIENTWMSOUT').style["textDecoration"] = "underline";
}
function lbARCLIENTWMSOUTonMouseOut() {
document.getElementById('lbARCLIENTWMSOUT').style.color = "#FF0000";
document.getElementById('lbARCLIENTWMSOUT').style.cursor = "auto";
document.getElementById('lbARCLIENTWMSOUT').style["textDecoration"] = "";
}
//应收出库客户
function onclickARCLIENT() {
if ($("hd_comboARCLIENT").value == "") {
var URLs = "../Shipping/ExchangesUnitEdit.aspx?handle=add";
ret = window.open(URLs, "添加提单", "height=768, width=1024,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=no");
}
else {
var loader = dhtmlxAjax.getSync("../FeeCodes/CUSTOMERNAMEGIDAdapter.aspx?handle=gid&CUSTOMERNAME=" + escape($("hd_comboARCLIENT").value) + "&val=" + newGuid());
var selectedId = loader.xmlDoc.responseText;
var URLs = "../Shipping/ExchangesUnitEdit.aspx?handle=edit&id=" + selectedId;
ret = window.open(URLs, "_blank", "height=768, width=1024,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=no");
}
}
function lbARCLIENTonMouseOver() {
document.getElementById('lbARCLIENT').style.color = "#0000FF";
document.getElementById('lbARCLIENT').style.cursor = "hand";
document.getElementById('lbARCLIENT').style["textDecoration"] = "underline";
}
function lbARCLIENTonMouseOut() {
document.getElementById('lbARCLIENT').style.color = "#FF0000";
document.getElementById('lbARCLIENT').style.cursor = "auto";
document.getElementById('lbARCLIENT').style["textDecoration"] = "";
}
//应付客户
function onclickTRUCKNAME() {
if ($("hd_comboTRUCKNAME").value == "") {
var URLs = "../Shipping/ExchangesUnitEdit.aspx?handle=add";
ret = window.open(URLs, "添加提单", "height=768, width=1024,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=no");
}
else {
var loader = dhtmlxAjax.getSync("../FeeCodes/CUSTOMERNAMEGIDAdapter.aspx?handle=gid&CUSTOMERNAME=" + escape($("hd_comboTRUCKNAME").value) + "&val=" + newGuid());
var selectedId = loader.xmlDoc.responseText;
var URLs = "../Shipping/ExchangesUnitEdit.aspx?handle=edit&id=" + selectedId;
ret = window.open(URLs, "_blank", "height=768, width=1024,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=no");
}
}
function lbTRUCKNAMEonMouseOver() {
document.getElementById('lbTRUCKNAME').style.color = "#0000FF";
document.getElementById('lbTRUCKNAME').style.cursor = "hand";
document.getElementById('lbTRUCKNAME').style["textDecoration"] = "underline";
}
function lbTRUCKNAMEonMouseOut() {
document.getElementById('lbTRUCKNAME').style.color = "#FF0000";
document.getElementById('lbTRUCKNAME').style.cursor = "auto";
document.getElementById('lbTRUCKNAME').style["textDecoration"] = "";
}
//应付客户
function onclickOUTCUSTOMER() {
if ($("h_outcustomer").value == "") {
var URLs = "../Shipping/ExchangesUnitEdit.aspx?handle=add";
ret = window.open(URLs, "添加提单", "height=768, width=1024,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=no");
}
else {
var loader = dhtmlxAjax.getSync("../FeeCodes/CUSTOMERNAMEGIDAdapter.aspx?handle=gid&CUSTOMERNAME=" + escape($("h_outcustomer").value) + "&val=" + newGuid());
var selectedId = loader.xmlDoc.responseText;
var URLs = "../Shipping/ExchangesUnitEdit.aspx?handle=edit&id=" + selectedId;
ret = window.open(URLs, "_blank", "height=768, width=1024,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=no");
}
}
function lbOUTCUSTOMERonMouseOver() {
document.getElementById('lbOUTCUSTOMER').style.color = "#0000FF";
document.getElementById('lbOUTCUSTOMER').style.cursor = "hand";
document.getElementById('lbOUTCUSTOMER').style["textDecoration"] = "underline";
}
function lbOUTCUSTOMERonMouseOut() {
document.getElementById('lbOUTCUSTOMER').style.color = "#FF0000";
document.getElementById('lbOUTCUSTOMER').style.cursor = "auto";
document.getElementById('lbOUTCUSTOMER').style["textDecoration"] = "";
}
function getOnload() {
initCombos();
createOrder();
initGrid2();
initGrid();
initDownFeeName();
initMenu();
}
function getOldCustFeeDate() {
if ($("h_isOldCustFeeDate").value.toString().trim() == "1") {
$("h_isOldCustFeeDate").value = "0";
$("divOldCustFeeDate").style.display = "none";
}
else {
$("h_isOldCustFeeDate").value = "1";
$("divOldCustFeeDate").style.display = "";
$("txt_oldcustFeeDate1").value = $("txt_oldcustFeeDate").value;
}
}
function setOldCustFeeDate() {
$("txt_oldcustFeeDate").value = $("txt_oldcustFeeDate1").value;
$("h_isOldCustFeeDate").value = "0";
$("divOldCustFeeDate").style.display = "none";
$("h_isOldCustFeeDateEnter").value = "1";
OutStorage();
}
function setUpdateGOODSOUTFEE() {
if (confirm('是否取现在入库的“应收开始计费日期”?')) {
$("h_isUpdateSTARTBILLINGDATE").value = "1";
}
else {
$("h_isUpdateSTARTBILLINGDATE").value = "0";
}
OutStorage();
}