update

parent d0ad43b2
...@@ -331,6 +331,7 @@ export type DetailUnit = { ...@@ -331,6 +331,7 @@ export type DetailUnit = {
fields: Array<FieldType>; fields: Array<FieldType>;
contracts: Array<Contract>; contracts: Array<Contract>;
classification: Array<ClassificationOptions>; classification: Array<ClassificationOptions>;
taxCode: string
}; };
export type CustomerType = { export type CustomerType = {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
isUpdate isUpdate
? $t('managingUnit.dialogLabel.title.add') ? $t('managingUnit.dialogLabel.title.add')
: $t('managingUnit.dialogLabel.title.update') : $t('managingUnit.dialogLabel.title.update')
}}</q-item-label> }}123</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-card-section> </q-card-section>
...@@ -56,16 +56,7 @@ ...@@ -56,16 +56,7 @@
</template> </template>
</q-input> </q-input>
<!-- <q-input
:model-value="code"
@update:model-value="$emit('update:code', $event)"
:label="$t('managingUnit.dialogLabel.fieldLabels.code')"
:rules="codeRules"
type="text"
class="q-my-sm"
outlined
clearable
></q-input> -->
<q-input <q-input
:model-value="name" :model-value="name"
@update:model-value="$emit('update:name', $event)" @update:model-value="$emit('update:name', $event)"
...@@ -122,6 +113,18 @@ ...@@ -122,6 +113,18 @@
:rules="addressRules" :rules="addressRules"
clearable clearable
></q-input> ></q-input>
<q-input
:model-value="taxCode"
@update:model-value="$emit('update:taxCode', $event)"
label="Mã số thuế *"
class="q-my-sm"
type="text"
outlined
:rules="taxCodeRules"
clearable
></q-input>
<q-select <q-select
:model-value="fields" :model-value="fields"
...@@ -599,6 +602,9 @@ export default defineComponent({ ...@@ -599,6 +602,9 @@ export default defineComponent({
const bankOptions: Ref<number | undefined> = ref(undefined); const bankOptions: Ref<number | undefined> = ref(undefined);
const cardTypeOptions: Ref<number | undefined> = ref(undefined); const cardTypeOptions: Ref<number | undefined> = ref(undefined);
const taxCode = ref('');
const usernameInputRules = [ const usernameInputRules = [
(val?: string) => (val && val.trim().length) || 'Vui lòng nhập tài khoản', (val?: string) => (val && val.trim().length) || 'Vui lòng nhập tài khoản',
]; ];
...@@ -606,6 +612,10 @@ export default defineComponent({ ...@@ -606,6 +612,10 @@ export default defineComponent({
(val?: string) => (val && val.trim().length) || 'Vui lòng nhập mật khẩu', (val?: string) => (val && val.trim().length) || 'Vui lòng nhập mật khẩu',
]; ];
const taxCodeRules = [
(val?: string) => (val && val.trim().length) || 'Vui lòng nhập mã số thuế',
]
const nameRules = [ const nameRules = [
(val?: string) => (val?: string) =>
(val && val.trim().length) || (val && val.trim().length) ||
...@@ -935,8 +945,10 @@ export default defineComponent({ ...@@ -935,8 +945,10 @@ export default defineComponent({
updateBankAccountDialogIsOpened, updateBankAccountDialogIsOpened,
updateNewBankAccount, updateNewBankAccount,
usernameInputRules, usernameInputRules,
taxCodeRules,
passwordInputRules, passwordInputRules,
isPwd: ref(true), isPwd: ref(true),
taxCode,
}; };
}, },
emits: [ emits: [
...@@ -954,6 +966,7 @@ export default defineComponent({ ...@@ -954,6 +966,7 @@ export default defineComponent({
'update:check_artistList', 'update:check_artistList',
'update:userName', 'update:userName',
'update:password', 'update:password',
'update:taxCode',
'addNewUnit', 'addNewUnit',
], ],
}); });
......
...@@ -189,6 +189,7 @@ ...@@ -189,6 +189,7 @@
v-model:status="unitStatus" v-model:status="unitStatus"
v-model:artistList="unitArtistList" v-model:artistList="unitArtistList"
v-model:check_artistList="check_artistList" v-model:check_artistList="check_artistList"
v-model:taxCode="taxCode"
isUpdate isUpdate
@addNewUnit="addNewUnit" @addNewUnit="addNewUnit"
/> />
...@@ -208,6 +209,7 @@ ...@@ -208,6 +209,7 @@
v-model:status="unitStatus" v-model:status="unitStatus"
v-model:artistList="unitArtistList" v-model:artistList="unitArtistList"
v-model:check_artistList="check_artistList" v-model:check_artistList="check_artistList"
v-model:taxCode="taxCode"
@addNewUnit="updateNewUnit" @addNewUnit="updateNewUnit"
/> />
...@@ -363,6 +365,7 @@ export default defineComponent({ ...@@ -363,6 +365,7 @@ export default defineComponent({
const unitPhoneNumber = ref(''); const unitPhoneNumber = ref('');
const unitUserName = ref(''); const unitUserName = ref('');
const unitPassword = ref(''); const unitPassword = ref('');
const taxCode = ref('');
const unitStatus: Ref<number> = ref(UnitStatus.active); const unitStatus: Ref<number> = ref(UnitStatus.active);
const unitArtistList: Ref<unknown[]> = ref([]); const unitArtistList: Ref<unknown[]> = ref([]);
const unitId: Ref<number | undefined> = ref(undefined); const unitId: Ref<number | undefined> = ref(undefined);
...@@ -435,7 +438,7 @@ export default defineComponent({ ...@@ -435,7 +438,7 @@ export default defineComponent({
const openAddUnitDialog = () => { const openAddUnitDialog = () => {
unitField.value = []; unitField.value = [];
taxCode.value = '',
unitName.value = null; unitName.value = null;
unitRepresentative.value = ''; unitRepresentative.value = '';
unitEmail.value = ''; unitEmail.value = '';
...@@ -465,7 +468,7 @@ export default defineComponent({ ...@@ -465,7 +468,7 @@ export default defineComponent({
if (response.data.error.code === config.API_RES_CODE.OK.code) { if (response.data.error.code === config.API_RES_CODE.OK.code) {
unitId.value = response.data.data.id; unitId.value = response.data.data.id;
unitName.value = response.data.data.unitName; unitName.value = response.data.data.unitName;
taxCode.value = response.data.data.taxCode;
unitEmail.value = response.data.data.email; unitEmail.value = response.data.data.email;
unitPhoneNumber.value = response.data.data.phoneNumber; unitPhoneNumber.value = response.data.data.phoneNumber;
unitRepresentative.value = response.data.data.representative; unitRepresentative.value = response.data.data.representative;
...@@ -562,6 +565,7 @@ export default defineComponent({ ...@@ -562,6 +565,7 @@ export default defineComponent({
userName: unitUserName.value, userName: unitUserName.value,
password: unitPassword.value, password: unitPassword.value,
contracts: unitArtistList.value, contracts: unitArtistList.value,
taxCode: taxCode.value
}; };
const response = (await api({ const response = (await api({
url: API_PATHS.updateUnit, url: API_PATHS.updateUnit,
...@@ -599,6 +603,7 @@ export default defineComponent({ ...@@ -599,6 +603,7 @@ export default defineComponent({
userName: unitUserName.value, userName: unitUserName.value,
password: unitPassword.value, password: unitPassword.value,
contracts: unitArtistList.value, contracts: unitArtistList.value,
taxCode :taxCode.value
}; };
const response = (await api({ const response = (await api({
url: API_PATHS.artistOwnerAdd, url: API_PATHS.artistOwnerAdd,
...@@ -656,6 +661,7 @@ export default defineComponent({ ...@@ -656,6 +661,7 @@ export default defineComponent({
unitUserName, unitUserName,
unitPassword, unitPassword,
unitStatus, unitStatus,
taxCode,
openAddUnitDialog, openAddUnitDialog,
unitArtistList, unitArtistList,
addNewUnit, addNewUnit,
......
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