@coopenomics/desktop 2025.6.14 → 2025.6.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/src/entities/Branch/api/index.ts +1 -2
- package/src/entities/Branch/model/types.ts +2 -1
- package/src/entities/Session/model/store.ts +1 -1
- package/src/features/Branch/CreateBranch/ui/CreateBranchButton.vue +85 -33
- package/src/features/Branch/DeleteBranch/api/index.ts +15 -0
- package/src/features/Branch/DeleteBranch/index.ts +1 -0
- package/src/features/Branch/DeleteBranch/model/index.ts +44 -0
- package/src/features/Branch/DeleteBranch/ui/DeleteBranchButton.vue +56 -0
- package/src/features/Cooperative/UpdateBoard/index.ts +1 -0
- package/src/features/Cooperative/UpdateBoard/ui/AddMemberDialog.vue +59 -0
- package/src/features/Cooperative/UpdateBoard/ui/index.ts +1 -0
- package/src/features/Installer/ui/RequestKeyForm/RequestKeyForm.vue +1 -1
- package/src/features/Installer/ui/SetSovietForm/SetSovietForm.vue +1 -1
- package/src/features/Meet/CreateMeet/model/index.ts +4 -2
- package/src/features/Meet/CreateMeet/ui/CreateMeet.vue +8 -0
- package/src/features/Meet/CreateMeet/ui/CreateMeetForm.vue +164 -76
- package/src/features/Meet/GenerateSovietDecision/model/index.ts +1 -1
- package/src/features/Meet/RestartMeet/model/index.ts +16 -3
- package/src/features/Meet/RestartMeet/ui/RestartMeetForm.vue +135 -73
- package/src/features/PaymentMethod/AddPaymentMethod/ui/AddPaymentButton.vue +1 -1
- package/src/features/PaymentMethod/DeletePaymentMethod/ui/DeletePaymentMethodButton.vue +1 -1
- package/src/features/Request/AcceptRequest/ui/AcceptButton.vue +1 -1
- package/src/features/Request/CancelRequest/ui/CancelButton.vue +1 -1
- package/src/features/Request/CompleteOnRequest/ui/CompleteOnRequestButton.vue +1 -1
- package/src/features/Request/ConfirmRecieveOnRequest/ui/ConfirmRecieveOnRequest.vue +1 -1
- package/src/features/Request/ConfirmSupplyOnRequest/ui/ConfirmSupplyOnRequestButton.vue +1 -1
- package/src/features/Request/CreateChildOrder/ui/CreateChildOrderButton/CreateChildOrderButton.vue +1 -1
- package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +1 -1
- package/src/features/Request/DeliverOnRequest/ui/DeliverOnRequestButton.vue +1 -1
- package/src/features/Request/DisputeOnRequest/ui/DisputeOnRequestButton.vue +1 -1
- package/src/features/Request/PublishRequest/ui/PublishRequestButton.vue +1 -1
- package/src/features/Request/RecieveOnRequest/ui/RecieveOnRequestButton.vue +1 -1
- package/src/features/Request/SupplyOnRequest/ui/SupplyOnRequestButton.vue +1 -1
- package/src/features/Request/UnpublishRequest/ui/UnpublishRequestButton.vue +1 -1
- package/src/features/Union/AddCooperative/ui/AddCooperativeForm.vue +1 -1
- package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +1 -1
- package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +1 -1
- package/src/features/Wallet/WithdrawFromWallet/ui/withdrawButton.vue +1 -1
- package/src/pages/Cooperative/ListOfMeets/ui/ListOfMeetsPage.vue +1 -1
- package/src/pages/Cooperative/MemberBranchList/ui/MemberBranchListPage.vue +3 -0
- package/src/pages/Registrator/SignUp/GenerateAccount.vue +1 -1
- package/src/pages/Registrator/SignUp/ReadStatement.vue +1 -1
- package/src/pages/Registrator/SignUp/SignUp.vue +0 -2
- package/src/pages/Union/ListOfCooperatives/ui/UnionPageListOfCooperatives.vue +2 -2
- package/src/processes/navigation-guard-setup/index.ts +31 -31
- package/src/processes/process-decisions/index.ts +6 -1
- package/src/processes/select-branch/index.ts +11 -4
- package/src/shared/api/errors.ts +2 -1
- package/src/shared/ui/UserSearchSelector/UserSearchSelector.vue +328 -0
- package/src/shared/ui/UserSearchSelector/composables/useUserSearch.ts +70 -0
- package/src/shared/ui/UserSearchSelector/index.ts +3 -0
- package/src/shared/ui/UserSearchSelector/model/types.ts +17 -0
- package/src/shared/ui/index.ts +1 -0
- package/src/widgets/Cooperative/Funds/ui/AccumulationFunds.vue +3 -3
- package/src/widgets/Cooperative/Funds/ui/AddAccumulationFund.vue +1 -1
- package/src/widgets/Cooperative/Funds/ui/AddExpenseFund.vue +1 -1
- package/src/widgets/Cooperative/Funds/ui/ExpenseFunds.vue +3 -3
- package/src/widgets/Cooperative/Members/ui/Members.vue +167 -135
- package/src/widgets/Registrator/LostKey/ui/LostKey.vue +1 -1
- package/src/widgets/Registrator/ResetKey/ui/ResetKey.vue +1 -1
@@ -1,114 +1,198 @@
|
|
1
1
|
<template lang="pug">
|
2
|
-
q-dialog(
|
3
|
-
|
2
|
+
q-dialog(
|
3
|
+
:model-value='modelValue',
|
4
|
+
@update:model-value='$emit("update:modelValue", $event)',
|
5
|
+
persistent
|
6
|
+
)
|
7
|
+
q-card(style='min-width: 500px')
|
4
8
|
q-card-section.row.items-center
|
5
|
-
|
9
|
+
.text-h6 Создать общее собрание {{ isChairman ? '(Председатель)' : '(Член совета)' }}
|
6
10
|
q-space
|
7
|
-
q-btn(
|
11
|
+
q-btn(
|
12
|
+
icon='close',
|
13
|
+
flat,
|
14
|
+
round,
|
15
|
+
dense,
|
16
|
+
v-close-popup,
|
17
|
+
@click='$emit("update:modelValue", false)'
|
18
|
+
)
|
8
19
|
|
9
20
|
q-card-section
|
10
|
-
q-form(@submit=
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
:
|
21
|
+
q-form(@submit='handleSubmit')
|
22
|
+
// Выбор типа собрания
|
23
|
+
q-select(
|
24
|
+
v-model='formData.type',
|
25
|
+
:options='meetTypeOptions',
|
26
|
+
label='Тип собрания',
|
27
|
+
emit-value,
|
28
|
+
map-options,
|
29
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
15
30
|
dense
|
16
31
|
)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
32
|
+
|
33
|
+
UserSearchSelector(
|
34
|
+
v-model='formData.presider',
|
35
|
+
label='Председатель собрания',
|
36
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
37
|
+
dense
|
38
|
+
)
|
39
|
+
|
40
|
+
UserSearchSelector(
|
41
|
+
v-model='formData.secretary',
|
42
|
+
label='Секретарь собрания',
|
43
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
21
44
|
dense
|
22
45
|
)
|
23
46
|
q-input(
|
24
|
-
v-model=
|
25
|
-
:label=
|
26
|
-
type=
|
27
|
-
:rules=
|
47
|
+
v-model='formData.open_at',
|
48
|
+
:label='env.NODE_ENV === "development" ? `Дата и время открытия (мин. через 1 минуту, ${timezoneLabel})` : `Дата и время открытия (мин. через 15 дней, ${timezoneLabel})`',
|
49
|
+
type='datetime-local',
|
50
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
28
51
|
dense
|
29
52
|
)
|
30
53
|
q-input(
|
31
|
-
v-model=
|
32
|
-
:label=
|
33
|
-
type=
|
34
|
-
:rules=
|
54
|
+
v-model='formData.close_at',
|
55
|
+
:label='`Дата и время закрытия (${timezoneLabel})`',
|
56
|
+
type='datetime-local',
|
57
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
35
58
|
dense
|
36
59
|
)
|
37
60
|
|
61
|
+
.text-h6.q-mt-md Повестка собрания
|
38
62
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
63
|
+
q-card.q-mb-lg.q-pa-sm(
|
64
|
+
flat,
|
65
|
+
bordered,
|
66
|
+
v-for='(point, index) in formData.agenda_points',
|
67
|
+
:key='index'
|
68
|
+
)
|
69
|
+
.row.items-center.q-mb-sm
|
70
|
+
.text-subtitle1.q-mr-md № {{ index + 1 }}
|
71
|
+
.col-auto
|
72
|
+
q-btn(
|
73
|
+
flat,
|
74
|
+
icon='delete',
|
75
|
+
size='sm',
|
76
|
+
color='grey',
|
77
|
+
@click='removeAgendaPoint(index)'
|
78
|
+
)
|
79
|
+
|
80
|
+
.q-mb-sm
|
48
81
|
q-input(
|
49
|
-
v-model=
|
50
|
-
label=
|
51
|
-
:rules=
|
52
|
-
dense
|
53
|
-
type=
|
82
|
+
v-model='point.title',
|
83
|
+
label='Вопрос',
|
84
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
85
|
+
dense,
|
86
|
+
type='textarea',
|
54
87
|
autogrow
|
55
88
|
)
|
56
89
|
|
57
|
-
|
90
|
+
.q-mb-sm
|
58
91
|
q-input(
|
59
|
-
v-model=
|
60
|
-
label=
|
61
|
-
:rules=
|
62
|
-
dense
|
63
|
-
type=
|
92
|
+
v-model='point.decision',
|
93
|
+
label='Проект Решения',
|
94
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
95
|
+
dense,
|
96
|
+
type='textarea',
|
64
97
|
autogrow
|
65
98
|
)
|
66
99
|
|
67
|
-
|
100
|
+
.q-mb-sm
|
68
101
|
q-input(
|
69
|
-
v-model=
|
70
|
-
label=
|
71
|
-
:rules=
|
72
|
-
dense
|
73
|
-
type=
|
102
|
+
v-model='point.context',
|
103
|
+
label='Приложения',
|
104
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
105
|
+
dense,
|
106
|
+
type='textarea',
|
74
107
|
autogrow
|
75
108
|
)
|
76
109
|
|
77
|
-
q-separator(v-if=
|
110
|
+
q-separator(v-if='index < formData.agenda_points.length - 1')
|
78
111
|
|
79
|
-
|
80
|
-
q-btn(
|
112
|
+
.text-center.q-mb-md
|
113
|
+
q-btn(
|
114
|
+
outline,
|
115
|
+
label='Добавить пункт повестки',
|
116
|
+
@click='addAgendaPoint'
|
117
|
+
)
|
81
118
|
|
82
119
|
q-card-section.q-pt-none
|
83
|
-
|
84
|
-
|
85
|
-
q-card-actions(align=
|
86
|
-
q-btn(
|
87
|
-
|
120
|
+
.text-caption.text-grey При создании собрания будет сгенерирован документ повестки.
|
121
|
+
|
122
|
+
q-card-actions(align='right')
|
123
|
+
q-btn(
|
124
|
+
flat,
|
125
|
+
label='Отмена',
|
126
|
+
v-close-popup,
|
127
|
+
@click='$emit("update:modelValue", false)',
|
128
|
+
:disable='loading'
|
129
|
+
)
|
130
|
+
q-btn(
|
131
|
+
color='primary',
|
132
|
+
label='Создать',
|
133
|
+
type='submit',
|
134
|
+
@click='handleSubmit',
|
135
|
+
:loading='loading'
|
136
|
+
)
|
88
137
|
</template>
|
89
138
|
|
90
139
|
<script setup lang="ts">
|
91
|
-
import { reactive } from 'vue'
|
92
|
-
import { useAgendaPoints } from 'src/shared/hooks/useAgendaPoints'
|
93
|
-
import {
|
94
|
-
|
140
|
+
import { reactive, computed, onMounted } from 'vue';
|
141
|
+
import { useAgendaPoints } from 'src/shared/hooks/useAgendaPoints';
|
142
|
+
import {
|
143
|
+
getCurrentLocalDateForForm,
|
144
|
+
convertLocalDateToUTC,
|
145
|
+
getTimezoneLabel,
|
146
|
+
getFutureDateForForm,
|
147
|
+
} from 'src/shared/lib/utils/dates/timezone';
|
148
|
+
import { env } from 'src/shared/config/Environment';
|
95
149
|
import { useSessionStore } from 'src/entities/Session';
|
96
150
|
import { useSystemStore } from 'src/entities/System/model';
|
151
|
+
import { UserSearchSelector } from 'src/shared/ui';
|
152
|
+
|
153
|
+
// Определяем пропсы один раз
|
154
|
+
const props = defineProps<{
|
155
|
+
modelValue: boolean;
|
156
|
+
loading?: boolean;
|
157
|
+
isChairman: boolean;
|
158
|
+
}>();
|
97
159
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}
|
160
|
+
// Отладочная информация при монтировании
|
161
|
+
onMounted(() => {
|
162
|
+
console.log('CreateMeetForm mounted, isChairman:', props.isChairman);
|
163
|
+
});
|
102
164
|
|
103
165
|
const emit = defineEmits<{
|
104
|
-
(e: 'update:modelValue', value: boolean): void
|
105
|
-
(e: 'create', data: any): void
|
106
|
-
}>()
|
166
|
+
(e: 'update:modelValue', value: boolean): void;
|
167
|
+
(e: 'create', data: any): void;
|
168
|
+
}>();
|
107
169
|
|
108
170
|
// Название часового пояса для отображения в лейблах
|
109
|
-
const timezoneLabel = getTimezoneLabel()
|
110
|
-
const session = useSessionStore()
|
111
|
-
const system = useSystemStore()
|
171
|
+
const timezoneLabel = getTimezoneLabel();
|
172
|
+
const session = useSessionStore();
|
173
|
+
const system = useSystemStore();
|
174
|
+
|
175
|
+
// Делаем isChairman доступным в шаблоне напрямую для отладки
|
176
|
+
const isChairman = computed(() => {
|
177
|
+
console.log('Вычисляемое свойство isChairman:', props.isChairman);
|
178
|
+
return props.isChairman;
|
179
|
+
});
|
180
|
+
|
181
|
+
// Опции для выбора типа собрания в зависимости от роли
|
182
|
+
const meetTypeOptions = computed(() => {
|
183
|
+
// Выведем отладочную информацию, чтобы увидеть значение флага
|
184
|
+
console.log('isChairman в форме для опций:', props.isChairman);
|
185
|
+
|
186
|
+
// Председатель может выбирать любой тип
|
187
|
+
if (props.isChairman) {
|
188
|
+
return [
|
189
|
+
{ label: 'Очередное собрание', value: 'regular' },
|
190
|
+
{ label: 'Внеочередное собрание', value: 'extra' },
|
191
|
+
];
|
192
|
+
}
|
193
|
+
// Члены совета могут создавать только внеочередное
|
194
|
+
return [{ label: 'Внеочередное собрание', value: 'extra' }];
|
195
|
+
});
|
112
196
|
|
113
197
|
// Форма для создания собрания
|
114
198
|
const formData = reactive(
|
@@ -121,6 +205,7 @@ const formData = reactive(
|
|
121
205
|
open_at: getCurrentLocalDateForForm(0.17), // ~10 секунд от текущего времени
|
122
206
|
close_at: getCurrentLocalDateForForm(2), // 2 минуты от текущего времени
|
123
207
|
username: session.username,
|
208
|
+
type: props.isChairman ? 'regular' : 'extra', // Тип по умолчанию в зависимости от роли
|
124
209
|
agenda_points: [
|
125
210
|
{
|
126
211
|
title: 'Тестовый вопрос',
|
@@ -137,22 +222,25 @@ const formData = reactive(
|
|
137
222
|
open_at: getFutureDateForForm(15, 6, 0), // через 15 дней, 6:00
|
138
223
|
close_at: getFutureDateForForm(18, 12, 0), // через 18 дней, 12:00
|
139
224
|
username: session.username,
|
225
|
+
type: props.isChairman ? 'regular' : 'extra', // Тип по умолчанию в зависимости от роли
|
140
226
|
agenda_points: [
|
141
227
|
// пустой массив, либо можно добавить пустой объект для вёрстки
|
142
228
|
],
|
143
|
-
}
|
144
|
-
)
|
229
|
+
},
|
230
|
+
);
|
145
231
|
|
146
|
-
const { addAgendaPoint, removeAgendaPoint } = useAgendaPoints(
|
232
|
+
const { addAgendaPoint, removeAgendaPoint } = useAgendaPoints(
|
233
|
+
formData.agenda_points,
|
234
|
+
);
|
147
235
|
|
148
236
|
const handleSubmit = () => {
|
149
237
|
// Конвертируем локальные даты в UTC для отправки в блокчейн
|
150
238
|
const dataToSend = {
|
151
239
|
...formData,
|
152
240
|
open_at: convertLocalDateToUTC(formData.open_at),
|
153
|
-
close_at: convertLocalDateToUTC(formData.close_at)
|
154
|
-
}
|
241
|
+
close_at: convertLocalDateToUTC(formData.close_at),
|
242
|
+
};
|
155
243
|
|
156
|
-
emit('create', dataToSend)
|
157
|
-
}
|
244
|
+
emit('create', dataToSend);
|
245
|
+
};
|
158
246
|
</script>
|
@@ -36,7 +36,7 @@ export function useGenerateSovietDecisionOnAnnualMeet() {
|
|
36
36
|
if (!data.meet_hash) {
|
37
37
|
throw new Error('Необходимо указать хеш собрания (meet_hash)')
|
38
38
|
}
|
39
|
-
|
39
|
+
console.log('data', data)
|
40
40
|
const { [Mutations.Meet.GenerateSovietDecisionOnAnnualMeetDocument.name]: result } = await client.Mutation(
|
41
41
|
Mutations.Meet.GenerateSovietDecisionOnAnnualMeetDocument.mutation,
|
42
42
|
{
|
@@ -27,6 +27,7 @@ export interface IRestartMeetWithProposalInput {
|
|
27
27
|
context: string
|
28
28
|
decision: string
|
29
29
|
}[]
|
30
|
+
type: string
|
30
31
|
}
|
31
32
|
|
32
33
|
/**
|
@@ -81,11 +82,12 @@ export async function restartMeetWithProposal(data: IRestartMeetWithProposalInpu
|
|
81
82
|
coopname: data.coopname,
|
82
83
|
username: data.username,
|
83
84
|
meet: {
|
84
|
-
type:
|
85
|
+
type: data.type,
|
85
86
|
open_at_datetime: openAtFormatted,
|
86
87
|
close_at_datetime: closeAtFormatted
|
87
88
|
},
|
88
|
-
questions: questions
|
89
|
+
questions: questions,
|
90
|
+
is_repeated: true
|
89
91
|
})
|
90
92
|
|
91
93
|
// Подписываем документ
|
@@ -145,13 +147,24 @@ export const useRestartMeet = (
|
|
145
147
|
if (!meetStore.currentMeet) return false
|
146
148
|
processingRef.value = true
|
147
149
|
try {
|
150
|
+
// Выводим полную структуру для отладки
|
151
|
+
console.log('Полные данные о собрании:', meetStore.currentMeet)
|
152
|
+
|
153
|
+
// Получаем тип собрания из текущего объекта meet
|
154
|
+
// По умолчанию используем 'regular' если тип не найден
|
155
|
+
const originalMeetType = (meetStore.currentMeet.processing?.meet.proposal?.document.meta as any).meet.type
|
156
|
+
|
157
|
+
// Выводим для отладки
|
158
|
+
console.log('Тип собрания для перезапуска:', originalMeetType)
|
159
|
+
|
148
160
|
const result = await restartMeetWithProposal({
|
149
161
|
coopname: info.coopname,
|
150
162
|
hash: meetStore.currentMeet.hash,
|
151
163
|
username: sessionStore.username,
|
152
164
|
new_open_at: data.new_open_at,
|
153
165
|
new_close_at: data.new_close_at,
|
154
|
-
agenda_points: data.agenda_points
|
166
|
+
agenda_points: data.agenda_points,
|
167
|
+
type: originalMeetType // Передаем оригинальный тип собрания
|
155
168
|
})
|
156
169
|
|
157
170
|
await meetStore.loadMeet({ coopname: info.coopname, hash: result.processing?.hash as string})
|
@@ -1,128 +1,190 @@
|
|
1
1
|
<template lang="pug">
|
2
|
-
q-dialog(
|
3
|
-
|
2
|
+
q-dialog(
|
3
|
+
:model-value='modelValue',
|
4
|
+
@update:model-value='$emit("update:modelValue", $event)',
|
5
|
+
persistent
|
6
|
+
)
|
7
|
+
q-card(style='min-width: 500px')
|
4
8
|
q-card-section.row.items-center
|
5
|
-
|
9
|
+
.text-h6 Перезапустить собрание
|
6
10
|
q-space
|
7
|
-
q-btn(
|
11
|
+
q-btn(
|
12
|
+
icon='close',
|
13
|
+
flat,
|
14
|
+
round,
|
15
|
+
dense,
|
16
|
+
v-close-popup,
|
17
|
+
@click='$emit("update:modelValue", false)'
|
18
|
+
)
|
8
19
|
q-card-section
|
9
|
-
q-form(@submit=
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
:rules=
|
20
|
+
q-form(@submit='handleSubmit')
|
21
|
+
.text-subtitle1.q-mb-sm Выберите новые даты и ответственных для собрания
|
22
|
+
|
23
|
+
UserSearchSelector.q-mb-md(
|
24
|
+
v-model='formData.new_presider',
|
25
|
+
label='Председатель собрания',
|
26
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
27
|
+
dense
|
28
|
+
)
|
29
|
+
|
30
|
+
UserSearchSelector.q-mb-md(
|
31
|
+
v-model='formData.new_secretary',
|
32
|
+
label='Секретарь собрания',
|
33
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
34
|
+
dense
|
35
|
+
)
|
36
|
+
|
37
|
+
q-input.q-mb-md(
|
38
|
+
v-model='formData.new_open_at',
|
39
|
+
:label='env.NODE_ENV === "development" ? `Новая дата и время открытия (мин. через 1 минуту, ${timezoneLabel})` : `Новая дата и время открытия (мин. через 15 дней, ${timezoneLabel})`',
|
40
|
+
type='datetime-local',
|
41
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
16
42
|
dense
|
17
|
-
class="q-mb-md"
|
18
43
|
)
|
19
|
-
q-input(
|
20
|
-
v-model=
|
21
|
-
:label=
|
22
|
-
type=
|
23
|
-
:rules=
|
44
|
+
q-input.q-mb-md(
|
45
|
+
v-model='formData.new_close_at',
|
46
|
+
:label='`Новая дата и время закрытия (${timezoneLabel})`',
|
47
|
+
type='datetime-local',
|
48
|
+
:rules='[(val) => !!val || "Обязательное поле"]',
|
24
49
|
dense
|
25
|
-
class="q-mb-md"
|
26
50
|
)
|
27
51
|
|
28
|
-
|
52
|
+
.text-subtitle1.q-mb-sm При перезапуске собрания будут использованы существующие пункты повестки:
|
29
53
|
|
30
|
-
q-card
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
54
|
+
q-card.q-pa-xs.q-my-sm.rounded-borders.bg-grey-1(
|
55
|
+
bordered,
|
56
|
+
flat,
|
57
|
+
v-if='meetStore.currentMeet?.processing?.questions?.length'
|
58
|
+
)
|
59
|
+
.q-mb-xs.flex.items-start.q-mb-lg.q-pa-xs(
|
60
|
+
v-for='(question, index) in meetStore.currentMeet.processing.questions',
|
61
|
+
:key='index'
|
62
|
+
)
|
63
|
+
AgendaNumberAvatar.q-mr-xs(:number='index + 1', size='22px')
|
64
|
+
.col
|
65
|
+
.text-body2.text-weight-medium.q-mb-2 {{ question.title }}
|
66
|
+
.text-caption.q-mb-1.q-mt-md
|
36
67
|
span.text-weight-bold.text-black Проект решения:
|
37
|
-
span.text-black.q-ml-xs {{question.decision }}
|
38
|
-
|
68
|
+
span.text-black.q-ml-xs {{ question.decision }}
|
69
|
+
.text-caption.q-mt-md
|
39
70
|
span.text-weight-bold.text-black Приложения:
|
40
|
-
span.text-black
|
71
|
+
span.text-black.q-ml-xs(
|
72
|
+
v-if='question.context',
|
73
|
+
v-html='parseLinks(question.context)'
|
74
|
+
)
|
41
75
|
span.text-black(v-else) —
|
42
76
|
|
43
|
-
|
44
|
-
|
77
|
+
.q-pa-sm.q-my-sm.bg-red-1.text-red-8.rounded-borders(v-else)
|
78
|
+
.text-center Вопросы повестки не найдены
|
45
79
|
|
46
|
-
q-card-actions(align=
|
47
|
-
q-btn(
|
80
|
+
q-card-actions(align='right')
|
81
|
+
q-btn(
|
82
|
+
flat,
|
83
|
+
label='Отмена',
|
84
|
+
v-close-popup,
|
85
|
+
@click='$emit("update:modelValue", false)',
|
86
|
+
:disable='loading'
|
87
|
+
)
|
48
88
|
q-btn(
|
49
|
-
color=
|
50
|
-
label=
|
51
|
-
type=
|
52
|
-
@click=
|
53
|
-
:loading=
|
54
|
-
:disable=
|
89
|
+
color='primary',
|
90
|
+
label='Перезапустить',
|
91
|
+
type='submit',
|
92
|
+
@click='handleSubmit',
|
93
|
+
:loading='loading',
|
94
|
+
:disable='!meetStore.currentMeet?.processing?.questions?.length'
|
55
95
|
)
|
56
96
|
</template>
|
57
97
|
|
58
98
|
<script setup lang="ts">
|
59
|
-
import { reactive, watch } from 'vue'
|
60
|
-
import { useMeetStore } from 'src/entities/Meet'
|
61
|
-
import {
|
62
|
-
|
63
|
-
|
64
|
-
|
99
|
+
import { reactive, watch } from 'vue';
|
100
|
+
import { useMeetStore } from 'src/entities/Meet';
|
101
|
+
import {
|
102
|
+
getCurrentLocalDateForForm,
|
103
|
+
convertLocalDateToUTC,
|
104
|
+
getTimezoneLabel,
|
105
|
+
getFutureDateForForm,
|
106
|
+
} from 'src/shared/lib/utils/dates/timezone';
|
107
|
+
import { env } from 'src/shared/config/Environment';
|
108
|
+
import { AgendaNumberAvatar } from 'src/shared/ui/AgendaNumberAvatar';
|
109
|
+
import { UserSearchSelector } from 'src/shared/ui';
|
110
|
+
import { parseLinks } from 'src/shared/lib/utils';
|
65
111
|
const props = defineProps<{
|
66
|
-
modelValue: boolean
|
67
|
-
loading?: boolean
|
68
|
-
}>()
|
112
|
+
modelValue: boolean;
|
113
|
+
loading?: boolean;
|
114
|
+
}>();
|
69
115
|
|
70
116
|
const emit = defineEmits<{
|
71
|
-
(e: 'update:modelValue', value: boolean): void
|
72
|
-
(e: 'restart', data: any): void
|
73
|
-
}>()
|
117
|
+
(e: 'update:modelValue', value: boolean): void;
|
118
|
+
(e: 'restart', data: any): void;
|
119
|
+
}>();
|
74
120
|
|
75
|
-
const meetStore = useMeetStore()
|
121
|
+
const meetStore = useMeetStore();
|
76
122
|
|
77
123
|
// Название часового пояса для отображения в лейблах
|
78
|
-
const timezoneLabel = getTimezoneLabel()
|
124
|
+
const timezoneLabel = getTimezoneLabel();
|
79
125
|
|
80
126
|
// Форма для перезапуска собрания
|
81
127
|
const formData = reactive(
|
82
128
|
env.NODE_ENV === 'development'
|
83
129
|
? {
|
130
|
+
new_presider: '',
|
131
|
+
new_secretary: '',
|
84
132
|
new_open_at: getCurrentLocalDateForForm(0.17),
|
85
133
|
new_close_at: getCurrentLocalDateForForm(1),
|
86
134
|
}
|
87
135
|
: {
|
136
|
+
new_presider: '',
|
137
|
+
new_secretary: '',
|
88
138
|
new_open_at: getFutureDateForForm(15, 6, 0),
|
89
139
|
new_close_at: getFutureDateForForm(18, 12, 0),
|
90
|
-
}
|
91
|
-
)
|
140
|
+
},
|
141
|
+
);
|
92
142
|
|
93
143
|
// Сброс формы при открытии диалога
|
94
|
-
watch(
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
144
|
+
watch(
|
145
|
+
() => props.modelValue,
|
146
|
+
(newVal) => {
|
147
|
+
if (newVal) {
|
148
|
+
// Предзаполняем текущими данными собрания
|
149
|
+
const currentMeet = meetStore.currentMeet;
|
150
|
+
if (currentMeet?.processing?.meet) {
|
151
|
+
formData.new_presider = currentMeet.processing.meet.presider;
|
152
|
+
formData.new_secretary = currentMeet.processing.meet.secretary;
|
153
|
+
}
|
154
|
+
|
155
|
+
if (env.NODE_ENV === 'development') {
|
156
|
+
formData.new_open_at = getCurrentLocalDateForForm(0.17);
|
157
|
+
formData.new_close_at = getCurrentLocalDateForForm(1);
|
158
|
+
} else {
|
159
|
+
formData.new_open_at = getFutureDateForForm(15, 6, 0);
|
160
|
+
formData.new_close_at = getFutureDateForForm(18, 12, 0);
|
161
|
+
}
|
102
162
|
}
|
103
|
-
}
|
104
|
-
|
163
|
+
},
|
164
|
+
);
|
105
165
|
|
106
166
|
const handleSubmit = () => {
|
107
|
-
const meet = meetStore.currentMeet
|
108
|
-
if (!meet) return
|
167
|
+
const meet = meetStore.currentMeet;
|
168
|
+
if (!meet) return;
|
109
169
|
|
110
170
|
// Проверяем наличие вопросов повестки
|
111
171
|
if (!meet.processing?.questions || meet.processing.questions.length === 0) {
|
112
|
-
return
|
172
|
+
return;
|
113
173
|
}
|
114
174
|
|
115
175
|
// Конвертируем локальные даты в UTC для отправки в блокчейн
|
116
176
|
const dataToSend = {
|
177
|
+
new_presider: formData.new_presider,
|
178
|
+
new_secretary: formData.new_secretary,
|
117
179
|
new_open_at: convertLocalDateToUTC(formData.new_open_at),
|
118
180
|
new_close_at: convertLocalDateToUTC(formData.new_close_at),
|
119
|
-
agenda_points: meet.processing.questions.map(q => ({
|
181
|
+
agenda_points: meet.processing.questions.map((q) => ({
|
120
182
|
title: q.title,
|
121
183
|
context: q.context,
|
122
|
-
decision: q.decision
|
123
|
-
}))
|
124
|
-
}
|
184
|
+
decision: q.decision,
|
185
|
+
})),
|
186
|
+
};
|
125
187
|
|
126
|
-
emit('restart', dataToSend)
|
127
|
-
}
|
188
|
+
emit('restart', dataToSend);
|
189
|
+
};
|
128
190
|
</script>
|