Commit 6d8f7919 authored by guantiantian's avatar guantiantian

格口文件上传增加是否港澳台参数

parent 40c8d753
...@@ -193,10 +193,10 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule']) ...@@ -193,10 +193,10 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data) success(response.data)
}) })
}, },
uploadExcelFile:function(date1,date2,fd,success){ uploadExcelFile:function(date1,date2,isGAT,fd,success){
$http({ $http({
method: 'POST', method: 'POST',
url: "../ReadExcel/ReadPersonPost?formStartTime="+date1+"&formDeadLine="+date2, url: "../ReadExcel/ReadPersonPost?formStartTime="+date1+"&formDeadLine="+date2+"&isGAT="+isGAT,
data: fd, data: fd,
headers: {'Content-Type': undefined}, headers: {'Content-Type': undefined},
transformRequest: angular.identity transformRequest: angular.identity
......
<style> <style>
.table th, .table td { .table th,
text-align: center; .table td {
vertical-align: middle!important; text-align: center;
} vertical-align: middle !important;
.select2-search__field { }
height:30px; .select2-search__field {
} height: 30px;
.ul li{ }
cursor: pointer; .ul li {
} cursor: pointer;
.page-list .pagination {float:left;} }
.page-list .pagination span {cursor: pointer;} .page-list .pagination {
.page-list .pagination .separate span{cursor: default; border-top:none;border-bottom:none;} float: left;
.page-list .pagination .separate span:hover {background: none;} }
.page-list .page-total {float:left; margin: 25px 20px;} .page-list .pagination span {
.page-list .page-total input, .page-list .page-total select{height: 26px; border: 1px solid #ddd;} cursor: pointer;
.page-list .page-total input {width: 40px; padding-left:3px;} }
.page-list .page-total select {width: 50px;} .page-list .pagination .separate span {
.page-list:after { cursor: default;
display: block; border-top: none;
clear: both; border-bottom: none;
content: "" }
} .page-list .pagination .separate span:hover {
background: none;
}
.page-list .page-total {
float: left;
margin: 25px 20px;
}
.page-list .page-total input,
.page-list .page-total select {
height: 26px;
border: 1px solid #ddd;
}
.page-list .page-total input {
width: 40px;
padding-left: 3px;
}
.page-list .page-total select {
width: 50px;
}
.page-list:after {
display: block;
clear: both;
content: "";
}
.page-list{ .page-list {
zoom: 1 zoom: 1;
} }
</style> </style>
<div class="content row"> <div class="content row">
<div class="col-md-12" style="margin-top:20px;"> <div class="col-md-12" style="margin-top: 20px">
<div class="box"> <div class="box">
<strong class="box-header with-border">异地制证数据量导出</strong> <strong class="box-header with-border">异地制证数据量导出</strong>
<div class="box box-primary"> <div class="box box-primary">
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<td>请选择制证日期:</td> <td>请选择制证日期:</td>
<td> <td>
<div class="input-group date"> <div class="input-group date">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
<input type="text" class="form-control pull-right" ng-model="choseDate" id="strdate" readonly/> <input
</div> type="text"
</td> class="form-control pull-right"
<td> ng-model="choseDate"
<div class="input-group date"> id="strdate"
<div class="input-group-addon"> readonly
<i class="fa fa-calendar"></i> />
</div> </div>
<input type="text" class="form-control pull-right" ng-model="choseDate" id="enddate" readonly/> </td>
</div> <td>
</td> <div class="input-group date">
<td> <div class="input-group-addon">
<div style="float: left"> <i class="fa fa-calendar"></i>
<button class="btn btn-info" ng-click="expUploadInfo()">数据导出</button> </div>
</div> <input
</td> type="text"
</tr> class="form-control pull-right"
</table> ng-model="choseDate"
</div> id="enddate"
</div> readonly
/>
</div>
</td>
<td>
<div style="float: left">
<button class="btn btn-info" ng-click="expUploadInfo()">
数据导出
</button>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="box"> <div class="box">
<strong class="box-header">格口文件上传</strong> <strong class="box-header">格口文件上传</strong>
<div class="box-primary"> <div class="box-primary">
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<td>订单起始日期:</td> <td>订单起始日期:</td>
<td> <td>
<div class="input-group date"> <div class="input-group date">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
<input type="text" <input
class="form-control pull-right" type="text"
ng-model="choseDate" class="form-control pull-right"
id="datepicker1" readonly/> ng-model="choseDate"
</div> id="datepicker1"
</td> readonly
<td> 订单截止日期:</td> />
<td> </div>
<div class="input-group date"> </td>
<div class="input-group-addon"> <td>订单截止日期:</td>
<i class="fa fa-calendar"></i> <td>
</div> <div class="input-group date">
<input type="text" <div class="input-group-addon">
class="form-control pull-right" <i class="fa fa-calendar"></i>
ng-model="choseDate" id="datepicker2" readonly/> </div>
</div> <input
</td> type="text"
</tr> class="form-control pull-right"
<tr> ng-model="choseDate"
<td>选择Excel文件:</td> id="datepicker2"
<td colspan="2"> readonly
<input type="file" />
id="id_file_photo_for_check" </div>
class="file" </td>
data-show-preview="false" </tr>
data-allowed-file-extensions='["XLS","xls","XLSX","xlsx"]' <tr>
multiple/> <td>港澳台:</td>
</td> <td>
<td> <input
<div style="float: left"> type="radio"
<button class="btn btn-primary" ng-click="uploadExcel()">上传</button> ng-model="isGAT"
</div> name="type"
</td> :value="true"
</tr> />
</table> <input
</div> style="margin-left: 10px"
type="radio"
ng-model="isGAT"
name="type"
:value="false"
ng-checked="true"
/>
</td>
<td>选择Excel文件:</td>
<td colspan="2">
<input
type="file"
id="id_file_photo_for_check"
class="file"
data-show-preview="false"
data-allowed-file-extensions='["XLS","xls","XLSX","xlsx"]'
multiple
/>
</td>
<td>
<div style="float: left">
<button class="btn btn-primary" ng-click="uploadExcel()">
上传
</button>
</div>
</td>
</tr>
</table>
</div>
</div> </div>
<div class="box "> <div class="box">
<strong class="box-header with-border">格口文件管理</strong> <strong class="box-header with-border">格口文件管理</strong>
<div class="box box-primary" style="margin-bottom: 0;"> <div class="box box-primary" style="margin-bottom: 0">
<table class="table table-bordered" style="margin-bottom: 0;"> <table class="table table-bordered" style="margin-bottom: 0">
<tr> <tr>
<td>上传时间:</td> <td>上传时间:</td>
<td> <td>
<div class="input-group date"> <div class="input-group date">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div>
<input type="text"
class="form-control pull-right"
id="datepicker3" value="{{choseDate}}" readonly/>
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
</div>
</td>
<td>文件名称:</td>
<td>
<input type="text" class="form-control" ng-model="fileName" placeholder="文件名称">
</td>
<td>
状态:
</td>
<td>
<select class="form-control select2" id="state" ng-model="state">
<option value="">--请选择解析状态--</option>
<option value="1">已解析</option>
<option value="0">未解析</option>
</select>
</td>
<td>
<button class="btn btn-primary" ng-click="getPostPackage()">查询</button>
</td>
</tr>
</table>
</div>
<div class="box-info" style="padding-top: 0;">
<table class="table table-bordered table-hover postTable" ng-if="postPackageData.length>0">
<thead>
<tr>
<th>NO.</th>
<th>文件ID</th>
<th>订单起始日期</th>
<th>订单截至日期</th>
<th>文件名</th>
<th>上传时间</th>
<th>解析状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in postPackageData">
<td>{{$index+1}}</td>
<td>{{item.fileId}}</td>
<td>{{item.formStartTime | myDateFilter}}</td>
<td>{{item.formDeadline| myDateFilter}}</td>
<td>{{item.fileName}}</td>
<td>{{item.uploadDate | myDateFilter}}</td>
<td ng-if="item.state==0">未解析</td>
<td ng-if="item.state==1">已解析</td>
<td>
<button class="btn btn-danger" ng-disabled="item.state==1" ng-click="deletePostData(item.fileId,item.uploadDate)">删除</button>
</td>
</tr>
</tbody>
</table>
<div style="padding-left: 27%;" ng-if="postPackageData.length>0">
<tm-pagination conf="paginationConf" class="ul"></tm-pagination>
</div>
<div class="box-body" ng-if="postPackageData.length==0"><h4>暂无记录</h4></div>
<div class="row" style="padding:0 25px;" ng-if="postMsgDetail.length>0">
<div class="col-md-11"></div>
<div class="col-md-1" style="text-align: right;">
<button id="rev-btn" class="btn btn-primary" data-loading-text="Loading..." ng-click="PreviewMytableRotate()" type="button">打印</button>
</div> </div>
</div> <input
type="text"
class="form-control pull-right"
id="datepicker3"
value="{{choseDate}}"
readonly
/>
<span class="input-group-addon"
><span class="glyphicon glyphicon-remove"></span
></span>
</div>
</td>
<td>文件名称:</td>
<td>
<input
type="text"
class="form-control"
ng-model="fileName"
placeholder="文件名称"
/>
</td>
<td>状态:</td>
<td>
<select class="form-control select2" id="state" ng-model="state">
<option value="">--请选择解析状态--</option>
<option value="1">已解析</option>
<option value="0">未解析</option>
</select>
</td>
<td>
<button class="btn btn-primary" ng-click="getPostPackage()">
查询
</button>
</td>
</tr>
</table>
</div>
<div class="box-info" style="padding-top: 0">
<table
class="table table-bordered table-hover postTable"
ng-if="postPackageData.length>0"
>
<thead>
<tr>
<th>NO.</th>
<th>文件ID</th>
<th>订单起始日期</th>
<th>订单截至日期</th>
<th>文件名</th>
<th>上传时间</th>
<th>解析状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in postPackageData">
<td>{{$index+1}}</td>
<td>{{item.fileId}}</td>
<td>{{item.formStartTime | myDateFilter}}</td>
<td>{{item.formDeadline| myDateFilter}}</td>
<td>{{item.fileName}}</td>
<td>{{item.uploadDate | myDateFilter}}</td>
<td ng-if="item.state==0">未解析</td>
<td ng-if="item.state==1">已解析</td>
<td>
<button
class="btn btn-danger"
ng-disabled="item.state==1"
ng-click="deletePostData(item.fileId,item.uploadDate)"
>
删除
</button>
</td>
</tr>
</tbody>
</table>
<div style="padding-left: 27%" ng-if="postPackageData.length>0">
<tm-pagination conf="paginationConf" class="ul"></tm-pagination>
</div>
<div class="box-body" ng-if="postPackageData.length==0">
<h4>暂无记录</h4>
</div> </div>
<div class="row" style="padding: 0 25px" ng-if="postMsgDetail.length>0">
<div class="col-md-11"></div>
<div class="col-md-1" style="text-align: right">
<button
id="rev-btn"
class="btn btn-primary"
data-loading-text="Loading..."
ng-click="PreviewMytableRotate()"
type="button"
>
打印
</button>
</div>
</div>
</div>
</div> </div>
</div>
</div> </div>
</div>
'use strict'; "use strict"
angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.pagination']) angular
.config(['$routeProvider', function ($routeProvider) { .module("AvatarCheck.excelAndSearch", [
$routeProvider.when('/excelAndSearch', { "ngRoute",
templateUrl: 'views/excelAndSearch/excelAndSearch.html' + urlTimeStamp(), "AvatarCheck.http",
controller: 'excelAndSearchCtrl', "tm.pagination",
cache: false ])
}); .config([
}]) "$routeProvider",
function ($routeProvider) {
.controller('excelAndSearchCtrl', function ($scope, $rootScope, $timeout, HttpService, $filter, $interval, MessageService, ngDialog) { $routeProvider.when("/excelAndSearch", {
templateUrl:
$("#id_file_photo_for_check").fileinput({ "views/excelAndSearch/excelAndSearch.html" + urlTimeStamp(),
language: 'zh', controller: "excelAndSearchCtrl",
showUpload: false, cache: false,
showCaption: true, })
maxFileCount: 1024, },
showPreview: true, ])
maxFileSize: 1024 * 30
}); .controller(
//Date picker "excelAndSearchCtrl",
$('#strdate').datetimepicker({ function (
minView: "month", //选择日期后,不会再跳转去选择时分秒 $scope,
language: 'zh-CN', $rootScope,
format: 'yyyy-MM-dd', $timeout,
todayBtn: 1, HttpService,
autoclose: 1 $filter,
}); $interval,
$('#enddate').datetimepicker({ MessageService,
minView: "month", //选择日期后,不会再跳转去选择时分秒 ngDialog
language: 'zh-CN', ) {
format: 'yyyy-MM-dd', $("#id_file_photo_for_check").fileinput({
todayBtn: 1, language: "zh",
autoclose: 1 showUpload: false,
}); showCaption: true,
//Date picker maxFileCount: 1024,
$('#datepicker1').datetimepicker({ showPreview: true,
minView: "month", //选择日期后,不会再跳转去选择时分秒 maxFileSize: 1024 * 30,
language: 'zh-CN', })
format: 'yyyy-MM-dd', //Date picker
todayBtn: 1, $("#strdate").datetimepicker({
autoclose: 1 minView: "month", //选择日期后,不会再跳转去选择时分秒
}); language: "zh-CN",
format: "yyyy-MM-dd",
$('#datepicker2').datetimepicker({ todayBtn: 1,
minView: "month", //选择日期后,不会再跳转去选择时分秒 autoclose: 1,
language: 'zh-CN', })
format: 'yyyy-MM-dd', $("#enddate").datetimepicker({
todayBtn: 1, minView: "month", //选择日期后,不会再跳转去选择时分秒
autoclose: 1 language: "zh-CN",
}); format: "yyyy-MM-dd",
$('#datepicker3').datetimepicker({ todayBtn: 1,
minView: "month", //选择日期后,不会再跳转去选择时分秒 autoclose: 1,
language: 'zh-CN', })
format: 'yyyy-MM-dd', //Date picker
todayBtn: 1, $("#datepicker1").datetimepicker({
autoclose: 1 minView: "month", //选择日期后,不会再跳转去选择时分秒
}); language: "zh-CN",
//清除的代码 format: "yyyy-MM-dd",
$(".glyphicon-remove").click(function(){ todayBtn: 1,
$($($(this).parent()).prev()).val(""); autoclose: 1,
}) })
$scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd"); $("#datepicker2").datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
$scope.expUploadInfo = function () { language: "zh-CN",
var strdate=$("#strdate").val(); format: "yyyy-MM-dd",
var enddate=$("#enddate").val(); todayBtn: 1,
var url = '../personPostApi/downloadUploadInfo?'+ 'strDate=' + strdate + '&'+ 'endDate=' + enddate ; autoclose: 1,
var a = document.createElement("a"); })
document.body.appendChild(a); $("#datepicker3").datetimepicker({
a.href = encodeURI(url); minView: "month", //选择日期后,不会再跳转去选择时分秒
a.click(); language: "zh-CN",
format: "yyyy-MM-dd",
todayBtn: 1,
autoclose: 1,
})
//清除的代码
$(".glyphicon-remove").click(function () {
$($($(this).parent()).prev()).val("")
})
$scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd")
$scope.isGAT = false
$scope.expUploadInfo = function () {
var strdate = $("#strdate").val()
var enddate = $("#enddate").val()
var url =
"../personPostApi/downloadUploadInfo?" +
"strDate=" +
strdate +
"&" +
"endDate=" +
enddate
var a = document.createElement("a")
document.body.appendChild(a)
a.href = encodeURI(url)
a.click()
}
$scope.uploadExcel = function () {
var fd = new FormData()
var files = document.querySelector(
"input#id_file_photo_for_check"
).files
if (files.length == 0) {
MessageService.showAlert("请选择上传的文件...")
} else {
for (var i in files) {
fd.append("file", files[i])
}
var getData = $scope.getPostPackage
ngDialog.openConfirm({
template: "dialogs/alert.html" + urlTimeStamp(),
width: 600,
cache: false,
closeByDocument: false,
controller: [
"$scope",
function ($scope) {
$scope.wrongMsg = -1
$scope.msgText = "上传中,请稍等..."
HttpService.uploadExcelFile(
$("#datepicker1").val(),
$("#datepicker2").val(),
$scope.isGAT,
fd,
function (data) {
$scope.msgText = data.msg
getData()
}
)
},
],
})
} }
}
$scope.uploadExcel = function () { $scope.paginationConf = {
var fd = new FormData(); currentPage: 1,
var files = document.querySelector('input#id_file_photo_for_check').files; itemsPerPage: 10,
if(files.length==0){ perPageOptions: [5, 10, 15, 20, 25],
MessageService.showAlert("请选择上传的文件...") }
}else{ $scope.getPostPackage = function () {
for(var i in files){ if ($scope.paginationConf.currentPage != 1) {
fd.append('file', files[i]); $scope.paginationConf.currentPage = 1
} $scope.paginationConf.itemsPerPage = 10
var getData = $scope.getPostPackage; } else {
ngDialog.openConfirm({ $scope.getPostPackagePage()
template: 'dialogs/alert.html' + urlTimeStamp(),
width: 600,
cache: false,
closeByDocument:false,
controller: ['$scope', function ($scope) {
$scope.wrongMsg =-1;
$scope.msgText = "上传中,请稍等..."
HttpService.uploadExcelFile($("#datepicker1").val(),$("#datepicker2").val(),fd,function (data) {
$scope.msgText =data.msg;
getData();
})
}]
});
}
} }
}
$scope.paginationConf = { $scope.getPostPackagePage = function () {
currentPage: 1, HttpService.selectPostPackageCount(
itemsPerPage: 10, $scope.fileName,
perPageOptions: [5 ,10 ,15 ,20 ,25] $scope.state,
}; $("#datepicker3").val(),
$scope.getPostPackage=function(){ function (data) {
if($scope.paginationConf.currentPage!=1){ $scope.paginationConf.totalItems = data.respData.string
$scope.paginationConf.currentPage=1; console.log($scope.paginationConf.totalItems)
$scope.paginationConf.itemsPerPage=10; }
}else{ )
$scope.getPostPackagePage(); // if($scope.paginationConf.currentPage==0){
} // $scope.paginationConf.currentPage=1;
} // }
$scope.getPostPackagePage = function(){ HttpService.selectPostPackage(
HttpService.selectPostPackageCount($scope.fileName,$scope.state,$("#datepicker3").val(),function (data) { $scope.fileName,
$scope.paginationConf.totalItems = data.respData.string; $scope.state,
console.log($scope.paginationConf.totalItems) $scope.paginationConf.currentPage,
}) $scope.paginationConf.itemsPerPage,
// if($scope.paginationConf.currentPage==0){ $("#datepicker3").val(),
// $scope.paginationConf.currentPage=1; function (data) {
// } $scope.postPackageData = data.respData
HttpService.selectPostPackage($scope.fileName,$scope.state,$scope.paginationConf.currentPage,$scope.paginationConf.itemsPerPage,$("#datepicker3").val(),function(data){ console.log($scope.postPackageData)
$scope.postPackageData = data.respData; }
console.log($scope.postPackageData) )
}) }
}
var reGetPostData = $scope.getPostPackage
var reGetPostData = $scope.getPostPackage; // 通过$watch currentPage和itemperPage 当他们一变化的时候,重新获取数据条目
// 通过$watch currentPage和itemperPage 当他们一变化的时候,重新获取数据条目 $scope.$watch(
$scope.$watch('paginationConf.currentPage +paginationConf.itemsPerPage', $scope.getPostPackagePage); "paginationConf.currentPage +paginationConf.itemsPerPage",
$scope.getPostPackagePage
$scope.deletePostData = function(fileid,importDate){ )
ngDialog.open({
template: 'dialogs/confirm.html' + urlTimeStamp(), $scope.deletePostData = function (fileid, importDate) {
width: 600, ngDialog.open({
cache: false, template: "dialogs/confirm.html" + urlTimeStamp(),
closeByDocument:false, width: 600,
controller: ['$scope', function ($scope) { cache: false,
$scope.wrongMsg =-1; closeByDocument: false,
$scope.total = 1; controller: [
$scope.importDate = $filter('myDateFilter')(importDate, 'yyyy-MM-dd'); "$scope",
$scope.fileid=fileid; function ($scope) {
$scope.confirmDelete = function () { $scope.wrongMsg = -1
HttpService.deleteByFileId(fileid, function (data) { $scope.total = 1
// MessageService.showAlert(data.msg); $scope.importDate = $filter("myDateFilter")(
if(data.msg){ importDate,
$scope.closeThisDialog(); "yyyy-MM-dd"
reGetPostData(); )
}else{ $scope.fileid = fileid
$scope.wrongMsg ="删除失败"; $scope.confirmDelete = function () {
} HttpService.deleteByFileId(fileid, function (data) {
// MessageService.showAlert(data.msg);
}) if (data.msg) {
}; $scope.closeThisDialog()
reGetPostData()
}] } else {
}); $scope.wrongMsg = "删除失败"
} }
})
}); }
\ No newline at end of file },
],
})
}
}
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment