Commit bf463eee authored by hong-IT-99's avatar hong-IT-99
parents c49d4e95 7445bb82
...@@ -3,7 +3,7 @@ import { i18n } from 'src/boot/i18n'; ...@@ -3,7 +3,7 @@ import { i18n } from 'src/boot/i18n';
import { isEmail } from '../../../boot/functions'; import { isEmail } from '../../../boot/functions';
import { isMobilePhone } from '../../../boot/functions'; import { isMobilePhone } from '../../../boot/functions';
import AddNewArtistDialog from 'components/managingunits/add-new-managingunits-dialog/add-new-artist-dialog/index.vue'; import AddNewArtistDialog from 'components/managingunits/add-new-managingunits-dialog/add-new-artist-dialog/index.vue';
import UpdateNewArtistDialog from 'components/managingunits/update-new-managingunits-dialog/update-new-artist-dialog/index.vue'; import UpdateNewArtistDialog from 'components/managingunits/add-new-managingunits-dialog/update-new-artist-dialog/index.vue';
import { API_PATHS } from 'src/assets/configurations.example'; import { API_PATHS } from 'src/assets/configurations.example';
import { AxiosResponse } from 'axios'; import { AxiosResponse } from 'axios';
import { api, BaseResponseBody } from 'src/boot/axios'; import { api, BaseResponseBody } from 'src/boot/axios';
...@@ -37,34 +37,26 @@ export default defineComponent({ ...@@ -37,34 +37,26 @@ export default defineComponent({
const openUpdateArtistDialog = ref(false); const openUpdateArtistDialog = ref(false);
const UpdateArtistDialog = (item: { const UpdateArtistDialog = (item: {
row: { row: {
id: number; artistId: number;
name: string;
fullName: string;
artistName: string; artistName: string;
contractFrom: string;
contractTo: string;
field: string; field: string;
fullName: string;
status: number;
timeAdd: string; timeAdd: string;
}; };
}) => { }) => {
console.log(item, 'aa'); openUpdateArtistDialog.value = true;
fieldsUpdate.value.name = item.row.field; fieldsUpdate.value.name = item.row.field;
nameUpdate.value.fullName = item.row.fullName; nameUpdate.value.fullName = item.row.fullName;
openUpdateArtistDialog.value = true; timeUpdateForm.value.contractFrom = item.row.contractFrom;
timeUpdateTo.value.contractTo = item.row.contractTo;
statusUpdate.value.status = item.row.status;
}; };
const updateNewManagingUnitsArtist = ( const updateNewManagingUnitsArtist = () => {
timeUpdateTo: string, managingUnitUpdateTableRows.value.push({});
timeUpdateForm: string
) => {
managingUnitUpdateTableRows.value.push({
contractFrom: timeUpdateForm,
contractTo: timeUpdateTo,
timeAdd: timeUpdateTo + ' - ' + timeUpdateForm,
status: statusUpdate,
artistId: nameAdd.value.id,
artistName: nameAdd.value.artistName,
fullName: nameAdd.value.fullName,
field: nameAdd.value.field,
});
}; };
//add //add
...@@ -161,8 +153,11 @@ export default defineComponent({ ...@@ -161,8 +153,11 @@ export default defineComponent({
id: 0, id: 0,
name: '', name: '',
}); });
const statusUpdate: Ref<number> = ref(1); const statusUpdate: Ref<{ status: number }> = ref({ status: 1 });
const timeUpdateForm: Ref<{ contractFrom: string }> = ref({
contractFrom: '',
});
const timeUpdateTo: Ref<{ contractTo: string }> = ref({ contractTo: '' });
watch( watch(
() => fieldsAdd.value, () => fieldsAdd.value,
(value) => { (value) => {
......
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
v-model:status-update="statusUpdate" v-model:status-update="statusUpdate"
:fields-add-options="fieldsAddOptions" :fields-add-options="fieldsAddOptions"
:name-add-options="nameAddOptions" :name-add-options="nameAddOptions"
@click:CloseBtn="openUpdateArtistDialog = false" @click:CloseBtn="openUpdateArtistDialogAdd = false"
@updateNewManagingUnitsArtist="updateNewManagingUnitsArtist" @updateNewManagingUnitsArtist="updateNewManagingUnitsArtist"
/> />
......
...@@ -41,7 +41,7 @@ export default defineComponent({ ...@@ -41,7 +41,7 @@ export default defineComponent({
const timeUpdateFormRules = [ const timeUpdateFormRules = [
(val?: string) => (val?: string) =>
(val && val.trim().length) || (val && val.trim().length) ||
i18n.global.t('managingUnitAdd.validateMessages.requireTimeUpdateForm'), i18n.global.t('managingUnitAdd.validateMessages.requireTimeUpdate'),
]; ];
const timeUpdateToRules = [ const timeUpdateToRules = [
(val?: string) => (val?: string) =>
......
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
:rules="nameUpdateRules" :rules="nameUpdateRules"
hide-bottom-space hide-bottom-space
map-options map-options
emit-value
option-value="id" option-value="id"
option-label="fullName" option-label="fullName"
class="q-my-sm" class="q-my-sm"
......
...@@ -7,10 +7,10 @@ export default defineComponent({ ...@@ -7,10 +7,10 @@ export default defineComponent({
type: Boolean, type: Boolean,
required: true, required: true,
}, },
fieldsAddOptions: {type: Array, required: true}, fieldsAddOptions: { type: Array, required: true },
fieldsUpdate: { type: Number, required: true}, fieldsUpdate: { type: Number, required: true },
nameUpdate: { type: Number, required: true }, nameUpdate: { type: Number, required: true },
nameUpdateOptions: {type: Array, required: true}, nameUpdateOptions: { type: Array, required: true },
timeUpdateTo: { type: String, required: true }, timeUpdateTo: { type: String, required: true },
timeUpdate: { type: String, required: true }, timeUpdate: { type: String, required: true },
statusUpdate: { type: Boolean, required: true }, statusUpdate: { type: Boolean, required: true },
...@@ -27,20 +27,20 @@ export default defineComponent({ ...@@ -27,20 +27,20 @@ export default defineComponent({
i18n.global.t('managingUnitAdd.validateMessages.requireTimeUpdateTo'), i18n.global.t('managingUnitAdd.validateMessages.requireTimeUpdateTo'),
]; ];
const fieldsUpdateRules = [ const fieldsUpdateRules = [
(val?: number) => (val?: number) =>
val !== undefined || val !== undefined ||
i18n.global.t('managingUnitAdd.validateMessages.requireFieldsUpdate'), i18n.global.t('managingUnitAdd.validateMessages.requireFieldsUpdate'),
]; ];
const timeUpdateRules = [ const timeUpdateRules = [
(val?: string) => (val?: string) =>
(val && val.trim().length) || (val && val.trim().length) ||
i18n.global.t('managingUnitAdd.validateMessages.requireTimeUpdate'), i18n.global.t('managingUnitAdd.validateMessages.requireTimeUpdate'),
]; ];
return { return {
nameUpdateRules, nameUpdateRules,
timeUpdateToRules, timeUpdateToRules,
fieldsUpdateRules, fieldsUpdateRules,
timeUpdateRules, timeUpdateRules,
}; };
}, },
emits: [ emits: [
......
...@@ -108,14 +108,6 @@ export default defineComponent({ ...@@ -108,14 +108,6 @@ export default defineComponent({
//Add nghệ sỹ //Add nghệ sỹ
const managingUnitAddTableColumns = [ const managingUnitAddTableColumns = [
// {
// name: 'sttAdd',
// field: 'sttAdd',
// required: true,
// label: i18n.global.t('managingUnitAdd.tableColumns.sttAdd'),
// align: 'center',
// sortable: false,
// },
{ {
name: 'nameAdd', name: 'nameAdd',
field: 'fullName', field: 'fullName',
...@@ -174,14 +166,6 @@ export default defineComponent({ ...@@ -174,14 +166,6 @@ export default defineComponent({
//Update nghệ sỹ //Update nghệ sỹ
const managingUnitUpdateTableColumns = [ const managingUnitUpdateTableColumns = [
// {
// name: 'sttAdd',
// field: 'sttAdd',
// required: true,
// label: i18n.global.t('managingUnitAdd.tableColumns.sttAdd'),
// align: 'center',
// sortable: false,
// },
{ {
name: 'nameAdd', name: 'nameAdd',
field: 'fullName', field: 'fullName',
......
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