Commit c8330db4 authored by Tình Trương's avatar Tình Trương

update

parent 7b6b8a02
...@@ -94,4 +94,5 @@ export enum API_PATHS { ...@@ -94,4 +94,5 @@ export enum API_PATHS {
updateConfigSystem = 'config-page/update', updateConfigSystem = 'config-page/update',
addConfigSystem = 'config-page/add', addConfigSystem = 'config-page/add',
deleteConfigSystem = 'config-page/delete', deleteConfigSystem = 'config-page/delete',
getListVABInfo = 'information',
} }
...@@ -511,3 +511,33 @@ export type AddConfigSystem = { ...@@ -511,3 +511,33 @@ export type AddConfigSystem = {
url: string; url: string;
numIndex: number; numIndex: number;
}; };
export type VABInfoType = {
id: number;
comName: string;
logo: string;
email: string;
website: string;
phone: string;
address: string;
};
export type DetailVABInfoType = {
id: number;
comName: string;
logo: string;
email: string;
website: string;
phone: string;
address: string;
};
export type UpdateVABInfoType = {
id: number;
comName: string;
logo: string;
email: string;
website: string;
phone: string;
address: string;
};
...@@ -62,11 +62,11 @@ ...@@ -62,11 +62,11 @@
:rules="urlRules" :rules="urlRules"
clearable clearable
></q-input> ></q-input>
<!-- :rules="nameMenuRules" -->
<q-select <q-select
:model-value="nameMenu" :model-value="nameMenu"
@update:model-value="$emit('update:nameMenu', $event)" @update:model-value="$emit('update:nameMenu', $event)"
:label="$t('listConfigSystem.dialogLabel.fieldLabels.nameMenu')" :label="$t('listConfigSystem.dialogLabel.fieldLabels.nameMenu')"
:rules="nameMenuRules"
:options="nameMenuOptions" :options="nameMenuOptions"
multiple multiple
map-options map-options
...@@ -236,15 +236,15 @@ export default defineComponent({ ...@@ -236,15 +236,15 @@ export default defineComponent({
(val && val.trim().length) || (val && val.trim().length) ||
i18n.global.t('listConfigSystem.validateMessages.requireUrl'), i18n.global.t('listConfigSystem.validateMessages.requireUrl'),
]; ];
const nameMenuRules = [ // const nameMenuRules = [
(val?: number) => // (val?: number) =>
val !== undefined || // val !== undefined ||
i18n.global.t('listConfigSystem.validateMessages.requireNameMenu'), // i18n.global.t('listConfigSystem.validateMessages.requireNameMenu'),
]; // ];
return { return {
namePageRules, namePageRules,
urlRules, urlRules,
nameMenuRules, // nameMenuRules,
}; };
}, },
emits: [ emits: [
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:model-value="isOpened" :model-value="isOpened"
@update:model-value="$emit('update:isOpened', $event)" @update:model-value="$emit('update:isOpened', $event)"
> >
<q-card class="full-width" style="max-width: 60rem" bordered> <q-card class="full-width" style="max-width: 80rem" bordered>
<q-form <q-form
greedy greedy
@submit.prevent=" @submit.prevent="
...@@ -30,55 +30,73 @@ ...@@ -30,55 +30,73 @@
style="max-height: calc(100vh - 10rem)" style="max-height: calc(100vh - 10rem)"
> >
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12"> <div class="col-6">
<div class="row flex-center q-pt-sm"> <div class="row flex-center">
<div> <div class="q-mt-lg">
<q-card style="margin-bottom: 8px" v-if="image !== null"> <q-card v-if="logo !== null">
<q-img <q-img
:src="image"
style="height: 268px; width: 350px"
@click="uploadAvatar" @click="uploadAvatar"
> :src="logo"
</q-img> style="height: 390px; width: 350px; cursor: pointer"
></q-img>
<q-icon <q-icon
name="mdi-close-circle" name="mdi-close-circle"
style="position: absolute; right: 0; font-size: 18px" color="red"
style="
position: absolute;
right: 0;
font-size: 18px;
cursor: pointer;
"
@click="deleteAvatar" @click="deleteAvatar"
></q-icon> ></q-icon>
</q-card> </q-card>
<q-card v-else style="margin-bottom: 8px"> <div
<q-img @click="uploadAvatar"
src="~/assets/noavatar.png" v-else
style="height: 265px; width: 350px" style="
></q-img> height: 390px;
</q-card> width: 350px;
border: 2px dashed #5d319e;
<q-card @click="uploadAvatar"> border-radius: 4px;
<div align="center" class="flex flex-center q-py-xs"> cursor: pointer;
"
>
<div
style="
height: 390px;
width: 350px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
"
>
<q-icon <q-icon
style="color: #5d319e" style="color: #5d319e"
name="mdi-plus-circle-outline" name="mdi-cloud-upload"
:size="'xs'" size="xl"
></q-icon> ></q-icon>
<div class="q-mt-xs"> Tải ảnh lên
{{ $t('infoVAB.uploadImg') }}
</div>
</div> </div>
</div>
<div>
<input <input
ref="upload" ref="upload"
hidden hidden
type="file"
@change="selectedFile($event.target.files)" @change="selectedFile($event.target.files)"
type="file"
accept="image/png, image/jpeg" accept="image/png, image/jpeg"
/> />
</q-card> </div>
</div> </div>
</div> </div>
</div>
<div class="col-6">
<q-input <q-input
:model-value="name" :model-value="comName"
@update:model-value="$emit('update:name', $event)" @update:model-value="$emit('update:comName', $event)"
:label="$t('infoVAB.dialogLabel.infoVABLabels.name')" :label="$t('infoVAB.dialogLabel.infoVABLabels.comName')"
type="text" type="text"
class="q-my-sm q-pt-md" class="q-my-sm q-pt-md"
outlined outlined
...@@ -156,7 +174,7 @@ ...@@ -156,7 +174,7 @@
<template v-slot:body-cell-action=""> <template v-slot:body-cell-action="">
<q-td style="padding: 0" class="flex flex-center"> <q-td style="padding: 0" class="flex flex-center">
<q-btn flat round color="primary" icon="mdi-delete-outline"> <q-btn flat round color="primary" icon="mdi-delete-outline">
<q-tooltip :offset="[20, 10]">{{ <q-tooltip :offset="[10, 10]">{{
$t('infoVAB.toolTipMessage.deleteBankAccount') $t('infoVAB.toolTipMessage.deleteBankAccount')
}}</q-tooltip> }}</q-tooltip>
</q-btn> </q-btn>
...@@ -166,7 +184,7 @@ ...@@ -166,7 +184,7 @@
color="primary" color="primary"
icon="mdi-account-edit-outline" icon="mdi-account-edit-outline"
> >
<q-tooltip :offset="[20, 10]">{{ <q-tooltip :offset="[10, 10]">{{
$t('infoVAB.toolTipMessage.updateBankAccount') $t('infoVAB.toolTipMessage.updateBankAccount')
}}</q-tooltip> }}</q-tooltip>
</q-btn> </q-btn>
...@@ -242,7 +260,6 @@ ...@@ -242,7 +260,6 @@
import { defineComponent, ref, Ref, PropType } from 'vue'; import { defineComponent, ref, Ref, PropType } from 'vue';
import InfoVABAddUpdateBankAccountDialog from 'components/update-info-vab/info-vab-add-update-bank-account/index.vue'; import InfoVABAddUpdateBankAccountDialog from 'components/update-info-vab/info-vab-add-update-bank-account/index.vue';
import { i18n } from 'src/boot/i18n'; import { i18n } from 'src/boot/i18n';
//bankAccount //bankAccount
const bankAccountTableColumnsInfoVAB = [ const bankAccountTableColumnsInfoVAB = [
{ {
...@@ -318,10 +335,10 @@ export default defineComponent({ ...@@ -318,10 +335,10 @@ export default defineComponent({
required: true, required: true,
}, },
isUpdate: { type: Boolean, default: false }, isUpdate: { type: Boolean, default: false },
name: { type: String, required: true }, comName: { type: String, required: true },
image: { type: String, required: true }, logo: { type: String, required: true },
website: { type: String, required: true }, website: { type: String, required: true },
phone: { type: String, required: true }, phone: { type: Number, required: true },
email: { type: String, required: true }, email: { type: String, required: true },
address: { type: String, required: true }, address: { type: String, required: true },
bankAccountList: { type: Array as PropType<unknown[]>, required: true }, bankAccountList: { type: Array as PropType<unknown[]>, required: true },
...@@ -338,6 +355,7 @@ export default defineComponent({ ...@@ -338,6 +355,7 @@ export default defineComponent({
}; };
const upload = ref(null); const upload = ref(null);
const uploadAvatar = () => { const uploadAvatar = () => {
console.log(1);
// eslint-disable-next-line // eslint-disable-next-line
// @ts-ignore // @ts-ignore
// eslint-disable-next-line // eslint-disable-next-line
...@@ -407,6 +425,7 @@ export default defineComponent({ ...@@ -407,6 +425,7 @@ export default defineComponent({
selectedFile, selectedFile,
deleteAvatar, deleteAvatar,
uploadAvatar, uploadAvatar,
upload,
bankAccountTableColumnsInfoVAB, bankAccountTableColumnsInfoVAB,
addBankAccountDialogIsOpened, addBankAccountDialogIsOpened,
bank, bank,
...@@ -426,12 +445,12 @@ export default defineComponent({ ...@@ -426,12 +445,12 @@ export default defineComponent({
}, },
emits: [ emits: [
'update:isOpened', 'update:isOpened',
'update:name', 'update:comName',
'update:website', 'update:website',
'update:phone', 'update:phone',
'update:email', 'update:email',
'update:address', 'update:address',
'update:image', 'update:logo',
'SetAvatar', 'SetAvatar',
'deleteAvatar', 'deleteAvatar',
'saveInfoVAB', 'saveInfoVAB',
......
...@@ -846,8 +846,8 @@ export default { ...@@ -846,8 +846,8 @@ export default {
titleBankAccount: 'Danh sách tài khoản ngân hàng thụ hưởng', titleBankAccount: 'Danh sách tài khoản ngân hàng thụ hưởng',
tableColumnsInfoVAB: { tableColumnsInfoVAB: {
stt: 'STT', stt: 'STT',
name: 'Tên công ty', comName: 'Tên công ty',
image: 'Logo', logo: 'Logo',
website: 'Website', website: 'Website',
phone: 'Số điện thoại', phone: 'Số điện thoại',
email: 'Email', email: 'Email',
...@@ -869,7 +869,7 @@ export default { ...@@ -869,7 +869,7 @@ export default {
updateBankAccount: 'Cập nhật ngân hàng thụ hưởng', updateBankAccount: 'Cập nhật ngân hàng thụ hưởng',
}, },
infoVABLabels: { infoVABLabels: {
name: 'Tên công ty *', comName: 'Tên công ty *',
website: 'Website *', website: 'Website *',
phone: 'Số điện thoại *', phone: 'Số điện thoại *',
email: 'Email *', email: 'Email *',
......
...@@ -144,7 +144,6 @@ ...@@ -144,7 +144,6 @@
/> />
<AddUpdatePolicyDialog <AddUpdatePolicyDialog
isUpdate
v-model:isOpened="showDialogUpdate" v-model:isOpened="showDialogUpdate"
v-model:namePage="namePage" v-model:namePage="namePage"
v-model:content="content" v-model:content="content"
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment