特殊人群

This commit is contained in:
yanran200730
2022-02-09 15:13:40 +08:00
parent 7f44ee66fd
commit 52f1b5d0ed
8 changed files with 1156 additions and 85 deletions

View File

@@ -9,12 +9,14 @@
<script>
import List from './components/List.vue'
import Detail from './components/Detail.vue'
import Add from './components/Add.vue'
export default {
name: 'AppSpecialDisabled',
name: 'AppSpecialMental',
label: '精神病人',
components: {
Add,
List,
Detail
},
@@ -40,7 +42,13 @@
this.params = data.params
}
if (data.type === 'list') {
if (data.type === 'Add') {
this.component = 'Add'
this.isShowDetail = true
this.params = data.params
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params

View File

@@ -0,0 +1,406 @@
<template>
<ai-detail>
<template #title>
<ai-title
:title="params.id ? '编辑精神病人' : '新增精神病人'"
isShowBottomBorder
isShowBack
@onBackClick="onBack(true)">
</ai-title>
</template>
<template #content>
<ai-card title="基本信息">
<template slot="content">
<el-form ref="formData" class="ai-form" :rules="rules" :model="formData" label-width="110px" size="small">
<div v-for="(item, index) in filedList" :key="index" :style="item.grid == 1 ? 'width: 100%;' : 'width: 50%;'">
<el-form-item :label="item.label" :prop="item.formDbName" style="width: 100%">
<template v-if="item.type == 'select'">
<ai-select v-model="formData[item.formDbName]" :placeholder="item.fieldName" :selectList="dict.getDict(item.dict)" :disabled="item.disable == 1" />
</template>
<template v-else-if="item.type == 'radio'">
<el-radio-group v-model="formData[item.formDbName]" :disabled="item.disable == 1">
<el-radio :label="item.dictValue" v-for="(item, i) in dict.getDict(item.dict)" :key="i">{{ item.dictName }}</el-radio>
</el-radio-group>
</template>
<template v-else-if="item.type == 'gird'">
<el-input disabled v-model="formData[item.formDbName]" :maxlength="200" size="small" placeholder="请选择选择网格">
<template slot="append">
<el-button size="small" @click="showGrid = true">选择网格</el-button>
</template>
</el-input>
</template>
<template v-else-if="item.type == 'onOff'">
<el-switch v-model="formData[item.formDbName]" active-color="#26f" inactive-color="#ddd" active-value="1" inactive-value="0" :disabled="item.disable == 1"></el-switch>
</template>
<template v-else-if="item.type == 'checkbox'">
<el-checkbox-group v-model="formData[item.formDbName]" :disabled="item.disable == 1">
<el-checkbox v-for="(item, i) in dict.getDict(item.dict)" :label="item.dictValue" :key="i">
{{ item.dictName }}
</el-checkbox>
</el-checkbox-group>
</template>
<template v-else-if="item.type == 'idNumber'">
<ai-id v-model="formData[item.formDbName]" :disabled="item.disable == 1" />
</template>
<template v-else-if="item.type == 'input' || item.type == 'name' || item.type == 'phone'">
<el-input v-model="formData[item.formDbName]" :placeholder="'请输入'+ item.label" clearable :disabled="item.disable == 1"
:maxlength="item.maxLength" show-word-limit></el-input>
</template>
<template v-else-if="item.type == 'number'">
<el-input-number v-model="formData[item.formDbName]" :label="'请输入'+item.label" :disabled="item.disable == 1" :precision="item.decimalPlaces" :max="item.maxValue" :min="item.minValue"></el-input-number>
</template>
<template v-else-if="item.type == 'textarea' || item.type == 'text'">
<el-input v-model="formData[item.formDbName]" :placeholder="'请输入'+item.label" clearable :disabled="item.disable == 1"
:maxlength="item.maxLength" type="textarea" show-word-limit :rows="3"></el-input>
</template>
<template v-else-if="item.type == 'date'">
<el-date-picker
v-model="formData[item.formDbName]"
type="date"
style="width: 100%"
placeholder="请选择"
:disabled="item.disable == 1"
value-format="yyyy-MM-DD">
</el-date-picker>
</template>
<template v-else-if="item.type == 'datetime'">
<el-date-picker v-model="formData[item.formDbName]" type="datetime" placeholder="选择日期时间" :disabled="item.disable == 1"
value-format="yyyy-MM-DD HH-mm-ss"></el-date-picker>
</template>
<template v-else-if="item.type == 'time'">
<el-time-picker v-model="formData[item.formDbName]" placeholder="请选择" :disabled="item.disable == 1"
value-format="HH-mm-ss"></el-time-picker>
</template>
<template v-else-if="item.type == 'upload'">
<ai-uploader :instance="instance" isShowTip fileType="file" v-model="formData[item.formDbName]" :disabled="item.disable == 1"
acceptType=".zip,.rar,.doc,.docx,.xls,.ppt,.pptx,.pdf,.txt,.jpg,.png,.xlsx"
:limit="item.fileMaxCount" :maxSize="item.fileChoseSize"></ai-uploader>
</template>
<template v-else-if="item.type == 'rtf'">
<ai-editor v-model="formData[item.formDbName]" :instance="instance"/>
</template>
<template v-else-if="item.type == 'area'">
<ai-area-get :instance="instance" v-model="formData[item.formDbName]" :name.sync="formData.areaName" :disabled="item.disable == 1"/>
</template>
</el-form-item>
</div>
</el-form>
<ai-dialog
title="选择网格"
:visible.sync="showGrid"
:destroyOnClose="true"
@close="showGrid = false"
@onConfirm="getCheckedTree"
width="720px">
<div class="grid">
<el-tree
:data="treeObj.treeList"
:props="treeObj.defaultProps"
node-key="id"
ref="tree"
:check-strictly="true" show-checkbox
:default-checked-keys="treeObj.checkedKeys"
default-expand-all highlight-current>
</el-tree>
</div>
</ai-dialog>
</template>
</ai-card>
</template>
<template #footer>
<el-button class="delete-btn footer-btn" @click="onBack">取消</el-button>
<el-button class="footer-btn" type="primary" @click="submit('formData')">提交</el-button>
</template>
</ai-detail>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Add',
props: {
instance: Function,
params: Object,
dict: Object
},
data() {
return {
showGrid: false,
formData: {
girdName: '',
name: '',
idNumber: '',
girdId: '',
placeTime: '',
phone: '',
areaId: '',
address: '',
areaName: '',
crime: '',
type: '',
startTime: '',
endTime: '',
isCreateGroup: '',
isRelease: ''
},
treeObj: {
treeList: [],
defaultProps: {
children: "girdList",
label: "girdName",
},
checkedKeys: [],
},
areaId: '',
filedList: [
{
label: '姓名',
type: 'input',
formDbName: 'name',
mustFill: 1,
fieldTips: '请输入姓名'
},
{
label: '身份证号',
type: 'input',
formDbName: 'idNumber',
mustFill: 1,
fieldTips: '请输入身份证号'
},
{
label: '联系电话',
type: 'input',
formDbName: 'phone',
mustFill: 1,
fieldTips: '请输入联系电话'
},
{
label: '所属区域',
type: 'area',
formDbName: 'areaId',
mustFill: 1,
fieldTips: '请选择所属区域'
},
{
label: '详细地址',
type: 'input',
grid: 1,
formDbName: 'address'
},
{
label: '所属网格',
type: 'gird',
grid: 1,
formDbName: 'girdName'
},
{
label: '家庭年收入',
type: 'input',
formDbName: 'income'
},
{
label: '发病日期',
type: 'time',
formDbName: 'sickTime'
},
{
label: '监护人姓名',
type: 'input',
formDbName: 'helpName'
},
{
label: '监护人联系方式',
type: 'input',
grid: 1,
formDbName: 'helpPhone',
},
{
label: '目前危险等级',
type: 'select',
dict: 'appSpecialDengerLevel',
formDbName: 'level',
},
{
label: '治疗情况',
type: 'select',
dict: 'appSpecialCure',
formDbName: 'situation',
}
]
}
},
computed: {
...mapState(['user']),
rules() {
let rules = {}
this.filedList.map(e => {
rules[e.formDbName] = []
if (e.mustFill == 1) {
rules[e.formDbName]?.push({required: true, message: e.fieldTips})
}
})
return rules
}
},
created () {
if (this.params.id) {
this.dict.load(this.filedList.filter(v => v.dict).map(v => v.dict)).then(() => {
this.getDetail()
})
} else {
this.getGridList()
this.dict.load(this.filedList.filter(v => v.dict).map(v => v.dict))
}
},
methods: {
getFormData() {
this.initForm(this.configs)
},
getCheckedTree() {
if (this.$refs.tree.getCheckedNodes().length > 1) {
return this.$message.error('不能选择多个网格')
}
const gird = this.$refs.tree.getCheckedNodes()
if (gird.length) {
this.formData.girdName = gird[0].girdName
this.formData.girdId = gird[0].id
} else {
this.formData.girdName = ''
this.formData.girdId = ''
}
this.showGrid = false
},
getGridList() {
this.instance.post(`/app/appgirdinfo/listAll`).then((res) => {
if (res.code == 0) {
this.treeObj.treeList = res.data
if (this.formData.girdId) {
this.$set(this.treeObj, 'checkedKeys', [this.formData.girdId])
}
}
})
},
getDetail() {
this.instance.post(`/app/appspecialmental/queryDetailById?id=${this.params.id}`).then((res) => {
if (res.data) {
this.formData = res.data
this.getGridList()
}
})
},
submit() {
this.$refs.formData?.validate((valid) => {
if (valid) {
this.filedList.map((item) => {
if (item.length) {
item.map((items) => {
if (items.type == 'checkbox' && this.formData[items.fieldDbName].length) { //多选
this.formData[items.fieldDbName] = this.formData[items.fieldDbName]?.toString()
}
if (items.type == 'upload' && this.formData[items.fieldDbName].length) { //附件 只传id
var files = []
this.formData[items.fieldDbName].map((item) => {
files.push(item.id)
})
this.formData[items.fieldDbName] = files.join(',')
}
if(items.type == 'area' && this.formData[items.fieldDbName]) {
var area = []
area.push(this.formData[items.fieldDbName])
area.push(this.formData[items.fieldDbName+'_name'])
this.formData[items.fieldDbName] = area.join('_')
}
})
}
})
this.instance.post(`/app/appspecialmental/addOrUpdate`, {
...this.formData,
id: this.params.id || ''
}).then((res) => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => {
this.onBack(true)
}, 600)
}
})
}
})
},
onBack(isRefresh) {
this.$emit('change', {
type: 'List',
params: this.params,
isRefresh: !!isRefresh,
})
},
},
}
</script>
<style scoped lang="scss">
::v-deep .ai-card{
width: 100%;
}
.form-div {
display: inline-block;
vertical-align: top;
}
.especial {
margin-bottom: 12px;
.icon {
vertical-align: top;
display: inline-block;
padding-top: 5px;
margin-left: 20px;
color: #f46;
}
.people {
display: inline-block;
font-size: 14px;
color: #666;
padding-right: 12px;
vertical-align: top;
width: 64px;
word-break: break-all;
box-sizing: border-box;
}
.AiWechatSelecter {
display: inline-block;
margin-left: 3px;
}
.hint {
font-size: 14px;
color: #999;
margin-left: 16px;
}
.mar-r40 {
margin-right: 40px;
}
.w80 {
width: 80px;
text-align: right;
color: #888;
}
}
.AiWechatSelecter {
width: calc(100% - 120px);
}
</style>

View File

@@ -1,30 +1,52 @@
<template>
<ai-detail isHasSidebar>
<ai-detail class="AppSpecial" isHasSidebar>
<template slot="title">
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(true)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本">
<AiSidebar :tabTitle="tabTitle" v-model="currIndex"></AiSidebar>
<ai-card title="基本信息" v-show="currIndex === 0">
<template #content>
<ai-table
class="detail-table__table"
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
<ai-wrapper>
<ai-info-item label="姓名" :value="info.name"></ai-info-item>
<ai-info-item label="身份证号" :value="info.idNumber"></ai-info-item>
<ai-info-item label="性别" :value="idNumberInfo.gender"></ai-info-item>
<ai-info-item label="出生日期" :value="idNumberInfo.birthday"></ai-info-item>
<ai-info-item label="联系电话" :value="info.phone"></ai-info-item>
<ai-info-item label="所属区域" :value="info.areaName"></ai-info-item>
<ai-info-item label="详细地址" isLine :value="info.address"></ai-info-item>
<ai-info-item label="所属网格" :value="info.girdName"></ai-info-item>
<ai-info-item label="家庭年收入" :value="info.income"></ai-info-item>
<ai-info-item label="发病日期" :value="info.sickTime"></ai-info-item>
<ai-info-item label="监护人姓名" :value="info.helpName"></ai-info-item>
<ai-info-item label="监护人联系方式" :value="info.helpPhone"></ai-info-item>
<ai-info-item label="目前危险等级" :value="dict.getLabel('appSpecialDengerLevel', info.level)"></ai-info-item>
<ai-info-item label="治疗情况" isLine :value="dict.getLabel('appSpecialCure', info.situation)"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<div class="visit-list" v-show="currIndex === 1">
<div class="visit-item" v-for="(item, index) in list" :key="index">
<div class="visit-item__top">
<div class="left">
<div class="avatar">{{ item.name.substr(item.name.length - 2) }}</div>
<h2>{{ item.name }}</h2>
</div>
<span>{{ item.visitTime }}</span>
</div>
<b>{{ item.title }}</b>
<p>{{ item.description }}</p>
<div class="visit-imgs">
<ai-uploader v-model="item.images" :instance="instance" :limit="9" disabled/>
</div>
<div class="visit-status">
<span>现实状态</span>
<i>{{ dict.getLabel('visitCondolenceReality', item.reality) }}</i>
</div>
</div>
<ai-empty v-if="!list.length"></ai-empty>
</div>
</template>
</ai-detail>
</template>
@@ -41,14 +63,21 @@
data () {
return {
info: {}
currIndex: 0,
tabTitle: ['人员信息', '走访记录'],
info: {},
list: [],
idNumberInfo: {}
}
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
this.dict.load(['epidemicRecentHealth', 'epidemicRecentTravel', 'epidemicTouchInFourteen', 'epidemicMemberType', 'epidemicRecentTestResult']).then(() => {
this.dict.load('appSpecialSituation', 'appSpecialPlacement', 'appSpecialDenger', 'appSpecialCrime',
'appSpecialControl', 'appSpecialDebug', 'appSpecialDrug', 'appSpecialChangeType', 'appSpecialCure', 'appSpecialDengerLevel',
'appSpecialDisableLevel', 'appSpecialDisableType', 'appSpecialHealth', 'appSpecialMarriage', 'appSpecialTypeFive','isReflection','yesOrNo').then(() => {
this.getInfo(this.params.id)
})
}
@@ -56,17 +85,17 @@
methods: {
getInfo (id) {
this.instance.post(`/app/appepidemicreportmember/queryDetailById?id=${id}`).then(res => {
this.instance.post(`/app/appspecialmental/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.currIndex = 0
this.idNumberInfo = this.idCardNoUtil.getIdCardInfo(res.data.idNumber)
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'list',
type: 'List',
isRefresh: !!isRefresh
})
}
@@ -75,4 +104,77 @@
</script>
<style scoped lang="scss">
.AppSpecial {
.visit-list {
.visit-item {
padding: 10px 0;
border-bottom: 1px solid #eee;
&:first-child {
padding-top: 0;
}
&:last-child {
border-bottom: none;
}
.visit-status {
display: flex;
align-items: center;
font-size: 14px;
span {
color: #333;
}
i {
color: #999;
font-style: normal;
}
}
& > p {
line-height: 1.4;
margin-bottom: 4px;
text-align: justify;
color: #666;
font-size: 16px;
}
.visit-item__top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
span {
font-size: 14px;
color: #999;
}
.left {
display: flex;
align-items: center;
img, .avatar {
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
margin-right: 10px;
border-radius: 50%;
font-size: 14px;
color: #fff;
background: #26f;
}
h2 {
font-size: 16px;
font-weight: 500;
}
}
}
}
}
}
</style>

View File

@@ -4,6 +4,10 @@
<template slot="content">
<div class="content">
<ai-search-bar bottomBorder>
<template #left>
<el-button type="primary" icon="iconfont iconAdd" size="small" @click="toAdd('', 'Add')">添加
</el-button>
</template>
<template #right>
<el-input
v-model="search.name"
@@ -29,6 +33,7 @@
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" @click="toEdit(row.id)">编辑</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
@@ -58,13 +63,11 @@
},
colConfigs: [
{ prop: 'name', label: '姓名' },
{ prop: 'phone', align: 'center', label: '手机号码' },
{ prop: 'areaName', align: 'center', label: '所属地区', width: '200px' },
{ prop: 'reportTime', align: 'center', label: '上报时间', width: '200px' },
{ prop: 'healthCode', align: 'center', label: '健康码', formart: v => v ? this.dict.getLabel('epidemicHealthCode', v) : '-' },
{ prop: 'checkTime', align: 'center', label: '核酸日期', formart: v => v ? v.split(' ')[0] : '-' },
{ prop: 'checkResult', align: 'center', label: '检测结果', formart: v => v ? this.dict.getLabel('epidemicRecentTestResult', v) : '-' },
{ prop: 'today', align: 'center', label: '今日上报', formart: v => v === '0' ? '未上报' : '已上报' },
{ prop: 'idNumber', align: 'center', label: '身份证号' },
{ prop: 'gender', align: 'center', label: '性别' },
{ prop: 'birthday', align: 'center', label: '出生日期' },
{ prop: 'age', align: 'center', label: '年龄', },
{ prop: 'phone', align: 'center', label: '联系方式' }
],
tableData: [],
total: 0,
@@ -83,37 +86,56 @@
},
created () {
this.loading = true
this.dict.load(['epidemicTouchInFourteen']).then(() => {
this.dict.load('sex').then(() => {
this.getList()
})
},
methods: {
getList () {
this.instance.post(`/app/appepidemicreportmember/list`, null, {
this.instance.post(`/app/appspecialmental/list`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.tableData = res.data.records.map(v => {
let info = this.idCardNoUtil.getIdCardInfo(v.idNumber)
v.birthday = info.birthday
v.age = this.$calcAge(v.idNumber)
v.gender = info.gender
return v
})
this.total = res.data.total
this.loading = false
} else {
this.loading = false
}
}).catch(() => {
this.loading = false
})
},
toEdit (e) {
this.$emit('change', {
type: 'Add',
params: {
type: 'Add',
id: e
}
})
},
toAdd() {
this.$emit('change', {
type: 'Add',
params: {
type: 'Add',
}
})
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appepidemicreportmember/delete?ids=${id}`).then(res => {
this.instance.post(`/app/appspecialmental/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getTotalInfo()
this.getList()
}
})