WaybillQuery.vue 18.8 KB
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
<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="8" >
                        <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="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="feewt">
                                <el-input readonly v-model="ruleForm.feewt" style="width: 200px">
                                    <template slot="prepend">计费重量</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="6">
                            <el-form-item  prop="pack">
                                <el-input readonly v-model="ruleForm.pack" style="width: 200px">
                                    <template slot="prepend">包&emsp;&emsp;装</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item  prop="meas">
                                <el-input readonly v-model="ruleForm.meas" style="width: 200px">
                                    <template slot="prepend">尺&emsp;&emsp;寸</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item prop="vol">
                                <el-input readonly v-model="ruleForm.vol" 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="dest4">
                                <el-input readonly v-model="ruleForm.dest4" style="width: 200px">
                                    <template slot="prepend">代理人名称</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item  prop="shpcomid">
                                <el-input readonly v-model="ruleForm.shpcomid" style="width: 200px">
                                    <template slot="prepend">代理人代码</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item prop="optime">
                                <el-input readonly v-model="ruleForm.optime" style="width: 250px">
                                    <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",
        // props: [
        //     'forms'
        // ],
        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:'',
                    dest4:'',
                    shpcomid:'',
                    optime:'',
                    feewt:'',
                    pack:'',
                    meas:'',
                    vol:'',
            },
                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= Object.assign({},row);
                if(row.stocktypeid=="AWBA"){
                    this.ruleForm.stockpre=row.stockpre+"-"+row.stockno;
                    this.ruleForm.stockno="";
                }
            },
        },
        activated() {
            this.form.awba=this.$route.query.waybill
            // console.log(this.$route.query.waybill)
            this.getList();
        },
    }
</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>