mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
more work
This commit is contained in:
@ -753,3 +753,23 @@ th.sort-false::after {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.pm-workorders {
|
||||
margin-left: 15px;
|
||||
|
||||
th {
|
||||
font-size: 13px;
|
||||
line-height: 13px;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
td {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
tr, th, td, thead, tbody {
|
||||
background-color: transparent !important;
|
||||
border-color: transparent !important;
|
||||
border: 0 !important;
|
||||
border-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
var biomed = {};
|
||||
|
||||
angular.module('biomed', ['biomed.filters', 'biomed.services', 'biomed.directives', 'ngResource', 'ui.bootstrap.dialog'])
|
||||
angular.module('biomed', ['biomed.filters', 'biomed.services', 'biomed.directives', 'ngResource', 'ngRoute', 'ui.bootstrap.dialog'])
|
||||
.run(function($rootScope) {
|
||||
$rootScope.TECH_GROUPS = {
|
||||
all: 'All',
|
||||
@ -38,67 +38,67 @@ angular.module('biomed', ['biomed.filters', 'biomed.services', 'biomed.directive
|
||||
$routeProvider
|
||||
.when('/schedule', {
|
||||
templateUrl: '/partials/schedule/index.html',
|
||||
controller: biomed.ScheduleIndexCtrl
|
||||
controller: "ScheduleIndexCtrl"
|
||||
})
|
||||
.when('/schedule/pms', {
|
||||
templateUrl: '/partials/schedule/pms.html',
|
||||
controller: biomed.SchedulePmsCtrl
|
||||
controller: "SchedulePmsCtrl"
|
||||
})
|
||||
.when('/clients', {
|
||||
templateUrl: '/partials/clients/index.html',
|
||||
controller: biomed.ClientIndexCtrl,
|
||||
controller: "ClientIndexCtrl",
|
||||
reloadOnSearch: false
|
||||
})
|
||||
.when('/clients/add', {
|
||||
templateUrl: '/partials/clients/add.html',
|
||||
controller: biomed.ClientAddCtrl
|
||||
controller: "ClientAddCtrl"
|
||||
})
|
||||
.when('/clients/:id', {
|
||||
templateUrl: '/partials/clients/edit.html',
|
||||
controller: biomed.ClientEditCtrl
|
||||
controller: "ClientEditCtrl"
|
||||
})
|
||||
.when('/accounting', {
|
||||
templateUrl: '/partials/accounting/index.html',
|
||||
controller: biomed.AccountingIndexCtrl,
|
||||
controller: "AccountingIndexCtrl",
|
||||
reloadOnSearch: false
|
||||
})
|
||||
.when('/workorders', {
|
||||
templateUrl: '/partials/workorders/index.html',
|
||||
controller: biomed.WorkorderIndexCtrl,
|
||||
controller: "WorkorderIndexCtrl",
|
||||
reloadOnSearch: false
|
||||
})
|
||||
.when('/workorders/add', {
|
||||
templateUrl: '/partials/workorders/add.html',
|
||||
controller: biomed.WorkorderAddCtrl
|
||||
controller: "WorkorderAddCtrl"
|
||||
})
|
||||
.when('/workorders/:id', {
|
||||
templateUrl: '/partials/workorders/edit.html',
|
||||
controller: biomed.WorkorderEditCtrl
|
||||
controller: "WorkorderEditCtrl"
|
||||
})
|
||||
.when('/techs/:id', {
|
||||
templateUrl: '/partials/techs/schedule.html',
|
||||
controller: biomed.TechScheduleCtrl
|
||||
controller: "TechScheduleCtrl"
|
||||
})
|
||||
.when('/posts', {
|
||||
templateUrl: '/partials/posts/index.html',
|
||||
controller: biomed.PostIndexCtrl
|
||||
controller: "PostIndexCtrl"
|
||||
})
|
||||
.when('/posts/add', {
|
||||
templateUrl: '/partials/posts/add.html',
|
||||
controller: biomed.PostAddCtrl
|
||||
controller: "PostAddCtrl"
|
||||
})
|
||||
.when('/posts/:id', {
|
||||
templateUrl: '/partials/posts/edit.html',
|
||||
controller: biomed.PostEditCtrl
|
||||
controller: "PostEditCtrl"
|
||||
})
|
||||
.when('/admin', {
|
||||
templateUrl: '/partials/users/index.html',
|
||||
controller: biomed.UsersIndexCtrl,
|
||||
controller: "UsersIndexCtrl",
|
||||
reloadOnSearch: false
|
||||
})
|
||||
.when('/admin/users/:id', {
|
||||
templateUrl: '/partials/users/clock.html',
|
||||
controller: biomed.UserClockCtrl
|
||||
controller: "UserClockCtrl"
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/schedule'
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
biomed.TechScheduleCtrl = function($scope, $routeParams, $location, Schedule, Users, LocationBinder) {
|
||||
angular.module('biomed')
|
||||
.controller("TechScheduleCtrl", function($scope, $routeParams, $location, Schedule, Users, LocationBinder) {
|
||||
|
||||
if (!$scope.date) {
|
||||
$scope.date = new Date();
|
||||
@ -25,9 +25,9 @@ biomed.TechScheduleCtrl = function($scope, $routeParams, $location, Schedule, Us
|
||||
$scope.schedule = result;
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
biomed.ScheduleIndexCtrl = function($scope, $location, Users, Schedule, LocationBinder) {
|
||||
.controller("ScheduleIndexCtrl", function($scope, $location, Users, Schedule, LocationBinder) {
|
||||
|
||||
// LocationBinder($scope, ['date'], { date: new Date() });
|
||||
updateUsers();
|
||||
@ -59,57 +59,46 @@ biomed.ScheduleIndexCtrl = function($scope, $location, Users, Schedule, Location
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
})
|
||||
|
||||
biomed.SchedulePmsCtrl = function($scope, Clients) {
|
||||
.controller("SchedulePmsCtrl", function($scope, $q, Clients, Workorders, Pms) {
|
||||
$scope.loading = true;
|
||||
|
||||
// Setup initial state
|
||||
$scope.filter = "all";
|
||||
$scope.month = moment().month();
|
||||
|
||||
$scope.frequencies = [];
|
||||
|
||||
var allData = Clients.frequencies(function() {
|
||||
if (allData) {
|
||||
angular.forEach(allData[0].frequencies, function(value, key) {
|
||||
$scope.frequencies.push(key);
|
||||
});
|
||||
}
|
||||
|
||||
filter();
|
||||
$scope.loading = false;
|
||||
});
|
||||
|
||||
function filter() {
|
||||
$scope.pms = [];
|
||||
|
||||
angular.forEach(allData, function(client) {
|
||||
|
||||
var reason = [];
|
||||
|
||||
angular.forEach(client.frequencies, function(value, key) {
|
||||
if (value[$scope.month]) {
|
||||
if (!$scope.frequency || $scope.frequency == key) {
|
||||
reason.push(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (reason.length > 0) {
|
||||
$scope.pms.push({
|
||||
reason: reason,
|
||||
client: client
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
console.log($scope.pms);
|
||||
}
|
||||
$scope.year = 2015;
|
||||
$scope.frequency = "";
|
||||
|
||||
$scope.sort = {
|
||||
column: 'client.name',
|
||||
descending: false
|
||||
};
|
||||
|
||||
function update() {
|
||||
$scope.loading = true;
|
||||
|
||||
if ($scope.filter != 'scheduled' && $scope.filter != 'complete') {
|
||||
if ($scope.month == "") {
|
||||
$scope.month = moment().month();
|
||||
}
|
||||
}
|
||||
if ($scope.month == "" && $scope.frequency == "") {
|
||||
$scope.frequency = "Anesthesia";
|
||||
}
|
||||
|
||||
var query = {
|
||||
type: $scope.filter,
|
||||
year: $scope.year,
|
||||
month: $scope.month,
|
||||
frequency: $scope.frequency
|
||||
};
|
||||
|
||||
$scope.pms = Pms.index(query, function() {
|
||||
$scope.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.selectedCls = function(column) {
|
||||
return column == $scope.sort.column && 'sort-' + $scope.sort.descending;
|
||||
}
|
||||
@ -124,11 +113,13 @@ biomed.SchedulePmsCtrl = function($scope, Clients) {
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('month', filter);
|
||||
$scope.$watch('frequency', filter);
|
||||
};
|
||||
$scope.$watch('filter', update);
|
||||
$scope.$watch('month', update);
|
||||
$scope.$watch('year', update);
|
||||
$scope.$watch('frequency', update);
|
||||
})
|
||||
|
||||
biomed.UsersIndexCtrl = function($scope, $filter, $routeParams, $location, Users, LocationBinder) {
|
||||
.controller("UsersIndexCtrl", function($scope, $filter, $routeParams, $location, Users, LocationBinder) {
|
||||
$scope.loading = true;
|
||||
|
||||
$scope.account.$then(function(value) {
|
||||
@ -210,17 +201,17 @@ biomed.UsersIndexCtrl = function($scope, $filter, $routeParams, $location, Users
|
||||
$scope.isNew = function(user) {
|
||||
return !('_id' in user);
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
biomed.UserClockCtrl = function($scope, $routeParams, Users) {
|
||||
.controller("UserClockCtrl", function($scope, $routeParams, Users) {
|
||||
Users.index({userid: $routeParams.id}, function(result) {
|
||||
$scope.tech = result[0];
|
||||
});
|
||||
|
||||
$scope.clocks = Users.clocks($routeParams);
|
||||
};
|
||||
})
|
||||
|
||||
biomed.PostIndexCtrl = function($scope, $routeParams, Posts, LocationBinder) {
|
||||
.controller("PostIndexCtrl", function($scope, $routeParams, Posts, LocationBinder) {
|
||||
var updatePosts = function() {
|
||||
$scope.loading = true;
|
||||
|
||||
@ -244,9 +235,9 @@ biomed.PostIndexCtrl = function($scope, $routeParams, Posts, LocationBinder) {
|
||||
};
|
||||
|
||||
$scope.$watch('page', updatePosts);
|
||||
};
|
||||
})
|
||||
|
||||
biomed.PostAddCtrl = function($scope, Posts, $location) {
|
||||
.controller("PostAddCtrl", function($scope, Posts, $location) {
|
||||
|
||||
$scope.tagOptions = {
|
||||
'multiple': true,
|
||||
@ -350,9 +341,9 @@ biomed.PostAddCtrl = function($scope, Posts, $location) {
|
||||
$scope.saveAsPosted = function() {
|
||||
save('posted');
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
biomed.PostEditCtrl = function($scope, Posts, $routeParams, $location) {
|
||||
.controller("PostEditCtrl", function($scope, Posts, $routeParams, $location) {
|
||||
var galleryImages = {};
|
||||
|
||||
$scope.tagOptions = {
|
||||
@ -475,10 +466,10 @@ biomed.PostEditCtrl = function($scope, Posts, $routeParams, $location) {
|
||||
$scope.saveAsArchived = function() {
|
||||
save('archived');
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
||||
biomed.ClientIndexCtrl = function($scope, $filter, $routeParams, Clients, LocationBinder) {
|
||||
.controller("ClientIndexCtrl", function($scope, $filter, $routeParams, Clients, LocationBinder) {
|
||||
$scope.loading = true;
|
||||
|
||||
var allData = Clients.index(function() {
|
||||
@ -532,9 +523,9 @@ biomed.ClientIndexCtrl = function($scope, $filter, $routeParams, Clients, Locati
|
||||
|
||||
$scope.filter();
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
biomed.ClientAddCtrl = function($scope, Clients, $location) {
|
||||
.controller("ClientAddCtrl", function($scope, Clients, $location) {
|
||||
|
||||
$scope.save = function() {
|
||||
$scope.model.contacts = [$scope.primaryContact, $scope.secondaryContact];
|
||||
@ -543,9 +534,9 @@ biomed.ClientAddCtrl = function($scope, Clients, $location) {
|
||||
$location.path("/clients/" + result._id);
|
||||
})
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
biomed.ClientEditCtrl = function($scope, $routeParams, Clients) {
|
||||
.controller("ClientEditCtrl", function($scope, $routeParams, Clients) {
|
||||
$scope.route = $routeParams;
|
||||
$scope.loading = true;
|
||||
|
||||
@ -672,9 +663,9 @@ biomed.ClientEditCtrl = function($scope, $routeParams, Clients) {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
biomed.AccountingIndexCtrl = function($scope, $filter, $routeParams, Workorders, LocationBinder) {
|
||||
.controller("AccountingIndexCtrl", function($scope, $filter, $routeParams, Workorders, LocationBinder) {
|
||||
$scope.loading = true;
|
||||
|
||||
var data = {};
|
||||
@ -757,9 +748,9 @@ biomed.AccountingIndexCtrl = function($scope, $filter, $routeParams, Workorders,
|
||||
filter();
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
biomed.WorkorderIndexCtrl = function($scope, $filter, $routeParams, Workorders, LocationBinder) {
|
||||
.controller("WorkorderIndexCtrl", function($scope, $filter, $routeParams, Workorders, LocationBinder) {
|
||||
$scope.loading = true;
|
||||
|
||||
var data = {};
|
||||
@ -831,9 +822,9 @@ biomed.WorkorderIndexCtrl = function($scope, $filter, $routeParams, Workorders,
|
||||
filter();
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
biomed.WorkorderAddCtrl = function($scope, $location, Workorders, Schedule, Clients, Users) {
|
||||
.controller("WorkorderAddCtrl", function($scope, $location, Workorders, Schedule, Clients, Users) {
|
||||
|
||||
$scope.emailsOptions = {
|
||||
'multiple': true,
|
||||
@ -1014,9 +1005,9 @@ biomed.WorkorderAddCtrl = function($scope, $location, Workorders, Schedule, Clie
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
biomed.WorkorderEditCtrl = function($scope, $routeParams, Workorders, Schedule, Users) {
|
||||
.controller("WorkorderEditCtrl", function($scope, $routeParams, Workorders, Schedule, Users) {
|
||||
$scope.emailsOptions = {
|
||||
'multiple': true,
|
||||
'simple_tags': true,
|
||||
@ -1245,10 +1236,10 @@ biomed.WorkorderEditCtrl = function($scope, $routeParams, Workorders, Schedule,
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
|
||||
biomed.PageCtrl = function($scope, $dialog, Account) {
|
||||
.controller("PageCtrl", function($scope, $dialog, Account) {
|
||||
$scope.opts = {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
@ -1256,7 +1247,7 @@ biomed.PageCtrl = function($scope, $dialog, Account) {
|
||||
dialogFade: true,
|
||||
backdropFade: true,
|
||||
templateUrl: '/partials/messages.html',
|
||||
controller: 'biomed.MessagesCtrl'
|
||||
controller: 'MessagesCtrl'
|
||||
};
|
||||
|
||||
$scope.openDialog = function(){
|
||||
@ -1273,9 +1264,9 @@ biomed.PageCtrl = function($scope, $dialog, Account) {
|
||||
};
|
||||
|
||||
$scope.account = Account.get();
|
||||
};
|
||||
})
|
||||
|
||||
biomed.MessagesCtrl = function($scope, dialog, Users, Messages) {
|
||||
.controller("MessagesCtrl", function($scope, dialog, Users, Messages) {
|
||||
$scope.model = {};
|
||||
|
||||
$scope.model.messages = [
|
||||
@ -1302,4 +1293,4 @@ biomed.MessagesCtrl = function($scope, dialog, Users, Messages) {
|
||||
$scope.cancel = function() {
|
||||
dialog.close();
|
||||
};
|
||||
};
|
||||
})
|
||||
|
@ -36,6 +36,13 @@ angular.module('biomed.services', [])
|
||||
destroy: { method: 'DELETE', params: { id: 0 } },
|
||||
});
|
||||
})
|
||||
.factory("Pms", function($resource) {
|
||||
return $resource('/api/pms',
|
||||
{},
|
||||
{
|
||||
index: { method: 'GET', isArray: true },
|
||||
});
|
||||
})
|
||||
.factory("Users", function($resource) {
|
||||
return $resource('/api/users/:id/:cmd',
|
||||
{ id: "@id", cmd: "@cmd" },
|
||||
|
@ -286,7 +286,7 @@
|
||||
<tbody>
|
||||
<tr ng-repeat="(frequency, values) in master.frequencies">
|
||||
<td class="name">{{frequency}}</td>
|
||||
<td ng-repeat="enabled in values" class="{{enabled}}"><a ng-click="toggleFrequency(frequency, $index)"><i ng-class="{ 'icon-ok': enabled, 'icon-remove': !enabled }"></i></a></td>
|
||||
<td ng-repeat="enabled in values track by $index" class="{{enabled}}"><a ng-click="toggleFrequency(frequency, $index)"><i ng-class="{ 'icon-ok': enabled, 'icon-remove': !enabled }"></i></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -9,15 +9,40 @@
|
||||
<div class="span12">
|
||||
<div class="toolbelt">
|
||||
<a href="/clients/add" class="btn btn-primary" ng-show="accountHasPermission('system.edit')">Create new Workorder</a>
|
||||
<span class="toolbelt-text">Filter:</span>
|
||||
<select ng-model="filter" name="filter" class="input-xlarge">
|
||||
<option value="all">All</option>
|
||||
<option value="due">Due</option>
|
||||
<option value="overdue">Overdue</option>
|
||||
<option value="scheduled">Scheduled</option>
|
||||
<option value="complete">Complete</option>
|
||||
</select>
|
||||
<span class="toolbelt-text">Frequency:</span>
|
||||
<select ng-model="frequency" name="frequency" class="input-xlarge">
|
||||
<option value="">All</option>
|
||||
<option ng-repeat="f in frequencies" value="{{f}}">{{f}}</option>
|
||||
<option value="" ng-disabled="month == ''">All</option>
|
||||
<option value="Anesthesia">Anesthesia</option>
|
||||
<option value="Annual">Annual</option>
|
||||
<option value="DLLR">DLLR</option>
|
||||
<option value="ERT">ERT</option>
|
||||
<option value="Ice Maker">Ice Maker</option>
|
||||
<option value="Imaging">Imaging</option>
|
||||
<option value="Medical Device">Medical Device</option>
|
||||
<option value="Medical Gas Systems">Medical Gas Systems</option>
|
||||
<option value="N2O Trace Gas">N2O Trace Gas</option>
|
||||
<option value="Quarterly">Quarterly</option>
|
||||
<option value="RAE">RAE</option>
|
||||
<option value="Semi">Semi</option>
|
||||
<option value="Sterilizer - F">Sterilizer - F</option>
|
||||
<option value="Sterilizer - TT">Sterilizer - TT</option>
|
||||
<option value="Vaporizer">Vaporizer</option>
|
||||
<option value="Waste Management System">Waste Management System</option>
|
||||
<option value="legacy" disabled>legacy</option>
|
||||
</select>
|
||||
<div class="pull-right">
|
||||
<span class="toolbelt-text">Month:</span>
|
||||
<div class="input-append">
|
||||
<select ng-model="month" name="month" class="input-xlarge">
|
||||
<option value="" ng-disabled="filter != 'scheduled' && filter != 'completed'">All</option>
|
||||
<option value="0">January</option>
|
||||
<option value="1">February</option>
|
||||
<option value="2">March</option>
|
||||
@ -49,13 +74,35 @@
|
||||
<tr ng-hide="loading || pms.length"><td colspan="4" class="table-message">There is no information to display.</td></tr>
|
||||
<tr ng-hide="loading" ng-repeat="pm in pms | orderBy : sort.column : sort.descending">
|
||||
<td colspan="2">
|
||||
{{pm.client.name}} ({{pm.client.identifier | uppercase}})<br>
|
||||
<span ng-repeat="reason in pm.reason">
|
||||
<a ng-href="/workorders/add?workorderType=pm&clientId={{pm.client._id}}&type={{reason}}">{{reason}}</a><span ng-show="!$last">, </span>
|
||||
</span>
|
||||
{{pm.name}} ({{pm.identifier | uppercase}})<br>
|
||||
|
||||
<table class="pm-workorders">
|
||||
<thead ng-if="pm.frequencies.length > 0">
|
||||
<th width="150"><strong>Due:</strong></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="reason in pm.frequencies">
|
||||
<td width="150">{{reason}}</td>
|
||||
<td><a ng-href="/workorders/add?workorderType=pm&clientId={{pm._id}}&type={{reason}}">Create Workorder</a><td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead ng-if="pm.workorders">
|
||||
<th width="150"><strong>Workorders:</strong></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="(key, values) in pm.workorders">
|
||||
<td width="150">{{key}}</td>
|
||||
<td>
|
||||
<span ng-repeat="workorder in values">
|
||||
<a ng-href="/workorders/{{workorder.id}}">#{{workorder.identifier}} ({{workorder.status}})</a><span ng-show="!$last">, </span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td>{{pm.client.contacts[0].name}}</td>
|
||||
<td>{{pm.client.contacts[0].phone}}</td>
|
||||
<td>{{pm.contacts[0].name}}</td>
|
||||
<td>{{pm.contacts[0].phone}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -98,7 +98,7 @@
|
||||
<option value="Quarterly">Quarterly</option>
|
||||
<option value="RAE">RAE</option>
|
||||
<option value="Semi">Semi</option>
|
||||
<option value="Sterilizer -F">Sterilizer -F</option>
|
||||
<option value="Sterilizer - F">Sterilizer - F</option>
|
||||
<option value="Sterilizer - TT">Sterilizer - TT</option>
|
||||
<option value="Vaporizer">Vaporizer</option>
|
||||
<option value="Waste Management System">Waste Management System</option>
|
||||
|
Reference in New Issue
Block a user