Commit 39790f8f authored by liboyang's avatar liboyang

派出所代码维护页面

parent 69acd0b5
......@@ -1633,7 +1633,7 @@ public interface TaskListMapper {
@Select("SELECT * FROM POLICE_DIC")
public List<Map<String,Object>> selectPoliceList();
@Select("SELECT * FROM POLICE_DIC WHERE POLICE_CODE = #{policeCode} OR POLICE_NAME LIKE #{policeCode}")
@Select("SELECT * FROM POLICE_DIC WHERE POLICE_CODE like #{policeCode} OR POLICE_NAME LIKE #{policeCode}")
public List<Map<String,Object>> selectPoliceListByPoliceCode(@Param("policeCode") String policeCode);
@Insert("INSERT INTO POLICE_DIC (POLICE_CODE,POLICE_NAME) VALUES (#{policeCode},#{policeName})")
......
......@@ -1309,7 +1309,7 @@ public class TaskListServiceImpl implements TaskListService {
@Override
public List<Map<String,Object>> selectPoliceListByPoliceCode(String policeCode){
return taskListMapper.selectPoliceListByPoliceCode(policeCode);
return taskListMapper.selectPoliceListByPoliceCode("%"+policeCode+"%");
}
@Override
......
<style>
input[type=number] {
-moz-appearance: textfield;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
</style>
<div class="ui-dialog-title" style="text-align: center">
派出所添加
</div>
<form class="ui-dialog-content" name="form">
<table class="table" style="border-color: black;">
<tr>
<td>派出所代码:</td>
<td><input type="number" class="form-control" ng-model="data.code" placeholder="请输入派出所代码" required></td>
</tr>
<tr>
<td>派出所名称:</td>
<td>
<input type="text" class="form-control" ng-model="data.name" placeholder="请输入派出所名称" required>
</td>
</tr>
</table>
</form>
<div class="ui-dialog-confirm">
<button type="submit" class="btn btn-info" ng-disabled="form.$invalid" ng-click="confirmAddPolice()">添加</button>
<button type="submit" class="btn btn-danger" ng-click="closeThisDialog()">取消</button>
</div>
\ No newline at end of file
<div class="ui-dialog-title">
提示
</div>
<div class="ui-dialog-content">
<div>确认删除 <span class="text-primary">{{policeName}}</span> 吗?</div>
</div>
<div class="ui-dialog-confirm">
<button type="submit" class="btn btn-info" ng-click="confirmDeletePolice()">确认删除</button>
<button type="submit" class="btn btn-danger" ng-click="closeThisDialog()">取消</button>
</div>
\ No newline at end of file
<style>
input[type=number] {
-moz-appearance: textfield;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
</style>
<div class="ui-dialog-title" style="text-align: center">
派出所修改
</div>
<form class="ui-dialog-content" name="form">
<table class="table" style="border-color: black;">
<tr>
<td>派出所代码:</td>
<td><input type="number" class="form-control" ng-model="code" ng-value="code" placeholder="请输入派出所代码" required></td>
</tr>
<tr>
<td>组织机构:</td>
<td>
<input type="text" class="form-control" ng-model="name" ng-value="name" placeholder="请输入派出所名称" required>
</td>
</tr>
</table>
</form>
<div class="ui-dialog-confirm">
<button type="submit" class="btn btn-info" ng-disabled="form.$invalid" ng-click="confirmUpdate(code,name)">添加</button>
<button type="submit" class="btn btn-danger" ng-click="closeThisDialog()">取消</button>
</div>
\ No newline at end of file
......@@ -218,6 +218,7 @@
<script src="views/blank/blank.js"></script>
<script src="views/addBackCard/addBackCard.js"></script>
<script src="views/updatePass/updatePass.js"></script>
<script src="views/getPoliceList/getPoliceList.js"></script>
<script src="views/downloadGongan/downloadGongan.js"></script>
<script src="views/greenPackageInfo/greenPackageInfo.js"></script>
<script src="views/confirmNotDeliveredInfo/confirmNotDeliveredInfo.js"></script>
......
......@@ -45,6 +45,7 @@ angular.module('AvatarCheck', [
'AvatarCheck.downloadGongan',
'AvatarCheck.greenPackageInfo',
"AvatarCheck.confirmNotDeliveredInfo",
'AvatarCheck.getPoliceList',
'AvatarCheck.blank'
]).config(['$locationProvider', '$routeProvider', 'localStorageServiceProvider', '$qProvider',function ($locationProvider, $routeProvider, localStorageServiceProvider, $qProvider) {
$locationProvider.hashPrefix('!');
......@@ -228,6 +229,9 @@ angular.module('AvatarCheck', [
if($location.path()=="/confirmNotDeliveredInfo"){
$rootScope.tab = '/confirmNotDeliveredInfo';
}
if($location.path()=="/getPoliceList"){
$rootScope.tab = '/getPoliceList';
}
......
......@@ -1757,5 +1757,61 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
return failed(err)
});
},
getAllPoliceData:function(success) {
$http({
method: 'GET',
url: "../TaskList/selectPoliceList" + urlTimeStamp()
}).then(function successCallback(response) {
success(response.data)
})
},
delPoliceByCode:function(code,success) {
$http({
method: 'GET',
url: "../TaskList/deletePolice" + urlTimeStamp(),
params:{
policeCode:code
}
}).then(function successCallback(response) {
success(response.data)
})
},
updatePoliceByCode:function(oldCode,code,name,success) {
console.log(oldCode,code,name);
$http({
method: 'GET',
url: "../TaskList/updatePolice" + urlTimeStamp(),
params:{
policeCode:oldCode,
policeName:name,
newPoliceCode:code
}
}).then(function successCallback(response) {
success(response.data)
})
},
addPoliceData:function (code,name,success) {
$http({
method: 'GET',
url: "../TaskList/insertPolice" + urlTimeStamp(),
params:{
policeCode:code,
policeName:name
}
}).then(function successCallback(response) {
success(response.data)
})
},
searchPoliceByCode:function (code,success) {
$http({
method: 'GET',
url: "../TaskList/selectPoliceListByPoliceCode" + urlTimeStamp(),
params:{
policeCode:code
}
}).then(function successCallback(response) {
success(response.data)
})
}
}
});
\ No newline at end of file
<div class="content row">
<div class="col-md-12 clearfix" style="margin-top:20px;">
<div class="pull-left">
<a class="btn btn-primary btn-flat" ng-click="addPolice()">添加派出所</a>
</div>
<div class="pull-right">
<div class="input-group input-group-sm pull-right" style="width:230px;padding-right: 5px;margin-bottom: 10px;">
<input type="text" class="form-control input-sm no-border padder" ng-keyup="enterEvent($event,searchInput)" style="height: 35px" ng-model="searchInput" placeholder="输入派出所代码或名称">
<span class="input-group-btn">
<button type="button" style="height: 35px;background-color: #fff;border-left:0;outline:none;" ng-click="doSearch(searchInput)" class="btn btn-sm bg-light">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</div>
</div>
<div class="col-md-12" style="margin-top:10px;">
<div class="box">
<div class="box-header with-border">
<strong>派出所列表详情(共<span class="text-info" ng-bind="policeList.length"></span>个派出所)</strong>
</div>
<div class="box box-primary" style="padding: 7px; padding-top: 0px;">
<div class="box-body">
<table class="table table-bordered table-hover" ng-if="policeList.length>0">
<thead>
<tr>
<th>NO.</th>
<th>派出所名称</th>
<th>派出所代码</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="police in policeList">
<td>{{$index+1}}</td>
<td>{{police.POLICE_NAME}}</td>
<td>{{police.POLICE_CODE}}</td>
<td>
<a class="btn btn-default" ng-click="updatePolice(police)">修改</a>
<a class="btn btn-danger" ng-click="deletePolice(police)">删除</a>
</td>
</tr>
</tbody>
</table>
<h4 ng-if="policeList.length==0">暂无记录。</h4>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
'use strict';
angular.module('AvatarCheck.getPoliceList', ['ngRoute', 'AvatarCheck.http'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/getPoliceList', {
templateUrl: 'views/getPoliceList/getPoliceList.html' + urlTimeStamp(),
controller: 'getPoliceListCtrl',
cache: false
});
}])
.controller('getPoliceListCtrl', function ($scope, $rootScope, HttpService, ngDialog,$location,$timeout,MessageService,$filter) {
//获取所有组织列表
var getAllPolice = function () {
HttpService.getAllPoliceData(function(data) {
$scope.policeList = data;
console.log($scope.policeList);
})
};
getAllPolice();
//冻结组织
$scope.deletePolice = function (police) {
ngDialog.open({
template: 'dialogs/confirmDeletePolice.html' + urlTimeStamp(),
width: 600,
cache: false,
closeByDocument: false,
controller: ['$scope', function ($scope) {
$scope.policeName = police.POLICE_NAME;
$scope.confirmDeletePolice = function () {
HttpService.delPoliceByCode(police.POLICE_CODE,function () {
$scope.closeThisDialog();
getAllPolice();
})
}
}]
})
};
$scope.updatePolice = function (police) {
ngDialog.open({
template: 'dialogs/confirmUpdatePolice.html' + urlTimeStamp(),
width: 600,
cache: false,
closeByDocument: false,
controller: ['$scope', function ($scope) {
$scope.name = police.POLICE_NAME;
$scope.code = parseInt(police.POLICE_CODE);
$scope.confirmUpdate = function (code,name) {
HttpService.updatePoliceByCode(police.POLICE_CODE,code,name,function () {
$scope.closeThisDialog();
getAllPolice();
})
}
}]
})
};
$scope.addPolice = function () {
ngDialog.open({
template: 'dialogs/addPolice.html' + urlTimeStamp(),
width: 600,
cache: false,
closeByDocument: false,
controller: ['$scope', function ($scope) {
$scope.data = {
code:"",
name:""
};
$scope.confirmAddPolice = function () {
HttpService.addPoliceData($scope.data.code,$scope.data.name,function () {
$scope.closeThisDialog();
getAllPolice();
})
}
}]
})
}
$scope.enterEvent = function(e,input) {
var keycode = window.event?e.keyCode:e.which;
if(keycode===13){
$scope.doSearch(input);
}
};
$scope.doSearch = function (searchInput) {
console.log("searchInput",searchInput);
if(searchInput==""){
getAllPolice();
}else{
HttpService.searchPoliceByCode(searchInput,function(data) {
$scope.policeList=data;
console.log($scope.policeList)
})
}
}
});
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