Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-presale
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1ebf747d
authored
Sep 11, 2025
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
无忧卡适用类型分页加载修改
1 parent
e4271ea8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
234 additions
and
35 deletions
src/api/modules/addWorryFree.js
src/views/addCards/index.vue
src/views/worryFree/index.vue
src/api/modules/addWorryFree.js
View file @
1ebf747
...
...
@@ -27,7 +27,7 @@ const downLoads = params => {
}
const
getTypelistApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
service.package.select.
get
`
params
.
method
=
`
${
defaultPath
}
service.package.select.
page
`
return
http
({
url
:
'rop-scrm-equity/router'
,
method
:
'POST'
,
...
...
src/views/addCards/index.vue
View file @
1ebf747
...
...
@@ -11,7 +11,16 @@
</GLTable>
<!-- 生成弹窗 -->
<GLDialog
class=
"gl-form-page gl-form-min"
title=
"生成无忧卡"
mode=
"mid"
v-if=
"addDialog"
:visible
.
sync=
"addDialog"
:before-close=
"handleClose"
@
onOk=
"submitForm('detailForm')"
@
onCancel=
"cancelDetailDialog"
>
<glsx-combi-form
ref=
"productCard"
labelWidth=
"154px"
defaultWidth=
"284px"
formRef=
"detailForm"
:formObj=
"addDialogForm"
:formData=
"addDialogFormData"
:formRules=
"addDialogRules"
></glsx-combi-form>
<glsx-combi-form
ref=
"productCard"
labelWidth=
"154px"
defaultWidth=
"284px"
formRef=
"detailForm"
:formObj=
"addDialogForm"
:formData=
"addDialogFormData"
:formRules=
"addDialogRules"
>
<div
slot=
"codeSlot"
>
<el-select
v-model=
"addDialogForm.packageCode"
remote
reserve-keyword
@
visible-change=
"visibleChangePackageCode"
:remote-method=
"remoteMethodPackageCode"
v-el-select-loadmore=
"interestsLoadmore"
clearable
filterable
>
<el-option
v-for=
"(subItem, subIndex) in codeTypeList"
:key=
"subIndex"
:label=
"subItem.packageName"
:value=
"subItem.packageCode"
/>
</el-select>
</div>
</glsx-combi-form>
</GLDialog>
</div>
</div>
...
...
@@ -85,6 +94,7 @@ export default {
}
],
getWorryBatcnList
:
this
.
$apis
.
addWorryFree
.
getWorryBatcnList
,
codeTypeList
:
[],
// 适用类型
addDialogForm
:
{
batchType
:
''
,
packageCode
:
''
,
...
...
@@ -114,10 +124,7 @@ export default {
{
label
:
'适用类型'
,
name
:
'packageCode'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'packageCode'
,
optionLabel
:
'packageName'
addHtml
:
'codeSlot'
},
{
type
:
'input'
,
...
...
@@ -211,21 +218,75 @@ export default {
// minWidth: '200'
}
]
},
pageNum
:
1
,
pageSize
:
20
}
},
directives
:
{
"el-select-loadmore"
:
{
bind
(
el
,
binding
)
{
const
waitForDropdown
=
()
=>
{
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
if
(
SELECTWRAP_DOM
)
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
+
1
if
(
condition
)
{
binding
.
value
()
}
});
}
else
{
// 如果没有找到下拉框DOM,延迟重试(针对对话框情况)
setTimeout
(
waitForDropdown
,
50
)
}
}
waitForDropdown
()
}
}
},
created
()
{
this
.
getTypelist
()
//
this.getTypelist()
},
mounted
()
{},
methods
:
{
getTypelist
(){
this
.
$apis
.
addWorryFree
.
getTypelistApi
({}).
then
(
res
=>
{
if
(
!
res
?.
length
)
return
;
let
target
=
this
.
addDialogFormData
.
find
(
item
=>
item
.
name
==
'packageCode'
)
target
.
optionList
=
res
this
.
$apis
.
addWorryFree
.
getTypelistApi
({
packageName
:
this
.
packageNameKeyword
,
pageNum
:
this
.
pageNum
,
pageSize
:
this
.
pageSize
}).
then
(
res
=>
{
let
arr
=
this
.
codeTypeList
.
concat
(
res
.
list
)
this
.
allPages
=
res
.
page
this
.
codeTypeList
=
arr
})
},
interestsLoadmore
()
{
setTimeout
(()
=>
{
this
.
pageNum
=
this
.
pageNum
+
1
if
(
this
.
allPages
<
this
.
pageNum
)
{
this
.
pageNum
=
this
.
allPages
return
}
this
.
getTypelist
()
},
10
)
},
remoteMethodPackageCode
(
query
)
{
this
.
packageNameKeyword
=
query
this
.
pageNum
=
1
this
.
codeTypeList
=
[]
this
.
getTypelist
()
// 请求接口
},
visibleChangePackageCode
(
data
)
{
// 获取焦点重新渲染下拉框数据
if
(
data
)
{
if
(
this
.
packageNameKeyword
)
{
this
.
packageNameKeyword
=
""
this
.
pageNum
=
1
this
.
codeTypeList
=
[]
this
.
getTypelist
()
}
}
},
// changePgCode(e){
// const arr = [{
// value: '1',
...
...
@@ -267,6 +328,9 @@ export default {
},
add
()
{
this
.
addDialog
=
true
this
.
codeTypeList
=
[]
this
.
pageNum
=
1
this
.
getTypelist
()
},
// 关闭弹窗界面
cancelDetailDialog
()
{
...
...
src/views/worryFree/index.vue
View file @
1ebf747
<
template
>
<div
class=
"equity-wrap"
>
<div
class=
"equity-wrap contain"
>
<GLCombiForm
ref=
"showSearch"
:formObj=
"detailForm"
:formData=
"detailFormData"
@
handleOk=
"detailSelect('select')"
@
handleRest=
"detailSelect('reset')"
></GLCombiForm>
<GLCombiForm
ref=
"showSearch"
:formObj=
"detailForm"
:formData=
"detailFormData"
@
handleOk=
"detailSelect('select')"
@
handleRest=
"detailSelect('reset')"
>
<div
slot=
"codeSlot"
>
<el-select
v-model=
"detailForm.packageCode"
remote
reserve-keyword
@
visible-change=
"visibleChangePackageCode"
:remote-method=
"remoteMethodPackageCode"
v-el-select-loadmore=
"interestsLoadmore"
clearable
filterable
>
<el-option
v-for=
"(subItem, subIndex) in codeTypeList"
:key=
"subIndex"
:label=
"subItem.packageName"
:value=
"subItem.packageCode"
/>
</el-select>
</div>
</GLCombiForm>
<el-alert
:closable=
"false"
type=
"info"
show-icon
>
总计
{{
line
.
total
}}
张,已使用
{{
line
.
usedAmount
}}
张
</el-alert>
<GLTable
ref=
"detailTable"
:searchForm=
"detailForm"
:tableParams=
"detailParams"
:pageConf=
"detailPageConf"
:getListApi=
"getDetailList"
:beforeSearchFn=
"check"
style=
"margin-top: 10px"
>
<span
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
>
...
...
@@ -12,7 +21,16 @@
</div>
<!-- 详情弹窗 -->
<GLDialog
class=
"gl-form-page gl-form-min"
title=
"修改无忧卡"
v-if=
"detailDialog"
:visible
.
sync=
"detailDialog"
mode=
"mid"
:before-close=
"handleClose"
@
onOk=
"submitForm('detailForm')"
@
onCancel=
"cancelDetailDialog"
>
<glsx-combi-form
ref=
"product"
labelWidth=
"154px"
defaultWidth=
"284px"
formRef=
"detailForm"
:formObj=
"detailDialogForm"
:formData=
"addDialogFormData"
:formRules=
"detailDialogRules"
></glsx-combi-form>
<glsx-combi-form
ref=
"product"
labelWidth=
"154px"
defaultWidth=
"284px"
formRef=
"detailForm"
:formObj=
"detailDialogForm"
:formData=
"addDialogFormData"
:formRules=
"detailDialogRules"
>
<div
slot=
"codeSlotDialog"
>
<el-select
v-model=
"detailDialogForm.packageCode"
remote
reserve-keyword
@
visible-change=
"visibleDialogChangePackageCode"
:remote-method=
"remoteMethodDialogPackageCode"
v-el-select-loadmore-dialog=
"interestsLoadmoreDialog"
clearable
filterable
>
<el-option
v-for=
"(subItem, subIndex) in dialogCodeTypeList"
:key=
"subIndex"
:label=
"subItem.packageName"
:value=
"subItem.packageCode"
/>
</el-select>
</div>
</glsx-combi-form>
</GLDialog>
</div>
</
template
>
...
...
@@ -52,7 +70,6 @@ export default {
},
data
()
{
return
{
applyTypelist
:
[],
date_format
,
buttonList
:
[
{
...
...
@@ -140,11 +157,7 @@ export default {
{
label
:
'适用类型'
,
name
:
'packageCode'
,
type
:
'select'
,
isClear
:
true
,
optionList
:
[],
optionId
:
'packageCode'
,
optionLabel
:
'packageName'
addHtml
:
'codeSlot'
},
{
label
:
'状态'
,
...
...
@@ -236,10 +249,7 @@ export default {
{
label
:
'适用类型'
,
name
:
'packageCode'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'packageCode'
,
optionLabel
:
'packageName'
addHtml
:
'codeSlotDialog'
},
{
type
:
'input'
,
...
...
@@ -442,11 +452,7 @@ export default {
},
{
label
:
'适用类型'
,
prop
:
'packageCode'
,
formatter
:
cellValue
=>
{
let
targer
=
this
.
applyTypelist
.
find
(
item
=>
item
.
packageCode
==
cellValue
.
packageCode
)
return
targer
&&
targer
.
packageName
?
targer
.
packageName
:
'--'
},
prop
:
'packageName'
,
width
:
220
},
{
...
...
@@ -478,6 +484,51 @@ export default {
width
:
100
}
]
},
pageNum
:
1
,
pageSize
:
20
,
dialogPageNum
:
1
,
codeTypeList
:
[],
dialogCodeTypeList
:
[]
}
},
directives
:
{
"el-select-loadmore"
:
{
bind
(
el
,
binding
)
{
const
waitForDropdown
=
()
=>
{
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
if
(
SELECTWRAP_DOM
)
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
+
1
if
(
condition
)
{
binding
.
value
()
}
});
}
else
{
// 如果没有找到下拉框DOM,延迟重试(针对对话框情况)
setTimeout
(
waitForDropdown
,
50
)
}
}
waitForDropdown
()
}
},
"el-select-loadmore-dialog"
:
{
bind
(
el
,
binding
)
{
const
waitForDropdown
=
()
=>
{
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
if
(
SELECTWRAP_DOM
)
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
+
1
if
(
condition
)
{
binding
.
value
()
}
});
}
else
{
// 如果没有找到下拉框DOM,延迟重试(针对对话框情况)
setTimeout
(
waitForDropdown
,
50
)
}
}
waitForDropdown
()
}
}
},
...
...
@@ -486,16 +537,96 @@ export default {
this
.
getTypelist
()
},
methods
:
{
/**筛选条件适用类型开始 */
getTypelist
()
{
this
.
$apis
.
addWorryFree
.
getTypelistApi
({}).
then
(
res
=>
{
if
(
!
res
?.
length
)
return
let
target
=
this
.
addDialogFormData
.
find
(
item
=>
item
.
name
==
'packageCode'
)
target
.
optionList
=
res
let
serachTarget
=
this
.
detailFormData
.
find
(
item
=>
item
.
name
==
'packageCode'
)
serachTarget
.
optionList
=
[{
packageCode
:
''
,
packageName
:
'全部'
},
...
res
]
this
.
applyTypelist
=
res
this
.
$apis
.
addWorryFree
.
getTypelistApi
({
pageNum
:
this
.
pageNum
,
pageSize
:
this
.
pageSize
,
packageName
:
this
.
packageNameKeyword
}).
then
(
res
=>
{
let
arr
=
this
.
codeTypeList
.
concat
(
res
.
list
)
this
.
allPages
=
res
.
page
this
.
codeTypeList
=
arr
if
(
!
this
.
codeTypeList
?.
find
(
val
=>
val
.
packageCode
==
''
&&
val
.
packageName
==
'全部'
))
this
.
codeTypeList
.
unshift
({
packageCode
:
''
,
packageName
:
'全部'
})
})
},
interestsLoadmore
()
{
setTimeout
(()
=>
{
this
.
pageNum
=
this
.
pageNum
+
1
if
(
this
.
allPages
<
this
.
pageNum
)
{
this
.
pageNum
=
this
.
allPages
return
}
this
.
getTypelist
()
},
10
)
},
remoteMethodPackageCode
(
query
)
{
this
.
packageNameKeyword
=
query
this
.
pageNum
=
1
this
.
codeTypeList
=
[]
this
.
getTypelist
()
// 请求接口
},
visibleChangePackageCode
(
data
)
{
// 获取焦点重新渲染下拉框数据
if
(
data
)
{
if
(
this
.
packageNameKeyword
)
{
this
.
packageNameKeyword
=
""
this
.
pageNum
=
1
this
.
codeTypeList
=
[]
this
.
getTypelist
()
}
}
},
/**筛选条件适用类型结束 */
/**修改弹窗适用类型开始 */
getDialogTypeList
(
defaultSelect
)
{
this
.
$apis
.
addWorryFree
.
getTypelistApi
({
pageNum
:
this
.
dialogPageNum
,
pageSize
:
this
.
pageSize
,
packageName
:
this
.
dialogPackageNameKeyword
}).
then
(
res
=>
{
let
arr
=
this
.
dialogCodeTypeList
.
concat
(
res
.
list
)
this
.
dialogAllPages
=
res
.
page
if
(
defaultSelect
?.
length
)
arr
=
defaultSelect
.
concat
(
arr
)
this
.
dialogCodeTypeList
=
this
.
unique
(
arr
)
})
},
// 根据packageCode去重
unique
(
arr
)
{
const
res
=
new
Map
()
return
arr
.
filter
(
(
a
)
=>
!
res
.
has
(
a
.
packageCode
)
&&
res
.
set
(
a
.
packageCode
,
1
)
)
},
interestsLoadmoreDialog
()
{
setTimeout
(()
=>
{
this
.
dialogPageNum
=
this
.
dialogPageNum
+
1
if
(
this
.
dialogAllPages
<
this
.
dialogPageNum
)
{
this
.
dialogPageNum
=
this
.
dialogAllPages
return
}
this
.
getDialogTypeList
()
},
10
)
},
remoteMethodDialogPackageCode
(
query
)
{
this
.
dialogPackageNameKeyword
=
query
this
.
dialogAllPages
=
1
this
.
dialogCodeTypeList
=
[]
this
.
getDialogTypeList
()
// 请求接口
},
visibleDialogChangePackageCode
(
data
)
{
// 获取焦点重新渲染下拉框数据
if
(
data
)
{
if
(
this
.
dialogPackageNameKeyword
)
{
this
.
dialogPackageNameKeyword
=
""
this
.
dialogPageNum
=
1
this
.
dialogCodeTypeList
=
[]
this
.
getDialogTypeList
()
}
}
},
/**修改弹窗适用类型结束 */
// changePgCode(e){
// const arr = [{
// value: '1',
...
...
@@ -574,6 +705,10 @@ export default {
}
else
{
this
.
detailDialogForm
.
batchType
=
'畅享版'
}
let
defaultArr
=
[{
packageCode
:
obj
.
packageCode
,
packageName
:
obj
.
packageName
}]
this
.
dialogCodeTypeList
=
[]
this
.
dialogPageNum
=
1
this
.
getDialogTypeList
(
defaultArr
)
},
// 清空无忧卡使用状态
clearStatus
(
row
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment