mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Latest bits
This commit is contained in:
@ -44,6 +44,10 @@ angular.module('biomed', ['biomed.filters', 'biomed.services', 'biomed.directive
|
||||
templateUrl: '/partials/schedule/pms.html',
|
||||
controller: "SchedulePmsCtrl"
|
||||
})
|
||||
.when('/schedule/pms/report', {
|
||||
templateUrl: '/partials/schedule/report.html',
|
||||
controller: "FrequencyReportCtrl"
|
||||
})
|
||||
.when('/clients', {
|
||||
templateUrl: '/partials/clients/index.html',
|
||||
controller: "ClientIndexCtrl",
|
||||
|
@ -118,6 +118,59 @@ angular.module('biomed')
|
||||
$scope.$watch('frequency', update);
|
||||
})
|
||||
|
||||
.controller("FrequencyReportCtrl", function($scope, $q, $filter, Clients, Workorders, Pms) {
|
||||
$scope.loading = true;
|
||||
|
||||
// Setup initial state
|
||||
$scope.month = moment().month();
|
||||
$scope.year = 2015;
|
||||
$scope.frequency = "Anesthesia";
|
||||
|
||||
$scope.sort = {
|
||||
column: 'client.name',
|
||||
descending: false
|
||||
};
|
||||
|
||||
function update() {
|
||||
$scope.loading = true;
|
||||
|
||||
if ($scope.month == "" && $scope.frequency == "") {
|
||||
$scope.frequency = "Anesthesia";
|
||||
}
|
||||
|
||||
var query = {
|
||||
year: $scope.year,
|
||||
month: $scope.month,
|
||||
frequency: $scope.frequency,
|
||||
type: 'all'
|
||||
};
|
||||
|
||||
$scope.pms = Pms.index(query, function() {
|
||||
$scope.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.selectedCls = function(column) {
|
||||
return column == $scope.sort.column && 'sort-' + $scope.sort.descending;
|
||||
}
|
||||
|
||||
$scope.changeSorting = function(column) {
|
||||
console.log(column);
|
||||
var sort = $scope.sort;
|
||||
if (sort.column == column) {
|
||||
sort.descending = !sort.descending;
|
||||
} else {
|
||||
sort.column = column;
|
||||
sort.descending = false;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('month', update);
|
||||
$scope.$watch('year', update);
|
||||
$scope.$watch('frequency', update);
|
||||
})
|
||||
|
||||
|
||||
.controller("UsersIndexCtrl", function($scope, $filter, $routeParams, $location, Users, LocationBinder) {
|
||||
$scope.loading = true;
|
||||
|
||||
@ -814,7 +867,7 @@ angular.module('biomed')
|
||||
}
|
||||
})
|
||||
|
||||
.controller("WorkorderAddCtrl", function($scope, $location, Workorders, Schedule, Clients, Users) {
|
||||
.controller("WorkorderAddCtrl", function($scope, $location, $filter, Workorders, Schedule, Clients, Users) {
|
||||
|
||||
$scope.emailsOptions = {
|
||||
'multiple': true,
|
||||
@ -864,19 +917,46 @@ angular.module('biomed')
|
||||
}
|
||||
}
|
||||
|
||||
if ($scope.model.client) {
|
||||
Clients.get({ id: $scope.model.client }, function(item) {
|
||||
$scope.clientPicker = {id: item._id, text: item.name + " (" + item.identifier + ")", data: item};
|
||||
});
|
||||
}
|
||||
|
||||
updateAllUsers();
|
||||
updateUsers();
|
||||
|
||||
$scope.$watch('group', updateUsers);
|
||||
|
||||
$scope.$watch('model.client', function() {
|
||||
$scope.currentClient = Clients.get({ id: $scope.model.client });
|
||||
$scope.$watch('clientPicker', function() {
|
||||
if ($scope.clientPicker) {
|
||||
var client = $scope.clientPicker.data;
|
||||
$scope.model.client = client._id;
|
||||
$scope.currentClient = client;
|
||||
} else {
|
||||
$scope.model.client = null;
|
||||
$scope.currentClient = null;
|
||||
}
|
||||
});
|
||||
|
||||
Clients.index(function(result) {
|
||||
$scope.clients = result;
|
||||
});
|
||||
|
||||
$scope.clientOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Client',
|
||||
minimumInputLength: 2,
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.clients, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item._id, text: item.name + " (" + item.identifier + ")", data: item});
|
||||
});
|
||||
query.callback({ results: results });
|
||||
}
|
||||
};
|
||||
|
||||
function convertToDate(date, time) {
|
||||
return moment(moment(date).format('YYYY-MM-DD') + 'T' + time).toDate();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/clients"><i class="icon-calendar"></i> Schedule</a><li>
|
||||
<li><a href="/schedule"><i class="icon-calendar"></i> Schedule</a><li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>Schedule</h1>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/clients"><i class="icon-briefcase"></i> Schedule</a><li>
|
||||
<li><a href="/schedule/pms"><i class="icon-briefcase"></i>Preventive Maintenance</a><li>
|
||||
<li><a href="/schedule/pms/report"><i class="icon-book"></i>Frequency Report</a></li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>Preventive Maintenance</h1>
|
||||
@ -32,6 +33,7 @@
|
||||
<option value="Quarterly">Quarterly</option>
|
||||
<option value="RAE">RAE</option>
|
||||
<option value="Semi">Semi</option>
|
||||
<option value="Sterilizer - Cleaning">Sterilizer - Cleaning</option>
|
||||
<option value="Sterilizer - F">Sterilizer - F</option>
|
||||
<option value="Sterilizer - TT">Sterilizer - TT</option>
|
||||
<option value="Vaporizer">Vaporizer</option>
|
||||
|
73
public/partials/schedule/report.html
Normal file
73
public/partials/schedule/report.html
Normal file
@ -0,0 +1,73 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/schedule/pms"><i class="icon-briefcase"></i>Preventive Maintenance</a><li>
|
||||
<li><a href="/schedule/pms/report"><i class="icon-book"></i>Frequency Report</a></li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>Frequency Report</h1>
|
||||
</header>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="toolbelt">
|
||||
<span class="toolbelt-text">Frequency:</span>
|
||||
<select ng-model="frequency" name="frequency" class="input-xlarge">
|
||||
<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 - Cleaning">Sterilizer - Cleaning</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>
|
||||
<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="">All</option>
|
||||
<option value="0">January</option>
|
||||
<option value="1">February</option>
|
||||
<option value="2">March</option>
|
||||
<option value="3">April</option>
|
||||
<option value="4">May</option>
|
||||
<option value="5">June</option>
|
||||
<option value="6">July</option>
|
||||
<option value="7">August</option>
|
||||
<option value="8">September</option>
|
||||
<option value="9">October</option>
|
||||
<option value="10">November</option>
|
||||
<option value="11">December</option>
|
||||
</select>
|
||||
<span class="add-on"><i class="icon-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="biomed-table" infinite-scroll="addItems()" can-load="canLoad" threshold="300">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 60%" ng-class="selectedCls('name')" ng-click="changeSorting('name')">Client Name</th>
|
||||
<th style="width: 25%" ng-class="selectedCls('contacts[0].name')" ng-click="changeSorting('contacts[0].name')">Contact</th>
|
||||
<th style="width: 15%" ng-class="selectedCls('contacts[0].phone')" ng-click="changeSorting('contacts[0].phone')">Phone</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-show="loading"><td colspan="3" class="table-loading"><i class="loader"></i></td></tr>
|
||||
<tr ng-hide="loading || pms.length"><td colspan="3" 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>{{pm.name}} ({{pm.identifier | uppercase}})</td>
|
||||
<td>{{pm.contacts[0].name}}</td>
|
||||
<td>{{pm.contacts[0].phone}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -16,9 +16,7 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label">Client</label>
|
||||
<div class="controls">
|
||||
<select ui-select2 ng-model="model.client" data-placeholder="Choose a Client" class="input-xxlarge">
|
||||
<option ng-repeat="client in clients" value="{{client._id}}">{{client.name}} ({{client.identifier}})</option>
|
||||
</select>
|
||||
<input type="hidden" ng-model="clientPicker" ui-select2="clientOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" ng-show="currentClient.address">
|
||||
@ -301,8 +299,8 @@
|
||||
<div class="form-section">
|
||||
<div class="section-label"> </div>
|
||||
<div class="section-container">
|
||||
<button ng-click="save(false)" type="button" class="btn btn-primary">Save</button>
|
||||
<button ng-click="save(true)" type="button" class="btn">Save & Notify</button>
|
||||
<button ng-disabled="!model.client" ng-click="save(false)" type="button" class="btn btn-primary">Save</button>
|
||||
<button ng-disabled="!model.client" ng-click="save(true)" type="button" class="btn">Save & Notify</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user