Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
office-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
office-web
Commits
e5c17742
Commit
e5c17742
authored
Dec 26, 2018
by
xiaohai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选人插件
parent
472d9116
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
391 additions
and
34 deletions
+391
-34
vueSelectEmployee.vue
src/components/common/vueSelectEmployee.vue
+69
-0
clerkInfo.vue
src/components/contacts/storeFrame/clerkInfo.vue
+99
-0
clerkView.vue
src/components/contacts/storeFrame/clerkView.vue
+70
-8
storeView.vue
src/components/contacts/storeFrame/storeView.vue
+58
-4
addClerk.vue
src/views/contacts/addClerk.vue
+11
-3
addDepartment.vue
src/views/contacts/addDepartment.vue
+0
-0
storeFrame.vue
src/views/contacts/storeFrame.vue
+80
-19
public.css
static/css/public.css
+4
-0
No files found.
src/components/common/vueSelectEmployee.vue
0 → 100644
View file @
e5c17742
<
template
>
<el-dialog
title=
"选择人员"
width=
"660px"
:visible
.
sync=
"dialogVisible"
>
<div
class=
"transfer-area"
>
<div
class=
"select-area t-a-select"
>
<p
class=
"title"
>
选择
</p>
<div
class=
"tree-div"
>
<div
class=
"input-container"
>
<el-input
v-model=
"searchKey"
placeholder=
"请输入内容"
></el-input>
</div>
<el-tree></el-tree>
</div>
</div>
<div
class=
"selected-area t-a-select"
>
<p
class=
"title"
>
已选
</p>
<div
class=
"tree-div"
></div>
</div>
</div>
</el-dialog>
</
template
>
<
script
>
export
default
{
name
:
"vue-select-employee"
,
props
:
{},
data
()
{
return
{
dialogVisible
:
true
,
searchKey
:
""
};
}
};
</
script
>
<
style
lang=
"scss"
>
.transfer-area
{
display
:
flex
;
.t-a-select
{
width
:
300px
;
height
:
415px
;
background
:
rgba
(
255
,
255
,
255
,
1
);
border
:
1px
solid
rgba
(
220
,
223
,
230
,
1
);
border-radius
:
4px
;
&:first-child
{
margin-right
:
20px
;
}
>
.title
{
width
:
100%
;
height
:
42px
;
line-height
:
42px
;
background
:
rgba
(
245
,
247
,
250
,
1
);
border-bottom
:
1px
solid
rgba
(
220
,
223
,
230
,
1
);
border-radius
:
4px
;
text-indent
:
15px
;
color
:
#303133
;
font-size
:
16px
;
}
.tree-div
{
width
:
100%
;
height
:
373px
;
overflow
:
auto
;
padding
:
15px
;
box-sizing
:
border-box
;
}
}
}
</
style
>
src/components/contacts/storeFrame/clerkInfo.vue
0 → 100644
View file @
e5c17742
<
template
>
<div
class=
"form-container bdr-box"
>
<el-form
ref=
"clerk_info"
:model=
"clerkInfo"
:rules=
"rules"
class=
"add-clerk-form"
label-width=
"80px"
>
<el-form-item
label=
"姓名"
prop=
"name"
>
<el-input
v-model=
"clerkInfo.name"
></el-input>
</el-form-item>
<el-form-item
label=
"手机号"
prop=
"phoneNumber"
>
<el-input
v-model=
"clerkInfo.phoneNumber"
></el-input>
</el-form-item>
<el-form-item
label=
"门店"
>
<el-input
v-model=
"clerkInfo.storeName"
></el-input>
</el-form-item>
<el-form-item
label=
"code"
prop=
"code"
>
<el-input
v-model=
"clerkInfo.code"
></el-input>
</el-form-item>
<el-form-item
label=
"职位"
prop=
"positionName"
>
<el-input
v-model=
"clerkInfo.positionName"
></el-input>
</el-form-item>
</el-form>
<div
class=
"btn-box"
>
<el-button
type=
"primary"
@
click=
"save"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"save(true)"
>
保存并继续添加
</el-button>
<el-button>
取消
</el-button>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
"clerk-info-form"
,
props
:
{
clerkInfo
:
{
type
:
Object
,
default
()
{
return
{};
}
}
},
data
()
{
let
validatePhone
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
'请输入手机号'
));
}
else
{
let
reg
=
/^1
[
34578
]\d{9}
$/
;
if
(
!
reg
.
test
(
value
))
{
return
callback
(
new
Error
(
"手机号格式不正确"
));
}
}
}
return
{
rules
:
{
name
:
[
{
required
:
true
,
message
:
"请输入店员姓名"
,
trigger
:
"blur"
},
{
min
:
2
,
max
:
10
,
message
:
'长度在 2 到 10 个字符'
,
trigger
:
'blur'
}
],
phoneNumber
:
[
{
required
:
true
,
validator
:
validatePhone
,
trigger
:
"blur"
}
],
code
:
[
{
required
:
true
,
message
:
"请输入code"
,
trigger
:
"blur"
},
{
min
:
2
,
max
:
20
,
message
:
'长度在 2 到 20 个字符'
,
trigger
:
'blur'
}
],
positionName
:
[
{
required
:
true
,
message
:
"请输入店员职位"
,
trigger
:
"blur"
}
]
}
};
},
methods
:
{
save
(
goahead
)
{
this
.
$refs
.
clerk_info
.
validate
((
valid
)
=>
{
console
.
log
(
valid
,
"valid"
);
if
(
valid
)
{
}
});
}
}
};
</
script
>
<
style
lang=
"scss"
>
.form-container
{
flex
:
1
;
padding
:
24px
35px
48px
;
background
:
#fff
;
.el-input
{
width
:
380px
;
}
.btn-box
{
padding-left
:
80px
;
}
}
</
style
>
src/components/contacts/storeFrame/clerkView.vue
View file @
e5c17742
<
template
>
<div>
<div
class=
"sf-right-button-box"
>
<el-select
v-model=
"storeType"
size=
"small"
>
<el-select
v-model=
"storeType"
@
change=
"selectByType"
size=
"small"
>
<el-option
v-for=
"(type, index) in typeArr"
:key=
"type"
...
...
@@ -9,8 +9,8 @@
:value=
"index"
>
</el-option>
</el-select>
<el-select
v-model=
"storeStatus"
size=
"small"
>
<el-option
label=
"全部状态"
:value=
"0
"
></el-option>
<el-select
v-model=
"storeStatus"
@
change=
"selectByStatus"
size=
"small"
>
<el-option
label=
"全部状态"
value=
"
"
></el-option>
<el-option
label=
"正常"
:value=
"1"
></el-option>
<el-option
label=
"停业整顿"
:value=
"3"
></el-option>
</el-select>
...
...
@@ -28,7 +28,7 @@
<template
slot-scope=
"scope"
>
<div>
<p
class=
"m-b-10"
>
{{
scope
.
row
.
storeName
}}
</p>
<p><a
class=
"a-href"
>
新增门店
</a></p>
<p><a
class=
"a-href"
:href=
"'#/addClerk?storeId='+scope.row.storeId"
target=
"_blank"
>
新增店员
</a></p>
</div>
</
template
>
</el-table-column>
...
...
@@ -63,7 +63,7 @@
</div>
<div
class=
"clerk-cell clerk-handle"
>
<a
class=
"a-href m-r-20"
>
编辑
</a>
<a
class=
"a-href"
>
删除
</a>
<a
class=
"a-href"
@
click=
"delClerk(clerk, scope.row)"
>
删除
</a>
</div>
</li>
</ul>
...
...
@@ -73,6 +73,7 @@
</div>
</template>
<
script
>
import
{
getRequest
,
postRequest
,
postJsonRequest
}
from
'@/api/api'
;
export
default
{
name
:
"clerkView"
,
props
:
{
...
...
@@ -87,15 +88,20 @@ export default {
return
{
storeType
:
0
,
typeArr
:
[
"全部类型"
,
"自营"
,
"联营"
,
"代理(加盟)"
,
"代销"
,
"托管"
],
storeStatus
:
0
,
showChildMember
:
false
,
storeStatus
:
""
,
showChildMember
:
false
};
},
methods
:
{
/**
* 设置是否显示子成员
*/
setChildMemberShow
()
{
this
.
$emit
(
"setChildMemberShow"
,
this
.
showChildMember
);
},
/**
* 更换店长
*/
changeManager
(
row
,
clerk
)
{
console
.
log
(
row
,
clerk
);
row
.
clerks
.
some
(
per
=>
{
...
...
@@ -105,6 +111,62 @@ export default {
return
per
.
isManager
==
1
;
});
clerk
.
isManager
=
1
;
},
/**
* 根据状态筛选店铺
*/
selectByStatus
(
val
)
{
this
.
$emit
(
"selectByStatus"
,
val
);
},
/**
* 根据店铺类型筛选店铺
*/
selectByType
(
type
)
{
let
storeType
=
""
;
if
(
type
!=
0
)
{
storeType
=
type
*
1
-
1
;
}
this
.
$emit
(
"selectByType"
,
storeType
);
},
/**
* 删除店员
*/
delClerk
(
clerk
,
store
)
{
console
.
log
(
clerk
,
clerk
.
employeeClerkId
,
store
);
let
_this
=
this
;
_this
.
$confirm
(
"是否要删除该员工?"
,
"提示"
,
{
type
:
"warning"
}).
then
(()
=>
{
let
params
=
{
ids
:
clerk
.
employeeClerkId
}
getRequest
(
"/haoban-manage-web/emp/del"
,
params
)
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
errorCode
==
1
)
{
store
.
clerks
.
forEach
(
ele
=>
{
if
(
ele
.
employeeClerkId
==
clerk
.
employeeClerkId
)
{
store
.
clerks
.
splice
(
store
.
clerks
.
indexOf
(
ele
),
1
);
}
});
_this
.
$message
.
success
({
duration
:
1000
,
message
:
"操作成功"
});
}
else
{
_this
.
$message
.
error
({
duration
:
1000
,
message
:
res
.
data
.
message
});
}
})
.
catch
(
e
=>
{
_this
.
$message
.
error
({
duration
:
1000
,
message
:
e
.
message
});
});
});
}
}
};
...
...
src/components/contacts/storeFrame/storeView.vue
View file @
e5c17742
...
...
@@ -51,13 +51,14 @@
>
<
template
slot-scope=
"scope"
>
<a
class=
"a-href m-r-20"
@
click=
"editStore(scope.row)"
>
编辑
</a>
<a
class=
"a-href"
@
click=
"delStore
(scope.row
)"
>
删除
</a>
<a
class=
"a-href"
@
click=
"delStore
s(scope.row, true
)"
>
删除
</a>
</
template
>
</el-table-column>
</el-table>
</div>
</template>
<
script
>
import
{
getRequest
,
postRequest
,
postJsonRequest
}
from
'@/api/api'
;
export
default
{
name
:
"storeView"
,
props
:
{
...
...
@@ -77,7 +78,61 @@ export default {
};
},
methods
:
{
delStores
()
{},
/**
* 批量删除店铺
*/
delStores
(
store
,
single
=
false
)
{
console
.
log
(
store
,
single
);
let
that
=
this
;
that
.
$confirm
(
"是否删除所选店铺"
,
"提示"
,
{
type
:
"warning"
}).
then
(()
=>
{
let
ids
=
""
;
if
(
single
)
{
ids
=
store
.
storeId
;
}
else
{
let
arr
=
[];
that
.
selectedList
.
forEach
(
li
=>
{
arr
.
push
(
li
.
storeId
);
});
ids
=
arr
.
join
(
","
);
}
let
params
=
{
ids
};
getRequest
(
"/haoban-manage-web/store/delByIds"
,
params
)
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
errorCode
==
1
)
{
let
stores
=
ids
.
split
(
","
);
let
spliceData
=
that
.
tableData
.
slice
(
0
);
spliceData
.
forEach
(
li
=>
{
stores
.
forEach
(
id
=>
{
if
(
id
==
li
.
storeId
)
{
let
index
=
that
.
tableData
.
indexOf
(
li
);
that
.
tableData
.
splice
(
index
,
1
);
}
});
});
that
.
$message
.
success
({
duration
:
1000
,
message
:
"操作成功"
});
}
else
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
res
.
data
.
message
});
}
}).
catch
(
e
=>
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
e
.
message
});
})
});
},
selectMember
(
selection
)
{
this
.
selectedList
=
selection
;
},
...
...
@@ -85,8 +140,7 @@ export default {
this
.
$emit
(
"setChildMemberShow"
,
this
.
showChildMember
);
},
linkToDetail
()
{},
editStore
()
{},
delStore
()
{}
editStore
()
{}
},
computed
:
{
disabledDel
()
{
...
...
src/views/contacts/addClerk.vue
View file @
e5c17742
<
template
>
<div
class=
"add-clerk-page"
></div>
<div
class=
"add-clerk-page"
>
<clerk-info></clerk-info>
</div>
</
template
>
<
script
>
import
clerkInfo
from
"components/contacts/storeFrame/clerkInfo"
;
export
default
{
name
:
"add-clerk-page"
name
:
"add-clerk-page"
,
components
:
{
clerkInfo
},
data
()
{
return
{};
}
}
</
script
>
<
style
lang=
"scss"
>
</
style
>
src/views/contacts/addDepartment.vue
View file @
e5c17742
This diff is collapsed.
Click to expand it.
src/views/contacts/storeFrame.vue
View file @
e5c17742
...
...
@@ -21,7 +21,7 @@
</div>
</
template
>
</search-menu>
<
employee-info
v-if=
"showEmployee == 'employee'"
:info=
"selectedEmployee"
></employee
-info>
<
clerk-info
v-if=
"showEmployee == 'employee'"
:clerkInfo=
"selectedEmployee"
></clerk
-info>
<store-info
v-else-if=
"showEmployee == 'store'"
:storeInfo=
"storeInfo"
></store-info>
<div
class=
"sf-right-container"
v-else
...
...
@@ -45,7 +45,7 @@
<store-view
:tableData=
"storeList"
@
setChildMemberShow=
"setChildMemberShow"
></store-view>
</
template
>
<
template
v-else
>
<clerk-view
:tableData=
"storeList"
@
setChildMemberShow=
"setChildMemberShow"
></clerk-view>
<clerk-view
:tableData=
"storeList"
@
setChildMemberShow=
"setChildMemberShow"
@
selectByStatus=
"selectByStatus"
@
selectByType=
"selectByType"
></clerk-view>
</
template
>
<div
class=
"pagination"
>
<el-pagination
...
...
@@ -70,6 +70,7 @@ import clerkView from "components/contacts/storeFrame/clerkView";
import
storeInfo
from
"components/contacts/storeFrame/storeInfo"
;
import
addBrand
from
"components/contacts/storeFrame/addBrand"
;
import
employeeInfo
from
"components/contacts/employeeInfo"
;
import
clerkInfo
from
"components/contacts/storeFrame/clerkInfo"
;
import
{
getRequest
,
postRequest
,
postJsonRequest
}
from
'@/api/api'
;
export
default
{
name
:
"storeEstruturaContainer"
,
...
...
@@ -79,7 +80,8 @@ export default {
clerkView
,
employeeInfo
,
storeInfo
,
addBrand
addBrand
,
clerkInfo
},
data
()
{
return
{
...
...
@@ -99,7 +101,9 @@ export default {
showEmployee
:
'node'
,
selectedEmployee
:
{},
storeInfo
:
{},
disableBtn
:
true
disableBtn
:
true
,
storeStatus
:
""
,
storeType
:
""
};
},
methods
:
{
...
...
@@ -145,16 +149,27 @@ export default {
this
.
pageNumber
=
pageNumber
;
this
.
getStoreList
();
},
/**
* 切换视图
*/
switchView
(
view
)
{
this
.
pageSize
=
20
;
this
.
pageNumber
=
1
;
this
.
storeList
=
[];
this
.
showChildMember
=
false
;
this
.
storeStatus
=
""
;
this
.
getStoreList
();
},
/**
* 设置是否显示子成员
*/
setChildMemberShow
(
show
)
{
this
.
showChildMember
=
show
;
this
.
getStoreList
();
},
/**
* 获取树形分组数据
*/
getGroupData
()
{
let
_this
=
this
;
let
params
=
{
...
...
@@ -162,20 +177,35 @@ export default {
};
getRequest
(
"/haoban-manage-web/dept/deptList"
,
params
)
.
then
(
res
=>
{
_this
.
menuData
=
res
.
data
.
result
||
[];
res
.
data
.
result
.
some
(
li
=>
{
if
(
li
.
level
==
0
)
{
_this
.
groupInfo
.
departmentId
=
li
.
groupId
;
_this
.
groupInfo
.
groupName
=
li
.
name
;
}
return
li
.
level
==
0
;
});
_this
.
getStoreList
();
if
(
res
.
data
.
errorCode
==
1
)
{
_this
.
menuData
=
res
.
data
.
result
||
[];
res
.
data
.
result
.
some
(
li
=>
{
if
(
li
.
level
==
0
)
{
_this
.
groupInfo
.
departmentId
=
li
.
groupId
;
_this
.
groupInfo
.
groupName
=
li
.
name
;
}
return
li
.
level
==
0
;
});
_this
.
getStoreList
();
}
else
{
_this
.
menuData
=
[];
_this
.
loading
=
false
;
_this
.
$message
.
error
({
duration
:
1000
,
message
:
res
.
data
.
message
});
}
})
.
catch
(
e
=>
{
console
.
log
(
e
,
"error"
);
_this
.
$message
.
error
({
duration
:
1000
,
message
:
e
.
message
});
});
},
/**
* 获取店铺列表
*/
getStoreList
()
{
let
_this
=
this
;
_this
.
loading
=
true
;
...
...
@@ -185,17 +215,34 @@ export default {
showType
:
_this
.
tableView
,
pageSize
:
_this
.
pageSize
,
pageNumber
:
_this
.
pageNumber
,
status
:
1
status
:
_this
.
storeStatus
,
storeType
:
_this
.
storeType
};
getRequest
(
"/haoban-manage-web/store/findSimplePage"
,
params
)
.
then
(
res
=>
{
_this
.
total
=
res
.
data
.
result
.
total
;
_this
.
storeList
=
res
.
data
.
result
.
list
||
[];
_this
.
loading
=
false
;
if
(
res
.
data
.
errorCode
==
1
)
{
_this
.
total
=
res
.
data
.
result
.
total
;
_this
.
storeList
=
res
.
data
.
result
.
list
||
[];
_this
.
loading
=
false
;
_this
.
$message
.
success
({
duration
:
1000
,
message
:
'操作成功!'
});
}
else
{
_this
.
loading
=
false
;
_this
.
storeList
=
[];
_this
.
$message
.
error
({
duration
:
1000
,
message
:
res
.
data
.
message
});
}
})
.
catch
(
e
=>
{
console
.
log
(
e
,
"error"
);
_this
.
loading
=
false
;
_this
.
$message
.
error
({
duration
:
1000
,
message
:
e
.
message
});
});
},
/**
...
...
@@ -207,6 +254,20 @@ export default {
this
.
groupInfo
.
groupName
=
obj
.
name
;
this
.
showEmployee
=
showEmployee
;
this
.
getStoreList
();
},
/**
* 店员视图根据店铺状态筛选店铺
*/
selectByStatus
(
val
)
{
this
.
storeStatus
=
val
;
this
.
getStoreList
();
},
/**
* 店员视图根据店铺类型筛选店铺
*/
selectByType
(
type
)
{
this
.
storeType
=
type
;
this
.
getStoreList
();
}
},
beforeMount
()
{
...
...
static/css/public.css
View file @
e5c17742
...
...
@@ -325,6 +325,10 @@ input:focus {
display
:
inline-block
;
}
.bdr-box
{
box-sizing
:
border-box
;
}
.t-rt
{
text-align
:
right
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment