Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
horse
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向伟
horse
Commits
98c19049
Commit
98c19049
authored
Nov 19, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b3a117d9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
845 additions
and
127 deletions
+845
-127
customer.ts
src/api/customer.ts
+115
-112
addfield.vue
src/components/customer/addfield.vue
+2
-8
customerPhase.vue
src/pages/customer/components/customerPhase.vue
+17
-7
createStageRange.vue
src/pages/editor/createStageRange.vue
+320
-0
manageStageRange.vue
src/pages/editor/manageStageRange.vue
+379
-0
routes.ts
src/router/routes.ts
+12
-0
No files found.
src/api/customer.ts
View file @
98c19049
...
...
@@ -2,30 +2,28 @@
* 所有跟用户相关的接口(TODO:DEMO USER)
*/
import
{
HttpResponse
}
from
'@/@types'
import
Axios
from
'./axios'
/**
import
{
HttpResponse
}
from
'@/@types'
import
Axios
from
'./axios'
/**
* @interface loginParams -登录参数
* @property {string} grant_type -授权类型
* @property {string} email -邮箱
* @property {string} password -用户密码
*/
interface
msg
{
interface
msg
{
Enable
:
number
}
interface
IdName
{
Id
:
number
,
Name
:
string
}
}
interface
IdName
{
Id
:
number
Name
:
string
}
/**
/**
* @example Axios.get(`https://xxx.com}`)
* @todo Get the exchange rate of the current currency
*/
class
customerService
{
class
customerService
{
// 获取客户字段列表
static
async
getCustomerFiledList
(
data
:
msg
):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/GetCustomerFiledList'
,
{
...
...
@@ -99,19 +97,7 @@
})
}
//新增修改客户字段
static
async
setCustomerFiledInfo
(
data
:
{
Id
:
number
,
Type
:
number
,
Name
:
string
,
Required
:
number
,
DeptId
:
number
,
WordNum
:
number
,
InputType
:
string
,
OptionsList
:
Array
<
IdName
>
,
Digits
:
number
,
Enable
:
number
,
[
propName
:
string
]:
any
}):
Promise
<
HttpResponse
>
{
static
async
setCustomerFiledInfo
(
data
:
{
Id
:
number
;
Type
:
number
;
Name
:
string
;
Required
:
number
;
DeptId
:
number
;
WordNum
:
number
;
InputType
:
string
;
OptionsList
:
Array
<
IdName
>
;
Digits
:
number
;
Enable
:
number
;
[
propName
:
string
]:
any
}):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/SetCustomerFiledInfo'
,
{
method
:
'post'
,
responseType
:
'json'
,
...
...
@@ -127,20 +113,37 @@
})
}
//设置客户阶段流程状态
static
async
setCustomerStageFlowState
(
data
:
{
Type
:
number
,
FlowId
:
number
}):
Promise
<
HttpResponse
>
{
static
async
setCustomerStageFlowState
(
data
:
{
Type
:
number
;
FlowId
:
number
}):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/SetCustomerStageFlowState'
,
{
method
:
'post'
,
responseType
:
'json'
,
data
})
}
//验证该阶段是否可以删除
static
async
validataCustomerStageDel
(
data
:
{
StageId
:
number
}):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/ValidataCustomerStageDel'
,
{
method
:
'post'
,
responseType
:
'json'
,
data
})
}
// 验证阶段输单/无效的 原因选项是否可以删除
static
async
validataCustomerCauseDel
(
data
:
{
CauseId
:
number
;
Type
:
number
}):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/ValidataCustomerCauseDel'
,
{
method
:
'post'
,
responseType
:
'json'
,
data
})
}
// 验证阶段输单/无效的 原因选项是否可以删除
static
async
setCustomerStageInfo
(
data
:
{
Id
:
number
;
Type
:
number
,
Name
:
string
,
Sort
:
number
,
OptionsList
:
Array
<
IdName
>
,
IsDefault
:
number
}):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/SetCustomerStageInfo'
,
{
method
:
'post'
,
responseType
:
'json'
,
data
})
}
}
export
default
customerService
\ No newline at end of file
export
default
customerService
src/components/customer/addfield.vue
View file @
98c19049
...
...
@@ -129,8 +129,6 @@
import
{
useQuasar
}
from
'quasar'
import
customerService
from
'@/api/customer'
// import { customerFieldtabsType } from '@/@types/customer'
export
default
defineComponent
({
components
:
{
draggable
,
selectTree
},
props
:
{
...
...
@@ -158,10 +156,8 @@
let
departmentType
=
ref
(
'1'
)
let
tab
=
ref
(
1
)
let
loading
=
ref
(
false
)
let
tabsList
=
ref
<
Array
<
any
>>
([])
tabsList
.
value
=
props
.
passtabsList
let
checkboxList
=
ref
<
Array
<
any
>>
([])
checkboxList
.
value
=
props
.
passcheckboxList
let
tabsList
=
ref
<
Array
<
any
>>
(
props
.
passtabsList
)
let
checkboxList
=
ref
<
Array
<
any
>>
(
props
.
passcheckboxList
)
let
decimalslist
=
ref
([{
Id
:
0
},
{
Id
:
1
},
{
Id
:
2
},
{
Id
:
3
},
{
Id
:
4
},
{
Id
:
5
},
{
Id
:
6
},
{
Id
:
7
},
{
Id
:
8
},
{
Id
:
9
},
{
Id
:
10
},
{
Id
:
11
},])
let
returnString
=
ref
<
Array
<
any
>>
([])
if
(
addMsg
.
value
.
Id
>
0
)
{
...
...
@@ -260,7 +256,6 @@
ctx
.
emit
(
'getcancel'
,
2
)
}
else
{
//如果移动失败 重新获取列表
loading
.
value
=
false
}
})
}
...
...
@@ -288,7 +283,6 @@
Enable
:
1
,
};
}
return
{
getcancel
,
//关闭弹窗
savewb
,
//保存数据
...
...
src/pages/customer/components/customerPhase.vue
View file @
98c19049
...
...
@@ -2,11 +2,11 @@
<div
class=
"customerPhase page-body"
>
<div
style=
"display: flex;align-items: center;justify-content: space-between;"
>
<div
style=
"display: flex;align-items: center;"
>
<q-btn
v-if=
"state.data.length
<20
"
color=
"accent"
style=
"margin-bottom: 10px;"
class=
"q-mr-md"
label=
"创建阶段流程"
@
click=
"
goestablish(
)"
size=
"sm"
></q-btn>
<q-btn
v-if=
"state.data.length
<20
"
color=
"accent"
style=
"margin-bottom: 10px;"
class=
"q-mr-md"
label=
"创建阶段流程"
@
click=
"
jumpPage('/editor/createStageRange'
)"
size=
"sm"
></q-btn>
<span
style=
"margin-left: 20px;color: rgb(133, 133, 152);"
>
已添加:
{{
state
.
data
.
length
}}
/20
</span>
</div>
<q-btn
color=
"white"
text-color=
"black"
style=
"margin-bottom: 10px;"
class=
"q-mr-md"
label=
"阶段管理"
size=
"sm"
@
click=
"
stageManagement(
)"
></q-btn>
@
click=
"
jumpPage('/editor/manageStageRange'
)"
></q-btn>
</div>
<table
class=
"payTable"
>
<thead>
...
...
@@ -25,7 +25,7 @@
<tr
v-for=
"(item,index) in state.data"
:key=
"index"
>
<td><span>
{{
item
.
FlowName
}}
</span></td>
<td>
<span
v-if=
'item.DeptEmpList && item.DeptEmpList.length>0'
v-for=
"(x,y) in item.DeptEmpList"
:key=
'y'
>
<
!--
<
span
v-if=
'item.DeptEmpList && item.DeptEmpList.length>0'
v-for=
"(x,y) in item.DeptEmpList"
:key=
'y'
>
<q-chip
color=
"blue-1"
text-color=
"blue"
icon=
"folder"
size=
"sm"
v-if=
"x.Type==1"
>
{{
x
.
Name
}}
</q-chip>
...
...
@@ -33,7 +33,7 @@
{{
x
.
Name
}}
</q-chip>
</span>
<span
v-else
>
未适配其他规则的阶段
</span>
<span
v-else
>
未适配其他规则的阶段
</span>
-->
</td>
<td>
...
...
@@ -63,9 +63,10 @@
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
onMounted
,
reactive
}
from
'vue'
import
{
defineComponent
,
onMounted
,
reactive
}
from
'vue'
import
customerService
from
'@/api/customer'
import
{
useQuasar
}
from
'quasar'
import
router
from
'@/router/index'
export
default
defineComponent
({
setup
(){
...
...
@@ -119,6 +120,14 @@
}
})
}
const
jumpPage
=
(
url
:
string
)
=>
{
router
.
push
({
path
:
url
,
query
:{
}
})
}
onMounted
(()
=>
{
getList
()
})
...
...
@@ -126,7 +135,8 @@
getList
,
state
,
setFiledState
,
godelete
godelete
,
jumpPage
}
}
})
...
...
src/pages/editor/createStageRange.vue
0 → 100644
View file @
98c19049
<
template
>
<div
class=
"page addPhase"
>
<div
class=
"q-pa-md q-gutter-sm navbar"
>
<q-breadcrumbs>
<q-breadcrumbs-el
label=
"返回"
icon=
"navigate_before"
@
click=
"jumpBeforePage"
/>
<q-breadcrumbs-el
label=
"创建阶段"
/>
</q-breadcrumbs>
<q-btn
color=
"primary"
label=
"完成"
@
click=
"savemove"
:loading=
"state.loading"
/>
</div>
<div
class=
"container"
>
<div
class=
"content-block"
>
<div
class=
"bold"
>
名称
</div>
<q-input
clearable
debounce
filled
maxlength=
"20"
counter
v-model=
"state.addMsg.FlowName"
style=
"width:600px"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
</div>
<div
class=
"content-block"
>
<div
class=
"bold"
>
阶段适用范围
</div>
<!--
<q-input
clearable
debounce
filled
maxlength=
"20"
counter
v-model=
"state.addMsg.FlowName"
style=
"width:600px"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
-->
</div>
<div
class=
"content-block"
>
<div
class=
"bold"
>
选择使用阶段
<span
style=
"font-size: 14px;font-weight: 300;color:rgb(133, 133, 152);"
>
若没有找到可选项,请前往
<span
style=
"color:#3470ff;cursor: pointer;"
@
click=
"stageManagement"
>
"阶段管理"
</span>
进行
</span>
</div>
<div
style=
"display:flex;align-items: center;"
>
<div
class=
"all-stage"
:style=
"
{height:state.getheight+'px'}">
<p
class=
"select-item-title"
>
全部阶段
</p>
<div
class=
""
v-for=
"(x,y) in state.StageList"
:key=
'y'
>
<q-checkbox
v-model=
"state.addMsg.UseStage"
:val=
"x.Id"
:label=
"x.Name"
:disable=
"x.IsDefault==0?false:true"
v-if=
"x.Type==1"
@
update:model-value=
"getusestageName"
/>
</div>
</div>
<div
class=
"right-arrow"
><i
class=
"el-icon-arrow-right"
></i></div>
<div
class=
"all-stage"
:style=
"
{height:state.getheight+'px'}">
<p
class=
"select-item-title"
>
已选阶段
</p>
<div
v-for=
"(x,y) in state.UseStageName"
:key=
'y'
>
<div
style=
"height:40px;line-height: 40px;"
v-if=
"x.IsDefault==0"
>
<span>
{{
x
.
Name
}}
</span>
</div>
</div>
<div
style=
"height:40px;line-height: 40px;"
v-for=
"(x,y) in state.UseStageName"
:key=
'y'
>
<span
v-if=
"x.IsDefault==1"
style=
"color: #ccc;"
>
{{
x
.
Name
}}
</span>
</div>
</div>
</div>
</div>
<div
v-if=
"state.StageList"
>
<div
v-for=
"(x,y) in state.StageList"
:key=
"y"
>
<div
class=
"content-block"
v-if=
"x.Type==2"
>
<div
class=
"bold"
v-if=
"x.Name=='已输单'"
>
选择输单原因
<span
style=
"font-size: 14px;font-weight: 300;color:rgb(133, 133, 152);"
>
若没有找到可选项,请前往
<span
style=
"color:#3470ff;cursor: pointer;"
@
click=
"stageManagement"
>
"阶段管理"
</span>
进行
</span>
</div>
<div
class=
"bold"
v-if=
"x.Name=='无效'"
>
选择无效原因
<span
style=
"font-size: 14px;font-weight: 300;color:rgb(133, 133, 152);"
>
若没有找到可选项,请前往
<span
style=
"color:#3470ff;cursor: pointer;"
@
click=
"stageManagement"
>
"阶段管理"
</span>
进行
</span>
</div>
<div
style=
"display:flex;align-items: center;flex-wrap: wrap;"
>
<div
v-if=
'x.Name=="已输单"'
>
<q-checkbox
v-model=
"state.addMsg.LoseCause"
v-for=
"(item,index) in x.OptionsList"
:key=
'index'
:val=
"item.Id"
:label=
"item.Name"
/>
</div>
<div
v-if=
'x.Name=="无效"'
>
<q-checkbox
v-model=
"state.addMsg.InvalidCause"
v-for=
"(item,index) in x.OptionsList"
:key=
'index'
:val=
"item.Id"
:label=
"item.Name"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
onMounted
,
reactive
,
}
from
'vue'
import
router
from
'@/router/index'
import
customerService
from
'@/api/customer'
import
{
useQuasar
}
from
'quasar'
export
default
defineComponent
({
setup
()
{
const
$q
=
useQuasar
()
const
state
:
any
=
reactive
({
addMsg
:
{
Id
:
0
,
FlowName
:
''
,
DeptEmpList
:
[],
UseStage
:
[],
LoseCause
:
[],
InvalidCause
:
[],
},
StageList
:
[],
gettypeoneList
:
[],
getheight
:
270
,
loading
:
false
,
UseStageName
:
[],
})
const
jumpBeforePage
=
()
=>
{
router
.
go
(
-
1
)
}
const
getList
=
()
=>
{
customerService
.
getCustomerStageList
({}).
then
((
res
)
=>
{
if
(
res
.
data
.
Code
==
1
)
{
state
.
StageList
=
res
.
data
.
Data
;
state
.
gettypeoneList
=
[]
state
.
StageList
.
forEach
(
x
=>
{
if
(
x
.
Type
==
1
)
{
if
(
x
.
IsDefault
==
1
)
{
state
.
addMsg
.
UseStage
.
push
(
x
.
Id
)
}
state
.
gettypeoneList
.
push
(
x
)
}
})
if
(
state
.
gettypeoneList
.
length
>
5
)
{
//阶段数量大于5个的时候
state
.
getheight
=
71
+
Number
(
state
.
gettypeoneList
.
length
)
*
40
}
getusestageName
()
// if (this.$route.query && this.$route.query.FlowId) {//如果有的话 调接口
// this.FlowId = this.$route.query.FlowId
// this.getdetails()
// }
}
else
{
//如果移动失败 重新获取列表
}
})
}
const
compare
=
(
property
:
string
)
=>
{
return
function
(
a
,
b
)
{
var
value1
=
a
[
property
];
var
value2
=
b
[
property
];
return
value1
-
value2
;
}
}
const
getusestageName
=
()
=>
{
state
.
UseStageName
=
[]
if
(
state
.
addMsg
.
UseStage
&&
state
.
addMsg
.
UseStage
.
length
>
0
)
{
state
.
addMsg
.
UseStage
.
forEach
(
x
=>
{
state
.
StageList
.
forEach
(
j
=>
{
if
(
x
==
j
.
Id
)
{
state
.
UseStageName
.
push
(
j
)
}
})
})
state
.
UseStageName
=
state
.
UseStageName
.
sort
(
compare
(
'Sort'
))
}
}
const
stageManagement
=
()
=>
{
router
.
push
({
path
:
'/editor/manageStageRange'
,
query
:
{
}
})
}
const
savemove
=
()
=>
{
$q
.
notify
({
type
:
'negative'
,
message
:
'不能删除'
,
position
:
'top'
})
}
onMounted
(()
=>
{
getList
()
})
return
{
state
,
jumpBeforePage
,
getList
,
getusestageName
,
compare
,
stageManagement
,
savemove
}
}
})
</
script
>
<
style
lang=
"scss"
scoped
>
.page
{
min-height
:
100vh
;
background-color
:
#f4f4f6
;
padding-bottom
:
20px
;
padding-top
:
80px
;
.mt20
{
margin-top
:
90px
;
}
}
.navbar
{
width
:
100%
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
height
:
70px
;
font-size
:
16px
;
border-bottom
:
1px
solid
#d7d7d7
;
background-color
:
#fff
;
position
:
fixed
;
/* left: 0; */
top
:
0
;
right
:
0
;
z-index
:
9
;
}
.container
{
margin
:
0
auto
;
width
:
1087px
;
.content-block
{
padding
:
30px
20px
;
border-radius
:
8px
;
background-color
:
#fff
;
margin-top
:
20px
;
.fission-title
{
color
:
#000
;
font-size
:
18px
;
font-weight
:
600
;
}
.fission-subtitle
{
color
:
#000
;
font-weight
:
bold
;
margin-top
:
15px
;
margin-bottom
:
15px
;
font-size
:
14px
;
}
.departs
{
.depart-title
{
font-size
:
14px
;
.per
{
height
:
16px
;
width
:
2px
;
display
:
inline-block
;
margin
:
0
15px
;
background
:
#d7d7d7
;
}
}
}
}
.btn
{
display
:
flex
;
align-items
:
center
;
margin-top
:
24px
;
margin-left
:
56px
;
;
margin-bottom
:
30px
;
}
.bold
{
font-weight
:
760
;
font-size
:
16px
;
color
:
#333
;
border-left
:
3px
solid
#3470ff
;
margin-bottom
:
20px
;
margin-left
:
-20px
;
padding
:
0
20px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
}
.addPhase
.all-stage
{
width
:
300px
;
padding
:
20px
45px
;
border
:
1px
solid
#d7d7d7
;
border-radius
:
8px
;
min-height
:
260px
;
}
.addPhase
.select-item-title
{
font-size
:
14px
;
font-weight
:
800
;
padding-bottom
:
10px
;
}
.addPhase
.right-arrow
{
width
:
28px
;
height
:
28px
;
background
:
#e7e7e7
;
border-radius
:
50%
;
align-self
:
center
;
line-height
:
28px
;
text-align
:
center
;
color
:
#fff
;
font-size
:
16px
;
margin
:
0
30px
;
}
.addPhase
.user_lists
{
width
:
100%
;
display
:
flex
;
flex-wrap
:
wrap
;
margin-top
:
20px
;
}
</
style
>
\ No newline at end of file
src/pages/editor/manageStageRange.vue
0 → 100644
View file @
98c19049
<
template
>
<div
class=
"page"
>
<div
class=
"q-pa-md q-gutter-sm navbar"
>
<q-breadcrumbs>
<q-breadcrumbs-el
label=
"返回"
icon=
"navigate_before"
@
click=
"jumpBeforePage"
/>
<q-breadcrumbs-el
label=
"阶段管理"
/>
</q-breadcrumbs>
<q-btn
color=
"primary"
label=
"完成"
@
click=
"savemove"
:loading=
"state.loading"
/>
</div>
<div
class=
"container"
>
<div
class=
"content-block"
>
<div
class=
"bold"
style=
"margin-bottom: 30px;"
>
跟进阶段
</div>
<draggable
v-model=
"state.followupStage"
item-key=
"Id"
>
<template
#
item=
"
{ element ,index}">
<div
style=
"display: flex;align-items: flex-start;"
>
<div
style=
"width: 57px;margin-top: 5px;"
>
<i
class=
"iconfont icon-drag"
style=
"font-size: 25px;color: #777;margin: 0 10px;"
></i>
</div>
<q-input
clearable
debounce
filled
maxlength=
"10"
counter
v-model=
"element.Name"
style=
"width:500px"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
<q-btn
flat
size=
"md"
icon=
"delete"
color=
"negative"
class=
"q-mr-xs"
style=
"margin-left: 10px;margin-top: 10px;"
label=
""
@
click=
"getStageDel(element.Id,index)"
/>
</div>
</
template
>
</draggable>
<div>
<div
v-for=
"(x,y) in state.followupStage_d"
:key=
"y"
style=
"display: flex;"
>
<div
style=
"width: 57px;height: 1px;"
>
</div>
<q-input
clearable
debounce
filled
v-model=
"x.Name"
style=
"width:500px"
disable
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
</div>
</div>
<div
class=
"btn"
>
<q-btn
v-if=
"state.followupStage.length<30"
color=
"accent"
class=
"q-mr-md"
label=
"添加"
icon=
'add'
@
click=
"state.followupStage.push({Id: 0,
IsDefault: 0,
Name: '',
OptionsList: [],
Sort: 0,
Type: 1})"
style=
"width: 100px;"
/>
<span
style=
"color:#858598"
>
已设/可设上限:{{state.followupStage.length}}/30
</span>
</div>
</div>
<div
class=
"content-block"
>
<div
class=
"bold"
>
结束跟进
</div>
<div
v-for=
"(x,y) in state.reasonList"
:key=
"y"
>
<ul
style=
"margin-left: 30px;margin-top: 10px;"
v-if=
"x.Type==2"
>
<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"
item-key=
"Id"
>
<
template
#
item=
"{ element ,index}"
>
<div
style=
"display: flex;"
>
<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=
"element.Name"
style=
"width:500px"
placeholder=
"名称"
:rules=
"[val => !!val || '不能为空']"
/>
<q-btn
flat
size=
"sm"
icon=
"delete"
color=
"negative"
class=
"q-mr-xs"
style=
"margin-left: 10px;"
label=
""
@
click=
"setCauseDel(y,index,x.Name,element.Id)"
/>
</div>
</
template
>
</draggable>
</ul>
<div
class=
"btn"
style=
"margin-left: 61px"
v-if=
"x.Type==2"
>
<q-btn
v-if=
"x.OptionsList.length<30"
color=
"accent"
class=
"q-mr-md"
label=
"添加"
icon=
'add'
@
click=
"state.reasonList[y].OptionsList.push({Id:0,Name:'',disable:false})"
style=
"width: 100px;"
/>
<span
style=
"color:#858598"
>
已设/可设上限:{{x.OptionsList.length}}/30
</span>
</div>
</div>
</div>
</div>
</div>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
onMounted
,
reactive
,
ref
}
from
'vue'
import
router
from
'@/router/index'
import
customerService
from
'@/api/customer'
import
draggable
from
"vuedraggable"
;
import
{
useQuasar
}
from
'quasar'
export
default
defineComponent
({
components
:
{
draggable
},
setup
()
{
const
$q
=
useQuasar
()
const
state
:
any
=
reactive
({
addMsg
:
[],
followupStage
:
[],
followupStage_d
:
[],
reasonList
:
[],
loading
:
false
})
const
jumpBeforePage
=
()
=>
{
router
.
go
(
-
1
)
}
const
getList
=
()
=>
{
customerService
.
getCustomerStageList
({}).
then
((
res
)
=>
{
if
(
res
.
data
.
Code
==
1
)
{
state
.
addMsg
=
res
.
data
.
Data
state
.
followupStage
=
[];
state
.
followupStage_d
=
[];
state
.
reasonList
=
[];
let
orderEntered
=
false
//判读是否有已输单
let
invalid
=
false
//无效
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
state
.
addMsg
))
list
.
forEach
(
x
=>
{
if
(
x
.
Type
==
1
)
{
if
(
x
.
IsDefault
==
0
)
{
state
.
followupStage
.
push
(
x
)
}
else
{
state
.
followupStage_d
.
push
(
x
)
}
}
if
(
x
.
Type
==
2
)
{
state
.
reasonList
.
push
(
x
)
if
(
x
.
Name
==
'已输单'
)
{
orderEntered
=
true
}
if
(
x
.
Name
==
'无效'
)
{
invalid
=
true
}
}
})
if
(
orderEntered
==
false
)
{
//没有的话 加一个已输单
let
obj
=
{
Id
:
0
,
IsDefault
:
0
,
Name
:
'已输单'
,
OptionsList
:
[],
Sort
:
0
,
Type
:
2
};
state
.
reasonList
.
push
(
obj
)
}
if
(
invalid
==
false
)
{
//没有的话 加一个无效
let
obj
=
{
Id
:
0
,
IsDefault
:
0
,
Name
:
'无效'
,
OptionsList
:
[],
Sort
:
0
,
Type
:
2
};
state
.
reasonList
.
push
(
obj
)
}
}
else
{
//如果移动失败 重新获取列表
}
})
}
const
getStageDel
=
(
Id
:
number
,
index
:
number
)
=>
{
if
(
Id
>
0
)
{
//判断是否是新加
customerService
.
validataCustomerStageDel
({
StageId
:
Id
}).
then
((
res
)
=>
{
if
(
res
.
data
.
Code
==
1
)
{
if
(
res
.
data
.
Data
.
UseState
==
false
)
{
//可以删除
state
.
followupStage
.
splice
(
index
,
1
)
}
else
{
$q
.
notify
({
type
:
'negative'
,
message
:
'不能删除'
,
position
:
'top'
})
}
}
else
{
//如果移动失败 重新获取列表
}
})
}
else
{
//不是的话直接删除
state
.
followupStage
.
splice
(
index
,
1
)
}
}
const
setCauseDel
=
(
y
:
number
,
index
:
number
,
Name
:
string
,
Id
:
number
)
=>
{
let
Type
=
1
if
(
Name
==
'无效'
)
Type
=
2
let
data
=
{
CauseId
:
Id
,
Type
:
Type
}
if
(
Id
>
0
)
{
customerService
.
validataCustomerCauseDel
(
data
).
then
((
res
)
=>
{
if
(
res
.
data
.
Code
==
1
)
{
if
(
res
.
data
.
Data
.
UseState
==
false
)
{
//可以删除
state
.
reasonList
[
y
].
OptionsList
.
splice
(
index
,
1
)
}
else
{
$q
.
notify
({
type
:
'negative'
,
message
:
'不能删除'
,
position
:
'top'
})
}
}
else
{
//如果移动失败 重新获取列表
}
})
}
else
{
state
.
reasonList
[
y
].
OptionsList
.
splice
(
index
,
1
)
}
}
const
savemove
=
()
=>
{
var
show
=
ref
(
false
)
for
(
let
i
=
0
;
i
<
state
.
followupStage
.
length
;
i
++
)
{
//判断根据阶段的值填写没有
let
x
=
state
.
followupStage
[
i
]
if
(
x
.
Name
==
''
||
x
.
Name
==
null
)
{
$q
.
notify
({
type
:
'negative'
,
message
:
'请填写跟进阶段列表选项值'
,
position
:
'top'
})
return
}
}
for
(
let
i
=
0
;
i
<
state
.
reasonList
.
length
;
i
++
)
{
let
x
=
state
.
reasonList
[
i
]
if
(
show
.
value
==
true
)
{
return
}
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
x
.
OptionsList
))
let
maxnum
=
list
.
sort
((
a
,
b
)
=>
{
return
b
.
Id
-
a
.
Id
})[
0
].
Id
for
(
let
j
=
0
;
j
<
x
.
OptionsList
.
length
;
j
++
)
{
let
z
=
x
.
OptionsList
[
j
]
if
(
z
.
Name
==
''
||
z
.
Name
==
null
)
{
$q
.
notify
({
type
:
'negative'
,
message
:
'请填写'
+
x
.
Name
+
'原因值'
,
position
:
'top'
})
show
.
value
=
true
return
}
if
(
z
.
Id
==
0
)
{
z
.
Id
=
maxnum
+
1
;
maxnum
++
}
}
}
state
.
addMsg
=
[]
state
.
addMsg
=
(
state
.
followupStage
.
concat
(
state
.
followupStage_d
)).
concat
(
state
.
reasonList
)
state
.
addMsg
.
forEach
((
x
,
i
)
=>
{
x
.
Sort
=
i
+
1
})
state
.
loading
=
true
customerService
.
setCustomerStageInfo
(
state
.
addMsg
).
then
((
res
)
=>
{
if
(
res
.
data
.
Code
==
1
)
{
state
.
loading
=
false
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
res
.
data
.
Message
,
position
:
'top'
})
getList
()
}
else
{
//如果移动失败 重新获取列表
state
.
loading
=
false
}
})
}
onMounted
(()
=>
{
getList
()
})
return
{
state
,
jumpBeforePage
,
getList
,
getStageDel
,
setCauseDel
,
savemove
,
}
}
})
</
script
>
<
style
lang=
"scss"
scoped
>
.page
{
/* height: 100vh; */
background-color
:
#f4f4f6
;
padding-bottom
:
20px
;
padding-top
:
80px
;
.mt20
{
margin-top
:
90px
;
}
}
.navbar
{
width
:
100%
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
height
:
70px
;
font-size
:
16px
;
border-bottom
:
1px
solid
#d7d7d7
;
background-color
:
#fff
;
position
:
fixed
;
/* left: 0; */
top
:
0
;
right
:
0
;
z-index
:
9
;
}
.container
{
margin
:
0
auto
;
width
:
1087px
;
.content-block
{
padding
:
30px
20px
;
border-radius
:
8px
;
background-color
:
#fff
;
margin-top
:
30px
;
.fission-title
{
color
:
#000
;
font-size
:
18px
;
font-weight
:
600
;
}
.fission-subtitle
{
color
:
#000
;
font-weight
:
bold
;
margin-top
:
15px
;
margin-bottom
:
15px
;
font-size
:
14px
;
}
.departs
{
.depart-title
{
font-size
:
14px
;
.per
{
height
:
16px
;
width
:
2px
;
display
:
inline-block
;
margin
:
0
15px
;
background
:
#d7d7d7
;
}
}
}
}
.btn
{
display
:
flex
;
align-items
:
center
;
margin-top
:
24px
;
margin-left
:
56px
;
;
margin-bottom
:
30px
;
}
.bold
{
font-weight
:
700
;
font-size
:
14px
;
color
:
#333
;
}
}
</
style
>
\ No newline at end of file
src/router/routes.ts
View file @
98c19049
...
...
@@ -39,6 +39,18 @@ const routes: RouteRecordRaw[] = [
path
:
'/editor/editRule'
,
component
:
()
=>
import
(
'@/pages/editor/editRule.vue'
)
},
// 编辑阶段规则
{
path
:
'/editor/manageStageRange'
,
component
:
()
=>
import
(
'@/pages/editor/manageStageRange.vue'
)
},
// 创建阶段
{
path
:
'/editor/createStageRange'
,
component
:
()
=>
import
(
'@/pages/editor/createStageRange.vue'
)
},
{
path
:
'/auth/login'
,
component
:
()
=>
import
(
'@/pages/auth/login.vue'
)
...
...
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