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