123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- "use strict";
- /**
- * controller for User Profile Example
- */
- app.controller("summaryDetailCtrl", [
- "$rootScope",
- "$scope",
- "$state",
- "$stateParams",
- "$timeout",
- "$interval",
- "$modal",
- "SweetAlert",
- "i18nService",
- "uiGridConstants",
- "uiGridGroupingConstants",
- "Restangular",
- "api_bpm_schedule",
- "api_bpm_data",
- "api_wechatfile",
- "api_configure_data",
- "moment",
- function (
- $rootScope,
- $scope,
- $state,
- $stateParams,
- $timeout,
- $interval,
- $modal,
- SweetAlert,
- i18nService,
- uiGridConstants,
- uiGridGroupingConstants,
- Restangular,
- api_bpm_schedule,
- api_bpm_data,
- api_wechatfile,
- api_configure_data,
- moment
- ) {
- $scope.langs = i18nService.getAllLangs();
- $scope.lang = "zh-cn";
- i18nService.setCurrentLang($scope.lang);
- // 获取信息
- $scope.consumableList = [];
- $scope.incidentDTO = {};
- $scope.workHourManagementList = [];
- $scope.totalMaintenancePrice = null;
- $scope.totalPriceConsumable = null;
- $scope.totalPriceWorkHourManagement = null;
- $scope.getInfo = function(){
- console.log($stateParams.incidentId);
- $rootScope.isMask = true;
- api_bpm_data.querySummaryDoc({"incidentId":$stateParams.incidentId}).then(
- function (data) {
- $rootScope.isMask = false;
- $scope.consumableList = data.consumableList || [];
- $scope.incidentDTO = data.incidentDTO || {};
- $scope.workHourManagementList = data.workHourManagementList || [];
- $scope.totalMaintenancePrice = data.totalMaintenancePrice;
- $scope.totalPriceConsumable = data.consumablePrice;
- $scope.totalPriceWorkHourManagement = data.workHourPrice;
- },
- function () {
- $rootScope.isMask = false;
- }
- );
- }
- $scope.getInfo();
- //返回列表
- $scope.goToList = function(){
- $state.go("app.incident.summary");
- }
- $scope.transferTime = function (time) {
- if(time){
- return moment(time).format('YYYY-MM-DD HH:mm');
- }else{
- return '';
- }
- }
- //查看事件
- $scope.goToIncident = function(){
- $state.go('app.incident.detail', {
- formKey: 'incident_back',
- pdKey: 'incident',
- dataId: $scope.incidentDTO.id,
- taskId: $scope.incidentDTO.taskId,
- processInstanceId: $scope.incidentDTO.processInstanceId
- });
- }
- // 撤销耗材
- $scope.removeHc = function(consumable){
- var modalInstance = $modal.open({
- templateUrl: "assets/views/delete.html",
- controller: function ($scope, $modalInstance) {
- $scope.title = "撤销";
- $scope.connect = "您确认要撤销此条耗材("+ consumable.consumableName + "【"+ consumable.consumablesNum +"】" +")的使用吗?";
- $scope.ok = function () {
- $modalInstance.close("start");
- };
- $scope.cancel = function () {
- $modalInstance.dismiss("cancel");
- };
- },
- size: "sm",
- });
- modalInstance.result.then(
- function (result) {
- if(result == 'start'){
- $rootScope.isMask = true;
- api_bpm_data.removeHc({
- summaryId: +$stateParams.id,
- remove: 'remove',
- consumableList: [
- {
- consumablesId: consumable.consumableId,
- consumablesNum: consumable.consumablesNum,
- }
- ]
- }).then(
- function (data) {
- $rootScope.isMask = false;
- $scope.getInfo();
- },
- function () {
- $rootScope.isMask = false;
- }
- );
- }
- },
- function () {}
- );
- }
- },
- ]);
|