Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
4574f91a
Commit
4574f91a
authored
Sep 18, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
10764642
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
848 additions
and
866 deletions
+848
-866
addPhase.vue
src/pages/enterprise/customer/CSChild/addPhase.vue
+110
-131
addfield.vue
...pages/enterprise/customer/CSChild/components/addfield.vue
+290
-290
choiceapprovalorbranch.vue
...se/customer/CSChild/components/choiceapprovalorbranch.vue
+193
-204
stageManagement.vue
src/pages/enterprise/customer/CSChild/stageManagement.vue
+255
-241
No files found.
src/pages/enterprise/customer/CSChild/addPhase.vue
View file @
4574f91a
<
style
>
<
style
>
@import
"../../../financial/css/cssReset.css"
;
@import
"../../../financial/css/cssReset.css"
;
.addPhase
{
padding
:
20px
;
}
.addPhase
.box
{
width
:
100%
;
border-radius
:
6px
;
background
:
#fff
;
padding
:
20px
;
margin-bottom
:
25px
;
}
.addPhase
.bold
{
font-weight
:
760
;
font-size
:
16px
;
color
:
#333
;
border-left
:
3px
solid
#3470ff
;
margin-bottom
:
20px
;
margin-left
:
-20px
;
padding-left
:
20px
;
}
.addPhase
{
padding
:
20px
;
}
.addPhase
.box
{
width
:
100%
;
border-radius
:
6px
;
background
:
#fff
;
padding
:
20px
;
margin-bottom
:
25px
;
}
.addPhase
.bold
{
font-weight
:
760
;
font-size
:
16px
;
color
:
#333
;
border-left
:
3px
solid
#3470ff
;
margin-bottom
:
20px
;
margin-left
:
-20px
;
padding-left
:
20px
;
}
</
style
>
</
style
>
<
template
>
<
template
>
<div
class=
"addPhase"
style=
"background: transparent;"
>
<div
class=
"addPhase"
style=
"background: transparent;"
>
<div
class=
"box"
>
<div
class=
"box"
>
<div
class=
"bold"
>
名称
</div>
<div
class=
"bold"
>
名称
</div>
<q-input
clearable
debounce
filled
maxlength=
"20"
counter
v-model=
"addMsg.FlowName"
style=
"width:600px"
<q-input
clearable
debounce
filled
maxlength=
"20"
counter
v-model=
"addMsg.FlowName"
style=
"width:600px"
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
</div>
</div>
<div
class=
"box"
>
<div
class=
"box"
>
<div
class=
"bold"
>
阶段适用范围
</div>
<div
class=
"bold"
>
阶段适用范围
</div>
<q-btn
class=
"q-mr-md"
label=
"选择部门/成员"
@
click=
"outerVisible = true"
/>
<q-btn
class=
"q-mr-md"
label=
"选择部门/成员"
@
click=
"outerVisible = true"
/>
</div>
<div
class=
"box"
>
</div>
<div
class=
"bold"
>
选择使用阶段
</div>
<div
class=
"box"
>
<div
style=
"display:flex;align-items: center;"
>
<div
class=
"bold"
>
选择使用阶段
</div>
</div>
<div
style=
"display:flex;align-items: center;"
>
</div>
<div
v-if=
"StageList"
>
</div>
<div
class=
"box"
v-for=
"(x,y) in StageList"
v-if=
"x.Type==2"
>
<div
class=
"bold"
v-if=
"x.Name=='已输单'"
>
选择输单原因
</div>
</div>
<div
class=
"bold"
v-if=
"x.Name=='无效'"
>
选择无效原因
</div>
<div
v-if=
"StageList"
>
<div
style=
"display:flex;align-items: center;flex-wrap: wrap;"
>
<div
class=
"box"
v-for=
"(x,y) in StageList"
v-if=
"x.Type==2"
>
<q-checkbox
v-model=
"addMsg.LoseCause"
v-if=
"x.Name=='已输单'"
v-for=
"(item,index) in x.OptionsList"
:key=
'index'
<div
class=
"bold"
v-if=
"x.Name=='已输单'"
>
选择输单原因
</div>
:val=
"item.Id"
:label=
"item.Name"
/>
<div
class=
"bold"
v-if=
"x.Name=='无效'"
>
选择无效原因
</div>
<q-checkbox
v-model=
"addMsg.InvalidCause"
v-if=
"x.Name=='无效'"
v-for=
"(item,index) in x.OptionsList"
<div
style=
"display:flex;align-items: center;flex-wrap: wrap;"
>
:key=
'index'
:val=
"item.Id"
:label=
"item.Name"
/>
<q-checkbox
v-model=
"addMsg.LoseCause"
v-if=
"x.Name=='已输单'"
v-for=
"(item,index) in x.OptionsList"
:key=
'index'
:val=
"item.Id"
:label=
"item.Name"
/>
<q-checkbox
v-model=
"addMsg.InvalidCause"
v-if=
"x.Name=='无效'"
v-for=
"(item,index) in x.OptionsList"
:key=
'index'
:val=
"item.Id"
:label=
"item.Name"
/>
</div>
</div>
</div>
<div
class=
"box"
>
<el-form
label-width=
"120px"
>
</el-form>
<q-card-actions
align=
"left"
class=
"bg-white"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"savemove()"
style=
"width: 100px;"
:loading=
"loading"
/>
<q-btn
class=
"q-mr-md"
label=
"返回"
@
click=
"goblck()"
style=
"width: 60px;"
/>
</q-card-actions>
</div>
</div>
</div>
<!-- 人员/部门选择 -->
</div>
<choiceapprovalorbranch
v-if=
"outerVisible"
@
close=
"outerVisible = false"
@
success=
"getsuccess2"
:byval=
'showMember'
cptype=
"1"
></choiceapprovalorbranch>
<div
class=
"box"
>
<el-form
label-width=
"120px"
>
</el-form>
<q-card-actions
align=
"left"
class=
"bg-white"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"savemove()"
style=
"width: 100px;"
:loading=
"loading"
/>
<q-btn
class=
"q-mr-md"
label=
"返回"
@
click=
"goblck()"
style=
"width: 60px;"
/>
</q-card-actions>
</div>
</div>
<!-- 人员/部门选择 -->
<choiceapprovalorbranch
v-if=
"outerVisible"
@
close=
"outerVisible = false"
@
success=
"getsuccess2"
:byval=
'showMember'
cptype=
"1"
></choiceapprovalorbranch>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
choiceapprovalorbranch
from
'./components/choiceapprovalorbranch'
import
choiceapprovalorbranch
from
'./components/choiceapprovalorbranch'
import
{
import
{
getCustomerStageList
,
getCustomerStageList
,
}
from
'../../../../api/system/wechat'
;
}
from
'../../../../api/system/wechat'
;
export
default
{
export
default
{
meta
:
{
meta
:
{
title
:
"阶段管理"
title
:
"阶段管理"
},
},
components
:
{
components
:
{
choiceapprovalorbranch
choiceapprovalorbranch
},
},
name
:
"addPhase"
,
name
:
"addPhase"
,
data
()
{
data
()
{
return
{
return
{
loading
:
false
,
loading
:
false
,
outerVisible
:
false
,
outerVisible
:
false
,
addMsg
:{
addMsg
:
{
FlowName
:
''
,
FlowName
:
''
,
DeptEmpList
:[],
DeptEmpList
:
[],
UseStage
:
''
,
UseStage
:
''
,
LoseCause
:[],
LoseCause
:
[],
InvalidCause
:[],
InvalidCause
:
[],
},
showMember
:[],
StageList
:[],
}
},
created
()
{
this
.
getCustomerStageList
()
},
},
methods
:
{
showMember
:
[],
StageList
:
[],
goblck
()
{
//返回上一个页面
}
this
.
$router
.
go
(
-
1
);
//返回上一层
},
},
created
()
{
savemove
(){
this
.
getCustomerStageList
()
},
},
methods
:
{
getCustomerStageList
(){
goblck
()
{
//返回上一个页面
getCustomerStageList
({}).
then
(
res
=>
{
this
.
$router
.
go
(
-
1
);
//返回上一层
this
.
loading
=
false
},
if
(
res
.
Code
==
1
)
{
savemove
()
{},
this
.
StageList
=
res
.
Data
getCustomerStageList
()
{
}
getCustomerStageList
({}).
then
(
res
=>
{
this
.
loading
=
false
})
if
(
res
.
Code
==
1
)
{
},
this
.
StageList
=
res
.
Data
getsuccess2
(
list
,
type
){
}
console
.
log
(
list
)
})
this
.
showMember
=
list
},
this
.
outerVisible
=
false
getsuccess2
(
list
,
type
)
{
},
this
.
showMember
=
list
this
.
outerVisible
=
false
},
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
src/pages/enterprise/customer/CSChild/components/addfield.vue
View file @
4574f91a
<
template
>
<
template
>
<div
class=
"addfield"
style=
"padding: 0;margin: 0;"
>
<div
class=
"addfield"
style=
"padding: 0;margin: 0;"
>
<q-dialog
v-model=
"Isadd"
persistent
>
<q-card
style=
"width: 700px; max-width: 80vw;"
>
<q-card-section>
<div
class=
"text-h6"
>
新建/修改字段
</div>
</q-card-section>
<q-separator
/>
<q-card-section
class=
"q-pt-none"
style=
"margin-top: 15px;"
>
<q-splitter
v-model=
"splitterModel"
>
<template
v-slot:before
>
<q-tabs
v-model=
"tab"
vertical
@
input=
"getdefault"
>
<q-tab
v-for=
"(x,y) in tabsList"
:key=
'y'
:name=
"x.Id"
:label=
"x.Name"
:disable=
"x.disable"
/>
</q-tabs>
</
template
>
<
template
v-slot:after
>
<div
style=
"height: 100%; width: 100%;padding: 16px"
>
<el-form
label-width=
"120px"
>
<el-form-item
label=
"字段名称:"
>
<q-input
clearable
filled
maxlength=
"8"
counter
v-model=
"addMsg.Name"
@
input=
"$forceUpdate()"
label=
"字段名称"
:rules=
"[val => !!val || '请输入字段名称']"
/>
</el-form-item>
<el-form-item
label=
"部门选择:"
>
<q-radio
v-model=
"departmentType"
val=
"1"
label=
"公司字段"
@
input=
'addMsg.DeptId=0'
/>
<q-radio
v-model=
"departmentType"
val=
"2"
label=
"部门字段"
@
input=
'addMsg.DeptId=0'
/>
<div
v-if=
"departmentType==2"
>
<selectTree
:treeData=
'deptl'
:defaultArray=
"returnString"
nodeKey=
"DeptId"
:multiple=
"false"
labelKey=
"DeptName"
childrenKey=
"ChildList"
tipText=
"选择部门"
@
getChild=
"getChild"
classStr=
"col-6 q-pb-lg"
>
</selectTree>
</div>
</el-form-item>
<el-form-item
label=
"字数限制:"
v-if=
'tab==1'
>
<q-input
v-model
.
number=
"addMsg.WordNum"
:rules=
"[val => !!val || '不能为空']"
type=
"number"
filled
:max=
'50'
:min=
'0'
style=
"max-width: 200px"
/>
</el-form-item>
<el-form-item
label=
"输入类型:"
v-if=
'tab==1'
>
<q-dialog
v-model=
"Isadd"
persistent
>
<div
class=
"q-gutter-sm"
>
<q-card
style=
"width: 700px; max-width: 80vw;"
>
<q-checkbox
v-model=
"addMsg.InputType"
v-for=
"(x,y) in checkboxList"
:key=
'y'
:val=
"x.Id"
<q-card-section>
:label=
"x.Name"
/>
<div
class=
"text-h6"
>
新建/修改字段
</div>
</div>
</q-card-section>
</el-form-item>
<q-separator
/>
<el-form-item
label=
"文字字数:"
v-if=
'tab==2'
>
<q-card-section
class=
"q-pt-none"
style=
"margin-top: 15px;"
>
<el-input-number
v-model=
"addMsg.WordNum"
@
change=
"handleChange"
:min=
"1"
:max=
"2000"
>
<q-splitter
v-model=
"splitterModel"
>
</el-input-number>
</el-form-item>
<template
v-slot:before
>
<el-form-item
label=
"列表选项:"
v-if=
'tab==3|| tab==4'
>
<q-tabs
v-model=
"tab"
vertical
@
input=
"getdefault"
>
<draggable
v-model=
"addMsg.OptionsList"
>
<q-tab
v-for=
"(x,y) in tabsList"
:key=
'y'
:name=
"x.Id"
:label=
"x.Name"
<div
v-for=
"(x,y) in addMsg.OptionsList"
:key=
'y'
:disable=
"x.disable"
/>
style=
"display: flex;align-items: center;margin-bottom: 10px;"
>
</q-tabs>
<i
class=
"iconfont icon-weiyi"
style=
"font-size: 14px;color: #777;margin-right: 10px;"
></i>
</
template
>
<q-input
clearable
filled
maxlength=
"16"
v-model=
"x.Name"
style=
"width: 280px;"
@
input=
"$forceUpdate()"
label=
"列表项值"
/>
<
template
v-slot:after
>
<q-btn
round
size=
"xs"
color=
"deep-orange"
icon=
"delete"
v-if=
"addMsg.OptionsList.length>1"
<div
style=
"height: 100%; width: 100%;padding: 16px"
>
@
click=
"addMsg.OptionsList.splice(y,1)"
style=
'margin-left: 10px;'
/>
<el-form
label-width=
"120px"
>
<q-btn
round
size=
"xs"
color=
"primary"
icon=
"add"
v-if=
"addMsg.OptionsList.length==y+1"
<el-form-item
label=
"字段名称:"
>
@
click=
"addMsg.OptionsList.push(
{Id:0,Name:''})" style='margin-left: 10px;' />
<q-input
clearable
filled
maxlength=
"8"
counter
v-model=
"addMsg.Name"
</div>
@
input=
"$forceUpdate()"
label=
"字段名称"
:rules=
"[val => !!val || '请输入字段名称']"
/>
</draggable>
</el-form-item>
</el-form-item>
<el-form-item
label=
"部门选择:"
>
<el-form-item
label=
"小数位数:"
v-if=
'tab==7'
>
<q-radio
v-model=
"departmentType"
val=
"1"
label=
"公司字段"
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Id"
v-model=
"addMsg.Digits"
ref=
"Id"
@
input=
'addMsg.DeptId=0'
/>
:options=
"decimalslist"
label=
"小数位数"
:dense=
"false"
emit-value
map-options
/>
<q-radio
v-model=
"departmentType"
val=
"2"
label=
"部门字段"
</el-form-item>
@
input=
'addMsg.DeptId=0'
/>
<el-form-item
label=
"属性设置:"
>
<div
v-if=
"departmentType==2"
>
<div
class=
"q-gutter-sm"
>
<q-toggle
v-model=
"addMsg.Required"
label=
"必填项"
:true-value=
"1"
:false-value=
"2"
/>
<selectTree
:treeData=
'deptl'
:defaultArray=
"returnString"
<q-toggle
v-model=
"addMsg.Enable"
label=
"启用"
:true-value=
"1"
:false-value=
"2"
/>
nodeKey=
"DeptId"
:multiple=
"false"
labelKey=
"DeptName"
</div>
childrenKey=
"ChildList"
tipText=
"选择部门"
@
getChild=
"getChild"
</el-form-item>
classStr=
"col-6 q-pb-lg"
>
</el-form>
</selectTree>
</div>
</div>
</
template
>
</el-form-item>
</q-splitter>
<el-form-item
label=
"字数限制:"
v-if=
'tab==1'
>
</q-card-section>
<q-input
v-model
.
number=
"addMsg.WordNum"
:rules=
"[val => !!val || '不能为空']"
<q-separator
/>
type=
"number"
filled
:max=
'50'
:min=
'0'
style=
"max-width: 200px"
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
</el-form-item>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"getcancel()"
/>
<el-form-item
label=
"输入类型:"
v-if=
'tab==1'
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"确定"
@
click=
"savewb()"
:loading=
"loading"
/>
</q-card-actions>
<div
class=
"q-gutter-sm"
>
</q-card>
<q-checkbox
v-model=
"addMsg.InputType"
</q-dialog>
v-for=
"(x,y) in checkboxList"
:key=
'y'
:val=
"x.Id"
</div>
:label=
"x.Name"
/>
</div>
</el-form-item>
<el-form-item
label=
"文字字数:"
v-if=
'tab==2'
>
<el-input-number
v-model=
"addMsg.WordNum"
@
change=
"handleChange"
:min=
"1"
:max=
"2000"
></el-input-number>
</el-form-item>
<el-form-item
label=
"列表选项:"
v-if=
'tab==3|| tab==4'
>
<draggable
v-model=
"addMsg.OptionsList"
>
<div
v-for=
"(x,y) in addMsg.OptionsList"
:key=
'y'
style=
"display: flex;align-items: center;margin-bottom: 10px;"
>
<i
class=
"iconfont icon-weiyi"
style=
"font-size: 14px;color: #777;margin-right: 10px;"
></i>
<q-input
clearable
filled
maxlength=
"16"
v-model=
"x.Name"
style=
"width: 280px;"
@
input=
"$forceUpdate()"
label=
"列表项值"
/>
<q-btn
round
size=
"xs"
color=
"deep-orange"
icon=
"delete"
v-if=
"addMsg.OptionsList.length>1"
@
click=
"addMsg.OptionsList.splice(y,1)"
style=
'margin-left: 10px;'
/>
<q-btn
round
size=
"xs"
color=
"primary"
icon=
"add"
v-if=
"addMsg.OptionsList.length==y+1"
@
click=
"addMsg.OptionsList.push(
{Id:0,Name:''})" style='margin-left: 10px;'/>
</div>
</draggable>
</el-form-item>
<el-form-item
label=
"小数位数:"
v-if=
'tab==7'
>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Id"
v-model=
"addMsg.Digits"
ref=
"Id"
:options=
"decimalslist"
label=
"小数位数"
:dense=
"false"
emit-value
map-options
/>
</el-form-item>
<el-form-item
label=
"属性设置:"
>
<div
class=
"q-gutter-sm"
>
<q-toggle
v-model=
"addMsg.Required"
label=
"必填项"
:true-value=
"1"
:false-value=
"2"
/>
<q-toggle
v-model=
"addMsg.Enable"
label=
"启用"
:true-value=
"1"
:false-value=
"2"
/>
</div>
</el-form-item>
</el-form>
</div>
</
template
>
</q-splitter>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"getcancel()"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"确定"
@
click=
"savewb()"
:loading=
"loading"
/>
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
</template>
<
script
>
<
script
>
import
draggable
from
"vuedraggable"
import
draggable
from
"vuedraggable"
import
selectTree
from
'../../../../../components/common/select-tree'
import
selectTree
from
'../../../../../components/common/select-tree'
import
{
setCustomerFiledInfo
import
{
}
from
'../../../../../api/system/wechat'
setCustomerFiledInfo
const
defaultObj
=
{
}
from
'../../../../../api/system/wechat'
Id
:
0
,
const
defaultObj
=
{
Type
:
1
,
Id
:
0
,
Name
:
''
,
Type
:
1
,
Required
:
2
,
Name
:
''
,
DeptId
:
0
,
Required
:
2
,
WordNum
:
1
,
DeptId
:
0
,
InputType
:
[],
WordNum
:
1
,
OptionsList
:
[{
InputType
:[],
Id
:
1
,
OptionsList
:[{
Id
:
1
,
Name
:
''
}],
Name
:
''
Digits
:
0
,
}],
Enable
:
1
,
Digits
:
0
,
Enable
:
1
,
}
export
default
{
name
:
"addfield"
,
components
:
{
draggable
,
selectTree
,
},
props
:
{
obj
:
{
type
:
Object
,
default
:
{},
},
deptl
:{
type
:
Array
,
default
:
[],
},
tabsList
:{
type
:
Array
,
default
:
[],
},
checkboxList
:{
type
:
Array
,
default
:
[],
},
},
data
()
{
return
{
loading
:
false
,
Isadd
:
true
,
splitterModel
:
13
,
tab
:
1
,
departmentType
:
'1'
,
decimalslist
:
[{
Id
:
0
},
{
Id
:
1
},
{
Id
:
2
},
{
Id
:
3
},
{
Id
:
4
},
{
Id
:
5
},
{
Id
:
6
},
{
Id
:
7
},
{
Id
:
8
},
{
Id
:
9
},
{
Id
:
10
},
{
Id
:
11
},],
addMsg
:
Object
.
assign
({},
defaultObj
),
returnString
:
[],
//默认岗位
}
export
default
{
name
:
"addfield"
,
components
:
{
draggable
,
selectTree
,
},
props
:
{
obj
:
{
type
:
Object
,
default
:
{},
},
deptl
:
{
type
:
Array
,
default
:
[],
},
tabsList
:
{
type
:
Array
,
default
:
[],
},
checkboxList
:
{
type
:
Array
,
default
:
[],
},
},
data
()
{
return
{
loading
:
false
,
Isadd
:
true
,
splitterModel
:
13
,
tab
:
1
,
departmentType
:
'1'
,
decimalslist
:
[{
Id
:
0
},
{
Id
:
1
},
{
Id
:
2
},
{
Id
:
3
},
{
Id
:
4
},
{
Id
:
5
},
{
Id
:
6
},
{
Id
:
7
},
{
Id
:
8
},
{
Id
:
9
},
{
Id
:
10
},
{
Id
:
11
},
],
addMsg
:
Object
.
assign
({},
defaultObj
),
returnString
:
[],
//默认岗位
}
},
created
()
{
this
.
Isadd
=
true
if
(
this
.
obj
!=
null
)
{
//编辑的时候数据处理
let
data
=
{
Id
:
this
.
obj
.
Id
,
Type
:
this
.
obj
.
Type
,
Name
:
this
.
obj
.
Name
,
Required
:
this
.
obj
.
Required
,
DeptId
:
this
.
obj
.
DeptId
,
WordNum
:
this
.
obj
.
WordNum
,
InputType
:
this
.
obj
.
InputType
.
split
(
','
).
map
(
Number
),
OptionsList
:
this
.
obj
.
OptionsList
,
Digits
:
this
.
obj
.
Digits
,
Enable
:
this
.
obj
.
Enable
,
}
this
.
tab
=
this
.
obj
.
Type
if
(
this
.
obj
.
DeptId
>
0
)
{
this
.
departmentType
=
'2'
this
.
returnString
=
[]
setTimeout
(()
=>
{
this
.
returnString
.
push
(
this
.
obj
.
DeptId
)
this
.
$forceUpdate
();
},
500
)
}
this
.
addMsg
=
data
this
.
tabsList
.
forEach
(
x
=>
{
if
(
x
.
Id
!=
data
.
Type
)
{
x
.
disable
=
true
}
})
}
else
{
this
.
addMsg
.
InputType
=
[]
this
.
checkboxList
.
forEach
(
x
=>
{
this
.
addMsg
.
InputType
.
push
(
x
.
Id
)
})
}
},
methods
:
{
savewb
()
{
let
addMsg
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
addMsg
))
addMsg
.
Type
=
this
.
tab
//先类型赋值
if
(
addMsg
.
Name
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写字段名称`
,
position
:
'top'
})
return
}
if
((
addMsg
.
Type
==
1
||
addMsg
.
Type
==
2
)
&&
addMsg
.
WordNum
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`字数不能为空`
,
position
:
'top'
})
return
}
if
(
this
.
departmentType
==
2
&&
(
addMsg
.
DeptId
==
0
||
addMsg
.
DeptId
==
''
))
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请选择部门`
,
position
:
'top'
})
return
}
if
(
addMsg
.
Type
==
3
||
addMsg
.
Type
==
4
)
{
for
(
let
i
=
0
;
i
<
addMsg
.
OptionsList
.
length
;
i
++
)
{
let
x
=
addMsg
.
OptionsList
[
i
]
if
(
x
.
Name
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写列表选项值`
,
position
:
'top'
})
break
}
}
},
addMsg
.
OptionsList
[
i
].
Id
=
i
+
1
created
()
{
}
this
.
Isadd
=
true
}
if
(
this
.
obj
!=
null
)
{
//编辑的时候数据处理
if
(
addMsg
.
Type
==
1
)
{
let
data
=
{
Id
:
this
.
obj
.
Id
,
if
(
addMsg
.
InputType
.
length
==
0
)
{
Type
:
this
.
obj
.
Type
,
this
.
$q
.
notify
({
Name
:
this
.
obj
.
Name
,
type
:
'negative'
,
Required
:
this
.
obj
.
Required
,
message
:
`至少选择一种输入类型`
,
DeptId
:
this
.
obj
.
DeptId
,
position
:
'top'
WordNum
:
this
.
obj
.
WordNum
,
})
InputType
:
this
.
obj
.
InputType
.
split
(
','
).
map
(
Number
),
return
OptionsList
:
this
.
obj
.
OptionsList
,
}
else
{
Digits
:
this
.
obj
.
Digits
,
addMsg
.
InputType
=
addMsg
.
InputType
.
join
(
','
)
Enable
:
this
.
obj
.
Enable
,
}
}
this
.
tab
=
this
.
obj
.
Type
if
(
this
.
obj
.
DeptId
>
0
){
this
.
departmentType
=
'2'
this
.
returnString
=
[]
setTimeout
(()
=>
{
this
.
returnString
.
push
(
this
.
obj
.
DeptId
)
this
.
$forceUpdate
();
},
500
)
}
this
.
addMsg
=
data
this
.
tabsList
.
forEach
(
x
=>
{
if
(
x
.
Id
!=
data
.
Type
){
x
.
disable
=
true
}
})
}
else
{
this
.
addMsg
.
InputType
=
[]
this
.
checkboxList
.
forEach
(
x
=>
{
this
.
addMsg
.
InputType
.
push
(
x
.
Id
)
})
}
},
methods
:
{
savewb
()
{
let
addMsg
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
addMsg
))
addMsg
.
Type
=
this
.
tab
//先类型赋值
if
(
addMsg
.
Name
==
''
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写字段名称`
,
position
:
'top'
})
return
}
if
((
addMsg
.
Type
==
1
||
addMsg
.
Type
==
2
)
&&
addMsg
.
WordNum
==
''
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`字数不能为空`
,
position
:
'top'
})
return
}
if
(
this
.
departmentType
==
2
&&
(
addMsg
.
DeptId
==
0
||
addMsg
.
DeptId
==
''
)){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请选择部门`
,
position
:
'top'
})
return
}
if
(
addMsg
.
Type
==
3
||
addMsg
.
Type
==
4
){
for
(
let
i
=
0
;
i
<
addMsg
.
OptionsList
.
length
;
i
++
){
let
x
=
addMsg
.
OptionsList
[
i
]
if
(
x
.
Name
==
''
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请填写列表选项值`
,
position
:
'top'
})
break
}
addMsg
.
OptionsList
[
i
].
Id
=
i
+
1
}
}
if
(
addMsg
.
Type
==
1
){
if
(
addMsg
.
InputType
.
length
==
0
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`至少选择一种输入类型`
,
position
:
'top'
})
return
}
else
{
addMsg
.
InputType
=
addMsg
.
InputType
.
join
(
','
)
}
}
else
{
addMsg
.
InputType
=
'1'
}
console
.
log
(
addMsg
)
this
.
loading
=
true
setCustomerFiledInfo
(
addMsg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
res
.
Message
,
position
:
'top'
})
this
.
$emit
(
'getcancel'
,
2
)
}).
catch
((
e
)
=>
{
this
.
loading
=
false
})
},
getcancel
()
{
this
.
$emit
(
'getcancel'
,
1
)
},
getChild
(
deptArray
)
{
var
tempStr
=
""
;
if
(
deptArray
&&
deptArray
!=
''
)
{
tempStr
=
deptArray
;
}
this
.
addMsg
.
DeptId
=
tempStr
},
handleChange
(
value
)
{
},
}
else
{
getdefault
(){
//新增的时候初始默认值
addMsg
.
InputType
=
'1'
this
.
addMsg
=
Object
.
assign
({},
defaultObj
)
}
this
.
addMsg
.
OptionsList
=
[{
Id
:
0
,
Name
:
''
,}]
//多选和单选的值
this
.
loading
=
true
}
setCustomerFiledInfo
(
addMsg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
res
.
Message
,
position
:
'top'
})
this
.
$emit
(
'getcancel'
,
2
)
}).
catch
((
e
)
=>
{
this
.
loading
=
false
})
},
getcancel
()
{
this
.
$emit
(
'getcancel'
,
1
)
},
getChild
(
deptArray
)
{
var
tempStr
=
""
;
if
(
deptArray
&&
deptArray
!=
''
)
{
tempStr
=
deptArray
;
}
}
this
.
addMsg
.
DeptId
=
tempStr
},
handleChange
(
value
)
{
},
getdefault
()
{
//新增的时候初始默认值
this
.
addMsg
=
Object
.
assign
({},
defaultObj
)
this
.
addMsg
.
OptionsList
=
[{
Id
:
0
,
Name
:
''
,
}]
//多选和单选的值
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
</
style
>
</
style
>
\ No newline at end of file
src/pages/enterprise/customer/CSChild/components/choiceapprovalorbranch.vue
View file @
4574f91a
<
style
>
<
style
>
.choiceappoval
.ApprovalProcessBg
{
.choiceappoval
.ApprovalProcessBg
{
background
:
#f8f8f8
;
background
:
#f8f8f8
;
max-height
:
400px
;
max-height
:
400px
;
overflow-y
:
auto
;
overflow-y
:
auto
;
}
}
.choiceappoval
.Approval_yxList
{
.choiceappoval
.Approval_yxList
{
width
:
300px
;
width
:
300px
;
background
:
#f8f8f8
;
background
:
#f8f8f8
;
min-height
:
400px
;
min-height
:
400px
;
max-height
:
400px
;
max-height
:
400px
;
overflow-y
:
auto
;
overflow-y
:
auto
;
}
}
.choiceappoval
.Approval_yxList
li
{
display
:
inline-block
;
width
:
100%
;
line-height
:
40px
;
text-indent
:
15px
;
border-bottom
:
1px
dotted
#eee
;
}
.choiceappoval
.Approval_yxList
li
{
display
:
inline-block
;
width
:
100%
;
line-height
:
40px
;
text-indent
:
15px
;
border-bottom
:
1px
dotted
#eee
;
}
</
style
>
</
style
>
<
template
>
<
template
>
<div>
<div>
<q-dialog
v-model=
"IsShow"
persistent
>
<q-dialog
v-model=
"IsShow"
persistent
>
<q-card
style=
"width: 700px; max-width: 80vw;"
class=
"choiceappoval"
>
<q-card
style=
"width: 700px; max-width: 80vw;"
class=
"choiceappoval"
>
<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-separator
/>
<q-separator
/>
<q-card-section
class=
"q-pt-none"
style=
"padding: 20px 0;"
>
<q-card-section
class=
"q-pt-none"
style=
"padding: 20px 0;"
>
<div
style=
"display: flex;align-items: flex-start;justify-content: space-between;"
>
<div
style=
"display: flex;align-items: flex-start;justify-content: space-between;"
>
<div
style=
"width: 300px; margin: 0 20px;"
>
<div
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;display: flex;align-items: center;"
>
选择:
<el-input
<p
style=
"margin: 0 0 10px 0;display: flex;align-items: center;"
>
选择:
<el-input
style=
"width: 200px;"
style=
"width: 200px;"
placeholder=
"输入关键字进行过滤"
v-model=
"filterText"
>
placeholder=
"输入关键字进行过滤"
v-model=
"filterText"
>
</el-input>
</el-input>
</p>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode"
:data=
"memberList"
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode"
:data=
"memberList"
show-checkbox
show-checkbox
ref=
"treeUser"
:props=
"defaultProps"
:render-after-expand=
"false"
ref=
"treeUser"
:props=
"defaultProps"
:render-after-expand=
"false"
node-key=
"DeptId"
node-key=
"DeptId"
@
check-change=
"handleNodeChange"
@
check=
'btncheck'
>
@
check-change=
"handleNodeChange"
@
check=
'btncheck'
>
</el-tree>
</el-tree>
</div>
</div>
<div
style=
"width: 300px; margin: 0 20px;"
>
<div
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showMember"
>
{{
item
.
DeptName
}}
<li
v-for=
"item in showMember"
>
{{
item
.
DeptName
}}
<i
@
click=
"mySetCheckedKeys(item.DeptId)"
<i
@
click=
"mySetCheckedKeys(item.DeptId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</li>
</div>
</div>
</div>
</div>
</div>
</div>
</q-card-section>
<q-separator
/>
</q-card-section>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"closeEditOrder"
/>
<q-separator
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"确定"
@
click=
"saveOrderInfo()"
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
</q-card-actions>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"closeEditOrder"
/>
</q-card>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"确定"
@
click=
"saveOrderInfo()"
/>
</q-dialog>
</q-card-actions>
</div>
</q-card>
</q-dialog>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
import
{
getEmployeeAddrBook
getEmployeeAddrBook
}
from
'../../../../../api/users/user'
}
from
'../../../../../api/users/user'
export
default
{
export
default
{
props
:
{
props
:
{
outerindex
:
{
outerindex
:
{
type
:
String
,
type
:
String
,
default
:
''
,
default
:
''
,
},
},
byval
:
{
byval
:{
type
:
Array
,
type
:
Array
,
default
:
[],
default
:
[],
},
},
cptype
:
{
//1是列表上使用2 新增使用
cptype
:{
//1是列表上使用2 新增使用
type
:
String
,
type
:
String
,
default
:
'1'
,
default
:
'1'
,
}
}
},
data
()
{
return
{
IsShow
:
true
,
memberList
:
[],
filterText
:
""
,
defaultProps
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
},
},
userList
:
[],
data
()
{
showMember
:
[],
return
{
memberSetCheckedKeys
:
[],
IsShow
:
true
,
sysUserKeys
:
[],
memberList
:
[],
newList
:
[]
filterText
:
""
,
}
defaultProps
:
{
},
children
:
'ChildList'
,
created
()
{
label
:
'DeptName'
,
if
(
this
.
byval
.
length
>
0
)
{
},
this
.
memberSetCheckedKeys
=
[];
userList
:
[],
this
.
showMember
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
byval
))
showMember
:
[],
this
.
byval
.
forEach
(
x
=>
{
memberSetCheckedKeys
:
[],
this
.
memberSetCheckedKeys
.
push
(
x
.
DeptId
)
sysUserKeys
:
[],
})
newList
:[]
}
this
.
getMember
()
//部门下面选择员工
},
mounted
()
{
},
watch
:
{
filterText
(
val
)
{
this
.
$refs
.
treeUser
.
filter
(
val
);
},
},
methods
:
{
getMember
()
{
let
_arr
=
this
.
sysUserKeys
.
concat
(
this
.
memberSetCheckedKeys
)
getEmployeeAddrBook
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
memberList
=
res
.
Data
let
_this
=
this
;
_this
.
$refs
.
treeUser
.
setCheckedKeys
(
_arr
);
}
}).
catch
(()
=>
{
})
},
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DeptName
.
indexOf
(
value
)
!==
-
1
;
},
handleNodeChange
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
DataType
==
2
&&
data
.
IsCheck
)
{
//是员工且选中
let
isExsit
=
false
this
.
showMember
.
forEach
(
x
=>
{
if
(
x
.
DeptId
==
data
.
DeptId
)
{
isExsit
=
true
return
false
}
}
},
})
created
()
{
if
(
!
isExsit
)
{
if
(
this
.
byval
.
length
>
0
){
this
.
showMember
.
push
({
this
.
memberSetCheckedKeys
=
[];
DeptName
:
data
.
DeptName
,
this
.
showMember
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
byval
))
DeptId
:
data
.
DeptId
,
this
.
byval
.
forEach
(
x
=>
{
DataType
:
data
.
DataType
this
.
memberSetCheckedKeys
.
push
(
x
.
DeptId
)
})
})
this
.
memberSetCheckedKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
DeptId
)
!=
-
1
)
{
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
DeptId
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
this
.
getMember
()
//部门下面选择员工
}
},
}
mounted
()
{
if
(
data
.
DataType
!=
2
&&
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
==
-
1
)
{
},
this
.
memberSetCheckedKeys
.
push
(
data
.
DeptId
)
watch
:
{
}
filterText
(
val
)
{
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
this
.
$refs
.
treeUser
.
filter
(
val
);
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
!=
-
1
)
{
},
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
},
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
ParentId
)
!=
-
1
)
{
methods
:
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
getMember
()
{
}
let
_arr
=
this
.
sysUserKeys
.
concat
(
this
.
memberSetCheckedKeys
)
}
getEmployeeAddrBook
({}).
then
(
res
=>
{
}
if
(
res
.
Code
==
1
)
{
},
this
.
memberList
=
res
.
Data
btncheck
()
{
//对数据的处理
let
_this
=
this
;
this
.
getdataprocess
()
_this
.
$refs
.
treeUser
.
setCheckedKeys
(
_arr
);
}
}).
catch
(()
=>
{
})
},
},
getdataprocess
()
{
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DeptName
.
indexOf
(
value
)
!==
-
1
;
},
handleNodeChange
(
data
,
checked
)
{
console
.
log
(
data
,
checked
)
data
.
IsCheck
=
checked
;
if
(
data
.
DataType
==
2
&&
data
.
IsCheck
)
{
//是员工且选中
let
isExsit
=
false
this
.
showMember
.
forEach
(
x
=>
{
if
(
x
.
DeptId
==
data
.
DeptId
)
{
isExsit
=
true
return
false
}
})
if
(
!
isExsit
)
{
this
.
showMember
.
push
({
DeptName
:
data
.
DeptName
,
DeptId
:
data
.
DeptId
,
DataType
:
data
.
DataType
})
this
.
memberSetCheckedKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
DeptId
)
!=
-
1
)
{
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
DeptId
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
if
(
data
.
DataType
!=
2
&&
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
==
-
1
)
{
this
.
memberSetCheckedKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
},
btncheck
(){
//对数据的处理
this
.
getdataprocess
()
},
},
getdataprocess
(){
getChildList
(
x
,
list
)
{
},
getChildList
(
x
,
list
){
},
mySetCheckedKeys
(
id
)
{
if
(
this
.
memberSetCheckedKeys
.
length
==
0
)
return
if
(
id
==
-
1
)
{
this
.
$refs
.
treeUser
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
)
return
}
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
id
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
id
),
1
)
this
.
$refs
.
treeUser
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
);
},
//关闭弹窗
closeEditOrder
()
{
this
.
$emit
(
'close'
)
},
saveOrderInfo
()
{
this
.
$emit
(
'success'
,
this
.
showMember
,
this
.
cptype
)
}
},
mySetCheckedKeys
(
id
)
{
if
(
this
.
memberSetCheckedKeys
.
length
==
0
)
return
if
(
id
==
-
1
)
{
this
.
$refs
.
treeUser
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
)
return
}
}
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
id
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
id
),
1
)
this
.
$refs
.
treeUser
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
);
},
//关闭弹窗
closeEditOrder
()
{
this
.
$emit
(
'close'
)
},
saveOrderInfo
()
{
this
.
$emit
(
'success'
,
this
.
showMember
,
this
.
cptype
)
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
src/pages/enterprise/customer/CSChild/stageManagement.vue
View file @
4574f91a
<
style
>
<
style
>
@import
"../../../financial/css/cssReset.css"
;
@import
"../../../financial/css/cssReset.css"
;
.stageManagement
{
.stageManagement
{
padding
:
20px
;
padding
:
20px
;
}
}
.stageManagement
.box
{
.stageManagement
.box
{
width
:
100%
;
width
:
100%
;
border-radius
:
6px
;
background
:
#fff
;
padding
:
20px
;
margin-bottom
:
25px
;
}
border-radius
:
6px
;
.stageManagement
.bold
{
background
:
#fff
;
font-weight
:
700
;
padding
:
20
px
;
font-size
:
14
px
;
margin-bottom
:
25px
;
color
:
#333
;
}
}
.stageManagement
.bold
{
.stageManagement
ul
li
{
font-weight
:
700
;
display
:
flex
;
font-size
:
14px
;
align-items
:
center
;
color
:
#333
;
}
}
.stageManagement
ul
li
{
.stageManagement
.btn
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
}
margin-top
:
24px
;
margin-left
:
56px
;
;
margin-bottom
:
30px
;
}
.stageManagement
.btn
{
display
:
flex
;
align-items
:
center
;
margin-top
:
24px
;
margin-left
:
56px
;
;
margin-bottom
:
30px
;
}
</
style
>
</
style
>
<
template
>
<
template
>
<div
class=
"stageManagement"
style=
"background: transparent;"
>
<div
class=
"stageManagement"
style=
"background: transparent;"
>
<div
class=
"box"
>
<div
class=
"box"
>
<div
class=
"bold"
style=
"margin-bottom: 30px;"
>
跟进阶段
</div>
<div
class=
"bold"
style=
"margin-bottom: 30px;"
>
跟进阶段
</div>
<ul
v-for=
"(x,y) in addMsg"
:key=
"y"
v-if=
"x.Type==1"
>
<ul
v-for=
"(x,y) in addMsg"
:key=
"y"
v-if=
"x.Type==1"
>
<div
v-if=
"x.IsDefault==0"
>
<div
v-if=
"x.IsDefault==0"
>
<draggable
v-model=
"x.OptionsList"
>
<draggable
v-model=
"x.OptionsList"
>
<li
v-for=
"(item,index) in x.OptionsList"
:key=
"index"
>
<li
v-for=
"(item,index) in x.OptionsList"
:key=
"index"
>
<div
style=
"width: 57px;"
>
<div
style=
"width: 57px;"
>
<i
class=
"iconfont icon-weiyi"
style=
"font-size: 14px;color: #777;margin: 0 10px;"
></i>
<i
class=
"iconfont icon-weiyi"
style=
"font-size: 14px;color: #777;margin: 0 10px;"
></i>
</div>
</div>
<q-input
clearable
debounce
filled
maxlength=
"10"
counter
v-model=
"item.Name"
<q-input
clearable
debounce
filled
maxlength=
"10"
counter
v-model=
"item.Name"
style=
"width:500px"
style=
"width:500px"
@
input=
"$forceUpdate()"
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
<q-btn
flat
size=
"sm"
icon=
"delete"
color=
"negative"
class=
"q-mr-xs"
style=
"margin-left: 10px;"
label=
""
<q-btn
flat
size=
"sm"
icon=
"delete"
color=
"negative"
class=
"q-mr-xs"
style=
"margin-left: 10px;"
@
click=
"addMsg[y].OptionsList.splice(index,1)"
/>
label=
""
@
click=
"addMsg[y].OptionsList.splice(index,1)"
/>
</li>
</li>
</draggable>
</draggable>
<div
class=
"btn"
>
<div
class=
"btn"
>
<q-btn
v-if=
"x.OptionsList.length
<30
"
color=
"accent"
class=
"q-mr-md"
label=
"添加"
icon=
'add'
<q-btn
v-if=
"x.OptionsList.length
<30
"
color=
"accent"
class=
"q-mr-md"
label=
"添加"
icon=
'add'
@
click=
"addMsg[y].OptionsList.push(
{Id:0,Name:'',disable:false}),$forceUpdate()" style="width: 100px;" />
@
click=
"addMsg[y].OptionsList.push(
{Id:0,Name:'',disable:false}),$forceUpdate()"
<span
style=
"color:#858598"
>
已设/可设上限:
{{
x
.
OptionsList
.
length
}}
/30
</span>
style="width: 100px;" />
</div>
<span
style=
"color:#858598"
>
已设/可设上限:
{{
x
.
OptionsList
.
length
}}
/30
</span>
</div>
</div>
<div
v-if=
"x.IsDefault==1"
>
<li
v-for=
"(item,index) in x.OptionsList"
:key=
"index"
>
<div
style=
"width: 57px;"
>
</div>
<q-input
clearable
debounce
filled
v-model=
"item.Name"
style=
"width:500px"
disable
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
</li>
</div>
</ul>
</div>
</div>
<div
v-if=
"x.IsDefault==1"
>
<div
class=
"box"
>
<li
v-for=
"(item,index) in x.OptionsList"
:key=
"index"
>
<div
class=
"bold"
>
结束跟进
</div>
<div
style=
"width: 57px;"
>
<div
v-for=
"(x,y) in addMsg"
:key=
"y"
v-if=
"x.Type==2"
>
<ul
style=
"margin-left: 30px;margin-top: 10px;"
>
<li>
<q-input
clearable
filled
debounce
placeholder=
"名称"
v-model=
"x.Name"
style=
"width:500px"
disable
/>
</li>
<li
class=
"bold"
style=
"margin: 10px 0 30px;"
v-if=
"x.Name=='已输单'"
>
输单原因
</li>
<li
class=
"bold"
style=
"margin: 10px 0 30px;"
v-if=
"x.Name=='无效'"
>
无效原因
</li>
<draggable
v-model=
"x.OptionsList"
>
<li
v-for=
"(item,index) in x.OptionsList"
:key=
"index"
>
<div
style=
"width: 31px;"
>
<i
class=
"iconfont icon-weiyi"
style=
"font-size: 14px;color: #777;margin: 0 10px;"
></i>
</div>
<q-input
clearable
debounce
filled
maxlength=
"10"
counter
v-model=
"item.Name"
style=
"width:500px"
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
<q-btn
flat
size=
"sm"
icon=
"delete"
color=
"negative"
class=
"q-mr-xs"
style=
"margin-left: 10px;"
label=
""
@
click=
"addMsg[y].OptionsList.splice(index,1)"
/>
</li>
</draggable>
</ul>
<div
class=
"btn"
style=
"margin-left: 61px"
>
<q-btn
v-if=
"x.OptionsList.length
<30
"
color=
"accent"
class=
"q-mr-md"
label=
"添加"
icon=
'add'
@
click=
"addMsg[y].OptionsList.push(
{Id:0,Name:'',disable:false}),$forceUpdate()"
style="width: 100px;" />
<span
style=
"color:#858598"
>
已设/可设上限:
{{
x
.
OptionsList
.
length
}}
/30
</span>
</div>
</div>
</div>
<q-input
clearable
debounce
filled
v-model=
"item.Name"
style=
"width:500px"
disable
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
</li>
</div>
</div>
</ul>
</div>
<div
class=
"box"
>
<div
class=
"box"
>
<el-form
label-width=
"120px"
>
<div
class=
"bold"
>
结束跟进
</div>
<div
v-for=
"(x,y) in addMsg"
:key=
"y"
v-if=
"x.Type==2"
>
</el-form>
<ul
style=
"margin-left: 30px;margin-top: 10px;"
>
<q-card-actions
align=
"left"
class=
"bg-white"
>
<li>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"savemove()"
style=
"width: 100px;"
<q-input
clearable
filled
debounce
placeholder=
"名称"
v-model=
"x.Name"
style=
"width:500px"
disable
/>
:loading=
"loading"
/>
</li>
<q-btn
class=
"q-mr-md"
label=
"返回"
@
click=
"goblck()"
style=
"width: 60px;"
/>
<li
class=
"bold"
style=
"margin: 10px 0 30px;"
v-if=
"x.Name=='已输单'"
>
输单原因
</li>
</q-card-actions>
<li
class=
"bold"
style=
"margin: 10px 0 30px;"
v-if=
"x.Name=='无效'"
>
无效原因
</li>
<draggable
v-model=
"x.OptionsList"
>
<li
v-for=
"(item,index) in x.OptionsList"
:key=
"index"
>
<div
style=
"width: 31px;"
>
<i
class=
"iconfont icon-weiyi"
style=
"font-size: 14px;color: #777;margin: 0 10px;"
></i>
</div>
<q-input
clearable
debounce
filled
maxlength=
"10"
counter
v-model=
"item.Name"
style=
"width:500px"
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
<q-btn
flat
size=
"sm"
icon=
"delete"
color=
"negative"
class=
"q-mr-xs"
style=
"margin-left: 10px;"
label=
""
@
click=
"addMsg[y].OptionsList.splice(index,1)"
/>
</li>
</draggable>
</ul>
<div
class=
"btn"
style=
"margin-left: 61px"
>
<q-btn
v-if=
"x.OptionsList.length
<30
"
color=
"accent"
class=
"q-mr-md"
label=
"添加"
icon=
'add'
@
click=
"addMsg[y].OptionsList.push(
{Id:0,Name:'',disable:false}),$forceUpdate()" style="width: 100px;" />
<span
style=
"color:#858598"
>
已设/可设上限:
{{
x
.
OptionsList
.
length
}}
/30
</span>
</div>
</div>
</div>
</div>
<div
class=
"box"
>
<el-form
label-width=
"120px"
>
</el-form>
<q-card-actions
align=
"left"
class=
"bg-white"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"savemove()"
style=
"width: 100px;"
:loading=
"loading"
/>
<q-btn
class=
"q-mr-md"
label=
"返回"
@
click=
"goblck()"
style=
"width: 60px;"
/>
</q-card-actions>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
draggable
from
"vuedraggable"
import
draggable
from
"vuedraggable"
import
{
import
{
getCustomerStageList
,
getCustomerStageList
,
setCustomerStageInfo
setCustomerStageInfo
}
from
'../../../../api/system/wechat'
;
}
from
'../../../../api/system/wechat'
;
export
default
{
export
default
{
meta
:
{
meta
:
{
title
:
"阶段管理"
title
:
"阶段管理"
},
},
components
:
{
components
:
{
draggable
,
draggable
,
},
},
name
:
"stageManagement"
,
name
:
"stageManagement"
,
data
()
{
data
()
{
return
{
return
{
loading
:
false
,
loading
:
false
,
addMsg
:
[],
addMsg
:
[],
}
}
},
},
created
()
{
created
()
{
this
.
getList
()
this
.
getList
()
},
methods
:
{
getList
()
{
},
getCustomerStageList
({}).
then
(
res
=>
{
methods
:
{
this
.
loading
=
false
getList
()
{
if
(
res
.
Code
==
1
)
{
getCustomerStageList
({}).
then
(
res
=>
{
this
.
addMsg
=
res
.
Data
this
.
loading
=
false
let
num
=
0
if
(
res
.
Code
==
1
)
{
let
isexistence
=
false
this
.
addMsg
=
res
.
Data
let
orderEntered
=
false
//判读是否有已输单
let
num
=
0
let
invalid
=
false
//无效
let
isexistence
=
false
this
.
addMsg
.
forEach
(
x
=>
{
let
orderEntered
=
false
//判读是否有已输单
if
(
x
.
Type
==
1
)
{
let
invalid
=
false
//无效
num
++
this
.
addMsg
.
forEach
(
x
=>
{
if
(
x
.
OptionsList
&&
x
.
OptionsList
.
length
>
0
)
{
if
(
x
.
Type
==
1
)
{
for
(
let
j
=
0
;
j
<
x
.
OptionsList
.
length
;
j
++
)
{
num
++
let
z
=
x
.
OptionsList
[
j
]
if
(
x
.
OptionsList
&&
x
.
OptionsList
.
length
>
0
)
{
if
(
z
.
Name
==
'成交'
)
{
//判断是否有默认值
for
(
let
j
=
0
;
j
<
x
.
OptionsList
.
length
;
j
++
)
{
isexistence
=
true
let
z
=
x
.
OptionsList
[
j
]
break
if
(
z
.
Name
==
'成交'
){
//判断是否有默认值
isexistence
=
true
break
}
}
}
}
if
(
x
.
Type
==
2
){
if
(
x
.
Name
==
'已输单'
){
orderEntered
=
true
}
if
(
x
.
Name
==
'无效'
){
invalid
=
true
}
}
})
if
(
num
==
0
){
//判断没有type==1的时候加2条数据
let
obj
=
[
{
Id
:
0
,
IsDefault
:
0
,
Name
:
'跟进阶段'
,
OptionsList
:[],
Sort
:
0
,
Type
:
1
},
{
Id
:
0
,
IsDefault
:
1
,
Name
:
'跟进阶段'
,
OptionsList
:[{
Id
:
0
,
Name
:
'成交'
},{
Id
:
0
,
Name
:
'多次成交'
},],
Sort
:
0
,
Type
:
1
},
]
this
.
addMsg
=
this
.
addMsg
.
concat
(
obj
)
}
if
(
num
>
0
&&
isexistence
==
false
){
//判断type==1有 但是没有默认值
let
obj
=
{
Id
:
0
,
IsDefault
:
1
,
Name
:
'跟进阶段'
,
OptionsList
:[{
Id
:
0
,
Name
:
'成交'
},{
Id
:
0
,
Name
:
'多次成交'
},],
Sort
:
0
,
Type
:
1
};
this
.
addMsg
.
unshift
(
obj
)
}
if
(
orderEntered
==
false
){
//没有的话 加一个已输单
let
obj
=
{
Id
:
0
,
IsDefault
:
0
,
Name
:
'已输单'
,
OptionsList
:[],
Sort
:
0
,
Type
:
2
};
this
.
addMsg
.
push
(
obj
)
}
if
(
invalid
==
false
){
//没有的话 加一个无效
let
obj
=
{
Id
:
0
,
IsDefault
:
0
,
Name
:
'无效'
,
OptionsList
:[],
Sort
:
0
,
Type
:
2
};
this
.
addMsg
.
push
(
obj
)
}
}
}
})
}
},
goblck
()
{
//返回上一个页面
this
.
$router
.
go
(
-
1
);
//返回上一层
},
savemove
()
{
console
.
log
(
this
.
addMsg
)
let
show
=
false
for
(
let
i
=
0
;
i
<
this
.
addMsg
.
length
;
i
++
)
{
let
x
=
this
.
addMsg
[
i
]
if
(
show
==
true
)
{
break
}
for
(
let
j
=
0
;
j
<
x
.
OptionsList
.
length
;
j
++
)
{
let
z
=
x
.
OptionsList
[
j
]
if
(
z
.
Name
==
''
)
{
let
message
=
''
if
(
x
.
Type
==
1
)
{
message
=
'请填写跟进阶段列表选项值'
}
else
{
message
=
'请填写结束跟进列表选项值'
}
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
message
,
position
:
'top'
})
show
=
true
break
}
}
}
}
this
.
loading
=
true
}
setCustomerStageInfo
(
this
.
addMsg
).
then
(
res
=>
{
if
(
x
.
Type
==
2
)
{
this
.
loading
=
false
if
(
x
.
Name
==
'已输单'
)
{
this
.
$q
.
notify
({
orderEntered
=
true
icon
:
'iconfont icon-chenggong'
,
}
color
:
'accent'
,
if
(
x
.
Name
==
'无效'
)
{
timeout
:
2000
,
invalid
=
true
message
:
res
.
Message
,
}
position
:
'top'
}
})
})
this
.
goblck
()
if
(
num
==
0
)
{
//判断没有type==1的时候加2条数据
let
obj
=
[{
}).
catch
((
e
)
=>
{
Id
:
0
,
this
.
loading
=
false
IsDefault
:
0
,
})
Name
:
'跟进阶段'
,
OptionsList
:
[],
},
Sort
:
0
,
Type
:
1
},
{
Id
:
0
,
IsDefault
:
1
,
Name
:
'跟进阶段'
,
OptionsList
:
[{
Id
:
0
,
Name
:
'成交'
},
{
Id
:
0
,
Name
:
'多次成交'
},
],
Sort
:
0
,
Type
:
1
},
]
this
.
addMsg
=
this
.
addMsg
.
concat
(
obj
)
}
if
(
num
>
0
&&
isexistence
==
false
)
{
//判断type==1有 但是没有默认值
let
obj
=
{
Id
:
0
,
IsDefault
:
1
,
Name
:
'跟进阶段'
,
OptionsList
:
[{
Id
:
0
,
Name
:
'成交'
},
{
Id
:
0
,
Name
:
'多次成交'
},
],
Sort
:
0
,
Type
:
1
};
this
.
addMsg
.
unshift
(
obj
)
}
if
(
orderEntered
==
false
)
{
//没有的话 加一个已输单
let
obj
=
{
Id
:
0
,
IsDefault
:
0
,
Name
:
'已输单'
,
OptionsList
:
[],
Sort
:
0
,
Type
:
2
};
this
.
addMsg
.
push
(
obj
)
}
if
(
invalid
==
false
)
{
//没有的话 加一个无效
let
obj
=
{
Id
:
0
,
IsDefault
:
0
,
Name
:
'无效'
,
OptionsList
:
[],
Sort
:
0
,
Type
:
2
};
this
.
addMsg
.
push
(
obj
)
}
}
})
},
goblck
()
{
//返回上一个页面
this
.
$router
.
go
(
-
1
);
//返回上一层
},
savemove
()
{
let
show
=
false
for
(
let
i
=
0
;
i
<
this
.
addMsg
.
length
;
i
++
)
{
let
x
=
this
.
addMsg
[
i
]
if
(
show
==
true
)
{
break
}
for
(
let
j
=
0
;
j
<
x
.
OptionsList
.
length
;
j
++
)
{
let
z
=
x
.
OptionsList
[
j
]
if
(
z
.
Name
==
''
)
{
let
message
=
''
if
(
x
.
Type
==
1
)
{
message
=
'请填写跟进阶段列表选项值'
}
else
{
message
=
'请填写结束跟进列表选项值'
}
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
message
,
position
:
'top'
})
show
=
true
break
}
}
}
}
this
.
loading
=
true
setCustomerStageInfo
(
this
.
addMsg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
res
.
Message
,
position
:
'top'
})
this
.
goblck
()
}).
catch
((
e
)
=>
{
this
.
loading
=
false
})
},
}
}
}
</
script
>
</
script
>
\ No newline at end of file
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