drugStockInOrderDetailPrint.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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 style="font-size:22px;font-weight:bold;text-align:center;">{{ orgName }}</div>
  12. <div class="order-title" style="font-size:18px;padding-top:0;">药品入库登记表</div>
  13. <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
  14. <table class="print-table" border="1">
  15. <tbody>
  16. <tr>
  17. <td width="80">药品名称</td>
  18. <td style="line-height:18px;" width="80">注册证号/批准文号/备案凭证号</td>
  19. <td style="line-height:18px;" width="80">规格<br>型号</td>
  20. <td style="line-height:18px;" width="80">生产<br>厂商</td>
  21. <td style="line-height:18px;" width="80">单位</td>
  22. <td style="line-height:18px;" width="80">进货价</td>
  23. <td style="line-height:18px;" width="80">入库<br>数量</td>
  24. <td style="line-height:18px;" width="60">总价</td>
  25. <td style="line-height:18px;" width="80">批号</td>
  26. <td style="line-height:18px;" width="120">生产日期</td>
  27. <td style="line-height:18px;" width="120">有效日期</td>
  28. <td style="line-height:18px;" width="60">质检<br>意见</td>
  29. <td style="line-height:18px;" width="60">验收<br>结论</td>
  30. </tr>
  31. <tr v-for="(item,index) in WarehouseInfo.warehouseInfoDate" :key="item.id">
  32. <td style="line-height: 18px">
  33. <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
  34. </td>
  35. <td style="line-height: 18px">{{ item.remark }}</td>
  36. <td style="line-height: 18px">
  37. <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
  38. </td>
  39. <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td>
  40. <td style="line-height: 18px">
  41. <span>{{getUnit(item.drug_id)}}</span>
  42. </td>
  43. <td style="line-height:18px">
  44. {{item.price}}
  45. </td>
  46. <td style="line-height: 18px">
  47. <span>{{ item.warehousing_count }}</span>
  48. </td>
  49. <td style="line-height:18px">
  50. <span>{{(item.warehousing_count * item.price).toFixed(2)}}</span>
  51. </td>
  52. <td style="line-height:18px">{{ item.number }}</td>
  53. <td style="line-height:18px">{{ item.product_date | parseTime("{y}-{m}-{d}") }}</td>
  54. <td style="line-height:18px">{{ item.expiry_date | parseTime("{y}-{m}-{d}") }}</td>
  55. <td style="line-height:18px">正常<br>入库</td>
  56. <td style="line-height:18px">合格</td>
  57. </tr>
  58. <tr>
  59. <td>合计</td>
  60. <td colspan="12" style="text-align:right;">{{allPrice.toFixed(2)}}</td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. <div style="display:flex;margin-top:20px;float:right;">
  65. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  66. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  67. <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
  68. <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
  69. <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(this.WarehouseInfo.warehouse.creater) }}</div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. <script>
  77. import { GetAllConfig,getPrintStockGood } from '@/api/stock'
  78. import { getDataConfig } from '@/utils/data'
  79. import { jsGetAge, uParseTime } from '@/utils/tools'
  80. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  81. import print from 'print-js'
  82. import {getDrugWarehouseInfoList} from "@/api/drug/drug_stock";
  83. import {getBaseDrugLibList} from '@/api/data'
  84. import { fetchAllAdminUsers } from "@/api/doctor";
  85. export default {
  86. name: 'dialysisPrintOrder',
  87. components: {
  88. BreadCrumb
  89. },
  90. data() {
  91. return {
  92. crumbs: [
  93. { path: false, name: '出入库明细' },
  94. { path: false, name: '打印单' }
  95. ],
  96. isEdit: 0,
  97. checked: false,
  98. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  99. goodType: [],
  100. goodInfo: [],
  101. manufacturer: [],
  102. dealer: [],
  103. Warehouse: {
  104. loading: false,
  105. warehouseDate: [],
  106. tableCurrentIndex: ""
  107. },
  108. WarehouseInfo: {
  109. loading: false,
  110. warehouseInfoDate: [],
  111. warehouse: {}
  112. },
  113. allPrice:0,
  114. start_time:"",
  115. end_time:"",
  116. list:[],
  117. is_use:"",
  118. is_charge:"",
  119. is_inject:"",
  120. page:1,
  121. limit:10000,
  122. keywords:"",
  123. orgName:'',
  124. orgId:'',
  125. adminUserOptions:[]
  126. }
  127. },
  128. methods: {
  129. getDateOne(){
  130. return "入库日期: "+this.start_time +"~"+this.end_time
  131. },
  132. getDateTwo(){
  133. var ptime = Math.round(new Date().getTime() / 1000)
  134. return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
  135. },
  136. getTime(value, temp) {
  137. if (value == 0) {
  138. return ''
  139. }
  140. if (value != undefined) {
  141. return uParseTime(value, temp)
  142. }
  143. return ''
  144. },
  145. printThisPage() {
  146. var ptime = Math.round(new Date().getTime() / 1000)
  147. this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
  148. 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: 1px 5px;} .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;}'
  149. printJS({
  150. printable: 'dialysis-print-box',
  151. type: 'html',
  152. style: style,
  153. scanStyles: false
  154. })
  155. },
  156. getUnit(id){
  157. var name = ""
  158. for(let i=0;i<this.goodUnit.length;i++){
  159. if(this.goodUnit[i].id == id){
  160. name = this.goodUnit[i].name
  161. }
  162. }
  163. return name
  164. },
  165. GetOrderDetail: function(order_id) {
  166. const params = {
  167. id: order_id
  168. };
  169. getDrugWarehouseInfoList(params).then(response => {
  170. if (response.data.state == 0) {
  171. this.$message.error(response.data.msg);
  172. return false;
  173. } else {
  174. for (let i = 0; i < response.data.data.info.length; i++) {
  175. this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
  176. }
  177. console.log("数据源",this.WarehouseInfo.warehouseInfoDate)
  178. var total_price = 0
  179. for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
  180. total_price += this.WarehouseInfo.warehouseInfoDate[i].warehousing_count * this.WarehouseInfo.warehouseInfoDate[i].price
  181. }
  182. console.log("total_price",total_price)
  183. this.allPrice = total_price
  184. this.WarehouseInfo.warehouse = response.data.data.warehousing;
  185. }
  186. });
  187. },
  188. getList() {
  189. let params = {
  190. page: this.page,
  191. limit: this.limit,
  192. keyword: this.keywords,
  193. is_use: this.is_use,
  194. is_charge: this.is_charge,
  195. is_inject: this.is_inject
  196. }
  197. getBaseDrugLibList(params).then(response => {
  198. if (response.data.state == 0) {
  199. this.$message.error(response.data.msg)
  200. return false
  201. } else {
  202. this.total = response.data.data.total
  203. this.list = []
  204. for (let i = 0; i < response.data.data.list.length; i++) {
  205. this.list.push(response.data.data.list[i])
  206. }
  207. console.log("list222222",this.list)
  208. }
  209. })
  210. },
  211. getUnit(id){
  212. var name = ""
  213. for(let i=0;i<this.list.length;i++){
  214. if(this.list[i].id == id){
  215. name = this.list[i].min_unit
  216. }
  217. }
  218. return name
  219. },
  220. getManufacturer(id){
  221. let name = ''
  222. this.manufacturer.map(item => {
  223. if(item.id == id){
  224. name = item.manufacturer_name
  225. }
  226. })
  227. return name
  228. },
  229. GetConfigInfo: function() {
  230. GetAllConfig().then(response => {
  231. if (response.data.state == 0) {
  232. this.$message.error(response.data.msg);
  233. return false;
  234. } else {
  235. this.manufacturer = response.data.data.manufacturer;
  236. }
  237. });
  238. },
  239. fetchAllAdminUsers() {
  240. fetchAllAdminUsers().then(response => {
  241. console.log(response);
  242. if (response.data.state == 1) {
  243. this.adminUserOptions = response.data.data.users;
  244. var alen = this.adminUserOptions.length;
  245. for (let index = 0; index < alen; index++) {
  246. if (this.adminUserOptions[index].user_type == 2) {
  247. // this.doctorOptions.push(this.adminUserOptions[index]);
  248. }
  249. }
  250. }
  251. });
  252. },
  253. getXuserName(id) {
  254. if (id <= 0) {
  255. return "";
  256. }
  257. var name = "";
  258. if (
  259. this.adminUserOptions == null ||
  260. typeof this.adminUserOptions.length === "undefined"
  261. ) {
  262. return name;
  263. }
  264. var leng = this.adminUserOptions.length;
  265. if (leng == 0) {
  266. return name;
  267. }
  268. for (let index = 0; index < leng; index++) {
  269. if (this.adminUserOptions[index].id == id) {
  270. name = this.adminUserOptions[index].name;
  271. break;
  272. }
  273. }
  274. return name;
  275. },
  276. },
  277. created() {
  278. this.orgName = this.$store.getters.xt_user.org.org_name;
  279. this.orgId = this.$store.getters.xt_user.org.id;
  280. this.fetchAllAdminUsers()
  281. this.GetConfigInfo()
  282. const order_id = this.$route.query.id;
  283. this.GetOrderDetail(order_id);
  284. this.getList()
  285. }
  286. }
  287. </script>
  288. <style>
  289. .dialysis-print-order {
  290. width: 960px;
  291. margin: 0 auto
  292. }
  293. .dialysis-print-order .order-yy-name {
  294. margin: auto;
  295. text-align: center;
  296. font-size: 20px;
  297. letter-spacing: 5px;
  298. }
  299. .dialysis-print-order .order-title {
  300. margin: auto;
  301. font-weight: 600;
  302. text-align: center;
  303. font-size: 22px;
  304. padding: 10px 20px 20px 20px;
  305. }
  306. .dialysis-print-order .table-box {
  307. width: 100%;
  308. line-height: 23px;
  309. font-size: 14px;
  310. }
  311. .dialysis-print-order .print-table {
  312. width: 100%;
  313. text-align: center;
  314. border-collapse: collapse;
  315. line-height: 40px;
  316. font-size: 14px;
  317. }
  318. .dialysis-print-order .print-table-no {
  319. width: 100%;
  320. text-align: center;
  321. border-collapse: collapse;
  322. font-size: 14px;
  323. }
  324. .dialysis-print-order .under-line {
  325. border-bottom: 1px solid #999;
  326. width: 95%;
  327. text-align: center;
  328. margin-left: 2px;
  329. }
  330. .dialysis-print-order .title-box {
  331. text-align: center;
  332. font-size: 16px;
  333. }
  334. .dialysis-print-order .radio-lebel-box {
  335. font-weight: 400;
  336. cursor: pointer;
  337. }
  338. .dialysis-print-order .radio-no {
  339. opacity: 0;
  340. outline: none;
  341. position: absolute;
  342. margin: 0;
  343. width: 0;
  344. height: 0;
  345. z-index: -1;
  346. }
  347. .dialysis-print-order .radio-inner {
  348. white-space: nowrap;
  349. cursor: pointer;
  350. outline: none;
  351. display: inline-block;
  352. line-height: 1;
  353. position: relative;
  354. vertical-align: middle;
  355. }
  356. .dialysis-print-order .radio-fang {
  357. display: inline-block;
  358. position: relative;
  359. border: 1px solid #000;
  360. box-sizing: border-box;
  361. width: 14px;
  362. height: 14px;
  363. background-color: #fff;
  364. z-index: 1;
  365. transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
  366. }
  367. .dialysis-print-order .is-checked-radio::after {
  368. content: "√";
  369. font-size: 15px;
  370. }
  371. .dialysis-print-order .print-table-no tr td {
  372. padding: 8px 5px;
  373. line-height: 25px;
  374. }
  375. .dialysis-print-order .print-table tr td {
  376. padding: 1px 1px;
  377. /*line-height: 25px;*/
  378. }
  379. .es-img {
  380. height: 25px;
  381. }
  382. .advice-name {
  383. text-align: left;
  384. }
  385. .advice-children {
  386. display: flex;
  387. }
  388. .title-box-pro {
  389. border: 0 #fff;
  390. line-height: 25px;
  391. height: 25px;
  392. text-align: left;
  393. padding-left: 10px !important;
  394. }
  395. .title-box-pro-tr {
  396. border: 0 #fff;
  397. }
  398. .text-align-left {
  399. text-align: left !important;
  400. padding-left: 10px !important;
  401. font-size: 14px !important;
  402. line-height: 25px;
  403. }
  404. .print-table-tr-new td {
  405. line-height: 20px !important;
  406. }
  407. .border-top-solid {
  408. border: solid 1px #000;
  409. }
  410. .print-template-two tr {
  411. line-height: 30px;
  412. }
  413. </style>