@coopenomics/desktop 2.2.6-alpha.0 → 2.2.7
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 +16 -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/init-stores.ts +5 -3
- 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 +89 -87
- package/src/entities/Request/api/index.ts +19 -19
- package/src/entities/Request/model/stores.ts +1 -0
- package/src/entities/System/model/store.ts +1 -1
- 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/Branch/SelectBranch/model/index.ts +1 -1
- package/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue +5 -7
- 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 +73 -51
- package/src/features/Request/CreateChildOrder/model/index.ts +46 -0
- package/src/features/Request/CreateChildOrder/model/types.ts +1 -1
- package/src/features/Request/CreateChildOrder/ui/CreateChildOrderButton/CreateChildOrderButton.vue +28 -4
- package/src/features/Request/CreateParentOffer/api/index.ts +5 -15
- package/src/features/Request/CreateParentOffer/model/types.ts +2 -2
- package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +8 -5
- 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 +4 -4
- package/src/features/Request/UnpublishRequest/api/index.ts +14 -17
- package/src/features/Request/UpdateRequest/api/index.ts +2 -6
- 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 +5 -3
- 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/shared/ui/UserDataForm/OrganizationDataForm/OrganizationDataForm.vue +1 -1
- 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/CoopCard/ui/CoopCard.vue +5 -1
- package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +4 -2
- package/src/shared/api/wif.ts +0 -9
@@ -39,7 +39,9 @@ form(@submit.prevent="submit").full-width
|
|
39
39
|
import { useCurrentUserStore } from 'src/entities/User';
|
40
40
|
import { useLoginUser } from 'src/features/User/LoginUser';
|
41
41
|
import { FailAlert } from 'src/shared/api';
|
42
|
-
import {
|
42
|
+
import { useSystemStore } from 'src/entities/System/model';
|
43
|
+
const { info } = useSystemStore()
|
44
|
+
|
43
45
|
import { useGlobalStore } from 'src/shared/store';
|
44
46
|
import { ref } from 'vue';
|
45
47
|
import { useRouter } from 'vue-router';
|
@@ -58,7 +60,7 @@ const submit = async () => {
|
|
58
60
|
try {
|
59
61
|
const { login } = useLoginUser()
|
60
62
|
await login(email.value, privateKey.value)
|
61
|
-
await currentUser.loadProfile(globalStore.username,
|
63
|
+
await currentUser.loadProfile(globalStore.username, info.coopname)
|
62
64
|
|
63
65
|
if (!currentUser.isRegistrationComplete) {
|
64
66
|
router.push({ name: 'signup' })
|
@@ -27,11 +27,13 @@ import { ModalBase } from 'src/shared/ui/ModalBase'
|
|
27
27
|
import { useWalletStore } from 'src/entities/Wallet'
|
28
28
|
import type { ILoadUserWallet } from 'src/entities/Wallet/model'
|
29
29
|
import { PayWithProvider } from 'src/shared/ui/PayWithProvider'
|
30
|
-
import {
|
30
|
+
import { CURRENCY } from 'src/shared/config'
|
31
31
|
import { SuccessAlert, FailAlert } from 'src/shared/api'
|
32
32
|
import { useSessionStore } from 'src/entities/Session'
|
33
33
|
import type { IPaymentOrder } from 'src/shared/lib/types/payments'
|
34
34
|
import { formatAssetToReadable } from 'src/shared/lib/utils/formatAssetToReadable'
|
35
|
+
import { useSystemStore } from 'src/entities/System/model';
|
36
|
+
const { info } = useSystemStore()
|
35
37
|
|
36
38
|
const { createDeposit, loadUserWalet } = useWalletStore()
|
37
39
|
|
@@ -69,7 +71,7 @@ const paymentFail = (): void => {
|
|
69
71
|
}
|
70
72
|
|
71
73
|
const paymentSuccess = (): void => {
|
72
|
-
loadUserWalet({ coopname:
|
74
|
+
loadUserWalet({ coopname: info.coopname, username: session.username as string } as ILoadUserWallet)
|
73
75
|
clear()
|
74
76
|
SuccessAlert('Платеж успешно принят')
|
75
77
|
}
|
@@ -69,12 +69,14 @@ import { getNameFromUserData } from 'src/shared/lib/utils/getNameFromUserData';
|
|
69
69
|
import { BranchCard } from 'src/widgets/BranchCard';
|
70
70
|
import { IndividualCard } from 'src/widgets/IndividualCard';
|
71
71
|
import { BankDetailsCard } from 'src/widgets/BankDetailsCard';
|
72
|
-
import {
|
72
|
+
import { useSystemStore } from 'src/entities/System/model';
|
73
|
+
const { info } = useSystemStore()
|
74
|
+
|
73
75
|
|
74
76
|
const branchStore = useBranchStore();
|
75
77
|
|
76
78
|
branchStore.loadBranches({
|
77
|
-
coopname:
|
79
|
+
coopname: info.coopname
|
78
80
|
})
|
79
81
|
|
80
82
|
const onLoading = ref(false);
|
@@ -3,8 +3,10 @@ ListOfDocumentsWidget(:showFilter="true" :filter="{receiver: coopname}")
|
|
3
3
|
</template>
|
4
4
|
<script setup lang="ts">
|
5
5
|
import { ListOfDocumentsWidget } from 'src/widgets/Cooperative/Documents/ListOfDocuments';
|
6
|
-
import {
|
6
|
+
import { useSystemStore } from 'src/entities/System/model';
|
7
|
+
const { info } = useSystemStore()
|
8
|
+
|
7
9
|
import { computed } from 'vue';
|
8
10
|
|
9
|
-
const coopname = computed(() =>
|
11
|
+
const coopname = computed(() => info.coopname)
|
10
12
|
</script>
|
@@ -2,12 +2,12 @@
|
|
2
2
|
import { computed } from 'vue'
|
3
3
|
import { CreateParentOfferForm } from 'src/features/Request/CreateParentOffer'
|
4
4
|
import { useSessionStore } from 'src/entities/Session'
|
5
|
+
import { useSystemStore } from 'src/entities/System/model'
|
5
6
|
const session = useSessionStore()
|
6
7
|
const username = computed(() => session.username)
|
7
|
-
|
8
|
-
|
8
|
+
const { info } = useSystemStore()
|
9
9
|
</script>
|
10
10
|
<template lang="pug">
|
11
11
|
div.row.justify-center
|
12
|
-
CreateParentOfferForm(:username="username" :coopname="
|
12
|
+
CreateParentOfferForm(:username="username" :coopname="info.coopname").col-md-4.col-xs-12.q-mt-md.q-mb-lg
|
13
13
|
</template>
|
@@ -1,25 +1,25 @@
|
|
1
1
|
<template lang="pug">
|
2
2
|
div
|
3
|
-
q-tabs(v-if="loggedIn" dense switch-indicator inline-label outside-arrows mobile-arrows align="justify" active-class="bg-teal-2" )
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
//- q-tabs(v-if="loggedIn" dense switch-indicator inline-label outside-arrows mobile-arrows align="justify" active-class="bg-teal-2" )
|
4
|
+
//- q-route-tab(name="Витрина" label="Витрина" :to="{name: 'marketplace-showcase'}" )
|
5
|
+
//- q-route-tab(name="Мои объявления" label="Мои объявления" :to="{name: 'marketplace-user-offers'}" )
|
6
|
+
//- q-route-tab(name="Мои заказы" label="Мои заказы" :to="{name: 'marketplace-user-supplies'}" )
|
7
|
+
//- q-route-tab(name="Создать объявление" label="Создать объявление" :to="{name: 'marketplace-create-offer'}" )
|
8
|
+
//- q-route-tab(name="Все объявления" label="Все объявления" :to="{name: 'marketplace-moderation'}" )
|
9
|
+
//- q-route-tab(name="Все заказы" label="Все заказы" :to="{name: 'marketplace-supplies'}" )
|
10
10
|
|
11
11
|
router-view
|
12
12
|
|
13
13
|
</template>
|
14
14
|
|
15
15
|
<script setup lang="ts">
|
16
|
-
import { computed } from 'vue'
|
17
|
-
import { useSessionStore } from 'src/entities/Session'
|
18
|
-
const session = useSessionStore()
|
16
|
+
// import { computed } from 'vue'
|
17
|
+
// import { useSessionStore } from 'src/entities/Session'
|
18
|
+
// const session = useSessionStore()
|
19
19
|
|
20
|
-
const loggedIn = computed(() => {
|
21
|
-
|
22
|
-
})
|
20
|
+
// const loggedIn = computed(() => {
|
21
|
+
// return session.isAuth
|
22
|
+
// })
|
23
23
|
</script>
|
24
24
|
|
25
25
|
<style>
|
@@ -30,7 +30,7 @@ div
|
|
30
30
|
|
31
31
|
</template>
|
32
32
|
<script setup lang="ts">
|
33
|
-
import { computed } from 'vue'
|
33
|
+
import { computed, onMounted } from 'vue'
|
34
34
|
import { ImageCarousel } from 'src/shared/ui/ImageCarousel'
|
35
35
|
|
36
36
|
import { useRouter } from 'vue-router'
|
@@ -40,13 +40,15 @@ import { UnpublishRequestButton } from 'src/features/Request/UnpublishRequest'
|
|
40
40
|
import { ModerateRequestButton } from 'src/features/Request/ModerateRequest'
|
41
41
|
import { ProhibitRequestButton } from 'src/features/Request/ProhibitRequest'
|
42
42
|
import { useSessionStore } from 'src/entities/Session'
|
43
|
-
|
43
|
+
|
44
|
+
import { useSystemStore } from 'src/entities/System/model'
|
44
45
|
const session = useSessionStore()
|
45
46
|
const username = computed(() => session.username)
|
47
|
+
const { info } = useSystemStore()
|
46
48
|
|
47
49
|
const router = useRouter()
|
48
50
|
|
49
|
-
const coopname = computed(() =>
|
51
|
+
const coopname = computed(() => info.coopname)
|
50
52
|
const requstsStore = useRequestStore()
|
51
53
|
|
52
54
|
const objects = computed(() => requstsStore.allParentOffers)
|
@@ -56,4 +58,6 @@ const currentObjectId = computed(() => router.currentRoute.value.params.id)
|
|
56
58
|
const currentObject = computed(() =>
|
57
59
|
objects.value.find((obj) => obj.id == Number(currentObjectId.value))
|
58
60
|
)
|
61
|
+
|
62
|
+
onMounted(() => requstsStore.loadAllParentOffers({coopname: coopname.value}))
|
59
63
|
</script>
|
@@ -70,7 +70,9 @@ import { UnpublishRequestButton } from 'src/features/Request/UnpublishRequest'
|
|
70
70
|
import { UpdateRequestButton } from 'src/features/Request/UpdateRequest'
|
71
71
|
import { useRequestStore } from 'src/entities/Request/model/stores'
|
72
72
|
import { useSessionStore } from 'src/entities/Session'
|
73
|
-
import {
|
73
|
+
import { useSystemStore } from 'src/entities/System/model';
|
74
|
+
const { info } = useSystemStore()
|
75
|
+
|
74
76
|
import type { IRequestData } from 'src/entities/Request'
|
75
77
|
const session = useSessionStore()
|
76
78
|
const username = computed(() => session.username)
|
@@ -95,7 +97,7 @@ watch(
|
|
95
97
|
{ deep: true }
|
96
98
|
)
|
97
99
|
const iAmOwner = computed(() => localRequest.value.username == username.value)
|
98
|
-
const coopname = computed(() =>
|
100
|
+
const coopname = computed(() => info.coopname)
|
99
101
|
|
100
102
|
let [temp_price, temp_symbol] = localRequest.value.unit_cost.split(' ')
|
101
103
|
temp_price = parseFloat(temp_price).toFixed(0)
|
@@ -14,7 +14,9 @@ div(v-if="store?.state?.payment?.details?.amount_without_fee")
|
|
14
14
|
import { computed, watch, onMounted } from 'vue'
|
15
15
|
import { useCreateUser } from 'src/features/User/CreateUser'
|
16
16
|
import { FailAlert } from 'src/shared/api';
|
17
|
-
import {
|
17
|
+
import { useSystemStore } from 'src/entities/System/model';
|
18
|
+
const { info } = useSystemStore()
|
19
|
+
|
18
20
|
import { useCooperativeStore } from 'src/entities/Cooperative';
|
19
21
|
import { useRegistratorStore } from 'src/entities/Registrator'
|
20
22
|
import { PayWithProvider } from 'src/shared/ui/PayWithProvider';
|
@@ -29,7 +31,7 @@ const coop = useCooperativeStore()
|
|
29
31
|
const currentStep = store.steps.PayInitial
|
30
32
|
|
31
33
|
onMounted(async () => {
|
32
|
-
await coop.loadPublicCooperativeData(
|
34
|
+
await coop.loadPublicCooperativeData(info.coopname)
|
33
35
|
|
34
36
|
if (step.value === currentStep)
|
35
37
|
createInitialPayment()
|
@@ -34,7 +34,7 @@ div
|
|
34
34
|
a(@click.stop='(event) => event.stopPropagation()' href='/documents/ustav.pdf' target='_blank').q-ml-xs Устав кооператива
|
35
35
|
|
36
36
|
div(v-if="!isLoading").q-mt-lg
|
37
|
-
q-btn.col-md-6.col-xs-12(flat
|
37
|
+
q-btn.col-md-6.col-xs-12(flat @click='back')
|
38
38
|
i.fa.fa-arrow-left
|
39
39
|
span.q-ml-md назад
|
40
40
|
|
@@ -73,7 +73,13 @@ const loadStatement = async (): Promise<void> => {
|
|
73
73
|
failAlert(e.message)
|
74
74
|
}
|
75
75
|
}
|
76
|
+
const back = () => {
|
77
|
+
if (store.isBranched)
|
78
|
+
store.goTo('SelectBranch')
|
79
|
+
else
|
80
|
+
store.goTo('GenerateAccount')
|
76
81
|
|
82
|
+
}
|
77
83
|
onMounted(() => {
|
78
84
|
if (store.state.step === store.steps.ReadStatement) {
|
79
85
|
loadStatement()
|
@@ -2,7 +2,7 @@
|
|
2
2
|
div(v-if="store")
|
3
3
|
q-step(
|
4
4
|
:name="store.steps.SelectBranch"
|
5
|
-
title="Выберите
|
5
|
+
title="Выберите кооперативный участок"
|
6
6
|
:done="store.isStepDone('SelectBranch')"
|
7
7
|
)
|
8
8
|
BranchSelector(
|
@@ -22,7 +22,9 @@ div(v-if="store")
|
|
22
22
|
import { useBranchStore } from 'src/entities/Branch/model'
|
23
23
|
import { useRegistratorStore } from 'src/entities/Registrator'
|
24
24
|
import { failAlert } from 'src/shared/api';
|
25
|
-
import {
|
25
|
+
import { useSystemStore } from 'src/entities/System/model';
|
26
|
+
const { info } = useSystemStore()
|
27
|
+
|
26
28
|
import { computed, onMounted, watch } from 'vue'
|
27
29
|
import { BranchSelector } from 'src/shared/ui/BranchSelector';
|
28
30
|
|
@@ -32,7 +34,7 @@ const branchStore = useBranchStore()
|
|
32
34
|
const load = async () => {
|
33
35
|
if (store.isStep('SelectBranch'))
|
34
36
|
try{
|
35
|
-
await branchStore.loadPublicBranches({ coopname:
|
37
|
+
await branchStore.loadPublicBranches({ coopname: info.coopname })
|
36
38
|
} catch(e: any){
|
37
39
|
failAlert(e)
|
38
40
|
}
|
@@ -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>
|
@@ -4,7 +4,7 @@ div(v-if="userData.organization_data").q-gutter-sm.q-mt-md
|
|
4
4
|
v-model="userData.organization_data.type"
|
5
5
|
label="Выберите тип организации"
|
6
6
|
standout="bg-teal text-white"
|
7
|
-
:options="[{ label: 'Потребительский Кооператив', value: 'coop' }, { label: 'ООО', value: 'ooo' }]"
|
7
|
+
:options="[{ label: 'Потребительский Кооператив', value: 'coop' }, { label: 'Производственный Кооператив', value: 'prodcoop' }, { label: 'ООО', value: 'ooo' }]"
|
8
8
|
emit-value
|
9
9
|
map-options).q-mb-md
|
10
10
|
q-input(v-model="userData.organization_data.short_name" standout="bg-teal text-white" hint="ПК Ромашка" label="Краткое наименование организации" :rules="[val => notEmpty(val)]" autocomplete="off")
|
@@ -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
|
})
|