drugStockOutOrderDetailPrint.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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 warehousingOutInfo.warehousingOutData" :key="item.id">
  26. <td style="line-height: 50px">&nbsp;
  27. {{index+1}}
  28. </td>
  29. <td style="line-height: 50px">
  30. <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
  31. </td>
  32. <td style="line-height: 50px">
  33. <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
  34. </td>
  35. <td style="line-height: 50px">
  36. <span>{{getUnit(item.drug_id)}}</span>
  37. </td>
  38. <td style="line-height: 50px">
  39. {{item.count}}
  40. </td>
  41. <td style="line-height:50px">
  42. {{item.price}}
  43. </td>
  44. <td style="line-height:50px">
  45. {{(item.count * item.price).toFixed(2)}}
  46. </td>
  47. </tr>
  48. <tr>
  49. <td style="line-height:50px">合计</td>
  50. <td colspan="5"></td>
  51. <td>{{allPrice.toFixed(2)}}</td>
  52. </tr>
  53. </tbody>
  54. </table>
  55. <div style="display:flex;margin-top:20px;float:right;">
  56. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  57. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  58. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  59. <div style="width:50px;">审核:</div><div style="width:100px;"></div>
  60. <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. import { getPrintStockGood } from '@/api/stock'
  69. import { getDataConfig } from '@/utils/data'
  70. import { jsGetAge, uParseTime } from '@/utils/tools'
  71. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  72. import print from 'print-js'
  73. import { getDrugWarehouseOutInfo } from '@/api/drug/drug_stock'
  74. import {getBaseDrugLibList} from '@/api/data'
  75. export default {
  76. name: 'dialysisPrintOrder',
  77. components: {
  78. BreadCrumb
  79. },
  80. data() {
  81. return {
  82. crumbs: [
  83. { path: false, name: '出入库明细' },
  84. { path: false, name: '打印单' }
  85. ],
  86. isEdit: 0,
  87. checked: false,
  88. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  89. goodType: [],
  90. goodInfo: [],
  91. manufacturer: [],
  92. dealer: [],
  93. warehousingOutInfo: {
  94. loading: false,
  95. warehousingOutData: [],
  96. info: {}
  97. },
  98. allPrice:0,
  99. start_time:"",
  100. end_time:"",
  101. list:[],
  102. is_use:"",
  103. is_charge:"",
  104. is_inject:"",
  105. page:1,
  106. limit:10000,
  107. keywords:""
  108. }
  109. },
  110. methods: {
  111. getDateTwo(){
  112. var ptime = Math.round(new Date().getTime() / 1000)
  113. return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
  114. },
  115. getTime(value, temp) {
  116. if (value == 0) {
  117. return ''
  118. }
  119. if (value != undefined) {
  120. return uParseTime(value, temp)
  121. }
  122. return ''
  123. },
  124. printThisPage() {
  125. var ptime = Math.round(new Date().getTime() / 1000)
  126. this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
  127. 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;}'
  128. printJS({
  129. printable: 'dialysis-print-box',
  130. type: 'html',
  131. style: style,
  132. scanStyles: false
  133. })
  134. },
  135. getUnit(id){
  136. var name = ""
  137. for(let i=0;i<this.goodUnit.length;i++){
  138. if(this.goodUnit[i].id == id){
  139. name = this.goodUnit[i].name
  140. }
  141. }
  142. return name
  143. },
  144. GetOrderDetail: function(order_id) {
  145. const params = {
  146. 'id': order_id
  147. }
  148. getDrugWarehouseOutInfo(params).then(response => {
  149. if (response.data.state == 0) {
  150. this.$message.error(response.data.msg)
  151. return false
  152. } else {
  153. for (let i = 0; i < response.data.data.list.length; i++) {
  154. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  155. }
  156. var total_price = 0
  157. for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
  158. total_price += this.warehousingOutInfo.warehousingOutData[i].count * this.warehousingOutInfo.warehousingOutData[i].price
  159. }
  160. this.allPrice = total_price
  161. this.warehousingOutInfo.info = response.data.data.info
  162. this.handleSpanTempArr()
  163. }
  164. })
  165. },
  166. getList() {
  167. let params = {
  168. page: this.page,
  169. limit: this.limit,
  170. keyword: this.keywords,
  171. is_use: this.is_use,
  172. is_charge: this.is_charge,
  173. is_inject: this.is_inject
  174. }
  175. getBaseDrugLibList(params).then(response => {
  176. if (response.data.state == 0) {
  177. this.$message.error(response.data.msg)
  178. return false
  179. } else {
  180. this.total = response.data.data.total
  181. this.list = []
  182. for (let i = 0; i < response.data.data.list.length; i++) {
  183. this.list.push(response.data.data.list[i])
  184. }
  185. console.log("list222222",this.list)
  186. }
  187. })
  188. },
  189. getUnit(id){
  190. var name = ""
  191. for(let i=0;i<this.list.length;i++){
  192. if(this.list[i].id == id){
  193. name = this.list[i].min_unit
  194. }
  195. }
  196. return name
  197. },
  198. },
  199. created() {
  200. const order_id = this.$route.query.id
  201. this.GetOrderDetail(order_id)
  202. this.getList()
  203. }
  204. }
  205. </script>
  206. <style>
  207. .dialysis-print-order {
  208. width: 960px;
  209. margin: 0 auto
  210. }
  211. .dialysis-print-order .order-yy-name {
  212. margin: auto;
  213. text-align: center;
  214. font-size: 20px;
  215. letter-spacing: 5px;
  216. }
  217. .dialysis-print-order .order-title {
  218. margin: auto;
  219. font-weight: 600;
  220. text-align: center;
  221. font-size: 22px;
  222. padding: 10px 20px 20px 20px;
  223. }
  224. .dialysis-print-order .table-box {
  225. width: 100%;
  226. line-height: 23px;
  227. font-size: 14px;
  228. }
  229. .dialysis-print-order .print-table {
  230. width: 100%;
  231. text-align: center;
  232. border-collapse: collapse;
  233. line-height: 40px;
  234. font-size: 14px;
  235. }
  236. .dialysis-print-order .print-table-no {
  237. width: 100%;
  238. text-align: center;
  239. border-collapse: collapse;
  240. font-size: 14px;
  241. }
  242. .dialysis-print-order .under-line {
  243. border-bottom: 1px solid #999;
  244. width: 95%;
  245. text-align: center;
  246. margin-left: 2px;
  247. }
  248. .dialysis-print-order .title-box {
  249. text-align: center;
  250. font-size: 16px;
  251. }
  252. .dialysis-print-order .radio-lebel-box {
  253. font-weight: 400;
  254. cursor: pointer;
  255. }
  256. .dialysis-print-order .radio-no {
  257. opacity: 0;
  258. outline: none;
  259. position: absolute;
  260. margin: 0;
  261. width: 0;
  262. height: 0;
  263. z-index: -1;
  264. }
  265. .dialysis-print-order .radio-inner {
  266. white-space: nowrap;
  267. cursor: pointer;
  268. outline: none;
  269. display: inline-block;
  270. line-height: 1;
  271. position: relative;
  272. vertical-align: middle;
  273. }
  274. .dialysis-print-order .radio-fang {
  275. display: inline-block;
  276. position: relative;
  277. border: 1px solid #000;
  278. box-sizing: border-box;
  279. width: 14px;
  280. height: 14px;
  281. background-color: #fff;
  282. z-index: 1;
  283. transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
  284. }
  285. .dialysis-print-order .is-checked-radio::after {
  286. content: "√";
  287. font-size: 15px;
  288. }
  289. .dialysis-print-order .print-table-no tr td {
  290. padding: 8px 5px;
  291. line-height: 25px;
  292. }
  293. .dialysis-print-order .print-table tr td {
  294. padding: 1px 1px;
  295. /*line-height: 25px;*/
  296. }
  297. .es-img {
  298. height: 25px;
  299. }
  300. .advice-name {
  301. text-align: left;
  302. }
  303. .advice-children {
  304. display: flex;
  305. }
  306. .title-box-pro {
  307. border: 0 #fff;
  308. line-height: 25px;
  309. height: 25px;
  310. text-align: left;
  311. padding-left: 10px !important;
  312. }
  313. .title-box-pro-tr {
  314. border: 0 #fff;
  315. }
  316. .text-align-left {
  317. text-align: left !important;
  318. padding-left: 10px !important;
  319. font-size: 14px !important;
  320. line-height: 25px;
  321. }
  322. .print-table-tr-new td {
  323. line-height: 20px !important;
  324. }
  325. .border-top-solid {
  326. border: solid 1px #000;
  327. }
  328. .print-template-two tr {
  329. line-height: 30px;
  330. }
  331. </style>