SM2加解密

main
kangjiawei 2 years ago
parent c8f405b61d
commit cb7ad2c727
  1. 5
      public/index.html
  2. 1
      src/App.vue
  3. 15
      src/api/examination.js
  4. 12
      src/api/hospital.js
  5. 170
      src/utils/SM.js
  6. 3
      src/utils/aisdapp.js
  7. 110
      src/views/Guidance.vue
  8. 362
      src/views/HomeView.vue
  9. 1385
      src/views/examProject.vue
  10. 1629
      src/views/examination.vue
  11. 640
      src/views/myExam.vue

@ -4,8 +4,10 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script src="https://isdapp.shandong.gov.cn/jmopen/jssdk/index.js"></script>
<title>车管所体检预约</title> <title>车管所体检预约</title>
<style> <style>
* { * {
@ -19,7 +21,6 @@
overflow: hidden; overflow: hidden;
} }
</style> </style>
<script src="https://isdapp.shandong.gov.cn/jmopen/jssdk/index.js"></script>
<script> <script>
(function (doc, win) { (function (doc, win) {
var docEl = doc.documentElement, var docEl = doc.documentElement,

@ -3,7 +3,6 @@
<router-view /> <router-view />
</div> </div>
</template> </template>
<script>
<style lang="scss"> <style lang="scss">
#app { #app {

@ -1,6 +1,6 @@
import request from "../utils/axios"; import request from "../utils/axios";
//放号天数 //放号天数 - SM2
export const queryDays = (query) => { export const queryDays = (query) => {
return request({ return request({
url: "/api/blade-business/apm-config/already-config-day", url: "/api/blade-business/apm-config/already-config-day",
@ -9,7 +9,7 @@ export const queryDays = (query) => {
}); });
}; };
// 获取放号列表 // 获取放号列表 - SM2
export const queryList = (query) => { export const queryList = (query) => {
return request({ return request({
url: "/api/blade-business/apm-config/detail-for-apm", url: "/api/blade-business/apm-config/detail-for-apm",
@ -18,7 +18,7 @@ export const queryList = (query) => {
}); });
}; };
// 新增预约记录 // 新增预约记录 - SM2
export const postExam = (data) => { export const postExam = (data) => {
return request({ return request({
url: "/api/blade-business/apm-record/save", url: "/api/blade-business/apm-record/save",
@ -26,12 +26,3 @@ export const postExam = (data) => {
data, data,
}); });
}; };
//取消预约记录
export const cancelExam = (data) => {
return request({
url: "blade-business/apm-record/cancel",
method: "post",
data,
});
};

@ -1,13 +1,13 @@
import request from "../utils/axios"; import request from "../utils/axios";
//医院列表 //医院列表 - SM2
export const queryHosiptal = () => { export const queryHosiptal = () => {
return request({ return request({
url: "/api/blade-system/dept-hospital/list-hospital", url: "/api/blade-system/dept-hospital/list-hospital",
method: "get", method: "get",
}); });
}; };
//根据医院id获取须知 //根据医院id获取须知 - SM2
export const queryArticleDetail = (createDept) => { export const queryArticleDetail = (createDept) => {
return request({ return request({
url: "/api/blade-business/article/detail-publish", url: "/api/blade-business/article/detail-publish",
@ -17,7 +17,7 @@ export const queryArticleDetail = (createDept) => {
}, },
}); });
}; };
//查询改用户是否在黑名单内 //查询改用户是否在黑名单内 - SM2
export const checkBacklist = (cupCardNo) => { export const checkBacklist = (cupCardNo) => {
return request({ return request({
url: "/api/blade-business/blacklist/user-blacklist", url: "/api/blade-business/blacklist/user-blacklist",
@ -27,7 +27,7 @@ export const checkBacklist = (cupCardNo) => {
}, },
}); });
}; };
//我的预约列表 //我的预约列表 - SM2
export const myRecord = (createDept, cupCardNo, current, size) => { export const myRecord = (createDept, cupCardNo, current, size) => {
return request({ return request({
url: "/api/blade-business/apm-record/page", url: "/api/blade-business/apm-record/page",
@ -40,7 +40,7 @@ export const myRecord = (createDept, cupCardNo, current, size) => {
}, },
}); });
}; };
//取消预约 //取消预约 - SM2
export const recordCancel = (id) => { export const recordCancel = (id) => {
return request({ return request({
url: "/api/blade-business/apm-record/cancel", url: "/api/blade-business/apm-record/cancel",
@ -50,7 +50,7 @@ export const recordCancel = (id) => {
}, },
}); });
}; };
//系统时间 //系统时间 - SM2
export const getSystemTime = () => { export const getSystemTime = () => {
return request({ return request({
url: "/api/blade-business/common-api/get-system-datetime", url: "/api/blade-business/common-api/get-system-datetime",

File diff suppressed because one or more lines are too long

@ -5,7 +5,8 @@ export const appword = "aKd20dbGdFvmuwrt"
const appid = 'cgstjyyxuwxt'; const appid = 'cgstjyyxuwxt';
const appMode = false;//是否开启爱山东中控台接口调用方式 const appMode = true;//是否开启爱山东中控台接口调用方式
// const appMode = true;//是否开启爱山东中控台接口调用方式
export default { export default {
appid, appid,

@ -1,7 +1,12 @@
<template> <template>
<div class="guidance"> <div class="guidance">
<div class="guide_title">{{ article.title}}</div> <div class="guide_title">{{ article.title }}</div>
<div v-html="article.content" class="guide_contant" ref="scrollView" id="scroll-view"></div> <div
v-html="article.content"
class="guide_contant"
ref="scrollView"
id="scroll-view"
></div>
<div class="guide_btn"> <div class="guide_btn">
<div class="guide_actBtn" @click="doCancel">取消</div> <div class="guide_actBtn" @click="doCancel">取消</div>
<div class="guide_actBtn blue" @click="doRead">已阅读</div> <div class="guide_actBtn blue" @click="doRead">已阅读</div>
@ -11,15 +16,17 @@
<script> <script>
import { queryArticleDetail } from "@/api/hospital"; import { queryArticleDetail } from "@/api/hospital";
import SM from "../utils/SM";
export default { export default {
data() { data() {
return { return {
isFlag: false,// isFlag: false, //
article: { article: {
title: '', title: "",
content: '' content: "",
},// }, //
} };
}, },
mounted() { mounted() {
if (this.$route.query.deptId) { if (this.$route.query.deptId) {
@ -29,33 +36,59 @@ export default {
methods: { methods: {
// //
queryAticle(id) { queryAticle(id) {
console.log(id,'qdsgajjtjczdhqwzxq2qdsgajjtjczdhqwzxq2qdsgajjtjczdhqwzxq2qdsgajjtjczdhqwzxq2qdsgajjtjczdhqwzxq2qdsgajjtjczdhqwzxq2');
this.$toast.loading({ this.$toast.loading({
message: '加载中', message: "加载中",
duration: 0, duration: 0,
}) });
try { try {
if (this.GlobalConfig.appMode) { if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdhqwzxq", JSON.stringify({ createDept: id }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { vaildInterfacefn(
this.$toast.clear(); "cgstjyyxuwxt",
let retData = JSON.parse(value); "qdsgajjtjczdhqwzxq2",
if (retData.code == 200 && JSON.stringify(retData.data) != '{}') { // JSON.stringify({ createDept: id }),
retData.data.content = decodeURIComponent(retData.data.content); SM.encrypt(
this.article = retData.data; JSON.stringify({ createDept: id }),
"0449eab752b761532a74609a37bf743efc41c2772c842ba0be1424d50b29ade9416c816d6a99d753fee952521bf92467f16ad1896fce1a5ae58cf2cf13c88c45c3"
),
"2",
"https://" + this.GlobalConfig.urlCreatesign,
"https://" + this.GlobalConfig.urlGateway
).then(
(value) => {
value = SM.decrypt(
value,
"00f043afa8fff8e0072dba30977b3c4f0111b98c14962af24f0708a7166af351e3"
);
this.$toast.clear();
let retData = JSON.parse(value);
if (retData.code == 200 && JSON.stringify(retData.data) != "{}") {
retData.data.content = decodeURIComponent(retData.data.content);
this.article = retData.data;
} else if (retData.code == 2000 || !retData) {
console.log(retData,'retDataretDataretDataretDataretDataretDataretDataretDataretDataretData');
this.queryAticle(id);
}
},
(err) => {
this.$toast.clear();
} }
}, err => { );
this.$toast.clear(); } else {
}) queryArticleDetail(id).then(
} (res) => {
else { this.$toast.clear();
queryArticleDetail(id).then(res => { if (res.data != null && JSON.stringify(res.data) != "{}") {
this.$toast.clear(); if (res.data) {
if (JSON.stringify(res.data) != '{}') { res.data.content = decodeURIComponent(res.data.content);
res.data.content = decodeURIComponent(res.data.content); }
this.article = res.data; this.article = res.data;
}
},
(err) => {
this.$toast.clear();
} }
}, err => { );
this.$toast.clear();
})
} }
} catch (error) { } catch (error) {
this.$toast.clear(); this.$toast.clear();
@ -67,7 +100,10 @@ export default {
}, },
// //
doRead() { doRead() {
this.$router.replace({ name: 'examination', query: { id: this.$route.query.deptId } }); this.$router.replace({
name: "examination",
query: { id: this.$route.query.deptId },
});
// let readBox = this.$refs.scrollView; // let readBox = this.$refs.scrollView;
// console.log(readBox.scrollHeight, parseInt(readBox.scrollTop), readBox.clientHeight) // console.log(readBox.scrollHeight, parseInt(readBox.scrollTop), readBox.clientHeight)
// if (readBox.scrollHeight - parseInt(readBox.scrollTop) !== readBox.clientHeight) { // if (readBox.scrollHeight - parseInt(readBox.scrollTop) !== readBox.clientHeight) {
@ -100,13 +136,13 @@ export default {
return; return;
} }
const { scrollTop, clientHeight, scrollHeight } = e.target; const { scrollTop, clientHeight, scrollHeight } = e.target;
console.log(scrollTop, clientHeight, scrollHeight) console.log(scrollTop, clientHeight, scrollHeight);
if ((scrollTop + clientHeight) >= (scrollHeight - 5) || scrollTop == 0) { if (scrollTop + clientHeight >= scrollHeight - 5 || scrollTop == 0) {
this.isFlag = true; this.isFlag = true;
console.log('阅读完成') console.log("阅读完成");
} }
}, },
} },
}; };
</script> </script>
@ -156,15 +192,15 @@ export default {
font-weight: bold; font-weight: bold;
line-height: 0.98rem; line-height: 0.98rem;
text-align: center; text-align: center;
background: #FFFFFF; background: #ffffff;
border-radius: 0.08rem; border-radius: 0.08rem;
border: 0.02rem solid #E1E1E1; border: 0.02rem solid #e1e1e1;
&.blue { &.blue {
float: right; float: right;
color: #fff; color: #fff;
background: #1677FF; background: #1677ff;
border-color: #1677FF; border-color: #1677ff;
} }
} }
} }

@ -1,11 +1,23 @@
<template> <template>
<div class="home"> <div class="home">
<div class="act_shoose"> <div class="act_shoose">
<div v-for="(item, index) in hospitalList" :key="'hospital' + index" @click="doGuidance(item.id)" <div
:class="choosedIndex == index ? 'act_btn active' : 'act_btn'"> v-for="(item, index) in hospitalList"
<img :src="item.imgUrl ? (GlobalConfig.appMode ? 'http://www.qdscgs.com:9091' + item.imgUrl : 'http://192.168.1.106:9000' + item.imgUrl) : require('@/assets/image/hospital_logo.png')" /> :key="'hospital' + index"
@click="doGuidance(item.id)"
:class="choosedIndex == index ? 'act_btn active' : 'act_btn'"
>
<img
:src="
item.imgUrl
? GlobalConfig.appMode
? 'http://www.qdscgs.com:9091' + item.imgUrl
: 'http://192.168.1.106:9000' + item.imgUrl
: require('@/assets/image/hospital_logo.png')
"
/>
<div class="hospital_info"> <div class="hospital_info">
<div class="hospital_name">{{ item.fullName}}</div> <div class="hospital_name">{{ item.fullName }}</div>
<!-- <div class="hospital_name">同济大学附属东方医院胶州医院</div> --> <!-- <div class="hospital_name">同济大学附属东方医院胶州医院</div> -->
<div class="hospital_addr">{{ item.remark }}</div> <div class="hospital_addr">{{ item.remark }}</div>
</div> </div>
@ -18,13 +30,15 @@
<van-overlay :show="isShowError"> <van-overlay :show="isShowError">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<div class="img_box"> <div class="img_box">
<img src="~@/assets/image/fail_tip.png" alt=""> <img src="~@/assets/image/fail_tip.png" alt="" />
</div> </div>
<div class="tips">提示</div> <div class="tips">提示</div>
<div class="tip_txt">{{ errMsg }}</div> <div class="tip_txt">{{ errMsg }}</div>
<div class="btn" @click="isShowError = false">知道了</div> <div class="btn" @click="isShowError = false">知道了</div>
</div> </div>
<div class="close_box" @click="isShowError = false"><img src="~@/assets/image/close.png" alt=""></div> <div class="close_box" @click="isShowError = false">
<img src="~@/assets/image/close.png" alt="" />
</div>
</van-overlay> </van-overlay>
<!-- 阅读须知 --> <!-- 阅读须知 -->
<!-- <GuidanceVue @doCancelGuide="doCancelGuide" v-if="guideShow"></GuidanceVue> --> <!-- <GuidanceVue @doCancelGuide="doCancelGuide" v-if="guideShow"></GuidanceVue> -->
@ -32,9 +46,11 @@
</template> </template>
<script> <script>
import { queryHosiptal, checkBacklist } from "@/api/hospital"; import { queryHosiptal, checkBacklist } from "@/api/hospital";
import GuidanceVue from '@/components/Guidance.vue'; import GuidanceVue from "@/components/Guidance.vue";
// import { getUserInfo } from '@/utils/aisdapp'; // import { getUserInfo } from '@/utils/aisdapp';
import { isMobile } from '@/utils'; import { isMobile } from "@/utils";
import SM from "../utils/SM";
export default { export default {
name: "HomeView", name: "HomeView",
components: { components: {
@ -46,56 +62,79 @@ export default {
choosedIndex: -1, choosedIndex: -1,
guideShow: false, guideShow: false,
userInfo: null, userInfo: null,
errMsg: '由于您未及时进行报到,已被拉黑请于2023-03-31日后再次进行预约', errMsg: "由于您未及时进行报到,已被拉黑请于2023-03-31日后再次进行预约",
isShowError: false,// isShowError: false, //
// //
urlCreatesign: urldomaincreatesign, urlCreatesign: urldomaincreatesign,
urlGateway: urldomaingateway, urlGateway: urldomaingateway,
appmark: "sdzwapp", appmark: "sdzwapp",
appword: "aKd20dbGdFvmuwrt", appword: "aKd20dbGdFvmuwrt",
userType: '1',// 1 2 userType: "1", // 1 2
} };
}, },
mounted() { mounted() {
this.queryHosiptal(); this.queryHosiptal();
if (isMobile()) { if (isMobile()) {
let userInfo = sessionStorage.getItem('userInfo') ? JSON.parse(sessionStorage.getItem('userInfo')) : null; let userInfo = sessionStorage.getItem("userInfo")
? JSON.parse(sessionStorage.getItem("userInfo"))
: null;
if (userInfo == null) { if (userInfo == null) {
this.getUserInfo(); this.getUserInfo();
} } else {
else {
this.userInfo = userInfo; this.userInfo = userInfo;
} }
} else { } else {
return false // alert('PC') return false; // alert('PC')
} }
}, },
methods: { methods: {
// //
queryHosiptal() { queryHosiptal() {
this.$toast.loading({ this.$toast.loading({
message: '加载中', message: "加载中",
duration: 0, duration: 0,
}) });
try { try {
if (this.GlobalConfig.appMode) { if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdhqyylb", JSON.stringify({}), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { vaildInterfacefn(
this.$toast.clear(); "cgstjyyxuwxt",
let retData = JSON.parse(value); "qdsgajjtjczdhqyylb2",
if (retData.success && retData.code == 200) { // JSON.stringify({}),
this.hospitalList = retData.data; SM.encrypt(
"{}",
"044cf30ffeba743f9e66aa1035115414e13dff701be93d6a57c0aa8e6ea48e1799dbe509ec252d4f8dea66a78b9513630bf31cd82bfc05636f3e824bb024680626"
),
"2",
"https://" + this.GlobalConfig.urlCreatesign,
"https://" + this.GlobalConfig.urlGateway
).then(
(value) => {
value = SM.decrypt(
value,
"00f25ebb5cb3183528b75cf25e69cac7092552fb17b4c6d746d9f70ebfbfe6d496"
);
this.$toast.clear();
let retData = JSON.parse(value);
if (retData.success && retData.code == 200) {
this.hospitalList = retData.data;
}else if(retData.code == 2000 || !retData){
this.queryHosiptal()
}
},
(err) => {
this.$toast.clear();
} }
}, err => { );
this.$toast.clear(); } else {
}) queryHosiptal().then(
} (res) => {
else { this.$toast.clear();
queryHosiptal().then(res => { this.hospitalList = res.data;
this.$toast.clear(); },
this.hospitalList = res.data; (err) => {
}, err => { this.$toast.clear();
this.$toast.clear(); }
}) );
} }
} catch (error) { } catch (error) {
this.$toast.clear(); this.$toast.clear();
@ -104,9 +143,8 @@ export default {
// //
goMyBook() { goMyBook() {
if (this.userInfo) { if (this.userInfo) {
this.$router.push({ name: 'MyExam' }); this.$router.push({ name: "MyExam" });
} } else {
else {
this.getUserInfo(); this.getUserInfo();
} }
}, },
@ -114,47 +152,90 @@ export default {
doCancelGuide() { doCancelGuide() {
this.guideShow = false; this.guideShow = false;
}, },
// //
doGuidance(id) { doGuidance(id) {
console.log(id,'qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2');
// this.guideShow = true; // this.guideShow = true;
// console.log(this.userInfo.papersnumber) // console.log(this.userInfo.papersnumber)
if (this.userInfo) { if (this.userInfo) {
// console.log(this.userInfo.papersnumber); // console.log(this.userInfo.papersnumber);
this.$toast.loading({ this.$toast.loading({
message: '请求中', message: "请求中",
duration: 0, duration: 0,
}) });
if (this.GlobalConfig.appMode) { if (this.GlobalConfig.appMode) {
try { try {
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdyhhmdyz", JSON.stringify({ cupCardNo: this.Base64.encode(this.userInfo.papersnumber) }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { vaildInterfacefn(
this.$toast.clear(); "cgstjyyxuwxt",
let retData = JSON.parse(value); "qdsgajjtjczdyhhmdyz2",
if (retData.code == 200 && retData.data) { SM.encrypt(
this.errMsg = retData.data; JSON.stringify({ cupCardNo: this.userInfo.papersnumber }),
this.isShowError = true; "041268f32bdcb362cfc8e00249debf326c127e56be7bd8ec1ee04771697caab77b5bae7f147e410abff5b43852185afb92e756bc72543eeadefc31be03a361b4b3"
} else { ),
this.$router.push({ name: 'guidance', query: { deptId: id } }) // JSON.stringify({
// // cupCardNo: this.Base64.encode(this.userInfo.papersnumber),
// cupCardNo: SM.encrypt(
// this.userInfo.papersnumber,
// "041268f32bdcb362cfc8e00249debf326c127e56be7bd8ec1ee04771697caab77b5bae7f147e410abff5b43852185afb92e756bc72543eeadefc31be03a361b4b3"
// ),
// }),
"2",
"https://" + this.GlobalConfig.urlCreatesign,
"https://" + this.GlobalConfig.urlGateway
).then(
(value) => {
value = SM.decrypt(
value,
"7c6a0aec3fc01d5e8e2cd623045ee3794767440d75480875ed828ce42fbab245"
);
console.log(value,'qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2qdsgajjtjczdyhhmdyz2');
this.$toast.clear();
let retData = JSON.parse(value);
if (retData.code == 200 && retData.data) {
this.errMsg = retData.data;
this.isShowError = true;
}else if(retData.code == 2000 || !retData){
console.log(retData,'retDataretDataretDataretDataretDataretDataretDataretDataretDataretDataretData');
this.doGuidance(id)
} else {
this.$router.push({
name: "guidance",
query: { deptId: id },
});
}
},
(err) => {
this.$toast.clear();
} }
}, err => { );
this.$toast.clear();
})
} catch (error) { } catch (error) {
this.$toast.clear(); this.$toast.clear();
} }
} } else {
else {
try { try {
checkBacklist(this.Base64.encode(this.userInfo.papersnumber)).then(res => { // checkBacklist(this.Base64.encode(this.userInfo.papersnumber)).then(
this.$toast.clear(); checkBacklist(
if (res.data) { SM.encrypt(
this.errMsg = res.data; this.userInfo.papersnumber,
this.isShowError = true; "041268f32bdcb362cfc8e00249debf326c127e56be7bd8ec1ee04771697caab77b5bae7f147e410abff5b43852185afb92e756bc72543eeadefc31be03a361b4b3"
} else { )
this.$router.push({ name: 'guidance', query: { deptId: id } }) ).then(
(res) => {
this.$toast.clear();
if (res.data) {
this.errMsg = res.data;
this.isShowError = true;
} else {
this.$router.push({
name: "guidance",
query: { deptId: id },
});
}
},
(err) => {
this.$toast.clear();
} }
}, err => { );
this.$toast.clear();
})
} catch (error) { } catch (error) {
this.$toast.clear(); this.$toast.clear();
} }
@ -168,72 +249,79 @@ export default {
// //
// console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
if (data == "未登录") { if (data == "未登录") {
this.onLoginApp() //APP this.onLoginApp(); //APP
} else { } else {
var jsonData = JSON.parse(data) var jsonData = JSON.parse(data);
if (jsonData.retcode == "000000") { if (jsonData.retcode == "000000") {
var dataValueObj = JSON.parse(jsonData.data) var dataValueObj = JSON.parse(jsonData.data);
var ticket = dataValueObj.ticket // var ticket = dataValueObj.ticket; //
this.userType = dataValueObj.usertype // this.userType = dataValueObj.usertype; //
this.getUserToken(ticket) this.getUserToken(ticket);
} }
} }
}, },
fail: function (data) { fail: function (data) {
// //
console.log(JSON.stringify(data)) console.log(JSON.stringify(data));
} },
}) });
}, },
/** /**
* 使用jssdk调用登录页面 * 使用jssdk调用登录页面
*/ */
onLoginApp() { onLoginApp() {
lightAppJssdk.user.loginapp({ lightAppJssdk.user.loginapp({
success: (data) => { success: (data) => {
if (data == "未登录") { if (data == "未登录") {
// //
this.oncloseWindow() this.oncloseWindow();
} else { } else {
var dataObj = JSON.parse(data) var dataObj = JSON.parse(data);
if (dataObj.retcode == "000000") { if (dataObj.retcode == "000000") {
// //
var dataValueObj = JSON.parse(dataObj.data) var dataValueObj = JSON.parse(dataObj.data);
this.getUserToken(dataValueObj.ticket) // this.getUserToken(dataValueObj.ticket); //
this.userType = jsonData.usertype // this.userType = jsonData.usertype; //
} else { } else {
// //
this.oncloseWindow() this.oncloseWindow();
} }
} }
}, },
fail: function (data) { fail: function (data) {
// //
oncloseWindow() oncloseWindow();
} },
}) });
}, },
/** /**
* 通过用户票据获取用户的令牌数据票据使用一次后失效token时效性较长 * 通过用户票据获取用户的令牌数据票据使用一次后失效token时效性较长
*/ */
getUserToken(ticket) { getUserToken(ticket) {
var params = '{"ticket":"' + ticket + '"}' var params = '{"ticket":"' + ticket + '"}';
const interfaceContent = { const interfaceContent = {
app_id: this.appmark, app_id: this.appmark,
servicename: "ticketValidate", servicename: "ticketValidate",
params: params params: params,
} };
vaildInterfacefn("jisnzjk", "ticketvalidate", JSON.stringify(interfaceContent), "2", "https://" + this.urlCreatesign, "https://" + this.urlGateway).then((value) => { vaildInterfacefn(
const data = JSON.parse(value) "jisnzjk",
"ticketvalidate",
JSON.stringify(interfaceContent),
"2",
"https://" + this.urlCreatesign,
"https://" + this.urlGateway
).then((value) => {
const data = JSON.parse(value);
if (data.retcode == "000000") { if (data.retcode == "000000") {
const userToken = JSON.parse(data.data).token const userToken = JSON.parse(data.data).token;
if (this.userType == "1") { if (this.userType == "1") {
// //
this.getUserInfoByToken(userToken) this.getUserInfoByToken(userToken);
} else { } else {
// //
this.findCorUserByToken(userToken) this.findCorUserByToken(userToken);
} }
} else { } else {
lightAppJssdk.notification.alert({ lightAppJssdk.notification.alert({
@ -241,34 +329,41 @@ export default {
message: data.msg, message: data.msg,
buttonName: "确认", buttonName: "确认",
success: function (data) { success: function (data) {
this.oncloseWindow() this.oncloseWindow();
} },
}) });
} }
}) });
}, },
/** /**
* 根据令牌获取个人完整信息 * 根据令牌获取个人完整信息
*/ */
getUserInfoByToken(userToken) { getUserInfoByToken(userToken) {
const params = '{"token":"' + userToken + '"}' const params = '{"token":"' + userToken + '"}';
const interfaceContent = { const interfaceContent = {
app_id: this.appmark, app_id: this.appmark,
servicename: "findOutsideUserByToken", servicename: "findOutsideUserByToken",
params: params params: params,
} };
try { try {
vaildInterfacefn("jisnzjk", "findoutsideuserbytoken", JSON.stringify(interfaceContent), "2", "https://" + this.urlCreatesign, "https://" + this.urlGateway).then((value) => { vaildInterfacefn(
const data = JSON.parse(value) "jisnzjk",
"findoutsideuserbytoken",
JSON.stringify(interfaceContent),
"2",
"https://" + this.urlCreatesign,
"https://" + this.urlGateway
).then((value) => {
const data = JSON.parse(value);
if (data.retcode == "000000") { if (data.retcode == "000000") {
const userInfo = data.data const userInfo = data.data;
sessionStorage.setItem('userInfo', userInfo); sessionStorage.setItem("userInfo", userInfo);
this.userInfo = JSON.parse(userInfo); this.userInfo = JSON.parse(userInfo);
} else { } else {
} }
}) });
} catch (error) { } } catch (error) {}
}, },
/** /**
@ -276,23 +371,30 @@ export default {
*/ */
findCorUserByToken(userToken) { findCorUserByToken(userToken) {
try { try {
const params = '{"token":"' + userToken + '"}' const params = '{"token":"' + userToken + '"}';
const interfaceContent = { const interfaceContent = {
app_id: this.appmark, app_id: this.appmark,
servicename: "findCorUserByToken", servicename: "findCorUserByToken",
params: params params: params,
} };
vaildInterfacefn("jisnzjk", "findcoruserytoken", JSON.stringify(interfaceContent), "2", "https://" + this.urlCreatesign, "https://" + this.urlGateway).then((value) => { vaildInterfacefn(
const data = JSON.parse(value) "jisnzjk",
"findcoruserytoken",
JSON.stringify(interfaceContent),
"2",
"https://" + this.urlCreatesign,
"https://" + this.urlGateway
).then((value) => {
const data = JSON.parse(value);
if (data.retcode == "000000") { if (data.retcode == "000000") {
const userInfo = data.data; const userInfo = data.data;
sessionStorage.setItem('userInfo', userInfo); sessionStorage.setItem("userInfo", userInfo);
this.userInfo = userInfo; this.userInfo = userInfo;
} else { } else {
} }
}) });
} catch (err) { } } catch (err) {}
}, },
/** /**
@ -300,18 +402,18 @@ export default {
*/ */
oncloseWindow() { oncloseWindow() {
lightAppJssdk.navigation.close({ lightAppJssdk.navigation.close({
success: function (data) { }, success: function (data) {},
fail: function (data) { } fail: function (data) {},
}) });
}, },
} },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.home { .home {
.act_shoose { .act_shoose {
position: absolute; position: absolute;
top:0.6rem; top: 0.6rem;
left: 0; left: 0;
right: 0; right: 0;
bottom: calc(1.68rem + 20px); bottom: calc(1.68rem + 20px);
@ -323,18 +425,17 @@ export default {
.act_btn { .act_btn {
width: 6.98rem; width: 6.98rem;
// height: 0.96rem; // height: 0.96rem;
background: #F6F6F6; background: #f6f6f6;
border-radius: 0.08rem; border-radius: 0.08rem;
border: 0.02rem solid #F6F6F6; border: 0.02rem solid #f6f6f6;
padding: 0.12rem 0; padding: 0.12rem 0;
margin-bottom: 0.3rem; margin-bottom: 0.3rem;
display: flex; display: flex;
align-items: center; align-items: center;
&.active { &.active {
background: #FFFFFF; background: #ffffff;
border-color: #1677FF; border-color: #1677ff;
} }
img { img {
@ -376,13 +477,13 @@ export default {
background: #fff; background: #fff;
.act_btn { .act_btn {
color: #FFFFFF; color: #ffffff;
font-size: 0.3rem; font-size: 0.3rem;
font-family: PingFang SC-Bold, PingFang SC; font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold; font-weight: bold;
line-height: 0.96rem; line-height: 0.96rem;
text-align: center; text-align: center;
background: #1677FF; background: #1677ff;
border-radius: 0.08rem; border-radius: 0.08rem;
} }
} }
@ -390,7 +491,7 @@ export default {
.wrapper { .wrapper {
width: 5.98rem; width: 5.98rem;
height: 6.66rem; height: 6.66rem;
background: #FFFFFF; background: #ffffff;
border-radius: 0.16rem; border-radius: 0.16rem;
margin: 0 auto; margin: 0 auto;
margin-top: 2.76rem; margin-top: 2.76rem;
@ -414,7 +515,6 @@ export default {
font-weight: bold; font-weight: bold;
margin: 0.56rem 0 0.2rem 0; margin: 0.56rem 0 0.2rem 0;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
} }
.tip_txt { .tip_txt {
@ -429,7 +529,7 @@ export default {
.btn { .btn {
width: 3rem; width: 3rem;
height: 0.8rem; height: 0.8rem;
background: #1677FF; background: #1677ff;
border-radius: 0.08rem; border-radius: 0.08rem;
margin: 0 auto; margin: 0 auto;
margin-top: 0.6rem; margin-top: 0.6rem;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,48 +1,101 @@
<template> <template>
<div class="my_exam" :style="{ backgroundColor: examArr.length > 0 ? '#f9f9f9' : '#fff' }"> <div
class="my_exam"
:style="{ backgroundColor: examArr.length > 0 ? '#f9f9f9' : '#fff' }"
>
<div class="exam_noresult" v-if="examArr.length < 1"> <div class="exam_noresult" v-if="examArr.length < 1">
<img src="~@/assets/image/no_result.jpg" /> <img src="~@/assets/image/no_result.jpg" />
<div class="no_title">查询无结果</div> <div class="no_title">查询无结果</div>
<div class="no_txt">暂无您的预约项目请选择医院后进行预约</div> <div class="no_txt">暂无您的预约项目请选择医院后进行预约</div>
</div> </div>
<van-list v-else v-model="loading" :finished="isFinished" finished-text="没有更多了" @load="onLoad"> <van-list
v-else
v-model="loading"
:finished="isFinished"
finished-text="没有更多了"
@load="onLoad"
>
<van-cell class="exam_box" v-for="item in examArr" :key="item.id"> <van-cell class="exam_box" v-for="item in examArr" :key="item.id">
<div class="time_box">{{ item.createDeptName }}</div> <div class="time_box">{{ item.createDeptName }}</div>
<div class="pro_box" v-for="item1 in item.details" :key="item1.id"> <div class="pro_box" v-for="item1 in item.details" :key="item1.id">
<div class="pro_top"> <div class="pro_top">
<div class="img_box"> <div class="img_box">
<img v-if="item.apmStatus !== 1" src="~@/assets/image/time.png" alt="" /> <img
v-if="item.apmStatus !== 1"
src="~@/assets/image/time.png"
alt=""
/>
<img v-else src="~@/assets/image/time_gray.png" alt="" /> <img v-else src="~@/assets/image/time_gray.png" alt="" />
</div> </div>
<div class="time_box"> <div class="time_box">
<div class="time_text">{{ doDateFormatter(item.apmDay) }}</div> <div class="time_text">{{ doDateFormatter(item.apmDay) }}</div>
<div class="date_txt">{{ item1.period + ' ' + item1.timeFrame }}</div> <div class="date_txt">
{{ item1.period + " " + item1.timeFrame }}
</div>
</div> </div>
</div> </div>
<div class="pro_bottom"> <div class="pro_bottom">
<div class="pro_left"> <div class="pro_left">
<div class="img_box"> <div class="img_box">
<img v-if="item.apmStatus !== 1" src="~@/assets/image/pro.png" alt="" /> <img
v-if="item.apmStatus !== 1"
src="~@/assets/image/pro.png"
alt=""
/>
<img v-else src="~@/assets/image/pro_gray.png" alt="" /> <img v-else src="~@/assets/image/pro_gray.png" alt="" />
</div> </div>
<div class="pro_name">{{ item1.project }} </div> <div class="pro_name">{{ item1.project }}</div>
<div class="pro_pos" <div
:class="[item1.apmStatus == 2 && class="pro_pos"
item1.lastExamTime === 0 ? 'timeout_tip' : item1.apmStatus === 2 ? 'tips' : '', item1.apmStatus == 1 ? 'cancel_tip' : '',]"> :class="[
item1.apmStatus == 2 && item1.lastExamTime === 0
? 'timeout_tip'
: item1.apmStatus === 2
? 'tips'
: '',
item1.apmStatus == 1 ? 'cancel_tip' : '',
]"
>
{{ {{
item1.apmStatus == 1 ? '您的体检项目已取消' : item1.apmStatus == 3 ? '体检项目已完成' : (item1.apmStatus == 2 && item1.apmStatus == 1
item1.lastExamTime == -1) ? '请尽快报到' : (item1.apmStatus == 2 && ? "您的体检项目已取消"
item1.lastExamTime === 0) ? '您的体检已过期' : item1.limitTime : item1.apmStatus == 3
}}</div> ? "体检项目已完成"
: item1.apmStatus == 2 && item1.lastExamTime == -1
? "请尽快报到"
: item1.apmStatus == 2 && item1.lastExamTime === 0
? "您的体检已过期"
: item1.limitTime
}}
</div>
</div> </div>
<div class="pro_right"> <div class="pro_right">
<div class="cancel" @click="cancelRegisiter(item1)" <div
:class="[item1.apmStatus == 3 ? 'finish' : item1.apmStatus == 1 || item1.limitCancelTime < 30 * 60 * 1000 ? 'cancel_item' : '',]"> class="cancel"
@click="cancelRegisiter(item1)"
:class="[
item1.apmStatus == 3
? 'finish'
: item1.apmStatus == 1 ||
item1.limitCancelTime < 30 * 60 * 1000
? 'cancel_item'
: '',
]"
>
{{ {{
item1.apmStatus == 1 ? '已取消' : (item1.apmStatus == 2 && item1.apmStatus == 1
item1.lastExamTime == -1) ? '已超时' : item1.apmStatus == 2 && ? "已取消"
item1.lastExamTime === 0 ? '已过期' : item1.apmStatus == 2 ? '取消预约' : item1.apmStatus == 3 ? '已完成' : '取消预约' : item1.apmStatus == 2 && item1.lastExamTime == -1
}}</div> ? "已超时"
: item1.apmStatus == 2 && item1.lastExamTime === 0
? "已过期"
: item1.apmStatus == 2
? "取消预约"
: item1.apmStatus == 3
? "已完成"
: "取消预约"
}}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -52,8 +105,10 @@
</template> </template>
<script> <script>
import { myRecord, recordCancel, getSystemTime, } from "@/api/hospital"; import { myRecord, recordCancel, getSystemTime } from "@/api/hospital";
import { dateFormat, calcDate, calcTime } from "@/utils/date"; import { dateFormat, calcDate, calcTime } from "@/utils/date";
import SM from "../utils/SM";
export default { export default {
data() { data() {
return { return {
@ -63,29 +118,29 @@ export default {
examArr: [], examArr: [],
userInfo: null, userInfo: null,
loading: true, loading: true,
systemTime: dateFormat(new Date(), 'yyyy/MM/dd hh:mm:ss'), systemTime: dateFormat(new Date(), "yyyy/MM/dd hh:mm:ss"),
setInterval: 0, setInterval: 0,
interVal: null, interVal: null,
starTime: '', starTime: "",
lastTime: '', lastTime: "",
timeArr: [], timeArr: [],
lastCanTime: '', lastCanTime: "",
limitTime: 1000 * 60 * 30 limitTime: 1000 * 60 * 30,
} };
}, },
mounted() { mounted() {
let userInfo = sessionStorage.getItem('userInfo') ? JSON.parse(sessionStorage.getItem('userInfo')) : null; let userInfo = sessionStorage.getItem("userInfo")
? JSON.parse(sessionStorage.getItem("userInfo"))
: null;
if (userInfo) { if (userInfo) {
this.userInfo = userInfo; this.userInfo = userInfo;
this.querySystemTime(); this.querySystemTime();
// this.queryMyRecord(); // this.queryMyRecord();
this.onLoad() this.onLoad();
} }
}, },
computed: { computed: {},
}, watch: {},
watch: {
},
beforeDestroy() { beforeDestroy() {
if (this.setInterval) { if (this.setInterval) {
clearInterval(this.setInterval); clearInterval(this.setInterval);
@ -99,129 +154,243 @@ export default {
// //
querySystemTime() { querySystemTime() {
if (this.GlobalConfig.appMode) { if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczhqxtsj", JSON.stringify({}), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { vaildInterfacefn(
console.log(typeof (value), 'systemtime', value); "cgstjyyxuwxt",
let retData = typeof (value) == 'string' ? JSON.parse(value) : value; "qdsgajjtjczhqxtsj2",
if (retData.code == 200) { // JSON.stringify({}),
this.systemTime = retData.data.replace(/-/g,'/'); SM.encrypt(
} "{}",
}, err => { "04fa4a906f872f77cb2e9120f6f8e1f2c0e4b3ca8b5d367e21f02922132cdd868acca77403c650a6717af3538b27a5ab9493d5a101d9e42ca40d6aaa6a2ee3815a"
}) ),
} "2",
else { "https://" + this.GlobalConfig.urlCreatesign,
getSystemTime().then(res => { "https://" + this.GlobalConfig.urlGateway
this.systemTime = res.data.replace(/-/g,'/'); ).then(
}) (value) => {
value = SM.decrypt(
value,
"5721b6a3000e381f7b9b9ce1b96069469fb653f9c5b9e6874714999863eb8a9c"
);
console.log(typeof value, "systemtime", value);
let retData = typeof value == "string" ? JSON.parse(value) : value;
if (retData.code == 200) {
this.systemTime = retData.data.replace(/-/g, "/");
} else if (retData.code == 2000 || !retData) {
this.querySystemTime();
}
},
(err) => {}
);
} else {
getSystemTime().then((res) => {
this.systemTime = res.data.replace(/-/g, "/");
});
} }
}, },
// //
queryMyRecord() { queryMyRecord() {
this.$toast.loading({ this.$toast.loading({
message: '加载中', message: "加载中",
duration: 0, duration: 0,
}) });
try { try {
if (this.GlobalConfig.appMode) { if (this.GlobalConfig.appMode) {
vaildInterfacefn(
"cgstjyyxuwxt",
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdckwdyy", JSON.stringify({ createDept: "", cupCardNo: this.Base64.encode(this.userInfo.papersnumber), current: this.current, size: this.size }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { "qdsgajjtjczdckwdyy2",
this.$toast.clear(); SM.encrypt(
let retData = JSON.parse(value); JSON.stringify({
if (retData.code == 200) { createDept: "",
let list = retData.data.records; cupCardNo: this.userInfo.papersnumber,
this.loading = false current: this.current,
list.map(item1 => { size: this.size,
item1.details.map(item => { }),
console.log(item) "04fdaa01435913600162dea9c1892986c2b6bf28ba4110d9892b8e5184750819d8aea3fd7c70aca79a53a6b65200d681c812f61887c176a1cbda00313a76b6322f"
),
"2",
"https://" + this.GlobalConfig.urlCreatesign,
"https://" + this.GlobalConfig.urlGateway
).then(
(value) => {
value = SM.decrypt(
value,
"0084028214ba9561a8e0ebcebe8680820e1639f745ee184f959baad8c7a77f4dd4"
);
console.log(
value,
"valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevalue"
);
this.$toast.clear();
let retData = JSON.parse(value);
if (retData.code == 200) {
let list = retData.data.records;
this.loading = false;
list.map((item1) => {
item1.details.map((item) => {
console.log(item);
let systemTime = Date.parse(new Date(this.systemTime));
item.starTime = systemTime;
let _lattime =
(item.period == "下午"
? 12 +
parseInt(item.timeFrame.split("-")[1].split(":")[0])
: item.timeFrame.split("-")[1].split(":")[0]) +
":" +
item.timeFrame.split("-")[1].split(":")[1];
console.log("lattime", _lattime);
let latime =
item1.apmDay.substr(0, 10) + " " + _lattime + ":00"; //
let _lasCanTime =
(item.period == "下午"
? 12 +
parseInt(item.timeFrame.split("-")[0].split(":")[0])
: item.timeFrame.split("-")[0].split(":")[0]) +
":" +
item.timeFrame.split("-")[0].split(":")[1];
console.log("lasCanTime", _lasCanTime);
let lasCanTime =
item1.apmDay.substr(0, 10) + " " + _lasCanTime + ":00"; //
// item.lastCanTime = Date.parse(new Date(lasCanTime.replaceAll('-', '/')))
// item.lastTime = Date.parse(new Date(latime.replaceAll('-', '/')))
item.lastCanTime = Date.parse(
new Date(lasCanTime.replace(/-/g, "/"))
);
item.lastTime = Date.parse(
new Date(latime.replace(/-/g, "/"))
);
item.limitTime = this.intervalTime(
item.starTime,
item.lastTime
); //
// -1 0
item.lastExamTime =
systemTime < item.lastTime
? item.lastTime - systemTime
: this.isToday(systemTime, item.lastTime)
? -1
: 0;
item.limitCancelTime =
systemTime < item.lastCanTime
? item.lastCanTime - systemTime
: 0; //
// console.log(latime,item.lastTime,lasCanTime,item.lastCanTime,item.limitCancelTime) //670422000
// this.$set(
// item,"limitTime",item.limitTime
// );
});
});
this.timeList();
// if(res.data.pages > 1){
// this.examArr = [...this.examArr,...list]
// }else{
// this.examArr = retData.data.records;
// }
this.examArr = [...this.examArr, ...list];
console.log(this.examArr);
if (retData.data.records.length == 0) {
// console.log('ces')
this.isFinished = true;
} else {
this.current++;
}
console.log(
this.examArr,
"examArrexamArrexamArrexamArrexamArrexamArrexamArrexamArr"
);
} else if (retData.code == 2000 || !retData) {
this.queryMyRecord();
}
},
(err) => {
this.$toast.clear();
}
);
} else {
myRecord(
"",
// this.Base64.encode(this.userInfo.papersnumber),
SM.encrypt(
this.userInfo.papersnumber,
"04fdaa01435913600162dea9c1892986c2b6bf28ba4110d9892b8e5184750819d8aea3fd7c70aca79a53a6b65200d681c812f61887c176a1cbda00313a76b6322f"
),
this.current,
this.size
).then(
(res) => {
this.$toast.clear();
let list = res.data.records;
// if(res.data.pages > 1){
// this.examArr = [...this.examArr,...list]
// }else{
// this.examArr = res.data.records;
// }
list.map((item1) => {
item1.details.map((item) => {
let systemTime = Date.parse(new Date(this.systemTime)); let systemTime = Date.parse(new Date(this.systemTime));
item.starTime = systemTime item.starTime = systemTime;
let _lattime = (item.period == '下午' ? 12 + parseInt(item.timeFrame.split('-')[1].split(':')[0]) : item.timeFrame.split('-')[1].split(':')[0]) + ':' + item.timeFrame.split('-')[1].split(':')[1]; let _lattime =
console.log('lattime', _lattime); (item.period == "下午"
let latime = item1.apmDay.substr(0, 10) + ' ' + _lattime + ':00';// ? 12 +
let _lasCanTime = (item.period == '下午' ? 12 + parseInt(item.timeFrame.split('-')[0].split(':')[0]) : item.timeFrame.split('-')[0].split(':')[0]) + ':' + item.timeFrame.split('-')[0].split(':')[1]; parseInt(item.timeFrame.split("-")[1].split(":")[0])
console.log('lasCanTime', _lasCanTime); : item.timeFrame.split("-")[1].split(":")[0]) +
let lasCanTime = item1.apmDay.substr(0, 10) + ' ' + _lasCanTime + ':00';// ":" +
item.timeFrame.split("-")[1].split(":")[1];
console.log("lattime", _lattime);
let latime =
item1.apmDay.substr(0, 10) + " " + _lattime + ":00";
let _lasCanTime =
(item.period == "下午"
? 12 +
parseInt(item.timeFrame.split("-")[0].split(":")[0])
: item.timeFrame.split("-")[0].split(":")[0]) +
":" +
item.timeFrame.split("-")[0].split(":")[1];
console.log("lasCanTime", _lasCanTime);
let lasCanTime =
item1.apmDay.substr(0, 10) + " " + _lasCanTime + ":00";
// item.lastCanTime = Date.parse(new Date(lasCanTime.replaceAll('-', '/'))) // item.lastCanTime = Date.parse(new Date(lasCanTime.replaceAll('-', '/')))
// item.lastTime = Date.parse(new Date(latime.replaceAll('-', '/'))) // item.lastTime = Date.parse(new Date(latime.replaceAll('-', '/')))
item.lastCanTime = Date.parse(new Date(lasCanTime.replace(/-/g, '/'))); item.lastCanTime = Date.parse(
item.lastTime = Date.parse(new Date(latime.replace(/-/g, '/'))) new Date(lasCanTime.replace(/-/g, "/"))
item.limitTime = this.intervalTime(item.starTime, item.lastTime);// );
// -1 0 item.lastTime = Date.parse(
item.lastExamTime = systemTime < item.lastTime ? item.lastTime - systemTime : this.isToday(systemTime,item.lastTime) ? -1 : 0; new Date(latime.replace(/-/g, "/"))
item.limitCancelTime = systemTime < item.lastCanTime ? item.lastCanTime - systemTime : 0;// );
item.limitTime = this.intervalTime(
item.starTime,
item.lastTime
);
item.lastExamTime =
systemTime < item.lastTime
? item.lastTime - systemTime
: this.isToday(systemTime, item.lastTime)
? -1
: 0;
item.limitCancelTime =
systemTime < item.lastCanTime
? item.lastCanTime - systemTime
: 0; //
// console.log(latime,item.lastTime,lasCanTime,item.lastCanTime,item.limitCancelTime) //670422000 // console.log(latime,item.lastTime,lasCanTime,item.lastCanTime,item.limitCancelTime) //670422000
// this.$set( // this.$set(
// item,"limitTime",item.limitTime // item,"limitTime",item.limitTime
// ); // );
}) });
}) });
this.timeList() this.timeList();
// if(res.data.pages > 1){
// this.examArr = [...this.examArr,...list]
// }else{
// this.examArr = retData.data.records;
// }
this.examArr = [...this.examArr, ...list]; this.examArr = [...this.examArr, ...list];
console.log(this.examArr) if (res.data.records.length === 0) {
if (retData.data.records.length == 0) { this.isFinished = true;
// console.log('ces')
this.isFinished = true
} else { } else {
this.current++ this.current++;
} }
this.loading = false;
},
} (err) => {
}, err => { this.$toast.clear();
this.$toast.clear();
})
}
else {
myRecord("", this.Base64.encode(this.userInfo.papersnumber), this.current, this.size).then(res => {
this.$toast.clear();
let list = res.data.records;
// if(res.data.pages > 1){
// this.examArr = [...this.examArr,...list]
// }else{
// this.examArr = res.data.records;
// }
list.map(item1 => {
item1.details.map(item => {
let systemTime = Date.parse(new Date(this.systemTime));
item.starTime = systemTime
let _lattime = (item.period == '下午' ? 12 + parseInt(item.timeFrame.split('-')[1].split(':')[0]) : item.timeFrame.split('-')[1].split(':')[0]) + ':' + item.timeFrame.split('-')[1].split(':')[1];
console.log('lattime', _lattime);
let latime = item1.apmDay.substr(0, 10) + ' ' + _lattime + ':00';
let _lasCanTime = (item.period == '下午' ? 12 + parseInt(item.timeFrame.split('-')[0].split(':')[0]) : item.timeFrame.split('-')[0].split(':')[0]) + ':' + item.timeFrame.split('-')[0].split(':')[1];
console.log('lasCanTime', _lasCanTime);
let lasCanTime = item1.apmDay.substr(0, 10) + ' ' + _lasCanTime + ':00';
// item.lastCanTime = Date.parse(new Date(lasCanTime.replaceAll('-', '/')))
// item.lastTime = Date.parse(new Date(latime.replaceAll('-', '/')))
item.lastCanTime = Date.parse(new Date(lasCanTime.replace(/-/g, '/')))
item.lastTime = Date.parse(new Date(latime.replace(/-/g, '/')))
item.limitTime = this.intervalTime(item.starTime, item.lastTime)
item.lastExamTime = systemTime < item.lastTime ? item.lastTime - systemTime : this.isToday(systemTime,item.lastTime) ? -1 : 0
item.limitCancelTime = systemTime < item.lastCanTime ? item.lastCanTime - systemTime : 0;//
// console.log(latime,item.lastTime,lasCanTime,item.lastCanTime,item.limitCancelTime) //670422000
// this.$set(
// item,"limitTime",item.limitTime
// );
})
})
this.timeList()
this.examArr = [...this.examArr, ...list];
if (res.data.records.length === 0) {
this.isFinished = true;
} else {
this.current++
} }
this.loading = false );
}, err => {
this.$toast.clear();
})
} }
} catch (error) { } catch (error) {
this.$toast.clear(); this.$toast.clear();
@ -230,29 +399,35 @@ export default {
timeList() { timeList() {
if (this.setInterval) { if (this.setInterval) {
clearInterval(this.setInterval) clearInterval(this.setInterval);
} }
this.setInterval = setInterval(() => { this.setInterval = setInterval(() => {
let arr = [] let arr = [];
this.examArr.forEach(item => { this.examArr.forEach((item) => {
item.details.map(item1 => { item.details.map((item1) => {
item1.starTime = item1.starTime > 1000 ? item1.starTime + 1000 : 0; item1.starTime = item1.starTime > 1000 ? item1.starTime + 1000 : 0;
item1.limitTime = this.intervalTime(item1.starTime, item1.lastTime); item1.limitTime = this.intervalTime(item1.starTime, item1.lastTime);
item1.lastExamTime = item1.lastExamTime > 1000 ? item1.lastExamTime - 1000 : this.isToday(this.systemTime,item1.lastTime) ? -1 : 0; item1.lastExamTime =
item1.limitCancelTime = item1.limitCancelTime > 1000 ? item1.limitCancelTime - 1000 : 0 item1.lastExamTime > 1000
this.$set(item.details, item1.limitTime, item1.limitTime) ? item1.lastExamTime - 1000
: this.isToday(this.systemTime, item1.lastTime)
? -1
: 0;
item1.limitCancelTime =
item1.limitCancelTime > 1000 ? item1.limitCancelTime - 1000 : 0;
this.$set(item.details, item1.limitTime, item1.limitTime);
// this.$set(item.details,item1.limitCancelTime,item1.limitCancelTime) // this.$set(item.details,item1.limitCancelTime,item1.limitCancelTime)
}) });
// console.log(this.examArr) // console.log(this.examArr)
}) });
}, 1000) }, 1000);
}, },
// //
// //
intervalTime(startTime, endTime) { intervalTime(startTime, endTime) {
// var timestamp=new Date().getTime(); // // var timestamp=new Date().getTime(); //
var timestamp = (Date.parse(new Date())) / 1000;// () var timestamp = Date.parse(new Date()) / 1000; // ()
var date1 = ""; // var date1 = ""; //
if (timestamp < startTime) { if (timestamp < startTime) {
date1 = startTime; date1 = startTime;
@ -261,11 +436,11 @@ export default {
} }
var date2 = endTime; // var date2 = endTime; //
// var date3 = date2.getTime() - date1.getTime(); // // var date3 = date2.getTime() - date1.getTime(); //
var date3 = (date2 - date1); // var date3 = date2 - date1; //
date3 = date3 < 0 ? 0 : date3 date3 = date3 < 0 ? 0 : date3;
// //
var days = Math.floor(date3 / (24 * 3600 * 1000)); var days = Math.floor(date3 / (24 * 3600 * 1000));
days = days < 0 ? '' : days + '天' days = days < 0 ? "" : days + "天";
// //
var leave1 = date3 % (24 * 3600 * 1000); // var leave1 = date3 % (24 * 3600 * 1000); //
@ -273,47 +448,70 @@ export default {
// //
var leave2 = leave1 % (3600 * 1000); // var leave2 = leave1 % (3600 * 1000); //
var minutes = Math.floor(leave2 / (60 * 1000)); var minutes = Math.floor(leave2 / (60 * 1000));
minutes = minutes < 10 ? '0' + minutes : minutes minutes = minutes < 10 ? "0" + minutes : minutes;
// //
var leave3 = leave2 % (60 * 1000); // var leave3 = leave2 % (60 * 1000); //
var seconds = Math.round(leave3 / 1000); var seconds = Math.round(leave3 / 1000);
seconds = seconds < 10 ? '0' + seconds : seconds; seconds = seconds < 10 ? "0" + seconds : seconds;
// console.log(days + " " + hours + " ") // console.log(days + " " + hours + " ")
return `距离体检还有${days}${hours}:${minutes}:${seconds}` return `距离体检还有${days}${hours}:${minutes}:${seconds}`;
// return { // return {
// days, // days,
// hours, // hours,
// minutes, // minutes,
// seconds // seconds
// } // }
}, },
// //
isToday(systemTime,lastTime) { isToday(systemTime, lastTime) {
console.log(dateFormat(new Date(systemTime), 'yyyy-MM-dd'), dateFormat(new Date(lastTime), 'yyyy-MM-dd'),dateFormat(new Date(systemTime), 'yyyy-MM-dd') == dateFormat(new Date(lastTime), 'yyyy-MM-dd')) console.log(
return dateFormat(new Date(systemTime), 'yyyy-MM-dd') == dateFormat(new Date(lastTime), 'yyyy-MM-dd') dateFormat(new Date(systemTime), "yyyy-MM-dd"),
dateFormat(new Date(lastTime), "yyyy-MM-dd"),
dateFormat(new Date(systemTime), "yyyy-MM-dd") ==
dateFormat(new Date(lastTime), "yyyy-MM-dd")
);
return (
dateFormat(new Date(systemTime), "yyyy-MM-dd") ==
dateFormat(new Date(lastTime), "yyyy-MM-dd")
);
}, },
// //
doDateFormatter(date) { doDateFormatter(date) {
return dateFormat(new Date(date.replace(/-/g, '/')), 'yyyy-MM-dd'); return dateFormat(new Date(date.replace(/-/g, "/")), "yyyy-MM-dd");
}, },
// //
calcDateTime(item) { calcDateTime(item) {
let systemTime = Date.parse(new Date(this.systemTime)); let systemTime = Date.parse(new Date(this.systemTime));
let time = item.timeFrame.split('-')[1].split(':'); let time = item.timeFrame.split("-")[1].split(":");
let endTime = Date.parse(new Date(this.doDateFormatter(item.apmDay) + ' ' + (time[0] < 10 ? '0' + time[0] : time[0]) + ':' + (time[1] < 10 ? '0' + time[1] : time[1]) + ':00')); let endTime = Date.parse(
new Date(
this.doDateFormatter(item.apmDay) +
" " +
(time[0] < 10 ? "0" + time[0] : time[0]) +
":" +
(time[1] < 10 ? "0" + time[1] : time[1]) +
":00"
)
);
if (systemTime < endTime) { if (systemTime < endTime) {
let ret = calcDate(systemTime, endTime); let ret = calcDate(systemTime, endTime);
return `距离体检还有${ret.days}${ret.hours}:${ret.minutes}:${(ret.seconds + '').substr(0, 2)}` return `距离体检还有${ret.days}${ret.hours}:${ret.minutes}:${(
ret.seconds + ""
).substr(0, 2)}`;
} }
}, },
calcDateTimeStr(time) { calcDateTimeStr(time) {
console.log('剩余 ===>', time) console.log("剩余 ===>", time);
let ret = calcTime(time); let ret = calcTime(time);
console.log('ret ===>', ret) console.log("ret ===>", ret);
return time > 0 ? `距离体检还有${ret.days}${ret.hours}:${ret.minutes}:${(ret.seconds + '').substr(0, 2)}` : '' return time > 0
? `距离体检还有${ret.days}${ret.hours}:${ret.minutes}:${(
ret.seconds + ""
).substr(0, 2)}`
: "";
}, },
// //
cancelRegisiter(row) { cancelRegisiter(row) {
@ -334,50 +532,70 @@ export default {
// } // }
lightAppJssdk.notification.confirm({ lightAppJssdk.notification.confirm({
message: "是否取消该体检项目", message: "是否取消该体检项目",
title: "提示",// title: "提示", //
buttonLabels: ['确定', '取消'], buttonLabels: ["确定", "取消"],
success: (data) => { success: (data) => {
if (JSON.parse(data).buttonIndex == 1) { if (JSON.parse(data).buttonIndex == 1) {
// console.log('ces') // console.log('ces')
this.$toast.loading({ this.$toast.loading({
message: '', message: "",
duration: 0, duration: 0,
}) });
if (this.GlobalConfig.appMode) { if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdqxtjyy", JSON.stringify({ id: row.id }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { vaildInterfacefn(
let retData = JSON.parse(value); "cgstjyyxuwxt",
if (retData.code == 200) { "qdsgajjtjczdqxtjyy2",
this.$toast('操作成功'); // JSON.stringify({ id: row.id }),
this.examArr.map(item => { // JSON.stringify({ id: row.id }),
let tmp = item.details.find(item1 => item1.id == row.id) SM.encrypt(
if (tmp) { JSON.stringify({ id: row.id }),
tmp.apmStatus = 1; "04a99f6a9ff11eb2cac2a4999d5a7fc2002dae6543e327d6a0ffcf001792cb6a89b48e6f87ca7d6826e469600f66c7c9beac911f5375b29fa725e58ae1d0cd848b"
} ),
}) "2",
this.$toast.clear() "https://" + this.GlobalConfig.urlCreatesign,
// setTimeout(() => { "https://" + this.GlobalConfig.urlGateway
// this.current = 1; ).then(
// this.examArr = [] (value) => {
// this.queryMyRecord(); value = SM.decrypt(
// }, 500); value,
} "66b284eeb814354cb6bc2933a94a7ffa75945ba650c25ff0b59353fc00df71cb"
}, err => { );
}) let retData = JSON.parse(value);
} if (retData.code == 200) {
else { this.$toast("操作成功");
recordCancel(row.id).then(res => { this.examArr.map((item) => {
console.log(res) let tmp = item.details.find(
(item1) => item1.id == row.id
);
if (tmp) {
tmp.apmStatus = 1;
}
});
this.$toast.clear();
// setTimeout(() => {
// this.current = 1;
// this.examArr = []
// this.queryMyRecord();
// }, 500);
}else if(retData.code == 2000 || !retData){
this.cancelRegisiter(row)
}
},
(err) => {}
);
} else {
recordCancel(row.id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$toast('操作成功'); this.$toast("操作成功");
// let tmp = '' // let tmp = ''
this.examArr.map(item => { this.examArr.map((item) => {
let tmp = item.details.find(item1 => item1.id == row.id) let tmp = item.details.find((item1) => item1.id == row.id);
if (tmp) { if (tmp) {
tmp.apmStatus = 1 tmp.apmStatus = 1;
} }
}) });
this.$toast.clear() this.$toast.clear();
// setTimeout(() => { // setTimeout(() => {
// this.current = 1; // this.current = 1;
// this.examArr = []; // this.examArr = [];
@ -385,14 +603,15 @@ export default {
// this.queryMyRecord(); // this.queryMyRecord();
// }, 500); // }, 500);
} }
}) });
} }
} }
}, },
fail: function (data) { // fail: function (data) {
} //
},
}); });
} },
}, },
}; };
</script> </script>
@ -450,11 +669,10 @@ export default {
// margin: 0.4rem auto; // margin: 0.4rem auto;
// margin-bottom: 0.7rem; // margin-bottom: 0.7rem;
.pro_top { .pro_top {
display: flex; display: flex;
padding-bottom: 0.26rem; padding-bottom: 0.26rem;
border-bottom: 1px solid #EEEEEE; border-bottom: 1px solid #eeeeee;
.img_box { .img_box {
display: flex; display: flex;
@ -472,7 +690,7 @@ export default {
width: 1.46rem; width: 1.46rem;
height: 0.32rem; height: 0.32rem;
text-align: center; text-align: center;
background: #F6F6F6; background: #f6f6f6;
border-radius: 0.08rem; border-radius: 0.08rem;
line-height: 0.32rem; line-height: 0.32rem;
font-size: 0.24rem; font-size: 0.24rem;
@ -496,7 +714,6 @@ export default {
.pro_left { .pro_left {
display: flex; display: flex;
.img_box { .img_box {
height: 100%; height: 100%;
display: flex; display: flex;
@ -505,7 +722,6 @@ export default {
img { img {
width: 0.5rem; width: 0.5rem;
height: 0.5rem; height: 0.5rem;
} }
} }
@ -529,11 +745,11 @@ export default {
} }
.tips { .tips {
color: #00B578; color: #00b578;
} }
.cancel_tip { .cancel_tip {
color: #F93A4A; color: #f93a4a;
} }
.timeout_tip { .timeout_tip {
@ -549,29 +765,29 @@ export default {
.cancel { .cancel {
width: 1.5rem; width: 1.5rem;
height: 0.5rem; height: 0.5rem;
background: rgba(22, 119, 255, .1); background: rgba(22, 119, 255, 0.1);
border-radius: 0.26rem; border-radius: 0.26rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 0.24rem; font-size: 0.24rem;
color: #1677FF; color: #1677ff;
} }
.finish { .finish {
background: #E5E5E5; background: #e5e5e5;
color: #999; color: #999;
pointer-events: none; pointer-events: none;
} }
.limit { .limit {
pointer-events: none; pointer-events: none;
background: #E5E5E5; background: #e5e5e5;
color: #999; color: #999;
} }
.cancel_item { .cancel_item {
background: rgba(125, 125, 125, .2); background: rgba(125, 125, 125, 0.2);
color: #999; color: #999;
pointer-events: none; pointer-events: none;
} }

Loading…
Cancel
Save