|  |  | 
 |  |  |   <div class="app-container"> | 
 |  |  |     <el-row :gutter="20"> | 
 |  |  |       <!--部门数据--> | 
 |  |  |       <el-col :span="4" :xs="24"> | 
 |  |  |       <!-- <el-col :span="4" :xs="24"> | 
 |  |  |         <div class="head-container"> | 
 |  |  |           <el-input | 
 |  |  |             v-model="deptName" | 
 |  |  | 
 |  |  |             @node-click="handleNodeClick" | 
 |  |  |           /> | 
 |  |  |         </div> | 
 |  |  |       </el-col> | 
 |  |  |       </el-col> --> | 
 |  |  |       <!--用户数据--> | 
 |  |  |       <el-col :span="20" :xs="24"> | 
 |  |  |       <el-col :span="24" :xs="24"> | 
 |  |  |         <el-form | 
 |  |  |           :model="queryParams" | 
 |  |  |           ref="queryForm" | 
 |  |  | 
 |  |  |           </el-col> | 
 |  |  |         </el-row> | 
 |  |  |         <el-form-item label="适用科室" prop="region"> | 
 |  |  |           <el-cascader | 
 |  |  |             style="width: 478px" | 
 |  |  |             v-model="form.deptCodes" | 
 |  |  |             @remove-tag="removehpsp" | 
 |  |  |             :options="deptOptions" | 
 |  |  |             :props="props" | 
 |  |  |             :show-all-levels="false" | 
 |  |  |             clearable | 
 |  |  |           > | 
 |  |  |             <template slot-scope="{ node, data }"> | 
 |  |  |               <span>{{ data.label }}</span> | 
 |  |  |               <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> | 
 |  |  |             </template> | 
 |  |  |           </el-cascader> | 
 |  |  |             <el-cascader | 
 |  |  |               style="width: 478px" | 
 |  |  |               v-model="form.deptCodes" | 
 |  |  |               @remove-tag="removehpsp" | 
 |  |  |               :options="deptOptionsks" | 
 |  |  |               :props="props" | 
 |  |  |               filterable | 
 |  |  |               clearable | 
 |  |  |             > | 
 |  |  |               <template slot-scope="{ node, data }"> | 
 |  |  |                 <span>{{ data.label }}</span> | 
 |  |  |                 <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> | 
 |  |  |               </template> | 
 |  |  |             </el-cascader> | 
 |  |  |         </el-form-item> | 
 |  |  |         <el-form-item label="适用病区" prop="region"> | 
 |  |  |           <el-cascader | 
 |  |  |             style="width: 478px" | 
 |  |  |             @remove-tag="removehpsp" | 
 |  |  |             v-model="form.wardCodes" | 
 |  |  |             :options="deptOptions" | 
 |  |  |             :props="props" | 
 |  |  |             :show-all-levels="false" | 
 |  |  |             clearable | 
 |  |  |           > | 
 |  |  |             <template slot-scope="{ node, data }"> | 
 |  |  |               <span>{{ data.label }}</span> | 
 |  |  |               <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> | 
 |  |  |             </template> | 
 |  |  |           </el-cascader> | 
 |  |  |             <el-cascader | 
 |  |  |               style="width: 478px" | 
 |  |  |               @remove-tag="removehpsp" | 
 |  |  |               v-model="form.wardCodes" | 
 |  |  |               :options="deptOptionsbq" | 
 |  |  |               :props="props" | 
 |  |  |               filterable | 
 |  |  |               clearable | 
 |  |  |             > | 
 |  |  |               <template slot-scope="{ node, data }"> | 
 |  |  |                 <span>{{ data.label }}</span> | 
 |  |  |                 <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> | 
 |  |  |               </template> | 
 |  |  |             </el-cascader> | 
 |  |  |         </el-form-item> | 
 |  |  |         <el-row> | 
 |  |  |           <el-col :span="12"> | 
 |  |  | 
 |  |  |       // 弹出层标题 | 
 |  |  |       title: "", | 
 |  |  |       // 部门树选项 | 
 |  |  |       deptOptions: undefined, | 
 |  |  |       deptOptionsks: undefined, | 
 |  |  |       deptOptionsbq: undefined, | 
 |  |  |       // 是否显示弹出层 | 
 |  |  |       open: false, | 
 |  |  |       // 部门名称 | 
 |  |  | 
 |  |  |       this.initPassword = response.msg; | 
 |  |  |     }); | 
 |  |  |   }, | 
 |  |  |   mounted() { | 
 |  |  |     this.$nextTick(() => { | 
 |  |  |       const menuWrap = document.querySelector('.el-cascader-menu__wrap'); | 
 |  |  |       if (menuWrap) { | 
 |  |  |         menuWrap.style.height = '404px'; | 
 |  |  |       } | 
 |  |  |     }); | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     /** 查询用户列表 */ | 
 |  |  |     getList() { | 
 |  |  | 
 |  |  |     /** 查询部门下拉树结构 */ | 
 |  |  |     getDeptTree() { | 
 |  |  |       // 科室列表 | 
 |  |  |       deptTreeSelect().then((response) => { | 
 |  |  |         this.deptOptions = response.data; | 
 |  |  |       deptTreeSelect(1).then((response) => { | 
 |  |  |         this.deptOptionsks = response.data; | 
 |  |  |       }); | 
 |  |  |       deptTreeSelect(2).then((response) => { | 
 |  |  |         this.deptOptionsbq = response.data; | 
 |  |  |       }); | 
 |  |  |       // 院区列表 | 
 |  |  |       //  deptTreeSelect().then((response) => { | 
 |  |  | 
 |  |  |         remark: undefined, | 
 |  |  |         postIds: [], | 
 |  |  |         roleIds: [], | 
 |  |  |         deptCodes: [], | 
 |  |  |         wardCodes: [], | 
 |  |  |       }; | 
 |  |  |       this.resetForm("form"); | 
 |  |  |     }, | 
 |  |  | 
 |  |  |         this.form = response.data; | 
 |  |  |         this.belongDepts = response.belongDepts; | 
 |  |  |         this.belongWards = response.belongWards; | 
 |  |  |         if (this.form.hospInfo) | 
 |  |  |         if (this.form.hospInfo) { | 
 |  |  |           this.form.deptCodes = JSON.parse(this.form.hospInfo); | 
 |  |  |         if (this.form.deptInfo) | 
 |  |  |         } else { | 
 |  |  |           this.form.deptCodes = []; | 
 |  |  |         } | 
 |  |  |         if (this.form.deptInfo) { | 
 |  |  |           this.form.wardCodes = JSON.parse(this.form.deptInfo); | 
 |  |  |         } else { | 
 |  |  |           this.form.wardCodes = []; | 
 |  |  |         } | 
 |  |  |         console.log(this.form.wardCodes, "wardCodes"); | 
 |  |  |         console.log(this.form.deptCodes, "deptCodes"); | 
 |  |  |  | 
 |  |  | 
 |  |  |     }, | 
 |  |  |     // 删除科室 | 
 |  |  |     removehpsp(valueArray) { | 
 |  |  |       console.log(valueArray,'删除科室'); | 
 |  |  |       console.log(this.form.userId,'删除'); | 
 |  |  |      let code=valueArray[valueArray.length-1]; | 
 |  |  |       removeusertd(this.form.userId,code).then((res) => { | 
 |  |  |       console.log(valueArray, "删除科室"); | 
 |  |  |       console.log(this.form.userId, "删除"); | 
 |  |  |       let code = valueArray[valueArray.length - 1]; | 
 |  |  |       removeusertd(this.form.userId, code).then((res) => { | 
 |  |  |         if (res.code) { | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  | 
 |  |  |       this.form.hospInfo = JSON.stringify(this.form.deptCodes); | 
 |  |  |       this.form.deptInfo = JSON.stringify(this.form.wardCodes); | 
 |  |  |       if (this.form.deptCodes.length) | 
 |  |  |       this.form.deptCodes = this.form.deptCodes.map( | 
 |  |  |         (subArr) => subArr[subArr.length - 1] | 
 |  |  |       ); | 
 |  |  |         this.form.deptCodes = this.form.deptCodes.map( | 
 |  |  |           (subArr) => subArr[subArr.length - 1] | 
 |  |  |         ); | 
 |  |  |       if (this.form.wardCodes.length) | 
 |  |  |       this.form.wardCodes = this.form.wardCodes.map( | 
 |  |  |         (subArr) => subArr[subArr.length - 1] | 
 |  |  |       ); | 
 |  |  |         this.form.wardCodes = this.form.wardCodes.map( | 
 |  |  |           (subArr) => subArr[subArr.length - 1] | 
 |  |  |         ); | 
 |  |  |       console.log(this.form.wardCodes, "wardCodes"); | 
 |  |  |       console.log(this.form.deptCodes, "deptCodes"); | 
 |  |  |  | 
 |  |  | 
 |  |  |   }, | 
 |  |  | }; | 
 |  |  | </script> | 
 |  |  | <style lang="scss" > | 
 |  |  | // ::v-deep .el-cascader-menu__wrap{ | 
 |  |  | //   min-height: 404px ; | 
 |  |  | // } | 
 |  |  | // ::v-deep.el-cascader-panel .el-cascader-menu__wrap { | 
 |  |  | //   height: 404px !important; | 
 |  |  | // } | 
 |  |  |  | 
 |  |  | </style> |