authorizeDetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <view class="public_tip">
  5. <view class="public_tip_box displayFlexRow">
  6. <image class="tips_icon" :src="iconUrl.spot_left" />
  7. <text class="colorCustom">温馨提示</text>
  8. <image class="tips_icon" :src="iconUrl.spot_right" />
  9. </view>
  10. <view class="public_tip_text">1.普通授权服务:系统默认只对个别基础服务进行授权操作。 2、人脸核身出示,接受查验,凭绿码方可进入院区。针对老年人等不使用、</view>
  11. <view class="public_tip_text">2.高级授权服务:开启高级授权服务,使用者将可 使用您的信息进行就诊业务操作,以及查阅您的全 部隐私档案数据,开启高级授权,需</view>
  12. <view class="public_tip_text">3.解除绑定:将把您的档案信息及授权服务,从对方亲情成员列表中移除。</view>
  13. </view>
  14. <view class="authoBox_info">
  15. <view class="authoBox_infoName">姓名:{{ authorizeInfo.member.memberName }}</view>
  16. <view class="authoBox_infoTxt">手机号:{{ authorizeInfo.member.mobile }}</view>
  17. <view class="authoBox_infoTxt">身份证:{{ authorizeInfo.member.idCardNo }}</view>
  18. <!-- 占位 -->
  19. <view class="authoBox_infoBlank"></view>
  20. <view class="authoBox_infoTxt"> 绑定时间:{{ authorizeInfo.createTime }}</view>
  21. <view class="authoBox_infoTxt">授权方式:{{ authorizeInfo.bindModeCodeName }}</view>
  22. <view class="authoBox_infoTag displayFlexLeft">
  23. <view class="tag">
  24. <text class="bg backgroundCustom "></text>
  25. <text class="text colorCustom">{{ authorizeInfo.relationCodeName }}</text>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="floot" v-if="authorizeInfo.memberAccountAuth.seniorOpen == 0">
  30. <view class="title">普通授权服务:</view>
  31. <view class="flootBox">
  32. <view class="flootBox_cont displayFlexBetween border_bottom">
  33. <view>预约挂号</view>
  34. <view class="displayFlexLeft">
  35. <switch color="var(--dominantColor)"
  36. :checked="authorizeInfo.memberAccountAuth.bookOpen == 1" @change="switchChangeFn($event, 'bookOpen')"
  37. />
  38. <picker class="dataPicker displayFlexLeft" mode="date" :start="pickerStart"
  39. @change="switchChangeFn($event, 'bookTime')"
  40. v-if="authorizeInfo.memberAccountAuth.bookOpen == 1">
  41. <view class="picker textTag">{{ authorizeInfo.memberAccountAuth.bookTime || '永久授权' }}
  42. </view>
  43. <image v-if="authorizeInfo.memberAccountAuth.bookTime" class="icon_commonDel"
  44. :src="iconUrl.icon_commonDel" @click.stop="clearData('bookTime')"></image>
  45. <image v-if="!authorizeInfo.memberAccountAuth.bookTime" class="public_right_img "
  46. :src="iconUrl.icon_right"></image>
  47. </picker>
  48. </view>
  49. </view>
  50. <view class="flootBox_cont displayFlexBetween">
  51. <view>充值缴费</view>
  52. <view class="displayFlexLeft">
  53. <switch color="var(--dominantColor)"
  54. :checked="authorizeInfo.memberAccountAuth.chargeOpen == 1"
  55. @change="switchChangeFn($event, 'chargeOpen')" />
  56. <picker class="dataPicker displayFlexLeft" mode="date" :start="pickerStart"
  57. @change="switchChangeFn($event, 'chargeTime')"
  58. v-if="authorizeInfo.memberAccountAuth.chargeOpen == 1">
  59. <view class="picker textTag">{{ authorizeInfo.memberAccountAuth.chargeTime || '永久授权' }}
  60. </view>
  61. <image v-if="authorizeInfo.memberAccountAuth.chargeTime" class="icon_commonDel"
  62. :src="iconUrl.icon_commonDel" @click.stop="clearData('chargeTime')">
  63. </image>
  64. <image v-if="!authorizeInfo.memberAccountAuth.chargeTime" class="public_right_img "
  65. :src="iconUrl.icon_right"></image>
  66. </picker>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="floot">
  72. <view class="title">高级授权服务:</view>
  73. <view class="flootBox">
  74. <view class="flootBox_cont displayFlexBetween">
  75. <view>开启高级授权</view>
  76. <view class="displayFlexLeft">
  77. <switch color="var(--dominantColor)"
  78. :checked="authorizeInfo.memberAccountAuth.seniorOpen == 1"
  79. @change="switchChangeFn($event, 'seniorOpen')" />
  80. <picker class="dataPicker displayFlexLeft" mode="date" :start="pickerStart"
  81. @change="switchChangeFn($event, 'seniorTime')"
  82. v-if="authorizeInfo.memberAccountAuth.seniorOpen == 1">
  83. <view class="picker textTag">{{ authorizeInfo.memberAccountAuth.seniorTime || '永久授权' }}
  84. </view>
  85. <image v-if="authorizeInfo.memberAccountAuth.seniorTime" class="icon_commonDel"
  86. :src="iconUrl.icon_commonDel" @click.stop="clearData('seniorTime')">
  87. </image>
  88. <image v-if="!authorizeInfo.memberAccountAuth.seniorTime" class="public_right_img "
  89. :src="iconUrl.icon_right"></image>
  90. </picker>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="floot">
  96. <view class="title">解除绑定:</view>
  97. <view class="flootBox">
  98. <view class="flootBox_cont displayFlexBetween">
  99. <view>解除亲情成员的绑定关系</view>
  100. <view class="operateBtn border boderColorCustom" @click="unbind">解除</view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </template>
  107. <script lang="ts" setup>
  108. import { ref } from 'vue';
  109. import { useOnLoad } from '@/hook';
  110. import { common } from '@/utils';
  111. import icon from '@/utils/icon';
  112. import { updateAccountAuthList as updateAccountAuthListApi, backstageDelUserMember_V3 } from '@/pagesPersonal/service/patientManagement';
  113. const app = getApp();
  114. const iconUrl = ref(icon)
  115. const authorizeInfo = ref<any>({
  116. member: {},
  117. memberAccountAuth: {}
  118. });
  119. const pickerStart = ref(common.getDate());
  120. const myInfo = ref<any>({});
  121. useOnLoad((options) => {
  122. if (options.authorizeInfo) {
  123. authorizeInfo.value = JSON.parse(decodeURIComponent(options.authorizeInfo));
  124. }
  125. myInfo.value = app.globalData.myInfo || {};
  126. });
  127. // 点击开关与时间选择
  128. const switchChangeFn = (e: any, type: string) => {
  129. let typeValue = e.detail.value;
  130. // 如果是 boolean 类型(switch 组件),转换为 0 或 1
  131. if (typeof typeValue === 'boolean') {
  132. typeValue = typeValue ? 1 : 0;
  133. }
  134. let msgObj: any = {
  135. bookOpen: `${typeValue ? '开启' : '关闭'}普通授权服务-预约挂号后,【${authorizeInfo.value.member.memberName}】将${typeValue ? '可以' : '无法'}为您进行该业务代理操作,是否确定${typeValue ? '开启' : '关闭'}?`,
  136. chargeOpen: `${typeValue ? '开启' : '关闭'}普通授权服务-充值缴费后,【${authorizeInfo.value.member.memberName}】将${typeValue ? '可以' : '无法'}为您进行该业务代理操作,是否确定${typeValue ? '开启' : '关闭'}?`,
  137. seniorOpen: `${typeValue ? '开启' : '关闭'}高级授权后,【${authorizeInfo.value.member.memberName}】将${typeValue ? '获得' : '失去'}所有业务代理操作,是否确定${typeValue ? '开启' : '关闭'}?`,
  138. };
  139. if (common.isNotEmpty(msgObj[type])) {
  140. common.showModal(msgObj[type], () => {
  141. updateAccountAuthList(type, typeValue);
  142. }, {
  143. title: '温馨提示', cancelText: '取消', callBack: () => {
  144. // 如果取消,需要还原 switch 的状态
  145. // 这里简单处理,实际上 switch 组件在 value 改变前已经变了,如果需要严格回滚可能需要 nextTick 或者重新赋值
  146. // 但原代码逻辑是取消后重置数据
  147. authorizeInfo.value.memberAccountAuth[type] = typeValue ? 0 : 1;
  148. }
  149. });
  150. } else {
  151. updateAccountAuthList(type, typeValue);
  152. }
  153. };
  154. // 清空时间
  155. const clearData = (type: string) => {
  156. updateAccountAuthList(type, '');
  157. };
  158. // 更新授权信息
  159. const updateAccountAuthList = async (type: string, typeValue: any) => {
  160. let { resData } = await updateAccountAuthListApi({
  161. accountSn: authorizeInfo.value.memberAccountAuth.accountSn,
  162. memberId: authorizeInfo.value.memberAccountAuth.memberId,
  163. [type]: typeValue
  164. });
  165. if (resData.RespCode == '10000') {
  166. common.showModal('修改成功');
  167. authorizeInfo.value.memberAccountAuth[type] = typeValue;
  168. } else {
  169. // 失败回滚?原逻辑:authorizeInfo.memberAccountAuth[type] = authorizeInfo.memberAccountAuth[type]
  170. // 实际上 Vue 双向绑定下可能不需要手动赋值回去,除非之前为了 UI 响应已经改了
  171. }
  172. };
  173. // 解除绑定
  174. const unbind = async () => {
  175. common.showModal(`解除对【${authorizeInfo.value.member.memberName}】绑定后,亲友成员将无法再看到绑定的就诊人信息!`, async () => {
  176. let { resData } = await backstageDelUserMember_V3({
  177. accountSn: authorizeInfo.value.memberAccountAuth.accountSn,
  178. memberId: authorizeInfo.value.memberAccountAuth.memberId,
  179. });
  180. if (resData.RespCode == '10000') {
  181. common.showModal('解除成功', () => {
  182. common.navigateBack(1);
  183. });
  184. }
  185. }, { title: "温馨提示", cancelText: '返回' });
  186. };
  187. </script>
  188. <style lang="scss" scoped>
  189. .public_tip {
  190. border-radius: 24upx;
  191. background: white;
  192. margin: 30upx;
  193. }
  194. .public_tip .tips_icon {
  195. width: 75upx;
  196. height: 23upx;
  197. }
  198. .public_tip .public_tip_box {
  199. margin-bottom: 48upx;
  200. }
  201. .public_tip .public_tip_box text {
  202. font-size: 32upx;
  203. font-weight: bold;
  204. padding: 0 24upx;
  205. box-sizing: border-box;
  206. color: #222326;
  207. }
  208. .public_tip .public_tip_text {
  209. font-size: 28upx;
  210. color: #62626D;
  211. padding-bottom: 28upx;
  212. line-height: 44upx;
  213. }
  214. .public_tip .public_tip_text:last-child {
  215. padding-bottom: 0;
  216. }
  217. .authoBox_info {
  218. position: relative;
  219. border-radius: 24upx;
  220. background: white;
  221. margin: 30upx;
  222. border-radius: 10upx;
  223. padding: 19upx;
  224. }
  225. .authoBox_info .authoBox_infoName {
  226. font-weight: bold;
  227. font-size: 30upx;
  228. color: #212326;
  229. margin: 20upx 0 30upx;
  230. }
  231. .authoBox_info .authoBox_infoTxt {
  232. font-size: 28upx;
  233. color: #4D4D53;
  234. margin-bottom: 19upx;
  235. }
  236. .authoBox_infoBlank {
  237. height: 40upx;
  238. }
  239. .authoBox_info .authoBox_infoTag {
  240. position: absolute;
  241. right: 30upx;
  242. top: 38upx;
  243. }
  244. .authoBox_info .authoBox_infoTag .tag {
  245. padding: 4upx 8upx;
  246. font-size: 22upx;
  247. margin-left: 8upx;
  248. position: relative;
  249. }
  250. .authoBox_info .authoBox_infoTag .tag .bg {
  251. opacity: .1;
  252. width: 100%;
  253. height: 100%;
  254. position: absolute;
  255. top: 0;
  256. left: 0;
  257. }
  258. .floot {
  259. margin: 30upx;
  260. }
  261. .floot .title {
  262. font-weight: bold;
  263. font-size: 28upx;
  264. color: #212326;
  265. margin-bottom: 30upx;
  266. }
  267. .flootBox {
  268. background: #fff;
  269. border-radius: 20upx;
  270. padding: 0 30upx;
  271. }
  272. .flootBox_cont {
  273. height: 110upx;
  274. }
  275. .operateBtn {
  276. width: 137upx;
  277. height: 60upx;
  278. line-height: 60upx;
  279. text-align: center;
  280. font-size: 26upx;
  281. font-weight: initial;
  282. border-radius: 30upx;
  283. color: var(--dominantColor);
  284. }
  285. .dataPicker {
  286. height: 45upx;
  287. line-height: 45upx;
  288. border-radius: 4upx;
  289. border: 1upx solid #D5D5D5;
  290. padding: 0 42upx 0 18upx;
  291. margin-left: 15upx;
  292. position: relative;
  293. }
  294. .dataPicker .icon_commonDel {
  295. width: 20upx;
  296. height: 20upx;
  297. position: absolute;
  298. right: 14upx;
  299. top: 50%;
  300. margin-top: -10upx;
  301. z-index: 10;
  302. }
  303. .dataPicker .public_right_img {
  304. right: 14upx;
  305. }
  306. </style>