|
@@ -9,16 +9,24 @@
|
|
|
<el-input v-model="form.tempName" placeholder="请输入模板名称"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所属医院:" prop="hospital" class="formItem">
|
|
|
- <el-select v-model="form.hospital" placeholder="请选择医院" class="selectHospital">
|
|
|
+ <el-select v-model="form.hospital" placeholder="请选择医院" class="selectHospital" @change="changeHsopital">
|
|
|
<el-option v-for="item in hospitalList" :key="item.id" :label="item.name" :value="item.val"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="选择模块:" prop="moduleName" class="formItem">
|
|
|
- <el-select v-model="form.moduleName" placeholder="请选择模块" class="selectModule">
|
|
|
+ <el-select v-model="form.moduleName" placeholder="请选择模块" class="selectModule" @change="changeHsopital">
|
|
|
<el-option v-for="item in moduleList" :key="item.id" :label="item.name" :value="item.val"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <el-form-item label="模块类型:" prop="moduleType" class="formItem">
|
|
|
+ <el-select v-model="form.moduleType" :disabled="form.hospital==='' || form.moduleName===''" placeholder="请选择模块类型" @change="changeModuleType" class="selectModule">
|
|
|
+ <el-option v-for="item in moduleTypeList" :key="item.id" :label="item.recTypeDetail" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="示例:" v-if="form.moduleType !==''" prop="example" class="formItem">
|
|
|
+ <span>{{form.example}}</span>
|
|
|
+ <!-- <el-input v-model="form.example" disabled placeholder="示例"></el-input> -->
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="添加模块内容:" prop="moduleInfo" class="formItem">
|
|
|
<div class="moduleInfoItem" v-for="(item,index) in moduleInfoList">
|
|
|
<div class="searchBox">
|
|
@@ -75,17 +83,20 @@ export default {
|
|
|
tempName: "",
|
|
|
hospital:"",
|
|
|
moduleName:"",
|
|
|
+ moduleType:""
|
|
|
},
|
|
|
rules:{
|
|
|
tempName:{ required: true, message: '请输入模块名称', trigger: ['blur', 'change']},
|
|
|
hospital:{ required: true, message: '请选择医院', trigger: ['blur', 'change']},
|
|
|
moduleName:{ required: true, message: '请输入选择模块', trigger: ['blur', 'change']},
|
|
|
+ moduleType:{ required: true, message: '请输入选择模块类型 ', trigger: ['blur', 'change']},
|
|
|
/*name:[{ required: true, message: '请输入显示名称',trigger: ['blur', 'change'] }],*/
|
|
|
},
|
|
|
searchIndex: -1,
|
|
|
|
|
|
hospitalList:[],
|
|
|
moduleList:[ ],
|
|
|
+ moduleTypeList:[], //模块类型列表
|
|
|
moduleInfoList:[
|
|
|
// {
|
|
|
// searchName:"",
|
|
@@ -111,7 +122,6 @@ export default {
|
|
|
created(){
|
|
|
this.getAllTypes();
|
|
|
const { isEdit, data } = this.$route.params
|
|
|
- console.log('data', data)
|
|
|
if(isEdit) {
|
|
|
this.isEdit = isEdit;
|
|
|
this.id = data.id
|
|
@@ -119,6 +129,11 @@ export default {
|
|
|
this.form.tempName = data.name
|
|
|
this.form.hospital = ''+data.hospitalId
|
|
|
this.form.moduleName = ''+data.modeId
|
|
|
+
|
|
|
+ this.getModuleTypeList().then(res =>{
|
|
|
+ this.form.moduleType = data.recordModuleId
|
|
|
+ this.form.example = this.moduleTypeList.find(item => item.id == this.form.moduleType).behospitalCodes
|
|
|
+ })
|
|
|
const moduleDetail = data.moduleDetail
|
|
|
const keysList = Object.keys(moduleDetail)
|
|
|
for(let i = 0; i < keysList.length; i++){
|
|
@@ -136,6 +151,7 @@ export default {
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -163,6 +179,32 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ changeHsopital(){
|
|
|
+ this.form.moduleType = ""
|
|
|
+ this.getModuleTypeList()
|
|
|
+ },
|
|
|
+ changeModule(){
|
|
|
+ this.form.moduleType = ""
|
|
|
+ this.getModuleTypeList()
|
|
|
+ },
|
|
|
+ changeModuleType(){
|
|
|
+ this.form.example = this.moduleTypeList.find(item => item.id == this.form.moduleType).behospitalCodes
|
|
|
+ },
|
|
|
+ getModuleTypeList(){
|
|
|
+ this.moduleTypeList = []
|
|
|
+ if(this.form.hospital === "" || this.form.moduleName===""){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return api.getModuleTypeList({hospitalId: this.form.hospital, modeId: this.form.moduleName}).then((res) =>{
|
|
|
+ if(res.data.code==="0"){
|
|
|
+ const data = res.data.data;
|
|
|
+ this.moduleTypeList = data
|
|
|
+ }else{
|
|
|
+ this.moduleTypeList=[]
|
|
|
+ this.warning("获取模块类型失败");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
addUnit(){
|
|
|
if(!this.form.hospital){
|
|
|
this.warning("请先选择所属医院")
|
|
@@ -249,7 +291,7 @@ export default {
|
|
|
confirm(form){
|
|
|
this.$refs[form].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- const {tempName,hospital,moduleName} = this.form
|
|
|
+ const {tempName,hospital,moduleName,moduleType} = this.form
|
|
|
let moduleDetail = [], moduleInfoList = this.moduleInfoList
|
|
|
for(let i = 0; i < moduleInfoList.length; i++){
|
|
|
for(let j = 0; j < moduleInfoList[i].selectFiled.length; j++){
|
|
@@ -270,7 +312,8 @@ export default {
|
|
|
modeId: moduleName,
|
|
|
hospitalId: hospital,
|
|
|
moduleDetail: moduleDetail,
|
|
|
- remark:''
|
|
|
+ remark:'',
|
|
|
+ recordModuleId:moduleType
|
|
|
}
|
|
|
if(this.isEdit){
|
|
|
param = Object.assign({}, param, {id: this.id})
|