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.
583 lines
22 KiB
Plaintext
583 lines
22 KiB
Plaintext
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CG_ChaseErrorList.aspx.cs" Inherits="TradeManage.CaiGou.CG_ChaseErrorList" %>
|
|
|
|
<!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 IsDone = 0;
|
|
$(document).ready(function () {
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
WindowLoadModel.Isbgiframe = true;
|
|
WindowLoadModel.Load();
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
|
ReadData();
|
|
|
|
$("#btn_tj1").bind("click", function () {
|
|
Clearcss();
|
|
IsDone = 0;
|
|
$(this).attr("class", "btnSelected");
|
|
ReadData();
|
|
});
|
|
|
|
$("#btn_tj2").bind("click", function () {
|
|
Clearcss();
|
|
IsDone = 1;
|
|
$(this).attr("class", "btnSelected");
|
|
ReadData();
|
|
});
|
|
$("#btn_tj3").bind("click", function () {
|
|
Clearcss();
|
|
IsDone = 2;
|
|
$(this).attr("class", "btnSelected");
|
|
ReadData();
|
|
});
|
|
$("#btn_tj4").bind("click", function () {
|
|
Clearcss();
|
|
IsDone = 3;
|
|
$(this).attr("class", "btnSelected");
|
|
ReadData();
|
|
});
|
|
$("#btn_sch,#select_cg").bind("click", function () {
|
|
|
|
ReadData();
|
|
});
|
|
|
|
$("#select_cljg").bind("change", function () {
|
|
$("#a_kddh").hide();
|
|
$("#txt_kddh").hide();
|
|
$("#a_kw").hide();
|
|
$("#txt_kw").hide();
|
|
if ($(this).val() == "退货")
|
|
{
|
|
$("#a_kddh").show();
|
|
$("#txt_kddh").show();
|
|
}
|
|
else if ($(this).val() == "处理完入库") {
|
|
$("#a_kw").show();
|
|
$("#txt_kw").show();
|
|
}
|
|
|
|
|
|
});
|
|
$("#" + datagrid1.TableID + " a[CommandName='cmdLook']").live("click", function () {
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
window.open("CG_ChaseAddForTM.aspx?Title=采购单&ChaseId=" + model.ChaseId);
|
|
// window.parent.addTab("新增采购", "CaiGou/CG_ChaseAddForTM.aspx?Title=采购参考&GoodsId=" + model.GoodsId + "&SupplierId=" + SupplierId + "&IsNeed=" + IsNeed + "&BuyUserId=" + BuyUserId, true);
|
|
});
|
|
$("#" + datagrid1.TableID + " a[CommandName='cmdHW']").live("click", function () {
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
window.open("../HuoWu/HW_GoodsAddForTM.aspx?GoodsId=" + model.GoodsId);
|
|
// window.parent.addTab("新增采购", "CaiGou/CG_ChaseAddForTM.aspx?Title=采购参考&GoodsId=" + model.GoodsId + "&SupplierId=" + SupplierId + "&IsNeed=" + IsNeed + "&BuyUserId=" + BuyUserId, true);
|
|
});
|
|
});
|
|
function Clearcss() {
|
|
|
|
$("#btn_tj1,#btn_tj2,#btn_tj3,#btn_tj4").attr("class", "btnUnSelected");
|
|
|
|
}
|
|
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='cmdHW' class='linka'>{Bind GoodsOldCode}</a>";
|
|
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 = "供应商";
|
|
col.CellTemplate = "<span>{Bind SupplierName}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "描述";
|
|
col.CellTemplate = "<a class='ms'>{Bind TypeDesc}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "异常";
|
|
col.CellTemplate = "<span style='color:red'>{Bind ErrorDesc}</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 = "<a>{Bind IsCGState}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "处理结果";
|
|
col.CellTemplate = "<a style='color:red'>{Bind DoResult}</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("DoDate", "yyyy-MM-dd HH:mm");
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "单号";
|
|
col.CellTemplate = "<a>{Bind PostCode}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "原库位";
|
|
col.CellTemplate = "<a>{Bind PostionDesc}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "采购人";
|
|
|
|
col.CreateFieldSpan("BuyName");
|
|
Array.add(datagrid1.Columns, col);
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "操作";
|
|
col.Width = "80px";
|
|
col.CellTemplate = "<input onclick='Del(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.CheckBox;
|
|
datagrid1.Init();
|
|
datagrid1.add_PageIndexChanged(function () { ReadData(); });
|
|
|
|
}
|
|
|
|
function InCol(obj) {
|
|
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;
|
|
|
|
$.ajax({
|
|
url: "CaiGouService.asmx/ChaseInStoreNew",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
dataType: "json",
|
|
success: function (data) {
|
|
if (data.d == 1)
|
|
{
|
|
alert("该采购单已经由入库记录,不能直接入库,可以点击入库");
|
|
}
|
|
else
|
|
alert("入库成功");
|
|
ReadData();
|
|
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
function ToCG() {
|
|
|
|
var list = datagrid1.GetSelectListModel();
|
|
if (list == null || list.length== 0)
|
|
{
|
|
alert("请选择要标记的数据");
|
|
return;
|
|
}
|
|
|
|
var param = new Object();
|
|
|
|
param.list = list;
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "CaiGouService.asmx/UpdateErrorToCG",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
dataType: "json",
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
alert("标记成功");
|
|
ReadData();
|
|
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
function DoneResult() {
|
|
|
|
var list = datagrid1.GetSelectListModel();
|
|
if (list == null || list.length==0) {
|
|
alert("请选择要处理的数据");
|
|
return;
|
|
}
|
|
if ($("#txt_sl").val() == "" || $("#txt_sl").val() == "0")
|
|
{
|
|
alert("请填写数量");
|
|
return;
|
|
|
|
}
|
|
var Num = $("#txt_sl").val();
|
|
var error = "";
|
|
$(list).each(function () {
|
|
if (Num > this.GoodsNum)
|
|
{
|
|
error += this.GoodsOldCode+"处理数量大于了异常数量;";
|
|
}
|
|
|
|
});
|
|
if (error != "")
|
|
{
|
|
|
|
alert(error);
|
|
return;
|
|
}
|
|
|
|
if ($("#select_cljg").val() == "退货" && $("#txt_kddh").val() == "") {
|
|
|
|
alert("退货请填写快递单号");
|
|
return;
|
|
}
|
|
else if ($("#select_cljg").val() == "处理完入库" && $("#txt_kw").val() == "") {
|
|
|
|
alert("请填写入库库位");
|
|
return;
|
|
}
|
|
var param = new Object();
|
|
param.DoResult = $("#select_cljg").val();
|
|
param.Num = Num;
|
|
param.list = list;
|
|
if($("#select_cljg").val() == "退货")
|
|
param.PostCode = $("#txt_kddh").val();
|
|
else
|
|
param.PostCode = "";
|
|
if ($("#select_cljg").val() == "处理完入库")
|
|
param.PostionCode = $("#txt_kw").val();
|
|
else
|
|
param.PostionCode = "";
|
|
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "CaiGouService.asmx/DoneError",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
dataType: "json",
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
alert(data.d);
|
|
if(data.d=="成功")
|
|
ReadData();
|
|
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
//#endregion
|
|
//#region 读取数据
|
|
function ReadData() {
|
|
|
|
var param = new Object();
|
|
|
|
|
|
param.IsDone = IsDone;
|
|
param.TjType = $("#select_tj").val();
|
|
param.Name = $("#txt_name").val();
|
|
param.ISCG = $("#select_cg").val();
|
|
param.Error = $("#select_error").val();
|
|
param.SDate = null;
|
|
if ($("#txt_SDate").val() != "")
|
|
param.SDate = $("#txt_SDate").val();
|
|
param.State = $("#select_state").val();
|
|
|
|
param.EDate = null;
|
|
if ($("#txt_EDate").val() != "")
|
|
param.EDate = $("#txt_EDate").val();
|
|
|
|
param.SDoDate = null;
|
|
if ($("#txt_SDoDate").val() != "")
|
|
param.SDoDate = $("#txt_SDoDate").val();
|
|
param.EDoDate = null;
|
|
if ($("#txt_EDoDate").val() != "")
|
|
param.EDoDate = $("#txt_EDoDate").val();
|
|
param.Hours = 0;
|
|
if ($("#txt_hour").val()!="")
|
|
param.Hours = $("#txt_hour").val();
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "CaiGouService.asmx/GetListCG_Error",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
datagrid1.DataBind(data.d.DataSource);
|
|
$(".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 ExcelData() {
|
|
|
|
var param = new Object();
|
|
|
|
|
|
param.IsDone = IsDone;
|
|
param.TjType = $("#select_tj").val();
|
|
param.Name = $("#txt_name").val();
|
|
param.ISCG = $("#select_cg").val();
|
|
param.Error = $("#select_error").val();
|
|
param.SDate = null;
|
|
if ($("#txt_SDate").val() != "")
|
|
param.SDate = $("#txt_SDate").val();
|
|
param.State = $("#select_state").val();
|
|
|
|
param.EDate = null;
|
|
if ($("#txt_EDate").val() != "")
|
|
param.EDate = $("#txt_EDate").val();
|
|
|
|
param.SDoDate = null;
|
|
if ($("#txt_SDoDate").val() != "")
|
|
param.SDoDate = $("#txt_SDoDate").val();
|
|
param.EDoDate = null;
|
|
if ($("#txt_EDoDate").val() != "")
|
|
param.EDoDate = $("#txt_EDoDate").val();
|
|
param.Hours = 0;
|
|
if ($("#txt_hour").val() != "")
|
|
param.Hours = $("#txt_hour").val();
|
|
var fname = "采购入库异常.xls";
|
|
$.ajax({
|
|
url: "CaiGouService.asmx/GetListCG_Error2",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
params = { FilePath: data.d, FileName: fname };
|
|
|
|
window.location = "../GlobalAshx/DownFile.ashx?" + jQuery.param(params);
|
|
}
|
|
});
|
|
|
|
|
|
|
|
}
|
|
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_ChaseLook.aspx?IsCheck=Edit&Title=采购入库&ChaseId=" + model.ChaseId, true);
|
|
//window.location.href = "CG_ChaseLook.aspx?ChaseId=" + model.ChaseId;
|
|
else
|
|
window.parent.addTab("采购单入库", "CaiGou/CG_ChaseInHouseAddForTM.aspx?Title=采购入库&ChaseId=" + model.ChaseId, true);
|
|
// window.location = "CG_ChaseInHouseAdd.aspx?ChaseId=" + ChaseId;
|
|
|
|
|
|
}
|
|
|
|
//#endregion
|
|
//#region 删除
|
|
function Del(obj) {
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
var rowindex = $(obj).parent().parent().attr("index");
|
|
var param = new Object();
|
|
var model = datagrid1.Get_Model(rowindex);
|
|
|
|
param.Id = model.Id;
|
|
|
|
$.ajax({
|
|
url: "CaiGouService.asmx/DeletechaseError",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
dataType: "json",
|
|
success: function (data) {
|
|
alert("删除成功");
|
|
ReadData();
|
|
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
//#endregion
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
<body class="headbody">
|
|
|
|
<div class="title_ico">
|
|
入库异常
|
|
</div>
|
|
<div style="display: none">
|
|
|
|
</div>
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td colspan="7">
|
|
<input id="btn_tj1" type="button" value="未处理或处理不了" class="btnSelected"/> <input id="btn_tj2" class="btnUnSelected" type="button" value="退货或者报废" /> <input id="btn_tj3" class="btnUnSelected" type="button" value="处理完入库" /> <input id="btn_tj4" class="btnUnSelected" type="button" value="全部" /> </td>
|
|
|
|
</tr>
|
|
|
|
|
|
<tr id="tr1">
|
|
|
|
<td class="f1" width="13%"> <select id="select_tj" class="selectClass" style="width: 100px" name="D3">
|
|
|
|
<option value="1">批次号</option>
|
|
<option value="2">货物信息</option>
|
|
<option value="3">采购人</option>
|
|
<option value="4">供应商</option>
|
|
<option value="5">购买单号</option>
|
|
</select></td>
|
|
<td width="15%">
|
|
<input id="txt_name" class="editTextbox" style="width: 120px;" type="text" /></td>
|
|
|
|
<td class="f1" width="13%">异常信息:</td>
|
|
<td width="15%">
|
|
<select id="select_error" class="selectClass" style="width: 100px" name="D5">
|
|
<option value="0">全部</option>
|
|
<option value="污渍">污渍</option>
|
|
<option value="破损">破损</option>
|
|
<option value="颜色不对">颜色不对</option>
|
|
<option value="尺码不对">尺码不对</option>
|
|
<option value="质量问题">质量问题</option>
|
|
|
|
</select></td>
|
|
<td class="f1" style="width: 10%;"> </td>
|
|
<td width="15%"> <input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
|
|
|
|
<td>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr id="tr2">
|
|
|
|
<td class="f1" width="13%">是否给采购:</td>
|
|
<td> <select id="select_cg" class="selectClass" style="width: 100px" name="D4">
|
|
<option value="-1">全部</option>
|
|
<option value="0">否</option>
|
|
<option value="1">是</option>
|
|
|
|
</select></td> <td class="f1" width="13%">未处理时间超过:</td>
|
|
<td> <input id="txt_hour" class="editTextbox" style="width: 50px;" type="text" />小时</td>
|
|
<td colspan="3"> </td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr id="tr3">
|
|
|
|
<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_SDoDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />-
|
|
<input id="txt_EDoDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" /></td>
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td colspan="7">
|
|
<input id="cmdCG" class="btnClass btnClassEdit" type="button" value="标记给采购" onclick="ToCG();" /> 处理结果:<select id="select_cljg" class="selectClass" style="width: 100px" name="D6">
|
|
|
|
<option value="处理不了">处理不了</option>
|
|
<option value="退货">退货</option>
|
|
<option value="报废">报废</option>
|
|
<option value="处理完入库">处理完入库</option>
|
|
</select>数量:<input id="txt_sl" class="editTextbox" style="width: 50px;" type="text" /><a id="a_kw" style="display:none">库位:</a><a id="a_kddh" style="display:none">快递单号:</a><input id="txt_kw" class="editTextbox" style="width: 100px;display:none" type="text" /> <a id="a_kddh" style="display:none">快递单号:</a><input id="txt_kddh" class="editTextbox" style="width: 100px;display:none" type="text" /><input id="cmdDo" class="btnClass btnClassEdit" type="button" value="提交处理结果" onclick="DoneResult();" /> <input id="cmdExcel" class="btnClass btnClassExcelTemplate" type="button" value="导出Excel" onclick="ExcelData();" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top" colspan="7">
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</body>
|
|
</html>
|