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.
280 lines
11 KiB
Plaintext
280 lines
11 KiB
Plaintext
2 months ago
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DD_GoodsCodeInput.aspx.cs" Inherits="TradeManageNew.DingDan.DD_GoodsCodeInput" %>
|
||
|
<!DOCTYPE html>
|
||
|
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head id="Head1" runat="server">
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta http-equiv="pragma" content="no-cache" />
|
||
|
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
|
||
|
<meta http-equiv="expires" content="0" />
|
||
|
<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/jquery.min.js" type="text/javascript"></script>
|
||
|
<script src="../Scripts/MicrosoftAjax.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/FixTable.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/jquery.url.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>
|
||
|
<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 type="text/javascript">
|
||
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
||
|
var WindowLoadModel = new WindowLoad();
|
||
|
var name = "<%=Session["Name"]%>";
|
||
|
var UserId = "<%=Session["UserId"]%>";
|
||
|
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_StartDate").val(CurrentDate.localeFormat("yyyy-MM-dd"));
|
||
|
|
||
|
$("#cmdAdd2").click(function () {
|
||
|
window.open("DD_GoodsAdd.aspx");
|
||
|
});
|
||
|
|
||
|
//TableAveColWidth("MainTable");
|
||
|
GetShopList();
|
||
|
CreateDataGrid();
|
||
|
ReadData();
|
||
|
|
||
|
$("#btn_Sure").click(function () {
|
||
|
if ($("#txt_StartDate").val() == "") {
|
||
|
alert("请填写数据日期");
|
||
|
return;
|
||
|
|
||
|
}
|
||
|
ReadData();
|
||
|
});
|
||
|
|
||
|
$("#cmdGet").click(function () {
|
||
|
ReadData();
|
||
|
});
|
||
|
|
||
|
$("#cmdSave,#cmdSave2").click(function () {
|
||
|
Save();
|
||
|
});
|
||
|
|
||
|
$("#DataGrid1 [CommandName]").live("click", function () {
|
||
|
var index = $(this).parentsUntil("tr").parent().attr("index");
|
||
|
var model = datagrid1.Get_Model(index);
|
||
|
Delete(model.Id);
|
||
|
//datagrid1.Del_Row(index);
|
||
|
});
|
||
|
|
||
|
});
|
||
|
function GetShopList() {
|
||
|
$("#listShopId").empty();
|
||
|
$("#listShopId").append("<option value='0'>-全部-</option>");
|
||
|
var param = new Object();
|
||
|
|
||
|
param.PlatType = 0;
|
||
|
|
||
|
|
||
|
$.ajax({
|
||
|
url: "../BaseDataNew.asmx/GetShopList",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
async:false,
|
||
|
success: function (data) {
|
||
|
|
||
|
if (data.d != null) {
|
||
|
$(data.d).each(function (i) {
|
||
|
$("#listShopId").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#region 初始化DataGrid
|
||
|
function CreateDataGrid() {
|
||
|
|
||
|
var col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "店铺";
|
||
|
col.CellTemplate = "<span>{Bind ShopName}</span>";
|
||
|
col.Width = "100px";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "编号";
|
||
|
col.CellTemplate = "<span>{Bind GoodsCode}</span>";
|
||
|
col.Width = "100px";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "人员";
|
||
|
col.CellTemplate = "<span>{Bind InName}</span>";
|
||
|
col.Width = "100px";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "广告费";
|
||
|
col.CellTemplate = "<input ColName='Dec1' colrequired='false' type='text' style='width:99%;text-align: center;' value='{Bind Dec1}' precision='2' min='0' max='99999999' ></input>";
|
||
|
col.Width = "60px";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "点击量";
|
||
|
col.CellTemplate = "<input ColName='Int1' colrequired='false' type='text' style='width:99%;text-align: center;' value='{Bind Int1}' precision='0' min='0' max='99999999' ></input>";
|
||
|
col.Width = "60px";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "大类排名";
|
||
|
col.CellTemplate = "<input ColName='Int2' colrequired='false' type='text' style='width:99%;text-align: center;' value='{Bind Int2}' precision='0' min='0' max='99999999' ></input>";
|
||
|
col.Width = "60px";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "小类排名";
|
||
|
col.CellTemplate = "<input ColName='Int3' colrequired='false' type='text' style='width:99%;text-align: center;' value='{Bind Int3}' precision='0' min='0' max='99999999' ></input>";
|
||
|
col.Width = "60px";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "链接";
|
||
|
col.CellTemplate = "<a target='_blank' href='{Bind Url}'>{Bind Url}</a>";
|
||
|
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 = false;
|
||
|
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.ShopId = $("#listShopId").val();
|
||
|
param.SDate = $("#txt_StartDate").val();
|
||
|
param.GoodsCode = $("#txtGoodsId").val();
|
||
|
if(UserId>1&&UserId!=48)
|
||
|
{
|
||
|
param.name=name;
|
||
|
}
|
||
|
else
|
||
|
param.name="";
|
||
|
$.ajax({
|
||
|
url: "../DD_OrderServiceNew.asmx/GetListGoodsCodeData3",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
datagrid1.DataBind(data.d);
|
||
|
$("input[ColName]").MaskedTextBox();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
//#region 删除
|
||
|
function Delete(Id) {
|
||
|
if (window.confirm("确定要删除吗?") == false) return;
|
||
|
var param = new Object();
|
||
|
param.Id = Id;
|
||
|
WindowLoadModel.Show();
|
||
|
$.ajax({
|
||
|
url: "XXX.asmx/Delete_GoodsCodeData",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
WindowLoadModel.Hide();
|
||
|
if (data.d == false) { alert("已经使用过,无法删除"); return; }
|
||
|
ReadData(); //刷新DataGrid
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
//#region 保存
|
||
|
function Save() {
|
||
|
if ($("#txt_StartDate").val() == "") {
|
||
|
alert("请填写数据日期");
|
||
|
return;
|
||
|
|
||
|
}
|
||
|
var error = datagrid1.UpdateDataSource();
|
||
|
if (error != "") { alert(error); return; }
|
||
|
var param = new Object();
|
||
|
param.list = datagrid1.DataSource;
|
||
|
param.SDate = $("#txt_StartDate").val();
|
||
|
WindowLoadModel.Show();
|
||
|
$.ajax({
|
||
|
url: "../DD_OrderServiceNew.asmx/Save_GoodsCodeDataList",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
WindowLoadModel.Hide();
|
||
|
// ReadData();
|
||
|
alert("保存成功");
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
</script>
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
|
||
|
<table id="SelectHtml" border="1" cellpadding="0" cellspacing="0" align="center" style="width: 100%"
|
||
|
class="tableAll">
|
||
|
<tr><td class="f1" >数据日期</td>
|
||
|
<td><input id="txt_StartDate" type="text" style="width: 120px; " onfocus="WdatePicker()" /> <input id="btn_Sure" type="button" value="确定" class="btnClass btnClassFind"/>
|
||
|
<input id="cmdAdd2" type="button" class="btnClass btnClassFind" value="编号设置" />
|
||
|
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td style="text-align: center;" colspan="2">
|
||
|
|
||
|
<input id="cmdSave2" type="button" value="保存" class="btnClass btnClassSave"/>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="2">
|
||
|
|
||
|
店铺:<select id='listShopId' style="width:150px"></select>编号:<input id='txtGoodsId' type='text' style='width:150px'/><input id="Button1" type="button" value="筛选" class="btnClass btnClassFind" onclick="ReadData();"/></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top" colspan="2">
|
||
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td style="text-align: center;" colspan="2">
|
||
|
|
||
|
<input id="cmdSave" type="button" value="保存" class="btnClass btnClassSave"/>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|
||
|
|
||
|
|