feat: custom worker count (#46)
* feat: add worker max type * feat: add default worker max * refactor: support adjustable worker max * refactor: bind worker max to form data
This commit is contained in:
parent
6d77c1a19d
commit
7817f8bd40
4 changed files with 33 additions and 13 deletions
|
|
@ -1,17 +1,17 @@
|
|||
<script lang="ts" setup>
|
||||
import { QTableProps } from 'quasar';
|
||||
import TableComponents from 'src/components/TableComponents.vue';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
defineEmits<{
|
||||
(e: 'delete', index: number): void;
|
||||
(e: 'check', index: number): void;
|
||||
}>();
|
||||
|
||||
const employeeAmount = defineModel<number>('employeeAmount', { default: 1 });
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
readonly?: boolean;
|
||||
employeeAmount?: number;
|
||||
fallbackImg?: string;
|
||||
hideQuantity?: boolean;
|
||||
checkable?: boolean;
|
||||
|
|
@ -30,7 +30,6 @@ withDefaults(
|
|||
}>(),
|
||||
{
|
||||
rows: () => [],
|
||||
employeeAmount: 0,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -157,15 +156,22 @@ const columns = [
|
|||
</TableComponents>
|
||||
|
||||
<div v-if="!hideQuantity" class="row q-pt-md items-center">
|
||||
<span class="q-ml-auto">
|
||||
<span class="q-ml-auto q-mr-sm">
|
||||
{{ $t('general.numberOf', { msg: $t('quotation.employee') }) }}
|
||||
</span>
|
||||
<div
|
||||
class="surface-tab bordered rounded flex items-center justify-center q-mx-md"
|
||||
style="width: 30px; height: 30px"
|
||||
>
|
||||
{{ employeeAmount || '0' }}
|
||||
</div>
|
||||
|
||||
<q-input
|
||||
for="worker-count"
|
||||
dense
|
||||
outlined
|
||||
style="width: 67px"
|
||||
:type="readonly ? 'text' : 'number'"
|
||||
class="col-1"
|
||||
input-class="text-center"
|
||||
:readonly
|
||||
hide-bottom-space
|
||||
v-model="employeeAmount"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue