|
@@ -46,7 +46,7 @@
|
|
|
:title="searchItem.name"
|
|
|
@click="selectSearchFiled(searchItem,index)"
|
|
|
>
|
|
|
- {{searchItem.name}}
|
|
|
+ {{searchItem.tagName}}
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -58,7 +58,7 @@
|
|
|
<span class="el-icon-arrow-down order" @click="downFiled(index)"></span>
|
|
|
</div>
|
|
|
<div class="selectFiled" v-for="(it,ii) in item.selectFiled">
|
|
|
- <span class="filedName" :class="{activeFiledName: item.activeIndex == ii}" @click="setActiveIndex(index,ii)">{{it.name}}
|
|
|
+ <span class="filedName" :class="{activeFiledName: item.activeIndex == ii}" @click="setActiveIndex(index,ii)">{{it.tagName}}
|
|
|
<span class="el-icon-circle-close delFiled" @click="delSelected(ii,index)"></span>
|
|
|
</span>
|
|
|
|
|
@@ -84,12 +84,23 @@
|
|
|
list:[],
|
|
|
labelPosition:'left',
|
|
|
isFirst:true,
|
|
|
+ isEdit: true,
|
|
|
title:'组合字段维护-添加组合字段',
|
|
|
form:{
|
|
|
modeId:"",
|
|
|
hospitalId:"",
|
|
|
name:'',
|
|
|
- remark:'',
|
|
|
+ tagType:4, //固定
|
|
|
+ controlType: 0,
|
|
|
+ name:'',
|
|
|
+ val:'',
|
|
|
+ tagName:'',
|
|
|
+ addLine:0,
|
|
|
+ bold:0,
|
|
|
+ position:0,
|
|
|
+ retract:0,
|
|
|
+ casesEntryIds:'',
|
|
|
+ questionMappings:[]
|
|
|
},
|
|
|
id:null,
|
|
|
rules:{
|
|
@@ -110,15 +121,7 @@
|
|
|
searchResult:[
|
|
|
],
|
|
|
selectFiled:[
|
|
|
- {
|
|
|
- name: "4姓名"
|
|
|
- },
|
|
|
- {
|
|
|
- name: "5职业"
|
|
|
- },
|
|
|
- {
|
|
|
- name: "6年龄"
|
|
|
- }
|
|
|
+
|
|
|
]
|
|
|
}
|
|
|
]
|
|
@@ -126,17 +129,26 @@
|
|
|
},
|
|
|
created(){
|
|
|
this.getAllTypes();
|
|
|
- let info = this.$route.params.info;
|
|
|
- if(info){
|
|
|
+ let {isEdit,data} = this.$route.params;
|
|
|
+ if(isEdit){
|
|
|
this.title='组合字段维护-修改组合字段';
|
|
|
- this.form = Object.assign({},info);
|
|
|
+ this.id = data.id
|
|
|
+ this.isEdit = isEdit
|
|
|
+ this.form = Object.assign({},data);
|
|
|
+ let questionMappings = this.form.questionMapping ||[]
|
|
|
+ let selectFiled = []
|
|
|
+ for(let i = 0; i < questionMappings.length; i++){
|
|
|
+ selectFiled.push(questionMappings[i])
|
|
|
+ }
|
|
|
+ this.combineInfoList[0].selectFiled = selectFiled
|
|
|
+ this.form.questionMapping = []
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
getAllTypes(){
|
|
|
if(localStorage.getItem("qcModuleTypes")){
|
|
|
this.hisTypes = JSON.parse(localStorage.getItem("qcHospitalTypes"));
|
|
|
- this.fieldTypes = JSON.parse(localStorage.getItem("qcModuleTypes"));console.log()
|
|
|
+ this.fieldTypes = JSON.parse(localStorage.getItem("qcModuleTypes"));
|
|
|
return ;
|
|
|
}
|
|
|
//获取枚举信息
|
|
@@ -157,6 +169,14 @@
|
|
|
if(!searchName){
|
|
|
return
|
|
|
}
|
|
|
+ if(this.form.hospitalId === ''){
|
|
|
+ this.warning("请选择所属医院")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.form.modeId === ''){
|
|
|
+ this.warning("请选择所属模块")
|
|
|
+ return
|
|
|
+ }
|
|
|
const param = {
|
|
|
tagName: searchName,
|
|
|
hospitalId: this.form.hospitalId,
|
|
@@ -222,10 +242,25 @@
|
|
|
}*/
|
|
|
this.$refs[form].validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ let questionMappings = []
|
|
|
+ const combineInfoList = this.combineInfoList
|
|
|
+ for(let i = 0; i < combineInfoList.length; i++){
|
|
|
+ const selectFiledList = combineInfoList[i].selectFiled
|
|
|
+ for(let j = 0; j < selectFiledList.length; j++){
|
|
|
+ questionMappings.push({
|
|
|
+ sonQuestion: selectFiledList[j].id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(questionMappings.length === 0){
|
|
|
+ this.warning('请添加组合内容')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.form = Object.assign({}, this.form,{questionMappings: questionMappings})
|
|
|
if(this.id && !this.copy){//修改
|
|
|
const param = Object.assign({},this.form,{id:this.id})
|
|
|
this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
- api.updateFieldMatch(param).then((res)=>{
|
|
|
+ api.addFieldMatch({questionWrapper:param}).then((res)=>{
|
|
|
if(res.data.code==0){
|
|
|
this.$message({
|
|
|
message:"修改成功",
|
|
@@ -233,7 +268,7 @@
|
|
|
});
|
|
|
//返回带搜索条件的首页
|
|
|
this.$router.push({
|
|
|
- name: 'VersionInfo',
|
|
|
+ name: 'CombineFeild',
|
|
|
params: Object.assign({}, this.$route.params, {currentPage: 1})
|
|
|
});
|
|
|
}else{
|
|
@@ -247,13 +282,13 @@
|
|
|
}else{//添加
|
|
|
const params = Object.assign({},this.form);
|
|
|
this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
- api.addFieldMatch(params).then((res)=>{
|
|
|
+ api.addFieldMatch({questionWrapper:params}).then((res)=>{
|
|
|
if(res.data.code==0){
|
|
|
this.$message({
|
|
|
message:"添加成功",
|
|
|
type:'success'
|
|
|
})
|
|
|
- this.$router.push({name: 'BaseField'});
|
|
|
+ this.$router.push({name: 'CombineFeild'});
|
|
|
}else{
|
|
|
this.$message({
|
|
|
message:res.data.msg,
|
|
@@ -268,6 +303,14 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ warning(msg, type,time) {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: msg,
|
|
|
+ type: type || 'warning',
|
|
|
+ duration:time || '3000'
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -282,6 +325,10 @@
|
|
|
.el-form-item{
|
|
|
width: 600px;
|
|
|
}
|
|
|
+ /deep/.el-input__inner {
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
.moduleInfoItem{
|
|
|
width: 500px;
|
|
|
min-height: 200px;
|