Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-portal-fe2
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
mingdan.ge
8 years ago
Commit
a466c2d388425b19ad9b339069f243e38ba1e02c
1 parent
4a20ac03
update sort
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
78 deletions
code/apps/category/views/Index.html
code/apps/operations/views/salecategory/Index.html
dist/yohobuy-portal-fe/5.0.2/jquery/category.Index.js
dist/yohobuy-portal-fe/5.0.2/jquery/operations.salecategory.Index.js
code/apps/category/views/Index.html
View file @
a466c2d
...
...
@@ -11,8 +11,8 @@
<div
class=
"panel-col2"
>
<select
name=
"status"
id=
"status"
tabindex=
"-1"
title=
""
class=
"select2-offscreen brandBtn-group"
>
<option
value=
"-1"
>
未选择
</option>
<option
value=
"0"
>
开启
</option>
<option
value=
"1"
>
关闭
</option>
<option
value=
"1"
>
开启
</option>
<option
value=
"0"
>
关闭
</option>
</select>
</div>
<div
class=
"panel-col"
>
...
...
@@ -22,7 +22,7 @@
</div>
</div>
<div
class=
"panel"
>
<div
class=
"panel"
style=
"display: none;"
>
<div
class=
"panel-body nopadding"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered toggle-table"
>
...
...
@@ -88,20 +88,20 @@
<
span
style
=
"width: 15%"
>
品类名称
<
/span
>
<
span
style
=
"width: 10%"
>
品类缩写
<
/span
>
<
span
style
=
"width: 15%"
>
所属分类
<
/span
>
<
span
class
=
"orderby"
width
=
"10%"
>
排序
<
/span
>
<
span
class
=
"status"
width
=
"10%"
>
状态
<
/span
>
<
span
class
=
"operate"
width
=
"20%"
>
操作
<
/span
>
<
span
class
=
"orderby"
style
=
"width: 10%"
>
排序
<
/span
>
<
span
class
=
"status"
style
=
"width: 10%"
>
状态
<
/span
>
<
span
class
=
"operate"
style
=
"width: 20%"
>
操作
<
/span
>
<
/div
>
</script>
<script
type=
"text/template"
id=
"tableTemp2"
>
<
span
class
=
"folder"
style
=
"width: 10%"
><
/span
>
<
span
style
=
"width: 10%"
>
[[
id
]]
<
/span
>
<
span
style
=
"width: 15%"
>
[[
sortName
]]
<
/span
>
<
span
style
=
"width: 10%"
>
[[
sortInitials
]]
<
/span
>
<
span
style
=
"width: 15%"
>
[[
sortLevel
]]
级分类
<
/span
>
<
span
class
=
"orderby"
width
=
"10%"
>
[[
orderBy
]]
<
/span
>
<
span
class
=
"status"
width
=
"10%"
>
[[
if
status
==
"1"
]]
<
b
style
=
"color: #449d44"
>
开启
<
/b>
[
[
/
if
]
]
[
[if status=="0"
]
]<b style="color: #d9534f">关闭</
b
>
[[
/if]]</
span
>
<
span
class
=
"operate"
width
=
"20%"
data
-
id
=
"[[id]]"
data
-
name
=
"[[sortName]]"
>
<
span
style
=
"font-size: 10px;width: 10%"
>
[[
id
]]
<
/span
>
<
span
style
=
"font-size: 10px;width: 15%"
>
[[
sortName
]]
<
/span
>
<
span
style
=
"font-size: 10px;width: 10%"
>
[[
sortInitials
]]
<
/span
>
<
span
style
=
"font-size: 10px;width: 15%"
>
[[
sortLevel
]]
级分类
<
/span
>
<
span
class
=
"orderby"
style
=
"font-size: 10px;width: 10%"
>
[[
orderBy
]]
<
/span
>
<
span
class
=
"status"
style
=
"font-size: 10px;width: 10%"
>
[[
if
status
==
"1"
]]
<
b
style
=
"color: #449d44"
>
开启
<
/b>
[
[
/
if
]
]
[
[if status=="0"
]
]<b style="color: #d9534f">关闭</
b
>
[[
/if]]</
span
>
<
span
class
=
"operate"
style
=
"font-size: 10px;width: 20%"
data
-
id
=
"[[id]]"
data
-
name
=
"[[sortName]]"
>
<
a
class
=
"btn btn-info btn-xs edit-class-btn"
href
=
"/product/class/edit/[[id]]"
>
编辑
<
/a
>
<
b
class
=
"openAndClose"
data
-
id
=
"[[id]]"
data
-
name
=
"[[sortName]]"
>
[[
if
status
==
"1"
]]
<
a
class
=
"btn btn-danger open-close-btn btn-xs close-category"
data
-
status
=
"[[status]]"
href
=
"javascript:;"
>
关闭
<
/a>
[
[
/
if
]
]
...
...
code/apps/operations/views/salecategory/Index.html
View file @
a466c2d
...
...
@@ -3,6 +3,8 @@
<div
class=
"contentpanel"
>
<a
href=
"javascript:;"
id=
"add-root-category"
class=
"btn btn-success"
style=
"margin:10px 0;"
><i
class=
"fa fa-plus"
></i>
添加根分类
</a>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"panel-col2"
>
...
...
@@ -18,8 +20,6 @@
</div>
</div>
</div>
<a
href=
"javascript:;"
id=
"add-root-category"
class=
"btn btn-success"
style=
"margin:10px 0;"
><i
class=
"fa fa-plus"
></i>
添加根分类
</a>
<div
class=
"panel"
>
<div
class=
"panel-body nopadding"
>
...
...
dist/yohobuy-portal-fe/5.0.2/jquery/category.Index.js
View file @
a466c2d
...
...
@@ -16,65 +16,7 @@ webpackJsonp([23],[
el
:
"#status"
});
var
renderHd
=
false
;
/*
var g2 = new common.grid({
el: '#basicTable2',
parms: function() {
return {
status: common.util.__input('status'), //$.trim($('#status').val()) || '',
};
},
columns: [{
display: "",
name: ""
},{
display: "ID",
name: "id"
}, {
display: "品类名称",
name: "brandIco",
render: function(item) {
return '<img src="' + item.brandIco + '" width="100" height="100"/>'
}
}, {
display: '品类缩写',
name: "brandName"
}, {
display: '所属分类',
name: "brandNameEn"
}, {
display: '排序',
name: "brandLevel"
}, {
display: '状态',
name: "status",
render: function(item) {
if(item.status==1){
var name ="开启" ;
}else {
var name ="关闭" ;
}
return name;
}
}, {
display: '操作',
name: "status",
render: function(items) {
alert(1);
var HtmArr = [];
HtmArr.push('<a href="/erpproduct/brands/edit/' + items.id + '"" class="btn btn-info btn-xs">编辑</a>');
if (items.status === 0) {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs open-brand">开启品牌</a>');
}
if (items.status === 1) {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs close-brand">关闭品牌</a>');
}
return HtmArr.join('');
}
}]
});
*/
var
g
=
new
common
.
grid
({
el
:
"#basicTable"
,
parms
:
function
()
{
...
...
@@ -119,7 +61,7 @@ webpackJsonp([23],[
//g.init("/erpproduct/sort/index");
$
(
"#filter-btn"
).
click
(
function
()
{
renderHd
=
false
;
g
.
reload
(
1
);
g
.
reload
();
});
//打开层级类目
...
...
@@ -140,7 +82,44 @@ webpackJsonp([23],[
}
});
//列表展示效果
$
(
document
).
on
(
'click'
,
'.open-close-btn'
,
function
()
{
var
status
;
var
id
=
$
(
this
).
parent
().
data
(
'id'
);
if
(
$
(
this
).
attr
(
'data-status'
)
===
'1'
)
{
status
=
0
;
}
else
if
(
$
(
this
).
attr
(
'data-status'
)
===
'0'
)
{
status
=
1
;
}
console
.
log
(
status
);
$
.
ajax
({
type
:
'POST'
,
dataType
:
'json'
,
url
:
status
?
"/erpproduct/sorter/open"
:
"/erpproduct/sorter/close"
,
data
:
{
param
:
id
}
}).
then
(
function
(
data
)
{
console
.
log
(
data
);
if
(
data
.
code
===
200
)
{
if
(
$
(
this
).
hasClass
(
'btn-danger'
))
{
common
.
util
.
__tip
(
"关闭成功!"
,
'success'
);
}
else
{
common
.
util
.
__tip
(
"开启成功!"
,
'success'
);
}
g
.
reload
();
}
});
event
.
preventDefault
();
}
);
var
$toggleTd
=
$
(
'.toggle-td'
);
...
...
dist/yohobuy-portal-fe/5.0.2/jquery/operations.salecategory.Index.js
View file @
a466c2d
...
...
@@ -5,10 +5,18 @@ webpackJsonp([117],[
'use strict'
;
var
$
=
__webpack_require__
(
1
),
common
=
__webpack_require__
(
2
);
//下拉框
new
common
.
dropDown
({
el
:
"#state"
});
var
renderHd
=
false
;
var
g
=
new
common
.
grid
({
el
:
"#basicTable"
,
parms
:
function
()
{
return
{
state
:
common
.
util
.
__input
(
'state'
),
//$.trim($('#status').val()) || '',
};
},
columns
:
[{
display
:
''
,
name
:
'foler'
,
...
...
@@ -43,6 +51,10 @@ webpackJsonp([117],[
});
g
.
init
(
$
(
"#gridurl"
).
val
());
$
(
"#filter-btn"
).
click
(
function
()
{
renderHd
=
false
;
g
.
reload
();
});
//编辑排序
$
(
document
).
on
(
'change'
,
'.saleCategoryNumInput'
,
function
()
{
...
...
@@ -407,7 +419,30 @@ webpackJsonp([117],[
});
})
//切换状态重载列表
//删除销售类目
$
(
document
).
on
(
'click'
,
'.del-category'
,
function
()
{
var
categoryId
=
$
(
this
).
parent
().
data
(
'id'
),
categoryName
=
$
(
this
).
parent
().
data
(
'name'
);
common
.
dialog
.
confirm
(
"温馨提示"
,
"确定  <b><font color='#ff0000'>删除 </font>【"
+
categoryName
+
"】</b> 分类吗?"
,
function
()
{
common
.
util
.
__ajax
({
url
:
'/sale/salesCategory/delSC'
,
data
:
{
categoryId
:
categoryId
}
},
function
(
res
){
if
(
res
.
code
==
200
)
{
g
.
reload
();
common
.
util
.
__tip
(
"关闭成功!"
,
"success"
);
}
else
{
common
.
util
.
__tip
(
res
.
data
.
message
);
}
},
true
)
});
})
//切换状态重载列表
$
(
'input[name="state"]'
).
on
(
'change'
,
function
()
{
$
(
this
).
parent
().
addClass
(
'current'
).
siblings
().
removeClass
(
'current'
);
g
.
reload
();
...
...
Please
register
or
login
to post a comment