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

printOne.vue 19KB

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