审查视图

src/views/nmms_import/Waybill.vue 17.0 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<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>
            <!--查询条件-->
            <el-row>
                <el-col :span="6">
                    <div class="grid-content">
                        <el-input placeholder="" v-model="defaultQuery.awba">
                            <template slot="prepend">主单号</template>
                        </el-input>
                    </div>
                </el-col>
                <el-col :span="5">
                    <div class="grid-content">
xudada authored
18
                            <el-input placeholder="" v-model="vcarrier">
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
                                <template slot="prepend">承运人</template>
                            </el-input>
                    </div>
                </el-col>
                <el-col :span="5">
                    <div class="grid-content">
                        <el-input placeholder="" v-model="defaultQuery.flightno">
                            <template slot="prepend">航班号</template>
                        </el-input>
                    </div>
                </el-col>
                <el-col :span="5">
                    <div class="grid-content">
                        <div class="block">
                            <el-date-picker
                                    v-model="defaultQuery.flightdate"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    placeholder="航班日期">
                            </el-date-picker>
                        </div>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="6">
                    <div class="grid-content">
                        <el-select v-model="defaultQuery.status" placeholder="选择状态" class="sel">
                            <el-option
                                    v-for="item in options"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </div>
                </el-col>
                <el-col :span="5">
                    <el-select v-model="defaultQuery.messageType" placeholder="报文类型" class="sel">
                        <el-option
                                v-for="item in options2"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span="5">
                    <el-col :span="8" style="margin-right: 0px">
                        <el-button type="primary" v-on:click="QueryData">查询</el-button>
                    </el-col>
70
                    <!--<el-col :span="16" style="margin-right: 0px">
71
                        <el-button type="primary">批量修改状态</el-button>
72
                    </el-col>-->
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
                </el-col>
            </el-row>
            <!--查询结果样式-->
            <el-row>
                <el-col :span="1" class="mark"><div class="grid-content bg" style="color: red"><span>注:</span></div></el-col>
                <el-col :span="2" class="mark"><div class="grid-content bg mainse" ><span>主单原始舱单</span></div></el-col>
                <el-col :span="2" class="mark"><div class="grid-content bg fense" ><span>分单原始舱单</span></div></el-col>
                <el-col :span="2" class="mark"><div class="grid-content bg tallse" ><span>主单理货报告</span></div></el-col>
                <el-col :span="2" class="mark"><div class="grid-content bg tallfense" ><span>分单理货报告</span></div></el-col>
            </el-row>
            <!--查询列表-->
            <el-row>
                <el-col :span="24">
                    <template>
                        <el-table
xudada authored
88
                                v-loading="tableloading"
89 90 91 92
                                ref="multipleTable"
                                :data="tableData"
                                tooltip-effect="dark"
                                style="width: 100%"
xudada authored
93
                                :default-sort = "{prop: 'date', order: 'descending'}"
94 95 96 97 98 99 100 101
                                @selection-change="handleSelectionChange">
                            <el-table-column
                                    type="selection"
                                    width="45">
                            </el-table-column>
                            <el-table-column
                                    fixed="left"
                                    label="操作"
xudada authored
102
                                    width="75">
103 104
                                <template slot-scope="scope">
                                    <el-button
105
                                            v-if="scope.row.stype=='MT1201'"
106 107 108 109 110 111 112 113 114
                                            @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">
115 116 117
                                <template slot-scope="scope">
                                    <span>{{scope.row.carrier}}{{scope.row.flightno}}</span>
                                </template>
118 119 120 121 122 123 124 125
                            </el-table-column>
                            <el-table-column
                                    prop="flightdate"
                                    label="航班日期"
                                    width="95">
                            </el-table-column>
                            <el-table-column
                                    label="航段"
126 127 128 129
                                    width="90">
                                <template slot-scope="scope">
                                    <span>{{scope.row.originstation}}-{{scope.row.destinationstation}}</span>
                                </template>
130 131 132 133 134
                            </el-table-column>
                            <el-table-column
                                    label="主单号"
                                    width="115"
                                    >
xudada authored
135
                                <template slot-scope="scope">
xudada authored
136
                                    <span v-if="scope.row.stype=='MT1201'&&scope.row.awbh==''" style="background-color:#67C23A;width: 100%;height:100%;display:block">
xudada authored
137 138
                                        {{scope.row.awba}}
                                    </span>
xudada authored
139
                                    <span v-else-if="scope.row.stype=='MT1201'&&scope.row.awbh!=''" style="background-color:#409eff;width: 100%;height:100%;display:block;">
xudada authored
140 141
                                        {{scope.row.awba}}
                                    </span>
xudada authored
142
                                    <span v-else-if="scope.row.stype=='MT5201'&&scope.row.awbh==''" style="background-color:#FF8C00;width: 100%;height:100%;display:block;">
xudada authored
143 144
                                        {{scope.row.awba}}
                                    </span>
xudada authored
145
                                    <span v-else-if="scope.row.stype=='MT5201'&&scope.row.awbh!=''" style="background-color:#e6a23c;width: 100%;height:100%;display:block;">
xudada authored
146 147 148
                                        {{scope.row.awba}}
                                    </span>
                                </template>
149 150 151 152 153 154 155 156 157
                            </el-table-column>
                            <el-table-column
                                    prop="awbh"
                                    label="分单号"
                                    width="130">
                            </el-table-column>
                            <el-table-column
                                    prop="piece"
                                    label="件数"
158
                                    width="60">
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
                            </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
179
                                    width="90" :formatter="formatStatus">
180 181 182 183
                            </el-table-column>
                            <el-table-column
                                    label="回执内容"
                                    width="250">
xudada authored
184 185 186 187 188 189 190 191 192 193 194 195 196 197
                                <template slot-scope="scope">
                                    <span v-if="scope.row.status=='01' || scope.row.status=='11'" style="color: #67C23A">
                                        {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.status=='02' || scope.row.status=='03'" style="color: #E6A23C">
                                        {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.status=='12' || scope.row.status=='13'" style="color: #F56C6C">
                                        {{scope.row.ext5}}
                                    </span>
                                    <span v-else style="color: #909399;">
                                        {{scope.row.ext5}}
                                    </span>
                                </template>
198 199 200 201 202 203 204 205 206 207 208 209
                            </el-table-column>
                        </el-table>
                    </template>
                </el-col>
            </el-row>
            <!--分页部分-->
            <el-row>
                <el-col>
                    <div class="block">
                        <el-pagination
                                @size-change="handleSizeChange"
                                @current-change="handleCurrentChange"
210
                                :current-page="currentPage"
211
                                :page-sizes="[100, 200, 300, 400]"
212
                                :page-size="pageSize"
213
                                layout="total, sizes, prev, pager, next, jumper"
214
                                :total="total">
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
                        </el-pagination>
                    </div>
                </el-col>
            </el-row>
        </el-main>
    </el-container>
</template>

<style scoped>
    .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
231 232 233 234
    .mainse{background: #67C23A}
    .fense{background-color: #409eff}
    .tallse{background-color: #FF8C00}
    .tallfense{background-color: #e6a23c}
235 236
    .cell{background: #5BB75B}
    .cell2{background-color: #12B399}
xudada authored
237 238 239
    .el-input-group{
        display: table;
    }
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
</style>
<script>
    import { QueryData } from '../../api/wayDeclaration'
    export default {
        data() {
            return {
                defaultQuery:{
                    awba:'',
                    carrier:'',
                    flightno:'',
                    flightdate:'',
                    status:'',
                    messageType:''
                },
                options: [
                    {
xudada authored
256 257
                    value: '',
                    label: '业务状态'
258
                }, {
xudada authored
259
                    value: '22',
260 261
                    label: '未发送'
                }, {
xudada authored
262
                    value: '23',
263 264
                    label: '已发舱单报'
                }, {
xudada authored
265
                    value: '03',
266 267 268 269 270
                    label: '舱单报退单'
                }],
                options2: [
                    {
                    value: '',
xudada authored
271
                    label: '业务类型'
272 273 274 275 276 277 278 279 280
                }, {
                    value: 'MT1201',
                    label: '原始舱单'
                }, {
                    value: 'MT5201',
                    label: '进港理货'
                }],
                tableData: [],
                multipleSelection: [],
281
                currentPage:1,
xudada authored
282
                pageSize:100,
xudada authored
283 284
                total:0,
                tableloading:false
285 286 287 288 289 290 291 292 293 294
            }
        },
        methods:{
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            handleClick(row) {
                console.log(row);
            },
            handleSizeChange(val) {
295 296
                this.pageSize=val;
                this.QueryData();
297 298
            },
            handleCurrentChange(val) {
299 300
                this.currentPage=val;
                this.QueryData();
301
            },
xudada authored
302 303 304 305 306 307 308
            //状态适配
            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'?'已发送修改报':'';
            },
309 310
            //条件查询方法
            QueryData(){
311 312
                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};
xudada authored
313
                this.tableloading=true;
314
                QueryData(params).then(res =>{
315
                    let response=res.data.data;
xudada authored
316
                    console.log(response)
317 318
                    this.tableData=response.list;
                    this.total=response.total;
xudada authored
319
                    this.tableloading = false;
320 321 322 323
            });
            },
            //点击进入原始页面
            handleClick(row){
xudada authored
324
                this.$router.push({path:'/origmaster',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)}});
325 326
            },
            //点击进入理货页面
327
            handleTally(row){
xudada authored
328
                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)}});
329
            },
330 331 332 333 334 335 336 337 338 339 340
            //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
341 342 343 344 345 346 347 348 349
            },
        computed:{
            vcarrier:{
                get:function () {
                    return this.defaultQuery.carrier;
                },
                set:function (val) {
                    this.defaultQuery.carrier=val.toUpperCase();
                }
350
            }
xudada authored
351
        },
352 353 354

    }
</script>