purchaseNewStockQueryPrint.vue 26KB

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