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.
ERP/ERPOMS/CangKu/CK_InventoryApply.aspx

373 lines
14 KiB
Plaintext

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CK_InventoryApply.aspx.cs" Inherits="ERPOMS.CangKu.CK_InventoryApply" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="referrer" content="no-referrer"/>
<title>OMS申请库存</title>
<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>
<!-- 引入select2的CSS -->
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<!-- 引入select2的JS -->
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script type="text/javascript">
var name = "<%=Session["Name"]%>";
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var UserId = "<%=Session["UserId"]%>";
var WindowLoadModel = new WindowLoad();
var Model = null;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
newId = 0;
$('#txt_UserName').val(name);
GetUserGoodsList();
//CreateDataGrid();
// ReadData();
$('.your-select-class').select2({
dropdownParent: $('#MainTable'), // 确保这是模态窗口的正确容器
maximumHeight: 50,
});
//查询
$("#btn_sch").bind("click", function () {
ReadData();
});
//保存
$("#cmdSave").bind("click", function () {
StartSave();
});
//返回
$("#cmdBack").bind("click", function () {
window.close();
window.parent.CloseTab(Title1, Title);
});
//自动查询销售单价
$('#select_goodslist').change(function () {
var param = new Object();
param.GoodsId = $(this).val();
$.ajax({
url: "../OMSCangKuServerNew.asmx/GetSalePriceByGoodsId",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
if (data.d != null) {
$('#txt_ApplyPrice').val(data.d);
}
}
});
});
});
//保存
//#region 保存
function StartSave() {
$.ajax({
url: "../OMSCangKuServerNew.asmx/GetGoodsListByUserId",
success: function (data) {
if (data.d != null) {
$("#select_goodslist").append("<option value='0'>-全部-</option>");
$(data.d).each(function () {
$("#select_goodslist").append("<option value='" + this.GoodsID + "'>" + this.GoodsCode + "</option>");
});
}
}
});
}
//#endregion
//撤销
//#region 撤销
function CancelApply() {
$.ajax({
url: "../OMSCangKuServerNew.asmx/GetGoodsListByUserId",
success: function (data) {
if (data.d != null) {
$("#select_goodslist").append("<option value='0'>-全部-</option>");
$(data.d).each(function () {
$("#select_goodslist").append("<option value='" + this.GoodsID + "'>" + this.GoodsCode + "</option>");
});
}
}
});
}
//#endregion
//获取登陆者的分配货号
//#region 获取登陆者的分配货号
function GetUserGoodsList() {
$.ajax({
url: "../OMSCangKuServerNew.asmx/GetGoodsListByUserId",
success: function (data) {
if (data.d != null) {
$("#select_goodslist").append("<option value='0'>-全部-</option>");
$(data.d).each(function () {
$("#select_goodslist").append("<option value='" + this.GoodsID + "'>" + this.GoodsCode + "</option>");
});
}
}
});
}
//#endregion
// 展示新增页面
//#region 展示新增页面
function ShowApply() {
$.fancybox({
'scrolling': 'no',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#MainTable',
'onStart': function () {
debugger
// 获取当前最高的Z-index
//var highestZIndex = Math.max.apply(null, $('.fancybox-skin').map(function () {
// return parseInt($(this).css('z-index'));
//}).get());
//// 设置Select2下拉菜单的Z-index
//$('.select2-drop').css('z-index', highestZIndex + 1);
}
}, 0);
}
function AddApply() {
// WindowLoadModel.Show();
$.ajax({
url: "../OMSCangKuServerNew.asmx/GetAllList_CK_GoodsApply",
success: function (data) {
// WindowLoadModel.Hide();
//查询列
var conList = data.d[0].map(item => item.Key);
debugger
CreateDataGrid(conList);
//转换列表
var newList = [];
for (const item of data.d) {
const modelObject = {};
for (const t of item) {
modelObject[t.Key] = t.Value;
}
newList.push(modelObject);
}
debugger
datagrid1.DataBind(newList);
}
});
}
//#endregion
// 查询
//#region 查询
function ReadData() {
$.ajax({
url: "../OMSCangKuServerNew.asmx/GetAllList_CK_GoodsApply",
success: function (data) {
// WindowLoadModel.Hide();
//查询列
var conList = data.d[0].map(item => item.Key);
debugger
CreateDataGrid(conList);
//转换列表
var newList = [];
for (const item of data.d) {
const modelObject = {};
for (const t of item) {
modelObject[t.Key] = t.Value;
}
newList.push(modelObject);
}
debugger
datagrid1.DataBind(newList);
}
});
}
//#endregion
// DataGrid
//#region 初始化DataGrid
function CreateDataGrid(conList) {
datagrid1.Columns = [];
for (const item of conList) {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = item;
//CommandName='cmdLook'
col.CellTemplate = `<span>{Bind ${item}}</span>`;// "<span>{Bind Id}</span>";//Id UserId GoodsId Quantity InDate GoodsCode UserName
col.SortExpression = "";
Array.add(datagrid1.Columns, col);
}
datagrid1.SortExpression = "";
datagrid1.ViewSortDirection = "";
datagrid1.IsFixHeader = false;
// datagrid1.Height = $(document).height() - 330;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = true;
datagrid1.Width = "100%";
datagrid1.IsFixHeader = false;
// datagrid1.Height = $(document).height() - 300;
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
datagrid1.Init();
datagrid1.Sorting(function () {
ReadData(false);
});
datagrid1.add_PageIndexChanged(function () { ReadData(false); });
}
//#endregion
</script>
<style>
.td_f1 {
font-size: 11pt;
text-align: center;
}
.auto-style1 {
height: 34px;
}
</style>
</head>
<body class="headbody">
<table class="tableAll" style="width: 100%;">
<tr>
<td width="100%" valign="top">
<table id="tb1" class="tableAll" style="width: 100%;">
<tr>
<td colspan="5">
<input class="layui-btn" type="button" value="全部状态" onclick="ReadData(-1);"/>
<input class="layui-btngray" type="button" value="未审批" onclick="ReadData(0);"/>
<input class="layui-btn" type="button" value="审批通过" onclick="ReadData(1);"/>
<input class="layui-btn" type="button" value="审批驳回" onclick="ReadData(2);"/>
<input class="layui-btn" type="button" value="填写申请" onclick="ShowApply();" />
</td>
</tr>
<tr>
<td class="td_f1" width="10%">货号</td>
<td width="20%">
<input id="txt_sku" class="editTextbox" style="width: 220px;" type="text" />
</td>
<td class="td_f1" width="10%">提交日期</td>
<td>
<input id="txt_SDate" class="editTextbox" onfocus="WdatePicker()" style="width: 80px;" type="text" />-
<input id="txt_EDate" class="editTextbox" onfocus="WdatePicker()" style="width: 80px;" type="text" />
</td>
<td>
<input id="btn_sch" class="layui-btnblue" type ="button" value="查询" />
</td>
</tr>
<tr>
<td valign="top" colspan="7" class="auto-style1">
<div id="DataGrid1" class="DataGridStyle" ></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div style="display: none;">
<div id="MainTable" title="编辑" style="width: 500px; height: auto;">
<table class="tableAll" style="width: 100%;">
<tr>
<td class="f1" >申请人</td>
<td>
<input id="txt_UserName" type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="Crash" columndesc="收现金" columnrequired="false" />
</td>
</tr>
<tr>
<td class="f1" >申请货号</td>
<td>
<select id="select_goodslist" class="your-select-class">
</select>
</td>
</tr>
<tr>
<td class="f1" >预计卖出单价</td>
<td>
<input id='txt_ApplyPrice' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="BackNum" columnrequired="false" />
</td>
</tr>
<tr>
<td class="f1" >申请数量</td>
<td>
<input id='txt_ApplyNum' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="NoPostNum" columnrequired="false" />
</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>