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.
358 lines
15 KiB
Plaintext
358 lines
15 KiB
Plaintext
2 months ago
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_GoodsAppplyList.aspx.cs" Inherits="TradeManageNew.CangKu.HW_GoodsAppplyList" %>
|
||
|
|
||
|
<!DOCTYPE html>
|
||
|
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head id="Head1" runat="server">
|
||
|
<link rel="stylesheet" type="text/css" href="../css2/icon.css">
|
||
|
<link rel="stylesheet" type="text/css" href="../css2/DataGrid.css" />
|
||
|
<link href="../css2/gray/easyui.css" rel="stylesheet" type="text/css" />
|
||
|
<link rel="stylesheet" href="../font-awesome/css/font-awesome.min.css" />
|
||
|
<link href="../css2/New.css?a=1" rel="stylesheet" type="text/css" />
|
||
|
<link rel="stylesheet" type="text/css" href="../themes/uploadify.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.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/Global2.js?t=1" type="text/javascript"></script>
|
||
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
||
|
<script src="../Scripts/My97DatePicker/WdatePicker.js?t=1"></script>
|
||
|
<link href="../Scripts/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" />
|
||
|
<script src="../Scripts/fancybox/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
|
||
|
<script src="../Scripts/MaskedTextBox.js?t=1" 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"));
|
||
|
|
||
|
|
||
|
TableAveColWidth("MainTable");
|
||
|
|
||
|
CreateDataGrid();
|
||
|
ReadData();
|
||
|
|
||
|
$("#cmdAdd").click(function () {
|
||
|
window.location = "HW_GoodsUserApply.aspx";
|
||
|
});
|
||
|
|
||
|
$("#cmdGet").click(function () {
|
||
|
ReadData();
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
$("#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() {
|
||
|
|
||
|
var col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "类型";
|
||
|
col.CellTemplate = "<span>{Bind Type}</span>";
|
||
|
col.CellFormatter = function (value) {
|
||
|
switch (value) {
|
||
|
case 1: return "库存认购";
|
||
|
case 2: return "海外仓出运认购";
|
||
|
|
||
|
}
|
||
|
};
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "申购日期";
|
||
|
col.CellTemplate = "<span>{Bind InDate,yyyy-MM-dd HH:mm}</span>";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "申购人";
|
||
|
col.CellTemplate = "<span>{Bind Name}</span>";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "操作";
|
||
|
col.Width = "160px";
|
||
|
col.CellTemplate = "<span CommandName='cmdDel' 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() {
|
||
|
var param = new Object();
|
||
|
CreateWhere("SelectHtml", param); //读取查询条件
|
||
|
param.cs = Base64.encode(param.cs);
|
||
|
param.IsMX = 0;
|
||
|
if ($("#chk_mx").is(":checked") == true)
|
||
|
param.IsMX = 1;
|
||
|
param.PageIndex = datagrid1.Get_PageIndex();
|
||
|
param.PageSize = datagrid1.Get_PageSize();
|
||
|
$.ajax({
|
||
|
url: "CK_Service.asmx/GetListUserBuyNum",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
datagrid1.Set_RowCount(data.d.RowCount);
|
||
|
datagrid1.DataBind(data.d.DataSource);
|
||
|
if (param.IsMX == 1)
|
||
|
AddTr();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function AddTr() {
|
||
|
|
||
|
|
||
|
$("#" + datagrid1.TableID + " tr").each(function (i) {
|
||
|
|
||
|
if (i > 0) {
|
||
|
|
||
|
|
||
|
var index = $(this).attr("index");
|
||
|
|
||
|
var md = datagrid1.Get_Model(index);
|
||
|
var shtmls = "";
|
||
|
|
||
|
shtmls = "<tr><td colspan='4'><table width='80%' class='trTable3'>";
|
||
|
var CountryCode = md.Country;
|
||
|
if (md.GoodsDetail != null) {
|
||
|
$(md.GoodsDetail).each(function () {
|
||
|
shtmls += "<tr style='height:55px'><td align='left'>";
|
||
|
var imgurl = "";
|
||
|
|
||
|
var GoodsCode = this.GoodsCode;
|
||
|
|
||
|
if (this.FirstImgUrl != null && this.FirstImgUrl != "")
|
||
|
imgurl = "<a><img src='" + this.productImgUrl + "' alt='' width='50px' height='50px'/></a></td>";
|
||
|
else
|
||
|
imgurl = "<a><img src='../images/notp.png' alt='' width='50px' height='50px'/></a></td>";
|
||
|
if (this.MateNum == null)
|
||
|
this.MateNum = 0;
|
||
|
if (this.InNum == null)
|
||
|
this.InNum = 0;
|
||
|
var leftNum = this.InNum - this.MateNum;
|
||
|
|
||
|
|
||
|
shtmls += imgurl + "<td align='left'><a style='cursor: pointer; text-decoration: underline; color: Blue;font-weight:normal;'>" + GoodsCode + '[' + this.SKU + "]</a></td><td align='left'>店铺:" + this.ShopName + " 仓库:" + this.StoreName + " 认购数量:</font>" + this.InNum + " <font >剩余:</font>" + leftNum + " <font></td></tr>";
|
||
|
|
||
|
});
|
||
|
|
||
|
}
|
||
|
shtmls += "</table></td><tr>";
|
||
|
$(this).css("background-color", "#EEEEEE");
|
||
|
|
||
|
$(this).after(shtmls);
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
//#endregion
|
||
|
//#region 删除
|
||
|
function Delete(Id) {
|
||
|
if (window.confirm("确定要删除吗?") == false) return;
|
||
|
var param = new Object();
|
||
|
param.Id = Id;
|
||
|
WindowLoadModel.Show();
|
||
|
$.ajax({
|
||
|
url: "CK_Service.asmx/Delete_UserBuyNum",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
WindowLoadModel.Hide();
|
||
|
if (data.d == 0) { 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: "CK_Service.asmx/Save_DayData",
|
||
|
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
|
||
|
</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 />
|
||
|
</colgroup>
|
||
|
<tr>
|
||
|
|
||
|
<td class="f1" >申购日期</td>
|
||
|
<td><input id="txt_StartDate" type="text" style="width: 100px; " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" where="a.InDate>='@value'" />-<input id="txt_StopDate" type="text" style="width: 100px; " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" where="a.InDate<= '@value 23:59:59'" /></td>
|
||
|
|
||
|
<td class="f1" >类型</td>
|
||
|
<td>
|
||
|
<select id="Select_Type" name="D1" where="Type=@value">
|
||
|
<option value="1">库存认购</option>
|
||
|
<option value="2">海外仓出运认购</option>
|
||
|
</select></td>
|
||
|
<td><input id="chk_mx" type="checkbox" checked="checked" />显示明细</td>
|
||
|
<td><input id="cmdGet" type="button" value = "查询" /></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td colspan="7">
|
||
|
<input id="cmdAdd" type="button" value="新增认购" /> <font color="red">注:当天认购的数据并且没有匹配记录允许删除,隔天了因为会产生仓储费用</font>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top" colspan="7">
|
||
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<div style="display: none;">
|
||
|
<div id="MainTable" title="编辑" style="width: 500px; height: auto;">
|
||
|
<table class="tableAll" style="width: 100%;">
|
||
|
<colgroup>
|
||
|
<col style="width: 80px;" />
|
||
|
<col style="width: 150px;" />
|
||
|
<col style="width: 80px;" />
|
||
|
<col style="width: 150px;" />
|
||
|
</colgroup>
|
||
|
|
||
|
<tr>
|
||
|
<td class="f1" >数据时间</td>
|
||
|
<td><input id='txtDataDate' type='text' style='width: 99%' onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" columnname="DataDate" columndesc="数据时间" columnrequired="true" validtype="" columnformat="yyyy-MM-dd" /></td>
|
||
|
|
||
|
<td class="f1" >面单数量</td>
|
||
|
<td><input id='txtLabelNum' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="LabelNum" columndesc="面单数量" columnrequired="false" /></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="f1" >扫单数量</td>
|
||
|
<td><input id='txtScanNum' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="ScanNum" columndesc="扫单数量" columnrequired="false" /></td>
|
||
|
|
||
|
<td class="f1" >未发货单数</td>
|
||
|
<td><input id='txtNoPostNum' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="NoPostNum" columndesc="未发货单数" columnrequired="false" /></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="f1" >退货单数</td>
|
||
|
<td><input id='txtBackNum' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="BackNum" columndesc="退货单数" columnrequired="false" /></td>
|
||
|
|
||
|
<td class="f1" >上班人数</td>
|
||
|
<td><input id='txtWorkNum' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="WorkNum" columndesc="上班人数" columnrequired="false" /></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="f1" >请假人员</td>
|
||
|
<td><input id='txtNote5' type='text' style='width: 99%' columnname="Note5" columndesc="请假人员" columnrequired="false" validtype="" /></td>
|
||
|
|
||
|
<td class="f1" >收现金</td>
|
||
|
<td>
|
||
|
<input id="txtCrash" type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="Crash" columndesc="收现金" columnrequired="false" ></input></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="f1" >事项建议1</td>
|
||
|
<td colspan="3"><textarea id='txtNote1' style='width: 99%' columnname="Note1" columndesc="事项建议1" columnrequired="false" validtype="" cols="20" rows="3"></textarea></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="f1" >事项建议2</td>
|
||
|
<td colspan="3"><textarea id='txtNote2' style='width: 99%' columnname="Note2" columndesc="事项建议2" columnrequired="false" validtype="" cols="20" rows="3"></textarea></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="f1" >事项建议3</td>
|
||
|
<td colspan="3"><textarea id='txtNote3' style='width: 99%' columnname="Note3" columndesc="事项建议3" columnrequired="false" validtype="" cols="20" rows="3"></textarea></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="f1" >事项建议4</td>
|
||
|
<td colspan="3"><textarea id='txtNote4' style='width: 99%' columnname="Note4" columndesc="事项建议4" columnrequired="false" validtype="" cols="20" rows="3"></textarea></td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td colspan="4" align="center">
|
||
|
<input id="cmdSave" type="button" value="保存" />
|
||
|
<input id="cmdBack" type="button" value="返回" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|
||
|
|
||
|
|
||
|
|