diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue
index 15c0aea31..92d4d09c7 100644
--- a/resources/assets/js/components/AkauntingSelect.vue
+++ b/resources/assets/js/components/AkauntingSelect.vue
@@ -570,7 +570,7 @@ export default {
onModal(value) {
let add_new = this.add_new;
- axios.get(this.add_new.path)
+ window.axios.get(this.add_new.path)
.then(response => {
add_new.show = true;
add_new.html = response.data.html;
@@ -625,7 +625,7 @@ export default {
let data = this.form.data();
- FormData.prototype.appendRecursive = function(data, wrapper = null) {
+ FormData.prototype.appendRecursive = function(data, wrapper = null) {
for(var name in data) {
if (wrapper) {
if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
@@ -661,7 +661,7 @@ export default {
if (response.data.success) {
this.selectOptions[response.data.data.id] = response.data.data['name'];
- this.new_options[response.data.data.id] = response.data.data.id;
+ this.new_options[response.data.data.id] = response.data.data['name'];
this.real_model = response.data.data.id.toString();
this.change();
@@ -696,6 +696,14 @@ export default {
options: function (options) {
// update options
this.selectOptions = options;
+
+ if (Object.keys(this.new_options).length) {
+ for (let [key, value] of Object.entries(this.new_options)) {
+ if (!this.selectOptions[key]) {
+ this.selectOptions[key] = value;
+ }
+ }
+ }
},
value: function (value) {
diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue
index 71ce64f14..7d66a1765 100644
--- a/resources/assets/js/components/AkauntingSelectRemote.vue
+++ b/resources/assets/js/components/AkauntingSelectRemote.vue
@@ -1,5 +1,16 @@
-
+
@@ -44,6 +55,8 @@
:key="value"
:label="label"
:value="value">
+ {{ label }}
+ {{ new_text }}
+ {{ label }}
+ {{ new_text }}
@@ -113,6 +128,8 @@
:key="value"
:label="label"
:value="value">
+ {{ label }}
+ {{ new_text }}
+ {{ label }}
+ {{ new_text }}
@@ -182,6 +201,8 @@
:key="value"
:label="label"
:value="value">
+ {{ label }}
+ {{ new_text }}
+ {{ label }}
+ {{ new_text }}
@@ -251,6 +274,8 @@
:key="value"
:label="label"
:value="value">
+ {{ label }}
+ {{ new_text }}
+ {{ label }}
+ {{ new_text }}
@@ -281,6 +308,8 @@
+
+ {{ new_text }}
+ {{ label }}
+ {{ new_text }}
+ {{ label }}
+ {{ new_text }}
@@ -364,6 +397,8 @@
+
+ {{ new_text }}
@@ -374,6 +409,7 @@ import { Select, Option, OptionGroup, ColorPicker } from 'element-ui';
import AkauntingModalAddNew from './AkauntingModalAddNew';
import AkauntingModal from './AkauntingModal';
+import AkauntingMoney from './AkauntingMoney';
import AkauntingRadioGroup from './forms/AkauntingRadioGroup';
import AkauntingSelect from './AkauntingSelect';
import AkauntingDate from './AkauntingDate';
@@ -393,6 +429,7 @@ export default {
AkauntingRadioGroup,
AkauntingSelect,
AkauntingModal,
+ AkauntingMoney,
AkauntingDate,
AkauntingRecurring,
},
@@ -430,7 +467,11 @@ export default {
},
options: null,
- model: null,
+ model: {
+ type: [String, Number],
+ default: '',
+ description: "Selectbox selected model"
+ },
icon: {
type: String,
@@ -446,6 +487,7 @@ export default {
path: null,
type: 'modal', // modal, inline
field: 'name',
+ new_text: 'New',
buttons: {}
};
},
@@ -462,6 +504,11 @@ export default {
default: false,
description: "Multible feature status"
},
+ readonly: {
+ type: Boolean,
+ default: false,
+ description: "Selectbox disabled status"
+ },
disabled: {
type: Boolean,
default: false,
@@ -509,16 +556,29 @@ export default {
data() {
return {
list: [],
- add_new: this.addNew,
+ add_new: {
+ text: this.addNew.text,
+ show: false,
+ path: this.addNew.path,
+ type: this.addNew.type, // modal, inline
+ field: this.addNew.name,
+ buttons: this.addNew.buttons
+ },
add_new_text: this.addNew.text,
+ new_text: this.addNew.new_text,
selectOptions: this.options,
real_model: this.model,
add_new_html: '',
form: {},
loading: false,
+ new_options: false,
}
},
+ created() {
+ this.new_options = {};
+ },
+
mounted() {
this.real_model = this.value;
@@ -601,7 +661,7 @@ export default {
},
addInline(value) {
- axios.post(this.add_new.path, {
+ window.axios.post(this.add_new.path, {
'_token': window.Laravel.csrfToken,
'type': 'inline',
field: this.add_new.field,
@@ -612,6 +672,7 @@ export default {
this.selectOptions = [];
this.selectOptions.push(response.data.data);
+ this.new_options[response.data.data.id] = response.data.data.id;
this.real_model = response.data.data.id;
this.change();
@@ -631,9 +692,9 @@ export default {
onModal(value) {
let add_new = this.add_new;
- axios.get(this.add_new.path)
+ window.axios.get(this.add_new.path)
.then(response => {
- add_new.status = true;
+ add_new.show = true;
add_new.html = response.data.html;
if (this.title) {
@@ -644,13 +705,14 @@ export default {
this.add_new_html = Vue.component('add-new-component', function (resolve, reject) {
resolve({
- template: '
',
+ template: '',
components: {
AkauntingModalAddNew,
AkauntingRadioGroup,
AkauntingSelect,
AkauntingModal,
+ AkauntingMoney,
AkauntingDate,
AkauntingRecurring,
[ColorPicker.name]: ColorPicker,
@@ -665,6 +727,10 @@ export default {
methods: {
onSubmit(event) {
this.$emit('submit', event);
+ },
+
+ onCancel(event) {
+ this.$emit('cancel', event);
}
}
})
@@ -681,9 +747,11 @@ export default {
onSubmit(event) {
this.form = event;
+ this.loading = true;
+
let data = this.form.data();
- FormData.prototype.appendRecursive = function(data, wrapper = null) {
+ FormData.prototype.appendRecursive = function(data, wrapper = null) {
for(var name in data) {
if (wrapper) {
if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
@@ -719,11 +787,15 @@ export default {
if (response.data.success) {
this.selectOptions[response.data.data.id] = response.data.data['name'];
+ this.new_options[response.data.data.id] = response.data.data['name'];
this.real_model = response.data.data.id.toString();
this.change();
- //this.add_new.status = false;
+ //this.add_new.show = false;
+
+ this.add_new.html = '';
+ this.add_new_html = null;
}
})
.catch(error => {
@@ -734,6 +806,16 @@ export default {
this.method_show_html = error.message;
});
},
+
+ onCancel() {
+ this.add_new.show = false;
+ this.add_new.html = null;
+ this.add_new_html = null;
+ },
+
+ addModal() {
+
+ },
},
watch: {
@@ -803,4 +885,11 @@ export default {
.el-select__footer div span {
margin-left: 5px;
}
+
+ .badge-resize {
+ float: right;
+ margin-top: -32px;
+ margin-right: 35px;
+ position: relative;
+ }