yxh
2023-11-21 dacf3c6ae5ede1c0a8a8b4afb24e2a3b62f0e368
src/views/patient/patient/index.vue
@@ -470,30 +470,30 @@
</template>
<script>
import { delUser } from "@/api/system/user";
import {
  delUser,
  addUser,
  updateUser,
  resetUserPwd,
  changeUserStatus,
  deptTreeSelect,
} from "@/api/system/user";
  listpat_archive,
  getpat_archive,
  addpat_archive,
  updatepat_archive,
  delpat_archive,
} from "@/api/smartorpor/pat_archive";
import {
  listpatient,
  messagelistpatient,
  alterpatient,
  addpatient,
  particularpatient,
  deletepatient,
  Exporterrorpatient,
  toleadpatient,
} from "@/api/patient/homepage";
import { listtag } from "@/api/system/label";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
  name: "User",
  name: "Userhuanze",
  dicts: ["sys_normal_disable", "sys_user_sex"],
  components: { Treeselect },
  data() {
@@ -637,10 +637,6 @@
  created() {
    this.getList();
    this.gettabList();
    this.getDeptTree();
    this.getConfigKey("sys.user.initPassword").then((response) => {
      this.initPassword = response.msg;
    });
  },
  methods: {
    /** 查询患者列表 */
@@ -656,7 +652,7 @@
    /** 查询标签列表 */
    gettabList() {
      const queryParams = {};
      listtag(this.addDateRange(queryParams)).then((response) => {
      listtag().then((response) => {
        console.log(response);
        this.optionstag = response.rows;
      });
@@ -670,12 +666,7 @@
        this.loading = false;
      });
    },
    /** 查询部门下拉树结构 */
    getDeptTree() {
      deptTreeSelect().then((response) => {
        this.deptOptions = response.data;
      });
    },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true;
@@ -686,24 +677,10 @@
      this.queryParams.deptId = data.id;
      this.handleQuery();
    },
    // 用户状态修改
    handleStatusChange(row) {
      let text = row.status === "0" ? "启用" : "停用";
      this.$modal
        .confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
        .then(function () {
          return changeUserStatus(row.userId, row.status);
        })
        .then(() => {
          this.$modal.msgSuccess(text + "成功");
        })
        .catch(function () {
          row.status = row.status === "0" ? "1" : "0";
        });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.Labelchange = false;
      this.reset();
    },
    // 表单重置
@@ -743,54 +720,44 @@
    handleAdd() {
      this.reset();
      this.Labelchange = true;
      this.amendtag = false;
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      console.log(row);
      const userIds = row.patid || this.ids;
      particularpatient(userIds).then((response) => {
        console.log(response);
        this.form = response.data;
      });
      this.amendtag = true;
      this.Labelchange = true;
    },
    //修改/新增患者
    updatevaluedate() {
    submitForm() {
      if (this.amendtag) {
        this.form.tagcategoryid = this.idds;
        // toamendtagcategory(this.addDateRange(this.classifyform)).then(
        //   (response) => {
        //     console.log(response);
        //     this.gitclasify();
        //   }
        // );
        alterpatient(this.form)
          .then((response) => {
            console.log(response);
          })
          .then(() => {
            this.getList();
            this.$modal.msgSuccess("修改成功");
          });
      } else {
        // addtagcategory(this.addDateRange(this.classifyform)).then(
        //   (response) => {
        //     console.log(response);
        //     this.gitclasify();
        //   }
        // );
        addpatient(this.form)
          .then((response) => {
            console.log(response);
          })
          .then(() => {
            this.getList();
            this.$modal.msgSuccess("添加成功");
          });
      }
      this.reset();
      // this.idds = "";
      this.Labelchange = false;
    },
    /** 重置密码按钮操作 */
    handleResetPwd(row) {
      this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        closeOnClickModal: false,
        inputPattern: /^.{5,20}$/,
        inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
      })
        .then(({ value }) => {
          resetUserPwd(row.userId, value).then((response) => {
            this.$modal.msgSuccess("修改成功,新密码是:" + value);
          });
        })
        .catch(() => {});
    },
    /** 分配角色操作 */
    handleAuthRole: function (row) {
      const userId = row.userId;
      this.$router.push("/system/user-auth/role/" + userId);
    },
    /** 删除按钮操作 */
@@ -799,7 +766,7 @@
      this.$modal
        .confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
        .then(function () {
          return delUser(userIds);
          return deletepatient(userIds);
        })
        .then(() => {
          this.getList();