clearing-print-stock.vue 4.93 KB
<template>
    <layout-print>
        <h2>库存对账单</h2>
        <p>供应商:{{supplierName}}</p>
        <p>对账日期:{{date}}</p>
        <div class="detail-list">
            <table width="100%">
                <thead>
                    <tr>
                        <th v-for="item in tableCols">{{item.title}}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="item in tableData">
                        <td>{{item.productSku}}</td>
                        <td>{{item.productName}}</td>
                        <td>{{item.factoryCode}}</td>
                        <td>{{item.sellTypeName}}</td>
                        <td>{{item.supplier90Sell}}</td>
                        <td>{{item.supplier11Sell}}</td>
                        <td>{{item.supplier30Sell}}</td>
                        <td>{{item.supplier33Sell}}</td>
                        <td>{{item.supplier10Sell}}</td>
                        <td>{{item.supplier60Sell}}</td>
                        <td>{{item.supplier70Sell}}</td>
                        <td>{{item.supplier71Sell}}</td>
                        <td>{{item.supplier100Sell}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="seal">盖章确认</div>  	
        <p>请您在SPM系统将结算对账单和库存对账单各打印一份,并盖章确认后与发票一并寄至:</p>
        <p>江苏省南京市建邺区嘉陵江东街18号南京国家广告产业园05栋17楼 --品牌经理(210000)</p>
        <p>电话:025-87781000</p>
        <p>传真:025-87781000</p>
        <p><br><br>以下为贵公司汇款信息及地址,请核对。如有变更请将新的信息盖章同账单一并寄至我公司。并请及时与我公司商品部联系,在业务系统中进行更新。<br><br></p>
        <p>公司名称: </p>
        <p>开户行名称:</p>
        <p>帐    号:</p>  
        <p>地    址: </p>
        <p>财务联系人:</p>
        <p>联系电话:</p>
        <p><br>备注:盖章确认后发现对账单存在任何问题的,我公司不承担任何责任。</p>
    </layout-print>
</template>

<script>
    import _ from 'lodash';
    import stock from '../clearing/store/stock';
    import FinanceService from 'services/finance/finance-service';
    import moment from 'moment';

    export default {
        data() {
            return stock.call(this);
        },
        created() {
            this.FinanceService = new FinanceService();
            this.search();
        },
        computed: {
            date() {
                return moment(this.$route.query.begin * 1000).format('YYYY-MM-DD 00:00:00') + '至' + moment(this.$route.query.begin * 1000).endOf('month').format('YYYY-MM-DD 00:00:00');
            },
            supplierName() {
                return this.$route.query.supplierName;
            }
        },
        methods: {
            search() {
                let params = {
                    brandId: +this.$route.query.brandId,
                    beginTime: +this.$route.query.begin,
                    endTime: +this.$route.query.end,
                    pageSize: 20,
                    pageNo: this.$route.query.page
                };

                params = _.pickBy(params, val => val);

                this.FinanceService.inventoryLedgerList(params).then(ret => {
                    let list = _.get(ret, 'data.records', []);

                    this.tableData = list;

                    this.tableData.push({
                        sellTypeName: '合计',
                        supplier90Sell: _.sum(_.map(list, 'supplier90Sell')),
                        supplier11Sell: _.sum(_.map(list, 'supplier11Sell')),
                        supplier30Sell: _.sum(_.map(list, 'supplier30Sell')),
                        supplier33Sell: _.sum(_.map(list, 'supplier33Sell')),
                        supplier10Sell: _.sum(_.map(list, 'supplier10Sell')),
                        supplier60Sell: _.sum(_.map(list, 'supplier60Sell')),
                        supplier70Sell: _.sum(_.map(list, 'supplier70Sell')),
                        supplier71Sell: _.sum(_.map(list, 'supplier71Sell')),
                        supplier100Sell: _.sum(_.map(list, 'supplier100Sell'))
                    });
                });
            }
        }
    };
</script>

<style lang="scss" scoped>
h2 {
    line-height: 50px;
    border-bottom: 1px solid #f2f2f2;
    margin-bottom: 10px;
}

.print-detail {
    margin-bottom: 20px;
    color: #333;
}

p {
    line-height: 20px;
}

.seal {
    text-align: right;
    padding-right: 250px;
    line-height: 50px;
    font-weight: bold;
}

.detail-list {
    table,
    th,
    td {
        border: 1px solid black;
        color: #333;
        font-size: 12px;
        text-align: center;
        padding: 8px 0;
    }

    table {
        border-spacing: 0;
        border-collapse: collapse;
        margin-top: 10px;
    }
}
</style>