|
@@ -0,0 +1,357 @@
|
|
|
|
+<!-- 添加常见科室症状 -->
|
|
|
|
+<template>
|
|
|
|
+ <div class="AddDiagBaseWrapper" @click="close">
|
|
|
|
+ <!-- <div class="groupTitle"><i
|
|
|
|
+ class="el-icon-back"
|
|
|
|
+ @click="back"
|
|
|
|
+ ></i> 量表管理维护--{{titleText}}</div> -->
|
|
|
|
+ <crumbs
|
|
|
|
+ :title="'诊断依据数据维护-'+titleText"
|
|
|
|
+ class="topBack"
|
|
|
|
+ :param="$route.params"
|
|
|
|
+ linkTo="DiagBase"
|
|
|
|
+ ></crumbs>
|
|
|
|
+ <el-form :model="form" ref="ruleForm" class="addDepartForm">
|
|
|
|
+ <el-form-item class="addDiagName" v-if="!isEdit" label="选择添加疾病名称:" >
|
|
|
|
+ <input class="searchInput" @focus="focuInput" type="text" v-model = "searchDiagVal">
|
|
|
|
+ <span class="searchName" @click="searchDiag">搜索</span>
|
|
|
|
+ <ul class="itemList diagList" ref="diagList">
|
|
|
|
+ <li
|
|
|
|
+ v-for="item in diagList"
|
|
|
|
+ class="diagItem ellipsis"
|
|
|
|
+ :title="item.name"
|
|
|
|
+ @click="selectDiag(item)"
|
|
|
|
+ :key="item.conceptId">
|
|
|
|
+ {{item.name}}
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item class="isRequired" label="已选添加疾病名称:">
|
|
|
|
+ {{form.name}}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div class="symptomList">
|
|
|
|
+ <p>疾病特征:</p>
|
|
|
|
+ <table class="indexTab">
|
|
|
|
+ <tr class="tableTitle">
|
|
|
|
+ <td class="FeatureSort">排序</td>
|
|
|
|
+ <td class="FeatureType">类型</td>
|
|
|
|
+ <td class="FeatureNumber">序号</td>
|
|
|
|
+ <td class="FeatureStand">标准词</td>
|
|
|
|
+ <td class="FeatureELATE">关联词</td>
|
|
|
|
+ <td class="FeatureResult">结果</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr v-for="(item, index) in selectedIndexList" :key="item.indexUnique">
|
|
|
|
+ <td class="FeatureType">{{index +1}}</td>
|
|
|
|
+ <td class="FeatureNumber">序号</td>
|
|
|
|
+ <td class="FeatureStand">标准词</td>
|
|
|
|
+ <td class="FeatureELATE">关联词</td>
|
|
|
|
+ <td class="FeatureResult">结果</td>
|
|
|
|
+ </tr>
|
|
|
|
+ </table>
|
|
|
|
+ <p>诊断公式:</p>
|
|
|
|
+ <table class="indexTab">
|
|
|
|
+ <tr class="tableTitle">
|
|
|
|
+ <td class="FeatureSort">排序</td>
|
|
|
|
+ <td class="FeatureType">类型</td>
|
|
|
|
+ <td class="FeatureNumber">序号</td>
|
|
|
|
+ <td class="FeatureStand">标准词</td>
|
|
|
|
+ <td class="FeatureELATE">关联词</td>
|
|
|
|
+ <td class="FeatureResult">结果</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr v-for="(item, index) in selectedIndexList" :key="item.indexUnique">
|
|
|
|
+ <td class="FeatureType">{{index +1}}</td>
|
|
|
|
+ <td class="FeatureNumber">序号</td>
|
|
|
|
+ <td class="FeatureStand">标准词</td>
|
|
|
|
+ <td class="FeatureELATE">关联词</td>
|
|
|
|
+ <td class="FeatureResult">结果</td>
|
|
|
|
+ <!-- <td class="selectedContent ">{{item.indexUnique}}</td>
|
|
|
|
+ <td class="selectedContentGroup"><input class="groupInput" type="text" v-model="item.indexDesc" @input="handleInp(index,$event)"></td>
|
|
|
|
+ <td class="selectedContentOpera"><el-button type="text" size="small" class="delete" @click="delSelectedIndex(item, index)">删除</el-button></td> -->
|
|
|
|
+ </tr>
|
|
|
|
+ </table>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="btn">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ :disabled = 'saveDisable'
|
|
|
|
+ @click="submitForm('ruleForm')"
|
|
|
|
+ >确 定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import api from '@api/diagBase.js';
|
|
|
|
+ export default {
|
|
|
|
+ name: 'AddChronicAndIndexRelation',
|
|
|
|
+ data() {
|
|
|
|
+ return{
|
|
|
|
+
|
|
|
|
+ form: {
|
|
|
|
+ diseaseId: '', //诊断id
|
|
|
|
+ diseaseName:'' //诊断名称
|
|
|
|
+ },
|
|
|
|
+ titleText: '添加关联',
|
|
|
|
+ diagList: [],
|
|
|
|
+ selectedIndexMap: [], //已经选择过的指标
|
|
|
|
+ selectedIndexList: [], //选择的指标列表
|
|
|
|
+ searchDiagVal: '',
|
|
|
|
+ isEdit: false,
|
|
|
|
+ saveDisable: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created(){
|
|
|
|
+ const { isEdit, data } = this.$route.params;
|
|
|
|
+ if(isEdit) {
|
|
|
|
+ if(isEdit) {
|
|
|
|
+ this.isEdit = isEdit;
|
|
|
|
+ this.titleText = '修改关联';
|
|
|
|
+ this.form.diseaseId = data.diseaseId
|
|
|
|
+ this.form.diseaseName = data.diseaseName
|
|
|
|
+ this.selectedIndexList = data.data
|
|
|
|
+ for (let i = 0; i < this.selectedIndexList.length; i++) {
|
|
|
|
+ this.selectedIndexMap.push(this.selectedIndexList[i].indexUnique)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ // searchTagVal(newVal, preVal) {
|
|
|
|
+ // if(newVal.trim() == ''){
|
|
|
|
+ // this.getTagList()
|
|
|
|
+ // }else if(newVal.trim() != preVal.trim()){
|
|
|
|
+ // this.getTagList()
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ close() {
|
|
|
|
+ this.diagList = [];
|
|
|
|
+ if(this.diagList.length>0){this.$refs['diagList'].style.display = 'none';}
|
|
|
|
+ },
|
|
|
|
+ back(){
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
+ },
|
|
|
|
+ searchDiag() {
|
|
|
|
+ if(!this.searchDiagVal) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const param = {
|
|
|
|
+ "name": this.searchDiagVal,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ api.diagBaseIndex(param).then((res)=>{
|
|
|
|
+ if(res.data.code === '0') {
|
|
|
|
+ this.diagList = res.data.data
|
|
|
|
+ if(this.diagList.length>0) {this.$refs['diagList'].style.display = 'block'}
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ selectDiag(item) {
|
|
|
|
+ this.form.conceptId = item.conceptId
|
|
|
|
+ this.form.name = item.name
|
|
|
|
+ this.$refs['diagList'].style.display='none'
|
|
|
|
+ this.searchDiagVal = ''
|
|
|
|
+ this.diagList=[]
|
|
|
|
+ },
|
|
|
|
+ focuInput() {
|
|
|
|
+ this.$refs['diagList'].style.display='none'
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ delSelectedIndex(selectedItem, index) {
|
|
|
|
+ this.selectedIndexMap = this.selectedIndexMap.filter((item) => {return item != selectedItem.indexUnique})
|
|
|
|
+ this.selectedIndexList.splice(index, 1)
|
|
|
|
+ },
|
|
|
|
+ submitForm(formName) {
|
|
|
|
+ if(!this.form.diseaseId) {
|
|
|
|
+ this.warning('请选择诊断')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.selectedIndexList.length === 0) {
|
|
|
|
+ this.warning('请选择指标')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ for (let i = 0; i < this.selectedIndexList.length; i++) {
|
|
|
|
+ if(!this.selectedIndexList[i].indexDesc) {
|
|
|
|
+ this.warning('请填写内容分组')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.showDelDialog()
|
|
|
|
+ },
|
|
|
|
+ showDelDialog() {
|
|
|
|
+ this.selectedIndexList.map((item) => {
|
|
|
|
+ item.diseaseId = this.form.diseaseId
|
|
|
|
+ return item
|
|
|
|
+ })
|
|
|
|
+ const param ={
|
|
|
|
+ "diseaseId": this.form.diseaseId,
|
|
|
|
+ "indexConfigData": this.selectedIndexList
|
|
|
|
+ }
|
|
|
|
+ this.showConfirmDialog('是否建立该关联?', () => {
|
|
|
|
+ const url = this.isEdit ?api.updateIndexConfigList(param) : api.saveIndexConfigLists(param)
|
|
|
|
+ this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
|
+ url.then((res) => {
|
|
|
|
+ if (res.data.code === '0') {
|
|
|
|
+ this.warning(res.data.msg || '关联成功', 'success','1000')
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ //返回带搜索条件的首页
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path:'ChronicAndIndexRelation',
|
|
|
|
+ params: Object.assign({}, this.$route.params, {currentPage: 1})
|
|
|
|
+ })
|
|
|
|
+ }, 1000);
|
|
|
|
+ } else {
|
|
|
|
+ this.warning(res.data.msg)
|
|
|
|
+ }
|
|
|
|
+ this.saveDisable = false
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ this.warning(err);
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ showConfirmDialog(msg, resolve) {
|
|
|
|
+ this.$alert(msg, '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ resolve();
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ },
|
|
|
|
+ warning(msg, type,time) {
|
|
|
|
+ this.$message({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: msg,
|
|
|
|
+ type: type || 'warning',
|
|
|
|
+ duration:time || '3000'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleInp(index,e){ //分组不能输入负数
|
|
|
|
+ const value = e.target.value;
|
|
|
|
+ const item = this.selectedIndexList[index].indexDesc;
|
|
|
|
+ e.target.value = value.replace(/[^\d]/g,'');
|
|
|
|
+ this.selectedIndexList[index].indexDesc = item.replace(/[^\d]/g,'');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less">
|
|
|
|
+ @import '../../less/common.less';
|
|
|
|
+ .AddDiagBaseWrapper {
|
|
|
|
+ color: #606266;
|
|
|
|
+ .topBack {
|
|
|
|
+ top: 0;
|
|
|
|
+ }
|
|
|
|
+ .groupTitle {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ height: 40px;
|
|
|
|
+ line-height: 40px;
|
|
|
|
+ padding-left: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .searchInput, .searchName {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ height: 32px;
|
|
|
|
+ line-height: 32px;
|
|
|
|
+ border: 1px solid #a9a9a9;
|
|
|
|
+ margin: 0px 0 0 0;
|
|
|
|
+ padding: 0 5px;
|
|
|
|
+ float: left;
|
|
|
|
+ margin-top: 4px;
|
|
|
|
+ }
|
|
|
|
+ .isRequired .el-form-item__label::before {
|
|
|
|
+ content: '*';
|
|
|
|
+ color: red;
|
|
|
|
+ }
|
|
|
|
+ .searchName {
|
|
|
|
+ border-left: none;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ padding: 0 14px;
|
|
|
|
+ }
|
|
|
|
+ .itemList {
|
|
|
|
+ position: absolute;
|
|
|
|
+ display: none;
|
|
|
|
+ background: #fff;
|
|
|
|
+ width: 162px;
|
|
|
|
+ max-height: 150px;
|
|
|
|
+ border: 1px solid #a9a9a9;
|
|
|
|
+ left: 138px;
|
|
|
|
+ top: 37px;
|
|
|
|
+ z-index: 2;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ }
|
|
|
|
+ .diagItem {
|
|
|
|
+ padding: 0 5px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ line-height: 30px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ .diagItem:hover {
|
|
|
|
+ background: #f5f7fa;
|
|
|
|
+ }
|
|
|
|
+ .addDepartForm {
|
|
|
|
+ position: relative;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ padding: 20px;
|
|
|
|
+ margin: 70px 20px 0px 20px;
|
|
|
|
+ }
|
|
|
|
+ .addDiagName {
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+ .symptomList {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ padding: 20px;
|
|
|
|
+ margin: 0px 20px 0px 20px;
|
|
|
|
+ min-height: 400px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .indexTab {
|
|
|
|
+ width: 100%;
|
|
|
|
+ border-collapse: collapse;
|
|
|
|
+ tr {
|
|
|
|
+ td {
|
|
|
|
+ padding: 5px 10px;
|
|
|
|
+ border: 1px solid #a9a9a9;
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .selectedContent {
|
|
|
|
+ width: 25%;
|
|
|
|
+ }
|
|
|
|
+ .selectedContentGroup {
|
|
|
|
+ width: 55%;
|
|
|
|
+ }
|
|
|
|
+ .selectedContentOpera {
|
|
|
|
+ width: 20%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .groupInput {
|
|
|
|
+ text-align: center;
|
|
|
|
+ height: 28px;
|
|
|
|
+ color: #606266;
|
|
|
|
+ width: 60%;
|
|
|
|
+ }
|
|
|
|
+ .btn {
|
|
|
|
+ position: relative;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ margin: 0px 20px;
|
|
|
|
+ height: 40px;
|
|
|
|
+ padding: 20px;
|
|
|
|
+ .el-button {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 20px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .tableTitle{
|
|
|
|
+ background: rgba(239,243,249,1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+</style>
|