Conformance: feature task clear but after apply need to trued.
This commit is contained in:
@@ -18,8 +18,18 @@
|
||||
</div>
|
||||
<!-- select result -->
|
||||
<ConformanceSelectResult></ConformanceSelectResult>
|
||||
<p>selectConformanceTask: {{ selectConformanceTask }}</p>
|
||||
<p>selectConformanceStartAndEnd: {{ selectConformanceStartAndEnd }}</p>
|
||||
<p>selectConformanceStart: {{ selectConformanceStart }}</p>
|
||||
<p>selectConformanceEnd: {{ selectConformanceEnd }}</p>
|
||||
<p>selectConformanceFrom: {{ selectConformanceFrom }}</p>
|
||||
<p>selectConformanceTo: {{ selectConformanceTo }}</p>
|
||||
<p>listSeq: {{ listSeq }}</p>
|
||||
<p>isSubmit: {{ isSubmit }}</p>
|
||||
<p>isSubmitListSeq: {{ isSubmitListSeq }}</p>
|
||||
<p>isSubmitStartAndEnd: {{ isSubmitStartAndEnd }}</p>
|
||||
<!-- time range -->
|
||||
<ConformanceTimeRange v-if="selectedRuleType === 'Activity duration' || selectedRuleType === 'Processing time' || selectedRuleType === 'Waiting time' || selectedRuleType === 'Cycle time'"></ConformanceTimeRange>
|
||||
<ConformanceTimeRange v-if="selectedRuleType === 'Activity duration' || selectedRuleType === 'Processing time' || selectedRuleType === 'Waiting time' || selectedRuleType === 'Cycle time'" :time="selectDurationTime"></ConformanceTimeRange>
|
||||
</div>
|
||||
<!-- button -->
|
||||
<div class="space-x-4 p-4 flex justify-center items-content border-t border-neutral-300">
|
||||
@@ -28,8 +38,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- show bar -->
|
||||
<ConformanceShowBar :class="isShowBar?'':'hidden'" :selectConformanceTask="selectConformanceTask" :selectConformanceStartAndEnd="selectConformanceStartAndEnd" :selectConformanceStart="selectConformanceStart" :selectConformanceEnd="selectConformanceEnd" :selectConformanceFrom="selectConformanceFrom" :selectConformanceTo="selectConformanceTo"
|
||||
:listSeq="listSeq"></ConformanceShowBar>
|
||||
<ConformanceShowBar :class="isShowBar?'':'hidden'"
|
||||
:isSubmit="isSubmit"
|
||||
:isSubmitTask="isSubmitTask"
|
||||
:isSubmitStartAndEnd="isSubmitStartAndEnd"
|
||||
:isSubmitListSeq="isSubmitListSeq"
|
||||
:isSubmitDurationData="isSubmitDurationData"
|
||||
></ConformanceShowBar>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -48,9 +63,9 @@ export default {
|
||||
const loadingStore = LoadingStore();
|
||||
const conformanceStore = ConformanceStore();
|
||||
const { isLoading } = storeToRefs(loadingStore);
|
||||
const { selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo } = storeToRefs(conformanceStore);
|
||||
const { selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceAllTasks } = storeToRefs(conformanceStore);
|
||||
|
||||
return { isLoading, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceStore }
|
||||
return { isLoading, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceStore, conformanceAllTasks }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -63,6 +78,13 @@ export default {
|
||||
selectConformanceFrom: null,
|
||||
selectConformanceTo: null,
|
||||
listSeq: [],
|
||||
selectDurationData: null,
|
||||
selectDurationTime: null,
|
||||
isSubmit: false,
|
||||
isSubmitTask: null,
|
||||
isSubmitStartAndEnd: null,
|
||||
isSubmitListSeq: [],
|
||||
isSubmitDurationData: null,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -72,17 +94,29 @@ export default {
|
||||
ConformanceSelectResult,
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* get Activity duration Time Range(duration)
|
||||
* @param {string} task
|
||||
* @returns {object} {min:12, max:345}
|
||||
*/
|
||||
getDurationTime(task) {
|
||||
this.conformanceAllTasks.forEach(i => {
|
||||
if(i.label === task) this.selectDurationTime = i.duration;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* @param {boolean} massage true | false 清空選單選項, 選擇的結果
|
||||
*/
|
||||
reset() {
|
||||
// Results page Cover Plate
|
||||
this.$emitter.emit('coverPlate', true);
|
||||
// Results page Cover Plate
|
||||
this.$emitter.emit('coverPlate', true);
|
||||
// Have activity
|
||||
this.selectConformanceTask = null;
|
||||
this.isSubmitTask = null;
|
||||
// Activity sequence
|
||||
this.selectConformanceStartAndEnd = null;
|
||||
this.listSeq = null;
|
||||
this.isSubmitStartAndEnd = null;
|
||||
this.isSubmitListSeq = [];
|
||||
// isSubmit
|
||||
this.isSubmit = false;
|
||||
|
||||
// 其他子元件 reset
|
||||
this.$emitter.emit('reset', null);
|
||||
@@ -114,30 +148,38 @@ export default {
|
||||
|
||||
if(this.selectedRuleType === 'Have activity') { // Activity Sequence 選 Have activity(s) 的行為
|
||||
if(!this.selectConformanceTask?.length) return this.$toast.error('Not selected.');
|
||||
else data = {
|
||||
type: 'contains-tasks',
|
||||
tasks: this.selectConformanceTask,
|
||||
};
|
||||
else {
|
||||
data = {
|
||||
type: 'contains-tasks',
|
||||
tasks: this.selectConformanceTask,
|
||||
};
|
||||
this.isSubmitTask = this.selectConformanceTask;
|
||||
}
|
||||
}else if(this.selectedRuleType === 'Activity sequence') { // Activity Sequence 選 Start & End 的行為
|
||||
if(this.selectedActivitySequence === 'Start & End'){
|
||||
if(this.selectConformanceStartAndEnd === null || this.selectConformanceStartAndEnd.length === 0) return this.$toast.error('Both Start and End must be selected.');
|
||||
else data = {
|
||||
type: 'start-end',
|
||||
starts_with: this.selectConformanceStartAndEnd[0],
|
||||
ends_with: this.selectConformanceStartAndEnd[1],
|
||||
};
|
||||
else {
|
||||
data = {
|
||||
type: 'start-end',
|
||||
starts_with: this.selectConformanceStartAndEnd[0],
|
||||
ends_with: this.selectConformanceStartAndEnd[1],
|
||||
};
|
||||
this.isSubmitStartAndEnd = this.selectConformanceStartAndEnd;
|
||||
}
|
||||
}else if(this.selectedActivitySequence === 'Sequence'){ // Activity Sequence 選 Sequence 的行為
|
||||
if(this.listSeq.length < 2) return this.$toast.error('Select two or more.');
|
||||
else {
|
||||
data = {
|
||||
type: isMode,
|
||||
task_seq: this.listSeq,
|
||||
}
|
||||
};
|
||||
this.isSubmitListSeq = this.listSeq;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.isLoading = true;
|
||||
this.isSubmit = true;
|
||||
await this.conformanceStore.addLogConformanceTempCheckerId(data);
|
||||
await this.conformanceStore.getLogConformanceTempReport();
|
||||
this.isShowBar = false;
|
||||
@@ -148,7 +190,7 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
// this.isShowBar = true;
|
||||
this.isShowBar = true;
|
||||
this.$emitter.on('actListData', (data) => {
|
||||
this.selectConformanceTask = data;
|
||||
});
|
||||
@@ -167,6 +209,11 @@ export default {
|
||||
this.selectConformanceTo = data.task;
|
||||
break;
|
||||
default:
|
||||
if(this.selectedRuleType === 'Activity sequence') this.listSequence = [data.task];
|
||||
else if(this.selectedRuleType === 'Activity duration') {
|
||||
this.selectDurationData = [data.task];
|
||||
this.getDurationTime(data.task);
|
||||
};
|
||||
break;
|
||||
};
|
||||
if(this.selectConformanceStart !== null && this.selectConformanceEnd !== null){
|
||||
@@ -175,7 +222,27 @@ export default {
|
||||
});
|
||||
this.$emitter.on('getListSequence', (data) => {
|
||||
this.listSeq = data;
|
||||
})
|
||||
});
|
||||
// Radio 切換時,資料要清空
|
||||
this.$emitter.on('isRadioChange', (data) => {
|
||||
if(data) {
|
||||
this.selectConformanceTask = null;
|
||||
this.selectConformanceStartAndEnd = null;
|
||||
this.selectConformanceStart = null;
|
||||
this.selectConformanceEnd = null;
|
||||
this.selectConformanceFrom = null;
|
||||
this.selectConformanceTo = null;
|
||||
this.listSeq = [];
|
||||
this.selectDurationData = null;
|
||||
this.selectDurationTime = null;
|
||||
};
|
||||
});
|
||||
this.$emitter.on('isRadioSeqChange', (data) => {
|
||||
if(data) {
|
||||
this.selectConformanceStartAndEnd = null;
|
||||
this.listSeq = [];
|
||||
};
|
||||
});
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user