feat: quotation add worker after accepted (#140)

* feat: add dialog structure

* feat: add select functionality

* chore: clear unused

* feat: pass selectable product into dialog

* feat: add table

* feat: implement select worker and product

* feat: send disabled worker into component

* feat: add event emitted after submit

* chore: cleanup

* feat: add store

* feat: dialogquotationbtn

* feat: import worker from file and select them all

* feat: add title

* feat: add import button

* feat: i18n

* feat: lazy load person card image

* refactor: change import button color

* feat: add import worker button

* chore: cleanup

* chore: clean

* chore: clean

* feat: post quotation add worker appear on expired

* fix: type

* fix: only proceed when import has at least one

* feat: check more condition

* feat: fetch data from api

* fix: worker not update

---------

Co-authored-by: Methapon2001 <61303214+Methapon2001@users.noreply.github.com>
Co-authored-by: nwpptrs <jay02499@gmail.com>
This commit is contained in:
Methapon Metanipat 2024-12-17 14:22:22 +07:00 committed by GitHub
parent 79d132f49e
commit 4528836f17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 702 additions and 12 deletions

View file

@ -74,6 +74,7 @@ import {
import QuotationFormReceipt from './QuotationFormReceipt.vue';
import QuotationFormProductSelect from './QuotationFormProductSelect.vue';
import QuotationFormInfo from './QuotationFormInfo.vue';
import QuotationFormWorkerAddDialog from './QuotationFormWorkerAddDialog.vue';
import ProfileBanner from 'components/ProfileBanner.vue';
import DialogForm from 'components/DialogForm.vue';
import {
@ -119,6 +120,7 @@ const optionStore = useOptionStore();
const { t, locale } = useI18n();
const ocrStore = useOcrStore();
const $q = useQuasar();
const openQuotation = ref<boolean>(false);
const {
currentFormData: quotationFormData,
@ -174,7 +176,6 @@ const selectedInstallmentNo = ref<number[]>([]);
const installmentAmount = ref<number>(0);
const selectedInstallment = ref();
const agentPrice = ref(false);
const attachmentData = ref<
{
name: string;
@ -415,6 +416,8 @@ async function fetchQuotation() {
);
}
assignWorkerToSelectedWorker();
await assignToProductServiceList();
await fetchStatus();
@ -1416,10 +1419,28 @@ async function getWorkerFromCriteria(
</div>
<nav class="q-ml-auto">
<AddButton
v-if="!readonly"
v-if="
!readonly &&
(!quotationFormState.source ||
quotationFormState.source?.quotationStatus ===
'Issued' ||
quotationFormState.source?.quotationStatus ===
'Expired')
"
icon-only
@click.stop="triggerSelectEmployeeDialog"
/>
<AddButton
v-if="
!!quotationFormState.source &&
quotationFormState.source.quotationStatus !==
'Issued' &&
quotationFormState.source?.quotationStatus !== 'Expired'
"
@click.stop="openQuotation = !openQuotation"
icon-only
class="q-ml-auto"
/>
</nav>
</section>
</template>
@ -2733,6 +2754,18 @@ async function getWorkerFromCriteria(
</DialogForm>
<!-- NOTE: END - Employee Add Form -->
<QuotationFormWorkerAddDialog
v-if="quotationFormState.source"
:disabled-worker-id="selectedWorker.map((v) => v.id)"
:productServiceList="quotationFormState.source.productServiceList"
:quotation-id="quotationFormState.source.id"
v-model:open="openQuotation"
@success="
openQuotation = !openQuotation;
fetchQuotation();
"
/>
</template>
<style scoped>