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.

497 lines
18 KiB
Plaintext

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EBookList.aspx.cs" Inherits="TradeManageNew.EBOOK.EBookList" %>
<!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>电子样册</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>
<script type="text/javascript">
function GetSort() {
$.ajax({
url: "cp_productservice.asmx/GetCPArea",
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
if (data.d != null) {
$.fn.zTree.init($("#treeDemo"), setting, data.d);
}
}
});
}
//function ReadData() {
// var param = new Object();
// param.PageSize = datagrid1.Get_PageSize();
// param.PageIndex = datagrid1.Get_PageIndex();
// param.sort = datagrid1.SortExpression + " " + datagrid1.ViewSortDirection;
// WindowLoadModel.Show();
// $.ajax({
// url: "cp_productservice.asmx/GetListGoodsPlatInfo",
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
// success: function (data) {
// WindowLoadModel.Hide();
// datagrid1.Set_RowCount(data.d.RowCount);
// datagrid1.DataBind(data.d.DataSource);
// $("tr[index]").hover(function () {
// $(this).find("td").css('background', '#FAF9D2');
// }, function () {
// $(this).find("td").css('background', '#fff');
// });
// }
// });
//}
var WindowLoadModel = new WindowLoad();
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
ajaxInit(null);
CreateDataGrid();
ReadData();
$("#btn_sch").bind("click", function () {
ReadData();
});
$("#btn_add").bind("click", function () {
window.open("EBook_ImgUpload.aspx");
});
$("#btn_add2").bind("click", function () {
SaveWebLink();
});
$("#" + datagrid1.TableID + " input[CommandName='cmdEdit']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
window.open("EBook_ImgUpload.aspx?id=" + model.id);
//window.location.href = "DD_OrderLook.aspx?OrderId=" + model.OrderId;
});
$("#" + datagrid1.TableID + " input[CommandName='cmdEdit2']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
window.open("EBook_ImgUploadPrice.aspx?id=" + model.id);
//window.location.href = "DD_OrderLook.aspx?OrderId=" + model.OrderId;
});
$("#" + datagrid1.TableID + " input[CommandName='cmdLook']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
window.open("EBook_Info.aspx?gocode=" + model.go_code+"&type=1");
//window.location.href = "DD_OrderLook.aspx?OrderId=" + model.OrderId;
});
$("#" + datagrid1.TableID + " input[CommandName='cmdLook2']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
window.open("EBook_Info.aspx?gocode=" + model.go_code+"&type=2");
//window.location.href = "DD_OrderLook.aspx?OrderId=" + model.OrderId;
});
$("#" + datagrid1.TableID + " input[CommandName='cmdDel']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
Delete(model.id);
});
// $("#" + datagrid1.TableID + " input[CommandName='cmdCopy']").live("click", function () {
// var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
// var model = datagrid1.Get_Model(RowIndex);
//var Url2=document.getElementById("txt_"+model.id);
//Url2.select(); // 选择对象
//document.execCommand("Copy"); // 执行浏览器复制命令
//alert("已复制到粘贴板,可粘贴。");
// });
});
//#region 外链
function SaveWebLink() {
var list = datagrid1.GetSelectListModel();
if (list == null || list.length == 0) {
alert("请选择要生成外链的相册");
return;
}
var param = new Object();
param.list = list;
WindowLoadModel.Show();
$.ajax({
url: "EBookService.asmx/Save_BookWebLink",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
if (data.d != "") {
$("#a_link").html("http://60.12.218.120:8080/EBOOK/EBook_OutList.aspx?code="+data.d);
$("#a_link").attr("href","http://60.12.218.120:8080/EBOOK/EBook_OutList.aspx?code="+data.d);
}
}
});
}
//#endregion
//#region 删除
function Delete(Id) {
if (window.confirm("确定要删除吗?") == false) return;
var param = new Object();
param.id = Id;
WindowLoadModel.Show();
$.ajax({
url: "EBookService.asmx/Delete_BookList",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
if (data.d == false) { alert("已经使用过,无法删除"); return; }
ReadData(); //刷新DataGrid
}
});
}
//#endregion
function ReadData() {
var param = new Object();
param.name = $("#txt_Name").val();
param.sortname = $("#txt_Sort").val();
param.gcname = $("#txt_GCName").val();
param.gccs = "";
param.gcxz = "";
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
param.sort = datagrid1.SortExpression + " " + datagrid1.ViewSortDirection;
WindowLoadModel.Show();
$.ajax({
url: "EBookService.asmx/GetListBookList",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
$("tr[index]").hover(function () {
$(this).find("td").css('background', '#FAF9D2');
}, function () {
$(this).find("td").css('background', '#fff');
});
}
});
}
var good_id = 0;
function fopen() {
$("#_fixTableHeader").hide();
$.fancybox({
'scrolling': 'no',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#test',
'onClosed': function () {
}
}, 0);
}
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "图片";
col.CellTemplate = "<img src='{Bind fristimg}' width='150px' height='150px'/>";
col.SortExpression = "a.good_code";
col.Width = "160px";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "样册名称";
//CommandName='cmdLook'
col.CellTemplate = "<span>{Bind bookname}</span>";
col.SortExpression = "";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "产品类型";
//CommandName='cmdLook'
col.CellTemplate = "<span>{Bind type_name}</span>";
col.SortExpression = "";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "工厂名称";
//CommandName='cmdLook'
col.CellTemplate = "<span>{Bind type_name3}</span>";
col.SortExpression = "";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "所在城市";
//CommandName='cmdLook'
col.CellTemplate = "<span>{Bind type_name4}</span>";
col.SortExpression = "";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "工厂性质";
//CommandName='cmdLook'
col.CellTemplate = "<span>{Bind type_name5}</span>";
col.SortExpression = "";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "备注";
//CommandName='cmdLook'
col.CellTemplate = "<div>{Bind remark}</div>";
col.SortExpression = "";
Array.add(datagrid1.Columns, col);
// col = new nblf.ui.DataGridColumn();
//col.HeaderText = "访问地址";
////CommandName='cmdLook'
//col.Width = "200px";
//col.CellTemplate = "<input type='text' value='{Bind url}' id='txt_{Bind id}' /><br/><input CommandName='cmdCopy' class='layui-btn' type='button' value='复制链接' />";
//col.SortExpression = "";
//Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "";
col.Width = "250px";
col.CellTemplate = "<input CommandName='cmdLook' class='layui-btn' style='background-color:green;border:solid 3px green;' type='button' value='查看相册' /> &nbsp;&nbsp;<input CommandName='cmdLook2' class='layui-btn' style='background-color:green;border:solid 3px green;' type='button' value='查看报价单' /> &nbsp;";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "350px";
col.CellTemplate = "<input CommandName='cmdEdit' class='layui-btn' type='button' value='编辑相册'/> &nbsp;<input CommandName='cmdEdit2' class='layui-btn' type='button' value='编辑报价单'/> &nbsp;&nbsp;<input CommandName='cmdDel' class='layui-btn' style='background-color:red;border:solid 3px red;' type='button' value='删除'/>";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(30);
datagrid1.SetPageIndex(1);
datagrid1.SortExpression = "";
datagrid1.ViewSortDirection = "";
datagrid1.IsFixHeader = false;
// datagrid1.Height = $(document).height() - 330;
datagrid1.ShowIndexColumn = true;
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();
});
datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
var newCount = 1;
function addHoverDom(treeId, treeNode) {
var sObj = $("#" + treeNode.tId + "_span");
if (treeNode.editNameFlag || $("#addBtn_" + treeNode.tId).length > 0) return;
var addStr = "<span class='button add' id='addBtn_" + treeNode.tId
+ "' title='add node' onfocus='this.blur();'></span>";
sObj.after(addStr);
var btn = $("#addBtn_" + treeNode.tId);
if (btn) btn.bind("click", function () {
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
zTree.addNodes(treeNode, { id: (100 + newCount), pId: treeNode.id, name: "new node" + (newCount++) });
return false;
});
};
function removeHoverDom(treeId, treeNode) {
$("#addBtn_" + treeNode.tId).unbind().remove();
};
//-->
</script>
<style>
.td_f1 {
font-size: 11pt;
text-align: center;
}
.auto-style1 {
height: 34px;
}
</style>
</head>
<body class="headbody">
<div style="display: none">
<div id="test" title="货物图片" style="width: 400px; height: 300px;">
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
<tr>
<td align="center" class="td_f1" width="40%">
平台
</td> <td>
<select id="select_plat2" class="selectClass" style="width: 99%;" name="D8">
</select>
</td>
</tr>
<tr>
<td align="center" class="td_f1">
店铺
</td> <td>
<select id="select_shop2" class="selectClass" style="width: 99%;" name="D8">
</select>
</td>
</tr>
<tr>
<td align="center" class="td_f1">
引用刊登包模板
</td> <td>
<select id="select_shop3" class="selectClass" style="width: 99%;" name="D8">
</select>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="button" value="刊登发布" class="layui-btn" onclick="SaveOrderLJ();" />
</td>
</tr>
</table>
</div>
</div>
<table class="tableAll" style="width: 100%;">
<tr>
<td width="100%" valign="top">
<table id="tb1" class="tableAll" style="width: 100%;">
<%-- <tr>
<td colspan="7">
<input id="btn_goods" class="layui-btngray" type="button" value="产品库列表" />
<input statetype="2" class="layui-btn" type="button" value="我的刊登记录" />
</td>
</tr>--%>
<tr>
<td class="td_f1" width="10%">
样册名称</td>
<td>
<input id="txt_Name" class="editTextbox" style="width: 220px;" type="text" /> </td>
<td class="td_f1" width="10%">
工厂名称</td>
<td>
<input id="txt_GCName" class="editTextbox" style="width: 220px;" type="text" /> </td>
<td class="td_f1" style="width: 10%;">产品分类:</td>
<td width="15%">
<input id="txt_Sort" class="editTextbox" style="width: 220px;" type="text" /></td>
<td><input id="btn_sch" class="layui-btnblue" type ="button" value="查询" /></td>
</tr>
<tr>
<td colspan="7"><input id="btn_add" class="layui-btnblue" type="button" value="新增电子样册" />&nbsp;&nbsp;&nbsp; <input id="btn_excel0" class="layui-btnblue" type="button" value="打包图片" style="display:none" /><input id="btn_add2" class="layui-btnblue" type="button" value="生成外链" />&nbsp; 外链地址:<a id="a_link" target="_blank" href=""></a></td>
</tr>
<tr>
<td valign="top" colspan="7" class="auto-style1">
<div id="DataGrid1" class="DataGridStyle" ></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>