Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

printOne.vue 17KB

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