Commit acd11e59 authored by liboyang's avatar liboyang

EMS角色的功能完成

parent 3b14f791
...@@ -672,6 +672,19 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule']) ...@@ -672,6 +672,19 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
}).then(function successCallback(response) { }).then(function successCallback(response) {
success(response.data) success(response.data)
}) })
},
updateIsValidData:function(slh,isValid,success){
console.log(slh,isValid)
$http({
method: 'GET',
url: "../queryPreproPerson/updatePreproPerson"+urlTimeStamp(),
params:{
uploadNo:slh,
isValid:isValid
}
}).then(function successCallback(response) {
success(response.data)
})
} }
} }
}); });
\ No newline at end of file
...@@ -103,21 +103,19 @@ ...@@ -103,21 +103,19 @@
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="item in packageData"> <tr ng-repeat="item in packageData">
<td>1</td> <td>{{$index+1}}</td>
<td>411032546565445</td> <td>{{item.JMSFZSLH}}</td>
<td>张三</td> <td>{{item.XM}}</td>
<td>130133195608240013</td> <td>{{item.GMSFHM}}</td>
<td>1321454113</td> <td>{{item.SOURCE_FILE_NAME}}</td>
<td>1213134556</td> <td>{{item.NEW_FILE_NAME}}</td>
<td>普通证</td> <td>{{item.CARD_TYPE}}</td>
<td> <td ng-if="item.IS_VALID==1"><button class="btn btn-primary" ng-click="updateIsValid(item.JMSFZSLH,0)">禁用</button></td>
<input type="radio" name="isPackage" value="1" checked> <td ng-if="item.IS_VALID==0"><button class="btn btn-info" ng-click="updateIsValid(item.JMSFZSLH,1)">启用</button></td>
<input type="radio" name="isPackage" value="2">
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p style="color:#9f191f;"><span style="margin-right: 15px;">普通证:3000</span><span style="margin-right: 15px;">邮寄证:2000</span><span>禁用数:2</span></p> <p style="color:#9f191f;"><span style="margin-right: 15px;">普通证:{{simpleCardCount}}</span><span style="margin-right: 15px;">邮寄证:{{postCardCount}}</span><span>禁用数:{{forbiddenCount}}</span></p>
<div style="padding-left: 27%;"> <div style="padding-left: 27%;">
<tm-pagination conf="paginationConf" class="ul"></tm-pagination> <tm-pagination conf="paginationConf" class="ul"></tm-pagination>
</div> </div>
......
...@@ -69,6 +69,7 @@ angular.module('AvatarCheck.cardProdPackage', ['ngRoute', 'AvatarCheck.http', 't ...@@ -69,6 +69,7 @@ angular.module('AvatarCheck.cardProdPackage', ['ngRoute', 'AvatarCheck.http', 't
$scope.paginationConf.totalItems=data.total; $scope.paginationConf.totalItems=data.total;
$scope.simpleCardCount = data.puSum; $scope.simpleCardCount = data.puSum;
$scope.postCardCount = data.youSum; $scope.postCardCount = data.youSum;
$scope.forbiddenCount= data.invaildCount;
$scope.packageData = data.list; $scope.packageData = data.list;
console.log(data) console.log(data)
}) })
...@@ -76,8 +77,65 @@ angular.module('AvatarCheck.cardProdPackage', ['ngRoute', 'AvatarCheck.http', 't ...@@ -76,8 +77,65 @@ angular.module('AvatarCheck.cardProdPackage', ['ngRoute', 'AvatarCheck.http', 't
// 通过$watch currentPage和itemperPage 当他们一变化的时候,重新获取数据条目 // 通过$watch currentPage和itemperPage 当他们一变化的时候,重新获取数据条目
$scope.$watch('paginationConf.currentPage +paginationConf.itemsPerPage', $scope.doPackageQuery); $scope.$watch('paginationConf.currentPage +paginationConf.itemsPerPage', $scope.doPackageQuery);
$scope.downloadXml = function(){ $scope.updateIsValid = function (slh,isValid) {
HttpService.updateIsValidData(slh,isValid,function(data) {
$scope.doPackageQuery();
MessageService.showAlert("更新成功")
})
};
var getCountAndDownloadUrl = function (url) {
var date = $("#datepicker").val();
var packageType = $("#packageType").val();
if(angular.isUndefined($scope.uploadNo)){
url = url + 'uploadNo=' + $scope.uploadNo + '&';
}else{
url = url + 'uploadNo=&';
}
if(angular.isUndefined($scope.idCard)){
url = url + 'IDCard=' + $scope.idCard + '&';
}else{
url = url + 'IDCard=&';
}
if(angular.isUndefined($scope.oldPackageNo)){
url = url + 'oldFile=' + $scope.oldPackageNo + '&';
}else{
url = url + 'oldFile=&';
}
if(angular.isUndefined($scope.newPackageNo)){
url = url + 'newFile=' + $scope.newPackageNo + '&';
}else{
url = url + 'newFile=&';
}
if(angular.isUndefined($scope.sljg)){
url = url + 'SSXQDM=' + $scope.sljg + '&';
}else{
url = url + 'SSXQDM=&';
}
if(angular.isUndefined($scope.typeCode)){
url = url + 'cardType=' + $scope.typeCode + '&';
}else{
url = url + 'cardType=&';
}
if(angular.isUndefined(packageType)){
url = url + 'state=' + packageType + '&';
}else{
url = url + 'state=&';
}
if (date==''){
date=$filter("date")(new Date(), "yyyy-MM-dd");
url = url + 'uploadDate=' + date + '&';
}else{
url = url + 'uploadDate=' + date + '&';
}
return url + 't=' + Math.floor(Date.now());
}
$scope.downloadXml = function(){
var url = '../exportXML/printXmlData?';
var a = document.createElement("a");
document.body.appendChild(a);
a.href = encodeURI(getCountAndDownloadUrl(url));
a.click();
} }
}); });
\ No newline at end of file
...@@ -86,23 +86,20 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http']) ...@@ -86,23 +86,20 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http'])
if (action === 'remove' && $scope.selected.indexOf(task) !== -1) $scope.selected.splice($scope.selected.indexOf(task), 1); if (action === 'remove' && $scope.selected.indexOf(task) !== -1) $scope.selected.splice($scope.selected.indexOf(task), 1);
}; };
//更新某一列数据的选择 //更新某一列数据的选择
var temp = 0;
$rootScope.cardsTotal = 0;
$scope.updateSelection = function ($event, task,typeCode) { $scope.updateSelection = function ($event, task,typeCode) {
var checkbox = $event.target; var checkbox = $event.target;
var action = (checkbox.checked ? 'add' : 'remove'); var action = (checkbox.checked ? 'add' : 'remove');
updateSelected(action, task); updateSelected(action, task);
$rootScope.cardsTotal=0;
var sum = 0; var sum = 0;
var checks = document.getElementsByClassName("checkOneBox"+typeCode); for (var i = 0; i < $scope.selected.length; i++) {
for (var i=0;i<checks.length;i++){ sum += parseInt($scope.selected[i].countyValidCount)-parseInt($scope.selected[i].specialCount);
if (checks[i].checked&&!checks[i].disabled) {
sum += parseInt(checks[i].name);
}
} }
$rootScope.cardsTotal = $rootScope.cardsTotal + sum - temp; $rootScope.cardsTotal = $rootScope.cardsTotal + sum;
$scope.restCount=$rootScope.cardsTotal%8; $scope.restCount=$rootScope.cardsTotal%8;
temp = sum; console.log(sum)
console.log($rootScope.cardsTotal)
}; };
//全选操作 //全选操作
...@@ -115,20 +112,16 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http']) ...@@ -115,20 +112,16 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http'])
updateSelected(action, contact); updateSelected(action, contact);
} }
$rootScope.cardsTotal=0;
if(checkbox.checked){
var sum = 0; var sum = 0;
var checks = document.getElementsByClassName("checkOneBox"+typeCode); for (var i = 0; i < $scope.selected.length; i++) {
for (var i = 0; i < checks.length; i++) { sum += parseInt($scope.selected[i].countyValidCount)-parseInt($scope.selected[i].specialCount);
sum += parseInt(checks[i].name);
} }
$rootScope.cardsTotal = $rootScope.cardsTotal + sum - temp; $rootScope.cardsTotal = $rootScope.cardsTotal + sum;
$scope.restCount=$rootScope.cardsTotal%8; $scope.restCount=$rootScope.cardsTotal%8;
temp = sum; console.log(sum)
console.log($rootScope.cardsTotal)
}else{
}
}; };
$scope.isSelected = function (task) { $scope.isSelected = function (task) {
return $scope.selected.indexOf(task) >= 0; return $scope.selected.indexOf(task) >= 0;
...@@ -442,23 +435,11 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http']) ...@@ -442,23 +435,11 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http'])
if (action === 'remove' && $scope.selected.indexOf(task) !== -1) $scope.selected.splice($scope.selected.indexOf(task), 1); if (action === 'remove' && $scope.selected.indexOf(task) !== -1) $scope.selected.splice($scope.selected.indexOf(task), 1);
}; };
//更新某一列数据的选择 //更新某一列数据的选择
var temp = 0;
$rootScope.cardsTotal = 0; $rootScope.cardsTotal = 0;
$scope.updateSelection = function ($event, task) { $scope.updateSelection = function ($event, task) {
var checkbox = $event.target; var checkbox = $event.target;
var action = (checkbox.checked ? 'add' : 'remove'); var action = (checkbox.checked ? 'add' : 'remove');
updateSelected(action, task); updateSelected(action, task);
var sum = 0;
var checks = document.getElementsByClassName("checkOneBox");
for (var i=0;i<checks.length;i++){
if (checks[i].checked) {
sum += parseInt(checks[i].value);
}
}
$rootScope.cardsTotal = $rootScope.cardsTotal + sum - temp;
temp = sum;
}; };
//全选操作 //全选操作
$scope.selectAll = function (task,$event) { $scope.selectAll = function (task,$event) {
...@@ -468,21 +449,6 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http']) ...@@ -468,21 +449,6 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http'])
var contact = task[i]; var contact = task[i];
updateSelected(action, contact); updateSelected(action, contact);
} }
if(checkbox.checked){
var sum = 0;
var checks = document.getElementsByClassName("checkOneBox");
for (var i = 0; i < checks.length; i++) {
sum += parseInt(checks[i].value);
}
$rootScope.cardsTotal = $rootScope.cardsTotal + sum - temp;
temp = sum;
}else{
$rootScope.cardsTotal =0;
temp = 0;
}
}; };
$scope.isSelected = function (task) { $scope.isSelected = function (task) {
return $scope.selected.indexOf(task) >= 0; return $scope.selected.indexOf(task) >= 0;
......
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