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
>
@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
>
<
template
>
<div
class=
"addPhase"
style=
"background: transparent;"
>
<div
class=
"box"
>
<div
class=
"bold"
>
名称
</div>
<q-input
clearable
debounce
filled
maxlength=
"20"
counter
v-model=
"addMsg.FlowName"
style=
"width:600px"
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
</div>
<div
class=
"box"
>
<div
class=
"bold"
>
阶段适用范围
</div>
<q-btn
class=
"q-mr-md"
label=
"选择部门/成员"
@
click=
"outerVisible = true"
/>
</div>
<div
class=
"box"
>
<div
class=
"bold"
>
选择使用阶段
</div>
<div
style=
"display:flex;align-items: center;"
>
</div>
</div>
<div
v-if=
"StageList"
>
<div
class=
"box"
v-for=
"(x,y) in StageList"
v-if=
"x.Type==2"
>
<div
class=
"bold"
v-if=
"x.Name=='已输单'"
>
选择输单原因
</div>
<div
class=
"bold"
v-if=
"x.Name=='无效'"
>
选择无效原因
</div>
<div
style=
"display:flex;align-items: center;flex-wrap: wrap;"
>
<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
class=
"addPhase"
style=
"background: transparent;"
>
<div
class=
"box"
>
<div
class=
"bold"
>
名称
</div>
<q-input
clearable
debounce
filled
maxlength=
"20"
counter
v-model=
"addMsg.FlowName"
style=
"width:600px"
@
input=
"$forceUpdate()"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
</div>
<div
class=
"box"
>
<div
class=
"bold"
>
阶段适用范围
</div>
<q-btn
class=
"q-mr-md"
label=
"选择部门/成员"
@
click=
"outerVisible = true"
/>
</div>
<div
class=
"box"
>
<div
class=
"bold"
>
选择使用阶段
</div>
<div
style=
"display:flex;align-items: center;"
>
</div>
</div>
<div
v-if=
"StageList"
>
<div
class=
"box"
v-for=
"(x,y) in StageList"
v-if=
"x.Type==2"
>
<div
class=
"bold"
v-if=
"x.Name=='已输单'"
>
选择输单原因
</div>
<div
class=
"bold"
v-if=
"x.Name=='无效'"
>
选择无效原因
</div>
<div
style=
"display:flex;align-items: center;flex-wrap: wrap;"
>
<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>
<!-- 人员/部门选择 -->
<choiceapprovalorbranch
v-if=
"outerVisible"
@
close=
"outerVisible = false"
@
success=
"getsuccess2"
:byval=
'showMember'
cptype=
"1"
></choiceapprovalorbranch>
</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>
<!-- 人员/部门选择 -->
<choiceapprovalorbranch
v-if=
"outerVisible"
@
close=
"outerVisible = false"
@
success=
"getsuccess2"
:byval=
'showMember'
cptype=
"1"
></choiceapprovalorbranch>
</div>
</
template
>
<
script
>
import
choiceapprovalorbranch
from
'./components/choiceapprovalorbranch'
import
{
getCustomerStageList
,
}
from
'../../../../api/system/wechat'
;
export
default
{
meta
:
{
title
:
"阶段管理"
},
components
:
{
choiceapprovalorbranch
},
name
:
"addPhase"
,
data
()
{
return
{
loading
:
false
,
outerVisible
:
false
,
addMsg
:{
FlowName
:
''
,
DeptEmpList
:[],
UseStage
:
''
,
LoseCause
:[],
InvalidCause
:[],
},
showMember
:[],
StageList
:[],
}
},
created
()
{
this
.
getCustomerStageList
()
import
choiceapprovalorbranch
from
'./components/choiceapprovalorbranch'
import
{
getCustomerStageList
,
}
from
'../../../../api/system/wechat'
;
export
default
{
meta
:
{
title
:
"阶段管理"
},
components
:
{
choiceapprovalorbranch
},
name
:
"addPhase"
,
data
()
{
return
{
loading
:
false
,
outerVisible
:
false
,
addMsg
:
{
FlowName
:
''
,
DeptEmpList
:
[],
UseStage
:
''
,
LoseCause
:
[],
InvalidCause
:
[],
},
methods
:
{
goblck
()
{
//返回上一个页面
this
.
$router
.
go
(
-
1
);
//返回上一层
},
savemove
(){
},
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
},
}
showMember
:
[],
StageList
:
[],
}
},
created
()
{
this
.
getCustomerStageList
()
},
methods
:
{
goblck
()
{
//返回上一个页面
this
.
$router
.
go
(
-
1
);
//返回上一层
},
savemove
()
{},
getCustomerStageList
()
{
getCustomerStageList
({}).
then
(
res
=>
{
this
.
loading
=
false
if
(
res
.
Code
==
1
)
{
this
.
StageList
=
res
.
Data
}
})
},
getsuccess2
(
list
,
type
)
{
this
.
showMember
=
list
this
.
outerVisible
=
false
},
}
}
</
script
>
\ No newline at end of file
src/pages/enterprise/customer/CSChild/components/addfield.vue
View file @
4574f91a
<
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
>
<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'
>
<div
class=
"q-gutter-sm"
>
<q-checkbox
v-model=
"addMsg.InputType"
v-for=
"(x,y) in checkboxList"
:key=
'y'
:val=
"x.Id"
: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>
<div
class=
"q-gutter-sm"
>
<q-checkbox
v-model=
"addMsg.InputType"
v-for=
"(x,y) in checkboxList"
:key=
'y'
:val=
"x.Id"
: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>
<
script
>
import
draggable
from
"vuedraggable"
import
selectTree
from
'../../../../../components/common/select-tree'
import
{
setCustomerFiledInfo
}
from
'../../../../../api/system/wechat'
const
defaultObj
=
{
Id
:
0
,
Type
:
1
,
Name
:
''
,
Required
:
2
,
DeptId
:
0
,
WordNum
:
1
,
InputType
:[],
OptionsList
:[{
Id
:
1
,
Name
:
''
}],
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
:
[],
//默认岗位
import
draggable
from
"vuedraggable"
import
selectTree
from
'../../../../../components/common/select-tree'
import
{
setCustomerFiledInfo
}
from
'../../../../../api/system/wechat'
const
defaultObj
=
{
Id
:
0
,
Type
:
1
,
Name
:
''
,
Required
:
2
,
DeptId
:
0
,
WordNum
:
1
,
InputType
:
[],
OptionsList
:
[{
Id
:
1
,
Name
:
''
}],
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
:
[],
//默认岗位
}
},
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
}
},
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
}
}
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
)
{
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
(
','
)
}
},
getdefault
(){
//新增的时候初始默认值
this
.
addMsg
=
Object
.
assign
({},
defaultObj
)
this
.
addMsg
.
OptionsList
=
[{
Id
:
0
,
Name
:
''
,}]
//多选和单选的值
}
}
else
{
addMsg
.
InputType
=
'1'
}
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
>
<
style
>
</
style
>
\ No newline at end of file
</
style
>
src/pages/enterprise/customer/CSChild/components/choiceapprovalorbranch.vue
View file @
4574f91a
<
style
>
.choiceappoval
.ApprovalProcessBg
{
background
:
#f8f8f8
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.choiceappoval
.Approval_yxList
{
width
:
300px
;
background
:
#f8f8f8
;
min-height
:
400px
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.choiceappoval
.ApprovalProcessBg
{
background
:
#f8f8f8
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.choiceappoval
.Approval_yxList
{
width
:
300px
;
background
:
#f8f8f8
;
min-height
:
400px
;
max-height
:
400px
;
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
>
<
template
>
<div>
<q-dialog
v-model=
"IsShow"
persistent
>
<q-card
style=
"width: 700px; max-width: 80vw;"
class=
"choiceappoval"
>
<q-card-section
class=
"row items-center q-pb-none "
>
<div
class=
"text-h6"
>
选择企业成员
</div>
<q-space
/>
<q-btn
icon=
"close"
flat
round
dense
v-close-popup
/>
</q-card-section>
<q-separator
/>
<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=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;display: flex;align-items: center;"
>
选择:
<el-input
style=
"width: 200px;"
placeholder=
"输入关键字进行过滤"
v-model=
"filterText"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode"
:data=
"memberList"
show-checkbox
ref=
"treeUser"
:props=
"defaultProps"
:render-after-expand=
"false"
node-key=
"DeptId"
@
check-change=
"handleNodeChange"
@
check=
'btncheck'
>
</el-tree>
</div>
<div
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showMember"
>
{{
item
.
DeptName
}}
<i
@
click=
"mySetCheckedKeys(item.DeptId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
</div>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"closeEditOrder"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"确定"
@
click=
"saveOrderInfo()"
/>
</q-card-actions>
</q-card>
</q-dialog>
</div>
<div>
<q-dialog
v-model=
"IsShow"
persistent
>
<q-card
style=
"width: 700px; max-width: 80vw;"
class=
"choiceappoval"
>
<q-card-section
class=
"row items-center q-pb-none "
>
<div
class=
"text-h6"
>
选择企业成员
</div>
<q-space
/>
<q-btn
icon=
"close"
flat
round
dense
v-close-popup
/>
</q-card-section>
<q-separator
/>
<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=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;display: flex;align-items: center;"
>
选择:
<el-input
style=
"width: 200px;"
placeholder=
"输入关键字进行过滤"
v-model=
"filterText"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode"
:data=
"memberList"
show-checkbox
ref=
"treeUser"
:props=
"defaultProps"
:render-after-expand=
"false"
node-key=
"DeptId"
@
check-change=
"handleNodeChange"
@
check=
'btncheck'
>
</el-tree>
</div>
<div
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showMember"
>
{{
item
.
DeptName
}}
<i
@
click=
"mySetCheckedKeys(item.DeptId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
</div>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
class=
"q-mr-md"
label=
"取消"
@
click=
"closeEditOrder"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"确定"
@
click=
"saveOrderInfo()"
/>
</q-card-actions>
</q-card>
</q-dialog>
</div>
</
template
>
<
script
>
import
{
getEmployeeAddrBook
}
from
'../../../../../api/users/user'
export
default
{
props
:
{
outerindex
:
{
type
:
String
,
default
:
''
,
},
byval
:{
type
:
Array
,
default
:
[],
},
cptype
:{
//1是列表上使用2 新增使用
type
:
String
,
default
:
'1'
,
}
import
{
getEmployeeAddrBook
}
from
'../../../../../api/users/user'
export
default
{
props
:
{
outerindex
:
{
type
:
String
,
default
:
''
,
},
byval
:
{
type
:
Array
,
default
:
[],
},
cptype
:
{
//1是列表上使用2 新增使用
type
:
String
,
default
:
'1'
,
}
},
data
()
{
return
{
IsShow
:
true
,
memberList
:
[],
filterText
:
""
,
defaultProps
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
},
data
()
{
return
{
IsShow
:
true
,
memberList
:
[],
filterText
:
""
,
defaultProps
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
},
userList
:
[],
showMember
:
[],
memberSetCheckedKeys
:
[],
sysUserKeys
:
[],
newList
:[]
userList
:
[],
showMember
:
[],
memberSetCheckedKeys
:
[],
sysUserKeys
:
[],
newList
:
[]
}
},
created
()
{
if
(
this
.
byval
.
length
>
0
)
{
this
.
memberSetCheckedKeys
=
[];
this
.
showMember
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
byval
))
this
.
byval
.
forEach
(
x
=>
{
this
.
memberSetCheckedKeys
.
push
(
x
.
DeptId
)
})
}
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
(
this
.
byval
.
length
>
0
){
this
.
memberSetCheckedKeys
=
[];
this
.
showMember
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
byval
))
this
.
byval
.
forEach
(
x
=>
{
this
.
memberSetCheckedKeys
.
push
(
x
.
DeptId
)
})
})
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
)
}
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
(()
=>
{
}
}
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
()
{
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
){
},
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
)
}
},
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
)
}
}
}
</
script
>
\ No newline at end of file
</
script
>
src/pages/enterprise/customer/CSChild/stageManagement.vue
View file @
4574f91a
<
style
>
@import
"../../../financial/css/cssReset.css"
;
@import
"../../../financial/css/cssReset.css"
;
.stageManagement
{
padding
:
20px
;
}
.stageManagement
{
padding
:
20px
;
}
.stageManagement
.box
{
width
:
100%
;
.stageManagement
.box
{
width
:
100%
;
border-radius
:
6px
;
background
:
#fff
;
padding
:
20px
;
margin-bottom
:
25px
;
}
border-radius
:
6px
;
background
:
#fff
;
padding
:
20
px
;
margin-bottom
:
25px
;
}
.stageManagement
.bold
{
font-weight
:
700
;
font-size
:
14
px
;
color
:
#333
;
}
.stageManagement
.bold
{
font-weight
:
700
;
font-size
:
14px
;
color
:
#333
;
}
.stageManagement
ul
li
{
display
:
flex
;
align-items
:
center
;
}
.stageManagement
ul
li
{
display
:
flex
;
align-items
:
center
;
}
.stageManagement
.btn
{
display
:
flex
;
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
>
<
template
>
<div
class=
"stageManagement"
style=
"background: transparent;"
>
<div
class=
"box"
>
<div
class=
"bold"
style=
"margin-bottom: 30px;"
>
跟进阶段
</div>
<ul
v-for=
"(x,y) in addMsg"
:key=
"y"
v-if=
"x.Type==1"
>
<div
v-if=
"x.IsDefault==0"
>
<draggable
v-model=
"x.OptionsList"
>
<li
v-for=
"(item,index) in x.OptionsList"
:key=
"index"
>
<div
style=
"width: 57px;"
>
<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>
<div
class=
"btn"
>
<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
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
class=
"stageManagement"
style=
"background: transparent;"
>
<div
class=
"box"
>
<div
class=
"bold"
style=
"margin-bottom: 30px;"
>
跟进阶段
</div>
<ul
v-for=
"(x,y) in addMsg"
:key=
"y"
v-if=
"x.Type==1"
>
<div
v-if=
"x.IsDefault==0"
>
<draggable
v-model=
"x.OptionsList"
>
<li
v-for=
"(item,index) in x.OptionsList"
:key=
"index"
>
<div
style=
"width: 57px;"
>
<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>
<div
class=
"btn"
>
<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
class=
"box"
>
<div
class=
"bold"
>
结束跟进
</div>
<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
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>
<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>
</ul>
</div>
<div
class=
"box"
>
<div
class=
"bold"
>
结束跟进
</div>
<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>
<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>
</
template
>
<
script
>
import
draggable
from
"vuedraggable"
import
{
getCustomerStageList
,
setCustomerStageInfo
}
from
'../../../../api/system/wechat'
;
export
default
{
meta
:
{
title
:
"阶段管理"
},
components
:
{
draggable
,
},
name
:
"stageManagement"
,
data
()
{
return
{
loading
:
false
,
addMsg
:
[],
}
},
created
()
{
this
.
getList
()
},
methods
:
{
getList
()
{
getCustomerStageList
({}).
then
(
res
=>
{
this
.
loading
=
false
if
(
res
.
Code
==
1
)
{
this
.
addMsg
=
res
.
Data
let
num
=
0
let
isexistence
=
false
let
orderEntered
=
false
//判读是否有已输单
let
invalid
=
false
//无效
this
.
addMsg
.
forEach
(
x
=>
{
if
(
x
.
Type
==
1
)
{
num
++
if
(
x
.
OptionsList
&&
x
.
OptionsList
.
length
>
0
)
{
for
(
let
j
=
0
;
j
<
x
.
OptionsList
.
length
;
j
++
)
{
let
z
=
x
.
OptionsList
[
j
]
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
)
}
import
draggable
from
"vuedraggable"
import
{
getCustomerStageList
,
setCustomerStageInfo
}
from
'../../../../api/system/wechat'
;
export
default
{
meta
:
{
title
:
"阶段管理"
},
components
:
{
draggable
,
},
name
:
"stageManagement"
,
data
()
{
return
{
loading
:
false
,
addMsg
:
[],
}
},
created
()
{
this
.
getList
()
},
methods
:
{
getList
()
{
getCustomerStageList
({}).
then
(
res
=>
{
this
.
loading
=
false
if
(
res
.
Code
==
1
)
{
this
.
addMsg
=
res
.
Data
let
num
=
0
let
isexistence
=
false
let
orderEntered
=
false
//判读是否有已输单
let
invalid
=
false
//无效
this
.
addMsg
.
forEach
(
x
=>
{
if
(
x
.
Type
==
1
)
{
num
++
if
(
x
.
OptionsList
&&
x
.
OptionsList
.
length
>
0
)
{
for
(
let
j
=
0
;
j
<
x
.
OptionsList
.
length
;
j
++
)
{
let
z
=
x
.
OptionsList
[
j
]
if
(
z
.
Name
==
'成交'
)
{
//判断是否有默认值
isexistence
=
true
break
}
})
},
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
=>
{
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
})
},
}
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
()
{
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
>
\ 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