Authored by kun

新增html页面

... ... @@ -25,4 +25,12 @@ file.maxsize = 209715200
dataSource.URL = jdbc:mysql://192.168.102.219:3306/yh_jobmanager?useUnicode=true&characterEncoding=UTF-8&testConnectionOnCheckout=false&testConnectionOnCheckin=true&idleConnectionTestPeriod=60
dataSource.user = yh_test
dataSource.password = 9nm0icOwt6bMHjMusIfMLw==
\ No newline at end of file
dataSource.password = 9nm0icOwt6bMHjMusIfMLw==
file.saveDir=E:\\
qiniu.accesskey=atSf7xxIl8alEnsXbhC1bOD1GWVW3qYffz8SlB4m
qiniu.secretkey=pyoJzPygXIkFWrc1BAsH6tAJ0yweTchpJwGKEwhm
file.image.size=512000
file.image.gif.size=2621440
qiniu.bucket=goodsimg
\ No newline at end of file
... ...
... ... @@ -25,4 +25,11 @@ rabbit_message_center_vhost = ${rabbit_message_center_vhost}
dataSource.URL = ${yoho.quartz.datasource.url}
dataSource.user = ${yoho.quartz.datasource.username}
dataSource.password = ${yoho.quartz.datasource.password}
\ No newline at end of file
dataSource.password = ${yoho.quartz.datasource.password}
file.saveDir=${file.saveDir}
qiniu.accesskey=${qiniu.accesskey}
qiniu.secretkey=${qiniu.secretkey}
file.image.size=${file.image.size}
file.image.gif.size=${file.image.gif.size}
qiniu.bucket=${qiniu.bucket}
\ No newline at end of file
... ...
... ... @@ -25,21 +25,11 @@
}
</style>
<div style="margin-left: 30px;" class="div_search">
<a id="addBrand" class="easyui-linkbutton btn-success">添加品牌</a>
</div>
<div style="margin-left: 30px;" class="div_search">
<input id="brandName" type="text">
<input id="brandStatus" class="easyui-combobox" value="" data-options="
editable: false,
valueField: 'id',
textField: 'text',
data: [{
id: '',
text: '选择状态'
}, {
id: '1',
text: '开启'
}, {
id: '2',
text: '关闭'
}]"/>
<input id="brandStatus" type="text"/>
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
<a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a>
... ... @@ -52,7 +42,15 @@
</div>
<script type="text/javascript">
var brandId;
$(function () {
$('#addBrand').linkbutton({
iconCls: "icon-edit",
onClick: function () {
editRow(0);
}
});
$.ajax({
contentType: "application/json",
... ... @@ -76,18 +74,31 @@
}
});
$("#brandStatus").myCombobox({
prompt: "选择状态",
width: 200,
data: [{
id: '1',
text: '开启'
}, {
id: '2',
text: '关闭'
}],
valueField: "id",
textField: "text"
});
var brandMyDatagrid = $("#brandTable");
brandMyDatagrid.myDatagrid({
$("#brandTable").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/brand/getBrandPageList",
method: 'POST',
queryParams: {
/*queryParams: {
'brandName':'',
'status':''
},
},*/
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
... ... @@ -103,25 +114,19 @@
field: "brandLogo",
width: 80,
align: "center",
formatter: function (value, rowData) {
return rowData.askUserName + "(" + rowData.askUserId + ")";
formatter: function (value) {
return '<img src="' + value + '" style="width:98px;height:98px"/></a>';
}
}, {
title: "品牌名称",
field: "brandName",
width: 100,
align: "center",
formatter: function (value, rowData) {
return "<a href='" + rowData.productUrl + "' target='_blank'>" + rowData.productName + "</a><br>SKN:" + rowData.skn + "<br>品牌:" + brandDataObj[rowData.brandId];
}
align: "center"
}, {
title: "英文名称",
field: "brandNameEn",
width: 80,
align: "center",
formatter: function (value, rowData) {
return "大类:" + rowData.maxSortName + "<br>中类:" + rowData.middleSortName + "<br>小类:" + rowData.smallSortName;
}
align: "center"
}, {
title: "品牌搜索词",
field: "brandSearch",
... ... @@ -178,7 +183,7 @@
$(this).myDatagrid("getPanel").find("a[role='closeBrand']").linkbutton({
iconCls: "icon-more",
onClick: function () {
deleteRow($(this).attr("dataId"));
updateBrandStatus($(this).attr("dataId"), 2);
}
});
... ... @@ -186,7 +191,7 @@
$(this).myDatagrid("getPanel").find("a[role='openBrand']").linkbutton({
iconCls: "icon-more",
onClick: function () {
deleteRow($(this).attr("dataId"));
updateBrandStatus($(this).attr("dataId"), 1);
}
});
}
... ... @@ -197,7 +202,7 @@
$("#searchLinkButton").linkbutton({
onClick: function () {
var param = getParams();
brandMyDatagrid.myDatagrid("load", param);
$("#brandTable").myDatagrid("load", param);
}
});
... ... @@ -205,8 +210,9 @@
$("#searchAllLinkButton").linkbutton({
onClick: function () {
$('#brandStatus').combobox('clear');
$('#brandName').combobox('clear');
var param = {};
brandMyDatagrid.myDatagrid("load", param);
$("#brandTable").myDatagrid("load", param);
}
});
... ... @@ -214,9 +220,8 @@
* 提取出搜索参数
*/
function getParams() {
var brandName = $('#brandName').val();
var brandName = $('#brandName').combobox('getText');
var status = $('#brandStatus').combobox('getValue');
var param = {};
if (undefined !== brandName && null !== brandName && "" !== brandName) {
param.brandName = brandName;
... ... @@ -229,12 +234,17 @@
function editRow(id) {
window.paramObject.id = id;
brandId = id;
var div = $("<div>").appendTo($(document.body));
var title = "编辑品牌";
var message = "确认修改品牌信息吗?";
if (id == 0) {
title = "添加品牌";
message = "确认添加品牌信息吗?";
}
$(div).myDialog({
width: "475px",
height: "267px",
width: "800px",
height: "500px",
title: title,
href: contextPath + "/html/brandManage/editBrand.html",
queryParams: {
... ... @@ -247,93 +257,83 @@
id: "saveBtn",
text: "保存",
handler: function () {
$("#consult_reply_form").form("submit", {
url: contextPath + "/operations/consult/reply",
onSubmit: function () {
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
$.messager.confirm("确认", message, function (flag) {
if(flag) {
var url = contextPath + "/brand/saveOrUpdateBrand";
$("#brandEditForm").form("submit", {
url: url,
onSubmit: function () {
if (!$("#brandEditForm").form("validate")) {
return false;
}
if ($("#brandEditForm #imageUpload").imageUpload("getValue") == null || $("#brandEditForm #imageUpload").imageUpload("getValue") == "") {
$.messager.alert("失败", "请上传图片", "error");
return false;
}
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后..."
});
return true;
},
success: function (data) {
$.messager.progress("close");
data = JSON.parse(data);
if (data.code == 200) {
$(div).dialog("close");
$("#brandTable").myDatagrid("reload");
$.messager.show({
title: "提示",
msg: title + "成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}
});
return true;
},
success: function (data) {
$.messager.progress("close");
data = JSON.parse(data);
if (data.code == 200) {
$(div).dialog("close");
$("#brandTable").myDatagrid("reload");
$.messager.show({
title: "提示",
msg: title + "成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}
});
}
}, {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$(div).dialog("close");
}
}]
});
}
function deleteRow(id) {
if (undefined === id || null === id || "" === id) {
$.messager.alert("提示消息", "请选择要删除的咨询!");
return;
}
$.messager.confirm("确认", "确认要删除该咨询吗?", function (flag) {
if (flag) {
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
$.post(contextPath + "/operations/consult/del?id=" + id, function (data) {
$.messager.progress("close");
if (data.code == 200) {
$("#brandTable").myDatagrid("reload");
$.messager.show({
title: "提示",
msg: "删除成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}, "json");
}
});
}
function restoreRow(id) {
if (undefined === id || null === id || "" === id) {
$.messager.alert("提示消息", "请选择要恢复的咨询!");
return;
function updateBrandStatus(id, status) {
var message = "";
var msg = "";
if (status == 1) {
message = "确认要开启品牌吗?";
msg = "开启品牌成功!";
} else {
message = "确认要关闭品牌吗?";
msg = "关闭品牌成功!";
}
$.messager.confirm("确认", "确认要恢复该咨询吗?", function (flag) {
window.top.$.messager.confirm("确认", message, function (flag) {
if (flag) {
$.messager.progress({
window.top.$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
$.post(contextPath + "/operations/consult/restore?id=" + id, function (data) {
$.messager.progress("close");
$.post(contextPath + "/brand/updateBrandStatus",{"id":id, "status":status}, function (data) {
window.top.$.messager.progress("close");
if (data.code == 200) {
$("#brandTable").myDatagrid("reload");
$.messager.show({
window.top.$.messager.show({
title: "提示",
msg: "恢复成功!",
msg: msg,
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
window.top.$.messager.alert("失败", data.message, "error");
}
}, "json");
}
... ...
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
<form name="activityAddForm" id="activityAddForm" method="post" enctype="multipart/form-data">
<form name="brandEditForm" id="brandEditForm" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" id="id"/>
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
<td width="10%"><span style="color:red">*</span><label>品牌名称</label></td>
<td>
<input class="easyui-combobox" id="brandName" name="brandName" style="width: 380px;">
</input>
<input class="easyui-textbox" id="brandName" name="brandName" data-options="validType:'length[1,50]'" style="width: 380px;"/>
</td>
</tr>
<tr style="height: 60px">
<td width="10%"><span style="color:red">*</span>英文名称</td>
<td width="50%">
<input id="brandNameEn" name="brandNameEn" class="easyui-textbox" style="width: 380px;"/></td>
<input id="brandNameEn" name="brandNameEn" class="easyui-textbox" data-options="validType:'length[1,100]'" style="width: 380px;"/></td>
</tr>
<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span>品牌LOGO</td>
... ... @@ -29,7 +27,8 @@
<tr class="coupon" style="height: 60px">
<td width="10%"></span>品牌搜索词</td>
<td width="50%">
<input id="couponId" type="number" name="couponId" class="easyui-textbox" style="width: 380px;" />
<input id="brandSearch" name="brandSearch" class="easyui-textbox" data-options="validType:'length[0, 500]'" style="width: 380px;"/>
<div style="color: #ab1e1e;margin-top: 20px">*多个搜索词中间用英文逗号分隔</div>
</tr>
</table>
</div>
... ... @@ -37,21 +36,32 @@
</div>
<script>
$(function () {
function getStrLength(str) {
var cArr = str.match(/[^\x00-\xff]/ig);
return str.length + (cArr == null ? 0 : cArr.length);
}
// 隐藏域赋值
$('#brandEditForm #id').val(brandId);
$(function () {
$("#brandEditForm #brandName").textbox({
required: true,
missingMessage: "品牌名称不能为空",
prompt: "品牌名称"
//width: 240
});
$("#brandEditForm #brandNameEn").textbox({
required: true,
missingMessage: "英文名称不能为空",
prompt: "英文名称"
//width: 240
});
$("#imageUpload").imageUpload({
$("#brandEditForm #imageUpload").imageUpload({
width: 171,
height: 120,
realInputName: "url",
realInputName: "brandLogo",
url: contextPath + '/fileupload/uploadFile',
queryParams: {
bucket: "activity"
bucket: "goodsimg"
},
onBeforeSubmit: function () {
$.messager.progress({
... ... @@ -62,10 +72,9 @@
});
},
filterFileName: function (data) {
debugger;
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误",data.message);
$.messager.alert("错误", data.message);
return "";
}
return data.data.url;
... ... @@ -76,87 +85,14 @@
}
});
// 名称不能为空
$("#rewardName").textbox({
required: true,
missingMessage: "奖品名称不能为空",
prompt: "请输入奖品名称(不能超过30个字)",
onChange: function(data){
if (data!="" && getStrLength(data) > 30) {
$.messager.alert("提示", "奖品名称长度不能超过30个字", "info");
$("#rewardName").focus();
$("#rewardName").textbox("setValue","");
}
}
});
// 奖品总数不能为空
$("#totalNum").textbox({
required: true,
missingMessage: "奖品总数不能为空",
prompt: "请输入奖品数量(正整数)",
onChange: function(data){
if(data != "" && Number(data) <= 1 ){
$.messager.alert("提示", "奖品总数必须不小于1!", "info");
$("#totalNum").textbox("setValue","");
}
}
});
// 中奖率不能为空
$("#probability").textbox({
required: true,
missingMessage: "中奖率不能为空",
prompt: "请输入中奖概率(小于100的正整数)",
onChange: function(data){
if(data != "" && (Number(data) <= 0 || Number(data) > 100)){
$.messager.alert("提示", "中奖率必须大于0小于100!", "info");
$("#probability").textbox("setValue","");
}
}
});
$("#orderTime").textbox({
required: false,
prompt: "必须大于0",
onChange: function(data){
if(data < 0){
$.messager.alert("提示", "天数必须大于0!", "info");
$("#orderTime").textbox("setValue","");
}
}
});
$("#minOrderAmount").textbox({
required: false,
prompt: "必须大于0",
onChange: function(data){
var max = $("#minOrderAmount").textbox("getValue");
if(data != "" && Number(data) < 0){
$.messager.alert("提示", "金额必须大于0!", "info");
$("#minOrderAmount").textbox("setValue","");
}
if(Number(data) > Number(max)){
$.messager.alert("提示", "金额必须小于最大值!", "info");
$("#minOrderAmount").textbox("setValue","");
}
}
});
$("#maxOrderAmount").textbox({
required: false,
prompt: "大于最小值",
onChange: function(data){
debugger
var min = $("#minOrderAmount").textbox("getValue");
if(data != "" && Number(data) < 0){
$.messager.alert("提示", "金额必须大于0!", "info");
$("#maxOrderAmount").textbox("setValue","");
}
if(data != "" && Number(data) <Number(min)){
$.messager.alert("提示", "金额必须大于最小值!", "info");
$("#maxOrderAmount").textbox("setValue","");
}
}
});
if (brandId > 0) {
$.post(contextPath + "/brand/getBrandById", {
id: brandId
}, function (data) {
$("#brandEditForm").form("load", data.data);
$("#brandEditForm #imageUpload").imageUpload("setValue", data.data.brandLogo);
});
}
});
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
<form name="productColorEditForm" id="productColorEditForm" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" id="id"/>
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
<td width="10%"><span style="color:red">*</span><label>颜色名称</label></td>
<td>
<input class="easyui-textbox" id="colorName" name="colorName" data-options="validType:'length[1,50]'" style="width: 380px;"/>
</td>
</tr>
<tr style="height: 60px">
<td width="10%"><span style="color:red">*</span>颜色代码</td>
<td width="50%">
<input id="colorCode" name="colorCode" class="easyui-textbox" data-options="validType:'length[1,6]'" style="width: 380px;"/></td>
</tr>
<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span>颜色值</td>
<td>
<div id="imageUpload">
</div>
</td>
</tr>
</table>
</div>
</form>
</div>
<script>
$(function () {
// 隐藏域赋值
$('#productColorEditForm #id').val(colorId);
$("#productColorEditForm #colorName").textbox({
required: true,
missingMessage: "颜色名称不能为空",
prompt: "请输入"
//width: 240
});
$("#productColorEditForm #colorCode").textbox({
required: true,
missingMessage: "颜色代码不能为空",
prompt: "请输入"
//width: 240
});
$("#productColorEditForm #imageUpload").imageUpload({
width: 171,
height: 120,
realInputName: "colorValue",
url: contextPath + '/fileupload/uploadFile',
queryParams: {
bucket: "goodsimg"
},
onBeforeSubmit: function () {
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data.url;
},
onLoadSuccess: function (data) {
$.messager.progress("close");
return false;
}
});
if (colorId > 0) {
$.post(contextPath + "/productColor/getProductColorById", {
id: colorId
}, function (data) {
$("#productColorEditForm").form("load", data.data);
$("#productColorEditForm #imageUpload").imageUpload("setValue", data.data.colorValue);
});
}
});
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
<script src="/ufoPlatform/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="height: 230px">
<script>
document.write(addHead('商品基础规则 /颜色库', ''));
</script>
<style>
.div_search input {
margin-top: 20px;
}
.div_search .textbox {
margin-top: 20px;
}
.div_search .easyui-linkbutton {
margin-top: 20px;
}
</style>
<div style="margin-left: 30px;" class="div_search">
<a id="addProductColor" class="easyui-linkbutton btn-success">添加颜色</a>
</div>
<div style="margin-left: 30px;" class="div_search">
<input id="colorName" type="text">
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
<a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a>
</div>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px;height: 660px">
<table id="colorTable"></table>
</div>
</div>
<script type="text/javascript">
var colorId;
$(function () {
$('#addProductColor').linkbutton({
iconCls: "icon-edit",
onClick: function () {
editRow(0);
}
});
$("#colorName").textbox({
prompt: "颜色名称"
});
$("#colorTable").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/productColor/getProductSortPageList",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "ID",
field: "id",
width: 40,
align: "center"
}, {
title: "颜色名称",
field: "colorName",
width: 80,
align: "center"
}, {
title: "颜色代码",
field: "colorCode",
width: 100,
align: "center"
}, {
title: "颜色值",
field: "colorValue",
width: 80,
align: "center",
formatter: function (value) {
if (value ==null || value == '' || value ==undefined){
return '';
}
return '<img src="' + value + '" style="width:98px;height:98px"/></a>';
}
}, {
title: "操作",
field: "operations",
width: 80,
align: "center",
formatter: function (value, rowData) {
return "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px'>编辑</a>";
}
}]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function () {
// 编辑
$(this).myDatagrid("getPanel").find("a[role='edit']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
var id = $(this).attr("dataId");
editRow(id);
}
});
}
});
// 搜索
$("#searchLinkButton").linkbutton({
onClick: function () {
$("#colorTable").myDatagrid("load", {"colorName": $('#colorName').textbox('getValue')});
}
});
// 搜索全部
$("#searchAllLinkButton").linkbutton({
onClick: function () {
$('#colorName').textbox('clear');
$("#colorTable").myDatagrid("load", {});
}
});
function editRow(id) {
colorId = id;
var div = $("<div>").appendTo($(document.body));
var title = "编辑颜色";
var message = "确认修改颜色信息吗?";
if (id == 0) {
title = "添加颜色";
message = "确认添加颜色信息吗?";
}
$(div).myDialog({
width: "800px",
height: "500px",
title: title,
href: contextPath + "/html/commodityBasicRules/color/productColorEdit.html",
queryParams: {
id: id
},
modal: true,
collapsible: true,
cache: false,
buttons: [{
id: "saveBtn",
text: "保存",
handler: function () {
$.messager.confirm("确认", message, function (flag) {
if(flag) {
var url = contextPath + "/productColor/saveOrUpdateProductColor";
$("#productColorEditForm").form("submit", {
url: url,
onSubmit: function () {
if (!$("#productColorEditForm").form("validate")) {
return false;
}
if ($("#productColorEditForm #imageUpload").imageUpload("getValue") == null || $("#productColorEditForm #imageUpload").imageUpload("getValue") == "") {
$.messager.alert("失败", "请上传图片", "error");
return false;
}
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后..."
});
return true;
},
success: function (data) {
$.messager.progress("close");
data = JSON.parse(data);
if (data.code == 200) {
$(div).dialog("close");
$("#colorTable").myDatagrid("reload");
$.messager.show({
title: "提示",
msg: title + "成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}
});
}
});
}
}, {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$(div).dialog("close");
}
}]
});
}
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
<form name="categoryEditForm" id="categoryEditForm" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" id="productSortId"/>
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span><label>品类名称</label></td>
<td>
<input class="easyui-textbox" id="sortName" name="sortName" data-options="validType:'length[1,30]'" style="width: 380px;"/>
</td>
</tr>
</table>
</div>
</form>
</div>
<script>
$(function () {
$("#categoryEditForm #sortName").textbox({
required: true,
missingMessage: "品类名称不能为空",
prompt: "请输入",
width: 240
});
if (productSortId > 0) {
$.post(contextPath + "/productSort/getProductSortById", {
id: productSortId
}, function (data) {
$("#categoryEditForm").form("load", data.data);
});
}
});
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
<script src="/ufoPlatform/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="height: 230px">
<script>
document.write(addHead('商品基础规则 /物理类目管理', ''));
</script>
<style>
.div_search input {
margin-top: 20px;
}
.div_search .textbox {
margin-top: 20px;
}
.div_search .easyui-linkbutton {
margin-top: 20px;
}
</style>
<div style="margin-left: 30px;" class="div_search">
<a id="addCategory" class="easyui-linkbutton btn-success">添加品类</a>
</div>
<div style="margin-left: 30px;" class="div_search">
<input id="sortName" type="text">
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
<a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a>
</div>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px;height: 660px">
<table id="productSortTable"></table>
</div>
</div>
<script type="text/javascript">
var productSortId;
$(function () {
$("#sortName").textbox({
prompt: "品类名称",
width: 200
});
$('#addCategory').linkbutton({
iconCls: "icon-edit",
onClick: function () {
editRow(0);
}
});
$("#productSortTable").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/productSort/getProductSortPageList",
method: 'POST',
/*queryParams: {
'sortName':''
},*/
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "品类ID",
field: "id",
width: 40,
align: "center"
}, {
title: "品类名称",
field: "sortName",
width: 80,
align: "center"
}, {
title: "状态",
field: "status",
width: 80,
align: "center",
formatter: function (value) {
if (value == 0) {
return '开启';
}
return '关闭';
}
}, {
title: "操作",
field: "operations",
width: 80,
align: "center",
formatter: function (value, rowData) {
var str = "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px'>编辑</a>";
if (0 == rowData.status) {
str += "<a role='closeProductName' dataId='" + rowData.id + "' style='margin-left:10px'>关闭</a>";
} else {
str += "<a role='openProductName' dataId='" + rowData.id + "' style='margin-left:10px'>开启</a>";
}
return str;
}
}]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function () {
// 编辑
$(this).myDatagrid("getPanel").find("a[role='edit']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
var id = $(this).attr("dataId");
editRow(id);
}
});
// 关闭品牌
$(this).myDatagrid("getPanel").find("a[role='closeProductName']").linkbutton({
iconCls: "icon-more",
onClick: function () {
updateBrandStatus($(this).attr("dataId"), 1);
}
});
// 开启品牌
$(this).myDatagrid("getPanel").find("a[role='openProductName']").linkbutton({
iconCls: "icon-more",
onClick: function () {
updateBrandStatus($(this).attr("dataId"), 0);
}
});
}
});
// 搜索
$("#searchLinkButton").linkbutton({
onClick: function () {
$("#productSortTable").myDatagrid("load", {"sortName": $('#sortName').textbox('getValue')});
}
});
// 搜索全部
$("#searchAllLinkButton").linkbutton({
onClick: function () {
$('#sortName').textbox('clear');
$("#productSortTable").myDatagrid("load", {});
}
});
function editRow(id) {
productSortId = id;
var div = $("<div>").appendTo($(document.body));
var title = "编辑品类";
var message = "确认修改品类信息吗?";
if (id == 0) {
title = "添加品类";
message = "确认添加品类信息吗?";
}
$(div).myDialog({
width: "450px",
height: "200px",
title: title,
href: contextPath + "/html/commodityBasicRules/physicalCategory/physicalCategoryManagementEdit.html",
queryParams: {
id: id
},
modal: true,
collapsible: true,
cache: false,
buttons: [{
id: "saveBtn",
text: "保存",
handler: function () {
$.messager.confirm("确认", message, function (flag) {
if(flag) {
$("#categoryEditForm").form("submit", {
url: contextPath + "/productSort/saveOrUpdateProductSort",
onSubmit: function () {
if (!$("#categoryEditForm").form("validate")) {
return false;
}
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后..."
});
return true;
},
success: function (data) {
$.messager.progress("close");
data = JSON.parse(data);
if (data.code == 200) {
$(div).dialog("close");
$("#productSortTable").myDatagrid("reload");
$.messager.show({
title: "提示",
msg: title + "成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}
});
}
});
}
}, {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$(div).dialog("close");
}
}]
});
}
function updateBrandStatus(id, status) {
var message = "";
var msg = "";
if (status == 1) {
message = "确认要开启品牌吗?";
msg = "开启品牌成功!";
} else {
message = "确认要关闭品牌吗?";
msg = "关闭品牌成功!";
}
window.top.$.messager.confirm("确认", message, function (flag) {
if (flag) {
window.top.$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
$.post(contextPath + "/productSort/updateProductSortStatus",{"id":id, "status":status}, function (data) {
window.top.$.messager.progress("close");
if (data.code == 200) {
$("#productSortTable").myDatagrid("reload");
window.top.$.messager.show({
title: "提示",
msg: msg,
height: 120
});
} else {
window.top.$.messager.alert("失败", data.message, "error");
}
}, "json");
}
});
}
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
<form name="sizeEditForm" id="sizeEditForm" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" id="id"/>
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
<td width="10%"><span style="color:red">*</span><label>分类</label></td>
<td>
<input id="sortId" name="sortId" style="width: 380px;"/>
</td>
</tr>
<tr style="height: 60px">
<td width="10%"><span style="color:red">*</span>尺码名</td>
<td width="50%">
<input id="sizeName" name="sizeName" class="easyui-textbox" data-options="validType:'length[1,20]'" style="width: 380px;"/></td>
</tr>
<tr style="height: 60px">
<td width="10%"><span style="color:red">*</span>排序值</td>
<td width="50%">
<input id="orderBy" name="orderBy" class="easyui-numberbox" data-options="validType:'length[1,10]'" style="width: 380px;"/></td>
</tr>
</table>
</div>
</form>
</div>
<script>
$(function () {
$("#sizeEditForm #orderBy").numberbox({
required: true,
precision:0,
min:1,
missingMessage: "排序值不能为空",
prompt: "请输入",
width: 200
});
// 隐藏域字段赋值
$('#sizeEditForm #id').val(sizeId);
$.ajax({
contentType: "application/json",
dataType: "json",
type: "GET",
url: contextPath + '/productSort/getProductSortIdAndName',
success: function (data) {
if (data.code != 200 || !data.data || data.data.length == 0) {
return;
}
$("#sizeEditForm #sortId").myCombobox({
prompt: "选择分类",
width: 200,
data: data.data,
valueField: "id",
textField: "text"
});
}
});
$("#sizeEditForm #sizeName").textbox({
required: true,
missingMessage: "尺码名不能为空",
prompt: "请输入",
width: 200
});
if (sizeId > 0) {
$.post(contextPath + "/size/getSizeById", {
id: sizeId
}, function (data) {
$("#sizeEditForm").form("load", data.data);
$("#sizeEditForm #sortId").myCombobox('select', data.data.sortId);
});
}
});
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
<script src="/ufoPlatform/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="height: 230px">
<script>
document.write(addHead('商品基础规则 /尺码库', ''));
</script>
<style>
.div_search input {
margin-top: 20px;
}
.div_search .textbox {
margin-top: 20px;
}
.div_search .easyui-linkbutton {
margin-top: 20px;
}
</style>
<div style="margin-left: 30px;" class="div_search">
<a id="addSize" class="easyui-linkbutton btn-success">添加尺码</a>
</div>
<div style="margin-left: 30px;" class="div_search">
<input id="sizeName" type="text">
<input id="sortName" type="text"/>
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
<a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a>
</div>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px;height: 660px">
<table id="sizeTable"></table>
</div>
</div>
<script type="text/javascript">
var sizeId;
$(function () {
$("#sizeName").textbox({
prompt: "尺码名称"
});
$('#addSize').linkbutton({
iconCls: "icon-edit",
onClick: function () {
editRow(0);
}
});
$.ajax({
contentType: "application/json",
dataType: "json",
type: "GET",
url: contextPath + '/productSort/getProductSortIdAndName',
success: function (data) {
if (data.code != 200 || !data.data || data.data.length == 0) {
return;
}
$("#sortName").myCombobox({
prompt: "选择分类",
width: 200,
data: data.data,
valueField: "id",
textField: "text"
});
}
});
$("#sizeTable").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/size/getProductSortPageList",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "尺码ID",
field: "id",
width: 40,
align: "center"
}, {
title: "尺码名",
field: "sizeName",
width: 80,
align: "center"
}, {
title: "所属分类",
field: "sortName",
width: 100,
align: "center",
}, {
title: "操作",
field: "operations",
width: 80,
align: "center",
formatter: function (value, rowData) {
return "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px'>编辑</a>";
}
}]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function () {
// 编辑
$(this).myDatagrid("getPanel").find("a[role='edit']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
var id = $(this).attr("dataId");
editRow(id);
}
});
}
});
// 搜索
$("#searchLinkButton").linkbutton({
onClick: function () {
$("#sizeTable").myDatagrid("load",
{
"sizeName": $('#sizeName').textbox('getValue'),
"sortName": $('#sortName').combobox("getText")
});
}
});
// 搜索全部
$("#searchAllLinkButton").linkbutton({
onClick: function () {
$('#sizeName').textbox('clear');
$('#sortName').combobox('clear');
$("#sizeTable").myDatagrid("load", {});
}
});
function editRow(id) {
sizeId = id;
var div = $("<div>").appendTo($(document.body));
var title = "编辑尺码";
var message = "确认修改尺码信息吗?";
if (id == 0) {
title = "添加尺码";
message = "确认添加尺码信息吗?";
}
$(div).myDialog({
width: "500px",
height: "360px",
title: title,
href: contextPath + "/html/commodityBasicRules/size/sizeEdit.html",
queryParams: {
id: id
},
modal: true,
collapsible: true,
cache: false,
buttons: [{
id: "saveBtn",
text: "保存",
handler: function () {
$.messager.confirm("确认", message, function (flag) {
if (flag) {
var sortId = $('#sizeEditForm #sortId').combobox("getValue");
if (sortId == '' || sortId == null || sortId == undefined) {
$.messager.alert("提示", '请选择分类!', "error");
return false;
}
var url = contextPath + "/size/saveOrUpdateSize";
$("#sizeEditForm").form("submit", {
url: url,
onSubmit: function () {
if (!$("#sizeEditForm").form("validate")) {
return false;
}
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后..."
});
return true;
},
success: function (data) {
$.messager.progress("close");
data = JSON.parse(data);
if (data.code == 200) {
$(div).dialog("close");
$("#sizeTable").myDatagrid("reload");
$.messager.show({
title: "提示",
msg: title + "成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}
});
}
});
}
}, {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$(div).dialog("close");
}
}]
});
}
});
</script>
</body>
</html>
\ No newline at end of file
... ...