printSix.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <template>
  2. <div id="prescriptionPrint">
  3. <div v-for="(item, index) in advicePrint" :key="index">
  4. <div
  5. id="prescription-print"
  6. class="prescription-print"
  7. style="page-break-after: always"
  8. >
  9. <div class="printTitle" v-if="prescriptions[index].med_type == '1111'">
  10. {{ orgname }}第一类精神处方笺
  11. </div>
  12. <div class="printTitle" v-if="prescriptions[index].med_type == '1112'">
  13. {{ orgname }}第二类精神处方笺
  14. </div>
  15. <div
  16. v-if="
  17. prescriptions[index].med_type != '1112' &&
  18. prescriptions[index].med_type != '1111'
  19. "
  20. class="printTitle"
  21. >
  22. {{ orgname }}处方笺 普通
  23. <!-- <div v-else style="line-height: 60px;font-size: 30px;">{{ orgname }}处方笺</div>-->
  24. <!-- <img class="logo" src="../assets/shuiyin.jpg" alt="加载失败..">-->
  25. </div>
  26. <div class="infoTitle" style="border-bottom: 1px solid #000">
  27. <p style="width: 174px">科室:{{ item.info ? getDepart(item.info.departments) : "" }}</p>
  28. <p style="width: 176px">费别:</p>
  29. <p style="width: 198px" v-if="hisPatient.number.length <= 12">
  30. 门诊号:{{ hisPatient.number ? hisPatient.number : "" }}
  31. </p>
  32. <p style="text-align: right; width: 155px">
  33. <span>{{ record_date.split("-")[0] }}年</span
  34. ><span>{{ record_date.split("-")[1] }}月</span
  35. ><span>{{ record_date.split("-")[2] }}日</span>
  36. <!-- {{getTime(item.ctime)?getTime(item.ctime):""}} -->
  37. </p>
  38. </div>
  39. <div
  40. class="infoTitle"
  41. style="border-bottom: 1px solid #000"
  42. v-if="hisPatient.number.length > 12"
  43. >
  44. <p>
  45. 门诊号:{{
  46. hisPatient.number ? hisPatient.number : ""
  47. }}
  48. </p>
  49. </div>
  50. <div class="infoTitle" style="border-bottom: 1px solid #000">
  51. <p>姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
  52. <p>
  53. 性别:
  54. <span v-if="item.patient.gender == 1">男</span>
  55. <span v-if="item.patient.gender == 2">女</span>
  56. </p>
  57. <p>年龄:{{ getAge(item.patient) ? getAge(item.patient) : "" }}岁</p>
  58. <p>电话:{{ item.patient.phone }}</p>
  59. </div>
  60. <div class="infoTitle" style="border-bottom: 1px solid #000">
  61. <p style="width:100%">地址:{{ item.patient.home_address }}</p>
  62. </div>
  63. <div class="infoTitle">
  64. <p style="width:100%">诊断:{{ getDiagnosis(item.info.diagnosis) }}</p>
  65. </div>
  66. <div class="prescriptionBox">
  67. <div class="Rp">R:</div>
  68. <div
  69. class="drugsBox"
  70. v-for="(it, index) in item.advices"
  71. :key="index"
  72. >
  73. <!-- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div> -->
  74. <div class="drugsOne">
  75. <!-- <span style="font-weight: bold">{{ index + 1 + "." }}</span> -->
  76. {{ it.advice_name ? it.advice_name : "" }}&nbsp;&nbsp;<span
  77. v-if="it.drug.min_unit != it.drug.dose_unit"
  78. >{{ it.drug.dose }}{{ it.drug.dose_unit }}&nbsp;* &nbsp;</span
  79. >{{ it.drug.min_number }}{{ it.drug.min_unit }}/{{
  80. it.drug.max_unit
  81. }}&nbsp;×&nbsp; {{ it.prescribing_number
  82. }}{{ it.prescribing_number_unit }}
  83. </div>
  84. <div style="margin-left: 100px">
  85. <span>用法:{{ it.single_dose }}{{ it.single_dose_unit }}</span
  86. >&nbsp;&nbsp;<span
  87. >{{ it.execution_frequency }}&nbsp;{{
  88. it.delivery_way
  89. }}&nbsp;</span
  90. >&nbsp;&nbsp;<span>{{ it.advice_desc }}</span>
  91. </div>
  92. </div>
  93. <div
  94. class="drugsBox"
  95. v-for="(it, i) in item.additionalcharge"
  96. :key="i"
  97. >
  98. <div class="drugsOne">
  99. {{ it.item_name ? it.item_name : "" }}:&nbsp;{{ it.price }}元/{{
  100. it.count
  101. }}次
  102. </div>
  103. </div>
  104. <div
  105. class="drugsBox"
  106. v-for="(it, index) in item.project"
  107. :key="index"
  108. >
  109. <div class="drugsOne">
  110. <!-- <span style="font-weight: bold">{{ index + 1 + "." }}</span> -->
  111. {{
  112. it.type == 2
  113. ? getProjectName(it.project_id)
  114. ? getProjectName(it.project_id)
  115. : ""
  116. : it.good_info.good_name
  117. }}&nbsp;&nbsp;{{ it.single_dose
  118. }}{{ it.single_dose_unit }}&nbsp;×&nbsp; {{ it.count }}{{ unit }}
  119. </div>
  120. <div style="margin-left: 100px">
  121. <span>用法:{{ it.single_dose }}{{ it.single_dose_unit }}</span
  122. >&nbsp;&nbsp;<span>{{ it.delivery_way }}</span
  123. >&nbsp;&nbsp;<span>{{ it.advice_desc }}</span>
  124. </div>
  125. </div>
  126. <div
  127. class="drugsBox"
  128. v-for="(it, i) in item.additionalcharge"
  129. :key="i"
  130. >
  131. <div class="drugsOne">
  132. {{ it.project_id ? it.project_id : "" }}:&nbsp;{{
  133. it.price.toFixed(2)
  134. }}元/{{ it.count }}次
  135. </div>
  136. </div>
  137. <div style="text-align: center">(以下空白)</div>
  138. </div>
  139. <div class="infoTitle"></div>
  140. <div class="actionBar" v-if="org_id != 10188">
  141. <div class="actionBar_list">
  142. <div style="width:120px;">
  143. 医师:
  144. <span>{{ item.doctor ? item.doctor : "" }} </span>
  145. </div>
  146. </div>
  147. <div class="actionBar_list">
  148. <div style="width:120px;">
  149. 审核:{{
  150. getDoctor(item.advices[0].checker)
  151. ? getDoctor(item.advices[0].checker)
  152. : ""
  153. }}
  154. </div>
  155. </div>
  156. <div class="actionBar_list">
  157. <div style="width:120px;">
  158. 金额:
  159. {{
  160. getTotalOne(item.id).toFixed(2)
  161. ? getTotalOne(item.id).toFixed(2)
  162. : 0
  163. }}
  164. </div>
  165. <!-- <div class="actionBar_val">
  166. </div> -->
  167. </div>
  168. </div>
  169. <div class="actionBar">
  170. <div class="actionBar_list">
  171. <div style="width:120px;">调配:</div>
  172. <!-- <div class="actionBar_val"></div> -->
  173. </div>
  174. <div class="actionBar_list">
  175. <div style="width:120px;">
  176. 核对:{{
  177. getDoctor(item.advices[0].checker)
  178. ? getDoctor(item.advices[0].checker)
  179. : ""
  180. }}
  181. </div>
  182. <!-- <div class="actionBar_val">
  183. </div> -->
  184. </div>
  185. <div class="actionBar_list">
  186. <div style="width:120px;">
  187. 发药:{{
  188. getDoctor(item.advices[0].execution_staff)
  189. ? getDoctor(item.advices[0].execution_staff)
  190. : ""
  191. }}
  192. <!-- <span>占位符</span> -->
  193. </div>
  194. <!-- <div class="actionBar_val">
  195. </div> -->
  196. </div>
  197. </div>
  198. <div style="page-break-after: always"></div>
  199. </div>
  200. </div>
  201. </div>
  202. </template>
  203. <script>
  204. import { jsGetAge, uParseTime } from "@/utils/tools";
  205. import {
  206. getAllDoctorList,
  207. getPrescriptionPrint,
  208. getHisPatientDetail,
  209. } from "@/api/project/project";
  210. import { getInitData } from "@/api/his/his";
  211. export default {
  212. props: {
  213. patient_id: Number,
  214. record_date: String,
  215. prescription_id: Number,
  216. ids: String,
  217. },
  218. data() {
  219. return {
  220. doctorList: [],
  221. advicePrint: {},
  222. patient: {},
  223. tableData: [],
  224. prescriptionInfo: [],
  225. hisPatient: {},
  226. department: [],
  227. prescriptions: [],
  228. projectList: [],
  229. orgname: "",
  230. diagnoses: [],
  231. org_id: 0,
  232. };
  233. },
  234. methods: {
  235. getAge(patient) {
  236. var thisLen = patient.id_card_no.length;
  237. var birth = "";
  238. if (thisLen == 15) {
  239. birth = "19" + patient.id_card_no.substr(6, 6);
  240. } else {
  241. birth = patient.id_card_no.substr(6, 8);
  242. }
  243. var births =
  244. birth.substr(0, 4) +
  245. "-" +
  246. birth.substr(4, 2) +
  247. "-" +
  248. birth.substr(6, 2);
  249. return jsGetAge(births, "-");
  250. },
  251. getAllDoctorList() {
  252. getAllDoctorList().then((response) => {
  253. if (response.data.state == 1) {
  254. var doctor = response.data.data.doctor;
  255. this.doctorList = doctor;
  256. }
  257. });
  258. },
  259. getDoctor(id) {
  260. var name = "";
  261. for (let i = 0; i < this.doctorList.length; i++) {
  262. if (id == this.doctorList[i].admin_user_id) {
  263. name = this.doctorList[i].user_name;
  264. }
  265. }
  266. return name;
  267. },
  268. getTime(value, temp) {
  269. if (value != undefined) {
  270. return uParseTime(value, temp);
  271. }
  272. return "";
  273. },
  274. getPrescriptionPrint() {
  275. var params = {
  276. // patient_id:this.patient_id,
  277. // record_date:this.record_date,
  278. // prescription_id:this.prescription_id,
  279. patient_id: this.patient_id,
  280. record_date: this.record_date,
  281. prescription_id: this.prescription_id,
  282. ids: this.ids,
  283. p_type: 2,
  284. };
  285. console.log("params", params);
  286. getPrescriptionPrint(params).then((response) => {
  287. if (response.data.state == 1) {
  288. var advicePrint = response.data.data.advicePrint;
  289. this.advicePrint = advicePrint;
  290. this.prescriptions = advicePrint;
  291. var hisPatient = response.data.data.hisPatient;
  292. this.hisPatient = hisPatient;
  293. var projectlist = response.data.data.projectlist;
  294. this.projectList = projectlist;
  295. }
  296. });
  297. },
  298. getHisPatientDetail() {
  299. const params = {
  300. patient_id: this.patient_id,
  301. };
  302. getHisPatientDetail(params).then((response) => {
  303. if (response.data.state == 1) {
  304. var hisPatient = response.data.data.hisPatient;
  305. console.log("挂号病人", hisPatient);
  306. this.hisPatient = hisPatient;
  307. }
  308. });
  309. },
  310. getInitData() {
  311. getInitData().then((response) => {
  312. if (response.data.state == 1) {
  313. this.department = response.data.data.department;
  314. this.diagnoses = response.data.data.diagnose;
  315. console.log("争端", this.diagnoses);
  316. }
  317. });
  318. },
  319. getDepart(id) {
  320. var name = "";
  321. for (let i = 0; i < this.department.length; i++) {
  322. if (id == this.department[i].id) {
  323. name = this.department[i].name;
  324. }
  325. }
  326. return name;
  327. },
  328. getTotalOne(id) {
  329. var total = 0;
  330. var addtotal = 0;
  331. for (let i = 0; i < this.prescriptions.length; i++) {
  332. if (id == this.prescriptions[i].id) {
  333. if (this.prescriptions[i].project != null) {
  334. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  335. total =
  336. total +
  337. this.prescriptions[i].project[a].price *
  338. this.prescriptions[i].project[a].count;
  339. }
  340. }
  341. if (this.prescriptions[i].additionalcharge != null) {
  342. for (
  343. let a = 0;
  344. a < this.prescriptions[i].additionalcharge.length;
  345. a++
  346. ) {
  347. addtotal =
  348. addtotal +
  349. this.prescriptions[i].additionalcharge[a].price *
  350. this.prescriptions[i].additionalcharge[a].count;
  351. }
  352. }
  353. addtotal = Math.floor(addtotal * 100) / 100;
  354. }
  355. }
  356. for (let i = 0; i < this.prescriptions.length; i++) {
  357. if (id == this.prescriptions[i].id) {
  358. if (this.prescriptions[i].advices != null) {
  359. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  360. total =
  361. total +
  362. this.prescriptions[i].advices[a].price *
  363. this.prescriptions[i].advices[a].prescribing_number;
  364. }
  365. }
  366. if (this.prescriptions[i].additionalcharge != null) {
  367. for (
  368. let a = 0;
  369. a < this.prescriptions[i].additionalcharge.length;
  370. a++
  371. ) {
  372. addtotal =
  373. addtotal +
  374. this.prescriptions[i].additionalcharge[a].price *
  375. this.prescriptions[i].additionalcharge[a].count;
  376. }
  377. }
  378. addtotal = Math.floor(addtotal * 100) / 100;
  379. }
  380. }
  381. return total + addtotal;
  382. },
  383. getProjectName(id) {
  384. var project_name = "";
  385. for (let i = 0; i < this.projectList.length; i++) {
  386. if (id == this.projectList[i].id) {
  387. project_name = this.projectList[i].project_name;
  388. }
  389. }
  390. return project_name;
  391. },
  392. getDiagnosis(id) {
  393. let ids = id.split(",");
  394. var name = "";
  395. for (let i = 0; i < ids.length; i++) {
  396. for (let b = 0; b < this.diagnoses.length; b++) {
  397. if (parseInt(ids[i]) == this.diagnoses[b].id) {
  398. if (name.length == 0) {
  399. name = this.diagnoses[b].class_name;
  400. } else {
  401. name = name + "," + this.diagnoses[b].class_name;
  402. }
  403. }
  404. }
  405. }
  406. return name;
  407. },
  408. },
  409. created() {
  410. this.getAllDoctorList();
  411. this.getInitData();
  412. this.getPrescriptionPrint();
  413. this.getHisPatientDetail();
  414. var xtuser = this.$store.getters.xt_user;
  415. this.orgname = xtuser.org.org_name;
  416. this.org_id = xtuser.org.id;
  417. },
  418. watch: {
  419. ids: function (val) {
  420. this.ids = val;
  421. this.getPrescriptionPrint();
  422. },
  423. },
  424. };
  425. </script>
  426. <style lang="scss" scoped>
  427. .prescription-print {
  428. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
  429. 0 0 60px rgba(0, 0, 0, 0.06) inset;
  430. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
  431. 0 0 40px rgba(0, 0, 0, 0.06) inset;
  432. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  433. margin-bottom: 20px;
  434. padding: 20px 10px;
  435. }
  436. .printTitle {
  437. font-size: 22px;
  438. text-align: center;
  439. font-weight: bold;
  440. display: flex;
  441. position: relative;
  442. left: 50%;
  443. transform: translateX(-50px);
  444. }
  445. .infoTitle_thin {
  446. display: flex;
  447. border-bottom: 2px solid #000;
  448. margin-top: 10px;
  449. line-height: 24px;
  450. padding: 0 10px;
  451. }
  452. .infoTitle_thin p {
  453. width: 250px;
  454. }
  455. .infoTitle {
  456. display: flex;
  457. border-bottom: 2px solid #000;
  458. margin-top: 10px;
  459. line-height: 24px;
  460. padding: 0 10px;
  461. }
  462. .infoTitle p {
  463. width: 165px;
  464. }
  465. .infoMain {
  466. display: flex;
  467. flex-wrap: wrap;
  468. border-bottom: 2px solid #000;
  469. padding: 0 10px;
  470. }
  471. .infoMain div {
  472. width: 50%;
  473. line-height: 24px;
  474. }
  475. .prescriptionBox {
  476. padding: 0 10px;
  477. min-height: 450px;
  478. }
  479. .Rp {
  480. font-size: 22px;
  481. font-weight: bold;
  482. }
  483. .drugsBox {
  484. padding-left: 40px;
  485. margin-bottom: 10px;
  486. }
  487. .drugsBox div {
  488. line-height: 20px;
  489. }
  490. .drugsOne {
  491. line-height: 24px;
  492. }
  493. .drugsOne span {
  494. margin-right: 20px;
  495. }
  496. .doctorBox {
  497. display: flex;
  498. justify-content: space-between;
  499. padding: 0 10px;
  500. line-height: 24px;
  501. border-bottom: 2px solid #000;
  502. }
  503. .actionBar {
  504. display: flex;
  505. justify-content: space-between;
  506. line-height: 24px;
  507. padding: 0 10px;
  508. .actionBar_list {
  509. display: flex;
  510. width: 120px;
  511. .actionBar_val {
  512. width: 100px;
  513. border-bottom: 2px solid #000;
  514. text-align: center;
  515. }
  516. .title_bar {
  517. position: relative;
  518. .val_list {
  519. position: absolute;
  520. width: 105px;
  521. top: 0;
  522. left: 42px;
  523. border-bottom: 1px solid #000;
  524. }
  525. }
  526. }
  527. }
  528. .actionBar p {
  529. width: 150px;
  530. }
  531. .logo {
  532. }
  533. </style>