|
|
|
@ -0,0 +1,407 @@
|
|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemuShopGoodPriceNew.aspx.cs" Inherits="TradeManageNew.Huowu.TemuShopGoodPriceNew" %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
<title>Temu店铺商品售价</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?a=1" />
|
|
|
|
|
<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?a=3445" 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/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 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/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
|
|
<script type="text/javascript" src="../Scripts/highcharts.js"></script>
|
|
|
|
|
<script src="../Scripts/kindeditor/kindeditor-min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/kindeditor/lang/zh_CN.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 Id = 0;
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
|
|
WindowLoadModel.Load();
|
|
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
GetTemuShops();
|
|
|
|
|
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
|
|
|
|
|
ReadData();
|
|
|
|
|
|
|
|
|
|
$("#btn_sch").bind("click", function () {
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#btn_add").bind("click", function () {
|
|
|
|
|
Id = 0;
|
|
|
|
|
Clear();
|
|
|
|
|
fopen();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [CommandName='cmdDelete']").live("click", function () {
|
|
|
|
|
var id = $(this).closest('tr').find('td span.shopid').attr('id');
|
|
|
|
|
var result = confirm("确定要执行此操作吗?");
|
|
|
|
|
if (result) {
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.id = id;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../HuoWuServiceNew.asmx/DeleteTemuShopGoodPrice",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.Code == 0) {
|
|
|
|
|
alert(data.d.Message);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
ReadData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#btn_Excel1").click(function () {
|
|
|
|
|
ajaxFileUpload();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#btn_Excel2").click(function () {
|
|
|
|
|
var url = '../ServerCookies/TemuGoodsTemplate.xls';
|
|
|
|
|
// 创建隐藏的 <a> 元素
|
|
|
|
|
var link = document.createElement('a');
|
|
|
|
|
link.href = url;
|
|
|
|
|
link.download = url.split('/').pop(); // 设置下载文件的名称
|
|
|
|
|
document.body.appendChild(link);
|
|
|
|
|
link.click();
|
|
|
|
|
document.body.removeChild(link);
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 初始化DataGrid
|
|
|
|
|
function CreateDataGrid() {
|
|
|
|
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "店铺名";
|
|
|
|
|
col.CellTemplate = "<span class='shopid' id={Bind ID}>{Bind ShopName}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "SKU";
|
|
|
|
|
col.CellTemplate = "<a>{Bind SKU}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "SPUID";
|
|
|
|
|
col.CellTemplate = "<a>{Bind SPUID}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "售价";
|
|
|
|
|
col.CellTemplate = "<span>{Bind SalePrice}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "预估运费";
|
|
|
|
|
col.CellTemplate = "<span>{Bind PostPrice}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "操作";
|
|
|
|
|
col.Width = "180px";
|
|
|
|
|
col.CellTemplate = "<input CommandName='cmdDelete' class='btnClass dgbtnEdit' type='button' value='Delete'>";
|
|
|
|
|
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.shopid = $("#select_shops").val();
|
|
|
|
|
param.search = $("#searchTxt").val();
|
|
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../HuoWuServiceNew.asmx/GetTemuShopGoodPriceDatas",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
|
|
|
datagrid1.DataBind(data.d.DataSource);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取temu平台的所有店铺
|
|
|
|
|
function GetTemuShops() {
|
|
|
|
|
$("#select_shops").append("<option value='0'>全部</option>");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.platid = 23;
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../DD_OrderServiceNew.asmx/GetAllShopsListByPlat",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$(data.d).each(function () {
|
|
|
|
|
$("#select_shops").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
|
|
|
|
|
$("#add_select_shop").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Clear() {
|
|
|
|
|
$("#addsku").val("");
|
|
|
|
|
$("#addsalePrice").val("");
|
|
|
|
|
$("#addspuid").val("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function fopen() {
|
|
|
|
|
|
|
|
|
|
$.fancybox({
|
|
|
|
|
'width': '40%',
|
|
|
|
|
'height': '40%',
|
|
|
|
|
'autoScale': false,
|
|
|
|
|
'transitionIn': 'elastic',
|
|
|
|
|
'transitionOut': 'elastic',
|
|
|
|
|
'href': '#test',
|
|
|
|
|
'onComplete': function () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Save() {
|
|
|
|
|
var md = new Object();
|
|
|
|
|
var param = new Object();
|
|
|
|
|
md.ID = 0;
|
|
|
|
|
md.Shopid = $("#add_select_shop").val();
|
|
|
|
|
if ($("#addsku").val() == "") {
|
|
|
|
|
alert("SKU不能为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
md.SKU = $("#addsku").val();
|
|
|
|
|
|
|
|
|
|
if ($("#addsalePrice").val() == "") {
|
|
|
|
|
alert("价格不能为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#addspuid").val() == "") {
|
|
|
|
|
alert("SPUID不能为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#addPostPrice").val() == "") {
|
|
|
|
|
alert("预估运费不能为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
md.PostPrice = $("#addPostPrice").val();
|
|
|
|
|
md.SPUID = $("#addspuid").val();
|
|
|
|
|
|
|
|
|
|
md.SalePrice = $("#addsalePrice").val();
|
|
|
|
|
md.CreateUserId = 0;
|
|
|
|
|
param.md = md;
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../HuoWuServiceNew.asmx/SaveTemuShopGoodPrice",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.Code == 0) {
|
|
|
|
|
alert(data.d.Message);
|
|
|
|
|
} else {
|
|
|
|
|
ReadData();
|
|
|
|
|
$.fancybox.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ajaxFileUpload() {
|
|
|
|
|
debugger;
|
|
|
|
|
|
|
|
|
|
var filename = $("#fileToUpload").val();
|
|
|
|
|
if (!filename.endsWith('.xls') && !filename.endsWith('.xlsx')) { alert("文件格式不正确"); return; }
|
|
|
|
|
$.ajaxFileUpload({
|
|
|
|
|
url: '../GlobalAshx/AjaxFileUpdate.ashx?DirectoryName=ServerCookies',
|
|
|
|
|
secureuri: false,
|
|
|
|
|
fileElementId: 'fileToUpload',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function (data, status) {
|
|
|
|
|
ImportGoods("ServerCookies/" + data.FileName);
|
|
|
|
|
},
|
|
|
|
|
error: function (data, status, e) {
|
|
|
|
|
alert(e);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ImportGoods(FileName) {
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.filePath = FileName;
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../HuoWuServiceNew.asmx/ImportTemuShopGoodPrices",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.Code == 0) { alert(data.d.Message); ReadData(); return; }
|
|
|
|
|
else {
|
|
|
|
|
ReadData();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status) {
|
|
|
|
|
if (status != "success") alert(xhr.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body class="headbody">
|
|
|
|
|
<div class="title_ico">
|
|
|
|
|
Temu店铺活动
|
|
|
|
|
</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 style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>店铺:
|
|
|
|
|
</td>
|
|
|
|
|
<td><select id="add_select_shop"></select></td>
|
|
|
|
|
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>SKU:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="addsku" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>SPUID:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="addspuid" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" />
|
|
|
|
|
</td>
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>基础价格:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="addsalePrice" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>预估运费:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="addPostPrice" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" />
|
|
|
|
|
</td> <td style="width: 110px;" class="f1">
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="center" colspan="2">
|
|
|
|
|
<input
|
|
|
|
|
id="btn_Save" type="button" class="btnClass btnClassSave" value="Save" onclick="Save();" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="13%">店铺:</td>
|
|
|
|
|
<td><select id="select_shops" class="selectClass" style="width: 120px" name="D2"></select></td>
|
|
|
|
|
|
|
|
|
|
<td class="f1" width="13%">SKU/SPUID:</td>
|
|
|
|
|
<td><input id="searchTxt" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" /></td>
|
|
|
|
|
|
|
|
|
|
<td><input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="10%">
|
|
|
|
|
<input id="btn_add" class="btnClass btnClassAdd" type="button" value="Add" />
|
|
|
|
|
</td>
|
|
|
|
|
<td > </td>
|
|
|
|
|
<td>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td valign="top" colspan="5">
|
|
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|