index.vue 6.53 KB
Newer Older
godwithdh's avatar
godwithdh committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<style lang="less">
    #receive{
        table{
            width:100%;
            >thead{
                width:calc(100% - 1em);
                >tr{
                    height:35px;
                }
            }
            >tbody{
                display: block;
                height: 200px;
                overflow-y: scroll;
godwithdh's avatar
godwithdh committed
15
                -webkit-overflow-scrolling: touch;
godwithdh's avatar
godwithdh committed
16
                height: calc(100vh - 160px);
godwithdh's avatar
godwithdh committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30
                >div{
                    background: #fff;
                    border-radius: 5px;
                    margin: 5px;
                    box-shadow: 0 1px 3px #bababa;
                    overflow: hidden;
                    >tr{
                        &.user{
                            background:#fff;
                            >td{
                                color:#5E9AFE;
                                text-align: left;
                                padding: 6px 15px;
                            }
godwithdh's avatar
godwithdh committed
31
                        }
godwithdh's avatar
godwithdh committed
32 33 34
                        &.num{
                            background:#fff;
                            >td{
godwithdh's avatar
godwithdh committed
35
                                &:not(:first-child){border-top:1px solid #eef4fe;}
godwithdh's avatar
godwithdh committed
36
                                padding:4px 0;
godwithdh's avatar
godwithdh committed
37 38 39
                                &:first-child{
                                    color:#229BD0;
                                }
godwithdh's avatar
godwithdh committed
40
                            }
godwithdh's avatar
godwithdh committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
                        }
                    }
                }
            }
            >tbody tr,>thead{
                display: table;
                width: 100%;
                // table-layout: fixed; /**表格列的宽度由表格宽度决定,不由内容决定*/
                text-align: center;
            }
            >thead th,>tbody td{
                width:50px;
            }
        }
    }
</style>
<template>
    <div id="receive">
        <div class="search">
            <searchComponent :search="search" :status="status"/>
        </div>
        <tab
            v-model="tabValue"
            prevent-default
            @on-before-index-change="switchTabItem"
            active-color="#5E9AFE"
            bar-active-color="#5E9AFE">
            <tab-item v-for="(v,k) in tabList" :key="k">{{v.sStoreName}}</tab-item>
        </tab>
        <table align="center" v-if="list.length>0">
            <thead>
                <tr>
                    <th>地点</th>
                    <th>匹数</th>
                    <th>米数</th>
                    <th>码数</th>
                    <th>重量</th>
                </tr>
            </thead>
            <tbody>
                <template v-for="(v,k) in list">
godwithdh's avatar
godwithdh committed
82 83 84 85 86
                    <div :key="k">
                        <tr class="user">
                            <td @click="toDetail(v.sProviderName)" style="text-decoration: underline;">{{v.sProviderName}}</td>
                        </tr>
                        <tr class="num">
godwithdh's avatar
godwithdh committed
87
                            <td>期初库存</td>
godwithdh's avatar
godwithdh committed
88 89
                            <td>{{v.nOldPieceQty||0}}</td>
                            <td style="color:#64B18B;">{{v.nOldLengthM||0}}</td>
godwithdh's avatar
godwithdh committed
90
                            <td>{{v.nOldLengthYD||0}}</td>
godwithdh's avatar
godwithdh committed
91 92 93
                            <td>{{v.nOldWeight||0}}</td>
                        </tr>
                        <tr class="num">
godwithdh's avatar
godwithdh committed
94
                            <td>本期入库</td>
godwithdh's avatar
godwithdh committed
95 96
                            <td>{{v.nInPieceQty||0}}</td>
                            <td style="color:#64B18B;">{{v.nInLengthM||0}}</td>
godwithdh's avatar
godwithdh committed
97
                            <td>{{v.nInLengthYD||0}}</td>
godwithdh's avatar
godwithdh committed
98 99 100
                            <td>{{v.nInWeight||0}}</td>
                        </tr>
                        <tr class="num">
godwithdh's avatar
godwithdh committed
101
                            <td>本期出库</td>
godwithdh's avatar
godwithdh committed
102 103
                            <td>{{v.nOutPieceQty||0}}</td>
                            <td style="color:#64B18B;">{{v.nOutLengthM||0}}</td>
godwithdh's avatar
godwithdh committed
104
                            <td>{{v.nOutLengthYD||0}}</td>
godwithdh's avatar
godwithdh committed
105 106 107
                            <td>{{v.nOutWeight||0}}</td>
                        </tr>
                        <tr class="num">
godwithdh's avatar
godwithdh committed
108
                            <td>本期库存</td>
godwithdh's avatar
godwithdh committed
109 110
                            <td>{{v.nStockPieceQty||0}}</td>
                            <td style="color:#64B18B;">{{v.nStockLengthM||0}}</td>
godwithdh's avatar
godwithdh committed
111
                            <td>{{v.nStockLengthYD||0}}</td>
godwithdh's avatar
godwithdh committed
112 113 114
                            <td>{{v.nStockWeight||0}}</td>
                        </tr>
                    </div>
godwithdh's avatar
godwithdh committed
115 116 117
                </template>
            </tbody>
        </table>
godwithdh's avatar
godwithdh committed
118
        <img v-else src="@/assets/noData.jpg" class="_img" style="width:100%" alt="" />
godwithdh's avatar
godwithdh committed
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
    </div>
</template>
<script>
import Util from "@/libs/util.js"
import searchComponent from '@/components/search'
import { Tab, TabItem } from 'vux'

export default {
    name:"receive",
    components:{searchComponent,Tab,TabItem},
    data(){
        return{
            tabList:[],
            list:[],
            search:{
                dBeginDate:Util.dateFormat(new Date(),'yyyy-MM-01'),
                dEndDate:Util.dateFormat(new Date(),'yyyy-MM-dd'),
                page:1,
                per_page:30,
                sStatus:'全部'
            },
            status:[],
            tabValue:0,
        }
    },
    created(){
godwithdh's avatar
godwithdh committed
145
        this.$store.dispatch('saveUserId',this.$route.params.userId);
godwithdh's avatar
godwithdh committed
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
        this.init();

        this.global.$off('searchData');
        this.global.$on('searchData',async ()=>{
            this.searchData();
        });
    },

    methods:{
        switchTabItem(index){
            this.tabValue=index
            this.searchData()
        },
        toDetail(name){
            this.$router.push({
                path:"/tiip/receive_varieties",
                query:{
                    sStockPlace:name,
                    sStoreNo:this.tabList[this.tabValue].sStoreNo
                }
            })
        },
        async init(){
            var value=await this.request("getTiipReceiveStorage",{
                data:[
                    {key:"url",value:"mmStore"},
                    {key:"sUserNo",value:this.$route.params.sUserNo}
                ]
            },"加载中",{})
            this.tabList=value

            this.searchData()
        },
        async searchData(){
            var value=await this.request("getTiipReceiveStorage",{
                data:[
                    {key:"url",value:"All"},
                    {key:"dStartDate",value:this.search.dBeginDate},
                    {key:"dEndDate",value:this.search.dEndDate},
                    {key:"sStoreNo",value:this.tabList[this.tabValue].sStoreNo},
                ]
            },"加载中",{})
            this.list=value
        },
    },
}
</script>