cell-dispatch.vue 1.28 KB
<template>
    <div class="cell-info">
        <span class="item">销售数:{{buyNum}}</span>
        <span class="item">实际应发数:{{actualNeed}}</span>
        <span class="item darker">当前需发数:{{currentNeed}}</span>
        <span v-if="showStore" class="item">收货数:{{storeNum}}</span>
    </div>
</template>

<script>
    export default {
        name: 'cell-dispatch',
        props: {
            showStore: {
                default: false
            },
            storeNum: {
                type: [String, Number]
            },
            buyNum: {
                type: [String, Number]
            },
            lackNum: {
                type: [String, Number]
            },
            shipNum: {
                type: [String, Number]
            }
        },
        data() {
            return {
            };
        },
        computed: {
            actualNeed() {
                return this.buyNum - this.lackNum;
            },
            currentNeed() {
                return this.actualNeed - this.shipNum;
            }
        }
    };
</script>

<style lang="scss" scoped>
.cell-info {
    text-align: right;

    .item {
        display: block;

        &.darker {
            font-weight: bold;
            color: #000;
        }
    }
}
</style>