WXL
2025-01-23 6de02b3641b3f0a876513d8f367ed44337423920
src/views/patient/patient/indexls.vue
@@ -1,23 +1,13 @@
<template>
  <div class="app-container">
  患者360嵌入位置
  </div>
  <div class="iframe-container"><iframe :src="linkUrl" frameborder="0"></iframe></div>
</template>
<script>
import {
  listUser,
  getUser,
  delUser,
  addUser,
  updateUser,
  resetUserPwd,
  changeUserStatus,
} from "@/api/system/user";
import { getTaskservelist } from "@/api/AiCentre/index";
import { gitzerotoken } from "@/api/AiCentre/index";
import Treeselect from "@riophae/vue-treeselect";
import store from "@/store";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import axios from "axios";
export default {
  name: "Discharge",
@@ -37,6 +27,7 @@
      showSearch: true,
      // 总条数
      total: 0,
      linkUrl:'https://blog.csdn.net/weixin_46622350/article/details/119245415',
      // 用户表格数据
      userList: null,
      // 弹出层标题
@@ -86,58 +77,7 @@
        },
      ],
      loading: false,
      states: [
        "Alabama",
        "Alaska",
        "Arizona",
        "Arkansas",
        "California",
        "Colorado",
        "Connecticut",
        "Delaware",
        "Florida",
        "Georgia",
        "Hawaii",
        "Idaho",
        "Illinois",
        "Indiana",
        "Iowa",
        "Kansas",
        "Kentucky",
        "Louisiana",
        "Maine",
        "Maryland",
        "Massachusetts",
        "Michigan",
        "Minnesota",
        "Mississippi",
        "Missouri",
        "Montana",
        "Nebraska",
        "Nevada",
        "New Hampshire",
        "New Jersey",
        "New Mexico",
        "New York",
        "North Carolina",
        "North Dakota",
        "Ohio",
        "Oklahoma",
        "Oregon",
        "Pennsylvania",
        "Rhode Island",
        "South Carolina",
        "South Dakota",
        "Tennessee",
        "Texas",
        "Utah",
        "Vermont",
        "Virginia",
        "Washington",
        "West Virginia",
        "Wisconsin",
        "Wyoming",
      ],
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
@@ -222,6 +162,40 @@
          label: "正常",
        },
      ],
      url: "http://9.208.2.190:8095/smartor/serviceExternal/query360PatInfo",
      postData: {
        XiaoXiTou: {
          FaSongFCSJC: "ZJHES",
          FaSongJGID: "47255004333112711A1001",
          FaSongJGMC: "景宁畲族自治县人民医院",
          FaSongSJ: "2025-01-09 17:29:36",
          FaSongXTJC: "SUIFANGXT",
          FaSongXTMC: "随访系统",
          XiaoXiID: "5FA92AFB-9833-4608-87C7-F56A654AC171",
          XiaoXiLX: "SC_LC_360STCX",
          XiaoXiMC: "360 视图查询",
          ZuHuID: "1400361376454545408",
          ZuHuMC: "景宁畲族自治县人民医院",
        },
        YeWuXX: {
          BingRenXX: {
            ZhengJianHM: "110101199701018034",
            ZhengJianLXDM: "01",
            ZhengJianLXMC: "居民身份证",
            ZuZhiJGID: "47255004333112711A1001",
            ZuZhiJGMC: "景宁畲族自治县人民医院",
          },
          YongHuXX: {
            XiTongID: "SUIFANGXT",
            XiTongMC: "随访系统",
            YongHuID: "1400466972205912064",
            YongHuXM: "JNRMYY",
            ZuZhiJGID: "47255004333112711A1001",
            ZuZhiJGMC: "景宁畲族自治县人民医院",
            idp: "lyra",
          },
        },
      },
      serviceState: [],
      // 表单校验
      rules: {},
@@ -229,259 +203,41 @@
  },
  watch: {},
  created() {
    this.serviceState = store.getters.serviceState;
    this.getList();
    this.getConfigKey("sys.user.initPassword").then((response) => {
      this.initPassword = response.msg;
    });
    this.gettoken();
  },
  activated() {
    this.getList();
  },
  // 搜索
  mounted() {
    this.list = this.states.map((item) => {
      return { value: `value:${item}`, label: `label:${item}` };
    });
  },
  activated() {},
  methods: {
    /** 查询门诊宣教服务列表 */
    getList() {
      if (this.topqueryParams.searchscope == 1) {
        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.topqueryParams.leavehospitaldistrictcodes = null;
      } else if (this.topqueryParams.searchscope == 2) {
        this.topqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
        this.topqueryParams.leaveldeptcodes = null;
      } else {
        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.topqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      this.loading = true;
      getTaskservelist(this.topqueryParams).then((response) => {
        this.userList = response.rows[0].serviceSubtaskList;
        this.userList.forEach((item) => {
          if (item.endtime) {
            item.endDay = this.daysBetween(item.endtime);
          }
        });
        this.total = response.total;
        this.loading = false;
      });
    },
    // 查看门诊宣教详情
    Referencequestion(row) {
      this.previewVisible = true;
    },
    // 添加弹框搜索
    remoteMethod(query) {
      if (query !== "") {
        this.loading = true;
        setTimeout(() => {
          this.loading = false;
          this.options = this.list.filter((item) => {
            return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
          });
        }, 200);
      } else {
        this.options = [];
      }
    },
    // 门诊宣教状态修改
    handleStatusChange(row) {
      let text = row.status === "0" ? "启用" : "停用";
      this.$modal
        .confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
        .then(function () {
          return changeUserStatus(row.userId, row.status);
    gettoken() {
      axios
        .post(this.url, this.postData)
        .then((response) => {
          // 请求成功
          console.log("Response:", response);
          console.log("Response:", response.data.data.url);
          this.linkUrl = response.data.data.url;
        })
        .then(() => {
          this.$modal.msgSuccess(text + "成功");
        })
        .catch(function () {
          row.status = row.status === "0" ? "1" : "0";
        });
    },
    // 取消按钮
    cancel() {
      this.addalteropen = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        userId: undefined,
        deptId: undefined,
        userName: undefined,
        nickName: undefined,
        password: undefined,
        phonenumber: undefined,
        email: undefined,
        sex: undefined,
        status: "0",
        remark: undefined,
        postIds: [],
        roleIds: [],
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      if (this.topqueryParams.searchscope == 1) {
        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.topqueryParams.leavehospitaldistrictcodes = null;
      } else if (this.topqueryParams.searchscope == 2) {
        this.topqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
        this.topqueryParams.leaveldeptcodes = null;
      } else {
        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.topqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      this.topqueryParams.pageNum = 1;
      this.topqueryParams.startOutHospTime = this.dateRange[0];
      this.topqueryParams.endOutHospTime = this.dateRange[1];
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.topqueryParams = {
        pageNum: 1,
        pageSize: 10,
        serviceType: 4,
      };
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.userId);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },
    //删除选项
    handleClose(tag) {
      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
    },
    //触发新增输入
    showInput() {
      this.inputVisible = true;
      this.$nextTick((_) => {
        this.$refs.saveTagInput.$refs.input.focus();
      });
    },
    //获取失去焦点触发
    handleInputConfirm() {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.dynamicTags.push(inputValue);
      }
      this.inputVisible = false;
      this.inputValue = "";
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.$router.push({
        path: "/followvisit/Missioncreation",
        query: {
          type: 3,
          serviceType: 4,
        },
      });
    },
    /** 提交按钮 */
    submitForm: function () {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.userId != undefined) {
            updateUser(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
        .catch((error) => {
          // 请求失败
          console.error("Error:", error);
          if (error.response) {
            // 服务器返回了错误响应
            console.error("Status Code:", error.response.status);
            console.error("Response Data:", error.response.data);
          } else if (error.request) {
            // 请求已发出,但未收到响应
            console.error("No response received");
          } else {
            addUser(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
            // 在设置请求时发生了一些事情,触发了一个错误
            console.error("Error Message:", error.message);
          }
        }
      });
    },
    // 全部停止
    AllStop() {
      this.$modal
        .confirm("是否停止全部任务?")
        .then(function () {
          return console.log("停止成功");
        })
        .then(() => {
          this.getList();
          this.$modal.msgWarning("停止成功");
        })
        .catch(() => {});
    },
    // 全部开始
    AllStarted() {
      this.$modal
        .confirm("是否开启全部任务?")
        .then(function () {
          return console.log("开启成功");
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("开启成功");
        })
        .catch(() => {});
    },
    // 设置发送时间
    Sendtimesetting() {
      this.modificationVisible = true;
    },
    // 便捷按钮
    toleadExport(too) {
      if (too == 1) {
        this.topqueryParams.sendstate = 4;
        this.topqueryParams.excep = null;
      } else if (too == 2) {
        this.topqueryParams.excep = 1;
      }
      this.handleQuery();
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "system/user/export",
        {
          ...this.topqueryParams,
        },
        `user_${new Date().getTime()}.xlsx`
      );
        });
    },
  },
};
</script>
<style lang="scss" scoped>
.el-tag + .el-tag {
  margin-left: 10px;
}
@@ -493,7 +249,17 @@
  padding-top: 0;
  padding-bottom: 0;
}
.iframe-container {
  width: 100vw; /* 视口宽度 */
  height: 100vh; /* 视口高度 */
  overflow: hidden; /* 隐藏超出部分 */
}
iframe {
  width: 100%;
  height: 100%;
  border: none; /* 移除边框 */
}
.input-new-tag {
  width: 90px;
  margin-left: 10px;