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/jsGridWmsZXFee.js

1625 lines
59 KiB
JavaScript

2 years ago
var mygrid_recv;
2 years ago
var page_count = 5;
var column_count;
var jsonWmsZXFeeObj;
var changeCount = 0;
function $(id) {
return document.getElementById(id);
}
function initWinScreen() {
var winScreenHeight = 0;
var winScreenWidth = 0;
if (window.screen.height) {
winScreenHeight = window.screen.height;
}
if (window.screen.width) {
winScreenWidth = window.screen.width;
}
if (winScreenWidth >= 1440 && winScreenWidth >= 900) {
document.getElementById("mygrid_recv").style.height = "580px";
}
else if (winScreenWidth >= 1366 && winScreenWidth >= 768) {
document.getElementById("mygrid_recv").style.height = "340px";
}
else if (winScreenWidth >= 1024 && winScreenWidth >= 768) {
document.getElementById("mygrid_recv").style.height = "300px";
}
}
function doInitRecvGrid() {
mygrid_recv = new dhtmlXGridObject('mygrid_recv');
mygrid_recv.setImagePath("../images/");
mygrid_recv.setSkin("xp");
// 1 2 3 4 5 6 7 8
//mygrid_recv.setHeader("<input type=\"checkbox\" id=\"ck_all\" onclick=\"checkall()\" />,客户名称,仓库名称,库位名称,单价,数量,仓储费,备注,是否入账");
// 1 2 3 4 5 6 7 8
mygrid_recv.setHeader("<input type=\"checkbox\" id=\"ck_all\" onclick=\"checkall()\" />,客户名称,仓库名称,库位名称,单价,数量,仓储费,数量单位,备注,是否入账");
mygrid_recv.setInitWidths("30,120,120,60,80,80,80,60,200,100");
mygrid_recv.setColAlign("center,center,center,center,center,center,center,center,center,center");
mygrid_recv.setColSorting("na,str,str,str,str,str,str,str,str,str");
mygrid_recv.setColTypes("ch,co,co,co,ed,ed,ed,co,ed,ro");
var urlVal = "WmsZXFeeGridSource.aspx?read=exist&showcount=1&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var loadVal = loader.xmlDoc.responseText;
loader = null;
if (parseInt(loadVal) == 1) {
mygrid_recv.loadXML("WmsZXFeeGridSource.aspx?read=init&showcount=1&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid());
setTimeout(function() {
//ReShowLabel(mygrid_recv);
}, 200);
}
mygrid_recv.init();
mygrid_recv.enableEditEvents(true, false, true);
mygrid_recv.enableMultiselect(true);
mygrid_recv.enableKeyboardSupport(true);
var pressRecord = "";
var pressRowIndex = -1;
var pressCellIndex = -1;
var pressCount = 0;
var flagFilter = 0;
//手动编写Grid控件编辑事件,由于免费控件没有提供完整的编辑判断功能,现特此做更改
mygrid_recv.attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) {
var newCheckValue = false;
//初始化状态
if (stage == 0) {
var selectedId = mygrid_recv.getSelectedRowId();
var rowIndex = mygrid_recv.getRowIndex(selectedId);
var oldVal = mygrid_recv.cellByIndex(rowIndex, 0).getValue().trim();
return true;
}
if (stage == 1) {
var selectedId = mygrid_recv.getSelectedRowId();
var rowIndex = mygrid_recv.getRowIndex(selectedId);
var txtEdit;
for (i = 0; i < document.all.length; i++) {
if (document.all(i).tagName == "TEXTAREA") {
txtEdit = document.all(i);
txtEdit.focus();
txtEdit.select();
break;
}
}
}
//如果编辑结束
if (stage == 2) {
//获取当前RowID
var selectedId = mygrid_recv.getSelectedRowId();
//获取当前RowIndex
var rowIndex = mygrid_recv.getRowIndex(selectedId);
//获取当前CellIndex(ind)
var ind = mygrid_recv.getSelectedCellIndex();
//触发操作事件前获取单元值
var oldVal = mygrid_recv.cellByIndex(rowIndex, ind).getValue();
if (cInd == 1) {
var cellVal = mygrid_recv.cellByIndex(rowIndex, cInd).getValue();
var s1 = cellVal;
var s2 = s1.indexOf("|");
if (s1 == "") {
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
mygrid_recv.cellByIndex(rowIndex, cInd).setLabel(s3);
}
else {
}
}
return true;
}
else if (cInd == 2) {
var cellVal = mygrid_recv.cellByIndex(rowIndex, cInd).getValue();
var s4 = "";
var s1 = cellVal;
var s2 = s1.indexOf("|");
if (s1 == "") {
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
mygrid_recv.cellByIndex(rowIndex, cInd).setLabel(s3);
s4 = s3;
}
else {
}
}
//
var combo = mygrid_recv.getCustomCombo(selectedId, ind + 1);
setAreanameCombo(combo, s4);
mygrid_recv.cellByIndex(rowIndex, ind + 1).setLabel("");
//
return true;
}
else if (cInd == 3) {
var strareaname = mygrid_recv.cellByIndex(rowIndex, cInd).getValue();
var urlVal = "WmsZXFeeGridSource.aspx?read=getacreage&areaname=" + escape(strareaname) + "&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var sLabel = loader.xmlDoc.responseText;
//
if (sLabel.trim() == "") {
mygrid_recv.cellByIndex(rowIndex, 5).setLabel("0.00");
}
else {
mygrid_recv.cellByIndex(rowIndex, 5).setLabel(sLabel);
}
return true;
}
else if (cInd == 4 || cInd == 5) {
var cellVal4 = mygrid_recv.cellByIndex(rowIndex, 4).getValue();
var cellVal5 = mygrid_recv.cellByIndex(rowIndex, 5).getValue();
var isint4 = IsNum(cellVal4);
if (!isint4) {
mygrid_recv.cellByIndex(rowIndex, 6).setLabel("0.00");
alert("单价格式有误!");
return true;
}
var isint5 = IsNum(cellVal4);
if (!isint5) {
mygrid_recv.cellByIndex(rowIndex, 6).setLabel("0.00");
alert("数量格式有误!");
return true;
}
var hj = cellVal4 * cellVal5;
mygrid_recv.cellByIndex(rowIndex, 6).setLabel(hj);
return true;
}
else {
return true;
}
}
});
//键盘操作事件
mygrid_recv.attachEvent("onKeyPress", function(code, cFlag, sFlag) {
//onKeyPress begin
//获取当前RowID
var selectedId = mygrid_recv.getSelectedRowId();
//获取当前RowIndex
var rowIndex = mygrid_recv.getRowIndex(selectedId);
//获取当前CellIndex(ind)
var ind = mygrid_recv.getSelectedCellIndex();
//触发操作事件前获取单元值
var oldVal = mygrid_recv.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;
}
}
if (code == 9)//Tab键
{
var colCount = mygrid_recv.getColumnsNum();
var rowCount = mygrid_recv.getRowsNum();
if (ind < colCount) {
pressRecord = "";
pressRowIndex = -1;
pressCellIndex = -1;
var cInd = ind;
var rId = selectedId;
mygrid_recv.selectCell(rowIndex, ind + 1, true, true);
mygrid_recv.editCell();
if (ind == colCount - 1) {
if (rowIndex < rowCount) {
mygrid_recv.editStop(true);
mygrid_recv.clearSelection();
mygrid_recv.selectCell(rowIndex + 1, 1, true, true);
mygrid_recv.editCell();
}
else {
return;
}
}
else {
return;
}
}
}
else if (code >= 65 && code <= 90) {//如果是输入英文字符
if (ind == 2 || ind == 1) {
//获取键盘输入字符
var pressVal = String.fromCharCode(code);
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 (rowIndex == pressRowIndex && ind == pressCellIndex) {
//未选中多个字符
if (start == end) {
if (start != pressRecord.length) {
if (start != 0) {
var firstVal = pressRecord.substring(0, start - 1);
var endVal = pressRecord.substring(start + 1, txtEdit.value.length - 1);
pressRecord = firstVal + pressVal + endVal;
}
} else {
pressRecord = pressRecord + pressVal;
}
}
//选中多个字符
if (start != end) {
var firstVal = pressRecord.substring(0, start);
var endVal = pressRecord.substring(end - 1, txtEdit.value.length - 1);
pressRecord = firstVal + pressVal + endVal;
}
} else {
pressRecord = pressVal;
pressRowIndex = rowIndex;
pressCellIndex = ind;
}
//获取combo下拉列表
var combo = mygrid_recv.getCustomCombo(selectedId, ind);
var comboArg = combo.getKeys();
var count = 0;
//开始遍历检索
//如果检索成功 状态pressCount=1 如果不成功应为pressCount=2
for (var i = 0; i < comboArg.length; i++) {
if (combo.get(comboArg[i]).toUpperCase().trim().indexOf(pressRecord) == 0) {
//计数
count++;
//获取value
var oldVal = comboArg[i];
//获取label
var oldLab = combo.get(comboArg[i]);
//记录状态值 检索到数据项
pressCount = 1;
flagFilter = 1;
//关闭编辑
mygrid_recv.editStop();
//将value写入cell(触发 stage2)
mygrid_recv.cellByIndex(rowIndex, ind).setValue(oldVal);
flagFilter = 0;
//重新打开cell(触发stage0 stage1)
mygrid_recv.selectCell(rowIndex, ind, true, true);
mygrid_recv.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位
r.select();
break;
}
}
break;
}
}
//如果检索不能成功 pressCount=2
if (count == 0) {
pressCount = 2;
txtEdit.value = pressRecord;
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(true);
r.moveStart("character", pressRecord.length); //从m位开始
r.moveEnd("character", pressRecord.length); //选取n位
r.select();
break;
}
}
}
}
else{
return true;
}
}
else if (code == 8)//delete
{
//code8 begin
if (ind == 2 || ind == 3 || ind == 1 || ind == 7) {
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) {
var firstVal = pressRecord.substring(0, start - 1);
var endVal = pressRecord.substring(start + 1, txtEdit.value.length - 1);
pressRecord = firstVal;
}
}
//选中多个字符
if (start != end) {
var firstVal = pressRecord.substring(0, start);
var endVal = pressRecord.substring(end - 1, txtEdit.value.length - 1);
pressRecord = firstVal + endVal;
}
setTimeout(function() {
if (pressRecord.trim().length > 0) {
var combo = mygrid_recv.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;
mygrid_recv.editStop();
mygrid_recv.cellByIndex(rowIndex, ind).setValue(oldVal);
mygrid_recv.selectCell(rowIndex, ind, true, true);
mygrid_recv.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 == 40)//向下方向键
{
if (ind == 1 || ind == 2 || ind == 3 || ind == 7) {
return true;
}
var rowCount = mygrid_recv.getRowsNum();
mygrid_recv.clearSelection();
mygrid_recv.editStop();
if (rowIndex == (rowCount - 1)) {
addRecvRow();
}
else {
mygrid_recv.selectCell(rowIndex + 1, 1, true, true);
mygrid_recv.editCell();
}
}
else if (code == 38)//向上箭头
{
if (ind == 1 || ind == 2 || ind == 3 || ind == 7) {
return true;
}
if (rowIndex > 0) {
mygrid_recv.clearSelection();
mygrid_recv.editStop();
mygrid_recv.selectCell(rowIndex - 1, 1, true, true);
mygrid_recv.editCell();
}
}
else {
return true;
}
});
setTimeout(function() {
markStatusColor(mygrid_recv);
}, 400);
}
//讲下拉列表Combo所有生成Array数组
function setComboByArray(gridNewObj, comboObj, rowGID, colIndex) {
var comboVal_arg = new Array();
comboVal_arg = comboObj.getKeys();
var newCombo = gridNewObj.getCustomCombo(rowGID, colIndex);
for (var i = 0; i < comboVal_arg.length; i++) {
var txtValue = comboObj.get(comboVal_arg[i]);
newCombo.put(comboVal_arg[i], txtValue);
}
}
function spliceBuffer(arrayRow) {
var strBuffer = "";
for (var i = 0; i < arrayRow.length; ++i) {
strBuffer = strBuffer + arrayRow[i];
if (i != arrayRow.length - 1) {
strBuffer = strBuffer + ",";
}
}
alert(strBuffer);
}
function isObjNaN(Obj) {
if (Obj.toString().toLowerCase() == "nan") {
return 0;
} else {
return Obj;
}
}
function addRecvRow() {
if (mygrid_recv.getRowsNum() > 0) {
var newId = newGuid();
//获取插入新纪录位置
var rowCount = mygrid_recv.getRowsNum();
var loader = dhtmlxAjax.getSync("WmsZXFeeGridSource.aspx?read=additemno&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid());
var strITEMNO = loader.xmlDoc.responseText;
mygrid_recv.addRow(newId, [0, "", "", "", "0.00", "0.00", "0.00", "", "", "否"], rowCount);
mygrid_recv.clearSelection();
var rId = mygrid_recv.getRowId(rowCount - 1);
var combo_customer;
combo_customer = mygrid_recv.getCustomCombo(rId, 1);
setComboByArray(mygrid_recv, combo_customer, newId, 1);
//
combo_customer = mygrid_recv.getCustomCombo(rId, 2);
setComboByArray(mygrid_recv, combo_customer, newId, 2);
//
combo_customer = mygrid_recv.getCustomCombo(rId, 3);
setComboByArray(mygrid_recv, combo_customer, newId, 3);
//
combo_customer = mygrid_recv.getCustomCombo(rId, 7);
setComboByArray(mygrid_recv, combo_customer, newId, 7);
mygrid_recv.editStop(true);
mygrid_recv.selectCell(mygrid_recv.getRowIndex(newId), 0, true, true);
mygrid_recv.editCell();
}
else {
mygrid_recv.loadXML("WmsZXFeeGridSource.aspx?read=add&showcount=1&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid());
}
}
function deleteRecvRow() {
mygrid_recv.editStop();
var selRowID = mygrid_recv.getCheckedRows(0); //所有选中的grid的id编号
var selGroup = new Array();
if (selRowID.indexOf(",") > 0) {
selGroup = selRowID.split(",");
}
else {
if (selRowID != null) {
selGroup.push(selRowID);
}
}
if (selGroup.length > 0) {
if (selGroup.length > 1) {
if (window.confirm("您确定要将所选部门删除吗?")) {
var dg = new dialog();
dg.html = "<img src=\"../images/icon/progress.gif\" />";
dg.width = 200;
dg.height = 100;
dg.title = "标题";
dg.show();
var strError = "";
for (var i = 0; i < selGroup.length; i++) {
var urlVal = "WmsZXFeeGridSource.aspx?read=getislock&gids=" + selGroup[i] + "&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var loadVal = loader.xmlDoc.responseText;
if (loadVal > 0) {
strError = "已入账记录,将不不予以删除!";
continue;
}
//
var urlVal = "WmsZXFeeGridSource.aspx?read=delete&gid=" + selGroup[i] + "&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var loadVal = loader.xmlDoc.responseText;
if (loadVal > 0) {
mygrid_recv.deleteRow(selGroup[i]);
}
else {
mygrid_recv.deleteSelectedRows();
}
}
if (strError.trim() != "") {
alert(strError);
}
dg.close();
}
}
else {
var strError = "";
for (var i = 0; i < selGroup.length; i++) {
var urlVal = "WmsZXFeeGridSource.aspx?read=getislock&gids=" + selGroup[i] + "&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var loadVal = loader.xmlDoc.responseText;
if (loadVal > 0) {
strError = "已入账记录,将不不予以删除!";
continue;
}
//
var rowIndex = mygrid_recv.getRowIndex(selGroup[i]);
var WmsZXFeeName = mygrid_recv.cellByIndex(rowIndex, 1).getValue();
if (window.confirm("您确定要将(" + WmsZXFeeName + ")删除吗?")) {
var dg = new dialog();
dg.html = "<img src=\"../images/icon/progress.gif\" />";
dg.width = 200;
dg.height = 100;
dg.title = "标题";
dg.show();
var urlVal = "WmsZXFeeGridSource.aspx?read=delete&gid=" + selGroup[i] + "&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var loadVal = loader.xmlDoc.responseText;
if (loadVal > 0) {
mygrid_recv.deleteRow(selGroup[i]);
dg.close();
//alert("删除成功");
}
else {
mygrid_recv.deleteSelectedRows();
dg.close();
}
}
}
if (strError.trim() != "") {
alert(strError);
}
}
}
else {
alert("未选中要操作的币别项");
}
}
function saveRecvChange() {
mygrid_recv.editStop();
jsonWmsZXFeeObj = "{\"$type\":\"DSWeb.Models.JsonWmsZXFeeGroupEntity, DSWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\",\"JsonWmsZXFeeEntities\":[";
column_count = mygrid_recv.getColumnsNum();
var tempJson = "";
var strError = "";
var isError = 0;
var rowCount = mygrid_recv.getRowsNum();
for (var i = 0; i < rowCount; i++) {
//获取RowID
tempJson = "";
var str78 = 0;
var rId = mygrid_recv.getRowId(i);
//判断是否出库
var urlVal = "WmsZXFeeGridSource.aspx?read=getislock&gids=" + rId + "&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var loadVal = loader.xmlDoc.responseText;
if (loadVal > 0) {
strError = "已入账记录,将不不予以更改!";
continue;
}
else
{
isError=1;
}
//
tempJson += "\"$type\":\"DSWeb.Models.JsonWmsZXFeeEntity, DSWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\",";
tempJson += "\"WmsZXFee1\":\"" + rId + "\","; //gid
for (var j = 0; j < column_count-1; j++) {
var cell = mygrid_recv.cellById(rId, j+1);
var value = "";
//value = cell.cell.innerText; // .getValue();
value = cell.cell.textContent || cell.cell.innerText;
if (j == 0) {
if (value.trim()=="") {
alert("客户名称不允许为空!");
return;
}
}
if (j == 1) {
if (value.trim() == "") {
alert("仓库名称不允许为空!");
return;
}
}
// if (j == 2) {
// if (value.trim() == "") {
// alert("库位名称不允许为空!");
// return;
// }
// }
if (j == 3) {
var istr = IsNum(value);
if (!istr) {
alert("单价格式有误!");
return;
}
}
if (j == 4) {
var istr = IsNum(value);
if (!istr) {
alert("计费数量格式有误!");
return;
}
}
if (j == 5) {
var istr = IsNum(value);
if (!istr) {
alert("仓储费用格式有误!");
return;
}
}
if (value.trim() == "") {
value = "null";
}
tempJson += "\"WmsZXFee" + (j + 2) + "\":\"" + value.trim() + "\"";
}
//tempJson += "\"WmsZXFee6\":\""+BSNO+"\"";
tempJson = "{" + tempJson + "}";
if (i == rowCount - 1) {
jsonWmsZXFeeObj = jsonWmsZXFeeObj + tempJson;
} else {
jsonWmsZXFeeObj = jsonWmsZXFeeObj + tempJson + ",";
}
}
if (strError != "") {
alert(strError);
}
if (isError == 0) {
return;
}
jsonWmsZXFeeObj += "]}";
var txt_name = $("recvContainer");
txt_name.value = jsonWmsZXFeeObj;
msgBox();
setTimeout(postEnterWmsZXFee, 200);
}
function doOnRowSelected(rowID, celInd) {
alert("Selected row ID is " + rowID + "\nUser clicked cell with index " + celInd);
}
function getValue() {
var colLabel = mygrid_recv.getColumnLabel(0);
alert(colLabel);
var colLabel2 = mygrid_recv.getColumnLabel(0, 2);
alert(colLabel2);
}
//post数据
function postEnterWmsZXFee() {
var myForm = document.getElementById("form1");
myForm.submit();
}
function findRow() {
var colNum = mygrid.getColumnsNum();
var count = mygrid.getRowsNum();
}
function initGrid() {
doInitRecvGrid();
//setTimeout(doInitPayGrid,200);
//setTimeout(totalDynamicWmsZXFeeGain,700);
}
//放弃应收币别修改 重新加载页面
function recoverRecvChange() {
mygrid_recv.editStop();
var selRowID = mygrid_recv.getSelectedRowId();
//查看是否有被选中的币别项
if (selRowID != null) {
var rowIndex = mygrid_recv.getRowIndex(selRowID);
var status = mygrid_recv.cellByIndex(rowIndex, 0).getValue();
var WmsZXFeeName = mygrid_recv.cellByIndex(rowIndex, 1).getValue();
var cusName = mygrid_recv.cellByIndex(rowIndex, 3).getValue();
if (window.confirm("您确定放弃当前行的修改吗?")) {
var dg = new dialog();
dg.html = "<img src=\"../../images/icon/progress.gif\" />";
dg.width = 200;
dg.height = 100;
dg.title = "标题";
dg.show();
var urlVal = "WmsZXFeeGridSource.aspx?read=recover&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&gid=" + selRowID + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var loadVal = loader.xmlDoc.responseText;
if (!IsNum(loadVal)) {
var recvArg = new Array();
recvArg = loadVal.split(",");
var selRowIndex = mygrid_recv.getRowIndex(recvArg[0]);
var colCount = mygrid_recv.getColumnsNum();
for (var i = 0; i < colCount; i++) {
mygrid_recv.cellByIndex(selRowIndex, i).setValue(recvArg[i + 1]);
}
dg.close();
}
else {
if (parseInt(loadVal) == -3) {
mygrid_recv.deleteSelectedRows();
}
dg.close();
}
} else {
return;
}
} else {
alert("未选中要操作的币别项");
}
}
function print_recv() {
alert("正在打印");
}
function amountSum(gridName) {
if (gridName == "recv") {
//计算应收
mygrid_recv
} else {
//计算应付
}
}
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);
}
//获取GUID
function newGuid() {
var guid = "";
for (var i = 1; i <= 32; i++) {
var n = Math.floor(Math.random() * 16.0).toString(16);
guid += n;
}
return guid.toUpperCase();
}
function 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 msgBox() {
var dg = new dialog();
dg.html = "程序正在提交,请稍等!";
//dg.html+="<input type=button onclick='new dialog().close();' value='确定'>";
dg.width = 200;
dg.height = 100;
dg.title = "标题";
dg.show();
}
//是否为数字
function IsNum(val) {
var re = /^[-\+]?\d+(\.\d+)?$/;
if (!re.test(val)) {
return false;
} else {
return true;
}
}
function ConvertToMoney(strObj) {
var result = strObj.replace(",", "");
return result;
}
function filterComboCustomerPress(gridObj, rowID, rowIndex, colIndex, filterVal, oldVal) {
var combo = gridObj.getCustomCombo(rowID, colIndex);
var comboArg = combo.getKeys();
var doCount = 0;
for (var i = 0; i < comboArg.length; i++) {
if (combo.get(comboArg[i]).toUpperCase().trim().indexOf(filterVal.toUpperCase()) == 0) {
alert(combo.get(comboArg[i]).toUpperCase().trim());
gridObj.cellByIndex(rowIndex, colIndex).setValue(combo.get(comboArg[i]));
gridObj.selectCell(rowIndex, colIndex, true, true, true, true);
doCount = 1;
break;
}
}
}
//两端去空格函数
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }
//下拉框内容显示value的值
function ReShowLabel(gridObj) {
var columnCount = gridObj.getColumnsNum();
var rowCount = gridObj.getRowsNum();
if (rowCount > 0) {
for (var i = 0; i < rowCount; i++) {
for (var j = 0; j < columnCount; j++) {
if (j == 1) {
var cellCurVal = gridObj.cellByIndex(i, j).getValue();
gridObj.cellByIndex(i, j).setLabel(cellCurVal);
}
}
}
}
}
function clearNoNum(valObj) {
//先把非数字的都替换掉,除了数字和.
valObj = valObj.replace(/[^\d.]/g, "");
//必须保证第一个为数字而不是.
valObj = valObj.replace(/^\./g, "");
//保证只有出现一个.而没有多个.
valObj = valObj.replace(/\.{2,}/g, ".");
//保证.只出现一次,而不能出现两次以上
valObj = valObj.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
return valObj;
}
function markStatusColor(gridObj) {
var count = gridObj.getRowsNum();
for (var i = 0; i < count; i++) {
var status = gridObj.cellByIndex(i, 0).getValue();
var rowId = gridObj.getRowId(i);
}
}
//刷新应收
function refreshRecv() {
doInitRecvGrid();
}
//全选框
function checkall() {
var checkStatus = $("ck_all").checked;
if (checkStatus == 1) {
var iCount = mygrid_recv.getRowsNum();
for (var i = 0; i < iCount; i++) {
mygrid_recv.cellByIndex(i, 0).setValue(1);
}
}
else {
var iCount = mygrid_recv.getRowsNum();
for (var i = 0; i < iCount; i++) {
mygrid_recv.cellByIndex(i, 0).setValue(0);
}
}
}
//--------------------------------------------------------------------------------------------------------------------------------------------------
function getisvbm(rId) {
var urlVal3 = "WmsZXFeeGridSource.aspx?read=isedit&gid=" + rId + "&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader3 = dhtmlxAjax.getSync(urlVal3);
var loadVal3 = loader3.xmlDoc.responseText;
if (loadVal3.trim() == "False") {
return false;
}
else {
return true;
}
}
function $(id) {
return document.getElementById(id);
}
var comboCUSTOMERNAME;
var comboTRUCK;
var comboWMSOP;
var comboSTOREMAN;
function initComboCUSTOMERNAME()//委托单位
{
comboCUSTOMERNAME = dhtmlXComboFromSelect("ddlCUSTOMERNAME");
comboCUSTOMERNAME.loadXML("../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISCONTROLLER");
}
function initComboCUSTOMERNAME2()//委托单位
{
comboCUSTOMERNAME.setOptionWidth(200);
comboCUSTOMERNAME.attachEvent("onChange", function() {
comboCUSTOMERNAME.setComboText($("hd_comboCUSTOMERNAME").value);
});
comboCUSTOMERNAME.attachEvent("onBlur", function() {
var s1 = comboCUSTOMERNAME.getComboText().trim();
var s2 = s1.indexOf("|");
if (s1 == "") {
$("hd_comboCUSTOMERNAME").value = "";
comboCUSTOMERNAME.setComboText($("hd_comboCUSTOMERNAME").value);
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
comboCUSTOMERNAME.setComboText(s3);
$("hd_comboCUSTOMERNAME").value = s3;
}
else {
comboCUSTOMERNAME.setComboText($("hd_comboCUSTOMERNAME").value);
}
}
});
comboCUSTOMERNAME.setComboText($("hd_comboCUSTOMERNAME").value);
comboCUSTOMERNAME.attachEvent("onKeyPressed", function(keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function() {
var filterCount = 0;
var is = -1;
var ishd = $("hd_comboCUSTOMERNAME").value.trim();
if ("" != comboCUSTOMERNAME.getComboText().trim()) {
while ("undefined" != typeof comboCUSTOMERNAME.getOptionByIndex(filterCount)) {
var comboValue = comboCUSTOMERNAME.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = comboCUSTOMERNAME.getComboText().trim().toUpperCase();
$("hd_comboCUSTOMERNAME").value = comboCUSTOMERNAME.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
comboCUSTOMERNAME.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
if (is == -1) {
$("hd_comboCUSTOMERNAME").value = ishd;
alert("无此内容,请重新选择!");
}
}
}, 10);
}
});
comboCUSTOMERNAME.attachEvent("onSelectionChange", function() {
$("hd_comboCUSTOMERNAME").value = comboCUSTOMERNAME.getComboText().trim();
});
}
function initComboTRUCK()//车队
{
comboTRUCK = dhtmlXComboFromSelect("ddlTRUCK");
comboTRUCK.loadXML("../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISTRUCK");
}
function initComboTRUCK2()//车队
{
comboTRUCK.setOptionWidth(200);
comboTRUCK.attachEvent("onChange", function() {
comboTRUCK.setComboText($("hd_comboTRUCK").value);
});
comboTRUCK.attachEvent("onBlur", function() {
var s1 = comboTRUCK.getComboText().trim();
var s2 = s1.indexOf("|");
if (s1 == "") {
$("hd_comboTRUCK").value = "";
comboTRUCK.setComboText($("hd_comboTRUCK").value);
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
comboTRUCK.setComboText(s3);
$("hd_comboTRUCK").value = s3;
}
else {
comboTRUCK.setComboText($("hd_comboTRUCK").value);
}
}
});
comboTRUCK.setComboText($("hd_comboTRUCK").value);
comboTRUCK.attachEvent("onKeyPressed", function(keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function() {
var filterCount = 0;
var is = -1;
var ishd = $("hd_comboTRUCK").value.trim();
if ("" != comboTRUCK.getComboText().trim()) {
while ("undefined" != typeof comboTRUCK.getOptionByIndex(filterCount)) {
var comboValue = comboTRUCK.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = comboTRUCK.getComboText().trim().toUpperCase();
$("hd_comboTRUCK").value = comboTRUCK.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
comboTRUCK.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
if (is == -1) {
$("hd_comboTRUCK").value = ishd;
alert("无此内容,请重新选择!");
}
}
}, 10);
}
});
comboTRUCK.attachEvent("onSelectionChange", function() {
$("hd_comboTRUCK").value = comboTRUCK.getComboText().trim();
});
}
function initComboWMSOP()//操作人员
{
//生成
var strUserID = $("hdUserID").value;
comboWMSOP = dhtmlXComboFromSelect("ddlWMSOP");
comboWMSOP.loadXML("../FeeCodes/OPAdapter.aspx?mask=0&pos=0&rName=isOperator&userID=" + strUserID);
}
function initComboWMSOP2()//操作人员
{
comboWMSOP.attachEvent("onChange", function() {
comboWMSOP.setComboText($("hd_comboWMSOP").value);
});
comboWMSOP.attachEvent("onBlur", function() {
var s1 = comboWMSOP.getComboText().trim();
var s2 = s1.indexOf("|");
if (s1 == "") {
$("hd_comboWMSOP").value = "";
comboWMSOP.setComboText($("hd_comboWMSOP").value);
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
comboWMSOP.setComboText(s3);
$("hd_comboWMSOP").value = s3;
}
else {
comboWMSOP.setComboText($("hd_comboWMSOP").value);
}
}
});
comboWMSOP.setComboText($("hd_comboWMSOP").value);
comboWMSOP.attachEvent("onKeyPressed", function(keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function() {
var filterCount = 0;
var is = -1;
var ishd = $("hd_comboWMSOP").value.trim();
if ("" != comboWMSOP.getComboText().trim()) {
while ("undefined" != typeof comboWMSOP.getOptionByIndex(filterCount)) {
var comboValue = comboWMSOP.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = comboWMSOP.getComboText().trim().toUpperCase();
$("hd_comboWMSOP").value = comboWMSOP.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
comboWMSOP.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
if (is == -1) {
$("hd_comboWMSOP").value = ishd;
alert("无此内容,请重新选择!");
}
}
}, 10);
}
});
comboWMSOP.attachEvent("onSelectionChange", function() {
$("hd_comboWMSOP").value = comboWMSOP.getComboText().trim();
});
}
function initComboSTOREMAN()//操作人员
{
//生成
var strUserID = $("hdUserID").value;
comboSTOREMAN = dhtmlXComboFromSelect("ddlSTOREMAN");
comboSTOREMAN.loadXML("../FeeCodes/OPAdapter.aspx?mask=0&pos=0&rName=isOperator&userID=" + strUserID);
}
function initComboSTOREMAN2()//操作人员
{
comboSTOREMAN.attachEvent("onChange", function() {
comboSTOREMAN.setComboText($("hd_comboSTOREMAN").value);
});
comboSTOREMAN.attachEvent("onBlur", function() {
var s1 = comboSTOREMAN.getComboText().trim();
var s2 = s1.indexOf("|");
if (s1 == "") {
$("hd_comboSTOREMAN").value = "";
comboSTOREMAN.setComboText($("hd_comboSTOREMAN").value);
}
else {
if (s2 > 0) {
s2 = s2 + 2;
}
var s3 = s1.substring(s2);
if (s2 > 0) {
comboSTOREMAN.setComboText(s3);
$("hd_comboSTOREMAN").value = s3;
}
else {
comboSTOREMAN.setComboText($("hd_comboSTOREMAN").value);
}
}
});
comboSTOREMAN.setComboText($("hd_comboSTOREMAN").value);
comboSTOREMAN.attachEvent("onKeyPressed", function(keyCode) {
if (keyCode != "8") {
var arrayArg = new Array();
setTimeout(function() {
var filterCount = 0;
var is = -1;
var ishd = $("hd_comboSTOREMAN").value.trim();
if ("" != comboSTOREMAN.getComboText().trim()) {
while ("undefined" != typeof comboSTOREMAN.getOptionByIndex(filterCount)) {
var comboValue = comboSTOREMAN.getOptionByIndex(filterCount).text.toUpperCase(); //.value;
var enterValue = comboSTOREMAN.getComboText().trim().toUpperCase();
$("hd_comboSTOREMAN").value = comboSTOREMAN.getComboText().trim().toUpperCase();
if (comboValue.indexOf(enterValue) == 0) {
comboSTOREMAN.selectOption(filterCount, true, true);
is = filterCount;
break;
}
++filterCount;
}
if (is == -1) {
$("hd_comboSTOREMAN").value = ishd;
alert("无此内容,请重新选择!");
}
}
}, 10);
}
});
comboSTOREMAN.attachEvent("onSelectionChange", function() {
$("hd_comboSTOREMAN").value = comboSTOREMAN.getComboText().trim();
});
}
//是否为数字,且数值格式是否正确
function IsNumFormat(val) {
var re = /^[-\+]?\d+(\.\d+)?$/;
if (!re.test(val)) {
return false;
}
else {
if (val.toString().indexOf(".") > 0) {
val.toString().replace("-", "");
val.toString().replace("+", "");
if (val.toString().substr(0, 1) == "0" && val.toString().substr(0, 2) != "0.") {
return false;
}
}
else {
var re1 = /^[-\+]+[1-9]+[0-9]*]*$/;
if (!re1.test(val)) {
re1 = /^[1-9]+[0-9]*]*$/;
if (!re1.test(val)) {
return false;
}
}
}
return true;
}
}
//是否为整数
function IsIntFormat(val) {
re1 = /^[1-9]+[0-9]*]*$/;
if (!re1.test(val)) {
return false;
}
return true;
}
//
function getIsNum(x) {
var str = x.value.trim();
if (str == "0") {
return;
}
else if (str == "") {
str = 0;
x.value = 0;
}
else {
var bl = IsNumFormat(str);
if (!bl) {
alert("数值格式错误!");
x.focus();
x.select();
}
}
}
//
function ShowDetailDel() {
if (confirm('确定撤销生成的凭证吗?')) {
var urlVal01 = "CwVouchersListGridSource.aspx?handle=delete&gids=" + $("hdOrdno").value.trim() + "&val=" + newGuid();
var loader01 = dhtmlxAjax.getSync(urlVal01);
var strDel = loader01.xmlDoc.responseText;
if (strDel.trim() != "") {
alert(strDel);
}
else {
window.close();
}
return;
}
}
function reloadParent(strBSNO, strHandle) {
var parentObj = window.parent.location;
var oldUrl = parentObj.href;
var idIndex = oldUrl.indexOf("&id");
//
var newUrl = "";
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=edit&id=" + strBSNO;
}
else if (strHandle == "addfull") {
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&id=" + strBSNO;
}
else if (strHandle == "edit") {
window.parent.opener.location.href = window.parent.opener.location.href;
}
else if (strHandle == "del") {
newUrl = oldUrl.substring(0, idIndex + 4);
window.parent.opener.location.href = window.parent.opener.location.href;
parentObj.href = newUrl + strBSNO;
alert("操作成功!");
}
else if (strHandle == "adds") {
window.parent.opener.location.href = window.parent.opener.location.href;
}
}
function printAction() {
var strBSNO = "";
strBSNO = $("hdGID").value;
var printUrl = "";
var companyID = "";
var typeName = "WmszxinInfoReport";
var dbSourceID = "";
var userID = "";
var url = "../Reports/ReportService.aspx?handle=printwmszxininfo&bsno=" + strBSNO + "&val=" + newGuid();
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 setAreanameCombo(obj, strSTOREMAN) {//初始化计费标准Combo
var AreanameObj = null;
obj.clear();
var url = "WmsZXFeeGridSource.aspx?read=areaname&areaname=" + escape(strSTOREMAN) + "&year=" + $("ddlFEEYEAR").value + "&month=" + $("ddlFEEMONTH").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(url);
var areaInfo = loader.xmlDoc.responseText;
if (areaInfo.trim() != "") {
AreanameObj = eval('(' + areaInfo + ')');
if (AreanameObj.area.length > 0) {
for (var i = 0; i < AreanameObj.area.length; i++) {
if (AreanameObj.area[i].name.trim() != "") {
obj.put(AreanameObj.area[i].name, AreanameObj.area[i].name);
}
}
}
}
}
function GetRange(RangeName, strgid) {
//var strgid = mygrid_log.getCheckedRows(0); //所有选中的grid的id编号 modWmsFeeLock modWmsFeeRejected
var loader = dhtmlxAjax.getSync("../FeeCodes/RangeAdapter.aspx?RangeName=" + RangeName + "&strGID=" + strgid + "&val=" + newGuid());
var dates = loader.xmlDoc.responseText;
if (dates == "") {
alert("您没有操作此数据的权限!");
return 0;
}
else {
return 1;
}
}
function setislock() {
var sGID = "";
var checked = mygrid_recv.getCheckedRows(0); //所有选中的grid的id编号
var arrtmp = checked.split(","); //将各参数分离形成参数数组
for (i = 0; i < arrtmp.length; i++) {
var selectedId = arrtmp[i].toString().trim();
var rowIndex = mygrid_recv.getRowIndex(selectedId);
var oldVal = mygrid_recv.cellByIndex(rowIndex, 9).getValue().trim();
if (oldVal != "是") {
sGID += "," + arrtmp[i].toString().trim()
}
}
checked = sGID.substr(1);
//
if (checked != null && checked != "") {
var ii = GetRange("modWmsFeeLock", checked);
if (ii == 0) {
return;
}
//
if (confirm('确定费用入账吗?(入账后将不允许修改删除费用!)')) {
var urlVal = "WmsZXFeeGridSource.aspx?read=islock&gids=" + checked + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var strDel = loader.xmlDoc.responseText;
if (strDel.trim() != "") {
alert(strDel);
}
initWinScreen();
refreshRecv();
}
}
else {
alert('未选中要操作的数据!');
return;
}
}
function setnotlock() {
var checked = mygrid_recv.getCheckedRows(0); //所有选中的grid的id编号
if (checked != null && checked != "") {
var ii = GetRange("modWmsFeeRejected", checked);
if (ii == 0) {
return;
}
//
if (confirm('确定取消入账吗?(只有“未申请开票、未开发票、未对帐”的入账费用允许取消!)')) {
var urlVal = "WmsZXFeeGridSource.aspx?read=notlock&gids=" + checked + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var strDel = loader.xmlDoc.responseText;
if (strDel.trim() != "") {
alert(strDel);
}
initWinScreen();
refreshRecv();
}
}
else {
alert('未选中要操作的数据!');
return;
}
}
function setDivCopy() {
if ($("h_isDivYM").value.toString().trim() == "1") {
$("h_isDivYM").value = "0";
$("divYM").style.display = "none";
}
else {
$("h_isDivYM").value = "1";
$("divYM").style.display = "";
}
}
function setCopy() {
var urlVal = "WmsZXFeeGridSource.aspx?read=setcopy&year1=" + $("ddlFEEYEAR1").value + "&month1=" + $("ddlFEEMONTH1").value + "&year2=" + $("ddlFEEYEAR2").value + "&month2=" + $("ddlFEEMONTH2").value + "&val=" + newGuid();
var loader = dhtmlxAjax.getSync(urlVal);
var strError = loader.xmlDoc.responseText;
if (strError.trim() == "false") {
alert("操作出错!");
return;
}
//
$("h_isDivYM").value = "0";
$("divYM").style.display = "none";
refreshRecv();
}