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

drug_damage_print.vue 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. <table class="printTable" border="0" cellspacing="0" align="center">
  14. <thead class="print_head">
  15. <tr><td colspan="11">{{org_name}}</td></tr>
  16. <tr><td colspan="11">药品盘点</td></tr>
  17. </thead>
  18. <tbody class="print_body">
  19. <tr>
  20. <td>报损日期</td>
  21. <td>药品名称</td>
  22. <td>规格</td>
  23. <td>总损耗数量</td>
  24. <td>总报损金额</td>
  25. <td>仓库名称</td>
  26. <td>操作人</td>
  27. </tr>
  28. <tr v-for="(item,index) in tableList" :key="index">
  29. <td>
  30. {{getTime(item.start_time)}}
  31. </td>
  32. <td>
  33. {{item.drug_name}}
  34. </td>
  35. <td>
  36. {{item.specification_name}}
  37. </td>
  38. <td>
  39. {{getTotalCount(item.drug_id,item.max_unit,item.min_unit,item.min_number)}}
  40. </td>
  41. <td>
  42. {{getTotalPrice(item.drug_id,item.min_price)}}
  43. </td>
  44. <td>
  45. {{getHouseName(item.storehouse_id)}}
  46. </td>
  47. <td>
  48. {{getDoctorName(item.creater)}}
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  59. const moment = require('moment');
  60. import { uParseTime } from '@/utils/tools'
  61. import { getDrugDamageList } from "@/api/drug/drug"
  62. import print from "print-js";
  63. export default {
  64. components:{
  65. BreadCrumb
  66. },
  67. data(){
  68. return{
  69. crumbs: [
  70. { path: false, name: '库存管理' },
  71. { path: false, name: '耗材管理' },
  72. { path: false, name: '耗材盘点打印' },
  73. ],
  74. org_name: this.$store.getters.xt_user.org.org_name,
  75. ids:"",
  76. tableList:[],
  77. manufacturerList:[],
  78. houseList:[],
  79. datamageList:[],
  80. doctorList:[]
  81. }
  82. },
  83. methods:{
  84. printAction: function() {
  85. const style = '@page{size:landscape;margin: 10mm;} @media print { print_content{width:960px;margin:0} .flex{display: flex;justify-content: space-between;} .printTable{width:100%;border-collapse: collapse;border:0px;margin:10px 0;} .printTable thead{text-align:center}.printTable td{padding:5px;} .print_body tr td{border: 1px solid;font-size:12px;border-collapse:collapse;} }';
  86. printJS({
  87. printable: 'print_content',
  88. type: 'html',
  89. documentTitle: ' ',
  90. style: style,
  91. scanStyles: false
  92. })
  93. },
  94. getTime(val) {
  95. if(val < 0){
  96. return ""
  97. }
  98. if(val == ""){
  99. return ""
  100. }else {
  101. return uParseTime(val, '{y}-{m}-{d}')
  102. }
  103. },
  104. getlist(){
  105. var params = {
  106. limit:this.$route.query.limit,
  107. page:this.$route.query.page,
  108. start_time:this.$route.query.start_time,
  109. end_time:this.$route.query.end_time,
  110. keyword:this.$route.query.keyword,
  111. storehouse_id:this.$route.query.storehouse_id,
  112. }
  113. getDrugDamageList(params).then(response=>{
  114. if(response.data.state == 1){
  115. this.tableList = response.data.data.list
  116. this.total = response.data.data.total
  117. this.doctorList = response.data.data.doctorList
  118. var datamagelist = response.data.data.damagelist
  119. this.datamageList = datamagelist
  120. var obj = {id:0,storehouse_name:"全部"}
  121. this.houseList = []
  122. this.houseList.push(obj)
  123. for(let i=0;i<response.data.data.houseList.length;i++){
  124. this.houseList.push(response.data.data.houseList[i])
  125. }
  126. }
  127. })
  128. },
  129. getManufacturerName(id){
  130. var name = ""
  131. for(let i=0;i<this.manufacturerList.length;i++){
  132. if(id == this.manufacturerList[i].id){
  133. name = this.manufacturerList[i].manufacturer_name
  134. }
  135. }
  136. return name
  137. },
  138. getHouseName(id){
  139. var storehouse_name = ""
  140. for(let i=0;i<this.houseList.length;i++){
  141. if(id == this.houseList[i].id){
  142. storehouse_name = this.houseList[i].storehouse_name
  143. }
  144. }
  145. if(storehouse_name == "全部"){
  146. return ""
  147. }else{
  148. return storehouse_name
  149. }
  150. },
  151. getDamageCount(good_id){
  152. var count = 0
  153. for(let i=0;i<this.damageList.length;i++){
  154. if(good_id == this.damageList[i].good_id){
  155. count = this.damageList[i].count
  156. }
  157. }
  158. return count
  159. },
  160. getAllDamageCount(good_id,price){
  161. var count = 0
  162. for(let i=0;i<this.damageList.length;i++){
  163. if(good_id == this.damageList[i].good_id){
  164. count = this.damageList[i].count
  165. }
  166. }
  167. return (count * price).toFixed(2)
  168. },
  169. getStorehouseName(id){
  170. var storehouse_name = ""
  171. for(let i=0;i<this.houseList.length;i++){
  172. if(id == this.houseList[i].id){
  173. storehouse_name = this.houseList[i].storehouse_name
  174. }
  175. }
  176. if(storehouse_name == "全部"){
  177. return ""
  178. }else{
  179. return storehouse_name
  180. }
  181. },
  182. getTotalCount(drugid,max_unit,min_unit,min_number){
  183. var total = 0
  184. var str = ""
  185. var str_min = ""
  186. for(let i=0;i<this.datamageList.length;i++){
  187. if(drugid == this.datamageList[i].drug_id){
  188. total +=this.datamageList[i].count
  189. }
  190. }
  191. if(parseInt(total/min_number)!=0){
  192. str = parseInt(total/min_number) + max_unit
  193. }
  194. if((total%min_number)!=0){
  195. str_min = total%min_number + min_unit
  196. }
  197. return str+str_min
  198. },
  199. getTotalPrice(drugid,minprice){
  200. var total = 0
  201. for(let i=0;i<this.datamageList.length;i++){
  202. if(drugid == this.datamageList[i].drug_id){
  203. total+=this.datamageList[i].count
  204. }
  205. }
  206. return (total*minprice).toFixed(2)
  207. },
  208. getDoctorName(id){
  209. var user_name = ""
  210. for(let i=0;i<this.doctorList.length;i++){
  211. if(id == this.doctorList[i].admin_user_id){
  212. user_name = this.doctorList[i].user_name
  213. }
  214. }
  215. return user_name
  216. },
  217. },
  218. created(){
  219. this.getlist()
  220. }
  221. }
  222. </script>
  223. <style rel="stylesheet/scss" lang="scss" scoped>
  224. .printTitle{font-size: 22px;text-align: center;}
  225. .flex{display: flex;justify-content: space-between;}
  226. .tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
  227. .tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
  228. .tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
  229. .printTable{width:100%;border-collapse: collapse;}
  230. .printTable td{padding:5px;}
  231. .print_head{border: none;display: table-header-group;}
  232. .print_head tr td{text-align: center;border: none;}
  233. .print_body tr td{border:1px solid}
  234. </style>