purchaseNewStockQueryPrint.vue 34KB

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