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.
459 lines
18 KiB
Plaintext
459 lines
18 KiB
Plaintext
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_GoodsPrint.aspx.cs" Inherits="TradeManage.HuoWu.HW_GoodsPrint" %>
|
|
<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
|
|
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>货物信息</title>
|
|
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
|
|
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
|
|
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
|
<script src="../Scripts/DataGrid.js" type="text/javascript"></script>
|
|
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
|
|
<script src="../Scripts/DateBox.js" type="text/javascript"></script>
|
|
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
|
|
<script src="../Scripts/Global.js" type="text/javascript"></script>
|
|
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
|
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
|
<script src="../Scripts/jquery.cookies.min.js" type="text/javascript"></script>
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css"
|
|
media="screen" />
|
|
<script type="text/javascript" src="../Scripts/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
|
|
<script type="text/javascript" src="../Scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
<script src="../Scripts/LodopFuncs.js" type="text/javascript"></script>
|
|
<script type="text/javascript">
|
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
var WindowLoadModel = new WindowLoad();
|
|
var Type = 1;
|
|
$(document).ready(function () {
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
WindowLoadModel.Isbgiframe = true;
|
|
WindowLoadModel.Load();
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
//CheckIsInstall();
|
|
CreateDataGrid();
|
|
//ReadData();
|
|
$("#" + datagrid1.TableID + " a[CommandName='cmdImg']").live("click", function () {
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
if (model.GoodsImageIds != null && model.GoodsImageIds != "")
|
|
GetImage(model.GoodsImageIds);
|
|
|
|
|
|
|
|
});
|
|
$("#" + datagrid1.TableID + " a[CommandName='cmdLook']").live("click", function () {
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
//window.location.href = "HW_GoodsAdd.aspx?GoodsId=" + model.GoodsId;
|
|
window.parent.addTab("货物编辑", "HuoWu/HW_GoodsAddForTM.aspx?Title=货物信息&GoodsId=" + model.GoodsId, true);
|
|
|
|
|
|
});
|
|
$("#" + datagrid1.TableID + " input[CommandName='cmdEdit']").live("click", function () {
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
// window.location.href = "HW_GoodsAdd.aspx?GoodsId=" + model.GoodsId;
|
|
window.parent.addTab("货物编辑", "HuoWu/HW_GoodsAddForTM.aspx?Title=货物信息&GoodsId=" + model.GoodsId, true);
|
|
|
|
});
|
|
|
|
$("#btn_print").bind("click", function () {
|
|
Print();
|
|
|
|
});
|
|
$("#btn_zprint").bind("click", function () {
|
|
ZPrint();
|
|
|
|
});
|
|
|
|
$("#Rad_1,#Rad_2,#Rad_3,#Rad_4").bind("click", function () {
|
|
if ($("#Rad_1").is(":checked") == true) {
|
|
$("#sp1").html("货物编号");
|
|
$("#sp2").html("型号");
|
|
$("#sp2").show();
|
|
$("#txt_Name2").show();
|
|
$("#txt_SDate").hide();
|
|
$("#txt_EDate").hide();
|
|
$("#span_0").hide();
|
|
Type = 1;
|
|
}
|
|
else if ($("#Rad_2").is(":checked") == true) {
|
|
$("#sp1").html("批次号");
|
|
$("#sp2").hide();
|
|
$("#txt_Name2").hide();
|
|
$("#txt_SDate").hide();
|
|
$("#txt_EDate").hide();
|
|
$("#span_0").hide();
|
|
Type = 2;
|
|
}
|
|
else if ($("#Rad_3").is(":checked") == true) {
|
|
$("#sp1").html("入库点");
|
|
$("#sp2").html("时间");
|
|
$("#sp2").show();
|
|
$("#txt_SDate").show();
|
|
$("#txt_EDate").show();
|
|
$("#span_0").show();
|
|
$("#txt_Name2").hide();
|
|
Type = 3;
|
|
}
|
|
else if ($("#Rad_4").is(":checked") == true) {
|
|
$("#sp1").html("订单号");
|
|
$("#sp2").hide();
|
|
$("#txt_Name2").hide();
|
|
$("#txt_SDate").hide();
|
|
$("#txt_EDate").hide();
|
|
$("#span_0").hide();
|
|
Type = 4;
|
|
}
|
|
|
|
});
|
|
$("#btn_sch").bind("click", function () {
|
|
|
|
ReadData();
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
function Print() {
|
|
datagrid1.UpdateDataSource();
|
|
var list = datagrid1.GetSelectListModel();
|
|
if (list == null || list.length == 0) {
|
|
alert("请选择要打印的sku");
|
|
return;
|
|
}
|
|
var Detail = "";
|
|
var wareno = "";
|
|
|
|
if (Type == 3)
|
|
wareno = $("#txt_Name1").val();
|
|
var wlist = new Array();
|
|
$(list).each(function () {
|
|
var pcode = '仓库';
|
|
if (this.PostionCode != null && this.PostionCode != "")
|
|
pcode = this.PostionCode;
|
|
//Detail += this.GoodsCode + "-" + this.GoodsOldCode + "-" + this.TypeCode + "-" + this.TypeDesc.replace("#", "").replace("&", "") + "-" + this.GoodsName.replace("#", "").replace("&", "") + "-" + this.PrintNum + "-" + pcode + ",";
|
|
if (this.PrintNum > 0) {
|
|
for (var i = 0; i < this.PrintNum; i++) {
|
|
var md = new Object();
|
|
md.WareNo = pcode;
|
|
md.GoodBatch = "1234567-12345678";
|
|
if (this.GoodsCode != null && this.GoodsCode != "")
|
|
md.GoodNo = this.GoodsCode + "-" + this.TypeCode;
|
|
else
|
|
if (this.GoodsOldCode != null && this.GoodsOldCode != "")
|
|
md.GoodNo = this.GoodsOldCode + "-" + this.TypeCode;
|
|
md.Descript = this.TypeDesc.replace("#", "").replace("&", "") + " " + this.GoodsName.replace("#", "").replace("&", "");
|
|
Array.add(wlist, md);
|
|
}
|
|
}
|
|
|
|
});
|
|
var param = new Object();
|
|
param.list = wlist;
|
|
$.ajax({
|
|
url: "HuoWuService.asmx/GoodsCodePrint",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
|
|
window.parent.addTab("打印", "PrintTemplate/GoodPrint.aspx?Title=货物打印", true);
|
|
//$("#APrint").click();
|
|
}
|
|
});
|
|
//&Detail=" + Detail + "&wareno=" + wareno
|
|
//datagrid1.UpdateDataSource();
|
|
//LODOP.PRINT_INITA(0, 0, 189, 76, "GoodsCode");
|
|
//LODOP.SET_PRINT_PAGESIZE(1, 500, 200, "GoodsCodePage");
|
|
|
|
|
|
//$(list).each(function (i) {
|
|
|
|
// if (i > 0) LODOP.NewPage();
|
|
// for (var j = 0; j < this.PrintNum; j++) {
|
|
// if (j > 0) LODOP.NewPage();
|
|
// PrintCode(this.GoodsCode + "-" + this.TypeCode, this.GoodsName + " " + this.TypeDesc);
|
|
|
|
// }
|
|
//});
|
|
//LODOP.PREVIEW();
|
|
|
|
}
|
|
|
|
function ZPrint() {
|
|
datagrid1.UpdateDataSource();
|
|
var list = datagrid1.GetSelectListModel();
|
|
if (list == null || list.length == 0) {
|
|
alert("请选择要打印的sku");
|
|
return;
|
|
}
|
|
var Detail = "";
|
|
var wareno = "";
|
|
|
|
if (Type == 3)
|
|
wareno = $("#txt_Name1").val();
|
|
var wlist = new Array();
|
|
$(list).each(function () {
|
|
var pcode = '仓库';
|
|
if (this.PostionCode != null && this.PostionCode != "")
|
|
pcode = this.PostionCode;
|
|
//Detail += this.GoodsCode + "-" + this.GoodsOldCode + "-" + this.TypeCode + "-" + this.TypeDesc.replace("#", "").replace("&", "") + "-" + this.GoodsName.replace("#", "").replace("&", "") + "-" + this.PrintNum + "-" + pcode + ",";
|
|
if (this.PrintNum > 0) {
|
|
for (var i = 0; i < this.PrintNum; i++) {
|
|
var md = new Object();
|
|
md.WareNo = pcode;
|
|
md.GoodBatch = "1234567-12345678";
|
|
if (this.GoodsCode != null && this.GoodsCode != "")
|
|
md.GoodNo = this.GoodsCode + "-" + this.TypeCode;
|
|
else
|
|
if (this.GoodsOldCode != null && this.GoodsOldCode != "")
|
|
md.GoodNo = this.GoodsOldCode + "-" + this.TypeCode;
|
|
md.Descript = this.TypeDesc.replace("#", "").replace("&", "") + " " + this.GoodsName.replace("#", "").replace("&", "");
|
|
Array.add(wlist, md);
|
|
}
|
|
}
|
|
|
|
});
|
|
var param = new Object();
|
|
param.list = wlist;
|
|
//$.ajax({
|
|
// url: "HuoWuService.asmx/GoodsCodePrint",
|
|
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
// success: function (data) {
|
|
|
|
// //window.parent.addTab("打印", "PrintTemplate/GoodPrint.aspx?Title=货物打印", true);
|
|
$("#APrint").click();
|
|
// }
|
|
//});
|
|
<%--var a = "<%=ZPrint(wlist)%>";--%>
|
|
}
|
|
|
|
function PrintCode(Code, Name) {
|
|
|
|
LODOP.ADD_PRINT_BARCODE(3, 9, 176, 45, "Code39", Code);
|
|
LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
|
|
LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
|
|
LODOP.ADD_PRINT_TEXT(49, 6, 178, 25, Name);
|
|
|
|
}
|
|
function PrintCode2(Code, Name) {
|
|
LODOP.ADD_PRINT_BARCODE(12, 10, 130, 45, "Code39", Code);
|
|
LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
|
|
LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
|
|
LODOP.ADD_PRINT_TEXT(61, 10, 100, 20, Name);
|
|
|
|
}
|
|
//#region 检测是否安装过打印机控件
|
|
function CheckIsInstall() {
|
|
try {
|
|
LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
|
|
if (LODOP != null) { return true; }
|
|
else { return false; }
|
|
} catch (err) {
|
|
//alert("Error:本机未安装或需要升级!");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
function fopen() {
|
|
|
|
$.fancybox({
|
|
'width': '40%',
|
|
'height': '40%',
|
|
'autoScale': false,
|
|
'transitionIn': 'elastic',
|
|
'transitionOut': 'elastic',
|
|
'href': '#test',
|
|
'onComplete': function () {
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
//#endregion
|
|
//#region 初始化DataGrid
|
|
function CreateDataGrid() {
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "货物名称";
|
|
col.CellTemplate = "<a>{Bind GoodsName}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "货物编码";
|
|
col.CellTemplate = "<a>{Bind GoodsCode}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "型号";
|
|
col.CellTemplate = "<span>{Bind TypeCode}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "描述";
|
|
col.CellTemplate = "<span>{Bind TypeDesc}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "库位";
|
|
col.CellTemplate = "<span>{Bind PostionCode}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "实际库存";
|
|
col.CellTemplate = "<span>{Bind GoodsNum}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "打印数量";
|
|
col.CellTemplate = "<input type='text' min='0' max='10000' precision='0' style='width:50px;' class='editTextbox' ColName='PrintNum' value='{Bind PrintNum}'/>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
|
|
datagrid1.IsFixHeader = false;
|
|
datagrid1.ShowIndexColumn = false;
|
|
datagrid1.AllowPaging = false;
|
|
datagrid1.Width = "100%";
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
|
|
datagrid1.Init();
|
|
|
|
|
|
}
|
|
//#endregion
|
|
//#region 读取数据
|
|
function ReadData() {
|
|
if (Type == 1 && $("#txt_Name1").val()=="")
|
|
{
|
|
alert("请输入货物编号");
|
|
return;
|
|
}
|
|
var param = new Object();
|
|
param.Type = Type;
|
|
param.Code = $("#txt_Name2").val();
|
|
param.Name = $("#txt_Name1").val();
|
|
param.SDate = null;
|
|
if ($("#txt_SDate").val() != "")
|
|
{
|
|
param.SDate = $("#txt_SDate").val();
|
|
|
|
}
|
|
param.EDate = null;
|
|
if ($("#txt_EDate").val() != "") {
|
|
param.EDate = $("#txt_EDate").val();
|
|
|
|
}
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "HuoWuService.asmx/GetPrintGoods",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
|
|
datagrid1.DataBind(data.d);
|
|
|
|
}
|
|
});
|
|
}
|
|
//#endregion
|
|
//#region 删除
|
|
function DelCol(obj) {
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
var rowindex = $(obj).parent().parent().attr("index");
|
|
var param = new Object();
|
|
var model = datagrid1.Get_Model(rowindex);
|
|
param.GoodsId = model.GoodsId;
|
|
|
|
$.ajax({
|
|
url: "HuoWuService.asmx/DeleteGoodsInfo",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
dataType: "json",
|
|
success: function (data) {
|
|
if (data.d == 0) {
|
|
alert("删除成功");
|
|
ReadData();
|
|
}
|
|
else {
|
|
alert("该货物有库存或者有订单匹配或者有采购单匹配,无法删除");
|
|
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
//#endregion
|
|
</script>
|
|
|
|
</head>
|
|
<body class="headbody">
|
|
<form id="form1" runat="server">
|
|
<div class="title_ico">
|
|
货物打印
|
|
</div>
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="f1" width="13%">打印方式:</td>
|
|
<td colspan="6">
|
|
<input id="Rad_1" name="pp1" type="radio" checked="checked" /><label for="Rad_1">按货物编号打印</label>
|
|
<input id="Rad_2" name="pp1" type="radio" /><label for="Rad_2">按入库批次打印</label><input id="Rad_3" name="pp1" type="radio" /><label for="Rad_3">按入库点剩余货物打印</label><input id="Rad_4" name="pp1" type="radio" /><label for="Rad_4">按订单货物打印</label></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="f1" width="13%"><span id="sp1">货物编号:</span></td>
|
|
<td width="15%">
|
|
<input id="txt_Name1" class="editTextbox" style="width: 120px;" type="text" /></td>
|
|
<td class="f1" style="width: 10%;"><span id="sp2">型号:</span></td>
|
|
<td colspan="4">
|
|
<input id="txt_Name2" class="editTextbox" style="width: 120px;" type="text" /> <input id="txt_SDate" class="editTextbox" onfocus="WdatePicker()" style="width: 90px;display:none" type="text" /><span id="span_0" style="display:none">-</span><input id="txt_EDate" class="editTextbox" onfocus="WdatePicker()" style="width: 90px;display:none" type="text" /> <input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td colspan="7">
|
|
<input id="btn_print" class="btnClass btnClassEdit" type="button" value="打印" />
|
|
<input id="btn_zprint" class="btnClass btnClassEdit" type="button" value="直接打印" />
|
|
<asp:Button ID="APrint" runat="server" Text="" OnClick="APrint_Click"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" colspan="7">
|
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|