UNPKG

mobileoa-common-modules

Version:

移动办公平台前端公共功能模块

39 lines (32 loc) 978 B
var angular = require('angular'); require('../modules'); require('../services/ArchivesInceptService'); 'use strict'; var module = angular.module('archivesincept'); module.controller('ArchivesInceptGroupCtrl', function($state, $toast, $sinoGoBackDelegate, ArchivesInceptService) { var ctrl = this; ctrl.todos = ArchivesInceptService.todos; ctrl.relatedList = ArchivesInceptService.relatedList; ctrl.toDetail = toDetail; ctrl.remove = remove; /** * 查看收文单据详情。 */ function toDetail(item) { $state.go('archivesincept-archivesinceptDetail', { id: item.id }); }; /** * 删除数据。 */ function remove(list, item) { return ArchivesInceptService.remove(item.id).then(function() { $toast.showLongCenter('收文单删除成功。'); list.remove(item); }, function() { $toast.showLongCenter('收文单删除失败,请检查网络连接。'); }); }; });