马宇豪
2025-01-10 03f0e2a3220106ec2a9dd8f53d3ef5ab824c3ae7
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<template>
    <div class="app-container">
        <div class="filter-container">
            <div style="display: block;">
                <div class="basic_search" style="padding-top: 10px">
                    <span>按流向码查询:</span>
                    <el-input filterable clearable v-model="filter.filter.directioncode" style="width:300px">
                    </el-input>
                </div>
 
                <el-select v-model="filter.filter.status" clearable placeholder="状态">
                    <el-option
                        v-for="item in statusOptions"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                    </el-option>
                </el-select>
                <div class="basic_search" style="margin-right: 10px">
                    <el-button style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="search('查询','')">查询</el-button>
                </div>
            </div>
 
        </div>
        <div class="table_content" v-loading="listLoading">
 
         <div>
            <div v-show="fireData.length > 0 ">
                <el-table
 
                    :data="fireData"
                    border
                    fit
                    highlight-current-row
                    style="width: 100%;"
                >
                    <el-table-column label="产品" prop="name" align="center"/>
                    <el-table-column label="类型" prop="type" align="center"/>
                    <el-table-column label="等级" prop="level" align="center"/>
                    <el-table-column label="箱含量" prop="boxNumber" align="center"/>
                    <el-table-column label="规格" prop="specification" align="center"/>
                    <el-table-column label="生产商" prop="manufacturer" align="center"/>
                </el-table>
            </div>
        </div>
 
 
            <div style="margin-top: 20px">
            <el-table
 
                :key="tableKey"
                :data="fireStatusInBoxData"
                border
                fit
                highlight-current-row
                style="width: 100%;"
            >
                <el-table-column label="序号" type="index" align="center" width="60"/>
                <el-table-column label="19位码" prop="directioncode" align="center">
                </el-table-column>
                <el-table-column label="状态" align="center">
                    <template slot-scope="scope">
                        <span >{{statusJudge(scope.row)}}</span>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
                v-show="recordTotal>0"
                :current-page="this.filter.pageIndex"
                :page-sizes="[10, 20, 30, 50]"
                :page-size="this.filter.pageSize"
                :total="recordTotal"
                layout="total, sizes, prev, pager, next, jumper"
                background
                style="float:right;"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
            />
            </div>
            <br>
        </div>
    </div>
</template>
 
<script>
import { fireStatusInBox } from '@/api/flow'
 
export default {
    name: "fireStatus",
    data(){
        return{
            tableKey:'',
            directionCode:'',
            listLoading:false,
            fireStatusInBoxData:[],
            fireData:[],
            recordTotal:0,
          statusOptions:[
            {label:"全部",value:null},
            {label:"未入库",value:"未入库"},
            {label:"已入库",value:"已入库"},
            {label:"已售出",value:"已售出"},
          ],
            filter:{
              pageIndex:1,
              pageSize:10,
              filter:{
                directioncode:"",
                status:null
              }
            }
        }
    },
    created() {
        this.fireStatusInBox()
    },
    watch: {
    },
    computed:{
 
    },
    methods:{
        async fireStatusInBox(){
            this.fireData = []
            this.listLoading = true
            if(this.filter.filter.directioncode !== null && this.filter.filter.directioncode !== '' ){
                let res = await fireStatusInBox(this.filter)
                if(res.data.code === "200"){
                    this.fireStatusInBoxData = res.data.result.result
                    this.fireData.push(res.data.result.extension)
 
                }else{
                    this.$message({
                        type:'warning',
                        message:res.data.message
                    })
                }
            }
            this.listLoading = false
        },
 
        search(){
            this.fireStatusInBox()
        },
      handleSizeChange(val) {
        this.fireStatusInBox()
      },
      handleCurrentChange(val) {
        this.fireStatusInBox()
      },
      statusJudge(row){
        switch (row.status) {
          case "已售出":
            return row.status
          case "":
            return row.owner === '' ? '未入库' : '已入库'
        }
      },
    },
}
</script>
 
<style scoped>
.basic_search{
    display:inline-block;
}
 
</style>