|
@@ -1,5 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="PubTagGroupWrapper">
|
|
<div class="PubTagGroupWrapper">
|
|
|
|
+ <el-button class="copyTmpt" type="primary" @click="copyTmpt" v-if="editData.id && this.form.region3 != 0">复制该内容</el-button>
|
|
<el-form
|
|
<el-form
|
|
class="groups"
|
|
class="groups"
|
|
:rules="rules"
|
|
:rules="rules"
|
|
@@ -13,7 +14,6 @@
|
|
>
|
|
>
|
|
<el-input
|
|
<el-input
|
|
v-model="form.region2"
|
|
v-model="form.region2"
|
|
- :disabled="!!editData.id"
|
|
|
|
maxLength="120"
|
|
maxLength="120"
|
|
placeholder="请输入模板名称"
|
|
placeholder="请输入模板名称"
|
|
></el-input>
|
|
></el-input>
|
|
@@ -24,7 +24,7 @@
|
|
>
|
|
>
|
|
<span class="changeTips">改变模板类型后,模板内容将会恢复到默认状态</span>
|
|
<span class="changeTips">改变模板类型后,模板内容将会恢复到默认状态</span>
|
|
<el-select
|
|
<el-select
|
|
- :disabled="!!editData.id"
|
|
|
|
|
|
+ :disabled="form.isCopy || !!editData.id"
|
|
v-model="form.region3"
|
|
v-model="form.region3"
|
|
placeholder="模板类型"
|
|
placeholder="模板类型"
|
|
@change="sendData"
|
|
@change="sendData"
|
|
@@ -64,7 +64,7 @@
|
|
>
|
|
>
|
|
<span class="changeTips">改变模板归属后,模板内容将会恢复到默认状态</span>
|
|
<span class="changeTips">改变模板归属后,模板内容将会恢复到默认状态</span>
|
|
<el-select
|
|
<el-select
|
|
- :disabled="!!editData.id || (form.region3 == '') || (form.region3 != '0' && form.region4 == '') || (form.region3 != '0' && form.region5 == '') "
|
|
|
|
|
|
+ :disabled="form.isCopy || !!editData.id || (form.region3 == '') || (form.region3 != '0' && form.region4 == '')"
|
|
v-model="form.region1"
|
|
v-model="form.region1"
|
|
placeholder="模板归属"
|
|
placeholder="模板归属"
|
|
@change="sendData"
|
|
@change="sendData"
|
|
@@ -97,14 +97,12 @@ export default {
|
|
numWord:0,
|
|
numWord:0,
|
|
Adscriptions:[],
|
|
Adscriptions:[],
|
|
sonLis:[],
|
|
sonLis:[],
|
|
- disabled1:'false',
|
|
|
|
- disabled2:'false',
|
|
|
|
- disabled3:'false',
|
|
|
|
form: {
|
|
form: {
|
|
region1: '', //归属
|
|
region1: '', //归属
|
|
region2: '', //模板名称
|
|
region2: '', //模板名称
|
|
region3: '', //类型
|
|
region3: '', //类型
|
|
region4: '', //所属科室慢病
|
|
region4: '', //所属科室慢病
|
|
|
|
+ isCopy:false
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
region1: [
|
|
region1: [
|
|
@@ -126,8 +124,12 @@ export default {
|
|
},
|
|
},
|
|
beforeMount:function(){
|
|
beforeMount:function(){
|
|
let templateType = localStorage.getItem('icssEnumsData') ? JSON.parse(localStorage.getItem('icssEnumsData')).moduleInfoTypeEnum : []
|
|
let templateType = localStorage.getItem('icssEnumsData') ? JSON.parse(localStorage.getItem('icssEnumsData')).moduleInfoTypeEnum : []
|
|
|
|
+ let templateOwn = localStorage.getItem('typeLis') ? JSON.parse(localStorage.getItem('typeLis')) : []
|
|
this.deptDis = localStorage.getItem('deptDis') ? JSON.parse(localStorage.getItem('deptDis')) : {}
|
|
this.deptDis = localStorage.getItem('deptDis') ? JSON.parse(localStorage.getItem('deptDis')) : {}
|
|
-
|
|
|
|
|
|
+ for(let i = 0;i < templateOwn.length;i++){
|
|
|
|
+ templateOwn[i].type = templateOwn[i].val
|
|
|
|
+ }
|
|
|
|
+ this.Adscriptions = templateOwn
|
|
this.AdscriptionsType = templateType
|
|
this.AdscriptionsType = templateType
|
|
},
|
|
},
|
|
computed:{
|
|
computed:{
|
|
@@ -148,8 +150,10 @@ export default {
|
|
tmpDeptDTOS.unshift(obj)
|
|
tmpDeptDTOS.unshift(obj)
|
|
}
|
|
}
|
|
this.sonLis = tmpDeptDTOS
|
|
this.sonLis = tmpDeptDTOS
|
|
- this.form.region4 = ''
|
|
|
|
- this.form.region1 = ''
|
|
|
|
|
|
+ if(!this.form.id){
|
|
|
|
+ this.form.region4 = ''
|
|
|
|
+ this.form.region1 = ''
|
|
|
|
+ }
|
|
}else if(newVal == 2){
|
|
}else if(newVal == 2){
|
|
let tmpDisDTOS = this.deptDis.disDTOS
|
|
let tmpDisDTOS = this.deptDis.disDTOS
|
|
let obj = {id:0,name:'通用'}
|
|
let obj = {id:0,name:'通用'}
|
|
@@ -157,39 +161,51 @@ export default {
|
|
tmpDisDTOS.unshift(obj)
|
|
tmpDisDTOS.unshift(obj)
|
|
}
|
|
}
|
|
this.sonLis = tmpDisDTOS
|
|
this.sonLis = tmpDisDTOS
|
|
- this.form.region1 = ''
|
|
|
|
- this.form.region4 = ''
|
|
|
|
|
|
+ if(!this.form.id){
|
|
|
|
+ this.form.region4 = ''
|
|
|
|
+ this.form.region1 = ''
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
- this.getTypes()
|
|
|
|
this.sonLis = []
|
|
this.sonLis = []
|
|
- this.form.region1 = ''
|
|
|
|
- this.form.region4 = ''
|
|
|
|
|
|
+ if(!this.form.id){
|
|
|
|
+ this.getTypes()
|
|
|
|
+ this.form.region4 = ''
|
|
|
|
+ this.form.region1 = ''
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
tmpOwnTo(newVal, preVal){
|
|
tmpOwnTo(newVal, preVal){
|
|
if(newVal != preVal){
|
|
if(newVal != preVal){
|
|
- this.getTypes()
|
|
|
|
- this.form.region1 = ''
|
|
|
|
|
|
+ if(!this.form.id){
|
|
|
|
+ this.getTypes()
|
|
|
|
+ this.form.region1 = ''
|
|
|
|
+ }
|
|
|
|
+ if(this.form.isCopy){
|
|
|
|
+ this.getTypes('copy')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
const editData = this.$props.editData;
|
|
const editData = this.$props.editData;
|
|
- console.log(editData)
|
|
|
|
- let templateOwn = localStorage.getItem('typeLis') ? JSON.parse(localStorage.getItem('typeLis')) : []
|
|
|
|
if(editData.id){ //修改
|
|
if(editData.id){ //修改
|
|
this.form = Object.assign({},this.form,editData);
|
|
this.form = Object.assign({},this.form,editData);
|
|
- this.Adscriptions = templateOwn
|
|
|
|
- this.form.region1 = (editData.type+'')
|
|
|
|
|
|
+ this.form.region1 = editData.type
|
|
this.form.region2 = editData.name
|
|
this.form.region2 = editData.name
|
|
- this.form.region3 = editData.moduleType
|
|
|
|
- this.form.region4 = editData.relationId
|
|
|
|
|
|
+ this.form.region3 = editData.moduleType+''
|
|
|
|
+ this.form.region4 = editData.relationId+''
|
|
}
|
|
}
|
|
this.$emit('changeVal', this.form, false)
|
|
this.$emit('changeVal', this.form, false)
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
- getTypes(){
|
|
|
|
|
|
+ copyTmpt(){
|
|
|
|
+ this.editData.id = ''
|
|
|
|
+ this.form.isCopy = true
|
|
|
|
+ this.$emit('staticOwn', this.form.region4, false)
|
|
|
|
+ this.$emit('changeVal', this.form, false)
|
|
|
|
+ },
|
|
|
|
+ getTypes(type){
|
|
let param = {
|
|
let param = {
|
|
"moduleType": this.form.region3,
|
|
"moduleType": this.form.region3,
|
|
"relationId": this.form.region4
|
|
"relationId": this.form.region4
|
|
@@ -197,7 +213,24 @@ export default {
|
|
api.getModuleType(param).then((res) => {
|
|
api.getModuleType(param).then((res) => {
|
|
if (res.data.code === '0') {//获取模板归属
|
|
if (res.data.code === '0') {//获取模板归属
|
|
let result = res.data.data
|
|
let result = res.data.data
|
|
- this.Adscriptions = result
|
|
|
|
|
|
+ if(type){
|
|
|
|
+ let num = 0;
|
|
|
|
+ for(let i = 0;i < result.length;i++){
|
|
|
|
+ if(result[i].type == this.form.region1){
|
|
|
|
+ ++num
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(num == 0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message:'该归属下的模板已添加',
|
|
|
|
+ type:'warning'
|
|
|
|
+ })
|
|
|
|
+ this.$emit('staticOwn', this.form.region4, false)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ this.Adscriptions = result
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -219,6 +252,12 @@ export default {
|
|
</script>
|
|
</script>
|
|
<style lang="less">
|
|
<style lang="less">
|
|
.PubTagGroupWrapper {
|
|
.PubTagGroupWrapper {
|
|
|
|
+ position: relative;
|
|
|
|
+ .copyTmpt {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 40px;
|
|
|
|
+ top: 20px;
|
|
|
|
+ }
|
|
.groups {
|
|
.groups {
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
padding: 20px;
|
|
padding: 20px;
|