import { ModelListSelect } from "vue-search-select";
export default { components: { ModelListSelect,},
data() { return { Booksarray: [],
form: new Form({
id: "",
book_id: "",
shell_id: "",
purchase_id: "",
quantity: "",
unitprice: "",
supplydate: ""
}),
}
,methods: { loadStocks() {
// $(".hideme").hide();
// if (this.$gate.isAdmin() || this.$gate.isUser()) {
this.$Progress.start(); // NProgress.start();
axios.get("api/Stock").then(({ data }) => (this.Stocks = data));
axios.get("api/getAllStock").then(({ data }) => (this.data = data));
axios.get("api/getAllBook").then(({ data }) => (this.Books = data));
axios.get("api/getAllShell").then(({ data }) => (this.Shells = data));
axios.get("api/getAllBook").then(({ data }) => (this.Booksarray = data));
axios
.get("api/getAllPurchase")
.then(({ data }) => (this.Purchases = data));
this.alert();
this.$Progress.finish();
// }
// NProgress.done();
},},
created() {
Fire.$on("searching", () => {
let query = this.search;
axios
.get("api/searchStock?q=" + query)
.then(data => {
this.Stocks = data.data;
})
.catch(() => {});
});
this.loadStocks();
// load the page after 3 secound
Fire.$on("refreshPage", () => {
this.loadStocks();
});
}