|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_GoodsSort.aspx.cs" Inherits="TradeManage.HuoWu.HW_GoodsSort" %>
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head id="Head1">
|
|
|
|
|
<title>货物分类</title>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
|
|
|
|
|
<link href="../themes/default/easyui.css" rel="stylesheet" type="text/css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/uploadify.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/DateBox.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 type="text/javascript" src="../Scripts/uploadify/jquery.uploadify.js"></script>
|
|
|
|
|
<script src="../Scripts/ajaxfileupload.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/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 src="../Scripts/Global.js" type="text/javascript"></script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SortId = 0;
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
ajaxInit(null);
|
|
|
|
|
$("#Select_depts").bind("change", function () {
|
|
|
|
|
|
|
|
|
|
ReadUsers();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ReadListMenu();
|
|
|
|
|
ReadSortTree();
|
|
|
|
|
|
|
|
|
|
$("#btn_Del").bind("click", function () {
|
|
|
|
|
|
|
|
|
|
DelSort();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
$("#btn_addsort").bind("click", function () {
|
|
|
|
|
|
|
|
|
|
SortId = 0;
|
|
|
|
|
$("#Select_ParentSort").combotree("setValue", -1);
|
|
|
|
|
$("#txt_flbh").val("");
|
|
|
|
|
$("#lb_title").html("货物分类--新增");
|
|
|
|
|
$("#btn_Save").val("添 加");
|
|
|
|
|
$("#txt_flmc").val("");
|
|
|
|
|
$("#txt_hgm").val("");
|
|
|
|
|
|
|
|
|
|
$("#txt_pxh").val("1");
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function DelSort() {
|
|
|
|
|
if (SortId == 0) {
|
|
|
|
|
|
|
|
|
|
alert("请选一个分类"); return
|
|
|
|
|
}
|
|
|
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
|
|
|
|
|
|
|
|
if (SortId > 0) {
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.SortId = SortId;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "HuoWuService.asmx/DeleteGoodsSort",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d == 1)
|
|
|
|
|
{
|
|
|
|
|
alert('该分类下面还有子分类,请先删除子分类才能删除');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (data.d == 2) {
|
|
|
|
|
alert('该分类下面有对应货物,请先删除货物或者更改货物分类再删除');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
alert('删除成功');
|
|
|
|
|
|
|
|
|
|
ReadListMenu();
|
|
|
|
|
ReadSortTree();
|
|
|
|
|
SortId = 0;
|
|
|
|
|
$("#txt_flbh").val("");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#txt_flmc").val("");
|
|
|
|
|
$("#txt_hgm").val("");
|
|
|
|
|
|
|
|
|
|
$("#txt_pxh").val("1");
|
|
|
|
|
$("#lb_title").html("货物分类--新增");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ListMenu = new Array();
|
|
|
|
|
// var Shtm = new Sys.StringBuilder();
|
|
|
|
|
|
|
|
|
|
//#region 读取菜单
|
|
|
|
|
function ReadListMenu() {
|
|
|
|
|
// var cudata = new Date();
|
|
|
|
|
|
|
|
|
|
ListMenu = new Array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "HuoWuService.asmx/GetGoodsSortList",
|
|
|
|
|
//data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
ListMenu = data.d;
|
|
|
|
|
|
|
|
|
|
BindTreeView();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status) {
|
|
|
|
|
if (status != "success") alert(xhr.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 绑定树菜单
|
|
|
|
|
var Treehtml;
|
|
|
|
|
var TreeSource;
|
|
|
|
|
function BindTreeView() {
|
|
|
|
|
TreeSource = new Array();
|
|
|
|
|
// Treehtml = new Sys.StringBuilder();
|
|
|
|
|
var ListMenus = GetListMenu(null);
|
|
|
|
|
$(ListMenus).each(function () {
|
|
|
|
|
|
|
|
|
|
var childNode = new Array();
|
|
|
|
|
var model = new Array();
|
|
|
|
|
model.id = this.SortId;
|
|
|
|
|
model.text = this.SortName;
|
|
|
|
|
model.state = "open";
|
|
|
|
|
model.checked = false;
|
|
|
|
|
model.iconCls = ".icon-addfolder";
|
|
|
|
|
model.children = childNode;
|
|
|
|
|
|
|
|
|
|
Array.add(TreeSource, model);
|
|
|
|
|
|
|
|
|
|
BindTreeChildNode(model.children, this.SortId);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 绑定子菜单
|
|
|
|
|
var blank = "";
|
|
|
|
|
function BindTreeChildNode(PrevNode, ParentItemId) {
|
|
|
|
|
|
|
|
|
|
var ListMenus = GetListMenu(ParentItemId);
|
|
|
|
|
|
|
|
|
|
$(ListMenus).each(function () {
|
|
|
|
|
var atr = new Object();
|
|
|
|
|
var childNode = new Array();
|
|
|
|
|
var model = new Array();
|
|
|
|
|
model.id = this.SortId;
|
|
|
|
|
model.text = this.SortName;
|
|
|
|
|
|
|
|
|
|
model.iconCls = "icon-Tree";
|
|
|
|
|
model.state = "closed";
|
|
|
|
|
model.checked = false;
|
|
|
|
|
|
|
|
|
|
model.children = childNode;
|
|
|
|
|
|
|
|
|
|
Array.add(PrevNode, model);
|
|
|
|
|
|
|
|
|
|
BindTreeChildNode(model.children, this.SortId);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 返回指定级菜单
|
|
|
|
|
function GetListMenu(ParentItemId) {
|
|
|
|
|
var ListMenus = new Array();
|
|
|
|
|
$(ListMenu).each(function () {
|
|
|
|
|
if (this.ParentId == ParentItemId) {
|
|
|
|
|
var model = new Object();
|
|
|
|
|
model.SortId = this.SortId;
|
|
|
|
|
model.ParentId = this.ParentId;
|
|
|
|
|
model.SortName = this.SortName;
|
|
|
|
|
|
|
|
|
|
Array.add(ListMenus, model);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return ListMenus;
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ReadSortTree() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#tree1').tree({
|
|
|
|
|
data: TreeSource,
|
|
|
|
|
onSelect: function (node) {
|
|
|
|
|
var node = $("#tree1").tree("getSelected");
|
|
|
|
|
$("#btn_Save").val("修改");
|
|
|
|
|
|
|
|
|
|
SortId = node.id;
|
|
|
|
|
$("#lb_title").html("货物分类--编辑");
|
|
|
|
|
ReadSortModel();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
var model = new Object();
|
|
|
|
|
model.id = 0;
|
|
|
|
|
model.text = "-无-";
|
|
|
|
|
model.state = "open";
|
|
|
|
|
model.checked = false;
|
|
|
|
|
model.iconCls = ".icon-addfolder";
|
|
|
|
|
model.children = null;
|
|
|
|
|
|
|
|
|
|
Array.insert(TreeSource, 0, model);
|
|
|
|
|
model = new Object();
|
|
|
|
|
model.id =-1;
|
|
|
|
|
model.text = "选择父级分类";
|
|
|
|
|
model.state = "closed";
|
|
|
|
|
model.checked = false;
|
|
|
|
|
model.iconCls = ".icon-addfolder";
|
|
|
|
|
model.children = null;
|
|
|
|
|
|
|
|
|
|
Array.insert(TreeSource, 0, model);
|
|
|
|
|
$("#Select_ParentSort").combotree({
|
|
|
|
|
data: TreeSource
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
$("#Select_ParentSort").combotree("setValue", -1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#region 读取菜单
|
|
|
|
|
function ReadSortModel() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.SortId = SortId;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "HuoWuService.asmx/GetGoodsSortModel",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$("#txt_flbh").val(data.d.EnglishCode);
|
|
|
|
|
if (data.d.ParentId == null)
|
|
|
|
|
$("#Select_ParentSort").combotree("setValue", 0);
|
|
|
|
|
else
|
|
|
|
|
$("#Select_ParentSort").combotree("setValue", data.d.ParentId);
|
|
|
|
|
$("#txt_flmc").val(data.d.SortName);
|
|
|
|
|
$("#txt_hgm").val(data.d.HGCode);
|
|
|
|
|
|
|
|
|
|
$("#txt_pxh").val(data.d.SortNo);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status) {
|
|
|
|
|
if (status != "success") alert(xhr.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function save() {
|
|
|
|
|
var ParentId = -1;
|
|
|
|
|
|
|
|
|
|
ParentId = $("#Select_ParentSort").combotree("getValue");
|
|
|
|
|
if (ParentId == -1) {
|
|
|
|
|
alert("请选择父级分类,没有父级分类就选无");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//if ($("#txt_flbh").val() == "") {
|
|
|
|
|
// alert("请输入分类编号");
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
if ($('#txt_flmc').val() == "") {
|
|
|
|
|
|
|
|
|
|
alert("请输入分类名称");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#txt_pxh").val()== "") {
|
|
|
|
|
|
|
|
|
|
alert("请输入排序号");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#txt_pxh").val().length > 3)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
alert("排序号不要超过三位");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var param = new Object();
|
|
|
|
|
var model = new Object();
|
|
|
|
|
model.SortId = SortId;
|
|
|
|
|
model.EnglishCode = "H";// $("#txt_flbh").val();
|
|
|
|
|
if (ParentId > 0)
|
|
|
|
|
model.ParentId = ParentId;
|
|
|
|
|
else
|
|
|
|
|
model.ParentId = null;
|
|
|
|
|
if (SortId == model.ParentId)
|
|
|
|
|
{
|
|
|
|
|
alert("上级分类不能选自己")
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
model.Layer = 0;
|
|
|
|
|
model.SortName = $("#txt_flmc").val();
|
|
|
|
|
model.HGCode = $("#txt_hgm").val();
|
|
|
|
|
model.SortCode = $("#txt_flbh").val();
|
|
|
|
|
model.EnglishName = "";
|
|
|
|
|
model.BagFee = $("#txt_bgjs").val();
|
|
|
|
|
model.SortNo = $("#txt_pxh").val();
|
|
|
|
|
model.IsUse =1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param.model = model;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
contentType: "application/json",
|
|
|
|
|
url: "../HuoWuServiceNew.asmx/SaveGoodsSort",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
cache: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d == "-1")
|
|
|
|
|
{
|
|
|
|
|
alert("该分类字母编号已经被同一级别别的类目使用了");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
alert("保存成功");
|
|
|
|
|
ReadListMenu();
|
|
|
|
|
ReadSortTree();
|
|
|
|
|
SortId = 0;
|
|
|
|
|
$("#txt_flbh").val("");
|
|
|
|
|
|
|
|
|
|
$("#btn_Save").val("添 加");
|
|
|
|
|
$("#txt_flmc").val("");
|
|
|
|
|
$("#txt_hgm").val("");
|
|
|
|
|
|
|
|
|
|
$("#txt_pxh").val("1");
|
|
|
|
|
$("#lb_title").html("货物分类--新增");
|
|
|
|
|
$("#Select_ParentSort").combotree("setValue", -1);
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status) {
|
|
|
|
|
if (status != "success") alert(xhr.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<form id="form1" runat="server">
|
|
|
|
|
|
|
|
|
|
<div class="title_ico">
|
|
|
|
|
货物分类</div>
|
|
|
|
|
|
|
|
|
|
<table border="2" cellpadding="0" cellspacing="0" style="width: 99%;" align="center" class="tableAll" >
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width:22%;" class="f1">
|
|
|
|
|
分类名:
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="2" style="font-size:large;background:#ffffff;">
|
|
|
|
|
<label id="lb_title" style="font-size:15px;margin-left:5px;color:red;font-weight:bolder">货物分类--新增</label>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<tr style="background:#ffffff;">
|
|
|
|
|
<td align="left" colspan="3">
|
|
|
|
|
<img alt="" src="../images/add.ico" /><a id="btn_addsort"
|
|
|
|
|
style=" cursor: pointer">新增分类</a> <img alt="" src="../images/Del.gif" /><a id="btn_Del"
|
|
|
|
|
style="cursor: pointer">删除分类</a></td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr style="background:#ffffff;">
|
|
|
|
|
<td style="width: 300px;background:#ffffff;" align="left" valign="top"><div style="height:300px;overflow:auto"> <ul id="tree1" class="easyui-tree" animate="false" dnd="false">
|
|
|
|
|
</ul></div></td>
|
|
|
|
|
<td colspan="2" align="center" valign="top">
|
|
|
|
|
<table border="1" cellpadding="0" cellspacing="0" style="width: 100%;" >
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="120px" >
|
|
|
|
|
<font color="red" style="font-weight:bolder">*</font>
|
|
|
|
|
父级分类:<label id="lb_ParentDept" style="display:none"></label></td>
|
|
|
|
|
<td > <select id="Select_ParentSort" class="easyui-combotree" name="D4" style="width:180px;">
|
|
|
|
|
|
|
|
|
|
</select> <font color="red">注:添加第一级分类的时候这项选无即可</font></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">
|
|
|
|
|
<font color="red" style="font-weight:bolder">*</font> 分类名称:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="txt_flmc" type="text" style="width:200px;" class="selectClass"/>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
<td class="f1" width="120px">
|
|
|
|
|
|
|
|
|
|
分类字母编码:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="txt_flbh" type="text" style="width:150px;" class="selectClass" maxlength="1"/>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">
|
|
|
|
|
海关(HS)码:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="txt_hgm" type="text" style="width:150px;" class="selectClass"/>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">
|
|
|
|
|
排序号
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="txt_pxh" type="text" style="width:80px;" value="1" class="selectClass"/>注意:不要超过3位</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">
|
|
|
|
|
包装费基数:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="txt_bgjs" type="text" style="width:80px;" value="" class="selectClass"/></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2" align="center">
|
|
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="添 加" onclick="save();" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr></table>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|