|
@@ -0,0 +1,269 @@
|
|
|
+//库点库存
|
|
|
+<template>
|
|
|
+ <div class="container">
|
|
|
+ <el-row class="row_top">
|
|
|
+ <el-col :span="12">
|
|
|
+ <h2 class="bg-left title">库存分布</h2>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="bg-right"><el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
|
|
|
+ style="vertion-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
|
|
|
+ </el-button></el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="center">
|
|
|
+ <el-row style='margin-bottom:10px;'>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-select v-model="warehouseName" filterable clearable placeholder="" @change="selectwarehouse" :value="searchType">
|
|
|
+ <el-option v-for="item in warehouse" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div class="datascreen">
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="fromdata">
|
|
|
+ <el-table :data="tableData" stripe style="width: 100%">
|
|
|
+ <el-table-column type="index" label="序号">
|
|
|
+ <template scope="scope">
|
|
|
+ <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
|
|
|
+ <span v-else>{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="warehouse" label="所属仓库"></el-table-column>
|
|
|
+ <el-table-column prop="locusWarehouse" label="所在仓库"></el-table-column>
|
|
|
+ <el-table-column prop="goodsName" label="货名"></el-table-column>
|
|
|
+ <el-table-column prop="inventory" label="剩余库存(吨)"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
+ style="text-align:center" :page-size="deptCircularPage.pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ getinventoryinfo,
|
|
|
+ getwarehouse
|
|
|
+ } from '@/model/profitable/index'
|
|
|
+ export default {
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ value: "",
|
|
|
+ tableData: [],
|
|
|
+ deptBudgetTotal: 0,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ deptCircularPage: {},
|
|
|
+ taskTypeList:[],
|
|
|
+ warehouse:[],
|
|
|
+ searchType:"",
|
|
|
+ searchKeyWord:"",
|
|
|
+ startDate:"",
|
|
|
+ endDate:"",
|
|
|
+ outtotal:0,
|
|
|
+ intotal:0,
|
|
|
+ foodExpenditure:0,
|
|
|
+ grainIncome:0,
|
|
|
+ expenseIncome:0,
|
|
|
+ expensesPay:0,
|
|
|
+ currentProfit:0,
|
|
|
+ warehouseName:'',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ // this.getPassYearFormatDate()
|
|
|
+ this.warehouseName=this.$route.query.warehouseName
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ typeChange(num){
|
|
|
+ this.searchType = num
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ returnsales(){
|
|
|
+ this.$router.go(-1)
|
|
|
+ },
|
|
|
+ getPassYearFormatDate () {
|
|
|
+ var nowDate = new Date()
|
|
|
+ var _date = new Date()
|
|
|
+ nowDate.setTime(nowDate.getTime()-24*60*60*1000*30)
|
|
|
+ var year = nowDate.getFullYear()
|
|
|
+ var year1 = _date.getFullYear()
|
|
|
+ var month = nowDate.getMonth() + 1
|
|
|
+ var month1 = _date.getMonth() + 1
|
|
|
+ var strDate = nowDate.getDate()
|
|
|
+ var strDate1 = _date.getDate()
|
|
|
+ if (month >= 1 && month <= 9) {
|
|
|
+ month = '0' + month
|
|
|
+ }
|
|
|
+ if (month1 >= 1 && month1 <= 9) {
|
|
|
+ month1 = '0' + month1
|
|
|
+ }
|
|
|
+
|
|
|
+ if (strDate >= 0 && strDate <= 9) {
|
|
|
+ strDate = '0' + strDate
|
|
|
+ }
|
|
|
+ if (strDate1 >= 0 && strDate1 <= 9) {
|
|
|
+ strDate1 = '0' + strDate1
|
|
|
+ }
|
|
|
+ this.startDate = year + '-' + month +'-' + strDate
|
|
|
+ this.endDate = year1 + '-' + month1 +'-' + strDate1
|
|
|
+ this.value=[this.startDate,this.endDate]
|
|
|
+ },
|
|
|
+ selectwarehouse(e){
|
|
|
+ this.warehouseName=e
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ getwarehouse({ compId: localStorage.getItem('ws-pf_compId'),warehouseType:1}).toPromise()
|
|
|
+ .then(response => {
|
|
|
+ this.warehouse = response
|
|
|
+
|
|
|
+ })
|
|
|
+ getinventoryinfo({
|
|
|
+ compId: localStorage.getItem('ws-pf_compId'),
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ warehouse:this.warehouseName,
|
|
|
+ pageSize:this.pageSize ,
|
|
|
+ inventoryType:3,
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then(response => {
|
|
|
+ this.tableData = response.records
|
|
|
+ if(this.tableData){
|
|
|
+ this.foodExpenditure=0
|
|
|
+ this.grainIncome=0
|
|
|
+ this.expenseIncome=0
|
|
|
+ this.expensesPay=0
|
|
|
+ this.currentProfit=0
|
|
|
+ for (let i = 0; i < this.tableData.length; i++) {
|
|
|
+ if(this.tableData[i].foodExpenditure){
|
|
|
+ this.foodExpenditure+=Number(this.tableData[i].foodExpenditure)
|
|
|
+ }
|
|
|
+ if(this.tableData[i].grainIncome){
|
|
|
+ this.grainIncome+=Number(this.tableData[i].grainIncome)
|
|
|
+ }
|
|
|
+ if(this.tableData[i].expenseIncome){
|
|
|
+ this.expenseIncome+=Number(this.tableData[i].expenseIncome)
|
|
|
+ }
|
|
|
+ if(this.tableData[i].expensesPay){
|
|
|
+ this.expensesPay+=Number(this.tableData[i].expensesPay)
|
|
|
+ }
|
|
|
+ if(this.tableData[i].currentProfit){
|
|
|
+ this.currentProfit+=Number(this.tableData[i].currentProfit)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.deptBudgetTotal = response.total
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeDate(){
|
|
|
+ if(this.value){
|
|
|
+ this.startDate = this.value[0]
|
|
|
+ this.endDate = this.value[1]
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ pickerOptions() {},
|
|
|
+ find() {
|
|
|
+ this.getList()
|
|
|
+
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ console.log(`每页 ${val} 条`)
|
|
|
+ this.pageSize = val
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.currentPage = val
|
|
|
+ console.log(`当前页: ${val}`)
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .container {
|
|
|
+ background: #E8ECF6;
|
|
|
+ }
|
|
|
+
|
|
|
+ .center {
|
|
|
+ margin: 0 auto;
|
|
|
+ background: #ffffff;
|
|
|
+ height: calc(100vh - 13vh);
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 20px 0;
|
|
|
+
|
|
|
+ /deep/.el-table td,
|
|
|
+ /deep/.el-table th {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .row_top {
|
|
|
+ background: #F6F7FC;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+
|
|
|
+ .bg-left {
|
|
|
+ padding-left: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bg-right {
|
|
|
+ padding-right: 10px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title {
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title::before {
|
|
|
+ content: '';
|
|
|
+ display: inline-block;
|
|
|
+ width: 5px;
|
|
|
+ height: 30px;
|
|
|
+ background: #5473e8;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .datascreen {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .data_css {
|
|
|
+ width: 40%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .input_css {
|
|
|
+ width: 50%;
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .find {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .fromdata {
|
|
|
+ margin: 20px 0;
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: 546px;
|
|
|
+ }
|
|
|
+ .top_info{
|
|
|
+ margin: 10px 0 0 10px;
|
|
|
+ min-width: 712px;
|
|
|
+ .info_css{
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .bg-right{
|
|
|
+ padding-top:15px;
|
|
|
+ }
|
|
|
+</style>
|