12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- <el-row style="float:right;">
- <el-col :span="24">
- <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
- </el-col>
- </el-row>
- </div>
- <div class="app-container" style="background-color: white;" v-loading="loading">
- <div id="print_content">
- <div class="print_main_content">
- <div class="order_title_panl">
- <span class="main_title">耗材进销存查询表</span>
- </div>
- <div style="text-align:left;margin-bottom:20px;font-size: 14px;margin-bottom:-30px">
- <span class="time_p">查询日期:{{start_time}} ~</span><span class="time_p">{{end_time}}</span>
- </div>
- <div style="text-align:right;margin-bottom:20px;font-size: 14px;">
- <span class="time_p"> 打印时间:{{time_now}}</span>
- </div>
- <div class="table_panel">
- <table class="table">
- <thead>
- <tr>
- <td rowspan="2" width="80">序号</td>
- <td rowspan="2" width="80" v-if="org_id==9956 || org_id == 0">耗材编码</td>
- <td rowspan="2" width="80">国家编码</td>
- <td rowspan="2" width="80">耗材名称</td>
- <td rowspan="2" width="80">耗材类型</td>
- <td rowspan="2" width="80">规格&单位</td>
- <td rowspan="2" width="80">生产厂商</td>
- <td rowspan="2" width="80">经销商</td>
- <td width="80" colspan="3">期初结余</td>
- <td width="80" colspan="3">本期增加</td>
- <td width="80" colspan="3">本期减少</td>
- <td width="80" colspan="3">期末结余</td>
- </tr>
- <tr>
- <td>数量</td>
- <td>进货金额</td>
- <td>销售金额</td>
- <td>数量</td>
- <td>进货金额</td>
- <td>销售金额</td>
- <td>数量</td>
- <td>进货金额</td>
- <td>销售金额</td>
- <td>数量</td>
- <td>进货金额</td>
- <td>销售金额</td>
- </tr>
-
- </thead>
- <tbody>
- <tr v-for="(item,index) in this.tableList" :key="index">
- <td>{{index + 1}}</td>
- <td v-if="org_id==9956 || org_id== 0">{{item.good_number}}</td>
- <td>{{item.social_security_directory_code}}</td>
- <td>{{item.good_name}}</td>
- <td>{{getGoodTypeName(item.good_type_id)}}</td>
- <td>{{item.specification_name}}</td>
- <td> {{getManufacturName(item.manufacturer)}}</td>
- <td> {{getDearName(item.dealer)}}</td>
- <td>{{item.stockIn}}</td>
- <td>{{item.stock_in_price}}</td>
- <td>{{item.stockMoney}}</td>
- <td>{{item.stockAdd}}</td>
- <td>{{item.addStockMoney}}</td>
- <td>{{item.saleStockMoney}}</td>
- <td>{{item.outStock}}</td>
- <td>{{item.stockOutprice}}</td>
- <td>{{item.saleOutMoney}}</td>
- <td>{{item.overStock}}</td>
- <td>{{item.overPrice}}</td>
- <td>{{item.overMoney}}</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import { getStorehouseList,getNewPurchaseStockQuery } from "@/api/drug/drug"
- import {
- getStockDrugCount
- } from "@/api/stock";
- import print from 'print-js'
- const moment = require('moment')
- export default {
- components:{
- BreadCrumb
- },
- data(){
- return{
- crumbs: [
- { path: false, name: '库存管理' },
- { path: false, name: '库存查询' },
- { path: false, name: '库存查询打印' },
- ],
- start_time:"",
- end_time:"",
- drug_name:"",
- drug_spec:"",
- keyword:"",
- tableData:[],
- time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
- type_name:"",
- limit:"",
- page:"",
- loading: false,
- warehouseInfoDate: [],
- tableList:[],
- good_type:[],
- manufacturerList:[],
- countList:[],
- outCountList:[],
- autoCountList:[],
- cancelCountList:[],
- org_id:0,
- goodTypeList:[],
- dealerList:[]
- }
- },
- methods:{
- printAction: function() {
- 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; } }'
- printJS({
- printable: 'print_content',
- type: 'html',
- documentTitle: ' ',
- style: style,
- scanStyles: false
- })
- },
- getStorehouseList(){
- getStorehouseList().then(response=>{
- if(response.data.state == 1){
-
- this.manufacturerList = response.data.data.manufacturerList
- var obj = {id:0,type_name:"全部"}
- this.goodTypeList.push(obj)
- var goodTypeList = response.data.data.goodTypeList
- for(let i=0;i<goodTypeList.length;i++){
- this.goodTypeList.push(goodTypeList[i])
- }
- this.dealerList = response.data.data.dealerList
- }
- })
- },
- getlist(){
- this.loading = true
- var params = {
- good_type:this.good_type,
- keyword:this.keyword,
- page:this.page,
- limit:this.limit,
- start_time:this.start_time,
- end_time:this.end_time,
- }
- getNewPurchaseStockQuery(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- this.loading = false
- for(let i=0;i<list.length;i++){
- // list[i].stockIn = list[i].GoodStartFlowInfo.over_count
-
- if(this.org_id == 0 || this.org_id ==10210 || this.org_id == 10265){
- list[i].stockIn = list[i].GoodStartFlowInfo.over_count
- }else{
- if(list[i].id== 5052){
- list[i].stockIn = list[i].GoodStartFlowInfo.over_count
- }else{
- list[i].stockIn = this.getAllStockIn(list[i].StWarehousingInfoTwo) + this.getAllStockInFlow(list[i].WareStartInStockFlow) - this.getAllOutStockIn(list[i].WarehouseOutInfoTenty) - this.getAllStockOutFlow(list[i].WareStartOutStockFlow)
- if(list[i].stockIn <0){
- list[i].stockIn =0
- }
- }
- }
-
- if(this.org_id == 0 || this.org_id ==10697){
- list[i].stock_in_price = list[i].buy_price
- list[i].stockMoney = (list[i].buy_price * list[i].stockIn).toFixed(2)
- }else if(this.org_id == 0 || this.org_id == 10644){
- list[i].stock_in_price = "/"
- list[i].stockMoney = (this.getAllStockInPrice(list[i].StWarehousingInfoTwo) + this.getAllStockInFlowPrice(list[i].WareStartInStockFlow) - this.getAllOutStockInPrice(list[i].WarehouseOutInfoTenty) - this.getAllStockOutFlowPrice(list[i].WareStartOutStockFlow)).toFixed(2)
- } else{
- list[i].stock_in_price = "/"
- list[i].stockMoney = "/"
- }
-
-
- list[i].stockAdd = this.getWarehouseInfoOne(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)//期间增加
-
- if(this.org_id == 0 || this.org_id ==10697){
- list[i].addStockMoney = list[i].buy_price
- list[i].saleStockMoney = (list[i].buy_price *list[i].stockAdd).toFixed(2)
- }else if(this.org_id == 0 || this.org_id == 10164){
- list[i].addStockMoney = "/"
- list[i].saleStockMoney = this.getWarehouseInfoOnePrice(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit).toFixed(2)
- }else{
- list[i].addStockMoney = "/"
- list[i].saleStockMoney = "/"
- }
-
-
- list[i].outStock = this.getWarehosueOutInfo(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)//本期减少
-
-
- if(this.org_id == 0 || this.org_id == 10697){
- list[i].stockOutprice = list[i].packing_price
- list[i].saleOutMoney = (list[i].packing_price * list[i].outStock).toFixed(2)
- }else if(this.org_id == 0 || this.org_id == 10164){
- list[i].addStockMoney = "/"
- list[i].saleStockMoney = this.getWarehouseInfoOnePrice(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit).toFixed(2)
- }else{
- list[i].stockOutprice = "/"
- list[i].saleOutMoney = "/"
- }
-
- if(this.org_id ==0 || this.org_id ==10265){
- list[i].overStock = list[i].GoodEndFlowInfo.over_count
- }else{
- list[i].overStock = list[i].stockIn + list[i].stockAdd - list[i].outStock
- }
-
- if(this.org_id == 0 || this.org_id ==10697){
- list[i].overPrice = list[i].packing_price
- list[i].overMoney = (list[i].packing_price*list[i].overStock).toFixed(2)
- }else if(this.org_id == 0 || this.org_id == 10164){
- list[i].stockOutprice = "/"
- list[i].saleOutMoney = this.getWarehosueOutInfoPrice(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)
- }else{
- list[i].overPrice = "/"
- list[i].overMoney = "/"
- }
-
- }
-
-
- 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}
-
- if(this.org_id == 0 || this.org_id == 10697){
- if(list.length!=null){
- for(let i=0;i<list.length;i++){
-
- // obj.stock_in_price += (this.tableList[i].stock_in_price).toFixed(2)
- obj.stockMoney += parseFloat(list[i].stockMoney)
- // obj.stockOutprice += (this.tableList[i].stockOutprice).toFixed(2)
- obj.saleStockMoney += parseFloat(list[i].saleStockMoney)
-
- obj.saleOutMoney += parseFloat(list[i].saleOutMoney)
- // obj.overPrice += (this.tableList[i].overPrice).toFixed(2)
- obj.overMoney += parseFloat(list[i].overMoney)
-
- }
- obj.stockMoney = obj.stockMoney.toFixed(2)
- obj.saleStockMoney = obj.saleStockMoney.toFixed(2)
- obj.overMoney = obj.overMoney.toFixed(2)
- obj.saleOutMoney = obj.saleOutMoney.toFixed(2)
-
- list.push(obj)
- }
- }
- this.tableList = list
- this.manufacturerList = response.data.data.manufacturerList
-
- }
- })
- },
- getWarehouseInfoStartMoney(arr,arr1,arr2,arr3,arr4){
- var total_price = 0
- var total_price_one = 0
- var total_price_two = 0
- var total_price_three = 0
- var total_price_four = 0
- var total_price_all = 0
- if(arr!=null && arr.length >0){
- for(let i=0;i<arr.length;i++){
- total_price +=arr[i].count * arr[i].price
- }
- }
- if(arr1!=null && arr1.length > 0){
- for(let i=0;i<arr1.length;i++){
- total_price_one +=arr1[i].count * arr1[i].price
- }
-
- }
- if(arr2!=null && arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- total_price_two +=arr2[i].count * arr2[i].price
- }
-
- }
- if(arr3!=null && arr3.length > 0){
- for(let i=0;i<arr3.length;i++){
- total_price_three +=arr3[i].count * arr3[i].price
- }
-
- }
- if(arr4!=null && arr4.length > 0){
- for(let i=0;i<arr4.length;i++){
- total_price_four +=arr4[i].count * arr4[i].price
- }
-
- }
- total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
- if (total_price_all > 0) {
- return total_price_all.toFixed(2)
- }else{
- return "0.00"
- }
- },
- getWarehosueOutInfo(val,val2,val3){
- var count = 0
- var count_one = 0
- var all_count = 0
- var count_two = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- count +=val[i].count
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- count_one +=val2[i].count
- }
- }
- if(val3!=null && val3.length > 0){
- for(let i=0;i<val3.length;i++){
- count_two +=val3[i].count
- }
- }
- all_count = count +count_one - count_two
- if(all_count >0){
- return all_count
- }else{
- return 0
- }
- },
- stockOutprice(val,val2,val3){
- var total_price = 0
- var total_price_one = 0
- var total_price_two = 0
- var all_price = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- total_price +=val[i].count * val[i].buy_price
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- total_price_one +=val2[i].count * val2[i].buy_price
- }
- }
- if(val3!=null && val3.length > 0){
- for(let i=0;i<val3.length;i++){
- total_price_two +=val3[i].count * val3[i].buy_price
- }
- }
- all_price = total_price + total_price_one - total_price_two
- if(all_price >0){
- return all_price.toFixed(2)
- }else{
- return "0.00"
- }
- },
- saleOutprice(val,val2,val3){
- var total_price = 0
- var total_price_one = 0
- var all_price = 0
- var total_price_two = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- total_price +=val[i].count * val[i].xt_warehouse_info.packing_price
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- total_price_one +=val2[i].count * val2[i].price
- }
- }
- if(val3!=null && val3.length > 0){
- for(let i=0;i<val3.length;i++){
- total_price_two +=val3[i].count * val3[i].price
- }
- }
- all_price = total_price + total_price_one - total_price_two
- if(all_price >0){
- return all_price.toFixed(2)
- }else{
- return "0.00"
- }
- },
- getEndWarehouseInfo(val,val3,val1,val2,val4){
- var count = 0
- var count_one = 0
- var count_two = 0
- var count_three =0
- var count_four = 0
- var all_count = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- count +=val[i].count
- }
- }
- if(val1!=null&&val1.length >0){
- for(let i=0;i<val1.length;i++){
- count_one +=val1[i].count
- }
- }
- if(val3!=null&& val3.length > 0){
- for(let i=0;i<val3.length;i++){
- count_three +=val3[i].count
- }
- }
- if(val2!=null&&val2.length >0){
- for(let i=0;i<val2.length;i++){
- count_two +=val2[i].count
- }
- }
- if(val4!=null&&val4.length >0){
- for(let i=0;i<val4.length;i++){
- count_four +=val4[i].count
- }
- }
- all_count = count- count_three + count_one - count_two + count_four
- if(all_count >0){
- return all_count
- }else{
- return 0
- }
- },
- getEndWarehouseInfo(val,val3,val1,val2,val4){
- var count = 0
- var count_one = 0
- var count_two = 0
- var count_three =0
- var count_four = 0
- var all_count = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- count +=val[i].count
- }
- }
- if(val1!=null&&val1.length >0){
- for(let i=0;i<val1.length;i++){
- count_one +=val1[i].count
- }
- }
- if(val3!=null&& val3.length > 0){
- for(let i=0;i<val3.length;i++){
- count_three +=val3[i].count
- }
- }
- if(val2!=null&&val2.length >0){
- for(let i=0;i<val2.length;i++){
- count_two +=val2[i].count
- }
- }
- if(val4!=null&&val4.length >0){
- for(let i=0;i<val4.length;i++){
- count_four +=val4[i].count
- }
- }
- all_count = count- count_three + count_one - count_two + count_four
- if(all_count >0){
- return all_count
- }else{
- return 0
- }
- },
- getEndSalePrice(val,val3,val1,val2,val4){
- var total_price = 0
- var total_price_one = 0
- var total_price_two = 0
- var total_price_three = 0
- var total_price_four = 0
- var all_price= 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- total_price +=val[i].count * val[i].price
- }
- }
- if(val1!=null && val1.length >0){
- for(let i=0;i<val1.length;i++){
- total_price_one +=val1[i].count * val1[i].price
- }
- }
- if(val3!=null && val3.length >0){
- for(let i=0;i<val3.length;i++){
- total_price_three +=val3[i].count * val3[i].price
- }
- }
- if(val2!=null && val2.length >0){
- for(let i=0;i<val2.length;i++){
- total_price_two +=val2[i].count * val2[i].price
- }
- }
- if(val4!=null && val4.length >0){
- for(let i=0;i<val4.length;i++){
- total_price_four +=val4[i].count * val4[i].price
- }
- }
- var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
- if(all_price >0){
- return all_price.toFixed(2)
- }else{
- return "0.00"
- }
- },
- getEndSalePrice(val,val3,val1,val2,val4){
- var total_price = 0
- var total_price_one = 0
- var total_price_two = 0
- var total_price_three = 0
- var total_price_four = 0
- var all_price= 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- total_price +=val[i].count * val[i].price
- }
- }
- if(val1!=null && val1.length >0){
- for(let i=0;i<val1.length;i++){
- total_price_one +=val1[i].count * val1[i].price
- }
- }
- if(val3!=null && val3.length >0){
- for(let i=0;i<val3.length;i++){
- total_price_three +=val3[i].count * val3[i].price
- }
- }
- if(val2!=null && val2.length >0){
- for(let i=0;i<val2.length;i++){
- total_price_two +=val2[i].count * val2[i].price
- }
- }
- if(val4!=null && val4.length >0){
- for(let i=0;i<val4.length;i++){
- total_price_four +=val4[i].count * val4[i].price
- }
- }
- var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
- if(all_price >0){
- return all_price.toFixed(2)
- }else{
- return 0
- }
- },
- getGoodTypeName(id){
- var type_name = ""
- for(let i=0;i<this.goodTypeList.length;i++){
- if(id == this.goodTypeList[i].id){
- type_name = this.goodTypeList[i].type_name
- }
- }
- if(type_name!="全部"){
- return type_name
- }
-
- },
- getWarehouseInfoStart(arr1,arr2,arr3,arr4,arr5){
- var count =0
- var countOne =0
- var countTwo= 0
- var countthree = 0 //期初
- var countfour = 0
- var countfive = 0
- if(arr1!=null && arr1.length > 0){
- for(let i=0;i<arr1.length;i++){
- countOne +=arr1[i].count
- }
- }
- if(arr2!=null && arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- countTwo +=arr2[i].count
- }
- }
- if(arr3!=null && arr3.length > 0){
- for(let i=0;i<arr3.length;i++){
- countthree +=arr3[i].count
- }
- }
- if(arr4!=null && arr4.length > 0){
- for(let i=0;i<arr4.length;i++){
- countfour +=arr4[i].count
- }
- }
- if(arr5!=null && arr5.length > 0){
- for(let i=0;i<arr5.length;i++){
- countfive +=arr5[i].count
- }
- }
- console.log("countOne",countOne)
- console.log("countTwo",countTwo)
- console.log("countthree",countthree)
- console.log("countfour",countfour)
- console.log("*********************")
- count = countOne - countTwo + countthree - countfour + countfive
- if(count > 0 ){
- return count
- }else{
- return 0
- }
- },
- getWarehouseInfoStartPrice(arr,arr1,arr2,arr3,arr4){
- var total_price = 0
- var total_price_one = 0
- var total_price_two = 0
- var total_price_three = 0
- var total_price_four = 0
- var total_price_all = 0
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total_price += arr[i].count * arr[i].buy_price
- }
- }
- if(arr1!=null && arr1.length > 0){
- for(let i=0;i<arr1.length;i++){
- total_price_one +=arr1[i].count * arr1[i].buy_price
- }
-
- }
- if(arr2!=null && arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- total_price_two +=arr2[i].count * arr2[i].buy_price
- }
-
- }
- if(arr3!=null && arr3.length > 0){
- for(let i=0;i<arr3.length;i++){
- total_price_three +=arr3[i].count * arr3[i].buy_price
- }
-
- }
- if(arr4!=null && arr4.length > 0){
- for(let i=0;i<arr4.length;i++){
- total_price_three +=arr4[i].count * arr4[i].buy_price
- }
-
- }
- total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
- if (total_price_all > 0) {
- return total_price_all.toFixed(2)
- }else{
- return "0.00"
- }
- },
- getWarehouseInfoOne(val,val2){
- var count =0
- var countOne = 0
- var all_count = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- count +=val[i].count
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- countOne +=val2[i].count
- }
- }
- all_count = count + countOne
- console.log("count2332323223232o2222222222wide",count)
- console.log("countONE23232322323323223",countOne)
- console.log("all_count9999999999999wode",all_count)
- console.log("-------------------------------------------")
- if(all_count > 0 ){
- return all_count
- }else{
- return 0
- }
- },
- getAddStockMony(val,val2){
- var total_price =0
- var total_price_one = 0
- var all_price = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- total_price +=val[i].count * val[i].buy_price
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- total_price_one +=val2[i].count * val2[i].price
- }
- }
- all_price = total_price + total_price_one
- if(all_price >0 ){
- return total_price.toFixed(2)
- }else{
- return "0.00"
- }
- },
- getSaleStockMony(val,val2){
- var total_price =0
- var total_price_one = 0
- var all_price = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- total_price +=val[i].count * val[i].price
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- total_price_one +=val2[i].count * val2[i].price
- }
- }
- all_price = total_price + total_price_one
- if(all_price >0 ){
- return all_price.toFixed(2)
- }else{
- return "0.00"
- }
- },
- getWarehouseOut(val){
- var count = 0
- for(let i=0;i<val.length;i++){
- count +=val[i].count
- }
- if(count >0){
- return count
- }else{
- return 0
- }
- },
- getManufacturName(id){
- var manufacturer_name = ""
- for(let i=0;i<this.manufacturerList.length;i++){
- if(id == this.manufacturerList[i].id){
- manufacturer_name = this.manufacturerList[i].manufacturer_name
- }
- }
- return manufacturer_name
- },
- getDearName(id){
- var dear_name = ""
- for(let i=0;i<this.dealerList.length;i++){
- if(id == this.dealerList[i].id){
- dear_name = this.dealerList[i].dealer_name
- }
- }
- return dear_name
- },
- getEndOverPrice(val,val3,val1,val2,val4){
- var total_price = 0
- var total_price_one = 0
- var total_price_two = 0
- var total_price_three = 0
- var total_price_four =0
- var all_price = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- total_price +=val[i].count * val[i].buy_price
- }
- }
- if(val1!=null && val1.length > 0){
- for(let i=0;i<val1.length;i++){
- total_price_one +=val1[i].count * val1[i].buy_price
- }
- }
- if(val3!=null && val3.length > 0){
- for(let i=0;i<val3.length;i++){
- total_price_three +=val3[i].count * val3[i].buy_price
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- total_price_two +=val2[i].count * val2[i].buy_price
- }
- }
- if(val4!=null && val4.length > 0){
- for(let i=0;i<val4.length;i++){
- total_price_four +=val4[i].count * val4[i].buy_price
- }
- }
- // console.log("total_price",total_price)
- // console.log("total_price_three",total_price_three)
- // console.log("total_price_two",total_price_two)
- // console.log("total_price_one",total_price_one)
- // console.log("total_price_four",total_price_four)
- all_price = total_price- total_price_three +total_price_one - total_price_two + total_price_four
- console.log("arrll_price",all_price)
- if(all_price >0){
- return all_price.toFixed(2)
- }else{
- return "0.00"
- }
- },
-
- getAllStockIn(val){
- var count = 0
- if(val!=null && val.length>0){
- for(let i=0;i<val.length;i++){
- count+= val[i].warehousing_count
- }
- }
- return count
- },
- getAllStockInPrice(val){
- var total_price =0
- if(val!=null && val.length>0){
- for(let i=0;i<val.length;i++){
- total_price += val[i].warehousing_count * val[i].price
- }
-
- }
- return total_price
- },
- getAllOutStockIn(val){
- var count = 0
- if(val!=null && val.length>0){
- for(let i=0;i<val.length;i++){
- count +=val[i].count
- }
- }
- return count
- },
- getAllStockInFlowPrice(val){
- var total_price = 0
- if(val!=null && val.length>0){
- for(let i=0;i<val.length;i++){
- total_price+= val[i].count * val[i].total_price
- }
- }
- return total_price
- },
- getAllStockInFlow(val){
- var count = 0
- if(val!=null && val.length>0){
- for(let i=0;i<val.length;i++){
- count+= val[i].count
- }
- }
- return count
- },
- getAllStockOutFlow(val){
- var count = 0
- if(val!=null && val.length>0){
- for(let i=0;i<val.length;i++){
- count+= val[i].count
- }
- }
- return count
- },
- getAllOutStockInPrice(val){
- var total_price = 0
- if(val!=null && val.length>0){
- for(let i=0;i<val.length;i++){
- total_price += val[i].count * val[i].price
- }
- }
- return total_price
- },
- getAllStockOutFlowPrice(val){
- var total_price = 0
- if(val!=null && val.length>0){
- for(let i=0;i<val.length;i++){
- total_price+= val[i].count * val[i].price
- }
- }
- return total_price
- },
- getWarehouseInfoOnePrice(val,val2){
- var count_price =0
- var count_one_price = 0
- var all_count_price = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- count_price +=val[i].count * val[i].price
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- count_one_price +=val2[i].count * val[i].price
- }
- }
- all_count_price = count_price + count_one_price
-
- if(all_count_price > 0 ){
- return all_count_price
- }else{
- return 0
- }
- },
- getWarehosueOutInfoPrice(val,val2,val3){
- var count_price = 0
- var count_one_price = 0
- var all_count_price = 0
- var count_two_price = 0
- if(val!=null && val.length >0){
- for(let i=0;i<val.length;i++){
- count_price += val[i].count * val[i].price
- }
- }
- if(val2!=null && val2.length > 0){
- for(let i=0;i<val2.length;i++){
- count_one_price +=val2[i].count * val[i].price
- }
- }
- if(val3!=null && val3.length > 0){
- for(let i=0;i<val3.length;i++){
- count_two_price +=val3[i].count * val[i].price
- }
- }
- console.log("本期减少",count_price)
- console.log("盘亏",count_one_price)
- console.log("退库",all_count_price)
- all_count_price = count_price +count_one_price - count_two_price
- console.log("数据我哦我我",all_count_price)
- if(all_count_price >0){
- return all_count_price
- }else{
- return 0
- }
- },
-
- },
- created(){
- this.org_id = this.$store.getters.xt_user.org_id
-
- var starttime = this.$route.query.start_time
- this.start_time = starttime
- var endtime = this.$route.query.end_time
- this.end_time = endtime
- var good_type = parseInt(this.$route.query.good_type)
- this.good_type = good_type
- var keyword = this.$route.query.keyword
- this.keyword = keyword
- this.page = parseInt(this.$route.query.page)
- this.limit = parseInt(this.$route.query.limit)
- this.getStorehouseList()
- this.getlist()
-
-
- }
- }
- </script>
-
-
- <style rel="stylesheet/scss" lang="scss" scoped>
- .print_main_content {
- background-color: white;
- max-width: 1500px;
- margin: 0 auto;
- padding: 0 0 20px 0;
-
- .order_title_panl {
- text-align: center;
-
- .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: 14px;
- padding: 15px 5px;
- }
- }
- }
- tbody {
- tr {
- td {
- border: 1px solid;
- text-align: center;
- font-size: 14px;
- 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;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- </style>
|