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.
327 lines
13 KiB
Plaintext
327 lines
13 KiB
Plaintext
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GoodsNumEdit.aspx.cs" Inherits="TradeManageNew.CaiGou.GoodsNumEdit" %>
|
|
<!DOCTYPE html>
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head id="Head1" runat="server">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta http-equiv="pragma" content="no-cache" />
|
|
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
|
|
<meta http-equiv="expires" content="0" />
|
|
<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/Global2.js?t=1" 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/fancybox2.1/source/jquery.fancybox.css?v=2.1.5"
|
|
media="screen" />
|
|
<script type="text/javascript" src="../Scripts/fancybox2.1/lib/jquery.mousewheel-3.0.6.pack.js"></script>
|
|
<script type="text/javascript" src="../Scripts/fancybox2.1/source/jquery.fancybox.js?v=2.1.5"></script>
|
|
<script src="../Scripts/MaskedTextBox.js?t=1" 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 Model = null;
|
|
$(document).ready(function () {
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
WindowLoadModel.Load();
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
//var CurrentDate = new Date();
|
|
//$("#txt_StartDate").val(CurrentDate.localeFormat("yyyy-MM-01"));
|
|
//$("#txt_StopDate").val(CurrentDate.localeFormat("yyyy-MM-dd"));
|
|
|
|
$("#txtGoodsNum,#txtLockNum,#txtIsOrder,#txtInGoodsNum,#txtErrorNum,#txtBackNum,#txtBoxNum,#txtOutInNum,#txtOutNum,#txtSJOutNum,#txtTJOutNum,#txtTJOutNum2,#txtSJOutNum2").MaskedTextBox();
|
|
|
|
TableAveColWidth("MainTable");
|
|
|
|
CreateDataGrid();
|
|
ReadData();
|
|
|
|
$("#cmdAdd").click(function () {
|
|
Model = new Object();
|
|
Model.Id = 0;
|
|
ClearControlValue("MainTable"); //清空内容
|
|
//var CurrentDate = new Date();
|
|
//$("#txtInDate").val(CurrentDate.localeFormat("yyyy-MM-dd"));
|
|
ShowFancybox("MainTable");
|
|
});
|
|
|
|
$("#cmdGet").click(function () {
|
|
ReadData();
|
|
});
|
|
|
|
$("#cmdSave").click(function () {
|
|
Save();
|
|
});
|
|
|
|
$("#cmdBack").click(function () {
|
|
$.fancybox.close();
|
|
});
|
|
|
|
|
|
$("#DataGrid1 [CommandName]").live("click", function () {
|
|
var CommandName = $(this).attr("CommandName");
|
|
var index = $(this).parentsUntil("tr").parent().attr("index");
|
|
Model = datagrid1.Get_Model(index);
|
|
if (CommandName == "cmdEdit") {
|
|
//有审核时用
|
|
//if (Model.State == 1 || Model.State == 2) { $("#cmdSave").hide(); }
|
|
//else { $("#cmdSave").show(); }
|
|
//if (Model.State == 2) { $("#tr1").show(); }
|
|
//else { $("#tr1").hide(); }
|
|
CreateGetModel("MainTable", Model);
|
|
ShowFancybox("MainTable");
|
|
}
|
|
if (CommandName == "cmdDel") {
|
|
Delete(Model.Id);
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
//#region 初始化DataGrid
|
|
function CreateDataGrid() {
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "采购批次号";
|
|
col.CellTemplate = "<span>{Bind GoodsOldCode}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "货物编号";
|
|
col.CellTemplate = "<span>{Bind GoodsCode}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "货物sku";
|
|
col.CellTemplate = "<span>{Bind GoodsName}</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 = "<span>{Bind InGoodsNum}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "已经发往海外仓数据";
|
|
col.CellTemplate = "<span>{Bind OutNum}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "剩余可以挑选的数量";
|
|
col.CellTemplate = "<span>{Bind GoodsLeftNum}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "操作";
|
|
col.Width = "160px";
|
|
col.CellTemplate = "<span CommandName='cmdEdit' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>编辑</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
//datagrid1.SetPageSize(20);
|
|
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(); });
|
|
|
|
}
|
|
//#endregion
|
|
//#region 读取数据
|
|
function ReadData() {
|
|
if ($("#chk_num").is(":checked") == false) {
|
|
if ($("#txt_GoodsCode").val() == "" && $("#txt_ChaseCode").val() == "") {
|
|
alert("请输入批次号或者货物编号")
|
|
return;
|
|
}
|
|
}
|
|
var param = new Object();
|
|
param.GoodsCode = $("#txt_GoodsCode").val();
|
|
param.ChaseCode = $("#txt_ChaseCode").val();
|
|
param.Num = 1;
|
|
if ($("#chk_num").is(":checked") == false)
|
|
param.Num = 0;
|
|
$.ajax({
|
|
url: "../CaiGouServiceNew.asmx/GetListGoodsNum",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
|
|
datagrid1.DataBind(data.d);
|
|
}
|
|
});
|
|
}
|
|
//#endregion
|
|
//#region 删除
|
|
function Delete(Id) {
|
|
if (window.confirm("确定要删除吗?") == false) return;
|
|
var param = new Object();
|
|
param.Id = Id;
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "../CaiGouServiceNew.asmx/Delete_PurchaseGoods",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
if (data.d == false) { alert("已经使用过,无法删除"); return; }
|
|
ReadData(); //刷新DataGrid
|
|
}
|
|
});
|
|
}
|
|
//#endregion
|
|
//#region 保存
|
|
function Save() {
|
|
var error = CreateSaveModel("MainTable", Model);
|
|
if (error != "") { alert(error); return; }
|
|
var param = new Object();
|
|
param.Model = Model;
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "../CaiGouServiceNew.asmx/Save_PurchaseGoods",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
ReadData();
|
|
alert("保存成功");
|
|
$.fancybox.close();
|
|
}
|
|
});
|
|
}
|
|
//#endregion
|
|
//#region 显示弹出窗体
|
|
function ShowFancybox(id) {
|
|
$.fancybox({
|
|
'scrolling': 'no',
|
|
'autoScale': false,
|
|
'transitionIn': 'elastic',
|
|
'transitionOut': 'elastic',
|
|
'href': '#' + id,
|
|
'onClosed': function () {
|
|
|
|
}
|
|
}, 0);
|
|
}
|
|
//#endregion
|
|
|
|
//#region 删除
|
|
function UpdateCGStoreNum() {
|
|
|
|
var param = new Object();
|
|
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "../CaiGouServiceNew.asmx/UpdateCGStoreNum",
|
|
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
alert("ok");
|
|
|
|
}
|
|
});
|
|
}
|
|
//#endregion
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<table id="SelectHtml" border="1" cellpadding="0" cellspacing="0" align="center" style="width: 100%"
|
|
class="tableAll">
|
|
<colgroup>
|
|
<col style="width: 60px;" />
|
|
<col style="width: 240px;" />
|
|
<col style="width: 60px;" />
|
|
<col style="width: 120px;" />
|
|
<col style="width: 60px;" />
|
|
<col style="width: 120px;" />
|
|
<col style="width: 60px;" />
|
|
<col style="width: 120px;" />
|
|
<col />
|
|
</colgroup>
|
|
<tr> <td class="f1" >采购批次</td>
|
|
<td><input id='txt_ChaseCode' type='text' style='width: 99%' /></td>
|
|
<td class="f1" >货物编号</td>
|
|
<td><input id='txt_GoodsCode' type='text' style='width: 49%' /><input
|
|
id="chk_num" type="checkbox" checked="checked"/>剩余挑选>0</td>
|
|
<td><input id="cmdGet" type="button" value = "查询" /> <input id="Button1" type="button" value = "刷新在途" onclick="UpdateCGStoreNum()"/></td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td valign="top" colspan="9">
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div style="display: none;">
|
|
<div id="MainTable" title="编辑" style="width: 400px; height: auto;">
|
|
<table class="tableAll" style="width: 100%;">
|
|
<colgroup>
|
|
<col style="width: 80px;" />
|
|
<col />
|
|
</colgroup>
|
|
<tr>
|
|
<td class="f1" >采购批次</td>
|
|
<td><input id='Text1' type='text' style='width: 99%' columnname="GoodsOldCode" columndesc="采购批次" columnrequired="false" validtype="" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="f1" >货物编号</td>
|
|
<td><input id='txtGoodsCode' type='text' style='width: 99%' columnname="GoodsCode" columndesc="货物编号" columnrequired="false" validtype="" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="f1" >SKU</td>
|
|
<td><input id='Text2' type='text' style='width: 99%' columnname="GoodsName" columndesc="货物sku" columnrequired="false" validtype="" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="f1" >采购数量</td>
|
|
<td><input id='Text3' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="GoodsNum" columndesc="采购数量" columnrequired="true" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="f1" >国内入库数量</td>
|
|
<td><input id='txtGoodsNum' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="InGoodsNum" columndesc="国内入库数量" columnrequired="true" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="f1" >之前已经发到海外数量</td>
|
|
<td><input id='txtGoodsPrice' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="OutNum" columndesc="之前已经发到海外数量" columnrequired="true" /></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4" align="center">
|
|
<input id="cmdSave" type="button" value="保存" />
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|