faceChooseVisiCard.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073
  1. <template>
  2. <view class="container">
  3. <view class="userInfo_box" v-if="serviceType != 'addCard'">
  4. <view class="userInfo_list border_bottom">
  5. <text>姓名</text>
  6. <text>{{userInfo.memberName}}</text>
  7. </view>
  8. <view class="userInfo_list border_bottom">
  9. <text>手机号</text>
  10. <text>{{common.desensitization(userInfo.userMobile,3,7)}}</text>
  11. </view>
  12. <view class="userInfo_list border_bottom">
  13. <text>身份证号</text>
  14. <text>{{common.desensitization(userInfo.certNum,4,14) || '-'}}</text>
  15. </view>
  16. <view class="userInfo_list border_bottom" v-if="userInfo.guardianCertNum">
  17. <text>监护人身份证号</text>
  18. <text>{{common.desensitization(userInfo.guardianCertNum,4,14)}}</text>
  19. </view>
  20. <view class="userInfo_list" data-type="open" @click="selectItem('open', $event)">
  21. <text class="userInfo_listRela">成员关系</text>
  22. <view class="relationCode_text" v-if="relationCodeIndex == null"><view>请选择亲友成员与本人关系 <text class="colorRed">(必选)</text></view><image class="public_right_img" :src="iconUrl.icon_rightGreen"></image></view>
  23. <text v-if="relationCodeIndex != null">{{relationCodeList[relationCodeIndex].dictLabel}}</text>
  24. </view>
  25. </view>
  26. <!-- 有卡全部绑定 -->
  27. <view class="cardList_box" v-if="serviceType == 'addMember'">
  28. <view class="cardList_topText colorCustom_F08">
  29. 就诊人"{{userInfo.memberName}}"名下已关联
  30. <text>{{userInfo.cardNum}}张就诊卡</text>
  31. <text v-if="userInfo.hosNum != 0">、{{userInfo.hosNum}}个住院号</text>
  32. </view>
  33. <view class="card_item displayFlexRow" v-for="(item, index) in cardList" :key="index" @click="chooseCard(index)">
  34. <template v-if="item.cardType == 1">
  35. <view class="member_item_info displayFlexCol">
  36. <view class="info_memberMsg_name ">{{item.memberName}}</view>
  37. <view class="info_memberCard" >
  38. 就诊卡:{{item.cardNo}}
  39. </view>
  40. </view>
  41. <view class="set_default displayFlexRow" @click.stop="autoBindCard(index)" v-if="userInfo.cardNum > 1">
  42. <text>设为默认卡</text>
  43. <image :src="item.check ? iconUrl.circle_active : iconUrl.circle" />
  44. </view>
  45. </template>
  46. <template v-if="item.cardType == 14">
  47. <view class="member_item_info displayFlexCol">
  48. <view class="info_memberMsg_name ">{{item.memberName}}</view>
  49. <view class="info_memberCard" >
  50. 住院号:{{item.cardNo}}
  51. </view>
  52. </view>
  53. <view class="set_default" :class="item.inHospitalStatus == 1?'colorCustom':'colorCustom_999'">
  54. {{item.inHospitalStatus == 1 ? '在院' : '离院'}}
  55. </view>
  56. </template>
  57. </view>
  58. </view>
  59. <!-- 无卡就诊人显示 -->
  60. <view class="no_card_tips_box displayFlexLeft" v-if="serviceType == 'noCard_idCard'">
  61. <text class="view colorCustom_F08" style="margin-bottom: 40upx;">查无关联就诊卡、住院号</text>
  62. <text class="text">1、您可直接建档,先预约,到院后到窗口办卡;</text>
  63. <text class="text mb0">2、若您手中有就诊卡,可手动添加。</text>
  64. </view>
  65. <template v-if="serviceType == 'diMobile'">
  66. <!-- 手机号不同 -->
  67. <view class="no_card_tips_box">
  68. <view class="view colorCustom_F08">当前手机尾号{{common.strSub(userInfo.userMobile,7,userInfo.userMobile.length)}}未查询到就诊卡,系统查询到该身份证绑定了其他手机号码,请确认</view>
  69. <view class="text mb0">该身份证绑定了其他手机号码</view>
  70. </view>
  71. <!-- 手机号不同 -->
  72. <view class="no_card_tips_box">
  73. <view class="view">请选择已绑定手机号码进行校验</view>
  74. <view class="choice_card_box">
  75. <view class="choice_card_item_box displayFlexRow border_bottom" v-for="(item, index) in mobileList" :key="index" @click="choiceMobile(index)">
  76. <view class="choice_card_info_box displayFlexCol">
  77. <text>{{item.mobile}}</text>
  78. <text>请输入手机号码中间4位进行确认</text>
  79. </view>
  80. <image v-if="index == mobileIndex" :src="iconUrl.circle_active" />
  81. <image v-if="index != mobileIndex" :src="iconUrl.circle" />
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <!-- 姓名与查询出来的不一致--手动录入 -->
  87. <view class="no_card_tips_box displayFlexCol" v-if="serviceType == 'diMemberName_idCard'">
  88. <text class="color62626D">该身份信息已注册过</text>
  89. <text>就诊人姓名与身份信息不匹配,查询档案与您输入的信息不一致;如果您是本人,请进行人脸认证。</text>
  90. </view>
  91. <!-- 姓名与查询出来的不一致--人脸添加 -->
  92. <view class="no_card_tips_box displayFlexCol" v-if="serviceType == 'diMemberName_face'">
  93. <text class="color62626D">该身份信息已注册过</text>
  94. <text>就诊人姓名与身份信息不匹配,查询档案与您输入的信息不一致,请确认:</text>
  95. <view class="query_card_info displayFlexCol">
  96. <text>{{cardList[0].MemberName}}</text>
  97. <text>身份证号:{{cardList[0].IdCardNo}}</text>
  98. </view>
  99. </view>
  100. <!-- 姓名与查询出来的不一致--人脸添加 -->
  101. <view class="no_card_tips_box query_member_mobile displayFlexCol" v-if="serviceType == 'diMemberName_face'">
  102. <text>如需绑定该就诊人,请校验手机号码 </text>
  103. <text>如需修改手机号码,请持身份证到医院窗口修改</text>
  104. <view class="query_card_info displayFlexCol">
  105. <text>{{common.desensitization(cardList[0].Telephone,3,7)}}</text>
  106. <text>请输入手机号码中间4位进行确认</text>
  107. </view>
  108. </view>
  109. <!-- 通过卡添加人时 切输入的卡号验证通过返回信息正确 -->
  110. <view class="userInfoTow" v-if="serviceType == 'addCard' && step != 1">
  111. <view class="userInfoTow_text colorCustom_F08">当前{{redioCardType=='1'?'就诊卡':'住院号'}}“{{addCardNo}}”,查询到以下就诊人信息,请选择正确的一个添加!</view>
  112. <radio-group @change="radioChange('changCardListIndex', $event)">
  113. <view class="userInfoTow_box" v-for="(item, index) in cardList" :key="index">
  114. <view class="displayFlexBetween">
  115. <view class="userInfoTow_boxName">{{item.memberName}}</view>
  116. <radio class="addCardMask_radio" :value="String(index)" :checked="changCardListIndex == index"></radio>
  117. </view>
  118. <view class="userInfoTow_boxinfo">
  119. <view class="userInfoTow_boxinfo_text">手机号:{{item.mobile}}</view>
  120. <view class="userInfoTow_boxinfo_text">身份证号:{{item.certNum || '-'}}</view>
  121. <!-- 判断如果没有身份证号,展示监护人身份信息 -->
  122. <template v-if="!item.certNum">
  123. <view class="userInfoTow_boxinfo_text">监护人姓名:{{item.guardianName || '-'}}</view>
  124. <view class="userInfoTow_boxinfo_text">监护人身份证号:{{item.guardianCertNum || '-'}}</view>
  125. </template>
  126. </view>
  127. <view class="userInfo_list" data-type="open" @click="selectItem('open', $event)" v-if="changCardListIndex == index">
  128. <text class="userInfo_listRela">成员关系</text>
  129. <view class="relationCode_text" v-if="relationCodeIndex == null">
  130. <view>请选择亲友成员与本人关系 <text class="colorRed">(必选)</text></view>
  131. </view>
  132. <text v-if="relationCodeIndex != null">{{relationCodeList[relationCodeIndex].dictLabel}}</text>
  133. <image class="public_right_img" :src="iconUrl.icon_rightGreen"></image>
  134. </view>
  135. </view>
  136. </radio-group>
  137. </view>
  138. <view class="footer_btn_box">
  139. <view class="public_btn backgroundCustom_F08" @click="jumpCheckReportForm" v-if="serviceType == 'addMember'">全部添加</view>
  140. <view class="public_btn backgroundCustom_F08" data-tag="createFile" @click="jumpCheckReportForm('createFile')" v-if="serviceType == 'noCard_idCard'">无卡建档,可预约</view>
  141. <view class="public_btn backgroundCustom" data-tag="addCard" @click="jumpCheckReportForm('addCard')" v-if="serviceType == 'noCard_idCard'">我有卡,手动添加</view>
  142. <view class="public_btn backgroundCustom_F08" @click="jumpCheckReportForm" v-if="serviceType == 'diMobile' || serviceType == 'diMemberName_face'">获取短信验证码</view>
  143. <view class="public_btn backgroundCustom_F08" @click="clickCardBtn" v-if="serviceType == 'addCard' && step == 2">下一步</view>
  144. </view>
  145. </view>
  146. <!-- 手动添加就诊卡 -->
  147. <view class="add_card_mask displayFlexRow" v-if="showAddCard">
  148. <view class="add_card_box displayFlexCol">
  149. <text class="add_card_title">添加就诊人</text>
  150. <text class="add_card_tips" v-if="step == 3">发送到手机号:{{cardList[0].mobile}}</text>
  151. <view class="page-section" v-if="step == 1">
  152. <radio-group @change="radioChange('redioCardType', $event)">
  153. <radio class="addCardMask_radio" value="1" :checked="redioCardType == 1">就诊卡</radio>
  154. <radio class="addCardMask_radio" value="14" :checked="redioCardType == 14">住院号</radio>
  155. </radio-group>
  156. </view>
  157. <input class="add_card_input" type="text" :value="step == 1 ? addCardNo : provingCode" :placeholder="step == 1 ?(redioCardType == '1'? '请输入就诊卡号' : '请输入住院号'):'请输入验证码' " :data-name="step == 1 ? 'addCardNo' : 'provingCode'" @input="getInputVal"/>
  158. <text class="add_card_tips" v-if="step == 3 && seconds > 0">{{seconds}}秒可重发</text>
  159. <text class="add_card_tips colorCustom" v-if="step == 3 && seconds == 0" @click="getProvingCode">点击发送验证码</text>
  160. <view class="add_card_footer_btn displayFlexRow">
  161. <text class="backgroundCustom" @click="hideAddCardModel">取消</text>
  162. <text class="backgroundCustom_F08" @click="clickCardBtn">确定</text>
  163. </view>
  164. </view>
  165. </view>
  166. <!-- 手机号不同--检验中间四位,并发送验证码校验 -->
  167. <view class="add_card_mask displayFlexRow" v-if="showDiMobile">
  168. <view class="add_card_box displayFlexCol">
  169. <text class="add_card_title">请输入手机号码中间4位</text>
  170. <text class="add_card_tips">手机号:{{serviceType == "diMemberName_face" ? cardList[0].mobile : mobileList[mobileIndex].mobile}}</text>
  171. <input class="add_card_input" type="number" :value="step == 1 ? subMobile : provingCode" :placeholder="step == 1 ? '请输入手机号码中间4位' : '请输入验证码'" :data-name="step == 1 ? 'subMobile' : 'provingCode'" @input="getInputVal"/>
  172. <text class="add_card_tips" v-if="step == 2 && seconds > 0">{{seconds}}秒可重发</text>
  173. <text class="add_card_tips colorCustom" v-if="step == 2 && seconds == 0" @click="getProvingCode">点击重新发送验证码</text>
  174. <view class="add_card_footer_btn displayFlexRow">
  175. <text class="backgroundCustom" @click="hideAddCardModel">取消</text>
  176. <text class="backgroundCustom_F08" @click="clickMobileBtn">确定</text>
  177. </view>
  178. </view>
  179. </view>
  180. <!-- 筛选条件 -->
  181. <view class="mainScreenBox " v-if="relationsShow">
  182. <view class="cententBox">
  183. <text class="screenTitle">选择成员关系</text>
  184. <view class="screenList">
  185. <text v-for="(item, index) in relationCodeList" :key="index" @click="selectItem('select', $event, index)" class="" :class="relationCodeIndex == index?'active_screen':''" >{{item.dictLabel}}</text>
  186. </view>
  187. <view class="public_btn backgroundCustom" @click="selectItem('open', $event)">确定</view>
  188. </view>
  189. </view>
  190. <!-- 遮罩 -->
  191. <view class="mask" v-if="relationsShow" @click="selectItem('cancel', $event)"></view>
  192. </template>
  193. <script lang="ts" setup>
  194. import { ref, reactive, computed, getCurrentInstance } from 'vue';
  195. import { useStore } from 'vuex';
  196. import { useOnLoad, usePreserMember, useGetDefaultMember } from '@/hook';
  197. import { common } from '@/utils';
  198. import icon from '@/utils/icon';
  199. import {
  200. dataList,
  201. queryMemberCardList_V3,
  202. addBaseMember_V3,
  203. updateToHealthCard_V2,
  204. setDefaultClinicCard_V3,
  205. queryMemberByCard_V3,
  206. sendVerificationCode_V3,
  207. addBaseMemberByEncryptionStore_V3,
  208. checkMobile_V3,
  209. checkVerificationCode_V3,
  210. setDefaultMemberV3
  211. } from '@/pagesPersonal/service/patientManagement';
  212. const { proxy } = getCurrentInstance();
  213. const app = getApp();
  214. const store = useStore();
  215. const iconUrl = ref(icon);
  216. const serviceType = ref("");
  217. const pageType = ref("");
  218. const reqData = ref<any>({});
  219. const userInfo = ref<any>({});
  220. const cardList = ref<any[]>([]);
  221. const mobileList = ref<any[]>([]);
  222. const mobileIndex = ref(0);
  223. const checkedIndex = ref("0");
  224. const showAddCard = ref(false);
  225. const showDiMobile = ref(false);
  226. const step = ref(1);
  227. const addCardNo = ref("");
  228. const subMobile = ref("");
  229. const pcId = ref("");
  230. const provingCode = ref("");
  231. const seconds = ref(0);
  232. const redioCardType = ref('1');
  233. const changCardListIndex = ref(0);
  234. const relationCodeList = ref<any[]>([]);
  235. const relationCodeIndex = ref<number | null>(null);
  236. const relationsShow = ref(false);
  237. let timer: any = null;
  238. let relationIndex: number | null = null;
  239. useOnLoad((options) => {
  240. getRelationCode();
  241. let queryData = options.queryData ? JSON.parse(options.queryData) : {};
  242. if (queryData.userMobile) {
  243. queryData.mobile = queryData.userMobile;
  244. queryData.isSHA = true;
  245. }
  246. serviceType.value = options.serviceType || "";
  247. reqData.value = queryData;
  248. userInfo.value = queryData;
  249. redioCardType.value = options.redioCardType || '1';
  250. pageType.value = options.pageType || '';
  251. // 通过卡查询绑卡
  252. if (serviceType.value == 'addCard') {
  253. showAddCard.value = true;
  254. }
  255. // 添加就诊人 查询当前信息就诊卡
  256. if (serviceType.value == 'addMember') {
  257. queryCardList(reqData.value);
  258. }
  259. });
  260. // 获取亲友成员关系字典
  261. const getRelationCode = async () => {
  262. let { resp } = await dataList({
  263. Page: {
  264. "PIndex": 1,
  265. "PSize": 10
  266. },
  267. dictType: "MemberAccountRelationCode"
  268. });
  269. if (common.isNotEmpty(resp)) {
  270. // 过滤本人字典,后端字典会自动插入前端过滤
  271. resp = resp.filter((item: any) => item.dictValue != '1');
  272. }
  273. relationCodeList.value = resp || [];
  274. };
  275. /**
  276. * 查询人下的卡
  277. */
  278. const queryCardList = async (reqDataParam: any) => {
  279. let userInfoVal = userInfo.value;
  280. let { resp, resData } = await queryMemberCardList_V3(reqDataParam);
  281. if (resData.RespCode == "10000") {
  282. if (serviceType.value == 'addMember') {
  283. // 查询到的卡卡列表去重手机号
  284. let mList = common.unique(resp, "mobile");
  285. // 判断当前返回的手机号是否与填写的手机号一致
  286. if (reqData.value.userMobile != mList[0].mobile) {
  287. mobileList.value = mList;
  288. serviceType.value = "diMobile";
  289. return;
  290. }
  291. }
  292. if (serviceType.value == 'diMobile') {
  293. serviceType.value = 'addMember';
  294. showDiMobile.value = false;
  295. }
  296. let cList = resp;
  297. if (common.isNotEmpty(resp)) {
  298. userInfoVal.cardNum = resp.filter((item: any) => item.cardType == 1).length;
  299. userInfoVal.hosNum = resp.filter((item: any) => item.cardType == 14).length;
  300. userInfo.value = userInfoVal;
  301. cList = [];
  302. for (let item of resp) {
  303. if (item.cardType == 1) {
  304. cList.unshift(item);
  305. }
  306. if (item.cardType == 14) {
  307. cList.push(item);
  308. }
  309. }
  310. if (cList[0].cardType == 1) {
  311. cList[0].check = true;
  312. }
  313. }
  314. cardList.value = cList;
  315. }
  316. };
  317. /**
  318. * 选择默认就诊卡
  319. */
  320. const autoBindCard = (index: number) => {
  321. let cList = cardList.value;
  322. cList.forEach((item: any) => {
  323. item.check = false;
  324. });
  325. cList[index].check = true;
  326. cardList.value = cList;
  327. };
  328. /**
  329. * 选择就诊卡
  330. */
  331. const chooseCard = (index: number) => {
  332. checkedIndex.value = String(index);
  333. };
  334. /**
  335. * 当手机号不同时,选择手机号进行校验
  336. */
  337. const choiceMobile = (index: number) => {
  338. mobileIndex.value = index;
  339. };
  340. /**
  341. * 全部按钮
  342. */
  343. const jumpCheckReportForm = async (tag?: string) => {
  344. // var index = checkedIndex.value;
  345. let sType = serviceType.value;
  346. // let tagVal = tag;
  347. // 验证是否选择了亲友成员关系
  348. if (checkRelation()) return;
  349. // 添加就诊人
  350. let memberId = "";
  351. if (sType == 'addMember') {
  352. let { resp } = await addBaseMember_V3(reqData.value);
  353. if (common.isNotEmpty(resp)) {
  354. memberId = resp[0].memberId;
  355. addMemberSuccess(resp);
  356. }
  357. }
  358. // 人脸录入
  359. else if (sType == 'noCard_idCard') {
  360. // 建档
  361. if (tag == "createFile") {
  362. addMemberFile();
  363. } else {
  364. showAddCard.value = true;
  365. }
  366. }
  367. // 手机号不同
  368. else if (sType == "diMobile" || sType == 'diMemberName_face') {
  369. showDiMobile.value = true;
  370. }
  371. //添加健康卡
  372. if (pageType.value == "addHealthCard") {
  373. /**获取健康卡code 未授权会弹出授权框 */
  374. let wechatCode = await common.getAuthorize();
  375. let memberInfo = {
  376. memberId: memberId
  377. };
  378. uni.hideLoading();
  379. if (common.isNotEmpty(wechatCode)) {
  380. //如果已经授权
  381. app.globalData.wechatCode = wechatCode;
  382. //点击健康卡升级
  383. let param = '{ "MemberId": "' + memberInfo.memberId + '","WechatCode":"' + wechatCode + '","DefaultCardNo":"' + cardList.value[0].CardNo + '","DefaultCardType":"' + cardList.value[0].CardType + '"}';
  384. let { resData } = await updateToHealthCard_V2({
  385. 'data': common.desEncrypt(param, app.globalData.apiSecretKey)
  386. });
  387. uni.hideLoading();
  388. if (resData.RespCode == 10000) {
  389. //升级健康卡成功
  390. common.showToast('升级成功', () => {
  391. uni.navigateTo({
  392. url: '../memberList/memberList'
  393. });
  394. });
  395. }
  396. }
  397. }
  398. };
  399. const addMemberFile = async () => {
  400. let { resp } = await addBaseMember_V3(reqData.value);
  401. if (common.isNotEmpty(resp)) {
  402. common.showModal('建档成功', () => {
  403. addMemberSuccess(resp);
  404. });
  405. }
  406. };
  407. /**
  408. * 修改默认就诊卡
  409. */
  410. const setDefaultCard = async (memberId: string, cardInfo: any) => {
  411. let data = {
  412. memberId: memberId,
  413. cardNo: cardInfo.cardNo,
  414. cardType: cardInfo.cardType,
  415. encryptionStore: cardInfo.encryptionStore,
  416. };
  417. let res = await setDefaultClinicCard_V3(data);
  418. if (res.resData.RespCode == 10000) {
  419. // Success handling if needed
  420. }
  421. };
  422. /**
  423. * 获取输入框的值
  424. */
  425. const getInputVal = (e: any) => {
  426. let name = e.currentTarget.dataset.name;
  427. let val = e.detail.value;
  428. if (name === 'addCardNo') addCardNo.value = val;
  429. if (name === 'provingCode') provingCode.value = val;
  430. if (name === 'subMobile') subMobile.value = val;
  431. };
  432. // 通过卡号查询就诊人信息
  433. const clickCardBtn = async () => {
  434. // 添加就诊卡第一步
  435. if (step.value == 1) {
  436. if (common.isEmpty(addCardNo.value)) {
  437. common.showToast(redioCardType.value == '1' ? "请输入就诊卡号" : '请输入住院号');
  438. return;
  439. }
  440. let querData = {
  441. cardNo: addCardNo.value,
  442. cardType: redioCardType.value
  443. };
  444. let { resp } = await queryMemberByCard_V3(querData);
  445. if (common.isNotEmpty(resp)) {
  446. // 判断通过卡号 查询到的就诊信息,在通过姓名加手机号查询出来的信息大于1个人,让用户选择绑定那个人
  447. let cardListResp = resp.filter((item: any) => common.isNotEmpty(item.certNum));
  448. // 判断如果查询到是空 跳转添加界面补全患者信息
  449. if (common.isEmpty(cardListResp)) {
  450. common.goToUrl(`/pagesPersonal/st1/business/patientManagement/addMember/addMember?pageType=cardAddMember&queryBean=${encodeURIComponent(JSON.stringify(resp[0]))}`);
  451. } else {
  452. serviceType.value = 'addCard';
  453. step.value = 2;
  454. showAddCard.value = false;
  455. cardList.value = cardListResp;
  456. }
  457. }
  458. } else if (step.value == 2) {
  459. // 验证是否选择了亲友成员关系
  460. if (checkRelation()) return;
  461. showAddCard.value = true;
  462. step.value = 3;
  463. } else {
  464. if (common.isEmpty(pcId.value)) {
  465. common.showToast("请发送验证码");
  466. return;
  467. }
  468. if (common.isEmpty(provingCode.value)) {
  469. common.showToast("请输入验证码");
  470. return;
  471. }
  472. let querData = {
  473. memberId: cardList.value[changCardListIndex.value].memberId,
  474. cardEncryptionStore: cardList.value[changCardListIndex.value].encryptionStore,
  475. pcId: pcId.value,
  476. verificationCode: provingCode.value,
  477. relationCode: relationCodeList.value[relationCodeIndex.value!].dictValue
  478. };
  479. let res = await addBaseMemberByEncryptionStore_V3(querData);
  480. let resp = res.resp;
  481. if (common.isNotEmpty(resp)) {
  482. addMemberSuccess(resp);
  483. }
  484. }
  485. };
  486. /**
  487. * 手动添加就诊卡确定按钮操作
  488. */
  489. const clickMobileBtn = async () => {
  490. let MobileBoj = mobileList.value[mobileIndex.value];
  491. let frontNum = MobileBoj.mobile.substr(0, 3); //手机号前四位
  492. let afterNum = MobileBoj.mobile.substr(-4); //手机号后三位
  493. // 手机号不同
  494. if (step.value == 1) {
  495. if (common.isEmpty(subMobile.value)) {
  496. common.showModal('请输入手机号码中间4位');
  497. return;
  498. }
  499. let querData = {
  500. mobile: frontNum + subMobile.value + afterNum,
  501. cardEncryptionStore: MobileBoj.encryptionStore
  502. };
  503. let res = await checkMobile_V3(querData);
  504. if (res) {
  505. step.value = 2;
  506. // 发送手机验证码
  507. getProvingCode();
  508. }
  509. } else if (step.value == 2) {
  510. if (common.isEmpty(provingCode.value)) {
  511. common.showToast("请输入验证码");
  512. return;
  513. }
  514. if (await verifyCode()) return;
  515. let querData = {
  516. ...reqData.value,
  517. userMobile: frontNum + subMobile.value + afterNum
  518. };
  519. queryCardList(querData);
  520. }
  521. };
  522. /**
  523. * 发送手机验证码
  524. */
  525. const getProvingCode = async () => {
  526. let encryptionStore = '';
  527. let mobile = '';
  528. if (serviceType.value == "diMobile") {
  529. encryptionStore = mobileList.value[mobileIndex.value].encryptionStore;
  530. mobile = mobileList.value[mobileIndex.value].mobile;
  531. } else {
  532. encryptionStore = cardList.value[0].encryptionStore;
  533. mobile = cardList.value[0].mobile;
  534. }
  535. let queryData = {
  536. mobile: mobile,
  537. cardEncryptionStore: encryptionStore
  538. };
  539. let res = await sendVerificationCode_V3(queryData);
  540. let resp = res.resp;
  541. if (!common.isEmpty(resp)) {
  542. pcId.value = resp[0].pcId;
  543. common.showModal('发送成功!');
  544. // Using a local timer ref or variable
  545. if (timer) clearInterval(timer);
  546. seconds.value = 60;
  547. timer = setInterval(() => {
  548. seconds.value--;
  549. if (seconds.value <= 0) {
  550. clearInterval(timer);
  551. }
  552. }, 1000);
  553. // publicFn.countDown.call(this, timer) // Legacy call, replaced with local logic or adapted
  554. }
  555. };
  556. // 检验验证码
  557. const verifyCode = async () => {
  558. return new Promise(async (resolve, reject) => {
  559. if (common.isEmpty(pcId.value)) {
  560. common.showModal('请先获取验证码');
  561. resolve(true); // Should block if no code? Original resolved true which means "stop" in caller?
  562. // In caller: if (await this.checkVerificationCode_V3()) return
  563. // So returning true stops execution.
  564. } else {
  565. let reqData = {
  566. pcId: pcId.value || '',
  567. verificationCode: provingCode.value,
  568. };
  569. let { resp, resData } = await checkVerificationCode_V3(reqData);
  570. if (resData.RespCode == 10000) {
  571. resolve(false); // Success, don't stop
  572. } else {
  573. resolve(true); // Fail, stop
  574. }
  575. }
  576. });
  577. };
  578. /**
  579. * 关闭手动添加就诊卡/手机号不同校验弹窗
  580. */
  581. const hideAddCardModel = () => {
  582. // 为通过卡号添加 且为第二步
  583. if (serviceType.value == 'addCard') {
  584. if (step.value == 3) {
  585. showAddCard.value = false;
  586. step.value = 2;
  587. } else {
  588. common.navigateBack(1);
  589. }
  590. return;
  591. }
  592. step.value = 1;
  593. showAddCard.value = false;
  594. showDiMobile.value = false;
  595. };
  596. // radio单选选中赋值
  597. const radioChange = (type: string, e: any) => {
  598. if (type === 'redioCardType') redioCardType.value = e.detail.value;
  599. if (type === 'changCardListIndex') changCardListIndex.value = e.detail.value;
  600. };
  601. // 添加人成功统一调用
  602. const addMemberSuccess = async (res: any) => {
  603. let querData = {
  604. memberId: res[0].memberId
  605. };
  606. // 设置默认就诊人
  607. let { resp, resData } = await setDefaultMemberV3(querData);
  608. if (resData.RespCode == "10000") {
  609. let cList = cardList.value;
  610. // 判断是否选中默认就诊卡
  611. for (let i = 0; i < cList.length; i++) {
  612. // 有选中默认就诊卡,调用设置默认就诊卡接口
  613. if (cList[i].check) {
  614. setDefaultCard(res[0].memberId, cList[i]);
  615. }
  616. }
  617. // 添加成功并且设置默认人完成后 重新查询并保存全局就诊人数据信息
  618. await usePreserMember();
  619. // 判断是否有存储跳转地址
  620. if (app.globalData.toUrl) {
  621. // 判断为(selecteCardOrHos)选择患者界面进入添加
  622. if (app.globalData.isSelectAdd) {
  623. app.globalData.isSelectAdd = false;
  624. common.navigateBack(1);
  625. return;
  626. }
  627. let member = await useGetDefaultMember({
  628. cardType: app.globalData.cardType,
  629. url: app.globalData.toUrl
  630. });
  631. if (common.isNotEmpty(member)) {
  632. common.goToUrl(app.globalData.toUrl, {
  633. skipWay: "redirectTo"
  634. });
  635. }
  636. /**如果是成功 并且全局存了url变量 跳转到全局URL */
  637. } else {
  638. common.navigateBack(1);
  639. }
  640. }
  641. };
  642. // 亲友关系选择
  643. const selectItem = (type: string, e: any, index?: number) => {
  644. if (type == 'open') {
  645. relationIndex = relationCodeIndex.value;
  646. relationsShow.value = !relationsShow.value;
  647. }
  648. if (type == 'cancel') {
  649. relationCodeIndex.value = relationIndex;
  650. relationsShow.value = false;
  651. }
  652. if (type == 'select' && index !== undefined) {
  653. relationCodeIndex.value = index;
  654. }
  655. };
  656. // 校验是否选择亲友关系
  657. const checkRelation = () => {
  658. if (relationCodeIndex.value === null) {
  659. common.showModal("请先选择亲友成员与本人关系");
  660. return true;
  661. }
  662. reqData.value.relationCode = relationCodeList.value[relationCodeIndex.value].dictValue;
  663. return false;
  664. };
  665. </script>
  666. <style lang="scss" scoped>
  667. .container {
  668. padding: 30upx;
  669. box-sizing: border-box;
  670. overflow: auto;
  671. }
  672. .userInfo_box {
  673. background: white;
  674. padding: 0 30upx;
  675. box-sizing: border-box;
  676. border-radius: 24upx;
  677. margin-bottom: 30upx;
  678. }
  679. .userInfo_list {
  680. height: 110upx;
  681. display: flex;
  682. flex-direction: row;
  683. justify-content: space-between;
  684. align-items: center;
  685. }
  686. .userInfo_list > text:nth-child(1) {
  687. width: 35%;
  688. font-size: 32upx;
  689. color: #8A8A99;
  690. }
  691. .userInfo_list > text.userInfo_listRela{
  692. width: 30%;
  693. }
  694. .userInfo_list > text:nth-child(2) {
  695. width: 60%;
  696. font-size: 32upx;
  697. font-weight: bold;
  698. color: #222326;
  699. }
  700. .userInfo_list > view.relationCode_text{
  701. width: 70%;
  702. font-size: 28upx;
  703. color: var(--dominantColor);
  704. position: relative;
  705. }
  706. /* 无卡 */
  707. .no_card_tips_box {
  708. padding: 36upx 30upx;
  709. box-sizing: border-box;
  710. background: white;
  711. border-radius: 24upx;
  712. margin-bottom: 30upx;
  713. }
  714. .no_card_tips_box .text {
  715. font-size: 28upx;
  716. color: #62626D;
  717. margin-bottom: 14upx;
  718. }
  719. .no_card_tips_box .view {
  720. font-size: 32upx;
  721. font-weight: bold;
  722. color: #222326;
  723. margin-bottom: 21upx;
  724. line-height: 44upx;
  725. }
  726. .no_card_tips_box .mb0{
  727. margin-bottom: 0;
  728. }
  729. /* ====== */
  730. .cardList_box {
  731. background: white;
  732. padding: 30upx;
  733. box-sizing: border-box;
  734. border-radius: 24upx;
  735. }
  736. .cardList_topText{
  737. font-size: 32upx;
  738. font-family: PingFang SC;
  739. font-weight: bold;
  740. margin: 6upx 3upx 0 ;
  741. line-height: 48upx;
  742. margin-bottom: 35upx;
  743. }
  744. .card_item {
  745. padding: 35upx 30upx;
  746. box-sizing: border-box;
  747. justify-content: space-between;
  748. box-shadow: 0px 0px 58px 0px rgba(0,0,0,0.05);
  749. margin-bottom: 24upx;
  750. border-radius: 20upx;
  751. }
  752. .card_item .member_item_info{
  753. align-items: flex-start;
  754. }
  755. .card_item .member_item_info .info_memberMsg_name {
  756. font-size: 32upx;
  757. font-family: PingFang SC;
  758. font-weight: 800;
  759. color: #222326;
  760. margin-bottom: 21upx;
  761. }
  762. .card_item .member_item_info .info_memberCard {
  763. font-size: 28upx;
  764. font-family: PingFang SC;
  765. color: #62626D;
  766. }
  767. .set_default text{
  768. font-size: 28upx;
  769. font-family: PingFang SC;
  770. color: #979AA8;
  771. }
  772. .set_default image{
  773. width: 40upx;
  774. height: 40upx;
  775. margin-left: 16upx;
  776. }
  777. .choice_card_box {
  778. width: 100%;
  779. padding: 0 30upx;
  780. box-sizing: border-box;
  781. box-shadow: 0px 0px 58px 0px rgba(0,0,0,0.05);
  782. border-radius: 20upx;
  783. justify-content: space-between;
  784. }
  785. .choice_card_item_box {
  786. padding: 30upx 0;
  787. justify-content: space-between;
  788. }
  789. .choice_card_item_box:last-child::before {
  790. border-top: 0;
  791. }
  792. .choice_card_info_box {
  793. align-items: flex-start;
  794. }
  795. .choice_card_info_box text:nth-child(1) {
  796. font-size: 32upx;
  797. color: #222326;
  798. margin-bottom: 27upx;
  799. }
  800. .choice_card_info_box text:nth-child(2) {
  801. color: #8A8A99;
  802. }
  803. .choice_card_box image {
  804. width: 42upx;
  805. height: 42upx;
  806. }
  807. .footer_btn_box {
  808. width: 100%;
  809. margin-top: 80upx;
  810. }
  811. .public_btn {
  812. margin-bottom: 32upx;
  813. }
  814. .query_card_info {
  815. width: 100%;
  816. padding: 36upx 30upx;
  817. box-sizing: border-box;
  818. border-radius: 20upx;
  819. box-shadow: 0px 0px 40px 0px rgba(0,0,0,0.06);
  820. align-items: flex-start;
  821. }
  822. .query_card_info text:nth-child(1) {
  823. font-size: 32upx;
  824. color: #222326;
  825. margin-bottom: 16upx;
  826. }
  827. .query_card_info text:nth-child(2) {
  828. font-size: 28upx;
  829. color: #8A8A99;
  830. margin-bottom: 0 !important;
  831. }
  832. .query_member_mobile text:nth-child(1) {
  833. margin-bottom: 16upx;
  834. }
  835. .query_member_mobile text:nth-child(2) {
  836. margin-bottom: 34upx;
  837. }
  838. /* 添加就诊卡 */
  839. .add_card_mask {
  840. width: 100%;
  841. height: 100%;
  842. background-color: rgba(0,0,0,0.6);
  843. position: fixed;
  844. top: 0;
  845. left: 0;
  846. }
  847. .add_card_box {
  848. width: 620upx;
  849. padding: 48upx;
  850. box-sizing: border-box;
  851. background: white;
  852. border-radius: 20upx;
  853. }
  854. .add_card_box .addCardMask_radio{
  855. margin-top: 28upx;
  856. margin-right: 20upx;
  857. }
  858. .add_card_title {
  859. font-size: 36upx;
  860. font-weight: bold;
  861. color: #222326;
  862. }
  863. .add_card_tips {
  864. font-size: 28upx;
  865. color: #8A8A99;
  866. margin-top: 27upx;
  867. }
  868. .add_card_input {
  869. width: 100%;
  870. height: 100upx;
  871. line-height: 100upx;
  872. font-size: 32upx;
  873. color: #8A8A99;
  874. padding-left: 53upx;
  875. box-sizing: border-box;
  876. background: #F0F1F6;
  877. margin-top: 40upx;
  878. border-radius: 100upx;
  879. }
  880. .add_card_footer_btn {
  881. width: 100%;
  882. height: 88upx;
  883. margin-top: 81upx;
  884. justify-content: space-between;
  885. }
  886. .add_card_footer_btn text {
  887. width: 49%;
  888. line-height: 88upx;
  889. font-size: 34upx;
  890. font-weight: bold;
  891. color: #43434A;
  892. text-align: center;
  893. border-radius: 88upx;
  894. }
  895. .add_card_footer_btn text:nth-child(1) {
  896. border: 1upx solid #E6E6E6;
  897. }
  898. .color62626D{
  899. color: #62626D;
  900. }
  901. .userInfoTow{
  902. margin-bottom: 30upx;
  903. }
  904. .userInfoTow_text{
  905. font-size: 28upx;
  906. font-family: PingFang SC;
  907. font-weight: 500;
  908. line-height: 45upx;
  909. }
  910. .userInfoTow_box{
  911. background: #FFFFFF;
  912. box-shadow: 0upx 0upx 58upx 0upx rgba(0,0,0,0.05);
  913. border-radius: 20upx;
  914. margin-top: 30upx;
  915. padding: 30upx;
  916. }
  917. .userInfoTow_boxName{
  918. font-size: 32upx;
  919. font-weight: bold;
  920. }
  921. .userInfoTow_boxinfo{
  922. padding: 30upx 30upx 0;
  923. box-sizing: border-box;
  924. margin-top: 20upx;
  925. background: #F8F8FA;
  926. border-radius: 10upx;
  927. }
  928. .userInfoTow_boxinfo_text{
  929. padding-bottom: 30upx;
  930. font-size: 28upx;
  931. font-family: PingFang SC;
  932. color: #62626d;
  933. }
  934. /* 弹窗 */
  935. .mainScreenBox {
  936. width: 100%;
  937. max-height: 800upx;
  938. background: white;
  939. border-radius: 24upx 24upx 0 0;
  940. position: fixed;
  941. /* top: 100upx; */
  942. left: 0;
  943. bottom: 0;
  944. z-index: 15;
  945. }
  946. .cententBox {
  947. max-height: 640upx;
  948. padding: 40upx 30upx 0;
  949. box-sizing: border-box;
  950. overflow: auto;
  951. }
  952. .screenTitle {
  953. display: inline-block;
  954. font-weight: 800;
  955. font-size: 44upx;
  956. color: #333;
  957. margin-bottom: 36upx;
  958. }
  959. .screenList {
  960. display: flex;
  961. flex-direction: row;
  962. justify-content: flex-start;
  963. align-items: center;
  964. flex-wrap: wrap;
  965. }
  966. .screenList text {
  967. display: inline-block;
  968. width: 30%;
  969. line-height: 80upx;
  970. margin-right: 5%;
  971. margin-bottom: 30upx;
  972. font-size: 40upx;
  973. text-align: center;
  974. color: #333;
  975. padding: 0 20upx;
  976. background: #F5F7F7;
  977. border-radius: 80upx;
  978. }
  979. .active_screen {
  980. color: var(--dominantColor) !important;
  981. border: 1px solid var(--dominantColor);
  982. }
  983. .screenList text:nth-child(3n) {
  984. margin-right: 0upx;
  985. }
  986. </style>