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

print.vue 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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" v-if="type == 1">入库单</div>
  13. <div class="order-title" v-if="type == 2">出库单</div>
  14. <div class="order-title" v-if="type == 4">退库单</div>
  15. <div style="float: left;margin-bottom: 10px;">{{getDateOne()}}</div>
  16. <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
  17. <table class="print-table" border="1">
  18. <tbody>
  19. <tr>
  20. <td style="line-height: 50px" width="50">序号</td>
  21. <td style="line-height: 50px" width="200">耗材名称</td>
  22. <td style="line-height: 50px" width="200">规格型号</td>
  23. <td style="line-height: 50px" width="80">数量</td>
  24. <td style="line-height: 50px" width="50">单位</td>
  25. <td style="line-height:50px" width="80">
  26. <span v-if="type == 1">进货价</span>
  27. <span v-if="type == 2">出货价</span>
  28. <span v-if="type == 4">退库价</span>
  29. </td>
  30. <td style="line-height: 50px" width="80">总价</td>
  31. <td style="line-height: 50px" width="80">备 注</td>
  32. </tr>
  33. <tr v-for="(item,index) in stockDatas" :key="item.id">
  34. <td style="line-height: 50px">&nbsp;
  35. {{index+1}}
  36. </td>
  37. <td style="line-height: 50px">
  38. {{item.good_name}}
  39. </td>
  40. <td style="line-height: 50px">
  41. {{item.specification_name}}
  42. </td>
  43. <td style="line-height: 50px">
  44. <span v-if="type == 1"> {{ item.warehousing_count }}</span>
  45. <span v-if="type == 2">
  46. <span v-if="org_id == 3907 || org_id == 9919 || org_id == 9583">{{getStockCount(item.good_id) }}</span>
  47. <span v-if="org_id == 10265">{{getMySelfCount(item.good_id) }}</span>
  48. <span v-if="org_id!=3907&&org_id!=10265&&org_id!=10285&&org_id!=9583">{{getStockCount(item.good_id) }}</span>
  49. </span>
  50. <span v-if="type == 4"> {{ item.count }}</span>
  51. </td>
  52. <td style="line-height: 50px">
  53. {{item.packing_unit}}
  54. </td>
  55. <td style="line-height:50px">
  56. <span v-if="type == 1"> {{ item.price }}</span>
  57. <span v-if="type == 2">
  58. <span v-if="org_id == 9919">{{ item.buy_price }}</span>
  59. <span v-else>
  60. {{ item.packing_price }}
  61. </span>
  62. </span>
  63. <span v-if="type == 4"> {{ item.price }}</span>
  64. </td>
  65. <td style="line-height:50px">
  66. <span v-if="type == 1">{{(item.warehousing_count * item.price).toFixed(2)}}</span>
  67. <span v-if="type == 2">
  68. <span v-if="org_id == 3907 || org_id ==9919">
  69. {{(getStockCount(item.good_id) * item.buy_price).toFixed(2)}}
  70. </span>
  71. <span v-if="org_id == 10265">{{(getMySelfCount(item.good_id)*item.packing_price).toFixed(2)}}</span>
  72. <span v-if="org_id!=3907&&org_id!=10265&&org_id!=9919">{{(getStockCount(item.good_id) * item.packing_price).toFixed(2)}}</span>
  73. </span>
  74. <span v-if="type == 4">{{(item.count * item.price).toFixed(2)}}</span>
  75. </td>
  76. <td style="line-height: 50px">
  77. <span v-if="type == 1">{{item.remark}}</span>
  78. </td>
  79. </tr>
  80. </tbody>
  81. </table>
  82. <table class="print-table" border="1">
  83. <tr>
  84. <td style="line-height: 50px" width="50">合计</td>
  85. <td style="line-height: 50px" width="200"></td>
  86. <td style="line-height: 50px" width="200"></td>
  87. <td style="line-height: 50px" width="80"></td>
  88. <td style="line-height: 50px" width="50"></td>
  89. <td style="line-height: 50px" width="80"></td>
  90. <td style="line-height: 50px" width="80">
  91. <span v-if="type == 1">{{getWareInfoTotal().toFixed(2)}}</span>
  92. <span v-if="type == 2">
  93. <span v-if="org_id == 3907 || org_id == 9919">{{getWareOutTotalOne().toFixed(2)}}</span>
  94. <span v-if="org_id == 10265">{{getWareOutTotalSix().toFixed(2)}}</span>
  95. <span v-if="org_id!=3907 && org_id!=9919 && org_id!=10265"> {{getWareOutTotal().toFixed(2)}}</span>
  96. </span>
  97. <span v-if="type == 4">{{getWareOutTotal().toFixed(2)}}</span>
  98. </td>
  99. <td style="line-height: 50px" width="80">
  100. </td>
  101. </tr>
  102. </table>
  103. <div style="display:flex;margin-top:20px;float:right;">
  104. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  105. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  106. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  107. <div style="width:50px;">审核:</div><div style="width:100px;"></div>
  108. <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </template>
  115. <script>
  116. import { getPrintStockGood,getGoodDetailPrintList,getStockDetail } from '@/api/stock'
  117. import { getDataConfig } from '@/utils/data'
  118. import { jsGetAge, uParseTime } from '@/utils/tools'
  119. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  120. import print from 'print-js'
  121. export default {
  122. name: 'dialysisPrintOrder',
  123. components: {
  124. BreadCrumb
  125. },
  126. data() {
  127. return {
  128. crumbs: [
  129. { path: false, name: '出入库明细' },
  130. { path: false, name: '打印单' }
  131. ],
  132. loading: false,
  133. orgname: '',
  134. queryParams: {
  135. start_time: this.$route.query.start_time,
  136. end_time: this.$route.query.end_time,
  137. type: this.$route.query.type,
  138. limit:this.$route.query.limit,
  139. page:this.$route.query.page,
  140. },
  141. totalPrice: 0,
  142. stockDatas: [],
  143. goodUnit: [],
  144. type: this.$route.query.type,
  145. start_time: this.$route.query.start_time,
  146. end_time: this.$route.query.end_time,
  147. stockTotal:[],
  148. wareOutInfo:[],
  149. org_id:this.$store.getters.xt_user.org.id,
  150. informationList:[]
  151. }
  152. },
  153. methods: {
  154. getDateOne(){
  155. if (this.type == 1){
  156. return "入库日期: "+this.start_time +"~"+this.end_time
  157. }else if(this.type == 2){
  158. return "出库日期: "+this.start_time +"~"+this.end_time
  159. }else if(this.type == 3){
  160. return "出库日期: "+this.start_time +"~"+this.end_time
  161. }else if(this.type == 4){
  162. return "退库日期: "+this.start_time +"~"+this.end_time
  163. }
  164. },
  165. getDateTwo(){
  166. var ptime = Math.round(new Date().getTime() / 1000)
  167. return "印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
  168. },
  169. getTime(value, temp) {
  170. if (value == 0) {
  171. return ''
  172. }
  173. if (value != undefined) {
  174. return uParseTime(value, temp)
  175. }
  176. return ''
  177. },
  178. printThisPage() {
  179. var ptime = Math.round(new Date().getTime() / 1000)
  180. this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
  181. 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;}'
  182. printJS({
  183. printable: 'dialysis-print-box',
  184. type: 'html',
  185. style: style,
  186. scanStyles: false
  187. })
  188. },
  189. calCount(stock) {
  190. let total = 0
  191. var array = []
  192. if (this.type == 1) {
  193. array = stock.query_warehousing_info
  194. } else if (this.type == 2) {
  195. array = stock.query_sales_return_info
  196. } else if (this.type == 3) {
  197. array = stock.query_warehouseout_info
  198. } else if (this.type == 4) {
  199. array = stock.query_cancel_stock_info
  200. }
  201. for (let i = 0; i < array.length; i++) {
  202. if (this.type == 1) {
  203. total = total + array[i].warehousing_count
  204. } else if (this.type == 2) {
  205. total = total + array[i].count
  206. } else if (this.type == 3) {
  207. total = total + array[i].count
  208. } else if (this.type == 4) {
  209. total = total + array[i].count
  210. }
  211. }
  212. return total
  213. }, calTotal(stock) {
  214. console.log(stock)
  215. var array = []
  216. if (this.type == 1) {
  217. array = stock.query_warehousing_info
  218. } else if (this.type == 3) {
  219. array = stock.query_warehouseout_info
  220. }
  221. let total_price = 0.0
  222. for (let i = 0; i < array.length; i++) {
  223. if(this.type == 1) {
  224. total_price = total_price + array[i].warehousing_count * array[i].price
  225. }else if(this.type == 3){
  226. total_price = total_price + array[i].count * array[i].price
  227. }
  228. }
  229. return Math.floor(total_price * 100) / 100
  230. },
  231. calTotalPrice() {
  232. var amountPrice = 0
  233. for (let i = 0; i < this.stockDatas.length; i++) {
  234. var obj = this.stockDatas[i]
  235. var len = 0
  236. if (this.type == 1) {
  237. len = obj.query_warehousing_info.length
  238. } else if (this.type == 3) {
  239. len = obj.query_warehouseout_info.length
  240. }
  241. let total_price = 0.0
  242. for (let a = 0; a < len; a++) {
  243. if (this.type == 1) {
  244. total_price = total_price + obj.query_warehousing_info[a].total_price
  245. } else if (this.type == 3) {
  246. total_price = total_price + obj.query_warehouseout_info[a].total_price
  247. }
  248. }
  249. amountPrice = amountPrice + Math.floor(total_price* 100) / 100
  250. }
  251. return Math.floor(amountPrice* 100) / 100
  252. }, getTotal: function(price, total) {
  253. var m = 0, r1, r2
  254. var s1 = price.toString()
  255. var s2 = total.toString()
  256. try {
  257. m += s1.split('.')[1].length
  258. } catch (e) {
  259. }
  260. try {
  261. } catch (e) {
  262. m += s2.split('.')[1].length
  263. }
  264. r1 = Number(price.toString().replace('.', ''))
  265. r2 = Number(total.toString().replace('.', ''))
  266. return r1 * r2 / Math.pow(10, m)
  267. },
  268. getUnit(id){
  269. var name = ""
  270. for(let i=0;i<this.goodUnit.length;i++){
  271. if(this.goodUnit[i].id == id){
  272. name = this.goodUnit[i].name
  273. }
  274. }
  275. return name
  276. },
  277. getStockCount(id){
  278. var count = ""
  279. for(let i=0;i<this.stockTotal.length;i++){
  280. if(id == this.stockTotal[i].good_id){
  281. count = this.stockTotal[i].count
  282. }
  283. }
  284. return count
  285. },
  286. getWareOut(id){
  287. var count = ""
  288. for(let i=0;i<this.wareOutInfo.length;i++){
  289. if(id == this.wareOutInfo[i].good_id){
  290. count = this.wareOutInfo[i].count
  291. }
  292. }
  293. return count
  294. },
  295. getPrice(id){
  296. var sum = ""
  297. for(let i=0;i<this.informationList.length;i++){
  298. for(let j=0;j<this.wareOutInfo.length;j++){
  299. if(this.informationList[i].id == this.wareOutInfo[j].good_id){
  300. this.wareOutInfo[j].buy_price = this.informationList[i].buy_price
  301. }
  302. }
  303. }
  304. for(let j=0;j<this.wareOutInfo.length;j++){
  305. if(id == this.wareOutInfo[j].good_id){
  306. sum += (this.wareOutInfo[j].buy_price * this.wareOutInfo[j].count).toFixed(2)
  307. }
  308. }
  309. return sum
  310. },
  311. getReailPrice(id){
  312. var price = 0
  313. for(let i=0;i<this.informationList.length;i++){
  314. if(id == this.informationList[i].id){
  315. price = this.informationList[i].buy_price
  316. }
  317. }
  318. return price
  319. },
  320. getTotalPrice(){
  321. var total_price = 0
  322. for(let i=0;i<this.stockDatas.length;i++){
  323. total_price += (this.getStockCount(this.stockDatas[i].id) * this.getReailPrice(this.stockDatas[i].id))
  324. }
  325. return total_price
  326. },
  327. getTotalPriceOne(){
  328. var total_price = 0
  329. for(let i=0;i<this.stockDatas.length;i++){
  330. total_price +=(this.getWareOut(this.stockDatas[i].id) * this.getReailPrice(this.stockDatas[i].id))
  331. }
  332. return total_price
  333. },
  334. unique(arr) {
  335. const res = new Map();
  336. return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
  337. },
  338. getGoodDetailPrintList(){
  339. console.log("param232323232322332",this.queryParams)
  340. getGoodDetailPrintList(this.queryParams).then(response=>{
  341. if(response.data.state == 1){
  342. var list = response.data.data.list
  343. console.log("新的",list)
  344. this.stockDatas = list
  345. var stockTotal = response.data.data.stockTotal
  346. this.stockTotal = stockTotal
  347. }
  348. })
  349. },
  350. getStockDetail(){
  351. getStockDetail(this.queryParams).then(response=>{
  352. if(response.data.state == 1){
  353. var total = response.data.data.total
  354. var list = response.data.data.list
  355. this.stockDatas = list
  356. }
  357. })
  358. },
  359. getWareInfoTotal(){
  360. var total = 0
  361. for(let i=0;i<this.stockDatas.length;i++){
  362. total+= this.stockDatas[i].warehousing_count * this.stockDatas[i].price
  363. }
  364. return total
  365. },
  366. getWareOutTotal(){
  367. var total = 0
  368. for(let i=0;i<this.stockDatas.length;i++){
  369. total+= this.stockDatas[i].count * this.stockDatas[i].packing_price
  370. }
  371. return total
  372. },
  373. getWareOutTotalOne(){
  374. var total = 0
  375. for(let i=0;i<this.stockDatas.length;i++){
  376. total+= this.getStockCount(this.stockDatas[i].good_id) * this.stockDatas[i].buy_price
  377. }
  378. return total
  379. },
  380. getMySelfCount(good_id){
  381. var total = 0
  382. for(let i=0;i<this.stockDatas.length;i++){
  383. if(good_id == this.stockDatas[i].good_id){
  384. total+= this.stockDatas[i].count
  385. }
  386. }
  387. return total
  388. },
  389. getWareOutTotalSix(){
  390. var total = 0
  391. for(let i=0;i<this.stockDatas.length;i++){
  392. total+= this.getMySelfCount(this.stockDatas[i].good_id) * this.stockDatas[i].packing_price
  393. }
  394. return total
  395. },
  396. },
  397. created() {
  398. var xtuser = this.$store.getters.xt_user
  399. this.orgname = xtuser.org.org_name
  400. this.goodUnit = this.$store.getters.good_unit
  401. this.getGoodDetailPrintList()
  402. }
  403. }
  404. </script>
  405. <style>
  406. .dialysis-print-order {
  407. width: 960px;
  408. margin: 0 auto
  409. }
  410. .dialysis-print-order .order-yy-name {
  411. margin: auto;
  412. text-align: center;
  413. font-size: 20px;
  414. letter-spacing: 5px;
  415. }
  416. .dialysis-print-order .order-title {
  417. margin: auto;
  418. font-weight: 600;
  419. text-align: center;
  420. font-size: 22px;
  421. padding: 10px 20px 20px 20px;
  422. }
  423. .dialysis-print-order .table-box {
  424. width: 100%;
  425. line-height: 23px;
  426. font-size: 14px;
  427. }
  428. .dialysis-print-order .print-table {
  429. width: 100%;
  430. text-align: center;
  431. border-collapse: collapse;
  432. line-height: 40px;
  433. font-size: 14px;
  434. }
  435. .dialysis-print-order .print-table-no {
  436. width: 100%;
  437. text-align: center;
  438. border-collapse: collapse;
  439. font-size: 14px;
  440. }
  441. .dialysis-print-order .under-line {
  442. border-bottom: 1px solid #999;
  443. width: 95%;
  444. text-align: center;
  445. margin-left: 2px;
  446. }
  447. .dialysis-print-order .title-box {
  448. text-align: center;
  449. font-size: 16px;
  450. }
  451. .dialysis-print-order .radio-lebel-box {
  452. font-weight: 400;
  453. cursor: pointer;
  454. }
  455. .dialysis-print-order .radio-no {
  456. opacity: 0;
  457. outline: none;
  458. position: absolute;
  459. margin: 0;
  460. width: 0;
  461. height: 0;
  462. z-index: -1;
  463. }
  464. .dialysis-print-order .radio-inner {
  465. white-space: nowrap;
  466. cursor: pointer;
  467. outline: none;
  468. display: inline-block;
  469. line-height: 1;
  470. position: relative;
  471. vertical-align: middle;
  472. }
  473. .dialysis-print-order .radio-fang {
  474. display: inline-block;
  475. position: relative;
  476. border: 1px solid #000;
  477. box-sizing: border-box;
  478. width: 14px;
  479. height: 14px;
  480. background-color: #fff;
  481. z-index: 1;
  482. transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
  483. }
  484. .dialysis-print-order .is-checked-radio::after {
  485. content: "√";
  486. font-size: 15px;
  487. }
  488. .dialysis-print-order .print-table-no tr td {
  489. padding: 8px 5px;
  490. line-height: 25px;
  491. }
  492. .dialysis-print-order .print-table tr td {
  493. padding: 1px 1px;
  494. /*line-height: 25px;*/
  495. }
  496. .es-img {
  497. height: 25px;
  498. }
  499. .advice-name {
  500. text-align: left;
  501. }
  502. .advice-children {
  503. display: flex;
  504. }
  505. .title-box-pro {
  506. border: 0 #fff;
  507. line-height: 25px;
  508. height: 25px;
  509. text-align: left;
  510. padding-left: 10px !important;
  511. }
  512. .title-box-pro-tr {
  513. border: 0 #fff;
  514. }
  515. .text-align-left {
  516. text-align: left !important;
  517. padding-left: 10px !important;
  518. font-size: 14px !important;
  519. line-height: 25px;
  520. }
  521. .print-table-tr-new td {
  522. line-height: 20px !important;
  523. }
  524. .border-top-solid {
  525. border: solid 1px #000;
  526. }
  527. .print-template-two tr {
  528. line-height: 30px;
  529. }
  530. </style>