审查视图

src/views/nmms_import/Waybill.vue 20.2 KB
1 2 3 4 5 6 7
<template>
    <el-container>
        <el-main>
            <el-row class="row-bg">
                <el-col :span="24"><div class="grid-content content co">进港运单申报</div></el-col>
            </el-row>
            <!--查询条件-->
8 9 10
            <el-row style="display: block;background-color: white">
                <el-row>
                    <el-col :span="6">
11
                        <el-input placeholder="" v-model="defaultQuery.awba" style="width: 90%" clearable>
12
                            <template slot="prepend">主单号</template>
13
                        </el-input>
14 15
                    </el-col>
                    <el-col :span="6">
16
                        <el-input placeholder="" v-model="vcarrier" style="width: 90%" clearable>
17
                            <template slot="prepend">承运人</template>
18
                        </el-input>
19 20
                    </el-col>
                    <el-col :span="6">
21
                        <el-input placeholder="" v-model="defaultQuery.flightno" style="width: 90%" clearable>
22
                            <template slot="prepend">航班号</template>
23 24 25
                        </el-input>
                    </el-col>
                    <el-col :span="6">
26 27 28
                        <div class="ip">
                            航班日期
                        </div>
29 30 31
                        <el-date-picker
                                v-model="defaultQuery.flightdate"
                                type="date"
32
                                value-format="yyyy-MM-dd"  style="width: 140px"
33 34 35 36 37 38
                                placeholder="航班日期">
                        </el-date-picker>
                    </el-col>
                </el-row>
                <el-row >
                    <el-col :span="6">
39 40 41
                        <div class="ip">
                            业务状态
                        </div>
42
                        <el-select v-model="defaultQuery.status" placeholder="选择状态" style="width: 125px">
43 44 45
                            <el-option
                                    v-for="item in options"
                                    :key="item.value"
46
                                    :label="item.label"
47 48 49 50 51
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-col>
                    <el-col :span="6">
52 53 54
                        <div class="ip">
                            报文类型
                        </div>
55
                        <el-select v-model="defaultQuery.messageType" placeholder="报文类型" style="width: 125px">
56 57 58
                            <el-option
                                    v-for="item in options2"
                                    :key="item.value"
59 60 61 62 63
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-col>
64 65
                    <el-col :span="6">
                        <el-col :span="8" style="margin-right: 0px">
66
                            <el-button type="primary" v-on:click="QueryData" icon="el-icon-search">查&nbsp;询</el-button>
67 68 69 70 71 72 73
                        </el-col>
                        <!--<el-col :span="16" style="margin-right: 0px">
                            <el-button type="primary">批量修改状态</el-button>
                        </el-col>-->
                    </el-col>
                </el-row>
74 75
            </el-row>
            <!--查询结果样式-->
76
            <el-row style="font-size: xx-small">
77
                <el-col :span="1" class="mark"><div class="grid-content bg" style="color: red"><span>注:</span></div></el-col>
78 79 80 81
                <el-col :span="3" class="mark"><div class="grid-content bg mainse" style="border-radius: 5px;margin-right: 5px;background-color: rgba(99,205,218,0.4)" ><span>主单原始舱单</span></div></el-col>
                <el-col :span="3" class="mark"><div class="grid-content bg fense" style="border-radius: 5px;margin-right: 5px;background-color: rgba(119,139,235,0.3)"><span>分单原始舱单</span></div></el-col>
                <el-col :span="3" class="mark"><div class="grid-content bg tallse" style="border-radius: 5px;margin-right: 5px;background-color: rgba(243,166,131,0.4)"><span>主单理货报告</span></div></el-col>
                <el-col :span="3" class="mark"><div class="grid-content bg tallfense" style="border-radius: 5px;margin-right: 5px;background-color: rgba(247,215,148,0.4)"><span>分单理货报告</span></div></el-col>
82 83 84 85 86 87
            </el-row>
            <!--查询列表-->
            <el-row>
                <el-col :span="24">
                    <template>
                        <el-table
xudada authored
88
                                v-loading="tableloading"
89 90 91
                                ref="multipleTable"
                                :data="tableData"
                                tooltip-effect="dark"
92 93
                                style="border-radius: 10px 10px 0px 0px;line-height: 25px;min-height: 500px"
                                :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
xudada authored
94
                                :default-sort = "{prop: 'date', order: 'descending'}"
95 96 97 98 99 100 101 102
                                @selection-change="handleSelectionChange">
                            <el-table-column
                                    type="selection"
                                    width="45">
                            </el-table-column>
                            <el-table-column
                                    fixed="left"
                                    label="操作"
xudada authored
103
                                    width="75">
104 105
                                <template slot-scope="scope">
                                    <el-button
106
                                            v-if="scope.row.stype=='MT1201'"
107 108 109 110 111 112 113 114 115
                                            @click="handleClick(scope.row)" type="text" size="small">原始舱单</el-button>
                                    <el-button
                                            v-else
                                            @click="handleTally(scope.row)" type="text" size="small">进港理货</el-button>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    label="航班号"
                                    width="75">
116 117 118
                                <template slot-scope="scope">
                                    <span>{{scope.row.carrier}}{{scope.row.flightno}}</span>
                                </template>
119 120 121 122 123 124 125 126
                            </el-table-column>
                            <el-table-column
                                    prop="flightdate"
                                    label="航班日期"
                                    width="95">
                            </el-table-column>
                            <el-table-column
                                    label="航段"
127 128 129 130
                                    width="90">
                                <template slot-scope="scope">
                                    <span>{{scope.row.originstation}}-{{scope.row.destinationstation}}</span>
                                </template>
131 132 133 134 135
                            </el-table-column>
                            <el-table-column
                                    label="主单号"
                                    width="115"
                                    >
xudada authored
136
                                <template slot-scope="scope">
137
                                    <span v-if="scope.row.stype=='MT1201'&&scope.row.awbh==''" style="background-color:rgba(99,205,218,0.4);width: 100%;height:100%;display:block;color: black">
xudada authored
138 139
                                        {{scope.row.awba}}
                                    </span>
140
                                    <span v-else-if="scope.row.stype=='MT1201'&&scope.row.awbh!=''" style="background-color:rgba(119,139,235,0.3);width: 100%;height:100%;display:block;color: black">
xudada authored
141 142
                                        {{scope.row.awba}}
                                    </span>
143
                                    <span v-else-if="scope.row.stype=='MT5201'&&scope.row.awbh==''" style="background-color:rgba(243,166,131,0.4);width: 100%;height:100%;display:block;color: black">
xudada authored
144 145
                                        {{scope.row.awba}}
                                    </span>
146
                                    <span v-else-if="scope.row.stype=='MT5201'&&scope.row.awbh!=''" style="background-color:rgba(247,215,148,0.4);width: 100%;height:100%;display:block;color: black">
xudada authored
147 148 149
                                        {{scope.row.awba}}
                                    </span>
                                </template>
150 151 152 153 154 155 156 157 158
                            </el-table-column>
                            <el-table-column
                                    prop="awbh"
                                    label="分单号"
                                    width="130">
                            </el-table-column>
                            <el-table-column
                                    prop="piece"
                                    label="件数"
159
                                    width="60">
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
                            </el-table-column>
                            <el-table-column
                                    prop="weight"
                                    label="重量"
                                    width="70">
                            </el-table-column>
                            <el-table-column
                                    prop="customcode"
                                    label="关区号"
                                    width="65">
                            </el-table-column>
                            <el-table-column
                                    prop="actime"
                                    label="时间"
                                    width="155">
                                <template slot-scope="scope">{{timestampToTime(scope.row.actime)}}</template>
                            </el-table-column>
                            <el-table-column
                                    prop="status"
                                    label="状态"
xudada authored
180
                                    width="90" :formatter="formatStatus">
181 182 183 184
                            </el-table-column>
                            <el-table-column
                                    label="回执内容"
                                    width="250">
xudada authored
185
                                <template slot-scope="scope">
186 187 188 189 190 191 192
                                    <span v-if="scope.row.ext5 && scope.row.ext5.indexOf('异常') != -1" style="color: #F56C6C">
                                       {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.ext5 && scope.row.ext5.indexOf('不通过') != -1" style="color: #F56C6C">
                                       {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.ext5 && scope.row.ext5.indexOf('不接受') != -1" style="color: #F56C6C">
193 194 195
                                       {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.status=='01' || scope.row.status=='11'" style="color: #67C23A">
xudada authored
196 197 198 199 200
                                        {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.status=='02' || scope.row.status=='03'" style="color: #E6A23C">
                                        {{scope.row.ext5}}
                                    </span>
201
                                    <span v-else-if="scope.row.status=='12' || scope.row.status=='13'" style="color: #f56c6c">
xudada authored
202 203 204 205 206 207
                                        {{scope.row.ext5}}
                                    </span>
                                    <span v-else style="color: #909399;">
                                        {{scope.row.ext5}}
                                    </span>
                                </template>
208
                            </el-table-column>
209
<!--                            || scope.row.ext5.indexOf('不通过') != -1 || scope.row.ext5.indexOf('不接受') != -1-->
210 211 212 213 214 215 216 217 218 219 220
                        </el-table>
                    </template>
                </el-col>
            </el-row>
            <!--分页部分-->
            <el-row>
                <el-col>
                    <div class="block">
                        <el-pagination
                                @size-change="handleSizeChange"
                                @current-change="handleCurrentChange"
221
                                :current-page="currentPage"
222
                                :page-sizes="[20, 50, 100, 200]"
223
                                :page-size="pageSize"
224
                                layout="total, sizes, prev, pager, next, jumper"
225
                                :total="total">
226 227 228 229 230 231 232 233 234
                        </el-pagination>
                    </div>
                </el-col>
            </el-row>
        </el-main>
    </el-container>
</template>

<style scoped>
235 236
    .ip{
        max-width: 100px;
237
        margin-right: -5px;
238 239 240 241 242 243 244 245 246 247 248 249 250
        display: inline-block;
        background-color: #6F8294;
        color: #ffffff;
        border: 1px solid #DCDFE6;
        vertical-align: middle;
        padding: 5px 18px;
        white-space: nowrap;
        border-top-right-radius: 0px;
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 0px;
        font-size: 10px;
    }
251 252 253 254 255 256 257
    .co{height: 36px;line-height: 36px;}
    .co{border-left: 4px #409EFF solid;padding-left: 10px;background-color: #f9fafc;margin-bottom: 2px}
    .row-bg{background-color: white;padding:0px;}
    .el-row{margin-bottom: 10px;}
    .sel{display: inline;}
    .mark{height:24px;}
    .bg{height:24px;text-align: center;line-height:24px;min-height: 24px}
xudada authored
258 259 260 261
    .mainse{background: #67C23A}
    .fense{background-color: #409eff}
    .tallse{background-color: #FF8C00}
    .tallfense{background-color: #e6a23c}
262 263
    .cell{background: #5BB75B}
    .cell2{background-color: #12B399}
xudada authored
264 265 266
    .el-input-group{
        display: table;
    }
267 268 269
</style>
<script>
    import { QueryData } from '../../api/wayDeclaration'
270
    import {mapActions, mapGetters} from 'vuex'
271
    import {loginedUserInfo} from "../../api/user";
272
    import jsutil from "@/common/js/util";
273
    export default {
274
        name:'Waybill',
275 276 277 278 279 280 281 282
        data() {
            return {
                defaultQuery:{
                    awba:'',
                    carrier:'',
                    flightno:'',
                    flightdate:'',
                    status:'',
283 284
                    messageType:'',
                    departmentid:''
285 286 287
                },
                options: [
                    {
xudada authored
288 289
                    value: '',
                    label: '业务状态'
290
                }, {
xudada authored
291
                    value: '22',
292 293
                    label: '未发送'
                }, {
xudada authored
294
                    value: '23',
295 296
                    label: '已发舱单报'
                }, {
xudada authored
297
                    value: '03',
298 299 300 301 302
                    label: '舱单报退单'
                }],
                options2: [
                    {
                    value: '',
xudada authored
303
                    label: '业务类型'
304 305 306 307 308 309 310 311 312
                }, {
                    value: 'MT1201',
                    label: '原始舱单'
                }, {
                    value: 'MT5201',
                    label: '进港理货'
                }],
                tableData: [],
                multipleSelection: [],
313
                currentPage:1,
314
                pageSize:20,
xudada authored
315 316
                total:0,
                tableloading:false
317 318 319 320 321 322 323
            }
        },
        methods:{
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            handleSizeChange(val) {
324 325
                this.pageSize=val;
                this.QueryData();
326 327
            },
            handleCurrentChange(val) {
328 329
                this.currentPage=val;
                this.QueryData();
330
            },
xudada authored
331 332 333 334 335 336 337
            //状态适配
            formatStatus:function (row,column) {
                return row.status=='01'?'接受申报':row.status=='02'?'待人工审核':row.status=='03'?'退单'
                    :row.status=='11'?'放行':row.status=='12'?'拒装':row.status=='13'?'禁卸'
                        :row.status=='21'?'可自动发送':row.status=='22'?'未发送':row.status=='23'?'已发送新增报'
                            :row.status=='24'?'已发送删除报':row.status=='25'?'已发送修改报':'';
            },
338 339
            //条件查询方法
            QueryData(){
340
                if(jsutil.checkNull(this.defaultQuery.awba)||jsutil.checkNull(this.defaultQuery.flightdate)){
朱兆平 authored
341 342 343 344 345 346 347 348 349 350 351
                    let params={
                        currentPage:this.currentPage,
                        pageSize:this.pageSize,
                        awba:this.defaultQuery.awba,
                        carrier:this.defaultQuery.carrier,
                        flightno:this.defaultQuery.flightno,
                        flightdate:this.defaultQuery.flightdate,
                        status:this.defaultQuery.status,
                        messageType:this.defaultQuery.messageType,
                        departmentid:loginedUserInfo().companyInfo.departmentid
                    };
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
                    this.tableloading=true;
                    QueryData(params).then(res =>{
                        let response=res.data.data;
                        this.tableData=response.list;
                        this.total=response.total;
                        this.tableloading = false;
                    }).catch(err => {
                        this.tableloading = false;
                    });
                }
                else {
                    this.$confirm('主单号和航班日期至少选填一项!', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    })
                }
369 370 371
            },
            //点击进入原始页面
            handleClick(row){
372 373 374 375 376 377 378 379 380
                this.$router.push({path:'/origmaster',
                    query:{
                        flightno:row.carrier+row.flightno,
                        destinationstation:row.destinationstation,
                        awba:row.awba,
                        flightdate:row.flightdate,
                        originstation:row.originstation
                    }
                });
381 382
            },
            //点击进入理货页面
383
            handleTally(row){
xudada authored
384
                this.$router.push({path:'/tallymaster',query:{flightno:JSON.stringify(row.carrier+row.flightno),destinationstation:JSON.stringify(row.destinationstation),awba:JSON.stringify(row.awba),flightdate:JSON.stringify(row.flightdate),originstation:JSON.stringify(row.originstation)}});
385
            },
386 387 388 389 390 391 392 393 394 395 396
            //table显示时间转换
            timestampToTime(timestamp) {
                var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
                var Y = date.getFullYear() + '-';
                var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
                var D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';
                var h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':';
                var m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':';
                var s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds());
                return Y+M+D+h+m+s;
            },
xudada authored
397 398 399 400 401 402 403 404 405
            },
        computed:{
            vcarrier:{
                get:function () {
                    return this.defaultQuery.carrier;
                },
                set:function (val) {
                    this.defaultQuery.carrier=val.toUpperCase();
                }
406 407
            },
            ...mapGetters(['getUserInfoStore','getUserMenuStore']) // 动态计算属性,相当于this.$store.getters.resturantName
xudada authored
408
        },
409 410

    }
411
</script>