|
@@ -11,7 +11,8 @@
|
|
|
<el-select v-model="form.parRuleType"
|
|
|
placeholder="请选择"
|
|
|
size="small"
|
|
|
- @change="ruleTypeChange">
|
|
|
+ @change="ruleTypeChange"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in ruleTypeList"
|
|
|
:key="item.id"
|
|
@@ -20,8 +21,8 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="规则术语类型:" prop="parLibTypeId">
|
|
|
- <el-select v-model="form.parLibTypeId"
|
|
|
+ <el-form-item label="规则术语类型:" prop="parLenCode">
|
|
|
+ <el-select v-model="form.parLenCode"
|
|
|
placeholder="请选择"
|
|
|
size="small" @change="ruleTermChange">
|
|
|
<el-option
|
|
@@ -32,18 +33,15 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="addDepartFormItem" label="医学标准术语:" prop="parConceptName">
|
|
|
- <el-input @focus="inputFocus" @input="searchConcept" v-model="form.parConceptName" suffix-icon="el-icon-search"></el-input>
|
|
|
- <ul class="itemList" v-show="showList&&conceptList.length>0">
|
|
|
- <li
|
|
|
+ <el-form-item class="addDepartFormItem" label="医学标准术语:" prop="parConceptId">
|
|
|
+ <el-select clearable filterable remote :remote-method="searchConcept" v-model="form.parConceptId">
|
|
|
+ <el-option
|
|
|
v-for="item in conceptList"
|
|
|
- class="conceptItem ellipsis"
|
|
|
- :title="item.conceptName"
|
|
|
- @click="selectConcept(item)"
|
|
|
- :key="item.conceptId">
|
|
|
- {{item.conceptNameType||item.conceptName}}
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ :key="item.conceptId"
|
|
|
+ :label="item.conceptName"
|
|
|
+ :value="item.conceptId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="有无子条件:" prop="parHasSub">
|
|
|
<el-select v-model="form.parHasSub"
|
|
@@ -60,7 +58,7 @@
|
|
|
<el-form-item label="附加信息:" prop="remind" class="parMsg">
|
|
|
<el-input type="textarea" :rows="3" placeholder="请输入附加信息" v-model="form.parMsg" maxlength="121"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="form.parHasSub==='1'" label="规则内容:" prop="remind" class="discDesc">
|
|
|
+ <el-form-item v-if="form.parHasSub===1" label="规则内容:" prop="remind" class="discDesc">
|
|
|
<SubRulesGroup v-for="(group,i) in subGroups"
|
|
|
:data="group"
|
|
|
:baseTypes="baseTypeList"
|
|
@@ -84,13 +82,13 @@
|
|
|
return{
|
|
|
labelPosition:'left',
|
|
|
isFirst:true,
|
|
|
+ isCopy:false,
|
|
|
title:'规则维护-添加规则',
|
|
|
ruleTermTypeList:[],
|
|
|
ruleTypeList:[],
|
|
|
conceptList:[],
|
|
|
baseTypeList:[],
|
|
|
conceptName:'',
|
|
|
- showList:false,
|
|
|
subGroups:[[{
|
|
|
subDescription:'',
|
|
|
parRuleType:'',
|
|
@@ -107,9 +105,9 @@
|
|
|
parDescription:'',
|
|
|
parRuleType:'',
|
|
|
parConceptId:'',
|
|
|
- parConceptName:'',
|
|
|
- parHasSub:'',
|
|
|
- parLibTypeId:'',
|
|
|
+ parlibName:'',
|
|
|
+ parHasSub:undefined,
|
|
|
+ parLenCode:'',
|
|
|
parMsg:'',
|
|
|
klRuleInfoSaveSub:[],
|
|
|
},
|
|
@@ -124,8 +122,8 @@
|
|
|
}}, trigger: 'change'
|
|
|
}],
|
|
|
parRuleType:[{ required: true, message: '请选择规则类型',trigger: ['blur'] }],
|
|
|
- parLibTypeId:[{ required: true, message: '请选择规则术语类型',trigger: ['blur'] }],
|
|
|
- parConceptName:[{ required: true, message: '请输入医学标准术语',trigger: ['blur'] }],
|
|
|
+ parLenCode:[{ required: true, message: '请选择规则术语类型',trigger: ['blur'] }],
|
|
|
+ parlibName:[{ required: true, message: '请输入医学标准术语',trigger: ['blur'] }],
|
|
|
parHasSub:[{ required: true, message: '请选择有无子条件',trigger: ['blur'] }],
|
|
|
parMsg:[{
|
|
|
validator: (rule,value,callback)=>{
|
|
@@ -136,29 +134,58 @@
|
|
|
}}, trigger: 'change'
|
|
|
}]
|
|
|
},
|
|
|
- hasSub:[{name:'有',id:'1'},{name:'无',id:'0'},
|
|
|
+ hasSub:[{name:'有',id:1},{name:'无',id:0},
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
- let info = this.$route.params.data;
|
|
|
+ this.getTypeList();
|
|
|
+ const param = this.$route.params;
|
|
|
+ let info = param.data;
|
|
|
if(info){
|
|
|
this.id = info.id;
|
|
|
- this.title = "规则维护-修改规则";
|
|
|
+ this.isCopy=param.copy;
|
|
|
+ this.title = "规则维护-"+(this.isCopy?'复制':'修改')+"规则";
|
|
|
this.form=Object.assign({},this.form,info);
|
|
|
- // this.getList();
|
|
|
+ this.conceptList=[{conceptName:this.form.parlibName,conceptId:this.form.parConceptId}];
|
|
|
+ this.subGroups=this.formatGroupDatas(info.klRuleByIdSub);
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ 'form.parRuleType':function(val){
|
|
|
+ const obj = this.ruleTypeList.find((it)=>it.id===val);
|
|
|
+ this.ruleTermTypeList = obj.subMenuList;
|
|
|
+ },
|
|
|
+ 'form.parLenCode':function(val){
|
|
|
+ const obj = this.ruleTermTypeList.find((it)=>it.code===val);
|
|
|
+ this.baseTypeList = obj.subMenuList;
|
|
|
}
|
|
|
- this.getTypeList();
|
|
|
},
|
|
|
components:{
|
|
|
SubRulesGroup
|
|
|
},
|
|
|
methods:{
|
|
|
+ showConfirmDialog(msg,resolve){
|
|
|
+ this.$alert(msg, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ resolve();
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ formatGroupDatas(data){
|
|
|
+ let arr=[];
|
|
|
+ data.map((it)=>{
|
|
|
+ if(!arr[it.groupType]){arr[it.groupType]=[];}
|
|
|
+ arr[it.groupType].push(it);
|
|
|
+ })
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
searchConcept(val){
|
|
|
- console.log(val)
|
|
|
const param = {
|
|
|
excludedConceptIds:[this.form.parRuleType],
|
|
|
- libTypes:[this.form.parLibTypeId],
|
|
|
+ libType:this.form.parLenCode,
|
|
|
name:val,
|
|
|
};
|
|
|
api.searchConcept(param).then((res) => {
|
|
@@ -170,41 +197,26 @@
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
|
- selectConcept(it){
|
|
|
- this.form.parConceptName=it.conceptName;
|
|
|
- this.form.parConceptId = it.conceptId;
|
|
|
- this.showList = false;
|
|
|
- },
|
|
|
- inputFocus(){
|
|
|
- this.showList = !this.showList;
|
|
|
- },
|
|
|
- ruleTypeChange(val){ //规则类型选中
|
|
|
- this.form.parRuleType=val;
|
|
|
- this.form.parLibTypeId='';
|
|
|
- const obj = this.ruleTypeList.find((it)=>it.id===val);//console.log(val)
|
|
|
- this.ruleTermTypeList = obj.subMenuList;
|
|
|
- this.setInitGroupData();
|
|
|
+ ruleTypeChange(val){ //规则类型选中
|
|
|
+ //this.showConfirmDialog('确定要修改规则类型吗?修改后规则内容将被清空',function(){
|
|
|
+ this.form.parRuleType=val;
|
|
|
+ this.form.parLenCode='';
|
|
|
+ const obj = this.ruleTypeList.find((it)=>it.id===val);//console.log(val)
|
|
|
+ this.ruleTermTypeList = obj.subMenuList;
|
|
|
+ this.setInitGroupData();
|
|
|
+ //});
|
|
|
},
|
|
|
ruleTermChange(val){ //规则术语类型选中
|
|
|
- this.form.parLibTypeId=val;
|
|
|
- const obj = this.ruleTermTypeList.find((it)=>it.code===val);//console.log(val)
|
|
|
- this.baseTypeList = obj.subMenuList;
|
|
|
- this.setInitGroupData();
|
|
|
+ //this.showConfirmDialog('确定要修改规则术语类型吗?修改后规则内容将被清空',function(){
|
|
|
+ this.form.parLenCode=val;
|
|
|
+ const obj = this.ruleTermTypeList.find((it)=>it.code===val);
|
|
|
+ this.baseTypeList = obj.subMenuList;
|
|
|
+ this.setInitGroupData();
|
|
|
+ //});
|
|
|
},
|
|
|
getTypeList(){
|
|
|
- const typeListData = localStorage.getItem("zskTypesList");
|
|
|
- if(typeListData){
|
|
|
- this.ruleTypeList = typeListData;
|
|
|
- return;
|
|
|
- }
|
|
|
- api.getTypesList({}).then((res) => {
|
|
|
- if (res.data.code == '0') {
|
|
|
- const data = res.data.data;
|
|
|
- this.ruleTypeList = data;
|
|
|
- }
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error);
|
|
|
- });
|
|
|
+ const typeListData = JSON.parse(localStorage.getItem("zskTypesList"));
|
|
|
+ this.ruleTypeList = typeListData;
|
|
|
},
|
|
|
setInitGroupData(){
|
|
|
this.subGroups = [[{
|
|
@@ -219,7 +231,7 @@
|
|
|
subMinUnit:'',
|
|
|
subMinValue:''
|
|
|
}]];
|
|
|
- this.form.parConceptName='';//医学标准术语清空
|
|
|
+ this.form.parlibName='';//医学标准术语清空
|
|
|
this.conceptList=[]; //下拉列表清空
|
|
|
},
|
|
|
getDetail(){
|
|
@@ -275,33 +287,12 @@
|
|
|
confirm(){
|
|
|
this.$refs['form'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.form.klRuleInfoSaveSub = this.formatGroups();
|
|
|
- if(this.parId){//修改
|
|
|
- const params = Object.assign({},this.form,{id:this.parId?this.parId:undefined})
|
|
|
- /*api.saveRule(param).then((res)=>{
|
|
|
- if(res.data.code==0){
|
|
|
- this.$message({
|
|
|
- message:"修改成功",
|
|
|
- type:'success'
|
|
|
- });
|
|
|
- //返回带搜索条件的首页
|
|
|
- this.$router.push({
|
|
|
- name: 'VersionInfo',
|
|
|
- params: Object.assign({}, this.$route.params, {currentPage: 1})
|
|
|
- });
|
|
|
- }else{
|
|
|
- this.$message({
|
|
|
- message:res.data.msg,
|
|
|
- type:'warning'
|
|
|
- });
|
|
|
- }
|
|
|
- })*/
|
|
|
- }else{//添加
|
|
|
- //const params = Object.assign({},this.form);
|
|
|
- this.saveRule(this.form)
|
|
|
- //console.log(params)
|
|
|
+ this.form.klRuleInfoSaveSub = this.form.parHasSub?this.formatGroups():undefined;
|
|
|
+ let params = this.form;
|
|
|
+ if(this.parId){//修改/复制
|
|
|
+ params = Object.assign({},this.form,{id:this.isCopy?undefined:this.parId})
|
|
|
}
|
|
|
- //this.saveRule(params);
|
|
|
+ this.saveRule(params);
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|