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.

387 lines
13 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CG_ChaseHWCGoods.aspx.cs" Inherits="TradeManage.CaiGou.CG_ChaseHWCGoods" %>
<!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/jquery.bgiframe.min.js" type="text/javascript"></script>
<script src="../Scripts/Global.js" type="text/javascript"></script>
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var WindowLoadModel = new WindowLoad();
var DHState = 0;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
CreateDataGrid();
$("#select_wlzt").live("change", function () {
ReadData();
});
ReadData();
});
function ReadBuyUser() {
$("#select_gmzh").append("<option value='0'>全部</option>");
var param = new Object();
param.CompanyID = 0;
param.KeyName = "cgzh";
$.ajax({
url: "../UserService.asmx/GetListBaseCode",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
if (data.d != null) {
$(data.d).each(function () {
$("#select_gmzh").append("<option value='" + this.Name + "'>" + this.Name + "</option>");
});
}
}
});
}
function Clearcss() {
$("#btn_tj1,#btn_tj2,#btn_tj3,#btn_tj4").attr("class", "btnUnSelected");
}
function AddTr() {
$("#" + datagrid1.TableID + " tr").each(function (i) {
if (i > 0) {
var shtmls = "<tr><td colspan='11'>";
var index = $(this).attr("index");
var md = datagrid1.Get_Model(index);
if (md.GoodsList != null) {
shtmls += "<table width='100%' class='trTable'><tr><td width='780px' style='font-weight:bolder;font-size:13pt;' align='left'>";
$(md.GoodsList).each(function () {
var imgs = "";
var Num = parseInt(this.GoodsNum) - parseInt(this.InGoodsNum);
if ($("#chk_wr").is(":checked") == false || Num > 0) {
if ($("#chk_image").is(":checked") == true && this.FirstImgUrl != null && this.FirstImgUrl != "")
imgs = "<img src='" + this.FirstImgUrl + "' alt='' width='50px' height='50px'/>";
shtmls += "" + imgs + "<span><a style='cursor: pointer; text-decoration: underline; color: Blue;font-weight:normal;' onclick='LinkGoods(" + this.GoodsId + ")'>" + this.GoodsCode + " &nbsp; &nbsp;" + this.GoodsOldCode + " &nbsp; &nbsp;" + this.GoodsName + " " + this.TypeCode + " </a>&nbsp; &nbsp;</span>[<span class='ms'>" + this.TypeDesc + "</span>] &nbsp; &nbsp;<span>" + Num + "</span><br/>";
}
});
}
shtmls += "</td></tr></table></td><tr>";
$(this).after(shtmls);
$(".ms").each(function () {
var cc = jQuery.trim($(this).html());
if ($(this).html() != "") {
var cl = cc.substr(cc.length - 1, 1);
if (cl == "一" || cl == "二" || cl == "三") {
$(this).css("color", "red");
}
}
});
}
});
}
function LinkGoods(GId) {
window.parent.addTab("货物编辑", "HuoWu/HW_GoodsAddForTM.aspx?Title=入库查询&GoodsId=" + GId, true);
}
function GetPostion() {
$("#select_postion").html("<option value='0'>选择</option>");
var param = new Object();
param.StoreId = 0;
param.IsLS = 1;
$.ajax({
url: "../CangKu/CangKuServer.asmx/GetStorePostionForTM",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
$(data.d).each(function () {
$("#select_postion").append("<option value='" + this.PostionId + "'>" + this.PostionCode + "</option>");
});
}
});
}
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 CommandName='cmdImg' class='linka'><img src='{Bind FirstImgUrl}' alt='' width='50px' height='50px'/></a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "货物";
col.Width = "180px";
col.Align = "left";
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind GoodsCode}-{Bind TypeCode}{Bind TypeDesc}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "发货编号";
col.Width = "180px";
col.Align = "left";
col.CellTemplate = "<a>{Bind ChaseCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "数量";
col.CellTemplate = "<span>{Bind GoodsNum}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
// datagrid1.SetPageSize(20);
// datagrid1.SetPageIndex(1);
// datagrid1.SortExpression = "b.GoodsCode,b.Indate";
// datagrid1.ViewSortDirection = "ASC";
// datagrid1.IsFixHeader = true;
// datagrid1.Height = $(document).height() - 230;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = false;
datagrid1.Width = "100%";
//datagrid1.Sorting(function () {
// ReadData();
//});
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
// datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
function InCol(obj) {
if ($("#txt_kwcode").val() == "") {
alert("请填写存放地点");
$("#txt_kwcode").focus();
return;
}
if (window.confirm('直接入库表示货物全部到齐且没有异常,确定要直接入库吗?') == false) return;
var rowindex = $(obj).parent().parent().attr("index");
var param = new Object();
var model = datagrid1.Get_Model(rowindex);
param.ChaseId = model.ChaseId;
param.PostionCode = $("#txt_kwcode").val();
WindowLoadModel.Show();
$.ajax({
url: "CaiGouService.asmx/ChaseInStoreForTM",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
WindowLoadModel.Hide();
if (data.d == 0) {
alert("入库库位编码不正确");
}
else if (data.d == 1) {
alert("该采购单已经有入库记录,不能直接入库,可以点击到货");
}
else {
alert("入库成功");
ReadData();
}
}
});
}
//#endregion
//#region 读取数据
function ReadData() {
var param = new Object();
param.PostState = $("#select_wlzt").val();
param.GoodsCode = $("#txt_code").val();
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
WindowLoadModel.Show();
$.ajax({
url: "CaiGouService.asmx/GetchaseGoodsDetail",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.DataBind(data.d);
}
});
}
function EditCol(obj) {
var rowindex = $(obj).parent().parent().attr("index");
var model = datagrid1.Get_Model(rowindex);
var ChaseId = model.ChaseId;
//if ($(obj).val() == "查看")
// window.parent.addTab("采购单", "CaiGou/CG_ChaseLookForTM.aspx?IsCheck=Edit&Title=采购入库&ChaseId=" + model.ChaseId, true);
// //window.location.href = "CG_ChaseLook.aspx?ChaseId=" + model.ChaseId;
//else
// var kw = "0";
// if ($("#txt_kwcode").val() != "")
// kw = $("#txt_kwcode").val();
window.parent.addTab("海外仓入库", "CaiGou/CG_ChaseInHouseAdd2.aspx?Title=海外仓入库&ChaseId=" + model.ChaseId, true);
// window.location = "CG_ChaseInHouseAdd.aspx?ChaseId=" + ChaseId;
}
//#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);
if (model.State > 0) {
alert("该采购单已经审批,不能删除");
return;
}
param.ChaseId = model.ChaseId;
$.ajax({
url: "CaiGouService.asmx/DeletePurchase",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("删除成功");
ReadData();
}
});
}
//#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><select id="select_wlzt" class="selectClass" style="width: 120px;" name="D5">
<option value="2">工厂生产中</option>
<option value="0">未出运</option>
<option value="3">准备出运</option>
<option value="4">海上</option>
<option value="5">海外</option>
<option value="6">部分入库</option>
</select>
</td>
<td class="f1" width="13%">货物编号:</td>
<td> <input id="txt_code" class="editTextbox" style="width: 120px;" type="text" />
</td>
<td><input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
</tr>
<tr>
<td valign="top" colspan="5">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</form>
</body>
</html>