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.

554 lines
22 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CG_ChaseHWCList.aspx.cs" Inherits="TradeManage.CaiGou.CG_ChaseHWCList" %>
<!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 UserId = '<%= Session["UserId"].ToString() %>';
var WindowLoadModel = new WindowLoad();
var DHState = 0;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
CreateDataGrid();
$("#" + datagrid1.TableID + " [CommandName='cmdLook']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
// window.location.href = "CG_ChaseLook.aspx?ChaseId=" + model.ChaseId;
//if(model.State==3)
//window.parent.addTab("采购单", "CaiGou/CG_ChaseLookForTM.aspx?Check=Edit&Title=采购入库&ChaseId=" + model.ChaseId, true);
//else
//var kw = "0";
// if ($("#txt_kwcode").val() != "")
// kw = $("#txt_kwcode").val();
window.parent.addTab("海外仓入库" + model.ChaseId.toString(), "CaiGou/CG_ChaseInHouseAdd2.aspx?Title=海外仓入库&ChaseId=" + model.ChaseId + "&KW=" + kw, true);
});
$("#" + datagrid1.TableID + " [CommandName='cmdEdit']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
// window.location.href = "CG_ChaseLook.aspx?ChaseId=" + model.ChaseId;
//if(model.State==3)
//window.parent.addTab("采购单", "CaiGou/CG_ChaseLookForTM.aspx?Check=Edit&Title=采购入库&ChaseId=" + model.ChaseId, true);
//else
//var kw = "0";
// if ($("#txt_kwcode").val() != "")
// kw = $("#txt_kwcode").val();
if (UserId == 1 || UserId == 53 || UserId == 157 || UserId == 32 || UserId == 43 || UserId == 115 || UserId == 178) {
window.parent.addTab("海外仓出运" + model.ChaseId.toString(), "CaiGou/CG_ChaseAddForTM3.aspx?Title=海外仓出运&ChaseId=" + model.ChaseId + "&StoreId=" + model.StoreId, true);
}
});
//$("#" + datagrid1.TableID + " a[cid]").live("click", function () {
//});
$("#btn_add").bind("click", function () {
window.location = "CG_ChaseAddForTM3.aspx";
});
$("#select_state").live("change", function () {
ReadData();
});
$("#btn_sch,#chk_mx,#chk_gc,#chk_bh,#chk_wr,#chk_dhyc").bind("click", function () {
ReadData();
});
$("#select_px").bind("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='cmdLook' class='linka'>{Bind ChaseCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "出运单号";
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind BuyCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "建立日期";
col.CreateFieldSpan("InDate", "yyyy-MM-dd HH:mm");
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "出运日期";
col.CreateFieldSpan("BuyDate", "yyyy-MM-dd HH:mm");
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "入库日期";
col.CreateFieldSpan("DoneDate", "yyyy-MM-dd HH:mm");
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 = "<span>{Bind TSoild}立方</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "头程费";
col.CellTemplate = "<span>{Bind TCFee5}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "出运状态";
col.CellTemplate = "<a no='revice'>{Bind ReveState}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "预计到达日期";
col.CellTemplate = "<a>{Bind BackDate,yyyy-MM-dd}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "发货仓库";
col.CellTemplate = "{Bind StoreId}";
col.CellFormatter = function (value) {
switch (value) {
case 6: return "RANCHO仓";
case 11: return "E仓east)";
}
};
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "备注";
col.Align = "left";
col.Width = "150px";
col.CellTemplate = "<div style='width:150px;word-break:break-all;' title='{Bind Remark}'>{Bind Remark}</div>"; //<a class='linka' cid='{Bind ChaseId}' einfo='{Bind ErrorInfo}'>提醒</a>
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "250px";
col.CellTemplate = "<input onclick='EditCol(this)' no='{Bind State}' gno='{Bind GoodsState}' class='btnClass dgbtnEdit' type='button' value='到货'></input>&nbsp;&nbsp;<input CommandName='cmdEdit' class='btnClass dgbtnEdit' type='button' value='编辑'></input>&nbsp;&nbsp;<input CommandName='dgbtnDel' onclick='DelCol(this);' class='btnClass dgbtnDel' type='button' value='删除'></input>";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(50);
datagrid1.SetPageIndex(1);
datagrid1.IsFixHeader = false;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = true;
datagrid1.Width = "100%";
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
//#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.ReveState == "部分入库" || model.ReveState == "全部入库") {
alert("货物有入库了,不能删除");
return;
}
param.ChaseId = model.ChaseId;
$.ajax({
url: "../CaiGouServiceNew.asmx/DeleteHWCGoods",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("已删除");
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.DHState = $("#select_wlzt").val();
param.ChaseCode = $("#txt_cgdh").val();
param.Code = $("#txt_code").val();
param.SDate = null;
if ($("#txt_SDate").val() != "")
param.SDate = $("#txt_SDate").val();
param.StoreId = $("#select_store").val();
param.EDate = null;
if ($("#txt_EDate").val() != "")
param.EDate = $("#txt_EDate").val();
param.SRKDate = null;
if ($("#txt_SRKDate").val() != "")
param.SRKDate = $("#txt_SRKDate").val();
param.ERKDate = null;
if ($("#txt_ERKDate").val() != "")
param.ERKDate = $("#txt_ERKDate").val();
param.sort = $("#select_px").val();
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
WindowLoadModel.Show();
$.ajax({
url: "../CaiGouServiceNew.asmx/GetListCG_InchaseForHWC2",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
$("a[no='revice']").each(function () {
if ($(this).html() == "全部入库") {
$(this).css("color","green");
}
if ($(this).html() == "未出运") {
$(this).css("color", "red");
}
if ($(this).html() == "准备出运") {
$(this).css("color", "#FF00FF");
}
if ($(this).html() == "出运海上") {
$(this).css("color", "#003366");
}
if ($(this).html() == "出运海外") {
$(this).css("color", "#FF9933");
}
if ($(this).html() == "部分入库") {
$(this).css("color", "blue");
}
});
}
});
}
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("海外仓入库" + model.ChaseId.toString(), "CaiGou/CG_ChaseInHouseAdd2.aspx?Title=海外仓入库&ChaseId=" + model.ChaseId, true);
// window.location = "CG_ChaseInHouseAdd.aspx?ChaseId=" + ChaseId;
}
//#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="-1">全部</option>
<option value="0">未出运</option>
<option value="3">准备出运</option>
<option value="4">海上</option>
<option value="5">海外</option>
<option value="6">部分入库</option>
<option value="7">已入库</option>
</select>
</td>
<td class="f1" style="width: 10%; height: 15px;">发往仓库:</td>
<td width="16%">
<select id="select_store" class="selectClass" style="width: 120px;" name="D6">
<option value="-1">全部</option>
<option value="6">RANCHO仓</option>
<option value="11">E仓east)</option>
</select></td>
<td class="f1">批次信息:</td>
<td>
<input id="txt_cgdh" class="editTextbox" style="width: 120px;" type="text" /></td>
<td> <input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
</tr>
<tr >
<td class="f1" width="13%">建立日期:</td>
<td colspan="3">
<input id="txt_SDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />-
<input id="txt_EDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" /></td>
<td class="f1" width="13%">入库日期:</td>
<td colspan="2">
<input id="txt_SRKDate" class="editTextbox" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" style="width: 130px;" type="text" />-
<input id="txt_ERKDate" class="editTextbox" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" style="width: 130px;" type="text" /></td>
</tr>
<tr >
<td class="f1" width="13%">排序:</td>
<td colspan="3">
<select id="select_px" class="selectClass" style="width: 180px;" name="D7">
<option value="a.PostState,a.BackDate">按入库状态排序</option>
<option value="a.InDate">按创建时间顺排</option>
<option value="a.InDate desc">按创建时间倒排</option>
<option value="a.BackDate">按预计到达时间顺排</option>
<option value="a.BackDate desc">按预计到达时间倒排</option>
<option value="a.DoneDate">按入库时间顺排</option>
<option value="a.DoneDate desc">按入库时间倒排</option>
</select></td>
<td class="f1" width="13%">货物编号:</td>
<td colspan="2">
<input id="txt_code" class="editTextbox" style="width: 120px;" type="text" /></td>
</tr>
<tr>
<td colspan="7" class="auto-style1">
<input id="btn_add" class="btnClass btnClassAdd" type="button" value="新增海运批次" />
</td>
</tr>
<tr>
<td valign="top" colspan="7">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</form>
</body>
</html>