Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-activity-center
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 3dc9d88e
authored
Jan 03, 2023
by
李伟康
Committed by
chenwq
Jan 09, 2023
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
众筹订单增加导入
1 parent
64c770a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
158 additions
and
7 deletions
src/api/modules/orderManage.js
src/views/orderManage/index.vue
src/api/modules/orderManage.js
View file @
3dc9d88
...
...
@@ -187,4 +187,16 @@ const batchRefundOrder = params => {
})
}
export
default
{
getInstallInfo
,
orderVerfication
,
signerOrder
,
getListApi
,
getCountApi
,
getOrderDetailApi
,
orderExportApi
,
writeOffApi
,
crowdFundWriteOffApi
,
crowdFundRefundApi
,
addDeliveryApi
,
examineDetailApi
,
examineAllowApi
,
confirmReceiptGoodsApi
,
updateOrderType
,
batchRefundOrder
}
/**导入众筹订单 */
const
importCrowdFundingOrder
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.weapp.crowdFunding.order.import'
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
export
default
{
getInstallInfo
,
orderVerfication
,
signerOrder
,
getListApi
,
getCountApi
,
getOrderDetailApi
,
orderExportApi
,
writeOffApi
,
crowdFundWriteOffApi
,
crowdFundRefundApi
,
addDeliveryApi
,
examineDetailApi
,
examineAllowApi
,
confirmReceiptGoodsApi
,
updateOrderType
,
batchRefundOrder
,
importCrowdFundingOrder
}
src/views/orderManage/index.vue
View file @
3dc9d88
...
...
@@ -27,12 +27,20 @@
</
template
>
</el-tabs>
</div>
<el-button
class=
"default-blue-btn"
:size=
"size"
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
<div
class=
"btn-group"
>
<el-button
class=
"default-blue-btn"
:size=
"size"
type=
"default"
@
click=
"importVisible = true"
>
导入
</el-button>
<el-button
class=
"default-blue-btn"
:size=
"size"
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
</div>
</div>
</div>
<!-- 表格区域 - 全部订单/售后订单 - 开始 -->
...
...
@@ -461,6 +469,52 @@
</div>
</GLTable>
</GLDialog>
<!-- 导入 -->
<GLDialog
mode=
"mid"
class=
"import-dialog"
title=
"上传文件"
:visible
.
sync=
"importVisible"
@
onCancel=
"importVisible = !importVisible"
@
onOk=
"importFun"
>
<div
class=
"gl-form-page gl-form-min"
>
<el-form
ref=
"form"
label-width=
"154px"
>
<el-form-item
label=
"导入文件:"
>
<div
class=
"flex"
>
<el-input
v-model=
"file.fileName"
readonly
></el-input>
<div
class=
"import-button"
>
<el-button
class=
"default-btn"
:size=
"size"
type=
"default"
>
导入文件
<input
type=
"file"
class=
"upload-input"
accept=
".xlsx, .xls"
@
change=
"e => handleXlsxChange(e)"
/>
</el-button>
<el-button
class=
"download-btn"
type=
"text"
@
click=
"downloadXlsx"
>
模版下载
</el-button>
</div>
</div>
</el-form-item>
</el-form>
</div>
</GLDialog>
</div>
</template>
...
...
@@ -1213,6 +1267,11 @@ export default {
}
]
},
importVisible
:
false
,
file
:
{
fileName
:
''
,
fileType
:
''
}
}
},
...
...
@@ -1628,6 +1687,54 @@ export default {
})
this
.
searchForm
.
requestSource
!=
0
?
this
.
handleSearch
()
:
this
.
$refs
.
allOrderRef
.
refreshTable
(
false
)
}
},
handleXlsxChange
(
e
)
{
console
.
log
(
e
)
this
.
$notify
({
title
:
'提示'
,
message
:
'文件上传中,请稍后'
})
var
[
file
]
=
e
.
srcElement
.
files
var
reader
=
new
FileReader
()
// 默认1MB
this
.
file
.
fileName
=
file
.
name
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
el
=>
{
const
imgFile
=
el
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
const
splitStr
=
file
.
name
.
split
(
'.'
)
this
.
file
.
fileType
=
splitStr
[
splitStr
.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
console
.
log
(
el
)
}
},
importFun
()
{
let
{
file
:
{
fileType
,
fileName
}
}
=
this
if
(
fileType
)
this
.
$apis
.
orderManage
.
importCrowdFundingOrder
({
file
:
fileType
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
$notify
({
title
:
'提示'
,
message
:
'订单导入成功'
,
type
:
'success'
})
this
.
searchForm
.
requestSource
!=
0
?
this
.
handleSearch
()
:
this
.
$refs
.
allOrderRef
.
refreshTable
(
false
)
}
})
else
this
.
$message
.
error
(
fileName
?
'文件上传中,请稍后'
:
'请上传文件后,在点击确定'
)
},
downloadXlsx
()
{
var
alink
=
document
.
createElement
(
'a'
)
alink
.
href
=
'//img02.glsx.com.cn/weapp/resource/saas/scrm/xlsx/订单导入模板.xlsx'
alink
.
setAttribute
(
'target'
,
'_blank'
)
alink
.
download
=
'订单导入模板.xlsx'
alink
.
click
()
alink
.
remove
()
}
}
}
...
...
@@ -1757,4 +1864,36 @@ export default {
.el-select
.el-tag
{
max-width
:
60%
!important
;
}
.import-dialog
{
.el-dialog__body
{
height
:
70px
!important
;
min-height
:
70px
!important
;
max-height
:
70px
!important
;
}
.import-button
{
position
:
relative
;
margin-left
:
10px
;
cursor
:
pointer
;
.upload-input
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
88px
;
height
:
100%
;
opacity
:
0
;
z-index
:
1
;
cursor
:
pointer
!important
;
}
}
.download-btn
{
position
:
absolute
;
top
:
110%
;
right
:
0
;
}
}
.btn-group
{
.el-button
+
.el-button
{
margin-left
:
8px
;
}
}
</
style
>
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