Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rbc-demo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
rbc-demo
Commits
2e32e3bf
Commit
2e32e3bf
authored
May 18, 2022
by
Joey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(@gms/gms-plugin-billexpand): 导入excel按钮
parent
4f946b27
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
emcon.js
develop/@gms/gms-plugin-billexpand/src/emcon.js
+18
-0
mcon.js
develop/@gms/gms-plugin-billexpand/src/mcon.js
+2
-0
importExcel.js
...ms/gms-plugin-billexpand/src/query-actions/importExcel.js
+41
-0
No files found.
develop/@gms/gms-plugin-billexpand/src/emcon.js
View file @
2e32e3bf
...
...
@@ -1306,6 +1306,24 @@ export default {
"title"
:
"导出Excel"
},
{
"value"
:
"importExcel"
,
"discard"
:
false
,
"path"
:
"云报销"
,
"extends"
:
{
"paramDes"
:
[
{
"isRequired"
:
true
,
"ref"
:
"bill"
,
"type"
:
"metaData"
,
"title"
:
"billDefine"
,
"key"
:
"billDefine"
},
]
},
"description"
:
"导入Excel"
,
"title"
:
"导入Excel"
},
{
"value"
:
"customDeleteAction"
,
"discard"
:
false
,
"path"
:
"云报销"
,
...
...
develop/@gms/gms-plugin-billexpand/src/mcon.js
View file @
2e32e3bf
...
...
@@ -63,6 +63,7 @@ import createBill from './query-actions/createBill.js';
import
editBill
from
'./query-actions/editBill.js'
;
import
examineAction
from
'./query-actions/examineAction.js'
import
exportExcel
from
'./query-actions/exportExcel.js'
import
importExcel
from
'./query-actions/importExcel.js'
import
createBills
from
'./query-actions/createBills'
import
payment
from
"./query-actions/payments/payment"
;
import
batchPayment
from
"./query-actions/payments/batchPayment"
;
...
...
@@ -198,6 +199,7 @@ export default {
editBill
,
examineAction
,
exportExcel
,
importExcel
,
customDeleteAction
,
createBills
,
batchPayment
,
...
...
develop/@gms/gms-plugin-billexpand/src/query-actions/importExcel.js
0 → 100644
View file @
2e32e3bf
function
popFileSelector
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
input
=
document
.
createElement
(
'input'
)
input
.
value
=
'选择文件'
input
.
type
=
'file'
input
.
onchange
=
event
=>
{
let
file
=
event
.
target
.
files
[
0
]
resolve
(
file
)
};
input
.
click
()
});
}
export
default
{
execute
(
context
,
param
)
{
popFileSelector
().
then
((
res
)
=>
{
const
postParam
=
new
FormData
()
postParam
.
append
(
'file'
,
res
)
postParam
.
append
(
'billDefine'
,
param
.
billDefine
)
window
.
GMS
.
$http
.
post
(
`/rbcquery/importExcelBudgetItems`
,
postParam
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
}
).
then
((
res
)
=>
{
if
(
res
.
data
&&
res
.
data
.
code
==
0
)
{
GMS
.
$hideContainer
.
$Message
.
success
(
`导入成功,共导入
${
res
.
data
.
successNum
}
条`
)
}
else
{
throw
new
Error
()
}
}).
catch
(()
=>
{
GMS
.
$hideContainer
.
$Message
.
error
(
'导入失败'
)
})
})
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment