printThree.vue 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <template>
  2. <div>
  3. <div id="prescription-print3" class="prescription-print">
  4. <img
  5. style="width: 100%; height: 80px"
  6. v-if="org_id == 10138"
  7. src="https://kuyi.shengws.com/bailin/bltotle.jpg"
  8. alt=""
  9. />
  10. <img
  11. style="width: 100%; height: 80px"
  12. v-if="org_id == 10278 || org_id == 0"
  13. src="https://kuyi.shengws.com/beierlog.png"
  14. alt=""
  15. />
  16. <div class="printTitle">检验申请单</div>
  17. <div style="border: 1px solid #000;margin-bottom: 10px;">
  18. <div
  19. style="
  20. display: flex;
  21. justify-content: space-between;
  22. border-bottom: 1px solid #000;
  23. line-height: 40px;
  24. padding: 0 10px;
  25. "
  26. >
  27. <div>是否急诊:否</div>
  28. <div>
  29. 结算方式:{{
  30. faber && faber.transBody
  31. ? getName(faber.transBody.outputlist1)
  32. : ""
  33. }}
  34. </div>
  35. <div>金额:{{ total }}</div>
  36. </div>
  37. <div
  38. style="
  39. display: flex;
  40. justify-content: space-between;
  41. border-bottom: 1px solid #000;
  42. line-height: 40px;
  43. padding: 0 10px;
  44. "
  45. >
  46. <div>
  47. 姓名:{{
  48. advicePrint[0].patient.name
  49. ? advicePrint[0].patient.name.indexOf("(") > -1
  50. ? advicePrint[0].patient.name.substring(
  51. 0,
  52. advicePrint[0].patient.name.indexOf("(")
  53. )
  54. : advicePrint[0].patient.name
  55. : ""
  56. }}
  57. </div>
  58. <div>
  59. 性别:
  60. <span v-if="advicePrint[0].patient.gender == 1">男</span>
  61. <span v-if="advicePrint[0].patient.gender == 2">女</span>
  62. </div>
  63. <!-- <div>-->
  64. <!-- 年龄:{{-->
  65. <!-- advicePrint[0].patient.age ? advicePrint[0].patient.age : ""-->
  66. <!-- }}岁-->
  67. <!-- </div>-->
  68. <div>年龄:{{getAge(advicePrint[0].patient)?getAge(advicePrint[0].patient):""}}岁</div>
  69. </div>
  70. <div style="margin-bottom: 20px; padding: 10px 10px 0" >
  71. 病史摘要:{{
  72. history.history_of_present_illness
  73. ? history.history_of_present_illness
  74. : ""
  75. }}
  76. </div>
  77. <!-- <div style="margin-bottom:20px;padding:0 10px;" >体格检查:
  78. <span>体温:{{ history.temperature ? history.temperature + '℃' : '/' }}</span>
  79. <span>脉搏:{{ history.pulse ? history.pulse + '次/分' : '/' }}</span>
  80. <span>呼吸:{{ history.breathing ? history.breathing + '次/分' : '/' }}</span>
  81. <span>血压:{{ history.sbp }}/{{ history.dbp }}mmHg</span>
  82. </div> -->
  83. <div style="margin-bottom: 20px; padding: 0 10px">
  84. 临床诊断:{{ getDiagnosis(advicePrint[0].info.diagnosis) }}
  85. </div>
  86. <div style="display: flex; margin-bottom: 20px; padding: 0 10px">
  87. <div>检验项目:</div>
  88. <div style="position: relative;">
  89. <div v-for="item in projectPrint" style="margin-bottom: 10px">
  90. {{ item.team.project_team }}
  91. </div>
  92. <div v-for="item in singleProjectPrint">
  93. <div v-if="item.remark == '血透前抽血'" style="border-right: 1px solid red;padding-bottom: 5px;">
  94. {{ item.project.project_name }}
  95. </div>
  96. <!-- <div v-else style="border-right: 1px solid rgb(0, 47, 255);">
  97. {{ item.project.project_name }}
  98. </div> -->
  99. </div>
  100. <div style="height: 10px;"></div>
  101. <div v-for="item in singleProjectPrint" >
  102. <!-- <div v-if="item.remark == '血透前抽血'" style="border-right: 1px solid red;">
  103. {{ item.project.project_name }}
  104. </div> -->
  105. <div v-if="item.remark == '血透后抽血'" style="border-right: 1px solid rgb(0, 47, 255);padding-bottom: 5px;">
  106. {{ item.project.project_name }}
  107. </div>
  108. </div>
  109. <span style="position: absolute;top: 65px;right: -77px;" v-if=" singleProjectPrint.length>0">血透前抽血</span>
  110. <span style="position: absolute;bottom: 96px;right: -77px;" v-if=" singleProjectPrint.length>0">血透后抽血</span>
  111. </div>
  112. </div>
  113. <div
  114. style="
  115. display: flex;
  116. justify-content: space-between;
  117. border-top: 1px solid #000;
  118. line-height: 40px;
  119. padding: 0 10px;
  120. "
  121. >
  122. <div>开单医生:{{ doctor ? doctor : "" }}</div>
  123. <div>
  124. 开单日期:
  125. {{ getTime(pre_time) ? getTime(pre_time).split(" ")[0] : "" }}
  126. </div>
  127. <div>
  128. 医生签字:
  129. <img
  130. v-if="setAdminUserES(advicePrint[0].creator)"
  131. style="height: 80px; width: 80px;"
  132. :src="setAdminUserES(advicePrint[0].creator)"
  133. alt=""
  134. srcset=""
  135. />
  136. <span
  137. style="width: 100px; display: inline-block"
  138. v-else-if="advicePrint[0].doctor != ''"
  139. >
  140. {{ advicePrint[0].doctor ? advicePrint[0].doctor : "" }}
  141. </span>
  142. <span v-else>
  143. </span>
  144. </div>
  145. </div>
  146. </div>
  147. <img
  148. style="width: 100%"
  149. v-if="org_id == 10138 "
  150. src="https://kuyi.shengws.com/bailin/blend.jpg"
  151. alt=""
  152. />
  153. <img
  154. style="width: 100%"
  155. v-if="org_id == 10278 || org_id == 0"
  156. src="https://kuyi.shengws.com/bailinbeier.png"
  157. alt=""
  158. />
  159. </div>
  160. </div>
  161. </template>
  162. <script>
  163. import { jsGetAge, uParseTime } from "@/utils/tools";
  164. import {
  165. getAllDoctorList,
  166. getPrescriptionPrint,
  167. getHisPatientDetail,
  168. getPatientCaseHistory,
  169. } from "@/api/project/project";
  170. import { getInitData } from "@/api/his/his";
  171. export default {
  172. props: {
  173. patient_id: Number,
  174. record_date: String,
  175. prescription_id: Number,
  176. ids: String,
  177. },
  178. data() {
  179. return {
  180. doctorList_1: [],
  181. doctorList: [],
  182. advicePrint: {},
  183. patient: {},
  184. tableData: [],
  185. prescriptionInfo: [],
  186. hisPatient: {},
  187. department: [],
  188. prescriptions: [],
  189. projectList: [],
  190. doc_name: "",
  191. orgname: "",
  192. diagnoses: [],
  193. pageArr: [],
  194. faber: {},
  195. total: 0,
  196. projectPrint: [],
  197. time: "",
  198. doctor: "",
  199. org_id: "",
  200. singleProjectPrint: [],
  201. operatorMaps: {},
  202. };
  203. },
  204. methods: {
  205. getAge(patient){
  206. // 将时间戳转换为 Date 对象
  207. const birthday = new Date(patient.birthday* 1000);
  208. // 获取当前日期
  209. const now = new Date();
  210. // 计算年龄差
  211. const ageDiffMs = now - birthday;
  212. const ageDate = new Date(ageDiffMs); // 不需要减掉 1970 年的时间戳
  213. // 提取年份
  214. const age = ageDate.getUTCFullYear() - 1970;
  215. return age
  216. },
  217. getPatientCaseHistory() {
  218. const params = {
  219. patient_id: this.patient_id,
  220. };
  221. getPatientCaseHistory(params).then((response) => {
  222. if (response.data.state == 1) {
  223. var history = response.data.data.history;
  224. // console.log("中国history222222", history);
  225. this.history = history;
  226. }
  227. });
  228. },
  229. getAllDoctorList() {
  230. getAllDoctorList().then((response) => {
  231. if (response.data.state == 1) {
  232. var doctor = response.data.data.doctor;
  233. this.doctorList = doctor;
  234. }
  235. });
  236. },
  237. getDoctor(id) {
  238. var name = "";
  239. for (let i = 0; i < this.doctorList.length; i++) {
  240. if (id == this.doctorList[i].admin_user_id) {
  241. name = this.doctorList[i].user_name;
  242. }
  243. }
  244. return name;
  245. },
  246. getTime(value, temp) {
  247. if (value != undefined) {
  248. return uParseTime(value, temp);
  249. }
  250. return "";
  251. },
  252. getPrescriptionPrint() {
  253. var params = {
  254. // patient_id:this.patient_id,
  255. // record_date:this.record_date,
  256. // prescription_id:this.prescription_id,
  257. patient_id: this.patient_id,
  258. record_date: this.record_date,
  259. prescription_id: this.prescription_id,
  260. ids: this.ids,
  261. p_type: 2,
  262. };
  263. // console.log("params", params);
  264. getPrescriptionPrint(params).then((response) => {
  265. if (response.data.state == 1) {
  266. var advicePrint = response.data.data.advicePrint;
  267. // console.log("adviceprint9999", advicePrint);
  268. this.advicePrint = advicePrint;
  269. this.prescriptions = advicePrint;
  270. // console.log("处方222222", this.prescriptions);
  271. var hisPatient = response.data.data.hisPatient;
  272. // console.log("hisPatient", hisPatient);
  273. this.hisPatient = hisPatient;
  274. let projectPrint = [];
  275. let total = 0;
  276. this.advicePrint.map((item) => {
  277. // console.log("imte233232323232323223", item.project);
  278. if (item.project.length > 0) {
  279. item.project.map((it) => {
  280. if (it.type == 2) {
  281. if (it.project.cost_classify == 3) {
  282. projectPrint.push(it);
  283. total += it.project.price * parseInt(it.count);
  284. }
  285. }
  286. });
  287. }
  288. });
  289. this.doctorList_1 = response.data.data.eles;
  290. // console.log(this.doctorList_1, "医生列表");
  291. if (this.doctorList_1.length > 0) {
  292. var operatorsLen = this.doctorList_1.length;
  293. for (var index = 0; index < operatorsLen; index++) {
  294. this.$set(
  295. this.operatorMaps,
  296. this.doctorList_1[index].creator,
  297. this.doctorList_1[index]
  298. );
  299. }
  300. }
  301. let data = [];
  302. let data2 = [];
  303. projectPrint.map((item) => {
  304. if (item.team.id != 0) {
  305. let status = data.some((it) => it.team.id == item.team.id);
  306. if (!status) {
  307. data.push(item);
  308. }
  309. }
  310. if (item.team.id == 0) {
  311. data2.push(item);
  312. }
  313. });
  314. this.projectPrint = data;
  315. console.log("列表", this.projectPrint);
  316. this.total = total.toFixed(2);
  317. this.pre_time = this.advicePrint[0].pre_time;
  318. this.doctor = this.advicePrint[0].doctor;
  319. this.singleProjectPrint = data2;
  320. console.log("列表333", this.singleProjectPrint);
  321. var projectlist = response.data.data.projectlist;
  322. var projectlist = response.data.data.projectlist;
  323. // console.log("所有项目列表", projectlist);
  324. this.projectList = projectlist;
  325. this.getPage();
  326. let outputlist1Name = response.data.data.his.patient_info
  327. ? JSON.parse(response.data.data.his.patient_info)
  328. : {};
  329. this.faber = outputlist1Name;
  330. }
  331. });
  332. },
  333. // 电子签名
  334. setAdminUserES(id) {
  335. // console.log(id, "id");
  336. if (id == 0) {
  337. return "";
  338. }
  339. if (id in this.operatorMaps) {
  340. // console.log(this.operatorMaps, "this.operatorMaps");
  341. return this.operatorMaps[id].url;
  342. } else {
  343. // console.log("po");
  344. return "";
  345. }
  346. },
  347. getHisPatientDetail() {
  348. const params = {
  349. patient_id: this.patient_id,
  350. };
  351. getHisPatientDetail(params).then((response) => {
  352. if (response.data.state == 1) {
  353. var hisPatient = response.data.data.hisPatient;
  354. // console.log("挂号病人", hisPatient);
  355. this.hisPatient = hisPatient;
  356. }
  357. });
  358. },
  359. getInitData() {
  360. getInitData().then((response) => {
  361. if (response.data.state == 1) {
  362. this.department = response.data.data.department;
  363. this.diagnoses = response.data.data.diagnose.sort(this.compare("id"));
  364. // console.log("争端", this.diagnoses);
  365. }
  366. });
  367. },
  368. getDepart(id) {
  369. var name = "";
  370. for (let i = 0; i < this.department.length; i++) {
  371. if (id == this.department[i].id) {
  372. name = this.department[i].name;
  373. }
  374. }
  375. return name;
  376. },
  377. getTotalOne(id) {
  378. var total = 0;
  379. var addtotal = 0;
  380. for (let i = 0; i < this.prescriptions.length; i++) {
  381. if (id == this.prescriptions[i].id) {
  382. if (this.prescriptions[i].project != null) {
  383. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  384. total =
  385. total +
  386. this.prescriptions[i].project[a].price *
  387. this.prescriptions[i].project[a].count;
  388. }
  389. }
  390. if (this.prescriptions[i].additionalcharge != null) {
  391. for (
  392. let a = 0;
  393. a < this.prescriptions[i].additionalcharge.length;
  394. a++
  395. ) {
  396. addtotal =
  397. addtotal +
  398. this.prescriptions[i].additionalcharge[a].price *
  399. this.prescriptions[i].additionalcharge[a].count;
  400. }
  401. }
  402. addtotal = Math.floor(addtotal * 100) / 100;
  403. }
  404. }
  405. for (let i = 0; i < this.prescriptions.length; i++) {
  406. if (id == this.prescriptions[i].id) {
  407. if (this.prescriptions[i].advices != null) {
  408. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  409. total =
  410. total +
  411. this.prescriptions[i].advices[a].price *
  412. this.prescriptions[i].advices[a].prescribing_number;
  413. }
  414. }
  415. if (this.prescriptions[i].additionalcharge != null) {
  416. for (
  417. let a = 0;
  418. a < this.prescriptions[i].additionalcharge.length;
  419. a++
  420. ) {
  421. addtotal =
  422. addtotal +
  423. this.prescriptions[i].additionalcharge[a].price *
  424. this.prescriptions[i].additionalcharge[a].count;
  425. }
  426. }
  427. addtotal = Math.floor(addtotal * 100) / 100;
  428. }
  429. }
  430. return total + addtotal;
  431. },
  432. getProjectName(id) {
  433. var project_name = "";
  434. for (let i = 0; i < this.projectList.length; i++) {
  435. if (id == this.projectList[i].id) {
  436. project_name = this.projectList[i].project_name;
  437. }
  438. }
  439. return project_name;
  440. },
  441. getDiagnosis(ids) {
  442. let newIds = ids.split(",").sort(function (a, b) {
  443. return a - b;
  444. });
  445. var name = "";
  446. let nameArr = [];
  447. for (let i = 0; i < this.diagnoses.length; i++) {
  448. // if(id == this.diagnoses[i].id){
  449. // name = this.diagnoses[i].class_name
  450. // }
  451. if (newIds.indexOf(this.diagnoses[i].id.toString()) > -1) {
  452. // name += diagnoses[i].class_name + ' '
  453. nameArr.push(this.diagnoses[i].class_name);
  454. }
  455. }
  456. let newNameArr = [];
  457. nameArr.map((item, index) => {
  458. if (item == "尿毒症") {
  459. newNameArr.push(item);
  460. nameArr.splice(index, 1, "");
  461. }
  462. });
  463. newNameArr.push(...nameArr);
  464. return newNameArr.join(" ");
  465. },
  466. compare(property) {
  467. return function (a, b) {
  468. var value1 = a[property];
  469. var value2 = b[property];
  470. return value1 - value2; //升序排序
  471. };
  472. },
  473. getPage() {
  474. this.page = 1;
  475. this.pageArr = [];
  476. this.advicePrint.map((item) => {
  477. let arr = [];
  478. item.pageArr = [];
  479. if (item.advices.length <= 5) {
  480. this.page = 1;
  481. arr.push(item.advices.length);
  482. item.pageArr.push(arr);
  483. } else if (item.advices.length > 5) {
  484. this.page = parseInt(item.advices.length / 5);
  485. let num = item.advices.length % 5;
  486. for (var i = 0; i < this.page; i++) {
  487. item.pageArr.push([5]);
  488. }
  489. if (num != 0) {
  490. item.pageArr.push([num]);
  491. }
  492. }
  493. });
  494. // console.log('this.pageArr',this.pageArr)
  495. },
  496. getName(list) {
  497. console.log("list", list);
  498. let new_list = [];
  499. for (let i = 0; i < list.length; i++) {
  500. if (list[i].aac031 == "1") {
  501. new_list.push(list[i]);
  502. }
  503. }
  504. switch (new_list[0].bcc334) {
  505. case "A31001":
  506. return "深圳医保1档";
  507. break;
  508. case "A31002":
  509. return "深圳医保2档";
  510. break;
  511. case "A31003":
  512. return "深圳医保3档";
  513. break;
  514. case "A31004":
  515. return "二档(少儿)";
  516. break;
  517. case "A31005":
  518. return "学生二档";
  519. break;
  520. case "A31006":
  521. return "大学生二档";
  522. break;
  523. case "A32001":
  524. return "在职公务员";
  525. break;
  526. case "A32002":
  527. return "在职驻深公务员";
  528. break;
  529. case "A39301":
  530. return "家属统筹医疗";
  531. break;
  532. case "A41001":
  533. return "工伤在职";
  534. break;
  535. case "A51001":
  536. return "生育在职";
  537. break;
  538. case "A52001":
  539. return "生育医疗一档";
  540. break;
  541. case "A52002":
  542. return "生育医疗一档";
  543. break;
  544. case "C31001":
  545. return "一档医疗退休";
  546. break;
  547. case "C31002":
  548. return "二档医疗退休";
  549. break;
  550. }
  551. },
  552. },
  553. created() {
  554. this.getAllDoctorList();
  555. this.getInitData();
  556. this.getPrescriptionPrint();
  557. this.getHisPatientDetail();
  558. this.getPatientCaseHistory();
  559. var xtuser = this.$store.getters.xt_user;
  560. this.orgname = xtuser.org.org_name;
  561. this.org_id = this.$store.getters.xt_user.org_id;
  562. },
  563. watch: {
  564. ids: function (val) {
  565. this.ids = val;
  566. this.getPrescriptionPrint();
  567. },
  568. },
  569. };
  570. </script>
  571. <style lang="scss" scoped>
  572. .prescription-print {
  573. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
  574. 0 0 60px rgba(0, 0, 0, 0.06) inset;
  575. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
  576. 0 0 40px rgba(0, 0, 0, 0.06) inset;
  577. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  578. margin-bottom: 20px;
  579. padding: 20px 10px;
  580. }
  581. .printTitle {
  582. font-size: 22px;
  583. text-align: center;
  584. font-weight: bold;
  585. margin-bottom: 10px;
  586. }
  587. .infoTitle {
  588. display: flex;
  589. margin-top: 10px;
  590. line-height: 24px;
  591. }
  592. .infoTitle div {
  593. width: 200px;
  594. }
  595. .infoMain {
  596. display: flex;
  597. flex-wrap: wrap;
  598. margin-top: 10px;
  599. }
  600. .infoMain div {
  601. width: 50%;
  602. line-height: 24px;
  603. }
  604. .prescriptionBox {
  605. padding: 0 10px;
  606. min-height: 400px;
  607. }
  608. .Rp {
  609. font-size: 22px;
  610. font-weight: bold;
  611. }
  612. .drugsBox {
  613. padding-left: 40px;
  614. margin-bottom: 10px;
  615. }
  616. .drugsBox div {
  617. line-height: 20px;
  618. }
  619. .drugsOne {
  620. line-height: 24px;
  621. }
  622. .drugsOne span {
  623. margin-right: 20px;
  624. }
  625. .doctorBox {
  626. display: flex;
  627. justify-content: space-between;
  628. padding: 0 10px;
  629. line-height: 24px;
  630. border-bottom: 2px solid #000;
  631. }
  632. .actionBar {
  633. display: flex;
  634. justify-content: space-between;
  635. line-height: 24px;
  636. padding: 0 10px;
  637. }
  638. .actionBar p {
  639. width: 150px;
  640. }
  641. .under_line {
  642. display: inline-block;
  643. border-bottom: 1px solid #000;
  644. flex: 1;
  645. }
  646. </style>