purchaseNewStockQueryPrint.vue 35KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  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;" v-loading="loading">
  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: 14px;margin-bottom:-30px">
  18. <span class="time_p">查询日期:{{start_time}} ~</span><span class="time_p">{{end_time}}</span>
  19. </div>
  20. <div style="text-align:right;margin-bottom:20px;font-size: 14px;">
  21. <span class="time_p"> 打印时间:{{time_now}}</span>
  22. </div>
  23. <div class="table_panel">
  24. <table class="table">
  25. <thead>
  26. <tr>
  27. <td rowspan="2" width="80">序号</td>
  28. <td rowspan="2" width="80" v-if="org_id==9956 || org_id == 0">耗材编码</td>
  29. <td rowspan="2" width="80">国家编码</td>
  30. <td rowspan="2" width="80">耗材名称</td>
  31. <td rowspan="2" width="80">耗材类型</td>
  32. <td rowspan="2" width="80">规格&单位</td>
  33. <td rowspan="2" width="80">生产厂商</td>
  34. <td rowspan="2" width="80">经销商</td>
  35. <td width="80" colspan="3">期初结余</td>
  36. <td width="80" colspan="3">本期增加</td>
  37. <td width="80" colspan="3">本期减少</td>
  38. <td width="80" colspan="3">期末结余</td>
  39. </tr>
  40. <tr>
  41. <td>数量</td>
  42. <td>进货金额</td>
  43. <td>销售金额</td>
  44. <td>数量</td>
  45. <td>进货金额</td>
  46. <td>销售金额</td>
  47. <td>数量</td>
  48. <td>进货金额</td>
  49. <td>销售金额</td>
  50. <td>数量</td>
  51. <td>进货金额</td>
  52. <td>销售金额</td>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. <tr v-for="(item,index) in this.tableList" :key="index">
  57. <td>{{index + 1}}</td>
  58. <td v-if="org_id==9956 || org_id== 0">{{item.good_number}}</td>
  59. <td>{{item.social_security_directory_code}}</td>
  60. <td>{{item.good_name}}</td>
  61. <td>{{getGoodTypeName(item.good_type_id)}}</td>
  62. <td>{{item.specification_name}}</td>
  63. <td> {{getManufacturName(item.manufacturer)}}</td>
  64. <td> {{getDearName(item.dealer)}}</td>
  65. <td>{{item.stockIn}}</td>
  66. <td>{{item.stock_in_price}}</td>
  67. <td>{{item.stockMoney}}</td>
  68. <td>{{item.stockAdd}}</td>
  69. <td>{{item.addStockMoney}}</td>
  70. <td>{{item.saleStockMoney}}</td>
  71. <td>{{item.outStock}}</td>
  72. <td>{{item.stockOutprice}}</td>
  73. <td>{{item.saleOutMoney}}</td>
  74. <td>{{item.overStock}}</td>
  75. <td>{{item.overPrice}}</td>
  76. <td>{{item.overMoney}}</td>
  77. </tr>
  78. </tbody>
  79. </table>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  88. import { getStorehouseList,getNewPurchaseStockQuery } from "@/api/drug/drug"
  89. import {
  90. getStockDrugCount
  91. } from "@/api/stock";
  92. import print from 'print-js'
  93. const moment = require('moment')
  94. export default {
  95. components:{
  96. BreadCrumb
  97. },
  98. data(){
  99. return{
  100. crumbs: [
  101. { path: false, name: '库存管理' },
  102. { path: false, name: '库存查询' },
  103. { path: false, name: '库存查询打印' },
  104. ],
  105. start_time:"",
  106. end_time:"",
  107. drug_name:"",
  108. drug_spec:"",
  109. keyword:"",
  110. tableData:[],
  111. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  112. type_name:"",
  113. limit:"",
  114. page:"",
  115. loading: false,
  116. warehouseInfoDate: [],
  117. tableList:[],
  118. good_type:[],
  119. manufacturerList:[],
  120. countList:[],
  121. outCountList:[],
  122. autoCountList:[],
  123. cancelCountList:[],
  124. org_id:0,
  125. goodTypeList:[],
  126. dealerList:[],
  127. query_type:0,
  128. }
  129. },
  130. methods:{
  131. printAction: function() {
  132. const style = '@media print { .print_main_content { background-color: white; width:1500px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .time_p{font-size:16px;} .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; } }'
  133. printJS({
  134. printable: 'print_content',
  135. type: 'html',
  136. documentTitle: ' ',
  137. style: style,
  138. scanStyles: false
  139. })
  140. },
  141. getStorehouseList(){
  142. getStorehouseList().then(response=>{
  143. if(response.data.state == 1){
  144. this.manufacturerList = response.data.data.manufacturerList
  145. var obj = {id:0,type_name:"全部"}
  146. this.goodTypeList.push(obj)
  147. var goodTypeList = response.data.data.goodTypeList
  148. for(let i=0;i<goodTypeList.length;i++){
  149. this.goodTypeList.push(goodTypeList[i])
  150. }
  151. this.dealerList = response.data.data.dealerList
  152. }
  153. })
  154. },
  155. getlist(){
  156. this.loading = true
  157. var params = {
  158. good_type:this.good_type,
  159. keyword:this.keyword,
  160. page:this.page,
  161. limit:this.limit,
  162. start_time:this.start_time,
  163. end_time:this.end_time,
  164. query_type:this.query_type,
  165. }
  166. getNewPurchaseStockQuery(params).then(response=>{
  167. if(response.data.state == 1){
  168. var list = response.data.data.list
  169. this.loading = false
  170. for(let i=0;i<list.length;i++){
  171. // list[i].stockIn = list[i].GoodStartFlowInfo.over_count
  172. if(this.org_id == 0 || this.org_id ==10210 || this.org_id == 10265){
  173. list[i].stockIn = list[i].GoodStartFlowInfo.over_count
  174. }else{
  175. if(list[i].id== 5052){
  176. list[i].stockIn = list[i].GoodStartFlowInfo.over_count
  177. }else{
  178. list[i].stockIn = this.getAllStockIn(list[i].StWarehousingInfoTwo) + this.getAllStockInFlow(list[i].WareStartInStockFlow) - this.getAllOutStockIn(list[i].WarehouseOutInfoTenty) - this.getAllStockOutFlow(list[i].WareStartOutStockFlow)
  179. if(list[i].stockIn <0){
  180. list[i].stockIn =0
  181. }
  182. }
  183. }
  184. if(this.org_id == 0 || this.org_id ==10697 || this.org_id == 9478){
  185. list[i].stock_in_price = list[i].buy_price
  186. list[i].stockMoney = (list[i].buy_price * list[i].stockIn).toFixed(2)
  187. }else if(this.org_id == 0 || this.org_id == 10644 || this.org_id == 10752){
  188. list[i].stock_in_price = "/"
  189. list[i].stockMoney = parseFloat(this.getAllStockInPrice(list[i].StWarehousingInfoTwo)) +parseFloat(this.getAllStockInFlowPrice(list[i].WareStartInStockFlow)) - parseFloat(this.getAllOutStockInPrice(list[i].WarehouseOutInfoTenty)) - parseFloat(this.getAllStockOutFlowPrice(list[i].WareStartOutStockFlow))
  190. if(list[i].stockMoney>0){
  191. list[i].stockMoney = list[i].stockMoney.toFixed(2)
  192. }
  193. } else{
  194. list[i].stock_in_price = "/"
  195. list[i].stockMoney = "/"
  196. }
  197. list[i].stockAdd = this.getWarehouseInfoOne(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)//期间增加
  198. if(this.org_id == 0 || this.org_id ==10697 || this.org_id == 9478){
  199. list[i].addStockMoney = list[i].buy_price
  200. list[i].saleStockMoney = (list[i].buy_price *list[i].stockAdd).toFixed(2)
  201. }else if(this.org_id == 0 || this.org_id == 10644 || this.org_id == 10752){
  202. list[i].addStockMoney = "/"
  203. list[i].saleStockMoney = this.getWarehouseInfoOnePrice(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)
  204. }else{
  205. list[i].addStockMoney = "/"
  206. list[i].saleStockMoney = "/"
  207. }
  208. list[i].outStock = this.getWarehosueOutInfo(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)//本期减少
  209. if(this.org_id == 0 || this.org_id == 10697 || this.org_id == 9478){
  210. list[i].stockOutprice = list[i].buy_price
  211. list[i].saleOutMoney = (list[i].buy_price * list[i].outStock).toFixed(2)
  212. }else if(this.org_id == 0 || this.org_id == 10644 || this.org_id == 10752){
  213. list[i].stockOutprice = "/"
  214. list[i].saleOutMoney = this.getWarehosueOutInfoPrice(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)
  215. if(list[i].saleOutMoney == "NaN"){
  216. list[i].saleOutMoney = ""
  217. }
  218. }else{
  219. list[i].stockOutprice = "/"
  220. list[i].saleOutMoney = "/"
  221. }
  222. if(this.org_id ==0 || this.org_id ==10265){
  223. list[i].overStock = list[i].GoodEndFlowInfo.over_count
  224. }else{
  225. list[i].overStock = list[i].stockIn + list[i].stockAdd - list[i].outStock
  226. }
  227. if(this.org_id == 0 || this.org_id ==10697 || this.org_id == 9478){
  228. list[i].overPrice = list[i].buy_price
  229. list[i].overMoney = (list[i].buy_price*list[i].overStock).toFixed(2)
  230. }else if(this.org_id == 0 || this.org_id == 10644 || this.org_id == 10752){
  231. list[i].overPrice = "/"
  232. console.log("stockMoney-00000000000000",list[i].stockMoney)
  233. console.log("saleStockMoney-00000000000000",list[i].saleStockMoney)
  234. console.log("saleOutMoney-00000000000000",list[i].saleOutMoney)
  235. list[i].overMoney = (parseFloat(list[i].stockMoney) + parseFloat(list[i].saleStockMoney) - parseFloat(list[i].saleOutMoney)).toFixed(2)
  236. if(list[i].overMoney == "NaN"){
  237. list[i].overMoney = ""
  238. }
  239. }else{
  240. list[i].overPrice = "/"
  241. list[i].overMoney = "/"
  242. }
  243. }
  244. var obj = {good_number:"",medical_insurance_level:"",social_security_directory_code:"合计",good_type_id:"",good_name:"",specification_name:"",packing_unit:"",manufacturer:"",dealer:"",stockIn:"",stock_in_price:"",stockMoney:0,outStock:"",stockOutprice:"",saleStockMoney:0,saleOutMoney:0,overStock:"",overPrice:"",overMoney:0}
  245. if(this.org_id == 0 || this.org_id == 10697 || this.org_id == 9478){
  246. if(list.length!=null){
  247. for(let i=0;i<list.length;i++){
  248. // obj.stock_in_price += (this.tableList[i].stock_in_price).toFixed(2)
  249. obj.stockMoney += parseFloat(list[i].stockMoney)
  250. // obj.stockOutprice += (this.tableList[i].stockOutprice).toFixed(2)
  251. obj.saleStockMoney += parseFloat(list[i].saleStockMoney)
  252. obj.saleOutMoney += parseFloat(list[i].saleOutMoney)
  253. // obj.overPrice += (this.tableList[i].overPrice).toFixed(2)
  254. obj.overMoney += parseFloat(list[i].overMoney)
  255. }
  256. obj.stockMoney = obj.stockMoney.toFixed(2)
  257. obj.saleStockMoney = obj.saleStockMoney.toFixed(2)
  258. obj.overMoney = obj.overMoney.toFixed(2)
  259. obj.saleOutMoney = obj.saleOutMoney.toFixed(2)
  260. list.push(obj)
  261. }
  262. }
  263. this.tableList = list
  264. this.manufacturerList = response.data.data.manufacturerList
  265. }
  266. })
  267. },
  268. getWarehouseInfoStartMoney(arr,arr1,arr2,arr3,arr4){
  269. var total_price = 0
  270. var total_price_one = 0
  271. var total_price_two = 0
  272. var total_price_three = 0
  273. var total_price_four = 0
  274. var total_price_all = 0
  275. if(arr!=null && arr.length >0){
  276. for(let i=0;i<arr.length;i++){
  277. total_price +=arr[i].count * arr[i].price
  278. }
  279. }
  280. if(arr1!=null && arr1.length > 0){
  281. for(let i=0;i<arr1.length;i++){
  282. total_price_one +=arr1[i].count * arr1[i].price
  283. }
  284. }
  285. if(arr2!=null && arr2.length > 0){
  286. for(let i=0;i<arr2.length;i++){
  287. total_price_two +=arr2[i].count * arr2[i].price
  288. }
  289. }
  290. if(arr3!=null && arr3.length > 0){
  291. for(let i=0;i<arr3.length;i++){
  292. total_price_three +=arr3[i].count * arr3[i].price
  293. }
  294. }
  295. if(arr4!=null && arr4.length > 0){
  296. for(let i=0;i<arr4.length;i++){
  297. total_price_four +=arr4[i].count * arr4[i].price
  298. }
  299. }
  300. total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
  301. if (total_price_all > 0) {
  302. return total_price_all.toFixed(2)
  303. }else{
  304. return "0.00"
  305. }
  306. },
  307. getWarehosueOutInfo(val,val2,val3){
  308. var count = 0
  309. var count_one = 0
  310. var all_count = 0
  311. var count_two = 0
  312. if(val!=null && val.length >0){
  313. for(let i=0;i<val.length;i++){
  314. count +=val[i].count
  315. }
  316. }
  317. if(val2!=null && val2.length > 0){
  318. for(let i=0;i<val2.length;i++){
  319. count_one +=val2[i].count
  320. }
  321. }
  322. if(val3!=null && val3.length > 0){
  323. for(let i=0;i<val3.length;i++){
  324. count_two +=val3[i].count
  325. }
  326. }
  327. all_count = count +count_one - count_two
  328. if(all_count >0){
  329. return all_count
  330. }else{
  331. return 0
  332. }
  333. },
  334. stockOutprice(val,val2,val3){
  335. var total_price = 0
  336. var total_price_one = 0
  337. var total_price_two = 0
  338. var all_price = 0
  339. if(val!=null && val.length >0){
  340. for(let i=0;i<val.length;i++){
  341. total_price +=val[i].count * val[i].buy_price
  342. }
  343. }
  344. if(val2!=null && val2.length > 0){
  345. for(let i=0;i<val2.length;i++){
  346. total_price_one +=val2[i].count * val2[i].buy_price
  347. }
  348. }
  349. if(val3!=null && val3.length > 0){
  350. for(let i=0;i<val3.length;i++){
  351. total_price_two +=val3[i].count * val3[i].buy_price
  352. }
  353. }
  354. all_price = total_price + total_price_one - total_price_two
  355. if(all_price >0){
  356. return all_price.toFixed(2)
  357. }else{
  358. return "0.00"
  359. }
  360. },
  361. saleOutprice(val,val2,val3){
  362. var total_price = 0
  363. var total_price_one = 0
  364. var all_price = 0
  365. var total_price_two = 0
  366. if(val!=null && val.length >0){
  367. for(let i=0;i<val.length;i++){
  368. total_price +=val[i].count * val[i].xt_warehouse_info.packing_price
  369. }
  370. }
  371. if(val2!=null && val2.length > 0){
  372. for(let i=0;i<val2.length;i++){
  373. total_price_one +=val2[i].count * val2[i].price
  374. }
  375. }
  376. if(val3!=null && val3.length > 0){
  377. for(let i=0;i<val3.length;i++){
  378. total_price_two +=val3[i].count * val3[i].price
  379. }
  380. }
  381. all_price = total_price + total_price_one - total_price_two
  382. if(all_price >0){
  383. return all_price.toFixed(2)
  384. }else{
  385. return "0.00"
  386. }
  387. },
  388. getEndWarehouseInfo(val,val3,val1,val2,val4){
  389. var count = 0
  390. var count_one = 0
  391. var count_two = 0
  392. var count_three =0
  393. var count_four = 0
  394. var all_count = 0
  395. if(val!=null && val.length >0){
  396. for(let i=0;i<val.length;i++){
  397. count +=val[i].count
  398. }
  399. }
  400. if(val1!=null&&val1.length >0){
  401. for(let i=0;i<val1.length;i++){
  402. count_one +=val1[i].count
  403. }
  404. }
  405. if(val3!=null&& val3.length > 0){
  406. for(let i=0;i<val3.length;i++){
  407. count_three +=val3[i].count
  408. }
  409. }
  410. if(val2!=null&&val2.length >0){
  411. for(let i=0;i<val2.length;i++){
  412. count_two +=val2[i].count
  413. }
  414. }
  415. if(val4!=null&&val4.length >0){
  416. for(let i=0;i<val4.length;i++){
  417. count_four +=val4[i].count
  418. }
  419. }
  420. all_count = count- count_three + count_one - count_two + count_four
  421. if(all_count >0){
  422. return all_count
  423. }else{
  424. return 0
  425. }
  426. },
  427. getEndWarehouseInfo(val,val3,val1,val2,val4){
  428. var count = 0
  429. var count_one = 0
  430. var count_two = 0
  431. var count_three =0
  432. var count_four = 0
  433. var all_count = 0
  434. if(val!=null && val.length >0){
  435. for(let i=0;i<val.length;i++){
  436. count +=val[i].count
  437. }
  438. }
  439. if(val1!=null&&val1.length >0){
  440. for(let i=0;i<val1.length;i++){
  441. count_one +=val1[i].count
  442. }
  443. }
  444. if(val3!=null&& val3.length > 0){
  445. for(let i=0;i<val3.length;i++){
  446. count_three +=val3[i].count
  447. }
  448. }
  449. if(val2!=null&&val2.length >0){
  450. for(let i=0;i<val2.length;i++){
  451. count_two +=val2[i].count
  452. }
  453. }
  454. if(val4!=null&&val4.length >0){
  455. for(let i=0;i<val4.length;i++){
  456. count_four +=val4[i].count
  457. }
  458. }
  459. all_count = count- count_three + count_one - count_two + count_four
  460. if(all_count >0){
  461. return all_count
  462. }else{
  463. return 0
  464. }
  465. },
  466. getEndSalePrice(val,val3,val1,val2,val4){
  467. var total_price = 0
  468. var total_price_one = 0
  469. var total_price_two = 0
  470. var total_price_three = 0
  471. var total_price_four = 0
  472. var all_price= 0
  473. if(val!=null && val.length >0){
  474. for(let i=0;i<val.length;i++){
  475. total_price +=val[i].count * val[i].price
  476. }
  477. }
  478. if(val1!=null && val1.length >0){
  479. for(let i=0;i<val1.length;i++){
  480. total_price_one +=val1[i].count * val1[i].price
  481. }
  482. }
  483. if(val3!=null && val3.length >0){
  484. for(let i=0;i<val3.length;i++){
  485. total_price_three +=val3[i].count * val3[i].price
  486. }
  487. }
  488. if(val2!=null && val2.length >0){
  489. for(let i=0;i<val2.length;i++){
  490. total_price_two +=val2[i].count * val2[i].price
  491. }
  492. }
  493. if(val4!=null && val4.length >0){
  494. for(let i=0;i<val4.length;i++){
  495. total_price_four +=val4[i].count * val4[i].price
  496. }
  497. }
  498. var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
  499. if(all_price >0){
  500. return all_price.toFixed(2)
  501. }else{
  502. return "0.00"
  503. }
  504. },
  505. getEndSalePrice(val,val3,val1,val2,val4){
  506. var total_price = 0
  507. var total_price_one = 0
  508. var total_price_two = 0
  509. var total_price_three = 0
  510. var total_price_four = 0
  511. var all_price= 0
  512. if(val!=null && val.length >0){
  513. for(let i=0;i<val.length;i++){
  514. total_price +=val[i].count * val[i].price
  515. }
  516. }
  517. if(val1!=null && val1.length >0){
  518. for(let i=0;i<val1.length;i++){
  519. total_price_one +=val1[i].count * val1[i].price
  520. }
  521. }
  522. if(val3!=null && val3.length >0){
  523. for(let i=0;i<val3.length;i++){
  524. total_price_three +=val3[i].count * val3[i].price
  525. }
  526. }
  527. if(val2!=null && val2.length >0){
  528. for(let i=0;i<val2.length;i++){
  529. total_price_two +=val2[i].count * val2[i].price
  530. }
  531. }
  532. if(val4!=null && val4.length >0){
  533. for(let i=0;i<val4.length;i++){
  534. total_price_four +=val4[i].count * val4[i].price
  535. }
  536. }
  537. var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
  538. if(all_price >0){
  539. return all_price.toFixed(2)
  540. }else{
  541. return 0
  542. }
  543. },
  544. getGoodTypeName(id){
  545. var type_name = ""
  546. for(let i=0;i<this.goodTypeList.length;i++){
  547. if(id == this.goodTypeList[i].id){
  548. type_name = this.goodTypeList[i].type_name
  549. }
  550. }
  551. if(type_name!="全部"){
  552. return type_name
  553. }
  554. },
  555. getWarehouseInfoStart(arr1,arr2,arr3,arr4,arr5){
  556. var count =0
  557. var countOne =0
  558. var countTwo= 0
  559. var countthree = 0 //期初
  560. var countfour = 0
  561. var countfive = 0
  562. if(arr1!=null && arr1.length > 0){
  563. for(let i=0;i<arr1.length;i++){
  564. countOne +=arr1[i].count
  565. }
  566. }
  567. if(arr2!=null && arr2.length > 0){
  568. for(let i=0;i<arr2.length;i++){
  569. countTwo +=arr2[i].count
  570. }
  571. }
  572. if(arr3!=null && arr3.length > 0){
  573. for(let i=0;i<arr3.length;i++){
  574. countthree +=arr3[i].count
  575. }
  576. }
  577. if(arr4!=null && arr4.length > 0){
  578. for(let i=0;i<arr4.length;i++){
  579. countfour +=arr4[i].count
  580. }
  581. }
  582. if(arr5!=null && arr5.length > 0){
  583. for(let i=0;i<arr5.length;i++){
  584. countfive +=arr5[i].count
  585. }
  586. }
  587. console.log("countOne",countOne)
  588. console.log("countTwo",countTwo)
  589. console.log("countthree",countthree)
  590. console.log("countfour",countfour)
  591. console.log("*********************")
  592. count = countOne - countTwo + countthree - countfour + countfive
  593. if(count > 0 ){
  594. return count
  595. }else{
  596. return 0
  597. }
  598. },
  599. getWarehouseInfoStartPrice(arr,arr1,arr2,arr3,arr4){
  600. var total_price = 0
  601. var total_price_one = 0
  602. var total_price_two = 0
  603. var total_price_three = 0
  604. var total_price_four = 0
  605. var total_price_all = 0
  606. if(arr!=null&&arr.length > 0){
  607. for(let i=0;i<arr.length;i++){
  608. total_price += arr[i].count * arr[i].buy_price
  609. }
  610. }
  611. if(arr1!=null && arr1.length > 0){
  612. for(let i=0;i<arr1.length;i++){
  613. total_price_one +=arr1[i].count * arr1[i].buy_price
  614. }
  615. }
  616. if(arr2!=null && arr2.length > 0){
  617. for(let i=0;i<arr2.length;i++){
  618. total_price_two +=arr2[i].count * arr2[i].buy_price
  619. }
  620. }
  621. if(arr3!=null && arr3.length > 0){
  622. for(let i=0;i<arr3.length;i++){
  623. total_price_three +=arr3[i].count * arr3[i].buy_price
  624. }
  625. }
  626. if(arr4!=null && arr4.length > 0){
  627. for(let i=0;i<arr4.length;i++){
  628. total_price_three +=arr4[i].count * arr4[i].buy_price
  629. }
  630. }
  631. total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
  632. if (total_price_all > 0) {
  633. return total_price_all.toFixed(2)
  634. }else{
  635. return "0.00"
  636. }
  637. },
  638. getWarehouseInfoOne(val,val2){
  639. var count =0
  640. var countOne = 0
  641. var all_count = 0
  642. if(val!=null && val.length >0){
  643. for(let i=0;i<val.length;i++){
  644. count +=val[i].count
  645. }
  646. }
  647. if(val2!=null && val2.length > 0){
  648. for(let i=0;i<val2.length;i++){
  649. countOne +=val2[i].count
  650. }
  651. }
  652. all_count = count + countOne
  653. console.log("count2332323223232o2222222222wide",count)
  654. console.log("countONE23232322323323223",countOne)
  655. console.log("all_count9999999999999wode",all_count)
  656. console.log("-------------------------------------------")
  657. if(all_count > 0 ){
  658. return all_count
  659. }else{
  660. return 0
  661. }
  662. },
  663. getAddStockMony(val,val2){
  664. var total_price =0
  665. var total_price_one = 0
  666. var all_price = 0
  667. if(val!=null && val.length >0){
  668. for(let i=0;i<val.length;i++){
  669. total_price +=val[i].count * val[i].buy_price
  670. }
  671. }
  672. if(val2!=null && val2.length > 0){
  673. for(let i=0;i<val2.length;i++){
  674. total_price_one +=val2[i].count * val2[i].price
  675. }
  676. }
  677. all_price = total_price + total_price_one
  678. if(all_price >0 ){
  679. return total_price.toFixed(2)
  680. }else{
  681. return "0.00"
  682. }
  683. },
  684. getSaleStockMony(val,val2){
  685. var total_price =0
  686. var total_price_one = 0
  687. var all_price = 0
  688. if(val!=null && val.length >0){
  689. for(let i=0;i<val.length;i++){
  690. total_price +=val[i].count * val[i].price
  691. }
  692. }
  693. if(val2!=null && val2.length > 0){
  694. for(let i=0;i<val2.length;i++){
  695. total_price_one +=val2[i].count * val2[i].price
  696. }
  697. }
  698. all_price = total_price + total_price_one
  699. if(all_price >0 ){
  700. return all_price.toFixed(2)
  701. }else{
  702. return "0.00"
  703. }
  704. },
  705. getWarehouseOut(val){
  706. var count = 0
  707. for(let i=0;i<val.length;i++){
  708. count +=val[i].count
  709. }
  710. if(count >0){
  711. return count
  712. }else{
  713. return 0
  714. }
  715. },
  716. getManufacturName(id){
  717. var manufacturer_name = ""
  718. for(let i=0;i<this.manufacturerList.length;i++){
  719. if(id == this.manufacturerList[i].id){
  720. manufacturer_name = this.manufacturerList[i].manufacturer_name
  721. }
  722. }
  723. return manufacturer_name
  724. },
  725. getDearName(id){
  726. var dear_name = ""
  727. for(let i=0;i<this.dealerList.length;i++){
  728. if(id == this.dealerList[i].id){
  729. dear_name = this.dealerList[i].dealer_name
  730. }
  731. }
  732. return dear_name
  733. },
  734. getEndOverPrice(val,val3,val1,val2,val4){
  735. var total_price = 0
  736. var total_price_one = 0
  737. var total_price_two = 0
  738. var total_price_three = 0
  739. var total_price_four =0
  740. var all_price = 0
  741. if(val!=null && val.length >0){
  742. for(let i=0;i<val.length;i++){
  743. total_price +=val[i].count * val[i].buy_price
  744. }
  745. }
  746. if(val1!=null && val1.length > 0){
  747. for(let i=0;i<val1.length;i++){
  748. total_price_one +=val1[i].count * val1[i].buy_price
  749. }
  750. }
  751. if(val3!=null && val3.length > 0){
  752. for(let i=0;i<val3.length;i++){
  753. total_price_three +=val3[i].count * val3[i].buy_price
  754. }
  755. }
  756. if(val2!=null && val2.length > 0){
  757. for(let i=0;i<val2.length;i++){
  758. total_price_two +=val2[i].count * val2[i].buy_price
  759. }
  760. }
  761. if(val4!=null && val4.length > 0){
  762. for(let i=0;i<val4.length;i++){
  763. total_price_four +=val4[i].count * val4[i].buy_price
  764. }
  765. }
  766. // console.log("total_price",total_price)
  767. // console.log("total_price_three",total_price_three)
  768. // console.log("total_price_two",total_price_two)
  769. // console.log("total_price_one",total_price_one)
  770. // console.log("total_price_four",total_price_four)
  771. all_price = total_price- total_price_three +total_price_one - total_price_two + total_price_four
  772. console.log("arrll_price",all_price)
  773. if(all_price >0){
  774. return all_price.toFixed(2)
  775. }else{
  776. return "0.00"
  777. }
  778. },
  779. getAllStockIn(val){
  780. var count = 0
  781. if(val!=null && val.length>0){
  782. for(let i=0;i<val.length;i++){
  783. count+= val[i].warehousing_count
  784. }
  785. }
  786. return count
  787. },
  788. getAllStockInPrice(val){
  789. var total_price =0
  790. if(val!=null && val.length>0){
  791. for(let i=0;i<val.length;i++){
  792. if(this.org_id == 10644){
  793. total_price += val[i].warehousing_count * val[i].price
  794. }
  795. if(this.org_id != 10644){
  796. total_price += val[i].warehousing_count * val[i].packing_price
  797. }
  798. }
  799. }
  800. if(total_price>0){
  801. return total_price.toFixed(2)
  802. }else{
  803. return total_price
  804. }
  805. },
  806. getAllOutStockIn(val){
  807. var count = 0
  808. if(val!=null && val.length>0){
  809. for(let i=0;i<val.length;i++){
  810. count +=val[i].count
  811. }
  812. }
  813. return count
  814. },
  815. getAllStockInFlowPrice(val){
  816. var total_price = 0
  817. if(val!=null && val.length>0){
  818. for(let i=0;i<val.length;i++){
  819. total_price+= val[i].count * val[i].price
  820. }
  821. }
  822. if(total_price>0){
  823. return total_price.toFixed(2)
  824. }else{
  825. return total_price
  826. }
  827. },
  828. getAllStockInFlow(val){
  829. var count = 0
  830. if(val!=null && val.length>0){
  831. for(let i=0;i<val.length;i++){
  832. count+= val[i].count
  833. }
  834. }
  835. return count
  836. },
  837. getAllStockOutFlow(val){
  838. var count = 0
  839. if(val!=null && val.length>0){
  840. for(let i=0;i<val.length;i++){
  841. count+= val[i].count
  842. }
  843. }
  844. return count
  845. },
  846. getAllOutStockInPrice(val){
  847. var total_price = 0
  848. if(val!=null && val.length>0){
  849. for(let i=0;i<val.length;i++){
  850. total_price += val[i].count * val[i].price
  851. }
  852. }
  853. if(total_price>0){
  854. return total_price.toFixed(2)
  855. }else{
  856. return total_price
  857. }
  858. },
  859. getAllStockOutFlowPrice(val){
  860. var total_price = 0
  861. if(val!=null && val.length>0){
  862. for(let i=0;i<val.length;i++){
  863. total_price+= val[i].count * val[i].price
  864. }
  865. }
  866. if(total_price>0){
  867. return total_price.toFixed(2)
  868. }else{
  869. return total_price
  870. }
  871. },
  872. getWarehouseInfoOnePrice(val,val2){
  873. var count_price =0
  874. var count_one_price = 0
  875. var all_count_price = 0
  876. if(val!=null && val.length >0){
  877. for(let i=0;i<val.length;i++){
  878. count_price +=val[i].count * val[i].price
  879. }
  880. }
  881. if(val2!=null && val2.length > 0){
  882. for(let i=0;i<val2.length;i++){
  883. count_one_price +=val2[i].count * val2[i].price
  884. }
  885. }
  886. all_count_price = count_price + count_one_price
  887. if(all_count_price > 0 ){
  888. return all_count_price.toFixed(2)
  889. }else{
  890. return 0
  891. }
  892. },
  893. getWarehosueOutInfoPrice(val,val2,val3){
  894. var count_price = 0
  895. var count_one_price = 0
  896. var all_count_price = 0
  897. var count_two_price = 0
  898. if(val!=null && val.length >0){
  899. for(let i=0;i<val.length;i++){
  900. count_price += val[i].count * val[i].price
  901. }
  902. }
  903. if(val2!=null && val2.length > 0){
  904. for(let i=0;i<val2.length;i++){
  905. count_one_price +=val2[i].count * val2[i].price
  906. }
  907. }
  908. if(val3!=null && val3.length > 0){
  909. for(let i=0;i<val3.length;i++){
  910. count_two_price +=val3[i].count * val3[i].price
  911. }
  912. }
  913. console.log("本期减少",count_price)
  914. console.log("盘亏",count_one_price)
  915. console.log("退库",all_count_price)
  916. all_count_price = count_price +count_one_price - count_two_price
  917. console.log("数据我哦我我",all_count_price)
  918. if(all_count_price >0){
  919. return all_count_price.toFixed(2)
  920. }else{
  921. return 0
  922. }
  923. },
  924. },
  925. created(){
  926. this.org_id = this.$store.getters.xt_user.org_id
  927. var starttime = this.$route.query.start_time
  928. this.start_time = starttime
  929. var endtime = this.$route.query.end_time
  930. this.end_time = endtime
  931. var good_type = parseInt(this.$route.query.good_type)
  932. this.good_type = good_type
  933. var keyword = this.$route.query.keyword
  934. this.keyword = keyword
  935. this.page = parseInt(this.$route.query.page)
  936. this.limit = parseInt(this.$route.query.limit)
  937. this.getStorehouseList()
  938. this.getlist()
  939. }
  940. }
  941. </script>
  942. <style rel="stylesheet/scss" lang="scss" scoped>
  943. .print_main_content {
  944. background-color: white;
  945. max-width: 1500px;
  946. margin: 0 auto;
  947. padding: 0 0 20px 0;
  948. .order_title_panl {
  949. text-align: center;
  950. .main_title {
  951. font-size: 18px;
  952. line-height: 40px;
  953. font-weight: 500;
  954. }
  955. }
  956. .table_panel {
  957. .table {
  958. width: 100%;
  959. border: 1px solid;
  960. border-collapse: collapse;
  961. padding: 2px;
  962. thead {
  963. tr {
  964. td {
  965. border: 1px solid;
  966. text-align: center;
  967. font-size: 14px;
  968. padding: 15px 5px;
  969. }
  970. }
  971. }
  972. tbody {
  973. tr {
  974. td {
  975. border: 1px solid;
  976. text-align: center;
  977. font-size: 14px;
  978. padding: 10px 5px;
  979. white-space: pre-line;
  980. .proj {
  981. padding: 5px 0;
  982. text-align: left;
  983. .proj_title {
  984. font-size: 16px;
  985. font-weight: 500;
  986. line-height: 25px;
  987. }
  988. .proj_item {
  989. font-size: 15px;
  990. line-height: 20px;
  991. .zone_name {
  992. font-weight: 500;
  993. }
  994. }
  995. }
  996. }
  997. }
  998. }
  999. }
  1000. }
  1001. }
  1002. </style>