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

drugPrint.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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: left;margin-bottom: 10px;">{{getDateOne()}}</div>
  14. <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
  15. <table class="print-table" border="1">
  16. <tbody>
  17. <tr>
  18. <td style="line-height: 50px" width="50">序号</td>
  19. <td style="line-height: 50px" width="250">药品名称</td>
  20. <td style="line-height: 50px" width="250">规格型号</td>
  21. <td style="line-height: 50px" width="50">单位</td>
  22. <td style="line-height: 50px" width="80">数量</td>
  23. <td style="line-height:50px" width="80">单价</td>
  24. <td style="line-height:50px" width="80">总价</td>
  25. <td style="line-height: 50px" width="">备 注</td>
  26. </tr>
  27. <tr v-for="(item,index) in cancelStockDate" :key="item.id">
  28. <td style="line-height: 50px">&nbsp;
  29. {{index+1}}
  30. </td>
  31. <td style="line-height: 50px">
  32. <span>{{item.XtBaseDrug.drug_name}}</span>
  33. </td>
  34. <td style="line-height: 50px">
  35. <!-- <span>{{item.drug_spec}}</span> -->
  36. <span>{{item.XtBaseDrug.dose}}{{item.XtBaseDrug.dose_unit}}*{{item.XtBaseDrug.min_number}}{{item.XtBaseDrug.min_unit}}/{{item.XtBaseDrug.max_unit}}</span>
  37. </td>
  38. <td style="line-height: 50px">
  39. <span>{{item.XtBaseDrug.min_unit}}</span>
  40. </td>
  41. <td style="line-height: 50px">
  42. {{getCount(item.drug_id)}}
  43. </td>
  44. <td style="line-height:50px">
  45. {{item.price}}
  46. </td>
  47. <td style="line-height:50px">
  48. {{(getCount(item.drug_id)*item.price).toFixed(2)}}
  49. </td>
  50. <td style="line-height: 50px">
  51. {{item.remark}}
  52. </td>
  53. </tr>
  54. </tbody>
  55. </table>
  56. <table class="print-table" border="1">
  57. <tbody>
  58. <tr>
  59. <td width="633" style="line-height: 50px">合计</td>
  60. <td width="80" style="line-height: 50px">{{getTotal().toFixed(2)}}</td>
  61. <td></td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. <div style="display:flex;margin-top:20px;float:right;">
  66. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  67. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  68. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  69. <div style="width:50px;">审核:</div><div style="width:100px;"></div>
  70. <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </template>
  77. <script>
  78. import { getPrintStockGood } from '@/api/stock'
  79. import { getDataConfig } from '@/utils/data'
  80. import { jsGetAge, uParseTime } from '@/utils/tools'
  81. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  82. import print from 'print-js'
  83. import { getDrugIndetail,getDrugWarehouseInfoPrint,getDrugCountList} from "@/api/drug/drug_stock"
  84. export default {
  85. name: 'dialysisPrintOrder',
  86. components: {
  87. BreadCrumb
  88. },
  89. data() {
  90. return {
  91. crumbs: [
  92. { path: false, name: '出入库明细' },
  93. { path: false, name: '打印单' }
  94. ],
  95. loading: false,
  96. orgname: '',
  97. totalPrice: 0,
  98. stockDatas: [],
  99. goodUnit: [],
  100. start_time: this.$route.query.start_time,
  101. end_time: this.$route.query.end_time,
  102. order_type:this.$route.query.order_type,
  103. manufacturer_id:this.$route.query.manufacturer_id,
  104. keyword:this.$route.query.keyword,
  105. limit:this.$route.query.limit,
  106. page:this.$route.query.page,
  107. cancelStockDate:[],
  108. minCount:[],
  109. }
  110. },
  111. methods: {
  112. getDateOne(){
  113. return "入库日期: "+this.start_time +"~"+this.end_time
  114. },
  115. getDateTwo(){
  116. var ptime = Math.round(new Date().getTime() / 1000)
  117. return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
  118. },
  119. getTime(value, temp) {
  120. if (value == 0) {
  121. return ''
  122. }
  123. if (value != undefined) {
  124. return uParseTime(value, temp)
  125. }
  126. return ''
  127. },
  128. printThisPage() {
  129. var ptime = Math.round(new Date().getTime() / 1000)
  130. this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
  131. 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;}'
  132. printJS({
  133. printable: 'dialysis-print-box',
  134. type: 'html',
  135. style: style,
  136. scanStyles: false
  137. })
  138. },
  139. getUnit(id){
  140. var name = ""
  141. for(let i=0;i<this.goodUnit.length;i++){
  142. if(this.goodUnit[i].id == id){
  143. name = this.goodUnit[i].name
  144. }
  145. }
  146. return name
  147. },
  148. getlist(){
  149. var params = {
  150. start_time:this.start_time,
  151. end_time:this.end_time,
  152. order_type:this.order_type,
  153. manufacturer_id:this.manufacturer_id,
  154. keyword:this.searchKey,
  155. limit:this.limit,
  156. page:this.page,
  157. }
  158. getDrugIndetail(params).then(response=>{
  159. if(response.data.state == 1){
  160. var drugInOrder = response.data.data.detail
  161. console.log("drug3434444",drugInOrder)
  162. let objInfo = {}
  163. drugInOrder.forEach((item,index)=>{
  164. let { drug_id } = item
  165. if(!objInfo[drug_id]){
  166. objInfo[drug_id] = {
  167. drug_id,
  168. child:[],
  169. drug_name:item.drug_name,
  170. drug_spec:item.drug_spec,
  171. min_unit:item.min_unit,
  172. warehousing_count:0,
  173. price:item.price,
  174. remark:item.remark,
  175. dose:item.dose,
  176. dose_unit:item.dose_unit,
  177. min_number:item.min_number,
  178. max_unit:item.max_unit
  179. }
  180. }
  181. })
  182. let list = Object.values(objInfo);
  183. console.log("list22333333",list)
  184. for(let i=0;i<drugInOrder.length;i++){
  185. list.map(item=>{
  186. if(drugInOrder[i].drug_id == item.drug_id){
  187. item.child.push(drugInOrder[i])
  188. }
  189. })
  190. }
  191. console.log("list2334444",list)
  192. for(let i=0;i<list.length;i++){
  193. for(let j=0;j<list[i].child.length;j++){
  194. if(list[i].child[j].warehousing_count!=null || list[i].child[j].warehousing_count != "" || list[i].child[j].warehousing_count!=0){
  195. list[i].warehousing_count += list[i].child[j].warehousing_count
  196. }
  197. }
  198. }
  199. // console.log("list666666666",list)
  200. this.cancelStockDate = list
  201. var total = response.data.data.total
  202. this.total = total
  203. }
  204. })
  205. },
  206. getTotal(){
  207. var total = 0
  208. for(let i=0;i<this.cancelStockDate.length;i++){
  209. total += this.cancelStockDate[i].price*getCount(this.cancelStockDate[i].drug_id)
  210. }
  211. return total
  212. },
  213. getDrugWarehouseInfoPrint(){
  214. var params = {
  215. start_time:this.start_time,
  216. end_time:this.end_time,
  217. order_type:this.order_type,
  218. }
  219. console.log("params2222",params)
  220. getDrugWarehouseInfoPrint(params).then(response=>{
  221. if(response.data.state == 1){
  222. var list = response.data.data.list
  223. console.log("入库单详情",list)
  224. this.cancelStockDate = list
  225. }
  226. })
  227. },
  228. getCount(drug_id){
  229. var total = 0
  230. for(let i=0;i<this.minCount.length;i++){
  231. if(drug_id == this.minCount[i].drug_id){
  232. total += this.minCount[i].warehousing_count
  233. }
  234. }
  235. return total
  236. },
  237. getDrugCountList(){
  238. var params = {
  239. keyword: this.keywords,
  240. start_time:this.start_time,
  241. end_time:this.end_time,
  242. }
  243. console.log("paramsw2ww",params)
  244. getDrugCountList(params).then(response=>{
  245. if(response.data.state == 1){
  246. var minCount = response.data.data.minCount
  247. console.log("minCount",minCount)
  248. this.minCount = minCount
  249. }
  250. })
  251. },
  252. },
  253. created() {
  254. var xtuser = this.$store.getters.xt_user
  255. this.orgname = xtuser.org.org_name
  256. // this.getlist()
  257. this.getDrugWarehouseInfoPrint()
  258. this.getDrugCountList()
  259. }
  260. }
  261. </script>
  262. <style>
  263. .dialysis-print-order {
  264. width: 960px;
  265. margin: 0 auto
  266. }
  267. .dialysis-print-order .order-yy-name {
  268. margin: auto;
  269. text-align: center;
  270. font-size: 20px;
  271. letter-spacing: 5px;
  272. }
  273. .dialysis-print-order .order-title {
  274. margin: auto;
  275. font-weight: 600;
  276. text-align: center;
  277. font-size: 22px;
  278. padding: 10px 20px 20px 20px;
  279. }
  280. .dialysis-print-order .table-box {
  281. width: 100%;
  282. line-height: 23px;
  283. font-size: 14px;
  284. }
  285. .dialysis-print-order .print-table {
  286. width: 100%;
  287. text-align: center;
  288. border-collapse: collapse;
  289. line-height: 40px;
  290. font-size: 14px;
  291. }
  292. .dialysis-print-order .print-table-no {
  293. width: 100%;
  294. text-align: center;
  295. border-collapse: collapse;
  296. font-size: 14px;
  297. }
  298. .dialysis-print-order .under-line {
  299. border-bottom: 1px solid #999;
  300. width: 95%;
  301. text-align: center;
  302. margin-left: 2px;
  303. }
  304. .dialysis-print-order .title-box {
  305. text-align: center;
  306. font-size: 16px;
  307. }
  308. .dialysis-print-order .radio-lebel-box {
  309. font-weight: 400;
  310. cursor: pointer;
  311. }
  312. .dialysis-print-order .radio-no {
  313. opacity: 0;
  314. outline: none;
  315. position: absolute;
  316. margin: 0;
  317. width: 0;
  318. height: 0;
  319. z-index: -1;
  320. }
  321. .dialysis-print-order .radio-inner {
  322. white-space: nowrap;
  323. cursor: pointer;
  324. outline: none;
  325. display: inline-block;
  326. line-height: 1;
  327. position: relative;
  328. vertical-align: middle;
  329. }
  330. .dialysis-print-order .radio-fang {
  331. display: inline-block;
  332. position: relative;
  333. border: 1px solid #000;
  334. box-sizing: border-box;
  335. width: 14px;
  336. height: 14px;
  337. background-color: #fff;
  338. z-index: 1;
  339. transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
  340. }
  341. .dialysis-print-order .is-checked-radio::after {
  342. content: "√";
  343. font-size: 15px;
  344. }
  345. .dialysis-print-order .print-table-no tr td {
  346. padding: 8px 5px;
  347. line-height: 25px;
  348. }
  349. .dialysis-print-order .print-table tr td {
  350. padding: 1px 1px;
  351. /*line-height: 25px;*/
  352. }
  353. .es-img {
  354. height: 25px;
  355. }
  356. .advice-name {
  357. text-align: left;
  358. }
  359. .advice-children {
  360. display: flex;
  361. }
  362. .title-box-pro {
  363. border: 0 #fff;
  364. line-height: 25px;
  365. height: 25px;
  366. text-align: left;
  367. padding-left: 10px !important;
  368. }
  369. .title-box-pro-tr {
  370. border: 0 #fff;
  371. }
  372. .text-align-left {
  373. text-align: left !important;
  374. padding-left: 10px !important;
  375. font-size: 14px !important;
  376. line-height: 25px;
  377. }
  378. .print-table-tr-new td {
  379. line-height: 20px !important;
  380. }
  381. .border-top-solid {
  382. border: solid 1px #000;
  383. }
  384. .print-template-two tr {
  385. line-height: 30px;
  386. }
  387. </style>