update

parent c2d6d6ce
...@@ -314,6 +314,7 @@ export type Contract = { ...@@ -314,6 +314,7 @@ export type Contract = {
artistFullName: string; artistFullName: string;
field: string; field: string;
fieldId: number; fieldId: number;
id: number
}; };
export type ArtistOwnerAdd = { export type ArtistOwnerAdd = {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
isUpdate isUpdate
? $t('managingUnit.dialogLabel.title.add') ? $t('managingUnit.dialogLabel.title.add')
: $t('managingUnit.dialogLabel.title.update') : $t('managingUnit.dialogLabel.title.update')
}} }}
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
...@@ -185,9 +185,9 @@ ...@@ -185,9 +185,9 @@
separator="cell" separator="cell"
:no-data-label="$t('emptyData')" :no-data-label="$t('emptyData')"
hide-pagination hide-pagination
:pagination="{ :pagination="{
rowsPerPage: 0, rowsPerPage: 0,
}" }"
> >
<template v-slot:body-cell-action="item"> <template v-slot:body-cell-action="item">
<q-td style="padding: 0" class="flex flex-center"> <q-td style="padding: 0" class="flex flex-center">
...@@ -365,6 +365,7 @@ ...@@ -365,6 +365,7 @@
v-model:artistStatus="artistStatus" v-model:artistStatus="artistStatus"
v-model:contractTimeFrom="contractTimeFrom" v-model:contractTimeFrom="contractTimeFrom"
v-model:contractTimeTo="contractTimeTo" v-model:contractTimeTo="contractTimeTo"
v-model:contractId="contractId"
:artistOptions="artistOptions" :artistOptions="artistOptions"
:fieldOptions="fieldsOptions" :fieldOptions="fieldsOptions"
:fieldsAddOptions="fieldsAddOptions" :fieldsAddOptions="fieldsAddOptions"
...@@ -591,6 +592,8 @@ export default defineComponent({ ...@@ -591,6 +592,8 @@ export default defineComponent({
const artistStatus = ref(1); const artistStatus = ref(1);
const contractTimeFrom = ref(''); const contractTimeFrom = ref('');
const contractTimeTo = ref(''); const contractTimeTo = ref('');
const contractId = ref(0);
const selectedContract: Ref< const selectedContract: Ref<
{ artist: Contract; index: number } | undefined { artist: Contract; index: number } | undefined
> = ref(undefined); > = ref(undefined);
...@@ -676,6 +679,7 @@ export default defineComponent({ ...@@ -676,6 +679,7 @@ export default defineComponent({
() => contractTimeFrom.value, () => contractTimeFrom.value,
(value) => { (value) => {
if (value) { if (value) {
console.log(value,'12312312');
const fromDate = moment(value, 'DD/MM/YYYY', true).toDate(); const fromDate = moment(value, 'DD/MM/YYYY', true).toDate();
const toDate = contractTimeTo.value const toDate = contractTimeTo.value
? moment(contractTimeTo.value, 'DD/MM/YYYY', true).toDate() ? moment(contractTimeTo.value, 'DD/MM/YYYY', true).toDate()
...@@ -808,6 +812,8 @@ export default defineComponent({ ...@@ -808,6 +812,8 @@ export default defineComponent({
const openUpdateArtistDialog = (artist: Contract, index: number) => { const openUpdateArtistDialog = (artist: Contract, index: number) => {
selectedContract.value = { artist, index }; selectedContract.value = { artist, index };
updateArtistDialogIsOpened.value = true; updateArtistDialogIsOpened.value = true;
contractId.value = artist.id;
artistField.value = { id: artist.fieldId, name: artist.field }; artistField.value = { id: artist.fieldId, name: artist.field };
artistStatus.value = artist.status; artistStatus.value = artist.status;
contractTimeFrom.value = moment( contractTimeFrom.value = moment(
...@@ -822,6 +828,7 @@ export default defineComponent({ ...@@ -822,6 +828,7 @@ export default defineComponent({
const updateArtistContract = () => { const updateArtistContract = () => {
const newArtistList = [...props.artistList]; const newArtistList = [...props.artistList];
if (selectedContract.value) { if (selectedContract.value) {
newArtistList[selectedContract.value.index] = { newArtistList[selectedContract.value.index] = {
contractFrom: `${contractTimeFrom.value} 00:00:00`, contractFrom: `${contractTimeFrom.value} 00:00:00`,
...@@ -833,6 +840,8 @@ export default defineComponent({ ...@@ -833,6 +840,8 @@ export default defineComponent({
artistFullName: artistName.value?.fullName, artistFullName: artistName.value?.fullName,
field: artistField.value?.name, field: artistField.value?.name,
fieldId: artistField.value?.id, fieldId: artistField.value?.id,
id:contractId.value
}; };
context.emit('update:artistList', [...newArtistList]); context.emit('update:artistList', [...newArtistList]);
Notify.create({ Notify.create({
...@@ -846,9 +855,9 @@ export default defineComponent({ ...@@ -846,9 +855,9 @@ export default defineComponent({
}; };
const addNewArtist = () => { const addNewArtist = () => {
console.log(artistField.value, 'artistField.value');
const newArtistList = [...props.artistList]; const newArtistList = [...props.artistList];
newArtistList.push({ newArtistList.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`,
...@@ -950,6 +959,7 @@ export default defineComponent({ ...@@ -950,6 +959,7 @@ export default defineComponent({
taxCodeRules, taxCodeRules,
passwordInputRules, passwordInputRules,
isPwd: ref(true), isPwd: ref(true),
contractId,
}; };
}, },
emits: [ emits: [
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
isUpdate isUpdate
? $t('managingUnitAdd.dialogLabel.title.add') ? $t('managingUnitAdd.dialogLabel.title.add')
: $t('managingUnitAdd.dialogLabel.title.update') : $t('managingUnitAdd.dialogLabel.title.update')
}} }}
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
...@@ -209,6 +209,7 @@ export default defineComponent({ ...@@ -209,6 +209,7 @@ export default defineComponent({
artistStatus: { type: Number, required: true }, artistStatus: { type: Number, required: true },
contractTimeFrom: { type: String, required: true }, contractTimeFrom: { type: String, required: true },
contractTimeTo: { type: String, required: true }, contractTimeTo: { type: String, required: true },
contractId:{type:Number, required: true}
// rowDataAccBank: { // rowDataAccBank: {
// type: Object as PropType<BankAccountType>, // type: Object as PropType<BankAccountType>,
// required: true, // required: true,
......
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