feat: add support for 'Restart' task status in task order management
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 10s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 10s
This commit is contained in:
parent
d4d8f0268e
commit
16bcecc8d6
3 changed files with 59 additions and 18 deletions
|
|
@ -113,7 +113,8 @@ function handleCheckAll() {
|
||||||
validate
|
validate
|
||||||
? status === TaskStatus.Success ||
|
? status === TaskStatus.Success ||
|
||||||
status === TaskStatus.Complete ||
|
status === TaskStatus.Complete ||
|
||||||
status === TaskStatus.Redo
|
status === TaskStatus.Redo ||
|
||||||
|
status === TaskStatus.Restart
|
||||||
: status === TaskStatus.Failed ||
|
: status === TaskStatus.Failed ||
|
||||||
status === TaskStatus.Success ||
|
status === TaskStatus.Success ||
|
||||||
status === TaskStatus.Complete ||
|
status === TaskStatus.Complete ||
|
||||||
|
|
@ -196,6 +197,7 @@ function handleCheck(
|
||||||
row.taskStatus === TaskStatus.Success ||
|
row.taskStatus === TaskStatus.Success ||
|
||||||
row.taskStatus === TaskStatus.Complete ||
|
row.taskStatus === TaskStatus.Complete ||
|
||||||
row.taskStatus === TaskStatus.Redo ||
|
row.taskStatus === TaskStatus.Redo ||
|
||||||
|
row.taskStatus === TaskStatus.Restart ||
|
||||||
(selectedEmployee.value.length > 0 &&
|
(selectedEmployee.value.length > 0 &&
|
||||||
selectedEmployee.value.some((v) => v._template?.id !== row._template?.id))
|
selectedEmployee.value.some((v) => v._template?.id !== row._template?.id))
|
||||||
) {
|
) {
|
||||||
|
|
@ -311,7 +313,7 @@ function disableCheckAll() {
|
||||||
class=""
|
class=""
|
||||||
>
|
>
|
||||||
<q-menu :offset="[0, 4]">
|
<q-menu :offset="[0, 4]">
|
||||||
<q-list v-if="validate">
|
<q-list v-if="validate" dense>
|
||||||
<q-item
|
<q-item
|
||||||
v-if="
|
v-if="
|
||||||
!selectedEmployee.some(
|
!selectedEmployee.some(
|
||||||
|
|
@ -355,6 +357,25 @@ function disableCheckAll() {
|
||||||
></q-icon>
|
></q-icon>
|
||||||
{{ $t(`taskOrder.status.Redo`) }}
|
{{ $t(`taskOrder.status.Redo`) }}
|
||||||
</q-item>
|
</q-item>
|
||||||
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
class="items-center"
|
||||||
|
@click="
|
||||||
|
$emit('changeAllStatus', {
|
||||||
|
data: selectedEmployee,
|
||||||
|
status: TaskStatus.Restart,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<q-icon
|
||||||
|
style="color: hsl(var(--negative-bg))"
|
||||||
|
name="mdi-file-remove-outline"
|
||||||
|
class="q-pr-sm"
|
||||||
|
size="xs"
|
||||||
|
></q-icon>
|
||||||
|
{{ $t(`taskOrder.status.Restart`) }}
|
||||||
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
<q-list v-if="!validate" dense>
|
<q-list v-if="!validate" dense>
|
||||||
<q-item
|
<q-item
|
||||||
|
|
@ -445,6 +466,7 @@ function disableCheckAll() {
|
||||||
props.row.taskStatus === TaskStatus.Success ||
|
props.row.taskStatus === TaskStatus.Success ||
|
||||||
props.row.taskStatus === TaskStatus.Complete ||
|
props.row.taskStatus === TaskStatus.Complete ||
|
||||||
props.row.taskStatus === TaskStatus.Redo ||
|
props.row.taskStatus === TaskStatus.Redo ||
|
||||||
|
props.row.taskStatus === TaskStatus.Restart ||
|
||||||
(selectedEmployee.length > 0 &&
|
(selectedEmployee.length > 0 &&
|
||||||
selectedEmployee.some(
|
selectedEmployee.some(
|
||||||
(v) => v._template?.id !== props.row._template?.id,
|
(v) => v._template?.id !== props.row._template?.id,
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,8 @@ function inactiveCheck() {
|
||||||
currStatus.value?.value === TaskStatus.Redo ||
|
currStatus.value?.value === TaskStatus.Redo ||
|
||||||
currStatus.value?.value === TaskStatus.Success ||
|
currStatus.value?.value === TaskStatus.Success ||
|
||||||
currStatus.value?.value === TaskStatus.Complete ||
|
currStatus.value?.value === TaskStatus.Complete ||
|
||||||
currStatus.value?.value === TaskStatus.Canceled
|
currStatus.value?.value === TaskStatus.Canceled ||
|
||||||
|
currStatus.value?.value === TaskStatus.Restart
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -227,6 +227,7 @@ const messengerListGroup = computed(() =>
|
||||||
});
|
});
|
||||||
|
|
||||||
if (indexUser === -1) {
|
if (indexUser === -1) {
|
||||||
|
// If user does not exist in acc, create a new entry
|
||||||
acc.push({
|
acc.push({
|
||||||
responsibleUser: task.responsibleUser,
|
responsibleUser: task.responsibleUser,
|
||||||
list: [
|
list: [
|
||||||
|
|
@ -236,27 +237,38 @@ const messengerListGroup = computed(() =>
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
if (selectedEmployee.value.length < acc.length) {
|
} else {
|
||||||
selectedEmployee.value.push([[]]);
|
const userEntry = acc[indexUser];
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (indexUser !== -1) {
|
// Find product in user's list
|
||||||
const indexProduct = acc[indexUser].list.findIndex(
|
const indexProduct = userEntry.list.findIndex(
|
||||||
(v) => v.product.id === task.requestWork.productService.product.id,
|
(v) => v.product.id === task.requestWork.productService.product.id,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (indexProduct === -1) {
|
if (indexProduct === -1) {
|
||||||
acc[indexUser].list.push({
|
// If product does not exist in user's list, add it
|
||||||
|
userEntry.list.push({
|
||||||
product: task.requestWork.productService.product,
|
product: task.requestWork.productService.product,
|
||||||
list: [record],
|
list: [record],
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
// Append task to the correct product's list
|
||||||
if (indexProduct !== -1) {
|
userEntry.list[indexProduct].list.push(record);
|
||||||
acc[indexUser].list[indexProduct].list.push(record);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure `selectedEmployee.value` grows dynamically
|
||||||
|
while (selectedEmployee.value.length < acc.length) {
|
||||||
|
selectedEmployee.value.push([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
acc.forEach((accItem, index) => {
|
||||||
|
const length = accItem.list.length;
|
||||||
|
|
||||||
|
while (selectedEmployee.value[index].length < length) {
|
||||||
|
selectedEmployee.value[index].push([]);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|
@ -1106,15 +1118,21 @@ watch(
|
||||||
step-on
|
step-on
|
||||||
:checkbox-on="
|
:checkbox-on="
|
||||||
view === TaskOrderStatus.Validate &&
|
view === TaskOrderStatus.Validate &&
|
||||||
fullTaskOrder?.userTask.find(
|
(fullTaskOrder?.userTask.find(
|
||||||
(l) => l.userId === v.responsibleUser.id,
|
(l) => l.userId === v.responsibleUser.id,
|
||||||
)?.userTaskStatus === UserTaskStatus.Submit
|
)?.userTaskStatus === UserTaskStatus.Submit ||
|
||||||
|
fullTaskOrder?.userTask.find(
|
||||||
|
(l) => l.userId === v.responsibleUser.id,
|
||||||
|
)?.userTaskStatus === UserTaskStatus.Restart)
|
||||||
"
|
"
|
||||||
:check-all="
|
:check-all="
|
||||||
view === TaskOrderStatus.Validate &&
|
(view === TaskOrderStatus.Validate &&
|
||||||
|
fullTaskOrder?.userTask.find(
|
||||||
|
(l) => l.userId === v.responsibleUser.id,
|
||||||
|
)?.userTaskStatus === UserTaskStatus.Submit) ||
|
||||||
fullTaskOrder?.userTask.find(
|
fullTaskOrder?.userTask.find(
|
||||||
(l) => l.userId === v.responsibleUser.id,
|
(l) => l.userId === v.responsibleUser.id,
|
||||||
)?.userTaskStatus === UserTaskStatus.Submit
|
)?.userTaskStatus === UserTaskStatus.Restart
|
||||||
"
|
"
|
||||||
:rows="sortList(list)"
|
:rows="sortList(list)"
|
||||||
@change-all-status="
|
@change-all-status="
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue