This commit is contained in:
liuyuan
2025-07-21 13:00:58 +08:00
parent 9ba542465b
commit 3e40db6eb5
6 changed files with 2353 additions and 10 deletions

View File

@@ -78,10 +78,13 @@ const mainRoutes = {
{ path: '/training-course-list', component: _import('modules/trainingCourse/training-course-list'), name: 'training-course-list', meta: { title: '培训班管理', isTab: true } },
{ path: '/training-course-user', component: _import('modules/trainingCourse/training-course-user'), name: 'training-course-user', meta: { title: '用户列表', isTab: true } },
{ path: '/talents-list', component: _import('modules/talents/talents-list'), name: 'talents-list', meta: { title: '太湖英才列表', isTab: true } },
{ path: '/course-taihumedList', component: _import('modules/course/taihumedList'), name: 'course-taihumedList', meta: { title: '太湖标签', isTab: true } },
{ path: '/courses-list', component: _import('modules/talents/courses-list'), name: 'courses-list', meta: { title: '查看课程', isTab: true } },
{ path: '/mergeList', component: _import('modules/certificate/mergeList'), name: 'mergeList', meta: { title: '小班、自考证书', isTab: true } },
{ path: '/medicalrecords-medicalList', component: _import('modules/medicalrecords/medicalList'), name: 'medicalrecords-medicalList', meta: { title: '医案列表', isTab: true } },
],
beforeEnter (to, from, next) {
let token = Vue.cookie.get('token')

View File

@@ -5,11 +5,13 @@
class="info_bg"
style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis"
>
当前标签<span style="color: #17b3a3; font-weight: 600">{{
当前{{currentNode&&['wait','false','all','success'].includes(currentNode.data.id)?'状态':'标签' }}<span style="color: #17b3a3; font-weight: 600"
:style="`${currentNode&&currentNode.data.color?`color: ${currentNode.data.color}`:''}`"
>{{
currentNode ? currentNode.data.title : ""
}}</span>
</p>
<el-button
<el-button v-if="currentNode&&!['wait','false','all'].includes(currentNode.data.id)"
type="primary"
@click="addOrUpdateHandle()"
style="float: right"
@@ -55,8 +57,9 @@
slot-scope="{ node, data }"
@click="source == 'tags' ? handleClickNodes(node, data, 'edit') : ''"
:class="
`${currentNode && currentNode.data.id == data.id ? 'isSelect' : ''}`
`${currentNode && currentNode.data.id == data.id ? `isSelect` : ''}`
"
:style="`${currentNode && currentNode.data.id == data.id&&data.bgcolor ? `background-image: linear-gradient(-45deg, #fff, ${data.bgcolor});` : ''}`"
style=" padding-left: 5px;
box-sizing: border-box;"
>
@@ -68,7 +71,7 @@
v-if="data.isLast == 1 && source == 'shop'"
style="margin-right: 10px"
></el-checkbox
>{{ node.label }}</span
><span :style="`${data.color?`color:${data.color};font-weight:bold`:''}`">{{ node.label }}</span></span
>
<span v-if="source == 'tags'">
<!-- v-if="node.level <= 1" -->
@@ -76,7 +79,7 @@
type="text"
size="mini"
@click.stop="handleClickNodes(node, data, 'addChildren')"
v-if="data.isLast != 1&&!disableAddChild"
v-if="data.isLast != 1&&!disableAddChild&&!data.isDisableAddChild"
>
添加下级
</el-button>

View File

@@ -0,0 +1,534 @@
<template>
<div class="mod-config">
<el-dialog
:title="`${isEdit ? '编辑' : '新增'}医案`"
:visible.sync="dialogVisible"
:close-on-click-modal="false"
width="600px"
>
<div v-if="dialogVisible">
<el-form
:rules="dataRule"
:model="addCertificateForm"
ref="addCertificateForm"
label-width="110px"
>
<!-- <div style="background-color: #f0f0f0;padding:0 10px;box-sizing: border-box;color: #000;">
<p>绑定用户</p>
</div> -->
<template v-if="pageType == 'label'">
<el-form-item
label="手机号/邮箱:"
prop="userKey"
class="form_item"
>
<div style="display: flex;align-items: center;">
<el-autocomplete
v-if="!isEdit"
style="width: 400px;"
v-model="addCertificateForm.userKey"
:fetch-suggestions="loadAll"
placeholder="请输入手机号/邮箱"
@select="handleSelect"
>
<template #default="{ item }">
<div class="custom-item">
<span>{{ item.tel ? item.tel : item.email }}</span>
<span
style="color: gray; margin-left: 10px;"
v-if="item.name"
>({{ item.name }})</span
>
</div>
</template>
</el-autocomplete>
<span v-if="isEdit">{{ addCertificateForm.userKey }}</span>
</div>
</el-form-item>
<el-form-item
label="用户姓名:"
style="width: 400px;"
v-if="addCertificateForm.userId"
prop="user"
class="form_item"
>
<div>
<!-- <span
style="width: 110px;display: inline-block;text-align: right;"
>用户姓名</span
> -->
{{
addCertificateForm.userName
? addCertificateForm.userName
: "-"
}}
</div></el-form-item
>
</template>
<template v-if="pageType == 'user'">
<el-form-item label="手机号/邮箱:" prop="user" class="form_item">
<div style="display: flex;align-items: center;">
{{ addCertificateForm.userKey }}
</div>
</el-form-item>
<el-form-item
label="用户姓名:"
style="width: 400px;"
prop="user"
class="form_item"
>
<div>
{{
addCertificateForm.userName
? addCertificateForm.userName
: "-"
}}
</div></el-form-item
>
<el-form-item label="医案分类" prop="user" class="form_item">
<div>
<el-cascader
:disabled="isEdit"
style="width: 400px;"
:show-all-levels="false"
v-model="addCertificateForm.labelId"
:props="{
value: 'id',
label: 'title'
}"
:options="cateOptions"
placeholder="医案分类"
@change="handleChange"
></el-cascader></div
></el-form-item>
</template>
<div
class="flexbox width100"
style="display: flex;align-items: center;"
>
<div>
<el-form-item label="标题:" prop="title">
<el-input
v-model="addCertificateForm.title"
placeholder="请输入医案标题"
style="width: 400px;"
></el-input>
</el-form-item>
</div>
</div>
<!-- <el-form-item label="课程名称:" prop="course" class="form_item">
<el-button plain type="primary" @click="selectCourse('addCertificateForm')"
size="mini">选择</el-button>
<span style="margin-left: 20px"></span>
<br/>
<div v-if="addCertificateForm.courseId" style="font-weight: bold;margin-top: 20px;display: flex;align-items: center;justify-content: space-between;"><p><img v-if="addCertificateForm.courseImg" :src="addCertificateForm.courseImg" alt=""style="width: 30px;height: 40px;margin-right: 20px;">{{ addCertificateForm.courseName }}</p><span @click="clearCourse" style="color: red;cursor: pointer;"><i class="el-icon-delete" style="margin-right: 4px;"></i> 删除</span></div>
</el-form-item> -->
<!-- <el-form-item label="医案编号" prop="certificateNo" class="form_item">
<el-input
v-model="addCertificateForm.certificateNo"
placeholder="请输入医案编号"
style="width: 400px;"
></el-input>
</el-form-item> -->
<el-form-item
label="上传医案"
prop="title"
class="form_item"
v-if="dialogVisible"
>
<el-upload
action="https://api.nuttyreading.com/oss/fileoss"
list-type="picture-card"
accept="image/png, image/jpeg"
:file-list="fileList"
:on-success="onSuccessImg"
:before-upload="beforeUpload"
:on-progress="onProgress"
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{ file }">
<img
class="el-upload-list__item-thumbnail"
:src="file.url"
alt=""
/>
<span class="el-upload-list__item-actions">
<!-- <span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span> -->
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<i class="el-icon-delete"></i>
</span>
</span>
<!-- 上传中的加载动画 -->
<div v-if="file.uploading" class="loading-spinner">
<i class="el-icon-loading"></i>
</div>
</div>
</el-upload>
<!-- <div class="flexBox" style="width:100%;justify-content: space-between;">
<div class="" style="display:flex">
<div
style="display:flex; align-items:center; width:100%;justify-content:center">
<div style="margin-right:15px">封面图</div>
<div>
<el-upload class="avatar-uploader" :action="baseUrl + '/oss/fileoss'"
:show-file-list="false" :on-success="handlePicSuccess">
<img v-if="fimages" :src="fimages" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
<div>
<div v-if="fimages != ''">
<el-tag class="delImgBtn" @click="delImg()"
type="danger">清空图片</el-tag>
</div>
</div>
</div>
</div>
</div> -->
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handleSubmit('addCertificateForm')">
</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
import { quillEditor } from "vue-quill-editor";
import global from "../../common/common.vue"; //引入共用组间
import debounce from "lodash/debounce"; //导入lodash中的debounce
import AddOrUpdate from "@/views/components/commonBookTags/bookTagsForm.vue";
import commonShop from "@/views/components/commonBookTags/shopproduct.vue";
import commonShopTable from "@/views/components/commonBookTags/shopproductTable.vue";
import commonTree from "@/views/components/commonBookTags/tags.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"] // 上传图片、上传视频
];
// import dialogComponent from './seckillprodrelation'
export default {
props: ["data", "pageType", "dataInfo",'labelId'],
data() {
return {
dataRule: {
userKey: [
{
required: true,
message: "请输入手机号/邮箱",
// trigger: "change",
}
],
certificateNo: [
{
required: true,
message: "请输入医案编号",
// trigger: "change",
}
],
},
isUploading: false, // 上传过程中是否显示加载动画
isEdit: false, // 上传过程中是否显示加载动画
dialogImageUrl: "",
dialogVisibleImg: false,
disabled: false,
restaurants: [],
fileList: [],
options: [],
cateOptions: [],
state: "",
timeout: null,
addCertificateForm: {},
baseUrl: global.baseUrl,
isEdit: false,
checkAll: false,
isIndeterminate: true,
dialogVisible: false,
urlList: {},
activeName: "first",
addForm: {},
audioFileList: [],
isFresh: false,
};
},
components: {
AddOrUpdate,
commonShop,
commonTree,
commonShopTable,
quillEditor
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
activated() {
this.isEdit = false;
// this.getDataList();
},
methods: {
remoteMethod(query) {
console.log(query, "query", this.addCertificateForm.key);
// return false
if (this.addCertificateForm.key !== "") {
let data = {
title: query //关键字
};
this.totalLaoding = true;
this.$http({
url: this.$http.adornUrl("/master/userManage/courseAndChildrenList"),
method: "post",
data: this.$http.adornData(data)
}).then(({ data }) => {
if (data && data.code === 0) {
this.options = data.list;
} else {
this.options = [];
}
this.totalLaoding = false;
if (data.code !== 0) return this.$message.error(data.msg);
});
} else {
this.options = [];
this.totalLaoding = false;
}
},
getCateList() {
this.$http({
url: this.$http.adornUrl(
"/master/userCertificate/userCertificateLabelList"
),
method: "post",
data: this.$http.adornData({})
}).then(({ data }) => {
if (data && data.code === 0) {
this.cateOptions = data.labelList;
} else {
this.cateOptions = [];
}
this.totalLaoding = false;
if (data.code !== 0) return this.$message.error(data.msg);
});
},
loadAll(queryString, cb) {
this.addCertificateForm.userId='';
this.addCertificateForm.userName='';
if (queryString == "") {
return false;
}
this.$http({
// url: this.$http.adornUrl('/book/user/list'),
url: this.$http.adornUrl("/book/user/getUserList"),
method: "post",
data: this.$http.adornData({
page: 1,
limit: 9999,
key: queryString
})
}).then(({ data }) => {
if (data && data.code === 0) {
var arr = data.user.records;
console.log("arr at line 467:", arr);
cb(arr);
} else {
cb([]);
}
});
},
createStateFilter(queryString) {
return state => {
return (
state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
);
};
},
handleSelect(item) {
console.log(item);
this.addCertificateForm.userKey = item.tel ? item.tel : item.email;
this.addCertificateForm.userName = item.name;
this.addCertificateForm.userId = item.id;
},
init(type, data) {
this.getCateList();
console.log("data at line 372:", data);
this.addCertificateForm = {};
this.fileList = [];
this.isEdit = type == "edit" ? true : false;
if (data) {
this.addCertificateForm = {
...data
};
this.remoteMethod(this.addCertificateForm.courseName);
if (this.addCertificateForm.images) {
console.log('this.addCertificateForm.images at line 447:', this.addCertificateForm.images)
this.fileList = this.addCertificateForm.images
.split(",")
.map((image, i) => ({
uid: i, // 假设 id 是唯一标识符
name: i, // 文件名
status: "done", // 状态
url: image // 文件 URL
}));
console.log("this.fileList at line 308:", this.fileList);
}
} else {
this.addCertificateForm = {};
}
if (this.pageType == "label") {
if (data.userId) {
// this.addCertificateForm.userKey = data.tel ? data.tel : data.email;
// this.addCertificateForm.userName = data.name;
// this.addCertificateForm.userId = data.id;
}
} else {
this.addCertificateForm.userKey = this.dataInfo.tel
? this.dataInfo.tel
: this.dataInfo.email;
this.addCertificateForm.userName = this.dataInfo.name;
this.addCertificateForm.userId = this.dataInfo.id;
}
this.dialogVisible = true;
},
handleSubmit: debounce(async function() {
// this.addCertificateForm
console.log('this.addCertificateForm at line 479:', this.addCertificateForm)
this.$refs["addCertificateForm"].validate(valid => {
if (valid) {
if(!this.addCertificateForm.userId&&this.pageType=='label'){
this.$message.error("请选择用户");
return false
}
var data={ }
this.$http({
url: this.$http.adornUrl(this.isEdit?'/master/userCertificate/editCertificate':"/master/userCertificate/addCertificate"),
method: "post",
data: this.$http.adornData(this.isEdit?{
certificateNo: this.addCertificateForm.certificateNo,
certificateUrl: this.fileList.map(item => item.url).join(","),
id: this.addCertificateForm.id
}:{
userId: this.addCertificateForm.userId,
labelId: this.pageType=='label'?this.labelId:this.addCertificateForm.labelId[this.addCertificateForm.labelId.length-1],
certificateNo: this.addCertificateForm.certificateNo,
certificateUrl: this.fileList.map(item => item.url).join(","),
courseId: this.addCertificateForm.courseId
})})
.then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success"
});
this.dialogVisible = false;
this.$nextTick(() => {
this.$emit("refresh");
});
} else {
this.$message.error(data.msg);
}
});
}
});
}, 200),
onSuccessImg(response, file, fileList) {
// 上传成功后,直接将返回的 URL 放到 file 对象中
file.uploading = false;
file.url = response.url; // 假设返回的数据包含文件的 url 地址
this.fileList = fileList; // 更新 fileList
},
beforeUpload(file) {
// 在文件上传之前,设置文件的上传状态
file.uploading = true;
},
onProgress(event, file, fileList) {
// 进度更新时,文件状态可以继续保持上传中
file.uploading = true;
},
handleRemove(file) {
this.fileList = this.fileList.filter(f => f.uid !== file.uid); // 删除文件
},
handleDownload(file) {
const link = document.createElement("a");
link.href = file.url;
link.download = file.name;
link.click();
},
selectChange(val) {
console.log("options", this.options);
// this.getCate(val)
},
handlePictureCardPreview(file) {
// 图片预览逻辑
}
}
};
</script>
<style lang="less" scoped></style>

File diff suppressed because it is too large Load Diff