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

doctorAdviceStaticPrint.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-row style="float:right;">
  6. <el-col :span="24">
  7. <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
  8. </el-col>
  9. </el-row>
  10. </div>
  11. <div class="app-container" style="background-color: white;">
  12. <div id="print_content">
  13. <div class="print_main_content">
  14. <div class="order_title_panl">
  15. <span class="main_title"> &nbsp;
  16. 透析药品
  17. </span>
  18. <span style="float:right;">打印日期: &nbsp;
  19. {{$route.query.schedule_date}}
  20. </span>
  21. </div>
  22. <div class="table_panel">
  23. <table class="table">
  24. <thead>
  25. <tr>
  26. <td width="50">序号</td>
  27. <td width="100">药品名称</td>
  28. <td width="100">规格</td>
  29. <td width="100">数量</td>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <tr v-for="(item,i) in tableList" :key="i">
  34. <td>{{i+1}}</td>
  35. <td>{{item.advice_name}}</td>
  36. <td>{{item.specification_name}}</td>
  37. <td>
  38. <span v-if="config.is_open == 1">{{getHisCount(item.child,item.max_unit,item.min_unit,item.min_number)}}</span>
  39. <span v-if="config.is_open != 1">{{getCount(item.child)}}</span>
  40. </td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import { getDialysisAdviceToday } from '@/api/dialysis'
  52. import { parseTime } from '@/utils'
  53. import { uParseTime } from '@/utils/tools'
  54. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  55. import print from 'print-js'
  56. import { getDataConfig } from '@/utils/data'
  57. export default {
  58. name: 'SchedulePrint',
  59. data() {
  60. return {
  61. crumbs: [
  62. { path: false, name: '排班管理' },
  63. { path: false, name: '排班打印' }
  64. ],
  65. td_1_width: '8%',
  66. td_2_width: '8%',
  67. td_3_width: '64%',
  68. td_4_width: '20%',
  69. month: 1,
  70. begin_day: 1,
  71. total:[],
  72. list:[],
  73. schedule_date:"",
  74. schedule_type:0,
  75. partition_type:0,
  76. keywords:"",
  77. loading:false,
  78. tableData:[],
  79. numberList:[],
  80. partitionArr:[],
  81. his_config:{},
  82. typeList:[],
  83. rowList:[],
  84. dialysate_formulation:[],
  85. body_fluid_option:[],
  86. displace_liqui_part_option:[],
  87. blood_access_option:[],
  88. hemodialysisPipelinesOptions:[],
  89. tableList:[],
  90. druglist:[],
  91. config:{}
  92. }
  93. },
  94. components: {
  95. BreadCrumb
  96. },
  97. created() {
  98. this.getDialysisAdviceSchedudeList()
  99. },
  100. methods: {
  101. getDialysisAdviceSchedudeList() {
  102. var params = {
  103. schedule_type:this.$route.query.schedule_type,
  104. partion_type:this.$route.query.partion_type,
  105. selected_date:this.$route.query.schedule_date,
  106. }
  107. console.log("params2332232wo",params)
  108. getDialysisAdviceToday(params).then(response=>{
  109. if(response.data.state == 1){
  110. var doctorList = []
  111. var druglist = response.data.data.drug
  112. this.druglist = druglist
  113. this.startdialogVisible = true
  114. var list = response.data.data.list
  115. var config = response.data.data.config
  116. this.config = config
  117. if(list!=null && list.length > 0){
  118. for(let i=0;i<list.length;i++){
  119. for(let j=0;j<list[i].xt_doctor_advice.length;j++){
  120. doctorList.push(list[i].xt_doctor_advice[j])
  121. }
  122. }
  123. }
  124. if(config.is_open!=1){
  125. if(doctorList!=null && doctorList.length > 0){
  126. let dataInfo = {}
  127. doctorList.forEach((item, index) => {
  128. let { advice_name } = item
  129. if (!dataInfo[advice_name]) {
  130. dataInfo[advice_name] = {
  131. advice_name:item.advice_name,
  132. child: [],
  133. count:0,
  134. drug_id:item.drug_id,
  135. specification_name:item.advice_desc +item.drug_spec_unit,
  136. patient_id:item.patient_id,
  137. }
  138. }
  139. })
  140. let arr = Object.values(dataInfo)
  141. // console.log("arr23332323232",arr)
  142. if(arr.length > 0){
  143. for(let i=0;i<doctorList.length;i++){
  144. for(let j=0;j<arr.length;j++){
  145. if(doctorList[i].advice_name == arr[j].advice_name){
  146. arr[j].child.push(doctorList[i])
  147. }
  148. }
  149. }
  150. }
  151. this.tableList = []
  152. for(let i=0;i<list.length;i++){
  153. for(let j=0;j<arr.length;j++){
  154. if(list[i].patient_id == arr[j].patient_id){
  155. this.tableList.push(arr[j])
  156. }
  157. }
  158. }
  159. }
  160. }
  161. var his_doctor_advice = []
  162. for(let i=0;i<list.length;i++){
  163. for(let j=0;j<list[i].his_doctor_advice.length;j++){
  164. his_doctor_advice.push(list[i].his_doctor_advice[j])
  165. }
  166. }
  167. console.log("his_doctor_advice",his_doctor_advice)
  168. var newHisArr = []
  169. for(let i=0;i<his_doctor_advice.length;i++){
  170. his_doctor_advice[i].count_one = 0
  171. if(his_doctor_advice[i].prescribing_number_unit == his_doctor_advice[i].drug.max_unit){
  172. his_doctor_advice[i].prescribing_number = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
  173. his_doctor_advice[i].count_one = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
  174. }
  175. }
  176. for(let i=0;i<his_doctor_advice.length;i++){
  177. for(let j=0;j<druglist.length;j++){
  178. if(his_doctor_advice[i].drug_id == druglist[j].id){
  179. newHisArr.push(his_doctor_advice[i])
  180. }
  181. }
  182. }
  183. console.log("下盘子3223323223",newHisArr)
  184. if(config.is_open == 1){
  185. if(newHisArr!=null && newHisArr.length > 0){
  186. let dataInfoOne = {}
  187. newHisArr.forEach((item, index) => {
  188. let { advice_name } = item
  189. if (!dataInfoOne[advice_name]) {
  190. dataInfoOne[advice_name] = {
  191. advice_name:item.advice_name,
  192. child: [],
  193. count:0,
  194. specification_name:this.getSpecification(item.drug_id),
  195. drug_id:item.drug_id,
  196. patient_id:item.patient_id,
  197. min_number:item.drug.min_number,
  198. max_unit:item.drug.max_unit,
  199. min_unit:item.drug.min_unit
  200. }
  201. }
  202. })
  203. let hisarr = Object.values(dataInfoOne)
  204. console.log("hisarr233232233232",hisarr)
  205. if(hisarr.length > 0){
  206. for(let i=0;i<newHisArr.length;i++){
  207. for(let j=0;j<hisarr.length;j++){
  208. if(newHisArr[i].drug_id == hisarr[j].drug_id){
  209. hisarr[j].child.push(newHisArr[i])
  210. }
  211. }
  212. }
  213. }
  214. console.log("hisarr",hisarr)
  215. this.tableList = []
  216. this.tableList = hisarr
  217. }
  218. console.log("中国人民解放军",this.tableList)
  219. }
  220. }
  221. })
  222. },
  223. getTimeOne(val) {
  224. if(val == ""){
  225. return ""
  226. }else {
  227. return uParseTime(val, '{y}-{m}-{d}')
  228. }
  229. },
  230. getCount(val){
  231. var count = 0
  232. if(val!=null && val.length > 0){
  233. for(let i=0;i<val.length;i++){
  234. count += parseInt(val[i].prescribing_number)
  235. }
  236. }
  237. if(count > 0){
  238. return count
  239. }else{
  240. return 0
  241. }
  242. },
  243. printAction: function() {
  244. const style = '@media print { .print_main_content { background-color: white; width:960px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 20px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 18px; padding: 10px 5px; } .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
  245. printJS({
  246. printable: 'print_content',
  247. type: 'html',
  248. documentTitle: ' ',
  249. style: style,
  250. scanStyles: false
  251. })
  252. },
  253. getSpecification(id){
  254. var specification_name = ""
  255. for(let i=0;i<this.druglist.length;i++){
  256. if(id == this.druglist[i].id){
  257. specification_name = this.druglist[i].dose+this.druglist[i].dose_unit +"*"+this.druglist[i].min_number+this.druglist[i].min_unit +"/"+this.druglist[i].max_unit
  258. }
  259. }
  260. return specification_name
  261. },
  262. getHisCount(val,max_unit,min_unit,min_number){
  263. var total = 0
  264. var max_str = "";
  265. var min_str = "";
  266. for(let i=0;i<val.length;i++){
  267. total+=parseInt(val[i].prescribing_number)
  268. }
  269. if (total < min_number) {
  270. min_str = total + min_unit;
  271. }
  272. if (total == 0) {
  273. min_str = "";
  274. max_str = "";
  275. }
  276. if (total >= min_number) {
  277. if (parseInt(total / min_number) != 0) {
  278. max_str = parseInt(total / min_number) + max_unit;
  279. }
  280. if (total % min_number != 0) {
  281. min_str = (total % min_number) + min_unit;
  282. }
  283. }
  284. return max_str + min_str;
  285. },
  286. }
  287. }
  288. </script>
  289. <style rel="stylesheet/scss" lang="scss" scoped>
  290. .print_main_content {
  291. background-color: white;
  292. width: 960px;
  293. margin: 0 auto;
  294. padding: 0 0 20px 0;
  295. .order_title_panl {
  296. text-align: center;
  297. .main_title {
  298. font-size: 18px;
  299. line-height: 40px;
  300. font-weight: 500;
  301. }
  302. }
  303. .table_panel {
  304. .table {
  305. width: 100%;
  306. border: 1px solid;
  307. border-collapse: collapse;
  308. padding: 2px;
  309. thead {
  310. tr {
  311. td {
  312. border: 1px solid;
  313. text-align: center;
  314. font-size: 20px;
  315. padding: 15px 5px;
  316. }
  317. }
  318. }
  319. tbody {
  320. tr {
  321. td {
  322. border: 1px solid;
  323. text-align: center;
  324. font-size: 18px;
  325. padding: 10px 5px;
  326. .proj {
  327. padding: 5px 0;
  328. text-align: left;
  329. .proj_title {
  330. font-size: 16px;
  331. font-weight: 500;
  332. line-height: 25px;
  333. }
  334. .proj_item {
  335. font-size: 15px;
  336. line-height: 20px;
  337. .zone_name {
  338. font-weight: 500;
  339. }
  340. }
  341. }
  342. }
  343. }
  344. }
  345. }
  346. }
  347. }
  348. </style>