Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-file-upload
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 8f2cde0e
authored
Feb 17, 2022
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
完成接口对接
1 parent
8e7d60a7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
263 additions
and
103 deletions
src/api/entmicroApi.js
src/api/index.js
src/api/upload.js
src/config/index.js
src/store/modules/app.js
src/views/services/index.vue
src/views/upload/index.vue
src/api/entmicroApi.js
deleted
100644 → 0
View file @
8e7d60a
const
url
=
'/rop-scrm-entmicro/router'
export
default
{
/**引流获客列表 */
getEntmicroChannelCodeList
(
data
)
{
data
.
method
=
'entmicro.api.code.listEntmicroChannelCodeList'
return
window
.
$HTTP
({
url
,
data
,
returnAll
:
true
})
},
/**变更客户信息 */
editCustomer
(
data
)
{
data
.
method
=
'entmicro.api.customer.editcustomer'
return
window
.
$HTTP
({
url
,
data
,
})
},
}
src/api/index.js
View file @
8f2cde0
...
...
@@ -12,7 +12,7 @@ import wxConfig from './wxConfig'
import
liveBroadcast
from
'./liveBroadcast'
import
groupCustomer
from
'./groupCustomer'
import
groupTag
from
'./groupTag'
import
entmicroApi
from
'./entmicroApi
'
import
upload
from
'./upload
'
import
detailApi
from
'./detail'
import
vehicle
from
'./vehicle'
...
...
@@ -23,7 +23,7 @@ export {
liveBroadcast
,
groupCustomer
,
groupTag
,
entmicroApi
,
upload
,
detailApi
,
vehicle
}
\ No newline at end of file
src/api/upload.js
0 → 100644
View file @
8f2cde0
const
url
=
'/rop-scrm-equity/router'
export
default
{
/**获取员工销售的无忧卡订单列表 */
orderListApi
(
data
)
{
data
.
method
=
'scrm.api.equity.service.h5.service.order.get'
return
window
.
$HTTP
({
url
,
data
,
returnAll
:
true
})
},
/**获取列表总数 */
orderCountApi
(
data
){
data
.
method
=
'scrm.api.equity.service.h5.service.order.dataprefection.count'
return
window
.
$HTTP
({
url
,
data
,
returnAll
:
true
})
},
/**获取附件值 */
fileDataApi
(
data
)
{
data
.
method
=
'scrm.api.equity.service.package.order.attachments.value.get.multiple'
return
window
.
$HTTP
({
url
,
data
,
returnAll
:
true
})
},
/**获取附件信息 */
fileInfoApi
(
data
)
{
data
.
method
=
'scrm.api.equity.service.package.order.attachment.get'
return
window
.
$HTTP
({
url
,
data
,
returnAll
:
true
})
},
/**上传附件 */
uploadFileApi
(
data
)
{
data
.
method
=
'scrm.api.equity.service.order.attachment.add'
return
window
.
$HTTP
({
url
,
data
,
returnAll
:
true
})
},
/**删除附件 */
deleteFileApi
(
data
)
{
data
.
method
=
'scrm.api.equity.service.order.attachment.delete'
return
window
.
$HTTP
({
url
,
data
,
returnAll
:
true
})
},
/**上传图片 */
uploadImageApi
(
data
){
data
.
method
=
'scrm.api.equity.common.upload.image'
return
window
.
$HTTP
({
url
,
data
,
returnAll
:
true
,
sign
:
true
,
noSignAttr
:
[
'file'
],
})
}
}
src/config/index.js
View file @
8f2cde0
...
...
@@ -15,7 +15,7 @@ export const fetchConfig = function(isEnv = true) {
Object
.
assign
(
request
,
{
timeout
})
return
Promise
.
resolve
(
config
)
}
return
window
.
fetch
(
'https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-
customer
-config'
,
{}).
then
(
res
=>
res
.
json
())
return
window
.
fetch
(
'https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-
file-upload
-config'
,
{}).
then
(
res
=>
res
.
json
())
}
export
const
cfg
=
{
install
(
vue
,
config
)
{
...
...
src/store/modules/app.js
View file @
8f2cde0
...
...
@@ -152,7 +152,8 @@ const actions = {
state
.
showWindow
=
true
},
registerHttp
({},
sessionId
=
''
)
{
window
.
$HTTP
=
new
Http
({
...
window
.
$fetchConfig
,
alert
:
Notify
,
headers
:
{
token
:
sessionId
}
})
// window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
window
.
$HTTP
=
new
Http
({
...
window
.
$fetchConfig
,
alert
:
Notify
,
headers
:
{
token
:
'710c3866-90c9-47fb-9161-b702b7f262ad'
}
})
}
}
const
getParams
=
name
=>
{
...
...
src/views/services/index.vue
View file @
8f2cde0
...
...
@@ -13,27 +13,28 @@
<div
class=
"list_widget"
>
<scroll-view
class=
"content"
@
ReachBottom=
"onReachBottom"
ref=
"scrollView"
>
<template
v-for=
"(item, index) in serviceList"
>
<div
:key=
"index"
class=
"box_wrapper"
@
click=
"jumpPage"
>
<div
:key=
"index"
class=
"box_wrapper"
@
click=
"jumpPage
(item)
"
>
<div
class=
"header_pannel flex_scb"
>
<span
class=
"title text_hide"
>
客户名称
</span>
<p
class=
"status"
:class=
"
{ other_color: i
ndex % 2 == 0
}">
<span
class=
"point"
:style=
"
{ background: i
ndex % 2 == 0
? '#3975C6' : '' }">
</span>
{{
i
ndex
%
2
==
0
?
'已完成'
:
'待上传'
}}
<span
class=
"title text_hide"
>
{{
item
.
customerName
}}
</span>
<p
class=
"status"
:class=
"
{ other_color: i
tem.dataPerfection==1
}">
<span
class=
"point"
:style=
"
{ background: i
tem.dataPerfection==1
? '#3975C6' : '' }">
</span>
{{
i
tem
.
dataPerfection
==
1
?
'已完成'
:
'待上传'
}}
</p>
</div>
<div
class=
"main_pannel"
>
<img
v-if=
"index % 2"
class=
"iconCover"
:src=
"imgBase + 'unActive_v.png'"
/>
<img
v-if=
"item.packageName=='优享版'"
class=
"iconCover"
:src=
"imgBase + 'version_2.png'"
/>
<img
v-else-if=
"item.packageName=='舒享版'"
class=
"iconCover"
:src=
"imgBase + 'version_3.png'"
/>
<img
v-else
class=
"iconCover"
:src=
"imgBase + 'active_v.png'"
/>
<div
class=
"info_wrap"
>
<p>
联系方式:
1806446816
</p>
<p>
车辆品牌:
奔驰
</p>
<p>
车辆型号:
2022款2022款2022款2022款2022款2022款2022款
</p>
<p>
车架号码:
LASDLSDKLSDLS
</p>
<p>
联系方式:
{{
item
.
customerPhone
}}
</p>
<p>
车辆品牌:
{{
item
.
vehicleBrandName
}}
</p>
<p>
车辆型号:
{{
item
.
vehicleShapeName
}}
</p>
<p>
车架号码:
{{
item
.
vin
}}
</p>
</div>
</div>
<div
class=
"footer_pannel flex_scb"
>
<span>
时间:
2021/8/21
</span>
<span>
{{
i
ndex
%
2
==
0
?
'查看详情'
:
'去上传'
}}
>>
</span>
<span>
时间:
{{
item
.
successDate
}}
</span>
<span>
{{
i
tem
.
dataPerfection
==
1
?
'查看详情'
:
'去上传'
}}
>>
</span>
</div>
</div>
</
template
>
...
...
@@ -44,7 +45,7 @@
<
script
>
import
ScrollView
from
'../../components/ScrollView.vue'
// import make from './make.vue'
// import { groupTag, ssoApi, groupCustomer, wxConfig
} from '@/api'
import
{
upload
}
from
'@/api'
// import { Toast } from 'vant'
const
baseImg
=
'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/'
export
default
{
...
...
@@ -70,29 +71,88 @@ export default {
],
currentTabIndex
:
0
,
imgBase
:
baseImg
,
serviceList
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
]
serviceList
:
[],
paramForm
:{
pageSize
:
10
,
pageNum
:
1
,
}
}
},
created
()
{},
mounted
()
{
console
.
log
(
new
Date
());
this
.
getOrderCount
()
this
.
getServicesList
()
},
methods
:
{
// 获取列表总数
getOrderCount
(
queryText
){
let
para
=
{}
if
(
queryText
){
para
.
queryText
=
queryText
}
else
{
para
=
{}
}
upload
.
orderCountApi
(
para
).
then
(
res
=>
{
const
{
finished
,
total
,
unfinished
}
=
res
.
data
this
.
tabs
[
0
].
num
=
total
this
.
tabs
[
1
].
num
=
unfinished
this
.
tabs
[
2
].
num
=
finished
})
},
// 获取列表数据
getServicesList
(){
upload
.
orderListApi
(
this
.
paramForm
).
then
(
res
=>
{
let
{
code
,
data
}
=
res
if
(
code
!=
0
){
return
}
data
.
list
.
map
(
item
=>
{
item
.
successDate
=
new
Date
(
item
.
successDate
).
format
(
'yyyy/MM/dd'
)
return
item
})
if
(
this
.
paramForm
.
pageNum
==
1
){
this
.
serviceList
=
data
.
list
}
else
{
data
.
list
.
forEach
(
item
=>
{
this
.
serviceList
.
push
(
item
)
})
}
if
((
data
.
list
.
length
<
this
.
paramForm
.
pageSize
)
&&
this
.
serviceList
.
length
){
this
.
$refs
.
scrollView
.
finished
=
true
}
this
.
$refs
.
scrollView
.
loading
=
false
})
},
search
(
e
)
{
console
.
log
(
e
)
this
.
paramForm
.
queryText
=
e
if
(
!
e
){
delete
this
.
paramForm
.
queryText
}
this
.
getServicesList
()
this
.
getOrderCount
(
e
)
},
changeTab
(
e
)
{
this
.
currentTabIndex
=
e
let
dataPerfection
=
e
==
2
?
1
:
e
==
1
?
0
:
3
this
.
paramForm
.
dataPerfection
=
dataPerfection
if
(
dataPerfection
==
3
){
delete
this
.
paramForm
.
dataPerfection
}
this
.
getServicesList
()
},
onReachBottom
()
{
console
.
log
(
'触底'
)
this
.
$refs
.
scrollView
.
loading
=
false
this
.
$refs
.
scrollView
.
finished
=
true
this
.
paramForm
.
pageNum
++
this
.
getServicesList
()
// this.$refs.scrollView.loading = false
// this.$refs.scrollView.finished = true
},
jumpPage
()
{
jumpPage
(
item
)
{
this
.
$router
.
push
({
name
:
'upload'
,
params
:
{}
params
:
{
packageCode
:
item
.
packageCode
,
contractNo
:
item
.
contractNo
,
}
})
}
}
...
...
src/views/upload/index.vue
View file @
8f2cde0
<
template
>
<div
class=
"contaienr"
>
<div
class=
"upload_box_wrapper"
>
<div
class=
"title flex_scb"
>
<span
class=
"require"
>
*
</span>
<span>
个人客户身份证/单位客户营业执照
</span>
<template
v-for=
"(item, index) in uploadList"
>
<div
:key=
"index"
class=
"upload_box_wrapper"
>
<div
class=
"title flex_scb"
>
<span
v-if=
"item.required"
class=
"require"
>
*
</span>
<span>
{{
item
.
attachmentName
}}
</span>
</div>
<div
class=
"main_pannel"
@
click=
"toClickUpoload(item)"
>
<van-uploader
v-if=
"loadingFinish"
:before-delete=
"beforeDelete"
:after-read=
"afterRread"
preview-size=
"102px"
v-model=
"fileURL[item.attachmentCode]"
max-count=
"4"
>
<div
class=
"box_wrap flex_ccc"
style=
"width:102px;height:102px"
>
<van-icon
name=
"add-o"
size=
"20px"
color=
"#999999"
/>
<p>
添加
</p>
</div>
</van-uploader>
</div>
</div>
<div
class=
"main_pannel"
>
<van-uploader
:after-read=
"afterRread1"
preview-size=
"102px"
v-model=
"fileList1"
multiple
:max-count=
"6"
>
<div
class=
"box_wrap flex_ccc"
>
<van-icon
name=
"add-o"
size=
"20px"
color=
"#999999"
/>
<p>
添加
</p>
</div>
</van-uploader>
</div>
</div>
<div
class=
"upload_box_wrapper"
>
<div
class=
"title flex_scb"
>
<span
class=
"require"
>
*
</span>
<span>
新车发票
</span>
</div>
<div
class=
"main_pannel"
>
<van-uploader
:after-read=
"afterRread2"
preview-size=
"102px"
v-model=
"fileList2"
multiple
:max-count=
"6"
>
<div
class=
"box_wrap flex_ccc"
>
<van-icon
name=
"add-o"
size=
"20px"
color=
"#999999"
/>
<p>
添加
</p>
</div>
</van-uploader>
</div>
</div>
<div
class=
"upload_box_wrapper"
>
<div
class=
"title flex_scb"
>
<span
class=
"require"
>
*
</span>
<span>
合同变更书
</span>
</div>
<div
class=
"main_pannel"
>
<van-uploader
:after-read=
"afterRread3"
preview-size=
"102px"
v-model=
"fileList3"
multiple
:max-count=
"6"
>
<div
class=
"box_wrap flex_ccc"
>
<van-icon
name=
"add-o"
size=
"20px"
color=
"#999999"
/>
<p>
添加
</p>
</div>
</van-uploader>
</div>
</div>
</
template
>
</div>
</template>
<
script
>
import
{
upload
}
from
'@/api'
const
baseImg
=
'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/'
export
default
{
data
()
{
return
{
imgBase
:
baseImg
,
fileList1
:
[],
fileList2
:
[],
fileList3
:
[]
fileList
:
[
{
url
:
'http://qcimg01.glsx.com.cn/group1/M00/00/6F/wKgD3mINtxWAV8xYAAF0Ps_hc1c683.png'
,
isImage
:
true
}
],
uploadList
:
[],
fileURL
:
{},
loadingFinish
:
false
}
},
name
:
'upload'
,
created
()
{},
mounted
()
{},
mounted
()
{
const
packageCode
=
this
.
$route
.
params
.
packageCode
const
contractNo
=
this
.
$route
.
params
.
contractNo
this
.
getFileInof
(
packageCode
,
contractNo
)
this
.
contractNo
=
contractNo
this
.
packageCode
=
packageCode
},
methods
:
{
afterRread1
(
file
)
{
console
.
log
(
file
);
// 获取附件信息
getFileInof
(
packageCode
,
contractNo
)
{
upload
.
fileInfoApi
({
packageCode
}).
then
(
res
=>
{
this
.
uploadList
=
res
.
data
this
.
getFileValue
(
contractNo
,
res
.
data
)
})
},
// 获取附件信息的值
getFileValue
(
contractNo
,
list
)
{
upload
.
fileDataApi
({
contractNo
}).
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
this
.
fileURL
=
{}
res
.
data
.
forEach
(
el
=>
{
list
.
forEach
(
item
=>
{
if
(
el
.
attachmentCode
===
item
.
attachmentCode
)
{
let
name
=
`
${
item
.
attachmentCode
}
`
let
newArr
=
[]
el
.
attachmentFiles
.
forEach
(
str
=>
{
let
temp
=
{
url
:
str
,
isImage
:
true
}
newArr
.
push
(
temp
)
})
let
obj
=
{
[
name
]:
newArr
}
this
.
fileURL
=
Object
.
assign
(
this
.
fileURL
,
obj
)
}
})
})
this
.
loadingFinish
=
true
}
})
},
// 获取当前点击的位置
toClickUpoload
(
item
)
{
this
.
currentItem
=
item
},
afterRread
(
file
,
e
)
{
this
.
uploadImage
(
file
)
},
afterRread2
(
file
)
{
console
.
log
(
file
)
beforeDelete
(
file
,
e
)
{
this
.
currentDelImg
=
file
.
url
this
.
deleteFile
()
},
// 上传图片
uploadImage
(
file
)
{
const
imgFile
=
file
.
content
const
base64
=
file
.
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
let
para
=
{
file
:
base64
,
fileType
:
'image'
}
upload
.
uploadImageApi
(
para
).
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
this
.
uploadFile
(
res
.
data
)
}
})
},
afterRread3
(
file
)
{
console
.
log
(
file
)
// 上传附件
uploadFile
(
url
)
{
let
para
=
{
contractNo
:
this
.
contractNo
,
attachmentCode
:
this
.
currentItem
.
attachmentCode
,
attachmentType
:
this
.
currentItem
.
attachmentType
,
attachmentFile
:
url
}
upload
.
uploadFileApi
(
para
).
then
(
res
=>
{
this
.
getFileInof
(
this
.
packageCode
,
this
.
contractNo
)
})
},
deleteImg1
(
file
)
{
console
.
log
(
file
)
const
name
=
file
.
name
let
newArr
=
this
.
fileList1
.
filter
(
item
=>
{
return
item
.
file
.
name
!=
name
// 删除附件
deleteFile
()
{
let
para
=
{
contractNo
:
this
.
contractNo
,
attachmentFile
:
this
.
currentDelImg
}
upload
.
deleteFileApi
(
para
).
then
(
res
=>
{
this
.
getFileInof
(
this
.
packageCode
,
this
.
contractNo
)
})
this
.
fileList1
=
newArr
}
}
}
...
...
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