医案管理

This commit is contained in:
yanwenlong
2023-11-30 21:49:03 +08:00
parent 428a69aa1d
commit bfcc3f336e
4 changed files with 652 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ const mainRoutes = {
{ path: '/book-comments', component: _import('modules/book/bookComments'), name: 'book-comments', meta: { title: '书评管理', isTab: true } },
{ path: '/clock', component: _import('modules/book/clock'), name: 'clock', meta: { title: '打卡管理', isTab: true } },
{ path: '/talkBook', component: _import('modules/book/talkBook'), name: 'talkBook', meta: { title: '讲书管理', isTab: true } },
{ path: '/yian', component: _import('modules/book/yian'), name: 'yian', meta: { title: '医案管理', isTab: true } },
{ path: '/acupointManagement', component: _import('modules/acupoint/acupointManagement'), name: 'acupointManagement', meta: { title: '经穴分类管理', isTab: true } },
{ path: '/acupointList', component: _import('modules/acupoint/acupointList'), name: 'acupointList', meta: { title: '经穴文章列表', isTab: true } },
{ path: '/acupointDetail', component: _import('modules/acupoint/acupointDetail'), name: 'acupointDetail', meta: { title: '穴位详细', isTab: true } },

View File

@@ -143,6 +143,11 @@
<el-button type="text" size="small">讲书管理</el-button>
</router-link>
</el-dropdown-item>
<el-dropdown-item>
<router-link :to="{path: 'yian' , query:{ id : scope.row.id , pageIndex} }">
<el-button type="text" size="small">医案管理</el-button>
</router-link>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-button v-if="scope.row.chapterStatus == '未处理' || scope.row.chapterStatus == '失败'" type="text" size="small" @click="chapterHandle(scope.row.id,scope.row)">章节拆分</el-button> -->

View File

@@ -0,0 +1,412 @@
<template>
<el-dialog :title="!dataForm.yianid ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
@close="handlereset" lock-scroll width="750px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="100px">
<!-- <el-form-item label="所属分类" prop="poids">
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" clearable></el-cascader>
</el-form-item> -->
<!-- <el-form-item label="商品类型" prop="goodsType">
<el-select v-model="dataForm.goodsType" placeholder="请选择">
<el-option v-for="item in goodsTypeList" :key="item.dictType" :label="item.dictValue" :value="item.dictType">
</el-option>
</el-select>
</el-form-item> -->
<!-- 关联的图书ids -->
<el-form-item label="标题" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入标题"></el-input>
</el-form-item>
<!-- <el-form-item label="封面图" prop="productImages">
<el-upload :limit="1" class="el-uploadfeng "
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
:action="baseUrl + '/oss/fileoss'" list-type="picture-card" :on-preview="handlePictureCardPreview"
:file-list="fileList" :on-success="handlePicSuccess" accept=".jpeg,.jpg,.gif,.png" :on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<img width="100%" :src="dataForm.productImages" alt="">
</el-dialog>
</el-form-item> -->
<!-- <el-form-item label="简介/描述" prop="bookdesc">
<el-input type="textarea" rows="4" v-model="dataForm.bookdesc"></el-input>
</el-form-item> -->
<el-form-item label="医案内容" prop="contents">
<el-upload class="avatar-uploader" :action="baseUrl + '/oss/fileoss'" accept=".jpeg,.jpg,.gif,.png" :show-file-list="false" :on-success="contentUploadSuccess" >
</el-upload>
<quill-editor v-model="dataForm.contents" ref="myQuillEditor" :options="editorOption"
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
@ready="onEditorReady($event)" class="shangpin_editor">
</quill-editor>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handlereset">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import {
quillEditor
} from 'vue-quill-editor'
import global from '../../common/common.vue' //引入共用组间
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
['blockquote', 'code-block'], //引用,代码块
[{ 'header': 1 }, { 'header': 2 }], // 几级标题
[{ 'list': 'ordered' }, { 'list': 'bullet' }], // 有序列表,无序列表
[{ 'script': 'sub' }, { 'script': 'super' }], // 下角标,上角标
[{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
[{ 'direction': 'rtl' }], // 文字输入方向
[{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],// 标题
[{ 'color': [] }, { 'background': [] }], // 颜色选择
[{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }],// 字体
[{ 'align': [] }], // 居中
['clean'], // 清除样式,
['link', 'image'], // 上传图片、上传视频
]
export default {
data() {
return {
baseUrl: global.baseUrl,
visible: false,
categorys: [],
fileList: [], // 封面图
swiperfileList: [],
dialogVisible: false,
props: {
value: "catId",
label: "name",
children: "children",
checkStrictly: true
},
dataForm: {
bookId: 0,
limitCountImg: 1, // 图片数量
// productImageList: '', // 轮播图
showBtnDealImg: true,
noneBtnImg: false,
title: '',
productImages: '',
bookdesc:'',
yianid:null,
sort: null,
},
dataRule: {
title: [{
required: true,
message: '书评标题不能为空',
trigger: 'blur'
}],
// productImages: [{
// required: true,
// message: '商品图不能为空',
// trigger: 'blur'
// }],
},
// 富文本编辑器配置
editorOption: {
modules: {
history: {
delay: 1000,
maxStack: 50,
userOnly: false
},
toolbar: {
container: toolbarOptions,
handlers: {
image: function (value) {
if (value) {
// 调用element的图片上传组件
document.querySelector('.avatar-uploader input').click()
} else {
this.quill.format('image', false)
}
}
}
},
},
// modules: {
// toolbar: [
// ['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
// ['blockquote', 'code-block'], // 引用 代码块
// [{
// header: 1
// }, {
// header: 2
// }], // 1、2 级标题
// [{
// list: 'ordered'
// }, {
// list: 'bullet'
// }], // 有序、无序列表
// [{
// script: 'sub'
// }, {
// script: 'super'
// }], // 上标/下标
// [{
// indent: '-1'
// }, {
// indent: '+1'
// }], // 缩进
// [{
// direction: 'rtl'
// }], // 文本方向
// [{
// size: ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36']
// }], // 字体大小
// [{
// header: [1, 2, 3, 4, 5, 6]
// }], // 标题
// [{
// color: []
// }, {
// background: []
// }], // 字体颜色、字体背景颜色
// // [{ font: ['songti'] }], // 字体种类
// [{
// align: []
// }], // 对齐方式
// ['clean'], // 清除文本格式
// ['image'] // 链接、图片、视频
// ]
// },
placeholder: '请输入正文'
},
}
},
created() {
},
methods: {
init(id, bookId) {
id ? '' : id=0
this.dataForm.yianid = id || null
this.dataForm.bookId = bookId || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.bookId) {
this.$http({
url: this.$http.adornUrl('/book/bookMedicalRecords/getById?medicalRecordsId='+ id),
method: 'post',
// params: this.$http.adornParams()
}).then(({
data
}) => {
// console.log(data,666)
if (data && data.code === 0 && data.entity != null) {
this.dataForm.bookId = data.entity.bookId
this.dataForm.title = data.entity.title
this.dataForm.contents = data.entity.content
this.dataForm.medicalRecordsId = data.entity.medicalRecordsId
this.dataForm.sort = data.entity.sort
}
})
}
})
},
dealImgChange(file, fileList) {
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
},
// 表单提交
dataFormSubmit() {
// console.log('userid', this.$store.state.user.id)
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/bookMedicalRecords/saveOrUpdate`),
method: 'post',
data: this.$http.adornData({
'bookId': this.dataForm.bookId || undefined,
'title': this.dataForm.title,
// 'image': this.dataForm.productImages,
'content': this.dataForm.contents,
// 'userid': this.$store.state.user.id,
// 'bookdesc': this.dataForm.bookdesc,
'medicalRecordsId': this.dataForm.yianid,
"sort": this.dataForm.sort
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.dataForm.contents = ''
this.$refs['dataForm'].resetFields()
// this.$refs['dataForm'].reset()
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
changeTime(e) {
console.log(e)
},
handlePictureCardPreview(file) {
this.dataForm.productImages = file.url;
this.dialogVisible = true;
},
bannerHandlePicSuccess(res, file) {
// 轮播图上传成功
if (res.msg == "success") {
this.swiperfileList.push({
name: file.name,
url: res.url
})
this.dataForm.productImages = res.url
console.log(this.swiperfileList,this.dataForm.productImages)
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
}
},
// 字符串图片地址
getStringImgUrl() {
let arr = this.swiperfileList.map(item => item.url)
if (arr.length <= 0) {
return null
} else {
return arr.toString()
}
},
contentUploadSuccess(res, file) {
// console.log(res)
let quill = this.$refs.myQuillEditor.quill
// 如果上传成功
if (res) {
// 获取光标所在位置
let length = quill.getSelection().index;
// 插入图片res为服务器返回的图片链接地址
quill.insertEmbed(length, 'image', res.url)
// 调整光标到最后
quill.setSelection(length + 1)
} else {
// 提示信息需引入Message
this.$message.error('图片插入失败!')
}
},
handlePicSuccess(res, file) {
// console.log(res,'res')
if (res.msg == "success") {
this.dataForm.productImages = res.url;
this.fileList.push({
name: file.name,
url: res.url
})
this.dataForm.productImages = res.url
console.log(this.dataForm.productImages,'productImages')
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
}
},
handleRemove(file, fileList) {
this.dataForm.productImages = '';
this.fileList = fileList
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
},
handlereset() {
this.fileList = [],
this.visible = false
this.swiperfileList = []
this.$refs['dataForm'].resetFields()
this.dataForm.contents = ''
// this.$refs['dataForm'].reset()
},
// 失去焦点事件
onEditorBlur(quill) {
console.log('editor blur!', quill)
},
// 获得焦点事件
onEditorFocus(quill) {
//console.log('editor focus!', quill)
},
// 准备富文本编辑器
onEditorReady(quill) {
// console.log('editor ready!', quill)
},
},
components: {
quillEditor
},
mounted() {
// this.$bus.$on("haveBookIds", (data) => {
// // console.log('haveBookIds', data)
// data.bookIds.length > 0 ? this.dataForm.Books = data.bookIds : this.dataForm.Books = []
// });
},
watch: {
visible: {
handler(val, oldVal) {
// this.getGoodsTypeList()
},
deep: true
},
}
}
</script>
<style lang="less">
// .disUoloadSty {
// .el-upload--picture-card {
// display: none;
// /* 上传按钮隐藏 */
// }
// }
// .el-form-item {
// /deep/ .el-form-item__label {
// font-size: 12px;
// }
// }
.el-uploadfeng {
.el-upload-list__item {
width: 120px;
height: 120px;
}
.el-upload--picture-card {
width: 120px;
height: 120px;
line-height: 120px;
}
}
.shangpin_editor .ql-editor {
height: 150px;
}
</style>

View File

@@ -0,0 +1,234 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<!-- <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> -->
<el-form-item>
<!-- <el-button @click="getDataList()">查询</el-button> -->
<el-button v-if="isAuth('book:bookchapter:save')" type="primary" @click="addOrUpdateHandle()">新增医案</el-button>
<el-button v-if="isAuth('book:bookchapter:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">删除</el-button>
<!-- <router-link :to="{path: 'book-book' , query:{ upPageIndex } }">
<el-button type="primary">返回上一级</el-button>
</router-link> -->
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column label="序号" width="70" align="center">
<template slot-scope="scope">
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<!-- <el-table-column
prop="id"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="bookId"
header-align="center"
align="center"
label="图书id">
</el-table-column> -->
<el-table-column
prop="title"
header-align="center"
align="center"
label="标题">
</el-table-column>
<!-- <el-table-column
prop="content"
header-align="center"
align="center"
:show-overflow-tooltip="true"
label="内容">
</el-table-column> -->
<el-table-column
prop="image"
header-align="center"
align="center"
label="封面图">
<template slot-scope="scope">
<img :src="scope.row.image" width="100px" />
</template>
</el-table-column>
<!-- <el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column> -->
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<!-- <el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="delFlag"
header-align="center"
align="center"
label="">
</el-table-column> -->
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.medicalRecordsId)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.medicalRecordsId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './yian-add-or-update.vue'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [1],
bookid:0,
upPageIndex:0,
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.bookid = this.$route.query.id;
if(this.$route.query.upPageInde != null){
this.pageIndex = this.$route.query.upPageIndex;
console.log(this.pageIndex)
}
this.upPageIndex = this.$route.query.pageIndex;
console.log(this.bookid)
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
// url: this.$http.adornUrl('/book/bookMedicalRecords/list'),
url: this.$http.adornUrl('/book/bookMedicalRecords/listByBookId'),
method: 'post',
data: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
//'key': this.dataForm.key,
'bookId' : this.bookid
})
// data: {
// 'page': this.pageIndex,
// 'limit': this.pageSize,
// // //'key': this.dataForm.key,
// 'bookid' : this.bookid
// }
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.records
this.totalPage = data.page.total
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, this.bookid)
})
},
// 删除
deleteHandle (id) {
// var ids = id ? [id] : this.dataListSelections.map(item => {
// return item.id
// })
this.$confirm(`确定进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/bookMedicalRecords/del?medicalRecordsId='+ id),
method: 'post',
// data: this.$http.adornData(id, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>