Merged in bugfix/PMCORE-2617 (pull request #7670)
PMCORE-2617 Approved-by: Henry Jonathan Quispe Quispe <jonathan.quispe@processmaker.com>
This commit is contained in:
@@ -74,13 +74,21 @@
|
|||||||
</b-button>
|
</b-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<input
|
<form ref="jump" @submit.stop.prevent="handleJumpTo">
|
||||||
v-model="caseNumber"
|
<b-form-group
|
||||||
size="1"
|
:state="caseNumberState"
|
||||||
class="form-control"
|
:invalid-feedback="$t('ID_INVALID_APPLICATION_NUMBER')"
|
||||||
:placeholder="$t('ID_CASE_NUMBER_CAPITALIZED')"
|
>
|
||||||
type="number"
|
<b-form-input
|
||||||
/>
|
id="case-number-input"
|
||||||
|
v-model="caseNumber"
|
||||||
|
:state="caseNumberState"
|
||||||
|
:placeholder="$t('ID_CASE_NUMBER_CAPITALIZED')"
|
||||||
|
required
|
||||||
|
type="number"
|
||||||
|
></b-form-input>
|
||||||
|
</b-form-group>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</b-col>
|
</b-col>
|
||||||
@@ -352,6 +360,7 @@ export default {
|
|||||||
saveModalTitle: this.$i18n.t('ID_SAVE_SEARCH'),
|
saveModalTitle: this.$i18n.t('ID_SAVE_SEARCH'),
|
||||||
localName: "",
|
localName: "",
|
||||||
nameState: null,
|
nameState: null,
|
||||||
|
caseNumberState: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -361,12 +370,11 @@ export default {
|
|||||||
this.searchTags = [];
|
this.searchTags = [];
|
||||||
this.selected = [];
|
this.selected = [];
|
||||||
this.setFilters(newVal);
|
this.setFilters(newVal);
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Filters and make the tag labels
|
* Set Filters and make the tag labels
|
||||||
* @param {object} filters json to manage the query
|
* @param {object} filters json to manage the query
|
||||||
@@ -468,8 +476,25 @@ export default {
|
|||||||
temp = [...new Set([...this.filters,...params])]
|
temp = [...new Set([...this.filters,...params])]
|
||||||
this.$emit("onUpdateFilters", temp);
|
this.$emit("onUpdateFilters", temp);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Jump To action handler
|
||||||
|
* Validates the form input
|
||||||
|
*/
|
||||||
|
handleJumpTo() {
|
||||||
|
const valid = this.$refs.jump.checkValidity() && parseInt(this.caseNumber) > 0;
|
||||||
|
this.caseNumberState = valid;
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$emit("onJumpCase", this.caseNumber);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Click evemt hamdler for "Jump To" button
|
||||||
|
*/
|
||||||
onJumpCase() {
|
onJumpCase() {
|
||||||
this.$emit("onJumpCase", this.caseNumber);
|
this.handleJumpTo();
|
||||||
},
|
},
|
||||||
onClick() {
|
onClick() {
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
|
|||||||
@@ -423,12 +423,16 @@ export default {
|
|||||||
let self = this;
|
let self = this;
|
||||||
api.cases
|
api.cases
|
||||||
.jump(params)
|
.jump(params)
|
||||||
.then(function(data) {
|
.then(function(response) {
|
||||||
self.$parent.dataCase = params;
|
if (response.data.exists) {
|
||||||
self.$parent.page = "XCase";
|
self.$parent.dataCase = params;
|
||||||
|
self.$parent.page = "XCase";
|
||||||
|
} else {
|
||||||
|
self.showAlert(response.data.message, "danger");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new Error(err);
|
self.showAlert(err.message, "danger");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user