Browse Source

0319

master
领悟 4 months ago
parent
commit
b256170965
  1. 6
      src/App.vue
  2. 21
      src/utils/index.js
  3. 12
      src/views/Patient/components/patient-detail.vue

6
src/App.vue

@ -146,8 +146,8 @@
firstAidId firstAidId
} = this.patientData; } = this.patientData;
if (!firstAidId) return; if (!firstAidId) return;
this.queryMessage(); // this.queryMessage();
await this.handMessageQuery(); // await this.handMessageQuery();
this.request = 0; this.request = 0;
this.utils.AnimationFrame.create( this.utils.AnimationFrame.create(
@ -270,7 +270,7 @@
// //
console.log('十秒'); console.log('十秒');
this.request = n + 1; this.request = n + 1;
// await this.handMessageQuery(); await this.handMessageQuery();
} }
}, },
}, },

21
src/utils/index.js

@ -136,7 +136,7 @@ function format(date) {
} }
/** /**
* 身份证加密 * 身份证加密
*/ */
function maskIDCard(idCard) { function maskIDCard(idCard) {
// 判断身份证号是否有效 // 判断身份证号是否有效
if (idCard.length === 18) { if (idCard.length === 18) {
@ -261,29 +261,30 @@ function calculateAge(idCard) {
if (idCard && idCard.length === 18) { if (idCard && idCard.length === 18) {
// 提取出生日期(前 6 位) // 提取出生日期(前 6 位)
let birthDate = idCard.substring(6, 14); let birthDate = idCard.substring(6, 14);
// 从出生日期创建 Date 对象,格式为 YYYY-MM-DD // 从出生日期创建 Date 对象,格式为 YYYY-MM-DD
let year = birthDate.substring(0, 4); let year = birthDate.substring(0, 4);
let month = birthDate.substring(4, 6) - 1; // 月份从 0 开始 let month = birthDate.substring(4, 6) - 1; // 月份从 0 开始
let day = birthDate.substring(6, 8); let day = birthDate.substring(6, 8);
let birth = new Date(year, month, day); let birth = new Date(year, month, day);
// 获取当前日期 // 获取当前日期
let now = new Date(); let now = new Date();
// 计算年龄 // 计算年龄
let age = now.getFullYear() - birth.getFullYear(); let age = now.getFullYear() - birth.getFullYear();
// 如果生日还没过,年龄减一 // 如果生日还没过,年龄减一
if (now.getMonth() < birth.getMonth() || (now.getMonth() === birth.getMonth() && now.getDate() < birth.getDate())) { if (now.getMonth() < birth.getMonth() || (now.getMonth() === birth.getMonth() && now.getDate() < birth
age--; .getDate())) {
age--;
} }
patientAge = age; patientAge = age;
} }
return patientAge; return patientAge;
} }
export default { export default {

12
src/views/Patient/components/patient-detail.vue

@ -254,7 +254,17 @@
this.authEdit = false this.authEdit = false
this.$message.success('更新成功'); this.$message.success('更新成功');
// this.$router.push('/firstaid/thrombolysis') // this.$router.push('/firstaid/thrombolysis')
this.getMessageQuery(0, data.firstAidId) // this.getMessageQuery(0, data.firstAidId)
this.request = 0;
this.utils.AnimationFrame.create(
'timerTask',
10000,
true,
(min) => {
// console.log('min', min)
this.getMessageQuery(min);
}
);
this.$router.push({ this.$router.push({
name: 'Thrombolysis', name: 'Thrombolysis',
query: { query: {

Loading…
Cancel
Save