purchaseNewStockQueryPrint.vue 34KB

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