| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- "use strict";
- angular.module('app.storage').controller("rulelibraryCtrl", function($scope,safeProduceNotifyService,$state, $http,$rootScope, $stateParams, APP_CONFIG) {
- //安全生产通告列表
- $scope.pageInfo = {pageNum : 1, pageSize : 10};
- $scope.search = {fileName:""};
- $scope.loadData = function() {
- safeProduceNotifyService.getPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize,$scope.search.fileName)
- .then(function(data){
- $scope.pageInfo = data;
- },function(data){
- console.log(data);
- });
- };
- $scope.loadData();
- // 翻页
- $scope.goPage = function(pageNum) {
- $scope.pageInfo.pageNum = pageNum;
- $scope.loadData();
- };
- // 显示增加页面
- $scope.showAddNotify=function () {
- $state.go('app.storage.safeproduce.safeleveledit', {id:0,isNotEdit:false,topRow:$rootScope.orgInfo.orgName+"通告:\n"});
- };
- //修改编辑页面
- $scope.showEditNotify = function (id) {
- $state.go('app.storage.safeproduce.safeleveledit', {id:id,isNotEdit:false});
- };
- // 查看页面
- $scope.showViewNotify = function(id) {
- $state.go('app.storage.safeproduce.safeleveledit', {id:id,isNotEdit:true});
- };
- // 根据id删除信息
- $scope.removeNotify = function(id) {
- if (!confirm("确定要删除吗?")) {
- return;
- }
- safeProduceNotifyService.removeById(id).then(function (data) {
- if(data.status == "success"){
- alert("删除成功");
- $scope.loadData();
- }else{
- alert("删除失败");
- }
- });
- }
-
- });
|