patientInformationInfo.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. <template>
  2. <view class="patientInformationInfo" v-if="Object.keys(infoDATA).length > 0">
  3. <view class="page_head">
  4. <view class="title">{{ infoDATA.patientName }}<text class="patientCode">{{ infoDATA.residenceNo }}({{ infoDATA.bedNum }})</text></view>
  5. <view class="info">
  6. <view class="bedNum" v-if="infoDATA.tripTypeDTO">
  7. <text class="info_h">陪检方式</text>
  8. <text class="info_b">{{ infoDATA.tripTypeDTO ? infoDATA.tripTypeDTO.inspectMode : '' }}</text>
  9. </view>
  10. <view :class="(infoDATA.careLevel || infoDATA.illnessState)?'bedNum':'waitingCount'">
  11. <text class="info_h">待检查数</text>
  12. <text class="info_b">{{ infoDATA.watingCount }}</text>
  13. </view>
  14. <view class="bedNum" v-if="infoDATA.careLevel">
  15. <text class="info_h">护理等级</text>
  16. <text class="info_b">{{ infoDATA.careLevel.name }}</text>
  17. </view>
  18. <view class="waitingCount" v-if="infoDATA.illnessState">
  19. <text class="info_h">病情级别</text>
  20. <text class="info_b">{{ infoDATA.illnessState.name }}</text>
  21. </view>
  22. </view>
  23. <view class="remark">
  24. <text class="remarkTitle">注意事项:</text><text class="remarkInfo">{{infoDATA.remark}}</text>
  25. </view>
  26. </view>
  27. <scroll-view v-if="!isEmpty" scroll-y class="scrollContent">
  28. <view class="page_item" v-for="(inspects, key, index) in infoDATA.inspectListMap" :key="key">
  29. <view class="splitLine">
  30. <view class="splitLineFlex">
  31. <view class="splitLineBox"></view>
  32. </view>
  33. <view>{{key}}</view>
  34. <view class="splitLineFlex">
  35. <view class="splitLineBox"></view>
  36. </view>
  37. </view>
  38. <checkbox-group @change="checkboxChange($event, key)">
  39. <view class="page_item_info" :class="{mt0: i === 0}" v-for="(item, i) in inspects" :key="item.id">
  40. <label class="page_item_info_title" style="display: inline-block;width: 100%;">
  41. <checkbox color="#49B856" :value="item.id + ''" :checked="item.checked" />
  42. 检查项目:<text class="bold">{{ item.inspectName }}</text></label>
  43. <view class="page_item_info_title"><text :class="{red: !item.execDept}">检查科室:</text><text>{{ item.execDept ? item.execDept.dept : "" }}<text class="newicon newicon-weibiaoti2010104 fz28" @click="changeExecDept(item)" v-if="item.inspectState.value == 1 || item.inspectState.value == 30"></text></text></view>
  44. <view class="page_item_info_title btn row">
  45. <view><text :class="{red: !item.yyTime}">预约时间:</text><text>{{ item.yyTime | filterSecondDate }}</text><text v-if="item.reservationNumber">({{ item.reservationNumber }})</text><text class="newicon newicon-weibiaoti2010104" @click="changeYyTime(item)" v-if="item.inspectState.value == 1 || item.inspectState.value == 30"></text></view>
  46. </view>
  47. <view class="page_item_info_title row">
  48. <view>是否紧急:<text :class="{red:item.priority===1||item.priority==='1'}">{{ (item.priority===1||item.priority==='1')?'是':'否' }}</text></view>
  49. <view>状态:<text v-if="item.inspectState">{{ item.inspectState.name }}</text></view>
  50. </view>
  51. <view class="buildOrder" @click="build(item)" v-if="!item.gdId&&(item.inspectState.value==1||item.inspectState.value==30)">建单</view>
  52. </view>
  53. </checkbox-group>
  54. </view>
  55. </scroll-view>
  56. <view v-if="isEmpty" class="zwsj">
  57. <image class="zwsj-img" mode="widthFix" src="../../static/img/zanwushuju.png"></image>
  58. <view class="zwsj-txt">暂无检查信息</view>
  59. </view>
  60. <view class="page_item_btns">
  61. <view class="page_item_btn" hover-class="seimin-btn-hover" @click="buildOrders()">批量陪检</view>
  62. <view class="toolbar" @click="Scanning()">
  63. <text class="toolbar-icon newicon newicon-saoma"></text>
  64. <text class="toolbar-sao">扫一扫</text>
  65. </view>
  66. </view>
  67. <!-- 弹窗 -->
  68. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  69. @ok="ok" @cancel="cancel" @know="know" :operate="models.operate"></showModel>
  70. <!-- 弹窗 -->
  71. <inspectRemoveModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content" @know="know1" :operate="models1.operate" @ok="ok1" @cancel="cancel1" :yy="currentInspect.yyTime"></inspectRemoveModel>
  72. <!-- 弹窗 -->
  73. <inspectExecDeptModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content" @know="know2" :operate="models2.operate" @ok="ok2" @cancel="cancel2" :execDeptList="currentInspect.inspectCheckType && currentInspect.inspectCheckType.deptList" :execDeptId="currentInspect.execDeptId"></inspectExecDeptModel>
  74. </view>
  75. </template>
  76. <script>
  77. import {
  78. get,
  79. post,
  80. SM,
  81. webHandle
  82. } from "../../http/http.js";
  83. export default {
  84. data() {
  85. return {
  86. currentInspect: {},
  87. SMFlag: true,
  88. isEmpty: true,
  89. options: {},
  90. infoDATA: {},
  91. // 弹窗model1
  92. models1: {
  93. disjunctor: false,
  94. },
  95. // 弹窗model1
  96. models2: {
  97. disjunctor: false,
  98. },
  99. // 建单的对象
  100. jdItem: [],
  101. // 弹窗model
  102. models: {
  103. disjunctor: false,
  104. },
  105. };
  106. },
  107. methods: {
  108. // 选择楼栋
  109. checkboxChange: function(e, key) {
  110. var dataList = this.infoDATA.inspectListMap[key],
  111. values = e.detail.value;
  112. for (var i = 0, lenI = dataList.length; i < lenI; ++i) {
  113. const item = dataList[i]
  114. if (values.includes(item.id + '')) {
  115. this.$set(item, 'checked', true)
  116. } else {
  117. this.$set(item, 'checked', false)
  118. }
  119. }
  120. },
  121. // 批量陪检
  122. buildOrders(){
  123. let list = Object.values(this.infoDATA.inspectListMap).flat().filter(v => v.checked);
  124. console.log(list);
  125. if(list.length){
  126. // 只要有一个没有检查科室
  127. let inspectDTO = list.find(v => !v.execDept);
  128. if(inspectDTO){
  129. this.models = {
  130. disjunctor: true,
  131. title: "提示",
  132. content: `<span class="red">${inspectDTO.inspectName || ''}</span>没有检查科室,不能建单`,
  133. icon: "warn",
  134. operate: {
  135. know: "返回",
  136. },
  137. };
  138. return;
  139. }
  140. this.jdItem = list;
  141. this.models = {
  142. disjunctor: true,
  143. title: "提示",
  144. content: `您选择<span class="red">${this.infoDATA.patientName || ""}</span>患者<span class="red">${list.length}</span>项检查,是否确认建单?`,
  145. icon: "warn",
  146. operate: {
  147. ok: "确定",
  148. cancel: "取消",
  149. },
  150. };
  151. }else{
  152. uni.showToast({
  153. icon: "none",
  154. title: "至少选择一个检查!",
  155. });
  156. }
  157. },
  158. // 建单
  159. build(data) {
  160. console.log(data);
  161. if(!data.execDept){
  162. this.models = {
  163. disjunctor: true,
  164. title: "提示",
  165. content: `<span class="red">${data.inspectName || ''}</span>没有检查科室,不能建单`,
  166. icon: "warn",
  167. operate: {
  168. know: "返回",
  169. },
  170. };
  171. return;
  172. }
  173. this.jdItem = [data];
  174. this.models = {
  175. disjunctor: true,
  176. title: "提示",
  177. content: `您即将创建<span class="red">${data.patientName || ""}</span>患者前往<span class="red">${ data.execDept ? data.execDept.dept : "" }</span>进行<span class="red">${data.inspectName || ""}</span>检查,您确认吗?`,
  178. icon: "warn",
  179. operate: {
  180. ok: "确定",
  181. cancel: "取消",
  182. },
  183. };
  184. },
  185. //建单后返回
  186. know() {
  187. this.models.disjunctor = false;
  188. this.getInfo(this.infoDATA.patientCode);
  189. },
  190. //建单确定
  191. ok() {
  192. this.models.disjunctor = false;
  193. let postData = {
  194. deptId: this.infoDATA.department.id
  195. };
  196. let taskId;
  197. uni.showLoading({
  198. title: "加载中",
  199. mask: true,
  200. });
  201. post("/nurse/getDeptTaskType", postData).then((result) => {
  202. if (result.status == 200) {
  203. let obj = result.data.allTaskTypes.filter(
  204. (item) => item.associationType.value == "inspect"
  205. );
  206. if (obj.length) {
  207. taskId = obj[0].id;
  208. let postData = {
  209. workOrder: {
  210. sourceId: 4,
  211. taskType: {
  212. id: taskId,
  213. isHalfInspect: obj[0].isHalfInspect === 1 ? 1 : 0
  214. },
  215. createDept: this.infoDATA.department.id,
  216. startDept: {
  217. id: this.infoDATA.department.id
  218. },
  219. patient: {
  220. patientCode: this.infoDATA.patientCode
  221. },
  222. checkList: this.jdItem,
  223. goods: "",
  224. worker: {
  225. id: uni.getStorageSync("userData").user.id
  226. },
  227. workerStartOrderFlag: 1,
  228. },
  229. };
  230. //根据检查的紧急度加急
  231. this.jdItem.forEach(v => {
  232. if (v.priority === 1 || v.priority === '1') {
  233. postData.workOrder["urgentDetails"] = {
  234. checkStatus: {
  235. id: 329
  236. },
  237. urgentReason: '系统根据检查信息,自动进行加急',
  238. };
  239. }
  240. })
  241. post("/api/startOrder", postData).then((res) => {
  242. uni.hideLoading();
  243. let msg = res.msg;
  244. let icon = "error";
  245. if (res.status == 200) {
  246. msg = "建单成功";
  247. icon = "success";
  248. }
  249. this.models = {
  250. disjunctor: true,
  251. content: msg,
  252. icon: icon,
  253. operate: {
  254. know: "返回",
  255. },
  256. };
  257. });
  258. } else {
  259. uni.hideLoading();
  260. this.models = {
  261. disjunctor: true,
  262. content: "建单失败,科室未开通!",
  263. icon: "error",
  264. operate: {
  265. know: "返回",
  266. },
  267. };
  268. }
  269. } else {
  270. uni.hideLoading();
  271. uni.showToast({
  272. icon: "none",
  273. title: result.msg || "接口获取数据失败!",
  274. });
  275. }
  276. });
  277. },
  278. //建单取消
  279. cancel() {
  280. this.models.disjunctor = false;
  281. },
  282. // 扫一扫
  283. Scanning(qrcodePrefix = '') {
  284. if (!this.SMFlag) {
  285. return;
  286. }
  287. this.SMFlag = false;
  288. SM().then((content) => {
  289. this.SMFlag = true;
  290. this.getInfo(content);
  291. }).catch(err => {
  292. this.SMFlag = true;
  293. });
  294. },
  295. // 修改预约时间->返回
  296. know1() {
  297. this.models1.disjunctor = false;
  298. },
  299. // 修改预约时间->确定
  300. ok1(data) {
  301. console.log(data);
  302. const { yyTime} = data;//暂时这样
  303. if (!yyTime) {
  304. //没有填写预约时间
  305. uni.showModal({
  306. title: "提示",
  307. content: "请填写预约时间!",
  308. showCancel: false,
  309. success: function(res) {
  310. if (res.confirm) {
  311. console.log("用户点击确定");
  312. } else if (res.cancel) {
  313. console.log("用户点击取消");
  314. }
  315. },
  316. });
  317. return;
  318. }
  319. this.models1.disjunctor = false;
  320. let postData = {
  321. inspectCode: this.currentInspect.inspectCode,
  322. yyTime
  323. };
  324. uni.showLoading({
  325. title: '加载中',
  326. mask: true,
  327. })
  328. post('/workerOrder/updateInspectYytime', postData).then(res => {
  329. uni.hideLoading();
  330. if (res.status == 200) {
  331. this.getInfo(this.options.patientCode);
  332. } else {
  333. uni.showToast({
  334. icon: "none",
  335. title: "修改失败",
  336. });
  337. }
  338. })
  339. },
  340. // 修改预约时间->取消
  341. cancel1() {
  342. this.models1.disjunctor = false;
  343. },
  344. // 修改预约时间
  345. changeYyTime(item) {
  346. this.currentInspect = item;
  347. this.models1 = {
  348. disjunctor: true,
  349. content: `您要修改[${item.inspectName||''}]的预约时间`,
  350. icon: "warn",
  351. operate: {
  352. ok: "确定",
  353. cancel: "取消",
  354. },
  355. };
  356. },
  357. // 修改检查科室
  358. changeExecDept(item) {
  359. this.currentInspect = item;
  360. if(this.currentInspect.inspectCheckType){
  361. this.currentInspect.inspectCheckType.deptList = this.currentInspect.inspectCheckType.deptList || [];
  362. }
  363. this.models2 = {
  364. disjunctor: true,
  365. content: `请选择[${item.patientName||''}]检查项目的检查科室`,
  366. icon: "warn",
  367. operate: {
  368. ok: "确定",
  369. cancel: "取消",
  370. },
  371. };
  372. },
  373. // 修改检查科室->返回
  374. know2() {
  375. this.models2.disjunctor = false;
  376. },
  377. // 修改检查科室->确定
  378. ok2(data) {
  379. console.log(data);
  380. const { execDeptId } = data;
  381. this.models2.disjunctor = false;
  382. let postData = {
  383. "id": this.currentInspect.id,
  384. "execDeptId": execDeptId
  385. };
  386. uni.showLoading({
  387. title: '加载中',
  388. mask: true,
  389. })
  390. post('/simple/data/updData/inspect', postData).then(res => {
  391. uni.hideLoading();
  392. if (res.status == 200) {
  393. this.getInfo(this.options.patientCode);
  394. } else {
  395. uni.showToast({
  396. icon: "none",
  397. title: "修改失败",
  398. });
  399. }
  400. })
  401. },
  402. // 修改检查科室->取消
  403. cancel2() {
  404. this.models2.disjunctor = false;
  405. },
  406. // 请求详细页面的数据
  407. getInfo(patientCode) {
  408. uni.showLoading({
  409. title: "加载中",
  410. mask: true,
  411. });
  412. post("/nurse/workOrder/getPatientInspectInfo", {
  413. patientCode,
  414. queryInspect: 1,
  415. }).then((res) => {
  416. uni.hideLoading();
  417. if (res.status == 200) {
  418. res.data.inspectListMap = res.data.inspectListMap || {};
  419. this.isEmpty = Object.keys(res.data.inspectListMap).length === 0;
  420. this.infoDATA = res.data;
  421. } else {
  422. uni.showToast({
  423. icon: "none",
  424. title: res.msg || "接口获取数据失败!",
  425. });
  426. }
  427. });
  428. },
  429. },
  430. onLoad(options) {
  431. this.options = options;
  432. this.getInfo(this.options.patientCode);
  433. // #ifdef APP-PLUS
  434. webHandle("no", "app");
  435. // #endif
  436. // #ifdef H5
  437. webHandle("no", "wx");
  438. // #endif
  439. },
  440. onShow() {
  441. this.SMFlag = true;
  442. }
  443. };
  444. </script>
  445. <style lang="less" scoped>
  446. /deep/ uni-checkbox:not([disabled]) .uni-checkbox-input:hover{
  447. border-color: #49B856!important;
  448. }
  449. .page_item_btns{
  450. display: flex;
  451. justify-content: space-between;
  452. align-items: center;
  453. margin-top: 16rpx;
  454. margin-bottom: 16rpx;
  455. .page_item_btn {
  456. flex: 1;
  457. height: 88rpx;
  458. background-image: linear-gradient(to right, #72c172, #3bb197);
  459. border-radius: 8rpx;
  460. line-height: 88rpx;
  461. color: #fff;
  462. font-size: 36rpx;
  463. font-weight: 700;
  464. text-align: center;
  465. margin-right: 24rpx;
  466. &:first-of-type{
  467. margin-left: 24rpx;
  468. }
  469. }
  470. .toolbar {
  471. flex: 1;
  472. z-index: 999;
  473. height: 88rpx;
  474. display: flex;
  475. justify-content: center;
  476. align-items: center;
  477. box-sizing: border-box;
  478. border-radius: 4rpx;
  479. background-color: #E5E8ED;
  480. margin-right: 24rpx;
  481. .toolbar-icon {
  482. font-size: 52rpx;
  483. margin-right: 16rpx;
  484. color: #07863c;
  485. }
  486. .toolbar-sao {
  487. font-size: 36rpx;
  488. color: #333;
  489. }
  490. }
  491. }
  492. .newicon-weibiaoti2010104{
  493. margin-left: 8rpx;
  494. }
  495. .patientInformationInfo {
  496. background-color: #F7F7F7;
  497. display: flex;
  498. flex-direction: column;
  499. height: 100vh;
  500. .zwsj {
  501. flex: 1;
  502. min-height: 0;
  503. text-align: center;
  504. .zwsj-img {
  505. width: 560rpx;
  506. }
  507. .zwsj-txt {
  508. font-size: 36rpx;
  509. font-weight: 700;
  510. margin-top: 20rpx;
  511. text-align: center;
  512. }
  513. }
  514. .page_head {
  515. background-color: #49b856;
  516. color: #fff;
  517. .title {
  518. font-size: 48rpx;
  519. padding-top: 24rpx;
  520. text-align: center;
  521. }
  522. .remark{
  523. display: flex;
  524. margin: 16rpx 27rpx;
  525. .remarkTitle{
  526. flex-shrink: 0;
  527. }
  528. .remarkInfo{
  529. flex-shrink: 1;
  530. }
  531. }
  532. .patientCode {
  533. margin-left: 12rpx;
  534. font-size: 28rpx;
  535. }
  536. .info {
  537. margin: 8rpx 0;
  538. height: 80rpx;
  539. display: flex;
  540. justify-content: center;
  541. align-items: center;
  542. .bedNum,
  543. .waitingCount {
  544. width: 300rpx;
  545. height: 100%;
  546. display: flex;
  547. flex-direction: column;
  548. justify-content: center;
  549. align-items: center;
  550. .info_h {
  551. font-size: 30rpx;
  552. }
  553. .info_b {
  554. font-size: 26rpx;
  555. margin-top: 8rpx;
  556. }
  557. }
  558. .bedNum {
  559. position: relative;
  560. &:after {
  561. content: "";
  562. position: absolute;
  563. width: 4rpx;
  564. height: 50rpx;
  565. right: -2rpx;
  566. top: 15rpx;
  567. background-color: #fff;
  568. }
  569. }
  570. }
  571. }
  572. .scrollContent{
  573. flex: 1;
  574. min-height: 0;
  575. }
  576. .page_item {
  577. // margin-bottom: 10rpx;
  578. border-radius: 8rpx;
  579. overflow: hidden;
  580. .splitLine{
  581. height: 50rpx;
  582. display: flex;
  583. align-items: center;
  584. justify-content: center;
  585. color: #8F8F8F;
  586. .splitLineFlex{
  587. flex: 1;
  588. display: flex;
  589. align-items: center;
  590. justify-content: center;
  591. .splitLineBox{
  592. width: calc(100% - 48rpx);
  593. height: 1rpx;
  594. background-color: #8F8F8F;
  595. }
  596. }
  597. }
  598. .page_item_info {
  599. margin-top: 10rpx;
  600. padding: 20rpx 16rpx;
  601. text-align: left;
  602. line-height: 60rpx;
  603. font-size: 30rpx;
  604. background: #fff;
  605. &.mt0{
  606. margin-top: 0;
  607. }
  608. .buildOrder{
  609. width: 258rpx;
  610. height: 72rpx;
  611. background: #49B856;
  612. border-radius: 6rpx;
  613. margin: 0 auto;
  614. color: #FFFFFF;
  615. display: flex;
  616. align-items: center;
  617. justify-content: center;
  618. font-size: 30rpx;
  619. }
  620. .page_item_info_title {
  621. font-weight: 700;
  622. &.btn {
  623. display: flex;
  624. button {
  625. font-size: 28rpx;
  626. color: #49b856;
  627. height: 50rpx;
  628. line-height: 50rpx;
  629. margin: 0;
  630. }
  631. }
  632. &.row{
  633. display: flex;
  634. align-items: center;
  635. justify-content: space-between;
  636. }
  637. text {
  638. font-weight: normal;
  639. &.red {
  640. color: red;
  641. }
  642. &.bold{
  643. font-weight: 700;
  644. }
  645. }
  646. }
  647. }
  648. }
  649. }
  650. </style>