@simitgroup/simpleapp-generator 1.0.63 → 1.0.64
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/README copy.md +9 -9
- package/buildinschemas copy/autoincreament.autoinc.jsonschema.json +1 -1
- package/buildinschemas copy/docnoformat.docno.jsonschema.json +2 -2
- package/dist/buildinschemas/autoincreament.js +6 -6
- package/dist/buildinschemas/branch.js +3 -3
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/docnoformat.js +5 -5
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/organization.js +3 -3
- package/dist/buildinschemas/permission.js +5 -5
- package/dist/buildinschemas/permission.js.map +1 -1
- package/dist/buildinschemas/tenant.js +2 -2
- package/dist/buildinschemas/user.js +3 -3
- package/dist/generate.js +2 -2
- package/dist/generate.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +6 -6
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/type.d.ts +7 -19
- package/dist/type.d.ts.map +1 -1
- package/docs/backend.md +2 -2
- package/docs/jsonschema.md +6 -6
- package/package.json +1 -1
- package/src/buildinschemas/autoincreament.ts +6 -6
- package/src/buildinschemas/branch.ts +3 -3
- package/src/buildinschemas/docnoformat.ts +5 -5
- package/src/buildinschemas/organization.ts +3 -3
- package/src/buildinschemas/permission.ts +5 -5
- package/src/buildinschemas/tenant.ts +2 -2
- package/src/buildinschemas/user.ts +3 -3
- package/src/generate.ts +2 -2
- package/src/processors/jsonschemabuilder.ts +7 -9
- package/src/processors/jsonschemabuilder.ts-old +5 -5
- package/src/type.ts +20 -20
- package/templates/basic/nest/controller.ts.eta +18 -18
- package/templates/basic/nest/processor.ts.eta +1 -1
- package/templates/basic/nuxt/pages.[id].vue.eta +1 -1
- package/templates/basic/nuxt/pages.landing.vue.eta +11 -16
- package/templates/basic/nuxt/{pages.crud.vue.eta → pages.new.vue.eta} +22 -9
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +6 -6
- package/templates/nest/src/simpleapp/generate/commons/interceptors/response.interceptor.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +20 -10
- package/templates/nest/src/simpleapp/generate/models/apievent.model.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +8 -8
- package/templates/nest/src/simpleapp/generate/types/apievent.type.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +16 -7
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.eta +10 -7
- package/templates/nest/src/simpleapp/services/branch.service.ts.eta +2 -2
- package/templates/nuxt/assets/css/style.css._eta +4 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +2 -1
- package/templates/nuxt/components/{SimpleAppDatatable.vue.eta → DocumentDatatable.vue.eta} +15 -63
- package/templates/nuxt/components/ListView.vue.eta +38 -26
- package/templates/nuxt/components/UserProfileListItem.vue.eta +1 -1
- package/templates/nuxt/components/{EventNotification.vue.eta → event/EventNotification.vue.eta} +1 -1
- package/templates/nuxt/components/{HeaderBar.vue.eta → header/HeaderBar.vue.eta} +6 -6
- package/templates/nuxt/components/{SelectBranch.vue.eta → header/HeaderSelectBranch.vue.eta} +2 -2
- package/templates/nuxt/components/{ButtonMenuPicker.vue.eta → header/button/HeaderButtonMenuPicker.vue.eta} +3 -3
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +11 -0
- package/templates/nuxt/components/renderer/index.ts.eta +12 -0
- package/templates/nuxt/components/{SimpleAppAutocomplete.vue.eta → simpleApp/SimpleAppAutocomplete.vue.eta} +13 -1
- package/templates/nuxt/components/{SimpleAppAutocompletemulti.vue.eta → simpleApp/SimpleAppAutocompletemulti.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppCalendar.vue.eta → simpleApp/SimpleAppCalendar.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppCheckbox.vue.eta → simpleApp/SimpleAppCheckbox.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppChip.vue.eta → simpleApp/SimpleAppChip.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppColor.vue.eta → simpleApp/SimpleAppColor.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppDocumentNo.vue.eta → simpleApp/SimpleAppDocumentNo.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppEditor.vue.eta → simpleApp/SimpleAppEditor.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppList.vue.eta → simpleApp/SimpleAppList.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppListmulti.vue.eta → simpleApp/SimpleAppListmulti.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppNumber.vue.eta → simpleApp/SimpleAppNumber.vue.eta} +12 -1
- package/templates/nuxt/components/{SimpleAppPassword.vue.eta → simpleApp/SimpleAppPassword.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppRadio.vue.eta → simpleApp/SimpleAppRadio.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppRating.vue.eta → simpleApp/SimpleAppRating.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppSelect.vue.eta → simpleApp/SimpleAppSelect.vue.eta} +12 -2
- package/templates/nuxt/components/{SimpleAppSelectmulti.vue.eta → simpleApp/SimpleAppSelectmulti.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppSlider.vue.eta → simpleApp/SimpleAppSlider.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppSwitch.vue.eta → simpleApp/SimpleAppSwitch.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppText.vue.eta → simpleApp/SimpleAppText.vue.eta} +13 -2
- package/templates/nuxt/components/{SimpleAppTextarea.vue.eta → simpleApp/SimpleAppTextarea.vue.eta} +13 -2
- package/templates/nuxt/composables/getMenus.generate.ts.eta +4 -1
- package/templates/nuxt/composables/goTo.generate.ts.eta +7 -0
- package/templates/nuxt/composables/notifications.generate.ts.eta +1 -1
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +1 -0
- package/templates/nuxt/layouts/documentlist.vue.eta +23 -7
- package/templates/nuxt/layouts/sidelist.vue.eta +68 -0
- package/templates/nuxt/pages/[xorg]/branch/index.vue.etax +2 -2
- package/templates/nuxt/pages/[xorg]/docnoformat/{[id].vue.eta → [doctype]/[id].vue.eta} +2 -5
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/new.vue.eta +216 -0
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype].vue.eta +33 -0
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +4 -294
- package/templates/nuxt/pages/[xorg]/docnoformat.vue.eta +100 -0
- package/templates/nuxt/pages/[xorg]/organization/[bid].vue.eta +14 -0
- package/templates/nuxt/pages/[xorg]/organization/[id]/branches/[bid].vue +13 -0
- package/templates/nuxt/pages/[xorg]/organization/[id]/branches/new.vue +149 -0
- package/templates/nuxt/pages/[xorg]/organization/[id]/index.vue.eta +1 -0
- package/templates/nuxt/pages/[xorg]/organization/new.vue.eta +145 -0
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +130 -0
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +28 -33
- package/templates/nuxt/pages/[xorg]/user.vue.eta +3 -3
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +1 -1
- package/templates/nuxt/types/documentlist.ts.eta +2 -2
- package/templates/project/jsonschemas/category.json._eta +2 -2
- package/templates/project/jsonschemas/customer.json._eta +2 -2
- package/templates/project/jsonschemas/invoice.json._eta +4 -4
- package/templates/project/jsonschemas/product.json._eta +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/renderers/ForeignKeyRender.vue.eta +0 -10
- package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +0 -168
- /package/templates/nuxt/components/{DebugDocumentData.vue.eta → debug/DebugDocumentData.vue.eta} +0 -0
- /package/templates/nuxt/components/{EventDecision.vue.eta → event/EventDecision.vue.eta} +0 -0
- /package/templates/nuxt/components/{ButtonHome.vue.eta → header/button/HeaderButtonHome.vue.eta} +0 -0
- /package/templates/nuxt/components/{ButtonLogout.vue.eta → header/button/HeaderButtonLogout.vue.eta} +0 -0
- /package/templates/nuxt/components/{ButtonProfile.vue.eta → header/button/HeaderButtonProfile.vue.eta} +0 -0
- /package/templates/nuxt/components/{renderers/BooleanRender.vue.eta → renderer/RendererBoolean.vue.eta} +0 -0
- /package/templates/nuxt/components/{renderers/DateRender.vue.eta → renderer/RendererDate.vue.eta} +0 -0
- /package/templates/nuxt/components/{renderers/MoneyRender.vue.eta → renderer/RendererMoney.vue.eta} +0 -0
- /package/templates/nuxt/components/{renderers/MultiTextRender.vue.eta → renderer/RendererMultiText.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleAppDynamicInput.vue.eta → simpleApp/SimpleAppDynamicInput.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleFieldContainer.vue.eta → simpleApp/SimpleAppFieldContainer.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleAppForm.vue.eta → simpleApp/SimpleAppForm.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleAppInputTable.vue.eta → simpleApp/SimpleAppInputTable.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleAppValue.vue.eta → simpleApp/SimpleAppValue.vue.eta} +0 -0
- /package/templates/nuxt/components/{helper.ts.eta → simpleApp/helper.ts.eta} +0 -0
- /package/templates/nuxt/components/{type.ts.eta → simpleApp/type.ts.eta} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by simpleapp everytime regenerate code.
|
|
4
|
+
* delete file "delete-me-for-avoid-override" if you want to modify this file and
|
|
5
|
+
* prevent regenerate code override it.
|
|
6
|
+
* last change 2023-09-09
|
|
7
|
+
* author: Ks Tan
|
|
8
|
+
*/
|
|
9
|
+
import ConfirmPopup from "primevue/confirmpopup";
|
|
10
|
+
import { useConfirm } from "primevue/useconfirm";
|
|
11
|
+
const confirm = useConfirm();
|
|
12
|
+
|
|
13
|
+
const { $BranchDoc, $OrganizationDoc, $event } = useNuxtApp();
|
|
14
|
+
const orgdoc = $OrganizationDoc();
|
|
15
|
+
const doc = $BranchDoc();
|
|
16
|
+
const data = doc.getReactiveData();
|
|
17
|
+
const bid = ref(String(useRoute().params.bid ?? ""));
|
|
18
|
+
const isReadOnly=ref(true)
|
|
19
|
+
const fetchRecord = async (id: string) => {
|
|
20
|
+
await doc.getById(id);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const disabled = computed(() => {
|
|
24
|
+
return false;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const createData = async () => {
|
|
28
|
+
doc
|
|
29
|
+
.create()
|
|
30
|
+
.then((res) => {
|
|
31
|
+
refresh();
|
|
32
|
+
goBranch(res.data._id);
|
|
33
|
+
})
|
|
34
|
+
.catch((err) => {
|
|
35
|
+
console.error(err);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const updateData = async () => {
|
|
39
|
+
doc
|
|
40
|
+
.update()
|
|
41
|
+
.then(() => {
|
|
42
|
+
// visible.value=false
|
|
43
|
+
refresh();
|
|
44
|
+
})
|
|
45
|
+
.catch((err) => {
|
|
46
|
+
console.error(err);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const deleteData = (event: Event) => {
|
|
50
|
+
confirm.require({
|
|
51
|
+
target: event.currentTarget as HTMLElement,
|
|
52
|
+
message: "Delete?",
|
|
53
|
+
icon: "pi pi-exclamation-triangle",
|
|
54
|
+
acceptClass: "p-button-danger",
|
|
55
|
+
accept: () => {
|
|
56
|
+
// disabled.value=true
|
|
57
|
+
doc.delete(data.value._id ?? "").then((res) => {
|
|
58
|
+
refresh();
|
|
59
|
+
|
|
60
|
+
goTo(doc.getDocName());
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
reject: () => {
|
|
64
|
+
console.log("Cancel delete");
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const refresh = () => {
|
|
70
|
+
$event("RefreshDocumentList", { documentName: doc.getDocName() });
|
|
71
|
+
isReadOnly.value=true
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (bid.value) {
|
|
75
|
+
fetchRecord(bid.value);
|
|
76
|
+
} else {
|
|
77
|
+
// const orgRecordid = ref(String(useRoute().params.id));
|
|
78
|
+
// const orgdata = (await orgdoc.getById(orgRecordid.value)).data;
|
|
79
|
+
doc.setNew();
|
|
80
|
+
isReadOnly.value=false
|
|
81
|
+
data.value.tenantId = getUserProfile().tenantId;
|
|
82
|
+
data.value.orgId = getUserProfile().orgId;
|
|
83
|
+
data.value.organization._id = getUserProfile().orgRecordId;
|
|
84
|
+
data.value.organization.label = getUserProfile().orgName;
|
|
85
|
+
data.value.organization.orgId = getUserProfile().orgId;
|
|
86
|
+
data.value.organization.code = getUserProfile().orgCode;
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
<template>
|
|
90
|
+
<div class="grid grid-cols2">
|
|
91
|
+
<SimpleAppForm :document="doc" #default="o" :readonly="isReadOnly">
|
|
92
|
+
<div v-if="!isReadOnly" class="col-span-4 text-left gap-4">
|
|
93
|
+
<Button
|
|
94
|
+
class="bg-primary-600 hover:bg-primary-400 text-white"
|
|
95
|
+
:isReadOnly="isReadOnly"
|
|
96
|
+
@click="createData"
|
|
97
|
+
type="button"
|
|
98
|
+
v-if="canPerform(doc.getDocName(), 'create') && doc.isNew()"
|
|
99
|
+
>Create</Button
|
|
100
|
+
>
|
|
101
|
+
<Button
|
|
102
|
+
class="bg-primary-600 hover:bg-primary-400 text-white"
|
|
103
|
+
|
|
104
|
+
@click="updateData"
|
|
105
|
+
type="button"
|
|
106
|
+
v-if="canPerform(doc.getDocName(), 'update') && !doc.isNew()"
|
|
107
|
+
>Update</Button
|
|
108
|
+
>
|
|
109
|
+
<Button
|
|
110
|
+
class="bg-danger-600 hover:bg-danger-400 text-white"
|
|
111
|
+
@click="deleteData($event)"
|
|
112
|
+
type="button"
|
|
113
|
+
v-if="canPerform(doc.getDocName(), 'delete') && !doc.isNew()"
|
|
114
|
+
>Delete</Button
|
|
115
|
+
>
|
|
116
|
+
|
|
117
|
+
<ConfirmPopup></ConfirmPopup>
|
|
118
|
+
</div>
|
|
119
|
+
<div v-else class="col-span-4 text-left gap-4">
|
|
120
|
+
<Button
|
|
121
|
+
class="bg-primary-600 hover:bg-primary-400 text-white"
|
|
122
|
+
@click="isReadOnly=false" type="button" >Edit</Button
|
|
123
|
+
>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<SimpleAppText
|
|
127
|
+
v-model="data.branchCode"
|
|
128
|
+
:setting="o.getField('#/properties/branchCode')"
|
|
129
|
+
/>
|
|
130
|
+
<SimpleAppText
|
|
131
|
+
v-model="data.branchName"
|
|
132
|
+
:setting="o.getField('#/properties/branchName')"
|
|
133
|
+
/>
|
|
134
|
+
<SimpleAppCheckbox
|
|
135
|
+
v-model="data.active"
|
|
136
|
+
:setting="o.getField('#/properties/active')"
|
|
137
|
+
/>
|
|
138
|
+
<SimpleAppTextarea
|
|
139
|
+
v-model="data.description"
|
|
140
|
+
:setting="o.getField('#/properties/description')"
|
|
141
|
+
/>
|
|
142
|
+
</SimpleAppForm>
|
|
143
|
+
<DebugDocumentData v-model="data" label="branch" />
|
|
144
|
+
</div>
|
|
145
|
+
</template>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by simpleapp everytime regenerate code.
|
|
4
|
+
* delete file "delete-me-for-avoid-override" if you want to modify this file and
|
|
5
|
+
* prevent regenerate code override it.
|
|
6
|
+
* last change 2023-09-09
|
|
7
|
+
* author: Ks Tan
|
|
8
|
+
*/
|
|
9
|
+
import ConfirmPopup from "primevue/confirmpopup";
|
|
10
|
+
import { useConfirm } from "primevue/useconfirm";
|
|
11
|
+
const confirm = useConfirm();
|
|
12
|
+
|
|
13
|
+
const { $OrganizationDoc, $BranchDoc, $event, $listen } = useNuxtApp();
|
|
14
|
+
const doc = $OrganizationDoc();
|
|
15
|
+
const brancdoc = $BranchDoc();
|
|
16
|
+
const data = doc.getReactiveData();
|
|
17
|
+
const branchlist = ref([]);
|
|
18
|
+
const isReadOnly=ref(true)
|
|
19
|
+
const getCurrentOrg = async () => {
|
|
20
|
+
await doc.getById(getUserProfile().orgRecordId);
|
|
21
|
+
};
|
|
22
|
+
const fetchRecord = async (id: string) => {
|
|
23
|
+
await doc.getById(id);
|
|
24
|
+
branchlist.value = await brancdoc.search({
|
|
25
|
+
filter: { orgId: data.value.orgId },
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const id = computed((): string => String(useRoute().params.id ?? ""));
|
|
30
|
+
const updateData = async () => {
|
|
31
|
+
doc
|
|
32
|
+
.update()
|
|
33
|
+
.then(() => {
|
|
34
|
+
refresh();
|
|
35
|
+
isReadOnly.value=true
|
|
36
|
+
})
|
|
37
|
+
.catch((err) => {
|
|
38
|
+
console.error(err);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const refresh = () => {
|
|
43
|
+
$event("RefreshDocumentList", { documentName: doc.getDocName() });
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//branch record update then reload
|
|
47
|
+
$listen("RefreshDocumentList", (data) => {
|
|
48
|
+
console.log("refresh from branch", data.documentName, "==", doc.getDocName());
|
|
49
|
+
if (data.documentName == "branch") {
|
|
50
|
+
fetchRecord(id.value);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (id) {
|
|
55
|
+
fetchRecord(id.value);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
getCurrentOrg();
|
|
59
|
+
</script>
|
|
60
|
+
<template>
|
|
61
|
+
<div class="grid grid-cols-3">
|
|
62
|
+
<div class="">
|
|
63
|
+
<Card>
|
|
64
|
+
<template #content>
|
|
65
|
+
<SimpleAppForm #default="o" :document="doc" :readonly="isReadOnly">
|
|
66
|
+
<div class="simpleapp-tool-bar col-span-4 text-left gap-4" v-if="canPerform(doc.getDocName(), 'update')">
|
|
67
|
+
<Button v-if="isReadOnly"
|
|
68
|
+
class="bg-primary-600 hover:bg-primary-400 text-white"
|
|
69
|
+
@click="isReadOnly=false" type="button">Edit</Button>
|
|
70
|
+
<Button v-else
|
|
71
|
+
class="bg-primary-600 hover:bg-primary-400 text-white"
|
|
72
|
+
@click="updateData" type="button" >Update</Button
|
|
73
|
+
>
|
|
74
|
+
<ConfirmPopup></ConfirmPopup>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="flex flex-col">
|
|
77
|
+
<div class="flex flex-row gap-4">
|
|
78
|
+
<SimpleAppText
|
|
79
|
+
autofocus
|
|
80
|
+
v-model="data.orgCode"
|
|
81
|
+
:setting="o.getField('#/properties/orgCode')"
|
|
82
|
+
|
|
83
|
+
/>
|
|
84
|
+
<SimpleAppText
|
|
85
|
+
v-model="data.orgName"
|
|
86
|
+
class=""
|
|
87
|
+
:setting="o.getField('#/properties/orgName')"
|
|
88
|
+
/>
|
|
89
|
+
<SimpleAppCheckbox
|
|
90
|
+
v-model="data.active"
|
|
91
|
+
:setting="o.getField('#/properties/active')"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
<div>
|
|
95
|
+
<SimpleAppTextarea
|
|
96
|
+
:setting="o.getField('#/properties/description')"
|
|
97
|
+
v-model="data.description"
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
<DebugDocumentData v-model="data" label="organization" />
|
|
102
|
+
</SimpleAppForm>
|
|
103
|
+
</template>
|
|
104
|
+
</Card>
|
|
105
|
+
</div>
|
|
106
|
+
<div>
|
|
107
|
+
<Card>
|
|
108
|
+
<template #header>
|
|
109
|
+
<!-- <h1 class="text-2xl font-bold">{{ data.orgName }}</h1> -->
|
|
110
|
+
</template>
|
|
111
|
+
<template #content>
|
|
112
|
+
<div class="">
|
|
113
|
+
<h1>Branches</h1>
|
|
114
|
+
<Button @click="goBranch('new')">New</Button>
|
|
115
|
+
<ListView
|
|
116
|
+
:list="branchlist"
|
|
117
|
+
title-field="branchName"
|
|
118
|
+
sub-title-field="branchCode"
|
|
119
|
+
:url="getDocumentUrl('organization', id)"
|
|
120
|
+
>
|
|
121
|
+
</ListView>
|
|
122
|
+
</div>
|
|
123
|
+
</template>
|
|
124
|
+
</Card>
|
|
125
|
+
</div>
|
|
126
|
+
<div>
|
|
127
|
+
<NuxtPage></NuxtPage>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</template>
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<div class="flex flex-col gap-2">
|
|
10
10
|
<SimpleAppText
|
|
11
11
|
autofocus
|
|
12
|
-
:setting="o.getField('#/properties/
|
|
13
|
-
v-model="userdata.
|
|
12
|
+
:setting="o.getField('#/properties/fullName')"
|
|
13
|
+
v-model="userdata.fullName"
|
|
14
14
|
/>
|
|
15
15
|
|
|
16
16
|
<SimpleAppText
|
|
@@ -64,36 +64,31 @@
|
|
|
64
64
|
</div> -->
|
|
65
65
|
|
|
66
66
|
<div class="">
|
|
67
|
-
<Card v-for="o in orglist" class="m-2">
|
|
67
|
+
<Card v-if="currentpermissions.length>0" v-for="o in orglist" class="m-2">
|
|
68
68
|
<template #title>{{ o.orgName }}</template>
|
|
69
|
-
<template #content>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
<template #content>
|
|
70
|
+
<table class="w w-full">
|
|
71
|
+
<tr v-for="(b, index) in branchlist">
|
|
72
|
+
<td v-if="checkBranchInOrg(o, b)" class="text-center">
|
|
73
|
+
{{ b.branchCode }}
|
|
74
|
+
</td>
|
|
75
|
+
<td
|
|
76
|
+
v-if="checkBranchInOrg(o, b)"
|
|
77
|
+
class="text-center flex flex-row"
|
|
78
|
+
>
|
|
79
|
+
<div>
|
|
80
|
+
|
|
81
|
+
<SelectButton
|
|
82
|
+
v-model="currentpermissions[index]['group']"
|
|
83
|
+
:options="grouplist"
|
|
84
|
+
option-label="label"
|
|
85
|
+
option-value="value"
|
|
86
|
+
@change="applyPermission(currentpermissions[index])"
|
|
87
|
+
></SelectButton>
|
|
88
|
+
</div>
|
|
89
|
+
</td>
|
|
75
90
|
</tr>
|
|
76
|
-
</
|
|
77
|
-
<tr v-for="(b, index) in branchlist">
|
|
78
|
-
<td v-if="checkBranchInOrg(o, b)" class="text-center">
|
|
79
|
-
{{ b.branchCode }}
|
|
80
|
-
</td>
|
|
81
|
-
<td
|
|
82
|
-
v-if="checkBranchInOrg(o, b)"
|
|
83
|
-
class="text-center flex flex-row"
|
|
84
|
-
>
|
|
85
|
-
<div>
|
|
86
|
-
<SelectButton
|
|
87
|
-
v-model="currentpermissions[index]['group']"
|
|
88
|
-
:options="grouplist"
|
|
89
|
-
option-label="label"
|
|
90
|
-
option-value="value"
|
|
91
|
-
@change="applyPermission(currentpermissions[index])"
|
|
92
|
-
></SelectButton>
|
|
93
|
-
</div>
|
|
94
|
-
</td>
|
|
95
|
-
</tr>
|
|
96
|
-
</table>
|
|
91
|
+
</table>
|
|
97
92
|
</template>
|
|
98
93
|
</Card>
|
|
99
94
|
</div>
|
|
@@ -103,7 +98,7 @@
|
|
|
103
98
|
</div>
|
|
104
99
|
</template>
|
|
105
100
|
<script setup lang="ts">
|
|
106
|
-
import Card from "primevue/card";
|
|
101
|
+
// import Card from "primevue/card";
|
|
107
102
|
import { Permission, User } from "../../../simpleapp/generate/openapi/api";
|
|
108
103
|
import _ from "lodash";
|
|
109
104
|
import SelectButton from "primevue/selectbutton";
|
|
@@ -207,7 +202,7 @@ const saveUser = async () => {
|
|
|
207
202
|
};
|
|
208
203
|
|
|
209
204
|
const onSelectUser = async (userId: string) => {
|
|
210
|
-
console.log(
|
|
205
|
+
console.log("onSelectUser", userId);
|
|
211
206
|
// .addRoute()
|
|
212
207
|
// const user: UserListItem = { ...menuitem };
|
|
213
208
|
const orgsearchbody: SearchBody = {
|
|
@@ -296,7 +291,7 @@ const getPermssionData = (userId: string, branchId: number) => {
|
|
|
296
291
|
|
|
297
292
|
onMounted(() => {
|
|
298
293
|
const id = String(useRoute().params.id);
|
|
299
|
-
console.log("id",id)
|
|
294
|
+
console.log("id", id);
|
|
300
295
|
onSelectUser(id);
|
|
301
296
|
});
|
|
302
297
|
</script>
|
|
@@ -72,7 +72,7 @@ const refreshList = async (resetpage: boolean = true) => {
|
|
|
72
72
|
"uid",
|
|
73
73
|
"email",
|
|
74
74
|
"created",
|
|
75
|
-
"
|
|
75
|
+
"fullName",
|
|
76
76
|
"active",
|
|
77
77
|
"lastActivity",
|
|
78
78
|
"description",
|
|
@@ -111,7 +111,7 @@ const invite = async () => {
|
|
|
111
111
|
inviteuserdoc.setNew();
|
|
112
112
|
const newuserdata = inviteuserdoc.getReactiveData();
|
|
113
113
|
newuserdata.value.email = inviteemail.value;
|
|
114
|
-
newuserdata.value.
|
|
114
|
+
newuserdata.value.fullName = inviteemail.value.split("@")[0];
|
|
115
115
|
newuserdata.value.active = true;
|
|
116
116
|
newuserdata.value.tenantId = currentuser.tenantId;
|
|
117
117
|
newuserdata.value.orgId = currentuser.orgId;
|
|
@@ -126,7 +126,7 @@ const invite = async () => {
|
|
|
126
126
|
$listen("RefreshUser", () => {
|
|
127
127
|
refreshList();
|
|
128
128
|
});
|
|
129
|
-
onMounted(() => {
|
|
129
|
+
onMounted(() => {
|
|
130
130
|
refreshList();
|
|
131
131
|
});
|
|
132
132
|
</script>
|
|
@@ -19,8 +19,10 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
19
19
|
tenantId:ref(0),
|
|
20
20
|
orgId:ref(0),
|
|
21
21
|
branchId:ref(0),
|
|
22
|
+
branchRecordId:ref(''),
|
|
22
23
|
branchCode:ref(''),
|
|
23
24
|
branchName:ref(''),
|
|
25
|
+
orgRecordId:ref(''),
|
|
24
26
|
orgCode:ref(''),
|
|
25
27
|
orgName:ref(''),
|
|
26
28
|
uid: ref(''),
|
|
@@ -55,7 +57,9 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
55
57
|
this.sessionId = res.data.sessionId
|
|
56
58
|
this.tenantId = res.data.tenantId
|
|
57
59
|
this.orgId = res.data.orgId
|
|
60
|
+
this.orgRecordId = res.data.orgRecordId
|
|
58
61
|
this.branchId = res.data.branchId
|
|
62
|
+
this.branchRecordId = res.data.branchRecordId
|
|
59
63
|
this.branchCode = res.data.branchCode
|
|
60
64
|
this.branchName = res.data.branchName
|
|
61
65
|
this.orgCode = res.data.orgCode
|
|
@@ -140,6 +144,8 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
140
144
|
tenantId : this.tenantId,
|
|
141
145
|
orgId : this.orgId,
|
|
142
146
|
branchId : this.branchId,
|
|
147
|
+
orgRecordId: this.orgRecordId,
|
|
148
|
+
branchRecordId: this.branchRecordId,
|
|
143
149
|
uid : this.uid,
|
|
144
150
|
email : this.email,
|
|
145
151
|
branchCode: this.branchCode,
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"_id": { "type": "string" },
|
|
13
13
|
"created": { "type": "string" },
|
|
14
14
|
"updated": { "type": "string" },
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"createdBy": { "type": "string" },
|
|
16
|
+
"updatedBy": { "type": "string" },
|
|
17
17
|
"tenantId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
18
18
|
"orgId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
19
19
|
"branchId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"_id": { "type": "string" },
|
|
14
14
|
"created": { "type": "string" },
|
|
15
15
|
"updated": { "type": "string" },
|
|
16
|
-
"
|
|
17
|
-
"
|
|
16
|
+
"createdBy": { "type": "string" },
|
|
17
|
+
"updatedBy": { "type": "string" },
|
|
18
18
|
"tenantId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
19
19
|
"orgId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
20
20
|
"branchId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"generateDocumentNumber": true,
|
|
11
11
|
"pageType": "crud",
|
|
12
12
|
"formulas": [
|
|
13
|
-
{ "
|
|
13
|
+
{ "jsonPath": "$.details[*]", "formula": "sharelibs.getSubtotal(value)" },
|
|
14
14
|
{
|
|
15
|
-
"
|
|
15
|
+
"jsonPath": "$.invoiceTotal",
|
|
16
16
|
"formula": "sharelibs.getTotal(data.details)"
|
|
17
17
|
}
|
|
18
18
|
]
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"_id": { "type": "string" },
|
|
22
22
|
"created": { "type": "string" },
|
|
23
23
|
"updated": { "type": "string" },
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"createdBy": { "type": "string" },
|
|
25
|
+
"updatedBy": { "type": "string" },
|
|
26
26
|
"tenantId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
27
27
|
"orgId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
28
28
|
"branchId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"_id": { "type": "string" },
|
|
14
14
|
"created": { "type": "string" },
|
|
15
15
|
"updated": { "type": "string" },
|
|
16
|
-
"
|
|
17
|
-
"
|
|
16
|
+
"createdBy": { "type": "string" },
|
|
17
|
+
"updatedBy": { "type": "string" },
|
|
18
18
|
"tenantId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
19
19
|
"orgId": { "type": "integer", "default": 1, "minimum": 1 },
|
|
20
20
|
"branchId": { "type": "integer", "default": 1, "minimum": 1 },
|