printOne.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <div id='prescriptionPrint'>
  3. <div id='prescription-print' class="prescription-print" v-for="(item,index) in advicePrint" :key="index">
  4. <div style="display:flex;justify-content: space-between;font-weight:bold;align-items:center;" >
  5. <div style="width:200px;display:flex;justify-content: space-between;font-weight:bold;">
  6. <span>费别</span>
  7. <span>自费</span>
  8. <span>公费</span>
  9. <span>保险</span>
  10. <span>其他</span>
  11. </div>
  12. <div v-if="org_id == 10460">就诊日期:{{getTime(item.pre_time,'{y}-{m}-{d}')}}</div>
  13. <div v-else>就诊日期:{{getTime(item.pre_time,'{y}-{m}-{d}')}}</div>
  14. </div>
  15. <div class="printTitle">{{orgname}}</div>
  16. <div class="printTitle">处方、治疗单</div>
  17. <!-- class="infoTitle" -->
  18. <div style="display: flex; margin-top: 10px; line-height: 24px;padding: 0 10px;">
  19. <div style="width: 300px;">门诊编号:</div>
  20. <div style="width: 300px;">电脑号:</div>
  21. </div>
  22. <div class="infoMain">
  23. <div style="margin-bottom: 10px;width:25%">姓名:{{item.patient.name}}</div>
  24. <div style="margin-bottom: 10px;width:25%">性别:
  25. <span v-if="item.patient.gender == 1">男</span>
  26. <span v-if="item.patient.gender == 2">女</span>
  27. </div>
  28. <div style="margin-bottom: 10px;width:25%">年龄:
  29. <span>{{getAge(item.patient)?getAge(item.patient):""}}岁</span>
  30. </div>
  31. <div style="margin-bottom: 10px;width:25%">参保类型:{{hisPatient.social_type?hisPatient.social_type:''}}
  32. </div>
  33. <div style="margin-bottom: 10px;width:50%;">联系电话:{{item.patient.phone}}</div>
  34. <div style="width:50%;">地址:{{ item.patient.home_address }}
  35. <!-- {{item.patient.unit_address}} -->
  36. </div>
  37. <div style="width:100%;">诊断:{{getDiagnosis(item.info.diagnosis)}}</div>
  38. </div>
  39. <div class="prescriptionBox" style="min-height: 420px;">
  40. <table style="width:100%;text-align:center;line-height:25px;">
  41. <tr>
  42. <td>序号</td>
  43. <td>项目名称</td>
  44. <td>数量</td>
  45. <td>单位</td>
  46. <td>单价</td>
  47. <td>部位</td>
  48. <td>备注</td>
  49. <td>天数</td>
  50. </tr>
  51. <tr v-for="(it,index) in item.project" :key="index">
  52. <td>{{index+1}}</td>
  53. <td>{{it.type == 2 ? it.project.project_name : it.good_info.good_name}}</td>
  54. <td>{{it.count}}</td>
  55. <td>{{getUnit(it.unit)}}</td>
  56. <td>{{it.price.toFixed(2)}}</td>
  57. <td></td>
  58. <td>{{it.remark}}</td>
  59. <td>{{it.day}}</td>
  60. </tr>
  61. <tr v-for="(it,index) in item.advices" :key="index">
  62. <td>{{index+1}}</td>
  63. <td>{{it.advice_name?it.advice_name:''}}</td>
  64. <td>{{it.single_dose?it.single_dose:''}}</td>
  65. <td>{{it.single_dose_unit?it.single_dose_unit:''}}</td>
  66. <td>{{it.price.toFixed(2)}}</td>
  67. <td></td>
  68. <td>{{it.remark}}</td>
  69. <td>{{it.day}}</td>
  70. </tr>
  71. </table>
  72. </div>
  73. <div style="display: flex; margin-top: 10px; line-height: 24px;padding: 0 10px;">
  74. <!-- <div style="width: 300px;">开单医生:{{item.doctor?item.doctor:''}}</div> -->
  75. <div style="width: 300px;" v-if="org_id==10088 ||org_id==0">
  76. 开单医生:
  77. <span
  78. style="width: 100px; display: inline-block"
  79. v-if="item.creator == ''"
  80. >
  81. {{ item.doctor ? item.doctor : "" }}
  82. </span>
  83. <span
  84. style="width: 100px; display: inline-block"
  85. v-else-if="doc_name != ''"
  86. >
  87. {{ doc_name }}
  88. </span>
  89. <img
  90. style="height: 30px"
  91. :src="setAdminUserES(item.creator,item.doctor)"
  92. alt=""
  93. srcset=""
  94. v-else
  95. />
  96. </div>
  97. <div style="width: 300px;">签章:</div>
  98. <div style="width: 300px;">费用:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):''}}元</div>
  99. </div>
  100. <table style="width:100%;text-align:center;line-height:25px;border-collapse: collapse;" border="1">
  101. <tr>
  102. <td style="width:16%;">治疗时间</td>
  103. <td style="width:16%;"></td>
  104. <td style="width:16%;"></td>
  105. <td style="width:16%;"></td>
  106. <td style="width:16%;"></td>
  107. <td style="width:16%;"></td>
  108. </tr>
  109. <tr>
  110. <td style="width:16%;">医生签字</td>
  111. <td style="width:16%;"></td>
  112. <td style="width:16%;"></td>
  113. <td style="width:16%;"></td>
  114. <td style="width:16%;"></td>
  115. <td style="width:16%;"></td>
  116. </tr>
  117. <tr>
  118. <td style="width:16px;">患者签字</td>
  119. <td style="width:16px;"></td>
  120. <td style="width:16px;"></td>
  121. <td style="width:16px;"></td>
  122. <td style="width:16px;"></td>
  123. <td style="width:16px;"></td>
  124. </tr>
  125. </table>
  126. </div>
  127. <!-- <div id='prescriptionPrint'>
  128. <div v-for="(item,index) in advicePrint" :key="index">
  129. <div id='prescription-print' class="prescription-print" style="page-break-after: always;">
  130. <div style="display:flex;justify-content: space-between;font-weight:bold;">
  131. <div style="width:200px;display:flex;justify-content: space-between;font-weight:bold;">
  132. <span>费别</span>
  133. <span>自费</span>
  134. <span>公费</span>
  135. <span>保险</span>
  136. <span>其他</span>
  137. </div>
  138. <div>就诊日期:{{getTime(item.ctime)}}</div>
  139. </div>
  140. <div class="printTitle">血液透析中心</div>
  141. <div class="printTitle">处方、治疗单</div>
  142. <div class="infoTitle">
  143. <div>门诊编号:</div>
  144. <div>电脑号:</div>
  145. </div>
  146. <div class="infoMain">
  147. <div style="margin-bottom: 10px;width:25%">姓名:{{item.patient.name}}</div>
  148. <div style="margin-bottom: 10px;width:25%">性别:
  149. <span v-if="item.patient.gender == 1">男</span>
  150. <span v-if="item.patient.gender == 2">女</span>
  151. </div>
  152. <div style="margin-bottom: 10px;width:25%">年龄:
  153. <span>{{item.patient.age}}</span>
  154. </div>
  155. <div style="margin-bottom: 10px;width:25%">参保类型:</div>
  156. <div style="margin-bottom: 10px;width:50%;">联系电话:{{item.patient.phone}}</div>
  157. <div style="width:50%;">地址:{{item.patient.unit_address}}</div>
  158. <div style="width:100%;">诊断:{{item.patient.diagnose}}</div>
  159. </div>
  160. <div class="prescriptionBox">
  161. <table style="width:100%;text-align:center;line-height:25px;">
  162. <tr>
  163. <td>序号</td>
  164. <td>项目名称</td>
  165. <td>数量</td>
  166. <td>单位</td>
  167. <td>单价</td>
  168. <td>部位</td>
  169. <td>备注</td>
  170. <td>天数</td>
  171. </tr>
  172. <tr v-for="(it,index) in item.project" :key="index">
  173. <td>{{index+1}}</td>
  174. <td>{{getProjectName(it.project_id)}}</td>
  175. <td>{{it.single_dose}}</td>
  176. <td>{{getUnit(it.unit)}}</td>
  177. <td>{{it.price}}</td>
  178. <td></td>
  179. <td>{{it.remark}}</td>
  180. <td>{{it.day}}</td>
  181. </tr>
  182. </table>
  183. </div>
  184. <div class="infoTitle">
  185. <div>开单医生:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</div>
  186. <div>签章:</div>
  187. </div>
  188. <div class="actionBar">
  189. <div>执行医生:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</div>
  190. <div>费用:</div>
  191. </div>
  192. <table style="width:100%;text-align:center;line-height:25px;border-collapse: collapse;" border="1">
  193. <tr>
  194. <td style="width:16%;">治疗时间</td>
  195. <td style="width:16%;"></td>
  196. <td style="width:16%;"></td>
  197. <td style="width:16%;"></td>
  198. <td style="width:16%;"></td>
  199. <td style="width:16%;"></td>
  200. </tr>
  201. <tr>
  202. <td style="width:16%;">医生签字</td>
  203. <td style="width:16%;"></td>
  204. <td style="width:16%;"></td>
  205. <td style="width:16%;"></td>
  206. <td style="width:16%;"></td>
  207. <td style="width:16%;"></td>
  208. </tr>
  209. <tr>
  210. <td style="width:16px;">患者签字</td>
  211. <td style="width:16px;"></td>
  212. <td style="width:16px;"></td>
  213. <td style="width:16px;"></td>
  214. <td style="width:16px;"></td>
  215. <td style="width:16px;"></td>
  216. </tr>
  217. </table>
  218. </div>
  219. </div>
  220. </div> -->
  221. </div>
  222. </template>
  223. <script>
  224. import { jsGetAge, uParseTime } from '@/utils/tools'
  225. import { getAllDoctorList, getPrescriptionPrint } from '@/api/project/project'
  226. import { getInitData } from '@/api/his/his'
  227. export default {
  228. props: {
  229. patient_id: Number,
  230. record_date: String,
  231. prescription_id: Number,
  232. ids: String
  233. },
  234. data() {
  235. return {
  236. doctorList: [],
  237. advicePrint: {},
  238. patient: {},
  239. tableData: [],
  240. prescriptionInfo: [],
  241. projectList: [],
  242. prescriptions: [],
  243. settlement:
  244. [
  245. { value: 1, label: '医保' },
  246. { value: 2, label: '自费' },
  247. { value: 3, label: '公费' },
  248. { value: 4, label: '农保' },
  249. { value: 5, label: '会员' },
  250. { value: 6, label: '职工' },
  251. { value: 7, label: '合同' },
  252. { value: 8, label: '医保自费' }
  253. ],
  254. hisPatient: {},
  255. diagnoses: [],
  256. org_id:''
  257. }
  258. },
  259. methods: {
  260. // 电子签名
  261. setAdminUserES(id,name) {
  262. if (id == 0) {
  263. return "";
  264. }
  265. if (id in this.operatorMaps) {
  266. return this.operatorMaps[id].url;
  267. } else {
  268. this.doc_name = name
  269. return "";
  270. }
  271. },
  272. getAge(patient){
  273. var thisLen = patient.id_card_no.length
  274. var birth = ''
  275. if (thisLen == 15) {
  276. birth = '19' + patient.id_card_no.substr(6, 6)
  277. } else {
  278. birth = patient.id_card_no.substr(6, 8)
  279. }
  280. var births =
  281. birth.substr(0, 4) +
  282. '-' +
  283. birth.substr(4, 2) +
  284. '-' +
  285. birth.substr(6, 2)
  286. return jsGetAge(births, '-')
  287. },
  288. printThisPage() {
  289. var ptime = Math.round(new Date().getTime() / 1000)
  290. this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
  291. const style =
  292. '@media print {.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoTitle{display: flex;margin-top:10px;line-height: 1px;padding:0 10px;}.infoTitle p{width: 200px;}.otherInfo{display: flex;margin-top:10px;padding:0 10px;}.otherInfo span{display:inline-block;}.recordTitle{display: flex;margin-top:10px;line-height: 24px;padding:0 10px;border-bottom: 2px solid #000;}.recordTitle p{width: 200px;}}'
  293. printJS({
  294. printable: 'prescription-print',
  295. type: 'html',
  296. style: style,
  297. scanStyles: false
  298. })
  299. },
  300. getAllDoctorList() {
  301. getAllDoctorList().then(response => {
  302. if (response.data.state == 1) {
  303. var doctor = response.data.data.doctor
  304. this.doctorList = doctor
  305. }
  306. })
  307. },
  308. getDoctor(id) {
  309. var name = ''
  310. for (let i = 0; i < this.doctorList.length; i++) {
  311. if (id == this.doctorList[i].admin_user_id) {
  312. name = this.doctorList[i].user_name
  313. }
  314. }
  315. return name
  316. },
  317. getTime(value, temp) {
  318. if (value != undefined) {
  319. return uParseTime(value, temp)
  320. }
  321. return ''
  322. },
  323. getPrescriptionPrint() {
  324. var params = {
  325. patient_id: this.patient_id,
  326. record_date: this.record_date,
  327. prescription_id: this.prescription_id,
  328. ids: this.ids,
  329. p_type:2,
  330. }
  331. console.log('999999', params)
  332. getPrescriptionPrint(params).then(response => {
  333. if (response.data.state == 1) {
  334. var advicePrint = response.data.data.advicePrint
  335. console.log('adviceprint', advicePrint)
  336. this.advicePrint = advicePrint
  337. this.prescriptions = advicePrint
  338. var projectlist = response.data.data.projectlist
  339. console.log('所有项目列表', projectlist)
  340. this.projectList = projectlist
  341. this.hisPatient = response.data.data.hisPatient
  342. this.advicePrint.map((item) => {
  343. console.log(item.project.length);
  344. if (item.project.length > 0) {
  345. for (var i = item.project.length - 1; i >= 0; i--) {
  346. if (item.project[i].type == 2) {
  347. if (item.project[i].project.cost_classify == 3) {
  348. console.log("!1111111")
  349. item.project.splice(i, 1);
  350. }
  351. }
  352. }
  353. }
  354. });
  355. }
  356. })
  357. },
  358. getProjectName(id) {
  359. var project_name = ''
  360. for (let i = 0; i < this.projectList.length; i++) {
  361. if (id == this.projectList[i].id) {
  362. project_name = this.projectList[i].project_name
  363. }
  364. }
  365. return project_name
  366. },
  367. getUnit(id) {
  368. var unit = ''
  369. for (let i = 0; i < this.projectList.length; i++) {
  370. if (id == this.projectList[i].id) {
  371. unit = this.projectList[i].unit
  372. }
  373. }
  374. return unit
  375. },
  376. getTotalOne(id) {
  377. var total = 0
  378. var addtotal = 0
  379. for (let i = 0; i < this.prescriptions.length; i++) {
  380. if (id == this.prescriptions[i].id) {
  381. if (this.prescriptions[i].project != null) {
  382. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  383. total = total + this.prescriptions[i].project[a].price * this.prescriptions[i].project[a].count
  384. }
  385. }
  386. if (this.prescriptions[i].additionalcharge != null) {
  387. for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
  388. addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
  389. }
  390. }
  391. addtotal = Math.floor(addtotal * 100) / 100
  392. }
  393. }
  394. for (let i = 0; i < this.prescriptions.length; i++) {
  395. if (id == this.prescriptions[i].id) {
  396. if (this.prescriptions[i].advices != null) {
  397. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  398. total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
  399. }
  400. }
  401. if (this.prescriptions[i].additionalcharge != null) {
  402. for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
  403. addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
  404. }
  405. }
  406. addtotal = Math.floor(addtotal * 100) / 100
  407. }
  408. }
  409. return total + addtotal
  410. },
  411. getInitData() {
  412. getInitData().then(response => {
  413. if (response.data.state == 1) {
  414. this.diagnoses = response.data.data.diagnose
  415. console.log('争端', this.diagnoses)
  416. }
  417. })
  418. },
  419. getDiagnosis(id) {
  420. let arr = id.split(",");
  421. var name = "";
  422. for (let i = 0; i < this.diagnoses.length; i++) {
  423. if (arr.indexOf(String(this.diagnoses[i].id)) > -1) {
  424. name += this.diagnoses[i].class_name + " ";
  425. }
  426. }
  427. return name
  428. }
  429. },
  430. created() {
  431. this.getInitData()
  432. this.getAllDoctorList()
  433. this.getPrescriptionPrint()
  434. var xtuser = this.$store.getters.xt_user
  435. this.orgname = xtuser.org.org_name
  436. this.org_id = this.$store.getters.xt_user.org_id
  437. },
  438. watch: {
  439. patient_id: function(val) {
  440. console.log('101000010101010', this.patient_id, this.record_date, this.prescription_id)
  441. // this.getPrescriptionPrint()
  442. },
  443. ids: function(val) {
  444. this.ids = val
  445. console.log('this.idsids', this.ids)
  446. this.getPrescriptionPrint()
  447. }
  448. }
  449. }
  450. </script>
  451. <style lang="scss" scoped>
  452. .prescription-print {
  453. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
  454. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  455. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  456. margin-bottom: 20px;
  457. padding: 20px 10px;
  458. }
  459. .prescription-print {
  460. font-size: 14px;
  461. }
  462. .printTitle {
  463. font-size: 18px;
  464. text-align: center;
  465. font-weight: bold;
  466. margin-top: 10px;
  467. }
  468. .infoTitle {
  469. display: flex;
  470. // border-bottom: 2px solid #000;
  471. margin-top: 10px;
  472. line-height: 24px;
  473. padding: 0 10px;
  474. }
  475. .infoTitle div {
  476. width: 300px;
  477. }
  478. .infoMain {
  479. display: flex;
  480. flex-wrap: wrap;
  481. border-bottom: 2px solid #000;
  482. padding: 0 10px;
  483. }
  484. .infoMain div {
  485. width: 50%;
  486. line-height: 24px;
  487. }
  488. .prescriptionBox {
  489. padding: 0 10px;
  490. }
  491. .Rp {
  492. font-size: 22px;
  493. font-weight: bold;
  494. }
  495. .drugsBox {
  496. padding-left: 40px;
  497. margin-bottom: 10px;
  498. }
  499. .drugsBox p {
  500. line-height: 30px;
  501. }
  502. .drugsOne {
  503. line-height: 24px;
  504. }
  505. .drugsOne span {
  506. margin-right: 20px;
  507. }
  508. .actionBar {
  509. display: flex;
  510. justify-content: space-between;
  511. line-height: 24px;
  512. padding: 0 10px;
  513. }
  514. .actionBar div {
  515. width: 150px;
  516. }
  517. </style>