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
|
||||
? status === TaskStatus.Success ||
|
||||
status === TaskStatus.Complete ||
|
||||
status === TaskStatus.Redo
|
||||
status === TaskStatus.Redo ||
|
||||
status === TaskStatus.Restart
|
||||
: status === TaskStatus.Failed ||
|
||||
status === TaskStatus.Success ||
|
||||
status === TaskStatus.Complete ||
|
||||
|
|
@ -196,6 +197,7 @@ function handleCheck(
|
|||
row.taskStatus === TaskStatus.Success ||
|
||||
row.taskStatus === TaskStatus.Complete ||
|
||||
row.taskStatus === TaskStatus.Redo ||
|
||||
row.taskStatus === TaskStatus.Restart ||
|
||||
(selectedEmployee.value.length > 0 &&
|
||||
selectedEmployee.value.some((v) => v._template?.id !== row._template?.id))
|
||||
) {
|
||||
|
|
@ -311,7 +313,7 @@ function disableCheckAll() {
|
|||
class=""
|
||||
>
|
||||
<q-menu :offset="[0, 4]">
|
||||
<q-list v-if="validate">
|
||||
<q-list v-if="validate" dense>
|
||||
<q-item
|
||||
v-if="
|
||||
!selectedEmployee.some(
|
||||
|
|
@ -355,6 +357,25 @@ function disableCheckAll() {
|
|||
></q-icon>
|
||||
{{ $t(`taskOrder.status.Redo`) }}
|
||||
</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 v-if="!validate" dense>
|
||||
<q-item
|
||||
|
|
@ -445,6 +466,7 @@ function disableCheckAll() {
|
|||
props.row.taskStatus === TaskStatus.Success ||
|
||||
props.row.taskStatus === TaskStatus.Complete ||
|
||||
props.row.taskStatus === TaskStatus.Redo ||
|
||||
props.row.taskStatus === TaskStatus.Restart ||
|
||||
(selectedEmployee.length > 0 &&
|
||||
selectedEmployee.some(
|
||||
(v) => v._template?.id !== props.row._template?.id,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ function inactiveCheck() {
|
|||
currStatus.value?.value === TaskStatus.Redo ||
|
||||
currStatus.value?.value === TaskStatus.Success ||
|
||||
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 user does not exist in acc, create a new entry
|
||||
acc.push({
|
||||
responsibleUser: task.responsibleUser,
|
||||
list: [
|
||||
|
|
@ -236,27 +237,38 @@ const messengerListGroup = computed(() =>
|
|||
},
|
||||
],
|
||||
});
|
||||
if (selectedEmployee.value.length < acc.length) {
|
||||
selectedEmployee.value.push([[]]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const userEntry = acc[indexUser];
|
||||
|
||||
if (indexUser !== -1) {
|
||||
const indexProduct = acc[indexUser].list.findIndex(
|
||||
// Find product in user's list
|
||||
const indexProduct = userEntry.list.findIndex(
|
||||
(v) => v.product.id === task.requestWork.productService.product.id,
|
||||
);
|
||||
|
||||
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,
|
||||
list: [record],
|
||||
});
|
||||
}
|
||||
|
||||
if (indexProduct !== -1) {
|
||||
acc[indexUser].list[indexProduct].list.push(record);
|
||||
} else {
|
||||
// Append task to the correct product's list
|
||||
userEntry.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;
|
||||
|
|
@ -1106,15 +1118,21 @@ watch(
|
|||
step-on
|
||||
:checkbox-on="
|
||||
view === TaskOrderStatus.Validate &&
|
||||
fullTaskOrder?.userTask.find(
|
||||
(fullTaskOrder?.userTask.find(
|
||||
(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="
|
||||
view === TaskOrderStatus.Validate &&
|
||||
(view === TaskOrderStatus.Validate &&
|
||||
fullTaskOrder?.userTask.find(
|
||||
(l) => l.userId === v.responsibleUser.id,
|
||||
)?.userTaskStatus === UserTaskStatus.Submit) ||
|
||||
fullTaskOrder?.userTask.find(
|
||||
(l) => l.userId === v.responsibleUser.id,
|
||||
)?.userTaskStatus === UserTaskStatus.Submit
|
||||
)?.userTaskStatus === UserTaskStatus.Restart
|
||||
"
|
||||
:rows="sortList(list)"
|
||||
@change-all-status="
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue