Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-portal-fe
·
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
姜敏
9 years ago
Commit
39f119cb642795ef36b38024454ecc02c84d5638
1 parent
b84fecd2
品类尺码关联--新增修改功能
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
14 deletions
client/js/sortsize/index.js
server/interface/sortsize.js
server/views/pages/sortsize/index.html
client/js/sortsize/index.js
View file @
39f119c
/**
*
创建供应商
*
品类关联尺码列表
*/
'use strict'
;
var
$
=
require
(
'jquery'
),
common
=
require
(
'../common/common'
);
var
sortmenu
=
require
(
'../common/sortmenu'
);
/**
* 表格
*/
var
g
=
new
common
.
grid
({
el
:
"#basicTable"
,
parms
:
function
()
{
...
...
@@ -26,23 +24,28 @@ var g = new common.grid({
{
display
:
"排序"
,
name
:
"orderBy"
},
{
display
:
"操作"
,
name
:
'id'
,
render
:
function
(
item
)
{
var
htmlArr
=
[];
// 子类目不能删除父类目所创建的属性
if
(
window
.
sortid
==
item
.
sortId
)
return
'<a data-index="'
+
item
.
__index
+
'" href="javascript:void(0)" class="btn btn-success btn-xs delbtn">删除</a>'
;
if
(
window
.
sortid
==
item
.
sortId
){
htmlArr
.
push
(
'<a data-index="'
+
item
.
__index
+
'" href="javascript:void(0)" class="btn btn-success btn-xs delbtn">删除</a>'
)
}
htmlArr
.
push
(
'<a data-index="'
+
item
.
__index
+
'" href="javascript:void(0)" class="btn btn-primary btn-xs editBtn">修改</a>'
)
return
htmlArr
.
join
(
""
);
}
}
]
});
/**
* 初始化排序目录
*/
sortmenu
.
init
(
function
()
{
g
.
init
(
'/erpproduct/sortsize/ajax/index'
);
});
var
_model
=
JSON
.
parse
(
$
(
"#model"
).
val
());
/**
* 添加
*/
$
(
document
).
on
(
"click"
,
"#btn-add"
,
function
()
{
var
_title
=
$
(
this
).
text
();
common
.
dialog
.
confirm
(
_title
,
common
.
util
.
__template
(
$
(
"#template"
).
html
(),
{
...
...
@@ -82,7 +85,9 @@ $(document).on("click", "#btn-add", function () {
}
});
});
/**
* 删除
*/
$
(
document
).
on
(
"click"
,
".delbtn"
,
function
()
{
var
item
=
g
.
rows
[
$
(
this
).
data
(
"index"
)];
common
.
dialog
.
confirm
(
"温馨提示"
,
"你确定要删除吗?"
,
function
()
{
...
...
@@ -94,3 +99,68 @@ $(document).on("click", ".delbtn", function () {
});
});
});
/**
* 验证
*/
var
edit
=
new
common
.
edit2
(
"#baseform"
);
/**
* 通用
* @type {{module: null, toast: Bll.toast}}
*/
var
Bll
=
{
module
:
null
,
//弹框
toast
:
function
(
module
)
{
Bll
.
module
=
module
;
var
d
=
new
common
.
dialog
({
title
:
"修改"
,
content
:
common
.
util
.
__template2
(
$
(
"#template2"
).
html
(),
Bll
.
module
),
width
:
'30%'
,
button
:
[
{
value
:
"保存"
,
callback
:
function
()
{
if
(
edit
.
validate
())
{
common
.
util
.
__ajax
({
url
:
"/product/updateSortSize"
,
data
:
Bll
.
module
},
function
(
res
)
{
if
(
res
.
code
==
'200'
)
{
g
.
reload
();
d
.
close
();
}
else
{
common
.
util
.
__tip
(
res
.
message
,
"warning"
);
}
});
}
return
false
;
},
css
:
"btn-primary"
},
{
"value"
:
"取消"
,
"css"
:
"btn-info"
}
]
});
edit
.
init
();
}
};
/**
* 监听输入框变化
*/
$
(
document
).
on
(
"change"
,
".observe"
,
function
()
{
var
$this
=
$
(
this
);
var
name
=
$this
.
data
(
"field"
);
Bll
.
module
=
common
.
util
.
__buildobj
(
name
,
'.'
,
Bll
.
module
,
function
(
obj
,
name1
)
{
obj
[
name1
]
=
$this
.
val
();
});
});
/**
* 修改
*/
$
(
document
).
on
(
"click"
,
".editBtn"
,
function
()
{
var
item
=
g
.
rows
[
$
(
this
).
data
(
"index"
)];
Bll
.
toast
(
item
);
});
...
...
server/interface/sortsize.js
View file @
39f119c
...
...
@@ -48,6 +48,16 @@ exports.res = [
{
name
:
"sizeId"
,
type
:
"number"
}
]
},
{
//修改品类尺码排序接口
route
:
'/product/updateSortSize'
,
method
:
'POST'
,
url
:
'/product/updateSortSize'
,
params
:[
{
name
:
"sortId"
,
type
:
"number"
},
{
name
:
"sizeId"
,
type
:
"number"
},
{
name
:
"orderBy"
,
type
:
"number"
}
]
},
//************************品类尺码属性管理*****************************
{
route
:
'/erpproduct/sortattribute/index'
,
...
...
server/views/pages/sortsize/index.html
View file @
39f119c
...
...
@@ -81,3 +81,31 @@
<
/div
>
<
/div
>
</script>
<!--编辑模态-->
<script
type=
"text/template"
id=
"template2"
>
<
div
class
=
"rows"
id
=
"baseform"
>
<
div
class
=
"form-group"
>
<
label
class
=
"col-sm-2 control-label"
>
当前分类
<
i
class
=
"red"
>*<
/i></
label
>
<
div
class
=
"col-sm-6"
>
<
input
type
=
"text"
value
=
"[[sortName]]"
class
=
"form-control observe"
data
-
field
=
"sortName"
readonly
/>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
class
=
"col-sm-2 control-label"
>
尺码名
<
i
class
=
"red"
>*<
/i></
label
>
<
div
class
=
"col-sm-6"
>
<
input
type
=
"text"
value
=
"[[sizeName]]"
class
=
"form-control observe"
data
-
field
=
"sizeName"
readonly
/>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
class
=
"col-sm-2 control-label"
>
排序
<
i
class
=
"red"
>*<
/i></
label
>
<
div
class
=
"col-sm-6"
>
<
input
type
=
"text"
value
=
"[[orderBy]]"
class
=
"form-control observe"
data
-
field
=
"orderBy"
match
=
"numbers"
required
placeholder
=
"排序值"
/>
<
/div
>
<
/div
>
<
/div
>
</script>
...
...
Please
register
or
login
to post a comment