|
@@ -36,6 +36,7 @@
|
|
|
<span class="changeTips">改变类型后,填写单明细将会恢复到默认状态</span>
|
|
|
<el-select
|
|
|
v-model="form.relationId"
|
|
|
+ :disabled="!!editData.id"
|
|
|
placeholder="请选择科室"
|
|
|
>
|
|
|
<el-option
|
|
@@ -54,7 +55,7 @@
|
|
|
<el-select
|
|
|
v-model="form.type"
|
|
|
:clearable="false"
|
|
|
- :disabled="!!editData.id"
|
|
|
+ :disabled="!!editData.id||!form.moduleType||(form.moduleType==1&&!form.relationId)"
|
|
|
placeholder="请选择模板归属"
|
|
|
@change="changeType(0)"
|
|
|
>
|
|
@@ -161,13 +162,34 @@
|
|
|
const {isEdit,data} = this.$route.params;
|
|
|
this.getDropDatas();
|
|
|
if(isEdit){
|
|
|
+ //this.getAvailibleType();
|
|
|
this.txt = '模板维护-修改模板';
|
|
|
this.form = Object.assign({},this.form,this.transFormData(data));
|
|
|
this.editData = data;
|
|
|
}
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ 'form.moduleType':function(newVal,oldVal){
|
|
|
+ if(+newVal!==1){
|
|
|
+ this.form.relationId = '';
|
|
|
+ }
|
|
|
+ this.getAvailibleType();
|
|
|
+ },
|
|
|
+ 'form.relationId':function(newVal,oldVal){
|
|
|
+ this.getAvailibleType();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
back() { this.$router.go(-1) },
|
|
|
+ getAvailibleType(){
|
|
|
+ api.getModuleType({moduleType:this.form.moduleType,relationId:this.form.relationId}).then((res) =>{
|
|
|
+ if(res.data.code === '0') {
|
|
|
+ this.typeList = res.data.data;
|
|
|
+ }else{
|
|
|
+ this.warning(res.data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
transFormData(org){
|
|
|
const maps = {
|
|
|
'moduleType':'moduleType',
|