feat: CRUD work

This commit is contained in:
puriphatt 2024-06-21 11:06:35 +00:00
parent 12e52e4a79
commit 2fb345e78f
3 changed files with 115 additions and 55 deletions

View file

@ -180,6 +180,7 @@ const serviceTab = [
];
const workItems = ref<WorkItems[]>([]);
const workNameRef = ref();
const currentServiceTab = ref('serviceInformation');
const propertiesDialog = ref<boolean>(false);
@ -605,6 +606,32 @@ async function submitGroup() {
clearFormGroup();
}
function confirmDeleteWork(id: string) {
dialog({
color: 'negative',
icon: 'mdi-alert',
title: t('deleteConfirmTitle'),
actionText: t('delete'),
message: t('deleteConfirmMessage'),
action: async () => {
deleteWork(id);
},
cancel: () => {},
});
}
function confirmCloseWork() {
dialog({
color: 'negative',
icon: 'mdi-alert',
title: t('deleteConfirmTitle'),
actionText: t('delete'),
message: t('deleteConfirmMessage'),
action: async () => {},
cancel: () => {},
});
}
const tempValueProperties = ref<Attributes>({
additional: [],
});
@ -1584,7 +1611,6 @@ watch(currentStatus, async () => {
<ServiceProperties
v-model:properties-option="propertiesOption"
v-model:form-service-properties="tempValueProperties"
@add-properties="console.log('')"
/>
</FormDialog>
@ -1592,11 +1618,18 @@ watch(currentStatus, async () => {
<FormDialog
no-address
no-app-box
no-footer
width="65%"
title="จัดการ"
v-model:modal="manageWorkNameDialog"
>
<WorkNameManagement />
<WorkNameManagement
ref="workNameRef"
v-model:nameList="workNameItems"
@delete="confirmDeleteWork"
@edit="editWork"
@add="createWork"
/>
</FormDialog>
<!-- edit service -->