This commit is contained in:
parent
011c65dcf8
commit
dd09a8cb23
8 changed files with 51 additions and 39 deletions
|
|
@ -188,6 +188,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
||||||
:label="$t('customer.form.citizenId')"
|
:label="$t('customer.form.citizenId')"
|
||||||
for="input-citizen-id"
|
for="input-citizen-id"
|
||||||
v-model="citizenId"
|
v-model="citizenId"
|
||||||
|
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DatePicker
|
<DatePicker
|
||||||
|
|
@ -221,6 +222,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
||||||
:label="$t('customer.form.religion')"
|
:label="$t('customer.form.religion')"
|
||||||
for="input-religion"
|
for="input-religion"
|
||||||
v-model="religion"
|
v-model="religion"
|
||||||
|
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||||
/>
|
/>
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -305,6 +307,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
||||||
:label="$t('customer.form.firstName')"
|
:label="$t('customer.form.firstName')"
|
||||||
for="input-first-name"
|
for="input-first-name"
|
||||||
v-model="firstName"
|
v-model="firstName"
|
||||||
|
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -316,6 +319,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
||||||
:label="$t('customer.form.lastName')"
|
:label="$t('customer.form.lastName')"
|
||||||
for="input-last-name"
|
for="input-last-name"
|
||||||
v-model="lastName"
|
v-model="lastName"
|
||||||
|
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ async function change(e: Event) {
|
||||||
...obj.value,
|
...obj.value,
|
||||||
{
|
{
|
||||||
_meta: structuredClone(toRaw(selectedMenu.value)._meta || {}),
|
_meta: structuredClone(toRaw(selectedMenu.value)._meta || {}),
|
||||||
group: selectedMenu.value?.value,
|
group: selectedMenu.value?.group,
|
||||||
file: renamedFile,
|
file: renamedFile,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
@ -327,7 +327,7 @@ defineEmits<{
|
||||||
:rows="
|
:rows="
|
||||||
obj
|
obj
|
||||||
.filter((v) => {
|
.filter((v) => {
|
||||||
if (!autoSave && v.group !== selectedMenu?.value) {
|
if (!autoSave && v.group !== selectedMenu?.group) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -2287,7 +2287,6 @@ const emptyCreateDialog = ref(false);
|
||||||
res = await customerStore.createBranch({
|
res = await customerStore.createBranch({
|
||||||
...customerFormData.customerBranch[idx],
|
...customerFormData.customerBranch[idx],
|
||||||
customerId: customerFormState.editCustomerId || '',
|
customerId: customerFormState.editCustomerId || '',
|
||||||
id: undefined,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
@ -2315,10 +2314,10 @@ const emptyCreateDialog = ref(false);
|
||||||
if (ext) filename += `.${ext}`;
|
if (ext) filename += `.${ext}`;
|
||||||
|
|
||||||
const res = await customerStore.putAttachment({
|
const res = await customerStore.putAttachment({
|
||||||
branchId:
|
parentId:
|
||||||
customerFormData.customerBranch?.[idx].id || '',
|
customerFormData.customerBranch?.[idx].id || '',
|
||||||
file: v.file,
|
file: v.file,
|
||||||
filename,
|
name: filename,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
@ -3108,7 +3107,7 @@ const emptyCreateDialog = ref(false);
|
||||||
file: File | undefined,
|
file: File | undefined,
|
||||||
) => {
|
) => {
|
||||||
let status: boolean = false;
|
let status: boolean = false;
|
||||||
if (group !== 'attachment') {
|
if (group === 'passport' || group === 'visa') {
|
||||||
if (file !== undefined && currentFromDataEmployee.id) {
|
if (file !== undefined && currentFromDataEmployee.id) {
|
||||||
const res = await employeeStore.postMeta({
|
const res = await employeeStore.postMeta({
|
||||||
parentId: currentFromDataEmployee.id || '',
|
parentId: currentFromDataEmployee.id || '',
|
||||||
|
|
@ -5171,7 +5170,7 @@ const emptyCreateDialog = ref(false);
|
||||||
file: File | undefined,
|
file: File | undefined,
|
||||||
) => {
|
) => {
|
||||||
let status: boolean = false;
|
let status: boolean = false;
|
||||||
if (group !== 'attachment') {
|
if (group === 'passport' || group === 'visa') {
|
||||||
if (file !== undefined && currentFromDataEmployee.id) {
|
if (file !== undefined && currentFromDataEmployee.id) {
|
||||||
const res = await employeeStore.postMeta({
|
const res = await employeeStore.postMeta({
|
||||||
parentId: currentFromDataEmployee.id || '',
|
parentId: currentFromDataEmployee.id || '',
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,6 @@ withDefaults(
|
||||||
hide-action
|
hide-action
|
||||||
:ocr="
|
:ocr="
|
||||||
async (group, file) => {
|
async (group, file) => {
|
||||||
console.log(group);
|
|
||||||
if (group !== 'attachment') {
|
if (group !== 'attachment') {
|
||||||
const res = await ocrStore.sendOcr({
|
const res = await ocrStore.sendOcr({
|
||||||
file: file,
|
file: file,
|
||||||
|
|
@ -245,12 +244,20 @@ withDefaults(
|
||||||
:auto-save="item.id !== ''"
|
:auto-save="item.id !== ''"
|
||||||
:download="
|
:download="
|
||||||
(obj) => {
|
(obj) => {
|
||||||
customerStore.getFile({
|
if (obj.group === 'citizen') {
|
||||||
parentId: item.id || '',
|
customerStore.getFile({
|
||||||
group: obj.group,
|
parentId: item.id || '',
|
||||||
fileId: obj._meta.id,
|
group: obj.group,
|
||||||
download: true,
|
fileId: obj._meta.id,
|
||||||
});
|
download: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
customerStore.getAttachment({
|
||||||
|
parentId: item.id || '',
|
||||||
|
name: obj._meta.id,
|
||||||
|
download: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
:delete-item="
|
:delete-item="
|
||||||
|
|
@ -279,7 +286,7 @@ withDefaults(
|
||||||
_meta: any,
|
_meta: any,
|
||||||
file: File | undefined,
|
file: File | undefined,
|
||||||
) => {
|
) => {
|
||||||
if (group !== 'attachment') {
|
if (group === 'citizen') {
|
||||||
if (file !== undefined && item.id) {
|
if (file !== undefined && item.id) {
|
||||||
const res = await customerStore.postMeta({
|
const res = await customerStore.postMeta({
|
||||||
parentId: item.id || '',
|
parentId: item.id || '',
|
||||||
|
|
@ -347,7 +354,6 @@ withDefaults(
|
||||||
});
|
});
|
||||||
|
|
||||||
const tempValue = resMeta.map(async (v: any) => {
|
const tempValue = resMeta.map(async (v: any) => {
|
||||||
console.log(v.expireDate);
|
|
||||||
return {
|
return {
|
||||||
_meta: { ...v },
|
_meta: { ...v },
|
||||||
name: `${group}-${dateFormat(v.expireDate)}`,
|
name: `${group}-${dateFormat(v.expireDate)}`,
|
||||||
|
|
@ -368,7 +374,6 @@ withDefaults(
|
||||||
});
|
});
|
||||||
|
|
||||||
const tempValue = (res as string[]).map(async (i: any) => {
|
const tempValue = (res as string[]).map(async (i: any) => {
|
||||||
console.log(i);
|
|
||||||
return {
|
return {
|
||||||
_meta: { id: i, name: i },
|
_meta: { id: i, name: i },
|
||||||
name: i || '',
|
name: i || '',
|
||||||
|
|
|
||||||
|
|
@ -69,19 +69,19 @@ export const uploadFileListCustomer: {
|
||||||
}[] = [
|
}[] = [
|
||||||
{
|
{
|
||||||
label: 'customer.typeFile.citizenId',
|
label: 'customer.typeFile.citizenId',
|
||||||
value: 'citizen',
|
|
||||||
group: 'citizen',
|
group: 'citizen',
|
||||||
|
value: 'citizen',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customer.typeFile.registrationBook',
|
label: 'customer.typeFile.registrationBook',
|
||||||
value: 'attachment',
|
|
||||||
group: 'houseRegistration',
|
group: 'houseRegistration',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: 'customer.typeFile.houseMap',
|
label: 'customer.typeFile.houseMap',
|
||||||
value: 'attachment',
|
|
||||||
group: 'vatRegistration',
|
group: 'vatRegistration',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -92,7 +92,7 @@ export const uploadFileListCustomer: {
|
||||||
|
|
||||||
{
|
{
|
||||||
label: 'customer.typeFile.dbdCertificate',
|
label: 'customer.typeFile.dbdCertificate',
|
||||||
group: 'powerOfAttorney',
|
group: 'dbdCertificate',
|
||||||
value: 'attachment',
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -144,43 +144,43 @@ export const uploadFileListEmployee: {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customerEmployee.fileType.tm6',
|
label: 'customerEmployee.fileType.tm6',
|
||||||
value: 'attachment',
|
|
||||||
group: 'tm6',
|
group: 'tm6',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customerEmployee.fileType.workPermit',
|
label: 'customerEmployee.fileType.workPermit',
|
||||||
value: 'attachment',
|
|
||||||
group: 'workPermit',
|
group: 'workPermit',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customerEmployee.fileType.noticeJobEmployment',
|
label: 'customerEmployee.fileType.noticeJobEmployment',
|
||||||
value: 'attachment',
|
|
||||||
group: 'noticeJobEmployment',
|
group: 'noticeJobEmployment',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customerEmployee.fileType.noticeJobEntry',
|
label: 'customerEmployee.fileType.noticeJobEntry',
|
||||||
value: 'attachment',
|
|
||||||
group: 'noticeJobEntry',
|
group: 'noticeJobEntry',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customerEmployee.fileType.historyJob',
|
label: 'customerEmployee.fileType.historyJob',
|
||||||
value: 'attachment',
|
|
||||||
group: 'historyJob',
|
group: 'historyJob',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customerEmployee.fileType.acceptJob',
|
label: 'customerEmployee.fileType.acceptJob',
|
||||||
value: 'attachment',
|
|
||||||
group: 'acceptJob',
|
group: 'acceptJob',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customerEmployee.fileType.receipt',
|
label: 'customerEmployee.fileType.receipt',
|
||||||
value: 'attachment',
|
|
||||||
group: 'receipt',
|
group: 'receipt',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'customerEmployee.fileType.other',
|
label: 'customerEmployee.fileType.other',
|
||||||
value: 'attachment',
|
|
||||||
group: 'other',
|
group: 'other',
|
||||||
|
value: 'attachment',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1010,7 +1010,6 @@ watch(
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<!-- TODO: blind remark, urgent -->
|
<!-- TODO: blind remark, urgent -->
|
||||||
{{ console.log(taskListGroup) }}
|
|
||||||
<RemarkExpansion
|
<RemarkExpansion
|
||||||
v-if="
|
v-if="
|
||||||
view === TaskOrderStatus.Pending ||
|
view === TaskOrderStatus.Pending ||
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@ const useCustomerStore = defineStore('api-customer', () => {
|
||||||
customerId?: string;
|
customerId?: string;
|
||||||
company?: boolean;
|
company?: boolean;
|
||||||
includeCustomer?: boolean;
|
includeCustomer?: boolean;
|
||||||
activeRegisBranchOnly?: boolean;
|
|
||||||
registeredBranchId?: string;
|
registeredBranchId?: string;
|
||||||
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
|
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
|
||||||
query?: string;
|
query?: string;
|
||||||
|
|
@ -281,18 +280,21 @@ const useCustomerStore = defineStore('api-customer', () => {
|
||||||
|
|
||||||
if (tempValue) {
|
if (tempValue) {
|
||||||
tempValue.file?.forEach(async ({ group, _meta, file }) => {
|
tempValue.file?.forEach(async ({ group, _meta, file }) => {
|
||||||
if (file !== undefined) {
|
if (!file) return;
|
||||||
|
|
||||||
|
if (group === 'citizen') {
|
||||||
await metaManager.postMeta({
|
await metaManager.postMeta({
|
||||||
parentId: v.id,
|
parentId: v.id,
|
||||||
group: group as
|
group: 'citizen',
|
||||||
| 'citizen'
|
|
||||||
| 'house-registration'
|
|
||||||
| 'commercial-registration'
|
|
||||||
| 'vat-registration'
|
|
||||||
| 'power-of-attorney',
|
|
||||||
meta: _meta,
|
meta: _meta,
|
||||||
file,
|
file,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
await attachmentManager.putAttachment({
|
||||||
|
parentId: v.id || '',
|
||||||
|
name: file.name,
|
||||||
|
file: file,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,10 @@ const useEmployeeStore = defineStore('api-employee', () => {
|
||||||
|
|
||||||
if (group === undefined) return;
|
if (group === undefined) return;
|
||||||
|
|
||||||
if (group !== 'attachment' && _meta !== undefined) {
|
if (
|
||||||
|
(group === 'passport' || group === 'visa') &&
|
||||||
|
_meta !== undefined
|
||||||
|
) {
|
||||||
metaManager.postMeta({
|
metaManager.postMeta({
|
||||||
parentId: res.data.id,
|
parentId: res.data.id,
|
||||||
group: group as 'passport' | 'visa',
|
group: group as 'passport' | 'visa',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue