printThree.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <template>
  2. <div>
  3. <div id='prescriptionPrint'>
  4. <div v-for="(item,index) in advicePrint" :key="index">
  5. <div id='prescription-print' v-if="item.project.length == 0" v-for='(i,pageIndex) in item.pageArr.length' :key="pageIndex" class="prescription-print" style="page-break-after: always;">
  6. <img src="../../../assets/img/bailinTop.jpg" style="width:100%" alt="">
  7. <div class="printTitle">处方笺</div>
  8. <div style="display:flex;">
  9. <div style="width:33%;display:flex;">费别:<span class="under_line">{{ faber && faber.transBody ? getName(faber.transBody.outputlist1) : '' }}</span></div>
  10. <div style="width:33%;display:flex;">电脑号:<span class="under_line">{{ faber && faber.transBody ? faber.transBody.aac999 : '' }}</span></div>
  11. <div style="width:33%;display:flex;">处方编号:<span class="under_line">{{ item.prescription_number.substring(item.prescription_number.length-6) }}</span></div>
  12. </div>
  13. <div class="infoTitle">
  14. <div>姓名:{{item.patient.name?item.patient.name:""}}</div>
  15. <div>性别:
  16. <span v-if="item.patient.gender == 1">男</span>
  17. <span v-if="item.patient.gender == 2">女</span>
  18. </div>
  19. <div>年龄:{{item.patient.age?item.patient.age:""}}岁</div>
  20. </div>
  21. <div class="infoMain">
  22. <div style="margin-bottom: 10px;display:flex;">门诊号码:<span class="under_line">{{hisPatient.number?hisPatient.number:""}}</span></div>
  23. <div style="margin-bottom: 10px;display:flex;">科别:<span class="under_line">{{item.info?getDepart(item.info.departments):''}}</span></div>
  24. <div style="margin-bottom: 10px;display:flex;">临床诊断:{{getDiagnosis(item.info.diagnosis)}}</div>
  25. <div style="margin-bottom: 10px;display:flex;">自费药品签名:<span class="under_line"></span></div>
  26. <!-- <div style="margin-bottom: 10px;display:flex;">医保卡号:{{item.hisPatient.number?item.hisPatient.number:""}}</div> -->
  27. <div style="margin-bottom: 10px;display:flex;">联系方式:<span class="under_line">{{item.patient.phone}}</span></div>
  28. <div style="margin-bottom: 10px;display:flex;">开具日期:<span class="under_line">{{getTime(item.pre_time) ? getTime(item.pre_time).split(' ')[0] : ''}}</span></div>
  29. <!-- <div>地址:{{item.patient.home_address}}</div> -->
  30. <!-- <div style="display:flex;width:50%;">临床诊断:{{getDiagnosis(item.info.diagnosis)}}</div> -->
  31. </div>
  32. <div class="prescriptionBox">
  33. <div class="Rp">Rp:</div>
  34. <div class="drugsBox" v-for="(it,index) in item.advices.slice(pageIndex * 5,(pageIndex * 5) + item.pageArr[pageIndex])" :key="index">
  35. <!-- <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> -->
  36. <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;<span v-if="it.drug.min_unit != it.drug.dose_unit">{{it.drug.dose}}{{it.drug.dose_unit}}&nbsp;* &nbsp;</span>{{it.drug.min_number}}{{it.drug.min_unit}}/{{it.drug.max_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div>
  37. <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.execution_frequency}}&nbsp;{{it.delivery_way}}&nbsp;</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
  38. </div>
  39. <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
  40. <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
  41. </div>
  42. <!-- <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
  43. <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{ it.type == 2 ? it.project.project_name : it.good_info.good_name }}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</div>
  44. <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.delivery_way}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
  45. </div>
  46. <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
  47. <div class="drugsOne">{{it.project_id?it.project_id:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
  48. </div> -->
  49. <div style="text-align:center;" >(以下空白)</div>
  50. </div>
  51. <div style="display:flex;">
  52. <div>医&nbsp;&nbsp;&nbsp;&nbsp;师:<span style="width:100px;display:inline-block;">{{item.doctor?item.doctor:""}}</span></div>
  53. <div>药品金额:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):0}}</div>
  54. </div>
  55. <div style="display:flex;">
  56. <div style="display:flex;">审核药师:<span style="width:100px" class="under_line"></span></div>
  57. <div style="display:flex;">调剂药师:<span style="width:100px" class="under_line"></span></div>
  58. <div style="display:flex;">核对/发药药师:<span style="width:100px" class="under_line"></span></div>
  59. </div>
  60. <div>
  61. 打印日期:{{getTime(new Date())?getTime(new Date()):""}}
  62. </div>
  63. <div>*处方当日有效,特殊情况可适当延长,一般不超过3天</div>
  64. <div>*药品属于特殊商品,非质量问题不允许退换</div>
  65. <img src="../../../assets/img/bailinBottom.jpg" style="width:100%" alt="">
  66. <!-- <div class="doctorBox">
  67. <p>医师:{{item.doctor?item.doctor:""}}</p>
  68. <p>日期:{{getTime(item.ctime)?getTime(item.ctime):""}}</p>
  69. </div>
  70. <div class="actionBar">
  71. <p>审核:</p>
  72. <p>配对:</p>
  73. <p>核对:</p>
  74. <p>发药:</p>
  75. <p>药费:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):0}}元</p>
  76. </div> -->
  77. <div style="page-break-after:always"></div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import { jsGetAge, uParseTime } from '@/utils/tools'
  85. import {getAllDoctorList,getPrescriptionPrint,getHisPatientDetail} from "@/api/project/project"
  86. import {getInitData} from "@/api/his/his"
  87. export default {
  88. props:{
  89. patient_id:Number,
  90. record_date:String,
  91. prescription_id:Number,
  92. ids:String
  93. },
  94. data(){
  95. return {
  96. doctorList:[],
  97. advicePrint:{},
  98. patient:{},
  99. tableData:[],
  100. prescriptionInfo:[],
  101. hisPatient:{},
  102. department:[],
  103. prescriptions:[],
  104. projectList:[],
  105. orgname:"",
  106. diagnoses:[],
  107. pageArr:[],
  108. faber:{}
  109. }
  110. },
  111. methods:{
  112. getAllDoctorList(){
  113. getAllDoctorList().then(response=>{
  114. if(response.data.state == 1){
  115. var doctor = response.data.data.doctor
  116. this.doctorList = doctor
  117. }
  118. })
  119. },
  120. getDoctor(id){
  121. var name = ""
  122. for(let i=0;i<this.doctorList.length;i++){
  123. if(id == this.doctorList[i].admin_user_id){
  124. name = this.doctorList[i].user_name
  125. }
  126. }
  127. return name
  128. },
  129. getTime(value, temp) {
  130. if (value != undefined) {
  131. return uParseTime(value, temp)
  132. }
  133. return ''
  134. },
  135. getPrescriptionPrint(){
  136. var params = {
  137. // patient_id:this.patient_id,
  138. // record_date:this.record_date,
  139. // prescription_id:this.prescription_id,
  140. patient_id:this.patient_id,
  141. record_date:this.record_date,
  142. prescription_id:this.prescription_id,
  143. ids:this.ids
  144. }
  145. console.log("params",params)
  146. getPrescriptionPrint(params).then(response=>{
  147. if(response.data.state == 1){
  148. var advicePrint = response.data.data.advicePrint
  149. console.log("adviceprint9999",advicePrint)
  150. this.advicePrint = advicePrint
  151. this.prescriptions = advicePrint
  152. console.log("处方222222",this.prescriptions)
  153. var hisPatient = response.data.data.hisPatient
  154. console.log("hisPatient",hisPatient)
  155. this.hisPatient = hisPatient
  156. var projectlist = response.data.data.projectlist
  157. console.log("所有项目列表",projectlist)
  158. this.projectList = projectlist
  159. this.getPage()
  160. let outputlist1Name = response.data.data.his.patient_info ? JSON.parse(response.data.data.his.patient_info) : {};
  161. this.faber = outputlist1Name
  162. }
  163. })
  164. },
  165. getHisPatientDetail(){
  166. const params = {
  167. patient_id:this.patient_id
  168. }
  169. getHisPatientDetail(params).then(response=>{
  170. if(response.data.state == 1){
  171. var hisPatient = response.data.data.hisPatient
  172. console.log("挂号病人",hisPatient)
  173. this.hisPatient = hisPatient
  174. }
  175. })
  176. },
  177. getInitData(){
  178. getInitData().then(response=>{
  179. if(response.data.state == 1){
  180. this.department = response.data.data.department
  181. this.diagnoses = response.data.data.diagnose
  182. console.log("争端",this.diagnoses)
  183. }
  184. })
  185. },
  186. getDepart(id){
  187. var name = ""
  188. for(let i=0;i<this.department.length;i++){
  189. if(id == this.department[i].id){
  190. name = this.department[i].name
  191. }
  192. }
  193. return name
  194. },
  195. getTotalOne(id) {
  196. var total = 0
  197. var addtotal = 0
  198. for (let i = 0; i < this.prescriptions.length; i++) {
  199. if(id == this.prescriptions[i].id){
  200. if (this.prescriptions[i].project != null) {
  201. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  202. total = total + this.prescriptions[i].project[a].price * this.prescriptions[i].project[a].count
  203. }
  204. }
  205. if (this.prescriptions[i].additionalcharge != null) {
  206. for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
  207. addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
  208. }
  209. }
  210. addtotal = Math.floor(addtotal * 100) / 100
  211. }
  212. }
  213. for (let i = 0; i < this.prescriptions.length; i++) {
  214. if(id == this.prescriptions[i].id){
  215. if (this.prescriptions[i].advices != null) {
  216. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  217. total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
  218. }
  219. }
  220. if (this.prescriptions[i].additionalcharge != null) {
  221. for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
  222. addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
  223. }
  224. }
  225. addtotal = Math.floor(addtotal * 100) / 100
  226. }
  227. }
  228. return total + addtotal
  229. },
  230. getProjectName(id){
  231. var project_name = ""
  232. for(let i=0;i<this.projectList.length;i++){
  233. if(id == this.projectList[i].id){
  234. project_name = this.projectList[i].project_name
  235. }
  236. }
  237. return project_name
  238. },
  239. getDiagnosis(id){
  240. var name = ""
  241. for(let i=0;i<this.diagnoses.length;i++){
  242. if(id == this.diagnoses[i].id){
  243. name = this.diagnoses[i].class_name
  244. }
  245. }
  246. return name
  247. },
  248. getPage(){
  249. this.page = 1
  250. this.pageArr = []
  251. this.advicePrint.map(item => {
  252. let arr = []
  253. item.pageArr = []
  254. if(item.advices.length <= 5){
  255. this.page = 1
  256. arr.push(item.advices.length)
  257. item.pageArr.push(arr)
  258. }else if(item.advices.length > 5){
  259. this.page = parseInt(item.advices.length / 5)
  260. let num = item.advices.length % 5
  261. for (var i=0;i<this.page;i++){
  262. item.pageArr.push([5])
  263. }
  264. if(num != 0){
  265. item.pageArr.push([num])
  266. }
  267. }
  268. })
  269. // console.log('this.pageArr',this.pageArr)
  270. },
  271. getName(list) {
  272. console.log('list',list)
  273. let new_list = []
  274. for (let i = 0; i < list.length; i++) {
  275. if (list[i].aac031 == '1') {
  276. new_list.push(list[i])
  277. }
  278. }
  279. switch (new_list[0].bcc334) {
  280. case "A31001":
  281. return "深圳医保1档"
  282. break
  283. case "A31002":
  284. return "深圳医保2档"
  285. break
  286. case "A31003":
  287. return "深圳医保3档"
  288. break
  289. case "A31004":
  290. return "二档(少儿)"
  291. break
  292. case "A31005":
  293. return "学生二档"
  294. break
  295. case "A31006":
  296. return "大学生二档"
  297. break
  298. case "A32001":
  299. return "在职公务员"
  300. break
  301. case "A32002":
  302. return "在职驻深公务员"
  303. break
  304. case "A39301":
  305. return "家属统筹医疗"
  306. break
  307. case "A41001":
  308. return "工伤在职"
  309. break
  310. case "A51001":
  311. return "生育在职"
  312. break
  313. case "A52001":
  314. return "生育医疗一档"
  315. break
  316. case "A52002":
  317. return "生育医疗一档"
  318. break
  319. case "C31001":
  320. return "一档医疗退休"
  321. break
  322. case "C31002":
  323. return "二档医疗退休"
  324. break
  325. }
  326. },
  327. },
  328. created(){
  329. this.getAllDoctorList()
  330. this.getInitData()
  331. this.getPrescriptionPrint()
  332. this.getHisPatientDetail()
  333. var xtuser = this.$store.getters.xt_user;
  334. this.orgname = xtuser.org.org_name;
  335. },
  336. watch:{
  337. ids:function(val){
  338. this.ids = val
  339. this.getPrescriptionPrint()
  340. }
  341. }
  342. }
  343. </script>
  344. <style lang="scss" scoped>
  345. .prescription-print{
  346. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
  347. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  348. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  349. margin-bottom: 20px;
  350. padding:20px 10px;
  351. }
  352. .printTitle{
  353. font-size: 22px;
  354. text-align: center;
  355. font-weight: bold;
  356. margin-bottom: 10px;
  357. }
  358. .infoTitle{
  359. display: flex;
  360. margin-top:10px;
  361. line-height: 24px;
  362. }
  363. .infoTitle div{
  364. width: 200px;
  365. }
  366. .infoMain{
  367. display: flex;
  368. flex-wrap: wrap;
  369. margin-top:10px;
  370. }
  371. .infoMain div{
  372. width: 50%;
  373. line-height: 24px;
  374. }
  375. .prescriptionBox{
  376. padding:0 10px;
  377. min-height:400px;
  378. }
  379. .Rp{
  380. font-size: 22px;
  381. font-weight: bold;
  382. }
  383. .drugsBox{
  384. padding-left: 40px;
  385. margin-bottom: 10px;
  386. }
  387. .drugsBox div{
  388. line-height: 20px;
  389. }
  390. .drugsOne{
  391. line-height: 24px;
  392. }
  393. .drugsOne span{
  394. margin-right: 20px;
  395. }
  396. .doctorBox{
  397. display: flex;
  398. justify-content: space-between;
  399. padding:0 10px;
  400. line-height: 24px;
  401. border-bottom: 2px solid #000;
  402. }
  403. .actionBar{
  404. display: flex;
  405. justify-content: space-between;
  406. line-height: 24px;
  407. padding:0 10px;
  408. }
  409. .actionBar p{
  410. width:150px;
  411. }
  412. .under_line{
  413. display: inline-block;
  414. border-bottom: 1px solid #000;
  415. flex: 1;
  416. }
  417. </style>