update_21.09.23

This commit is contained in:
NW
2023-09-21 15:20:06 +01:00
parent 046eddc957
commit 0de0459ce1
25 changed files with 2454 additions and 2091 deletions

View File

@@ -8,10 +8,12 @@
:key="index"
:class="[element.col ? element.col : 'col-md-12']"
v-show="togglePageVisibility(element.page_num)">
<fieldGenerator
<fieldGenerator
:element="element"
:settings="settings"
:submitted_data="submitted_data"
:action="action"
:action-by="actionBy"
@apply_conditions="applyConditions">
</fieldGenerator>
</div>
@@ -64,7 +66,7 @@
import fieldGenerator from "./FieldGenerator";
export default{
props: ['form', 'actionBy'],
props: ['form', 'actionBy', 'action'],
components: {
fieldGenerator
},
@@ -121,7 +123,9 @@
messages: messages,
submitHandler: function(form, e) {
e.preventDefault();
let disabled = $('#show_form :input:disabled').removeAttr('disabled');
var form_data = $('#show_form').serialize();
disabled.attr('disabled', 'disabled');
$("button.submit_btn, button.draft_btn").attr('disabled', 'disabled');
var status = $("input[name=status]").val();
if (status == 'complete') {
@@ -139,9 +143,9 @@
}
let url = '/form-data/' + self.form_parsed.id + '?token=' + self.token + '&form_data_id=' + self.form_data_id;
if (self.actionBy.length && self.actionBy == 'admin') {
url = '/update/'+self.form_parsed.id+'/data/'+self.form_data_id;
}
// if (self.actionBy.length && self.actionBy === 'admin') {
// url = '/update/'+self.form_parsed.id+'/data/'+self.form_data_id;
// }
axios
.post(url, {form_data})
@@ -209,11 +213,15 @@
location.reload();
}
}
setTimeout(function() {
window.location.href = document.referrer;
}, 3000);
} else {
toastr.error(response.data.msg);
}
})
.catch(function(error) {
.catch(function(error) {
toastr.error(error);
});
}
@@ -301,7 +309,7 @@
} else {
form_element_value = document.getElementById(element.condition).value;
}
//check if condition_satisfied or not
if(logical_operator == 'AND') {
if (element.operator == '==') {
@@ -430,7 +438,7 @@
isCardFormLayout() {
const self = this;
if (
self.settings.layout &&
self.settings.layout &&
_.includes(['card_form'], self.settings.layout)
) {
return true
@@ -493,7 +501,7 @@
) {
is_element_valid = $('[name="' + element_name + '"]').valid();
}
return is_element_valid;
},
copyLink(){
@@ -509,4 +517,4 @@
}
}
}
</script>
</script>