Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-renewal
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 a6901cce
authored
Aug 18, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'xuyl_v2.8.0' into 'v2.8.0'
修复bug See merge request
!30
2 parents
b0c1cc58
37a7337a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
34 deletions
src/views/insurance/customer/addNamelist/index.vue
src/views/insurance/customer/addNamelist/index.vue
View file @
a6901cc
...
@@ -138,7 +138,7 @@ export default {
...
@@ -138,7 +138,7 @@ export default {
pageData
:
{
pageData
:
{
//懒加载相关参数,这里代表从第一条数据开始加载,一次加载40项
//懒加载相关参数,这里代表从第一条数据开始加载,一次加载40项
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
40
pageSize
:
40
,
},
},
merchants
:
[],
merchants
:
[],
upLoadNum
:
''
,
upLoadNum
:
''
,
...
@@ -155,20 +155,20 @@ export default {
...
@@ -155,20 +155,20 @@ export default {
merchant
:
''
,
merchant
:
''
,
brand
:
''
,
brand
:
''
,
address
:
''
,
address
:
''
,
remarks
:
''
remarks
:
''
,
},
},
rules
:
{
rules
:
{
merchant
:
[
merchant
:
[
{
required
:
true
,
message
:
'请选择商户'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请选择商户'
,
trigger
:
'change'
}
,
],
],
brand
:
[
brand
:
[
{
required
:
true
,
message
:
'请输入商户主营品牌'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入商户主营品牌'
,
trigger
:
'change'
}
,
],
],
address
:
[
address
:
[
{
required
:
true
,
message
:
'请输入商户地址'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入商户地址'
,
trigger
:
'change'
}
,
],
],
remarks
:
[{
required
:
false
,
trigger
:
'blur'
}]
remarks
:
[{
required
:
false
,
trigger
:
'blur'
}]
,
}
}
,
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -181,15 +181,15 @@ export default {
...
@@ -181,15 +181,15 @@ export default {
const
SELECTWRAP_DOM
=
el
.
querySelector
(
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
'.el-select-dropdown .el-select-dropdown__wrap'
)
)
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
const
condition
=
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
if
(
condition
)
{
if
(
condition
)
{
binding
.
value
()
binding
.
value
()
}
}
})
})
}
}
,
}
}
,
},
},
watch
:
{
watch
:
{
fileName
(
val
)
{
fileName
(
val
)
{
...
@@ -208,11 +208,11 @@ export default {
...
@@ -208,11 +208,11 @@ export default {
this
.
dataItems
=
[]
this
.
dataItems
=
[]
this
.
merchantList
({
this
.
merchantList
({
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
40
pageSize
:
40
,
})
})
}
}
}
}
,
}
}
,
},
},
methods
:
{
methods
:
{
loadmore
()
{
loadmore
()
{
...
@@ -230,15 +230,15 @@ export default {
...
@@ -230,15 +230,15 @@ export default {
.
getMerchantsListByPages
({
.
getMerchantsListByPages
({
accounttypeId
,
accounttypeId
,
merchantName
:
searchVal
,
merchantName
:
searchVal
,
...
val
...
val
,
})
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
let
arr
=
res
.
data
.
data
.
data
.
map
(
val
=>
{
let
arr
=
res
.
data
.
data
.
data
.
map
(
(
val
)
=>
{
return
{
return
{
merchantName
:
val
.
merchantName
,
merchantName
:
val
.
merchantName
,
merchantBrandCars
:
val
.
merchantBrandCars
,
merchantBrandCars
:
val
.
merchantBrandCars
,
merchantAddress
:
val
.
merchantAddress
,
merchantAddress
:
val
.
merchantAddress
,
merchantId
:
val
.
merchantNo
merchantId
:
val
.
merchantNo
,
}
}
})
})
this
.
dataItems
=
[...
this
.
dataItems
,
...
arr
]
this
.
dataItems
=
[...
this
.
dataItems
,
...
arr
]
...
@@ -262,23 +262,23 @@ export default {
...
@@ -262,23 +262,23 @@ export default {
this
.
dataItems
=
[]
this
.
dataItems
=
[]
this
.
merchantList
({
this
.
merchantList
({
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
40
pageSize
:
40
,
})
})
}
}
},
},
// 根据所选商户获取品牌和地址
// 根据所选商户获取品牌和地址
async
selectChange
(
label
)
{
async
selectChange
(
label
)
{
if
(
label
)
{
if
(
label
)
{
let
obj
=
this
.
dataItems
.
filter
(
el
=>
{
let
obj
=
this
.
dataItems
.
filter
(
(
el
)
=>
{
return
el
.
merchantName
==
label
return
el
.
merchantName
==
label
})
})
this
.
merchantId
=
obj
[
0
]
&&
obj
[
0
].
merchantId
this
.
merchantId
=
obj
[
0
]
&&
obj
[
0
].
merchantId
await
addNamelistApi
await
addNamelistApi
.
findMerchantDetailByMerchantNo
({
merchantId
:
this
.
merchantId
})
.
findMerchantDetailByMerchantNo
({
merchantId
:
this
.
merchantId
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
let
brandTreeList
=
res
.
data
.
data
&&
res
.
data
.
data
.
brandTreeList
let
brandTreeList
=
res
.
data
.
data
&&
res
.
data
.
data
.
brandTreeList
let
brandTreeListName
=
let
brandTreeListName
=
brandTreeList
&&
brandTreeList
.
map
(
item
=>
item
.
name
)
brandTreeList
&&
brandTreeList
.
map
(
(
item
)
=>
item
.
name
)
let
brandNamStr
=
brandTreeListName
&&
brandTreeListName
.
toString
()
let
brandNamStr
=
brandTreeListName
&&
brandTreeListName
.
toString
()
if
(
brandNamStr
&&
brandNamStr
.
length
>
50
)
{
if
(
brandNamStr
&&
brandNamStr
.
length
>
50
)
{
this
.
$set
(
this
.
ruleForm
,
'brand'
,
brandNamStr
.
slice
(
0
,
50
))
this
.
$set
(
this
.
ruleForm
,
'brand'
,
brandNamStr
.
slice
(
0
,
50
))
...
@@ -299,13 +299,13 @@ export default {
...
@@ -299,13 +299,13 @@ export default {
if
(
this
.
fileName
==
''
)
{
if
(
this
.
fileName
==
''
)
{
this
.
hasFile
=
true
this
.
hasFile
=
true
}
}
this
.
$refs
.
ruleForm
.
validate
(
valid
=>
{
this
.
$refs
.
ruleForm
.
validate
(
(
valid
)
=>
{
if
(
!
this
.
hasFile
&&
valid
)
{
if
(
!
this
.
hasFile
&&
valid
)
{
let
{
let
{
address
:
merchantAddr
,
address
:
merchantAddr
,
merchant
:
merchantName
,
merchant
:
merchantName
,
brand
:
mainBrandName
,
brand
:
mainBrandName
,
remarks
:
remark
remarks
:
remark
,
}
=
this
.
ruleForm
}
=
this
.
ruleForm
let
params
=
{
let
params
=
{
merchantAddr
,
merchantAddr
,
...
@@ -313,15 +313,15 @@ export default {
...
@@ -313,15 +313,15 @@ export default {
mainBrandName
,
mainBrandName
,
remark
,
remark
,
merchantId
:
this
.
merchantId
,
merchantId
:
this
.
merchantId
,
file
:
this
.
fileBaseUrl
file
:
this
.
fileBaseUrl
,
}
}
customerApi
.
addCustomerList
(
params
).
then
(
customerApi
.
addCustomerList
(
params
).
then
(
res
=>
{
(
res
)
=>
{
let
loading
=
this
.
$loading
({
let
loading
=
this
.
$loading
({
lock
:
true
,
lock
:
true
,
text
:
'Loading'
,
text
:
'Loading'
,
spinner
:
'el-icon-loading'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.7)'
background
:
'rgba(0, 0, 0, 0.7)'
,
})
})
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
loading
.
close
()
loading
.
close
()
...
@@ -335,12 +335,12 @@ export default {
...
@@ -335,12 +335,12 @@ export default {
this
.
uploadErrorMsg
=
res
.
message
this
.
uploadErrorMsg
=
res
.
message
}
}
},
},
err
=>
{
(
err
)
=>
{
let
loading
=
this
.
$loading
({
let
loading
=
this
.
$loading
({
lock
:
true
,
lock
:
true
,
text
:
'Loading'
,
text
:
'Loading'
,
spinner
:
'el-icon-loading'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.7)'
background
:
'rgba(0, 0, 0, 0.7)'
,
})
})
loading
.
close
()
loading
.
close
()
this
.
dialogVisible
=
true
this
.
dialogVisible
=
true
...
@@ -373,7 +373,7 @@ export default {
...
@@ -373,7 +373,7 @@ export default {
this
.
setInter
=
setInterval
(
this
.
addProcess
,
100
)
this
.
setInter
=
setInterval
(
this
.
addProcess
,
100
)
const
reader
=
new
FileReader
()
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
file
)
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
event
=>
{
reader
.
onload
=
(
event
)
=>
{
this
.
fileName
=
file
.
name
this
.
fileName
=
file
.
name
const
imgFile
=
event
.
target
.
result
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
const
arrBase64
=
imgFile
.
split
(
','
)
...
@@ -381,18 +381,21 @@ export default {
...
@@ -381,18 +381,21 @@ export default {
const
fileUrl
=
splitStr
[
splitStr
.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
const
fileUrl
=
splitStr
[
splitStr
.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
let
fileList
=
[{
file
:
fileUrl
,
fileType
:
'doc'
}]
let
fileList
=
[{
file
:
fileUrl
,
fileType
:
'doc'
}]
uploadApi
.
multipleUpload
({
fileList
}).
then
(
uploadApi
.
multipleUpload
({
fileList
}).
then
(
res
=>
{
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
this
.
fileBaseUrl
=
res
.
data
[
0
]
this
.
fileBaseUrl
=
res
.
data
[
0
]
this
.
$refs
.
file
.
value
=
''
}
else
{
}
else
{
this
.
fileName
=
''
this
.
fileName
=
''
this
.
$refs
.
file
.
value
=
''
this
.
$message
.
error
(
'文件上传失败'
)
this
.
$message
.
error
(
'文件上传失败'
)
}
}
}
}
},
},
err
=>
{
(
err
)
=>
{
this
.
fileName
=
''
this
.
fileName
=
''
this
.
$refs
.
file
.
value
=
''
this
.
$message
.
error
(
'文件上传失败'
)
this
.
$message
.
error
(
'文件上传失败'
)
}
}
)
)
...
@@ -405,15 +408,15 @@ export default {
...
@@ -405,15 +408,15 @@ export default {
'续保'
,
'续保'
,
'保险渠道管理'
,
'保险渠道管理'
,
'客户名单管理'
,
'客户名单管理'
,
'客户名单管理列表'
'客户名单管理列表'
,
])
])
this
.
dialogVisible
=
false
this
.
dialogVisible
=
false
if
(
this
.
uploadStatus
==
'success'
)
{
if
(
this
.
uploadStatus
==
'success'
)
{
this
.
ruleForm
=
{}
this
.
ruleForm
=
{}
this
.
fileName
=
''
this
.
fileName
=
''
}
}
}
}
,
}
}
,
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
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