update

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