@coopenomics/desktop 2.2.5 → 2.2.6
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/CHANGELOG.md +8 -0
- package/extensions/powerup/boot.ts +1 -1
- package/package.json +6 -6
- package/src/app/App.vue +4 -2
- package/src/app/providers/card/store.ts +6 -3
- package/src/boot/branch-selector.ts +0 -2
- package/src/boot/navigation-guards.ts +5 -7
- package/src/components/menu/footerMobileMenu.vue +4 -2
- package/src/components/soviet/staff.vue +9 -7
- package/src/desktops/User/model/index.ts +94 -87
- package/src/entities/Request/api/index.ts +19 -19
- package/src/entities/Request/model/stores.ts +1 -0
- package/src/entities/User/model/entity.ts +1 -0
- package/src/features/Agreementer/GenerateAgreement/ui/AgreementReader.vue +4 -2
- package/src/features/Agreementer/SignAgreementDialog/model/index.ts +4 -3
- package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +4 -2
- package/src/features/Branch/CreateBranch/model/index.ts +4 -3
- package/src/features/Branch/EditBranch/model/index.ts +3 -2
- package/src/features/Decision/AuthorizeAndExecDecision/model/index.ts +6 -6
- package/src/features/Decision/VoteForDecision/model/index.ts +4 -2
- package/src/features/Installer/ui/RequestKeyForm/RequestKeyForm.vue +4 -2
- package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +4 -6
- package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +3 -2
- package/src/features/Request/AcceptRequest/api/index.ts +20 -21
- package/src/features/Request/CancelRequest/api/index.ts +13 -17
- package/src/features/Request/CompleteOnRequest/api/index.ts +13 -17
- package/src/features/Request/ConfirmRecieveOnRequest/api/index.ts +17 -21
- package/src/features/Request/ConfirmSupplyOnRequest/api/index.ts +17 -21
- package/src/features/Request/CreateChildOrder/api/index.ts +27 -30
- package/src/features/Request/CreateParentOffer/api/index.ts +4 -14
- package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +5 -2
- package/src/features/Request/DeclineRequest/api/index.ts +14 -18
- package/src/features/Request/DeliverOnRequest/api/index.ts +13 -17
- package/src/features/Request/DisputeOnRequest/api/index.ts +3 -7
- package/src/features/Request/ModerateRequest/api/index.ts +14 -18
- package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +4 -3
- package/src/features/Request/ProhibitRequest/api/index.ts +14 -18
- package/src/features/Request/PublishRequest/api/index.ts +13 -17
- package/src/features/Request/RecieveOnRequest/api/index.ts +17 -21
- package/src/features/Request/SupplyOnRequest/api/index.ts +3 -3
- package/src/features/Request/UnpublishRequest/api/index.ts +14 -17
- package/src/features/Request/UpdateRequest/api/index.ts +0 -4
- package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +4 -2
- package/src/features/User/CreateUser/model/index.ts +10 -8
- package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +4 -2
- package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +4 -2
- package/src/pages/Cooperative/ListOfBranches/ui/ListOfBranchesPage.vue +4 -2
- package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +4 -2
- package/src/pages/Marketplace/CreateParentOffer/ui/CreateParentOfferPage.vue +3 -3
- package/src/pages/Marketplace/MainPage/ui/MainPage.vue +13 -13
- package/src/pages/Marketplace/Moderation/ui/ModerationPage.vue +7 -3
- package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +4 -2
- package/src/pages/Registrator/SignUp/PayInitial.vue +4 -2
- package/src/pages/Registrator/SignUp/ReadStatement.vue +7 -1
- package/src/pages/Registrator/SignUp/SelectBranch.vue +4 -2
- package/src/pages/Registrator/SignUp/SignUp.vue +7 -7
- package/src/pages/Registrator/SignUp/WaitingRegistration.vue +4 -2
- package/src/pages/Union/Connection/ConnectionPage.vue +1 -1
- package/src/pages/_layouts/default.vue +3 -2
- package/src/shared/store/index.ts +16 -18
- package/src/shared/ui/BaseDocument/BaseDocument.vue +1 -3
- package/src/shared/ui/Providers/Bank/Bank.vue +54 -2
- package/src/widgets/Agreementer/RequireAgreements/ui/RequireAgreements.vue +5 -3
- package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +11 -3
- package/src/widgets/Cooperative/Contacts/ui/ChangeContacts.vue +5 -3
- package/src/widgets/Cooperative/Contributions/ui/ChangeContributions.vue +6 -4
- package/src/widgets/Cooperative/Funds/ui/AccumulationFunds.vue +8 -7
- package/src/widgets/Cooperative/Funds/ui/AddAccumulationFund.vue +5 -3
- package/src/widgets/Cooperative/Funds/ui/AddExpenseFund.vue +5 -3
- package/src/widgets/Cooperative/Funds/ui/ExpenseFunds.vue +8 -7
- package/src/widgets/Cooperative/Members/ui/Members.vue +4 -2
- package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +4 -2
- package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +61 -62
- package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +5 -3
- package/src/widgets/Request/CreateChildOrderCard/CreateChildOrderCard.vue +5 -3
- package/src/widgets/Request/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +3 -3
- package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +4 -2
- package/src/shared/api/wif.ts +0 -9
@@ -38,7 +38,9 @@ import WaitingRegistration from './WaitingRegistration.vue'
|
|
38
38
|
import Welcome from './Welcome.vue'
|
39
39
|
import SelectBranch from './SelectBranch.vue'
|
40
40
|
|
41
|
-
import {
|
41
|
+
import { useSystemStore } from 'src/entities/System/model';
|
42
|
+
const { info } = useSystemStore()
|
43
|
+
|
42
44
|
import { useCurrentUserStore } from 'src/entities/User'
|
43
45
|
|
44
46
|
import { useRegistratorStore } from 'src/entities/Registrator'
|
@@ -48,7 +50,6 @@ import { useAgreementStore } from 'src/entities/Agreement'
|
|
48
50
|
import { useWalletStore } from 'src/entities/Wallet'
|
49
51
|
|
50
52
|
import { useRouter } from 'vue-router';
|
51
|
-
import { useSystemStore } from 'src/entities/System/model'
|
52
53
|
|
53
54
|
const currentUser = useCurrentUserStore()
|
54
55
|
const router = useRouter()
|
@@ -60,7 +61,7 @@ const agreementer = useAgreementStore()
|
|
60
61
|
const wallet = useWalletStore()
|
61
62
|
|
62
63
|
onMounted(() => {
|
63
|
-
agreementer.loadCooperativeAgreements(
|
64
|
+
agreementer.loadCooperativeAgreements(info.coopname)
|
64
65
|
if (!currentUser.isRegistrationComplete) {
|
65
66
|
|
66
67
|
if (currentUser.userAccount?.status === 'registered' || currentUser.userAccount?.status === 'active' || currentUser.userAccount?.status === 'blocked') {
|
@@ -97,8 +98,8 @@ watch(
|
|
97
98
|
() => [store.step, store.email, store.account, store.userData],
|
98
99
|
() => {
|
99
100
|
if (store.step >= steps.GenerateAccount && store.step < steps.WaitingRegistration) {
|
100
|
-
currentUser.loadProfile(username.value,
|
101
|
-
wallet.loadUserWalet({coopname:
|
101
|
+
currentUser.loadProfile(username.value, info.coopname)
|
102
|
+
wallet.loadUserWalet({coopname: info.coopname, username: username.value})
|
102
103
|
}
|
103
104
|
}
|
104
105
|
)
|
@@ -112,8 +113,7 @@ watch(() => registeredAndloggedIn, (newValue) => {
|
|
112
113
|
router.push({name: 'index'})
|
113
114
|
})
|
114
115
|
|
115
|
-
const
|
116
|
-
const isBranched = computed(() => system.info?.cooperator_account.is_branched)
|
116
|
+
const isBranched = computed(() => info.cooperator_account.is_branched)
|
117
117
|
|
118
118
|
</script>
|
119
119
|
<style></style>
|
@@ -17,7 +17,9 @@ div
|
|
17
17
|
<script lang="ts" setup>
|
18
18
|
import { ref, computed, watch, onBeforeUnmount, onMounted } from 'vue'
|
19
19
|
import { useCurrentUserStore } from 'src/entities/User';
|
20
|
-
import {
|
20
|
+
import { useSystemStore } from 'src/entities/System/model';
|
21
|
+
const { info } = useSystemStore()
|
22
|
+
|
21
23
|
import { Loader } from 'src/shared/ui/Loader';
|
22
24
|
import { useRegistratorStore } from 'src/entities/Registrator'
|
23
25
|
const store = useRegistratorStore()
|
@@ -52,7 +54,7 @@ onBeforeUnmount(() => {
|
|
52
54
|
const update = async () => {
|
53
55
|
if (store.state.account.username && !participantAccount.value) {
|
54
56
|
try {
|
55
|
-
await currentUser.loadProfile(store.state.account.username,
|
57
|
+
await currentUser.loadProfile(store.state.account.username, info.coopname)
|
56
58
|
} catch(e: any){
|
57
59
|
console.log('error: ', e.message)
|
58
60
|
}
|
@@ -53,7 +53,7 @@ const document = ref(new DigitalDocument())
|
|
53
53
|
const {loadOneCooperative} = useLoadCooperatives()
|
54
54
|
|
55
55
|
const coop = ref()
|
56
|
-
const instruction = computed(() => `Создайте A-запись домена ${coop.value?.announce} на IP-адрес:
|
56
|
+
const instruction = computed(() => `Создайте A-запись домена ${coop.value?.announce} на IP-адрес: 51.250.114.13`)
|
57
57
|
|
58
58
|
const html = computed(() => document.value?.data?.html)
|
59
59
|
const signedDocument = computed(() => document.value?.signedDocument)
|
@@ -25,13 +25,14 @@
|
|
25
25
|
import { LeftDrawerMenu } from 'src/widgets/Desktop/LeftDrawerMenu'
|
26
26
|
import { ContactsFooter } from 'src/shared/ui/Footer'
|
27
27
|
import { useRoute } from 'vue-router'
|
28
|
-
import {
|
28
|
+
import { useSystemStore } from 'src/entities/System/model';
|
29
|
+
const { info } = useSystemStore()
|
29
30
|
|
30
31
|
const session = useSessionStore()
|
31
32
|
const cooperativeStore = useCooperativeStore()
|
32
33
|
cooperativeStore.loadContacts()
|
33
34
|
const route = useRoute()
|
34
|
-
const showDrawer = computed(() => route.params.coopname ===
|
35
|
+
const showDrawer = computed(() => route.params.coopname === info.coopname)
|
35
36
|
|
36
37
|
const $q = useQuasar()
|
37
38
|
const { width } = useWindowSize()
|
@@ -3,7 +3,6 @@ import { Action, PrivateKey } from '@wharfkit/antelope';
|
|
3
3
|
import { defineStore } from 'pinia';
|
4
4
|
import { ref, Ref } from 'vue';
|
5
5
|
import { decrypt, encrypt, hashSHA256 } from '../api/crypto';
|
6
|
-
import { COOPNAME } from '../config';
|
7
6
|
import { IMessageSignature } from '../lib/types/crypto';
|
8
7
|
import { useSessionStore } from 'src/entities/Session';
|
9
8
|
import { TransactResult } from '@wharfkit/session';
|
@@ -11,6 +10,7 @@ import { readBlockchain } from '../api';
|
|
11
10
|
import { ITokens } from '../lib/types/user';
|
12
11
|
import { getFromIndexedDB, setToIndexedDB } from '../api/indexDB';
|
13
12
|
import { client } from '../api/client';
|
13
|
+
import { useSystemStore } from 'src/entities/System/model';
|
14
14
|
|
15
15
|
interface IGlobalStore {
|
16
16
|
hasCreditials: Ref<boolean>;
|
@@ -37,23 +37,25 @@ export const useGlobalStore = defineStore('global', (): IGlobalStore => {
|
|
37
37
|
|
38
38
|
const password = ''; // это временное намеренное решение. Позже заменим на пользовательский пин-код.
|
39
39
|
|
40
|
+
const { info } = useSystemStore()
|
41
|
+
|
40
42
|
// Инициализация
|
41
43
|
const init = async () => {
|
42
44
|
|
43
45
|
try {
|
44
46
|
// Получите зашифрованный ключ и токены из хранилища
|
45
47
|
const encryptedKey = await getFromIndexedDB(
|
46
|
-
|
48
|
+
info.coopname,
|
47
49
|
'store',
|
48
50
|
'encryptedKey'
|
49
51
|
);
|
50
52
|
const encryptedTokens = await getFromIndexedDB(
|
51
|
-
|
53
|
+
info.coopname,
|
52
54
|
'store',
|
53
55
|
'encryptedTokens'
|
54
56
|
);
|
55
57
|
const encryptedUsername = await getFromIndexedDB(
|
56
|
-
|
58
|
+
info.coopname,
|
57
59
|
'store',
|
58
60
|
'encryptedUsername'
|
59
61
|
);
|
@@ -73,22 +75,18 @@ export const useGlobalStore = defineStore('global', (): IGlobalStore => {
|
|
73
75
|
tokens.value = JSON.parse(decryptedTokens);
|
74
76
|
username.value = decryptedUsername;
|
75
77
|
|
76
|
-
// if (NODE_ENV === 'development')
|
77
|
-
// console.log('tokens: ', tokens)
|
78
|
-
|
79
78
|
// Установите hasCreditials в true
|
80
79
|
hasCreditials.value = true;
|
81
|
-
|
80
|
+
|
82
81
|
if (tokens.value?.access.token){
|
83
|
-
console.log('on set tokens')
|
84
82
|
client.setToken(tokens.value.access.token)
|
85
83
|
}
|
86
84
|
|
87
85
|
|
88
86
|
} catch (error: any) {
|
89
|
-
await setToIndexedDB(
|
90
|
-
await setToIndexedDB(
|
91
|
-
await setToIndexedDB(
|
87
|
+
await setToIndexedDB(info.coopname, 'store', 'encryptedKey', '');
|
88
|
+
await setToIndexedDB(info.coopname, 'store', 'encryptedUsername', '');
|
89
|
+
await setToIndexedDB(info.coopname, 'store', 'encryptedTokens', '');
|
92
90
|
throw new Error('Ошибка авторизации. Войдите повторно.');
|
93
91
|
}
|
94
92
|
};
|
@@ -97,9 +95,9 @@ export const useGlobalStore = defineStore('global', (): IGlobalStore => {
|
|
97
95
|
const encryptedKey = await encrypt(key, password);
|
98
96
|
const encryptedUsername = await encrypt(newUsername, password);
|
99
97
|
|
100
|
-
await setToIndexedDB(
|
98
|
+
await setToIndexedDB(info.coopname, 'store', 'encryptedKey', encryptedKey);
|
101
99
|
await setToIndexedDB(
|
102
|
-
|
100
|
+
info.coopname,
|
103
101
|
'store',
|
104
102
|
'encryptedUsername',
|
105
103
|
encryptedUsername
|
@@ -111,7 +109,7 @@ export const useGlobalStore = defineStore('global', (): IGlobalStore => {
|
|
111
109
|
|
112
110
|
const setTokens = async (newTokens: ITokens) => {
|
113
111
|
const encryptedTokens = await encrypt(JSON.stringify(newTokens), password);
|
114
|
-
await setToIndexedDB(
|
112
|
+
await setToIndexedDB(info.coopname, 'store', 'encryptedTokens', encryptedTokens);
|
115
113
|
tokens.value = newTokens;
|
116
114
|
};
|
117
115
|
|
@@ -120,9 +118,9 @@ export const useGlobalStore = defineStore('global', (): IGlobalStore => {
|
|
120
118
|
wif.value = undefined;
|
121
119
|
hasCreditials.value = false;
|
122
120
|
tokens.value = undefined;
|
123
|
-
await setToIndexedDB(
|
124
|
-
await setToIndexedDB(
|
125
|
-
await setToIndexedDB(
|
121
|
+
await setToIndexedDB(info.coopname, 'store', 'encryptedKey', '');
|
122
|
+
await setToIndexedDB(info.coopname, 'store', 'encryptedUsername', '');
|
123
|
+
await setToIndexedDB(info.coopname, 'store', 'encryptedTokens', '');
|
126
124
|
};
|
127
125
|
|
128
126
|
const signDigest = (digest: string): IMessageSignature => {
|
@@ -3,6 +3,7 @@ import type { IPaymentOrder } from 'src/shared/lib/types/payments';
|
|
3
3
|
import { onMounted, onBeforeUnmount, ref, computed } from 'vue';
|
4
4
|
import QRCode from 'qrcode';
|
5
5
|
import { useCooperativeStore } from 'src/entities/Cooperative';
|
6
|
+
import { copyToClipboard, Notify } from 'quasar';
|
6
7
|
|
7
8
|
// Определяем интерфейс для orderData
|
8
9
|
interface IOrderData {
|
@@ -14,6 +15,7 @@ interface IOrderData {
|
|
14
15
|
correspacc?: string;
|
15
16
|
personalacc?: string;
|
16
17
|
purpose?: string;
|
18
|
+
payeeinn?: string;
|
17
19
|
}
|
18
20
|
|
19
21
|
const props = defineProps<{
|
@@ -68,6 +70,28 @@ const generateQRCode = () => {
|
|
68
70
|
}
|
69
71
|
};
|
70
72
|
|
73
|
+
const copyAll = () => {
|
74
|
+
const data = `
|
75
|
+
ИНН Получателя: ${orderData.value.payeeinn}
|
76
|
+
Получатель: ${orderData.value.name}
|
77
|
+
БИК: ${orderData.value.bic}
|
78
|
+
Банк получателя: ${orderData.value.bankname}
|
79
|
+
КПП: ${orderData.value.kpp}
|
80
|
+
Корреспондентский счёт: ${orderData.value.correspacc}
|
81
|
+
Номер счёта: ${orderData.value.personalacc}
|
82
|
+
Сумма платежа: ${amount.value}
|
83
|
+
Назначение платежа: ${orderData.value.purpose}
|
84
|
+
`.trim();
|
85
|
+
|
86
|
+
copy(data);
|
87
|
+
};
|
88
|
+
|
89
|
+
const copy = (data: any) => {
|
90
|
+
copyToClipboard(data)
|
91
|
+
.then(() => Notify.create({ message: 'Реквизиты скопированы в буфер обмена', type: 'positive' }))
|
92
|
+
.catch(console.log)
|
93
|
+
}
|
94
|
+
|
71
95
|
const downloadQR = () => {
|
72
96
|
if (qrElement.value) {
|
73
97
|
const link = document.createElement('a');
|
@@ -82,19 +106,47 @@ const downloadQR = () => {
|
|
82
106
|
|
83
107
|
<template lang="pug">
|
84
108
|
div
|
109
|
+
q-input(label="ИНН получателя" v-model="orderData.payeeinn" readonly)
|
110
|
+
template(v-slot:append)
|
111
|
+
q-btn(icon="fas fa-copy" @click="copy(orderData.payeeinn)" size="xs" flat)
|
112
|
+
|
85
113
|
q-input(label="Получатель" v-model="orderData.name" readonly)
|
86
|
-
|
114
|
+
template(v-slot:append)
|
115
|
+
q-btn(icon="fas fa-copy" @click="copy(orderData.name)" size="xs" flat)
|
116
|
+
|
87
117
|
q-input(label="БИК" v-model="orderData.bic" readonly)
|
118
|
+
template(v-slot:append)
|
119
|
+
q-btn(icon="fas fa-copy" @click="copy(orderData.bic)" size="xs" flat)
|
120
|
+
|
121
|
+
q-input(label="Банк получателя" v-model="orderData.bankname" readonly)
|
122
|
+
template(v-slot:append)
|
123
|
+
q-btn(icon="fas fa-copy" @click="copy(orderData.bankname)" size="xs" flat)
|
124
|
+
|
88
125
|
q-input(label="КПП" v-model="orderData.kpp" readonly)
|
126
|
+
template(v-slot:append)
|
127
|
+
q-btn(icon="fas fa-copy" @click="copy(orderData.kpp)" size="xs" flat)
|
128
|
+
|
89
129
|
q-input(label="Корреспондентский счёт" v-model="orderData.correspacc" readonly)
|
130
|
+
template(v-slot:append)
|
131
|
+
q-btn(icon="fas fa-copy" @click="copy(orderData.correspacc)" size="xs" flat)
|
132
|
+
|
90
133
|
q-input(label="Номер счёта" v-model="orderData.personalacc" readonly)
|
134
|
+
template(v-slot:append)
|
135
|
+
q-btn(icon="fas fa-copy" @click="copy(orderData.personalacc)" size="xs" flat)
|
136
|
+
|
91
137
|
q-input(label="Cумма платежа" v-model="amount" readonly)
|
138
|
+
template(v-slot:append)
|
139
|
+
q-btn(icon="fas fa-copy" @click="copy(amount)" size="xs" flat)
|
140
|
+
|
92
141
|
q-input(label="Назначение платежа" v-model="orderData.purpose" readonly)
|
142
|
+
template(v-slot:append)
|
143
|
+
q-btn(icon="fas fa-copy" @click="copy(orderData.purpose)" size="xs" flat)
|
93
144
|
|
94
145
|
div.full-width.text-center
|
95
146
|
canvas#qr
|
96
147
|
div.full-width.text-center
|
97
|
-
q-btn(@click="
|
148
|
+
q-btn(@click="copyAll" flat icon="fas fa-copy" size="sm") скопировать реквизиты
|
149
|
+
q-btn(@click="downloadQR" flat icon="download" size="sm") скачать QR
|
98
150
|
</template>
|
99
151
|
|
100
152
|
<style>
|
@@ -7,7 +7,9 @@ div
|
|
7
7
|
<script lang="ts" setup>
|
8
8
|
import { SignAgreementDialog } from 'src/features/Agreementer/SignAgreementDialog';
|
9
9
|
import { useAgreementStore } from 'src/entities/Agreement';
|
10
|
-
import {
|
10
|
+
import { useSystemStore } from 'src/entities/System/model';
|
11
|
+
const { info } = useSystemStore()
|
12
|
+
|
11
13
|
import { computed, ref, watch } from 'vue';
|
12
14
|
import { useRoute } from 'vue-router';
|
13
15
|
import { AgreementReader } from 'src/features/Agreementer/GenerateAgreement';
|
@@ -56,8 +58,8 @@ const required_agreements = computed(() => {
|
|
56
58
|
});
|
57
59
|
|
58
60
|
const init = async () => {
|
59
|
-
agreementer.loadCooperativeAgreements(
|
60
|
-
agreementer.loadAgreementTemplates(
|
61
|
+
agreementer.loadCooperativeAgreements(info.coopname)
|
62
|
+
agreementer.loadAgreementTemplates(info.coopname)
|
61
63
|
}
|
62
64
|
const session = useSessionStore()
|
63
65
|
|
@@ -85,7 +85,9 @@ import { Cooperative, SovietContract } from 'cooptypes'
|
|
85
85
|
import { useVoteForDecision } from 'src/features/Decision/VoteForDecision';
|
86
86
|
import { useAuthorizeAndExecDecision } from 'src/features/Decision/AuthorizeAndExecDecision';
|
87
87
|
import { useVoteAgainstDecision } from 'src/features/Decision/VoteAgainstDecision';
|
88
|
-
import {
|
88
|
+
import { useSystemStore } from 'src/entities/System/model';
|
89
|
+
const { info } = useSystemStore()
|
90
|
+
|
89
91
|
import { useCooperativeStore } from 'src/entities/Cooperative/model/stores';
|
90
92
|
import { useCurrentUserStore } from 'src/entities/User';
|
91
93
|
import { CreateProjectFreeDecisionButton } from 'src/features/Decision/CreateProject';
|
@@ -160,12 +162,18 @@ const isProcess = (decisionId: number) => {
|
|
160
162
|
}
|
161
163
|
|
162
164
|
const updateAuthorized = async (row: Cooperative.Document.IComplexAgenda) => {
|
165
|
+
|
163
166
|
const decision_id = Number(row.table.id)
|
167
|
+
console.log('decision_id', decision_id)
|
164
168
|
try {
|
165
169
|
const username = row.table.username
|
166
170
|
const type = row.table.type
|
167
171
|
const meta = {} as any
|
168
|
-
|
172
|
+
console.log('here', row.table.statement.meta)
|
173
|
+
|
174
|
+
//TODO убрать проверку позже (нужно было для теста)
|
175
|
+
const unparsedDocumentMeta = row.table.statement.meta == '' ? '{}' : row.table.statement.meta
|
176
|
+
let parsedDocumentMeta = JSON.parse(unparsedDocumentMeta)
|
169
177
|
|
170
178
|
const registryMap = {
|
171
179
|
'freedecision': Cooperative.Registry.FreeDecision.registry_id,
|
@@ -241,7 +249,7 @@ const voteFor = async (decision_id: number) => {
|
|
241
249
|
const voteAgainst = async (decision_id: number) => {
|
242
250
|
try {
|
243
251
|
await useVoteAgainstDecision().voteAgainstDecision({
|
244
|
-
coopname:
|
252
|
+
coopname: info.coopname,
|
245
253
|
member: session.username,
|
246
254
|
decision_id,
|
247
255
|
})
|
@@ -16,7 +16,9 @@ import { Cooperative } from 'cooptypes';
|
|
16
16
|
import { useCooperativeStore } from 'src/entities/Cooperative';
|
17
17
|
import { useUpdateMeta } from 'src/features/User/UpdateMeta';
|
18
18
|
import { FailAlert, SuccessAlert } from 'src/shared/api';
|
19
|
-
import {
|
19
|
+
import { useSystemStore } from 'src/entities/System/model';
|
20
|
+
const { info } = useSystemStore()
|
21
|
+
|
20
22
|
import { ref, watch } from 'vue';
|
21
23
|
|
22
24
|
const coop = useCooperativeStore()
|
@@ -31,7 +33,7 @@ watch(() => coop.contacts, (newValue: Cooperative.Model.IContacts | undefined) =
|
|
31
33
|
}
|
32
34
|
})
|
33
35
|
|
34
|
-
coop.loadPublicCooperativeData(
|
36
|
+
coop.loadPublicCooperativeData(info.coopname)
|
35
37
|
coop.loadContacts()
|
36
38
|
|
37
39
|
const update = async () => {
|
@@ -40,7 +42,7 @@ const update = async () => {
|
|
40
42
|
|
41
43
|
try {
|
42
44
|
await updateMeta(
|
43
|
-
|
45
|
+
info.coopname,
|
44
46
|
{
|
45
47
|
phone: phone.value,
|
46
48
|
email: email.value
|
@@ -4,12 +4,14 @@ import { useCooperativeStore } from 'src/entities/Cooperative';
|
|
4
4
|
import { useSessionStore } from 'src/entities/Session';
|
5
5
|
import { useUpdateCoop } from 'src/features/Cooperative/UpdateCoop';
|
6
6
|
import { FailAlert, SuccessAlert } from 'src/shared/api';
|
7
|
-
import {
|
7
|
+
import { CURRENCY } from 'src/shared/config';
|
8
8
|
import { formatToAsset } from 'src/shared/lib/utils/formatToAsset';
|
9
9
|
import { ref, watch } from 'vue';
|
10
|
+
import { useSystemStore } from 'src/entities/System/model';
|
11
|
+
const { info } = useSystemStore()
|
10
12
|
|
11
13
|
const coop = useCooperativeStore()
|
12
|
-
coop.loadPublicCooperativeData(
|
14
|
+
coop.loadPublicCooperativeData(info.coopname)
|
13
15
|
coop.loadPrivateCooperativeData()
|
14
16
|
|
15
17
|
const localCoop = ref({
|
@@ -25,7 +27,7 @@ const save = async () => {
|
|
25
27
|
if (coop.publicCooperativeData)
|
26
28
|
try {
|
27
29
|
await updateCoop({
|
28
|
-
coopname:
|
30
|
+
coopname: info.coopname,
|
29
31
|
username: session.username,
|
30
32
|
initial: formatToAsset(localCoop.value.initial, CURRENCY),
|
31
33
|
minimum: formatToAsset(localCoop.value.minimum, CURRENCY),
|
@@ -34,7 +36,7 @@ const save = async () => {
|
|
34
36
|
announce: coop.publicCooperativeData?.announce,
|
35
37
|
description: coop.publicCooperativeData?.description
|
36
38
|
})
|
37
|
-
await coop.loadPublicCooperativeData(
|
39
|
+
await coop.loadPublicCooperativeData(info.coopname)
|
38
40
|
|
39
41
|
SuccessAlert('Размеры взносов успешно обновлены')
|
40
42
|
} catch (e: any) {
|
@@ -2,18 +2,19 @@
|
|
2
2
|
import { computed, ref } from 'vue';
|
3
3
|
import { FundContract } from 'cooptypes';
|
4
4
|
import { useEditFund } from 'src/features/Fund/EditFund';
|
5
|
-
import { COOPNAME } from 'src/shared/config';
|
6
5
|
import { useSessionStore } from 'src/entities/Session';
|
7
6
|
import { FailAlert, SuccessAlert } from 'src/shared/api';
|
8
7
|
import { useCooperativeStore } from 'src/entities/Cooperative';
|
9
8
|
import AddAccumulationFund from './AddAccumulationFund.vue'
|
10
9
|
import { useDeleteFund } from 'src/features/Fund/DeleteFund';
|
10
|
+
import { useSystemStore } from 'src/entities/System/model';
|
11
|
+
const { info } = useSystemStore()
|
11
12
|
|
12
13
|
const coop = useCooperativeStore()
|
13
14
|
|
14
15
|
const loadFunds = async () => {
|
15
16
|
try {
|
16
|
-
await coop.loadFunds(
|
17
|
+
await coop.loadFunds(info.coopname)
|
17
18
|
} catch(e: any){
|
18
19
|
FailAlert(e.message)
|
19
20
|
}
|
@@ -37,13 +38,13 @@ const delFund = async(fund: FundContract.Tables.AccumulatedFunds.IAccumulatedFun
|
|
37
38
|
const { deleteFund } = useDeleteFund()
|
38
39
|
try {
|
39
40
|
await deleteFund({
|
40
|
-
coopname:
|
41
|
+
coopname: info.coopname,
|
41
42
|
username: session.username,
|
42
43
|
type: 'accumulation',
|
43
44
|
fund_id: fund.id
|
44
45
|
})
|
45
46
|
|
46
|
-
await coop.loadFunds(
|
47
|
+
await coop.loadFunds(info.coopname)
|
47
48
|
SuccessAlert('Фонд успешно удалён')
|
48
49
|
|
49
50
|
} catch (e: any){
|
@@ -59,7 +60,7 @@ const saveFund = async (fund: FundContract.Tables.AccumulatedFunds.IAccumulatedF
|
|
59
60
|
try {
|
60
61
|
|
61
62
|
await editFund({
|
62
|
-
coopname:
|
63
|
+
coopname: info.coopname,
|
63
64
|
username: session.username,
|
64
65
|
type: 'accumulation',
|
65
66
|
fund_id: fund.id,
|
@@ -69,12 +70,12 @@ const saveFund = async (fund: FundContract.Tables.AccumulatedFunds.IAccumulatedF
|
|
69
70
|
percent: percent
|
70
71
|
})
|
71
72
|
|
72
|
-
await coop.loadFunds(
|
73
|
+
await coop.loadFunds(info.coopname)
|
73
74
|
|
74
75
|
SuccessAlert('Фонд успешно обновлён')
|
75
76
|
} catch(e: any){
|
76
77
|
FailAlert(e.message)
|
77
|
-
await coop.loadFunds(
|
78
|
+
await coop.loadFunds(info.coopname)
|
78
79
|
}
|
79
80
|
|
80
81
|
};
|
@@ -3,7 +3,9 @@ import { useCooperativeStore } from 'src/entities/Cooperative';
|
|
3
3
|
import { useSessionStore } from 'src/entities/Session';
|
4
4
|
import { useCreateFund } from 'src/features/Fund/CreateFund';
|
5
5
|
import { FailAlert, SuccessAlert } from 'src/shared/api';
|
6
|
-
import {
|
6
|
+
import { useSystemStore } from 'src/entities/System/model';
|
7
|
+
const { info } = useSystemStore()
|
8
|
+
|
7
9
|
import { ref, watch } from 'vue';
|
8
10
|
|
9
11
|
const props = defineProps({
|
@@ -27,7 +29,7 @@ const percent = ref()
|
|
27
29
|
const addFund = async() => {
|
28
30
|
try{
|
29
31
|
await createFund({
|
30
|
-
coopname:
|
32
|
+
coopname: info.coopname,
|
31
33
|
username: session.username,
|
32
34
|
type: 'accumulation',
|
33
35
|
contract: '',
|
@@ -36,7 +38,7 @@ const addFund = async() => {
|
|
36
38
|
percent: Number(percent.value) * 10000
|
37
39
|
})
|
38
40
|
|
39
|
-
await coop.loadFunds(
|
41
|
+
await coop.loadFunds(info.coopname)
|
40
42
|
localShowAdd.value = false
|
41
43
|
name.value = ''
|
42
44
|
description.value = ''
|
@@ -3,7 +3,9 @@ import { useCooperativeStore } from 'src/entities/Cooperative';
|
|
3
3
|
import { useSessionStore } from 'src/entities/Session';
|
4
4
|
import { useCreateFund } from 'src/features/Fund/CreateFund';
|
5
5
|
import { FailAlert, SuccessAlert } from 'src/shared/api';
|
6
|
-
import {
|
6
|
+
import { useSystemStore } from 'src/entities/System/model';
|
7
|
+
const { info } = useSystemStore()
|
8
|
+
|
7
9
|
import { ref, watch } from 'vue';
|
8
10
|
|
9
11
|
const props = defineProps({
|
@@ -26,7 +28,7 @@ const description = ref('')
|
|
26
28
|
const addFund = async() => {
|
27
29
|
try{
|
28
30
|
await createFund({
|
29
|
-
coopname:
|
31
|
+
coopname: info.coopname,
|
30
32
|
username: session.username,
|
31
33
|
type: 'expend',
|
32
34
|
contract: '',
|
@@ -35,7 +37,7 @@ const addFund = async() => {
|
|
35
37
|
percent: 0
|
36
38
|
})
|
37
39
|
|
38
|
-
await coop.loadFunds(
|
40
|
+
await coop.loadFunds(info.coopname)
|
39
41
|
localShowAdd.value = false
|
40
42
|
name.value = ''
|
41
43
|
description.value = ''
|
@@ -2,18 +2,19 @@
|
|
2
2
|
import { computed, ref } from 'vue';
|
3
3
|
import { FundContract } from 'cooptypes';
|
4
4
|
import { useEditFund } from 'src/features/Fund/EditFund';
|
5
|
-
import { COOPNAME } from 'src/shared/config';
|
6
5
|
import { useSessionStore } from 'src/entities/Session';
|
7
6
|
import { FailAlert, SuccessAlert } from 'src/shared/api';
|
8
7
|
import { useCooperativeStore } from 'src/entities/Cooperative';
|
9
8
|
import AddExpenseFund from './AddExpenseFund.vue'
|
10
9
|
import { useDeleteFund } from 'src/features/Fund/DeleteFund';
|
10
|
+
import { useSystemStore } from 'src/entities/System/model';
|
11
|
+
const { info } = useSystemStore()
|
11
12
|
|
12
13
|
const coop = useCooperativeStore()
|
13
14
|
|
14
15
|
const loadFunds = async () => {
|
15
16
|
try {
|
16
|
-
await coop.loadFunds(
|
17
|
+
await coop.loadFunds(info.coopname)
|
17
18
|
} catch(e: any){
|
18
19
|
FailAlert(e.message)
|
19
20
|
}
|
@@ -31,13 +32,13 @@ const delFund = async(fund: FundContract.Tables.AccumulatedFunds.IAccumulatedFun
|
|
31
32
|
const { deleteFund } = useDeleteFund()
|
32
33
|
try {
|
33
34
|
await deleteFund({
|
34
|
-
coopname:
|
35
|
+
coopname: info.coopname,
|
35
36
|
username: session.username,
|
36
37
|
type: 'expend',
|
37
38
|
fund_id: fund.id
|
38
39
|
})
|
39
40
|
|
40
|
-
await coop.loadFunds(
|
41
|
+
await coop.loadFunds(info.coopname)
|
41
42
|
SuccessAlert('Фонд успешно удалён')
|
42
43
|
|
43
44
|
} catch (e: any){
|
@@ -52,7 +53,7 @@ const saveFund = async (fund: FundContract.Tables.AccumulatedFunds.IAccumulatedF
|
|
52
53
|
try {
|
53
54
|
|
54
55
|
await editFund({
|
55
|
-
coopname:
|
56
|
+
coopname: info.coopname,
|
56
57
|
username: session.username,
|
57
58
|
type: 'expend',
|
58
59
|
fund_id: fund.id,
|
@@ -62,12 +63,12 @@ const saveFund = async (fund: FundContract.Tables.AccumulatedFunds.IAccumulatedF
|
|
62
63
|
percent: 0
|
63
64
|
})
|
64
65
|
|
65
|
-
await coop.loadFunds(
|
66
|
+
await coop.loadFunds(info.coopname)
|
66
67
|
|
67
68
|
SuccessAlert('Фонд успешно обновлён')
|
68
69
|
} catch(e: any){
|
69
70
|
FailAlert(e.message)
|
70
|
-
await coop.loadFunds(
|
71
|
+
await coop.loadFunds(info.coopname)
|
71
72
|
}
|
72
73
|
|
73
74
|
};
|
@@ -76,7 +76,9 @@ import { Notify } from 'quasar';
|
|
76
76
|
import { readBlockchain } from 'src/shared/api'
|
77
77
|
import { useSessionStore } from 'src/entities/Session';
|
78
78
|
import { useUpdateBoard } from 'src/features/Cooperative/UpdateBoard';
|
79
|
-
import {
|
79
|
+
import { useSystemStore } from 'src/entities/System/model';
|
80
|
+
const { info } = useSystemStore()
|
81
|
+
|
80
82
|
import { useCooperativeStore } from 'src/entities/Cooperative';
|
81
83
|
import { sleep } from 'src/shared/api/sleep';
|
82
84
|
|
@@ -173,7 +175,7 @@ const updateBoard = async (new_members: any) => {
|
|
173
175
|
const coop = useUpdateBoard()
|
174
176
|
|
175
177
|
await coop.updateBoard({
|
176
|
-
coopname:
|
178
|
+
coopname: info.coopname,
|
177
179
|
username: useSessionStore().username,
|
178
180
|
board_id: 0,
|
179
181
|
members: new_members,
|
@@ -19,7 +19,7 @@ q-tabs(
|
|
19
19
|
:name="route.meta.title"
|
20
20
|
:label="route.meta.title"
|
21
21
|
:to="{ name: route.name }"
|
22
|
-
:params="{coopname:
|
22
|
+
:params="{coopname: info.coopname}"
|
23
23
|
)
|
24
24
|
|
25
25
|
|
@@ -30,7 +30,9 @@ import { ref, watch } from 'vue';
|
|
30
30
|
import { useRoute } from 'vue-router';
|
31
31
|
import { useDesktopStore } from 'src/entities/Desktop/model';
|
32
32
|
import { type IRoute } from 'src/entities/Desktop/model/types';
|
33
|
-
import {
|
33
|
+
import { useSystemStore } from 'src/entities/System/model';
|
34
|
+
const { info } = useSystemStore()
|
35
|
+
|
34
36
|
const desktop = useDesktopStore()
|
35
37
|
const routes = ref<IRoute[]>([])
|
36
38
|
const route = useRoute()
|