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

stockPrint.vue 15KB

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