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

stockPrint.vue 12KB

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