balance.vue 3.01 KB
<template>
    <LayoutBody>
        <LayoutFilter>
            <FilterItem label="对帐单号">
                <!--<Input v-model.trim.trim=""-->
                       <!--:placeholder=""-->
                <!--&gt;</Input>-->
            </FilterItem>
            <FilterItem label="供应商">
                <!--<SelectBrand>-->
                <!--</SelectBrand>-->
            </FilterItem>
            <FilterItem label="品牌">
            </FilterItem>

            <FilterItem label="日期">
                <Date-picker type="date" placeholder="选择日期" style="width: 180px"></Date-picker>
            </FilterItem>

            <FilterItem label="">
                <Date-picker type="daterange" placement="bottom-end" placeholder="选择日期" style="width: 180px"></Date-picker>
            </FilterItem>

            <FilterItem>
                <Button type="primary" @click="filterSearch">筛选</Button>
                <Button @click="">导出</Button>
            </FilterItem>
        </LayoutFilter>

        <LayoutList>
            <Table border :context="self" :columns="tableCols" :data="tableData"></Table>
            <!--<Page :total="" :current=""-->
                  <!--@on-change="" :page-size="20" show-total></Page>-->
        </LayoutList>

    </LayoutBody>

</template>

<script>
    import Vue from 'vue';
    import service from 'finance-service';
    import {SelectBrand, SelectCategory} from 'finance/filter-select';
    import {filterFields, initialFields, tableCols, tableData} from './detail';

    export default {
        data() {
            return {
                self: this,
                tableCols,
                tableData,
                filters: '',
            };
        },
        created() {
            this.filters = JSON.parse(initialFields);
        },
        methods: {
            filterParams() {
//                const fts = this.filters;
                const data = {

                };

                return data;
            },
            filterSearch() {
                const params = this.filterParams();

                this.useFilterSign = true;
                this.productList(params);
                this.pageData.current = 1;

            },
            productList(params) {

                if (_.isObject(params) &&
                    params.productSkn !== undefined &&
                    !_.isFinite(+params.productSkn)) {
                    this.$Message.error('SKN编码只能是数字', 3);
                    return;
                };

                service.productList(
                    _.merge(params || {}, {
                        shelfStatus: 1,
                        size: 20
                    }))
                    .then(res => {
                        if (res.code === 200) {
                            this.updateStore(res.data);
                        }
                    });
            }
        },
        components: {
            SelectBrand,
            SelectCategory,
        }
    };
</script>

<style lang="scss" scoped>


</style>