Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
c1f7aded
Commit
c1f7aded
authored
Dec 04, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] add import manual inport excel
parent
3bb9aedf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
131 additions
and
21 deletions
+131
-21
vat-report-view.ctrl.js
...p/common/controls/vat-report-view/vat-report-view.ctrl.js
+99
-19
vat-report-view.html
.../app/common/controls/vat-report-view/vat-report-view.html
+32
-1
vat-report-view.less
.../app/common/controls/vat-report-view/vat-report-view.less
+0
-1
No files found.
atms-web/src/main/webapp/app/common/controls/vat-report-view/vat-report-view.ctrl.js
View file @
c1f7aded
...
...
@@ -16,6 +16,7 @@
$scope
.
voucherComments
=
""
;
$scope
.
voucherFileName
=
""
;
$scope
.
voucherFileID
=
""
;
$scope
.
manualSpread
=
{};
//Notice: ************************************
//$scope.templateCode, $scope.reportId, $scope.initRow, $scope.initCol等都是外部传递进来的数据。
...
...
@@ -1484,7 +1485,7 @@
};
//单元格详细信息点击确定时执行
$scope
.
c
onfirm
=
function
()
{
$scope
.
C
onfirm
=
function
()
{
$scope
.
handInputModel
.
name
=
$scope
.
taxCellDetail
.
inputMemo
;
$scope
.
handInputModel
.
amount
=
$scope
.
taxCellDetail
.
inputValue
;
$scope
.
handInputModel
.
description
=
$scope
.
taxCellDetail
.
inputMemo
;
...
...
@@ -1516,6 +1517,9 @@
return
$q
.
reject
();
};
$scope
.
saveReportCache
=
function
()
{
if
(
!
$scope
.
reportData
)
{
return
$q
.
reject
();
...
...
@@ -2674,28 +2678,104 @@
$log
.
debug
(
text
);
if
(
text
==
'海关专用缴款书'
||
text
==
'代扣代缴税收通用缴款书取数'
){
var
excelIo
=
new
GC
.
Spread
.
Excel
.
IO
();
var
excelFilePath
=
'resources/Excel/importExcel.xlsx'
;
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'GET'
,
excelFilePath
,
true
);
xhr
.
responseType
=
'blob'
;
xhr
.
onload
=
function
(
e
)
{
if
(
this
.
status
==
200
)
{
// get binary data as a response
var
blob
=
this
.
response
;
// convert Excel to JSON
excelIo
.
open
(
blob
,
function
(
json
)
{
var
workbookObj
=
json
;
spread
.
fromJSON
(
workbookObj
);
},
function
(
e
)
{
// process error
alert
(
e
.
errorMessage
);
},
{});
}
};
$
(
"#importExcellFile"
).
modal
(
'show'
);
}
else
{
SweetAlert
.
warning
(
"仅支持海关专用缴款书或代扣代缴税收通用缴款书取数"
);
}
};
$scope
.
loadMyExcel
=
function
(){
$scope
.
manualSpread
=
new
GC
.
Spread
.
Sheets
.
Workbook
(
document
.
getElementById
(
"ss"
),{
sheetCount
:
1
});
var
excelIo
=
new
GC
.
Spread
.
Excel
.
IO
();
var
excelFile
=
document
.
getElementById
(
"fileDemo"
).
files
[
0
];
excelIo
.
open
(
excelFile
,
function
(
json
)
{
var
workbookObj
=
json
;
$scope
.
manualSpread
.
fromJSON
(
workbookObj
);
},
function
(
e
)
{
alert
(
e
.
errorMessage
);
if
(
e
.
errorCode
===
2
/*noPassword*/
||
e
.
errorCode
===
3
/*invalidPassword*/
)
{
document
.
getElementById
(
'password'
).
onselect
=
null
;
}
},
{
});
};
$scope
.
multiWrite
=
function
(){
var
manualSheet
=
$scope
.
manualSpread
.
getActiveSheet
();
var
currentSheet
=
$scope
.
spread
.
getActiveSheet
()
currentSheet
.
options
.
isProtected
=
false
;
for
(
var
rowIndex
=
0
;
rowIndex
<
currentSheet
.
getRowCount
();
rowIndex
++
)
{
for
(
var
columnIndex
=
0
;
columnIndex
<
currentSheet
.
getColumnCount
();
columnIndex
++
)
{
var
tagInfo
=
currentSheet
.
getTag
(
rowIndex
,
columnIndex
);
if
(
tagInfo
)
{
var
jsonTagInfo
=
JSON
.
parse
(
tagInfo
);
if
(
jsonTagInfo
.
isReadOnly
)
continue
;
var
cellValue
=
manualSheet
.
getValue
(
rowIndex
,
columnIndex
);
if
(
typeof
(
cellValue
)
==
"string"
)
cellValue
=
cellValue
.
trim
();
var
r
=
/^00
\d
*|^
\.\d
+|
\.
$/
;
if
(
typeof
cellValue
==
"undefined"
||
cellValue
==
null
||
cellValue
==
""
||
cellValue
==
"NaN"
)
continue
;
if
(
cellValue
&&
(
isNaN
(
cellValue
)
||
r
.
test
(
cellValue
)))
{
SweetAlert
.
warning
(
$translate
.
instant
(
'CheckInputValueFormat'
));
return
;
}
else
if
(
cellValue
&&
parseFloat
(
cellValue
).
toFixed
(
2
)
>
9999999999999
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
'CheckInputValueLength'
));
return
;
}
cellValue
=
jsonTagInfo
.
dataType
===
5
?
parseInt
(
cellValue
):
parseFloat
(
cellValue
).
toFixed
(
2
);
var
handInputModel
=
{
cellID
:
jsonTagInfo
.
cellID
,
cellTemplateID
:
jsonTagInfo
.
cellTemplateID
,
reportID
:
jsonTagInfo
.
reportID
,
amount
:
cellValue
};
$scope
.
myConfirm
(
handInputModel
);
}
}
}
};
$scope
.
myConfirm
=
function
(
handInputModel
)
{
handInputModel
.
projectID
=
vatSessionService
.
project
.
id
;
handInputModel
.
serviceTypeID
=
vatSessionService
.
project
.
serviceTypeID
;
handInputModel
.
period
=
vatSessionService
.
month
;
if
(
handInputModel
.
amount
||
handInputModel
.
name
)
{
//日志对象
logDto
.
ID
=
PWC
.
newGuid
();
logDto
.
CreateTime
=
new
Date
();
logDto
.
UpdateTime
=
new
Date
();
logDto
.
OperationContent
=
"Amount: "
+
handInputModel
.
amount
+
"; Description: "
+
handInputModel
.
description
;
logDto
.
OperationName
=
$translate
.
instant
(
'ManualInputDataSource'
);
logDto
.
Comment
=
comment
+
"(Cell ID:"
+
handInputModel
.
cellID
+
", Cell Template ID:"
+
handInputModel
.
cellTemplateID
+
")"
;
logDto
.
OperationType
=
enums
.
vatLogOperationTypeEnum
.
RV_ManualInput
;
// 前端保存数据
return
vatReportService
.
addCellManualData
(
handInputModel
,
logDto
).
then
(
function
(
manualData
)
{
var
obj
=
manualData
.
data
.
data
;
obj
.
dataSourceType
=
manualData
.
dataSourceType
;
$scope
.
updateCellByManualChange
(
obj
);
return
$q
.
when
();
});
}
return
$q
.
reject
();
};
$scope
.
cleanManual
=
function
(){
$scope
.
manualSpread
=
new
GC
.
Spread
.
Sheets
.
Workbook
(
document
.
getElementById
(
"ss"
),{
sheetCount
:
1
});
$
(
'#ss'
).
html
(
''
);
document
.
getElementById
(
"fileDemo"
).
value
=
""
;
};
/****************************************证据文件function Ended*************************************************/
/****************************************证据文件function Ended*************************************************/
/****************************************证据文件function Ended*************************************************/
...
...
atms-web/src/main/webapp/app/common/controls/vat-report-view/vat-report-view.html
View file @
c1f7aded
...
...
@@ -7,11 +7,13 @@
<span
ng-if=
"!isBSPL"
ng-click=
"doApprove();"
><i
class=
"fa fa-floppy-o"
></i>
{{'报表审批'}}
</span>
<span
ng-if=
"!isBSPL"
ng-click=
"upLoadManual();"
><i
class=
"fa fa-floppy-o"
></i>
{{'上传手工数据'}}
</span>
class=
"fa fa-floppy-o"
></i>
{{'上传手工数据'}}
</span>
<!--<span ng-if="!isBSPL" ng-click="saveReportCache();"><i-->
<!--class="fa fa-floppy-o"></i> {{'Save' | translate}}</span>-->
</div>
<div
class=
'report-container'
id=
"reportContainer"
>
<vat-report-sheet
id=
'report-view'
report-source=
"reportData"
formula-blocks=
"formulaBlocks"
is-read-only=
"!isDocumentList"
...
...
@@ -186,4 +188,32 @@
</div>
</div>
</div>
<div
class=
"modal fade"
id=
"importExcellFile"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModal"
data-backdrop=
"static"
data-keyboard=
"false"
>
<div
class=
"modal-dialog"
style=
"width:850px;height:500px"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<span
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
ng-click=
"closeModal()"
>
×
</span>
<span>
批量录入手工数据
</span>
</div>
<br/>
<div
class=
"row"
style=
"margin-left:12px; margin-right:12px;width:850px;height:500px"
>
<div
id=
"ss"
class=
"sample-spreadsheets"
style=
"height:100%;width:100%"
></div>
</div>
<div
class=
"row"
style=
"margin-left:12px; margin-right:12px;"
>
<div
class=
"col-lg-12 col-md-12 col-sm-12"
>
<div
class=
"inputContainer"
>
<input
type=
"file"
id=
"fileDemo"
class=
"btn btn-sm"
name=
"选择文件"
>
<input
type=
"button"
id=
"loadExcel"
value=
"加载文件"
class=
"btn btn-sm"
ng-click=
"loadMyExcel()"
>
<button
class=
"btn btn-sm"
ng-click=
"multiWrite()"
>
批量录入
</button>
<button
class=
"btn btn-sm"
ng-click=
"cleanManual()"
>
清空
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
atms-web/src/main/webapp/app/common/controls/vat-report-view/vat-report-view.less
View file @
c1f7aded
...
...
@@ -7,7 +7,6 @@
height: calc(~"100% - 20px");
min-height: 500px;
margin: 10px 10px 10px 20px;
.report-container {
border: @thin-border solid @color-border;
height: calc(~"100% - 36px");
...
...
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