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,
.table td {
text-align: center; text-align: center;
vertical-align: middle!important; vertical-align: middle !important;
} }
.select2-search__field { .select2-search__field {
height:30px; height: 30px;
} }
.ul li{ .ul li {
cursor: pointer; cursor: pointer;
} }
.page-list .pagination {float:left;} .page-list .pagination {
.page-list .pagination span {cursor: pointer;} float: left;
.page-list .pagination .separate span{cursor: default; border-top:none;border-bottom:none;} }
.page-list .pagination .separate span:hover {background: none;} .page-list .pagination span {
.page-list .page-total {float:left; margin: 25px 20px;} cursor: pointer;
.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 .pagination .separate span {
.page-list .page-total select {width: 50px;} cursor: default;
border-top: none;
border-bottom: none;
}
.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 { .page-list:after {
display: block; display: block;
clear: both; clear: both;
content: "" 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">
...@@ -40,7 +63,13 @@ ...@@ -40,7 +63,13 @@
<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
type="text"
class="form-control pull-right"
ng-model="choseDate"
id="strdate"
readonly
/>
</div> </div>
</td> </td>
<td> <td>
...@@ -48,12 +77,20 @@ ...@@ -48,12 +77,20 @@
<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="enddate" readonly/> <input
type="text"
class="form-control pull-right"
ng-model="choseDate"
id="enddate"
readonly
/>
</div> </div>
</td> </td>
<td> <td>
<div style="float: left"> <div style="float: left">
<button class="btn btn-info" ng-click="expUploadInfo()">数据导出</button> <button class="btn btn-info" ng-click="expUploadInfo()">
数据导出
</button>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -71,47 +108,75 @@ ...@@ -71,47 +108,75 @@
<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
type="text"
class="form-control pull-right" class="form-control pull-right"
ng-model="choseDate" ng-model="choseDate"
id="datepicker1" readonly/> id="datepicker1"
readonly
/>
</div> </div>
</td> </td>
<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
type="text"
class="form-control pull-right" class="form-control pull-right"
ng-model="choseDate" id="datepicker2" readonly/> ng-model="choseDate"
id="datepicker2"
readonly
/>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>港澳台:</td>
<td>
<input
type="radio"
ng-model="isGAT"
name="type"
:value="true"
/>
<input
style="margin-left: 10px"
type="radio"
ng-model="isGAT"
name="type"
:value="false"
ng-checked="true"
/>
</td>
<td>选择Excel文件:</td> <td>选择Excel文件:</td>
<td colspan="2"> <td colspan="2">
<input type="file" <input
type="file"
id="id_file_photo_for_check" id="id_file_photo_for_check"
class="file" class="file"
data-show-preview="false" data-show-preview="false"
data-allowed-file-extensions='["XLS","xls","XLSX","xlsx"]' data-allowed-file-extensions='["XLS","xls","XLSX","xlsx"]'
multiple/> multiple
/>
</td> </td>
<td> <td>
<div style="float: left"> <div style="float: left">
<button class="btn btn-primary" ng-click="uploadExcel()">上传</button> <button class="btn btn-primary" ng-click="uploadExcel()">
上传
</button>
</div> </div>
</td> </td>
</tr> </tr>
</table> </table>
</div> </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>
...@@ -119,19 +184,28 @@ ...@@ -119,19 +184,28 @@
<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
type="text"
class="form-control pull-right" class="form-control pull-right"
id="datepicker3" value="{{choseDate}}" readonly/> id="datepicker3"
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span> value="{{choseDate}}"
readonly
/>
<span class="input-group-addon"
><span class="glyphicon glyphicon-remove"></span
></span>
</div> </div>
</td> </td>
<td>文件名称:</td> <td>文件名称:</td>
<td> <td>
<input type="text" class="form-control" ng-model="fileName" placeholder="文件名称"> <input
</td> type="text"
<td> class="form-control"
状态: ng-model="fileName"
placeholder="文件名称"
/>
</td> </td>
<td>状态:</td>
<td> <td>
<select class="form-control select2" id="state" ng-model="state"> <select class="form-control select2" id="state" ng-model="state">
<option value="">--请选择解析状态--</option> <option value="">--请选择解析状态--</option>
...@@ -140,13 +214,18 @@ ...@@ -140,13 +214,18 @@
</select> </select>
</td> </td>
<td> <td>
<button class="btn btn-primary" ng-click="getPostPackage()">查询</button> <button class="btn btn-primary" ng-click="getPostPackage()">
查询
</button>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="box-info" style="padding-top: 0;"> <div class="box-info" style="padding-top: 0">
<table class="table table-bordered table-hover postTable" ng-if="postPackageData.length>0"> <table
class="table table-bordered table-hover postTable"
ng-if="postPackageData.length>0"
>
<thead> <thead>
<tr> <tr>
<th>NO.</th> <th>NO.</th>
...@@ -170,23 +249,38 @@ ...@@ -170,23 +249,38 @@
<td ng-if="item.state==0">未解析</td> <td ng-if="item.state==0">未解析</td>
<td ng-if="item.state==1">已解析</td> <td ng-if="item.state==1">已解析</td>
<td> <td>
<button class="btn btn-danger" ng-disabled="item.state==1" ng-click="deletePostData(item.fileId,item.uploadDate)">删除</button> <button
class="btn btn-danger"
ng-disabled="item.state==1"
ng-click="deletePostData(item.fileId,item.uploadDate)"
>
删除
</button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div style="padding-left: 27%;" ng-if="postPackageData.length>0"> <div style="padding-left: 27%" ng-if="postPackageData.length>0">
<tm-pagination conf="paginationConf" class="ul"></tm-pagination> <tm-pagination conf="paginationConf" class="ul"></tm-pagination>
</div> </div>
<div class="box-body" ng-if="postPackageData.length==0"><h4>暂无记录</h4></div> <div class="box-body" ng-if="postPackageData.length==0">
<div class="row" style="padding:0 25px;" ng-if="postMsgDetail.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-11"></div>
<div class="col-md-1" style="text-align: right;"> <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> <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>
</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:
"views/excelAndSearch/excelAndSearch.html" + urlTimeStamp(),
controller: "excelAndSearchCtrl",
cache: false,
})
},
])
.controller(
"excelAndSearchCtrl",
function (
$scope,
$rootScope,
$timeout,
HttpService,
$filter,
$interval,
MessageService,
ngDialog
) {
$("#id_file_photo_for_check").fileinput({ $("#id_file_photo_for_check").fileinput({
language: 'zh', language: "zh",
showUpload: false, showUpload: false,
showCaption: true, showCaption: true,
maxFileCount: 1024, maxFileCount: 1024,
showPreview: true, showPreview: true,
maxFileSize: 1024 * 30 maxFileSize: 1024 * 30,
}); })
//Date picker //Date picker
$('#strdate').datetimepicker({ $("#strdate").datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒 minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN', language: "zh-CN",
format: 'yyyy-MM-dd', format: "yyyy-MM-dd",
todayBtn: 1, todayBtn: 1,
autoclose: 1 autoclose: 1,
}); })
$('#enddate').datetimepicker({ $("#enddate").datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒 minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN', language: "zh-CN",
format: 'yyyy-MM-dd', format: "yyyy-MM-dd",
todayBtn: 1, todayBtn: 1,
autoclose: 1 autoclose: 1,
}); })
//Date picker //Date picker
$('#datepicker1').datetimepicker({ $("#datepicker1").datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒 minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN', language: "zh-CN",
format: 'yyyy-MM-dd', format: "yyyy-MM-dd",
todayBtn: 1, todayBtn: 1,
autoclose: 1 autoclose: 1,
}); })
$('#datepicker2').datetimepicker({ $("#datepicker2").datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒 minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN', language: "zh-CN",
format: 'yyyy-MM-dd', format: "yyyy-MM-dd",
todayBtn: 1, todayBtn: 1,
autoclose: 1 autoclose: 1,
}); })
$('#datepicker3').datetimepicker({ $("#datepicker3").datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒 minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN', language: "zh-CN",
format: 'yyyy-MM-dd', format: "yyyy-MM-dd",
todayBtn: 1, todayBtn: 1,
autoclose: 1 autoclose: 1,
}); })
//清除的代码 //清除的代码
$(".glyphicon-remove").click(function(){ $(".glyphicon-remove").click(function () {
$($($(this).parent()).prev()).val(""); $($($(this).parent()).prev()).val("")
}) })
$scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd"); $scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd")
$scope.isGAT = false
$scope.expUploadInfo = function () { $scope.expUploadInfo = function () {
var strdate=$("#strdate").val(); var strdate = $("#strdate").val()
var enddate=$("#enddate").val(); var enddate = $("#enddate").val()
var url = '../personPostApi/downloadUploadInfo?'+ 'strDate=' + strdate + '&'+ 'endDate=' + enddate ; var url =
var a = document.createElement("a"); "../personPostApi/downloadUploadInfo?" +
document.body.appendChild(a); "strDate=" +
a.href = encodeURI(url); strdate +
a.click(); "&" +
"endDate=" +
enddate
var a = document.createElement("a")
document.body.appendChild(a)
a.href = encodeURI(url)
a.click()
} }
$scope.uploadExcel = function () { $scope.uploadExcel = function () {
var fd = new FormData(); var fd = new FormData()
var files = document.querySelector('input#id_file_photo_for_check').files; var files = document.querySelector(
if(files.length==0){ "input#id_file_photo_for_check"
).files
if (files.length == 0) {
MessageService.showAlert("请选择上传的文件...") MessageService.showAlert("请选择上传的文件...")
}else{ } else {
for(var i in files){ for (var i in files) {
fd.append('file', files[i]); fd.append("file", files[i])
} }
var getData = $scope.getPostPackage; var getData = $scope.getPostPackage
ngDialog.openConfirm({ ngDialog.openConfirm({
template: 'dialogs/alert.html' + urlTimeStamp(), template: "dialogs/alert.html" + urlTimeStamp(),
width: 600, width: 600,
cache: false, cache: false,
closeByDocument:false, closeByDocument: false,
controller: ['$scope', function ($scope) { controller: [
$scope.wrongMsg =-1; "$scope",
function ($scope) {
$scope.wrongMsg = -1
$scope.msgText = "上传中,请稍等..." $scope.msgText = "上传中,请稍等..."
HttpService.uploadExcelFile($("#datepicker1").val(),$("#datepicker2").val(),fd,function (data) { HttpService.uploadExcelFile(
$scope.msgText =data.msg; $("#datepicker1").val(),
getData(); $("#datepicker2").val(),
$scope.isGAT,
fd,
function (data) {
$scope.msgText = data.msg
getData()
}
)
},
],
}) })
}]
});
} }
} }
$scope.paginationConf = { $scope.paginationConf = {
currentPage: 1, currentPage: 1,
itemsPerPage: 10, itemsPerPage: 10,
perPageOptions: [5 ,10 ,15 ,20 ,25] perPageOptions: [5, 10, 15, 20, 25],
};
$scope.getPostPackage=function(){
if($scope.paginationConf.currentPage!=1){
$scope.paginationConf.currentPage=1;
$scope.paginationConf.itemsPerPage=10;
}else{
$scope.getPostPackagePage();
} }
$scope.getPostPackage = function () {
if ($scope.paginationConf.currentPage != 1) {
$scope.paginationConf.currentPage = 1
$scope.paginationConf.itemsPerPage = 10
} else {
$scope.getPostPackagePage()
} }
$scope.getPostPackagePage = function(){ }
HttpService.selectPostPackageCount($scope.fileName,$scope.state,$("#datepicker3").val(),function (data) { $scope.getPostPackagePage = function () {
$scope.paginationConf.totalItems = data.respData.string; HttpService.selectPostPackageCount(
$scope.fileName,
$scope.state,
$("#datepicker3").val(),
function (data) {
$scope.paginationConf.totalItems = data.respData.string
console.log($scope.paginationConf.totalItems) console.log($scope.paginationConf.totalItems)
}) }
)
// if($scope.paginationConf.currentPage==0){ // if($scope.paginationConf.currentPage==0){
// $scope.paginationConf.currentPage=1; // $scope.paginationConf.currentPage=1;
// } // }
HttpService.selectPostPackage($scope.fileName,$scope.state,$scope.paginationConf.currentPage,$scope.paginationConf.itemsPerPage,$("#datepicker3").val(),function(data){ HttpService.selectPostPackage(
$scope.postPackageData = data.respData; $scope.fileName,
$scope.state,
$scope.paginationConf.currentPage,
$scope.paginationConf.itemsPerPage,
$("#datepicker3").val(),
function (data) {
$scope.postPackageData = data.respData
console.log($scope.postPackageData) console.log($scope.postPackageData)
}) }
)
} }
var reGetPostData = $scope.getPostPackage; var reGetPostData = $scope.getPostPackage
// 通过$watch currentPage和itemperPage 当他们一变化的时候,重新获取数据条目 // 通过$watch currentPage和itemperPage 当他们一变化的时候,重新获取数据条目
$scope.$watch('paginationConf.currentPage +paginationConf.itemsPerPage', $scope.getPostPackagePage); $scope.$watch(
"paginationConf.currentPage +paginationConf.itemsPerPage",
$scope.getPostPackagePage
)
$scope.deletePostData = function(fileid,importDate){ $scope.deletePostData = function (fileid, importDate) {
ngDialog.open({ ngDialog.open({
template: 'dialogs/confirm.html' + urlTimeStamp(), template: "dialogs/confirm.html" + urlTimeStamp(),
width: 600, width: 600,
cache: false, cache: false,
closeByDocument:false, closeByDocument: false,
controller: ['$scope', function ($scope) { controller: [
$scope.wrongMsg =-1; "$scope",
$scope.total = 1; function ($scope) {
$scope.importDate = $filter('myDateFilter')(importDate, 'yyyy-MM-dd'); $scope.wrongMsg = -1
$scope.fileid=fileid; $scope.total = 1
$scope.importDate = $filter("myDateFilter")(
importDate,
"yyyy-MM-dd"
)
$scope.fileid = fileid
$scope.confirmDelete = function () { $scope.confirmDelete = function () {
HttpService.deleteByFileId(fileid, function (data) { HttpService.deleteByFileId(fileid, function (data) {
// MessageService.showAlert(data.msg); // MessageService.showAlert(data.msg);
if(data.msg){ if (data.msg) {
$scope.closeThisDialog(); $scope.closeThisDialog()
reGetPostData(); reGetPostData()
}else{ } else {
$scope.wrongMsg ="删除失败"; $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