purchaseNewStockQueryPrint.vue 33KB

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