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
ee691719
Commit
ee691719
authored
Nov 17, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
eda17e82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
11 deletions
+102
-11
customer.ts
src/api/customer.ts
+8
-0
customerField.vue
src/pages/customer/components/customerField.vue
+94
-11
No files found.
src/api/customer.ts
View file @
ee691719
...
@@ -39,6 +39,14 @@
...
@@ -39,6 +39,14 @@
data
data
})
})
}
}
// 客户标签移动
static
async
setCustomerFiledState
(
data
:
{
Type
:
number
,
SortFiledId
:
number
,
FiledId
:
number
}):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/SetCustomerFiledState'
,
{
method
:
'post'
,
responseType
:
'json'
,
data
})
}
// 获取客户线索规则列表
// 获取客户线索规则列表
static
async
getCustomerClueRuleList
(
data
:
any
):
Promise
<
HttpResponse
>
{
static
async
getCustomerClueRuleList
(
data
:
any
):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/GetCustomerClueRuleList'
,
{
return
Axios
(
'/QYCustomer/GetCustomerClueRuleList'
,
{
...
...
src/pages/customer/components/customerField.vue
View file @
ee691719
<
template
>
<
template
>
<
requestgroup></requestgroup
>
<
!--
<requestgroup></requestgroup>
--
>
<div
class=
"q-pa-md customerField"
>
<div
class=
"q-pa-md customerField"
>
<table
class=
"payTable"
>
<table
class=
"payTable"
>
<thead>
<thead>
...
@@ -30,11 +30,11 @@
...
@@ -30,11 +30,11 @@
<q-toggle
v-if=
"element.IsLock==1"
v-model=
"element.Enable"
:true-value=
"1"
:false-value=
"2"
<q-toggle
v-if=
"element.IsLock==1"
v-model=
"element.Enable"
:true-value=
"1"
:false-value=
"2"
icon=
"lock"
disable
/>
icon=
"lock"
disable
/>
<q-toggle
v-else
v-model=
"element.Enable"
:true-value=
"1"
:false-value=
"2"
<q-toggle
v-else
v-model=
"element.Enable"
:true-value=
"1"
:false-value=
"2"
@
input
=
"godelete(element,1,index)"
/>
@
update:model-value
=
"godelete(element,1,index)"
/>
</td>
</td>
<td>
<td>
<q-toggle
v-model=
"element.Required"
:true-value=
"1"
:false-value=
"2"
<q-toggle
v-model=
"element.Required"
:true-value=
"1"
:false-value=
"2"
@
input
=
"godelete(element,2,index)"
/>
@
update:model-value
=
"godelete(element,2,index)"
/>
</td>
</td>
<td>
<td>
<div>
{{
element
.
UpdateByName
}}
</div>
<div>
{{
element
.
UpdateByName
}}
</div>
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
class=
"q-mr-xs"
label=
"删除"
@
click=
"godelete(element,3,index)"
/>
class=
"q-mr-xs"
label=
"删除"
@
click=
"godelete(element,3,index)"
/>
</td>
</td>
<td>
<td>
<i
class=
"iconfont icon-
weiyi"
style=
"font-size: 14
px;color: #777;"
></i>
<i
class=
"iconfont icon-
drag"
style=
"font-size: 20
px;color: #777;"
></i>
</td>
</td>
</tr>
</tr>
</
template
>
</
template
>
...
@@ -58,28 +58,109 @@
...
@@ -58,28 +58,109 @@
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
onMounted
}
from
'vue'
import
{
defineComponent
,
ref
,
onMounted
,
reactive
}
from
'vue'
import
requestgroup
from
'../../../components/customer/request-group.vue'
import
requestgroup
from
'../../../components/customer/request-group.vue'
import
customerService
from
'@/api/customer'
import
customerService
from
'@/api/customer'
import
draggable
from
"vuedraggable"
;
import
draggable
from
"vuedraggable"
;
import
{
useQuasar
}
from
'quasar'
interface
listType
{
Id
:
number
Enable
:
number
Required
:
number
[
propName
:
string
]:
any
}
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
draggable
,
requestgroup
},
components
:
{
draggable
,
requestgroup
},
setup
()
{
setup
()
{
const
data
=
ref
([]);
const
$q
=
useQuasar
()
const
dragId
=
ref
(
0
);
let
data
=
ref
<
Array
<
listType
>>
([])
let
dragId
=
ref
(
0
);
const
changePage
=
()
=>
{
const
changePage
=
()
=>
{
customerService
.
getCustomerFiledList
({
Enable
:
-
1
}).
then
((
res
)
=>
{
customerService
.
getCustomerFiledList
({
Enable
:
-
1
}).
then
((
res
)
=>
{
data
.
value
=
res
.
data
.
Data
data
.
value
=
res
.
data
.
Data
})
})
}
}
const
datadragEnd
=
(
e
:
any
)
=>
{
const
datadragEnd
=
(
e
:
any
)
=>
{
console
.
log
(
'拖动结束'
,
e
)
// console.log('拖动结束',e)
let
olddragId
=
0
if
(
e
.
newIndex
>
0
){
olddragId
=
data
.
value
[
e
.
newIndex
-
1
].
Id
}
else
{
olddragId
=
0
}
let
msg
=
{
Type
:
4
,
FiledId
:
dragId
.
value
,
SortFiledId
:
olddragId
,
}
customerService
.
setCustomerFiledState
(
msg
).
then
((
res
)
=>
{
if
(
res
.
data
.
Code
==
1
)
{
}
else
{
//如果移动失败 重新获取列表
changePage
()
}
})
}
}
const
getdata
=
(
e
:
any
)
=>
{
const
getdata
=
(
e
:
any
)
=>
{
console
.
log
(
'拖动结束22323'
,
e
)
dragId
.
value
=
e
.
draggedContext
.
element
.
Id
dragId
.
value
=
e
.
draggedContext
.
element
.
Id
}
}
const
setFiledState
=
(
item
,
Type
)
=>
{
let
msg
=
{
Type
:
Type
,
FiledId
:
item
.
Id
,
SortFiledId
:
0
,
}
customerService
.
setCustomerFiledState
(
msg
).
then
((
res
)
=>
{
if
(
res
.
data
.
Code
==
1
)
{
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
`操作成功`
,
position
:
'top'
})
changePage
()
}
else
{
//如果移动失败 重新获取列表
}
})
}
const
godelete
=
(
item
:
any
,
type
:
number
,
index
:
number
)
=>
{
let
text
=
''
if
(
type
==
1
){
//tyep等于1和2的时候 先让弹出提示 然后再给予掉接口 所以把原本的值暂时先赋值给本身
text
=
'确定修改启用状态'
if
(
item
.
Enable
==
2
){
data
.
value
[
index
].
Enable
=
1
}
else
{
data
.
value
[
index
].
Enable
=
2
}
}
else
if
(
type
==
2
){
text
=
'确定修改必填状态'
if
(
item
.
Required
==
2
){
data
.
value
[
index
].
Required
=
1
}
else
{
data
.
value
[
index
].
Required
=
2
}
}
else
if
(
type
==
3
){
text
=
'删除后字段不在显示,是否删除?'
}
console
.
log
(
text
)
$q
.
dialog
({
title
:
"提示信息"
,
message
:
text
,
cancel
:
{
label
:
"取消"
,
flat
:
true
},
ok
:
{
label
:
"确认"
,
flat
:
true
,
focus
:
true
}
}).
onOk
(()
=>
{
setFiledState
(
item
,
type
)
});
}
onMounted
(()
=>
{
onMounted
(()
=>
{
changePage
()
changePage
()
...
@@ -89,7 +170,9 @@
...
@@ -89,7 +170,9 @@
data
,
data
,
changePage
,
changePage
,
datadragEnd
,
datadragEnd
,
getdata
getdata
,
godelete
,
setFiledState
}
}
}
}
...
@@ -107,7 +190,7 @@
...
@@ -107,7 +190,7 @@
font-size
:
12px
;
font-size
:
12px
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#2D2D2D
;
color
:
#2D2D2D
;
background
:
#
DDDEE0
;
background
:
#
f5f5fa
;
}
}
.customerField
.payTable
tr
{
.customerField
.payTable
tr
{
...
...
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