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

drugPrint.vue 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. <el-button :loading="loading" size="small" icon="el-icon-printer" @click="printThisPage" type="primary">打印
  6. </el-button>
  7. </div>
  8. <div class="app-container ">
  9. <div id="dialysis-print-box">
  10. <div class="dialysis-print-order">
  11. <div class="order-yy-name">{{orgname}}</div>
  12. <div class="order-title">入库单</div>
  13. <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
  14. <table class="print-table" border="1">
  15. <tbody>
  16. <tr>
  17. <td style="line-height: 50px" width="50">序号</td>
  18. <td style="line-height: 50px" width="250">药品名称</td>
  19. <td style="line-height: 50px" width="250">规格型号</td>
  20. <td style="line-height: 50px" width="50">单位</td>
  21. <td style="line-height: 50px" width="80">数量</td>
  22. <td style="line-height:50px" width="80">单价</td>
  23. <td style="line-height: 50px" width="">备 注</td>
  24. </tr>
  25. <tr v-for="(item,index) in cancelStockDate" :key="item.id">
  26. <td style="line-height: 50px">&nbsp;
  27. {{index+1}}
  28. </td>
  29. <td style="line-height: 50px">
  30. <span>{{item.drug_name}}</span>
  31. </td>
  32. <td style="line-height: 50px">
  33. <span>{{item.drug_spec}}</span>
  34. </td>
  35. <td style="line-height: 50px">
  36. <span>{{item.min_unit}}</span>
  37. </td>
  38. <td style="line-height: 50px">
  39. {{item.warehousing_count}}
  40. </td>
  41. <td style="line-height:50px">
  42. {{item.price}}
  43. </td>
  44. <td style="line-height: 50px">
  45. {{item.remark}}
  46. </td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. <table class="print-table" border="1">
  51. <tbody>
  52. <tr>
  53. <td width="633" style="line-height: 50px">合计</td>
  54. <td width="80" style="line-height: 50px">{{getTotal()}}</td>
  55. <td></td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. import { getPrintStockGood } from '@/api/stock'
  66. import { getDataConfig } from '@/utils/data'
  67. import { jsGetAge, uParseTime } from '@/utils/tools'
  68. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  69. import print from 'print-js'
  70. import { getDrugIndetail} from "@/api/drug/drug_stock"
  71. export default {
  72. name: 'dialysisPrintOrder',
  73. components: {
  74. BreadCrumb
  75. },
  76. data() {
  77. return {
  78. crumbs: [
  79. { path: false, name: '出入库明细' },
  80. { path: false, name: '打印单' }
  81. ],
  82. loading: false,
  83. orgname: '',
  84. totalPrice: 0,
  85. stockDatas: [],
  86. goodUnit: [],
  87. start_time: this.$route.query.start_time,
  88. end_time: this.$route.query.end_time,
  89. order_type:this.$route.query.order_type,
  90. manufacturer_id:this.$route.query.manufacturer_id,
  91. keyword:this.$route.query.keyword,
  92. limit:this.$route.query.limit,
  93. page:this.$route.query.page,
  94. cancelStockDate:[],
  95. }
  96. },
  97. methods: {
  98. getDateTwo(){
  99. var ptime = Math.round(new Date().getTime() / 1000)
  100. return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
  101. },
  102. getTime(value, temp) {
  103. if (value == 0) {
  104. return ''
  105. }
  106. if (value != undefined) {
  107. return uParseTime(value, temp)
  108. }
  109. return ''
  110. },
  111. printThisPage() {
  112. var ptime = Math.round(new Date().getTime() / 1000)
  113. this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
  114. const style = '@media print {.dialysis-print-order{width:960px;margin:0 auto}.dialysis-print-order .order-yy-name{margin:auto;text-align:center;font-size:20px;letter-spacing:5px}.dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px 20px 20px 20px}.dialysis-print-order .table-box{width:100%;line-height:23px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:25px;font-size:14px}.dialysis-print-order .print-table-no{width:100%;text-align:center;border-collapse:collapse;font-size:14px}.dialysis-print-order .under-line{border-bottom:1px solid #999;width:95%;text-align:center;margin-left:2px}.dialysis-print-order .title-box{text-align:center;font-size:16px;border:1px solid #666}.dialysis-print-order .radio-lebel-box{font-weight:400;cursor:pointer}.dialysis-print-order .radio-no{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.dialysis-print-order .radio-inner{white-space:nowrap;cursor:pointer;outline:0;display:inline-block;line-height:1;position:relative;vertical-align:middle}.dialysis-print-order .radio-fang{display:inline-block;position:relative;border:1px solid #000;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.dialysis-print-order .is-checked-radio::after{content:"√";font-size:15px}}.dialysis-print-order .print-table-no tr td { padding: 8px 5px; line-height: 25px; }.es-img{height: 20px; }.advice-name{text-align: left;}.advice-children{display:flex;} .dialysis-print-order .print-table tr td{padding: 0px 0px;} .print-template-two tr {line-height: 30px;} .title-box-pro{border: 0 #fff;line-height: 40px;height: 40px;text-align: left;padding-left: 10px !important;} .text-align-left{text-align: left !important;padding-left:10px !important;font-size: 14px !important;line-height: 25px;}'
  115. printJS({
  116. printable: 'dialysis-print-box',
  117. type: 'html',
  118. style: style,
  119. scanStyles: false
  120. })
  121. },
  122. getUnit(id){
  123. var name = ""
  124. for(let i=0;i<this.goodUnit.length;i++){
  125. if(this.goodUnit[i].id == id){
  126. name = this.goodUnit[i].name
  127. }
  128. }
  129. return name
  130. },
  131. getlist(){
  132. var params = {
  133. start_time:this.start_time,
  134. end_time:this.end_time,
  135. order_type:this.order_type,
  136. manufacturer_id:this.manufacturer_id,
  137. keyword:this.searchKey,
  138. limit:this.limit,
  139. page:this.page,
  140. }
  141. getDrugIndetail(params).then(response=>{
  142. if(response.data.state == 1){
  143. var drugInOrder = response.data.data.detail
  144. console.log("drug3434444",drugInOrder)
  145. this.cancelStockDate = drugInOrder
  146. var total = response.data.data.total
  147. this.total = total
  148. }
  149. })
  150. },
  151. getTotal(){
  152. var total = 0
  153. for(let i=0;i<this.cancelStockDate.length;i++){
  154. total += this.cancelStockDate[i].price
  155. }
  156. return total
  157. }
  158. },
  159. created() {
  160. var xtuser = this.$store.getters.xt_user
  161. this.orgname = xtuser.org.org_name
  162. this.getlist()
  163. }
  164. }
  165. </script>
  166. <style>
  167. .dialysis-print-order {
  168. width: 960px;
  169. margin: 0 auto
  170. }
  171. .dialysis-print-order .order-yy-name {
  172. margin: auto;
  173. text-align: center;
  174. font-size: 20px;
  175. letter-spacing: 5px;
  176. }
  177. .dialysis-print-order .order-title {
  178. margin: auto;
  179. font-weight: 600;
  180. text-align: center;
  181. font-size: 22px;
  182. padding: 10px 20px 20px 20px;
  183. }
  184. .dialysis-print-order .table-box {
  185. width: 100%;
  186. line-height: 23px;
  187. font-size: 14px;
  188. }
  189. .dialysis-print-order .print-table {
  190. width: 100%;
  191. text-align: center;
  192. border-collapse: collapse;
  193. line-height: 40px;
  194. font-size: 14px;
  195. }
  196. .dialysis-print-order .print-table-no {
  197. width: 100%;
  198. text-align: center;
  199. border-collapse: collapse;
  200. font-size: 14px;
  201. }
  202. .dialysis-print-order .under-line {
  203. border-bottom: 1px solid #999;
  204. width: 95%;
  205. text-align: center;
  206. margin-left: 2px;
  207. }
  208. .dialysis-print-order .title-box {
  209. text-align: center;
  210. font-size: 16px;
  211. }
  212. .dialysis-print-order .radio-lebel-box {
  213. font-weight: 400;
  214. cursor: pointer;
  215. }
  216. .dialysis-print-order .radio-no {
  217. opacity: 0;
  218. outline: none;
  219. position: absolute;
  220. margin: 0;
  221. width: 0;
  222. height: 0;
  223. z-index: -1;
  224. }
  225. .dialysis-print-order .radio-inner {
  226. white-space: nowrap;
  227. cursor: pointer;
  228. outline: none;
  229. display: inline-block;
  230. line-height: 1;
  231. position: relative;
  232. vertical-align: middle;
  233. }
  234. .dialysis-print-order .radio-fang {
  235. display: inline-block;
  236. position: relative;
  237. border: 1px solid #000;
  238. box-sizing: border-box;
  239. width: 14px;
  240. height: 14px;
  241. background-color: #fff;
  242. z-index: 1;
  243. transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
  244. }
  245. .dialysis-print-order .is-checked-radio::after {
  246. content: "√";
  247. font-size: 15px;
  248. }
  249. .dialysis-print-order .print-table-no tr td {
  250. padding: 8px 5px;
  251. line-height: 25px;
  252. }
  253. .dialysis-print-order .print-table tr td {
  254. padding: 1px 1px;
  255. /*line-height: 25px;*/
  256. }
  257. .es-img {
  258. height: 25px;
  259. }
  260. .advice-name {
  261. text-align: left;
  262. }
  263. .advice-children {
  264. display: flex;
  265. }
  266. .title-box-pro {
  267. border: 0 #fff;
  268. line-height: 25px;
  269. height: 25px;
  270. text-align: left;
  271. padding-left: 10px !important;
  272. }
  273. .title-box-pro-tr {
  274. border: 0 #fff;
  275. }
  276. .text-align-left {
  277. text-align: left !important;
  278. padding-left: 10px !important;
  279. font-size: 14px !important;
  280. line-height: 25px;
  281. }
  282. .print-table-tr-new td {
  283. line-height: 20px !important;
  284. }
  285. .border-top-solid {
  286. border: solid 1px #000;
  287. }
  288. .print-template-two tr {
  289. line-height: 30px;
  290. }
  291. </style>