<template> 
 | 
    <view class="content"> 
 | 
        <view class="content_search"> 
 | 
            <Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true" placeholder="搜索入库单号/入库仓库"> 
 | 
                <template v-slot:content> 
 | 
                    <view class="Search_item"> 
 | 
                        <view class="Search_item_label">计划日期</view> 
 | 
                        <view class="Search_item_content" @click="openDate"> 
 | 
                            <view class="Search_item_content_a" :style="listData.planDateStart ? 'color: #000' : ''"> 
 | 
                                {{ listData.planDateStart ? listData.planDateStart : '开始日期'}} 
 | 
                            </view> 
 | 
                            <text>-</text> 
 | 
                            <view class="Search_item_content_a" :style="listData.planDateEnd ? 'color: #000' : ''"> 
 | 
                                {{ listData.planDateEnd ? listData.planDateEnd : '结束日期'}} 
 | 
                            </view> 
 | 
                        </view> 
 | 
                    </view> 
 | 
                    <view class="Search_item"> 
 | 
                        <view class="Search_item_label">单据类型</view> 
 | 
                        <view class="Search_item_content"> 
 | 
                            <view class="tag"> 
 | 
                                <view class="tag_item" :class="{'tag_active': item.isActive}" v-for="(item, i) in types" 
 | 
                                    :key="item.id" @click="changeTags(i)">{{item.name}}</view> 
 | 
                            </view> 
 | 
                        </view> 
 | 
                    </view> 
 | 
                </template> 
 | 
            </Search> 
 | 
            <view class="content_search_x"></view> 
 | 
            <LabelSelection :TagList="tagList" :isShow="true" @change="clickTag" /> 
 | 
        </view> 
 | 
        <view class="content_total" :style="{top: top}">共{{listData.total}}条数据</view> 
 | 
        <view class="content_list"> 
 | 
            <scroll-view 
 | 
            :refresher-enabled="true" 
 | 
            :refresher-triggered="isLoading" 
 | 
            @refresherrefresh="onRefresh" 
 | 
            refresher-background="#fff" 
 | 
            @scrolltolower="getLists" 
 | 
            scroll-y 
 | 
            :style="{height: height}"> 
 | 
                <view class="content_list_item" v-for="(item, i) in lists" :key="i" @click="jump(item)"> 
 | 
                    <!-- item头部视图 --> 
 | 
                    <view class="content_list_item_top"> 
 | 
                        <view class="content_list_item_top_left"> 
 | 
                            <!--                <text>转库单号:</text>--> 
 | 
                            <text>{{ item.code }}</text> 
 | 
                        </view> 
 | 
                        <view class="content_list_item_top_right"> 
 | 
                            <span class="warning" v-if="item.status == 0">待入库</span> 
 | 
                            <span class="green" v-else-if="item.status == 1">已入库</span> 
 | 
                            <span class="info" v-else-if="item.status == 2">已取消</span> 
 | 
                        </view> 
 | 
                    </view> 
 | 
                    <!-- item主题信息部分 --> 
 | 
                    <view class="content_list_item_content"> 
 | 
                        <view class="content_list_item_content_item"> 
 | 
                            <view class="content_list_item_content_item_label">单据类型:</view> 
 | 
                            <view class="content_list_item_content_item_nr"> 
 | 
                                {{ seeText(item.billType) }} 
 | 
                            </view> 
 | 
                        </view> 
 | 
                        <view class="content_list_item_content_item"> 
 | 
                            <view class="content_list_item_content_item_label">入库仓库:</view> 
 | 
                            <view class="content_list_item_content_item_nr"> 
 | 
                                {{ item.warehouseName + ' | ' + item.warehouseCode }} 
 | 
                            </view> 
 | 
                        </view> 
 | 
                        <view class="content_list_item_content_item"> 
 | 
                            <view class="content_list_item_content_item_label">计划入库:</view> 
 | 
                            <view class="content_list_item_content_item_nr"> 
 | 
                                {{ item.planDate }} 
 | 
                            </view> 
 | 
                        </view> 
 | 
                        <view class="content_list_item_content_item"> 
 | 
                            <view class="content_list_item_content_item_label">来源类型:</view> 
 | 
                            <view class="content_list_item_content_item_nr"> 
 | 
                                {{ tyepToStr(item.originType) }} 
 | 
                            </view> 
 | 
                        </view> 
 | 
                        <view class="content_list_item_content_item"> 
 | 
                            <view class="content_list_item_content_item_label">来源单号:</view> 
 | 
                            <view class="content_list_item_content_item_nr"> 
 | 
                                {{ item.originCode ? item.originCode : '-' }} 
 | 
                            </view> 
 | 
                        </view> 
 | 
                    </view> 
 | 
                </view> 
 | 
            </scroll-view> 
 | 
        </view> 
 | 
        <!-- 选择日期 --> 
 | 
        <!-- <u-calendar :show="timeShow" mode="range" :minDate="minDate" :maxDate="maxDate" @close="timeShow = false" 
 | 
            @confirm="timeConfirm"></u-calendar> --> 
 | 
        <l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5" 
 | 
            rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar> 
 | 
    </view> 
 | 
</template> 
 | 
  
 | 
<script> 
 | 
    import Search from '@/components/Search.vue' 
 | 
    import LabelSelection from '@/components/LabelSelection.vue' 
 | 
    import { getBoundList, pageCount } from "@/util/api/materialStorage"; 
 | 
    import { orderTyepToStr } from '@/util/constData.js' 
 | 
    export default { 
 | 
        components: { 
 | 
            Search, 
 | 
            LabelSelection 
 | 
        }, 
 | 
        data() { 
 | 
            return { 
 | 
                height: '', 
 | 
                top: '', 
 | 
                minDate: new Date('2021-01-31'), 
 | 
                maxDate: new Date(), 
 | 
                isLoading: false, 
 | 
                listData: { 
 | 
                    capacity: 10, 
 | 
                    page: 0, 
 | 
                    total: 0, 
 | 
                    planDateEnd: "", 
 | 
                    planDateStart: "", 
 | 
                    code: "", 
 | 
                    originType: "", 
 | 
                    status: "", 
 | 
                }, 
 | 
                types: [{ 
 | 
                        name: '车间领料', 
 | 
                        id: '1', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '机台备料', 
 | 
                        id: '2', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '车间转库', 
 | 
                        id: '3', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '完工入库', 
 | 
                        id: '4', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '计划领料', 
 | 
                        id: '5', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '外协领料', 
 | 
                        id: '6', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '外协完工转库', 
 | 
                        id: '7', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '产品入库', 
 | 
                        id: '8', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '产品转库', 
 | 
                        id: '9', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '让步放行入库', 
 | 
                        id: '10', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '让步放行转库', 
 | 
                        id: '11', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '客返返修领料', 
 | 
                        id: '12', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '客返返修入库', 
 | 
                        id: '13', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '跨组织转库', 
 | 
                        id: '14', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '工序报废', 
 | 
                        id: '15', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '客退返修领料', 
 | 
                        id: '16', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '客退返修入库', 
 | 
                        id: '17', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '工单产出', 
 | 
                        id: '24', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '采购入库', 
 | 
                        id: '25', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '客退检验入库', 
 | 
                        id: '26', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '客返检验入库', 
 | 
                        id: '27', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '库存调整', 
 | 
                        id: '28', 
 | 
                        isActive: false 
 | 
                    }, 
 | 
                    { 
 | 
                        name: '废品入库', 
 | 
                        id: '30', 
 | 
                        isActive: false 
 | 
                    } 
 | 
                ], 
 | 
                tagList: [{ 
 | 
                        id: "", 
 | 
                        name: "全部", 
 | 
                        num: "0", 
 | 
                    }, 
 | 
                    { 
 | 
                        id: "0", 
 | 
                        name: "待入库", 
 | 
                        num: "0", 
 | 
                    }, 
 | 
                    { 
 | 
                        id: "1", 
 | 
                        name: "已入库", 
 | 
                        num: "0", 
 | 
                    }, 
 | 
                    { 
 | 
                        id: "2", 
 | 
                        name: "已取消", 
 | 
                        num: "0", 
 | 
                    } 
 | 
                ], 
 | 
                finished: false, 
 | 
                loading: false, 
 | 
                refreshing: false, 
 | 
                timeShow: false, 
 | 
                lists: [] 
 | 
            }; 
 | 
        }, 
 | 
        onReady() { 
 | 
            var that = this 
 | 
            this.$nextTick(() => { 
 | 
                uni.createSelectorQuery().in(this).select('.content_search').boundingClientRect((rect) => { 
 | 
                    that.height = `calc(100vh - ${rect.height + 80}px)` 
 | 
                    that.top = `${rect.height}px` 
 | 
                }).exec() 
 | 
            }) 
 | 
        }, 
 | 
        onLoad() { 
 | 
            this.getLists() 
 | 
            this.getPageCount() 
 | 
        }, 
 | 
        methods: { 
 | 
            onRefresh() { 
 | 
                this.isLoading = true 
 | 
                this.listData.page = 0; 
 | 
                this.finished = false; 
 | 
                this.lists = []; 
 | 
                this.getLists() 
 | 
                this.getPageCount() 
 | 
            }, 
 | 
            seeText(id) { 
 | 
                return orderTyepToStr(id) 
 | 
            }, 
 | 
            tyepToStr(type) { 
 | 
                for (const item of this.types) { 
 | 
                    if (parseInt(item.id) === type) { 
 | 
                        return item.name 
 | 
                    } 
 | 
                } 
 | 
                return '-' 
 | 
            }, 
 | 
            // 跳转 
 | 
            jump(item) { 
 | 
                uni.navigateTo({ 
 | 
                    url: `/pages_adjust/pages/warehousingDetails1/warehousingDetails1?id=${item.id}` 
 | 
                }) 
 | 
            }, 
 | 
            // 获取头部组件高度 
 | 
            getHeight(height) { 
 | 
                this.height = height 
 | 
            }, 
 | 
            // 重置 
 | 
            reset() { 
 | 
                this.listData.code = ''; 
 | 
                this.listData.page = 0; 
 | 
                this.finished = false; 
 | 
                this.lists = []; 
 | 
                this.types.forEach((item) => { 
 | 
                    item.isActive = false 
 | 
                }) 
 | 
                this.listData.originType = '' 
 | 
                this.listData.planDateEnd = '' 
 | 
                this.listData.planDateStart = '' 
 | 
                this.getLists(); 
 | 
                this.getPageCount() 
 | 
            }, 
 | 
            // 统计数据 
 | 
            getPageCount() { 
 | 
                pageCount({ 
 | 
                    type: 1, 
 | 
                    codeOrHouse: this.listData.code, 
 | 
                    planDateEnd: this.listData.planDateEnd, 
 | 
                    planDateStart: this.listData.planDateStart, 
 | 
                    billType: this.listData.originType 
 | 
                }).then(res => { 
 | 
                    if (res.code === 200) { 
 | 
                        this.tagList[0].num = res.data.allNum.toString() 
 | 
                        this.tagList[1].num = res.data.startNum.toString() 
 | 
                        this.tagList[2].num = res.data.endNum.toString() 
 | 
                        this.tagList[3].num = res.data.cancelNum.toString() 
 | 
                    } 
 | 
                }) 
 | 
            }, 
 | 
            // 获取计划列表数据 
 | 
            getLists() { 
 | 
                if (!this.finished) { 
 | 
                    this.loading = true; 
 | 
                    this.listData.page = this.listData.page += 1; 
 | 
                    getBoundList({ 
 | 
                        capacity: this.listData.capacity, 
 | 
                        model: { 
 | 
                            type: 1, 
 | 
                            codeOrHouse: this.listData.code, 
 | 
                            planDateEnd: this.listData.planDateEnd, 
 | 
                            planDateStart: this.listData.planDateStart, 
 | 
                            status: this.listData.status, 
 | 
                            billType: this.listData.originType 
 | 
                        }, 
 | 
                        page: this.listData.page, 
 | 
                        sorts: [{ 
 | 
                            direction: "ASC", 
 | 
                            property: "publishDate", 
 | 
                        }] 
 | 
                    }) 
 | 
                    .then((res) => { 
 | 
                        this.loading = false; 
 | 
                        this.listData.total = res.data.total; 
 | 
                        if (res.code === 200) { 
 | 
                            if (res.data.records.length < this.listData.capacity) { 
 | 
                                this.finished = true; 
 | 
                            } 
 | 
                            if (this.listData.page === 1) { 
 | 
                                this.lists = res.data.records; 
 | 
                            } else { 
 | 
                                this.lists.push(...res.data.records); 
 | 
                            } 
 | 
                        } 
 | 
                    }) 
 | 
                    .finally(() => { 
 | 
                        this.loading = false; 
 | 
                        this.isLoading = false 
 | 
                    }) 
 | 
                } else { 
 | 
                    this.isLoading = false 
 | 
                } 
 | 
            }, 
 | 
            // 日期确定 
 | 
            timeConfirm(val) { 
 | 
                this.listData.planDateStart = val.startDate 
 | 
                this.listData.planDateEnd = val.endDate 
 | 
                this.timeShow = false 
 | 
            }, 
 | 
            // 切换单据类型 
 | 
            changeTags(i) { 
 | 
                this.types[i].isActive = !this.types[i].isActive; 
 | 
                this.listData.originType = this.types[i].id 
 | 
                for (const index in this.types) { 
 | 
                    if (index != i) { 
 | 
                        const item = this.types[index] 
 | 
                        item.isActive = false 
 | 
                    } 
 | 
                } 
 | 
            }, 
 | 
            // 打开日期插件 
 | 
            openDate() { 
 | 
                this.timeShow = true 
 | 
            }, 
 | 
            // 搜索 
 | 
            searchInput(val) { 
 | 
                this.listData.code = val; 
 | 
                this.listData.page = 0; 
 | 
                this.finished = false; 
 | 
                this.lists = []; 
 | 
                this.getLists(); 
 | 
                this.getPageCount() 
 | 
            }, 
 | 
            // 点击标签搜索 
 | 
            clickTag(ids) { 
 | 
                this.listData.status = ids 
 | 
                this.listData.page = 0; 
 | 
                this.finished = false; 
 | 
                this.lists = []; 
 | 
                this.getLists() 
 | 
            }, 
 | 
            // 获取列表统计 
 | 
            pageCounts() { 
 | 
                pageCount({ 
 | 
                    factoryId: this.listData.departIds, 
 | 
                    procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [], 
 | 
                    startDate: this.listData.startDate, 
 | 
                    endDate: this.listData.endDate, 
 | 
                    statusList: this.listData.cateIds 
 | 
                }).then(res => { 
 | 
                    if (res.code === 200 && res.data) { 
 | 
                        this.tagList[0].num = res.data.allNum.toString() 
 | 
                        this.tagList[1].num = res.data.startNum.toString() 
 | 
                        this.tagList[2].num = res.data.ingNum.toString() 
 | 
                        this.tagList[3].num = res.data.endNum.toString() 
 | 
                    } 
 | 
                }) 
 | 
            }, 
 | 
            // 搜索弹框提交 
 | 
            submit() { 
 | 
                this.listData.page = 0; 
 | 
                this.finished = false; 
 | 
                this.lists = []; 
 | 
                this.getLists(); 
 | 
                this.getPageCount() 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
</script> 
 | 
  
 | 
<style lang="scss" scoped> 
 | 
    .content { 
 | 
        .content_search { 
 | 
            width: 100%; 
 | 
            padding: 30rpx; 
 | 
            background: white; 
 | 
            position: sticky; 
 | 
            top: 0; 
 | 
            z-index: 999; 
 | 
            box-sizing: border-box; 
 | 
  
 | 
            .Search_item { 
 | 
                margin-bottom: 40rpx; 
 | 
  
 | 
                .Search_item_label { 
 | 
                    font-size: 30rpx; 
 | 
                    font-weight: 500; 
 | 
                    color: #222222; 
 | 
                } 
 | 
  
 | 
                .Search_item_content { 
 | 
                    display: flex; 
 | 
                    align-items: center; 
 | 
                    justify-content: space-between; 
 | 
                    margin-top: 30rpx; 
 | 
  
 | 
                    .tag { 
 | 
                        display: flex; 
 | 
                        flex-wrap: wrap; 
 | 
                        align-items: center; 
 | 
  
 | 
                        .tag_active { 
 | 
                            background: $nav-color !important; 
 | 
                            color: #ffffff !important; 
 | 
                        } 
 | 
  
 | 
                        .tag_item { 
 | 
                            padding: 22rpx 26rpx; 
 | 
                            box-sizing: border-box; 
 | 
                            background: #F2F2F2; 
 | 
                            border-radius: 8rpx; 
 | 
                            font-size: 26rpx; 
 | 
                            font-weight: 400; 
 | 
                            color: #333333; 
 | 
                            display: flex; 
 | 
                            align-items: center; 
 | 
                            justify-content: center; 
 | 
                            margin-right: 22rpx; 
 | 
                            margin-bottom: 22rpx; 
 | 
                        } 
 | 
                    } 
 | 
  
 | 
                    text { 
 | 
                        font-size: 26rpx; 
 | 
                        font-weight: 400; 
 | 
                        color: #333333; 
 | 
                        margin: 0 30rpx; 
 | 
                    } 
 | 
  
 | 
                    .Search_item_content_a { 
 | 
                        padding: 20rpx 0; 
 | 
                        flex: 1; 
 | 
                        background: #F7F7F7; 
 | 
                        border-radius: 8rpx; 
 | 
                        border: 1rpx solid #EEEEEE; 
 | 
                        font-size: 26rpx; 
 | 
                        font-weight: 400; 
 | 
                        color: #B2B2B2; 
 | 
                        display: flex; 
 | 
                        align-items: center; 
 | 
                        justify-content: center; 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
  
 | 
            .content_search_x { 
 | 
                height: 24rpx; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        .content_list { 
 | 
            width: 100%; 
 | 
            display: flex; 
 | 
            flex-direction: column; 
 | 
  
 | 
            .content_list_item { 
 | 
                width: 100%; 
 | 
                box-sizing: border-box; 
 | 
                padding: 30rpx; 
 | 
                display: flex; 
 | 
                flex-direction: column; 
 | 
                border-bottom: 1rpx solid #ececec; 
 | 
                background: white; 
 | 
  
 | 
                .content_list_item_top { 
 | 
                    display: flex; 
 | 
                    align-items: center; 
 | 
                    justify-content: space-between; 
 | 
  
 | 
                    .content_list_item_top_left { 
 | 
                        display: flex; 
 | 
                        align-items: center; 
 | 
  
 | 
                        text { 
 | 
                            font-size: 32rpx; 
 | 
                            font-weight: 500; 
 | 
                            color: #333333; 
 | 
                        } 
 | 
                    } 
 | 
  
 | 
                    .content_list_item_top_right { 
 | 
                        font-size: 26rpx; 
 | 
                        font-weight: 400; 
 | 
  
 | 
                        .created { 
 | 
                            color: $nav-stateColor1 !important; 
 | 
                        } 
 | 
  
 | 
                        .warning { 
 | 
                            color: $nav-stateColor5 !important; 
 | 
                        } 
 | 
  
 | 
                        .green { 
 | 
                            color: $nav-stateColor6 !important; 
 | 
                        } 
 | 
  
 | 
                        .info { 
 | 
                            color: $nav-stateColor3 !important; 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
  
 | 
                .content_list_item_content { 
 | 
                    padding: 24rpx 30rpx; 
 | 
                    background: #f7f7f7; 
 | 
                    border-radius: 16rpx; 
 | 
                    display: flex; 
 | 
                    flex-wrap: wrap; 
 | 
                    justify-content: space-between; 
 | 
                    margin-top: 32rpx; 
 | 
  
 | 
                    .content_list_item_content_item { 
 | 
                        width: 100%; 
 | 
                        display: flex; 
 | 
                        margin-top: 24rpx; 
 | 
  
 | 
                        &:first-child { 
 | 
                            margin-top: 0; 
 | 
                        } 
 | 
  
 | 
                        // &:nth-child(1) { 
 | 
                        //   margin-top: 0 !important; 
 | 
                        // } 
 | 
                        // &:nth-child(2) { 
 | 
                        //   margin-top: 0 !important; 
 | 
                        // } 
 | 
                        .content_list_item_content_item_label { 
 | 
                            font-size: 24rpx; 
 | 
                            font-weight: 400; 
 | 
                            color: #666666; 
 | 
                            flex-shrink: 0; 
 | 
                        } 
 | 
  
 | 
                        .content_list_item_content_item_nr { 
 | 
                            font-size: 24rpx; 
 | 
                            font-weight: 400; 
 | 
                            color: #222222; 
 | 
                            margin-right: 10rpx; 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
  
 | 
        .content_total { 
 | 
            width: 100%; 
 | 
            height: 80rpx; 
 | 
            padding: 24rpx 30rpx; 
 | 
            background: #F7F7F7; 
 | 
            font-size: 24rpx; 
 | 
            font-weight: 400; 
 | 
            box-sizing: border-box; 
 | 
            color: #666666; 
 | 
            position: sticky; 
 | 
            z-index: 99; 
 | 
        } 
 | 
    } 
 | 
</style> 
 |