chore: clean quotation main page
This commit is contained in:
parent
98c10c2fa1
commit
c020a3acbd
1 changed files with 1 additions and 76 deletions
|
|
@ -2,24 +2,20 @@
|
||||||
import { pageTabs, fieldSelectedOption } from './constants';
|
import { pageTabs, fieldSelectedOption } from './constants';
|
||||||
|
|
||||||
import { onMounted, reactive, ref, watch } from 'vue';
|
import { onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
|
||||||
// NOTE: Import stores
|
// NOTE: Import stores
|
||||||
import useProductServiceStore from 'src/stores/product-service';
|
|
||||||
import { useQuotationStore } from 'src/stores/quotations';
|
import { useQuotationStore } from 'src/stores/quotations';
|
||||||
import { isRoleInclude } from 'stores/utils';
|
import { isRoleInclude } from 'stores/utils';
|
||||||
import useFlowStore from 'src/stores/flow';
|
import useFlowStore from 'src/stores/flow';
|
||||||
import useMyBranch from 'stores/my-branch';
|
import useMyBranch from 'stores/my-branch';
|
||||||
import { useQuotationForm } from './form';
|
import { useQuotationForm } from './form';
|
||||||
import useOcrStore from 'stores/ocr';
|
|
||||||
|
|
||||||
// NOTE Import Types
|
// NOTE Import Types
|
||||||
import { CustomerBranchCreate } from 'stores/customer/types';
|
import { CustomerBranchCreate } from 'stores/customer/types';
|
||||||
import { Employee } from 'src/stores/employee/types';
|
import { Employee } from 'src/stores/employee/types';
|
||||||
|
|
||||||
// NOTE: Import Components
|
// NOTE: Import Components
|
||||||
import TreeView from 'src/components/shared/TreeView.vue';
|
|
||||||
import QuotationCard from 'src/components/05_quotation/QuotationCard.vue';
|
import QuotationCard from 'src/components/05_quotation/QuotationCard.vue';
|
||||||
import PaginationComponent from 'src/components/PaginationComponent.vue';
|
import PaginationComponent from 'src/components/PaginationComponent.vue';
|
||||||
import StatCardComponent from 'src/components/StatCardComponent.vue';
|
import StatCardComponent from 'src/components/StatCardComponent.vue';
|
||||||
|
|
@ -44,19 +40,12 @@ import {
|
||||||
EmployerFormAbout,
|
EmployerFormAbout,
|
||||||
} from 'src/pages/03_customer-management/components';
|
} from 'src/pages/03_customer-management/components';
|
||||||
|
|
||||||
import {
|
import { useCustomerForm } from 'src/pages/03_customer-management/form';
|
||||||
useCustomerForm,
|
|
||||||
useEmployeeForm,
|
|
||||||
} from 'src/pages/03_customer-management/form';
|
|
||||||
import QuotationView from './QuotationView.vue';
|
|
||||||
import { quotationProductTree } from './utils';
|
|
||||||
|
|
||||||
const quotationFormStore = useQuotationForm();
|
const quotationFormStore = useQuotationForm();
|
||||||
const customerFormStore = useCustomerForm();
|
const customerFormStore = useCustomerForm();
|
||||||
const employeeFormStore = useEmployeeForm();
|
|
||||||
const flowStore = useFlowStore();
|
const flowStore = useFlowStore();
|
||||||
const userBranch = useMyBranch();
|
const userBranch = useMyBranch();
|
||||||
const ocrStore = useOcrStore();
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
currentFormData: quotationFormData,
|
currentFormData: quotationFormData,
|
||||||
|
|
@ -69,33 +58,12 @@ const { currentMyBranch } = storeToRefs(userBranch);
|
||||||
const special = ref(false);
|
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 refreshImageState = ref(false);
|
|
||||||
const emptyCreateDialog = ref(false);
|
const emptyCreateDialog = ref(false);
|
||||||
const onCreateImageList = ref<{
|
const onCreateImageList = ref<{
|
||||||
selectedImage: string;
|
selectedImage: string;
|
||||||
list: { url: string; imgFile: File | null; name: string }[];
|
list: { url: string; imgFile: File | null; name: string }[];
|
||||||
}>({ selectedImage: '', list: [] });
|
}>({ selectedImage: '', list: [] });
|
||||||
|
|
||||||
const tabFieldRequired = ref<{ [key: string]: (keyof CustomerBranchCreate)[] }>(
|
|
||||||
{
|
|
||||||
main: [],
|
|
||||||
business: ['businessType', 'jobPosition'],
|
|
||||||
address: [
|
|
||||||
'homeCode',
|
|
||||||
'address',
|
|
||||||
'addressEN',
|
|
||||||
'provinceId',
|
|
||||||
'districtId',
|
|
||||||
'subDistrictId',
|
|
||||||
],
|
|
||||||
contact: [],
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const productServiceStore = useProductServiceStore();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const selectedEmployee = ref<Employee[]>([]);
|
const selectedEmployee = ref<Employee[]>([]);
|
||||||
|
|
||||||
const pageState = reactive({
|
const pageState = reactive({
|
||||||
|
|
@ -242,16 +210,6 @@ function triggerQuotationDialog(opts: {
|
||||||
window.open(url.toString(), '_blank');
|
window.open(url.toString(), '_blank');
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerSelectEmployeeDialog() {
|
|
||||||
pageState.employeeModal = true;
|
|
||||||
// TODO: form and state controll
|
|
||||||
}
|
|
||||||
|
|
||||||
function triggerProductServiceDialog() {
|
|
||||||
pageState.productServiceModal = true;
|
|
||||||
// TODO: form and state controll
|
|
||||||
}
|
|
||||||
|
|
||||||
const quotationStore = useQuotationStore();
|
const quotationStore = useQuotationStore();
|
||||||
const {
|
const {
|
||||||
data: quotationData,
|
data: quotationData,
|
||||||
|
|
@ -345,39 +303,6 @@ watch(() => pageState.currentTab, fetchQuotationList);
|
||||||
:style="pageState.hideStat ? 'rotate: 90deg' : ''"
|
:style="pageState.hideStat ? 'rotate: 90deg' : ''"
|
||||||
style="transition: 0.1s ease-in-out"
|
style="transition: 0.1s ease-in-out"
|
||||||
/>
|
/>
|
||||||
<q-btn
|
|
||||||
class="q-ml-sm"
|
|
||||||
label="add"
|
|
||||||
color="primary"
|
|
||||||
size="sm"
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
@click="triggerSelectEmployeeDialog"
|
|
||||||
:style="pageState.hideStat ? 'rotate: 90deg' : ''"
|
|
||||||
style="transition: 0.1s ease-in-out"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
class="q-ml-sm"
|
|
||||||
label="quo"
|
|
||||||
color="primary"
|
|
||||||
size="sm"
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
@click="triggerQuotationDialog('create')"
|
|
||||||
:style="pageState.hideStat ? 'rotate: 90deg' : ''"
|
|
||||||
style="transition: 0.1s ease-in-out"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
class="q-ml-sm"
|
|
||||||
label="proserv"
|
|
||||||
color="primary"
|
|
||||||
size="sm"
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
@click="triggerProductServiceDialog"
|
|
||||||
:style="pageState.hideStat ? 'rotate: 90deg' : ''"
|
|
||||||
style="transition: 0.1s ease-in-out"
|
|
||||||
/>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<transition name="slide">
|
<transition name="slide">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue