purchaseNewStockQueryPrint.vue 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  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. if(this.org_id == 0 || this.org_id ==10210){
  169. list[i].stockIn = list[i].GoodStartFlowInfo.over_count
  170. }else{
  171. list[i].stockIn = this.getAllStockIn(list[i].StWarehousingInfoTwo) + this.getAllStockInFlow(list[i].WareStartInStockFlow) - this.getAllOutStockIn(list[i].WarehouseOutInfoTenty) - this.getAllStockOutFlow(list[i].WareStartOutStockFlow)
  172. }
  173. list[i].stock_in_price = "/"
  174. list[i].stockMoney = "/"
  175. list[i].stockAdd = this.getWarehouseInfoOne(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 = "/"
  180. list[i].saleOutprice = "/"
  181. if(this.org_id ==0 || this.org_id ==10265){
  182. list[i].overStock = list[i].GoodEndFlowInfo.over_count
  183. }else{
  184. list[i].overStock = list[i].stockIn + list[i].stockAdd - list[i].outStock
  185. }
  186. list[i].overPrice = "/"
  187. list[i].overMoney = "/"
  188. }
  189. this.tableList = list
  190. this.manufacturerList = response.data.data.manufacturerList
  191. }
  192. })
  193. },
  194. getWarehouseInfoStartMoney(arr,arr1,arr2,arr3,arr4){
  195. var total_price = 0
  196. var total_price_one = 0
  197. var total_price_two = 0
  198. var total_price_three = 0
  199. var total_price_four = 0
  200. var total_price_all = 0
  201. if(arr!=null && arr.length >0){
  202. for(let i=0;i<arr.length;i++){
  203. total_price +=arr[i].count * arr[i].price
  204. }
  205. }
  206. if(arr1!=null && arr1.length > 0){
  207. for(let i=0;i<arr1.length;i++){
  208. total_price_one +=arr1[i].count * arr1[i].price
  209. }
  210. }
  211. if(arr2!=null && arr2.length > 0){
  212. for(let i=0;i<arr2.length;i++){
  213. total_price_two +=arr2[i].count * arr2[i].price
  214. }
  215. }
  216. if(arr3!=null && arr3.length > 0){
  217. for(let i=0;i<arr3.length;i++){
  218. total_price_three +=arr3[i].count * arr3[i].price
  219. }
  220. }
  221. if(arr4!=null && arr4.length > 0){
  222. for(let i=0;i<arr4.length;i++){
  223. total_price_four +=arr4[i].count * arr4[i].price
  224. }
  225. }
  226. total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
  227. if (total_price_all > 0) {
  228. return total_price_all.toFixed(2)
  229. }else{
  230. return "0.00"
  231. }
  232. },
  233. getWarehosueOutInfo(val,val2,val3){
  234. var count = 0
  235. var count_one = 0
  236. var all_count = 0
  237. var count_two = 0
  238. if(val!=null && val.length >0){
  239. for(let i=0;i<val.length;i++){
  240. count +=val[i].count
  241. }
  242. }
  243. if(val2!=null && val2.length > 0){
  244. for(let i=0;i<val2.length;i++){
  245. count_one +=val2[i].count
  246. }
  247. }
  248. if(val3!=null && val3.length > 0){
  249. for(let i=0;i<val3.length;i++){
  250. count_two +=val3[i].count
  251. }
  252. }
  253. all_count = count +count_one - count_two
  254. if(all_count >0){
  255. return all_count
  256. }else{
  257. return 0
  258. }
  259. },
  260. stockOutprice(val,val2,val3){
  261. var total_price = 0
  262. var total_price_one = 0
  263. var total_price_two = 0
  264. var all_price = 0
  265. if(val!=null && val.length >0){
  266. for(let i=0;i<val.length;i++){
  267. total_price +=val[i].count * val[i].buy_price
  268. }
  269. }
  270. if(val2!=null && val2.length > 0){
  271. for(let i=0;i<val2.length;i++){
  272. total_price_one +=val2[i].count * val2[i].buy_price
  273. }
  274. }
  275. if(val3!=null && val3.length > 0){
  276. for(let i=0;i<val3.length;i++){
  277. total_price_two +=val3[i].count * val3[i].buy_price
  278. }
  279. }
  280. all_price = total_price + total_price_one - total_price_two
  281. if(all_price >0){
  282. return all_price.toFixed(2)
  283. }else{
  284. return "0.00"
  285. }
  286. },
  287. saleOutprice(val,val2,val3){
  288. var total_price = 0
  289. var total_price_one = 0
  290. var all_price = 0
  291. var total_price_two = 0
  292. if(val!=null && val.length >0){
  293. for(let i=0;i<val.length;i++){
  294. total_price +=val[i].count * val[i].xt_warehouse_info.packing_price
  295. }
  296. }
  297. if(val2!=null && val2.length > 0){
  298. for(let i=0;i<val2.length;i++){
  299. total_price_one +=val2[i].count * val2[i].price
  300. }
  301. }
  302. if(val3!=null && val3.length > 0){
  303. for(let i=0;i<val3.length;i++){
  304. total_price_two +=val3[i].count * val3[i].price
  305. }
  306. }
  307. all_price = total_price + total_price_one - total_price_two
  308. if(all_price >0){
  309. return all_price.toFixed(2)
  310. }else{
  311. return "0.00"
  312. }
  313. },
  314. getEndWarehouseInfo(val,val3,val1,val2,val4){
  315. var count = 0
  316. var count_one = 0
  317. var count_two = 0
  318. var count_three =0
  319. var count_four = 0
  320. var all_count = 0
  321. if(val!=null && val.length >0){
  322. for(let i=0;i<val.length;i++){
  323. count +=val[i].count
  324. }
  325. }
  326. if(val1!=null&&val1.length >0){
  327. for(let i=0;i<val1.length;i++){
  328. count_one +=val1[i].count
  329. }
  330. }
  331. if(val3!=null&& val3.length > 0){
  332. for(let i=0;i<val3.length;i++){
  333. count_three +=val3[i].count
  334. }
  335. }
  336. if(val2!=null&&val2.length >0){
  337. for(let i=0;i<val2.length;i++){
  338. count_two +=val2[i].count
  339. }
  340. }
  341. if(val4!=null&&val4.length >0){
  342. for(let i=0;i<val4.length;i++){
  343. count_four +=val4[i].count
  344. }
  345. }
  346. all_count = count- count_three + count_one - count_two + count_four
  347. if(all_count >0){
  348. return all_count
  349. }else{
  350. return 0
  351. }
  352. },
  353. getEndWarehouseInfo(val,val3,val1,val2,val4){
  354. var count = 0
  355. var count_one = 0
  356. var count_two = 0
  357. var count_three =0
  358. var count_four = 0
  359. var all_count = 0
  360. if(val!=null && val.length >0){
  361. for(let i=0;i<val.length;i++){
  362. count +=val[i].count
  363. }
  364. }
  365. if(val1!=null&&val1.length >0){
  366. for(let i=0;i<val1.length;i++){
  367. count_one +=val1[i].count
  368. }
  369. }
  370. if(val3!=null&& val3.length > 0){
  371. for(let i=0;i<val3.length;i++){
  372. count_three +=val3[i].count
  373. }
  374. }
  375. if(val2!=null&&val2.length >0){
  376. for(let i=0;i<val2.length;i++){
  377. count_two +=val2[i].count
  378. }
  379. }
  380. if(val4!=null&&val4.length >0){
  381. for(let i=0;i<val4.length;i++){
  382. count_four +=val4[i].count
  383. }
  384. }
  385. all_count = count- count_three + count_one - count_two + count_four
  386. if(all_count >0){
  387. return all_count
  388. }else{
  389. return 0
  390. }
  391. },
  392. getEndSalePrice(val,val3,val1,val2,val4){
  393. var total_price = 0
  394. var total_price_one = 0
  395. var total_price_two = 0
  396. var total_price_three = 0
  397. var total_price_four = 0
  398. var all_price= 0
  399. if(val!=null && val.length >0){
  400. for(let i=0;i<val.length;i++){
  401. total_price +=val[i].count * val[i].price
  402. }
  403. }
  404. if(val1!=null && val1.length >0){
  405. for(let i=0;i<val1.length;i++){
  406. total_price_one +=val1[i].count * val1[i].price
  407. }
  408. }
  409. if(val3!=null && val3.length >0){
  410. for(let i=0;i<val3.length;i++){
  411. total_price_three +=val3[i].count * val3[i].price
  412. }
  413. }
  414. if(val2!=null && val2.length >0){
  415. for(let i=0;i<val2.length;i++){
  416. total_price_two +=val2[i].count * val2[i].price
  417. }
  418. }
  419. if(val4!=null && val4.length >0){
  420. for(let i=0;i<val4.length;i++){
  421. total_price_four +=val4[i].count * val4[i].price
  422. }
  423. }
  424. var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
  425. if(all_price >0){
  426. return all_price.toFixed(2)
  427. }else{
  428. return "0.00"
  429. }
  430. },
  431. getEndSalePrice(val,val3,val1,val2,val4){
  432. var total_price = 0
  433. var total_price_one = 0
  434. var total_price_two = 0
  435. var total_price_three = 0
  436. var total_price_four = 0
  437. var all_price= 0
  438. if(val!=null && val.length >0){
  439. for(let i=0;i<val.length;i++){
  440. total_price +=val[i].count * val[i].price
  441. }
  442. }
  443. if(val1!=null && val1.length >0){
  444. for(let i=0;i<val1.length;i++){
  445. total_price_one +=val1[i].count * val1[i].price
  446. }
  447. }
  448. if(val3!=null && val3.length >0){
  449. for(let i=0;i<val3.length;i++){
  450. total_price_three +=val3[i].count * val3[i].price
  451. }
  452. }
  453. if(val2!=null && val2.length >0){
  454. for(let i=0;i<val2.length;i++){
  455. total_price_two +=val2[i].count * val2[i].price
  456. }
  457. }
  458. if(val4!=null && val4.length >0){
  459. for(let i=0;i<val4.length;i++){
  460. total_price_four +=val4[i].count * val4[i].price
  461. }
  462. }
  463. var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
  464. if(all_price >0){
  465. return all_price.toFixed(2)
  466. }else{
  467. return 0
  468. }
  469. },
  470. getGoodTypeName(id){
  471. var type_name = ""
  472. for(let i=0;i<this.goodTypeList.length;i++){
  473. if(id == this.goodTypeList[i].id){
  474. type_name = this.goodTypeList[i].type_name
  475. }
  476. }
  477. return type_name
  478. },
  479. getWarehouseInfoStart(arr1,arr2,arr3,arr4,arr5){
  480. var count =0
  481. var countOne =0
  482. var countTwo= 0
  483. var countthree = 0 //期初
  484. var countfour = 0
  485. var countfive = 0
  486. if(arr1!=null && arr1.length > 0){
  487. for(let i=0;i<arr1.length;i++){
  488. countOne +=arr1[i].count
  489. }
  490. }
  491. if(arr2!=null && arr2.length > 0){
  492. for(let i=0;i<arr2.length;i++){
  493. countTwo +=arr2[i].count
  494. }
  495. }
  496. if(arr3!=null && arr3.length > 0){
  497. for(let i=0;i<arr3.length;i++){
  498. countthree +=arr3[i].count
  499. }
  500. }
  501. if(arr4!=null && arr4.length > 0){
  502. for(let i=0;i<arr4.length;i++){
  503. countfour +=arr4[i].count
  504. }
  505. }
  506. if(arr5!=null && arr5.length > 0){
  507. for(let i=0;i<arr5.length;i++){
  508. countfive +=arr5[i].count
  509. }
  510. }
  511. console.log("countOne",countOne)
  512. console.log("countTwo",countTwo)
  513. console.log("countthree",countthree)
  514. console.log("countfour",countfour)
  515. console.log("*********************")
  516. count = countOne - countTwo + countthree - countfour + countfive
  517. if(count > 0 ){
  518. return count
  519. }else{
  520. return 0
  521. }
  522. },
  523. getWarehouseInfoStartPrice(arr,arr1,arr2,arr3,arr4){
  524. var total_price = 0
  525. var total_price_one = 0
  526. var total_price_two = 0
  527. var total_price_three = 0
  528. var total_price_four = 0
  529. var total_price_all = 0
  530. if(arr!=null&&arr.length > 0){
  531. for(let i=0;i<arr.length;i++){
  532. total_price += arr[i].count * arr[i].buy_price
  533. }
  534. }
  535. if(arr1!=null && arr1.length > 0){
  536. for(let i=0;i<arr1.length;i++){
  537. total_price_one +=arr1[i].count * arr1[i].buy_price
  538. }
  539. }
  540. if(arr2!=null && arr2.length > 0){
  541. for(let i=0;i<arr2.length;i++){
  542. total_price_two +=arr2[i].count * arr2[i].buy_price
  543. }
  544. }
  545. if(arr3!=null && arr3.length > 0){
  546. for(let i=0;i<arr3.length;i++){
  547. total_price_three +=arr3[i].count * arr3[i].buy_price
  548. }
  549. }
  550. if(arr4!=null && arr4.length > 0){
  551. for(let i=0;i<arr4.length;i++){
  552. total_price_three +=arr4[i].count * arr4[i].buy_price
  553. }
  554. }
  555. total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
  556. if (total_price_all > 0) {
  557. return total_price_all.toFixed(2)
  558. }else{
  559. return "0.00"
  560. }
  561. },
  562. getWarehouseInfoOne(val,val2){
  563. var count =0
  564. var countOne = 0
  565. var all_count = 0
  566. if(val!=null && val.length >0){
  567. for(let i=0;i<val.length;i++){
  568. count +=val[i].count
  569. }
  570. }
  571. if(val2!=null && val2.length > 0){
  572. for(let i=0;i<val2.length;i++){
  573. countOne +=val2[i].count
  574. }
  575. }
  576. all_count = count + countOne
  577. console.log("count2332323223232o2222222222wide",count)
  578. console.log("countONE23232322323323223",countOne)
  579. console.log("all_count9999999999999wode",all_count)
  580. console.log("-------------------------------------------")
  581. if(all_count > 0 ){
  582. return all_count
  583. }else{
  584. return 0
  585. }
  586. },
  587. getAddStockMony(val,val2){
  588. var total_price =0
  589. var total_price_one = 0
  590. var all_price = 0
  591. if(val!=null && val.length >0){
  592. for(let i=0;i<val.length;i++){
  593. total_price +=val[i].count * val[i].buy_price
  594. }
  595. }
  596. if(val2!=null && val2.length > 0){
  597. for(let i=0;i<val2.length;i++){
  598. total_price_one +=val2[i].count * val2[i].price
  599. }
  600. }
  601. all_price = total_price + total_price_one
  602. if(all_price >0 ){
  603. return total_price.toFixed(2)
  604. }else{
  605. return "0.00"
  606. }
  607. },
  608. getSaleStockMony(val,val2){
  609. var total_price =0
  610. var total_price_one = 0
  611. var all_price = 0
  612. if(val!=null && val.length >0){
  613. for(let i=0;i<val.length;i++){
  614. total_price +=val[i].count * val[i].price
  615. }
  616. }
  617. if(val2!=null && val2.length > 0){
  618. for(let i=0;i<val2.length;i++){
  619. total_price_one +=val2[i].count * val2[i].price
  620. }
  621. }
  622. all_price = total_price + total_price_one
  623. if(all_price >0 ){
  624. return all_price.toFixed(2)
  625. }else{
  626. return "0.00"
  627. }
  628. },
  629. getWarehouseOut(val){
  630. var count = 0
  631. for(let i=0;i<val.length;i++){
  632. count +=val[i].count
  633. }
  634. if(count >0){
  635. return count
  636. }else{
  637. return 0
  638. }
  639. },
  640. getManufacturName(id){
  641. var manufacturer_name = ""
  642. for(let i=0;i<this.manufacturerList.length;i++){
  643. if(id == this.manufacturerList[i].id){
  644. manufacturer_name = this.manufacturerList[i].manufacturer_name
  645. }
  646. }
  647. return manufacturer_name
  648. },
  649. getDearName(id){
  650. var dear_name = ""
  651. for(let i=0;i<this.dealerList.length;i++){
  652. if(id == this.dealerList[i].id){
  653. dear_name = this.dealerList[i].dealer_name
  654. }
  655. }
  656. return dear_name
  657. },
  658. getEndOverPrice(val,val3,val1,val2,val4){
  659. var total_price = 0
  660. var total_price_one = 0
  661. var total_price_two = 0
  662. var total_price_three = 0
  663. var total_price_four =0
  664. var all_price = 0
  665. if(val!=null && val.length >0){
  666. for(let i=0;i<val.length;i++){
  667. total_price +=val[i].count * val[i].buy_price
  668. }
  669. }
  670. if(val1!=null && val1.length > 0){
  671. for(let i=0;i<val1.length;i++){
  672. total_price_one +=val1[i].count * val1[i].buy_price
  673. }
  674. }
  675. if(val3!=null && val3.length > 0){
  676. for(let i=0;i<val3.length;i++){
  677. total_price_three +=val3[i].count * val3[i].buy_price
  678. }
  679. }
  680. if(val2!=null && val2.length > 0){
  681. for(let i=0;i<val2.length;i++){
  682. total_price_two +=val2[i].count * val2[i].buy_price
  683. }
  684. }
  685. if(val4!=null && val4.length > 0){
  686. for(let i=0;i<val4.length;i++){
  687. total_price_four +=val4[i].count * val4[i].buy_price
  688. }
  689. }
  690. // console.log("total_price",total_price)
  691. // console.log("total_price_three",total_price_three)
  692. // console.log("total_price_two",total_price_two)
  693. // console.log("total_price_one",total_price_one)
  694. // console.log("total_price_four",total_price_four)
  695. all_price = total_price- total_price_three +total_price_one - total_price_two + total_price_four
  696. console.log("arrll_price",all_price)
  697. if(all_price >0){
  698. return all_price.toFixed(2)
  699. }else{
  700. return "0.00"
  701. }
  702. },
  703. getAllStockIn(val){
  704. var count = 0
  705. if(val!=null && val.length>0){
  706. for(let i=0;i<val.length;i++){
  707. count+= val[i].warehousing_count
  708. }
  709. }
  710. return count
  711. },
  712. getAllOutStockIn(val){
  713. var count = 0
  714. if(val!=null && val.length>0){
  715. for(let i=0;i<val.length;i++){
  716. count +=val[i].count
  717. }
  718. }
  719. return count
  720. },
  721. getAllStockInFlow(val){
  722. var count = 0
  723. if(val!=null && val.length>0){
  724. for(let i=0;i<val.length;i++){
  725. count+= val[i].count
  726. }
  727. }
  728. return count
  729. },
  730. getAllStockOutFlow(val){
  731. var count = 0
  732. if(val!=null && val.length>0){
  733. for(let i=0;i<val.length;i++){
  734. count+= val[i].count
  735. }
  736. }
  737. return count
  738. }
  739. },
  740. created(){
  741. this.org_id = this.$store.getters.xt_user.org_id
  742. var starttime = this.$route.query.start_time
  743. this.start_time = starttime
  744. var endtime = this.$route.query.end_time
  745. this.end_time = endtime
  746. var good_type = parseInt(this.$route.query.good_type)
  747. this.good_type = good_type
  748. var keyword = this.$route.query.keyword
  749. this.keyword = keyword
  750. this.page = parseInt(this.$route.query.page)
  751. this.limit = parseInt(this.$route.query.limit)
  752. this.getStorehouseList()
  753. this.getlist()
  754. }
  755. }
  756. </script>
  757. <style rel="stylesheet/scss" lang="scss" scoped>
  758. .print_main_content {
  759. background-color: white;
  760. max-width: 1500px;
  761. margin: 0 auto;
  762. padding: 0 0 20px 0;
  763. .order_title_panl {
  764. text-align: center;
  765. .main_title {
  766. font-size: 18px;
  767. line-height: 40px;
  768. font-weight: 500;
  769. }
  770. }
  771. .table_panel {
  772. .table {
  773. width: 100%;
  774. border: 1px solid;
  775. border-collapse: collapse;
  776. padding: 2px;
  777. thead {
  778. tr {
  779. td {
  780. border: 1px solid;
  781. text-align: center;
  782. font-size: 14px;
  783. padding: 15px 5px;
  784. }
  785. }
  786. }
  787. tbody {
  788. tr {
  789. td {
  790. border: 1px solid;
  791. text-align: center;
  792. font-size: 14px;
  793. padding: 10px 5px;
  794. white-space: pre-line;
  795. .proj {
  796. padding: 5px 0;
  797. text-align: left;
  798. .proj_title {
  799. font-size: 16px;
  800. font-weight: 500;
  801. line-height: 25px;
  802. }
  803. .proj_item {
  804. font-size: 15px;
  805. line-height: 20px;
  806. .zone_name {
  807. font-weight: 500;
  808. }
  809. }
  810. }
  811. }
  812. }
  813. }
  814. }
  815. }
  816. }
  817. </style>