zs
2025-05-14 3ec65a96dd073e598e58c12fb0b5af31e38bc20e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
<template>
    <view class="check-stock-main-search-component">
        <view class="search-form-box">
            <u-form labelPosition="left" :labelWidth="84" :model="form" ref="form" :labelStyle="{color:'#787878'}">
                <u-form-item label="计划单号:" borderBottom>
                    <u-input v-model="form.PlanNo" placeholder="请输入..." border="none" clearable />
                </u-form-item>
                <u-form-item label="计划状态:" borderBottom>
                    <u-view-form-select-picker v-model="form.InspectionStatus" :list="selectList.checkPlan" value-field="code" label-field="name" />
                </u-form-item>
            </u-form>
        </view>
        <view class="search-bottom">
            <u-button type="primary" text="查 询" @click="onSearch" />
        </view>
    </view>
</template>
 
<script>
import UViewFormSelectPicker from '@/components/UViewFormSelectPicker.vue'
import { getDicList, $alert } from '@/static/js/utils/index.js'
const defaultQueryForm = {
    PlanNo:'',
    InspectionStatus:''
}
export default {
    name:'checkStockMainSearchComponent',
    components:{UViewFormSelectPicker},
    emits:['callback'],
    props:{
        resetflag: {
          type: Number,
          default: 0
        }
    },
    data(){
        return {
            form:{...defaultQueryForm},
            selectList:{
                checkPlan:[]
            }
        }
    },
    watch:{
        resetflag(newVal, oldVal){
            if (newVal !== oldVal) {
              this.form = {...defaultQueryForm}
            }
        }
    },
    methods:{
        onSearch(){
            this.$emit('callback',this.form)
        }
    },
    mounted() {
        this.selectList.checkPlan = getDicList(this.$store,'task_status')
    }
}
</script>
 
<style lang="scss" scoped>
.check-stock-main-search-component{
    height: 100%;
    display: flex;
    flex-direction: column;
    .search-form-box{
        flex-grow: 1;
        background-color: $uni-bg-color;
        overflow: auto;
        padding: 10rpx 20rpx;
    }
    .search-bottom{
        flex-shrink: 0;
        padding: 10rpx 0;
        padding: 20rpx;
    }
}
</style>