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
15 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_CheckList.aspx.cs" Inherits="TradeManage.CaiGou.CG_CheckList" %>
<!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/DateBox.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>
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css"
media="screen" />
<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/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var WindowLoadModel = new WindowLoad();
var checkstate = -1;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
checkstate = $.url.param("checkstate");
if (checkstate == undefined) {
checkstate = -1;
}
if (checkstate == 0)
$("#select_state").val("0");
else
if (checkstate == 4) {
$("#select_state").val("2");
$("#select_hwstate").val("3");
}
CreateDataGrid();
ReadData();
$("#" + datagrid1.TableID + " [CommandName='cmdEdit']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
if (model.State == 0)
window.parent.addTab("采购单", "CaiGou/CG_ChaseLook.aspx?Title=采购单审批&IsCheck=check&ChaseId=" + model.ChaseId, true);
//window.location.href = "CG_ChaseLook.aspx?ChaseId=" + model.ChaseId + "&IsCheck=check";
else
window.parent.addTab("采购单", "CaiGou/CG_ChaseLook.aspx?Title=采购单审批&ChaseId=" + model.ChaseId, true);
//window.location.href = "CG_ChaseLook.aspx?ChaseId=" + model.ChaseId;
});
$("#cmdAdd").bind("click", function () {
var SelectListModels = datagrid1.GetSelectListModel();
if (SelectListModels == null || $(SelectListModels).length == 0) {
alert("请选择要开启或者关闭的评价");
return;
}
});
$("#chk_mx").bind("click", function () {
ReadData();
});
$("#btn_sch").bind("click", function () {
ReadData();
});
$("#btn_add").bind("click", function () {
window.location.href = "CG_ChaseAdd.aspx?ChaseId=0";
});
});
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) {
$(md.GoodsList).each(function () {
shtmls += "<table width='100%'><tr><td width='50px'></td><td><font color='blue'>购买商品:</font><span>" + this.GoodsName + " &nbsp; &nbsp;<font color='blue'>商品SKU</font>" + this.SKU1 + "</span> &nbsp; &nbsp;<font color='blue'>购买数量:</font><span>" + this.GoodsNum + "</span> &nbsp; &nbsp;<font color='blue'>到货数量:</font>" + this.InGoodsNum + "</td></tr></table>";
});
}
shtmls += "</td><tr>";
$(this).after(shtmls);
}
});
}
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='cmdEdit' class='linka'>{Bind ChaseCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "购买订单号";
col.CellTemplate = "<a>{Bind BuyCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "采购日期";
col.CreateFieldSpan("BuyDate", "yyyy-MM-dd");
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "预计到货日期";
col.CreateFieldSpan("DoneDate", "yyyy-MM-dd");
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 GoodsMoney}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "采购人";
col.CellTemplate = "<span>{Bind InName}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "审批状态";
col.CellTemplate = "<span>{Bind CheckState}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "异常备注";
col.Align = "left";
col.Width = "150px";
col.CellTemplate = "<a title='{Bind ErrorInfo}'>{Bind SimpErrorInfo}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "80px";
col.CellTemplate = "<input CommandName='cmdEdit' no='{Bind State}' class='btnClass dgbtnEdit' type='button' value='审批'></input>";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(30);
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(); });
}
//#endregion
//#region 读取数据
function ReadData() {
var param = new Object();
param.ChaseCode = $("#txt_cgdh").val();
param.BuyCode = $("#txt_gmdh").val();
param.Goods = $("#txt_cgwp").val();
param.Name = $("#txt_cgr").val();
param.SDate = null;
if ($("#txt_SDate").val() != "")
param.SDate = $("#txt_SDate").val();
param.State = $("#select_state").val();
param.DHState = $("#select_hwstate").val();
param.EDate = null;
if ($("#txt_EDate").val() != "")
param.EDate = $("#txt_EDate").val();
// if ($("#txt_Edate").val() != "")
//param.Edate = null;
param.IsDetail = 0;
if ($("#chk_mx").is(':checked') == true)
param.IsDetail = 1;
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
WindowLoadModel.Show();
$.ajax({
url: "CaiGouService.asmx/GetListCG_CheckPurchase",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
if (param.IsDetail == 1)
AddTr();
$("#" + datagrid1.TableID + " input[CommandName='cmdEdit']").each(function () {
if ($(this).attr("no") != "0")
{
$(this).val("查看");
}
});
}
});
}
//#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);
param.Id = model.Id;
$.ajax({
url: "YY_Service.asmx/DeleteFoodList",
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>
<div style="display: none">
<div id="test" title="货物图片" style="width: 600px; height: 400px;">
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
<tr>
<td colspan="2" align="center">
<img src="../attached/images/1.jpg" width="280px" height="250px" id="img_1" />
</td>
</tr>
<tr>
<td style="width: 80px;" class="f1">图片:
</td>
<td align="left">
<div id="div_img">
<img src="../attached/images/1.jpg" width="100px" height="80px" />
<img src="../attached/images/2.jpg" width="100px" height="80px" />
<img src="../attached/images/3.jpg" width="100px" height="80px" />
<img src="../attached/images/4.jpg" width="100px" height="80px" />
</div>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input
id="btn_Cancel1" type="button" class="btnClass" value="关闭" />
</td>
</tr>
</table>
</div>
</div>
<table id="tb1" class="tableAll" style="width: 100%;">
<tr>
<td class="f1" width="13%">采购单号:</td>
<td width="15%">
<input id="txt_cgdh" class="editTextbox" style="width: 120px;" type="text" /></td>
<td class="f1" width="13%">购买单号:</td>
<td width="15%">
<input id="txt_gmdh" class="editTextbox" style="width: 120px;" type="text" /></td>
<td class="f1" style="width: 10%;">采购物品:</td>
<td width="15%"><input id="txt_cgwp" 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> <select id="select_hwstate" class="selectClass" style="width: 120px" name="D2">
<option value="-1">全部</option>
<option value="0">未到货</option>
<option value="1">部分到货</option>
<option value="2">已到货</option>
<option value="3">到货异常</option>
</select>
</td>
<td class="f1" style="width: 10%; height: 15px;">审批状态:</td>
<td>
<select id="select_state" class="selectClass" style="width: 120px" name="D1">
<option value="-1">全部</option>
<option value="0">未审批</option>
<option value="2">已审批</option>
<option value="3">已结束</option>
</select></td>
<td class="f1">采购人:</td>
<td>
<input id="txt_cgr" class="editTextbox" style="width: 120px;" type="text" /></td>
<td></td>
</tr>
<tr>
<td class="f1" width="13%">采购日期:</td>
<td colspan="6">
<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" /><input id="chk_mx" type="checkbox" /><label for="chk_mx">列出采购货物明细</label></td>
</tr>
<tr>
<td valign="top" colspan="7">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</form>
</body>
</html>