<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
<el-form-item label="类别" prop="type">
|
<el-select v-model="queryParams.type" placeholder="所有类别" clearable
|
style="width: 240px;
|
height: 35px;
|
border-radius: 16px 16px 16px 16px;
|
opacity: 0.5;" @keyup.enter.native="handleQuery" filterable allow-create>
|
<el-option v-for="item in typeOptions"
|
:key="item.value" :label="item.label" :value="item.value"/>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item label="症状" prop="symptom">
|
<el-input
|
v-model="queryParams.symptom"
|
placeholder="请输入症状"
|
clearable
|
style="width: 200px;
|
height: 35px;
|
border-radius: 16px 16px 16px 16px;
|
opacity: 0.5;"
|
@keyup.enter.native="handleQuery">
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
</el-input>
|
</el-form-item>
|
|
<el-form-item label="处方" prop="cmedical">
|
<el-input
|
v-model="queryParams.cmedical"
|
placeholder="请输入中医处方"
|
clearable
|
style="width: 200px;
|
height: 35px;
|
border-radius: 16px 16px 16px 16px;
|
opacity: 0.5;"
|
@keyup.enter.native="handleQuery">
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="功效" prop="effect">
|
<el-input
|
v-model="queryParams.effect"
|
placeholder="请输入功效"
|
clearable
|
style="width: 200px;
|
height: 35px;
|
border-radius: 16px 16px 16px 16px;
|
opacity: 0.5;"
|
@keyup.enter.native="handleQuery">
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="适用人" prop="suitable">
|
<el-input
|
v-model="queryParams.suitable"
|
placeholder="请输入适用人"
|
clearable
|
style="width: 200px;
|
height: 35px;
|
border-radius: 16px 16px 16px 16px;
|
opacity: 0.5;"
|
@keyup.enter.native="handleQuery"
|
>
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
</el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="mini" @click="handleQuery" style=" width: 67px;height: 27px;background: #FFDDE3;
|
border-radius: 7px 7px 7px 7px;opacity: 1; " >搜索</el-button>
|
<el-button size="mini" @click="resetQuery" style=" width: 67px;height: 27px;background: #FFDDE3;
|
border-radius: 7px 7px 7px 7px;opacity: 1; ">重置</el-button>
|
</el-form-item>
|
</el-form>
|
<div>
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button
|
type="primary"
|
plain
|
icon="el-icon-plus"
|
size="mini"
|
@click="handleAdd"
|
v-hasPermi="['system:role:add']"
|
>新增</el-button>
|
</el-col>
|
|
<el-col :span="1.5">
|
<el-button
|
type="danger"
|
plain
|
icon="el-icon-delete"
|
size="mini"
|
:disabled="multiple"
|
@click="handleDelete"
|
v-hasPermi="['system:role:remove']"
|
>删除</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="warning"
|
plain
|
icon="el-icon-download"
|
size="mini"
|
@click="handleExport"
|
v-hasPermi="['family:note:export']"
|
>导出</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="warning"
|
plain
|
icon="el-icon-download"
|
size="mini"
|
@click="handleExportTemplate"
|
v-hasPermi="['family:note:export']"
|
>导入模板下载</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
|
<el-upload
|
action=""
|
|
class="upload-demo"
|
:show-file-list="false"
|
:http-request="handleEnport"
|
>
|
<el-button size="mini" type="primary"
|
plain
|
icon="el-icon-top">导入</el-button>
|
|
</el-upload>
|
</el-col>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
</el-row>
|
</div>
|
|
<el-table v-loading="loading" :data="doctorList" :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;">
|
<el-table-column type="selection" :reserve-selection="true" width="55" align="center" />
|
<el-table-column fixed label="序号" sortable type="index" align="center" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
|
<el-table-column label="类别" prop="type" sortable :show-overflow-tooltip="true" width="80" align="center">
|
<!-- <template slot-scope="scope">{{ getSrc(scope.row.type) }}</template>-->
|
<template slot-scope="scope">{{scope.row.type? scope.row.type: '————'}}</template>
|
</el-table-column>
|
<el-table-column label="症状" prop="symptom" sortable :show-overflow-tooltip="true" width="120" align="center" >
|
<template slot-scope="scope">{{scope.row.symptom? scope.row.symptom: '————'}}</template>
|
</el-table-column>
|
<el-table-column label="持续时间" prop="duration" sortable :show-overflow-tooltip="true" width="160" align="center" >
|
<template slot-scope="scope">{{scope.row.duration? scope.row.duration: '————'}}</template>
|
</el-table-column>
|
<el-table-column label="中医处方" prop="cmedical" sortable :show-overflow-tooltip="true" width="160" align="center" >
|
<template slot-scope="scope">{{scope.row.cmedical? scope.row.cmedical: '————'}}</template>
|
</el-table-column>
|
<el-table-column label="西医处方" prop="wmedical" sortable :show-overflow-tooltip="true" width="160" align="center">
|
<template slot-scope="scope">{{scope.row.wmedical? scope.row.wmedical: '————'}}</template>
|
</el-table-column>
|
<el-table-column label="功效" prop="effect" sortable :show-overflow-tooltip="true" width="120" align="center" >
|
<template slot-scope="scope">{{scope.row.effect? scope.row.effect: '————'}}</template>
|
</el-table-column>
|
|
<el-table-column label="适用人" prop="suitable" sortable :show-overflow-tooltip="true" width="140" align="center" >
|
<template slot-scope="scope">{{scope.row.suitable? scope.row.suitable: '————'}}</template>
|
</el-table-column>
|
<el-table-column label="是否是本家庭记录" prop="ownData" sortable :show-overflow-tooltip="true" width="150px" align="center" >
|
<template slot-scope="scope">{{scope.row.ownData === 0 ? '否': '是'}}</template>
|
</el-table-column>
|
<el-table-column label="备注" prop="remark" sortable :show-overflow-tooltip="true" width="120" align="center">
|
<template slot-scope="scope">{{scope.row.remark? scope.row.remark: '————'}}</template>
|
</el-table-column>
|
<el-table-column label="电子文件" prop="url" width="160" align="center">
|
<template slot-scope="scope" >
|
<div @click="handleCheck(scope.row)">
|
<img
|
class="el-upload-list__item-thumbnail"
|
src="../../assets/images/deviceLis.png"
|
alt=""
|
style="width: 35px; height: 35px;"
|
fit="cover"
|
v-if="!(scope.row.url === '' || scope.row.url === ',' || scope.row.url === null)"
|
>
|
<img
|
v-else
|
class="el-upload-list__item-thumbnail"
|
src="../../assets/images/deviceA.png"
|
alt=""
|
style="width: 35px; height: 35px;"
|
fit="cover"
|
|
></div>
|
</template>
|
</el-table-column>
|
|
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
|
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
<div class="button-container">
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-edit"
|
:disabled="!scope.row.ownData"
|
@click="handleUpdate(scope.row)"
|
v-hasPermi="['system:role:edit']"
|
>
|
<span style="font-size: 14px;">修改</span>
|
</el-button>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-delete"
|
@click="handleDelete(scope.row)"
|
:disabled="!scope.row.ownData"
|
v-hasPermi="['system:role:remove']"
|
><span style="font-size: 14px;">删除</span></el-button>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-d-arrow-right"
|
@click="handleCheck(scope.row)">
|
<span style="font-size: 14px;">查看详情</span></el-button>
|
</div>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
style="background: #FEF7FC;"
|
@pagination="getList"
|
/>
|
|
<!-- 添加就医记录配置对话框 -->
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
<el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
|
|
<el-form-item label="类别" prop="type">
|
<el-select v-model="formDat.type" placeholder="请选择类别" clearable :style="{width: '100%'}" >
|
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
|
></el-option>
|
</el-select>
|
<el-input v-model="newOption" v-if="showInput" placeholder="若未在上述选项中找到对应类别,请在此输入新的类别" @change="addNewOption"></el-input>
|
</el-form-item>
|
|
<el-form-item label="症状" prop="symptom">
|
<el-input v-model="formDat.symptom" placeholder="请输入症状" clearable :style="{width: '100%'}" ></el-input>
|
</el-form-item>
|
<el-form-item label="持续时间" prop="duration">
|
<el-input v-model="formDat.duration" placeholder="请输入持续时间" type="number" clearable :style="{width: '100%'}" >
|
</el-input>
|
</el-form-item>
|
<el-form-item label="中医处方" prop="cmedical">
|
<el-input v-model="formDat.cmedical" placeholder="请输入中医处方" clearable :style="{width: '100%'}" >
|
</el-input>
|
</el-form-item>
|
<el-form-item label="西医处方" prop="wmedical">
|
<el-input v-model="formDat.wmedical" placeholder="请输入西医处方" clearable :style="{width: '100%'}" >
|
</el-input>
|
</el-form-item>
|
<el-form-item label="功效" prop="effect">
|
<el-input v-model="formDat.effect" placeholder="请输入功效" clearable :style="{width: '100%'}" >
|
</el-input>
|
</el-form-item>
|
<el-form-item label="适用人" prop="suitable">
|
<el-input v-model="formDat.suitable" placeholder="请输入适用人" clearable :style="{width: '100%'}" >
|
</el-input>
|
</el-form-item>
|
|
<el-form-item label="备注" prop="remark">
|
<el-input v-model="formDat.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" ></el-input>
|
</el-form-item>
|
|
<h4 class="form-header">相关图片 </h4>
|
<el-upload
|
action="#"
|
accept="image/jpeg, image/png,image/jpg, image/WMF,image/gif"
|
list-type="picture-card"
|
multiple
|
:http-request="requestUpload"
|
:file-list="fileList"
|
:on-change="handleChange"
|
:auto-upload="false"
|
ref="upload"
|
>
|
<i slot="default" class="el-icon-plus"></i>
|
<div slot="file" slot-scope="{file}">
|
<template v-if="fileList">
|
<img
|
class="el-upload-list__item-thumbnail"
|
:src="file.url"
|
alt=""
|
style="width: 100%; height: 100%; object-fit: cover;"
|
fit="cover"
|
:preview-src-list="[file.url]"
|
>
|
</template>
|
<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="handleRemove(file)"
|
>
|
<i class="el-icon-delete"></i>
|
</span>
|
</span>
|
|
|
</div>
|
</el-upload>
|
<el-button
|
style="margin-left: 10px"
|
size="small"
|
type="success"
|
|
@click="picUpload"
|
>上传到服务器</el-button>
|
<h4 class="form-header">其他附件 </h4>
|
<el-upload
|
action=""
|
:file-list="fileListOther"
|
class="upload-demo"
|
multiple
|
|
:on-remove="handleRemoveFile"
|
:http-request="requestUpload1"
|
:show-file-list="true"
|
|
ref="upload1"
|
:on-change="handleChange1"
|
:auto-upload="false"
|
list-type="picture-card"
|
>
|
|
|
<i slot="default" class="el-icon-plus"></i>
|
<div slot="file" slot-scope="{file}">
|
<!-- 添加video元素用于显示视频 -->
|
<video
|
v-if="file.url.includes('.mp4')"
|
class="el-upload-list__item-thumbnail"
|
:src="file.url"
|
style="width: 147px; height: 147px"
|
fit="cover"
|
></video>
|
<img v-else
|
class="el-upload-list__item-thumbnail"
|
:src="file.url"
|
alt=""
|
style="width: 100%; height: 100%"
|
fit="cover"></img>
|
|
<span class="el-upload-list__item-actions">
|
<span class="el-upload-list__item-name">{{ file.name }}</span>
|
<span
|
class="el-upload-list__item-preview"
|
@click="handleFileCardPreview(file)"
|
>
|
<i class="el-icon-zoom-in"></i>
|
</span>
|
|
<span
|
|
class="el-upload-list__item-delete"
|
@click="handleRemoveFile(file)"
|
>
|
<i class="el-icon-delete"></i>
|
</span>
|
</span>
|
|
</div>
|
|
|
</el-upload>
|
<el-button
|
style="margin-left: 10px"
|
size="small"
|
type="success"
|
@click="fileUpload"
|
>上传到服务器</el-button>
|
</el-form>
|
<h4 class="form-header"> </h4>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="submitDataScope">保 存</el-button>
|
<el-button @click="cancelData">取 消</el-button>
|
</div>
|
</el-dialog>
|
|
<!-- 分配角色数据权限对话框 -->
|
<el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
|
|
</el-dialog>
|
|
</div>
|
</template>
|
|
<script>
|
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
|
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
|
|
|
|
//导入接口函数
|
import {listDoctor,enload,getDoctor, addDoctor,updateDoctor, delDoctor,uploadPic,listType} from "@/api/doctor/index";
|
|
import { Notification, MessageBox, Message, Loading } from 'element-ui'
|
export default {
|
name: "index",
|
dicts: ['sys_normal_disable'],
|
data() {
|
return {
|
// 遮罩层
|
disabled: false,
|
|
loading: true,
|
formData:[],
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 小医生表格数据
|
doctorList: [],
|
typeList:[],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
// 是否显示弹出层(数据权限)
|
openDataScope: false,
|
menuExpand: false,
|
menuNodeAll: false,
|
deptExpand: true,
|
deptNodeAll: false,
|
// 日期范围
|
dateRange: [],
|
// 数据范围选项
|
fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx',
|
'.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'],
|
fileList:[],
|
fileList1:[],
|
uploadFileList: [],
|
uploadFileList1: [],
|
fileListOther:[],
|
dsb:true,
|
btn:false,
|
fit:['fill'],
|
uploading: false,
|
uploading1: false,
|
formDat: {
|
//就医记录
|
id:undefined,
|
type:undefined,
|
symptom:undefined,
|
cmedical:undefined,
|
duration:undefined,
|
wmedical:undefined,
|
effect:undefined,
|
suitable:undefined,
|
remark:undefined,
|
url: "",
|
|
},
|
// 菜单列表
|
menuOptions: [],
|
// 部门列表
|
deptOptions: [],
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
type:undefined,
|
symptom:undefined,
|
cmedical:undefined,
|
suitable:undefined,
|
effect:undefined,
|
|
},
|
// searchVal:"",
|
|
// 表单参数
|
form: {},
|
defaultProps: {
|
children: "children",
|
label: "label"
|
},
|
// 表单校验
|
rules: {
|
|
type: [{
|
// required: true,
|
message: '请输入类别',
|
trigger: 'blur'
|
}],
|
symptom: [{
|
required: true,
|
message: '请输入症状',
|
trigger: 'blur'
|
}],
|
duration: [{
|
// required: true,
|
message: '请输入持续时间',
|
trigger: 'blur'
|
}],
|
cmedical: [{
|
// required: true,
|
message: '请输入中医处方',
|
trigger: 'blur'
|
}],
|
wmedical: [{
|
// required: true,
|
message: '请输入西医处方',
|
trigger: 'blur'
|
}],
|
effect: [{
|
required: true,
|
message: '请输入功效',
|
trigger: 'blur'
|
}],
|
suitable: [{
|
required: true,
|
message: '请输入适用人',
|
trigger: 'blur'
|
}],
|
|
remark: [{
|
// required: true,
|
message: '请输入备注',
|
trigger: 'blur'
|
}],
|
},
|
typeOptions: [],
|
newOption: undefined,
|
showInput: true
|
};
|
},
|
created() {
|
this.getList();
|
this.getTypeOptions();
|
},
|
methods: {
|
// 取消按钮
|
cancelData() {
|
this.open = false;
|
this.reset();
|
},
|
|
//隔行变色
|
tableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 == 0) {
|
return "statistics-warning-row1";
|
} else {
|
return "statistics-warning-row";
|
}
|
},
|
//类别
|
addNewOption() {
|
const newOption = this.newOption.trim();
|
if (newOption && !this.typeOptions.includes(newOption)) {
|
this.typeOptions.push(newOption);
|
this.$set(this.formDat, 'type', newOption); // 更新formDat.type的值为新的选项
|
}
|
},
|
|
/** 查询记录列表 */
|
getList() {
|
this.loading = true;
|
let _this = this;
|
// console.log(this.queryParams)
|
// listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listDoctor(this.queryParams).then(response => {
|
// alert(123)
|
// console.log(response.data)
|
if(response.msg=="您没加入到对应的家庭,请联系管理员")
|
{
|
_this.$modal.msgSuccess("您没加入到对应的家庭,请联系管理员");
|
_this.loading = false;
|
}else{
|
_this.doctorList = response.data.data;
|
_this.total = response.data.total;
|
_this.loading = false;
|
}
|
}
|
);
|
listType(this.queryParams).then(response => {
|
this.typeList = response.data;
|
// console.log( this.typeList )
|
// 在回调函数中调用 getTypeOptions()
|
this.getTypeOptions();
|
this.loading = false;
|
}
|
);
|
},
|
getTypeOptions() {
|
const filteredOptions = this.typeList.filter(item => typeof item === 'string' && item !== '');
|
// 创建一个空对象用于存储唯一的字符串选项
|
const uniqueOptions = {};
|
// 构建下拉选项列表
|
this.typeOptions = filteredOptions.reduce((options, option) => {
|
if (!uniqueOptions[option]) {
|
uniqueOptions[option] = true;
|
options.push({
|
label: option,
|
value: option
|
});
|
}
|
return options;
|
}, []);
|
|
},
|
//类别选择
|
getSrc(type) {
|
if (type === '神经科'){
|
return '神经科'
|
}else if(type === '牙科'){
|
return '牙科'
|
}else if(type === '内科'){
|
return '内科'
|
}else {
|
return '其它'
|
}
|
},
|
handleRemove(file) {
|
for(let i = 0; i < this.fileList.length; i++)
|
{
|
if(this.fileList[i].url==file.url)
|
{
|
this.$delete(this.fileList,i);
|
this.$delete(this.uploadFileList,i);
|
}
|
}
|
},
|
handleRemoveFile(file) {
|
for(let i = 0; i < this.fileListOther.length; i++)
|
{
|
if(this.fileListOther[i].url==file.url)
|
{
|
|
this.$delete(this.fileListOther,i);
|
this.$delete(this.uploadFileList1,i);
|
|
}
|
}
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
getRowId(row)
|
{
|
return row.id
|
},
|
// 取消按钮(数据权限)
|
cancelDataScope() {
|
this.openDataScope = false;
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
if (this.$refs.menu != undefined) {
|
this.$refs.menu.setCheckedKeys([]);
|
}
|
this.menuExpand = false,
|
this.menuNodeAll = false,
|
this.deptExpand = true,
|
this.deptNodeAll = false,
|
this.form = {
|
roleId: undefined,
|
roleName: undefined,
|
roleKey: undefined,
|
roleSort: 0,
|
status: "0",
|
menuIds: [],
|
deptIds: [],
|
menuCheckStrictly: true,
|
deptCheckStrictly: true,
|
remark: undefined
|
};
|
this.resetForm("form");
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.dateRange = [];
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map(item => item.id)
|
console.log(this.ids)
|
this.single = selection.length!=1
|
this.multiple = !selection.length
|
},
|
// //每次改变input框值时就改变this.myTableData的值
|
// inputChange() { //循环每一项 只要content的值含有输入的searchVal值,就加进newList;反之,就无东西加进newList
|
// let newlist = this.formDat.filter(
|
// (item) => item.content.indexOf(this.searchVal) > -1
|
// );
|
// this.contactList = newlist;
|
// },
|
|
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
this.open = true;
|
this.title = "添加就医记录详细信息";
|
},
|
/** 查看详细信息 */
|
handleCheck(row){
|
const id = row.id;
|
this.$router.push("/familymodel/Doctor/doctorInfo/" + id);
|
},
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
const id = row.id;
|
let jd = true
|
|
this.$router.push({
|
path:"/familymodel/Doctor/doctorInfo/" + id,
|
query:{
|
detail:jd
|
}
|
});
|
},
|
|
|
handlePictureCardPreview(file) {
|
this.dialogImageUrl = file.url;
|
this.dialogVisible = true;
|
},
|
/** 提交按钮(数据权限) */
|
submitDataScope: function() {
|
|
|
this.$refs["elForm"].validate(valid => {
|
if (valid) {
|
|
addDoctor(this.formDat).then(response => {
|
this.$modal.msgSuccess("新增成功");
|
this.open = false;
|
// 清空formDat对象的数据
|
Object.keys(this.formDat).forEach(key => {
|
this.formDat[key] = '';
|
});
|
for(let i = 0; i <= this.fileList.length; i++)
|
{
|
this.handleRemove(this.fileList[0]);
|
}
|
for(let i = 0; i < this.fileListOther.length; i++){
|
this.handleRemoveFile(this.fileListOther[0]);
|
}
|
this.getList();
|
});
|
}
|
});
|
},
|
handleChange(file, fileList1) {
|
//定义一个全局数组uploadFileList来做存储
|
|
// this.uploadFileList.push(file.raw);
|
console.log("=========5555=========")
|
console.log(file)
|
// console.log(this.uploadFileList)
|
// this.fileList = fileList
|
//alert(file)
|
this.uploadFileList.push(file.raw);
|
this.fileList.push({name:file.name,url:file.url})
|
//alert(fileList1.length)
|
},
|
handleChange1(file, fileOtherList1) {
|
//定义一个全局数组uploadFileList来做存储
|
this.uploadFileList1.push(file.raw);
|
this.fileListOther.push({name:file.name,url:file.url})
|
// this.uploadFileList.push(file.raw);
|
console.log("=========5555=========")
|
//console.log(file)
|
// console.log(this.uploadFileList)
|
// this.fileList = fileList
|
},
|
fileUpload(){
|
// var file = params.file;
|
|
var formData = new FormData();
|
this.$refs.upload1.submit();
|
// formData.append('uploadFile', file);
|
if(this.uploadFileList1.length==0){
|
this.$modal.msgSuccess("文档上传列表不能为空!");
|
return
|
}
|
this.uploadFileList1.forEach((elem)=>{
|
formData.append("files", elem)
|
|
})
|
|
let _this = this
|
|
this.uploading = true;
|
uploadPic(formData).then(response => {
|
_this.uploadFileList1 = []
|
_this.formDat.url = _this.formDat.url+","+response.fileNames
|
_this.$modal.msgSuccess("文件上传成功!");
|
})
|
|
},
|
picUpload()
|
{
|
var formData = new FormData();
|
//alert(976)
|
//this.$refs.upload.submit();
|
//alert(8)
|
//alert(this.uploadFileList.length)
|
if(this.uploadFileList.length==0){
|
this.$modal.msgSuccess("图片上传列表不能为空!");
|
return}
|
//console.log(this.uploadFileList)
|
this.uploadFileList.forEach((elem)=>{
|
formData.append("files", elem)
|
|
})
|
//alert(90)
|
let _this = this
|
//alert(9)
|
uploadPic(formData).then(response => {
|
// alert("dds")
|
_this.formDat.url = _this.formDat.url+","+response.fileNames
|
_this.uploadFileList = []
|
_this.$modal.msgSuccess("图片上传成功");
|
|
});
|
},
|
requestUpload(params) {
|
//alert(98)
|
// this.uploadFileList.push(params.file);
|
},
|
requestUpload1(params)
|
{
|
// this.uploadFileList1.push(params.file);
|
},
|
/** 删除按钮操作 */
|
handleDelete(row) {
|
const Ids = row.id || this.ids;
|
this.$modal.confirm('是否确认删除数据项?').then(function() {
|
return delDoctor(Ids);
|
}).then(() => {
|
this.getList();
|
this.$modal.msgSuccess("删除成功");
|
}).catch(() => {});
|
},
|
/** 导出按钮操作 */
|
handleExport() {
|
const Ids = this.ids;
|
|
if(Ids.length==0)
|
{
|
this.download('/zfDoctor/export', {
|
...this.queryParams
|
}, `zfDoctor_${new Date().getTime()}.xlsx`)
|
}else{
|
this.download('/zfDoctor/export1/'+Ids, {
|
|
}, `zfDoctor_${new Date().getTime()}.xlsx`)
|
}
|
},
|
|
handleExportTemplate(){
|
this.download('/zfDoctor/model', {
|
|
}, `zfDoctor_${new Date().getTime()}.xlsx`)
|
},
|
/** 导入操作*/
|
handleEnport(params){
|
var file = params.file;
|
var formData = new FormData();
|
formData.append('excelImport', file);
|
let _this = this
|
|
enload(formData).then(response => {
|
_this.getList();
|
Message({ message: "导入成功", type: 'warning' })
|
|
}).catch(() => { Message({ message: "导入失败", type: 'error' })});
|
|
}
|
},
|
watch: {
|
type(value) {
|
if (value === '') {
|
this.showInput = true;
|
} else {
|
this.showInput = false;
|
}
|
}
|
}
|
};
|
</script>
|
<style>
|
.app-container{
|
background-color: #FEF7FC;
|
}
|
.el-table__row.statistics-warning-row {
|
background: #E0EEFE;
|
|
}
|
.el-table__row.statistics-warning-row1 {
|
background: #FFEFF2;
|
|
}
|
.tableRowClassName {
|
height: 40px;
|
}
|
.el-table__cell {
|
font-size: 14px; /* 设置字体大小 */
|
}
|
.button-container {
|
display: inline-flex; /* 设置按钮容器为行内元素 */
|
}
|
</style>
|