refactor: special
This commit is contained in:
parent
20dc04c769
commit
0461da4bf8
2 changed files with 22 additions and 13 deletions
|
|
@ -13,6 +13,7 @@ const customerStore = useCustomerStore();
|
||||||
const branchId = defineModel<string>('branchId');
|
const branchId = defineModel<string>('branchId');
|
||||||
const customerBranchId = defineModel<string>('customerBranchId');
|
const customerBranchId = defineModel<string>('customerBranchId');
|
||||||
const agentPrice = defineModel<boolean>('agentPrice');
|
const agentPrice = defineModel<boolean>('agentPrice');
|
||||||
|
const special = defineModel<boolean>('special');
|
||||||
|
|
||||||
const branchOption = ref();
|
const branchOption = ref();
|
||||||
const customerOption = ref();
|
const customerOption = ref();
|
||||||
|
|
@ -116,6 +117,13 @@ watch(
|
||||||
v-model="agentPrice"
|
v-model="agentPrice"
|
||||||
style="font-size: 14px"
|
style="font-size: 14px"
|
||||||
/>
|
/>
|
||||||
|
<q-checkbox
|
||||||
|
class="q-ml-md"
|
||||||
|
:label="$t('quotation.special')"
|
||||||
|
size="xs"
|
||||||
|
v-model="special"
|
||||||
|
style="font-size: 14px"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 row q-col-gutter-sm">
|
<div class="col-12 row q-col-gutter-sm">
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ const { state: employeeFormState, currentFromDataEmployee } =
|
||||||
storeToRefs(employeeFormStore);
|
storeToRefs(employeeFormStore);
|
||||||
const { currentMyBranch } = storeToRefs(userBranch);
|
const { currentMyBranch } = storeToRefs(userBranch);
|
||||||
|
|
||||||
|
const special = ref(false);
|
||||||
const branchId = ref('');
|
const branchId = ref('');
|
||||||
const agentPrice = ref<boolean>(false);
|
const agentPrice = ref<boolean>(false);
|
||||||
const currentCustomerId = ref<string | undefined>();
|
const currentCustomerId = ref<string | undefined>();
|
||||||
|
|
@ -355,17 +356,16 @@ function triggerAddQuotationDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerQuotationDialog() {
|
function triggerQuotationDialog() {
|
||||||
const params = new URLSearchParams();
|
const url = new URL('/quotation/add-quotation', window.location.origin);
|
||||||
|
url.searchParams.set('branchId', branchId.value);
|
||||||
|
url.searchParams.set(
|
||||||
|
'customerBranchId',
|
||||||
|
quotationFormData.value.customerBranchId,
|
||||||
|
);
|
||||||
|
url.searchParams.set('agentPrice', agentPrice.value.toString());
|
||||||
|
url.searchParams.set('special', special.value.toString());
|
||||||
|
|
||||||
params.set('branchId', branchId.value);
|
window.open(url.toString(), '_blank');
|
||||||
params.set('customerBranchId', branchId.value);
|
|
||||||
params.set('date', Date.now().toString());
|
|
||||||
params.set('agentPrice', agentPrice.value.toString());
|
|
||||||
|
|
||||||
const query = params.toString();
|
|
||||||
|
|
||||||
window.open(`/quotation/add-quotation?${query}`, '_blank');
|
|
||||||
// TODO: form and state controll
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerSelectEmployeeDialog() {
|
function triggerSelectEmployeeDialog() {
|
||||||
|
|
@ -831,7 +831,7 @@ watch(() => pageState.currentTab, fetchQuotationList);
|
||||||
|
|
||||||
<!-- NOTE: SEC START - Dialog -->
|
<!-- NOTE: SEC START - Dialog -->
|
||||||
|
|
||||||
<!-- NOTE: START - Quotation Form -->
|
<!-- NOTE: START - Quotation Form, Add Quotation -->
|
||||||
|
|
||||||
<DialogForm
|
<DialogForm
|
||||||
:title="$t('general.add', { text: $t('quotation.title') })"
|
:title="$t('general.add', { text: $t('quotation.title') })"
|
||||||
|
|
@ -868,9 +868,10 @@ watch(() => pageState.currentTab, fetchQuotationList);
|
||||||
>
|
>
|
||||||
<FormAbout
|
<FormAbout
|
||||||
on-create
|
on-create
|
||||||
v-model:branch-id="branchId"
|
|
||||||
v-model:customer-branch-id="quotationFormData.customerBranchId"
|
|
||||||
v-model:agent-price="agentPrice"
|
v-model:agent-price="agentPrice"
|
||||||
|
v-model:branch-id="branchId"
|
||||||
|
v-model:special="special"
|
||||||
|
v-model:customer-branch-id="quotationFormData.customerBranchId"
|
||||||
@add-customer="triggerSelectTypeCustomerd()"
|
@add-customer="triggerSelectTypeCustomerd()"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue