初始化
This commit is contained in:
2
.env.development
Normal file
2
.env.development
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# 开发环境变量
|
||||||
|
VUE_APP_BASE_API=/api
|
||||||
2
.env.production
Normal file
2
.env.production
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# 生产环境变量
|
||||||
|
VUE_APP_BASE_API=/api
|
||||||
23
.gitignore
vendored
Normal file
23
.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/dist
|
||||||
|
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
24
README.md
Normal file
24
README.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# hospital_project
|
||||||
|
|
||||||
|
## Project setup
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and hot-reloads for development
|
||||||
|
```
|
||||||
|
npm run serve
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and minifies for production
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lints and fixes files
|
||||||
|
```
|
||||||
|
npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
### Customize configuration
|
||||||
|
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||||
5
babel.config.js
Normal file
5
babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@vue/cli-plugin-babel/preset'
|
||||||
|
]
|
||||||
|
}
|
||||||
19
jsconfig.json
Normal file
19
jsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"module": "esnext",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lib": [
|
||||||
|
"esnext",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"scripthost"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
12313
package-lock.json
generated
Normal file
12313
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
47
package.json
Normal file
47
package.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"name": "hospital_project",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vue-cli-service serve",
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"lint": "vue-cli-service lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"axios": "^1.13.6",
|
||||||
|
"core-js": "^3.8.3",
|
||||||
|
"element-ui": "^2.15.14",
|
||||||
|
"vue": "^2.6.14",
|
||||||
|
"vue-router": "^3.6.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.12.16",
|
||||||
|
"@babel/eslint-parser": "^7.12.16",
|
||||||
|
"@vue/cli-plugin-babel": "~5.0.0",
|
||||||
|
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||||
|
"@vue/cli-service": "~5.0.0",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
|
"eslint-plugin-vue": "^8.0.3",
|
||||||
|
"vue-template-compiler": "^2.6.14"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:vue/essential",
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "@babel/eslint-parser"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not dead"
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
public/favicon1.ico
Normal file
BIN
public/favicon1.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
17
public/index.html
Normal file
17
public/index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
26
src/App.vue
Normal file
26
src/App.vue
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<template>
|
||||||
|
<div id="app">
|
||||||
|
<router-view></router-view>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'App'
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
src/api/auth.js
Normal file
35
src/api/auth.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import request from '@/request/index'
|
||||||
|
|
||||||
|
// 登录
|
||||||
|
export const login = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/appUser/AppUserLogin',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 提交绿色通道
|
||||||
|
export const createAisle = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/appUser/createAisle',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 绿色通道列表
|
||||||
|
export const getAisle = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/appUser/getAisle',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 录入
|
||||||
|
|
||||||
|
export const insertEmergencyPublic = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/emergency/insertEmergencyPublic',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
BIN
src/assets/login_bg.jpg
Normal file
BIN
src/assets/login_bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 242 KiB |
58
src/components/HelloWorld.vue
Normal file
58
src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<template>
|
||||||
|
<div class="hello">
|
||||||
|
<h1>{{ msg }}</h1>
|
||||||
|
<p>
|
||||||
|
For a guide and recipes on how to configure / customize this project,<br>
|
||||||
|
check out the
|
||||||
|
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
||||||
|
</p>
|
||||||
|
<h3>Installed CLI Plugins</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>Essential Links</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
||||||
|
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
||||||
|
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
||||||
|
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
||||||
|
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>Ecosystem</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
||||||
|
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
||||||
|
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'HelloWorld',
|
||||||
|
props: {
|
||||||
|
msg: String
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
|
<style scoped>
|
||||||
|
h3 {
|
||||||
|
margin: 40px 0 0;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #42b983;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
13
src/main.js
Normal file
13
src/main.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import App from './App.vue'
|
||||||
|
import router from './router'
|
||||||
|
import ElementUI from 'element-ui'
|
||||||
|
import 'element-ui/lib/theme-chalk/index.css'
|
||||||
|
|
||||||
|
Vue.use(ElementUI)
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
router,
|
||||||
|
render: h => h(App),
|
||||||
|
}).$mount('#app')
|
||||||
41
src/request/index.js
Normal file
41
src/request/index.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
// 创建axios实例
|
||||||
|
const service = axios.create({
|
||||||
|
baseURL: process.env.VUE_APP_BASE_API, // 基础URL
|
||||||
|
timeout: 10000, // 请求超时时间
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 请求拦截器
|
||||||
|
service.interceptors.request.use(
|
||||||
|
config => {
|
||||||
|
// 从本地存储获取token
|
||||||
|
const token = localStorage.getItem('token')
|
||||||
|
if (token) {
|
||||||
|
config.headers.Authorization = `Bearer ${token}`
|
||||||
|
}
|
||||||
|
return config
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
console.error('请求错误:', error)
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// 响应拦截器
|
||||||
|
service.interceptors.response.use(
|
||||||
|
response => {
|
||||||
|
const res = response.data
|
||||||
|
// 这里可以根据后端返回的状态码进行统一处理
|
||||||
|
return res
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
console.error('响应错误:', error)
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export default service
|
||||||
46
src/router/index.js
Normal file
46
src/router/index.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import VueRouter from 'vue-router'
|
||||||
|
import Login from '../view/login.vue'
|
||||||
|
import Index from '../view/index.vue'
|
||||||
|
|
||||||
|
Vue.use(VueRouter)
|
||||||
|
|
||||||
|
const routes = [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
redirect: '/login'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/login',
|
||||||
|
name: 'Login',
|
||||||
|
component: Login
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/index',
|
||||||
|
name: 'Index',
|
||||||
|
component: Index
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/green-channel',
|
||||||
|
name: 'GreenChannel',
|
||||||
|
component: () => import('../view/green-channel.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/emergency-input',
|
||||||
|
name: 'EmergencyInput',
|
||||||
|
component: () => import('../view/emergency-input.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/green_record',
|
||||||
|
name: 'greenRecord',
|
||||||
|
component: () => import('../view/green_record.vue')
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const router = new VueRouter({
|
||||||
|
mode: 'history',
|
||||||
|
base: process.env.BASE_URL,
|
||||||
|
routes
|
||||||
|
})
|
||||||
|
|
||||||
|
export default router
|
||||||
175
src/view/emergency-input.vue
Normal file
175
src/view/emergency-input.vue
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
<template>
|
||||||
|
<div class="emergency-input-container">
|
||||||
|
<!-- <h1>急诊录入页面</h1>-->
|
||||||
|
<div class="content">
|
||||||
|
<div class="title_text">录入信息</div>
|
||||||
|
<el-form ref="form" :model="form" label-width="100px" :rules="rules">
|
||||||
|
<el-form-item label="项目编码:" prop="project_sn">
|
||||||
|
<el-input v-model="form.project_sn" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="编号:" prop="sn">
|
||||||
|
<el-input v-model="form.sn" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="bottom">
|
||||||
|
<div class="open_btn" @click="saveMenu">录入</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content" v-if="infoShow">
|
||||||
|
<div class="title_text">检查信息</div>
|
||||||
|
<div class="user_info">
|
||||||
|
<div class="row_item">
|
||||||
|
<div>患者姓名:</div>
|
||||||
|
<div>{{ formInfo.patient_name }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>患者类型:</div>
|
||||||
|
<div>{{ formInfo.patient_type }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>项目编号:</div>
|
||||||
|
<div>{{ formInfo.project_no }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>项目名称:</div>
|
||||||
|
<div>{{ formInfo.project_name }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>项目金额:</div>
|
||||||
|
<div>{{ formInfo.project_amount }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>身份证号:</div>
|
||||||
|
<div>{{ formInfo.id_card }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>登记编号:</div>
|
||||||
|
<div>{{ formInfo.register_no }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>开单医生编号:</div>
|
||||||
|
<div>{{ formInfo.doctor_no }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>开单医生:</div>
|
||||||
|
<div>{{ formInfo.doctor_name }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>检查医生:</div>
|
||||||
|
<div>{{ formInfo.check_doctor_name }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>检查设备:</div>
|
||||||
|
<div>{{ formInfo.device }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div>科室:</div>
|
||||||
|
<div>{{ formInfo.department }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {insertEmergencyPublic} from "@/api/auth";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EmergencyInput',
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
form:{
|
||||||
|
project_sn:'',
|
||||||
|
sn:''
|
||||||
|
},
|
||||||
|
rules:{
|
||||||
|
project_sn: [{ required: true, message: '这是必填项',trigger: ['blur', 'change']}],
|
||||||
|
sn: [{ required: true, message: '这是必填项',trigger: ['blur', 'change']}],
|
||||||
|
},
|
||||||
|
formInfo:{},
|
||||||
|
infoShow:false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
saveMenu(){
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let params = {
|
||||||
|
project_sn:this.form.project_sn,
|
||||||
|
sn:this.form.sn,
|
||||||
|
user_id:JSON.parse(localStorage.getItem('info')).ID
|
||||||
|
}
|
||||||
|
insertEmergencyPublic({...params}).then(res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
this.formInfo = res.data
|
||||||
|
this.infoShow = true
|
||||||
|
}else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.emergency-input-container {
|
||||||
|
padding: 20px;
|
||||||
|
.content {
|
||||||
|
background: #ffffff;
|
||||||
|
padding: 14px 16px 20px;
|
||||||
|
border-radius: 10px;
|
||||||
|
width: 50%;
|
||||||
|
.title_text {
|
||||||
|
color: rgba(16,16,16,1);
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
font-family: PingFangSC-bold;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.title_text::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 20px;
|
||||||
|
background: #007aff;
|
||||||
|
vertical-align: middle;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.bottom {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
.open_btn {
|
||||||
|
font-size: 28rpx;
|
||||||
|
background: #386BF1;
|
||||||
|
color: #ffffff;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
width: 100px;
|
||||||
|
line-height: 40px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.user_info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 20px;
|
||||||
|
.row_item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
76
src/view/green-channel.vue
Normal file
76
src/view/green-channel.vue
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<template>
|
||||||
|
<div class="green-channel-container">
|
||||||
|
<!-- <h1>绿色通道页面</h1>-->
|
||||||
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
||||||
|
<el-form-item label="原因:" prop="cause">
|
||||||
|
<el-input v-model="form.cause"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="bottom">
|
||||||
|
<div class="open_btn" @click="saveMenu">开启</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { createAisle } from '@/api/auth'
|
||||||
|
export default {
|
||||||
|
name: 'GreenChannel',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form:{
|
||||||
|
cause:''
|
||||||
|
},
|
||||||
|
rules:{
|
||||||
|
cause: [{ required: true, message: '这是必填项',trigger: ['blur', 'change']}],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
saveMenu(){
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let params = {
|
||||||
|
msg:this.form.cause,
|
||||||
|
user_id:JSON.parse(localStorage.getItem('info')).ID,
|
||||||
|
}
|
||||||
|
createAisle({...params}).then(res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
this.$message.success(res.msg);
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
}else {
|
||||||
|
this.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.green-channel-container {
|
||||||
|
padding: 20px;
|
||||||
|
width: 50%;
|
||||||
|
.bottom {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
.open_btn {
|
||||||
|
font-size: 28rpx;
|
||||||
|
background: #386BF1;
|
||||||
|
color: #ffffff;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
width: 100px;
|
||||||
|
line-height: 40px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
95
src/view/green_record.vue
Normal file
95
src/view/green_record.vue
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<template>
|
||||||
|
<div class="content">
|
||||||
|
<div class="item_content" v-for="item in list" :key="item.ID">
|
||||||
|
<div class="row_item">
|
||||||
|
<div class="row_title">开启时间:</div>
|
||||||
|
<div class="row_text">{{ formatDate(item.CreatedAt) }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row_item">
|
||||||
|
<div class="row_title">开启原因:</div>
|
||||||
|
<div class="row_text">{{ item.msg }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getAisle} from "@/api/auth";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props:{
|
||||||
|
activeName:String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list:[]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
activeName(newVal) {
|
||||||
|
if (newVal === 'third') {
|
||||||
|
this.getListData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.activeName === 'third') {
|
||||||
|
this.getListData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getListData(){
|
||||||
|
getAisle({user_id:JSON.parse(localStorage.getItem('info')).ID}).then(res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
this.list = res.data.list
|
||||||
|
console.log(this.list)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formatDate (dateString){
|
||||||
|
if (!dateString) return '';
|
||||||
|
const date = new Date(dateString);
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.content {
|
||||||
|
width: 50%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
.item_content {
|
||||||
|
padding: 14px 16px 20px;
|
||||||
|
background: #f8f8f8;
|
||||||
|
border-radius: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
.row_item {
|
||||||
|
display: flex;
|
||||||
|
line-height: 1.5;
|
||||||
|
.row_title {
|
||||||
|
width: 180rpx;
|
||||||
|
}
|
||||||
|
.row_text {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
91
src/view/index.vue
Normal file
91
src/view/index.vue
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
<template>
|
||||||
|
<div class="title_top">
|
||||||
|
<div class="left_top">
|
||||||
|
<el-tabs v-model="activeName" @tab-click="handleClick" >
|
||||||
|
<el-tab-pane label="绿色通道" name="first">
|
||||||
|
<greenChannel></greenChannel>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="急诊录入" name="second">
|
||||||
|
<emergencyInput></emergencyInput>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="绿色通道记录" name="third">
|
||||||
|
<greenRecord :activeName="activeName"></greenRecord>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="right_top">
|
||||||
|
<el-tabs @tab-click="logOut">
|
||||||
|
<el-tab-pane label="退出登录" name="out" ></el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import greenChannel from '@/view/green-channel.vue'
|
||||||
|
import emergencyInput from '@/view/emergency-input.vue'
|
||||||
|
import greenRecord from '@/view/green_record.vue'
|
||||||
|
export default {
|
||||||
|
name: 'IndexPage',
|
||||||
|
components: {
|
||||||
|
greenChannel,
|
||||||
|
emergencyInput,
|
||||||
|
greenRecord
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName:'first',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick(){
|
||||||
|
|
||||||
|
},
|
||||||
|
logOut(){
|
||||||
|
this.$confirm('确定要退出登录吗?', '退出登录', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$message.success('退出登录成功');
|
||||||
|
localStorage.setItem('info',{})
|
||||||
|
this.$router.replace('/login')
|
||||||
|
}).catch(() => {
|
||||||
|
// 取消退出
|
||||||
|
// console.log('用户取消退出登录');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.title_top {
|
||||||
|
padding:0 20px ;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
::v-deep .el-tabs__nav {
|
||||||
|
line-height: 50px;
|
||||||
|
}
|
||||||
|
.left_top {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.right_top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
::v-deep .el-tabs__active-bar {
|
||||||
|
width: 0 !important;
|
||||||
|
}
|
||||||
|
::v-deep .el-tabs__item:hover {
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
::v-deep .el-tabs__item.is-active {
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
89
src/view/login.vue
Normal file
89
src/view/login.vue
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
<template>
|
||||||
|
<div class="login-container">
|
||||||
|
<el-card class="login-card">
|
||||||
|
<h2 class="login-title">医疗设备智能控费系统</h2>
|
||||||
|
<el-form
|
||||||
|
:model="loginForm"
|
||||||
|
:rules="loginRules"
|
||||||
|
ref="loginForm"
|
||||||
|
label-width="80px"
|
||||||
|
>
|
||||||
|
<el-form-item label="用户名" prop="username">
|
||||||
|
<el-input v-model="loginForm.username" placeholder="请输入用户名"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="密码" prop="password">
|
||||||
|
<el-input type="password" v-model="loginForm.password" placeholder="请输入密码"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-button type="primary" @click="handleLogin" style="width: 100%">登录</el-button>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {login} from '@/api/auth'
|
||||||
|
export default {
|
||||||
|
name: 'LoginPage',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loginForm: {
|
||||||
|
username: '',
|
||||||
|
password: ''
|
||||||
|
},
|
||||||
|
loginRules: {
|
||||||
|
username: [
|
||||||
|
{ required: true, message: '请输入用户名', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
password: [
|
||||||
|
{ required: true, message: '请输入密码', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleLogin() {
|
||||||
|
this.$refs.loginForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let params = {
|
||||||
|
user: this.loginForm.username,
|
||||||
|
password: this.loginForm.password,
|
||||||
|
}
|
||||||
|
login({...params}).then((res) => {
|
||||||
|
if(res.code === 0){
|
||||||
|
this.$message.success('登录成功');
|
||||||
|
this.$router.replace('/index')
|
||||||
|
localStorage.setItem('info',JSON.stringify(res.data))
|
||||||
|
}else {
|
||||||
|
this.$message.error(res.msg || '请求失败');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.error('请输入正确的用户名和密码')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.login-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
background-image: url('@/assets/login_bg.jpg');
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
.login-card {
|
||||||
|
width: 400px;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.login-title {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
color: #409EFF;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
15
vue.config.js
Normal file
15
vue.config.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
const { defineConfig } = require('@vue/cli-service')
|
||||||
|
module.exports = {
|
||||||
|
devServer: {
|
||||||
|
port: 8081,
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://47.105.32.17:8888',
|
||||||
|
changeOrigin: true,
|
||||||
|
pathRewrite: {
|
||||||
|
'^/api': ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user