feat(device): update list
This commit is contained in:
No files matched your search
@@ -76,13 +76,13 @@ function onCancelForm() {
|
|||||||
<Cell>
|
<Cell>
|
||||||
<Label height="compact">Kode</Label>
|
<Label height="compact">Kode</Label>
|
||||||
<Field :errMessage="errors.code">
|
<Field :errMessage="errors.code">
|
||||||
<Input id="code" v-model="code" v-bind="codeAttrs" :disabled="isLoading" />
|
<Input id="code" v-model="code" v-bind="codeAttrs" :disabled="isLoading || isReadonly" />
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>
|
||||||
<Label height="compact">Nama</Label>
|
<Label height="compact">Nama</Label>
|
||||||
<Field :errMessage="errors.name">
|
<Field :errMessage="errors.name">
|
||||||
<Input id="name" v-model="name" v-bind="nameAttrs" :disabled="isLoading" />
|
<Input id="name" v-model="name" v-bind="nameAttrs" :disabled="isLoading || isReadonly" />
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>
|
||||||
@@ -95,13 +95,13 @@ function onCancelForm() {
|
|||||||
v-model="uom"
|
v-model="uom"
|
||||||
v-bind="uomAttrs"
|
v-bind="uomAttrs"
|
||||||
:items="uoms"
|
:items="uoms"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Block>
|
</Block>
|
||||||
<div class="my-2 flex justify-end gap-2 py-2">
|
<div class="my-2 flex justify-end gap-2 py-2">
|
||||||
<Button variant="secondary" class="w-[120px]" @click="onCancelForm"> Kembali </Button>
|
<Button type="button" variant="secondary" class="w-[120px]" @click="onCancelForm"> Kembali </Button>
|
||||||
<Button
|
<Button
|
||||||
v-if="!isReadonly"
|
v-if="!isReadonly"
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/dat
|
|||||||
|
|
||||||
export const cols: Col[] = [{ width: 100 }, { width: 250 }, { width: 100 }, { width: 50 }]
|
export const cols: Col[] = [{ width: 100 }, { width: 250 }, { width: 100 }, { width: 50 }]
|
||||||
|
|
||||||
export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Satuan' }]]
|
export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Satuan' }, { label: '' }]]
|
||||||
|
|
||||||
export const keys = ['code', 'name', 'uom_code', 'action']
|
export const keys = ['code', 'name', 'uom_code', 'action']
|
||||||
|
|
||||||
@@ -28,10 +28,6 @@ export const funcParsed: Record<string, (row: any, ...args: any[]) => any> = {
|
|||||||
const recX = rec as SmallDetailDto
|
const recX = rec as SmallDetailDto
|
||||||
return `${recX.name}`.trim()
|
return `${recX.name}`.trim()
|
||||||
},
|
},
|
||||||
item_id: (rec: unknown): unknown => {
|
|
||||||
const recX = rec as SmallDetailDto
|
|
||||||
return recX.item_id
|
|
||||||
},
|
|
||||||
uom_code: (rec: unknown): unknown => {
|
uom_code: (rec: unknown): unknown => {
|
||||||
const recX = rec as SmallDetailDto
|
const recX = rec as SmallDetailDto
|
||||||
return recX.uom_code
|
return recX.uom_code
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ provide('rec_action', recAction)
|
|||||||
provide('rec_item', recItem)
|
provide('rec_item', recItem)
|
||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
// Watch for row actions
|
// Watch for row actions when recId or recAction changes
|
||||||
watch(recId, () => {
|
watch([recId, recAction], () => {
|
||||||
switch (recAction.value) {
|
switch (recAction.value) {
|
||||||
case ActionEvents.showDetail:
|
case ActionEvents.showDetail:
|
||||||
getEquipmentDetail(recId.value)
|
getEquipmentDetail(recId.value)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import AppToolsEntryForm from '~/components/app/tools/entry-form.vue'
|
|||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
import { toast } from "~/components/pub/ui/toast"
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import type { Uom } from '~/models/uom'
|
import type { Uom } from '~/models/uom'
|
||||||
@@ -40,7 +40,6 @@ const getToolsDetail = async (id: number | string) => {
|
|||||||
if (result.success) {
|
if (result.success) {
|
||||||
const currentDevice = result.body?.data || {}
|
const currentDevice = result.body?.data || {}
|
||||||
recItem.value = currentDevice
|
recItem.value = currentDevice
|
||||||
isFormEntryDialogOpen.value = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,17 +103,19 @@ provide('rec_item', recItem)
|
|||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
// Watch for row actions
|
// Watch for row actions
|
||||||
watch(recId, () => {
|
watch([recId, recAction], () => {
|
||||||
switch (recAction.value) {
|
switch (recAction.value) {
|
||||||
case ActionEvents.showDetail:
|
case ActionEvents.showDetail:
|
||||||
getToolsDetail(recId.value)
|
getToolsDetail(recId.value)
|
||||||
title.value = 'Detail Peralatan'
|
title.value = 'Detail Peralatan'
|
||||||
isReadonly.value = true
|
isReadonly.value = true
|
||||||
|
isFormEntryDialogOpen.value = true
|
||||||
break
|
break
|
||||||
case ActionEvents.showEdit:
|
case ActionEvents.showEdit:
|
||||||
getToolsDetail(recId.value)
|
getToolsDetail(recId.value)
|
||||||
title.value = 'Edit Peralatan'
|
title.value = 'Edit Peralatan'
|
||||||
isReadonly.value = false
|
isReadonly.value = false
|
||||||
|
isFormEntryDialogOpen.value = true
|
||||||
break
|
break
|
||||||
case ActionEvents.showConfirmDelete:
|
case ActionEvents.showConfirmDelete:
|
||||||
isRecordConfirmationOpen.value = true
|
isRecordConfirmationOpen.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user