Skip to content

Commit

Permalink
Merge pull request #4547 from mikhailprivalov/fix-change-group
Browse files Browse the repository at this point in the history
Смена группы у поля - v2
  • Loading branch information
urchinpro authored Dec 14, 2024
2 parents 08f940d + e904d26 commit 5554959
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions l2-frontend/src/construct/ParaclinicResearchEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@
<Treeselect
v-model="row.newGroupId"
placeholder="Группа..."
:options="possibleGroupsForField"
:options="findPossibleGroupForField"
/>
</div>
</div>
Expand Down Expand Up @@ -1396,6 +1396,13 @@ export default {
expertise() {
return this.$store.getters.modules.l2_expertise;
},
findPossibleGroupForField() {
const filtered = this.groups.filter((group) => {
const newFields = group.fields.filter((field) => field.pk === -1);
return newFields.length < 1;
});
return filtered.map(group => ({ id: group.pk, label: group.pk }));
},
},
watch: {
pk() {
Expand Down Expand Up @@ -1425,7 +1432,6 @@ export default {
await this.loadDepartmentsForPermissions();
await this.load_deparments();
await this.loadDynamicDirectories();
this.findPossibleGroupForField();
},
mounted() {
window.$(window).on('beforeunload', () => {
Expand Down Expand Up @@ -1739,7 +1745,6 @@ export default {
if (this.ex_deps.length > 0 && this.site_type === null) {
this.site_type = this.ex_deps[0].pk;
}
this.findPossibleGroupForField();
},
cancel() {
// eslint-disable-next-line no-restricted-globals,no-alert
Expand Down Expand Up @@ -1833,9 +1838,6 @@ export default {
closePermissionsModal() {
this.showPermissionsModal = false;
},
findPossibleGroupForField() {
this.possibleGroupsForField = this.groups.map(group => ({ id: group.pk, label: group.pk }));
},
openFileAddModal() {
this.showFileAddModal = true;
},
Expand Down Expand Up @@ -2059,4 +2061,7 @@ export default {
padding: 7px 12px;
width: 116px !important;
};
.change-field-group {
margin: 6px 0;
}
</style>

0 comments on commit 5554959

Please sign in to comment.