Compare commits
7 Commits
master
...
master-dev
| Author | SHA1 | Date |
|---|---|---|
|
|
23ce314810 | 4 days ago |
|
|
9540b9372d | 4 days ago |
|
|
d89c61099d | 4 days ago |
|
|
b53572961a | 4 days ago |
|
|
106290be8c | 4 days ago |
|
|
6f2424f446 | 4 days ago |
|
|
56efdfdd99 | 6 days ago |
17 changed files with 1036 additions and 611 deletions
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@ -0,0 +1,558 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-form |
||||
|
:model="queryParams" |
||||
|
ref="queryForm" |
||||
|
size="small" |
||||
|
:inline="true" |
||||
|
v-show="showSearch" |
||||
|
> |
||||
|
<el-form-item label="报告单版本" prop="code"> |
||||
|
<el-select |
||||
|
v-model="queryParams.param.code" |
||||
|
filterable |
||||
|
placeholder="请选择" |
||||
|
style="width: 100%" |
||||
|
clearable |
||||
|
> |
||||
|
<el-option |
||||
|
v-for="item in typeList" |
||||
|
:key="item.value" |
||||
|
:label="item.lable" |
||||
|
:value="item.value" |
||||
|
> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="导出类型" prop="type"> |
||||
|
<el-select |
||||
|
v-model="queryParams.param.type" |
||||
|
filterable |
||||
|
placeholder="请选择" |
||||
|
style="width: 100%" |
||||
|
clearable |
||||
|
> |
||||
|
<el-option |
||||
|
v-for="item in versionList" |
||||
|
:key="item.value" |
||||
|
:label="item.lable" |
||||
|
:value="item.value" |
||||
|
> |
||||
|
</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-row :gutter="10" class="mb8"> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
> |
||||
|
新增 |
||||
|
</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="danger" |
||||
|
plain |
||||
|
icon="el-icon-delete" |
||||
|
size="mini" |
||||
|
:disabled="multiple" |
||||
|
@click="handleDelete" |
||||
|
>删除</el-button |
||||
|
> |
||||
|
</el-col> |
||||
|
<right-toolbar |
||||
|
:showSearch.sync="showSearch" |
||||
|
@queryTable="getList" |
||||
|
></right-toolbar> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-table |
||||
|
v-loading="loading" |
||||
|
:data="roleList" |
||||
|
@selection-change="handleSelectionChange" |
||||
|
> |
||||
|
<el-table-column type="selection" width="55" align="center" /> |
||||
|
<el-table-column label="报告单版本" prop="code"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.row.code === 'PERSION'">个人版</span> |
||||
|
<span v-if="scope.row.code === 'DOCTOR'">医生版</span> |
||||
|
<span v-if="scope.row.code === 'POSITIVE'">阳性版</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="报告单名称" prop="name" /> |
||||
|
<el-table-column label="导出类型" prop="type"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.row.type === 0">word</span> |
||||
|
<span v-if="scope.row.type === 1">pdf</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="创建人" prop="createBy" width="100" /> |
||||
|
<el-table-column label="创建时间" align="center" prop="createTime"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="操作" |
||||
|
align="center" |
||||
|
class-name="small-padding fixed-width" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-download" |
||||
|
@click="handleDownload(scope.row)" |
||||
|
> |
||||
|
下载报告单模板 |
||||
|
</el-button> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
v-hasPermi="['system:role:edit']" |
||||
|
>修改</el-button |
||||
|
> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-delete" |
||||
|
@click="handleDelete(scope.row)" |
||||
|
v-hasPermi="['system:role:remove']" |
||||
|
>删除</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="640px" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
||||
|
<el-form-item label="报告单版本" prop="code"> |
||||
|
<el-select |
||||
|
v-model="form.code" |
||||
|
filterable |
||||
|
placeholder="请选择" |
||||
|
style="width: 100%" |
||||
|
> |
||||
|
<el-option |
||||
|
v-for="item in typeList" |
||||
|
:key="item.value" |
||||
|
:label="item.lable" |
||||
|
:value="item.value" |
||||
|
> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="报告单名称" prop="code"> |
||||
|
<el-input v-model="form.name" placeholder="请输入"></el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="导出类型" prop="type"> |
||||
|
<el-select |
||||
|
v-model="form.type" |
||||
|
filterable |
||||
|
placeholder="请选择" |
||||
|
style="width: 100%" |
||||
|
:multiple="title == '添加模板' ? true : false" |
||||
|
> |
||||
|
<el-option |
||||
|
v-for="item in versionList" |
||||
|
:key="item.value" |
||||
|
:label="item.lable" |
||||
|
:value="item.value" |
||||
|
> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="上传文件" prop="accessUrl"> |
||||
|
<el-upload |
||||
|
:limit="1" |
||||
|
class="avatar-uploader wj-uploader" |
||||
|
:headers="headers" |
||||
|
:action="uploadFileUrl" |
||||
|
accept=".docx" |
||||
|
:before-upload="handleBeforePdfUpload" |
||||
|
:show-file-list="true" |
||||
|
:on-success="handleUploadPdfAdd" |
||||
|
:file-list="fileList" |
||||
|
:on-remove="handleUploadRemove" |
||||
|
:data="{ type: 2 }" |
||||
|
> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text"> |
||||
|
将文件拖到此处,或 |
||||
|
<em>点击上传</em> |
||||
|
</div> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
</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> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
reportTemplateList, |
||||
|
reportTemplateAdd, |
||||
|
reportTemplateDel, |
||||
|
} from "@/api/reportTemplate/index.js"; |
||||
|
import { getToken } from "@/utils/auth"; |
||||
|
import { getScaleList } from "@/api/his/scale"; |
||||
|
const settings = require("@/config/settings"); |
||||
|
export default { |
||||
|
name: "Role", |
||||
|
data() { |
||||
|
var wordPath = (rule, value, callback) => { |
||||
|
if (!this.form.accessUrl) { |
||||
|
callback(new Error("文件不能为空")); |
||||
|
} else { |
||||
|
callback(); // 一定要每种情况都执行回调 |
||||
|
} |
||||
|
}; |
||||
|
return { |
||||
|
reportList: [], |
||||
|
typeList: [ |
||||
|
{ |
||||
|
lable: "个人版", |
||||
|
value: "PERSION", |
||||
|
}, |
||||
|
{ |
||||
|
lable: "医生版", |
||||
|
value: "DOCTOR", |
||||
|
}, |
||||
|
{ |
||||
|
lable: "阳性版", |
||||
|
value: "POSITIVE", |
||||
|
}, |
||||
|
], |
||||
|
versionList: [ |
||||
|
{ |
||||
|
lable: "word", |
||||
|
value: 0, |
||||
|
}, |
||||
|
{ |
||||
|
lable: "pdf", |
||||
|
value: 1, |
||||
|
}, |
||||
|
], |
||||
|
headers: { |
||||
|
Authorization: "Bearer " + getToken(), |
||||
|
deptId: localStorage.getItem("hospitalId"), |
||||
|
}, |
||||
|
fileList: [], |
||||
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
total: 0, |
||||
|
// 角色表格数据 |
||||
|
roleList: [], |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
param: { code: "", name: "" }, |
||||
|
}, |
||||
|
// 表单参数 |
||||
|
form: { |
||||
|
name: "", |
||||
|
code: "", |
||||
|
accessUrl: "", |
||||
|
type: "", |
||||
|
}, |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
name: [{ required: true, message: "名称不能为空", trigger: "blur" }], |
||||
|
type: [{ required: true, message: "类型不能为空", trigger: "change" }], |
||||
|
code: [{ required: true, message: "版本不能为空", trigger: "blur" }], |
||||
|
accessUrl: [{ required: true, validator: wordPath, trigger: "change" }], |
||||
|
}, |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.queryScaleList(); |
||||
|
this.getList(); |
||||
|
}, |
||||
|
methods: { |
||||
|
handleDownload(_item) { |
||||
|
window.open(settings.apiUrl + _item.accessUrl); |
||||
|
}, |
||||
|
scaleChange(_item) { |
||||
|
this.form.name = _item.name; |
||||
|
this.form.code = _item.code; |
||||
|
}, |
||||
|
/** 查询量表列表 */ |
||||
|
queryScaleList() { |
||||
|
getScaleList({ pageNum: -1 }).then((response) => { |
||||
|
this.scaleList = response.data; |
||||
|
}); |
||||
|
}, |
||||
|
// 上传前校检格式和大小 - 图片 |
||||
|
handleBeforeUpload(file) { |
||||
|
const isLt2M = file.size / 1024 / 1024 < 100; |
||||
|
// 校检文件大小 |
||||
|
if (!isLt2M) { |
||||
|
this.$message.error("上传文件大小不能超过 100MB!"); |
||||
|
} |
||||
|
return isLt2M; |
||||
|
}, |
||||
|
// 上传前校检格式和大小 - 文件 |
||||
|
handleBeforePdfUpload(file) { |
||||
|
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1); |
||||
|
const whiteList = ["docx"]; |
||||
|
if (whiteList.indexOf(fileSuffix) === -1) { |
||||
|
this.$message.error("上传文件只能是 docx"); |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
handleUploadRemove() { |
||||
|
console.log("删除文件列表"); |
||||
|
this.form.accessUrl = ""; |
||||
|
this.form.url = ""; |
||||
|
}, |
||||
|
// 上传成功回 - pdg |
||||
|
handleUploadPdfAdd(res) { |
||||
|
this.form.accessUrl = res.fileName; |
||||
|
this.form.url = res.fileName; |
||||
|
}, |
||||
|
/** 查询角色列表 */ |
||||
|
getList() { |
||||
|
this.loading = true; |
||||
|
reportTemplateList(this.queryParams).then((response) => { |
||||
|
this.roleList = response.data.list; |
||||
|
this.total = response.data.total; |
||||
|
this.loading = false; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
name: "", |
||||
|
code: "", |
||||
|
accessUrl: "", |
||||
|
}; |
||||
|
this.resetForm("form"); |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1; |
||||
|
this.getList(); |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
this.queryParams.param = { |
||||
|
code: "", |
||||
|
name: "", |
||||
|
}; |
||||
|
this.handleQuery(); |
||||
|
}, |
||||
|
// 多选框选中数据 |
||||
|
handleSelectionChange(selection) { |
||||
|
this.ids = selection.map((item) => item.id); |
||||
|
this.single = selection.length != 1; |
||||
|
this.multiple = !selection.length; |
||||
|
}, |
||||
|
|
||||
|
/** 新增按钮操作 */ |
||||
|
handleAdd() { |
||||
|
this.reset(); |
||||
|
this.open = true; |
||||
|
this.title = "添加模板"; |
||||
|
this.fileList = []; |
||||
|
}, |
||||
|
/** 修改按钮操作 */ |
||||
|
handleUpdate(row) { |
||||
|
this.title = "修改模板"; |
||||
|
this.fileList = []; |
||||
|
const { id, url, accessUrl, name, code, type } = JSON.parse( |
||||
|
JSON.stringify(row) |
||||
|
); |
||||
|
this.form = { |
||||
|
id, |
||||
|
url, |
||||
|
accessUrl, |
||||
|
name, |
||||
|
code, |
||||
|
type, |
||||
|
}; |
||||
|
this.open = true; |
||||
|
if (!this.form.accessUrl) return; |
||||
|
let wordurl = this.form.accessUrl; |
||||
|
|
||||
|
let slic = wordurl.slice(wordurl.lastIndexOf("/") + 1); |
||||
|
this.fileList = [{ name: slic, url: this.form.accessUrl }]; |
||||
|
}, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm: function () { |
||||
|
this.$refs["form"].validate((valid) => { |
||||
|
if (valid) { |
||||
|
if (this.form.id != undefined) { |
||||
|
reportTemplateAdd(this.form).then((response) => { |
||||
|
this.$modal.msgSuccess("修改成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} else { |
||||
|
let data = JSON.parse(JSON.stringify(this.form)); |
||||
|
if (data.type.length >= 2) { |
||||
|
data.type = 2; |
||||
|
} else { |
||||
|
data.type = data.type[0]; |
||||
|
} |
||||
|
reportTemplateAdd(this.form).then((response) => { |
||||
|
this.$modal.msgSuccess("新增成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/** 提交按钮(数据权限) */ |
||||
|
submitDataScope: function () { |
||||
|
if (this.form.roleId != undefined) { |
||||
|
this.form.deptIds = this.getDeptAllCheckedKeys(); |
||||
|
dataScope(this.form).then((response) => { |
||||
|
this.$modal.msgSuccess("修改成功"); |
||||
|
this.openDataScope = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
/** 删除按钮操作 */ |
||||
|
handleDelete(row) { |
||||
|
const roleIds = row.id || this.ids; |
||||
|
this.$modal |
||||
|
.confirm("是否确认删?") |
||||
|
.then(function () { |
||||
|
return delRole(roleIds); |
||||
|
}) |
||||
|
.then(() => { |
||||
|
this.getList(); |
||||
|
this.$modal.msgSuccess("删除成功"); |
||||
|
}) |
||||
|
.catch(() => {}); |
||||
|
}, |
||||
|
handleDelete(row) { |
||||
|
try { |
||||
|
const postIds = row.id ? [row.id] : this.ids; |
||||
|
this.$modal |
||||
|
.confirm("是否确认删除数据?") |
||||
|
.then(function () { |
||||
|
return; |
||||
|
}) |
||||
|
.then(() => { |
||||
|
reportTemplateDel({ idList: postIds }).then((response) => { |
||||
|
this.$modal.msgSuccess("删除成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
}) |
||||
|
.catch((err) => { |
||||
|
console.log("err1: ", err); |
||||
|
}); |
||||
|
} catch (err) { |
||||
|
console.log("err2: ", err); |
||||
|
} |
||||
|
}, |
||||
|
/** 导出按钮操作 */ |
||||
|
handleExport() { |
||||
|
this.download( |
||||
|
"system/role/export", |
||||
|
{ |
||||
|
...this.queryParams, |
||||
|
}, |
||||
|
`role_${new Date().getTime()}.xlsx` |
||||
|
); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
<style> |
||||
|
.wj-uploader .el-icon-upload:before { |
||||
|
font-size: 100px; |
||||
|
} |
||||
|
.wj-uploader .el-upload { |
||||
|
display: flex; |
||||
|
align-content: center; |
||||
|
justify-content: center; |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
.wj-uploader .el-upload__text { |
||||
|
line-height: 20px; |
||||
|
width: 100% !important; |
||||
|
} |
||||
|
.avatar-uploader { |
||||
|
height: 180px; |
||||
|
} |
||||
|
.avatar-uploader .el-upload { |
||||
|
border: 1px dashed #d9d9d9 !important; |
||||
|
border-radius: 6px; |
||||
|
cursor: pointer; |
||||
|
position: relative; |
||||
|
overflow: hidden; |
||||
|
width: 100% !important; |
||||
|
height: 180px !important; |
||||
|
line-height: 150px; |
||||
|
} |
||||
|
.el-upload-dragger, |
||||
|
.el-upload { |
||||
|
width: 100% !important; |
||||
|
} |
||||
|
.el-upload-list__item { |
||||
|
transition: none !important; |
||||
|
} |
||||
|
.el-upload-list__item:first-child { |
||||
|
margin-top: 0; |
||||
|
} |
||||
|
</style> |
||||
Loading…
Reference in new issue