|
@@ -1,4 +1,5 @@
|
|
|
const { pages } = require('@alancnet/material-framework/app/crud')
|
|
const { pages } = require('@alancnet/material-framework/app/crud')
|
|
|
|
|
+const { dollarIcon } = require('../assets')
|
|
|
|
|
|
|
|
pages({
|
|
pages({
|
|
|
camelName: 'staffMember',
|
|
camelName: 'staffMember',
|
|
@@ -35,26 +36,55 @@ pages({
|
|
|
{
|
|
{
|
|
|
inList: false,
|
|
inList: false,
|
|
|
camelName: 'wage',
|
|
camelName: 'wage',
|
|
|
- type: 'currency'
|
|
|
|
|
|
|
+ type: 'currency',
|
|
|
|
|
+ field: html`
|
|
|
|
|
+ <md-input-container flex ng-if="$ctrl.api.claims['INCOME_' + $ctrl.laborCategoryKey + '_VIEW']">
|
|
|
|
|
+ <label>Wage</label>
|
|
|
|
|
+ <input type="number" step="0.01" ng-model="model.wage" />
|
|
|
|
|
+ <md-icon md-svg-src="${dollarIcon}"></md-icon>
|
|
|
|
|
+ </md-input-container>
|
|
|
|
|
+ `
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
inList: false,
|
|
inList: false,
|
|
|
camelName: 'salary',
|
|
camelName: 'salary',
|
|
|
- type: 'currency'
|
|
|
|
|
|
|
+ type: 'currency',
|
|
|
|
|
+ field: html`
|
|
|
|
|
+ <md-input-container flex ng-if="$ctrl.api.claims['INCOME_' + $ctrl.laborCategoryKey + '_VIEW']">
|
|
|
|
|
+ <label>Salary</label>
|
|
|
|
|
+ <input type="number" step="0.01" ng-model="model.salary" />
|
|
|
|
|
+ <md-icon md-svg-src="${dollarIcon}"></md-icon>
|
|
|
|
|
+ </md-input-container>
|
|
|
|
|
+ `
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
|
|
+ controllers: {
|
|
|
|
|
+ details: function() {
|
|
|
|
|
+ this.loadingPromise.then(async () => {
|
|
|
|
|
+ const cats = await this.api.laborCategoryDictionary()
|
|
|
|
|
+ const unwatch = this.$scope.$watch('model.laborCategoryId', (laborCategoryId) => {
|
|
|
|
|
+ if (laborCategoryId) {
|
|
|
|
|
+ this.laborCategoryKey = cats[laborCategoryId].key
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.laborCategoryKey = null
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$scope.$on('$destroy', unwatch)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
layout: [
|
|
layout: [
|
|
|
{
|
|
{
|
|
|
section: null,
|
|
section: null,
|
|
|
rows: [
|
|
rows: [
|
|
|
- [ 'name', 'title', 'terminalId' ],
|
|
|
|
|
- [ 'wage', 'salary' ]
|
|
|
|
|
|
|
+ [ 'name', 'title', ],
|
|
|
|
|
+ [ 'laborCategoryId', 'terminalId' ]
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
section: 'Staffing information',
|
|
section: 'Staffing information',
|
|
|
rows: [
|
|
rows: [
|
|
|
- [ 'laborCategoryId', 'staffingAgencyId' ]
|
|
|
|
|
|
|
+ [ 'wage', 'salary', 'staffingAgencyId' ]
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|