purchaseNewStockQueryPrint.vue 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  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">耗材编码</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 width="80" colspan="3">期初结余</td>
  35. <td width="80" colspan="3">本期增加</td>
  36. <td width="80" colspan="3">本期减少</td>
  37. <td width="80" colspan="3">期末结余</td>
  38. </tr>
  39. <tr>
  40. <td>数量</td>
  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. </tr>
  53. </thead>
  54. <tbody>
  55. <tr v-for="(item,index) in this.tableList" :key="index">
  56. <td>{{index + 1}}</td>
  57. <td v-if="org_id==9956">{{item.good_number}}</td>
  58. <td>{{item.good_name}}</td>
  59. <td>{{getGoodTypeName(item.good_type_id)}}</td>
  60. <td>{{item.specification_name}}</td>
  61. <td> {{getManufacturName(item.manufacturer)}}</td>
  62. <td> {{getDearName(item.dealer)}}</td>
  63. <td>{{item.stockIn}}</td>
  64. <td>{{item.stock_in_price}}</td>
  65. <td>{{item.stockMoney}}</td>
  66. <td>{{item.stockAdd}}</td>
  67. <td>{{item.addStockMoney}}</td>
  68. <td>{{item.saleStockMoney}}</td>
  69. <td>{{item.outStock}}</td>
  70. <td>{{item.stockOutprice}}</td>
  71. <td>{{item.saleOutMoney}}</td>
  72. <td>{{item.overStock}}</td>
  73. <td>{{item.overPrice}}</td>
  74. <td>{{item.overMoney}}</td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </template>
  84. <script>
  85. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  86. import { getStorehouseList,getNewPurchaseStockQuery } from "@/api/drug/drug"
  87. import {
  88. getStockDrugCount
  89. } from "@/api/stock";
  90. import print from 'print-js'
  91. const moment = require('moment')
  92. export default {
  93. components:{
  94. BreadCrumb
  95. },
  96. data(){
  97. return{
  98. crumbs: [
  99. { path: false, name: '库存管理' },
  100. { path: false, name: '库存查询' },
  101. { path: false, name: '库存查询打印' },
  102. ],
  103. start_time:"",
  104. end_time:"",
  105. drug_name:"",
  106. drug_spec:"",
  107. keyword:"",
  108. tableData:[],
  109. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  110. type_name:"",
  111. limit:"",
  112. page:"",
  113. loading: false,
  114. warehouseInfoDate: [],
  115. tableList:[],
  116. good_type:[],
  117. manufacturerList:[],
  118. countList:[],
  119. outCountList:[],
  120. autoCountList:[],
  121. cancelCountList:[],
  122. org_id:0,
  123. goodTypeList:[],
  124. dealerList:[]
  125. }
  126. },
  127. methods:{
  128. printAction: function() {
  129. 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; } }'
  130. printJS({
  131. printable: 'print_content',
  132. type: 'html',
  133. documentTitle: ' ',
  134. style: style,
  135. scanStyles: false
  136. })
  137. },
  138. getStorehouseList(){
  139. getStorehouseList().then(response=>{
  140. if(response.data.state == 1){
  141. this.manufacturerList = response.data.data.manufacturerList
  142. var obj = {id:0,type_name:"全部"}
  143. this.goodTypeList.push(obj)
  144. var goodTypeList = response.data.data.goodTypeList
  145. for(let i=0;i<goodTypeList.length;i++){
  146. this.goodTypeList.push(goodTypeList[i])
  147. }
  148. this.dealerList = response.data.data.dealerList
  149. }
  150. })
  151. },
  152. getlist(){
  153. this.loading = true
  154. var params = {
  155. good_type:this.good_type,
  156. keyword:this.keyword,
  157. page:this.page,
  158. limit:this.limit,
  159. start_time:this.start_time,
  160. end_time:this.end_time,
  161. }
  162. getNewPurchaseStockQuery(params).then(response=>{
  163. if(response.data.state == 1){
  164. var list = response.data.data.list
  165. this.loading = false
  166. for(let i=0;i<list.length;i++){
  167. list[i].stockIn = list[i].GoodStartFlowInfo.over_count
  168. list[i].stock_in_price = "/"
  169. list[i].stockMoney = "/"
  170. // list[i].stockIn = this.getWarehouseInfoStart(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo) //期初结余
  171. // list[i].stock_in_price = this.getWarehouseInfoStartPrice(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo)
  172. // list[i].stockMoney = this.getWarehouseInfoStartMoney(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo)
  173. list[i].stockAdd = this.getWarehouseInfoOne(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)//期间增加
  174. // list[i].addStockMoney = this.getAddStockMony(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)
  175. // list[i].saleStockMoney = this.getSaleStockMony(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)
  176. list[i].addStockMoney = "/"
  177. list[i].saleStockMoney = "/"
  178. list[i].outStock = this.getWarehosueOutInfo(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)//本期减少
  179. // list[i].stockOutprice = this.stockOutprice(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)
  180. // list[i].saleOutMoney = this.getSaleStockMony(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)
  181. list[i].stockOutprice = "/"
  182. list[i].saleOutprice = "/"
  183. // list[i].overStock= this.getEndWarehouseInfo(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
  184. // list[i].overPrice= this.getEndOverPrice(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
  185. // list[i].overMoney = this.getEndSalePrice(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
  186. if(this.org_id ==0 || this.org_id ==10265){
  187. list[i].overStock = list[i].GoodEndFlowInfo.over_count
  188. }else{
  189. list[i].overStock = list[i].stockIn + list[i].stockAdd - list[i].outStock
  190. }
  191. list[i].overPrice = "/"
  192. list[i].overMoney = "/"
  193. }
  194. this.tableList = list
  195. this.manufacturerList = response.data.data.manufacturerList
  196. }
  197. })
  198. },
  199. getWarehouseInfoStartMoney(arr,arr1,arr2,arr3,arr4){
  200. var total_price = 0
  201. var total_price_one = 0
  202. var total_price_two = 0
  203. var total_price_three = 0
  204. var total_price_four = 0
  205. var total_price_all = 0
  206. if(arr!=null && arr.length >0){
  207. for(let i=0;i<arr.length;i++){
  208. total_price +=arr[i].count * arr[i].price
  209. }
  210. }
  211. if(arr1!=null && arr1.length > 0){
  212. for(let i=0;i<arr1.length;i++){
  213. total_price_one +=arr1[i].count * arr1[i].price
  214. }
  215. }
  216. if(arr2!=null && arr2.length > 0){
  217. for(let i=0;i<arr2.length;i++){
  218. total_price_two +=arr2[i].count * arr2[i].price
  219. }
  220. }
  221. if(arr3!=null && arr3.length > 0){
  222. for(let i=0;i<arr3.length;i++){
  223. total_price_three +=arr3[i].count * arr3[i].price
  224. }
  225. }
  226. if(arr4!=null && arr4.length > 0){
  227. for(let i=0;i<arr4.length;i++){
  228. total_price_four +=arr4[i].count * arr4[i].price
  229. }
  230. }
  231. total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
  232. if (total_price_all > 0) {
  233. return total_price_all.toFixed(2)
  234. }else{
  235. return "0.00"
  236. }
  237. },
  238. getWarehosueOutInfo(val,val2,val3){
  239. var count = 0
  240. var count_one = 0
  241. var all_count = 0
  242. var count_two = 0
  243. if(val!=null && val.length >0){
  244. for(let i=0;i<val.length;i++){
  245. count +=val[i].count
  246. }
  247. }
  248. if(val2!=null && val2.length > 0){
  249. for(let i=0;i<val2.length;i++){
  250. count_one +=val2[i].count
  251. }
  252. }
  253. if(val3!=null && val3.length > 0){
  254. for(let i=0;i<val3.length;i++){
  255. count_two +=val3[i].count
  256. }
  257. }
  258. all_count = count +count_one - count_two
  259. if(all_count >0){
  260. return all_count
  261. }else{
  262. return 0
  263. }
  264. },
  265. stockOutprice(val,val2,val3){
  266. var total_price = 0
  267. var total_price_one = 0
  268. var total_price_two = 0
  269. var all_price = 0
  270. if(val!=null && val.length >0){
  271. for(let i=0;i<val.length;i++){
  272. total_price +=val[i].count * val[i].buy_price
  273. }
  274. }
  275. if(val2!=null && val2.length > 0){
  276. for(let i=0;i<val2.length;i++){
  277. total_price_one +=val2[i].count * val2[i].buy_price
  278. }
  279. }
  280. if(val3!=null && val3.length > 0){
  281. for(let i=0;i<val3.length;i++){
  282. total_price_two +=val3[i].count * val3[i].buy_price
  283. }
  284. }
  285. all_price = total_price + total_price_one - total_price_two
  286. if(all_price >0){
  287. return all_price.toFixed(2)
  288. }else{
  289. return "0.00"
  290. }
  291. },
  292. saleOutprice(val,val2,val3){
  293. var total_price = 0
  294. var total_price_one = 0
  295. var all_price = 0
  296. var total_price_two = 0
  297. if(val!=null && val.length >0){
  298. for(let i=0;i<val.length;i++){
  299. total_price +=val[i].count * val[i].xt_warehouse_info.packing_price
  300. }
  301. }
  302. if(val2!=null && val2.length > 0){
  303. for(let i=0;i<val2.length;i++){
  304. total_price_one +=val2[i].count * val2[i].price
  305. }
  306. }
  307. if(val3!=null && val3.length > 0){
  308. for(let i=0;i<val3.length;i++){
  309. total_price_two +=val3[i].count * val3[i].price
  310. }
  311. }
  312. all_price = total_price + total_price_one - total_price_two
  313. if(all_price >0){
  314. return all_price.toFixed(2)
  315. }else{
  316. return "0.00"
  317. }
  318. },
  319. getEndWarehouseInfo(val,val3,val1,val2,val4){
  320. var count = 0
  321. var count_one = 0
  322. var count_two = 0
  323. var count_three =0
  324. var count_four = 0
  325. var all_count = 0
  326. if(val!=null && val.length >0){
  327. for(let i=0;i<val.length;i++){
  328. count +=val[i].count
  329. }
  330. }
  331. if(val1!=null&&val1.length >0){
  332. for(let i=0;i<val1.length;i++){
  333. count_one +=val1[i].count
  334. }
  335. }
  336. if(val3!=null&& val3.length > 0){
  337. for(let i=0;i<val3.length;i++){
  338. count_three +=val3[i].count
  339. }
  340. }
  341. if(val2!=null&&val2.length >0){
  342. for(let i=0;i<val2.length;i++){
  343. count_two +=val2[i].count
  344. }
  345. }
  346. if(val4!=null&&val4.length >0){
  347. for(let i=0;i<val4.length;i++){
  348. count_four +=val4[i].count
  349. }
  350. }
  351. all_count = count- count_three + count_one - count_two + count_four
  352. if(all_count >0){
  353. return all_count
  354. }else{
  355. return 0
  356. }
  357. },
  358. getEndWarehouseInfo(val,val3,val1,val2,val4){
  359. var count = 0
  360. var count_one = 0
  361. var count_two = 0
  362. var count_three =0
  363. var count_four = 0
  364. var all_count = 0
  365. if(val!=null && val.length >0){
  366. for(let i=0;i<val.length;i++){
  367. count +=val[i].count
  368. }
  369. }
  370. if(val1!=null&&val1.length >0){
  371. for(let i=0;i<val1.length;i++){
  372. count_one +=val1[i].count
  373. }
  374. }
  375. if(val3!=null&& val3.length > 0){
  376. for(let i=0;i<val3.length;i++){
  377. count_three +=val3[i].count
  378. }
  379. }
  380. if(val2!=null&&val2.length >0){
  381. for(let i=0;i<val2.length;i++){
  382. count_two +=val2[i].count
  383. }
  384. }
  385. if(val4!=null&&val4.length >0){
  386. for(let i=0;i<val4.length;i++){
  387. count_four +=val4[i].count
  388. }
  389. }
  390. all_count = count- count_three + count_one - count_two + count_four
  391. if(all_count >0){
  392. return all_count
  393. }else{
  394. return 0
  395. }
  396. },
  397. getEndSalePrice(val,val3,val1,val2,val4){
  398. var total_price = 0
  399. var total_price_one = 0
  400. var total_price_two = 0
  401. var total_price_three = 0
  402. var total_price_four = 0
  403. var all_price= 0
  404. if(val!=null && val.length >0){
  405. for(let i=0;i<val.length;i++){
  406. total_price +=val[i].count * val[i].price
  407. }
  408. }
  409. if(val1!=null && val1.length >0){
  410. for(let i=0;i<val1.length;i++){
  411. total_price_one +=val1[i].count * val1[i].price
  412. }
  413. }
  414. if(val3!=null && val3.length >0){
  415. for(let i=0;i<val3.length;i++){
  416. total_price_three +=val3[i].count * val3[i].price
  417. }
  418. }
  419. if(val2!=null && val2.length >0){
  420. for(let i=0;i<val2.length;i++){
  421. total_price_two +=val2[i].count * val2[i].price
  422. }
  423. }
  424. if(val4!=null && val4.length >0){
  425. for(let i=0;i<val4.length;i++){
  426. total_price_four +=val4[i].count * val4[i].price
  427. }
  428. }
  429. var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
  430. if(all_price >0){
  431. return all_price.toFixed(2)
  432. }else{
  433. return "0.00"
  434. }
  435. },
  436. getEndSalePrice(val,val3,val1,val2,val4){
  437. var total_price = 0
  438. var total_price_one = 0
  439. var total_price_two = 0
  440. var total_price_three = 0
  441. var total_price_four = 0
  442. var all_price= 0
  443. if(val!=null && val.length >0){
  444. for(let i=0;i<val.length;i++){
  445. total_price +=val[i].count * val[i].price
  446. }
  447. }
  448. if(val1!=null && val1.length >0){
  449. for(let i=0;i<val1.length;i++){
  450. total_price_one +=val1[i].count * val1[i].price
  451. }
  452. }
  453. if(val3!=null && val3.length >0){
  454. for(let i=0;i<val3.length;i++){
  455. total_price_three +=val3[i].count * val3[i].price
  456. }
  457. }
  458. if(val2!=null && val2.length >0){
  459. for(let i=0;i<val2.length;i++){
  460. total_price_two +=val2[i].count * val2[i].price
  461. }
  462. }
  463. if(val4!=null && val4.length >0){
  464. for(let i=0;i<val4.length;i++){
  465. total_price_four +=val4[i].count * val4[i].price
  466. }
  467. }
  468. var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
  469. if(all_price >0){
  470. return all_price.toFixed(2)
  471. }else{
  472. return 0
  473. }
  474. },
  475. getGoodTypeName(id){
  476. var type_name = ""
  477. for(let i=0;i<this.goodTypeList.length;i++){
  478. if(id == this.goodTypeList[i].id){
  479. type_name = this.goodTypeList[i].type_name
  480. }
  481. }
  482. return type_name
  483. },
  484. getWarehouseInfoStart(arr1,arr2,arr3,arr4,arr5){
  485. var count =0
  486. var countOne =0
  487. var countTwo= 0
  488. var countthree = 0 //期初
  489. var countfour = 0
  490. var countfive = 0
  491. if(arr1!=null && arr1.length > 0){
  492. for(let i=0;i<arr1.length;i++){
  493. countOne +=arr1[i].count
  494. }
  495. }
  496. if(arr2!=null && arr2.length > 0){
  497. for(let i=0;i<arr2.length;i++){
  498. countTwo +=arr2[i].count
  499. }
  500. }
  501. if(arr3!=null && arr3.length > 0){
  502. for(let i=0;i<arr3.length;i++){
  503. countthree +=arr3[i].count
  504. }
  505. }
  506. if(arr4!=null && arr4.length > 0){
  507. for(let i=0;i<arr4.length;i++){
  508. countfour +=arr4[i].count
  509. }
  510. }
  511. if(arr5!=null && arr5.length > 0){
  512. for(let i=0;i<arr5.length;i++){
  513. countfive +=arr5[i].count
  514. }
  515. }
  516. console.log("countOne",countOne)
  517. console.log("countTwo",countTwo)
  518. console.log("countthree",countthree)
  519. console.log("countfour",countfour)
  520. console.log("*********************")
  521. count = countOne - countTwo + countthree - countfour + countfive
  522. if(count > 0 ){
  523. return count
  524. }else{
  525. return 0
  526. }
  527. },
  528. getWarehouseInfoStartPrice(arr,arr1,arr2,arr3,arr4){
  529. var total_price = 0
  530. var total_price_one = 0
  531. var total_price_two = 0
  532. var total_price_three = 0
  533. var total_price_four = 0
  534. var total_price_all = 0
  535. if(arr!=null&&arr.length > 0){
  536. for(let i=0;i<arr.length;i++){
  537. total_price += arr[i].count * arr[i].buy_price
  538. }
  539. }
  540. if(arr1!=null && arr1.length > 0){
  541. for(let i=0;i<arr1.length;i++){
  542. total_price_one +=arr1[i].count * arr1[i].buy_price
  543. }
  544. }
  545. if(arr2!=null && arr2.length > 0){
  546. for(let i=0;i<arr2.length;i++){
  547. total_price_two +=arr2[i].count * arr2[i].buy_price
  548. }
  549. }
  550. if(arr3!=null && arr3.length > 0){
  551. for(let i=0;i<arr3.length;i++){
  552. total_price_three +=arr3[i].count * arr3[i].buy_price
  553. }
  554. }
  555. if(arr4!=null && arr4.length > 0){
  556. for(let i=0;i<arr4.length;i++){
  557. total_price_three +=arr4[i].count * arr4[i].buy_price
  558. }
  559. }
  560. total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
  561. if (total_price_all > 0) {
  562. return total_price_all.toFixed(2)
  563. }else{
  564. return "0.00"
  565. }
  566. },
  567. getWarehouseInfoOne(val,val2){
  568. var count =0
  569. var countOne = 0
  570. var all_count = 0
  571. if(val!=null && val.length >0){
  572. for(let i=0;i<val.length;i++){
  573. count +=val[i].count
  574. }
  575. }
  576. if(val2!=null && val2.length > 0){
  577. for(let i=0;i<val2.length;i++){
  578. countOne +=val2[i].count
  579. }
  580. }
  581. all_count = count + countOne
  582. console.log("count2332323223232o2222222222wide",count)
  583. console.log("countONE23232322323323223",countOne)
  584. console.log("all_count9999999999999wode",all_count)
  585. console.log("-------------------------------------------")
  586. if(all_count > 0 ){
  587. return all_count
  588. }else{
  589. return 0
  590. }
  591. },
  592. getAddStockMony(val,val2){
  593. var total_price =0
  594. var total_price_one = 0
  595. var all_price = 0
  596. if(val!=null && val.length >0){
  597. for(let i=0;i<val.length;i++){
  598. total_price +=val[i].count * val[i].buy_price
  599. }
  600. }
  601. if(val2!=null && val2.length > 0){
  602. for(let i=0;i<val2.length;i++){
  603. total_price_one +=val2[i].count * val2[i].price
  604. }
  605. }
  606. all_price = total_price + total_price_one
  607. if(all_price >0 ){
  608. return total_price.toFixed(2)
  609. }else{
  610. return "0.00"
  611. }
  612. },
  613. getSaleStockMony(val,val2){
  614. var total_price =0
  615. var total_price_one = 0
  616. var all_price = 0
  617. if(val!=null && val.length >0){
  618. for(let i=0;i<val.length;i++){
  619. total_price +=val[i].count * val[i].price
  620. }
  621. }
  622. if(val2!=null && val2.length > 0){
  623. for(let i=0;i<val2.length;i++){
  624. total_price_one +=val2[i].count * val2[i].price
  625. }
  626. }
  627. all_price = total_price + total_price_one
  628. if(all_price >0 ){
  629. return all_price.toFixed(2)
  630. }else{
  631. return "0.00"
  632. }
  633. },
  634. getWarehouseOut(val){
  635. var count = 0
  636. for(let i=0;i<val.length;i++){
  637. count +=val[i].count
  638. }
  639. if(count >0){
  640. return count
  641. }else{
  642. return 0
  643. }
  644. },
  645. getManufacturName(id){
  646. var manufacturer_name = ""
  647. for(let i=0;i<this.manufacturerList.length;i++){
  648. if(id == this.manufacturerList[i].id){
  649. manufacturer_name = this.manufacturerList[i].manufacturer_name
  650. }
  651. }
  652. return manufacturer_name
  653. },
  654. getDearName(id){
  655. var dear_name = ""
  656. for(let i=0;i<this.dealerList.length;i++){
  657. if(id == this.dealerList[i].id){
  658. dear_name = this.dealerList[i].dealer_name
  659. }
  660. }
  661. return dear_name
  662. },
  663. getEndOverPrice(val,val3,val1,val2,val4){
  664. var total_price = 0
  665. var total_price_one = 0
  666. var total_price_two = 0
  667. var total_price_three = 0
  668. var total_price_four =0
  669. var all_price = 0
  670. if(val!=null && val.length >0){
  671. for(let i=0;i<val.length;i++){
  672. total_price +=val[i].count * val[i].buy_price
  673. }
  674. }
  675. if(val1!=null && val1.length > 0){
  676. for(let i=0;i<val1.length;i++){
  677. total_price_one +=val1[i].count * val1[i].buy_price
  678. }
  679. }
  680. if(val3!=null && val3.length > 0){
  681. for(let i=0;i<val3.length;i++){
  682. total_price_three +=val3[i].count * val3[i].buy_price
  683. }
  684. }
  685. if(val2!=null && val2.length > 0){
  686. for(let i=0;i<val2.length;i++){
  687. total_price_two +=val2[i].count * val2[i].buy_price
  688. }
  689. }
  690. if(val4!=null && val4.length > 0){
  691. for(let i=0;i<val4.length;i++){
  692. total_price_four +=val4[i].count * val4[i].buy_price
  693. }
  694. }
  695. // console.log("total_price",total_price)
  696. // console.log("total_price_three",total_price_three)
  697. // console.log("total_price_two",total_price_two)
  698. // console.log("total_price_one",total_price_one)
  699. // console.log("total_price_four",total_price_four)
  700. all_price = total_price- total_price_three +total_price_one - total_price_two + total_price_four
  701. console.log("arrll_price",all_price)
  702. if(all_price >0){
  703. return all_price.toFixed(2)
  704. }else{
  705. return "0.00"
  706. }
  707. },
  708. },
  709. created(){
  710. this.org_id = this.$store.getters.xt_user.org_id
  711. var starttime = this.$route.query.start_time
  712. this.start_time = starttime
  713. var endtime = this.$route.query.end_time
  714. this.end_time = endtime
  715. var good_type = parseInt(this.$route.query.good_type)
  716. this.good_type = good_type
  717. var keyword = this.$route.query.keyword
  718. this.keyword = keyword
  719. this.page = parseInt(this.$route.query.page)
  720. this.limit = parseInt(this.$route.query.limit)
  721. this.getStorehouseList()
  722. this.getlist()
  723. }
  724. }
  725. </script>
  726. <style rel="stylesheet/scss" lang="scss" scoped>
  727. .print_main_content {
  728. background-color: white;
  729. max-width: 1500px;
  730. margin: 0 auto;
  731. padding: 0 0 20px 0;
  732. .order_title_panl {
  733. text-align: center;
  734. .main_title {
  735. font-size: 18px;
  736. line-height: 40px;
  737. font-weight: 500;
  738. }
  739. }
  740. .table_panel {
  741. .table {
  742. width: 100%;
  743. border: 1px solid;
  744. border-collapse: collapse;
  745. padding: 2px;
  746. thead {
  747. tr {
  748. td {
  749. border: 1px solid;
  750. text-align: center;
  751. font-size: 14px;
  752. padding: 15px 5px;
  753. }
  754. }
  755. }
  756. tbody {
  757. tr {
  758. td {
  759. border: 1px solid;
  760. text-align: center;
  761. font-size: 14px;
  762. padding: 10px 5px;
  763. white-space: pre-line;
  764. .proj {
  765. padding: 5px 0;
  766. text-align: left;
  767. .proj_title {
  768. font-size: 16px;
  769. font-weight: 500;
  770. line-height: 25px;
  771. }
  772. .proj_item {
  773. font-size: 15px;
  774. line-height: 20px;
  775. .zone_name {
  776. font-weight: 500;
  777. }
  778. }
  779. }
  780. }
  781. }
  782. }
  783. }
  784. }
  785. }
  786. </style>