|
@@ -1,6 +1,8 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <crumbs :title="minTitle" linkTo="/admin/LT-YXSYKWH-YXSYMMWH"></crumbs>
|
|
|
+ <crumbs :title="minTitle"
|
|
|
+ :param="$route.params"
|
|
|
+ linkTo="MedicalName"></crumbs>
|
|
|
<div class="contents">
|
|
|
<div class="content">
|
|
|
<h3>添加术语:</h3>
|
|
@@ -25,14 +27,28 @@
|
|
|
<input type="text" v-model="data.spell" placeholder="请输入拼音" maxlength="50" @input="handlePinyin">
|
|
|
</td>
|
|
|
<td>
|
|
|
- <el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small" @change="selectType">
|
|
|
+ <!-- <el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small" @change="selectType">
|
|
|
<el-option
|
|
|
v-for="item in typeList"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
:value="item.name">
|
|
|
</el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
+ <template v-if="!id">
|
|
|
+ <el-select v-model="data.type" filterable clearable placeholder="请选择" size="small" @change="selectType">
|
|
|
+ <el-option-group
|
|
|
+ v-for="group in options"
|
|
|
+ :key="group.label">
|
|
|
+ <el-option
|
|
|
+ v-for="item in group.options"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.name">
|
|
|
+ </el-option>
|
|
|
+ </el-option-group>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
<span v-else>{{data.type}}</span>
|
|
|
</td>
|
|
|
<td class="desc">
|
|
@@ -56,16 +72,32 @@
|
|
|
<td :title="item.name&&item.name.length>9?item.name:''">
|
|
|
<!-- 使用原生input,输入限制 -->
|
|
|
<!-- <el-input v-model="item.name" placeholder="请输入术语" maxlength="30" size="small" @input.native="handleInput(2,index)"></el-input> -->
|
|
|
- <input type="text" v-model="item.name" :title="item.name" placeholder="请输入术语" maxlength="50" @blur="handleBlur(2,index,99)" :disabled="!item.isEdit">
|
|
|
+ <input type="text" v-model="item.name" :title="item.name" placeholder="请输入术语" maxlength="50" @blur="handleBlur(2,index,99)" >
|
|
|
</td>
|
|
|
- <td v-if="!item.isEdit">
|
|
|
+ <!-- <td v-if="!item.isEdit">
|
|
|
{{item.spell}}
|
|
|
</td>
|
|
|
- <td v-else>
|
|
|
+ <td v-else> -->
|
|
|
+ <td>
|
|
|
<input type="text" v-model="item.spell" placeholder="请输入拼音" maxlength="50" @input="handlePinyin" class="spell">
|
|
|
</td>
|
|
|
<td>
|
|
|
- {{data.type}}
|
|
|
+ <!-- {{data.type}} -->
|
|
|
+ <template v-if="index==0&©">
|
|
|
+ <el-select v-model="data.type" filterable placeholder="请选择" size="small" @change="selectType">
|
|
|
+ <el-option-group
|
|
|
+ v-for="group in options"
|
|
|
+ :key="group.label">
|
|
|
+ <el-option
|
|
|
+ v-for="item in group.options"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.name">
|
|
|
+ </el-option>
|
|
|
+ </el-option-group>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <span v-else>{{data.type}}</span>
|
|
|
</td>
|
|
|
<td class="desc">
|
|
|
<input v-model="item.remark" placeholder="请输入术语说明" maxlength="120"></input>
|
|
@@ -83,11 +115,11 @@
|
|
|
</tr>
|
|
|
</table>
|
|
|
<div class="actionDo">
|
|
|
- <div class="btnWrap">
|
|
|
+ <!-- <div class="btnWrap"> -->
|
|
|
<!-- <el-button type="primary" size="mini" v-if="show" @click="comfirn(14)">确认修改</el-button> -->
|
|
|
- <el-button plain size="mini" v-if="show" @click="toggleShow(1)">放弃修改</el-button>
|
|
|
- <el-button plain size="mini" @click="toggleShow(2)" v-if="!show">修改标准词</el-button>
|
|
|
- </div>
|
|
|
+ <!-- <el-button plain size="mini" v-if="show" @click="toggleShow(1)">放弃修改</el-button>
|
|
|
+ <el-button plain size="mini" @click="toggleShow(2)" v-if="!show">修改标准词</el-button> -->
|
|
|
+ <!-- </div> -->
|
|
|
<div class="radioWrap" v-if="show">
|
|
|
<el-radio-group v-model="radioVal" size="mini">
|
|
|
<el-radio v-for="(item,index) in allwords" :label="index" :disabled="index == 0">选为标准词</el-radio>
|
|
@@ -209,14 +241,18 @@ import pinyin from '../../js/Convert_Pinyin.js';
|
|
|
}
|
|
|
],
|
|
|
unfit:false, //点确认时是否弹提示,
|
|
|
- saveDisable: false //保存按钮禁止点击
|
|
|
+ saveDisable: false, //保存按钮禁止点击
|
|
|
+ options:[],
|
|
|
+ copy:null
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
this.getTypeList();
|
|
|
const id = this.$route.params.id || '';
|
|
|
+ const copy = this.$route.params.copy || '';
|
|
|
+ this.copy = copy;
|
|
|
if(id){
|
|
|
- this.minTitle = '医学术语命名维护-修改';
|
|
|
+ this.minTitle = copy?'医学术语命名维护-复制':'医学术语命名维护-修改';
|
|
|
this.id = id;
|
|
|
this.colspan = 5;
|
|
|
this.getDetail(id);
|
|
@@ -285,6 +321,17 @@ import pinyin from '../../js/Convert_Pinyin.js';
|
|
|
if(data.code==0){
|
|
|
// this.typeList = data.data.records;
|
|
|
this.typeList = data.data;
|
|
|
+ // 类型改成平铺
|
|
|
+ if(data.data.length>0){
|
|
|
+ const total = data.data.length;
|
|
|
+ const average = parseInt(total/3);
|
|
|
+ const firstGroup = data.data.slice(0,average);
|
|
|
+ this.options.push({label:1,options:firstGroup});
|
|
|
+ const secGroup = data.data.slice(average,average*2);
|
|
|
+ this.options.push({label:2,options:secGroup});
|
|
|
+ const thirdGroup = data.data.slice(average*2,total-1);
|
|
|
+ this.options.push({label:3,options:thirdGroup});
|
|
|
+ }
|
|
|
}else{
|
|
|
this.$message({
|
|
|
message:data.msg,
|
|
@@ -327,16 +374,17 @@ import pinyin from '../../js/Convert_Pinyin.js';
|
|
|
}else if(type==2){
|
|
|
// 修改时术语名称、拼音和类型均不能修改
|
|
|
if(flg == 99){
|
|
|
- if(this.synonymous[index-1].name && !pattern.test(this.synonymous[index-1].name)){
|
|
|
+ // if(this.synonymous[index-1].name && !pattern.test(this.synonymous[index-1].name)){
|
|
|
+ if(this.allwords[index].name && !pattern.test(this.allwords[index].name)){
|
|
|
this.$message({
|
|
|
- // message:'无法输入纯数字或者纯字符,请输入正确数据!',
|
|
|
message:'无法输入纯数字,请输入正确数据!',
|
|
|
type:'warning'
|
|
|
});
|
|
|
// this.synonymous[index-1].name = '';
|
|
|
this.unfit = true;
|
|
|
}else{
|
|
|
- let current = this.synonymous[index-1];
|
|
|
+ // let current = this.synonymous[index-1];
|
|
|
+ let current = this.allwords[index];
|
|
|
current.spell = pinyin.getCamelChars(current.name);
|
|
|
this.unfit = false;
|
|
|
}
|
|
@@ -484,7 +532,7 @@ import pinyin from '../../js/Convert_Pinyin.js';
|
|
|
'name':this.data.name,
|
|
|
'type':this.data.type,
|
|
|
'detailList':detailList,
|
|
|
- 'conceptId':this.id,
|
|
|
+ 'conceptId':this.copy?'':this.id,//复制当新增,把id置空
|
|
|
'sexType':sexCode,
|
|
|
'maxAge':this.maxAge,
|
|
|
'minAge':this.minAge
|
|
@@ -494,7 +542,7 @@ import pinyin from '../../js/Convert_Pinyin.js';
|
|
|
'name':this.data.name,
|
|
|
'type':this.data.type,
|
|
|
'detailList':detailList,
|
|
|
- 'conceptId':this.id
|
|
|
+ 'conceptId':this.copy?'':this.id
|
|
|
}
|
|
|
}
|
|
|
this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
@@ -502,7 +550,8 @@ import pinyin from '../../js/Convert_Pinyin.js';
|
|
|
const result = res.data;
|
|
|
if(result.code==0){
|
|
|
this.warning(res.data.msg||'操作成功','success');
|
|
|
- this.$router.push({name:'MedicalName'});
|
|
|
+ //返回带搜索条件的首页
|
|
|
+ this.$router.push({name:'MedicalName',params:Object.assign({},this.$route.params,{currentPage:1})});
|
|
|
/*if(flg == 14){
|
|
|
this.getDetail(this.id)
|
|
|
this.radioVal = ''
|
|
@@ -538,6 +587,19 @@ import pinyin from '../../js/Convert_Pinyin.js';
|
|
|
text-align: right;
|
|
|
margin-left: 0;
|
|
|
}
|
|
|
+ // 饿了么分组下拉
|
|
|
+ .el-scrollbar{
|
|
|
+ .el-select-dropdown__list{
|
|
|
+ .el-select-group__wrap{
|
|
|
+ min-width: 160px !important;
|
|
|
+ display: inline-block !important;
|
|
|
+ vertical-align: top !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-select-group__wrap::after{
|
|
|
+ background:#fff !important;
|
|
|
+ }
|
|
|
.displayColor {
|
|
|
color: #ccc;
|
|
|
cursor:not-allowed;
|