|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CG_ChaseInHouseEdit.aspx.cs" Inherits="TradeManage.CaiGou.CG_ChaseInHouseEdit" %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head id="Head1">
|
|
|
|
|
<title>采购单入库</title>
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
|
|
|
|
|
<link href="../themes/default/easyui.css" rel="stylesheet" type="text/css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/uploadify.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/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>
|
|
|
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css"
|
|
|
|
|
media="screen" />
|
|
|
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
|
|
<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/Global.js" type="text/javascript"></script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
|
|
var datagrid2 = new nblf.ui.DataGrid("DataGrid2");
|
|
|
|
|
var datagrid3 = new nblf.ui.DataGrid("DataGrid3");
|
|
|
|
|
var ChaseId = 0;
|
|
|
|
|
var DetailId = 0;
|
|
|
|
|
var ErrorId = -1;
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
ajaxInit(null);
|
|
|
|
|
ChaseId = $.url.param("ChaseId");
|
|
|
|
|
if (ChaseId == undefined) {
|
|
|
|
|
ChaseId = 0;
|
|
|
|
|
}
|
|
|
|
|
GetStore();
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
CreateDataGrid2();
|
|
|
|
|
CreateDataGrid3();
|
|
|
|
|
$("#" + datagrid1.TableID + " input[CommandName='cmdSet']").live("click", function () {
|
|
|
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
DetailId = model.DetailId;
|
|
|
|
|
$("#a_goodsname").html(model.GoodsName);
|
|
|
|
|
YCGoodslist = model.ErrorList;
|
|
|
|
|
if (YCGoodslist == null)
|
|
|
|
|
YCGoodslist = new Array();
|
|
|
|
|
fopen();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#btn_Save").bind("click", function () {
|
|
|
|
|
AddBuy();
|
|
|
|
|
});
|
|
|
|
|
$("#select_ycyy").bind("change", function () {
|
|
|
|
|
$("#txtErrorRemrk").val("");
|
|
|
|
|
$("#txt_ycnum").val("");
|
|
|
|
|
});
|
|
|
|
|
$("#txt_ycnum").MaskedTextBox();
|
|
|
|
|
$("#btn_Cancel").bind("click", $.fancybox.close);
|
|
|
|
|
$("#cmdSavekddh").bind("click", function () {
|
|
|
|
|
|
|
|
|
|
AddPostCode();
|
|
|
|
|
});
|
|
|
|
|
if (ChaseId > 0) {
|
|
|
|
|
GetChaseModel();
|
|
|
|
|
ReadGoods();
|
|
|
|
|
GetPost();
|
|
|
|
|
}
|
|
|
|
|
GetYCYY();
|
|
|
|
|
$("#txt_ycnum").MaskedTextBox();
|
|
|
|
|
|
|
|
|
|
$("#chk_error").bind("click", function () {
|
|
|
|
|
if ($(this).is(":checked") == true)
|
|
|
|
|
{
|
|
|
|
|
var error = "";
|
|
|
|
|
$(GoodsList).each(function () {
|
|
|
|
|
if (this.Error != null && this.Error!="")
|
|
|
|
|
error += this.TypeDesc + ":【" + this.Error + "】;";
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
$("#txtErrorInfo").val(error);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
$("#txtErrorInfo").val("");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("input[storeid]").live("keyup", function () {
|
|
|
|
|
var num = 0;
|
|
|
|
|
var num1 = $("#txt_oldGoodsNum").html();
|
|
|
|
|
$("input[storeid]").each(function () {
|
|
|
|
|
if ($(this).val() != "")
|
|
|
|
|
num += $(this).val();
|
|
|
|
|
});
|
|
|
|
|
if (parseInt(num) > parseInt(num1)) {
|
|
|
|
|
|
|
|
|
|
alert("入库数量不能大于原来的异常数量");
|
|
|
|
|
$(this).val("");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
$("#txt_GoodsNum").html(num1 - num);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function SetSH()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var SelectListModels = datagrid1.GetSelectListModel();
|
|
|
|
|
|
|
|
|
|
if (SelectListModels == null || $(SelectListModels).length<= 0) {
|
|
|
|
|
alert("请选择要正常到货的货物");
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(SelectListModels).each(function () {
|
|
|
|
|
var detailids = this.DetailId;
|
|
|
|
|
if (StoreList == null || StoreList.length==0)
|
|
|
|
|
$("input[no='" + detailids + "']").val(this.GoodsNum);
|
|
|
|
|
else
|
|
|
|
|
$("input[no='" + detailids + "'][sid='" + $("#select_ck").val() + "']").val(this.GoodsNum);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function AddYc()
|
|
|
|
|
{
|
|
|
|
|
if($("#txt_ycnum").val()=="")
|
|
|
|
|
{
|
|
|
|
|
alert("请输入异常货物数量");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ErrorId<0) {
|
|
|
|
|
var md = new Object();
|
|
|
|
|
md.ErrorDesc = $("#select_ycyy").val();
|
|
|
|
|
md.Remark = $("#txtErrorRemrk").val();
|
|
|
|
|
md.GoodsNum = $("#txt_ycnum").val();
|
|
|
|
|
md.StoreId = 0;
|
|
|
|
|
md.GoodsDetailId = DetailId;
|
|
|
|
|
md.State = 2;
|
|
|
|
|
Array.add(YCGoodslist, md);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
YCGoodslist[ErrorId].ErrorDesc = $("#select_ycyy").val();
|
|
|
|
|
YCGoodslist[ErrorId].Remark = $("#txtErrorRemrk").val();
|
|
|
|
|
YCGoodslist[ErrorId].GoodsNum = $("#txt_ycnum").val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
datagrid2.DataBind(YCGoodslist);
|
|
|
|
|
QXYC();
|
|
|
|
|
}
|
|
|
|
|
function AddInStore() {
|
|
|
|
|
|
|
|
|
|
var error = "";
|
|
|
|
|
|
|
|
|
|
$(YCGoodslist).each(function () {
|
|
|
|
|
if (this.Remark != null && this.Remark!="")
|
|
|
|
|
error += this.ErrorDesc + ":" + this.GoodsNum + "个,备注:" + this.Remark + ";";
|
|
|
|
|
else
|
|
|
|
|
error += this.ErrorDesc + ":" + this.GoodsNum + "个;";
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
if (GoodsList != null)
|
|
|
|
|
{
|
|
|
|
|
$(GoodsList).each(function () {
|
|
|
|
|
if (this.DetailId == DetailId)
|
|
|
|
|
{
|
|
|
|
|
this.Error = error;
|
|
|
|
|
this.ErrorList = YCGoodslist;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$("a[ano='" + DetailId + "']").html(error);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.fancybox.close();
|
|
|
|
|
}
|
|
|
|
|
function QXYC()
|
|
|
|
|
{
|
|
|
|
|
ErrorId =-1;
|
|
|
|
|
|
|
|
|
|
$("#txtErrorRemrk").val("");
|
|
|
|
|
$("#txt_ycnum").val("");
|
|
|
|
|
$("#btn_qx").hide();
|
|
|
|
|
$("#btn_tj").val("添加");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
var Errorlist = new Array();
|
|
|
|
|
function GetCGInStore() {
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.ChaseId = ChaseId;
|
|
|
|
|
param.State = 1;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "CaiGouService.asmx/GetChaseInStoreList",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$(data.d).each(function () {
|
|
|
|
|
var id = this.Id;
|
|
|
|
|
var did = this.GoodsDetailId;
|
|
|
|
|
var Num = this.GoodsNum;
|
|
|
|
|
|
|
|
|
|
var sid = this.StoreId;
|
|
|
|
|
$("a[no]").each(function () {
|
|
|
|
|
if ($(this).attr("no") == did && $(this).attr("sid") == sid) {
|
|
|
|
|
$(this).html(Num);
|
|
|
|
|
$(this).attr("did", id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var YCGoodslist = new Array();
|
|
|
|
|
function fopen() {
|
|
|
|
|
|
|
|
|
|
$.fancybox({
|
|
|
|
|
'width': '40%',
|
|
|
|
|
'height': '40%',
|
|
|
|
|
'autoScale': false,
|
|
|
|
|
'transitionIn': 'elastic',
|
|
|
|
|
'transitionOut': 'elastic',
|
|
|
|
|
'href': '#test',
|
|
|
|
|
'onComplete': function () {
|
|
|
|
|
//if (YCGoodslist == null || YCGoodslist.length == 0) {
|
|
|
|
|
// $(Errorlist).each(function () {
|
|
|
|
|
// var id = this.GoodsDetailId;
|
|
|
|
|
// if (id == this.DetailId) {
|
|
|
|
|
|
|
|
|
|
// Array.add(YCGoodslist, this);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
//}
|
|
|
|
|
datagrid2.DataBind(YCGoodslist);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function GetYCYY() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.CompanyID = 0;
|
|
|
|
|
param.KeyName = "rkyc";
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../UserService.asmx/GetPlatBaseCode",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$(data.d).each(function () {
|
|
|
|
|
$("#select_ycyy").append("<option value='" + this.Name + "'>" + this.Name + "</option>");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function GetChaseModel() {
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.ChaseId = ChaseId;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "CaiGouService.asmx/GetPurchaseModel",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$("#txtChaseCode").html(data.d.ChaseCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#txtRemark").html(data.d.Remark);
|
|
|
|
|
$("#txtErrorInfo").val(data.d.ErrorInfo);
|
|
|
|
|
if (data.d.BuyDate!=null)
|
|
|
|
|
$("#txtBuyDate").html(data.d.BuyDate.localeFormat("yyyy-MM-dd HH:mm"));
|
|
|
|
|
if (data.d.DoneDate != null)
|
|
|
|
|
$("#txtDoneDate").html(data.d.DoneDate.localeFormat("yyyy-MM-dd HH:mm"));
|
|
|
|
|
$("#txtSupplier").html(data.d.Supplier);
|
|
|
|
|
|
|
|
|
|
$("#txtSupplierPhone").html(data.d.SupplierPhone);
|
|
|
|
|
$("#txtInName").html(data.d.InName);
|
|
|
|
|
|
|
|
|
|
$("#txtAccount").html(data.d.Account);
|
|
|
|
|
$("#txtGoodsNum").html(data.d.GoodsNum);
|
|
|
|
|
$("#txtGoodsMoney").html(data.d.GoodsMoney);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var GoodsList=null;
|
|
|
|
|
function ReadGoods() {
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.ChaseId = ChaseId;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "CaiGouService.asmx/GetPurchaseInGoodsList",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
GoodsList = data.d;
|
|
|
|
|
datagrid1.DataBind(data.d);
|
|
|
|
|
GetCGInStore();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var StoreList = new Array();
|
|
|
|
|
function GetStore() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../CangKu/CangKuServer.asmx/GetUseStoreHouse",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
StoreList = data.d;
|
|
|
|
|
var shtml = new Sys.StringBuilder();
|
|
|
|
|
shtml.append("<table width='100%'>");
|
|
|
|
|
$(StoreList).each(function () {
|
|
|
|
|
shtml.append("<tr><td width='15%' class='f1'>" + this.StoreName + ":</td><td> <input storeid='"+this.StoreId+"' type='text' min='0' max='10000000' precision='0' style='width:80px;' class='editTextbox' value=''/></td></tr>")
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
shtml.append("</table>");
|
|
|
|
|
$("#div_rk").html(shtml.toString());
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$("#div_rk").html("<input storeid='0' type='text' min='0' max='10000000' precision='0' style='width:80px;' class='editTextbox' value=''/>");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function GetPost() {
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.ChaseId = ChaseId;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "CaiGouService.asmx/GetchasePostList",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
|
|
|
|
|
datagrid3.DataBind(data.d);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#region 初始化DataGrid
|
|
|
|
|
function CreateDataGrid() {
|
|
|
|
|
var 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 = "<a>{Bind GoodsName}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "型号";
|
|
|
|
|
|
|
|
|
|
col.CellTemplate = "<a>{Bind TypeCode}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "SKU";
|
|
|
|
|
|
|
|
|
|
col.CellTemplate = "<a>{Bind SKU1}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "描述";
|
|
|
|
|
col.CreateFieldSpan("TypeDesc", "");
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "采购数量";
|
|
|
|
|
col.CreateFieldSpan("GoodsNum", "");
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StoreList == null || StoreList.length == 0) {
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "入库数量";
|
|
|
|
|
// col.Width = "100px";
|
|
|
|
|
col.CellTemplate = "<a did='0' sid='0' no='{Bind DetailId}' /></a>";
|
|
|
|
|
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$(StoreList).each(function () {
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = this.StoreName+"入库数量";
|
|
|
|
|
// col.Width = "100px";
|
|
|
|
|
col.CellTemplate = "<a did='0' sid='" + this.StoreId + "' no='{Bind DetailId}' /></a>";
|
|
|
|
|
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "到货异常";
|
|
|
|
|
// col.Width = "100px";
|
|
|
|
|
col.Align = "left";
|
|
|
|
|
col.CellTemplate = "<a ano='{Bind DetailId}'>{Bind Error}</a>";
|
|
|
|
|
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "操作";
|
|
|
|
|
col.Width = "70px";
|
|
|
|
|
col.CellTemplate = "<input CommandName='cmdSet' class='btnClass dgbtnEdit' type='button' value='处理异常'></input>";
|
|
|
|
|
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
|
|
datagrid1.ShowIndexColumn = false;
|
|
|
|
|
datagrid1.AllowPaging = false;
|
|
|
|
|
//datagrid1.Height = "260px";
|
|
|
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.None;
|
|
|
|
|
datagrid1.Init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CreateDataGrid2() {
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "异常原因";
|
|
|
|
|
|
|
|
|
|
col.CellTemplate = "<span>{Bind ErrorDesc}<span>";
|
|
|
|
|
Array.add(datagrid2.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "异常数量";
|
|
|
|
|
|
|
|
|
|
col.CellTemplate = "<span>{Bind GoodsNum}<span>";
|
|
|
|
|
Array.add(datagrid2.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "备注";
|
|
|
|
|
col.Width = "180px";
|
|
|
|
|
col.CellTemplate = "<span>{Bind Remark}<span>";
|
|
|
|
|
Array.add(datagrid2.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "操作";
|
|
|
|
|
col.Width = "80px";
|
|
|
|
|
col.CellTemplate = "<input onclick='EditError(this)' class='btnClass dgbtnEdit' type='button' value='编辑'></input>";
|
|
|
|
|
Array.add(datagrid2.Columns, col);
|
|
|
|
|
|
|
|
|
|
datagrid2.IsFixHeader = false;
|
|
|
|
|
datagrid2.ShowIndexColumn = false;
|
|
|
|
|
datagrid2.AllowPaging = false;
|
|
|
|
|
//datagrid1.Height = "260px";
|
|
|
|
|
datagrid2.SelectMode = nblf.ui.SelectMode.None;
|
|
|
|
|
datagrid2.Init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function DelError(obj) {
|
|
|
|
|
|
|
|
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
|
|
|
|
|
|
|
|
var rowindex = $(obj).parent().parent().attr("index");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
var model = datagrid2.Get_Model(rowindex);
|
|
|
|
|
param.Id = model.Id;
|
|
|
|
|
if (model.Id > 0) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "CaiGouService.asmx/DeleteChaseInStore",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
alert("删除成功");
|
|
|
|
|
datagrid2.Del_Row(rowindex);
|
|
|
|
|
|
|
|
|
|
DeleteError();
|
|
|
|
|
}
|
|
|
|
|
function DeleteError() {
|
|
|
|
|
|
|
|
|
|
var error = "";
|
|
|
|
|
$(YCGoodslist).each(function () {
|
|
|
|
|
error += this.ErrorDesc + ":" + this.GoodsNum + "个;";
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
if (GoodsList != null) {
|
|
|
|
|
$(GoodsList).each(function () {
|
|
|
|
|
if (this.DetailId == DetailId) {
|
|
|
|
|
this.Error = error;
|
|
|
|
|
this.ErrorList = YCGoodslist;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
datagrid1.DataBind(GoodsList);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function EditError(obj) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rowindex = $(obj).parent().parent().attr("index");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
var model = datagrid2.Get_Model(rowindex);
|
|
|
|
|
ErrorId = rowindex;
|
|
|
|
|
$("#txtErrorDesc").val(model.ErrorDesc);
|
|
|
|
|
$("#txtErrorRemrk").html(model.Remark);
|
|
|
|
|
$("#txt_GoodsNum,#txt_oldGoodsNum").html(model.GoodsNum);
|
|
|
|
|
$("input[storeid]").val("");
|
|
|
|
|
}
|
|
|
|
|
function CreateDataGrid3() {
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "快递公司";
|
|
|
|
|
|
|
|
|
|
col.CellTemplate = "<span>{Bind PostName}<span>";
|
|
|
|
|
Array.add(datagrid3.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "快递单号";
|
|
|
|
|
|
|
|
|
|
col.CellTemplate = "<span>{Bind PostCode}<span>";
|
|
|
|
|
Array.add(datagrid3.Columns, col);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
datagrid3.IsFixHeader = false;
|
|
|
|
|
datagrid3.ShowIndexColumn = false;
|
|
|
|
|
datagrid3.AllowPaging = false;
|
|
|
|
|
//datagrid1.Height = "260px";
|
|
|
|
|
datagrid3.SelectMode = nblf.ui.SelectMode.None;
|
|
|
|
|
datagrid3.Init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function save(State) {
|
|
|
|
|
if (State == 3) {
|
|
|
|
|
if (window.confirm('确定要结束采购单吗,结束后将无法修改该单子?') == false) return;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var list = new Array();
|
|
|
|
|
|
|
|
|
|
$(GoodsList).each(function () {
|
|
|
|
|
if (this.ErrorList != null) {
|
|
|
|
|
$(this.ErrorList).each(function () {
|
|
|
|
|
Array.add(list, this);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
|
$("input[no]").each(function () {
|
|
|
|
|
|
|
|
|
|
if ($(this).val() != "" && $(this).val()>0) {
|
|
|
|
|
var md = new Object();
|
|
|
|
|
md.Id = $(this).attr("did");
|
|
|
|
|
md.ErrorDesc = "";
|
|
|
|
|
md.Remark = "";
|
|
|
|
|
md.GoodsNum = $(this).val();
|
|
|
|
|
md.GoodsDetailId = $(this).attr("no");
|
|
|
|
|
md.StoreId = $(this).attr("sid");
|
|
|
|
|
md.State =1;
|
|
|
|
|
Array.add(list, md);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
param.ChaseId = ChaseId;
|
|
|
|
|
|
|
|
|
|
param.ErrorInfo = $("#txtErrorInfo").val();
|
|
|
|
|
param.State = State;
|
|
|
|
|
|
|
|
|
|
param.list = list;
|
|
|
|
|
param.list1 = GoodsList;
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
contentType: "application/json",
|
|
|
|
|
url: "CaiGouService.asmx/SaveChaseInStore",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
cache: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
|
|
|
|
alert("提交成功");
|
|
|
|
|
window.location.href = "CG_Chase.aspx";
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status) {
|
|
|
|
|
if (status != "success") alert(xhr.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body class="headbody">
|
|
|
|
|
<div style="display: none">
|
|
|
|
|
<div id="test" title="异常到货" style="width:550px; height:400px;">
|
|
|
|
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="left" colspan="5">
|
|
|
|
|
<div id="DataGrid2"></div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 80px;" class="f1">
|
|
|
|
|
货物:
|
|
|
|
|
</td>
|
|
|
|
|
<td align="left" colspan="4">
|
|
|
|
|
<a id="a_goodsname"></a>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 80px;" class="f1">
|
|
|
|
|
异常原因:
|
|
|
|
|
</td>
|
|
|
|
|
<td align="left" colspan="4">
|
|
|
|
|
<a id="txtErrorDesc"></a>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 80px;" class="f1">
|
|
|
|
|
备注:
|
|
|
|
|
</td>
|
|
|
|
|
<td align="left" colspan="4">
|
|
|
|
|
<div id="txtErrorRemrk" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 80px;" class="f1">
|
|
|
|
|
异常货物数量:
|
|
|
|
|
</td>
|
|
|
|
|
<td align="left" colspan="4">
|
|
|
|
|
<a id="txt_oldGoodsNum" style="display:none"></a>
|
|
|
|
|
<a id="txt_GoodsNum"></a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 80px;" class="f1">
|
|
|
|
|
入库数量:
|
|
|
|
|
</td>
|
|
|
|
|
<td align="left" colspan="4">
|
|
|
|
|
<div id="div_rk">
|
|
|
|
|
<table width="100%"><tr><td width="15%" class="f1">仓库1:</td><td> <input type='text' min='0' max='10000000' precision='0' style='width:80px;' class='editTextbox' value=''/></td></tr><tr><td width="15%" class="f1">仓库1:</td><td><input type='text' min='0' max='10000000' precision='0' style='width:80px;' class='editTextbox' value=''/></td></tr></table>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="center" colspan="5">
|
|
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="保 存" onclick="AddInStore();" /> <input
|
|
|
|
|
id="btn_Cancel" type="button" class="btnClass btnClassBack" value="取 消" //>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="title_ico">
|
|
|
|
|
采购单入库</div>
|
|
|
|
|
|
|
|
|
|
<table border="1" cellpadding="0" cellspacing="0" style="width:99%;" align="center" class="tableAll">
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
<td colspan="4" align="center" style="font-size:18pt;font-weight:bolder">
|
|
|
|
|
采购货物入库</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width:120px" class="f1">
|
|
|
|
|
采购单号:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a id="txtChaseCode"></a>
|
|
|
|
|
</td> <td style="width:120px" class="f1">
|
|
|
|
|
采购日期:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a id="txtBuyDate"></a></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width:120px" class="f1">
|
|
|
|
|
采购人:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a id="txtInName"></a></td> <td style="width:120px" class="f1">
|
|
|
|
|
购买账号:
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td><a id="txtAccount"></a></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width:120px" class="f1">
|
|
|
|
|
供应商:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a id="txtSupplier"></a> </td> <td style="width:120px" class="f1">
|
|
|
|
|
联系方式:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a id="txtSupplierPhone"></a></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width:120px" class="f1">
|
|
|
|
|
采购总数量</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a id="txtGoodsNum"></a></td> <td style="width:120px" class="f1">
|
|
|
|
|
采购总金额</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a id="txtGoodsMoney"></a></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 120px" class="f1">快递单号:</td>
|
|
|
|
|
<td colspan="3" align="left">
|
|
|
|
|
|
|
|
|
|
<div id="DataGrid3" class="DataGridStyle" style="width: 300px; margin-left: 0px"></div>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width:120px" class="f1">
|
|
|
|
|
采购货物:</td>
|
|
|
|
|
<td colspan="3">
|
|
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width:120px" class="f1">
|
|
|
|
|
备注信息:</td>
|
|
|
|
|
<td colspan="3">
|
|
|
|
|
<div id="txtRemark"></div></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width:120px" class="f1">
|
|
|
|
|
异常信息:<br />
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="3">
|
|
|
|
|
<textarea id="txtErrorInfo" cols="100" rows="4" style="width:90%"></textarea></td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="4" align="center">
|
|
|
|
|
<input id="cmdSave" type="button" value="提 交" class="btnClass btnClassSave" onclick="save(0);" /> <input id="cmdSave2" type="button" value="结束采购单" class="btnClass btnClassSave" onclick="save(3);" />
|
|
|
|
|
<input id="cmdBack" type="button" value="返 回" class="btnClass btnClassBack" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|