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 86f2d00e
authored
Apr 01, 2022
by
张权
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
合并
1 parent
9854a015
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
14 deletions
src/views/claims/components/material.vue
src/views/claims/components/repair.vue
src/views/claims/components/material.vue
View file @
86f2d00
<
template
>
<div
class=
"report-components"
>
<div
class=
"title"
>
上传资料
</div>
<el-upload
action=
"https://jsonplaceholder.typicode.com/posts/"
list-type=
"picture-card"
:on-preview=
"handlePictureCardPreview"
:on-remove=
"handleRemove"
>
<i
class=
"el-icon-plus"
></i>
</el-upload>
<el-dialog
:visible
.
sync=
"dialogVisible"
>
<img
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
/>
</el-dialog>
<div
v-for=
"item in materialData"
:key=
"item.name"
>
<div>
{{
item
.
label
}}
</div>
<el-upload
:class=
"[(item.imgList ? item.limit != item.imgList.length : true) ? '' : 'hidePlusBtn']"
:limit=
"item.limit"
action=
"#"
:before-upload=
"beforeAvatarUpload"
list-type=
"picture-card"
:ref=
"item.name + 'Ref'"
:on-preview=
"handlePictureCardPreview"
:on-remove=
"e => handleRemove(e, item.name)"
:http-request=
"e => httpRequest(e, item.name)"
>
<i
slot=
"default"
class=
"el-icon-plus"
></i>
</el-upload>
<el-dialog
:visible
.
sync=
"dialogVisible"
>
<img
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
/>
</el-dialog>
</div>
</div>
</
template
>
...
...
@@ -22,34 +25,98 @@ export default {
// },
data
()
{
return
{
dialogVisible
:
false
,
materialForm
:
{
cardInfo
:
''
,
billInfo
:
''
,
otherInfo
:
''
},
fieldInfo
:
{
cardInfo
:
[],
billInfo
:
[],
otherInfo
:
[]
},
materialData
:
[
{
label
:
'身份证'
,
name
:
'cardInfo'
,
type
:
'upload'
limit
:
2
,
imgList
:
[]
},
{
label
:
'发票'
,
name
:
'billInfo'
,
type
:
'upload'
limit
:
10
,
imgList
:
[]
},
{
label
:
'其他'
,
name
:
'otherInfo'
,
type
:
'upload'
limit
:
1
,
imgList
:
[]
}
]
}
},
methods
:
{}
methods
:
{
beforeAvatarUpload
(
e
)
{
let
AllImgExt
=
'.zip|.rar|.png|.jpg'
let
extName
=
e
.
name
.
substring
(
e
.
name
.
lastIndexOf
(
'.'
)).
toLowerCase
()
if
(
AllImgExt
.
indexOf
(
extName
)
===
-
1
)
{
this
.
$message
.
error
(
'上传格式不正确'
)
return
false
}
const
size
=
e
.
size
/
1024
/
1024
if
(
size
>
9
)
{
this
.
$message
.
error
(
'上传文件不可超过9M'
)
return
false
}
},
httpRequest
({
file
:
e
},
fieldName
)
{
console
.
log
(
e
,
456
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
)
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
const
targetNameList
=
e
.
name
.
split
(
'.'
)
const
fileInfo
=
targetNameList
[
targetNameList
.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
this
.
$apis
.
ghBeforeSale
.
uploadImgApi
({
file
:
fileInfo
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
let
targetItem
=
this
.
materialData
.
find
(
item
=>
item
.
name
===
fieldName
)
targetItem
.
imgList
.
push
(
res
)
this
.
fieldInfo
[
fieldName
].
push
(
e
.
uid
)
}
else
{
this
.
handleRemove
(
e
,
fieldName
,
1
)
}
})
}
},
handleRemove
(
e
,
fieldName
,
isDel
)
{
if
(
isDel
)
{
let
id
=
this
.
$refs
[
fieldName
+
'Ref'
][
0
].
uploadFiles
.
findIndex
(
item
=>
item
.
uid
===
e
.
uid
)
this
.
$refs
[
fieldName
+
'Ref'
][
0
].
uploadFiles
.
splice
(
id
,
1
)
}
else
{
console
.
log
(
this
.
fieldInfo
[
fieldName
],
e
.
uid
)
let
targetId
=
this
.
fieldInfo
[
fieldName
].
findIndex
(
item
=>
item
===
e
.
uid
)
console
.
log
(
targetId
)
}
},
handlePictureCardPreview
(
file
)
{
this
.
dialogImageUrl
=
file
.
url
this
.
dialogVisible
=
true
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
/
deep
/
.hidePlusBtn
{
.el-upload--picture-card
{
display
:
none
;
}
}
.report-components
{
background
:
white
;
.title
{
...
...
src/views/claims/components/repair.vue
View file @
86f2d00
...
...
@@ -30,9 +30,9 @@
</div>
<div
class=
"account-info"
>
<glsx-combi-form
ref=
"accountRef"
:formRules=
"accountRule"
labelWidth=
"144px"
defaultWidth=
"320px"
:formObj=
"accountForm"
:formData=
"accountData"
>
<template
slot=
"collectCity"
>
<
!--
<
template
slot=
"collectCity"
>
<city-select
@
onChange=
"selectAddress"
></city-select>
</
template
>
</
template
>
-->
</glsx-combi-form>
</div>
</div>
...
...
@@ -41,7 +41,6 @@
</template>
<
script
type=
"text/ecmascript-6"
>
import
citySelect
from
'./citySelect.vue'
import
glsxCombiForm
from
'@/components/glsx-combi-form'
const
phoneReg
=
/^
(
13
[
0-9
]
|15
[
0-9
]
|16
[
0-9
]
|17
[
0-9
]
|18
[
0-9
]
|19
[
0-9
]
|14
[
0-9
])[
0-9
]{8}
$/
export
default
{
...
...
@@ -51,7 +50,6 @@ export default {
},
components
:
{
glsxCombiForm
,
citySelect
,
},
data
()
{
return
{
...
...
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