Merge branch 'bonus-jyy-smart-canteen' of http://192.168.0.75:3000/bonus/bonus-ui into bonus-jyy-smart-canteen

This commit is contained in:
zzyuan 2025-06-03 10:25:30 +08:00
commit 741ad1a41f
3 changed files with 1297 additions and 42 deletions

View File

@ -0,0 +1,611 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="关 键 字">
<el-input v-model="queryParams.articleTitle" placeholder="请输入用户姓名、编号或手机号" maxlength="20" clearable style="width: 220px"/>
</el-form-item>
<el-form-item label="所属组织" prop="deptIdList">
<el-cascader v-model="queryParams.deptIdList"
:options="deptOptions" :filterable="true" placeholder="请选择所属组织" style="width: 240px" :show-all-levels="false"
:props="{
multiple: true,
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable collapse-tags >
</el-cascader>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableListData" height="800" ref="multipleTable">
<el-table-column label="用户姓名" align="center" prop="nickName" :show-overflow-tooltip="true" >
</el-table-column>
<el-table-column label="用户手机号" align="center" prop="mobile" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="位置信息" align="center" prop="placeFullName" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="饮食医嘱" align="center" prop="doctorAdvice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.doctorAdvice==1">禁食</span>
<span v-if="scope.row.doctorAdvice==2">流食</span>
<span v-if="scope.row.doctorAdvice==3">半流食</span>
<span v-if="scope.row.doctorAdvice==4">治疗饮食</span>
</template>
</el-table-column>
<el-table-column label="就诊号" align="center" prop="doctorNum" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="住院号" align="center" prop="hospitalNum" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="住院日期" align="center" prop="inpatientDate" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="慢性病" align="center" prop="chronicNames" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="劳动强度" align="center" prop="labourIntensity" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.labourIntensity==1">轻劳动</span>
<span v-if="scope.row.labourIntensity==2">中等强度劳动</span>
<span v-if="scope.row.labourIntensity==3">重强度劳动</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleUpdate2(scope.row)"
>体检报告</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框 -->
<el-dialog :title="title" :visible.sync="open" width="980px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-row justify="center">
<table align="center" width="100%" cellspacing="0">
<tr >
<td colspan="4" class="table-title">个人信息</td>
</tr>
<tr >
<td class="table-label"><i class="text-red">*</i> <span >用户姓名</span></td>
<td class="table-content"><span >测试操作员</span></td>
<td class="table-label"><i class="text-red">*</i> <span >用户编号</span></td>
<td class="table-content"><span >232072</span></td>
</tr>
<tr >
<td class="table-label"><i class="text-red">*</i> <span >所属组织</span></td>
<td class="table-content"><span >测试有限责任公司(默认)/后场临时部门</span></td>
<td class="table-label"><span >用户类别</span></td>
<td class="table-content"><span >临时人员</span></td>
</tr>
<tr >
<td class="table-label"><span >用户手机号</span></td>
<td class="table-content"><span >136****0965</span></td>
<td class="table-label"><span >性别</span></td>
<td class="table-content"><span ></span></td>
</tr>
<tr >
<td class="table-label"><span >位置信息</span></td>
<td class="table-content"><span ></span></td>
<td class="table-label"><span >出生日期</span></td>
<td class="table-content"><span ></span></td>
</tr>
<tr >
<td colspan="4" class="table-title">健康信息</td>
</tr>
<tr >
<td class="table-label"><span >就诊号</span></td>
<td class="table-content">
<el-input
v-model="form.doctorNum"
placeholder="请输入就诊号"
maxlength="40"
show-word-limit
/>
</td>
<td class="table-label"><span >住院号</span></td>
<td class="table-content">
<el-input
v-model="form.hospitalNum"
placeholder="请输入住院号"
maxlength="40"
show-word-limit
/>
</td>
</tr>
<tr >
<td class="table-label"><span >身高</span></td>
<td class="table-content">
<el-input
v-model="form.height"
placeholder="请输入住身高"
maxlength="3"
show-word-limit
/>
</td>
<td class="table-label"><span >体重</span></td>
<td class="table-content">
<el-input
v-model="form.weight"
placeholder="请输入住体重"
maxlength="5"
show-word-limit
/>
</td>
</tr>
<tr >
<td class="table-label"><span >血型</span></td>
<td class="table-content">
<el-select v-model="form.bloodType" placeholder="请选择血型" style="width: 100%">
<el-option v-for="item in this.bloodTypeOptions"
:key="item.bloodType"
:label="item.bloodTypeName"
:value="item.bloodType"
></el-option>
</el-select>
</td>
<td class="table-label"><span >慢性病</span></td>
<td class="table-content">
<el-select v-model="form.chronicList" placeholder="请选择慢性病" multiple style="width: 220px" clearable collapse-tags>
<el-option v-for="item in chronicOptions"
:key="item.chronicId"
:label="item.chronicName"
:value="item.chronicId"
></el-option>
</el-select>
</td>
</tr>
<tr >
<td class="table-label"><span >怀孕状态</span></td>
<td class="table-content">
<el-select v-model="form.pregnantStatus" placeholder="请选择怀孕状态" style="width: 100%">
<el-option v-for="item in this.pregnantOptions"
:key="item.pregnantStatus"
:label="item.pregnantStatusName"
:value="item.pregnantStatus"
></el-option>
</el-select>
</td>
<td class="table-label"><span >怀孕日期</span></td>
<td class="table-content"></td>
</tr>
<tr >
<td class="table-label"><span >是否住院</span></td>
<td class="table-content">
<el-select v-model="form.ifHospitalized" placeholder="请选择是否住院" multiple style="width: 220px" clearable collapse-tags>
<el-option id="1"></el-option>
<el-option id="2"></el-option>
</el-select>
</td>
<td class="table-label"><span >住院日期</span></td>
<td class="table-content"></td>
</tr>
<tr >
<td class="table-label"><span >劳动强度</span></td>
<td class="table-content">
<el-select v-model="form.labourIntensity" placeholder="请选择劳动强度" style="width: 100%">
<el-option v-for="item in this.labourIntensityOptions"
:key="item.labourIntensity"
:label="item.labourIntensityName"
:value="item.labourIntensity"
></el-option>
</el-select>
</td>
<td class="table-label"><span >过敏源</span></td>
<td class="table-content">
<el-input
v-model="form.allergen"
placeholder="请输入过敏源"
maxlength="40"
show-word-limit
/>
</td>
</tr>
<tr >
<td class="table-label"><span >饮食医嘱</span></td>
<td class="table-content">
<el-select v-model="form.doctorAdvice" placeholder="请选择饮食医嘱" multiple style="width: 220px" clearable collapse-tags>
<el-option v-for="item in doctorAdviceOptions"
:key="item.doctorAdvice"
:label="item.doctorAdviceName"
:value="item.doctorAdvice"
></el-option>
</el-select>
</td>
<td class="table-label"><span >体重控制目标</span></td>
<td class="table-content">
<el-select v-model="form.weightControl" placeholder="请选择" multiple style="width: 220px" clearable collapse-tags>
<el-option id="1">减肥</el-option>
<el-option id="2">增重</el-option>
</el-select>
</td>
</tr>
<tr >
<td class="table-label"><span >BMI(kg/)</span></td>
<td class="table-content"></td>
<td colspan="2"></td>
</tr>
</table>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import { deptTreeSelect } from '@/api/system/user'
import { dictHealthChronicApi,getHealthSciencePageApi,addHealthScienceApi,editHealthScienceApi,delHealthScienceApi,getHealthInfoPageApi } from "@/api/healthCenter/index";
import { imgUpLoadTwo } from '@/api/system/upload'
export default {
name: "",
dicts: [],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
title:"",
//
open: false,
dateRange:[new Date(),new Date()],
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
picker.$emit('pick', [start, end]);
}
},{
text: '最近一个月',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
},{
text: '最近三个月',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
picker.$emit('pick', [start, end]);
}
}]
},
chronicOptions:[],
doctorAdviceOptions:[{"doctorAdvice":1,"doctorAdviceName":"禁食"},
{"doctorAdvice":2,"doctorAdviceName":"流食"},
{"doctorAdvice":3,"doctorAdviceName":"半流食"},
{"doctorAdvice":4,"doctorAdviceName":"治疗饮食"},
],
bloodTypeOptions:[
{"bloodType":1,"bloodTypeName":"A型"},
{"bloodType":2,"bloodTypeName":"B型"},
{"bloodType":3,"bloodTypeName":"AB型"},
{"bloodType":4,"bloodTypeName":"O型"},
{"bloodType":5,"bloodTypeName":"Rh阳型"},
{"bloodType":6,"bloodTypeName":"Rh阴型"}
],//
pregnantOptions:[
{"pregnantStatus":0,"pregnantStatusName":"保密"},
{"pregnantStatus":1,"pregnantStatusName":"未怀孕"},
{"pregnantStatus":2,"pregnantStatusName":"孕妇(早期)"},
{"pregnantStatus":3,"pregnantStatusName":"孕妇(中期)"},
{"pregnantStatus":4,"pregnantStatusName":"孕妇(晚期)"},
{"pregnantStatus":5,"pregnantStatusName":"乳母"}
],//怀
labourIntensityOptions:[
{"labourIntensity":1,"labourIntensityName":"轻劳动"},
{"labourIntensity":2,"labourIntensityName":"中等强度劳动"},
{"labourIntensity":3,"labourIntensityName":"重强度劳动"}
],//
//
queryParams: {
pageNum: 1,
pageSize: 10,
articleTitle: undefined,//
deptIdList:[],//
chronicList:[], //
placeIdList:[], //
articleType:null //
},
form: {
articleTitle:null,
summary:null,
chronicIdList:[],
coverPhoto:null,
articleType:1,
articleContent:null,
},//
rules: {
articleTitle: [
{ required: true, message: "文章标题不能为空", trigger: "blur" }
],
articleContent: [
{ required: true, message: "文章内容不能为空", trigger: "blur" }
]
},
fileList: [],//
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
};
},
created() {
this.getDeptTree()
this.getList()
this.getChronicList()
},
computed: {
//1
uploadDisabled() {
return this.checkUrlList.length > 0
},
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = this.filterTree(response.data)
})
},
filterTree(nodes) {
return nodes
.map((node) => {
if (node.children) {
node.children = this.filterTree(node.children)
}
return node
})
.filter((node) => node.status !== '1')
},
//
getChronicList() {
dictHealthChronicApi({}).then((response) => {
this.chronicOptions = response.data;
console.log("this.chronicOptions",this.chronicOptions)
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [new Date(),new Date()]
this.queryParams = {
pageNum: 1,
pageSize: 10,
articleTitle: undefined,//
chronicList:[], //
articleType:null //
}
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"articleTitle":this.queryParams.articleTitle,
"articleType":this.queryParams.articleType,
"chronicIds":this.queryParams.chronicList.join(",")||"",
"startDate":this.formatDate(this.dateRange[0]),
"endDate":this.formatDate(this.dateRange[1])
}
// if(this.queryParams.chronicList.length>0){
// this.queryParams.chronicIds = this.queryParams.chronicList.join(",")
// }else{
// this.queryParams.chronicIds = ""
// }
getHealthInfoPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList=[]
this.form = {
articleTitle:null,
summary:null,
chronicIdList:[],
coverPhoto:null,
articleType:1,
articleContent: null,
};
this.resetForm("form");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
handleUpdate(row) {
this.form = Object.assign({}, row);
if(this.form.coverPhoto){
this.fileList=[{url:this.form.coverPhoto}]
this.checkUrlList=[this.form.coverPhoto]
}else{
this.fileList=[]
this.checkUrlList=[]
}
this.open = true;
this.title = "修改健康档案";
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if(this.form.chronicIdList.length>0){
this.form.chronicIds = this.form.chronicIdList.join(",")
}else{
this.form.chronicIds = ""
}
this.form.coverPhoto = this.checkUrlList[0]
if (this.form.articleId != undefined) {
editHealthScienceApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addHealthScienceApi(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delHealthScienceApi(row.articleId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
openImg(row) {
this.dialogImageUrl = row.coverPhoto;
this.dialogVisible = true;
},
//
imgUpLoad(param, name, index) {
// console.log(param,'image')
param.type = 'canteen'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
} else {
this.$modal.msgError(res.msg)
}
})
.catch((error) => {
this.$modal.msgError(error)
})
},
handleAvatarSuccess(res, file) {
console.log('success')
},
handleRemove(file, fileList) {
let sum = 0
this.checkUrlNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.checkUrlNameList.splice(sum, 1)
this.checkUrlList.splice(sum, 1)
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
formatDate(date) {
// YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
}
};
</script>
<style lang="scss" scoped>
.remind-question{
width: 100%;
height: 50px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: center;
}
.remind-title{
width: 100%;
height: 40px;
font-size: 16px;
font-weight: bold;
color: #000;
display: flex;
align-items: center;
justify-content: center;
}
table td, table th{
border-left: 1px solid #dfe6ec;
border-top: 1px solid #dfe6ec;
}
.table-title {
height: 45px;
background-color: #f8f8f9;
}
.table-label{
height: 45px;
width: 110px;
min-width: 100px;
background-color: #f8f8f9;
}
.table-content{
min-width: 250px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
</style>
SSSSSSSSS

View File

@ -0,0 +1,644 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="关 键 字">
<el-input v-model="queryParams.articleTitle" placeholder="请输入用户姓名、编号或手机号" maxlength="20" clearable style="width: 220px"/>
</el-form-item>
<el-form-item label="所属位置" prop="placeIdList">
<el-cascader v-model="queryParams.placeIdList"
:options="placeOptions" :filterable="true" style="width: 240px" :show-all-levels="false"
:props="{
multiple: true,
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable collapse-tags >
</el-cascader>
</el-form-item>
<el-form-item label="所属组织" prop="deptIdList">
<el-cascader v-model="queryParams.deptIdList"
:options="deptOptions" :filterable="true" placeholder="请选择所属组织" style="width: 240px" :show-all-levels="false"
:props="{
multiple: true,
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable collapse-tags >
</el-cascader>
</el-form-item>
<el-form-item label="慢性病">
<el-select v-model="queryParams.chronicList" placeholder="请选择慢性病" multiple style="width: 220px" clearable collapse-tags>
<el-option v-for="item in chronicOptions"
:key="item.chronicId"
:label="item.chronicName"
:value="item.chronicId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="饮食医嘱">
<el-select v-model="queryParams.doctorAdvice" placeholder="请选择饮食医嘱" multiple style="width: 220px" clearable collapse-tags>
<el-option v-for="item in doctorAdviceOptions"
:key="item.doctorAdvice"
:label="item.doctorAdviceName"
:value="item.doctorAdvice"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableListData" height="800" ref="multipleTable">
<el-table-column label="用户姓名" align="center" prop="nickName" :show-overflow-tooltip="true" >
</el-table-column>
<el-table-column label="用户手机号" align="center" prop="mobile" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="位置信息" align="center" prop="placeFullName" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="饮食医嘱" align="center" prop="doctorAdvice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.doctorAdvice==1">禁食</span>
<span v-if="scope.row.doctorAdvice==2">流食</span>
<span v-if="scope.row.doctorAdvice==3">半流食</span>
<span v-if="scope.row.doctorAdvice==4">治疗饮食</span>
</template>
</el-table-column>
<el-table-column label="就诊号" align="center" prop="doctorNum" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="住院号" align="center" prop="hospitalNum" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="住院日期" align="center" prop="inpatientDate" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="慢性病" align="center" prop="chronicNames" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="劳动强度" align="center" prop="labourIntensity" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.labourIntensity==1">轻劳动</span>
<span v-if="scope.row.labourIntensity==2">中等强度劳动</span>
<span v-if="scope.row.labourIntensity==3">重强度劳动</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框 -->
<el-dialog :title="title" :visible.sync="open" width="980px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-row justify="center">
<table align="center" width="100%" cellspacing="0">
<tr >
<td colspan="4" class="table-title">个人信息</td>
</tr>
<tr >
<td class="table-label"><i class="text-red">*</i> <span >用户姓名</span></td>
<td class="table-content"><span >测试操作员</span></td>
<td class="table-label"><i class="text-red">*</i> <span >用户编号</span></td>
<td class="table-content"><span >232072</span></td>
</tr>
<tr >
<td class="table-label"><i class="text-red">*</i> <span >所属组织</span></td>
<td class="table-content"><span >测试有限责任公司(默认)/后场临时部门</span></td>
<td class="table-label"><span >用户类别</span></td>
<td class="table-content"><span >临时人员</span></td>
</tr>
<tr >
<td class="table-label"><span >用户手机号</span></td>
<td class="table-content"><span >136****0965</span></td>
<td class="table-label"><span >性别</span></td>
<td class="table-content"><span ></span></td>
</tr>
<tr >
<td class="table-label"><span >位置信息</span></td>
<td class="table-content"><span ></span></td>
<td class="table-label"><span >出生日期</span></td>
<td class="table-content"><span ></span></td>
</tr>
<tr >
<td colspan="4" class="table-title">健康信息</td>
</tr>
<tr >
<td class="table-label"><span >就诊号</span></td>
<td class="table-content">
<el-input
v-model="form.doctorNum"
placeholder="请输入就诊号"
maxlength="40"
show-word-limit
/>
</td>
<td class="table-label"><span >住院号</span></td>
<td class="table-content">
<el-input
v-model="form.hospitalNum"
placeholder="请输入住院号"
maxlength="40"
show-word-limit
/>
</td>
</tr>
<tr >
<td class="table-label"><span >身高</span></td>
<td class="table-content">
<el-input
v-model="form.height"
placeholder="请输入住身高"
maxlength="3"
show-word-limit
/>
</td>
<td class="table-label"><span >体重</span></td>
<td class="table-content">
<el-input
v-model="form.weight"
placeholder="请输入住体重"
maxlength="5"
show-word-limit
/>
</td>
</tr>
<tr >
<td class="table-label"><span >血型</span></td>
<td class="table-content">
<el-select v-model="form.bloodType" placeholder="请选择血型" style="width: 100%">
<el-option v-for="item in this.bloodTypeOptions"
:key="item.bloodType"
:label="item.bloodTypeName"
:value="item.bloodType"
></el-option>
</el-select>
</td>
<td class="table-label"><span >慢性病</span></td>
<td class="table-content">
<el-select v-model="form.chronicList" placeholder="请选择慢性病" multiple style="width: 220px" clearable collapse-tags>
<el-option v-for="item in chronicOptions"
:key="item.chronicId"
:label="item.chronicName"
:value="item.chronicId"
></el-option>
</el-select>
</td>
</tr>
<tr >
<td class="table-label"><span >怀孕状态</span></td>
<td class="table-content">
<el-select v-model="form.pregnantStatus" placeholder="请选择怀孕状态" style="width: 100%">
<el-option v-for="item in this.pregnantOptions"
:key="item.pregnantStatus"
:label="item.pregnantStatusName"
:value="item.pregnantStatus"
></el-option>
</el-select>
</td>
<td class="table-label"><span >怀孕日期</span></td>
<td class="table-content"></td>
</tr>
<tr >
<td class="table-label"><span >是否住院</span></td>
<td class="table-content">
<el-select v-model="form.ifHospitalized" placeholder="请选择是否住院" multiple style="width: 220px" clearable collapse-tags>
<el-option id="1"></el-option>
<el-option id="2"></el-option>
</el-select>
</td>
<td class="table-label"><span >住院日期</span></td>
<td class="table-content"></td>
</tr>
<tr >
<td class="table-label"><span >劳动强度</span></td>
<td class="table-content">
<el-select v-model="form.labourIntensity" placeholder="请选择劳动强度" style="width: 100%">
<el-option v-for="item in this.labourIntensityOptions"
:key="item.labourIntensity"
:label="item.labourIntensityName"
:value="item.labourIntensity"
></el-option>
</el-select>
</td>
<td class="table-label"><span >过敏源</span></td>
<td class="table-content">
<el-input
v-model="form.allergen"
placeholder="请输入过敏源"
maxlength="40"
show-word-limit
/>
</td>
</tr>
<tr >
<td class="table-label"><span >饮食医嘱</span></td>
<td class="table-content">
<el-select v-model="form.doctorAdvice" placeholder="请选择饮食医嘱" multiple style="width: 220px" clearable collapse-tags>
<el-option v-for="item in doctorAdviceOptions"
:key="item.doctorAdvice"
:label="item.doctorAdviceName"
:value="item.doctorAdvice"
></el-option>
</el-select>
</td>
<td class="table-label"><span >体重控制目标</span></td>
<td class="table-content">
<el-select v-model="form.weightControl" placeholder="请选择" multiple style="width: 220px" clearable collapse-tags>
<el-option id="1">减肥</el-option>
<el-option id="2">增重</el-option>
</el-select>
</td>
</tr>
<tr >
<td class="table-label"><span >BMI(kg/)</span></td>
<td class="table-content"></td>
<td colspan="2"></td>
</tr>
</table>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import { deptTreeSelect } from '@/api/system/user'
import { dictHealthChronicApi,getHealthSciencePageApi,addHealthScienceApi,editHealthScienceApi,delHealthScienceApi,getHealthInfoPageApi } from "@/api/healthCenter/index";
import { imgUpLoadTwo } from '@/api/system/upload'
export default {
name: "",
dicts: [],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
title:"",
//
open: false,
dateRange:[new Date(),new Date()],
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
picker.$emit('pick', [start, end]);
}
},{
text: '最近一个月',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
},{
text: '最近三个月',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
picker.$emit('pick', [start, end]);
}
}]
},
chronicOptions:[],
doctorAdviceOptions:[{"doctorAdvice":1,"doctorAdviceName":"禁食"},
{"doctorAdvice":2,"doctorAdviceName":"流食"},
{"doctorAdvice":3,"doctorAdviceName":"半流食"},
{"doctorAdvice":4,"doctorAdviceName":"治疗饮食"},
],
bloodTypeOptions:[
{"bloodType":1,"bloodTypeName":"A型"},
{"bloodType":2,"bloodTypeName":"B型"},
{"bloodType":3,"bloodTypeName":"AB型"},
{"bloodType":4,"bloodTypeName":"O型"},
{"bloodType":5,"bloodTypeName":"Rh阳型"},
{"bloodType":6,"bloodTypeName":"Rh阴型"}
],//
pregnantOptions:[
{"pregnantStatus":0,"pregnantStatusName":"保密"},
{"pregnantStatus":1,"pregnantStatusName":"未怀孕"},
{"pregnantStatus":2,"pregnantStatusName":"孕妇(早期)"},
{"pregnantStatus":3,"pregnantStatusName":"孕妇(中期)"},
{"pregnantStatus":4,"pregnantStatusName":"孕妇(晚期)"},
{"pregnantStatus":5,"pregnantStatusName":"乳母"}
],//怀
labourIntensityOptions:[
{"labourIntensity":1,"labourIntensityName":"轻劳动"},
{"labourIntensity":2,"labourIntensityName":"中等强度劳动"},
{"labourIntensity":3,"labourIntensityName":"重强度劳动"}
],//
//
queryParams: {
pageNum: 1,
pageSize: 10,
articleTitle: undefined,//
deptIdList:[],//
chronicList:[], //
placeIdList:[], //
articleType:null //
},
form: {
articleTitle:null,
summary:null,
chronicIdList:[],
coverPhoto:null,
articleType:1,
articleContent:null,
},//
rules: {
articleTitle: [
{ required: true, message: "文章标题不能为空", trigger: "blur" }
],
articleContent: [
{ required: true, message: "文章内容不能为空", trigger: "blur" }
]
},
fileList: [],//
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
};
},
created() {
this.getDeptTree()
this.getList()
this.getChronicList()
},
computed: {
//1
uploadDisabled() {
return this.checkUrlList.length > 0
},
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = this.filterTree(response.data)
})
},
filterTree(nodes) {
return nodes
.map((node) => {
if (node.children) {
node.children = this.filterTree(node.children)
}
return node
})
.filter((node) => node.status !== '1')
},
//
getChronicList() {
dictHealthChronicApi({}).then((response) => {
this.chronicOptions = response.data;
console.log("this.chronicOptions",this.chronicOptions)
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [new Date(),new Date()]
this.queryParams = {
pageNum: 1,
pageSize: 10,
articleTitle: undefined,//
chronicList:[], //
articleType:null //
}
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"articleTitle":this.queryParams.articleTitle,
"articleType":this.queryParams.articleType,
"chronicIds":this.queryParams.chronicList.join(",")||"",
"startDate":this.formatDate(this.dateRange[0]),
"endDate":this.formatDate(this.dateRange[1])
}
// if(this.queryParams.chronicList.length>0){
// this.queryParams.chronicIds = this.queryParams.chronicList.join(",")
// }else{
// this.queryParams.chronicIds = ""
// }
getHealthInfoPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList=[]
this.form = {
articleTitle:null,
summary:null,
chronicIdList:[],
coverPhoto:null,
articleType:1,
articleContent: null,
};
this.resetForm("form");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
handleUpdate(row) {
this.form = Object.assign({}, row);
if(this.form.coverPhoto){
this.fileList=[{url:this.form.coverPhoto}]
this.checkUrlList=[this.form.coverPhoto]
}else{
this.fileList=[]
this.checkUrlList=[]
}
this.open = true;
this.title = "修改健康档案";
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if(this.form.chronicIdList.length>0){
this.form.chronicIds = this.form.chronicIdList.join(",")
}else{
this.form.chronicIds = ""
}
this.form.coverPhoto = this.checkUrlList[0]
if (this.form.articleId != undefined) {
editHealthScienceApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addHealthScienceApi(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delHealthScienceApi(row.articleId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
openImg(row) {
this.dialogImageUrl = row.coverPhoto;
this.dialogVisible = true;
},
//
imgUpLoad(param, name, index) {
// console.log(param,'image')
param.type = 'canteen'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
} else {
this.$modal.msgError(res.msg)
}
})
.catch((error) => {
this.$modal.msgError(error)
})
},
handleAvatarSuccess(res, file) {
console.log('success')
},
handleRemove(file, fileList) {
let sum = 0
this.checkUrlNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.checkUrlNameList.splice(sum, 1)
this.checkUrlList.splice(sum, 1)
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
formatDate(date) {
// YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
}
};
</script>
<style lang="scss" scoped>
.remind-question{
width: 100%;
height: 50px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: center;
}
.remind-title{
width: 100%;
height: 40px;
font-size: 16px;
font-weight: bold;
color: #000;
display: flex;
align-items: center;
justify-content: center;
}
table td, table th{
border-left: 1px solid #dfe6ec;
border-top: 1px solid #dfe6ec;
}
.table-title {
height: 45px;
background-color: #f8f8f9;
}
.table-label{
height: 45px;
width: 110px;
min-width: 100px;
background-color: #f8f8f9;
}
.table-content{
min-width: 250px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
</style>

View File

@ -17,22 +17,22 @@
<el-form-item label="文章标题">
<el-input v-model="queryParams.articleTitle" placeholder="请输入文章标题" maxlength="20" clearable style="width: 220px"/>
</el-form-item>
<el-form-item label="适用慢性病">
<el-select v-model="queryParams.chronicList" multiple style="width: 220px" clearable collapse-tags>
<el-option v-for="item in chronicOptions"
:key="item.chronicId"
:label="item.chronicName"
:value="item.chronicId"
></el-option>
</el-select>
></el-option>
</el-select>
</el-form-item>
<el-form-item label="文章类型">
<el-select v-model="queryParams.articleType" style="width: 220px" clearable collapse-tags>
<el-option label="原创" value="1"></el-option>
<el-option label="转载" value="2"></el-option>
</el-select>
</el-form-item>
<el-option label="转载" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -47,18 +47,18 @@
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800" ref="multipleTable">
<el-table v-loading="loading" :data="tableListData" height="800" ref="multipleTable">
<el-table-column label="序号" align="center" width="80" type="index" fixed="left">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="封面照片" align="center" prop="coverPhoto" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<img :src="scope.row.coverPhoto" v-if="scope.row.coverPhoto" alt="" style="width: 80px;height: 40px;" @click="openImg(scope.row)">
@ -71,26 +71,26 @@
<template slot-scope="scope">
<span v-if="scope.row.articleType==1">原创</span>
<span v-if="scope.row.articleType==2">转载</span>
</template>
</template>
</el-table-column>
<el-table-column label="发布时间" align="center" prop="pushTime" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="可见状态" align="center" prop="ifVisible" :show-overflow-tooltip="true">
</el-table-column>
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
@ -104,7 +104,7 @@
@pagination="getList"
/>
<!-- 对话框 -->
<!-- 对话框 -->
<el-dialog :title="title" :visible.sync="open" width="980px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-row>
@ -125,10 +125,10 @@
:key="item.chronicId"
:label="item.chronicName"
:value="item.chronicId"
></el-option>
</el-select>
</el-form-item>
</el-col>
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="文章封面" prop="coverPhoto">
<el-upload
@ -149,7 +149,7 @@
<i
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="24">
@ -171,7 +171,7 @@
</div>
</template>
<script>
<script>
import { dictHealthChronicApi,getHealthSciencePageApi,addHealthScienceApi,editHealthScienceApi,delHealthScienceApi } from "@/api/healthCenter/index";
import { imgUpLoadTwo } from '@/api/system/upload'
@ -196,7 +196,7 @@ export default {
tableListData: [],
title:"",
//
open: false,
open: false,
dateRange:[new Date(),new Date()],
pickerOptions: {
shortcuts: [{
@ -232,7 +232,7 @@ export default {
pageSize: 10,
articleTitle: undefined,//
chronicList:[], //
articleType:null //
articleType:null //
},
form: {
articleTitle:null,
@ -240,7 +240,7 @@ export default {
chronicIdList:[],
coverPhoto:null,
articleType:1,
articleContent:null,
articleContent:null,
},//
rules: {
articleTitle: [
@ -249,15 +249,15 @@ export default {
articleContent: [
{ required: true, message: "文章内容不能为空", trigger: "blur" }
]
},
},
fileList: [],//
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
dialogImageUrl:"",//
};
},
created() {
created() {
this.getList()
this.getChronicList()
},
@ -267,13 +267,13 @@ export default {
return this.checkUrlList.length > 0
},
},
methods: {
methods: {
//
getChronicList() {
dictHealthChronicApi({}).then((response) => {
this.chronicOptions = response.data;
});
},
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -287,15 +287,15 @@ export default {
pageSize: 10,
articleTitle: undefined,//
chronicList:[], //
articleType:null //
articleType:null //
}
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"articleTitle":this.queryParams.articleTitle,
@ -331,7 +331,7 @@ export default {
chronicIdList:[],
coverPhoto:null,
articleType:1,
articleContent: null,
articleContent: null,
};
this.resetForm("form");
},
@ -362,8 +362,8 @@ export default {
}else{
this.form.chronicIds = ""
}
this.form.coverPhoto = this.checkUrlList[0]
this.form.coverPhoto = this.checkUrlList[0]
if (this.form.articleId != undefined) {
editHealthScienceApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
@ -380,14 +380,14 @@ export default {
}
});
},
handleDelete(row) {
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delHealthScienceApi(row.articleId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
},
openImg(row) {
this.dialogImageUrl = row.coverPhoto;
this.dialogVisible = true;
@ -400,17 +400,17 @@ export default {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
} else {
} else {
this.$modal.msgError(res.msg)
}
})
.catch((error) => {
.catch((error) => {
this.$modal.msgError(error)
})
},
handleAvatarSuccess(res, file) {
console.log('success')
},
},
handleRemove(file, fileList) {
let sum = 0
this.checkUrlNameList.forEach((item, index) => {
@ -422,7 +422,7 @@ export default {
this.checkUrlList.splice(sum, 1)
},
//
handlePictureCardPreview(file) {
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
@ -433,7 +433,7 @@ export default {
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
}
}
};
</script>