lkk
2025-03-12 a98aa4517e7244024f4647b2789b152948439f22
src/views/system/dept/index.vue
@@ -12,18 +12,20 @@
            style="margin-bottom: 15px"
          />
        </div>
        <div class="head-container">
          <el-tree
            :data="deptOption"
            :props="defaultProps"
            :expand-on-click-node="false"
            :filter-node-method="filterNode"
            ref="tree"
            node-key="id"
            default-expand-all
            highlight-current
            @node-click="handleNodeClick"
          />
        <div class="scrollable-container">
          <div class="content">
            <el-tree
              :data="deptOption"
              :props="defaultProps"
              :expand-on-click-node="false"
              :filter-node-method="filterNode"
              ref="tree"
              node-key="id"
              default-expand-all
              highlight-current
              @node-click="handleNodeClick"
            />
          </div>
        </div>
      </el-col>
      <el-col :span="20" :xs="24">
@@ -322,7 +324,11 @@
          </el-input>
        </el-form-item>
        <el-form-item label="his科室名" prop="hisksmc">
          <el-input v-model="form.hisksmc" placeholder="his科室名" style="width: 202px;">
          <el-input
            v-model="form.hisksmc"
            placeholder="his科室名"
            style="width: 202px"
          >
          </el-input>
        </el-form-item>
        <!-- <el-form-item label="重点科室" prop="deptFcusTypeCode">
@@ -362,10 +368,16 @@
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="submitForm">确 定</el-button>
      </div>
      <Packagese ref="aaa" @add="handleChanges" />
      <!-- 在父组件中 -->
      <Packagese
        ref="aaa"
        :visible="showPackagese"
        @add="handleChanges"
        :selectedId="form.hisksid"
      />
    </el-dialog>
  </div>
</template>
@@ -389,7 +401,7 @@
export default {
  name: "Dept",
  dicts: ["sys_normal_disable", "dict_user_orgtype", "dict_dept_type"],
  components: { Treeselect,Packagese },
  components: { Treeselect, Packagese },
  data() {
    let checkPhoneNum = (rule, value, callback) => {
      let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
@@ -402,12 +414,14 @@
      }
    };
    return {
      showPackagese: false,
      // 部门名称
      deptName: undefined,
      // 遮罩层
      loading: true,
      hospList: [],
      parentNameList: [],
      total: 0,
      // 显示搜索条件
      showSearch: true,
      // 表格树数据
@@ -500,18 +514,27 @@
    this.getDeptTree();
  },
  methods: {
    handlePacCode(data) {
  // 处理pacCode的逻辑
  console.log('Received pacCode:', data);
},
    handleQuerys() {
      this.showPackagese = true;
      if (this.form.hisksid) {
        this.$refs.aaa.list = [
          {
            pacCode: this.form.hisksid,
            pacName: this.form.hisksmc,
          },
        ];
      }
      this.$refs.aaa.open = true;
      this.$refs.aaa.getAllList();
      this.$refs.aaa.title = "数据字典";
    },
    handleChanges(param1) {
      this.form.lisXmbm = param1[0].pacCode;
      this.form.lisXmmc = param1[0].pacName;
      this.form = {
        ...this.form,
        hisksid: param1[0].pacCode,
        hisksmc: param1[0].pacName,
      };
    },
    /** 查询部门列表 */
    getList() {
@@ -658,14 +681,15 @@
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      // console.log(11111)
      // this.reset();
      this.form = row;
      this.form.parentId = this.form.parentId.toString();
      if (this.form.parentId == 0) {
        this.deptOption.push({ id: 0, label: "主类目" });
      }
      this.open = true;
      this.title = "科室信息维护  ";
      // getDept(row.deptId).then((response) => {
@@ -691,7 +715,6 @@
        if (valid) {
          if (this.form.deptId != undefined) {
            if (this.form.hospId) {
              // console.log(this.form);
              updateDept(this.form).then((response) => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
@@ -732,3 +755,17 @@
};
</script>
<style scoped>
.scrollable-container {
  width: 200px; /* 设置容器的宽度 */
  height: 629px; /* 设置容器的高度 */
  overflow: auto; /* 允许内容溢出时显示滚动条 */
  border: 1px solid #ccc; /* 可选:添加边框以更好地显示容器 */
  position: relative; /* 可选:使容器内的绝对定位元素能够正确显示 */
}
.content {
  width: 600px; /* 设置内容的宽度,以触发水平滚动条 */
  height: 1000px; /* 设置内容的高度,以触发垂直滚动条 */
}
</style>