pull/1/head
parent
0b300a457b
commit
9f5bd59065
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="hello">
|
||||
<h1>{{ msg }}</h1>
|
||||
<h2>Essential Links</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
href="https://vuejs.org"
|
||||
target="_blank"
|
||||
>
|
||||
Core Docs
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://forum.vuejs.org"
|
||||
target="_blank"
|
||||
>
|
||||
Forum
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://chat.vuejs.org"
|
||||
target="_blank"
|
||||
>
|
||||
Community Chat
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://twitter.com/vuejs"
|
||||
target="_blank"
|
||||
>
|
||||
Twitter
|
||||
</a>
|
||||
</li>
|
||||
<br>
|
||||
<li>
|
||||
<a
|
||||
href="http://vuejs-templates.github.io/webpack/"
|
||||
target="_blank"
|
||||
>
|
||||
Docs for This Template
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Ecosystem</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
href="http://router.vuejs.org/"
|
||||
target="_blank"
|
||||
>
|
||||
vue-router
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="http://vuex.vuejs.org/"
|
||||
target="_blank"
|
||||
>
|
||||
vuex
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="http://vue-loader.vuejs.org/"
|
||||
target="_blank"
|
||||
>
|
||||
vue-loader
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://github.com/vuejs/awesome-vue"
|
||||
target="_blank"
|
||||
>
|
||||
awesome-vue
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HelloWorld',
|
||||
data () {
|
||||
return {
|
||||
msg: 'Welcome to Your Vue.js App'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
h1, h2 {
|
||||
font-weight: normal;
|
||||
}
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
li {
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="box">
|
||||
<nav-menu></nav-menu>
|
||||
<router-view/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavMenu from './common/NavMenu'
|
||||
export default {
|
||||
name: 'Home',
|
||||
components: {NavMenu}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,13 @@
|
||||
package com.example.hosdata;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class HosdataApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HosdataApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,20 @@
|
||||
package com.example.hosdata.controller;
|
||||
|
||||
import com.example.hosdata.pojo.Doctor;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.service.DoctorService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DoctorController {
|
||||
@Autowired
|
||||
DoctorService doctorService;
|
||||
|
||||
@CrossOrigin
|
||||
@GetMapping("/api/register")
|
||||
public List<Doctor> listByDepartment(String department) throws Exception {
|
||||
return doctorService.listByDepartment(department);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.example.hosdata.controller;
|
||||
|
||||
import com.example.hosdata.pojo.Docyz;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.service.DocyzService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class DocyzController {
|
||||
@Autowired
|
||||
DocyzService docService;
|
||||
|
||||
@CrossOrigin
|
||||
@PostMapping("/api/docrecords")
|
||||
public Docyz addOrUpdate(@RequestBody Docyz doc) throws Exception {
|
||||
docService.addOrUpdate(doc);
|
||||
return doc;
|
||||
}
|
||||
|
||||
/* @CrossOrigin
|
||||
@GetMapping("/api/docrecords")
|
||||
public List<Docyz> listdoctorname() throws Exception {
|
||||
return docService.listBydoctorname();
|
||||
}*/
|
||||
|
||||
@CrossOrigin
|
||||
@GetMapping("/api/treatment")
|
||||
public List<Docyz> listghname() throws Exception {
|
||||
return docService.listByghname();
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.example.hosdata.controller;
|
||||
|
||||
import com.example.hosdata.pojo.Information;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.service.DocyzService;
|
||||
import com.example.hosdata.service.InService;
|
||||
import com.example.hosdata.service.RegisterService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class InController {
|
||||
@Autowired
|
||||
InService inService;
|
||||
|
||||
@CrossOrigin
|
||||
@GetMapping("/api/setting")
|
||||
public List<Information> listuser() throws Exception {
|
||||
return inService.listbyuser();
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@PostMapping("/api/setting")
|
||||
public Information Update(@RequestBody Information information) throws Exception {
|
||||
inService.update(information);
|
||||
return information;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.example.hosdata.controller;
|
||||
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.pojo.User;
|
||||
import com.example.hosdata.result.Result;
|
||||
import com.example.hosdata.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
UserService userService;
|
||||
|
||||
@CrossOrigin
|
||||
@PostMapping(value = "/api/login")
|
||||
@ResponseBody
|
||||
public Result login(@RequestBody User requestUser) {
|
||||
String username = requestUser.getUsername();
|
||||
username = HtmlUtils.htmlEscape(username);
|
||||
String id = requestUser.getId();
|
||||
id = HtmlUtils.htmlEscape(id);
|
||||
String realname = requestUser.getRealname();
|
||||
realname = HtmlUtils.htmlEscape(realname);
|
||||
|
||||
User user = userService.getall(id,username, requestUser.getPassword(),realname);
|
||||
//String id=requestUser.getId();
|
||||
RegisterService.username = username;
|
||||
DocyzService.ghname = realname;
|
||||
DocyzService.doctorname = realname;
|
||||
ShopService.myzh = username;
|
||||
InService.userna = username;
|
||||
if (null == user) {
|
||||
return new Result(400);
|
||||
} else if(id.equals("医务人员")){
|
||||
return new Result(100);
|
||||
} else if(id.equals("管理员")){
|
||||
return new Result(300);
|
||||
}else {
|
||||
return new Result(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.example.hosdata.controller;
|
||||
|
||||
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.service.DocyzService;
|
||||
import com.example.hosdata.service.RegisterService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class RegisterController {
|
||||
@Autowired
|
||||
RegisterService Reservice;
|
||||
|
||||
@CrossOrigin
|
||||
@GetMapping("/api/records")
|
||||
public List<RegisterRecord> list() throws Exception {
|
||||
return Reservice.listByname();
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@GetMapping("/api/docrecords")
|
||||
public List<RegisterRecord> listdoc() throws Exception {
|
||||
return Reservice.list();
|
||||
}
|
||||
|
||||
/*@CrossOrigin
|
||||
@PostMapping("/api/docrecords")
|
||||
public List<RegisterRecord> searchResult(@RequestParam(value="doctor",required=false) String doctor) {
|
||||
return Reservice.Search(doctor);
|
||||
}*/
|
||||
|
||||
|
||||
@CrossOrigin
|
||||
@PostMapping("/api/register")
|
||||
public RegisterRecord addOrUpdate(@RequestBody RegisterRecord record) throws Exception {
|
||||
Reservice.addOrUpdate(record);
|
||||
return record;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.example.hosdata.controller;
|
||||
|
||||
import com.example.hosdata.pojo.Medicine;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.pojo.ShopRecord;
|
||||
import com.example.hosdata.service.ShopService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class ShopController {
|
||||
|
||||
@Autowired
|
||||
ShopService shopService;
|
||||
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
@GetMapping(value = "/api/shop")
|
||||
public List<Medicine> shop() {
|
||||
return shopService.MedicineList();
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@PostMapping("/api/shop")
|
||||
public ShopRecord Add(@RequestBody ShopRecord SR) throws Exception {
|
||||
shopService.addOrUpdate(SR);
|
||||
return SR;
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@PostMapping("/api/Admin")
|
||||
public Medicine Update(@RequestBody Medicine medicine) throws Exception {
|
||||
shopService.Update(medicine);
|
||||
return medicine;
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@GetMapping("/api/shoprecords")
|
||||
public List<ShopRecord> listbymyzh() throws Exception {
|
||||
return shopService.listBymyzh();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.example.hosdata.controller;
|
||||
import com.example.hosdata.pojo.Information;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.pojo.Zhuce;
|
||||
import com.example.hosdata.service.DocyzService;
|
||||
import com.example.hosdata.service.InService;
|
||||
import com.example.hosdata.service.RegisterService;
|
||||
|
||||
import com.example.hosdata.service.ZhuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class ZhuController {
|
||||
@Autowired
|
||||
ZhuService zhuService;
|
||||
|
||||
@CrossOrigin
|
||||
@PostMapping("/api/zhu")
|
||||
public Zhuce add(@RequestBody Zhuce zhuce) throws Exception {
|
||||
zhuService.add(zhuce);
|
||||
return zhuce;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.example.hosdata.dao;
|
||||
|
||||
import com.example.hosdata.pojo.Docyz;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DocDAO extends JpaRepository<Docyz,Integer> {
|
||||
List<Docyz> findByGhname(String ghname);
|
||||
|
||||
List<Docyz> findByDoctorname(String doctorname);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.example.hosdata.dao;
|
||||
import java.util.*;
|
||||
import com.example.hosdata.pojo.Doctor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface DoctorDAO extends JpaRepository<Doctor,Integer> {
|
||||
List<Doctor> findAllByDepartment(String department);
|
||||
List<Doctor> findAllByDoctorname(String doctorname);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.example.hosdata.dao;
|
||||
|
||||
import com.example.hosdata.pojo.Information;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.pojo.User;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
public interface InDAO extends JpaRepository<Information,Integer>{
|
||||
List<Information> findByUsername(String username);
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.example.hosdata.dao;
|
||||
|
||||
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RegisterDAO extends JpaRepository<RegisterRecord,Integer> {
|
||||
List<RegisterRecord> findByUsername(String username);
|
||||
|
||||
List<RegisterRecord> findByDoctor(String doctor);
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.example.hosdata.dao;
|
||||
|
||||
import com.example.hosdata.pojo.Medicine;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopDAO extends JpaRepository<Medicine,Integer> {
|
||||
List<Medicine> findAllByPlace(String place);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.example.hosdata.dao;
|
||||
|
||||
import com.example.hosdata.pojo.Medicine;
|
||||
import com.example.hosdata.pojo.ShopRecord;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
public interface ShopRecordDAO extends JpaRepository<ShopRecord,Integer> {
|
||||
List<ShopRecord> findByMyzh(String myzh);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.example.hosdata.dao;
|
||||
|
||||
import com.example.hosdata.pojo.Information;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.pojo.User;
|
||||
import com.example.hosdata.pojo.Zhuce;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
public interface ZhuDAO extends JpaRepository<Zhuce,Integer>{
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import router from './router'
|
||||
import ElementUI from 'element-ui'
|
||||
import 'element-ui/lib/theme-chalk/index.css'
|
||||
|
||||
var axios = require('axios')
|
||||
axios.defaults.baseURL = 'http://localhost:8443/api'
|
||||
Vue.prototype.$axios = axios
|
||||
Vue.config.productionTip = false
|
||||
|
||||
Vue.use(ElementUI)
|
||||
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#app',
|
||||
render: h => h(App),
|
||||
router,
|
||||
components: { App },
|
||||
template: '<App/>'
|
||||
})
|
@ -0,0 +1,40 @@
|
||||
package com.example.hosdata.pojo;
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@Entity
|
||||
@Table(name = "doctor")
|
||||
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
|
||||
|
||||
public class Doctor {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "doctorid")
|
||||
int doctorid;
|
||||
|
||||
String doctorname;
|
||||
String department;
|
||||
String worktime;
|
||||
|
||||
public String getDoctorname() {
|
||||
return doctorname;
|
||||
}
|
||||
public void setDoctorname(String doctorname) {
|
||||
this.doctorname = doctorname;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
public void setDpartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getWorktime() {
|
||||
return worktime;
|
||||
}
|
||||
public void setWorktime(String worktime) {
|
||||
this.worktime = worktime;
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.example.hosdata.pojo;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@Entity
|
||||
@Table(name = "docyz")
|
||||
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
|
||||
|
||||
public class Docyz {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "idnumber")
|
||||
int idnumber;
|
||||
|
||||
String doctorname;
|
||||
|
||||
String ghname;
|
||||
int yyh;
|
||||
String zhengz;
|
||||
String zhend;
|
||||
String liaoc;
|
||||
|
||||
|
||||
public int getIdnumber() {
|
||||
return idnumber;
|
||||
}
|
||||
public void setIdnumber(int idnumber) {
|
||||
this.idnumber = idnumber;
|
||||
}
|
||||
|
||||
public String getDoctorname() {
|
||||
return doctorname;
|
||||
}
|
||||
public void setDoctorname(String doctorname) {
|
||||
this.doctorname = doctorname;
|
||||
}
|
||||
|
||||
public String getGhname() {
|
||||
return ghname;
|
||||
}
|
||||
public void setGhname(String ghname) {
|
||||
this.ghname = ghname;
|
||||
}
|
||||
|
||||
public int getYyh() {
|
||||
return yyh;
|
||||
}
|
||||
public void setYyh(int yyh) {
|
||||
this.yyh = yyh;
|
||||
}
|
||||
|
||||
public String getZhengz() {
|
||||
return zhengz;
|
||||
}
|
||||
public void setZhengz(String zhengz) {
|
||||
this.zhengz = zhengz;
|
||||
}
|
||||
|
||||
public String getZhend() {
|
||||
return zhend;
|
||||
}
|
||||
public void setZhend(String zhend) {
|
||||
this.zhend = zhend;
|
||||
}
|
||||
|
||||
public String getLiaoc() {
|
||||
return liaoc;
|
||||
}
|
||||
public void setLiaoc(String liaoc) {
|
||||
this.liaoc = liaoc;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
package com.example.hosdata.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "user")
|
||||
@JsonIgnoreProperties({"handler","hibernateLazyInitializer"})
|
||||
|
||||
public class Information {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
String id;
|
||||
|
||||
String username;
|
||||
String password;
|
||||
|
||||
String realname;
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRealname() {
|
||||
return realname;
|
||||
}
|
||||
|
||||
public void setRealname(String realname) {
|
||||
this.realname = realname;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.example.hosdata.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "medicine")
|
||||
@JsonIgnoreProperties({"handler","hibernateLazyInitializer"})
|
||||
|
||||
public class Medicine {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
int id;
|
||||
|
||||
String name;
|
||||
int number;
|
||||
double price;
|
||||
|
||||
String place;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public int getNumber() {return number;}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
|
||||
public double getPrice() {return price;}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getPlace() {return place;}
|
||||
|
||||
public void setPlace(String place) {
|
||||
this.place = place;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.example.hosdata.pojo;
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@Entity
|
||||
@Table(name = "register")
|
||||
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
|
||||
|
||||
public class RegisterRecord {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "idnum")
|
||||
int idnum;
|
||||
|
||||
String name;
|
||||
String department;
|
||||
String major;
|
||||
String time;
|
||||
String doctor;
|
||||
String username;
|
||||
|
||||
|
||||
|
||||
public int getIdnum() {
|
||||
return idnum;
|
||||
}
|
||||
public void setIdnum(int idnum) {
|
||||
this.idnum = idnum;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getMajor() {
|
||||
return major;
|
||||
}
|
||||
public void setMajor(String major) {
|
||||
this.major = major;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getDoctor() {
|
||||
return doctor;
|
||||
}
|
||||
public void setDoctor(String doctor) {
|
||||
this.doctor = doctor;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.example.hosdata.pojo;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@Entity
|
||||
@Table(name = "shoprecord")
|
||||
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
|
||||
|
||||
public class ShopRecord {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "mid")
|
||||
int mid;
|
||||
|
||||
String medicine;
|
||||
int number;
|
||||
|
||||
String myzh;
|
||||
|
||||
public String getMedicine() {
|
||||
return medicine;
|
||||
}
|
||||
public void setMedicine(String medicine) {
|
||||
this.medicine = medicine;
|
||||
}
|
||||
|
||||
public int getNumber() {return number;}
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public int getMid() {
|
||||
return mid;
|
||||
}
|
||||
public void setMid(int mid) {
|
||||
this.mid = mid;
|
||||
}
|
||||
|
||||
public String getMyzh() {
|
||||
return myzh;
|
||||
}
|
||||
public void setMyzh(String myzh) {
|
||||
this.myzh = myzh;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.example.hosdata.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "user")
|
||||
@JsonIgnoreProperties({"handler","hibernateLazyInitializer"})
|
||||
|
||||
public class User {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
String id;
|
||||
|
||||
String username;
|
||||
String password;
|
||||
|
||||
String realname;
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRealname() {
|
||||
return realname;
|
||||
}
|
||||
|
||||
public void setRealname(String realname) {
|
||||
this.realname = realname;
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.example.hosdata.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "user")
|
||||
@JsonIgnoreProperties({"handler","hibernateLazyInitializer"})
|
||||
|
||||
public class Zhuce {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
String id;
|
||||
|
||||
String username;
|
||||
String password;
|
||||
|
||||
String realname;
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRealname() {
|
||||
return realname;
|
||||
}
|
||||
|
||||
public void setRealname(String realname) {
|
||||
this.realname = realname;
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<el-form class="login-container" label-position="left"
|
||||
label-width="0px" :data="RegisterForm">
|
||||
<h3 class="login_title">填写预约挂号信息</h3>
|
||||
<el-form-item>
|
||||
<el-input type="text" v-model="RegisterForm.username" prop="username"
|
||||
auto-complete="off" placeholder="请输入账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="text" v-model="RegisterForm.name" prop="name"
|
||||
auto-complete="off" placeholder="请输入患者姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="RegisterForm.major" prop="major" filterable placeholder="请选择学院">
|
||||
<el-option label="计算机学院" value="计算机学院"></el-option>
|
||||
<el-option label="理学院" value="理学院"></el-option>
|
||||
<el-option label="法学院" value="法学院"></el-option>
|
||||
<el-option label="飞行学院" value="飞行学院"></el-option>
|
||||
<el-option label="经济与管理学院" value="经济与管理学院"></el-option>
|
||||
<el-option label="航空工程学院" value="航空工程学院"></el-option>
|
||||
<el-option label="外国语学院" value="外国语学院"></el-option>
|
||||
<el-option label="交通工程学院" value="交通工程学院"></el-option>
|
||||
<el-option label="电动学院" value="电动学院"></el-option>
|
||||
<el-option label="空管学院" value="空管学院"></el-option>
|
||||
<el-option label="中欧学院" value="中欧学院"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="RegisterForm.department" prop="department" filterable placeholder="请选择科室">
|
||||
<el-option v-for="item in department" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="RegisterForm.doctor" prop="doctor" filterable placeholder="请选择主治医师">
|
||||
<el-option v-if="RegisterForm.department=='内科'" v-for="item in doctor.slice(0,3)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.department=='外科'" v-for="item in doctor.slice(3,5)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.department=='眼科'" v-for="item in doctor.slice(5,7)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.department=='耳鼻喉科'" v-for="item in doctor.slice(7,9)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.department=='口腔科'" v-for="item in doctor.slice(9,11)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.department=='皮肤科'" v-for="item in doctor.slice(11)" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="RegisterForm.time" prop="time" filterable placeholder="请选择就诊时间">
|
||||
<el-option v-if="RegisterForm.doctor=='李明'" v-for="item in time.slice(0,7)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='王明'" v-for="item in time.slice(9,16)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='张伟'" v-for="item in time.slice(7,18)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='吴尚洋'" v-for="item in time.slice(2,9)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='王雨辰'" v-for="item in time.slice(5,15)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='曹时嘉'" v-for="item in time.slice(11,20)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='程学成'" v-for="item in time.slice(15)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='郑浩睿'" v-for="item in time.slice(6,14)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='李江涛'" v-for="item in time.slice(11,18)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='李飞翔'" v-for="item in time.slice(0,5)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='吴凯'" v-for="item in time.slice(1,7)" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-if="RegisterForm.doctor=='侯兴禹'" v-for="item in time.slice(8,13)" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%;background: #505458;border: none" @click="onSubmit">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'RegisterIndex',
|
||||
data () {
|
||||
return {
|
||||
department: ['内科', '外科', '眼科', '耳鼻喉科', '口腔科', '皮肤科'],
|
||||
doctor: ['李明', '王明', '张伟', '吴尚洋', '王雨辰', '曹时嘉', '程学成', '郑浩睿', '李江涛', '李飞翔', '吴凯', '侯兴禹'],
|
||||
time: ['星期一上午9:00', '星期一上午10:00', '星期一下午14:00', '星期一上午15:00', '星期二上午8:00', '星期二上午10:00', '星期二下午14:00', '星期二上午16:00',
|
||||
'星期三上午9:00', '星期三上午10:00', '星期三下午14:00', '星期三上午15:00', '星期四上午9:00', '星期四上午10:00', '星期四下午14:00', '星期四上午16:00',
|
||||
'星期五上午8:00', '星期五上午10:00', '星期五下午14:00', '星期五上午15:00'],
|
||||
RegisterForm: {
|
||||
username: '',
|
||||
name: '',
|
||||
major: '',
|
||||
department: '',
|
||||
doctor: '',
|
||||
time: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit () {
|
||||
this.$axios
|
||||
.post('/register', {
|
||||
username: this.RegisterForm.username,
|
||||
name: this.RegisterForm.name,
|
||||
major: this.RegisterForm.major,
|
||||
department: this.RegisterForm.department,
|
||||
doctor: this.RegisterForm.doctor,
|
||||
time: this.RegisterForm.time
|
||||
}).then(resp => {
|
||||
if (resp && resp.status === 200) {
|
||||
this.$emit('onSubmit')
|
||||
}
|
||||
})
|
||||
this.$message({
|
||||
message: '挂号成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.$router.replace({path: '/index'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.login-container {
|
||||
border-radius: 15px;
|
||||
background-clip: padding-box;
|
||||
margin: 80px auto;
|
||||
width: 350px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
background: #ffffff;
|
||||
border: 1px solid #cac6c6;
|
||||
box-shadow: 0 0 25px #ffffff;
|
||||
}
|
||||
|
||||
.login_title {
|
||||
margin: 0px auto 40px auto;
|
||||
text-align: center;
|
||||
color: #505458;
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,19 @@
|
||||
package com.example.hosdata.result;
|
||||
|
||||
public class Result {
|
||||
//响应码
|
||||
private int code;
|
||||
|
||||
public Result(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import AppIndex from '../components/home/AppIndex'
|
||||
import Login from '../components/Login'
|
||||
import Home from '../components/Home'
|
||||
import RegisterIndex from '../components/register/RegisterIndex'
|
||||
import ShopIndex from '../components/shop/ShopIndex'
|
||||
import RecordIndex from '../components/records/RecordIndex'
|
||||
import AdvanceIndex from '../components/advance/AdvanceIndex'
|
||||
import DocrecordIndex from '../components/docrecords/DocrecordIndex'
|
||||
import TreatmentIndex from '../components/treatment/TreatmentIndex'
|
||||
import ShoprecordIndex from '../components/shoprecords/ShoprecordIndex'
|
||||
import SettingIndex from '../components/setting/SettingIndex'
|
||||
import ZhuceIndex from '../components/zhu/ZhuceIndex'
|
||||
import AdminIndex from '../components/Admin/AdminIndex'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
export default new Router({
|
||||
routes: [
|
||||
{
|
||||
path: '/home',
|
||||
name: 'Home',
|
||||
component: Home,
|
||||
redirect: '/index',
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
name: 'AppIndex',
|
||||
component: AppIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
name: 'RegisterIndex',
|
||||
component: RegisterIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/shop',
|
||||
name: 'ShopIndex',
|
||||
component: ShopIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/records',
|
||||
name: 'RecordIndex',
|
||||
component: RecordIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/advance',
|
||||
name: 'AdvanceIndex',
|
||||
component: AdvanceIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/treatment',
|
||||
name: 'TreatmentIndex',
|
||||
component: TreatmentIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/shoprecords',
|
||||
name: 'ShoprecordIndex',
|
||||
component: ShoprecordIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/setting',
|
||||
name: 'SettingIndex',
|
||||
component: SettingIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/docrecords',
|
||||
name: 'DocrecordIndex',
|
||||
component: DocrecordIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'Login',
|
||||
component: Login
|
||||
},
|
||||
{
|
||||
path: '/zhu',
|
||||
name: 'ZhuceIndex',
|
||||
component: ZhuceIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/Admin',
|
||||
name: 'AdminIndex',
|
||||
component: AdminIndex,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
@ -0,0 +1,21 @@
|
||||
package com.example.hosdata.service;
|
||||
|
||||
import com.example.hosdata.dao.DoctorDAO;
|
||||
import com.example.hosdata.pojo.Doctor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DoctorService {
|
||||
@Autowired
|
||||
DoctorDAO doctorDAO;
|
||||
|
||||
public List<Doctor> listByDepartment(String department) {
|
||||
return doctorDAO.findAllByDepartment(department);
|
||||
}
|
||||
|
||||
public List<Doctor> listworktime(String doctor) {
|
||||
return doctorDAO.findAllByDoctorname(doctor);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.example.hosdata.service;
|
||||
|
||||
import com.example.hosdata.dao.DocDAO;
|
||||
import com.example.hosdata.pojo.Docyz;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DocyzService {
|
||||
@Autowired
|
||||
DocDAO docDAO;
|
||||
static public String ghname;
|
||||
static public String doctorname;
|
||||
|
||||
public void addOrUpdate(Docyz doc) {
|
||||
docDAO.save(doc);
|
||||
}
|
||||
|
||||
public List<Docyz> listByghname() {
|
||||
return docDAO.findByGhname(this.ghname);
|
||||
}
|
||||
|
||||
public List<Docyz> listBydoctorname() {
|
||||
return docDAO.findByDoctorname(this.doctorname);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.example.hosdata.service;
|
||||
|
||||
import com.example.hosdata.dao.InDAO;
|
||||
import com.example.hosdata.dao.RegisterDAO;
|
||||
import com.example.hosdata.pojo.Information;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class InService {
|
||||
@Autowired
|
||||
InDAO inDAO;
|
||||
static public String userna;
|
||||
|
||||
public List<Information> listbyuser() {
|
||||
return inDAO.findByUsername(userna);
|
||||
}
|
||||
|
||||
public void update(Information information) {
|
||||
inDAO.save(information);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.example.hosdata.service;
|
||||
|
||||
import com.example.hosdata.dao.RegisterDAO;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class RegisterService {
|
||||
@Autowired
|
||||
RegisterDAO reDAO;
|
||||
static public String username;
|
||||
|
||||
public List<RegisterRecord> listByname() {
|
||||
return reDAO.findByUsername(this.username);
|
||||
}
|
||||
|
||||
public void addOrUpdate(RegisterRecord record) {
|
||||
reDAO.save(record);
|
||||
}
|
||||
|
||||
public List<RegisterRecord> list() {
|
||||
return reDAO.findAll();
|
||||
}
|
||||
|
||||
public List<RegisterRecord> Search(String doctor) {
|
||||
return reDAO.findByDoctor(doctor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.example.hosdata.service;
|
||||
|
||||
import com.example.hosdata.dao.ShopDAO;
|
||||
import com.example.hosdata.dao.ShopRecordDAO;
|
||||
import com.example.hosdata.pojo.Medicine;
|
||||
import com.example.hosdata.pojo.ShopRecord;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ShopService {
|
||||
public String place = "药房";
|
||||
|
||||
static public String myzh;
|
||||
@Autowired
|
||||
ShopDAO shopDAO;
|
||||
|
||||
@Autowired
|
||||
ShopRecordDAO shopRecordDAO;
|
||||
|
||||
public List<Medicine> MedicineList(){
|
||||
return shopDAO.findAllByPlace(place);
|
||||
}
|
||||
|
||||
public void addOrUpdate(ShopRecord shopRecord) {
|
||||
shopRecordDAO.save(shopRecord);
|
||||
}
|
||||
|
||||
public void Update(Medicine medicine) {
|
||||
medicine.setPlace("药房");
|
||||
shopDAO.save(medicine);
|
||||
}
|
||||
|
||||
public List<ShopRecord> listBymyzh() {
|
||||
return shopRecordDAO.findByMyzh(this.myzh);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.example.hosdata.service;
|
||||
|
||||
import com.example.hosdata.dao.InDAO;
|
||||
import com.example.hosdata.dao.RegisterDAO;
|
||||
import com.example.hosdata.dao.ZhuDAO;
|
||||
import com.example.hosdata.pojo.Information;
|
||||
import com.example.hosdata.pojo.RegisterRecord;
|
||||
import com.example.hosdata.pojo.Zhuce;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ZhuService {
|
||||
@Autowired
|
||||
ZhuDAO zhuDAO;
|
||||
|
||||
public void add(Zhuce zhuce) {
|
||||
zhuDAO.save(zhuce);
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<el-table
|
||||
:data="serecords"
|
||||
style="width: 100%"
|
||||
:model="ruleForm"
|
||||
class="se">
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="登录身份"
|
||||
v-model="ruleForm.id"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="username"
|
||||
v-model="ruleForm.username"
|
||||
label="用户名"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="password"
|
||||
label="密码"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="realname"
|
||||
v-model="ruleForm.realname"
|
||||
label="姓名"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="180">
|
||||
<el-button type="text" @click="dialogVisible = true">修改</el-button>
|
||||
<el-dialog title="修改密码" :visible.sync="dialogVisible" append-to-body>
|
||||
<el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm">
|
||||
<el-form-item label="身份" prop="id">
|
||||
<el-input v-model="ruleForm.id" autocomplete="off" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="realname">
|
||||
<el-input v-model="ruleForm.realname" autocomplete="off" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="账号" prop="username">
|
||||
<el-input v-model="ruleForm.username" autocomplete="off" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="pass">
|
||||
<el-input type="password" v-model="ruleForm.pass" autocomplete="off" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="checkPass">
|
||||
<el-input type="password" v-model="ruleForm.checkPass" autocomplete="off" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SettingIndex',
|
||||
data () {
|
||||
var validatePass = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请输入密码'))
|
||||
} else {
|
||||
if (this.ruleForm.checkPass !== '') {
|
||||
this.$refs.ruleForm.validateField('checkPass')
|
||||
}
|
||||
callback()
|
||||
}
|
||||
}
|
||||
var validatePass2 = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请再次输入密码'))
|
||||
} else if (value !== this.ruleForm.pass) {
|
||||
callback(new Error('两次输入密码不一致!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
serecords: [],
|
||||
dialogVisible: false,
|
||||
formLabelWidth: '100px',
|
||||
ruleForm: {
|
||||
id: '',
|
||||
username: '',
|
||||
realname: '',
|
||||
pass: '',
|
||||
checkPass: ''
|
||||
},
|
||||
rules: {
|
||||
pass: [
|
||||
{ validator: validatePass, trigger: 'blur' }
|
||||
],
|
||||
checkPass: [
|
||||
{ validator: validatePass2, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.loadSerecords()
|
||||
},
|
||||
methods: {
|
||||
loadSerecords () {
|
||||
var _this = this
|
||||
this.$axios.get('/setting').then(resp => {
|
||||
if (resp && resp.status === 200) {
|
||||
_this.serecords = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
submitForm (formName) {
|
||||
this.$axios
|
||||
.post('/setting', {
|
||||
id: this.ruleForm.id,
|
||||
username: this.ruleForm.username,
|
||||
realname: this.ruleForm.realname,
|
||||
password: this.ruleForm.checkPass
|
||||
}).then(resp => {
|
||||
if (resp && resp.status === 200) {
|
||||
this.$emit('submitForm')
|
||||
}
|
||||
})
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.$router.replace({path: '/login'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.se {
|
||||
position: fixed;
|
||||
margin-left: 50%;
|
||||
left: -400px;
|
||||
top: 140px;
|
||||
width: 700px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div class="sh">
|
||||
<template>
|
||||
<el-form style="width: 100%" :data="shopRecord">
|
||||
<el-form-item label="账号:">
|
||||
<el-input type="text" v-model="shopRecord.username"
|
||||
auto-complete="off" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="药品名称:">
|
||||
<el-input type="text" v-model="shopRecord.medicine"
|
||||
auto-complete="off" placeholder="药品名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<template>
|
||||
<el-table
|
||||
:data="shopResult.filter(item=>item.name===shopRecord.medicine)"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="药品名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="price"
|
||||
label="药品价格">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="number"
|
||||
label="药品数量">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
<template>
|
||||
<el-form style="width: 100%" :data="shopRecord">
|
||||
<el-input type="text" v-model="shopRecord.number"
|
||||
auto-complete="off" placeholder="购药数量"></el-input>
|
||||
</el-form>
|
||||
<el-form style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%;background: #464849;border: none" @click="onSubmit">购买</el-button>
|
||||
</el-form>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ShopIndex',
|
||||
data () {
|
||||
return {
|
||||
shopResult: [],
|
||||
shopRecord: {
|
||||
username: '',
|
||||
medicine: '',
|
||||
number: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.shop()
|
||||
},
|
||||
methods: {
|
||||
shop () {
|
||||
var _this = this
|
||||
this.$axios.get('/shop').then(resp => {
|
||||
if (resp && resp.status === 200) {
|
||||
_this.shopResult = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
onSubmit () {
|
||||
this.$axios
|
||||
.post('/shop', {
|
||||
myzh: this.shopRecord.username,
|
||||
medicine: this.shopRecord.medicine,
|
||||
number: this.shopRecord.number
|
||||
}).then(resp => {
|
||||
if (resp && resp.status === 200) {
|
||||
this.$emit('onSubmit')
|
||||
}
|
||||
})
|
||||
this.$message({
|
||||
message: '购买成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.$router.replace({path: '/shop'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.sh {
|
||||
position: fixed;
|
||||
margin-left: 50%;
|
||||
left: -200px;
|
||||
top: 160px;
|
||||
width: 400px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<el-table
|
||||
:data="shrecords"
|
||||
style="width: 100%"
|
||||
class="sh">
|
||||
<el-table-column
|
||||
prop="mid"
|
||||
label="取药号"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="medicine"
|
||||
label="药名"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="number"
|
||||
label="数量"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ShoprecordIndex',
|
||||
data () {
|
||||
return {
|
||||
shrecords: []
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.loadShrecords()
|
||||
},
|
||||
methods: {
|
||||
loadShrecords () {
|
||||
var _this = this
|
||||
this.$axios.get('/shoprecords').then(resp => {
|
||||
if (resp && resp.status === 200) {
|
||||
_this.shrecords = resp.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.sh {
|
||||
position: fixed;
|
||||
margin-left: 50%;
|
||||
left: -250px;
|
||||
top: 140px;
|
||||
width: 700px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<el-table
|
||||
:data="docyz"
|
||||
style="width: 100%"
|
||||
class="tre">
|
||||
<el-table-column
|
||||
prop="doctorname"
|
||||
label="医生姓名"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="yyh"
|
||||
label="预约号"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="ghname"
|
||||
label="挂号姓名"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="zhengz"
|
||||
label="症状"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="zhend"
|
||||
label="诊断"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="liaoc"
|
||||
label="疗程"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TreatmentIndex',
|
||||
data () {
|
||||
return {
|
||||
docyz: []
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.loaddocyz()
|
||||
},
|
||||
methods: {
|
||||
loaddocyz () {
|
||||
var _this = this
|
||||
this.$axios.get('/treatment').then(resp => {
|
||||
if (resp && resp.status === 200) {
|
||||
_this.docyz = resp.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tre {
|
||||
position: fixed;
|
||||
margin-left: 50%;
|
||||
left: -500px;
|
||||
top: 140px;
|
||||
width: 700px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<el-form class="zhuce" label-position="left"
|
||||
label-width="0px">
|
||||
<h3 class="login_title">注册新用户</h3>
|
||||
<el-form-item>
|
||||
<el-select v-model="ZhuForm.id" placeholder="请选择登录身份">
|
||||
<el-option label="普通用户" value="普通用户"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="text" v-model="ZhuForm.realname"
|
||||
auto-complete="off" placeholder="输入姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="text" v-model="ZhuForm.username"
|
||||
auto-complete="off" placeholder="输入账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="password" v-model="ZhuForm.password"
|
||||
auto-complete="off" placeholder="输入密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%;background: #505458;border: none" v-on:click="ok">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ZhuceIndex',
|
||||
data () {
|
||||
return {
|
||||
ZhuForm: {
|
||||
id: '',
|
||||
username: '',
|
||||
password: '',
|
||||
realname: ''
|
||||
},
|
||||
responseResult: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
ok () {
|
||||
this.$axios
|
||||
.post('/zhu', {
|
||||
id: this.ZhuForm.id,
|
||||
username: this.ZhuForm.username,
|
||||
realname: this.ZhuForm.realname,
|
||||
password: this.ZhuForm.password
|
||||
}).then(resp => {
|
||||
if (resp && resp.status === 200) {
|
||||
this.$emit('ok')
|
||||
}
|
||||
})
|
||||
this.$message({
|
||||
message: '注册成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.$router.replace({path: '/login'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.zhuce {
|
||||
border-radius: 15px;
|
||||
background-clip: padding-box;
|
||||
margin: 90px auto;
|
||||
width: 350px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
background: #fff;
|
||||
border: 1px solid #eaeaea;
|
||||
box-shadow: 0 0 25px #cac6c6;
|
||||
}
|
||||
|
||||
.login_title {
|
||||
margin: 0px auto 40px auto;
|
||||
text-align: center;
|
||||
color: #505458;
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in new issue