Updated Project calculation for hours and progress.

This commit is contained in:
Paolo Arena
2019-04-06 21:52:27 +02:00
parent f632259c05
commit f60edc1c5b
11 changed files with 42 additions and 50 deletions

View File

@@ -43,10 +43,6 @@ export default class SingleProject extends Vue {
@Prop({ required: true }) public itemproject: IProject
// @Watch('itemproject.completed') valueChanged() {
// this.watchupdate('status')
// }
@Watch('itemproject.enableExpiring') public valueChanged4() {
this.watchupdate('enableExpiring')
}
@@ -108,7 +104,7 @@ export default class SingleProject extends Vue {
}
public watchupdate(field = '') {
console.log('watchupdate', field)
console.log('watchupdate PROJ', field)
this.$emit('eventupdateproj', {myitem: this.itemproject, field } )
this.updateicon()
}
@@ -138,7 +134,7 @@ export default class SingleProject extends Vue {
this.clButtPopover = this.sel ? 'pos-item-popover comp_selected' : 'pos-item-popover'
if (this.itemproject.status !== tools.Status.COMPLETED) {
if (this.itemproject.statusproj !== tools.Status.COMPLETED) {
this.clButtPopover += ' pos-item-popover_cursor'
}
@@ -386,16 +382,14 @@ export default class SingleProject extends Vue {
public setCompleted() {
// console.log('setCompleted')
if (this.itemproject.status === tools.Status.COMPLETED) {
this.itemproject.status = tools.Status.OPENED
if (this.itemproject.statusproj === tools.Status.COMPLETED) {
this.itemproject.statusproj = tools.Status.OPENED
} else {
this.itemproject.status = tools.Status.COMPLETED
this.itemproject.statusproj = tools.Status.COMPLETED
}
this.updateicon()
this.updatedata('status')
this.deselectAndExitEdit()
}

View File

@@ -69,7 +69,7 @@
v-for="(mytodo, index) in items_dacompletare(categoryAtt)"
:key="mytodo._id" class="myitemdrag">
<div v-if="(prior !== mytodo.priority) && mytodo.status !== tools.Status.COMPLETED"
<div v-if="(prior !== mytodo.priority) && mytodo.statustodo !== tools.Status.COMPLETED"
:class="tools.getTitlePriority(mytodo.priority)">
<label>{{tools.getPriorityByInd(mytodo.priority)}}</label>
</div>
@@ -79,7 +79,7 @@
<!--<div :nametranslate="`REF${index}`" class="divdrag non-draggato"></div>-->
<div style="display: none">{{ prior = mytodo.priority, priorcomplet = (mytodo.status === tools.Status.COMPLETED) }}
<div style="display: none">{{ prior = mytodo.priority, priorcomplet = (mytodo.statustodo === tools.Status.COMPLETED) }}
</div>
</div>
</div>
@@ -101,7 +101,7 @@
<!--<div :nametranslate="`REF${index}`" class="divdrag non-draggato"></div>-->
<div style="display: none">{{ prior = mytodo.priority, priorcomplet = (mytodo.status === tools.Status.COMPLETED) }}
<div style="display: none">{{ prior = mytodo.priority, priorcomplet = (mytodo.statustodo === tools.Status.COMPLETED) }}
</div>
</div>
</div>

View File

@@ -49,10 +49,6 @@ export default class SingleTodo extends Vue {
@Prop({ required: true }) public itemtodo: ITodo
// @Watch('itemtodo.completed') valueChanged() {
// this.watchupdate('status')
// }
@Watch('itemtodo.enableExpiring') public valueChanged4() {
this.watchupdate('enableExpiring')
}
@@ -74,9 +70,10 @@ export default class SingleTodo extends Vue {
console.log('itemtodo.hoursplanned', this.itemtodo.hoursplanned)
this.watchupdate('hoursplanned')
}
@Watch('itemtodo.status') public valueChangedstatus() {
console.log('itemtodo.status', this.itemtodo.status)
this.watchupdate('status')
// ++TODO: FIX! STATUSTODO WILL NOT UPDATE IF I DON'T PUT { immediate: true } parameter. ! WHY???
@Watch('itemtodo.statustodo', {immediate: true}) public valueChangedstatus() {
console.log('itemtodo.statustodo', this.itemtodo.statustodo)
this.watchupdate('statustodo')
}
@Watch('itemtodo.completed_at') public valueChangedcompleted_at() {
console.log('itemtodo.completed_at', this.itemtodo.completed_at)
@@ -145,7 +142,7 @@ export default class SingleTodo extends Vue {
this.classExpiring = 'flex-item data-item shadow-1 hide-if-small'
this.classExpiringEx = ''
if (this.itemtodo.status === tools.Status.COMPLETED) {
if (this.itemtodo.statustodo === tools.Status.COMPLETED) {
this.percentageProgress = 100
this.classCompleted += ' icon_completed'
this.classDescr += ' status_completed'
@@ -162,7 +159,7 @@ export default class SingleTodo extends Vue {
let mycolcl = ' ' + tools.getProgressClassColor(this.itemtodo.progress)
this.colProgress = tools.getProgressColor(this.itemtodo.progress)
if (this.itemtodo.status === tools.Status.COMPLETED) {
if (this.itemtodo.statustodo === tools.Status.COMPLETED) {
mycolcl = ' percompleted'
this.colProgress = 'gray'
}
@@ -174,7 +171,7 @@ export default class SingleTodo extends Vue {
this.clButtPopover = this.sel ? 'pos-item-popover comp_selected' : 'pos-item-popover'
if (this.itemtodo.status !== tools.Status.COMPLETED) {
if (this.itemtodo.statustodo !== tools.Status.COMPLETED) {
this.clButtPopover += ' pos-item-popover_cursor'
}
@@ -271,7 +268,7 @@ export default class SingleTodo extends Vue {
}
public editTodo() {
if (this.itemtodo.status !== tools.Status.COMPLETED) {
if (this.itemtodo.statustodo !== tools.Status.COMPLETED) {
// console.log('INIZIO - editTodo')
this.$emit('click')
this.precDescr = this.itemtodo.descr
@@ -407,11 +404,12 @@ export default class SingleTodo extends Vue {
public setCompleted() {
// console.log('setCompleted')
if (this.itemtodo.status === tools.Status.COMPLETED) {
this.itemtodo.status = tools.Status.OPENED
if (this.itemtodo.statustodo === tools.Status.COMPLETED) {
this.itemtodo.statustodo = tools.Status.OPENED
} else {
this.itemtodo.status = tools.Status.COMPLETED
this.itemtodo.statustodo = tools.Status.COMPLETED
}
this.watchupdate('statustodo')
this.deselectAndExitEdit()
}
@@ -424,7 +422,7 @@ export default class SingleTodo extends Vue {
public updateicon() {
// console.log('updateicon')
if (this.itemtodo.status === tools.Status.COMPLETED) {
if (this.itemtodo.statustodo === tools.Status.COMPLETED) {
this.iconCompleted = 'check_circle'
}
else {

View File

@@ -4,12 +4,12 @@
<q-btn push flat
:class="classCompleted"
:icon="iconCompleted"
@click.native="setCompleted">
@click="setCompleted">
</q-btn>
</div>
<div class="flex-item donotdrag divdescrTot">
<q-input v-if="sel && itemtodo.status !== tools.Status.COMPLETED" hide-underline type="textarea" ref="inputdescr"
<q-input v-if="sel && itemtodo.statustodo !== tools.Status.COMPLETED" hide-underline type="textarea" ref="inputdescr"
v-model.trim="precDescr"
autogrow
borderless

View File

@@ -15,7 +15,7 @@
<q-checkbox v-model="itemtodo.enableExpiring"/>
</q-item-section>
<q-item-section side v-if="field.value === 110">
<q-checkbox v-model="itemtodo.status"/>
<q-checkbox v-model="itemtodo.statustodo"/>
</q-item-section>
</q-item>
<q-item clickable v-if="(field.value === 120)" :icon="field.icon"