|
@@ -20,19 +20,20 @@
|
|
|
loading-text="加载中..."
|
|
|
@change="changeWord"
|
|
|
value-key="conceptId"
|
|
|
+ @clear="handleClear"
|
|
|
ref="termName"
|
|
|
placeholder="搜索"
|
|
|
:remote-method="searchTerms">
|
|
|
- <el-option v-for="term in terms" :key="term.conceptId" :label="term.nameType" :value="term" ></el-option>
|
|
|
+ <el-option v-for="(term,idx) in terms" :key="idx" :label="term.name+(term.typeName?'('+term.typeName+')':'')" :value="term" ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="已选择标准术语:" label-width="160px">
|
|
|
{{form.selectedTermName}}
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <el-form-item v-if="form.selectedTerm&&(form.typeId==1||form.typeId==3||form.typeId==4||form.typeId==5)" :label="titleChange" prop="titleChange" label-width="160px">
|
|
|
+ <el-input v-model="form.titleChange"></el-input>
|
|
|
+ </el-form-item>
|
|
|
<p class="line"></p>
|
|
|
-
|
|
|
-
|
|
|
<InfoParagraph v-for="(f,i) in form.prags"
|
|
|
v-if="!upload"
|
|
|
:key="i"
|
|
@@ -111,15 +112,19 @@
|
|
|
typeId:'',
|
|
|
selectedTermName:'',
|
|
|
selectedTermType:'',
|
|
|
+ titleChange:'',
|
|
|
fileList:[],
|
|
|
+ name:'',
|
|
|
prags:[{ //单个段落相关
|
|
|
title:'',
|
|
|
content:'',
|
|
|
isReason:0,
|
|
|
orderNo:0,
|
|
|
position:[],
|
|
|
- text:''}],
|
|
|
- fileTitle:'',
|
|
|
+ text:''}
|
|
|
+ ],
|
|
|
+ fileTitle:'',
|
|
|
+ titleChange:''
|
|
|
},
|
|
|
rules: {
|
|
|
selectedTerm: [
|
|
@@ -132,7 +137,8 @@
|
|
|
callback(new Error('标题名称不能超过30字'));
|
|
|
}else{
|
|
|
callback();
|
|
|
- }}, trigger: 'change' }
|
|
|
+ }
|
|
|
+ }, trigger: 'change' }
|
|
|
],
|
|
|
fileList: [
|
|
|
{ required: true, message: '请上传文件', trigger: 'change' },
|
|
@@ -149,14 +155,6 @@
|
|
|
isShowTip: false
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- /*watch:{
|
|
|
- 'form.selectedTerm':function(newVal){
|
|
|
- const name = newVal.nameType;console.log(newVal)
|
|
|
- this.form.selectedTermName = name;
|
|
|
- this.form.conceptId = newVal.conceptId;
|
|
|
- }
|
|
|
- },*/
|
|
|
created:function(){
|
|
|
const {isEdit,data,isCopy} = this.$route.params;
|
|
|
if(isEdit||isCopy){
|
|
@@ -164,30 +162,32 @@
|
|
|
this.isCopy = isCopy;
|
|
|
this.title = isEdit?'编辑':(isCopy?'复制':'添加');
|
|
|
isEdit&&this.changeWord(data);
|
|
|
- //this.form.selectedTerm = data;
|
|
|
- //this.form.selectedTermName = data.libName;
|
|
|
- //this.form.conceptId = data.conceptId;
|
|
|
api.getTremList({id:data.id}).then((res) => {
|
|
|
if (res.data.code == '0') {
|
|
|
const data = res.data.data;
|
|
|
if(this.form.typeId === 82 || this.form.typeId === 83){
|
|
|
- console.log('data',data)
|
|
|
+ // console.log('data',data)
|
|
|
this.form.fileList=data&&data.map((it)=>{
|
|
|
return JSON.parse(it.content);
|
|
|
});
|
|
|
- console.log(' this.form.fileList', this.form.fileList)
|
|
|
this.showFileList = true
|
|
|
this.showUpLoad = false
|
|
|
}else{
|
|
|
- console.log(data.details) //ssssssssssssssssssss
|
|
|
+ console.log(data) //ssssssssssssssssssss
|
|
|
+ this.conceptId = data.id
|
|
|
+ this.form.typeId = data.type
|
|
|
+ this.form.name = data.name
|
|
|
+ this.form.titleChange = data.type==1?data.clinicalPathwayName:(data.type==3||data.type==4||data.type==5)?data.noticeName:''
|
|
|
+ this.form.selectedTermName = data.name+(data.typeName?'('+data.typeName+')':'')
|
|
|
+ this.form.selectedTerm = data.name+(data.typeName?'('+data.typeName+')':'')
|
|
|
this.form.prags=data&&data.details.map((it)=>{
|
|
|
return {
|
|
|
- title:it.title,
|
|
|
- position:this.mapStringToNum(it.position),
|
|
|
- content:it.content.replace(/{imageUrlPrefix}/g,config.imgHost),
|
|
|
- isReason:it.isReason,
|
|
|
- text:it.text,
|
|
|
- disabled:true};
|
|
|
+ title:it.title,
|
|
|
+ position:this.mapStringToNum(it.contentType ),
|
|
|
+ content:it.content.replace(/{imageUrlPrefix}/g,config.imgHost),
|
|
|
+ // isReason:it.isReason,
|
|
|
+ text:it.text,
|
|
|
+ disabled:true};
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -228,6 +228,11 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleClear(){
|
|
|
+ this.form.selectedTermName = ''
|
|
|
+ this.form.selectedTerm = ''
|
|
|
+ },
|
|
|
+
|
|
|
handleMouseenter(){
|
|
|
if(this.form.fileList.length !== 0 ){
|
|
|
this.isShowTip = true
|
|
@@ -237,14 +242,17 @@
|
|
|
this.isShowTip = false
|
|
|
},
|
|
|
changeWord(newVal){
|
|
|
- const name = newVal.nameType;
|
|
|
- this.form.selectedTermName = name;
|
|
|
- this.form.selectedTerm=name;
|
|
|
- this.form.conceptId = newVal.conceptId;
|
|
|
+ const name = newVal.name;
|
|
|
+ const typeName = newVal.typeName;
|
|
|
+ const type = newVal.type;
|
|
|
+ this.form.selectedTermName = name+(typeName?'('+typeName+')':'');
|
|
|
+ this.form.selectedTerm=name+(typeName?'('+typeName+')':'');
|
|
|
+ this.form.name=name
|
|
|
this.form.fileList=[]
|
|
|
this.showFileList = false
|
|
|
- this.form.typeId = newVal.typeId || ""
|
|
|
+ this.form.typeId = type || ""
|
|
|
this.showUpLoad = true
|
|
|
+ this.titleChange = type==1?'临床路径标题:':type==3||type==4||type==5?'注意事项标题:':''
|
|
|
this.form.fileTitle = ""
|
|
|
if(newVal.typeId === 82 || newVal.typeId === 83){
|
|
|
this.upload = true
|
|
@@ -262,9 +270,7 @@
|
|
|
return ;
|
|
|
}
|
|
|
temp = Object.assign(this.form.prags[i-1]);
|
|
|
- //temp.orderNo = temp.orderNo+1;
|
|
|
it = Object.assign(this.form.prags[i]);
|
|
|
- //it.orderNo = it.orderNo-1;
|
|
|
this.form.prags.splice(i-1,2,it,temp);
|
|
|
}else{
|
|
|
if(i===this.form.prags.length-1){
|
|
@@ -272,9 +278,7 @@
|
|
|
return ;
|
|
|
}
|
|
|
temp = Object.assign(this.form.prags[i+1]);
|
|
|
- //temp.orderNo = temp.orderNo-1;
|
|
|
it = Object.assign(this.form.prags[i]);
|
|
|
- //it.orderNo = it.orderNo+1;
|
|
|
this.form.prags.splice(i,2,temp,it);
|
|
|
}
|
|
|
},
|
|
@@ -287,16 +291,8 @@
|
|
|
text:''});
|
|
|
//添加段落光标自动落到新增的段落中
|
|
|
setTimeout(()=>{
|
|
|
- //console.log(this.$refs.subForm[i+1].$el.getElementsByClassName("el-input__inner")[0]);
|
|
|
this.$refs.subForm[i+1].$el.getElementsByClassName("el-input__inner")[0].focus()
|
|
|
})
|
|
|
- /*this.form.prags.push({
|
|
|
- title:'',
|
|
|
- content:'',
|
|
|
- isReason:0,
|
|
|
- orderNo:this.form.prags.length,
|
|
|
- position:[],
|
|
|
- text:''});*/
|
|
|
},
|
|
|
delParagraph(i){
|
|
|
if(this.form.prags.length==1){
|
|
@@ -310,11 +306,12 @@
|
|
|
back() { this.$router.go(-1) },
|
|
|
searchTerms(query){
|
|
|
if(!query.trim()){
|
|
|
+ this.form.terms = []
|
|
|
return;
|
|
|
}
|
|
|
//搜索术语列表
|
|
|
this.showDrop = true;
|
|
|
- api.getAllConcept({name:query.trim()}).then((res) =>{
|
|
|
+ api.getAllConcept({inputStr:query.trim(),types:[0]}).then((res) =>{
|
|
|
this.showDrop = false;
|
|
|
if(res.data.code === '0') {
|
|
|
this.terms = res.data.data;
|
|
@@ -375,13 +372,25 @@
|
|
|
}))
|
|
|
|
|
|
}else {
|
|
|
- param =item.map((it,i)=>{
|
|
|
- return Object.assign({},it,{
|
|
|
- position:typeof it.position=='string'?it.position:it.position.join(","),
|
|
|
- conceptId:this.form.conceptId,
|
|
|
- orderNo:i,
|
|
|
- content:it.content.replace(new RegExp(config.imgHost,'g'),'{imageUrlPrefix}')});
|
|
|
- });
|
|
|
+ let data = this.form.prags,tempArr=[],paramsAll={},types = this.form.typeId;
|
|
|
+ for(let i = 0;i < data.length;i++){
|
|
|
+ let obj = {}
|
|
|
+ obj.content = data[i].content
|
|
|
+ obj.text = data[i].text
|
|
|
+ obj.conceptId = data[i].conceptId
|
|
|
+ obj.orderNo = i
|
|
|
+ obj.title = data[i].title
|
|
|
+ obj.contentType = data[i].position.join(',')
|
|
|
+ tempArr.push(obj)
|
|
|
+ }
|
|
|
+ paramsAll.clinicalPathwayName = types==1?this.form.titleChange:''
|
|
|
+ paramsAll.id = ''
|
|
|
+ paramsAll.name = this.form.name
|
|
|
+ paramsAll.noticeName = types==3||types==4||types==5?this.form.titleChange:''
|
|
|
+ paramsAll.type = this.form.typeId
|
|
|
+ paramsAll.details = tempArr
|
|
|
+ param = paramsAll
|
|
|
+
|
|
|
}
|
|
|
this.showSaveDialog(param,'是否保存该静态知识?');
|
|
|
},
|
|
@@ -389,7 +398,6 @@
|
|
|
this.showConfirmDialog(msg, () => {
|
|
|
this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
api.saveTermPrompts(param).then((res) => {
|
|
|
-
|
|
|
if (res.data.code === '0') {
|
|
|
this.isSuccessUpload = 0 // 修改文件上传状态为0
|
|
|
this.warning(res.data.msg || '保存成功', 'success');
|
|
@@ -523,9 +531,9 @@
|
|
|
.NoiseTemplateWrapper .info-container .el-input__inner{
|
|
|
width: 250px;
|
|
|
}
|
|
|
- .NoiseTemplateWrapper .el-select .el-input .el-icon-circle-close{
|
|
|
- display: inherit!important;
|
|
|
- }
|
|
|
+ // .NoiseTemplateWrapper .el-select .el-input .el-icon-circle-close{
|
|
|
+ // display: inherit!important;
|
|
|
+ // }
|
|
|
.cacelBtn{
|
|
|
color: #22ccc8!important;
|
|
|
}
|
|
@@ -580,7 +588,10 @@
|
|
|
border-right: 6px solid transparent;
|
|
|
// border-right: 6px solid #4D4D4D;
|
|
|
}
|
|
|
-
|
|
|
+ .btn {
|
|
|
+ text-align: right;
|
|
|
+ padding-right: 20px;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
</style>
|