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

drugStockOutOrderDetailPrint.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  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" style="font-size:22px;font-weight:bold;letter-spacing:0px;">{{orgName}}</div>
  12. <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
  13. <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
  14. <table class="print-table" border="1">
  15. <tbody>
  16. <tr>
  17. <td style="line-height: 50px" width="250">药品名称</td>
  18. <td style="line-height: 50px" width="250">规格型号</td>
  19. <td style="line-height: 50px" width="50">单位</td>
  20. <td style="line-height: 50px" width="80">出货数量</td>
  21. <td style="line-height:50px" width="80">出库价格</td>
  22. <td style="line-height: 50px" width="">总价</td>
  23. <td style="line-height: 50px" width="">批号</td>
  24. <td style="line-height: 50px" width="">生产日期</td>
  25. <td style="line-height: 50px" width="">有效日期</td>
  26. </tr>
  27. <tr v-for="(item,index) in warehousingOutInfo.warehousingOutData" :key="item.id">
  28. <td style="line-height: 50px">
  29. <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
  30. </td>
  31. <td style="line-height: 50px">
  32. <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
  33. </td>
  34. <td style="line-height: 50px">
  35. <span>{{getUnit(item.drug_id)}}</span>
  36. </td>
  37. <td style="line-height: 50px">
  38. {{item.count}}
  39. </td>
  40. <td style="line-height:50px">
  41. {{item.price}}
  42. </td>
  43. <td style="line-height:50px">
  44. {{(item.count * item.price).toFixed(2)}}
  45. </td>
  46. <td>{{getNumber(item.drug_id)}}</td>
  47. <td>{{getProductDate(item.drug_id)}}</td>
  48. <td>{{getExpiryDate(item.drug_id)}}</td>
  49. </tr>
  50. <tr>
  51. <td style="line-height:50px">合计</td>
  52. <td colspan="7"></td>
  53. <td>{{allPrice.toFixed(2)}}</td>
  54. </tr>
  55. </tbody>
  56. </table>
  57. <div v-if="orgId != 10024" style="display:flex;margin-top:1px;float:right;">
  58. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  59. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  60. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  61. <div style="width:50px;">审核:</div><div style="width:100px;"></div>
  62. <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
  63. </div>
  64. <div v-if="orgId == 10024" style="display:flex;margin-top:1px;float:right;">
  65. <div style="width:50px;">科室:</div><div style="width:60px;"></div>
  66. <div style="width:70px;">领料人:</div><div style="width:60px;"></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 { getDrugWarehouseOutInfo,getDrugWarehouseOrderInfo } from '@/api/drug/drug_stock'
  84. import {getBaseDrugLibList} from '@/api/data'
  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. warehousingOutInfo: {
  104. loading: false,
  105. warehousingOutData: [],
  106. info: {}
  107. },
  108. allPrice:0,
  109. start_time:"",
  110. end_time:"",
  111. list:[],
  112. is_use:"",
  113. is_charge:"",
  114. is_inject:"",
  115. page:1,
  116. limit:10000,
  117. keywords:"",
  118. orgId:'',
  119. orgName:"",
  120. drugOrderList:[]
  121. }
  122. },
  123. methods: {
  124. getDateTwo(){
  125. var ptime = Math.round(new Date().getTime() / 1000);
  126. return "打印日期:"+uParseTime(ptime, '{y}-{m}-{d}')
  127. },
  128. getTime(value, temp) {
  129. if (value == 0) {
  130. return ''
  131. }
  132. if (value != undefined) {
  133. return uParseTime(value, temp)
  134. }
  135. return ''
  136. },
  137. printThisPage() {
  138. var ptime = Math.round(new Date().getTime() / 1000);
  139. this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}');
  140. 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;font-weight:bold;}.dialysis-print-order .order-title{margin:auto;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;}';
  141. printJS({
  142. printable: 'dialysis-print-box',
  143. type: 'html',
  144. style: style,
  145. scanStyles: false
  146. })
  147. },
  148. getUnit(id){
  149. var name = "";
  150. for(let i=0;i<this.goodUnit.length;i++){
  151. if(this.goodUnit[i].id == id){
  152. name = this.goodUnit[i].name
  153. }
  154. }
  155. return name
  156. },
  157. GetOrderDetail: function(order_id) {
  158. const params = {
  159. 'id': order_id
  160. };
  161. getDrugWarehouseOutInfo(params).then(response => {
  162. if (response.data.state == 0) {
  163. this.$message.error(response.data.msg);
  164. return false
  165. } else {
  166. for (let i = 0; i < response.data.data.list.length; i++) {
  167. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  168. }
  169. var total_price = 0;
  170. for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
  171. total_price += this.warehousingOutInfo.warehousingOutData[i].count * this.warehousingOutInfo.warehousingOutData[i].price
  172. }
  173. this.allPrice = total_price;
  174. this.warehousingOutInfo.info = response.data.data.info;
  175. this.handleSpanTempArr()
  176. }
  177. })
  178. },
  179. getList() {
  180. let params = {
  181. page: this.page,
  182. limit: this.limit,
  183. keyword: this.keywords,
  184. is_use: this.is_use,
  185. is_charge: this.is_charge,
  186. is_inject: this.is_inject
  187. };
  188. getBaseDrugLibList(params).then(response => {
  189. if (response.data.state == 0) {
  190. this.$message.error(response.data.msg);
  191. return false
  192. } else {
  193. this.total = response.data.data.total;
  194. this.list = [];
  195. for (let i = 0; i < response.data.data.list.length; i++) {
  196. this.list.push(response.data.data.list[i])
  197. }
  198. console.log("list222222",this.list)
  199. }
  200. })
  201. },
  202. getUnit(id){
  203. var name = "";
  204. for(let i=0;i<this.list.length;i++){
  205. if(this.list[i].id == id){
  206. name = this.list[i].min_unit
  207. }
  208. }
  209. return name
  210. },
  211. handleSpanTempArr(){
  212. this.tempArr = [];
  213. for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
  214. if (i === 0) {
  215. this.tempArr.push(1);
  216. this.pos = 0
  217. } else {
  218. // 判断当前元素与上一个元素是否相同
  219. if (this.warehousingOutInfo.warehousingOutData[i].drug_id === this.warehousingOutInfo.warehousingOutData[i - 1].drug_id) {
  220. this.tempArr[this.pos] += 1;
  221. this.tempArr.push(0)
  222. } else {
  223. this.tempArr.push(1);
  224. this.pos = i
  225. }
  226. }
  227. }
  228. let sameRowArr = [], sIdx = 0;
  229. this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
  230. item.index = index;
  231. if (index === 0) {
  232. sameRowArr.push([index])
  233. } else {
  234. if (item.drug_id === this.warehousingOutInfo.warehousingOutData[index - 1].drug_id) {
  235. sameRowArr[sIdx].push(index)
  236. } else {
  237. sIdx = sIdx + 1;
  238. sameRowArr.push([index])
  239. }
  240. }
  241. });
  242. this.sameRowArr = sameRowArr
  243. },
  244. getDrugWarehouseOrderInfo(){
  245. getDrugWarehouseOrderInfo().then(response=>{
  246. if(response.data.state == 1){
  247. var list = response.data.data.list
  248. console.log("入库单详情",list)
  249. this.drugOrderList = list
  250. }
  251. })
  252. },
  253. getNumber(id){
  254. var number = ""
  255. for(let i=0;i<this.drugOrderList.length;i++){
  256. if(id == this.drugOrderList[i].drug_id){
  257. number = this.drugOrderList[i].number
  258. }
  259. }
  260. return number
  261. },
  262. getProductDate(id){
  263. var product_date = ""
  264. for(let i=0;i<this.drugOrderList.length;i++){
  265. if(id == this.drugOrderList[i].drug_id){
  266. product_date = this.drugOrderList[i].product_date
  267. }
  268. }
  269. return this.getTime(product_date)
  270. },
  271. getExpiryDate(id){
  272. var expiry_date = ""
  273. for(let i=0;i<this.drugOrderList.length;i++){
  274. if(id == this.drugOrderList[i].drug_id){
  275. expiry_date = this.drugOrderList[i].expiry_date
  276. }
  277. }
  278. return this.getTime(expiry_date)
  279. },
  280. getTime(val) {
  281. if(val < 0){
  282. return ""
  283. }
  284. if(val == ""){
  285. return ""
  286. }else {
  287. return uParseTime(val, '{y}-{m}-{d}')
  288. }
  289. },
  290. },
  291. created() {
  292. this.orgName = this.$store.getters.xt_user.org.org_name;
  293. const order_id = this.$route.query.id;
  294. this.orgId = this.$store.getters.xt_user.org.id;
  295. this.GetOrderDetail(order_id);
  296. this.getList()
  297. this.getDrugWarehouseOrderInfo()
  298. }
  299. }
  300. </script>
  301. <style>
  302. .dialysis-print-order {
  303. width: 960px;
  304. margin: 0 auto
  305. }
  306. .dialysis-print-order .order-yy-name {
  307. margin: auto;
  308. text-align: center;
  309. font-size: 20px;
  310. letter-spacing: 5px;
  311. }
  312. .dialysis-print-order .order-title {
  313. margin: auto;
  314. font-weight: 600;
  315. text-align: center;
  316. font-size: 22px;
  317. padding: 10px 20px 20px 20px;
  318. }
  319. .dialysis-print-order .table-box {
  320. width: 100%;
  321. line-height: 23px;
  322. font-size: 14px;
  323. }
  324. .dialysis-print-order .print-table {
  325. width: 100%;
  326. text-align: center;
  327. border-collapse: collapse;
  328. line-height: 40px;
  329. font-size: 14px;
  330. }
  331. .dialysis-print-order .print-table-no {
  332. width: 100%;
  333. text-align: center;
  334. border-collapse: collapse;
  335. font-size: 14px;
  336. }
  337. .dialysis-print-order .under-line {
  338. border-bottom: 1px solid #999;
  339. width: 95%;
  340. text-align: center;
  341. margin-left: 2px;
  342. }
  343. .dialysis-print-order .title-box {
  344. text-align: center;
  345. font-size: 16px;
  346. }
  347. .dialysis-print-order .radio-lebel-box {
  348. font-weight: 400;
  349. cursor: pointer;
  350. }
  351. .dialysis-print-order .radio-no {
  352. opacity: 0;
  353. outline: none;
  354. position: absolute;
  355. margin: 0;
  356. width: 0;
  357. height: 0;
  358. z-index: -1;
  359. }
  360. .dialysis-print-order .radio-inner {
  361. white-space: nowrap;
  362. cursor: pointer;
  363. outline: none;
  364. display: inline-block;
  365. line-height: 1;
  366. position: relative;
  367. vertical-align: middle;
  368. }
  369. .dialysis-print-order .radio-fang {
  370. display: inline-block;
  371. position: relative;
  372. border: 1px solid #000;
  373. box-sizing: border-box;
  374. width: 14px;
  375. height: 14px;
  376. background-color: #fff;
  377. z-index: 1;
  378. transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
  379. }
  380. .dialysis-print-order .is-checked-radio::after {
  381. content: "√";
  382. font-size: 15px;
  383. }
  384. .dialysis-print-order .print-table-no tr td {
  385. padding: 8px 5px;
  386. line-height: 25px;
  387. }
  388. .dialysis-print-order .print-table tr td {
  389. padding: 1px 1px;
  390. /*line-height: 25px;*/
  391. }
  392. .es-img {
  393. height: 25px;
  394. }
  395. .advice-name {
  396. text-align: left;
  397. }
  398. .advice-children {
  399. display: flex;
  400. }
  401. .title-box-pro {
  402. border: 0 #fff;
  403. line-height: 25px;
  404. height: 25px;
  405. text-align: left;
  406. padding-left: 10px !important;
  407. }
  408. .title-box-pro-tr {
  409. border: 0 #fff;
  410. }
  411. .text-align-left {
  412. text-align: left !important;
  413. padding-left: 10px !important;
  414. font-size: 14px !important;
  415. line-height: 25px;
  416. }
  417. .print-table-tr-new td {
  418. line-height: 20px !important;
  419. }
  420. .border-top-solid {
  421. border: solid 1px #000;
  422. }
  423. .print-template-two tr {
  424. line-height: 30px;
  425. }
  426. </style>