|
a |
|
b/web-app/client/x.vue |
|
|
1 |
<template> |
|
|
2 |
<div> |
|
|
3 |
<div class="regpatient" style="height: 680px;"> |
|
|
4 |
<h1 >REGISTER NEW PATIENT</h1> |
|
|
5 |
<form @submit="fs" enctype=multipart/form-data> |
|
|
6 |
<ul> |
|
|
7 |
<li> |
|
|
8 |
<label for="fname" class="label" >Name:</label> |
|
|
9 |
<input type="text" v-model="patientname" id="fname" name="patientname" class="inputfield" required><br><br> |
|
|
10 |
</li> |
|
|
11 |
<li> |
|
|
12 |
<label for="fname" class="label">age:</label> |
|
|
13 |
<input type="text" v-model="age" id="fname" name="age" class="inputfield"><br><br> |
|
|
14 |
</li> |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
<li> |
|
|
18 |
<label for="fname" class="label">Adhar no:</label> |
|
|
19 |
<input type="text" v-model="patientadno" id="fname" name="patientadno" class="inputfield"><br><br> |
|
|
20 |
</li> |
|
|
21 |
|
|
|
22 |
<li> |
|
|
23 |
<label for="fname" class="label">Ph no:</label> |
|
|
24 |
<input type="text" v-model="phno" id="fname" name="phno" class="inputfield"><br><br> |
|
|
25 |
</li> |
|
|
26 |
|
|
|
27 |
<!-- <li> |
|
|
28 |
<label for="fname" class="label upload">Upload prescription:</label> |
|
|
29 |
<input type="file" id="myFile" name="reportt" class="inputfield" ><br><br> |
|
|
30 |
</li> --> |
|
|
31 |
|
|
|
32 |
<li> |
|
|
33 |
<input type="submit" value="Submit" name="patient" class="signup"> |
|
|
34 |
</li> |
|
|
35 |
</ul> |
|
|
36 |
</form> |
|
|
37 |
|
|
|
38 |
</div> |
|
|
39 |
<vue-instant-loading-spinner ref="Spinner"></vue-instant-loading-spinner> |
|
|
40 |
</div> |
|
|
41 |
</template> |
|
|
42 |
|
|
|
43 |
<script> |
|
|
44 |
import PostsService from "@/services/apiService"; |
|
|
45 |
import VueInstantLoadingSpinner from "vue-instant-loading-spinner/src/components/VueInstantLoadingSpinner.vue"; |
|
|
46 |
export default { |
|
|
47 |
name: "regpatient", |
|
|
48 |
data (){ |
|
|
49 |
return{ |
|
|
50 |
patientname: '', |
|
|
51 |
age: '', |
|
|
52 |
patientadno: '', |
|
|
53 |
phno: '', |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
} |
|
|
57 |
}, |
|
|
58 |
components: { |
|
|
59 |
VueInstantLoadingSpinner |
|
|
60 |
}, |
|
|
61 |
methods: { |
|
|
62 |
fs(e) |
|
|
63 |
{ |
|
|
64 |
e.preventDefault(); |
|
|
65 |
console.log("submit pressed") |
|
|
66 |
const newTodo = { |
|
|
67 |
name: this.patientname, |
|
|
68 |
age : this.age , |
|
|
69 |
adharNo : this.patientadno , |
|
|
70 |
phNo : this.phno , |
|
|
71 |
|
|
|
72 |
} |
|
|
73 |
console.log(newTodo) |
|
|
74 |
//construct object and emmit to parent |
|
|
75 |
// this.$emit('add-todo', newTodo); |
|
|
76 |
axios.post(`http://jsonplaceholder.typicode.com/posts`, { |
|
|
77 |
newTodo |
|
|
78 |
}) |
|
|
79 |
.then(response => {}) |
|
|
80 |
.catch(e => { |
|
|
81 |
this.errors.push(e) |
|
|
82 |
}) |
|
|
83 |
}, |
|
|
84 |
|
|
|
85 |
} |
|
|
86 |
} |
|
|
87 |
</script> |
|
|
88 |
|
|
|
89 |
<style scoped> |
|
|
90 |
</style> |