update

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