审查视图

src/views/nmms/ExitLoading.vue 42.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<template>
    <!--<div class="app-container">-->
    <div>
        <div>
            <el-row class="row-bg">
                <el-col :span="24">
                    <div class="grid-content content">航班信息</div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content co">
                        <el-col :span="1">
                            <div class="grid-content"></div>
                        </el-col>
                        <el-col :span="20">
                            <div class="grid-content">
                                <span class="titleSpan">航班号:{{this.loadingQuery.carrier}}{{this.loadingQuery.flightno}}</span>
                                <span class="titleSpan">航班日期:{{this.loadingQuery.flightdate}}</span>
                                <span class="titleSpan">航段:{{this.loadingQuery.originstation}}-{{this.loadingQuery.destinationstation}}</span>
                            </div>
                        </el-col>
                    </div>
                </el-col>
                <el-col :span="24">
24
                    <div class="grid-content content">出港装载查询</div>
25 26 27 28 29 30 31 32 33 34
                </el-col>
                <el-col :span="24">
                    <div class="grid-content co">
                        <el-col :span="1">
                            <div class="grid-content"></div>
                        </el-col>
                        <el-col :span="22">
                            <div class="grid-content">
                                <el-col :span="4">
                                    <div class="grid-content">
王勇 authored
35
                                        <el-input clearable v-model="loadingQuery.awba" placeholder="请输入主单号"></el-input>
36 37 38 39
                                    </div>
                                </el-col>
                                <div class="el-btn">
                                    <el-button type="primary" size="mini" @click="handleSearch">查询</el-button>
40
                                    <el-button v-if="loadingQuery.flightno === undefined && loadingData.length <1"
41 42 43 44 45 46 47 48 49 50 51
                                               type="primary" size="mini" @click="handleAddLoading">新增装载
                                    </el-button>
                                </div>
                            </div>
                        </el-col>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content content" style="margin-top: 6px">出港装载明细</div>
                </el-col>
            </el-row>
朱兆平 authored
52
            <el-table v-loading="listLoading" :data="loadingData" stripe style="font-size: 12px"
53 54
                      border @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="60"></el-table-column>
55
                <el-table-column label="主单号" width="160" align="center">
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
                    <template slot-scope="scope">
                        <span>{{scope.row.awba}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="运载件数" width="70" align="center">
                    <template slot-scope="scope">
                        <span>{{scope.row.lodingpiece}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="运载重量" width="70" align="center">
                    <template slot-scope="scope">
                        <span>{{scope.row.lodingweight}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="货物描述" width="120" align="center">
                    <template slot-scope="scope">
                        <span>{{scope.row.goodsname}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="装载时间" width="150" align="center">
                    <template slot-scope="scope">
                        <span>{{scope.row.loadingtime}}</span>
                    </template>
                </el-table-column>
shenhailong authored
80
                <el-table-column label="状态" width="200" align="center">
81
                    <template slot-scope="scope">
82 83 84
                        <span v-if="scope.row.status ==='01'">接受申报</span>
                        <span v-if="scope.row.status ==='02'">待人工审核</span>
                        <span v-if="scope.row.status ==='03'">退单</span>
85 86 87 88 89 90
                        <span v-if="scope.row.status ==='05'">舱单报退单</span>
                        <span v-if="scope.row.status ==='06'">舱单转人工</span>
                        <span v-if="scope.row.status ==='07'">舱单报申报成功</span>
                        <span v-if="scope.row.status ==='08'">已发舱单删除报</span>
                        <span v-if="scope.row.status ==='09'">舱单删除报退单</span>
                        <span v-if="scope.row.status ==='10'">舱单删除报转人工</span>
91 92 93
                        <span v-if="scope.row.status ==='11'">放行</span>
                        <span v-if="scope.row.status ==='12'">拒装</span>
                        <span v-if="scope.row.status ==='13'">禁卸</span>
94 95 96
                        <span v-if="scope.row.status ==='14'">舱单修改报转人工</span>
                        <span v-if="scope.row.status ==='15'">舱单修改报成功</span>
                        <span v-if="scope.row.status ==='16'">海关已存在</span>
97 98 99 100 101
                        <span v-if="scope.row.status ==='21'">可自动发送</span>
                        <span v-if="scope.row.status ==='22'">未发送</span>
                        <span v-if="scope.row.status ==='23'">已发送新增报</span>
                        <span v-if="scope.row.status ==='24'">已发送删除报</span>
                        <span v-if="scope.row.status ==='25'">已发送修改报</span>
102 103
                    </template>
                </el-table-column>
shenhailong authored
104
                <el-table-column label="回执信息" width="270" align="center">
105 106 107 108
                    <template slot-scope="scope">
                        <span>{{scope.row.ext5}}</span>
                    </template>
                </el-table-column>
109
                <el-table-column label="操作" align="center" fixed="right">
110 111
                    <template slot-scope="scope">
                        <el-button size="mini" @click="handleSend(scope.row)">收发明细</el-button>
112
113
                        <el-button size="mini" type="success" @click="handleEdit(scope.row)" >编辑
114
                        </el-button>
115
116
                        <el-button size="mini" type="primary" @click="handleSendAwb(scope.row)"
117
                                   :disabled="scope.row.status ==='23'">发送出港装载报
118
                        </el-button>
119 120

                        <br><br>
121 122
                        <el-button size="mini" type="danger" v-if="isAdmin" @click="handleAwbDelete(scope.row)">删除运单
                        </el-button>
123
124
                        <el-button size="mini" type="warning" @click="handleAwbStatus(scope.row)"
125
                                   :disabled="scope.row.status ==='22'">更改状态
126
                        </el-button>
127
128
                        <el-button size="mini" type="danger" @click="handleSendDelete(scope.row)"
129 130 131
                                   :disabled="scope.row.status ==='24'">发删除报
                        </el-button>
132 133
                    </template>
                </el-table-column>
134
            </el-table>
135 136 137
            <div class="btnFoot">
                <el-row>
                    <el-button type="primary" size="mini"
138
                               v-if="loadingQuery.flightno !== undefined || loadingData.length >0"
139 140
                               @click="handelAddLoadingInfo">新增出港装载
                    </el-button>
141 142 143 144
                    <el-button type="primary" size="mini"
                               v-if="loadingQuery.flightno !== undefined || loadingData.length>0"
                               @click="handelBackStep">返回
                    </el-button>
145 146
                </el-row>
            </div>
147
            <pagination background layout="total, prev, pager, next" v-show="total>0" :total="total" :page.sync="loadingQuery.pageSize" :limit.sync="loadingQuery.limitSize"
148 149 150 151 152 153 154 155 156 157 158
                        @pagination="getList"/>

            <el-dialog :title="dialogMap[dialogStatus]" :visible.sync="dialogFormVisible">
                <el-form ref="loadingFormData" :model="loadingModel" :rules="loadingRoles" label-position="right"
                         label-width="90px">
                    <div class="grid-content content">
                        <span>航班信息</span>
                    </div>
                    <el-row>
                        <el-col :span="7.5">
                            <el-form-item label="主单号" prop="awba">
159
                                <el-input v-model="loadingModel.awba" :disabled="dialogStatus ==='update'"></el-input>
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
                            <el-form-item label="承运人" prop="carrier">
                                <el-input v-model="carrier" :disabled="dialogStatus ==='update'"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
                            <el-form-item label="航班号" prop="flightno">
                                <el-input v-model="flightno" :disabled="dialogStatus ==='update'"></el-input>
                            </el-form-item>
                        </el-col>

                    </el-row>
                    <el-row>

                        <el-col :span="7.5">
                            <el-form-item label="起始站" prop="originstation">
178
                                <el-select filterable clearable placeholder="请选择起始站" :remote-method="remoteMethodAirport"
179
                                           allow-create v-model="originstation" remote :disabled="dialogStatus ==='update'">
180 181 182 183 184 185 186
                                    <el-option v-for="item in airportCode"
                                               :key="item.airportid" :label="item.airportid"
                                               :value="item.airportid" :disabled="dialogStatus === 'update'">
                                        <span style="float: left">{{ item.airportdescchn }}</span>
                                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
                                    </el-option>
                                </el-select>
187 188 189
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
朱兆平 authored
190
                            <el-form-item label="目的站" prop="destinationstation">
191
                                <el-select filterable clearable placeholder="请选择起始站" :remote-method="remoteMethodAirport"
192
                                           allow-create v-model="destinationstation" remote :disabled="dialogStatus ==='update'">
193 194 195 196 197 198 199
                                    <el-option v-for="item in airportCode"
                                               :key="item.airportid" :label="item.airportid"
                                               :value="item.airportid" :disabled="dialogStatus === 'update'">
                                        <span style="float: left">{{ item.airportdescchn }}</span>
                                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
                                    </el-option>
                                </el-select>
200 201 202 203 204 205 206 207 208 209 210 211 212 213
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
                            <el-form-item label="航班日期" prop="flightdate">
                                <el-date-picker v-model="loadingModel.flightdate" value-format="yyyy-MM-dd" type="date"
                                                placeholder="请输入" :disabled="dialogStatus ==='update'"></el-date-picker>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <div class="grid-content content">
                        <span>货物信息</span>
                    </div>
                    <el-row>
                        <el-col :span="7.5">
朱兆平 authored
214
                            <el-form-item label="装载件数" prop="lodingpiece">
215 216 217 218
                                <el-input v-model.number="loadingModel.lodingpiece"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
朱兆平 authored
219 220
                            <el-form-item label="装载重量" prop="lodingweight">
                                <el-input v-model="loadingModel.lodingweight"></el-input>
221 222 223 224 225 226 227 228 229 230 231 232
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
                            <el-form-item label="装载时间" prop="loadingtime">
                                <el-date-picker v-model="loadingModel.loadingtime" value-format="yyyy-MM-dd HH:mm:ss"
                                                type="datetime"
                                                placeholder="请输入"></el-date-picker>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="7.5">
朱兆平 authored
233 234
                            <el-form-item label="运单件数" prop="awbprice">
                                <el-input v-model.number="loadingModel.awbprice"></el-input>
235 236 237
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
朱兆平 authored
238
                            <el-form-item label="运单重量" prop="awbweight">
zhangFan authored
239
                                <el-input v-model="loadingModel.awbweight"></el-input>
240 241 242 243
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
                            <el-form-item label="海关关区" prop="customcode">
244 245
                                <el-select v-model="loadingModel.customcode"  placeholder="请选择关区代码"
                                           filterable clearable remote :remote-method="remoteMethodCustomCode" :loading="customLoading"
朱兆平 authored
246 247 248
                                           allow-create
                                           default-first-option
                                >
249 250 251 252 253
                                    <el-option v-for="item in customCodeList" :key="item.customcode" :label="item.customcode"
                                               :value="item.customcode">
                                        <span style="float: left">{{ item.customcode }}</span>
                                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.customname }}</span>
                                    </el-option>
254 255 256 257 258 259
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="7.5">
朱兆平 authored
260
                            <el-form-item label="特货代码" prop="specialgoods">
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
                                <el-input v-model="loadingModel.specialgoods"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7.5">
                            <el-form-item label="货物描述" prop="goodsname">
                                <el-input v-model="goodsname" placeholder="请输入"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="dialogFormVisible = false">取消</el-button>
                    <el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">保存</el-button>
                </div>
            </el-dialog>
            <el-dialog title="收发明细" :visible.sync="dialogTableVisible">
                <el-table :data="detailData" border>
278
                    <el-table-column label="操作时间" width="180">
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
                        <template slot-scope="scope">
                            {{scope.row.busdate}}
                        </template>
                    </el-table-column>
                    <el-table-column label="航班号" width="80">
                        <template slot-scope="scope">
                            {{scope.row.carrier}}{{scope.row.flightno}}
                        </template>
                    </el-table-column>
                    <el-table-column label="航班日期" width="100">
                        <template slot-scope="scope">
                            {{scope.row.flightdate}}
                        </template>
                    </el-table-column>
                    <el-table-column label="件数" width="70">
                        <template slot-scope="scope">
                            {{scope.row.buspiece}}
                        </template>
                    </el-table-column>
                    <el-table-column label="重量" width="70">
                        <template slot-scope="scope">
                            {{scope.row.busweight}}
                        </template>
                    </el-table-column>
                    <el-table-column label="回执信息" width="">
                        <template slot-scope="scope">
                            {{scope.row.cusrestext}}
                        </template>
                    </el-table-column>
308 309 310 311 312
                    <el-table-column label="操作类型" width="100">
                        <template slot-scope="scope">
                            {{scope.row.opertype}}
                        </template>
                    </el-table-column>
313 314
                    <el-table-column label="操作人" width="100">
                        <template slot-scope="scope">
315
                            {{scope.row.operusername}}
316 317 318 319
                        </template>
                    </el-table-column>
                </el-table>
            </el-dialog>
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340
            <el-dialog title="删除原因" :visible.sync="dialogDeleteVisible" width="30%">
                <el-form ref="loadingDeleteForm" :model="respModel" :rules="loadingDeleteRules"
                         label-width="120px" style="margin-right: 50px">
                    <el-form-item label="删除原因" prop="reason">
                        <el-input v-model="respModel.reason" placeholder="删除原因"></el-input>
                    </el-form-item>
                    <el-form-item label="删除操作人" prop="contactName">
                        <el-input v-model="respModel.contactName" placeholder="操作人姓名"></el-input>
                    </el-form-item>
                    <el-form-item label="操作人Tel" prop="contactTel">
                        <el-input v-model="respModel.contactTel" placeholder="删除操作人联系方式"></el-input>
                    </el-form-item>
                    <el-form-item label="备注">
                        <el-input v-model="respModel.content" type="textarea"></el-input>
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="dialogDeleteVisible = false">取消</el-button>
                    <el-button type="primary" @click="sendLoadingDelete()">发送</el-button>
                </div>
            </el-dialog>
341 342 343 344 345
        </div>
    </div>
</template>
<script>
    import Pagination from '@/components/Pagination'
346 347 348
    import {getCustomCode,getAirportCode} from "@/api/country";
    import {
        getMt4201ListForParam, deleteByIsDelete, updateStatus,
349
        updateMT4201, addMt4201, sendCreateMt4201, sendDeleteMt4201, test
350
    } from '@/api/exitLoading'
351
    import {Message} from "element-ui"
352 353 354 355 356
    import {
        validAwb,
        validAlphabets,
        validAlphabetsAndNum,
        validAlphabetsAndSpanceKey,
朱兆平 authored
357 358
        validatorNum,
        validatorCustomsNum
359
    } from "@/utils/validate"
360
    import {getResponseForParam} from '@/api/responseDetail'
361 362
    export default {
        name: "ExitLoading",
363
        components: { Pagination},
364 365 366 367
        inject: ['reload'],
        data() {
            const validatorAwb = (rule, value, callback) => {
                if (!validAwb(value)) {
朱兆平 authored
368
                    callback("请正确书写主单号格式为xxx-xxxxxxxx")
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383
                }
                callback()
            }
            const validatorAwbh = (rule, value, callback) => {
                if (!validAlphabetsAndNum(value)) {
                    callback("只能输入字母和数字")
                }
                callback()
            }
            const validatorAlphabets = (rule, value, callback) => {
                if (!validAlphabets(value)) {
                    callback("只能输入字母")
                }
                callback()
            }
384 385
            const validAlphabetsSpanceKey = (rule, value, callback) => {
                if (!validAlphabetsAndSpanceKey(value)) {
386 387 388 389
                    callback("只能输入字母、数字、空格")
                }
                callback()
            }
zhangFan authored
390 391 392 393 394 395
            const validatorNums = (rule, value, callback) => {
                if (!validatorNum(value)) {
                    callback("只能输入数字,并且小数位最多两位")
                }
                callback()
            }
朱兆平 authored
396 397 398 399 400 401
            const validatorCustomsNums = (rule, value, callback) => {
                if (!validatorCustomsNum(value)) {
                    callback(new Error("只能输入4位数字"))
                }
                callback()
            }
402
            return {
403
                total: 0,
404
                isAdmin: false,
405 406 407 408
                dialogMap: {
                    update: '编辑出港装载',
                    create: '添加出港装载',
                },
409 410
                customCodeList: [],
                airportCode:[],
411 412 413
                dialogStatus: undefined,
                dialogTableVisible: false,
                dialogFormVisible: false,
414
                dialogDeleteVisible: false,
415
                customLoading: false,
416 417 418
                listLoading: false,
                loadingQuery: {
                    pageSize: 1,
419
                    limitSize: 10,
420 421 422 423 424 425
                    awba: undefined,
                    carrier: undefined,
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
426 427
                    customcode: undefined,
                    messageType: undefined
428 429 430 431 432 433 434
                },
                loadingRoles: {
                    awba: [{required: true, trigger: 'blur', validator: validatorAwb}],
                    awbh: [{required: true, trigger: 'blur', validator: validatorAwbh}],
                    goodsname: [{required: true, trigger: 'blur', validator: validAlphabetsSpanceKey}],
                    carrier: [{required: true, trigger: 'blur', validator: validatorAwbh}],
                    flightno: [{required: true, trigger: 'blur', validator: validatorAwbh}],
朱兆平 authored
435 436
                    flightdate: [{required: true, trigger: 'blur'}],
                    loadingtime: [{required: true, trigger: 'blur'}],
437 438
                    originstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}],
                    destinationstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}],
朱兆平 authored
439 440 441 442 443 444
                    lodingpiece: [{type: 'number',required: true, trigger: 'change', message: '只能输入数字'}],
                    lodingweight: [{required: true, trigger: 'change', message: '只能输入数字,并且小数位最多两位',validator: validatorNums}],
                    customcode: [
                        {required: true, message: '关区号不能为空'},
                        {validator: validatorCustomsNums,trigger: 'change',message: '关区号为4位整数'}
                    ]
445 446 447 448
                },
                loadingData: [],
                detailData: [],
                loadingModel: {
449
                    carrier: undefined,
450 451 452 453 454 455 456 457 458 459 460 461 462
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    awba: undefined,
                    lodingpiece: undefined,
                    lodingweight: undefined,
                    goodsname: undefined,
                    customcode: undefined,
                    specialgoods: undefined,
                    loadingtime: undefined,
                    messageType: 'MT4201',
                    awbprice: undefined,
463 464 465 466 467
                    awbweight: undefined,
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: undefined,
468 469 470
                    user: {
                        username : JSON.parse(sessionStorage.getItem('user')).username
                    }
471 472 473 474 475 476 477 478 479 480 481
                },
                respModel: {
                    uuid: undefined,
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: '',
                    flightNo: undefined,
                    awba: undefined,
                    customCode: undefined,
                    flightDate: undefined,
482
                    awbh: '',
483 484 485 486 487 488
                },
                loadingDeleteRules: {
                    reason: [{required: true, message: '删除原因不能为空', trigger: 'blur'}],
                    contactName: [{required: true, message: '删除操作人不能为空', trigger: 'blur'}],
                    contactTel: [{required: true, message: '操作人联系方式不能为空', trigger: 'blur'}]
                },
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
            }
        },
        created() {
            if (this.$route.params.flightData !== undefined) {
                // 给查询条件赋值
                if (this.$route.params.flightData.awba !== undefined && this.$route.params.flightData.awba !== '') {
                    this.loadingQuery.awba = this.$route.params.flightData.awba.substring(0, 3) + '-' + this.$route.params.flightData.awba.substring(3)
                }
                this.loadingQuery.carrier = this.$route.params.flightData.flightno.substring(0, 2)
                this.loadingQuery.flightno = this.$route.params.flightData.flightno.substring(2)
                this.loadingQuery.flightdate = this.$route.params.flightData.flightdate
                this.loadingQuery.originstation = this.$route.params.flightData.originstation
                this.loadingQuery.destinationstation = this.$route.params.flightData.destinationstation
                this.getList()
            }
zhangFan authored
504
            let username = JSON.parse(sessionStorage.getItem('user')).username
505
            if (username === 'admin') {
zhangFan authored
506 507
                this.isAdmin = true
            }
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
        },
        computed: {
            carrier: {
                get: function () {
                    return this.loadingModel.carrier
                },
                set: function (val) {
                    this.loadingModel.carrier = val.toUpperCase().trim()
                }
            },
            goodsname: {
                get: function () {
                    return this.loadingModel.goodsname
                },
                set: function (val) {
                    this.loadingModel.goodsname = val.toUpperCase().trim()
                }
            },
            flightno: {
                get: function () {
                    return this.loadingModel.flightno
                },
                set: function (val) {
                    this.loadingModel.flightno = val.toUpperCase().trim()
                }
            },
            originstation: {
                get: function () {
                    return this.loadingModel.originstation
                },
                set: function (val) {
                    this.loadingModel.originstation = val.toUpperCase().trim()
                }
            },
            destinationstation: {
                get: function () {
                    return this.loadingModel.destinationstation
                },
                set: function (val) {
                    this.loadingModel.destinationstation = val.toUpperCase().trim()
                }
            }
        },
        methods: {
552 553 554


555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
            getList() {
                this.listLoading = true
                if (this.loadingQuery.awba !== undefined && this.loadingQuery.awba !== '') {
                    getMt4201ListForParam(this.loadingQuery).then(res => {
                        this.loadingData = res.data.dataList
                        this.total = res.data.count
                        if (res.data.count > 0) {
                            this.loadingQuery.carrier = this.loadingData[0].carrier
                            this.loadingQuery.flightno = this.loadingData[0].flightno
                            this.loadingQuery.flightdate = this.loadingData[0].flightdate
                            this.loadingQuery.originstation = this.loadingData[0].originstation
                            this.loadingQuery.destinationstation = this.loadingData[0].destinationstation
                            this.loadingQuery.customcode = this.loadingData[0].customcode
                        }
                        setTimeout(() => {
                            this.listLoading = false
                        }, 1.5 * 1000)
                    })
                } else {
                    getMt4201ListForParam(this.loadingQuery).then(res => {
                        this.loadingData = res.data.dataList
                        this.total = res.data.count
                        setTimeout(() => {
                            this.listLoading = false
                        }, 1.5 * 1000)
                    })
                }

            },
            // 多选
            handleSelectionChange() {

            },
            // 查询
            handleSearch() {
王勇 authored
590 591 592 593 594
                // this.loadingQuery.carrier = undefined
                // this.loadingQuery.flightno = undefined
                // this.loadingQuery.originstation = undefined
                // this.loadingQuery.flightdate = undefined
                // this.loadingQuery.destinationstation = undefined
595 596 597
                this.getList()
            },
            // 收发明细
598
            handleSend(row) {
599 600 601 602
                const resQuery = {
                    carrier: row.carrier,
                    flightNo: row.flightno,
                    flightDate: row.flightdate,
603
                    opertype: row.opertype,
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623
                    awba: row.awba,
                    awbh: row.awbh,
                    messageType: 'MT4201'
                }
                this.dialogTableVisible = true
                getResponseForParam(resQuery).then(res => {
                    this.detailData = res.data
                })
            },
            // 编辑 弹框
            handleEdit(row) {
                this.loadingModel = Object.assign({}, row)
                this.dialogStatus = 'update'
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.loadingFormData.clearValidate()
                })
            },
            // 更新数据
            updateData() {
624
                let _this = this;
625 626
                this.$refs.loadingFormData.validate(valid => {
                    if (valid) {
627 628 629
                        _this.loadingModel.user= {
                            username : JSON.parse(sessionStorage.getItem('user')).username
                        }
630 631 632 633 634 635 636 637 638 639 640 641 642 643
                        updateMT4201(this.loadingModel).then(res => {
                            if (res.data.count > 0) {
                                this.dialogFormVisible = false
                                Message.success("数据更新成功")
                                this.getList()
                            } else {
                                Message.error("数据更新失败,请检查数据")
                            }
                        })
                    }
                })
            },

            // 发送舱单报
644
            handleSendAwb(row) {
645
646 647 648 649 650 651 652 653
                this.$confirm("是否发送", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '发送',
                    cancelButtonText: '取消'
                }).then(() => {
                    if(row.awbh === null || row.awbh === undefined){
                        row.awbh = ''
                    }
654 655 656
                    row.user = {
                        username : JSON.parse(sessionStorage.getItem('user')).username
                    }
657 658 659 660 661 662 663 664 665 666 667
                    sendCreateMt4201(row).then(res => {
                        if (res.data.count > 0) {
                            Message.success(res.data.respMessage)
                            this.getList()
                        }else {
                            Message.success(res.data.respMessage)
                        }
                    })
                }).catch(error =>{
                    Message.error(error.message)
                })
668
            },
669 670 671 672

            // 发送删除报
            handleSendDelete(row) {
                this.respModel = {
673
                    carrier: undefined,
674 675 676 677 678 679 680 681
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: '',
                    flightNo: undefined,
                    awba: undefined,
                    customCode: undefined,
                    flightDate: undefined,
682 683
                    awbh: '',
                    username: JSON.parse(sessionStorage.getItem('user')).username,
684 685
                }
                this.dialogDeleteVisible = true
686 687
                this.respModel.carrier = row.carrier
                this.respModel.flightNo = row.flightno
688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716
                this.respModel.awba = row.awba
                this.respModel.customCode = row.customcode
                this.respModel.flightDate = row.flightdate
                if(row.awbh ===null){
                    this.respModel.awbh = ''
                }else {
                    this.respModel.awbh = row.awbh
                }
                this.$nextTick(() => {
                    this.$refs.loadingDeleteForm.clearValidate()
                })
            },

            sendLoadingDelete() {
                this.$refs.loadingDeleteForm.validate(valid => {
                    if (valid) {
                        sendDeleteMt4201(this.respModel).then(res => {
                            if (res.data.count > 0) {
                                Message.success(res.data.respMessage)
                                this.dialogDeleteVisible = false
                                this.getList()
                            } else {
                                Message.success(res.data.respMessage)
                            }
                        })
                    }
                })
            },
            // 删除
717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752
            handleAwbDelete(row) {
                this.$confirm("是否删除", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '删除',
                    cancelButtonText: '取消'
                }).then(() => {
                    deleteByIsDelete(row).then(res => {
                        if (res.data.count > 0) {
                            this.$message({
                                type: 'success',
                                message: '删除成功'
                            })
                            this.getList()
                        } else {
                            this.$message({
                                type: 'danger',
                                message: '删除异常,请稍后重试'
                            })
                        }
                    })
                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消删除'
                            : '删除取消'
                    })
                })
            },
            // 更改当前运单发送状态
            handleAwbStatus(row) {
                this.$confirm("是否发送更改状态", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '确认更改',
                    cancelButtonText: '取消更改'
                }).then(() => {
753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769
                    if (row.status!==22){
                        row.status =22;
                    }
                    // updateStatus(row).then(res => {
                    //     if (res.data.count > 0) {
                    //         this.$message({
                    //             type: 'success',
                    //             message: '当前运单状态已更改'
                    //         })
                    //         this.getList()
                    //     } else {
                    //         this.$message({
                    //             type: 'error',
                    //             message: '状态更改失败,请稍后重试'
                    //         })
                    //     }
                    // })
770 771 772 773 774 775 776 777 778 779 780 781 782

                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消状态更改'
                            : '状态更改取消'
                    })
                })
            },
            // 重置实体
            restModel() {
                this.loadingModel = {
783
                    carrier: undefined,
784 785 786 787 788 789 790 791 792 793 794 795 796
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    awba: undefined,
                    lodingpiece: undefined,
                    lodingweight: undefined,
                    goodsname: undefined,
                    customcode: undefined,
                    specialgoods: undefined,
                    loadingtime: undefined,
                    messageType: 'MT4201',
                    awbprice: undefined,
797 798 799 800
                    awbweight: undefined,
                    user: {
                        username : JSON.parse(sessionStorage.getItem('user')).username,
                    }
801 802 803 804 805 806 807 808 809 810 811 812 813 814
                }
            },
            // 新增出港装载 弹框
            handelAddLoadingInfo() {
                this.restModel()
                // 给model赋值,所使用数据是以单独单号查询数据所得
                this.loadingModel.carrier = this.loadingQuery.carrier
                this.loadingModel.flightdate = this.loadingQuery.flightdate
                this.loadingModel.flightno = this.loadingQuery.flightno
                this.loadingModel.originstation = this.loadingQuery.originstation
                this.loadingModel.destinationstation = this.loadingQuery.destinationstation
                this.loadingModel.customcode = this.loadingQuery.customcode
                this.dialogStatus = 'create'
                this.dialogFormVisible = true
815
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835
                this.$nextTick(() => {
                    this.$refs.loadingFormData.clearValidate()
                })
            },
            // 新增出港装载 请求
            createData() {
                this.$refs.loadingFormData.validate(valid => {
                    if (valid) {
                        addMt4201(this.loadingModel).then(res => {
                            if (res.data.count > 0) {
                                this.dialogFormVisible = false
                                Message.success("新增出港装载成功")
                                this.getList()
                            } else {
                                Message.error("数据新增失败,请检查数据")
                            }
                        })
                    }
                })
            },
836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851
            //获取机场三字码
            remoteMethodAirport(query){
                this.airportCode = []
                if (query !== '') {
                    this.listLoading = true
                    getAirportCode({airportid: query}).then(res => {
                        if(res !== null){
                            setTimeout(() => {
                                this.listLoading = false
                                this.airportCode = res.data.data
                            }, 200)
                        }
                    })
                } else {
                    this.airportCode = []
                }
852
            },
853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868
            //关区代码
            remoteMethodCustomCode(query){
                this.customCodeList = []
                if (query !== '') {
                    this.customLoading = true
                    getCustomCode({customcode: query}).then(res => {
                        if(res !== null){
                            setTimeout(() => {
                                this.customLoading = false
                                this.customCodeList = res.data.data
                            }, 200)
                        }
                    })
                } else {
                    this.airportCode = []
                }
869
            },
870 871 872 873 874 875 876
            handleAddLoading() {
                const row = {
                    'messageType': 'MT4201'
                }
                this.$router.push({name: '出港航班信息', params: {scopeRow: row}})
            },
            handelBackStep() {
877 878
                this.loadingQuery.messageType = 'MT4201'
                this.$router.push({name: '出港航班信息', params: {scopeRow: this.loadingQuery}})
879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923
            }
        }
    }

</script>
<style>
    .grid-content {
        height: 36px;
        line-height: 36px;
    }

    .content {
        border-left: 4px #409EFF solid;
        padding-left: 10px;
        background-color: #f9fafc;
        margin-bottom: 2px
    }

    .row-bg, .co {
        background-color: white;
    }

    .titleSpan {
        font-weight: bold;
        margin-right: 35px;
    }

    .el-row {
        margin-top: 10px;
        margin-bottom: 0px;
    }

    .btnFoot {
        margin-top: 10px;
    }

    .el-table td, .el-table th {
        text-align: center
    }

    .el-btn {
        margin-left: 10px;
        display: inline-block;
    }
</style>