printFive.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <div id='prescriptionPrint'>
  3. <div v-for="(item,index) in advicePrint" :key="index">
  4. <div id='prescription-print' class="prescription-print" style="page-break-after: always;">
  5. <div class="printTitle" v-if="prescriptions[0].med_type == '1111'">{{orgname}}第一类精神处方笺</div>
  6. <div class="printTitle" v-if="prescriptions[0].med_type == '1112'">{{orgname}}第二类精神处方笺</div>
  7. <div class="printTitle" v-if="prescriptions[0].med_type != '1111' && prescriptions[0].med_type != '1112'">{{orgname}}处方笺</div>
  8. <div class="NoCell">
  9. <div><span style="font-size:20px;font-weight:bold;">No</span><div class="underLine" style="width:120px;"></div></div>
  10. <div style="display:flex;">
  11. <div style="display: flex;flex-direction: column-reverse;">开具日期</div>
  12. <div class="underLine" style="width:60px;">{{getTime(item.ctime)?getTime(item.ctime).split(' ')[0].slice(0,4):""}}</div><div style="display: flex;flex-direction: column-reverse;">年</div>
  13. <div class="underLine" style="width:60px;">{{getTime(item.ctime)?getTime(item.ctime).split(' ')[0].slice(5,7):""}}</div><div style="display: flex;flex-direction: column-reverse;">月</div>
  14. <div class="underLine" style="width:60px;">{{getTime(item.ctime)?getTime(item.ctime).split(' ')[0].slice(8,11):""}}</div><div style="display: flex;flex-direction: column-reverse;">日</div>
  15. </div>
  16. </div>
  17. <div class="basicCell">
  18. <span>透析号</span>
  19. <span class="underLine" style="width:100px;">{{ item.patient.dialysis_no ? item.patient.dialysis_no : '' }}</span>
  20. <span>治疗区</span>
  21. <span class="underLine" style="width:100px;">{{item.info?getDepart(item.info.departments):''}}</span>
  22. <span>费别</span>
  23. <span class="underLine" style="width:100px;"></span>
  24. </div>
  25. <div class="basicCell">
  26. <span>姓名</span>
  27. <span class="underLine" style="width:100px;">{{item.patient.name?item.patient.name:""}}</span>
  28. <span>性别</span>
  29. <span class="underLine" style="width:60px;">
  30. <span v-if="item.patient.gender == 1">男</span>
  31. <span v-if="item.patient.gender == 2">女</span>
  32. </span>
  33. <span>年龄</span>
  34. <span class="underLine" style="width:60px;">{{getAge(item.patient)?getAge(item.patient):""}}岁</span>
  35. <span>电话</span>
  36. <span class="underLine" style="width:120px;">{{item.patient.phone}}</span>
  37. </div>
  38. <div class="basicCell" style="margin-bottom:30px;">
  39. <span>临床诊断</span>
  40. <span class="underLine" style="width:100%;flex:1;text-align:left;padding-left:10px;">{{getDiagnosis(item.info.diagnosis)}}</span>
  41. </div>
  42. <div class="prescriptionBox" style="border-top: 1px solid #000;border-bottom: 1px solid #000;">
  43. <div class="Rp">Rp:</div>
  44. <div class="drugsBox" v-for="(it,index) in item.advices" :key="index">
  45. <!-- <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> -->
  46. <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>
  47. <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>
  48. </div>
  49. <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
  50. <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
  51. </div>
  52. <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
  53. <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.type == 2?getProjectName(it.project_id)?getProjectName(it.project_id):"":it.good_info.good_name}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</div>
  54. <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>
  55. </div>
  56. <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
  57. <div class="drugsOne">{{it.project_id?it.project_id:""}}:&nbsp;{{it.price.toFixed(2)}}元/{{it.count}}次</div>
  58. </div>
  59. <div style="text-align:center;" >(以下空白)</div>
  60. </div>
  61. <div class="NoCell" style="margin-top:20px;">
  62. <div style="display:flex;">
  63. <span>医师</span>
  64. <span class="underLine" style="width:100px;">{{item.doctor?item.doctor:""}}</span>
  65. </div>
  66. <div style="display:flex;">
  67. <span>金额</span>
  68. <span class="underLine" style="width:100px;">{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):0}}元</span>
  69. </div>
  70. </div>
  71. <div class="NoCell">
  72. <div style="display:flex;">
  73. <span>药师(审核、核对、发药)</span>
  74. <span class="underLine" style="width:100px;"></span>
  75. </div>
  76. <div style="display:flex;">
  77. <span>调配</span>
  78. <span class="underLine" style="width:100px;"></span>
  79. </div>
  80. </div>
  81. <div style="page-break-after:always"></div>
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import { jsGetAge, uParseTime } from '@/utils/tools'
  88. import {getAllDoctorList,getPrescriptionPrint,getHisPatientDetail} from "@/api/project/project"
  89. import {getInitData} from "@/api/his/his"
  90. export default {
  91. props:{
  92. patient_id:Number,
  93. record_date:String,
  94. prescription_id:Number,
  95. ids:String
  96. },
  97. data(){
  98. return {
  99. doctorList:[],
  100. advicePrint:{},
  101. patient:{},
  102. tableData:[],
  103. prescriptionInfo:[],
  104. hisPatient:{},
  105. department:[],
  106. prescriptions:[],
  107. projectList:[],
  108. orgname:"",
  109. diagnoses:[],
  110. org_id: 0
  111. }
  112. },
  113. methods:{
  114. getAge(patient){
  115. var thisLen = patient.id_card_no.length
  116. var birth = ''
  117. if (thisLen == 15) {
  118. birth = '19' + patient.id_card_no.substr(6, 6)
  119. } else {
  120. birth = patient.id_card_no.substr(6, 8)
  121. }
  122. var births =
  123. birth.substr(0, 4) +
  124. '-' +
  125. birth.substr(4, 2) +
  126. '-' +
  127. birth.substr(6, 2)
  128. return jsGetAge(births, '-')
  129. },
  130. getAllDoctorList(){
  131. getAllDoctorList().then(response=>{
  132. if(response.data.state == 1){
  133. var doctor = response.data.data.doctor
  134. this.doctorList = doctor
  135. }
  136. })
  137. },
  138. getDoctor(id){
  139. var name = ""
  140. for(let i=0;i<this.doctorList.length;i++){
  141. if(id == this.doctorList[i].admin_user_id){
  142. name = this.doctorList[i].user_name
  143. }
  144. }
  145. return name
  146. },
  147. getTime(value, temp) {
  148. if (value != undefined) {
  149. return uParseTime(value, temp)
  150. }
  151. return ''
  152. },
  153. getPrescriptionPrint(){
  154. var params = {
  155. // patient_id:this.patient_id,
  156. // record_date:this.record_date,
  157. // prescription_id:this.prescription_id,
  158. patient_id:this.patient_id,
  159. record_date:this.record_date,
  160. prescription_id:this.prescription_id,
  161. ids:this.ids
  162. }
  163. console.log("params",params)
  164. getPrescriptionPrint(params).then(response=>{
  165. if(response.data.state == 1){
  166. var advicePrint = response.data.data.advicePrint
  167. console.log("adviceprint9999",advicePrint)
  168. this.advicePrint = advicePrint
  169. this.prescriptions = advicePrint
  170. console.log("处方222222",this.prescriptions)
  171. var hisPatient = response.data.data.hisPatient
  172. console.log("hisPatient",hisPatient)
  173. this.hisPatient = hisPatient
  174. var projectlist = response.data.data.projectlist
  175. console.log("所有项目列表",projectlist)
  176. this.projectList = projectlist
  177. }
  178. })
  179. },
  180. getHisPatientDetail(){
  181. const params = {
  182. patient_id:this.patient_id
  183. }
  184. getHisPatientDetail(params).then(response=>{
  185. if(response.data.state == 1){
  186. var hisPatient = response.data.data.hisPatient
  187. console.log("挂号病人",hisPatient)
  188. this.hisPatient = hisPatient
  189. }
  190. })
  191. },
  192. getInitData(){
  193. getInitData().then(response=>{
  194. if(response.data.state == 1){
  195. this.department = response.data.data.department
  196. this.diagnoses = response.data.data.diagnose
  197. console.log("争端",this.diagnoses)
  198. }
  199. })
  200. },
  201. getDepart(id){
  202. var name = ""
  203. for(let i=0;i<this.department.length;i++){
  204. if(id == this.department[i].id){
  205. name = this.department[i].name
  206. }
  207. }
  208. return name
  209. },
  210. getTotalOne(id) {
  211. var total = 0
  212. var addtotal = 0
  213. for (let i = 0; i < this.prescriptions.length; i++) {
  214. if(id == this.prescriptions[i].id){
  215. if (this.prescriptions[i].project != null) {
  216. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  217. total = total + this.prescriptions[i].project[a].price * this.prescriptions[i].project[a].count
  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. for (let i = 0; i < this.prescriptions.length; i++) {
  229. if(id == this.prescriptions[i].id){
  230. if (this.prescriptions[i].advices != null) {
  231. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  232. total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
  233. }
  234. }
  235. if (this.prescriptions[i].additionalcharge != null) {
  236. for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
  237. addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
  238. }
  239. }
  240. addtotal = Math.floor(addtotal * 100) / 100
  241. }
  242. }
  243. return total + addtotal
  244. },
  245. getProjectName(id){
  246. var project_name = ""
  247. for(let i=0;i<this.projectList.length;i++){
  248. if(id == this.projectList[i].id){
  249. project_name = this.projectList[i].project_name
  250. }
  251. }
  252. return project_name
  253. },
  254. getDiagnosis(id){
  255. var name = ""
  256. for(let i=0;i<this.diagnoses.length;i++){
  257. if(id == this.diagnoses[i].id){
  258. name = this.diagnoses[i].class_name
  259. }
  260. }
  261. return name
  262. }
  263. },
  264. created(){
  265. this.getAllDoctorList()
  266. this.getInitData()
  267. this.getPrescriptionPrint()
  268. this.getHisPatientDetail()
  269. var xtuser = this.$store.getters.xt_user;
  270. this.orgname = xtuser.org.org_name;
  271. this.org_id = xtuser.org.id
  272. },
  273. watch:{
  274. ids:function(val){
  275. this.ids = val
  276. this.getPrescriptionPrint()
  277. }
  278. }
  279. }
  280. </script>
  281. <style lang="scss" scoped>
  282. .prescription-print{
  283. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
  284. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  285. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  286. margin-bottom: 20px;
  287. padding:20px 10px;
  288. }
  289. .printTitle{
  290. font-size: 22px;
  291. text-align: center;
  292. font-weight: bold;
  293. }
  294. .infoTitle{
  295. display: flex;
  296. border-bottom: 2px solid #000;
  297. margin-top:10px;
  298. line-height: 24px;
  299. padding:0 10px;
  300. }
  301. .infoTitle p{
  302. width: 200px;
  303. }
  304. .infoMain{
  305. display: flex;
  306. flex-wrap: wrap;
  307. border-bottom: 2px solid #000;
  308. padding:0 10px;
  309. }
  310. .infoMain div{
  311. width: 50%;
  312. line-height: 24px;
  313. }
  314. .prescriptionBox{
  315. padding:0 10px;
  316. min-height:450px;
  317. }
  318. .Rp{
  319. font-size: 22px;
  320. font-weight: bold;
  321. }
  322. .drugsBox{
  323. padding-left: 40px;
  324. margin-bottom: 10px;
  325. }
  326. .drugsBox div{
  327. line-height: 20px;
  328. }
  329. .drugsOne{
  330. line-height: 24px;
  331. }
  332. .drugsOne span{
  333. margin-right: 20px;
  334. }
  335. .doctorBox{
  336. display: flex;
  337. justify-content: space-between;
  338. padding:0 10px;
  339. line-height: 24px;
  340. border-bottom: 2px solid #000;
  341. }
  342. .actionBar{
  343. display: flex;
  344. justify-content: space-between;
  345. line-height: 24px;
  346. padding:0 10px;
  347. }
  348. .actionBar p{
  349. width:150px;
  350. }
  351. .NoCell{display: flex;justify-content: space-between;margin-bottom: 10px;}
  352. .underLine{display: inline-block;border-bottom: 1px solid #000;text-align: center;line-height: 24px;}
  353. .basicCell{display: flex;} .basicCell span{line-height: 24px;margin-bottom: 10px;}
  354. </style>