| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="类别" prop="type"> |
| | | <el-select |
| | | v-model="queryParams.type" |
| | | placeholder="所有类别" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter.native="handleQuery" |
| | | > |
| | | <el-option |
| | | v-for="item in typeOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | <el-select v-model="queryParams.type" placeholder="所有类别" clearable |
| | | style="width: 240px" @keyup.enter.native="handleQuery"> |
| | | <el-option v-for="item in typeOptions" |
| | | :key="item.value" :label="item.label" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <!-- <div style="width: 100px;--> |
| | | <!-- height: 24px;--> |
| | | <!-- font-size: 18px;--> |
| | | <!-- font-family: Microsoft YaHei-Regular, Microsoft YaHei;--> |
| | | <!-- font-weight: 400;--> |
| | | <!-- color: #000000;--> |
| | | <!-- line-height: 21px;--> |
| | | <!-- ">家庭小医生</div>--> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | |
| | | </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="25" align="center" /> |
| | | <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 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 label="类别" prop="type" sortable 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" > |
| | | <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" > |
| | |
| | | <el-table-column label="适用人" prop="suitable" sortable 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 width="150px" > |
| | | <template slot-scope="scope">{{scope.row.ownData === 0 ? '否': '是'}}</template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" prop="remark" sortable width="120" align="center"> |
| | | <template slot-scope="scope">{{scope.row.remark? scope.row.remark: '————'}}</template> |
| | | </el-table-column> |
| | |
| | | <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-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.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" ></el-input> |
| | | </el-form-item> |
| | | |
| | | <h4 class="form-header">电子文件 </h4> |
| | | <h4 class="form-header">相关图片 </h4> |
| | | <el-upload |
| | | action="#" |
| | | list-type="picture-card" |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | |
| | | |
| | | //导入接口函数 |
| | | import {listDoctor,enload,getDoctor, addDoctor,updateDoctor, delDoctor,uploadPic} from "@/api/doctor/index"; |
| | | import {listDoctor,enload,getDoctor, addDoctor,updateDoctor, delDoctor,uploadPic,listType} from "@/api/doctor/index"; |
| | | |
| | | import { Notification, MessageBox, Message, Loading } from 'element-ui' |
| | | export default { |
| | |
| | | total: 0, |
| | | // 小医生表格数据 |
| | | doctorList: [], |
| | | typeList:[], |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否显示弹出层 |
| | |
| | | // 日期范围 |
| | | dateRange: [], |
| | | // 数据范围选项 |
| | | fot:[".jpg",".jif"], |
| | | fileList:[ |
| | | ], |
| | | fileListOther:[ |
| | | |
| | | ], |
| | | fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx', |
| | | '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'], |
| | | fileList:[], |
| | | fileListOther:[], |
| | | dsb:true, |
| | | btn:false, |
| | | fit:['fill'], |
| | | |
| | | uploading: false, |
| | | formDat: { |
| | | //就医记录 |
| | | id:undefined, |
| | |
| | | rules: { |
| | | |
| | | type: [{ |
| | | required: true, |
| | | message: '请输入类型', |
| | | // required: true, |
| | | message: '请输入类别', |
| | | trigger: 'blur' |
| | | }], |
| | | symptom: [{ |
| | |
| | | trigger: 'blur' |
| | | }], |
| | | }, |
| | | typeOptions: [{ |
| | | value:'神经科', |
| | | label:'神经科' |
| | | },{ |
| | | value:'牙科', |
| | | label:'牙科' |
| | | },{ |
| | | value:'内科', |
| | | label:'内科' |
| | | }], |
| | | typeOptions: [], |
| | | newOption: undefined, |
| | | showInput: true |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.getCateInfor() |
| | | // for (let i = 0; i < this.contactList.length; i++) { |
| | | // this.formDat[i] = this.contactList[i]; |
| | | // } |
| | | this.getTypeOptions(); |
| | | }, |
| | | methods: { |
| | | // 取消按钮 |
| | |
| | | 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; |
| | |
| | | // alert(123) |
| | | // console.log(response.data) |
| | | this.doctorList = response.data.data; |
| | | |
| | | this.total = response.data.total; |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | listType(this.queryParams).then(response => { |
| | | this.typeList = response.data; |
| | | this.total = response.data.total; |
| | | // console.log( this.typeList ) |
| | | // 在回调函数中调用 getTypeOptions() |
| | | this.getTypeOptions(); |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | }, |
| | | /** 查询类别信息 */ |
| | | getCateInfor() |
| | | { |
| | | let _this = this |
| | | getCategory().then(response=>{ |
| | | 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; |
| | | }, []); |
| | | |
| | | response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ |
| | | _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) |
| | | }) |
| | | }) |
| | | }, |
| | | }, |
| | | /** 查询类别信息 */ |
| | | // getCateInfor() |
| | | // { |
| | | // let _this = this |
| | | // getCategory().then(response=>{ |
| | | // |
| | | // response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ |
| | | // _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) |
| | | // }) |
| | | // }) |
| | | // }, |
| | | //类别选择 |
| | | getSrc(type) { |
| | | if (type === '神经科'){ |
| | |
| | | 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]); |
| | | } |
| | | }, |
| | | requestUpload(params) |
| | | { |
| | |
| | | var formData = new FormData(); |
| | | formData.append('uploadFile', file); |
| | | let _this = this |
| | | |
| | | this.uploading = true; |
| | | uploadPic(formData).then(response => { |
| | | let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) |
| | | |
| | | this.uploading = false; |
| | | this.$modal.msgSuccess("上传成功"); |
| | | if(_this.fot.includes(pth) === true) |
| | | { |
| | | _this.fileList.push({name:response.data.fileName, "url":response.data.url}) |
| | |
| | | }).catch(() => { Message({ message: "导入失败", type: 'error' })}); |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | | type(value) { |
| | | if (value === '') { |
| | | this.showInput = true; |
| | | } else { |
| | | this.showInput = false; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |