update

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