|
@@ -1,16 +1,17 @@
|
|
|
<template>
|
|
|
<div class="groups-cont">
|
|
|
- <el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">
|
|
|
- <span v-if="!disabled&&!isLast" class="del-btn" @click="delRule">删除</span><!--:class="isLast?'disable del-btn':'del-btn'"-->
|
|
|
- <el-form-item label="基础依据名称:" prop="subDescription">
|
|
|
- <el-input v-model.trim = "groupData.subDescription" :disabled="disabled"></el-input>
|
|
|
+ <!--<el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">-->
|
|
|
+ <div class="sub-condition-form">
|
|
|
+ <span v-if="!isLast" class="del-btn" @click="delRule">删除</span><!--:class="isLast?'disable del-btn':'del-btn'"-->
|
|
|
+ <el-form-item label="基础依据名称:" :prop="ruleLine+ind+'.basDescription'">
|
|
|
+ <el-input v-model.trim = "groupData.basDescription"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="基础依据类型:" prop="subType">
|
|
|
- <el-select v-model="groupData.subType"
|
|
|
- :disabled="disabled"
|
|
|
+ <el-form-item label="基础依据类型:" prop="basType">
|
|
|
+ <el-select v-model="groupData.basType"
|
|
|
+ id="basTypeRef"
|
|
|
placeholder="请选择"
|
|
|
size="small"
|
|
|
- @change="subTypeChange">
|
|
|
+ @change="basTypeChange">
|
|
|
<el-option
|
|
|
v-for="item in baseTypes"
|
|
|
:key="item.id"
|
|
@@ -19,11 +20,11 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="基础依据术语类型:" prop="subLenCode">
|
|
|
- <el-select v-model="groupData.subLenCode"
|
|
|
- :disabled="disabled"
|
|
|
+ <el-form-item v-if="!showRegx" label="基础依据术语类型:" :prop="ruleLine+ind+'.basLibType'">
|
|
|
+ <el-select v-model="groupData.basLibType"
|
|
|
placeholder="请选择"
|
|
|
- size="small" @change="subCodeChange">
|
|
|
+ size="small"
|
|
|
+ :disabled="showRegx">
|
|
|
<el-option
|
|
|
v-for="item in baseTermTypeList"
|
|
|
:key="item.id"
|
|
@@ -32,8 +33,11 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="addDepartFormItem" label="医学标准术语:" prop="subConceptId">
|
|
|
- <el-select clearable remote filterable :disabled="disabled" :remote-method="searchConcept" v-model.trim="groupData.subConceptId">
|
|
|
+ <el-form-item v-if="showRegx" label="基础依据术语类型:" class="is-required">
|
|
|
+ <el-input disabled v-model="basTypeName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="!showRegx" class="addDepartFormItem" label="医学标准术语:" :prop="ruleLine+ind+'.basConceptId'">
|
|
|
+ <el-select clearable remote filterable :remote-method="searchConcept" v-model.trim="groupData.basConceptId">
|
|
|
<el-option
|
|
|
v-for="item in conceptList"
|
|
|
:key="item.conceptId"
|
|
@@ -42,7 +46,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="groupData.subType===2&&showDataType" label="选择类型:" prop="dataType">
|
|
|
+ <el-form-item v-if="groupData.basType===2&&showDataType" label="选择类型:" :prop="ruleLine+ind+'.dataType'">
|
|
|
<el-select v-model="groupData.dataType"
|
|
|
placeholder="请选择"
|
|
|
size="small" @change="dataTypeChange">
|
|
@@ -57,8 +61,8 @@
|
|
|
<el-form-item class="min-margin" v-if="groupData.dataType==='1'" label="最大值:">
|
|
|
<div class="select-item clearfix">
|
|
|
<el-col :span="3">
|
|
|
- <el-form-item prop="subMaxOperator">
|
|
|
- <el-select v-model="groupData.subMaxOperator"
|
|
|
+ <el-form-item prop="maxOperator">
|
|
|
+ <el-select v-model="groupData.maxOperator"
|
|
|
placeholder="请选择"
|
|
|
size="small" clearable>
|
|
|
<el-option
|
|
@@ -71,13 +75,13 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="3">
|
|
|
- <el-form-item prop="subMaxValue">
|
|
|
- <el-input type="text" v-model="groupData.subMaxValue" placeholder="填写数值"/>
|
|
|
+ <el-form-item prop="maxVal">
|
|
|
+ <el-input type="text" v-model="groupData.maxVal" placeholder="填写数值"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="3">
|
|
|
- <el-form-item prop="subMaxUnit">
|
|
|
- <el-input type="text" v-model.trim="groupData.subMaxUnit" placeholder="填写单位"/>
|
|
|
+ <el-form-item prop="maxUnit">
|
|
|
+ <el-input type="text" v-model.trim="groupData.maxUnit" placeholder="填写单位"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</div>
|
|
@@ -85,8 +89,8 @@
|
|
|
<el-form-item class="min-margin" v-if="groupData.dataType==='1'" label="最小值:">
|
|
|
<div class="select-item clearfix">
|
|
|
<el-col :span="3">
|
|
|
- <el-form-item prop="subMinOperator">
|
|
|
- <el-select v-model="groupData.subMinOperator"
|
|
|
+ <el-form-item prop="minOperator">
|
|
|
+ <el-select v-model="groupData.minOperator"
|
|
|
placeholder="请选择"
|
|
|
size="small" clearable>
|
|
|
<el-option
|
|
@@ -99,40 +103,42 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="3">
|
|
|
- <el-form-item prop="subMinValue">
|
|
|
- <el-input type="text" v-model="groupData.subMinValue" placeholder="填写数值"/>
|
|
|
+ <el-form-item prop="minVal">
|
|
|
+ <el-input type="text" v-model="groupData.minVal" placeholder="填写数值"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="3">
|
|
|
- <el-form-item prop="subMinUnit">
|
|
|
- <el-input type="text" v-model.trim="groupData.subMinUnit" placeholder="填写单位"/>
|
|
|
+ <el-form-item prop="minUnit">
|
|
|
+ <el-input type="text" v-model.trim="groupData.minUnit" placeholder="填写单位"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="groupData.subType!==6&&groupData.dataType==='2'" label="医学内容:" prop="subEqValue" class="discDesc is-required">
|
|
|
- <el-input type="textarea" rows="3" placeholder="请输入医学内容" v-model.trim="groupData.subEqValue"></el-input>
|
|
|
+ <el-form-item v-if="groupData.dataType==='2'" label="医学内容:" :prop="ruleLine+ind+'.eqValue'" class="discDesc is-required">
|
|
|
+ <el-input type="textarea" rows="3" placeholder="请输入医学内容" v-model.trim="groupData.eqValue"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="groupData.subType===6" label="正则表达式:" prop="subEqValue" class="discDesc is-required">
|
|
|
- <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.subEqValue"></el-input>
|
|
|
+ <el-form-item v-if="showRegx" label="正则表达式:" :prop="ruleLine+ind+'.eqValue'" class="discDesc is-required">
|
|
|
+ <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.eqValue"></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
- <div class="inner-oper" v-if="showAdd">
|
|
|
+ </div>
|
|
|
+ <!--</el-form>-->
|
|
|
+ <div class="inner-oper">
|
|
|
<span>新增基础依据:</span>
|
|
|
<span class="add-btn" @click="addRule"><img src="../../images/add.png" alt="新增基础依据"></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import api from '@api/knowledgeLib.js';
|
|
|
+ import api from '@api/zskDiagBase.js';
|
|
|
export default {
|
|
|
name:'DiagBaseItem',
|
|
|
- props:['groupData','ind','isLast','baseTypes','firstPlace','disabled','showAdd'],
|
|
|
+ props:['groupData','ind','isLast','baseTypes','parInx','inx'],
|
|
|
data(){
|
|
|
return {
|
|
|
baseTermTypeList:[],
|
|
|
typeList:[],
|
|
|
numTypes:'', //只有数值类型的类型id
|
|
|
+ basTypeName:'',
|
|
|
operMaxList:[
|
|
|
{name:'<=',key:'<='},
|
|
|
{name:'<',key:'<'},
|
|
@@ -143,44 +149,33 @@
|
|
|
dataTypes:[{id:'1',name:'数值类型'},{id:'2',name:'文本类型'}],
|
|
|
conceptList:[],
|
|
|
rules:{
|
|
|
- subDescription:[{ required: true, message: '请输入基础规则名称',trigger: ['blur'] },{
|
|
|
- validator: (rule,value,callback)=>{
|
|
|
- if(value.length>100){
|
|
|
- callback(new Error('规则名称不能超过100字'));
|
|
|
- }else{
|
|
|
- callback();
|
|
|
- }}, trigger: 'change'
|
|
|
- }],
|
|
|
- subType:[{ required: true, message: '请选择基础规则类型',trigger: ['change'] }],
|
|
|
- subLenCode:[{ required: true, message: '请选择基础规则术语类型',trigger: ['change'] }],
|
|
|
- subConceptId:[{ required: true, message: '请输入医学标准术语',trigger: ['blur'] }],
|
|
|
- dataType:[{ required: true, message: '请选择类型',trigger: ['change'] }],
|
|
|
- subMaxOperator:[{
|
|
|
+
|
|
|
+ maxOperator:[{
|
|
|
validator: (rule,value,callback)=>{
|
|
|
- const {subMaxValue,subMinOperator,subMinValue}=this.groupData;
|
|
|
- const val=value+subMinOperator+subMinValue+subMaxValue;
|
|
|
- if(!val||(!value&&subMaxValue!=='')){
|
|
|
+ const {maxVal,minOperator,minVal}=this.groupData;
|
|
|
+ const val=value+minOperator+minVal+maxVal;
|
|
|
+ if(!val||(!value&&maxVal!=='')){
|
|
|
callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
|
|
|
}else{
|
|
|
callback();
|
|
|
}}, trigger: 'blur'
|
|
|
}],
|
|
|
- subMinOperator:[{
|
|
|
+ minOperator:[{
|
|
|
validator: (rule,value,callback)=>{
|
|
|
- const {subMaxValue,subMaxOperator,subMinValue}=this.groupData;
|
|
|
- const val=value+subMaxOperator+subMinValue+subMaxValue;
|
|
|
- if(!val||(!value&&subMinValue!=='')){
|
|
|
+ const {maxVal,maxOperator,minVal}=this.groupData;
|
|
|
+ const val=value+maxOperator+minVal+maxVal;
|
|
|
+ if(!val||(!value&&minVal!=='')){
|
|
|
callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
|
|
|
}else{
|
|
|
callback();
|
|
|
}}, trigger: 'blur'
|
|
|
}],
|
|
|
- subMaxValue:[{
|
|
|
+ maxVal:[{
|
|
|
validator: (rule,value,callback)=>{
|
|
|
- const {subMaxOperator,subMinOperator,subMinValue}=this.groupData;
|
|
|
- const val=value+subMaxOperator+subMinValue+subMinOperator;
|
|
|
+ const {maxOperator,minOperator,minVal}=this.groupData;
|
|
|
+ const val=value+maxOperator+minVal+minOperator;
|
|
|
const isNum=/^(\-|\+)?\d+(\.\d+)?$/.test(value);
|
|
|
- if(!val||(value==''&&subMaxOperator)){
|
|
|
+ if(!val||(value==''&&maxOperator)){
|
|
|
callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
|
|
|
}else if(value!==''&&!isNum){
|
|
|
callback(new Error('只能输入数字'));
|
|
@@ -188,12 +183,12 @@
|
|
|
callback();
|
|
|
}}, trigger: 'blur'
|
|
|
}],
|
|
|
- subMinValue:[{
|
|
|
+ minVal:[{
|
|
|
validator: (rule,value,callback)=>{
|
|
|
- const {subMaxValue,subMinOperator,subMaxOperator}=this.groupData;
|
|
|
- const val=value+subMaxOperator+subMaxValue+subMinOperator;
|
|
|
+ const {maxVal,minOperator,maxOperator}=this.groupData;
|
|
|
+ const val=value+maxOperator+maxVal+minOperator;
|
|
|
const isNum=/^(\-|\+)?\d+(\.\d+)?$/.test(value);
|
|
|
- if(!val||(value==''&&subMinOperator)){
|
|
|
+ if(!val||(value==''&&minOperator)){
|
|
|
callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
|
|
|
}else if(value!==''&&!isNum){
|
|
|
callback(new Error('只能输入数字'));
|
|
@@ -201,7 +196,7 @@
|
|
|
callback();
|
|
|
}}, trigger: 'blur'
|
|
|
}],
|
|
|
- subEqValue:[{
|
|
|
+ eqValue:[{
|
|
|
validator: (rule,value,callback)=>{
|
|
|
if(value===''){
|
|
|
callback(new Error('请输入'+this.textName));
|
|
@@ -214,77 +209,56 @@
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
- watch:{
|
|
|
- 'groupData':{
|
|
|
- handler:function(val){
|
|
|
- this.$emit("changeVal",val,this.ind);
|
|
|
- },
|
|
|
- deep:true
|
|
|
- },
|
|
|
- 'baseTypes':{
|
|
|
- handler:function(val){
|
|
|
- if(!this.groupData.subType){
|
|
|
- this.baseTermTypeList =[];
|
|
|
- return;
|
|
|
- }
|
|
|
- const obj = val.find((it)=>it.type===this.groupData.subType);
|
|
|
- this.baseTermTypeList = obj.subMenuList;
|
|
|
+ watch: {
|
|
|
+ 'groupData': {
|
|
|
+ handler: function (val) {
|
|
|
+ this.$emit("changeVal", val, this.ind);
|
|
|
},
|
|
|
- deep:true
|
|
|
+ deep: true
|
|
|
},
|
|
|
- 'firstPlace':{
|
|
|
- handler:function(val) {
|
|
|
- if (this.ind!==0||!val) return;
|
|
|
- const dict = localStorage.getItem("zskDicts").match(new RegExp(val.checkedType+'-\\d+','g'))||[];
|
|
|
- const types = dict[0].split("-");
|
|
|
- const sub = this.baseTypes.find((it) => it.ruleType === +types[0] && it.type === +types[2]);
|
|
|
- this.groupData.subType = sub.type;
|
|
|
- this.baseTermTypeList = sub.subMenuList;
|
|
|
- this.groupData.subLenCode = (this.baseTermTypeList.find((it) => it.ruleType === +types[0])||{}).code;
|
|
|
- this.conceptList = [val];
|
|
|
- this.groupData.subDescription = val.conceptName;
|
|
|
- this.groupData.subConceptId = val.conceptId;
|
|
|
- this.groupData.subConceptName = val.conceptName;
|
|
|
- },
|
|
|
- deep:true
|
|
|
- }
|
|
|
},
|
|
|
created(){
|
|
|
this.numTypes = localStorage.getItem("zskNumDict");
|
|
|
- this.conceptList=[{conceptName:this.groupData.subLibName||this.groupData.subConceptName,conceptId:this.groupData.subConceptId}];
|
|
|
- if(this.groupData.subLenCode){
|
|
|
- this.baseTermTypeList=[{name:this.groupData.subLenName,code:this.groupData.subLenCode}];
|
|
|
+ this.conceptList=[{conceptName:this.groupData.subLibName||this.groupData.subConceptName,conceptId:this.groupData.basConceptId}];
|
|
|
+ if(this.groupData.basLibType){
|
|
|
+ this.baseTermTypeList=[{name:this.groupData.subLenName,code:this.groupData.basLibType}];
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
+ ruleLine:function(){
|
|
|
+ return 'klDiagnoseTypeVO.'+this.parInx+'.groupVO.'+this.inx+'.klDiagnoseDetail.';
|
|
|
+ },
|
|
|
showDataType:function(){
|
|
|
- return (this.numTypes+',').indexOf(this.groupData.subLenCode+',')===-1;
|
|
|
+ return (this.numTypes+',').indexOf(this.groupData.basLibType+',')===-1;
|
|
|
+ },
|
|
|
+ showRegx:function(){
|
|
|
+ return this.groupData.basType===3||this.groupData.basType===4;
|
|
|
},
|
|
|
textName:function(){
|
|
|
- return this.groupData.subType!==6&&this.groupData.dataType==='2'?'医学内容':'正则表达式';
|
|
|
- }
|
|
|
+ return this.showRegx?'正则表达式':'医学内容';
|
|
|
+ },
|
|
|
},
|
|
|
methods:{
|
|
|
dataTypeChange(val){
|
|
|
- this.groupData.subEqOperator=(val==='2'?'=':'');
|
|
|
+ this.groupData.eqOperator=(val==='2'?'=':'');
|
|
|
this.clearNumText();
|
|
|
delete this.groupData.dataType; //触发更新
|
|
|
this.$set(this.groupData,'dataType',val);
|
|
|
},
|
|
|
- subTypeChange(val){ //基础规则类型修改
|
|
|
- this.groupData.subLenCode='';
|
|
|
- this.groupData.dataType='';
|
|
|
- this.clearConcept();
|
|
|
- this.clearNumText();
|
|
|
+ basTypeChange(val){ //基础规则类型修改
|
|
|
if(!val){
|
|
|
this.baseTermTypeList =[];
|
|
|
return;
|
|
|
}
|
|
|
+ this.basTypeName=this.baseTypes.find((it)=>it.type===val).name;
|
|
|
+ this.groupData.basLibType=this.groupData.basType;
|
|
|
+ this.clearConcept();
|
|
|
+ this.clearNumText();
|
|
|
const obj = this.baseTypes.find((it)=>it.type===val);
|
|
|
this.baseTermTypeList = obj.subMenuList;
|
|
|
},
|
|
|
subCodeChange(val){ //基础规则术语类型修改
|
|
|
- this.groupData.subLenCode=val;
|
|
|
+ this.groupData.basLibType=val;
|
|
|
if((this.numTypes+',').indexOf(val+',')>-1){
|
|
|
this.groupData.dataType='1';
|
|
|
}else{
|
|
@@ -294,23 +268,23 @@
|
|
|
this.clearNumText();
|
|
|
},
|
|
|
clearConcept(){
|
|
|
- this.groupData.subConceptId='';
|
|
|
+ this.groupData.basConceptId='';
|
|
|
this.conceptList=[];
|
|
|
},
|
|
|
clearNumText(){
|
|
|
- this.groupData.subMaxOperator='';
|
|
|
- this.groupData.subMaxValue='';
|
|
|
- this.groupData.subMaxUnit='';
|
|
|
- this.groupData.subMinOperator='';
|
|
|
- this.groupData.subMinValue='';
|
|
|
- this.groupData.subMinUnit='';
|
|
|
- this.groupData.subEqValue='';
|
|
|
- this.groupData.subEqOperator='';
|
|
|
+ this.groupData.maxOperator='';
|
|
|
+ this.groupData.maxVal='';
|
|
|
+ this.groupData.maxUnit='';
|
|
|
+ this.groupData.minOperator='';
|
|
|
+ this.groupData.minVal='';
|
|
|
+ this.groupData.minUnit='';
|
|
|
+ this.groupData.eqValue='';
|
|
|
+ this.groupData.eqOperator='';
|
|
|
},
|
|
|
searchConcept(val){
|
|
|
const param = {
|
|
|
- excludedConceptIds:[this.groupData.subType],
|
|
|
- libType:this.groupData.subLenCode,
|
|
|
+ excludedConceptIds:[this.groupData.basType],
|
|
|
+ libType:this.groupData.basLibType,
|
|
|
name:val,
|
|
|
};
|
|
|
api.searchConcept(param).then((res) => {
|
|
@@ -326,14 +300,7 @@
|
|
|
this.$emit("addRule");
|
|
|
},
|
|
|
delRule(){
|
|
|
- if(this.isLast){
|
|
|
- this.warning("初始状态规则不能删除~");
|
|
|
- return;
|
|
|
- }
|
|
|
- //this.showConfirmDialog("是否删除该条规则,可能对现有系统会造成影响",()=>{
|
|
|
this.$emit("delRule",this.ind);
|
|
|
- //});
|
|
|
-
|
|
|
},
|
|
|
warning(msg,type){
|
|
|
this.$message({
|
|
@@ -356,6 +323,7 @@
|
|
|
<style lang="less">
|
|
|
.groups-cont{
|
|
|
background: #fff;
|
|
|
+ margin-top:20px;
|
|
|
.conceptItem{
|
|
|
padding: 0 10px;
|
|
|
cursor: pointer;
|