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

stockPrint.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-row style="float:right;">
  6. <el-col :span="24">
  7. <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
  8. </el-col>
  9. </el-row>
  10. </div>
  11. <div class="app-container" style="background-color: white;">
  12. <div id="print_content">
  13. <div class="print_main_content">
  14. <div class="order_title_panl">
  15. <span class="main_title">耗材管理查询表</span>
  16. </div>
  17. <div style="text-align:left;margin-bottom:20px;font-size: 18px;margin-bottom:-30px" v-if="org_id == 3907 || org_id == 9671">
  18. <span v-if="end_time!=''">查询日期:{{start_time}} ~</span> {{end_time}}
  19. </div>
  20. <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
  21. 打印时间:{{time_now}}
  22. </div>
  23. <div class="table_panel">
  24. <table class="table">
  25. <thead>
  26. <tr>
  27. <td width="80">耗材类型</td>
  28. <td width="80">耗材名称</td>
  29. <td width="80">规格&单位</td>
  30. <td width="80">国家编码</td>
  31. <td width="80">进货单价</td>
  32. <td width="80">生产商</td>
  33. <td width="80">入库数量</td>
  34. <td width="80">出库数量</td>
  35. <td width="80">剩余库存</td>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. <tr v-for='(item,index) in tableList' :key="index">
  40. <td style="text-align:center">{{getGoodType(item.good_type_id)}}</td>
  41. <td style="text-align:center">{{item.good_name }}</td>
  42. <td style="text-align:center"><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
  43. <td style="text-align:center">{{item.social_security_directory_code}}</td>
  44. <td style="text-align:center">{{item.buy_price}}</td>
  45. <td style="text-align:center">{{getManufacture(item.manufacturer)}}</td>
  46. <td style="text-align:center">
  47. <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
  48. </td>
  49. <td v-if="end_time == ''" style="text-align:center">
  50. <span v-if="org_id == 9671 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4 || org_id == 3877 || org_id == 10243 || org_id == 10088 || org_id== 10245 || org_id == 9779 || org_id == 10290 || org_id == 10265">
  51. <span>
  52. {{getWareInfo(item.xt_warehouse_info) - getOverFlushInfo(item.xt_warehouse_info) + getCancelSotckInfo(item.cancel_stock_info)}}
  53. </span>
  54. </span>
  55. <span v-else>{{getAutoCount(item.id) + getOutCount(item.id)}} </span>
  56. </td>
  57. <td v-if="end_time!=''" style="text-align:center">
  58. {{getAutoCount(item.id) + getOutCount(item.id)}}
  59. </td>
  60. <td v-if="end_time == ''" style="text-align:center">
  61. <span v-if="org_id == 9671 || org_id == 9675 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4 || org_id == 3877 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9779 || org_id == 10290 || org_id == 10265 || org_id == 10210">
  62. {{getOverFlushInfo(item.xt_warehouse_info)}}
  63. </span>
  64. <span v-else>
  65. {{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}
  66. </span>
  67. </td>
  68. <td v-if="end_time!=''" style="text-align:center">
  69. {{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}
  70. </td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  82. import { getAllStockList,GetAllGoodType,getStockDrugCount } from "@/api/stock";
  83. import print from 'print-js'
  84. const moment = require('moment')
  85. export default {
  86. components:{
  87. BreadCrumb
  88. },
  89. data(){
  90. return{
  91. crumbs: [
  92. { path: false, name: '库存管理' },
  93. { path: false, name: '库存查询' },
  94. { path: false, name: '库存查询打印' },
  95. ],
  96. start_time:"",
  97. end_time:"",
  98. drug_name:"",
  99. drug_spec:"",
  100. keyword:"",
  101. tableData:[],
  102. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  103. type_name:"",
  104. limit:"",
  105. page:"",
  106. WarehouseInfo: {
  107. loading: false,
  108. warehouseInfoDate: [],
  109. },
  110. tableList:[],
  111. goodType:[],
  112. manufacturerList:[],
  113. countList:[],
  114. outCountList:[],
  115. autoCountList:[],
  116. cancelCountList:[],
  117. org_id:0,
  118. }
  119. },
  120. methods:{
  121. printAction: function() {
  122. const style = '@media print { .print_main_content { background-color: white; width:960px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
  123. printJS({
  124. printable: 'print_content',
  125. type: 'html',
  126. documentTitle: ' ',
  127. style: style,
  128. scanStyles: false
  129. })
  130. },
  131. getlist(){
  132. const params = {
  133. page: this.page,
  134. limit: this.limit,
  135. keywords:this.keyword,
  136. start_time:this.start_time,
  137. end_time:this.end_time,
  138. type:this.type_name,
  139. }
  140. console.log("打印",params)
  141. getAllStockList(params).then(response=>{
  142. if(response.data.state == 1){
  143. var list = response.data.data.list
  144. this.tableList = list
  145. var total = response.data.data.total
  146. this.total = total
  147. var manufacturerList = response.data.data.manufacturerList
  148. this.manufacturerList = manufacturerList
  149. }
  150. })
  151. },
  152. GetAllGoodType() {
  153. GetAllGoodType().then(response => {
  154. if (response.data.state == 0) {
  155. this.$message.error(response.data.msg);
  156. return false;
  157. } else {
  158. for (let i = 0; i < response.data.data.goodType.length; i++) {
  159. this.goodType.push(response.data.data.goodType[i]);
  160. }
  161. }
  162. });
  163. },
  164. stockInCount: function(row) {
  165. let total = 0;
  166. for (let i = 0; i < row.query_warehousing_info.length; i++) {
  167. total = total + row.query_warehousing_info[i].warehousing_count;
  168. }
  169. return total;
  170. },
  171. salesReturnCount: function(row) {
  172. let total = 0;
  173. for (let i = 0; i < row.query_sales_return_info.length; i++) {
  174. total = total + row.query_sales_return_info[i].count;
  175. }
  176. return total;
  177. },
  178. stockOutCount: function(row) {
  179. let total = 0;
  180. for (let i = 0; i < row.query_warehouseout_info.length; i++) {
  181. total = total + row.query_warehouseout_info[i].count;
  182. }
  183. return total;
  184. },
  185. cancelStockCount: function(row) {
  186. let total = 0;
  187. for (let i = 0; i < row.query_cancel_stock_info.length; i++) {
  188. total = total + row.query_cancel_stock_info[i].count;
  189. }
  190. return total;
  191. },
  192. getGoodType(id){
  193. var name = ""
  194. for(let i=0;i<this.goodType.length;i++){
  195. if(id == this.goodType[i].id){
  196. name = this.goodType[i].type_name
  197. }
  198. }
  199. return name
  200. },
  201. getManufacture(id){
  202. var name = ""
  203. for(let i=0;i<this.manufacturerList.length;i++){
  204. if(id == this.manufacturerList[i].id){
  205. name = this.manufacturerList[i].manufacturer_name
  206. }
  207. }
  208. return name
  209. },
  210. getStockDrugCount(){
  211. var params ={
  212. keywords: this.keyword,
  213. start_time:this.start_time,
  214. end_time:this.end_time,
  215. }
  216. console.log("打印按钮",params)
  217. getStockDrugCount(params).then(response=>{
  218. if(response.data.state == 1){
  219. var count = response.data.data.count
  220. this.countList = count
  221. var outlist = response.data.data.outList
  222. this.outCountList = outlist
  223. var autoCount = response.data.data.autoCount
  224. this.autoCountList = autoCount
  225. var totalCount = response.data.data.totalCount
  226. this.cancelCountList = totalCount
  227. }
  228. })
  229. },
  230. getInCount(id){
  231. var count= ""
  232. for(let i=0;i<this.countList.length;i++){
  233. if(id == this.countList[i].good_id){
  234. count = this.countList[i].count
  235. }
  236. }
  237. return count
  238. },
  239. getOutCount(id){
  240. var count = ""
  241. for(let i=0;i<this.outCountList.length;i++){
  242. if(id == this.outCountList[i].good_id){
  243. count = this.outCountList[i].count
  244. }
  245. }
  246. return count
  247. },
  248. getAutoCount(id){
  249. var count= ""
  250. for(let i=0;i<this.autoCountList.length;i++){
  251. if(id == this.autoCountList[i].good_id){
  252. count = this.autoCountList[i].count
  253. }
  254. }
  255. return count
  256. },
  257. getCancelCount(id){
  258. var count = 0
  259. for(let i=0;i<this.cancelCountList.length;i++){
  260. if(id == this.cancelCountList[i].good_id){
  261. count = this.cancelCountList[i].count
  262. }
  263. }
  264. return count
  265. },
  266. getStockCount(id){
  267. var stock_count = 0
  268. for(let i=0;i<this.countList.length;i++){
  269. if(id == this.countList[i].good_id){
  270. stock_count = this.countList[i].stock_count
  271. }
  272. }
  273. return stock_count
  274. },
  275. getWareInfo(arr){
  276. var total = 0
  277. if(arr.length > 0){
  278. for(let i=0;i<arr.length;i++){
  279. total += parseInt(arr[i].warehousing_count)
  280. }
  281. }else{
  282. total = ""
  283. }
  284. return total
  285. },
  286. getOverplus(arr){
  287. var total = 0
  288. if(arr.length > 0){
  289. for(let i=0;i<arr.length;i++){
  290. total += arr[i].stock_count
  291. }
  292. }else{
  293. total = ""
  294. }
  295. return total
  296. },
  297. getCancelInfo(arr){
  298. var total = 0
  299. if(arr.length > 0){
  300. for(let i=0;i<arr.length;i++){
  301. total += arr[i].count
  302. }
  303. }else{
  304. total = ""
  305. }
  306. return total
  307. },
  308. getOverFlushInfo(arr){
  309. var total = 0
  310. if(arr.length >0){
  311. for(let i=0;i<arr.length;i++){
  312. total += arr[i].stock_count
  313. }
  314. }
  315. return total
  316. },
  317. getCancelSotckInfo(arr){
  318. var cancle_toal = 0
  319. if(arr.length >0){
  320. for(let z=0;z<arr.length;z++){
  321. cancle_toal += arr[z].count
  322. }
  323. }
  324. return cancle_toal
  325. }
  326. },
  327. created(){
  328. this.org_id = this.$store.getters.xt_user.org_id
  329. var starttime = this.$route.query.start_time
  330. this.start_time = starttime
  331. var endtime = this.$route.query.end_time
  332. this.end_time = endtime
  333. var type_name = parseInt(this.$route.query.type_name)
  334. this.type_name = type_name
  335. var keyword = this.$route.query.keyword
  336. this.keyword = keyword
  337. this.page = parseInt(this.$route.query.page)
  338. this.limit = parseInt(this.$route.query.limit)
  339. this.getlist()
  340. this.GetAllGoodType()
  341. this.getStockDrugCount()
  342. }
  343. }
  344. </script>
  345. <style rel="stylesheet/scss" lang="scss" scoped>
  346. .print_main_content {
  347. background-color: white;
  348. max-width: 1500px;
  349. margin: 0 auto;
  350. padding: 0 0 20px 0;
  351. .order_title_panl {
  352. text-align: center;
  353. .main_title {
  354. font-size: 18px;
  355. line-height: 40px;
  356. font-weight: 500;
  357. }
  358. }
  359. .table_panel {
  360. .table {
  361. width: 100%;
  362. border: 1px solid;
  363. border-collapse: collapse;
  364. padding: 2px;
  365. thead {
  366. tr {
  367. td {
  368. border: 1px solid;
  369. text-align: center;
  370. font-size: 18px;
  371. padding: 15px 5px;
  372. }
  373. }
  374. }
  375. tbody {
  376. tr {
  377. td {
  378. border: 1px solid;
  379. text-align: center;
  380. font-size: 18px;
  381. padding: 10px 5px;
  382. white-space: pre-line;
  383. .proj {
  384. padding: 5px 0;
  385. text-align: left;
  386. .proj_title {
  387. font-size: 16px;
  388. font-weight: 500;
  389. line-height: 25px;
  390. }
  391. .proj_item {
  392. font-size: 15px;
  393. line-height: 20px;
  394. .zone_name {
  395. font-weight: 500;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. }
  402. }
  403. }
  404. }
  405. </style>