// 物料出入库记录
<template>
    <div class="container">
        <el-row class="toptitle">
            <el-col :span="12">
                <h2 class="bg-left title">物料出入库记录</h2>
            </el-col>
            <el-col :span="12" class="bg-right">
                <el-button type="primary" size="small" @click="returnsales()">
                    <img width="6" height="10" style="vertical-align: bottom; margin-right: 3px"
                        src="../../../public/img/lujing.png" alt="" />返回
                </el-button>
            </el-col>
        </el-row>
        <div class="center">
            <el-row>
                <el-col :span="6" style="height: 45px"></el-col>
                <el-col :span="18" class="bg-right">
                    <div style="display:flex">
                        <el-select style='margin-right:5px; width:40%' v-model="warehouseName" placeholder="请选择仓库名"
                            @change="warehouseNameChange">
                            <el-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName"
                                :value="item.warehouseName"></el-option>
                        </el-select>
                        <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels
                            range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
                            :picker-options="pickerOptions">
                        </el-date-picker>
                        <el-input placeholder=" 可按物料名称、车牌号和操作员姓名查找" clearable v-model="searchKeyWord"
                            class="search_css">
                        </el-input>
                        <el-button type="primary" size="small" @click="lookup">查找</el-button>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="18" style="height: 33px;">
                    <el-button style="margin-left: 10px !important" @click="inOutChange('')"
                        :type="inOutFlag == '' ? 'primary' : ''">全部</el-button>
                    <el-button @click="inOutChange(2)" :type="inOutFlag == 2 ? 'primary' : ''">入库</el-button>
                    <el-button @click="inOutChange(1)" :type="inOutFlag == 1 ? 'primary' : ''">出库</el-button>
                </el-col>
                <el-col :span="18" style="display:flex;margin-left: 45%;">
                    <div style="text-align:right;margin-right:80px;">合计入库重量（吨）：{{ inWeight }}</div>
                    <div style="text-align:right;margin-right:60px;">合计出库重量（吨）：{{ outWeight }}</div>
                    <div style="text-align:right;margin-right:40px;">合计入库数量（个）：{{ inCount }}</div>
                    <div style="text-align:right;margin-right:20px;">合计出库数量（个）：{{ outCount }}</div>
                </el-col>
            </el-row>
            <el-table class="forData" :data="weighingRecordList" style="width: 100%; margin-top: 20px" height="500"
                @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="55"></el-table-column>
                <el-table-column type="index" label="序号" width="50">
                    <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="businessNo" label="业务编号" width="150"></el-table-column> -->
                <el-table-column prop="itemName" label="物料名称" width="120"></el-table-column>
                <el-table-column label="类型" width="60">
                    <template scope="scope">
                        <span v-if="scope.row.inOutFlag == '1'">出库</span>
                        <span v-else>入库</span>
                    </template>
                </el-table-column>
                <el-table-column prop="deliveryMethod" label="统计方式" width="100">
                    <template scope="scope">
                        <span v-if="scope.row.deliveryMethod == '1'">称重</span>
                        <span v-else>计数</span>
                    </template>
                </el-table-column>
                <el-table-column prop="grossWeight" label="毛重（公斤）" width="150"></el-table-column>
                <el-table-column prop="tare" label="皮重（公斤）" width="150"></el-table-column>
                <el-table-column prop="netWeight" label="净重（公斤）" width="150"></el-table-column>
                <el-table-column prop="carNo" label="车牌号" width="150"></el-table-column>
                <el-table-column prop="materialQuantity" label="数量（个）" width="100"></el-table-column>
                <el-table-column label="经办人" width="200">
                    <template scope="scope">
                        <span v-if="scope.row.grossAgent == scope.row.tareAgent"> {{ scope.row.grossAgent }}</span>
                        <span v-else>{{ scope.row.grossAgent }} {{ scope.row.tareAgent }}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="status" label="状态"></el-table-column>
                <el-table-column prop="inOutWarehouseDate" label="出入库日期">
                    <template scope="scope">
                        <span>{{ scope.row.inOutWarehouseDate.split(" ")[0] }}</span>
                    </template>
                </el-table-column>
                <!-- <el-table-column label="操作"  width="200">
                    <template scope="scope">
                        <el-button @click="printInfo(scope.row)" >打印</el-button>
                        <el-button @click="deleteInfo(scope.row)" v-if="scope.row.status == '待称皮重'">删除</el-button>
                    </template>
                </el-table-column> -->
            </el-table>
        </div>
        <div style="text-align: center; padding: 10px">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="currentPage" :page-size="deptCircularPage.pageSize"
                layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
            </el-pagination>
        </div>
        <!-- <div class="mask1" v-show="isShowPrintTypeBills"></div>
        <div class="print-type1" v-show="isShowPrintTypeBills">
            <div class="print-type-content">
                <div class="print-type-title">请选择打印纸张类型</div>
                <div class="print-type-checkbox">
                </div>
                <div class="shdw-style1" v-if="checked || (!ddchecked && !checked)">
                    <div>收货单位：</div>
                    <el-select v-model="companyName" placeholder="请选择" style="width: 75%;">
                        <el-option v-for="item in companyNameOptions" :key="item.value" :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </div>
                <div
                    v-if="warehouseName1 == '鲅鱼圈金信库' || warehouseName1 == '白城内陆港' || warehouseName1 == '杜尔伯特家禾库' || warehouseName1 == '洮南新友谊兴旺库' || warehouseName1 == '甘南宏旗库' || warehouseName1 == '哈尔滨依兰库' || warehouseName1 == '山东园丰库'">
                    <div class="print-type-ew">
                        <el-checkbox v-model="checked" @change="changeEw">打印额外票据</el-checkbox>
                        <el-checkbox v-model="ddchecked" @change="changeEwDD">单独打印额外票据</el-checkbox>
                    </div>
                    <div class="ew-print" v-if="printSeparately">
                        <div class="row">
                            <div>额外客户姓名：</div>
                            <el-select v-model="ewCustomer" placeholder="请选择" style="width: 75%;">
                                <el-option v-for="item in ewCustomerOptions" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </div>
                        <div class="row">
                            <div>额外收货单位：</div>
                            <el-select v-model="companyNameEW" placeholder="请选择" style="width: 75%;">
                                <el-option v-for="item in companyNameEWOptions" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bottom-btn">
                <el-button @click="printBig1">确定</el-button>
                <el-button @click="typePrintCannelClick1">取消</el-button>
            </div>
        </div> -->
    </div>
</template>
<script>
import {
    // delMaterial,
    getMaterialRecord
} from '@/model/warehouse/index'
import {
    selectWarehouseSelf,
} from '@/model/outboundManagement/index'
export default {
    data() {
        return {
            weighingRecordList: [],
            warehouseId: '',
            warehouseName: '',
            warehouseName1: '',

            compId: '',
            inOutFlag: '',
            //分页
            currentPage: 1,
            pageSize: 10,
            value2: '',
            deptCircularPage: {},
            deptBudgetTotal: 0,
            warehouseList: [], //仓库
            searchKeyWord: '',
            title: '',
            modification: [],
            isShowPrintTypeBills: false,
            inWeight: 0,//合计入库重量
            outWeight: 0,//合计出库重量
            inCount: 0,//合计入库数量
            outCount: 0,//合计出库数量
            startDate: '',
            endDate: '',
            pickerOptions: {
                shortcuts: [{
                    text: '本周',
                    onClick(picker) {
                        const end = new Date()
                        const start = new Date()
                        var thisDay = start.getDay()
                        var thisDate = start.getDate()
                        if (thisDay != 0) {
                            start.setDate(thisDate - thisDay)
                        }
                        picker.$emit('pick', [start, end])
                    },
                },
                {
                    text: '本月',
                    onClick(picker) {
                        const end = new Date()
                        const start = new Date()
                        start.setDate(1)
                        picker.$emit('pick', [start, end])
                    },
                },
                {
                    text: '本季度',
                    onClick(picker) {
                        var oDate = new Date()

                        var thisYear = oDate.getFullYear()
                        var thisMonth = oDate.getMonth() + 1

                        var n = Math.ceil(thisMonth / 3) // 季度

                        var Month = n * 3 - 1

                        var start = new Date(thisYear, Month - 2, 1)
                        var end = new Date()

                        picker.$emit('pick', [start, end])
                    },
                },
                ],
            },
            ddchecked: false,
            checked: false,
            // ewCustomerOptions: [{
            //     value: '天津建源供应链管理有限公司',
            //     label: '天津建源供应链管理有限公司'
            // }, {
            //     value: '黑龙江中天昊元贸易有限公司',
            //     label: '黑龙江中天昊元贸易有限公司'
            // }, {
            //     value: '黑龙江利润元粮食贸易有限公司',
            //     label: '黑龙江利润元粮食贸易有限公司'
            // }, {
            //     value: '黑龙江众利合粮食贸易有限公司',
            //     label: '黑龙江众利合粮食贸易有限公司'
            // }, {
            //     value: '黑龙江鑫满仓粮食贸易有限公司',
            //     label: '黑龙江鑫满仓粮食贸易有限公司'
            // }, {
            //     value: '厦门建发物产有限公司',
            //     label: '厦门建发物产有限公司'
            // }, {
            //     value: '黑龙江谷香粮食贸易有限公司',
            //     label: '黑龙江谷香粮食贸易有限公司'
            // }, {
            //     value: '黑龙江秋收有限公司',
            //     label: '黑龙江秋收有限公司'
            // }, {
            //     value: '黑龙江欣洋粮食贸易有限公司',
            //     label: '黑龙江欣洋粮食贸易有限公司'
            // }, {
            //     value: '黑龙江益储益运粮食贸易有限公司',
            //     label: '黑龙江益储益运粮食贸易有限公司'
            // }, {
            //     value: '黑龙江启兴粮食贸易有限公司',
            //     label: '黑龙江启兴粮食贸易有限公司'
            // }],
            // companyNameOptions: [{
            //     value: '黑龙江中天昊元贸易有限公司',
            //     label: '黑龙江中天昊元贸易有限公司'
            // }, {
            //     value: '黑龙江利润元粮食贸易有限公司',
            //     label: '黑龙江利润元粮食贸易有限公司'
            // }, {
            //     value: '黑龙江众利合粮食贸易有限公司',
            //     label: '黑龙江众利合粮食贸易有限公司'
            // }, {
            //     value: '黑龙江鑫满仓粮食贸易有限公司',
            //     label: '黑龙江鑫满仓粮食贸易有限公司'
            // }, {
            //     value: '黑龙江谷香粮食贸易有限公司',
            //     label: '黑龙江谷香粮食贸易有限公司'
            // }, {
            //     value: '黑龙江秋收有限公司',
            //     label: '黑龙江秋收有限公司'
            // }, {
            //     value: '黑龙江欣洋粮食贸易有限公司',
            //     label: '黑龙江欣洋粮食贸易有限公司'
            // }, {
            //     value: '黑龙江益储益运粮食贸易有限公司',
            //     label: '黑龙江益储益运粮食贸易有限公司'
            // }, {
            //     value: '黑龙江启兴粮食贸易有限公司',
            //     label: '黑龙江启兴粮食贸易有限公司'
            // }],
            // companyNameEWOptions: [{
            //     value: '天津建源供应链管理有限公司',
            //     label: '天津建源供应链管理有限公司'
            // }, {
            //     value: '厦门建发物产有限公司',
            //     label: '厦门建发物产有限公司'
            // }],
            // companyName: '黑龙江中天昊元贸易有限公司',
            // companyNameEW: '厦门建发物产有限公司',
            // ewCustomer: '黑龙江利润元粮食贸易有限公司',
            printSeparately: false,
            onePrint: false,
            dialogDataList: [],
            printData: {
            }
        }
    },
    activated() {
        //仓库
        selectWarehouseSelf({
            compId: localStorage.getItem('ws-pf_compId'),
        })
            .toPromise()
            .then((response) => {
                this.warehouseList = response
            })
        this.compId = localStorage.getItem('ws-pf_compId')
        this.warehouseName = this.$route.query.warehouseName //仓库名
        this.warehouseId = this.$route.query.warehouseId //仓库Id
        // if (localStorage.getItem('compNameoptions')) {
        //     var company = JSON.parse(localStorage.getItem('compNameoptions'))

        //     var extra = company.filter((item) => {
        //         return item != '黑龙江中天昊元贸易有限公司'
        //             && item != '黑龙江利润元粮食贸易有限公司'
        //             && item != '黑龙江众利合粮食贸易有限公司'
        //             && item != '黑龙江鑫满仓粮食贸易有限公司'
        //             && item != '黑龙江谷香粮食贸易有限公司'
        //             && item != '黑龙江秋收有限公司'
        //             && item != '黑龙江欣洋粮食贸易有限公司'
        //             && item != '黑龙江益储益运粮食贸易有限公司'
        //             && item != '黑龙江启兴粮食贸易有限公司'
        //     })
        //     if (extra.length > 0) {
        //         this.companyNameOptions = [
        //             {
        //                 value: '黑龙江中天昊元贸易有限公司',
        //                 label: '黑龙江中天昊元贸易有限公司'
        //             }, {
        //                 value: '黑龙江利润元粮食贸易有限公司',
        //                 label: '黑龙江利润元粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江众利合粮食贸易有限公司',
        //                 label: '黑龙江众利合粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江鑫满仓粮食贸易有限公司',
        //                 label: '黑龙江鑫满仓粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江欣洋粮食贸易有限公司',
        //                 label: '黑龙江欣洋粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江谷香粮食贸易有限公司',
        //                 label: '黑龙江谷香粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江秋收有限公司',
        //                 label: '黑龙江秋收有限公司'
        //             }, {
        //                 value: '黑龙江益储益运粮食贸易有限公司',
        //                 label: '黑龙江益储益运粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江启兴粮食贸易有限公司',
        //                 label: '黑龙江启兴粮食贸易有限公司'
        //             }]

        //         this.ewCustomerOptions = [
        //             {
        //                 value: '天津建源供应链管理有限公司',
        //                 label: '天津建源供应链管理有限公司'
        //             }, {
        //                 value: '黑龙江中天昊元贸易有限公司',
        //                 label: '黑龙江中天昊元贸易有限公司'
        //             }, {
        //                 value: '黑龙江利润元粮食贸易有限公司',
        //                 label: '黑龙江利润元粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江众利合粮食贸易有限公司',
        //                 label: '黑龙江众利合粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江鑫满仓粮食贸易有限公司',
        //                 label: '黑龙江鑫满仓粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江欣洋粮食贸易有限公司',
        //                 label: '黑龙江欣洋粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江谷香粮食贸易有限公司',
        //                 label: '黑龙江谷香粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江秋收有限公司',
        //                 label: '黑龙江秋收有限公司'
        //             }, {
        //                 value: '黑龙江益储益运粮食贸易有限公司',
        //                 label: '黑龙江益储益运粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江启兴粮食贸易有限公司',
        //                 label: '黑龙江启兴粮食贸易有限公司'
        //             }]
        //         this.companyNameEWOptions = [
        //             {
        //                 value: '天津建源供应链管理有限公司',
        //                 label: '天津建源供应链管理有限公司'
        //             }, {
        //                 value: '黑龙江中天昊元贸易有限公司',
        //                 label: '黑龙江中天昊元贸易有限公司'
        //             }, {
        //                 value: '黑龙江利润元粮食贸易有限公司',
        //                 label: '黑龙江利润元粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江众利合粮食贸易有限公司',
        //                 label: '黑龙江众利合粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江鑫满仓粮食贸易有限公司',
        //                 label: '黑龙江鑫满仓粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江欣洋粮食贸易有限公司',
        //                 label: '黑龙江欣洋粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江谷香粮食贸易有限公司',
        //                 label: '黑龙江谷香粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江秋收有限公司',
        //                 label: '黑龙江秋收有限公司'
        //             }, {
        //                 value: '黑龙江益储益运粮食贸易有限公司',
        //                 label: '黑龙江益储益运粮食贸易有限公司'
        //             }, {
        //                 value: '黑龙江启兴粮食贸易有限公司',
        //                 label: '黑龙江启兴粮食贸易有限公司'
        //             }]
        //         if (localStorage.getItem('print_company_name')) {
        //             this.companyName = localStorage.getItem('print_company_name')
        //         } else {
        //             this.companyName = extra[0]
        //         }
        //         if (localStorage.getItem('print_company_name_ew')) {
        //             this.companyNameEW = localStorage.getItem('print_company_name_ew')
        //         } else {
        //             this.companyNameEW = extra[0]
        //         }
        //         if (localStorage.getItem('print_customer_name_ew')) {
        //             this.ewCustomer = localStorage.getItem('print_customer_name_ew')
        //         } else {
        //             this.ewCustomer = extra[0]
        //         }
        //         for (let i = 0; i < extra.length; i++) {
        //             this.ewCustomerOptions.push({ value: extra[i], label: extra[i] })
        //             this.companyNameOptions.push({ value: extra[i], label: extra[i] })
        //             this.companyNameEWOptions.push({ value: extra[i], label: extra[i] })
        //         }
        //     }
        // }
        this.getList()
    },
    methods: {
        inOutChange(num) {
            this.inOutFlag = num
            this.getList()
        },
        // changeEw(e) {
        //     this.ddchecked = false
        //     if (e) {
        //         this.printSeparately = true
        //     } else {
        //         this.printSeparately = false
        //     }
        // },
        // changeEwDD(e) {
        //     this.checked = false
        //     if (e) {
        //         this.printSeparately = true
        //     } else {
        //         this.printSeparately = false
        //     }
        // },
        // printBig1(type, radioType) {
        //     this.printData.extra1 = true
        //     localStorage.setItem('print_company_name', this.companyName)
        //     localStorage.setItem('print_company_name_ew', this.companyNameEW)
        //     localStorage.setItem('print_customer_name_ew', this.ewCustomer)
        //     // 打印额外
        //     if (this.checked || this.ddchecked) {
        //         this.printData.extra2 = true
        //         if (this.ddchecked) {
        //             localStorage.setItem('print_alone_extra', true)
        //         } else {
        //             localStorage.setItem('print_alone_extra', false)
        //         }
        //         //  this.selectEW = true;
        //     } else {
        //         this.printData.extra2 = false
        //     }
        //     localStorage.setItem('printdrydata', JSON.stringify(this.printData))
        //     window.open(
        //         '../../../../../static/printdry.html?type=2&printTypeList=结算凭证'
        //     )
        //     // if (type == 1) {
        //     //   localStorage.setItem('selectPrint_jjSelectPrintList', JSON.stringify(this.jjSelectPrintList))
        //     //   window.open('../../../../static/weightCheck.html?type=2&radioType=' + radioType + '&selectEW=' + this
        //     //     .checked + '&selectEWDD=' + this.ddchecked)
        //     // } else if (type == 2) {
        //     //   localStorage.setItem('selectPrint_jjSelectPrintList', JSON.stringify(this.excelPrintData))
        //     //   window.open('../../../../static/weightCheck.html?type=2&radioType=' + radioType)
        //     // } else {
        //     //   console.log(this.dialogDataList)

        //     //   localStorage.setItem('print_in_data',JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
        //     //   // window.open('../../../../static/weightCheck.html?type=2&tableData=' + JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
        //     //   window.open('../../../../static/weightCheck.html?type=2&tableData=' )
        //     // }
        // },
        //   typePrintCannelClick1() {
        //     this.dialogDataList = [] //打个打印取消时数组至空
        //     this.isShowPrintTypeBills= false
        //   },
        //     printInfo(row){
        //         this.printData=row
        //         this.warehouseName1=row.warehouseName

        //         this.isShowPrintTypeBills=true
        //         // window.open('../../../static/printdry.html')
        //     },
        // deleteInfo(row) {
        //     //删除
        //     this.$confirm('确定删除检斤信息？', '提示', {
        //         confirmButtonText: '确定',
        //         cancelButtonText: '取消',
        //         type: 'warning',
        //     })
        //         .then(() => {
        //             delMaterial({
        //                 id: row.id,
        //             })
        //                 .toPromise()
        //                 .then((response) => {
        //                     this.$notify.success({
        //                         title: '成功',
        //                         message: '删除成功',
        //                     })
        //                     this.getList()
        //                 })
        //                 .catch((response) => {
        //                     // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
        //                 })
        //         })
        //         .catch(() => {
        //             return false
        //         })
        // },
        handleSelectionChange(val) {
            this.modification = val;
            //合计入库重量
            this.inWeight = 0
            //合计出库重量
            this.outWeight = 0
            //合计入库数量
            this.inCount = 0
            //合计出库数量
            this.outCount = 0
            for (let i = 0; i < this.modification.length; i++) {
                //合计入库重量
                if (this.modification[i].netWeight && this.modification[i].inOutFlag == 2) {
                    this.inWeight += this.modification[i].netWeight
                }
                //合计出库重量
                if (this.modification[i].netWeight && this.modification[i].inOutFlag == 1) {
                    this.outWeight += this.modification[i].netWeight
                }
                //合计入库数量
                if (this.modification[i].materialQuantity && this.modification[i].deliveryMethod == 3 && this.modification[i].inOutFlag == 2) {
                    this.inCount += this.modification[i].materialQuantity
                }
                //合计出库数量
                if (this.modification[i].materialQuantity && this.modification[i].deliveryMethod == 3 && this.modification[i].inOutFlag == 1) {
                    this.outCount += this.modification[i].materialQuantity
                }
            }
            this.inWeight = (this.inWeight / 1000).toFixed(2)
            this.outWeight = (this.outWeight / 1000).toFixed(2)
        },
        dateFormat(fmt, date) {
            let ret
            const opt = {
                'Y+': date.getFullYear().toString(), // 年
                'm+': (date.getMonth() + 1).toString(), // 月
                'd+': date.getDate().toString(), // 日
                'H+': date.getHours().toString(), // 时
                // "M+": date.getMinutes().toString(),         // 分
                // "S+": date.getSeconds().toString()          // 秒
                // 有其他格式化字符需求可以继续添加，必须转化成字符串
            }
            for (let k in opt) {
                ret = new RegExp('(' + k + ')').exec(fmt)
                if (ret) {
                    fmt = fmt.replace(
                        ret[1],
                        ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
                    )
                }
            }
            return fmt
        },
        lookup() {
            if (this.value2) {
                this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
                this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
            } else {
                this.startDate = ''
                this.endDate = ''
            }
            this.currentPage = 1
            this.getList()
        },
        returnsales() {
            this.searchKeyWord = ''
            this.$router.go(-1)
        },
        warehouseNameChange(e) {
            for (let i = 0; i < this.warehouseList.length; i++) {
                if (e == this.warehouseList[i].warehouseName) {
                    this.warehouseId = this.warehouseList[i].id
                }
            }
            this.getList()
        },
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`)
            this.pageSize = val
            this.getList()
        },
        handleCurrentChange(val) {
            this.currentPage = val
            console.log(`当前页: ${val}`)
            this.getList()
        },
        getList() {
            // 列表
            getMaterialRecord({
                baseId: this.warehouseId,
                currentPage: this.currentPage,
                pageSize: this.pageSize,
                searchKeyWord: this.searchKeyWord,
                inOutFlag: this.inOutFlag,
                startDate: this.startDate,
                endDate: this.endDate,
            })
                .toPromise()
                .then((response) => {
                    this.weighingRecordList = response.records
                    this.deptBudgetTotal = response.total
                })
                .catch((response) => {
                    // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
                })
        },

    },
}
</script>
<style lang="scss" scoped>
.toptitle {
    background: #f6f7fc;
}

.bg-left {
    padding-left: 30px;
}

.bg-right {
    text-align: right;
    padding: 16px 20px;
}

.top-title {
    width: 50%;
    display: flex;
}

.title {
    position: relative;
}

.title::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 30px;
    background: #5473e8;
    position: absolute;
    left: 0;
}

.container {
    overflow: scroll;
    height: 93vh;
}

.center {
    margin: auto;
}

.centertitle {
    display: flex;
    margin: 10px 0;
}

.temporary {
    line-height: 80px;
    font-size: 20px;
    color: #abaaaa;
}

/deep/.forData .cell {
    text-align: center;
}

//弹出框
.eject-warehouse {
    font-size: 20px;
    margin-left: 15px;
    font-weight: 600;
}

.table_css {
    margin: 20px auto;

    tr {
        height: 50px;
    }

    .table_item {
        min-width: 70px;
    }

    td {
        text-align: center;
        font-size: 18px;
        font-weight: 600;
    }

    .el-select {
        width: 90%;
    }
}

.btn_topcss {
    margin-top: 15px;

}

.btn_css {
    width: 90px;
    margin-left: 10px;
}

.search_css {
    margin: 0 20px;
}

.mask {
    background: black;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    z-index: 99;
    opacity: 0.3;
}

.print-type-title {
    text-align: center;
    font-size: 18px;
    margin: 20px;
}

.bottom-btn {
    display: flex;
    margin-top: 20px;
    justify-content: space-around;
}

.print-type-checkbox {
    // padding-left: 20px;
}

.print-type {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 440px;
    height: 320px;
    background: white;
    border-radius: 10px;
    z-index: 999;
}

/deep/.el-radio-group {
    width: 100%;
    display: flex;
}

/deep/.el-radio__label {
    font-size: 20px;
}

/deep/.el-radio__inner {
    // background: red;
    height: 20px;
    width: 20px;
}

.label-width {
    width: 100%;
    text-align: center;
    font-size: 20px;
}

.show-excel {
    opacity: 0;
}

/deep/.base_header_layout .find.el-button--primary {
    width: 30px;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
}

/deep/.base_header_layout .findinput input {
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
}

.ew-print {
    padding: 0 20px;
    margin-top: 10px;

    // display: flex;
    // justify-content: space-between;
    // align-content: center;
    .row {
        display: flex;
        margin-top: 10px;
        align-items: center;
    }
}

.sh-address {
    display: flex;
}

.print-type-ew {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;

    /deep/.el-radio__label {
        font-size: 14px;
    }

    margin-top: 10px;
}

/deep/.el-table .cell {
    text-align: center;
}

.shdw-style {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-top: 20px;
}

.mask1 {
    background: black;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    z-index: 1001;
    opacity: 0.3;
}

.print-type-title1 {
    text-align: center;
    font-size: 18px;
    margin: 20px;
}


.print-type-checkbox1 {
    // padding-left: 20px;
}

.print-type1 {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 440px;
    height: 320px;
    background: white;
    border-radius: 10px;
    z-index: 1001;
}

.shdw-style1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-top: 20px;
}

.print-type-ew {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;

    /deep/.el-radio__label {
        font-size: 14px;
    }

    margin-top: 10px;
}

.ew-print {
    padding: 0 20px;
    margin-top: 10px;

    // display: flex;
    // justify-content: space-between;
    // align-content: center;
    .row {
        display: flex;
        margin-top: 10px;
        align-items: center;
    }
}
</style>
