Commit 594d6dc0 authored by 小费同学阿's avatar 小费同学阿 💬

Merge remote-tracking branch 'origin/master'

parents 91fa35de 252e3df7
......@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询授权历史列表
export function listHistory(query) {
return request({
url: '/business/history/list',
url: '/system/history/list',
method: 'get',
params: query
})
......@@ -12,7 +12,7 @@ export function listHistory(query) {
// 查询授权历史详细
export function getHistory(id) {
return request({
url: '/business/history/' + id,
url: '/system/history/' + id,
method: 'get'
})
}
......@@ -20,7 +20,7 @@ export function getHistory(id) {
// 新增授权历史
export function addHistory(data) {
return request({
url: '/business/history',
url: '/system/history',
method: 'post',
data: data
})
......@@ -29,7 +29,7 @@ export function addHistory(data) {
// 修改授权历史
export function updateHistory(data) {
return request({
url: '/business/history',
url: '/system/history',
method: 'put',
data: data
})
......@@ -38,7 +38,7 @@ export function updateHistory(data) {
// 删除授权历史
export function delHistory(id) {
return request({
url: '/business/history/' + id,
url: '/system/history/' + id,
method: 'delete'
})
}
......@@ -5,14 +5,14 @@ let isFetching = false;
// 查询医院列表
export function listHospital(query) {
return request({
url: '/business/hospital/list',
url: '/system/hospital/list',
method: 'get',
params: query
})
}
export function listGetUserInfo(query) {
return request({
url: '/business/hospital/listGetUser',
url: '/system/hospital/listGetUser',
method: 'get',
params: query
})
......@@ -27,7 +27,7 @@ export function listHospitalAll() {
// 查询医院详细
export function getHospital(id) {
return request({
url: '/business/hospital/' + id,
url: '/system/hospital/' + id,
method: 'get'
})
}
......@@ -41,7 +41,7 @@ export async function addHospital(data) {
try {
return request({
url: '/business/hospital',
url: '/system/hospital',
method: 'post',
data: data
})
......@@ -55,7 +55,7 @@ export async function addHospital(data) {
// 修改医院
export function updateHospital(data) {
return request({
url: '/business/hospital',
url: '/system/hospital',
method: 'put',
data: data
})
......@@ -64,7 +64,16 @@ export function updateHospital(data) {
// 删除医院
export function delHospital(id) {
return request({
url: '/business/hospital/' + id,
url: '/system/hospital/' + id,
method: 'delete'
})
}
// 获取所有医院ID
export function getHospitalIds(query) {
return request({
url: '/system/hospital/getHospitalIds',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询文档管理列表
export function listManagement(query) {
return request({
url: '/system/management/list',
method: 'get',
params: query
})
}
// 查询文档管理详细
export function getManagement(id) {
return request({
url: '/system/management/' + id,
method: 'get'
})
}
// 新增文档管理
export function addManagement(data) {
return request({
url: '/system/management',
method: 'post',
data: data
})
}
// 修改文档管理
export function updateManagement(data) {
return request({
url: '/system/management',
method: 'put',
data: data
})
}
// 删除文档管理
export function delManagement(id) {
return request({
url: '/system/management/' + id,
method: 'delete'
})
}
......@@ -112,6 +112,43 @@ export const constantRoutes = [
]
},
// 文档管理
{
path: '/document-management',
component: Layout,
hidden: true,
permissions: ['*:*:*'],
children: [
{
path: 'privacy-policy',
props: true,
component: () => import('@/views/document-management/privacy-policy/privacy-policy'),
name: 'privacy-policy',
meta: { title: '隐私政策', icon: 'date' }
},
{
path: 'user-protocol',
props: true,
component: () => import('@/views/document-management/user-protocol/user-protocol'),
name: 'user-protocol',
meta: { title: '用户协议', icon: 'table' }
},
{
path: 'about-us',
props: true,
component: () => import('@/views/document-management/about-us/about-us.vue'),
name: 'about-us',
meta: { title: '关于我们', icon: 'github' }
},
{
path: 'entry-contract',
props: true,
component: () => import('@/views/document-management/entry-contract/entry-contract'),
name: 'entry-contract',
meta: { title: '合同文件', icon: 'component' }
}
]
},
// 文章
{
path: '/article-management',
......
<template>
<div>
关于我们页面
</div>
<div class="policy-container">
<div class="title-paragraph">
<span class="title-text">编辑内容</span>
</div>
<el-row>
<el-col :span="1.5" style="margin: 0 10px 0 75px">
<span>关于我们:</span>
</el-col>
<el-col v-if="isEdit===true" :span="19">
<rich-text v-model="privacyPolicy.content" :height="500" />
</el-col>
<el-col v-if="isEdit===false" :span="19">
<rich-text v-model="privacyPolicy.content" :height="500" :read-only="true" />
</el-col>
</el-row>
<el-row v-show="isEdit">
<el-col style="display: flex;justify-content: left;margin: 20px 0 0 135px">
<el-button type="primary" @click="submit">提 交</el-button>
</el-col>
</el-row>
</div>
</template>
<script>
import RichText from '../rich-text.vue'
import { listManagement,addManagement,updateManagement } from '@/api/business/policy'
import { getUserProfile } from '@/api/system/user'
export default {
name: 'about-us'
name: "privacy-policy",
components: { RichText },
data() {
return {
privacyPolicy: {
type:'2',
content: null
},
isAdd: true,
// 是否可编辑, 平台登录可以,其他不可以
isEdit: null,
}
},
mounted() {
getUserProfile().then(response => {
if (response.data.userType === '00') {
this.isEdit = true
} else {
this.isEdit = false
}
console.log('this.isEdit', this.isEdit)
});
this.getPrivacyPolicy()
},
methods: {
submit() {
console.log('隐私协议', this.privacyPolicy)
// 内容为空不能
if (this.privacyPolicy.content === null || this.privacyPolicy.content === '' || this.privacyPolicy.content === '<p><br></p>') {
this.$modal.msgError('内容不能为空')
return
}
if (this.isAdd) {
// 新增
addManagement(this.privacyPolicy).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('修改成功')
}
})
} else {
// 修改
updateManagement(this.privacyPolicy).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('修改成功')
}
})
}
},
getPrivacyPolicy() {
listManagement({type: '2'}).then(res => {
if (res.rows.length === 0) {
this.isAdd = true
} else {
this.privacyPolicy = res.rows[0]
this.isAdd = false
}
})
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
.policy-container {
padding: 10px 0 80px 0;
background-color: #FFFFFF;
.box-card {
margin: 20px 20px 0 20px;
}
.title-paragraph {
margin: 20px 0 20px 15px;
border-left: 5px solid #5FB54B;
.title-text {
margin-left: 10px;
}
}
}
::v-deep .el-card__header {
background-color: rgb(249, 249, 249);
}
</style>
<template>
<div>入驻合同</div>
<div class="contract-container">
<div class="title-paragraph">
<span class="title-text">入驻合同</span>
</div>
<!-- 入驻合同表 -->
<el-table v-loading="loading" :data="entryContract" style="width: 90%;margin: 0 0 0 60px;">
<el-table-column prop="createTime" label="入驻时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column prop="authorizationDuration" label="授权类型">
<template slot-scope="scope">
<span v-if="scope.row.authorizationDuration < 99">非长期授权</span>
<span v-else>长期授权</span>
</template>
</el-table-column>
<el-table-column prop="authorizationDuration" label="授权时长">
<template slot-scope="scope">
<span v-if="scope.row.authorizationDuration < 99">{{scope.row.authorizationDuration}}</span>
<span v-else>永久</span>
</template>
</el-table-column>
<el-table-column prop="createByName" label="授权账号" />
<el-table-column prop="fileName" label="入驻合同">
<template slot-scope="scope">
<span>{{ scope.row.fileName || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button style="color: #5FB54B" type="text" @click="check(scope.row)">查看</el-button>
<el-button style="color: #5FB54B" type="text" @click="downloadPdf(scope.row)">下载</el-button>
</template>
</el-table-column>
</el-table>
<div class="title-paragraph" style="margin-top: 30px">
<span class="title-text">授权合同</span>
</div>
<!-- 授权合同表 -->
<el-table v-loading="loading" :data="authorizationHistory" style="width: 90%;margin: 0 0 0 60px;">
<el-table-column prop="createTime" label="授权时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column prop="authorizationDuration" label="授权类型">
<template slot-scope="scope">
<span v-if="scope.row.authorizationDuration < 99">非长期授权</span>
<span v-else>长期授权</span>
</template>
</el-table-column>
<el-table-column prop="authorizationDuration" label="授权时长">
<template slot-scope="scope">
<span v-if="scope.row.authorizationDuration < 99">{{scope.row.authorizationDuration}}</span>
<span v-else>长期</span>
</template>
</el-table-column>
<el-table-column prop="" label="授权截止日期">
<template slot-scope="scope">
<span>{{addDays(scope.row.currentTime, scope.row.authorizationDuration)}}</span>
</template>
</el-table-column>
<el-table-column prop="fileName" label="授权合同">
<template slot-scope="scope">
<span>{{ scope.row.fileName || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button style="color: #5FB54B" type="text" @click="check(scope.row)">查看</el-button>
<el-button style="color: #5FB54B" type="text" @click="downloadPdf(scope.row)">下载</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { listGetUserInfo } from '../../../api/business/hospital'
import { listHistory } from '../../../api/business/history'
export default {
name: 'entry-contract'
name: 'entry-contract',
data() {
return {
// 图片根据不同环境显示路径
baseUrl: process.env.VUE_APP_TEST_API,
// 授权合同
authorizationHistory: [],
// 入驻合同
entryContract: [],
// 当前登录的医院ID
currentHospitalId: '',
loading: true,
}
},
mounted() {
this.getCurrentHospital()
setTimeout(() => {
this.getContract()
}, 500)
},
methods: {
getContract() {
console.log('xxxx', this.currentHospitalId)
listHistory({ hospitalId: this.currentHospitalId }).then(res => {
const list = res.rows
console.log('授权历史312', list)
const lastData = list.pop()
console.log('---123', lastData)
this.entryContract.push(lastData)
this.authorizationHistory = list
console.log('授权合同', this.authorizationHistory)
console.log('入驻合同', this.entryContract)
this.loading = false
})
},
getCurrentHospital() {
listGetUserInfo().then(res => {
console.log('当前医院', res)
this.currentHospitalId = res.rows[0].id
console.log('医院ID', this.currentHospitalId)
})
},
check(row) {
console.log('pdf', row.contract)
console.log('pdf2', this.baseUrl)
window.open(this.baseUrl + row.contract)
},
downloadPdf() {
},
/** 通过授权历史获取到期日期 */
addDays(date, str) {
if (str === null) {
return null;
}
const days = str.split('.')[0]
if (parseInt(days) >= 99) {
return '长期'
}
const result = new Date(date)
result.setDate(result.getDate() + days * 365)
const formatTime = this.formatTime(result)
return formatTime
},
/** 格式化时间-年月日 */
formatTime(date) {
// 获取年月日
var year = date.getFullYear();
var month = date.getMonth() + 1; // 月份从0开始,需要加1
var day = date.getDate();
// 将年月日格式化为字符串
if (month < 10) {
month = '0' + month
}
if (day < 10) {
day = '0' + day
}
const formattedDate = year + '-' + month + '-' + day
return formattedDate;
},
}
}
</script>
<style scoped>
<style scoped lang="scss">
.contract-container {
width: 1640px;
height: 880px;
//margin: 0 0 0 15px;
padding: 10px 0 80px 0;
background-color: #FFFFFF;
.title-paragraph {
margin: 20px 0 20px 15px;
border-left: 5px solid #5FB54B;
.title-text {
margin-left: 10px;
}
}
}
</style>
<template>
<div>
<el-upload
:action="uploadUrl"
:before-upload="handleBeforeUpload"
:on-success="handleUploadSuccess"
:on-error="handleUploadError"
name="file"
:show-file-list="false"
:headers="headers"
style="display: none"
ref="upload"
v-if="this.type == 'url'"
>
</el-upload>
<div class="editor" ref="editor" :style="styles"></div>
</div>
</template>
<script>
import Quill from "quill";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import { getToken } from "@/utils/auth";
export default {
name: "RichText",
props: {
/* 编辑器的内容 */
value: {
type: String,
default: "",
},
/* 高度 */
height: {
type: Number,
default: null,
},
/* 最小高度 */
minHeight: {
type: Number,
default: null,
},
/* 只读 */
readOnly: {
type: Boolean,
default: false,
},
// 上传文件大小限制(MB)
fileSize: {
type: Number,
default: 5,
},
/* 类型(base64格式、url格式) */
type: {
type: String,
default: "url",
}
},
data() {
return {
uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken()
},
Quill: null,
currentValue: "",
options: {
theme: "snow",
bounds: document.body,
debug: "warn",
modules: {
// 工具栏配置
toolbar: [
["bold", "italic", "underline"], // 加粗 斜体 下划线 删除线
// ["blockquote", "code-block"], // 引用 代码块
[{ list: "ordered" }], // 有序、无序列表
[{ indent: "-1" }, { indent: "+1" }], // 缩进
// [{ size: ["small", false, "large", "huge"] }], // 字体大小
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
// [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
[{ align: [] }], // 对齐方式
// ["clean"], // 清除文本格式
// ["link", "image", "video"] // 链接、图片、视频
],
},
placeholder: "请输入内容",
readOnly: this.readOnly,
},
};
},
computed: {
styles() {
let style = {};
if (this.minHeight) {
style.minHeight = `${this.minHeight}px`;
}
if (this.height) {
style.height = `${this.height}px`;
}
return style;
},
},
watch: {
value: {
handler(val) {
if (val !== this.currentValue) {
this.currentValue = val === null ? "" : val;
if (this.Quill) {
this.Quill.pasteHTML(this.currentValue);
}
}
},
immediate: true,
},
},
mounted() {
this.init();
},
beforeDestroy() {
this.Quill = null;
},
methods: {
init() {
const editor = this.$refs.editor;
this.Quill = new Quill(editor, this.options);
// 如果设置了上传地址则自定义图片上传事件
if (this.type == 'url') {
let toolbar = this.Quill.getModule("toolbar");
toolbar.addHandler("image", (value) => {
this.uploadType = "image";
if (value) {
this.$refs.upload.$children[0].$refs.input.click();
} else {
this.quill.format("image", false);
}
});
}
this.Quill.pasteHTML(this.currentValue);
this.Quill.on("text-change", (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML;
const text = this.Quill.getText();
const quill = this.Quill;
this.currentValue = html;
this.$emit("input", html);
this.$emit("on-change", { html, text, quill });
});
this.Quill.on("text-change", (delta, oldDelta, source) => {
this.$emit("on-text-change", delta, oldDelta, source);
});
this.Quill.on("selection-change", (range, oldRange, source) => {
this.$emit("on-selection-change", range, oldRange, source);
});
this.Quill.on("editor-change", (eventName, ...args) => {
this.$emit("on-editor-change", eventName, ...args);
});
},
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件大小
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
return true;
},
handleUploadSuccess(res, file) {
// 获取富文本组件实例
let quill = this.Quill;
// 如果上传成功
if (res.code == 200) {
// 获取光标所在位置
let length = quill.getSelection().index;
// 插入图片 res.url为服务器返回的图片地址
quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
// 调整光标到最后
quill.setSelection(length + 1);
} else {
this.$message.error("图片插入失败");
}
},
handleUploadError() {
this.$message.error("图片插入失败");
},
},
};
</script>
<style>
.editor, .ql-toolbar {
white-space: pre-wrap !important;
line-height: normal !important;
}
.quill-img {
display: none;
}
.ql-snow .ql-tooltip[data-mode="link"]::before {
content: "请输入链接地址:";
}
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
border-right: 0px;
content: "保存";
padding-right: 0px;
}
.ql-snow .ql-tooltip[data-mode="video"]::before {
content: "请输入视频地址:";
}
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
content: "14px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
content: "10px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
content: "18px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
content: "32px";
}
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
content: "文本";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
content: "标题1";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
content: "标题2";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
content: "标题3";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
content: "标题4";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
content: "标题5";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
content: "标题6";
}
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
content: "标准字体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
content: "衬线字体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
content: "等宽字体";
}
</style>
<template>
<div>用户协议</div>
<div class="protocol-container">
<div class="title-paragraph">
<span class="title-text">编辑内容</span>
</div>
<el-row>
<el-col :span="1.5" style="margin: 0 10px 0 75px">
<span>用户协议:</span>
</el-col>
<el-col v-if="isEdit===true" :span="19">
<rich-text v-model="privacyPolicy.content" :height="500" />
</el-col>
<el-col v-if="isEdit===false" :span="19">
<rich-text v-model="privacyPolicy.content" :height="500" :read-only="true" />
</el-col>
</el-row>
<el-row v-show="isEdit">
<el-col style="display: flex;justify-content: left;margin: 20px 0 0 135px">
<el-button type="primary" @click="submit">提 交</el-button>
</el-col>
</el-row>
</div>
</template>
<script>
import RichText from '../rich-text.vue'
import { listManagement,addManagement,updateManagement } from '@/api/business/policy'
import { getUserProfile } from '@/api/system/user'
export default {
name: 'user-protocol'
name: "user-protocol",
components: { RichText },
data() {
return {
privacyPolicy: {
type:'1',
content: null
},
isAdd: true,
// 是否可编辑, 平台登录可以,其他不可以
isEdit: null,
}
},
mounted() {
getUserProfile().then(response => {
if (response.data.userType === '00') {
this.isEdit = true
} else {
this.isEdit = false
}
console.log('this.isEdit', this.isEdit)
});
this.getPrivacyPolicy()
},
methods: {
submit() {
console.log('隐私协议', this.privacyPolicy)
// 内容为空不能
if (this.privacyPolicy.content === null || this.privacyPolicy.content === '' || this.privacyPolicy.content === '<p><br></p>') {
this.$modal.msgError('内容不能为空')
return
}
if (this.isAdd) {
// 新增
addManagement(this.privacyPolicy).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('修改成功')
}
})
} else {
// 修改
updateManagement(this.privacyPolicy).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('修改成功')
}
})
}
},
getPrivacyPolicy() {
listManagement({type: '1'}).then(res => {
if (res.rows.length === 0) {
this.isAdd = true
} else {
this.privacyPolicy = res.rows[0]
this.isAdd = false
}
})
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
.protocol-container {
padding: 10px 0 80px 0;
background-color: #FFFFFF;
.box-card {
margin: 20px 20px 0 20px;
}
.title-paragraph {
margin: 20px 0 20px 15px;
border-left: 5px solid #5FB54B;
.title-text {
margin-left: 10px;
}
}
}
::v-deep .el-card__header {
background-color: rgb(249, 249, 249);
}
</style>
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