This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
v-model="userId"
|
v-model="userId"
|
||||||
:label="$ay.t('UserList')"
|
:label="$ay.t('UserList')"
|
||||||
ref="userPickList"
|
ref="userPickList"
|
||||||
|
@input="checkSave()"
|
||||||
></gz-pick-list> </v-col
|
></gz-pick-list> </v-col
|
||||||
><v-col cols="1">
|
><v-col cols="1">
|
||||||
<v-btn @click="addSelected()">
|
<v-btn @click="addSelected()">
|
||||||
@@ -20,18 +21,6 @@
|
|||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<!-- <v-col cols="12">
|
|
||||||
<v-select
|
|
||||||
:items="items"
|
|
||||||
item-text="name"
|
|
||||||
item-value="id"
|
|
||||||
multiple
|
|
||||||
chips
|
|
||||||
deletable-chips
|
|
||||||
:value="toUsers"
|
|
||||||
:label="$ay.t('MemoToID')"
|
|
||||||
></v-select>
|
|
||||||
</v-col> -->
|
|
||||||
|
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<template v-for="item in toUsers">
|
<template v-for="item in toUsers">
|
||||||
@@ -55,6 +44,7 @@
|
|||||||
ref="message"
|
ref="message"
|
||||||
auto-grow
|
auto-grow
|
||||||
:clearable="!formState.readOnly"
|
:clearable="!formState.readOnly"
|
||||||
|
@input="checkSave()"
|
||||||
></v-textarea>
|
></v-textarea>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -155,6 +145,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkSave() {
|
||||||
|
let hasSelection =
|
||||||
|
this.toUsers.length > 0 || (this.userId != null && this.userId != 0);
|
||||||
|
let hasText = this.message != null && this.message != "";
|
||||||
|
|
||||||
|
this.formState.dirty = hasSelection && hasText;
|
||||||
|
if (this.canSave) {
|
||||||
|
window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":save");
|
||||||
|
} else {
|
||||||
|
window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":save");
|
||||||
|
}
|
||||||
|
},
|
||||||
closeChip(item) {
|
closeChip(item) {
|
||||||
// console.log(item);
|
// console.log(item);
|
||||||
// debugger;
|
// debugger;
|
||||||
@@ -162,22 +164,21 @@ export default {
|
|||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
this.toUsers.splice(i, 1);
|
this.toUsers.splice(i, 1);
|
||||||
}
|
}
|
||||||
|
this.checkSave();
|
||||||
},
|
},
|
||||||
addSelected() {
|
addSelected() {
|
||||||
let selected = this.$refs.userPickList.getFullSelectionValue();
|
let selected = this.$refs.userPickList.getFullSelectionValue();
|
||||||
if (selected == null) {
|
if (selected == null) {
|
||||||
console.log("Selected is null");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//already in the list?
|
//already in the list?
|
||||||
if (this.toUsers.find(z => z.id == selected.id)) {
|
if (this.toUsers.find(z => z.id == selected.id)) {
|
||||||
console.log(`User ${selected.name} is already in the list`);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Pushing user ${selected.name} into list`);
|
|
||||||
this.toUsers.push(selected);
|
this.toUsers.push(selected);
|
||||||
this.userId = 0;
|
this.userId = 0;
|
||||||
|
this.checkSave();
|
||||||
},
|
},
|
||||||
ayaTypes: function() {
|
ayaTypes: function() {
|
||||||
return window.$gz.type;
|
return window.$gz.type;
|
||||||
@@ -186,11 +187,7 @@ export default {
|
|||||||
form() {
|
form() {
|
||||||
return window.$gz.form;
|
return window.$gz.form;
|
||||||
},
|
},
|
||||||
fieldValueChanged(ref) {
|
|
||||||
if (!this.formState.loading && !this.formState.readOnly) {
|
|
||||||
window.$gz.form.fieldValueChanged(this, ref);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async submit() {
|
async submit() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
if (vm.canSave) {
|
if (vm.canSave) {
|
||||||
|
|||||||
Reference in New Issue
Block a user