update

parent 13f24b20
export const config = {
// pro
API_ENDPOINT: 'https://cms.vab.vn/api/',
API_IMAGE_ENDPOINT: 'https://cms.vab.vn/file/upload/',
// API_ENDPOINT: 'https://cms.vab.vn/api/',
// API_IMAGE_ENDPOINT: 'https://cms.vab.vn/file/upload/',
// dev
// API_ENDPOINT: 'http://103.147.34.20:10700/api/',
// API_IMAGE_ENDPOINT: 'http://103.147.34.20:10705/file/upload/',
API_ENDPOINT: 'http://103.147.34.20:10700/api/',
API_IMAGE_ENDPOINT: 'http://103.147.34.20:10705/file/upload/',
API_RES_CODE: {
OK: {
......@@ -42,7 +42,7 @@ export enum API_PATHS {
getListUnits = '/artistOwner',
getListArtists = '/artist',
getFieldOptions = '/field',
getClassificationOptions="/common/classification",
getClassificationOptions= '/common/classification',
getNationalityOptions = '/nationality',
getProvinceOptions = '/common/province',
getMusicTypeOptions= '/common/musicType',
......
......@@ -268,6 +268,7 @@ export type DetailUnit = {
password: string;
fields: Array<FieldType>;
contracts: Array<Contract>;
classification: Array<ClassificationOptions>
};
......
......@@ -127,7 +127,7 @@
:rules="addressRules"
clearable
></q-input>
<q-select
:model-value="fields"
@update:model-value="$emit('update:fields', $event)"
......@@ -375,7 +375,7 @@
v-model:contractTimeTo="contractTimeTo"
:artistOptions="artistOptions"
:fieldOptions="fieldsOptions"
:fieldsAddOptions="fieldsAddOptions"
:fieldsAddOptions="fieldsAddOptions"
@saveArtistInfo="updateArtistContract"
/>
......@@ -590,8 +590,7 @@ export default defineComponent({
const updateArtistDialogIsOpened = ref(false);
const fieldsAddOptions: Ref<FieldType[]> = ref([]);
const fieldsOptions: Ref<ClassificationOptions[]> = ref([]);
const artistOptions: Ref<ArtistInfoType[]> = ref([]);
const artistField: Ref<{ id: number; name: string } | undefined> =
ref(undefined);
......@@ -737,8 +736,6 @@ export default defineComponent({
})) as AxiosResponse<BaseResponseBody<FieldType[]>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
fieldsAddOptions.value = response.data.data;
}
};
......@@ -786,7 +783,7 @@ export default defineComponent({
const artistList = [];
for (let i = 0; i < item.length; i++) {
// artistList.push({
// // contractFrom: `${contractTimeFrom.value} 00:00:00`,
// // contractTo: `${contractTimeTo.value} 00:00:00`,
// // timeAdd: `${contractTimeFrom.value} - ${contractTimeTo.value}`,
......@@ -796,7 +793,7 @@ export default defineComponent({
// // artistFullName: artistName.value?.fullName,
// // field: artistField.value?.name,
// });
console.log(item[i],'item[i]')
console.log(item[i], 'item[i]');
}
// console.log(artistList, 'artistList')
......@@ -911,7 +908,7 @@ export default defineComponent({
onMounted(() => {
void getClassificationOptions();
void getFieldOptions()
void getFieldOptions();
});
return {
......
......@@ -461,8 +461,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
url: 'https://cms.vab.vn/file/upload/', // pro
// url: 'http://103.147.34.20:10705/file/upload/', // test
url: config.API_IMAGE_ENDPOINT, // pro
method: 'POST',
data: bodyFormData,
......
......@@ -400,7 +400,9 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
url: 'https://cms.vab.vn/file/upload/', // pro
// url: 'https://cms.vab.vn/file/upload/', // pro
url: config.API_IMAGE_ENDPOINT, // pro
// url: 'http://103.147.34.20:10705/file/upload/', // test
method: 'POST',
......
......@@ -408,7 +408,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
url: 'https://cms.vab.vn/file/upload/', // pro
// url: 'https://cms.vab.vn/file/upload/', // pro
url: config.API_IMAGE_ENDPOINT, // pro
// url: 'http://103.147.34.20:10705/file/upload/', // test
method: 'POST',
......
......@@ -468,7 +468,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
url: 'https://cms.vab.vn/file/upload/', // pro
// url: 'https://cms.vab.vn/file/upload/', // pro
url: config.API_IMAGE_ENDPOINT, // pro
// url: 'http://103.147.34.20:10705/file/upload/', // test
method: 'POST',
......
......@@ -413,7 +413,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
url: 'https://cms.vab.vn/file/upload/', // pro
// url: 'https://cms.vab.vn/file/upload/', // pro
url: config.API_IMAGE_ENDPOINT, // pro
// url: 'http://103.147.34.20:10705/file/upload/', // test
method: 'POST',
data: bodyFormData,
......
......@@ -292,7 +292,7 @@ export default defineComponent({
const fieldSelected: Ref<FieldType | undefined> = ref();
const addUnitDialogIsOpened = ref(false);
const updateUnitDialogIsOpened = ref(false);
const unitField: Ref<ClassificationOptions[] | undefined> = ref(undefined);
const unitField: Ref<unknown[]> = ref([]);
const unitCode = ref('');
const unitName = ref('');
const unitRepresentative = ref('');
......@@ -326,7 +326,7 @@ export default defineComponent({
};
const openAddUnitDialog = () => {
unitField.value = undefined;
unitField.value = [];
unitCode.value = '';
unitName.value = '';
unitRepresentative.value = '';
......@@ -365,7 +365,7 @@ export default defineComponent({
unitAddress.value = response.data.data.address;
unitStatus.value = response.data.data.status;
unitArtistList.value = response.data.data.contracts;
unitField.value = response.data.data.fields;
unitField.value = response.data.data.classification;
unitUserName.value = response.data.data.userName;
unitPassword.value = response.data.data.password;
}
......@@ -448,6 +448,7 @@ export default defineComponent({
};
const updateNewUnit = async () => {
const data = {
id: unitId.value,
name: unitName.value,
......@@ -481,13 +482,15 @@ export default defineComponent({
};
//add
const addNewUnit = async () => {
const addNewUnit = async () => {
let hasError = false;
if (unitArtistList.value.length !== 0) {
hasError = true;
check_artistList.value = true;
}
if (hasError === false) {
console.log(unitField,'unitField.value')
const data = {
name: unitName.value,
code: unitCode.value,
......@@ -496,10 +499,13 @@ export default defineComponent({
email: unitEmail.value,
phoneNumber: unitPhoneNumber.value,
status: unitStatus.value,
classification: unitField.value,
classification: unitField.value === null ? null : unitField.value ,
userName: unitUserName.value,
password: unitPassword.value,
contracts: unitArtistList.value,
};
const response = (await api({
url: API_PATHS.artistOwnerAdd,
......
......@@ -284,7 +284,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
url: 'https://cms.vab.vn/file/upload/', // pro
// url: 'https://cms.vab.vn/file/upload/', // pro
url: config.API_IMAGE_ENDPOINT, // pro
// url: 'http://103.147.34.20:10705/file/upload/', // test
method: 'POST',
data: bodyFormData,
......
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