|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HY_GiftList.aspx.cs" Inherits="TradeManage.Member.HY_GiftList" %>
|
|
|
|
|
|
|
|
|
|
<!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 type="text/javascript" src="../Scripts/highcharts.js"></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>
|
|
|
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
|
|
<script type="text/javascript" src="../Scripts/uploadify/jquery.uploadify.js"></script>
|
|
|
|
|
<script src="../Scripts/ajaxfileupload.js" type="text/javascript"></script>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox2.1/source/jquery.fancybox.css?v=2.1.5"
|
|
|
|
|
media="screen" />
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox2.1/lib/jquery.mousewheel-3.0.6.pack.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox2.1/source/jquery.fancybox.js?v=2.1.5"></script>
|
|
|
|
|
<script src="../Scripts/kindeditor/kindeditor-min.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 UserId = "<%=Session["UserId"]%>";
|
|
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
|
|
|
|
|
|
|
var GiftId = 0;
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
|
|
WindowLoadModel.Load();
|
|
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
Target = $.url.param("Target");
|
|
|
|
|
if (Target == undefined) {
|
|
|
|
|
Target = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#txt_days").MaskedTextBox();
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
|
|
|
|
|
GetShopList2();
|
|
|
|
|
GetDepartMent();
|
|
|
|
|
GetBasePlat();
|
|
|
|
|
GetShopList();
|
|
|
|
|
$("#txtChangeScore,#txtPrice,#txtNum").MaskedTextBox();
|
|
|
|
|
$("#select_dept,#select_plat").bind("change", function () {
|
|
|
|
|
GetShopList();
|
|
|
|
|
});
|
|
|
|
|
ReadData();
|
|
|
|
|
$("#" + datagrid1.TableID + " input[CommandName='cmdEdit']").live("click", function () {
|
|
|
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
Clear();
|
|
|
|
|
GiftId = model.GiftId;
|
|
|
|
|
$("#txtGiftName").val(model.GiftName);
|
|
|
|
|
if (model.ImgList != null) {
|
|
|
|
|
ImgList = model.ImgList;
|
|
|
|
|
$(ImgList).each(function () {
|
|
|
|
|
var url = "../" + this.FileUrl;
|
|
|
|
|
$("#div_img").append("<a href='" + url + "' target='_blank'><img alt='' imgurl='" + this.FileUrl + "' src='" + url + "' width='70px' height='70px' /><span>" + this.FileName + "</span></a><a class='img_del' style='cursor:pointer;' no='" + this.Id + "'><img alt='删除' src='../images/del.gif' width='20px' height='20px' /></a>");
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$("#txtChangeScore").val(model.ChangeScore);
|
|
|
|
|
$("#txtPrice").val(model.Price);
|
|
|
|
|
$("#txtGiftDesc").val(model.GiftDesc);
|
|
|
|
|
$("#txtNum").val(model.Num);
|
|
|
|
|
$("#txtLeftNum").val(model.LeftNum);
|
|
|
|
|
$("#select_shop2").val(model.ShopId);
|
|
|
|
|
|
|
|
|
|
if(model.State==1)
|
|
|
|
|
$("#chkUse").attr("checked", "checked");
|
|
|
|
|
else
|
|
|
|
|
$("#chkUse").removeAttr("checked");
|
|
|
|
|
if (model.SDate!=null)
|
|
|
|
|
$("#txtSDate").val(model.SDate.localeFormat("yyyy-MM-dd"));
|
|
|
|
|
if (model.EDate != null)
|
|
|
|
|
$("#txtEDate").val(model.EDate.localeFormat("yyyy-MM-dd"));
|
|
|
|
|
|
|
|
|
|
$("#txtUseRule").val(model.UseRule);
|
|
|
|
|
fopen();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#btn_sch").bind("click", function () {
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
$("#btn_Add").bind("click", function () {
|
|
|
|
|
Clear();
|
|
|
|
|
fopen();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#btn_Cancel").click($.fancybox.close);
|
|
|
|
|
|
|
|
|
|
$(".img_del").live("click", function () {
|
|
|
|
|
$(this).prev("a").remove();
|
|
|
|
|
$(this).remove();
|
|
|
|
|
var imgid = $(this).attr("no");
|
|
|
|
|
if (ImgList != null) {
|
|
|
|
|
$(ImgList).each(function () {
|
|
|
|
|
if (imgid == this.id) {
|
|
|
|
|
Array.remove(ImgList, this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
$("#fileToUploadImage").bind("change", function () {
|
|
|
|
|
ajaxFileUpload_fileToUploadImage();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function GetDepartMent() {
|
|
|
|
|
$("#select_dept").append("<option value='0'>全部</option>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
|
param.DeptType = "事业部";
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManage/SysManageService.asmx/GetDepartList",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$(data.d).each(function () {
|
|
|
|
|
$("#select_dept").append("<option value='" + this.DeptId + "'>" + this.DeptName + "</option>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function Clear()
|
|
|
|
|
{
|
|
|
|
|
GiftId = 0;
|
|
|
|
|
$("#txtGiftName").val("");
|
|
|
|
|
|
|
|
|
|
ImgList = new Array();
|
|
|
|
|
$("#txtChangeScore").val("");
|
|
|
|
|
$("#txtPrice").val("");
|
|
|
|
|
$("#txtGiftDesc").val("");
|
|
|
|
|
$("#txtNum").val("");
|
|
|
|
|
$("#LeftNum").val("");
|
|
|
|
|
$("#select_shop2").val("0");
|
|
|
|
|
$("#div_img").html("");
|
|
|
|
|
|
|
|
|
|
$("#chkUse").attr("checked", "checked");
|
|
|
|
|
|
|
|
|
|
$("#txtSDate").val("");
|
|
|
|
|
$("#txtEDate").val("");
|
|
|
|
|
$("#txtUseRule").val("");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function GetBasePlat() {
|
|
|
|
|
|
|
|
|
|
$("#select_plat").append("<option value='0'>全部</option>");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.CompanyID = 0;
|
|
|
|
|
param.KeyName = "ptlx";
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../UserService.asmx/GetPlatBaseCode",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$(data.d).each(function () {
|
|
|
|
|
$("#select_plat").append("<option value='" + this.SortNo + "'>" + this.Name + "</option>");
|
|
|
|
|
});
|
|
|
|
|
GetShopList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function GetShopList() {
|
|
|
|
|
$("#select_shop").empty();
|
|
|
|
|
$("#select_shop").append("<option value='0'>全部</option>");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
|
param.DeptId = $("#select_dept").val();
|
|
|
|
|
param.PlatType = $("#select_plat").val();
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../BaseData.asmx/GetDeptShopList",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$(data.d).each(function (i) {
|
|
|
|
|
$("#select_shop").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function GetShopList2() {
|
|
|
|
|
$("#select_shop2").empty();
|
|
|
|
|
$("#select_shop2").append("<option value='0'>-选择-</option>");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param.PlatType =0;
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../BaseData.asmx/GetShopListMaster",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$(data.d).each(function (i) {
|
|
|
|
|
$("#select_shop2").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
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><img src='{Bind ImageUrl}' alt='' width='40px' height='40px'/></a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "礼物名称";
|
|
|
|
|
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind GiftName}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "店铺";
|
|
|
|
|
col.CellTemplate = "<a>{Bind ShopName}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "兑换积分";
|
|
|
|
|
col.CellTemplate = "<a>{Bind ChangeScore}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "兑换规则";
|
|
|
|
|
col.CellTemplate = "<div style='width:120px;word-break:break-all;'>{Bind UseRule}</div>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "总计个数";
|
|
|
|
|
col.CellTemplate = "<span>{Bind Num}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "剩余个数";
|
|
|
|
|
col.CellTemplate = "<span>{Bind LeftNum}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "兑换有效期";
|
|
|
|
|
col.CellTemplate = "<span>{Bind SDate,yyyy-MM-dd}-{Bind EDate,yyyy-MM-dd}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "状态";
|
|
|
|
|
col.CellTemplate = "<span>{Bind StateName}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "操作";
|
|
|
|
|
col.Width = "140px";
|
|
|
|
|
col.CellTemplate = "<input CommandName='cmdEdit' class='btnClass dgbtnEdit' type='button' value='修改'></input> <input CommandName='dgbtnDel' onclick='DelCol(this);' class='btnClass dgbtnDel' type='button' value='删除'></input>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
datagrid1.SetPageSize(50);
|
|
|
|
|
datagrid1.SetPageIndex(1);
|
|
|
|
|
//datagrid1.SortExpression = "OrderId";
|
|
|
|
|
//datagrid1.ViewSortDirection = "desc";
|
|
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
|
|
datagrid1.ShowIndexColumn = false;
|
|
|
|
|
datagrid1.AllowPaging = true;
|
|
|
|
|
datagrid1.Width = "100%";
|
|
|
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
|
|
|
|
|
datagrid1.Init();
|
|
|
|
|
//datagrid1.Sorting(function () {
|
|
|
|
|
|
|
|
|
|
// ReadData();
|
|
|
|
|
//});
|
|
|
|
|
datagrid1.add_PageIndexChanged(function () { ReadData(); });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var State =-1;
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 读取数据
|
|
|
|
|
function ReadData() {
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
|
param.State = $("#select_state").val();
|
|
|
|
|
param.DeptId = $("#select_dept").val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($("#select_plat").find("option").length > 0)
|
|
|
|
|
param.PlatType = $("#select_plat").val();
|
|
|
|
|
else
|
|
|
|
|
param.PlatType = 0;
|
|
|
|
|
if ($("#select_shop").find("option").length > 0)
|
|
|
|
|
param.ShopId = $("#select_shop").val();
|
|
|
|
|
else
|
|
|
|
|
param.ShopId = 0;
|
|
|
|
|
|
|
|
|
|
param.SScore =-1;
|
|
|
|
|
if ($("#txt_SScore").val() != "")
|
|
|
|
|
param.SScore = $("#txt_SScore").val();
|
|
|
|
|
param.EScore =-1;
|
|
|
|
|
if ($("#txt_EScore").val() != "")
|
|
|
|
|
param.EScore = $("#txt_EScore").val();
|
|
|
|
|
param.SNum = -1;
|
|
|
|
|
if ($("#txt_SNum").val() != "")
|
|
|
|
|
param.SNum = $("#txt_SNum").val();
|
|
|
|
|
param.ENum =-1;
|
|
|
|
|
if ($("#txt_ENum").val() != "")
|
|
|
|
|
param.ENum = $("#txt_ENum").val();
|
|
|
|
|
param.GiftName = $("#txt_GiftName").val();
|
|
|
|
|
param.GiftInfo = $("#txt_GiftInfo").val();
|
|
|
|
|
|
|
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
param.Sort = "GiftId";
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "HY_MemberService.asmx/GetListGift",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
|
|
|
datagrid1.DataBind(data.d.DataSource);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#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.GiftId = model.GiftId;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "DD_OrderService.asmx/DeleteGift",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
alert("删除成功");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
datagrid1.Del_Row(rowindex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
var ImgList = new Array();
|
|
|
|
|
function ajaxFileUpload_fileToUploadImage() {
|
|
|
|
|
var filename = $("#fileToUploadImage").val();
|
|
|
|
|
if (filename == "" || filename == undefined) return;
|
|
|
|
|
if (IsImage(filename) == false) { alert("上传文件格式只限于bmp,png,gif,jpeg,jpg格式"); return; }
|
|
|
|
|
// WindowLoadModel.Show();
|
|
|
|
|
var dd = new Date();
|
|
|
|
|
var dirname = dd.getFullYear() + "." + dd.getMonth();
|
|
|
|
|
$.ajaxFileUpload({
|
|
|
|
|
url: '../GlobalAshx/AjaxFileUpload.ashx?DirectoryName=attached/' + dirname,
|
|
|
|
|
secureuri: false,
|
|
|
|
|
fileElementId: 'fileToUploadImage',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function (data, status) {
|
|
|
|
|
// WindowLoadModel.Hide();
|
|
|
|
|
if (data.Id == 0) {
|
|
|
|
|
alert("图片太大了,不要超过400K");
|
|
|
|
|
$("#fileToUploadImage").bind("change", function () {
|
|
|
|
|
ajaxFileUpload_fileToUploadImage();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var md = new Object();
|
|
|
|
|
md.FileUrl = data.FileUrl;
|
|
|
|
|
md.FileName = data.FileName;
|
|
|
|
|
md.id = data.Id;
|
|
|
|
|
Array.add(ImgList, md);
|
|
|
|
|
var Url = "../" + data.FileUrl;
|
|
|
|
|
$("#div_img").append("<a><img alt='' imgurl='" + data.FileUrl + "' no='" + data.Id + "' src='" + Url + "' width='70px' height='60px' /><span>" + data.FileName + "</span></a><a class='img_del' style='cursor:pointer;' no='" + data.Id + "'><img alt='删除' src='../images/del.gif' width='20px' height='20px' /></a>");
|
|
|
|
|
$("#fileToUploadImage").bind("change", function () {
|
|
|
|
|
ajaxFileUpload_fileToUploadImage();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#region 保存
|
|
|
|
|
function Save() {
|
|
|
|
|
|
|
|
|
|
if ($("#select_shop2").val() == "0") {
|
|
|
|
|
alert("请选择店铺");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#txtGiftName").val() == "") {
|
|
|
|
|
alert("请填写礼物名称");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#txtChangeScore").val() == "") {
|
|
|
|
|
alert("请填写兑换积分");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#txtNum").val() == "") {
|
|
|
|
|
alert("请填写礼物数量");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (ImgList == null || ImgList.length==0) {
|
|
|
|
|
alert("请上传礼物图片");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var param = new Object();
|
|
|
|
|
var Model=new Object();
|
|
|
|
|
|
|
|
|
|
Model.GiftId = GiftId;
|
|
|
|
|
Model.GiftName = $("#txtGiftName").val();
|
|
|
|
|
//Model.ImageUrl = $("#txtImageUrl").val();
|
|
|
|
|
// Model.ImageIds = $("#txtImageIds").val();
|
|
|
|
|
Model.ImgList = ImgList;
|
|
|
|
|
Model.ChangeScore = $("#txtChangeScore").val();
|
|
|
|
|
Model.Price = $("#txtPrice").val();
|
|
|
|
|
Model.GiftDesc = $("#txtGiftDesc").val();
|
|
|
|
|
Model.Num = $("#txtNum").val();
|
|
|
|
|
Model.LeftNum = $("#txtNum").val();
|
|
|
|
|
Model.ShopId = $("#select_shop2").val();
|
|
|
|
|
|
|
|
|
|
Model.State = 1;
|
|
|
|
|
if ($("#chkUse").is(":checked") == false)
|
|
|
|
|
Model.State = 0;
|
|
|
|
|
Model.SDate = $("#txtSDate").val();
|
|
|
|
|
Model.EDate = $("#txtEDate").val();
|
|
|
|
|
Model.UseRule = $("#txtUseRule").val();
|
|
|
|
|
param.Model = Model;
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "HY_MemberService.asmx/SaveGift",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
|
|
|
|
alert("成功");
|
|
|
|
|
ReadData();
|
|
|
|
|
$.fancybox.close();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body class="headbody">
|
|
|
|
|
<div class="title_ico">
|
|
|
|
|
礼物管理信息
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display:none">
|
|
|
|
|
<div id="test" title="礼物" style="width: 650px; height: 530px;">
|
|
|
|
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>店铺:
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="3">
|
|
|
|
|
|
|
|
|
|
<select id="select_shop2" class="selectClass" name="D4" style="width:120px;">
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="10%"> <font color="red" style="font-weight: bolder">*</font>礼物名称:<br /><font color="red" style="font-weight: bolder">写英文</font></td>
|
|
|
|
|
<td colspan="3">
|
|
|
|
|
<input id="txtGiftName" class="editTextbox" style="width: 200px;" type="text" />
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="10%"><font color="red" style="font-weight: bolder">*</font> 兑换积分:</td>
|
|
|
|
|
<td colspan="3">
|
|
|
|
|
<input id="txtChangeScore" class="editTextbox" min='0' max='10000000' precision='0' style="width: 100px;" type="text" /> <input id="chkUse" type="checkbox" checked="checked"/>是否上架
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<tr> <td class="f1" width="10%">兑换规则:<br /><font color="red" style="font-weight: bolder">写英文</font></td> <td colspan="3">
|
|
|
|
|
<textarea id="txtUseRule" cols="100" rows="7" class="editMultTextbox" style="width: 99%"></textarea>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 100px;" class="f1"> <font color="red" style="font-weight: bolder">*</font>礼物图:
|
|
|
|
|
</td>
|
|
|
|
|
<td align="left" colspan="3" valign="top">
|
|
|
|
|
<input id="fileToUploadImage" name="fileToUploadImage" type="file" /><br />
|
|
|
|
|
<div id="div_img"></div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr> <td class="f1" width="10%"> <font color="red" style="font-weight: bolder">*</font>礼物数量:</td>
|
|
|
|
|
<td width="35%">
|
|
|
|
|
<input id="txtNum" min='0' max='10000000' precision='0' class="editTextbox" style="width: 80px;" type="text" />个
|
|
|
|
|
</td>
|
|
|
|
|
<td class="f1" width="10%">市场价:</td>
|
|
|
|
|
<td width="35%">
|
|
|
|
|
<input id="txtPrice" min='0' max='10000000' precision='2' class="editTextbox" style="width: 80px;" type="text" />美元
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="10%">礼物介绍:<br /><font color="red" style="font-weight: bolder">写英文</font></td>
|
|
|
|
|
<td colspan="3">
|
|
|
|
|
<textarea id="txtGiftDesc" cols="100" rows="7" class="editMultTextbox" style="width: 99%"></textarea>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr> <td class="f1" width="10%">兑换有效期:</td>
|
|
|
|
|
<td colspan="3">
|
|
|
|
|
<input id="txtSDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />-<input id="txtEDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" /> <font color="red" style="font-weight: bolder">不填表示一直有效</font>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="center" colspan="4">
|
|
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="保 存" onclick="Save();"/>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
<td class="f1" width="10%">平台:</td>
|
|
|
|
|
<td width="15%">
|
|
|
|
|
<select id="select_plat" class="selectClass" style="width: 120px" name="D6">
|
|
|
|
|
</select></td>
|
|
|
|
|
<td class="f1" width="12%">
|
|
|
|
|
部门/分组:</td>
|
|
|
|
|
<td width="18%">
|
|
|
|
|
<select id="select_dept" class="selectClass" style="width: 90px" name="D8">
|
|
|
|
|
|
|
|
|
|
</select><select id="select_shop" class="selectClass" style="width: 80px" name="D7">
|
|
|
|
|
</select></td>
|
|
|
|
|
<td class="f1" style="width: 10%;">
|
|
|
|
|
兑换积分范围:</td>
|
|
|
|
|
<td width="28%" colspan="2">
|
|
|
|
|
|
|
|
|
|
<input id="txt_SScore" class="editTextbox" style="width: 60px;" type="text" />-<input id="txt_EScore" class="editTextbox" style="width:60px;" type="text" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="10%">礼物名称:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="txt_GiftName" class="editTextbox" style="width: 120px;" type="text" /></td>
|
|
|
|
|
<td class="f1" width="10%">剩余数量:</td>
|
|
|
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<input id="txt_SNum" class="editTextbox" style="width: 60px;" type="text" />-<input id="txt_ENum" class="editTextbox" style="width:60px;" type="text" /></td>
|
|
|
|
|
|
|
|
|
|
<td class="f1" style="width: 10%;">
|
|
|
|
|
礼物其他信息:</td>
|
|
|
|
|
<td > <input id="txt_GiftInfo" 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="10%">上架状态:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<select id="select_state" class="selectClass" style="width: 120px" name="D9">
|
|
|
|
|
<option value="-1">全部</option>
|
|
|
|
|
<option value="1">上架</option>
|
|
|
|
|
<option value="0">下架</option>
|
|
|
|
|
</select></td>
|
|
|
|
|
<td class="f1" width="10%"> </td>
|
|
|
|
|
<td>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td class="f1" style="width: 10%;">
|
|
|
|
|
</td>
|
|
|
|
|
<td > </td>
|
|
|
|
|
<td >
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td colspan="7">
|
|
|
|
|
<input id="btn_Add" class="btnClass btnClassAdd" type="button" value="添加礼物" /> </td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td valign="top" colspan="7">
|
|
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|