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

drugStockOutOrderDetailPrint.vue 17KB

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