patientInformationInfo.vue 21 KB

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