审查视图

src/views/nmms/ExitArrive.vue 44.5 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
<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.arriveQuery.carrier}}{{this.arriveQuery.flightno}}</span>
                                <span class="titleSpan">航班日期:{{this.arriveQuery.flightdate}}</span>
                                <span class="titleSpan">航段:{{this.arriveQuery.originstation}}-{{this.arriveQuery.destinationstation}}</span>
                            </div>
                        </el-col>
                    </div>
                </el-col>
                <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="22">
                            <div class="grid-content">
                                <el-col :span="4">
                                    <div class="grid-content">
35 36 37
                                        <el-input v-model="awba" clearable placeholder="请输入主单号">
                                            <template slot="prepend">主单号</template>
                                        </el-input>
38 39 40
                                    </div>
                                </el-col>
                                <div class="grid-content el-btn">
41
                                    <el-button type="primary"  @click="handleSerach">查询</el-button>
42
                                    <el-button v-if="arriveQuery.flightno ===undefined && arriveData.length<1"
43
                                               type="primary"
44 45 46 47 48 49 50 51 52 53 54 55
                                               @click="handleAddArrive">新增运抵
                                    </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>
        </div>
56 57 58 59 60 61 62 63
        <el-table v-loading="listLoading" :data="arriveData" stripe
                  style="font-size: 12px" border @selection-change="handleSelectionChange"
                    default-expand-all
                    row-key="uuid"
                    border
                    :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
            <el-table-column type="selection" width="55">
            </el-table-column>
64
            <el-table-column label="航班号" width="110" align="center">
65 66 67 68
                <template slot-scope="scope">
                    <span>{{scope.row.carrier}}{{scope.row.flightno}}</span>
                </template>
            </el-table-column>
69
            <el-table-column label="运单号" width="110" align="center">
70
                <template slot-scope="scope">
71 72 73
<!--                    <span>{{scope.row.awba}}</span>-->
                    <a type="text" style="color: #409eff;text-decoration: underline" class="tableInline" @click="handleEdit(scope.row)" v-if="scope.row.awbh !==''">{{scope.row.awbh}}</a>
                    <a type="text" style="color: #409eff;text-decoration: underline" class="tableInline" @click="handleEdit(scope.row)" v-else>{{scope.row.awba}}</a>
74 75
                </template>
            </el-table-column>
76 77 78 79 80
<!--            <el-table-column label="分单号" width="120" align="center">-->
<!--                <template slot-scope="scope">-->
<!--                    <span>{{scope.row.awbh}}</span>-->
<!--                </template>-->
<!--            </el-table-column>-->
81 82 83 84 85 86 87 88 89 90
            <el-table-column label="运抵件数" width="70" align="center">
                <template slot-scope="scope">
                    <span>{{scope.row.piece}}</span>
                </template>
            </el-table-column>
            <el-table-column label="运抵重量" width="70" align="center">
                <template slot-scope="scope">
                    <span>{{scope.row.weight}}</span>
                </template>
            </el-table-column>
91
            <el-table-column label="货物描述" width="120" style="height: 20px" align="center">
92 93 94 95
                <template slot-scope="scope">
                    <span>{{scope.row.goodsname}}</span>
                </template>
            </el-table-column>
96
            <el-table-column label="运抵时间" width="150" align="center">
97 98 99 100 101 102
                <template slot-scope="scope">
                    <span>{{scope.row.arrivetime}}</span>
                </template>
            </el-table-column>
            <el-table-column label="状态" width="100" align="center">
                <template slot-scope="scope">
103 104 105
                    <span v-if="scope.row.status ==='01'">接受申报</span>
                    <span v-if="scope.row.status ==='02'">待人工审核</span>
                    <span v-if="scope.row.status ==='03'">退单</span>
106 107 108 109 110 111
                    <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>
112 113 114
                    <span v-if="scope.row.status ==='11'">放行</span>
                    <span v-if="scope.row.status ==='12'">拒装</span>
                    <span v-if="scope.row.status ==='13'">禁卸</span>
115 116 117
                    <span v-if="scope.row.status ==='14'">舱单修改报转人工</span>
                    <span v-if="scope.row.status ==='15'">舱单修改报成功</span>
                    <span v-if="scope.row.status ==='16'">海关已存在</span>
118 119 120 121 122
                    <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>
123 124
                </template>
            </el-table-column>
125
            <el-table-column prop="receipt" label="回执信息"  align="center">
126 127 128 129
                <template slot-scope="scope">
                    <span>{{scope.row.ext5}}</span>
                </template>
            </el-table-column>
王勇 authored
130
            <el-table-column prop="operation" fixed="right" label="操作" align="center" width="400">
131
                <template slot-scope="scope">
132 133 134
                    <el-button  @click="handleSendDesc(scope.row)">收发明细</el-button>
<!--                    <el-button  type="success" @click="handleEdit(scope.row)">编辑</el-button>-->
                    <el-button  type="primary" @click="handleSendAwb(scope.row)"
135
                               :disabled="scope.row.status ==='23'">发送出港运抵报
136 137
                    </el-button>
                    <p></p>
138
                    <el-button  type="danger" v-if="isAdmin" @click="handleAwbDelete(scope.row)">删除运单
139
                    </el-button>
140
                    <el-button  type="warning" @click="handleAwbStatus(scope.row)"
141 142
                               :disabled="scope.row.status ==='22'">更改状态
                    </el-button>
143
                    <el-button type="primary" v-if="scope.row.awbh ===''"
144 145
                               @click="handleAddAwbh(scope.row)">新增分单
                    </el-button>
146
                    <el-button  type="danger" @click="handleSendDelete(scope.row)"
147 148
                               :disabled="scope.row.status ==='24'">发删除报
                    </el-button>
149 150
                </template>
            </el-table-column>
151
        </el-table>
152 153
        <div class="btnFoot">
            <el-row>
154
                <el-button type="primary"  v-if="arriveQuery.flightno !==undefined || arriveData.length>0"
155 156
                           @click="handelAddArriveInfo">新增出港运抵
                </el-button>
157
                <el-button type="primary"  v-if="arriveQuery.flightno !== undefined || arriveData.length>0"
158 159 160 161
                           @click="handelBackStep">返回
                </el-button>
            </el-row>
        </div>
162
        <pagination  background layout="total, prev, pager, next" v-show="total>0" :total="total" :page.sync="arriveQuery.pageSize"
163 164 165 166 167 168 169 170 171 172
                    :limit.sync="arriveQuery.limitSize"
                    @pagination="getList"/>
        <el-dialog :title="dialogMap[dialogStatus]" :visible.sync="dialogFormVisible">
            <el-form ref="arriveFormData" :model="arriveModel" :rules="arriveRoles" label-position="right"
                     label-width="90px">
                <div class="grid-content content">
                    <span>航班信息</span>
                </div>
                <el-row>
                    <el-col :span="7.5">
173 174
                        <el-form-item label="主单号" prop="awba" >
                            <el-input v-model="arriveModel.awba" :disabled="dialogStatus === 'update'"></el-input>
175 176
                        </el-form-item>
                    </el-col>
177
                    <el-col :span="7.5" v-if="fenStatus === 'addAwbh'">
178 179 180 181 182 183 184 185 186 187 188 189
                        <el-form-item label="分单号" prop="awbh">
                            <el-input v-model="awbh"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <div class="grid-content content">
                    <span>航班信息</span>
                </div>
                <el-row>
                    <el-col :span="7.5">
                        <el-form-item label="承运人" prop="carrier">
                            <el-input v-model="carrier"
190
                                      :disabled="fenStatus === 'addAwbh'"></el-input>
191 192 193 194 195
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
                        <el-form-item label="航班号" prop="flightno">
                            <el-input v-model="flightno"
196
                                      :disabled="fenStatus === 'addAwbh'"></el-input>
197 198 199 200 201 202
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
                        <el-form-item label="航班日期" prop="flightdate">
                            <el-date-picker v-model="arriveModel.flightdate" value-format="yyyy-MM-dd" type="date"
                                            placeholder="请输入"
203
                                            :disabled="fenStatus === 'addAwbh'"></el-date-picker>
204 205 206 207 208 209
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="7.5">
                        <el-form-item label="起始站" prop="originstation">
210 211
                            <el-select filterable clearable placeholder="请选择起始站" :remote-method="remoteMethodAirport"
                                       allow-create v-model="originstation" remote>
212 213 214 215 216 217 218
                                <el-option v-for="item in airportCode"
                                           :key="item.airportid" :label="item.airportid"
                                           :value="item.airportid" :disabled="dialogFormVisible === 'update'">
                                    <span style="float: left">{{ item.airportdescchn }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
                                </el-option>
                            </el-select>
219 220 221 222
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
                        <el-form-item label="目的站" prop="destinationstation">
223 224
                            <el-select filterable clearable placeholder="请选择起始站" :remote-method="remoteMethodAirport"
                                       allow-create v-model="destinationstation" remote>
225 226 227 228 229 230 231
                                <el-option v-for="item in airportCode"
                                           :key="item.airportid" :label="item.airportid"
                                           :value="item.airportid" :disabled="dialogFormVisible === 'update'">
                                    <span style="float: left">{{ item.airportdescchn }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
                                </el-option>
                            </el-select>
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
                        </el-form-item>
                    </el-col>
                </el-row>
                <div class="grid-content content">
                    <span>货物信息</span>
                </div>
                <el-row>
                    <el-col :span="7.5">
                        <el-form-item label="运抵件数" prop="piece">
                            <el-input v-model.number="arriveModel.piece"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
                        <el-form-item label="运抵重量" prop="weight">
                            <el-input v-model.number="arriveModel.weight"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
                        <el-form-item label="运抵时间" prop="arrivetime">
                            <el-date-picker v-model="arriveModel.arrivetime" 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">
                        <el-form-item label="货物描述" prop="goodsname">
                            <el-input v-model="goodsname" placeholder="请输入"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
                        <el-form-item label="海关关区" prop="customcode">
265
                            <el-select v-model="arriveModel.customcode" placeholder="请选择关区代码" :loading="customLoading"
266
                                       filterable clearable remote :remote-method="remoteMethodCustomCode"
267
                                       :disabled="dialogStatus === 'addAwbh'">
268 269
                                <el-option v-for="item in customCodeList" :key="item.customcode"
                                           :label="item.customcode"
270 271 272 273
                                           :value="item.customcode">
                                    <span style="float: left">{{ item.customcode }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.customname }}</span>
                                </el-option>
274 275 276 277 278 279 280 281 282 283 284 285
                            </el-select>
                        </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>
286
                <el-table-column label="操作时间" width="180">
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
                    <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>
316 317 318 319 320
                <el-table-column label="操作类型" width="100">
                    <template slot-scope="scope">
                        {{scope.row.opertype}}
                    </template>
                </el-table-column>
321 322
                <el-table-column label="操作人" width="100">
                    <template slot-scope="scope">
323
                        {{scope.row.operusername}}
324 325 326 327
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
        <el-dialog title="删除原因" :visible.sync="dialogDeleteVisible" width="30%">
            <el-form ref="arriveDeleteForm" :model="respModel" :rules="arriveDeleteRules"
                     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="sendArriveDelete()">发送</el-button>
            </div>
        </el-dialog>
349 350 351 352 353 354
    </div>
</template>
<script>
    import treeTable from '@/components/TreeTable'
    import treeToArray from '@/utils/customEval'
    import Pagination from '@/components/Pagination'
355
    import {getCustomCode, getAirportCode} from "@/api/country";
356 357 358 359 360 361 362 363 364
    import {
        getMt3201ListForParam,
        deleteByIsDelete,
        updateStatus,
        updateMT3201,
        addMt3201,
        sendCreateMt3201,
        sendRemoveMt3201
    } from '@/api/exitArrive'
365
    import {Message} from "element-ui";
366 367 368 369 370 371 372
    import {
        validAwb,
        validAlphabets,
        validAlphabetsAndNum,
        validAlphabetsAndSpanceKey,
        validatorNum
    } from "@/utils/validate";
373 374
    import {getResponseForParam} from '@/api/responseDetail';
    import loginUserInfo from '../../api/base';
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398

    export default {
        name: "ExitArrive",
        components: {treeTable, Pagination},
        inject: ['reload'],
        data() {
            const validatorAwb = (rule, value, callback) => {
                if (!validAwb(value)) {
                    callback("请正确书写主单号")
                }
                callback()
            }
            const validatorAwbh = (rule, value, callback) => {
                if (!validAlphabetsAndNum(value)) {
                    callback("只能输入字母和数字")
                }
                callback()
            }
            const validatorAlphabets = (rule, value, callback) => {
                if (!validAlphabets(value)) {
                    callback("只能输入字母")
                }
                callback()
            }
399 400
            const validAlphabetsSpanceKey = (rule, value, callback) => {
                if (!validAlphabetsAndSpanceKey(value)) {
401 402 403 404
                    callback("只能输入字母、数字、空格")
                }
                callback()
            }
zhangFan authored
405 406 407 408 409 410
            const validatorNums = (rule, value, callback) => {
                if (!validatorNum(value)) {
                    callback("只能输入数字,并且小数位最多两位")
                }
                callback()
            }
411 412 413
            return {
                func: treeToArray,
                total: 1,
zhangFan authored
414
                isAdmin: false,
415 416
                arriveQuery: {
                    pageSize: 1,
417
                    limitSize: 10,
418 419 420 421 422 423
                    awba: undefined,
                    carrier: undefined,
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
424 425
                    customcode: undefined,
                    messageType: undefined,
426 427 428 429 430 431 432
                },
                dialogMap: {
                    update: '编辑出港运抵',
                    create: '添加出港运抵',
                },
                dialogTableVisible: false,
                multipleSelection: [],
433
                customCodeList: [],
434
                airportCode: [],
435 436
                dialogStatus: undefined,
                awbhStatus: false,
437
                fenStatus: undefined,
438
                dialogFormVisible: false,
439
                dialogDeleteVisible: false,
440
                listLoading: false,
441
                customLoading: false,
442 443 444
                arriveRoles: {
                    awba: [{required: true, trigger: 'blur', validator: validatorAwb}],
                    awbh: [{required: true, trigger: 'blur', validator: validatorAwbh}],
445 446 447 448
                    goodsname: [
                        {required: true, trigger: 'blur', message:'货物描述不能为空'},
                        {required: true, trigger: 'blur', validator: validAlphabetsSpanceKey}
                    ],
449 450 451 452
                    carrier: [{required: true, trigger: 'blur', validator: validatorAwbh}],
                    flightno: [{required: true, trigger: 'blur', validator: validatorAwbh}],
                    originstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}],
                    destinationstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}],
zhangFan authored
453 454
                    weight: [{required: true, trigger: 'change', validator: validatorNums}],
                    piece: [{required: true, trigger: 'change', validator: validatorNums}],
455 456
                    arrivetime: [{required: true, trigger: 'blur', message:'请选择运抵时间'}],
                    customcode: [{required: true, trigger: 'blur', message:'海关关区不能为空'}],
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472
                },
                arriveData: [],
                detailData: [],
                arriveModel: {
                    carrier: undefined,
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    awba: undefined,
                    awbh: undefined,
                    piece: undefined,
                    weight: undefined,
                    goodsname: undefined,
                    customcode: undefined,
                    arrivetime: undefined,
473 474
                    messageType: 'MT3201',
                    user :{
475
                        username : loginUserInfo.username
476
                    }
477 478 479 480 481 482 483 484 485 486 487 488 489 490
                },
                respModel: {
                    uuid: undefined,
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: '',
                    flightNo: undefined,
                    awba: undefined,
                    customCode: undefined,
                    flightDate: undefined,
                    awbh: ''
                },
                arriveDeleteRules: {
491 492 493 494 495 496 497 498 499 500 501 502 503 504
                    reason:[{required:true,message:'原因不能为空',trigger:'blur'}],
                    contactName:[{required:true,message:'操作人不能为空',trigger:'blur'}],
                    contactTel:[
                        { required: true, message: '手机号不能为空', trigger: 'blur' },
                        { type: 'number', message: '手机号格式不正确', trigger: 'blur',
                            transform(value){
                                var phone = 11 && /^((13|14|15|16|17|18|19)[0-9]{1}\d{8})$/
                                if (!phone.test(value)){
                                    return false;
                                }else {
                                    return Number(value);
                                }
                            }}
                    ],
505
                },
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
            }
        },
        created() {
            if (this.$route.params.flightData !== undefined) {
                // 给查询条件赋值
                if (this.$route.params.flightData.awba !== undefined && this.$route.params.flightData.awba !== '') {
                    this.arriveQuery.awba = this.$route.params.flightData.awba.substring(0, 3) + "-" + this.$route.params.flightData.awba.substring(3)
                }
                this.arriveQuery.carrier = this.$route.params.flightData.flightno.substring(0, 2)
                this.arriveQuery.flightno = this.$route.params.flightData.flightno.substring(2)
                this.arriveQuery.flightdate = this.$route.params.flightData.flightdate
                this.arriveQuery.originstation = this.$route.params.flightData.originstation
                this.arriveQuery.destinationstation = this.$route.params.flightData.destinationstation
                this.getList()
            }
521
            let username = loginUserInfo.username
522
            if (username === 'admin') {
zhangFan authored
523 524
                this.isAdmin = true
            }
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 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
        },
        computed: {
            awba: {
                get: function () {
                    return this.arriveQuery.awba
                },
                set: function (val) {
                    this.arriveQuery.awba = val.trim()
                }
            },
            awbh: {
                get: function () {
                    return this.arriveModel.awbh
                },
                set: function (val) {
                    this.arriveModel.awbh = val.toUpperCase().trim()
                }
            },
            carrier: {
                get: function () {
                    return this.arriveModel.carrier
                },
                set: function (val) {
                    this.arriveModel.carrier = val.toUpperCase().trim()
                }
            },
            goodsname: {
                get: function () {
                    return this.arriveModel.goodsname
                },
                set: function (val) {
                    this.arriveModel.goodsname = val.toUpperCase().trim()
                }
            },
            flightno: {
                get: function () {
                    return this.arriveModel.flightno
                },
                set: function (val) {
                    this.arriveModel.flightno = val.toUpperCase().trim()
                }
            },
            originstation: {
                get: function () {
                    return this.arriveModel.originstation
                },
                set: function (val) {
                    this.arriveModel.originstation = val.toUpperCase().trim()
                }
            },
            destinationstation: {
                get: function () {
                    return this.arriveModel.destinationstation
                },
                set: function (val) {
                    this.arriveModel.destinationstation = val.toUpperCase().trim()
                }
            }
        },
        methods: {
            getList() {
                this.listLoading = true
                if (this.arriveQuery.awba !== undefined) {
                    getMt3201ListForParam(this.arriveQuery).then(res => {
589 590 591
                        this.arriveData = res.data.data.list
                        this.total = res.data.data.total
                        if (res.data.data.list.length > 0){
592 593 594 595 596 597 598 599 600 601 602 603 604
                            this.arriveQuery.carrier = this.arriveData[0].carrier
                            this.arriveQuery.flightno = this.arriveData[0].flightno
                            this.arriveQuery.flightdate = this.arriveData[0].flightdate
                            this.arriveQuery.originstation = this.arriveData[0].originstation
                            this.arriveQuery.destinationstation = this.arriveData[0].destinationstation
                            this.arriveQuery.customcode = this.arriveData[0].customcode
                        }
                        setTimeout(() => {
                            this.listLoading = false
                        }, 1.5 * 1000)
                    })
                } else {
                    getMt3201ListForParam(this.arriveQuery).then(res => {
605 606
                        this.arriveData = res.data.data.list
                        this.total = res.data.data.total
607 608 609 610 611 612 613 614
                        setTimeout(() => {
                            this.listLoading = false
                        }, 1.5 * 1000)
                    })
                }

            },
            handleSerach() {
王勇 authored
615 616 617 618 619
                // this.arriveQuery.carrier = undefined
                // this.arriveQuery.flightno = undefined
                // this.arriveQuery.originstation = undefined
                // this.arriveQuery.flightdate = undefined
                // this.arriveQuery.destinationstation = undefined
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635
                this.getList()
            },
            handleSelectionChange(val) {
                this.multipleSelection = val
            },
            // 新增出港运抵
            handelAddArriveInfo() {
                this.restModel()
                // 给model赋值,所使用数据是以单独单号查询数据所得
                this.arriveModel.carrier = this.arriveQuery.carrier
                this.arriveModel.flightdate = this.arriveQuery.flightdate
                this.arriveModel.flightno = this.arriveQuery.flightno
                this.arriveModel.originstation = this.arriveQuery.originstation
                this.arriveModel.destinationstation = this.arriveQuery.destinationstation
                this.arriveModel.customcode = this.arriveQuery.customcode
                this.dialogStatus = 'create'
636
                this.fenStatus = ''
637 638 639 640 641
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.arriveFormData.clearValidate()
                })
            },
642 643 644 645 646 647 648 649 650 651 652 653 654
            // 新增出港运抵分单
            handleAddAwbh(row){
                this.restModel()
                // 给model赋值,所使用数据是以单独单号查询数据所得
                this.arriveModel.carrier = row.carrier
                this.arriveModel.awba = row.awba
                this.arriveModel.flightdate = row.flightdate
                this.arriveModel.flightno = row.flightno
                this.arriveModel.originstation = row.originstation
                this.arriveModel.destinationstation = row.destinationstation
                this.arriveModel.customcode = row.customcode
                this.dialogStatus = 'create'
                this.fenStatus = 'addAwbh'
655 656
                this.dialogFormVisible = true,
                row.user = {
657
                    username: loginUserInfo.username
658
                }
659 660 661 662
                this.$nextTick(() => {
                    this.$refs.arriveFormData.clearValidate()
                })
            },
663 664 665 666
            createData() {
                this.$refs.arriveFormData.validate(valid => {
                    if (valid) {
                        addMt3201(this.arriveModel).then(res => {
667
                            if (res.data.code == "200") {
668
                                this.dialogFormVisible = false
669
                                Message.success(res.data.msg);
670
                                this.getList()
671 672 673 674 675 676
                            }else if (res.data.code == "201"){
                                Message.error(res.data.msg);
                            }else if (res.data.code == "202"){
                                Message.error(res.data.msg);
                            }else {
                                Message.error("数据有误,请检查数据");
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698
                            }
                        })
                    }
                })

            },

            // 重置实体
            restModel() {
                this.arriveModel = {
                    carrier: undefined,
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    awba: undefined,
                    awbh: undefined,
                    piece: undefined,
                    weight: undefined,
                    goodsname: undefined,
                    customcode: undefined,
                    arrivetime: undefined,
699
                    user: {
700
                        username: loginUserInfo.username
701
                    }
702 703 704 705 706
                }
            },
            // 编辑
            handleEdit(row) {
                this.arriveModel = Object.assign({}, row) // copy obj
707 708 709 710 711 712
                if (row.awbh === ''){
                    this.fenStatus = undefined
                }else {
                    this.fenStatus = 'addAwbh'
                }
713 714 715 716 717 718 719
                this.dialogStatus = 'update'
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.arriveFormData.clearValidate()
                })
            },
            updateData() {
720
                var _this = this
721
                this.$refs.arriveFormData.validate(valid => {
722
                    _this.arriveModel.user= {
723
                        username : loginUserInfo.username
724
                    }
725 726
                    if (valid) {
                        updateMT3201(this.arriveModel).then(res => {
727
                            if (res.data.code == "200") {
728
                                this.dialogFormVisible = false
729
                                Message.success(res.data.msg);
730
                                this.getList()
731 732 733 734 735 736
                            }else if (res.data.code == "201"){
                                Message.error(res.data.msg);
                            }else if (res.data.code == "202"){
                                Message.error(res.data.msg);
                            }else {
                                Message.error("数据更新失败,请检查数据");
737 738 739 740 741 742
                            }
                        })
                    }

                })
            },
743 744 745 746 747 748 749
            // 发送舱单报
            handleSendAwb(row) {
                this.$confirm("是否发送", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '发送',
                    cancelButtonText: '取消'
                }).then(() => {
750 751 752 753 754
                    if (row.awbh === null) {
                        row.awbh = ''
                    }
                    delete row.parent
                    delete row.children
755 756

                    row.user = {
757
                        username : loginUserInfo.username
758 759
                    }
760 761 762 763 764 765 766 767 768 769 770 771
                    sendCreateMt3201(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)
                })
            },
772
773 774 775
            // 发送删除报
            handleSendDelete(row) {
                this.respModel = {
776
                    carrier: undefined,
777 778 779 780 781 782 783 784
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: '',
                    flightNo: undefined,
                    awba: undefined,
                    customCode: undefined,
                    flightDate: undefined,
785
                    awbh: undefined,
786
                    username: loginUserInfo.username,
787 788
                }
                this.dialogDeleteVisible = true
789
                this.respModel.flightNo = row.flightno
790
                this.respModel.awba = row.awba
791 792
                this.respModel.carrier = row.carrier
                if (row.awbh === null) {
793
                    this.respModel.awbh = ''
794
                } else {
795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812
                    this.respModel.awbh = row.awbh
                }
                this.respModel.customCode = row.customcode
                this.respModel.flightDate = row.flightdate
                this.$nextTick(() => {
                    this.$refs.arriveDeleteForm.clearValidate()
                })
            },

            sendArriveDelete() {
                this.$refs.arriveDeleteForm.validate(valid => {
                    if (valid) {
                        sendRemoveMt3201(this.respModel).then(res => {
                            if (res.data.count > 0) {
                                Message.success(res.data.respMessage)
                                this.dialogDeleteVisible = false
                                this.getList()
                            } else {
813
                                Message.error(res.data.respMessage)
814 815 816 817
                            }
                        })
                    }
                })
818 819
            },
            // 收发明细
820
            handleSendDesc(row) {
821 822 823 824
                const resQuery = {
                    carrier: row.carrier,
                    flightNo: row.flightno,
                    flightDate: row.flightdate,
825
                    opertype:row.opertype,
826 827 828 829 830 831 832 833 834
                    awba: row.awba,
                    awbh: row.awbh,
                    messageType: 'MT3201'
                }
                this.dialogTableVisible = true
                getResponseForParam(resQuery).then(res => {
                    this.detailData = res.data
                })
            },
835
            //删除运单
836
            handleAwbDelete(row) {
837 838 839
                row.user =  {
                    username: loginUserInfo.username
                }
840 841 842 843 844 845
                this.$confirm("是否删除", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '删除',
                    cancelButtonText: '取消'
                }).then(() => {
                    deleteByIsDelete(row).then(res => {
846
                        if (res.data.code == "200") {
847 848
                            this.$message({
                                type: 'success',
849
                                message: res.data.msg
850 851 852 853 854
                            })
                            this.getList()
                        } else {
                            this.$message({
                                type: 'danger',
855
                                message: res.data.msg
856 857 858 859 860 861 862 863 864 865 866 867 868 869
                            })
                        }
                    })
                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消删除'
                            : '删除取消'
                    })
                })
            },
            //更改状态
            handleAwbStatus(row) {
870
871 872 873 874 875
                this.$confirm("是否发送更改状态", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '确认更改',
                    cancelButtonText: '取消更改'
                }).then(() => {
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892
                    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: '状态更改失败,请稍后重试'
                    //         })
                    //     }
                    // })
893 894 895 896 897 898 899 900 901 902

                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消状态更改'
                            : '状态更改取消'
                    })
                })
            },
903
            //获取机场三字码
904
            remoteMethodAirport(query) {
905 906 907 908
                this.airportCode = []
                if (query !== '') {
                    this.listLoading = true
                    getAirportCode({airportid: query}).then(res => {
909
                        if (res !== null) {
910 911 912 913 914 915 916 917 918
                            setTimeout(() => {
                                this.listLoading = false
                                this.airportCode = res.data.data
                            }, 200)
                        }
                    })
                } else {
                    this.airportCode = []
                }
919
            },
920
            //关区代码
921
            remoteMethodCustomCode(query) {
922 923 924 925
                this.customCodeList = []
                if (query !== '') {
                    this.customLoading = true
                    getCustomCode({customcode: query}).then(res => {
926
                        if (res !== null) {
927 928 929 930 931 932 933 934 935
                            setTimeout(() => {
                                this.customLoading = false
                                this.customCodeList = res.data.data
                            }, 200)
                        }
                    })
                } else {
                    this.airportCode = []
                }
936
            },
937
938 939 940 941 942 943 944 945
            // 携数据跳转 新增运抵
            handleAddArrive() {
                const row = {
                    'messageType': 'MT3201'
                }
                this.$router.push({name: "出港航班信息", params: {scopeRow: row}})
            },
            handelBackStep() {
946 947
                this.arriveQuery.messageType = 'MT3201'
                this.$router.push({name: '出港航班信息', params: {scopeRow: this.arriveQuery}})
948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995
            }

        }
    }

</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>