Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
horse
Project
Project
Details
Activity
Releases
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
向伟
horse
Commits
4271c1ab
Commit
4271c1ab
authored
Nov 22, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fb6831e2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
251 additions
and
41 deletions
+251
-41
departmentStaff.vue
src/components/common/departmentStaff.vue
+178
-16
editRuleModule.ts
src/module/editor/editRuleModule.ts
+55
-14
clueRule.vue
src/pages/customer/components/clueRule.vue
+2
-2
editRule.vue
src/pages/editor/editRule.vue
+16
-9
No files found.
src/components/common/departmentStaff.vue
View file @
4271c1ab
<
template
>
<
template
>
<q-dialog
v-model=
"modelValue"
persistent
transition-show=
"scale"
transition-hide=
"scale"
@
hide =
"hideDialog"
>
<q-dialog
<q-card
style=
"width: 800px"
>
v-model=
"modelValue"
class=
"col-6"
persistent
transition-show=
"scale"
transition-hide=
"scale"
@
hide=
"hideDialog"
>
<q-card
style=
"width: 600px;height:600px; max-width: 80vw;"
>
<q-card-section
class=
"row items-center q-pb-none"
>
<q-card-section
class=
"row items-center q-pb-none"
>
<div
class=
"text-h6"
>
选择部门/员工
</div>
<div
class=
"text-h6"
>
选择部门/员工
</div>
<q-space
/>
<q-space
/>
<q-btn
icon=
"close"
flat
round
dense
v-close-popup
/>
<q-btn
icon=
"close"
flat
round
dense
v-close-popup
/>
</q-card-section>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-card-section
class=
"q-pt-none"
style=
"height:480px;"
>
<div
class=
"flex col"
>
<div
class=
"row"
style=
"height:100%;"
>
<div
class=
"col-6"
>
1
<div
class=
"col-6 q-px-sm"
style=
"border-right:1px solid #999;height:100%;"
>
<q-input
color=
"teal"
dense
outlined
placeholder=
"请输入"
style=
"margin-bottom:10px"
>
<template
v-slot:append
>
<q-icon
name=
"search"
/>
</
template
>
</q-input>
<q-tree
style=
"height:calc(100% - 50px);overflow-y:scroll"
ref=
"tree"
class=
"col-12"
:nodes=
"treeData"
:node-key=
"nodeKey"
:label-key=
"labelKey"
:children-key=
"childrenKey"
:tick-strategy=
"strategy"
:default-expand-all=
"defaultExpandAll"
no-connectors
v-model:ticked=
"defaultArray"
@
update:ticked=
"tickedTree"
/>
</div>
<div
class=
"col-6 q-px-sm"
>
<div
class=
"list-title"
>
已选择的部门或成员
</div>
<div
class=
"q-pb-none col-12 list-box"
>
<div
v-for=
"(item,index) in defaultArray"
:key=
"index"
class=
"list-item"
>
<div
class=
"flex-center"
>
<q-icon
name=
"work"
color=
"primary"
v-if=
"item.slice(0, 1) == 1"
/>
<q-icon
name=
"person"
color=
"accent"
v-if=
"item.slice(0, 1) == 2"
/>
<span
class=
"q-ml-sm"
>
{{ item.split('-')[1] }}
</span>
</div>
<q-icon
name=
"cancel"
@
click=
"delItem(index)"
></q-icon>
</div>
</div>
</div>
</div>
<div
class=
"col-6"
>
2
</div>
</div>
</div>
</q-card-section>
</q-card-section>
<q-card-actions
align=
"right"
class=
"bg-white text-teal"
>
<q-card-actions
align=
"right"
class=
"bg-white text-teal"
>
<q-btn
flat
label=
"取消"
v-close-popup
/>
<q-btn
flat
label=
"取消"
v-close-popup
/>
<q-btn
color=
"primary"
label=
"确定"
/>
<q-btn
color=
"primary"
v-close-popup
label=
"确定"
/>
</q-card-actions>
</q-card-actions>
</q-card>
</q-card>
</q-dialog>
</q-dialog>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
reactive
,
ref
,
watch
}
from
'vue'
import
{
ref
}
from
'vue'
interface
parmas
{
[
key
:
string
]:
any
}
export
default
{
export
default
{
props
:
{
props
:
{
modelValue
:
{
modelValue
:
{
...
@@ -39,16 +98,119 @@ export default {
...
@@ -39,16 +98,119 @@ export default {
showType
:
{
showType
:
{
type
:
Number
,
//0:显示部门和员工,1:只显示部门
type
:
Number
,
//0:显示部门和员工,1:只显示部门
default
:
0
default
:
0
}
},
},
// emits:["update:modelValue"],
//是否默认展开
setup
(
props
,
ctx
)
{
defaultExpandAll
:
{
let
hideDialog
=
()
=>
{
type
:
Boolean
,
ctx
.
emit
(
"update:modelValue"
,
false
)
default
:
false
},
//默认选中值
defaultArray
:
{
type
:
Array
,
default
:
()
=>
[],
required
:
true
,
},
//节点Key
nodeKey
:
{
type
:
String
,
//格式需拼成 '类型-名字-id'的形式
default
:
'id'
},
//节点名称
labelKey
:
{
type
:
String
,
default
:
'name'
},
//子节点名称
childrenKey
:
{
type
:
String
,
default
:
'children'
},
//滴答策略
strategy
:
{
type
:
String
,
default
:
'strict'
},
},
setup
(
props
,
ctx
)
{
let
tree
=
ref
<
any
>
(
null
);
let
list
=
ref
<
Array
<
string
>>
([])
let
hideDialog
=
()
=>
{
ctx
.
emit
(
"update:modelValue"
,
false
)
}
let
findChild
=
(
arr
:
parmas
)
=>
{
arr
.
map
((
e
)
=>
{
if
(
e
[
props
.
childrenKey
]
&&
e
[
props
.
childrenKey
].
length
>
0
)
{
let
parentId
=
e
[
props
.
nodeKey
]
let
flag
=
tree
.
value
.
isTicked
(
parentId
)
// let childArr = e[props.childrenKey].map(_e => _e[props.nodeKey])
// let flag2 = childArr.every(_e => {
// return props.defaultArray.toString().indexOf(_e) != -1
// })
console
.
log
(
147
,
parentId
,
flag
)
findChild
(
e
[
props
.
childrenKey
])
}
})
}
}
let
tickedTree
=
(
val
)
=>
{
ctx
.
emit
(
"update:defaultArray"
,
val
)
// findChild(props.treeData)
let
chected
=
tree
.
value
.
getTickedNodes
()
console
.
log
(
165
,
chected
)
}
let
delItem
=
(
i
:
number
)
=>
{
props
.
defaultArray
.
splice
(
i
,
1
)
}
return
{
return
{
hideDialog
tree
,
hideDialog
,
tickedTree
,
delItem
,
list
}
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
::-webkit-scrollbar
{
height
:
7px
;
width
:
7px
;
}
::-webkit-scrollbar-thumb
{
/*滚动条里面小方块*/
border-radius
:
3px
;
background-color
:
#ddd
;
}
::-webkit-scrollbar-track-piece
{
background-color
:
#fff
;
-webkit-border-radius
:
12px
;
}
.list-title
{
height
:
50px
;
padding-bottom
:
10px
;
color
:
#606266
;
font-size
:
14px
;
box-sizing
:
border-box
;
display
:
flex
;
align-items
:
center
;
}
.list-box
{
height
:
420px
;
overflow-y
:
scroll
;
}
.list-item
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
3px
0
0
10px
;
border-radius
:
5px
;
height
:
30px
;
}
</
style
>
\ No newline at end of file
src/module/editor/editRuleModule.ts
View file @
4271c1ab
...
@@ -2,23 +2,46 @@ import { reactive } from 'vue'
...
@@ -2,23 +2,46 @@ import { reactive } from 'vue'
import
customerService
from
'@/api/customer'
import
customerService
from
'@/api/customer'
import
customerService2
from
'@/api/customer2'
import
customerService2
from
'@/api/customer2'
import
router
from
'@/router/index'
import
router
from
'@/router/index'
interface
Params
{
RuleId
:
number
interface
dataParams
{
showDialog
:
boolean
shape
:
number
dataTree
:
Array
<
any
>
defaultArray
:
Array
<
number
|
string
>
editMsg
:
any
}
}
const
curQueryId
=
Number
(
router
.
currentRoute
.
value
.
query
.
Id
)
??
0
console
.
log
(
8
,
curQueryId
)
const
msg
=
reactive
<
Params
>
(
{
const
msg
=
()
=>
{
RuleId
:
0
const
curQueryId
=
Number
(
router
.
currentRoute
.
value
.
query
.
Id
)
})
return
{
if
(
curQueryId
>
0
)
{
RuleId
:
curQueryId
msg
.
RuleId
=
<
number
>
curQueryId
}
}
}
const
data
=
reactive
({
const
data
=
reactive
<
dataParams
>
({
showDialog
:
false
,
showDialog
:
false
,
shape
:
0
,
shape
:
0
,
dataTree
:
{}
dataTree
:
[],
defaultArray
:
[],
editMsg
:
{
Id
:
0
,
RuleSelectType
:
1
,
//客户的查询类型 1并且 2或者
DeptList
:
[],
//部门列表
EmpList
:
[],
//员工列表
RuleAllotWay
:
1
,
//分配方式 1依次轮流 2随机分配
ConditionList
:
[]
//条件列表
}
})
})
// watch(
// () =>data.defaultArray,
// (val) => {
// val.map(e => {
// console.log('valDefault', e)
// })
// }
// )
const
jumpBeforePage
=
()
=>
{
const
jumpBeforePage
=
()
=>
{
router
.
go
(
-
1
)
router
.
go
(
-
1
)
}
}
...
@@ -30,8 +53,10 @@ const changeDialog = () => {
...
@@ -30,8 +53,10 @@ const changeDialog = () => {
const
editRuleModule
=
()
=>
{
const
editRuleModule
=
()
=>
{
//获取线索详情
//获取线索详情
const
getDetail
=
()
=>
{
const
getDetail
=
()
=>
{
customerService
.
getCustomerClueRuleDetail
(
msg
).
then
(
res
=>
{
customerService
.
getCustomerClueRuleDetail
(
msg
()).
then
(
res
=>
{
console
.
log
(
res
,
'数据'
)
console
.
log
(
res
.
data
.
Data
,
'详情数据'
)
data
.
defaultArray
=
[]
// res.data.Data.
})
})
}
}
//获取部门数据
//获取部门数据
...
@@ -39,6 +64,22 @@ const editRuleModule = () => {
...
@@ -39,6 +64,22 @@ const editRuleModule = () => {
customerService2
.
getEmployeeData
({}).
then
(
res
=>
{
customerService2
.
getEmployeeData
({}).
then
(
res
=>
{
console
.
log
(
res
.
data
.
Data
,
'数据'
)
console
.
log
(
res
.
data
.
Data
,
'数据'
)
data
.
dataTree
=
res
.
data
.
Data
data
.
dataTree
=
res
.
data
.
Data
// 重组唯一id
if
(
data
.
dataTree
.
length
==
0
)
return
data
.
dataTree
.
forEach
(
x
=>
{
x
.
newId
=
x
.
DataType
+
'-'
+
x
.
DeptName
+
'-'
+
x
.
DeptId
if
(
x
.
ChildList
&&
x
.
ChildList
.
length
>
0
)
{
getChildList
(
x
.
ChildList
)
}
})
})
}
const
getChildList
=
(
ChildList
:
Array
<
any
>
)
=>
{
ChildList
.
forEach
(
x
=>
{
x
.
newId
=
x
.
DataType
+
'-'
+
x
.
DeptName
+
'-'
+
x
.
DeptId
if
(
x
.
ChildList
&&
x
.
ChildList
.
length
>
0
)
{
getChildList
(
x
.
ChildList
)
}
})
})
}
}
return
{
return
{
...
...
src/pages/customer/components/clueRule.vue
View file @
4271c1ab
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
style=
"font-weight:400;color: #3FC4FF"
style=
"font-weight:400;color: #3FC4FF"
class=
"q-mr-xs"
class=
"q-mr-xs"
label=
"编辑"
label=
"编辑"
@
click=
"jumpPage('/editor/editRule',item.Id)"
/>
/>
</td>
</td>
<td>
<td>
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
style=
"font-weight:400;color: #3FC4FF"
style=
"font-weight:400;color: #3FC4FF"
class=
"q-mr-xs"
class=
"q-mr-xs"
label=
"编辑"
label=
"编辑"
@
click=
"goedit(element
)"
@
click=
"jumpPage('/editor/editRule',element.Id
)"
/>
/>
<q-btn
<q-btn
v-if=
"element.IsDefault != 1"
v-if=
"element.IsDefault != 1"
...
...
src/pages/editor/editRule.vue
View file @
4271c1ab
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
</div>
</div>
</div>
</div>
<div
class=
"staff-box mt20"
>
<div
class=
"staff-box mt20"
>
<q-chip
color=
"primary"
text-color=
"white"
icon=
"work"
label=
"部门"
></q-chip>
<
!--
<
q-chip
color=
"primary"
text-color=
"white"
icon=
"work"
label=
"部门"
></q-chip>
<q-chip
color=
"accent"
text-color=
"white"
icon=
"person"
label=
"员工"
></q-chip>
<q-chip
color=
"accent"
text-color=
"white"
icon=
"person"
label=
"员工"
></q-chip>
-->
</div>
</div>
</div>
</div>
<div
class=
"content-block mt20"
>
<div
class=
"content-block mt20"
>
...
@@ -34,13 +34,21 @@
...
@@ -34,13 +34,21 @@
<div
class=
"fission-subtitle flex align-center"
>
<div
class=
"fission-subtitle flex align-center"
>
选择分配规则:
选择分配规则:
<div
class=
"q-gutter-sm"
>
<div
class=
"q-gutter-sm"
>
<q-radio
v-model=
"data.
shape
"
:val=
"1"
label=
"顺序分配"
/>
<q-radio
v-model=
"data.
editMsg.RuleAllotWay
"
:val=
"1"
label=
"顺序分配"
/>
<q-radio
v-model=
"data.
shape
"
:val=
"2"
label=
"随机分配"
/>
<q-radio
v-model=
"data.
editMsg.RuleAllotWay
"
:val=
"2"
label=
"随机分配"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<departmentStaff
v-model=
'data.showDialog'
:treeData=
'data.dataTree'
/>
<departmentStaff
v-model=
"data.showDialog"
v-model:defaultArray=
"data.defaultArray"
nodeKey=
"newId"
labelKey=
"DeptName"
childrenKey=
"ChildList"
strategy=
'leaf'
:treeData=
"data.dataTree"
/>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
...
@@ -51,15 +59,12 @@ import {
...
@@ -51,15 +59,12 @@ import {
import
requestGroup
from
'@/components/customer/request-group.vue'
import
requestGroup
from
'@/components/customer/request-group.vue'
import
departmentStaff
from
'@/components/common/departmentStaff.vue'
import
departmentStaff
from
'@/components/common/departmentStaff.vue'
import
editRuleModule
from
'@/module/editor/editRuleModule'
import
editRuleModule
from
'@/module/editor/editRuleModule'
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
components
:
{
requestGroup
,
requestGroup
,
departmentStaff
departmentStaff
},
},
setup
()
{
setup
()
{
let
{
let
{
jumpBeforePage
,
jumpBeforePage
,
changeDialog
,
changeDialog
,
...
@@ -69,7 +74,9 @@ export default defineComponent({
...
@@ -69,7 +74,9 @@ export default defineComponent({
getEmployeeData
getEmployeeData
}
=
editRuleModule
();
}
=
editRuleModule
();
onMounted
(()
=>
{
onMounted
(()
=>
{
if
(
msg
.
RuleId
>
0
)
{
if
(
msg
().
RuleId
>
0
)
{
console
.
log
(
'getDetail'
,
msg
())
getDetail
()
getDetail
()
}
}
getEmployeeData
()
getEmployeeData
()
...
...
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