Procházet zdrojové kódy

个人就医记录信息查询

Liuteng před 3 měsíci
rodič
revize
25868790f1

+ 399 - 0
src/views/HVversion/VocationalWork/PublicService/zwGrjyjlxxcx/index.vue

@@ -0,0 +1,399 @@
+<template>
+  <div class="VocationalWork">
+    <top-info :time.sync="time"></top-info>
+    <center-info @back="goback" @home="gohome">
+      <div class="yw-progress">
+        <sm-progress :nowStep="nowStep" :stepList="stepList"></sm-progress>
+      </div>
+      <div class="yw-content">
+        <yw-box class="grjyjlxxcx-box" title="查询结果">
+          <yj-table :data="datas">
+            <yj-table-column prop="psnNo" label="人员编号"></yj-table-column>
+            <yj-table-column prop="naty" label="民族"></yj-table-column>
+            <yj-table-column prop="brdy" label="出生日期"></yj-table-column>
+            <yj-table-column prop="insutype" label="险种类型"></yj-table-column>
+            <yj-table-column prop="empName" label="单位名称"></yj-table-column>
+            <yj-table-column
+              prop="fixmedinsCode"
+              label="定点医药机构编号"
+            ></yj-table-column>
+            <yj-table-column
+              prop="fixmedinsName"
+              label="定点医药机构名称"
+            ></yj-table-column>
+            <yj-table-column prop="begntime" label="开始时间"></yj-table-column>
+            <yj-table-column prop="endtime" label="结束时间"></yj-table-column>
+            <yj-table-column
+              prop="mdtrtCertType"
+              label="就诊凭证类型"
+            ></yj-table-column>
+            <yj-table-column prop="medType" label="医疗类别"></yj-table-column>
+            <yj-table-column prop="year" label="年度"></yj-table-column>
+          </yj-table>
+        </yw-box>
+      </div>
+    </center-info>
+    <bottom-info></bottom-info>
+  </div>
+</template>
+
+<script>
+import { getTransKey1, grjyjlxxcx } from "@/api/public";
+export default {
+  name: "NewsmzcZwGrjyjlxxcx",
+
+  data() {
+    return {
+      // 顶部信息
+      time: 180,
+      // 进度条
+      nowStep: 2,
+      stepList: ["个人就医记录查询", "登录", "查询结果"],
+      // 业务
+      datas: [],
+
+      encryptConfig: {
+        cappid: "200861_app_20201118153052",
+        appSecret: "6bea6514521d4a6e8003fb7d49abc24e",
+        pbe: "kcn071805buj05k313ql",
+        publicKeyTemporary:
+          "3NVYvzUUyxBqTuMtDYSbWPyDKxhXhfSrRTOUvR+NqUhIFfRL0bEgJ4dOpaJK47T6gs9XMob4MKxY81FwRVlwVQ==",
+        cipherKey: "qweasdzxcrfvtgbb",
+        url_safe: false,
+      },
+      encryptList: {},
+    };
+  },
+
+  mounted() {
+    // this.Records();
+  },
+
+  created() {
+    this.init();
+  },
+
+  methods: {
+    // 初始化密钥及配置
+    init() {
+      const winMethods = window.DCSAPPClientAPI;
+      const encryptArray = winMethods.parseUtf8StringToArray(
+        JSON.stringify({
+          appSecret: this.encryptConfig.appSecret,
+          passwordType: "01",
+          cipherKey: this.encryptConfig.cipherKey,
+          encAlg: "SM4",
+          option: "",
+        })
+      );
+      this.encryptList = winMethods.workKey_nego_and_data_encrypt_cpa(
+        "",
+        this.encryptConfig.pbe,
+        this.encryptConfig.publicKeyTemporary,
+        encryptArray,
+        this.encryptConfig.url_safe
+      );
+      this.getDatas();
+    },
+
+    // 调用接口
+    async getDatas() {
+      this.$loading.show("正在查询...");
+      try {
+        const password = await this.getPassWord();
+        const result = await this.getList(password);
+        this.Decryption(result);
+      } catch (error) {
+        this.$msgbox({
+          title: "提示",
+          content: error,
+          type: "error",
+          showCansole: false,
+        }).then(() => {});
+      }
+      this.$loading.hide();
+    },
+
+    // 解密数据
+    Decryption(key) {
+      const winMethods = window.DCSAPPClientAPI;
+      var decryptArray = winMethods.data_decrypt_cpa(
+        "",
+        this.encryptConfig.pbe,
+        this.encryptList.keyCipher,
+        key,
+        false
+      );
+      var data = winMethods.arrayToUtf8(decryptArray);
+      data = JSON.parse(data);
+      if (data.code === 0) {
+        this.datas = data.data?.data.map((item) => {
+          return {
+            ...item,
+            insutype: this.formatXzlx(item.insutype),
+            naty: this.formateN(item.naty),
+            brdy: this.formatDate(item.brdy),
+            begntime: this.formatDate(item.begntime),
+            endtime: this.formatDate(item.endtime),
+          };
+        });
+      } else {
+        this.$msgbox({
+          title: "提示",
+          content: data.message || "未查询到相关信息,请稍后再试",
+          type: "error",
+          showCansole: false,
+        }).then(() => {});
+      }
+    },
+
+    // 获取临时密码
+    getPassWord() {
+      return new Promise((resolve, reject) => {
+        const login = JSON.parse(localStorage.getItem("parameter") || "{}");
+        let form = {
+          token: login.token,
+          cappid: this.encryptConfig.cappid,
+          requestParams: this.encryptList.keySM2Cipher,
+        };
+        getTransKey1(form)
+          .then((res) => {
+            if (res.code === 200) {
+              resolve(res.data || "");
+            } else {
+              reject(res.msg || "获取密码失败");
+            }
+          })
+          .catch((err) => {
+            reject("获取密码失败");
+          });
+      });
+    },
+
+    // 获取数据
+    getList(password) {
+      return new Promise((resolve, reject) => {
+        const login = JSON.parse(localStorage.getItem("parameter") || "{}");
+        const winMethods = window.DCSAPPClientAPI;
+        let form = {
+          cappid: this.encryptConfig.cappid,
+          token: login.token,
+          appSecret: this.encryptConfig.appSecret,
+          dynamicPassword: this.formatterParams(password).decrypt,
+          requestParams: this.formatterParams(password).requestParams,
+        };
+        grjyjlxxcx(form)
+          .then((res) => {
+            if (res.code === 200) {
+              resolve(res.data);
+            } else {
+              reject(res.msg || "获取数据失败");
+            }
+          })
+          .catch((err) => {
+            reject("获取数据失败");
+          });
+      });
+    },
+
+    formatterParams(password) {
+      const userInfo = JSON.parse(localStorage.getItem("userInfo") || "{}");
+      const winMethods = window.DCSAPPClientAPI;
+      // 配置
+      const request = {
+        certno: userInfo.userInfo.certNo,
+      };
+      // 处理数据
+      const encryptArray = winMethods.data_decrypt_cpa(
+        "",
+        this.encryptConfig.pbe,
+        this.encryptList.keyCipher,
+        window.atob(password),
+        this.encryptConfig.url_safe
+      );
+      const cryptData = winMethods.arrayToUtf8(encryptArray);
+      var decryptData = JSON.parse(cryptData);
+      var responseBody = JSON.parse(decryptData["C-Response-Body"]);
+      let decrypt = "";
+      if (responseBody.dynamicPassword) {
+        decrypt = responseBody.dynamicPassword;
+      }
+      const encreptArray = winMethods.parseUtf8StringToArray(
+        JSON.stringify(request)
+      );
+      const requestParams = winMethods.data_encrypt_cpa(
+        "",
+        this.encryptConfig.pbe,
+        this.encryptList.keyCipher,
+        encreptArray,
+        this.encryptConfig.url_safe
+      );
+      return {
+        decrypt: decrypt,
+        requestParams: requestParams,
+      };
+    },
+
+    formateN(e) {
+      return e == "01" ? "汉" : "其他";
+    },
+
+    formatXzlx(e) {
+      if (e) {
+        if (e == "310") {
+          return "职工基本医疗保险";
+        } else if (e == "31003") {
+          return "医疗保险个人账户(用人单位)";
+        } else if (e == "312") {
+          return "农民工住院医疗";
+        } else if (e == "320") {
+          return "公务员医疗补助";
+        } else if (e == "321") {
+          return "公务员医疗补助(市直统发)";
+        } else if (e == "323") {
+          return "公务员医疗补助(市直非统发)";
+        } else if (e == "330") {
+          return "大额医疗费用补助";
+        } else if (e == "331") {
+          return "二次补助";
+        } else if (e == "340") {
+          return "离休人员医疗保障";
+        } else if (e == "350") {
+          return "一至六级伤残军人医疗补助";
+        } else if (e == "360") {
+          return "老红军医疗保障";
+        } else if (e == "370") {
+          return "企业补充医疗保险";
+        } else if (e == "380") {
+          return "新型农村合作医疗";
+        } else if (e == "390") {
+          return "城乡居民基本医疗保险";
+        } else if (e == "399511") {
+          return "企业补充养老保险";
+        } else if (e == "391") {
+          return "城镇居民基本医疗保险";
+        } else if (e == "399510") {
+          return "企业基本养老保险";
+        } else if (e == "39911") {
+          return "医疗救助补充保险";
+        } else if (e == "392") {
+          return "城乡居民大病医疗保险";
+        } else if (e == "399508") {
+          return "机关事业工伤保险";
+        } else if (e == "39912") {
+          return "大病统筹医疗保险";
+        } else if (e == "399") {
+          return "其他特殊人员医疗保障";
+        } else if (e == "399507") {
+          return "企业工伤保险";
+        } else if (e == "39909") {
+          return "处级干部医疗补助";
+        } else if (e == "39901") {
+          return "劳模医疗保障";
+        } else if (e == "399512") {
+          return "养老保险";
+        } else if (e == "39910") {
+          return "机关生育保险";
+        } else if (e == "39902") {
+          return "补充百分之十医疗";
+        } else if (e == "399505") {
+          return "特慢病保险";
+        } else if (e == "39903") {
+          return "城乡居民补充医疗保险";
+        } else if (e == "399504") {
+          return "天然林一次性征缴";
+        } else if (e == "39904") {
+          return "建国前老工人医疗保险";
+        } else if (e == "399503") {
+          return "启动基金";
+        } else if (e == "39905") {
+          return "二乙医疗保险";
+        } else if (e == "399501") {
+          return "失业保险";
+        } else if (e == "39906") {
+          return "意外伤害医疗保险";
+        } else if (e == "399506") {
+          return "风险调解金";
+        } else if (e == "410") {
+          return "长期照护保险";
+        } else if (e == "510") {
+          return "生育保险";
+        } else if (e == "3701") {
+          return "企业事业单位补充医疗保险";
+        } else if (e == "520") {
+          return "公务员生育";
+        } else if (e == "39907") {
+          return "公费医疗照顾保险";
+        } else if (e == "39908") {
+          return "超转人员医疗保险";
+        } else if (e == "39913") {
+          return "保健对象医疗补助";
+        } else if (e == "39914") {
+          return "高知医疗补助";
+        } else if (e == "313") {
+          return "门诊附加(企业补充)险";
+        } else if (e == "411") {
+          return "城乡居民补充长期护理保险";
+        } else if (e == "3991") {
+          return "门急诊大额险";
+        } else if (e == "314") {
+          return "住院补充险";
+        } else if (e == "324") {
+          return "公务员补充资金";
+        } else {
+          return "";
+        }
+      } else {
+        return "";
+      }
+    },
+
+    formatDate(e) {
+      if (e == null) {
+        return "--";
+      } else {
+        var date = new Date(e);
+        var Y = date.getFullYear() + "-";
+        var M =
+          (date.getMonth() + 1 < 10
+            ? "0" + (date.getMonth() + 1)
+            : date.getMonth() + 1) + "-";
+        var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
+        return Y + M + D;
+      }
+    },
+
+    Records() {
+      let data = {
+        name:
+          JSON.parse(localStorage.getItem("userInfo")).userInfo.userName || "", //姓名
+        tel:
+          JSON.parse(localStorage.getItem("userInfo")).userInfo.userMobile ||
+          "", //手机号
+        sfzh:
+          JSON.parse(localStorage.getItem("userInfo")).userInfo.certNo || "", // 身份证号
+        nsrsbh: "" /** 纳税人识别号(自然人=身份证号码 */,
+        nsrmc: "" /** 纳税人名称(自然人=身份证姓名) */,
+        bz: "" /** 备注(查询起止时间) */,
+        type: "人社",
+      };
+      this.$logs.log(data);
+    },
+
+    // 返回
+    goback() {
+      this.$router.back();
+    },
+    // 首页
+    gohome() {
+      this.$router.push({ path: "/", replace: true });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.grjyjlxxcx-box {
+  width: 100%;
+}
+</style>