1
lkk
6 天以前 5eea8066e149ade255d1440b350be6a8ee93b848
src/views/system/user/index.vue
@@ -36,7 +36,6 @@
              :filter-node-method="filterNode"
              ref="tree"
              node-key="id"
              default-expand-all
              :default-expanded-keys="treeId"
              highlight-current
              @node-click="handleNodeClick"
@@ -375,7 +374,7 @@
                  icon="el-icon-d-arrow-right"
                  title="更多"
                ></el-button>
                <el-dropdown-menu slot="dropdown">
                <el-dropdown-menu slot="dropdown" :append-to-body="true">
                  <el-dropdown-item
                    command="handleResetPwd"
                    icon="el-icon-key"
@@ -388,15 +387,6 @@
                    v-hasPermi="['system:user:edit']"
                    >分配角色</el-dropdown-item
                  >
                  <!-- 添加用户详情按钮 点击跳出该用户的详细信息页面 -->
                  <!-- <el-button
                    size="mini"
                    type="text"
                    icon="el-icon-share"
                    @click="handleSearch(scope.row)"
                    v-hasPermi="['hosp:Userinfo:list']"
                    >详细信息</el-button
                  > -->
                </el-dropdown-menu>
              </el-dropdown>
            </template>
@@ -564,11 +554,10 @@
            </el-select>
            <!-- <el-input v-model="form.hospName" placeholder="请输入组织中文名称" /> -->
          </el-form-item>
          <el-form-item label="归属科室" prop="deptId">
          <el-form-item label="归属科室" prop="deptId" >
            <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属科室"
              style="width: 200px" /> -->
            <el-select
              v-if="DepartmentList.length > 0"
            <el-select
              v-model="form.deptId"
              placeholder="请选择归属科室"
              clearable
@@ -1332,7 +1321,7 @@
          </el-collapse>
        </el-form>
        <div slot="footer" class="dialog-footer1">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button :disabled="submit" type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </el-dialog>
@@ -1467,6 +1456,7 @@
      hospList: [],
      activeNames: ["1"],
      treeId: [],
      selectedDeptId: null,
      // 遮罩层
      loading: true,
      // 选中数组
@@ -1475,6 +1465,7 @@
      single: true,
      // 非多个禁用
      multiple: true,
      submit: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
@@ -1620,6 +1611,7 @@
    // 根据名称筛选部门树
    deptName(val) {
      console.log(val);
      this.$refs.tree.filter(val);
    },
    treeId(newVal, oldVal) {
      if (newVal) {
@@ -1720,6 +1712,7 @@
    // 节点单击事件
    handleNodeClick(data) {
      this.queryParams.deptId = data.id;
      this.selectedDeptId = data.id;
      this.handleQuery();
    },
    handlePackage() {
@@ -1754,10 +1747,11 @@
    cancel() {
      this.open = false;
      this.reset();
      this.$tab.refreshPage();
      // this.$tab.refreshPage();
    },
    handleClose() {
      this.$tab.refreshPage();
      this.cancel();
      // this.$tab.refreshPage();
    },
    // 表单重置
    reset() {
@@ -1805,6 +1799,9 @@
      this.ids = selection.map((item) => item.userId);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
        if (selection.length >= 1) {
        this.queryParams.userName = selection[0].userName
      }
    },
    // 更多操作触发
@@ -1835,6 +1832,9 @@
          this.sendhospName();
        }
      });
      if (this.selectedDeptId) {
        this.form.deptId = this.selectedDeptId;
      }
      // getUser().then((response) => {
      //   this.postOptions = response.posts;
      //   this.roleOptions = response.roles;
@@ -1850,22 +1850,24 @@
      getDeptListByDictHospId(data).then((res) => {
        console.log(res, 123456);
        this.DepartmentList = res.data;
        this.form.deptId = String(this.form.deptId);
        // this.form.deptId = String(this.form.deptId);
      });
    },
    handleUp(row) {
       handleUp(row) {
      this.title = "用户信息维护";
      // this.form = row;
      this.open = true;
      this.form = row;
      this.form.hospId = Number(row.hospId);
      // listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
      //   (response) => {
      //     response.rows.forEach((item, index) => {
      //       this.form = item;
      //     });
      //   }
      // );
      this.submit = false
      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
        (response) => {
          response.rows.forEach((item, index) => {
            this.form = item;
          });
        }
      );
    },
    select(val) {
      this.postList.forEach((item) => {
@@ -1881,6 +1883,10 @@
      this.getlistHosp();
      this.reset();
      this.form = row;
      this.form = {
        ...row,
        deptId: row.deptId != null ? String(row.deptId) : null, // 👈 确保为字符串
      };
      if (this.form.hospId) {
        this.sendhospName();
      }
@@ -1889,6 +1895,7 @@
      //   this.forms = this.form.userInfo;
      // }
      this.open = true;
            this.submit = false
      this.title = "用户信息维护";
    },
@@ -1898,9 +1905,11 @@
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (_this.form.userId !== undefined) {
           _this.submit = true
            updateUser(_this.form).then((response) => {
              _this.$modal.msgSuccess("修改成功");
              _this.open = false;
               _this.submit = false
              _this.getList();
            });
          } else {
@@ -2046,6 +2055,7 @@
  width: 600px; /* 设置内容的宽度,以触发水平滚动条 */
  height: 1000px; /* 设置内容的高度,以触发垂直滚动条 */
}
.pag {
  width: 100%;
  display: flex;