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
|
|
@ -485,6 +485,7 @@ async function convertDataToFormSubmit() {
|
|||
|
||||
quotationFormData.value = {
|
||||
id: quotationFormData.value.id,
|
||||
workerMax: quotationFormData.value.workerMax,
|
||||
productServiceList: quotationFormData.value.productServiceList,
|
||||
urgent: quotationFormData.value.urgent,
|
||||
customerBranchId: quotationFormData.value.customerBranchId,
|
||||
|
|
@ -683,6 +684,10 @@ function convertEmployeeToTable() {
|
|||
preSelectedWorker.value,
|
||||
);
|
||||
pageState.employeeModal = false;
|
||||
quotationFormData.value.workerMax = Math.max(
|
||||
quotationFormData.value.workerMax || 1,
|
||||
selectedWorker.value.length,
|
||||
);
|
||||
}
|
||||
|
||||
function changeMode(mode: string) {
|
||||
|
|
@ -1147,7 +1152,16 @@ const view = ref<View>(View.Quotation);
|
|||
|
||||
<div class="surface-1 q-pa-md full-width">
|
||||
<WorkerItem
|
||||
:employee-amount="selectedWorker.length"
|
||||
@update:employee-amount="
|
||||
(v) =>
|
||||
(quotationFormData.workerMax = Math.max(
|
||||
v,
|
||||
selectedWorker.length,
|
||||
))
|
||||
"
|
||||
:employee-amount="
|
||||
quotationFormData.workerMax || selectedWorker.length
|
||||
"
|
||||
:readonly="readonly"
|
||||
fallback-img="/images/employee-avatar.png"
|
||||
:rows="
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ const DEFAULT_DATA: QuotationPayload = {
|
|||
urgent: false,
|
||||
customerBranchId: '',
|
||||
worker: [],
|
||||
workerMax: 1,
|
||||
payBillDate: new Date(),
|
||||
paySplit: [],
|
||||
paySplitCount: 0,
|
||||
|
|
@ -158,8 +159,6 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
|||
if (mode === 'assign') return;
|
||||
|
||||
currentFormState.value.mode = mode;
|
||||
|
||||
console.log(currentFormData.value);
|
||||
}
|
||||
|
||||
async function submitQuotation() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue