Commit eff07d64 authored by songrui's avatar songrui

慢病自我初筛

parent ffae8f5c
public/favicon.ico

4.19 KB | W: | H:

public/favicon.ico

848 Bytes | W: | H:

public/favicon.ico
public/favicon.ico
public/favicon.ico
public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
......@@ -77,6 +77,7 @@
// 字体大小
.text-16 { font-size: 16px; }
.text-12 { font-size: 12px; }
.text-center { text-align: center; }
.text-black { color: #000; }
.text-green { color: #52C41A; }
......
......@@ -26,3 +26,7 @@ body {
.route-enter, .route-leave-to {
opacity: 0;
}
*, :after, :before {
box-sizing: border-box;
}
\ No newline at end of file
<template>
<div class="h-full chronic-home">
<router-view v-slot="{ Component }">
<Transition name="route" mode="out-in">
<component :is="Component" v-if="visible"/>
</Transition>
</router-view>
</div>
</template>
<script>
import { getDict } from './api/base.js'
import { useStore } from './store/index.js'
export default {
data() {
return {
visible: false
}
},
setup() {
const store = useStore()
return { store }
},
created() {
this.init()
},
methods: {
async init() {
console.log(this.visible)
const res = await getDict()
this.store.$patch({ dict: res.data || {} })
this.visible = true
}
}
}
</script>
<style lang="less" scoped>
</style>
import { fetchBase } from '@/utils/fetch.js'
import { setSessionStorage, getSessionStorage } from '@/utils/common.js'
// 获取字典
export function getDict() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true })
}
// 区划编码查询下级
export function getAreaChild(parentCode, loading = true) {
const key = 'chronic-area-cache'
return new Promise((resolve, reject) => {
const result = getSessionStorage(key) || {}
if (result[parentCode]) {
resolve(result[parentCode])
return
}
fetchBase({ url: `/tumour-admin/v1/h5-app/child-area/${parentCode}`, loading }).then(res => {
result[parentCode] = res.data
setSessionStorage(key, result)
resolve(res.data)
}).catch(err => {
reject(err)
})
})
}
// 居民基本信息查询
export function getResidentInfo(idCard) {
return fetchBase({ url: `/tumour-admin/v1/h5-app/residents/${idCard}`, loading: true })
}
<template>
<div class="h-full flex flex-col id-check">
<div class="flex py-2">
<div class="px-4 title">基本信息</div>
<div class="text-12">请准确填写您的证件信息,标*内容为必填</div>
</div>
<van-form label-width="5em" ref="form">
<van-field required
v-model="form.certificateTypeTrans"
is-link
readonly
name="certificateType"
label="证件类型"
placeholder="请选择"
disabled/>
<van-field v-model="form.idCard"
required
center
clearable
name="idCard"
label="证件号码"
placeholder="请输入"
:rules="rules.idCard"
>
</van-field>
</van-form>
<div class="px-4 pb-4 grow flex flex-col justify-end">
<van-button type="primary" block
@click="submit">下一步</van-button>
</div>
</div>
</template>
<script>
import { useStore } from '@/chronic/store/index.js'
import { idCardRule } from '@/utils/commonReg.js'
export default {
data() {
return {
form: {
idCard: '',
certificateType: 1,
certificateTypeTrans: ''
},
rules: {
idCard: [{ required: true, message: '请输入' }, idCardRule],
certificateType: [{ required: true, message: '请选择' }]
}
}
},
setup() {
const store = useStore()
return { store }
},
created() {
this.init()
},
methods: {
init() {
console.log(this.store, this.store.getDictValue('DC00004', this.form.certificateType))
this.form.certificateTypeTrans = this.store.getDictValue('DC00004', this.form.certificateType)
},
submit() {
this.$refs.form.validate().then(res => {
console.log(res, this.form)
}).catch(err => {
console.warn(err)
})
}
}
}
</script>
<style lang="less" scoped>
@import '../../../utils/common.less';
</style>
<template>
<div class="h-full pb-5 flex flex-col ">
<div class="p-3 text-16 text-black text-center shrink-0 top-bar">
<span class="back-bt" @click="onBack" v-if="setp >= 2">
<doc-icon type="doc-left" />
</span>
<span>慢病自我初筛</span>
</div>
<div class="grow overflow-y-auto">
<IdCheck v-show="setp === 1"/>
</div>
</div>
</template>
<script>
import { showNotify } from 'vant'
import IdCheck from './IdCheck.vue'
export default {
components: {
IdCheck
},
data() {
return {
// 操作步骤
setp: 1,
}
},
computed: {
routeQuery() {
return this.$route.query
},
doctorId() {
return this.routeQuery.doctorId
}
},
created() {
if (!this.doctorId) {
showNotify({ type: 'warning', message: '未获取到医生信息', duration: 0 })
}
},
methods: {
onBack() {
if (this.setp === 1) return
this.setp--
}
}
}
</script>
<style lang="less" scoped>
.top-bar {
position: relative;
border-bottom: 1px solid #0000001A;
.back-bt {
position: absolute;
left: .16rem;
}
}
</style>
import { defineStore } from 'pinia'
export const useStore = defineStore('chronic', {
state: () => {
return {
// 字典
dict: []
}
},
getters: {},
actions: {
getDict(dict) {
if (!dict) return []
return this.dict[dict] || []
},
getDictValue(dict, value) {
let array = []
if (typeof dict === 'string') {
array = this.dict[dict]
} else {
array = dict
}
if (!array || !array.length) {
return ''
}
let temp = array.find(e => e.value == value) || {}
return temp.name || ''
}
}
})
.title {
font-weight: 600;
display: flex;
align-items: center;
&::before {
content: '';
display: inline-block;
background: var(--van-primary-color);
height: 16px;
width: 4px;
margin-right: 4px;
}
}
\ No newline at end of file
......@@ -13,7 +13,18 @@ const routes = [
}
]
},
{
path: '/chronic',
name: 'chronic',
component: () => import(/* webpackChunkName: "page-chronic" */ '@/chronic/Chronic.vue'),
children: [
{
path: 'screening/first/form',
name: 'chronic-screening-first-form',
component: () => import(/* webpackChunkName: "page-chronic" */ '@/chronic/screening/first/form/Index.vue')
}
]
},
]
const router = createRouter({
......
import { fetchBase } from './fetch.js'
import { fetchBase } from '@/utils/fetch.js'
import { setSessionStorage, getSessionStorage } from '@/utils/common.js'
// 获取字典
export function getDict() {
return fetchBase({ url: `/v1/h5-app/dict`, loading: true })
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true })
}
// 区划编码查询下级
......@@ -15,7 +15,7 @@ export function getAreaChild(parentCode, loading = true) {
resolve(result[parentCode])
return
}
fetchBase({ url: `/v1/h5-app/child-area/${parentCode}`, loading }).then(res => {
fetchBase({ url: `/tumour-admin/v1/h5-app/child-area/${parentCode}`, loading }).then(res => {
result[parentCode] = res.data
setSessionStorage(key, result)
resolve(res.data)
......@@ -27,5 +27,5 @@ export function getAreaChild(parentCode, loading = true) {
// 居民基本信息查询
export function getResidentInfo(idCard) {
return fetchBase({ url: `/v1/h5-app/residents/${idCard}`, loading: true })
return fetchBase({ url: `/tumour-admin/v1/h5-app/residents/${idCard}`, loading: true })
}
import { fetchBase } from './fetch.js'
import { fetchBase } from '@/utils/fetch.js'
// 简易筛查 新增
export function addSimpleScreen(params, loading = true) {
return fetchBase({ url: `/v1/h5-app/add-simple-screen`, body: params, loading })
return fetchBase({ url: `/tumour-admin/v1/h5-app/add-simple-screen`, body: params, loading })
}
/**
* 基础请求方法
*/
import axios from 'axios'
import { showFailToast, showLoadingToast } from 'vant'
......@@ -32,7 +36,7 @@ export function fetchBase({
}
baseAxios({
method: method,
url: `/tumour-admin${url}`,
url: `${url}`,
params: params,
data: body,
headers: {
......@@ -50,7 +54,6 @@ export function fetchBase({
errorMark++
reject(err)
}).finally(() => {
console.log(33)
if (loading) {
loadingList--
if (loadingList <= 0 && loadingToast) {
......
......@@ -22,7 +22,8 @@ module.exports = defineConfig({
// 设置代理
proxy: {
'/tumour-admin': {
target: 'http://192.168.1.7:8081',
// target: 'http://192.168.1.7:8081',
target: 'https://beta-tumour.zmnyjk.com',
changOrigin: true,
pathRewrite: {
'^/tumour-admin': '/tumour-admin'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment