WaybillQuery.vue 16.6 KB
<template>
    <el-container>
        <el-main>
            <el-row class="row-bg">
                <el-col :span="24">
                    <div class="grid-content content">单号查询</div>
                </el-col>
            </el-row>
            <!--            搜索区域-->
            <el-row>
                <el-form :label-position="labelPosition" :model="form"  ref="queryFlight"
                         label-width="130px" class="demo-ruleForm">
                    <el-col :span="5" >
                        <el-form-item label="" prop="awba" label-width="70px">
                            <el-input v-model="form.awba" style="width:250px">
                                <template slot="prepend">主单号</template>
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" >
                        <el-form-item label="" prop="status" label-width="70px">
<!--                            <el-input v-model="form.status" style="width:250px">-->
<!--                                <template slot="prepend">运单状态</template>-->
<!--                            </el-input>-->
                            <div style="display: inline-block;background-color: #6F8294;color: white;
                            border-top-left-radius: 4px;margin-right: -4px;padding-right: 14px;font-size: 12px;
                            border-bottom-left-radius:4px;padding-left: 14px">运单状态</div>
                            <el-select v-model="form.status" style="width:250px">
                                <el-option label="正常" value="30"></el-option>
                                <el-option label="未理货" value="31"></el-option>
                                <el-option label="无原始" value="33"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" >
                        <el-button type="primary" @click="getList()">查询</el-button>
                    </el-col>
                </el-form>
            </el-row>
            <!--            表单区域-->
            <el-row>
                <el-table
                        :data="tableData"
                        border default-expand-all
                        height="500" tooltip-effect="dark"
                        v-loading="tableloading"
                        style="border-radius: 10px 10px 0px 0px;line-height: 25px;min-height: 500px"
                        :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small">
                    <el-table-column
                            label="主单号"
                            prop="awba"
                            width="180">
                        <template slot-scope="scope">
                            <span v-if="scope.row.stocktypeid=='AWBA'">
                                {{scope.row.stockpre}}-{{scope.row.stockno}}
                            </span>
                            <span v-else>
                                {{scope.row.stockpre}}
                             </span>
                        </template>
                    </el-table-column>
                    <el-table-column
                            label="分单号"
                            width="150">
                        <template slot-scope="scope">
                            <span v-if="scope.row.stocktypeid=='AWBA'">
                            </span>
                            <span v-else>
                                {{scope.row.stockno}}
                            </span>
                        </template>
                    </el-table-column>
                    <el-table-column
                            label="件数"
                            prop="pcs"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            label="重量"
                            prop="weight"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            label="起始站"
                            prop="sairportid"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            label="目的站"
                            prop="eairportid"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            label="货物描述"
                            prop="goodsname">
                    </el-table-column>
                    <el-table-column
                            fixed="right"
                            prop=""
                            label="报文操作"
                            width="120">
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
                                    type="success"
                                    @click="trnList(scope.$index,scope.row)">查看</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-row>
            <!--分页模块-->
            <el-row style="float: right;margin-top: 20px">
                <div class="block">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="pageNum"
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="pageSize"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="total">
                    </el-pagination>
                </div>
            </el-row>
            <el-dialog title="运单明细" :visible.sync="dialogFormVisible" width="65%">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-position="labelPosition" size="mini">
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <el-divider content-position="left">运单信息</el-divider>
                        </el-col>
                    </el-row>
                    <el-row class="flightInfo">
                        <el-col :span="6">
                            <el-form-item  prop="stockpre">
                                <el-input readonly v-model="ruleForm.stockpre" style="width: 200px">
                                    <template slot="prepend">主单号&emsp;</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item  prop="stockno">
                                <el-input readonly v-model="ruleForm.stockno" style="width: 200px">
                                    <template slot="prepend">分单号&emsp;</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item  prop="pcs">
                                <el-input readonly v-model="ruleForm.pcs" style="width: 200px">
                                    <template slot="prepend">件&emsp;&emsp;数</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item prop="weight">
                                <el-input readonly v-model="ruleForm.weight" style="width: 200px">
                                    <template slot="prepend">重&emsp;&emsp;量</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row class="flightInfo">
                        <el-col :span="6">
                            <el-form-item  prop="sairportid">
                                <el-input readonly v-model="ruleForm.sairportid" style="width: 200px">
                                    <template slot="prepend">起始站&emsp;</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item  prop="eairportid">
                                <el-input readonly v-model="ruleForm.eairportid" style="width: 200px">
                                    <template slot="prepend">目的站&emsp;</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item prop="goodsname">
                                <el-input readonly v-model="ruleForm.goodsname" style="width: 200px">
                                    <template slot="prepend">货物描述</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <!--发货人信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <el-divider content-position="left">发货人信息</el-divider>
                        </el-col>
                    </el-row>
                    <el-row style="margin-bottom: 0px;">
                        <el-col :span="6">
                            <el-form-item label="" prop="shprname">
                                <el-input readonly v-model="ruleForm.shprname" style="width: 200px">
                                    <template slot="prepend">发货人称</template>
                                </el-input>
                            </el-form-item>
                        </el-col>

                        <el-col :span="6">
                            <el-form-item label="" prop="shpraddress">
                                <el-input readonly v-model="ruleForm.shpraddress" style="width: 200px">
                                    <template slot="prepend">地&emsp;&emsp;址</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="" prop="shprtel">
                                <el-input readonly v-model="ruleForm.shprtel" style="width: 200px">
                                    <template slot="prepend">电&emsp;&emsp;话</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="" prop="shprcountyr">
                                <el-input readonly v-model="ruleForm.shprcountyr" style="width: 200px">
                                    <template slot="prepend">国家代码</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <!--收货人信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <el-divider content-position="left">收货人信息</el-divider>
                        </el-col>
                    </el-row>
                    <el-row style="margin-bottom: 30px">
                        <el-col :span="6">
                            <el-form-item label="" prop="cnsnname">
                                <el-input readonly v-model="ruleForm.cnsnname" style="width: 200px">
                                    <template slot="prepend">收货人称</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="" prop="cnsnaddress">
                                <el-input readonly v-model="ruleForm.cnsnaddress" style="width: 200px">
                                    <template slot="prepend">地&emsp;&emsp;址</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="" prop="cnsntel">
                                <el-input readonly v-model="ruleForm.cnsntel" style="width: 200px">
                                    <template slot="prepend">电&emsp;&emsp;话</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="" prop="cnscountyr">
                                <el-input readonly v-model="ruleForm.cnscountyr" style="width: 200px">
                                    <template slot="prepend">国家代码</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </el-dialog>

        </el-main>
    </el-container>
</template>

<script>
    import { selectAwbList } from '../../api/wayDeclaration'

    export default {
        name: "WaybillQuery",
        data(){
            return{
                form:{
                    awba:'',
                    status:''
            },
                pageNum:1,
                pageSize:100,
                total:0,
                ruleForm:{
                    stockpre:'',
                    stockno:'',
                    pcs:'',
                    weight:'',
                    sairportid:'',
                    eairportid:'',
                    goodsname:'',
                    shprname:'',
                    shprtel:'',
                    shprcountyr:'',
                    shpraddress:'',
                    cnsnname:'',
                    cnsnaddress:'',
                    cnsntel:'',
                    cnscountyr:'',
            },
                rules:{

                },
                dialogFormVisible:false,
                tableData:[],
                labelPosition:'left',
                // pageNum: 1,
                // pageSize:10,
                // total:0,
                tableloading:false,

            }
        },
        methods:{
            /*分页方法*/
            handleSizeChange(val) {
                this.pageSize=val;
                this.getList();
            },
            handleCurrentChange(val) {
                this.currentPage=val;
                this.getList();
            },
            // 获取消息标签列表
            getList() {
                const _this = this
                this.tableloading = true;
                selectAwbList(this.form).then((response) => {
                    console.log(response);
                    const res = response.data
                    if (res.code != '200') {
                        return _this.$message.error('获取消息收发记录,失败!')
                    }
                    // 获取列表数据
                    _this.tableData = res.data.list;
                    // 获取列表的总记录数
                    // _this.total = res.total
                    this.tableloading = false;
                    _this.$message.success('获取消息收发记录,成功!')
                }).catch(error => {
                    // 关闭加载
                    _this.$message.error(error.toString())
                    this.tableloading = false;

                })
            },
            /*编辑主单信息*/
            trnList(index, row){
                this.dialogFormVisible = true;
                this.ruleForm=row;
                if(row.stocktypeid=="AWBA"){
                    this.ruleForm.stockpre=row.stockpre+"-"+row.stockno;
                    this.ruleForm.stockno="";
                }
            },
        }
    }
</script>

<style scoped>
    .grid-content {
        height: 36px;
        line-height: 36px;
    }
    .el-dialog__body{text-align: center}
    .content {
        border-left: 4px #409EFF solid;
        padding-left: 10px;
        background-color: #f9fafc;
        margin-bottom: 2px
    }

    .row-bg{
        background-color: white;
    }
</style>