审查视图

src/views/nmms/ExitPre.vue 104.5 KB
1 2 3 4 5 6 7 8 9 10
<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">
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
                        <el-col :span="24">
                            <el-row>
                                <el-col :span="4">
                                    <el-input v-model="flightComNo"  placeholder="航班号" clearable >
                                        <template slot="prepend">航班号</template>
                                    </el-input>
                                </el-col>
                                <el-col :span="1">
                                    <div class="grid-content"></div>
                                </el-col>
                                <el-col :span="4">
                                    <div class="el-input el-input--mini el-input-group el-input-group--prepend el-input--suffix">
                                        <div class="el-input-group__prepend"> 航班日期</div>
                                        <el-date-picker
                                                value-format="yyyy-MM-dd"
                                                style="width: 200px"
                                                v-model="preQuery.flightdate" align="left"
                                                class="flight-date-tianbo"
                                                type="date" placeholder="请输入航班日期" clearable>
                                        </el-date-picker>
                                    </div>
                                </el-col>
                            </el-row>
34 35 36 37 38 39
                        </el-col>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content content">预配舱单查询</div>
                </el-col>
40
                <el-col :span="24">
41 42 43 44
                    <div class="grid-content co">
                        <el-col :span="1">
                            <div class="grid-content"></div>
                        </el-col>
45
                        <el-col :span="24">
46
                            <div class="grid-content">
47
                                <el-col :span="4">
48
                                    <div class="grid-content">
49 50 51
                                        <el-input  v-model="preQuery.awba"  placeholder="请输入主单号" clearable>
                                            <template slot="prepend">主单号</template>
                                        </el-input>
52 53 54
                                    </div>
                                </el-col>
                                <div class="grid-content el-btn">
55 56
                                    <el-button   type="warning" style="width:150px" icon="el-icon-search" @click="handleSerach">查&emsp;&emsp;询</el-button>
                                    <el-button   v-if="preQuery.flightno === undefined && preData.length<1" type="success"
小范 authored
57
                                               style="width:150px" icon="el-icon-plus"
58 59
                                               @click="handleAddpre">新增预配舱单
                                    </el-button>
60 61
                                    <el-button icon="el-icon-plus" @click="handleAwbSend('')" v-if="batchChooseFlag" style="width:150px"  type="primary">
                                        批量申报
62
                                    </el-button>
63 64
                                    <el-button icon="el-icon-edit"  @click="handleAwbEdit('')" v-if="batchChooseFlag" style="width:150px"  type="success">
                                        批量修改申报
65
                                    </el-button>
66 67
                                    <el-button icon="el-icon-delete" @click="handleSendDelete('')" v-if="batchChooseFlag" style="width:150px"  type="danger">
                                        批量删除申报
68
                                    </el-button>
69
                                    <el-button icon="el-icon-download" @click="download" style="width:150px"  type="success">
shenhailong authored
70 71
                                        模板下载
                                    </el-button>
72 73 74 75 76 77 78 79
                                    <el-upload
                                            style="display: inline; margin-left: 10px;margin-right: 10px;"
                                            action=""
                                            :http-request="uploadFile"
                                            :limit=1
                                            :on-exceed="fileExceed"
                                            accept="application/vnd.ms-excel,application/vnd.ms-excels"
                                            ref="fileupload">
80
                                        <el-button slot="trigger" style="width:150px"  icon="el-icon-folder-add" type="primary">导入excel</el-button>
81
                                    </el-upload>
82 83 84 85 86 87 88 89 90 91 92
                                </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>
93
        <el-table :data="preData" stripe
小范 authored
94
                  style="border-radius: 10px 10px 0px 0px;line-height: 25px;"
95
                  :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
96
                  @selection-change="handleSelectionChange" v-loading="listLoading"
97 98 99 100 101 102
                  default-expand-all
                  row-key="uuid"
                  border
                  :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
            <el-table-column type="selection" width="55">
            </el-table-column>
103
            <el-table-column label="运单号" width="140" align="center">
104
                <template slot-scope="scope">
105 106
                    <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>
107 108
                </template>
            </el-table-column>
109
            <el-table-column label="航班号" width="70" align="center">
110
                <template slot-scope="scope">
111
                    <span class="tableInline">{{scope.row.carrier}}{{scope.row.flightno}}</span>
112 113
                </template>
            </el-table-column>
114
            <el-table-column label="航班日期" width="100" align="center">
115
                <template slot-scope="scope">
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
                    <span class="tableInline">{{scope.row.flightdate}}</span>
                </template>
            </el-table-column>
            <el-table-column label="目的站" width="80" align="center">
                <template slot-scope="scope">
                    <span class="tableInline">{{scope.row.destinationstation}}</span>
                </template>
            </el-table-column>
            <el-table-column label="件数" width="50" align="center">
                <template slot-scope="scope">
                    {{scope.row.piece}}
                </template>
            </el-table-column>
            <el-table-column label="重量" width="60" align="center">
                <template slot-scope="scope">
                    {{scope.row.weight}}
132 133
                </template>
            </el-table-column>
134
            <el-table-column label="货物描述" width="120" align="center" show-overflow-tooltip>
135 136 137 138
                <template slot-scope="scope">
                    {{scope.row.goodsname}}
                </template>
            </el-table-column>
139 140 141 142 143
            <el-table-column label="海关关区" width="70" align="center">
                <template slot-scope="scope">
                    {{scope.row.customcode}}
                </template>
            </el-table-column>
144
            <el-table-column label="配载时间" width="150" align="center">
145 146 147 148 149 150
                <template slot-scope="scope">
                    {{scope.row.actime}}
                </template>
            </el-table-column>
            <el-table-column label="状态" width="100" align="center">
                <template slot-scope="scope">
151 152 153
                    <span v-if="scope.row.status ==='01'">接受申报</span>
                    <span v-if="scope.row.status ==='02'">待人工审核</span>
                    <span v-if="scope.row.status ==='03'">退单</span>
154 155 156 157 158 159
                    <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>
160 161 162
                    <span v-if="scope.row.status ==='11'">放行</span>
                    <span v-if="scope.row.status ==='12'">拒装</span>
                    <span v-if="scope.row.status ==='13'">禁卸</span>
163 164 165
                    <span v-if="scope.row.status ==='14'">舱单修改报转人工</span>
                    <span v-if="scope.row.status ==='15'">舱单修改报成功</span>
                    <span v-if="scope.row.status ==='16'">海关已存在</span>
166 167 168 169 170
                    <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>
171 172
                </template>
            </el-table-column>
173
            <el-table-column prop="receipt" label="回执信息" align="center" show-overflow-tooltip>
174
                <template slot-scope="scope">
175 176 177 178 179 180 181 182 183 184 185 186
                    <el-tag v-if="scope.row.status=='01' || scope.row.status=='11'" type="success">
                        {{scope.row.ext5}}
                    </el-tag>
                    <el-tag v-else-if="scope.row.status=='02' || scope.row.status=='03'" type="warning">
                        {{scope.row.ext5}}
                    </el-tag>
                    <el-tag v-else-if="scope.row.status=='12' || scope.row.status=='13'" type="danger">
                        {{scope.row.ext5}}
                    </el-tag>
                    <el-tag v-else>
                        {{scope.row.ext5}}
                    </el-tag>
187 188
                </template>
            </el-table-column>
189 190
            <el-table-column label="操作" width="450px" fixed="right" align="center">
                <template slot-scope="scope" >
191 192 193 194 195 196 197 198 199 200
                    <el-row type="flex" justify="space-between">
                        <el-button icon="el-icon-view"   @click="handleSend(scope.row)">收发明细</el-button>
                        <el-button type="success" icon="el-icon-plus"  v-if="scope.row.awbh ===''"
                                   @click="handleAddAwbh(scope.row)">新增分单
                        </el-button>
                        <el-button type="warning" icon="el-icon-edit"  @click="handleAwbStatus(scope.row)"
                                   :disabled="scope.row.status === '22'">更改状态
                        </el-button>

                        <el-button  type="danger" icon="el-icon-delete"   v-if="isAdmin"  @click="handleAwbDelete(scope.row)">删除运单</el-button>
201
                    </el-row>
202 203 204 205 206 207 208 209
                    <el-row type="flex" justify="space-between">
                        <el-button type="primary" icon="el-icon-plus"  @click="handleAwbSend(scope.row.uuid)"
                                   :disabled="addStatus(scope.row.status)">预配申报
                        </el-button>
                        <el-button type="success" icon="el-icon-edit"    @click="handleAwbEdit(scope.row.uuid)"
                                   :disabled="editStatus(scope.row.status)">修改申报</el-button>
                        <el-button type="danger" icon="el-icon-delete"   @click="handleSendDelete(scope.row.uuid)"
                                   :disabled="deleteStatus(scope.row.status)">删除申报</el-button>
210
                    </el-row>
211 212
                </template>
            </el-table-column>
213
        </el-table>
214
215 216
        <div class="btnFoot">
            <el-row>
217
                <el-button type="success" icon="el-icon-plus"  v-if="preQuery.flightno !== undefined || preData.length >0"
218 219
                           @click="handleAddpreInfo">新增预配舱单
                </el-button>
220 221
                <el-button type="primary" icon="el-icon-back"  @click="handelBackStep"
                           v-if="preQuery.flightno !== undefined || preData.length >0">返&emsp;&emsp;回
222 223 224
                </el-button>
            </el-row>
        </div>
225
        <pagination v-show="total>0" :total="total" :page.sync="preQuery.pageSize" :limit.sync="preQuery.limitSize"
226
                    @pagination="getList"/>
227
        <el-dialog  top="5vh" :title="dialogMap[dialogStatus]" :visible.sync="dialogFormVisible" width="90%">
228
            <el-form ref="preFormData" :model="preModel" :rules="preRoles" label-position="right"
229
                     label-width="80px" size="mini" class="el-dialog-div">
230 231 232 233
                <div  style="font-size: 10px;background-color: #F0F0F0;color: #6459A5">
                    <span style="text-align:center;display:inline-block;width:100px;border-bottom: 2px solid #6459A5">
                        运单信息
                    </span>
234
                </div>
235 236 237
                <el-row class="flight-info"  style="padding-left: 90px;padding-right: 90px">
                    <el-col :span="6">
                        <el-form-item label="主单号" prop="awba">
shenhailong authored
238 239 240
                            <el-input :disabled="dialogStatus !== 'create'" v-model="awba" clearable v-if="fenStatus === 'addAwbh'" disabled style="width: 140px">
                            </el-input>
                            <el-input :disabled="dialogStatus !== 'create'" v-model="awba" clearable v-else style="width: 140px">
241
                            </el-input>
242 243
                        </el-form-item>
                    </el-col>
244
                    <el-col :span="6" v-if="fenStatus === 'addAwbh'">
shenhailong authored
245 246
                        <el-form-item label="分单号" prop="awbh" >
                            <el-input v-model="awbh" clearable style="width: 140px">
247
                            </el-input>
248 249
                        </el-form-item>
                    </el-col>
250 251
                    <el-col :span="6">
                        <el-form-item label="提前运抵">
shenhailong authored
252
                            <el-select v-model="preModel.ext3" class="filter-item" clearable style="width: 140px" placeholder="请选择">
253 254 255 256 257
                                <el-option v-for="item in ext3" :key="item.value"
                                           :label="item.label"
                                           :value="item.value">
                                </el-option>
                            </el-select>
258 259
                        </el-form-item>
                    </el-col>
260 261
                    <el-col :span="6">
                        <el-form-item label="报关类型">
shenhailong authored
262
                            <el-select v-model="preModel.ext4" class="filter-item" style="width: 140px" clearable placeholder="请选择报关类型">
263 264 265 266 267 268 269 270 271
                                <el-option v-for="item in customsDeclarationType" :key="item.value"
                                           :label="item.label"
                                           :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="货物属性">
shenhailong authored
272
                            <el-select v-model="preModel.awbinfo.goodsAttribute" class="filter-item" clearable style="width: 140px" placeholder="请选择货物属性">
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
                                <el-option v-for="item in goodsAttribute" :key="item.value"
                                           :label="item.label"
                                           :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <div  style="font-size: 10px;background-color: #F0F0F0;color: #6459A5">
                    <span style="text-align:center;display:inline-block;width:100px;border-bottom: 2px solid #6459A5">
                        航班信息
                    </span>
                </div>
                <el-row class="flight-info"  style="padding-left: 90px;padding-right: 90px">
                    <el-col :span="6">
                        <el-form-item label="航班号" prop="flightno">
289
                            <el-input v-model="flightno" @blur="transportQuery()" :disabled="fenStatus === 'addAwbh'"  style="width: 140px" clearable>
290
                            </el-input>
291
                        </el-form-item>
292 293 294 295 296 297 298
                        <el-alert
                                title="运输工具申报信息:"
                                :type="alert_type"
                                :description = "alert_des"
                                :closable="false"
                        >
                        </el-alert>
299
                    </el-col>
300 301
                    <el-col :span="6">
                        <el-form-item label="航班日期" prop="flightdate">
302
                            <el-date-picker :disabled="fenStatus === 'addAwbh'"
303
                                            value-format="yyyy-MM-dd"
shenhailong authored
304
                                            style="width: 140px"
305 306
                                            v-model="preModel.flightdate" align="left"
                                            class="flight-date-tianbo"
307
                                            @blur="transportQuery()"
308 309 310
                                            type="date" placeholder="请输入航班日期" clearable/>
                        </el-form-item>
                    </el-col>
311 312
                    <el-col :span="6">
                        <el-form-item label="起始站" prop="originstation">
313 314 315 316 317
                            <el-select
                                    filterable
                                    clearable
                                    placeholder="请选择起始站"
                                    :remote-method="remoteMethodAirport"
318
                                    default-first-option
319 320
                                    allow-create remote
                                    v-model="originstation"
321
                                    :loading="airportLoading"
322
                                    style="width: 140px">
323 324
                                <el-option v-for="item in airportCode"
                                           :key="item.airportid" :label="item.airportid"
325
                                           :value="item.airportid" >
326 327 328 329
                                    <span style="float: left">{{ item.airportdescchn }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
                                </el-option>
                            </el-select>
330 331
                        </el-form-item>
                    </el-col>
332 333
                    <el-col :span="6">
                        <el-form-item label="目的站" prop="destinationstation">
334
                            <el-select filterable clearable placeholder="请选择目的站" allow-create remote
335 336 337 338
                                       v-model="destinationstation"
                                       :remote-method="remoteMethodAirport"
                                       default-first-option
                                       style="width: 140px">
339 340
                                <el-option v-for="item in airportCode"
                                           :key="item.airportid" :label="item.airportid"
341
                                           :value="item.airportid">
342 343 344 345
                                    <span style="float: left">{{ item.airportdescchn }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
                                </el-option>
                            </el-select>
346 347 348 349
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
                    <div align="center"  class="bpp" style="margin-bottom: 4px">
                        <tr style="background-color: #F1F3FF" >
                            <td width="70px">
                                航程
                            </td>
                            <td width="350px">
                                到达站
                            </td>
                            <td width="350px">
                                承运人
                            </td>
                        </tr>
                        <tr>
                            <td  style="border-left:  1.5px solid #F1F3FF">
                                1
                            </td>
                            <td  style="border: 1.5px solid #F1F3FF;border-top: 0px">
                                <el-input  style="background-color: #fff;text-align: center" v-model="by1" size="mini" placeholder="三字码"></el-input>
                            </td>
                            <td style="border-right:  1.5px solid #F1F3FF">
                                <el-input style="background-color: #fff" v-model="dest1" size="mini" placeholder="承运人代码"></el-input>
                            </td>
                        </tr>
                        <tr>
                            <td style="border: 1.5px solid #F1F3FF">
                                2
                            </td>
                            <td style="border-bottom: 1.5px solid #F1F3FF">
                                <el-input  style="background-color: #fff;text-align: center" v-model="by2" size="mini" placeholder="三字码"></el-input>
                            </td>
                            <td style="border: 1.5px solid #F1F3FF">
                                <el-input style="background-color: #fff" v-model="dest2" size="mini" placeholder="承运人代码"></el-input>
                            </td>
                        </tr>
                    </div>

                </el-row>
                <div style="font-size: 10px;background-color: #F0F0F0;color: #6459A5" v-if="fenStatus !=='addAwbh'">
                    <span style="text-align:center;display:inline-block;width:100px;border-bottom: 2px solid #6459A5">
                        代理信息
                    </span>
                </div>
                <el-row class="flight-info" v-if="fenStatus !=='addAwbh'"  style="padding-left: 90px;padding-right: 90px">
                    <el-col :span="6">
                        <el-form-item label="订舱代理">
shenhailong authored
395
                            <el-select v-model="preModel.bookingAgentId" clearable class="filter-item" style="width: 140px" placeholder="请录入订舱代理">
396 397 398
                                <el-option v-for="item in bookingAgentList" :key="item.id"
                                           :label="item.forShort"
                                           :value="item.id">
399
                                </el-option>
400 401 402
                            </el-select>
                        </el-form-item>
                    </el-col>
403 404
                    <el-col :span="6">
                        <el-form-item label="操作代理">
shenhailong authored
405
                            <el-select v-model="preModel.operatingAgentId" clearable class="filter-item" placeholder="请录入操作代理">
406 407 408
                                <el-option v-for="item in operatingAgentList" :key="item.id"
                                           :label="item.forShort"
                                           :value="item.id">
409
                                </el-option>
410 411 412
                            </el-select>
                        </el-form-item>
                    </el-col>
413 414 415
                    <el-col :span="6">
                        <el-form-item label="代理名称" prop="">
                            <el-input disabled v-model="preModel.awbinfo.dest4" clearable style="width: 140px">
416
                            </el-input>
417 418
                        </el-form-item>
                    </el-col>
419 420 421
                    <el-col :span="6">
                        <el-form-item  label="代理编码" prop="">
                            <el-input disabled v-model="preModel.awbinfo.dest4city" clearable style="width: 140px">
422
                            </el-input>
423 424 425
                        </el-form-item>
                    </el-col>
                </el-row>
426
427 428 429 430 431 432 433 434 435 436 437 438 439
<!--                <el-row style="margin-bottom: 10px">-->
<!--                    <el-col :span="7"  v-if="fenStatus ==='addAwbh'">-->
<!--                        <span>-->
<!--                            货物剩余信息:-->
<!--                        </span>-->
<!--                    </el-col>-->
<!--                    <el-col :span="7" v-if="fenStatus ==='addAwbh'">-->
<!--                        <span>剩余件数:{{awbPiece}}</span>-->
<!--                    </el-col>-->
<!--                    <el-col :span="7" v-if="fenStatus ==='addAwbh'">-->
<!--                        <span>剩余重量:{{awbWeight}}</span>-->
<!--                    </el-col>-->
<!--                </el-row>-->
440 441 442 443
                <div   style="font-size: 10px;background-color: #F0F0F0;color: #6459A5">
                    <span style="text-align:center;display:inline-block;width:100px;border-bottom: 2px solid #6459A5">
                        发货人
                    </span>
444
                </div>
445 446 447 448 449
                <el-row   style="padding-left: 90px;padding-right: 90px">
                    <el-button class="sun" style="border:1px solid #6459A5;color: #6459A5" plain size="mini" @click="consignerSelect()">选择发货人</el-button>
                    <el-col :span="12">
                        <el-form-item   label="发货人" prop="awbinfo.shprname">
                            <el-input id="a" v-model="shprname" clearable  style="width: 340px">
450
                            </el-input>
451 452
                        </el-form-item>
                    </el-col>
453 454 455
                    <el-col :span="12">
                        <el-form-item label="地址" prop="awbinfo.shpraddress">
                            <el-input  v-model="shpraddress" clearable style="width: 340px">
456
                            </el-input>
457 458
                        </el-form-item>
                    </el-col>
459 460 461

                    <el-col :span="6">
                        <el-form-item label="国家代码" prop="awbinfo.shprcountyr">
462 463 464 465 466
                            <el-select
                                    :remote-method="remoteMethod"
                                    :loading="listLoading"
                                    v-model="shprcountyr"
                                    filterable
467
                                    default-first-option
朱兆平 authored
468
                                    allow-create
469
                                    remote
470
                                    placeholder="请选择国家代码" clearable  style="width: 120px">
471 472 473 474 475 476 477 478 479 480 481
                                <el-option
                                        v-for="item in countryOption"
                                        :key="item.value"
                                        :label="item.value"
                                        :value="item.value">
                                    <span style="float: left">{{ item.label }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
482 483 484
                    <el-col :span="6">
                        <el-form-item label="城市代码" prop="awbinfo.scityid">
                            <el-input v-model="preModel.awbinfo.scityid" clearable style="width: 120px">
485 486 487
                            </el-input>
                        </el-form-item>
                    </el-col>
488 489 490 491
                    <el-col :span="6">
                        <el-form-item label="电话" prop="awbinfo.shprtel">
                            <el-input  v-model="preModel.awbinfo.shprtel" clearable style="width: 120px">
                                <!--                                <template  slot="prepend" >&nbsp;&nbsp;&nbsp;电&nbsp;&nbsp;&nbsp;话&nbsp;&nbsp;&nbsp;</template>-->
492
                            </el-input>
493 494
                        </el-form-item>
                    </el-col>
495 496 497 498
                    <el-col :span="6">
                        <el-form-item label="AEO编码" prop="awbinfo.shpaeocode">
                            <el-input v-model="preModel.awbinfo.shpaeocode" clearable  style="width: 120px">
                                <!--                                <template  slot="prepend" >&nbsp;&nbsp;AEO编码&nbsp;</template>-->
499
                            </el-input>
500 501
                        </el-form-item>
                    </el-col>
502 503 504 505 506 507 508 509 510 511 512 513
                </el-row>
                <div style="font-size: 10px;background-color: #F0F0F0;color: #6459A5">
                    <span style="text-align:center;display:inline-block;width:100px;border-bottom: 2px solid #6459A5">
                        收货人
                    </span>
                </div>
                <el-row   style="padding-left: 90px;padding-right: 90px">
                    <el-button class="suns" style="border:1px solid #6459A5;color: #6459A5"  plain size="mini" @click="consigneeSelect()" >选择收货人</el-button>
                    <el-col :span="12">
                        <el-form-item  label="收货人" prop="awbinfo.cnsnname">
                            <el-input  v-model="cnsnname" clearable style="width: 340px">
                                <!--                                <template  slot="prepend" ></template>-->
514
                            </el-input>
515 516
                        </el-form-item>
                    </el-col>
517 518 519 520
                    <el-col :span="12">
                        <el-form-item label="地址" prop="awbinfo.cnsnaddress">
                            <el-input   v-model="cnsnaddress" clearable style="width: 340px">
                                <!--                                <template  slot="prepend" >&nbsp;&nbsp;&nbsp;地&nbsp;&nbsp;&nbsp;址&nbsp;&nbsp;&nbsp;</template>-->
521
                            </el-input>
522 523
                        </el-form-item>
                    </el-col>
524 525 526 527

                    <el-col :span="6">
                        <el-form-item label="国家代码" prop="awbinfo.cnscountyr">
                            <!--                            <div class="el-input-group__prepend select-lable" style="line-height: 27px;float:left; width:98px;font-size:12px;text-align: center;">&nbsp;国家代码&nbsp;</div>-->
528 529 530 531 532
                            <el-select
                                    :remote-method="remoteMethod"
                                    :listLoading="listLoading"
                                    v-model="cnscountyr"
                                    filterable
朱兆平 authored
533
                                    allow-create
534
                                    default-first-option
535
                                    remote
536
                                    placeholder="请选择国家代码" clearable style="width: 120px">
537 538 539 540 541 542 543 544 545 546 547
                                <el-option
                                        v-for="item in countryOption"
                                        :key="item.value"
                                        :label="item.value"
                                        :value="item.value">
                                    <span style="float: left">{{ item.label }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
548 549 550 551
                    <el-col :span="6">
                        <el-form-item label="城市代码" prop="awbinfo.ecityid">
                            <el-input  v-model="preModel.awbinfo.ecityid" clearable  style="width: 120px">
                                <!--                                <template  slot="prepend" >&nbsp;城市代码&nbsp;&nbsp;</template>-->
552
                            </el-input>
553 554
                        </el-form-item>
                    </el-col>
555 556 557 558
                    <el-col :span="6">
                        <el-form-item label="电话" prop="awbinfo.cnsntel">
                            <el-input  v-model="preModel.awbinfo.cnsntel" clearable  style="width: 120px">
                                <!--                                <template  slot="prepend" >&nbsp;&nbsp;&nbsp;电&nbsp;&nbsp;&nbsp;话&nbsp;&nbsp;&nbsp;</template>-->
559
                            </el-input>
560 561
                        </el-form-item>
                    </el-col>
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 590 591 592 593 594 595 596
                    <el-col :span="6">
                        <el-form-item  label="AEO编码" prop="awbinfo.cnsaeocode">
                            <el-input v-model="preModel.awbinfo.cnsaeocode" clearable   style="width: 120px">
                                <!--                                <template  slot="prepend" >&nbsp;AEO编码&nbsp;&nbsp;</template>-->
                            </el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <div style="font-size: 10px;background-color: #F0F0F0;color: #6459A5">
                    <span style="text-align:center;display:inline-block;width:100px;border-bottom: 2px solid #6459A5">
                        货物信息
                    </span>
                </div>
                <el-row   style="padding-left: 90px;padding-right: 90px">
                    <el-col :span="6">
                        <el-form-item label="货物描述" prop="goodsname">
                            <el-input v-model="goodsname" clearable  style="width: 120px">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="预配件数" prop="piece">
                            <el-input v-model="preModel.piece" @input="pieceEcho" clearable  style="width: 120px">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="预配重量" prop="weight">
                            <el-input v-model="preModel.weight" @input="weightEcho" clearable style="width: 120px">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item  label="所属关区" prop="customcode">
597 598 599 600 601 602 603 604 605 606 607 608 609 610
<!--                            <el-select v-model="preModel.customcode" clearable class="filter-item" style="width: 140px" placeholder="请选择所属关区">-->
<!--                                <el-option v-for="item in custom" :key="item.value"-->
<!--                                           :label="item.label"-->
<!--                                           :value="item.value">-->
<!--                                </el-option>-->
<!--                            </el-select>-->
                            <el-select v-model="preModel.customcode"  class="filter-item" placeholder="请输入关区代码"
                                       filterable clearable remote :remote-method="remoteMethodCustomCode" :loading="customLoading"
                                       allow-create
                                       default-first-option>
                                <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>
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="付费方式" prop="awbinfo.paymodel">
                            <el-select v-model="preModel.awbinfo.paymodel" class="filter-item"  placeholder="请选择付费方式"  style="width: 120px">
                                <el-option
                                        v-for="item in payTypes"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="货物类型" prop="awbinfo.awbtype">
shenhailong authored
629
                            <el-select v-model="preModel.awbinfo.awbtype" clearable class="filter-item" style="width: 120px" placeholder="请录入货物类型">
630 631 632 633 634 635 636
                                <el-option v-for="item in customTypess" :key="item.value"
                                           :label="item.label"
                                           :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
637
                </el-row>
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665
<!--                <div v-if="dialogStatus === 'sendUpdate'">-->
<!--                    <div class="grid-content content">-->
<!--                        运单信息-->
<!--                    </div>-->
<!--                    <el-row>-->
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label="" prop="reason">-->
<!--                                <el-input v-model="preModel.reason" clearable>-->
<!--                                    <template  slot="prepend" >修改原因</template>-->
<!--                                </el-input>-->
<!--                            </el-form-item>-->
<!--                        </el-col>-->
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label="" prop="contactName">-->
<!--                                <el-input v-model="preModel.contactName" clearable>-->
<!--                                    <template  slot="prepend" >修改人名称</template>-->
<!--                                </el-input>-->
<!--                            </el-form-item>-->
<!--                        </el-col>-->
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label="" prop="contactTel">-->
<!--                                <el-input v-model="preModel.contactTel" clearable maxlength="5">-->
<!--                                    <template  slot="prepend" >修改人电话</template>-->
<!--                                </el-input>-->
<!--                            </el-form-item>-->
<!--                        </el-col>-->
<!--                    </el-row>-->
<!--                </div>-->
666
            </el-form>
667
            <div slot="footer" class="dialog-footer" style="text-align: center">
668 669
                <el-button @click="dialogFormVisible = false" size="medium" type="primary"
                           style="width: 100px">取消</el-button>
670
                <el-button type="success" size="medium" style="width: 100px"
671
                           @click="dialogStatus ==='create'? createData():updateData()" v-loading="addloading">保存</el-button>
672 673
            </div>
        </el-dialog>
674 675 676 677
        <el-dialog title="收发明细" :visible.sync="dialogTableVisible" width="70%">
            <el-table :data="detailData" border :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}"
                      style="border-radius: 10px 10px 0px 0px;line-height: 25px;width: 100%" size="small" >
                <el-table-column label="操作时间" width="150">
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706
                    <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>
707 708 709 710 711
                <el-table-column label="操作类型" width="100">
                    <template slot-scope="scope">
                        {{scope.row.opertype}}
                    </template>
                </el-table-column>
712 713
                <el-table-column label="操作人" width="100">
                    <template slot-scope="scope">
714
                        {{scope.row.operusername}}
715 716 717 718
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>
719 720
        <el-dialog :title="sendMap[sendStatus]" :visible.sync="dialogDeleteVisble" width="50%">
            <el-form ref="sendDeleteForm" :model="respModel" :rules="sendDeleteRules" label-width="120px"
721
                 style="margin-right:50px;">
722
            <el-form-item label="" prop="reason">
723 724 725 726 727
                <el-input v-if="sendStatus==='remove'" v-model="respModel.reason" type="textarea" placeholder="删除原因">
                    <template  slot="prepend" >删除原因</template>
                </el-input>
                <el-input v-else v-model="respModel.reason" type="textarea" placeholder="修改原因">
                    <template  slot="prepend" >修改原因</template>
728
                </el-input>
729
            </el-form-item>
730 731
            <el-form-item label="" prop="contactName">
                <el-input v-model="respModel.contactName" placeholder="操作人姓名">
732
                    <template  slot="prepend" >操作人名称</template>
733
                </el-input>
734
            </el-form-item>
735
            <el-form-item label="" prop="contactTel">
736 737
                <el-input v-model="respModel.contactTel" placeholder="操作人联系方式">
                    <template  slot="prepend" >操作人电话</template>
738
                </el-input>
739
            </el-form-item>
740
            <el-form-item label="">
741
                <el-input v-if="sendStatus==='remove'" v-model="respModel.content" type="textarea" placeholder="请输入备注">
742
                </el-input>
743
            </el-form-item>
744 745 746 747 748
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogDeleteVisble = false" size="medium"
                           style="width: 100px;background-color: #6F8294;color: #ffffff">取消</el-button>
                <el-button type="success" size="medium" style="width: 100px"
749
                           @click="sendStatus =='edit'? sendUpdate():sendDelete()">发送</el-button>
750
            </div>
751
        </el-dialog>
752
        <el-dialog title="发货人信息" :visible.sync="dialogSelectVisible" width="70%">
753 754 755 756
            <!--工具条-->
            <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
                <el-form :inline="true" :model="consignerQuery">
                    <el-form-item>
757 758 759
                        <el-input v-model="consignerQuery.companyName" placeholder="公司名称" size="small">
                            <template slot="prepend">公司名称</template>
                        </el-input>
760 761
                    </el-form-item>
                    <el-form-item>
762
                        <el-button type="primary" icon="el-icon-plus" size="small" v-on:click="consignerSelect()">查&emsp;&emsp;询</el-button>
763 764 765
                    </el-form-item>
                </el-form>
            </el-col>
766 767 768
            <el-table v-loading="listLoading" :data="consignerList" stripe
                      :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}"
                      style="border-radius: 10px 10px 0px 0px;line-height: 25px;width: 100%" size="small"
769 770 771 772 773 774 775 776 777 778 779 780 781 782 783
                      border >
                <el-table-column type="selection" width="55">
                </el-table-column>
                <el-table-column label="序号" type="index">
                </el-table-column>
                <el-table-column prop="companyName" label="发货人公司"  >
                </el-table-column>
                <el-table-column prop="conCity" label="发货人城市"  >
                </el-table-column>
                <el-table-column prop="country" label="发货人国家代码"  >
                </el-table-column>
                <el-table-column prop="conPhone" label="发货人电话"  >
                </el-table-column>
                <el-table-column label="操作">
                    <template slot-scope="scope">
784
                        <el-button type="success" size="mini" icon="el-icon-thumb" @click="consignerClick(scope.row)">选&emsp;&emsp;择</el-button>
785 786 787 788 789 790
                    </template>
                </el-table-column>
            </el-table>
            <pagination background layout="total, prev, pager, next" v-show="consignerQuery.total>0" :total="consignerQuery.total" :page.sync="consignerQuery.pageSize" :limit.sync="consignerQuery.limitSize"
                        @pagination="consignerSelect()"/>
        </el-dialog>
791
        <el-dialog title="收货人信息" :visible.sync="dialogNeeVisible" width="70%">
792 793 794 795
            <!--工具条-->
            <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
                <el-form :inline="true" :model="consignerQuery">
                    <el-form-item>
796 797 798
                        <el-input v-model="consigneeQuery.companyName" placeholder="公司名称" size="small">
                            <template slot="prepend">公司名称</template>
                        </el-input>
799 800
                    </el-form-item>
                    <el-form-item>
801
                        <el-button type="primary" icon="el-icon-plus" v-on:click="consigneeSelect()" size="small">查&emsp;&emsp;询</el-button>
802 803 804
                    </el-form-item>
                </el-form>
            </el-col>
805 806 807
            <el-table v-loading="listLoading" :data="consigneeList" stripe
                      :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}"
                      style="border-radius: 10px 10px 0px 0px;line-height: 25px;width: 100%" size="small"
808 809 810 811 812 813 814 815 816 817 818 819 820 821 822
                      border >
                <el-table-column type="selection" width="55">
                </el-table-column>
                <el-table-column label="序号" type="index">
                </el-table-column>
                <el-table-column prop="companyName" label="收货人公司"  >
                </el-table-column>
                <el-table-column prop="conCity" label="收货人城市"  >
                </el-table-column>
                <el-table-column prop="country" label="收货人国家代码"  >
                </el-table-column>
                <el-table-column prop="conPhone" label="收货人电话"  >
                </el-table-column>
                <el-table-column label="操作">
                    <template slot-scope="scope">
823
                        <el-button type="success"  icon="el-icon-thumb" @click="consigneeClick(scope.row)" size="small">选&emsp;&emsp;择</el-button>
824 825 826 827 828 829
                    </template>
                </el-table-column>
            </el-table>
            <pagination background layout="total, prev, pager, next" v-show="consigneeQuery.total>0" :total="consigneeQuery.total" :page.sync="consigneeQuery.pageSize" :limit.sync="consigneeQuery.limitSize"
                        @pagination="consignerSelect()"/>
        </el-dialog>
830 831 832 833 834 835
    </div>
</template>
<script>
    import treeTable from '@/components/TreeTable'
    import treeToArray from '@/utils/customEval'
    import Pagination from '@/components/Pagination'
朱兆平 authored
836
    import util from '@/common/js/util'
837 838 839 840 841 842 843 844 845
    import {getCountry, getByCountryCode, getByCountryCodeForName,getCustomCode,getAirportCode} from "@/api/country";
    import {
        getMt2201ListForParam,
        deleteByIsDelete,
        updateStatus,
        updateMT2201,
        addMt2201,
        sendCreateMt2201,
        sendDeleteMt2201,
846 847
        sendUpdateMt2201,
        uploadFileExcel
shenhailong authored
848
    } from '@/api/exitPre';
849
    import {loginedUserInfo} from "../../api/user";
850 851
    import {Message} from "element-ui";
    import {getResponseForParam} from '@/api/responseDetail'
852 853
    import { getList} from '../../api/consigner/consigner';
    import { getList as neeList} from '../../api/consigner/consignee';
854 855
    import {getListHzTypeList} from '../../api/shipper/shipper';
    import {selectPredictionInterface} from '../../api/transport';
zhangFan authored
856 857 858 859 860 861 862
    import {
        validAwb,
        validAlphabets,
        validAlphabetsAndNum,
        validAlphabetsAndSpanceKey,
        validatorNum
    } from "@/utils/validate"
863
    import flight from "../airtransport/flight";
864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893

    export default {
        name: "ExitPre",
        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()
            }
            const validAlphabetsSpanceKey = (rule, value, callback) => {
                if (!validAlphabetsAndSpanceKey(value)) {
                    callback("只能输入字母、数字、空格")
                }
                callback()
            }
zhangFan authored
894 895 896 897 898 899
            const validatorNums = (rule, value, callback) => {
                if (!validatorNum(value)) {
                    callback("只能输入数字,并且小数位最多两位")
                }
                callback()
            }
900 901 902
            return {
                func: treeToArray,
                total: 1,
903
                isAdmin: false,
904 905
                alert_type: 'info',
                alert_des: '',
906
                addloading: false,
907 908
                consignerList: [],
                dialogNeeVisible: false,
909 910
                batchChooseFlag: false,
                batchChooseSelection: '',
911
                consigneeList: [],
912
                carrierAndFlight: '',
913 914 915 916 917 918 919 920 921 922 923 924 925
                consignerQuery: {
                    companyName: '',
                    total: 0,
                    pageSize: 1,
                    limitSize: 5,
                },
                consigneeQuery: {
                    companyName: '',
                    total: 0,
                    pageSize: 1,
                    limitSize: 5,
                },
                dialogSelectVisible: false,
926
                loginUserInfo: loginedUserInfo(),
927
                preQuery: {
928
                    pageSize: 1,
929
                    limitSize: 30,
930 931 932 933 934 935
                    awba: '',
                    carrier: '',
                    flightno: '',
                    flightdate: '',
                    originstation: '',
                    destinationstation: '',
936
                    userId:loginedUserInfo().userId,
937
                    customCode:'',
938
                    enterpriseId:loginedUserInfo().companyId,
939
                    messageType: ''
940 941 942 943 944 945
                },
                dialogMap: {
                    update: '编辑预配舱单',
                    create: '添加预配舱单',
                    addAwbh: '添加分单'
                },
946 947 948 949
                sendMap: {
                    edit: '修改申报',
                    remove: '删除申报',
                },
950
                customTypess: [
951 952 953 954
                    {label: '普通货物', value: '001'},
                    {label: '国际转运货物', value: '002'},
                    {label: '国内转关', value: '003'},
                    {label: '空箱', value: '004'},
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
                    {label: '快件', value: '005'}
                ],
                custom:[
                    {label: '4604', value: '4604'},
                    {label: '4620', value: '4620'},
                ],
                customsDeclarationType: [
                    {label: '本地报关', value: '001'},
                    {label: '转关', value: '002'},
                    {label: '通关一体化', value: '003'},
                    {label: '提前报关', value: '004'}],
                shipmentCargo:[
                    {label: '郑州机场地面处理',value:'1'}
                ],
                ext3: [
                    {label: '正常运抵', value: 'N'},
                    {label: '提前运抵', value: 'Y'},
                ],
                shipType:[
                    {label: '普货交运', value: '1'},
                    {label: '邮件交运', value: '2'},
                    {label: '国际邮件交运', value: '3'}],
                codeType:[
                    {label: 'USCI', value: 'USCI'},
                    {label: 'OC', value: 'OC'},
                    {label: '9999', value: '9999'}
                ],
                goodsAttribute:[
                    {label: '非保税', value: '2'},
                    {label: '保税', value: '1'}
                ],
                consignorList:[],
                operatingAgentList:[],
                bookingAgentList:[],
                payTypes: [{label: '预付', value: 'PP'}, {label: '到付', value: 'CC'}],
990
                splitcodes: [{label: '是', value: 'T'}, {label: '否', value: 'P'}],
991 992 993 994 995 996 997 998 999 1000 1001 1002
                packagingInformation: [
                    {label: '纸箱', value: '1'},
                    {label: '木箱', value: '2'},
                    {label: '桶装', value: '3'},
                    {label: '纸托', value: '4'},
                    {label: '木托', value: '5'},
                    {label: '塑料箱', value: '6'},
                    {label: '金属托', value: '7'},
                    {label: '散装', value: '8'},
                    {label: '包', value: '9'},
                    {label: '其他', value: '10'}
                ],
1003 1004
                customCodeList: [],
                airportCode:[],
1005
                dialogStatus: undefined,
1006
                sendStatus: undefined,
1007
                fenStatus:undefined,
1008
                dialogTableVisible: false,
1009
                dialogDeleteVisble: false,
1010
                listLoading: false,
1011 1012
                customLoading:false,
                airportLoading:false,
1013 1014 1015 1016 1017 1018 1019 1020
                disabledStatus: false,
                dialogFormVisible: false,
                countryOption: [],
                countryList: [],
                countryResultList: [],
                awbPiece: undefined,
                awbWeight: undefined,
                preRoles: {
zhangFan authored
1021 1022 1023 1024
                    weight: [{required: true, trigger: 'change', validator: validatorNums}],
                    piece: [{required: true, trigger: 'change', validator: validatorNums}],
                    destinationstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}],
                    originstation: [{required: true, trigger: 'blur', validator: validatorAlphabets}],
1025 1026 1027
                    flightdate: [{required: true, message: '航班日期必须输入', trigger: 'change'}],
                    carrier: [{required: true, trigger: 'blur', validator: validatorAwbh}],
                    flightno: [{required: true, trigger: 'blur', validator: validatorAwbh}],
zhangFan authored
1028
                    actime: [{required: true, trigger: 'blur', message: '预配时间不能为空'}],
1029 1030
                    customcode: [{required: true, message: '关区代码必须选择', trigger: 'change'}],
                    awba: [{required: true, trigger: 'blur', validator: validatorAwb}],
zhangFan authored
1031
                    awbh: [{required: true, trigger: 'blur', validator: validatorAwbh}],
1032
                    'awbinfo.paymodel': [{required: true, message: '付款方式必选', trigger: 'change'}],
1033
                    'awbinfo.awbtype': [{required: true, message: '货物类型必须', trigger: 'change'}],
shenhailong authored
1034
                    goodsname: [{required: true, trigger: 'blur', validator: validAlphabetsSpanceKey}],
zhangFan authored
1035
                    ex5: [{required: true, message: '货物描述不能为空', trigger: 'blur'}],
1036 1037 1038 1039 1040 1041 1042 1043 1044
                    'awbinfo.sairportid': [{required: true, message: '起始航站不能为空', trigger: 'change'}],
                    'awbinfo.shprname': [{required: true, message: '发货人不能为空', trigger: 'change'}],
                    'awbinfo.shprtel': [{required: true, message: '发货电话不能为空', trigger: 'change'}],
                    'awbinfo.shpraddress': [{required: true, message: '发货地址不能为空', trigger: 'change'}],
                    'awbinfo.shprcountyr': [{required: true, message: '国家代码不能为空', trigger: 'change'}],
                    'awbinfo.cnsnname': [{required: true, message: '收货人不能为空', trigger: 'change'}],
                    'awbinfo.cnsntel': [{required: true, message: '收货电话不能为空', trigger: 'change'}],
                    'awbinfo.cnsnaddress': [{required: true, message: '收获地址不能为空', trigger: 'change'}],
                    'awbinfo.cnscountyr': [{required: true, message: '国家代码不能为空', trigger: 'change'}],
zhangFan authored
1045 1046
                    'awbinfo.weight': [{required: true, trigger: 'change', validator: validatorNums}],
                    'awbinfo.pcs': [{required: true, trigger: 'change', validator: validatorNums}],
1047 1048
                },
                preModel: {
1049
                    uuid: undefined,
1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066
                    awba: undefined,
                    awbh: undefined,
                    customcode: undefined,
                    flightno: undefined,
                    carrier: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    piece: undefined,
                    weight: undefined,
                    actime: undefined,
                    goodsname: undefined,
                    splitcode: undefined,
                    uldType: undefined,
                    uldNo: undefined,
                    status: undefined,
                    ex5: undefined,
1067
                    ext3: undefined,
1068 1069 1070
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
1071 1072
                    bookingAgentId: undefined,
                    operatingAgentId: undefined,
shenhailong authored
1073 1074
                    userId: undefined,
                    enterpriseId: undefined,
1075 1076 1077
                    awbinfo: {
                        pcs: undefined,
                        weight: undefined,
zhangFan authored
1078 1079
                        scityid: undefined,
                        ecityid: undefined,
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
                        specopeid: undefined,
                        shprname: undefined,
                        shprmobiletype: undefined,
                        shprtel: undefined,
                        shpraddress: undefined,
                        shprcountyr: undefined,
                        shpcomidpre: undefined,
                        shpaeocode: undefined,
                        shpcomidpno: undefined,
                        shpcitycode: undefined,
                        shpcustomerid: undefined,
                        cnsnname: undefined,
                        cnsrmobiletype: undefined,
                        cnsntel: undefined,
                        cnsnaddress: undefined,
                        cnscountyr: undefined,
                        cnsrctcname: undefined,
                        cnsaeocode: undefined,
                        cnsrctctel: undefined,
                        cnscitycode: undefined,
                        cargonm: undefined,
                        sairportid: undefined,
                        dest1city: undefined,
朱兆平 authored
1103
                        by1: '',
1104 1105 1106 1107 1108 1109 1110
                        dest1: undefined,
                        by2: undefined,
                        dest2: undefined,
                        by3: undefined,
                        dest3: undefined,
                        eairportid: undefined,
                        csgcustomerid: undefined,
1111
                        paymodel: 'PP',
1112 1113 1114 1115
                        awbtype: undefined,
                        dest4:undefined,
                        dest4city:undefined
1116 1117
                    },
                    user: {
1118
                        username: loginedUserInfo().username
1119 1120
                    }
                },
1121 1122 1123 1124 1125 1126 1127 1128
                respModel: {
                    uuid: undefined,
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: '',
                },
                sendDeleteRules:{
1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142
                    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);
                                }
                            }}
                    ],
1143
                },
1144
                preData: [],
1145 1146
                detailData: [],
                rows:[]
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156
            }
        },
        mounted() {
            // 延迟加载,否则会出错
            setTimeout(() => {
                this.countryResultList = this.countryList.map(item => {
                    return {value: item.countryCode, label: item.countryNameCn}
                })
            }, 1000)
        },
1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174
        // deactivated(){
        //         this.preQuery= {
        //                 pageSize: 1,
        //                 limitSize: 30,
        //                 awba: '',
        //                 carrier: '',
        //                 flightno: '',
        //                 flightdate: '',
        //                 originstation: '',
        //                 destinationstation: '',
        //                 userId:loginedUserInfo().userId,
        //                 customCode:'',
        //                 enterpriseId:loginedUserInfo().companyId,
        //                 messageType: ''
        //         }
        //         console.log("distroyed")
        // },
        activated() {
1175
            if (this.$route.params.flightData !== undefined) {
1176 1177
                this.preQuery.carrier = this.$route.params.flightData.flightno.substring(0, 2)
                this.preQuery.flightno = this.$route.params.flightData.flightno.substring(2)
1178
                this.carrierAndFlight = this.$route.params.flightData.flightno;
1179 1180 1181 1182
                this.preQuery.flightdate = this.$route.params.flightData.flightdate
                if (this.$route.params.flightData.awba !== undefined && this.$route.params.flightData.awba !== '') {
                    this.preQuery.awba = this.$route.params.flightData.awba.substring(0, 3) + "-" + this.$route.params.flightData.awba.substring(3)
                }
1183 1184 1185
                this.getList()
            }
            this.getCountryList()
zhangFan authored
1186
            let username = JSON.parse(sessionStorage.getItem('user')).username
1187
            if (username === 'admin') {
zhangFan authored
1188 1189
                this.isAdmin = true
            }
1190
        },
1191 1192

        // 验证
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
        computed: {
            awba: {
                get: function () {
                    return this.preModel.awba
                },
                set: function (val) {
                    if (val.length == 3) {
                        val = val + "-"
                    }
                    this.preModel.awba = val.trim()
                }
            },
            awbh: {
                get: function () {
                    return this.preModel.awbh
                },
                set: function (val) {
                    this.preModel.awbh = val.toUpperCase().trim()
                }
            },
            flightno: {
                get: function () {
                    return this.preModel.flightno
                },
                set: function (val) {
                    this.preModel.flightno = val.toUpperCase().trim()
                }
            },
            carrier: {
                get: function () {
                    return this.preModel.carrier
                },
                set: function (val) {
                    this.preModel.carrier = val.toUpperCase().trim()
                }
            },
            originstation: {
                get: function () {
                    return this.preModel.originstation
                },
                set: function (val) {
                    this.preModel.originstation = val.toUpperCase().trim()
                }
            },
            destinationstation: {
                get: function () {
                    return this.preModel.destinationstation
                },
                set: function (val) {
                    this.preModel.destinationstation = val.toUpperCase().trim()
                }
            },

            goodsname: {
                get: function () {
                    return this.preModel.goodsname
                },
                set: function (val) {
zhangFan authored
1251
                    this.preModel.goodsname = val.toUpperCase()
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266
                }
            },
            specopeid: {
                get: function () {
                    return this.preModel.awbinfo.specopeid
                },
                set: function (val) {
                    this.preModel.awbinfo.specopeid = val.toUpperCase().trim()
                }
            },
            shprname: {
                get: function () {
                    return this.preModel.awbinfo.shprname
                },
                set: function (val) {
zhangFan authored
1267
                    this.preModel.awbinfo.shprname = val.toUpperCase()
1268 1269 1270 1271 1272 1273 1274
                }
            },
            shpraddress: {
                get: function () {
                    return this.preModel.awbinfo.shpraddress
                },
                set: function (val) {
zhangFan authored
1275
                    this.preModel.awbinfo.shpraddress = val.toUpperCase()
1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290
                }
            },
            shprcountyr: {
                get: function () {
                    return this.preModel.awbinfo.shprcountyr
                },
                set: function (val) {
                    this.preModel.awbinfo.shprcountyr = val.toUpperCase().trim()
                }
            },
            shpaeocode: {
                get: function () {
                    return this.preModel.awbinfo.shpaeocode
                },
                set: function (val) {
zhangFan authored
1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307
                    this.preModel.awbinfo.shpaeocode = val.toUpperCase()
                }
            },
            scityid: {
                get: function () {
                    return this.preModel.awbinfo.scityid
                },
                set: function (val) {
                    this.preModel.awbinfo.scityid = val.toUpperCase().trim()
                }
            },
            ecityid: {
                get: function () {
                    return this.preModel.awbinfo.ecityid
                },
                set: function (val) {
                    this.preModel.awbinfo.ecityid = val.toUpperCase().trim()
1308 1309 1310 1311 1312 1313 1314
                }
            },
            cnsnname: {
                get: function () {
                    return this.preModel.awbinfo.cnsnname
                },
                set: function (val) {
zhangFan authored
1315
                    this.preModel.awbinfo.cnsnname = val.toUpperCase()
1316 1317 1318 1319 1320 1321 1322
                }
            },
            cnsnaddress: {
                get: function () {
                    return this.preModel.awbinfo.cnsnaddress
                },
                set: function (val) {
zhangFan authored
1323
                    this.preModel.awbinfo.cnsnaddress = val.toUpperCase()
1324 1325 1326 1327 1328 1329 1330
                }
            },
            cnscountyr: {
                get: function () {
                    return this.preModel.awbinfo.cnscountyr
                },
                set: function (val) {
zhangFan authored
1331
                    this.preModel.awbinfo.cnscountyr = val.toUpperCase()
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351
                }
            },
            cnsrctcname: {
                get: function () {
                    return this.preModel.awbinfo.cnsrctcname
                },
                set: function (val) {
                    this.preModel.awbinfo.cnsrctcname = val.toUpperCase().trim()
                }
            },
            cnsaeocode: {
                get: function () {
                    return this.preModel.awbinfo.cnsaeocode
                },
                set: function (val) {
                    this.preModel.awbinfo.cnsaeocode = val.toUpperCase().trim()
                }
            },
            by1: {
                get: function () {
朱兆平 authored
1352
                    return util.checkNull(this.preModel.awbinfo.by1)?this.preModel.awbinfo.by1:''
1353 1354
                },
                set: function (val) {
朱兆平 authored
1355
                    this.preModel.awbinfo.by1 = util.checkNull(val)?val.toUpperCase().trim():''
1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397
                }
            },
            dest1: {
                get: function () {
                    return this.preModel.awbinfo.dest1
                },
                set: function (val) {
                    this.preModel.awbinfo.dest1 = val.toUpperCase().trim()
                }
            },
            by2: {
                get: function () {
                    return this.preModel.awbinfo.by2
                },
                set: function (val) {
                    this.preModel.awbinfo.by2 = val.toUpperCase().trim()
                }
            },
            dest2: {
                get: function () {
                    return this.preModel.awbinfo.dest2
                },
                set: function (val) {
                    this.preModel.awbinfo.dest2 = val.toUpperCase().trim()
                }
            },
            by3: {
                get: function () {
                    return this.preModel.awbinfo.by3
                },
                set: function (val) {
                    this.preModel.awbinfo.by3 = val.toUpperCase().trim()
                }
            },
            dest3: {
                get: function () {
                    return this.preModel.awbinfo.dest3
                },
                set: function (val) {
                    this.preModel.awbinfo.dest3 = val.toUpperCase().trim()
                }
            },
1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414
            flightComNo: {
                get: function () {
                    return this.carrierAndFlight;
                },
                set: function (val) {
                    val = val.toUpperCase();
                    if (util.checkNull(val) && val.length>=2){
                        this.preQuery.carrier= val.substring(0,2);
                        this.preQuery.flightno = val.substring(2)
                    }else {
                        this.preQuery.carrier= ''
                        this.preQuery.flightno = ''
                    }
                    this.carrierAndFlight =  val

                }
            }
1415 1416 1417 1418
        },
        methods: {
            // >>>>>>>>>>>>>>>>获取list集合<<<<<<<<<<<<<<<<<<
            getList() {
1419
                // console.log("11111"+JSON.stringify(this.preQuery));
1420
                this.listLoading = true
1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439
                // if (this.preQuery.awba !== undefined && this.preQuery.awba !== '') {
                //     console.log("22222"+JSON.stringify(this.preQuery));
                //     getMt2201ListForParam(this.preQuery).then(res => {
                //         this.preData = res.data.data.list
                //         this.total = res.data.data.total
                //         if (res.data.data.list.length > 0) {
                //             this.preQuery.carrier = this.preData[0].carrier
                //             this.preQuery.flightno = this.preData[0].flightno
                //             this.preQuery.flightdate = this.preData[0].flightdate
                //             this.preQuery.originstation = this.preData[0].originstation
                //             this.preQuery.destinationstation = this.preData[0].destinationstation
                //             this.preQuery.customcode = this.preData[0].customcode
                //         }
                //         setTimeout(() => {
                //             this.listLoading = false
                //         }, 1500)
                //     })
                // } else {
                //     console.log("33333"+JSON.stringify(this.preQuery));
1440
                    getMt2201ListForParam(this.preQuery).then(res => {
1441 1442
                        this.preData = res.data.data.list
                        this.total = res.data.data.total
1443 1444 1445 1446
                        setTimeout(() => {
                            this.listLoading = false
                        }, 1500)
                    })
1447
                // }
1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471
            },
            // >>>>>>>>>>>>>>>>重置实体<<<<<<<<<<<<<<<<<<
            restModel() {
                this.preModel = {
                    awba: undefined,
                    awbh: undefined,
                    customcode: undefined,
                    flightno: undefined,
                    carrier: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    piece: undefined,
                    weight: undefined,
                    goodsname: undefined,
                    splitcode: undefined,
                    uldType: undefined,
                    uldNo: undefined,
                    status: undefined,
                    ex5: undefined,
                    awbinfo: {
                        pcs: undefined,
                        weight: undefined,
                        specopeid: undefined,
zhangFan authored
1472 1473
                        scityid: undefined,
                        ecityid: undefined,
1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505
                        shprname: undefined,
                        shprmobiletype: undefined,
                        shprtel: undefined,
                        shpraddress: undefined,
                        shprcountyr: undefined,
                        shpcomidpre: undefined,
                        shpaeocode: undefined,
                        shpcomidpno: undefined,
                        shpcitycode: undefined,
                        shpcustomerid: undefined,
                        cnsnname: undefined,
                        cnsrmobiletype: undefined,
                        cnsntel: undefined,
                        cnsnaddress: undefined,
                        cnscountyr: undefined,
                        cnscomidpre: undefined,
                        cnscomidno: undefined,
                        cnsrctcname: undefined,
                        cnsaeocode: undefined,
                        cnsrctctel: undefined,
                        cnscitycode: undefined,
                        cargonm: undefined,
                        sairportid: undefined,
                        dest1city: undefined,
                        by1: undefined,
                        dest1: undefined,
                        by2: undefined,
                        dest2: undefined,
                        by3: undefined,
                        dest3: undefined,
                        eairportid: undefined,
                        csgcustomerid: undefined,
1506
                        paymodel: 'PP',
1507 1508 1509
                    },
                    user: {
                        username : JSON.parse(sessionStorage.getItem('user')).username
1510 1511
                    }
                }
1512 1513
                this.alert_des = ''
                this.alert_type = 'info'
1514 1515 1516
            },
            // >>>>>>>>>>>>>>>>新增主单<<<<<<<<<<<<<<<<<<
            handleAddpreInfo() {
1517
                this.addloading = false;
shenhailong authored
1518
                this.fenStatus=undefined;
1519
                this.restModel()
1520 1521 1522 1523 1524 1525 1526 1527 1528 1529
                let _this = this;
                getListHzTypeList().then(res => {
                    if (res.data.code == '200') {
                        _this.consignorList = res.data.data.consignorList;
                        _this.operatingAgentList = res.data.data.operatingAgentList;
                        _this.bookingAgentList = res.data.data.bookingAgentList;
                    } else {
                        Message.error("获取货主列表失败")
                    }
                })
1530 1531 1532
                if (this.preQuery.carrier !== undefined){
                    this.preModel.flightno = this.preQuery.carrier+this.preQuery.flightno
                }
1533 1534
                this.preModel.flightdate = this.preQuery.flightdate
                this.preModel.customcode = this.preQuery.customcode
1535 1536
                this.dialogStatus = 'create'
                this.dialogFormVisible = true
shenhailong authored
1537
                this.userId();
1538 1539 1540 1541
                this.$nextTick(() => {
                    this.$refs.preFormData.clearValidate()
                })
            },
1542 1543 1544 1545 1546 1547
            pieceEcho: function(val){
                this.preModel.awbinfo.pcs = val;
            },
            weightEcho: function(val){
                this.preModel.awbinfo.weight = val;
            },
1548 1549 1550
            createData() {
                this.$refs.preFormData.validate(valid => {
                    if (valid) {
zhangFan authored
1551
                        addMt2201(this.preModel).then(res => {
1552
                            if (res.data.code == '200') {
1553 1554 1555 1556
                                Message.success("新增成功")
                                this.dialogFormVisible = false
                                this.getList()
                            } else {
1557
                                Message.error(res.data.msg);
1558 1559 1560 1561 1562
                            }
                        })
                    }
                })
            },
1563 1564 1565 1566 1567 1568 1569
            // 远程获取发货人信息
            consignerSelect(){
                this.dialogSelectVisible = true;
                this.listLoading = true;
                let para = {
                    pageSize: this.consignerQuery.pageSize,
                    limitSize: this.consignerQuery.limitSize,
shenhailong authored
1570
                    companyName: this.consignerQuery.companyName,
1571
                    enterpriseId: loginedUserInfo().companyId
1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595
                };
                getList(para).then((res) => {
                    this.consignerQuery.total = res.data.data.total;
                    this.consignerList = res.data.data.list;
                    this.listLoading = false;
                }).catch((error) => {
                    this.listLoading = false;
                    if(null!= error.response && error.response!==undefined){
                        let status= error.response.status;
                        let msg = error.response.statusText;
                        alert(status+msg);
                    }else {
                        alert(error);
                    }

                });
            },
            // 远程获取收货人信息
            consigneeSelect(){
                this.dialogNeeVisible = true;
                this.listLoading = true;
                let para = {
                    pageSize: this.consigneeQuery.pageSize,
                    limitSize: this.consigneeQuery.limitSize,
shenhailong authored
1596
                    companyName: this.consigneeQuery.companyName,
1597
                    enterpriseId: loginedUserInfo().companyId
1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634
                };
                neeList(para).then((res) => {
                    this.consigneeQuery.total = res.data.data.total;
                    this.consigneeList = res.data.data.list;
                    this.listLoading = false;
                }).catch((error) => {
                    this.listLoading = false;
                    if(null!= error.response && error.response!==undefined){
                        let status= error.response.status;
                        let msg = error.response.statusText;
                        alert(status+msg);
                    }else {
                        alert(error);
                    }

                });
            },
            // 发货人信息赋值
            consignerClick(val){
                this.preModel.awbinfo.shprname=val.conName;
                this.preModel.awbinfo.shpraddress=val.conAddress;
                this.preModel.awbinfo.scityid=val.conCity;
                this.preModel.awbinfo.shprtel=val.conPhone;
                this.preModel.awbinfo.shpaeocode=val.conAeo;
                this.preModel.awbinfo.shprcountyr=val.country;
                this.dialogSelectVisible = false;
            },
            // 收货人信息赋值
            consigneeClick(val){
                this.preModel.awbinfo.cnsnname=val.conName;
                this.preModel.awbinfo.cnsnaddress=val.conAddress;
                this.preModel.awbinfo.ecityid=val.conCity;
                this.preModel.awbinfo.cnsntel=val.conPhone;
                this.preModel.awbinfo.cnsaeocode=val.conAeo;
                this.preModel.awbinfo.cnscountyr=val.country;
                this.dialogNeeVisible = false;
            },
1635 1636
            // >>>>>>>>>>>>>>>>搜索<<<<<<<<<<<<<<<<<<
            handleSerach() {
1637
                this.preQuery.originstation = undefined
1638
                // this.preQuery.flightdate = undefined
1639
                this.preQuery.destinationstation = undefined
1640 1641 1642 1643 1644 1645
                this.getList()
            },
            // >>>>>>>>>>>>>>>>收发明细<<<<<<<<<<<<<<<<<<
            handleSend(row) {
                const resQuery = {
                    carrier: row.carrier,
1646 1647
                    flightno: row.flightno,
                    flightdate: row.flightdate,
1648
                    orpertype: row.orpertype,
1649 1650 1651 1652 1653 1654 1655 1656 1657
                    awba: row.awba,
                    awbh: row.awbh,
                    messageType: 'MT2201'
                }
                this.dialogTableVisible = true
                getResponseForParam(resQuery).then(res => {
                    this.detailData = res.data
                })
            },
1658 1659 1660 1661 1662 1663 1664 1665
            // >>>>>>>>>>>>>>>>多选<<<<<<<<<<<<<<<<<<
            handleSelectionChange(val) {
                this.batchChooseSelection = val;
                this.batchChooseFlag = true;
                if (this.batchChooseSelection.length == 0){
                    this.batchChooseFlag = false;
                }
            },
1666
            // >>>>>>>>>>>>>>>>发送舱单报<<<<<<<<<<<<<<<<<<
1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678
            handleAwbSend(id) {
                let checkArr = "";
                let ids = [];
                if (id !== undefined && id !== ""){
                    ids.push(id);
                }else {
                    checkArr = this.batchChooseSelection;
                    checkArr.forEach(function (item) {
                        ids.push(item.uuid);
                    })

                }
1679 1680 1681 1682 1683
                this.$confirm("是否发送", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '发送',
                    cancelButtonText: '取消'
                }).then(() => {
1684
                    const form = new FormData()
1685
                    form.append("username", loginedUserInfo().username);
1686 1687 1688 1689
                    form.append("ids", ids);
                    sendCreateMt2201(form).then(res => {
                        if (res.data.code == "200") {
                            Message.success(res.data.msg)
1690 1691
                            this.rows.status="23";
                            this.rows.ext5="新增报发送成功";
1692
                        } else {
1693
                            Message.error(res.data.msg)
1694 1695 1696
                        }
                    })
                })
1697
1698
            },
1699 1700 1701 1702 1703 1704 1705 1706
            // 发送舱单报 按钮自灰
            addStatus(status){
                if(status=='23' || status=='24'||status=='25'){
                    return true;
                }else if(status=='22' ) {
                    return false;
                }
            },
1707 1708
            // >>>>>>>>>>>>>>>>更新运单数据<<<<<<<<<<<<<<<<<<
            handleEdit(row) {
1709 1710
                this.dialogStatus = undefined;
                this.fenStatus = undefined;
1711
                this.preModel = Object.assign({}, row)
shenhailong authored
1712
                this.userId();
1713
                this.preModel.flightno = row.carrier+row.flightno;
1714
                this.dialogStatus = 'update'
1715 1716 1717 1718
                if (row.awbh !== undefined && row.awbh !== ""){
                    this.fenStatus = 'addAwbh'
                }
1719 1720 1721 1722 1723 1724
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.preFormData.clearValidate()
                })
            },
            updateData() {
1725
                let _this = this;
1726 1727 1728 1729
                this.$refs.preFormData.validate(valid => {
                    if (valid) {
                        delete this.preModel.parent
                        delete this.preModel.children
1730
                        _this.preModel.user= {
1731
                            username : loginedUserInfo().username
1732 1733 1734
                        }

                        updateMT2201(_this.preModel).then(res => {
1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747
                            if (res.data.code == "200") {
                                Message.success(res.data.msg)
                                _this.dialogFormVisible = false
                                _this.getList()
                            } else if (res.data.code == "201"){
                                _this.preModel.flightno=_this.preModel.carrier+_this.preModel.flightno
                                Message.error(res.data.msg);
                            }else if (res.data.code == "202"){
                                _this.preModel.flightno=_this.preModel.carrier+_this.preModel.flightno
                                Message.error(res.data.msg)
                            }else if (res.data.code == "203"){
                                _this.preModel.flightno=_this.preModel.carrier+_this.preModel.flightno
                                Message.error(res.data.msg)
1748 1749 1750 1751 1752 1753
                            }
                        })
                    }
                })
            },
            // >>>>>>>>>>>>>>>>发送修改报<<<<<<<<<<<<<<<<<<
1754 1755 1756 1757 1758 1759 1760
            handleAwbEdit(id) {
                this.batchModel();
                this.restModel.uuid = id;
                this.sendStatus = 'edit';
                this.dialogDeleteVisble = true;
                this.$nextTick(()=>{
                    this.$refs.sendDeleteForm.clearValidate()
1761
                })
1762
            },
1763 1764 1765 1766 1767 1768 1769 1770
            // 发送修改报自灰
            editStatus(status){
                if(status=='23' || status=='24'||status=='25'){
                    return true;
                }else if(status=='25' ) {
                    return false;
                }
            },
1771
            sendUpdate(){
1772
                this.$refs.sendDeleteForm.validate(valid =>{
1773
                    if(valid){
1774 1775 1776 1777 1778 1779 1780 1781 1782 1783
                        let checkArr = "";
                        let ids = [];
                        if (this.restModel.uuid !== undefined && this.restModel.uuid !== ""){
                            ids.push(this.restModel.uuid);
                        }else {
                            checkArr = this.batchChooseSelection;
                            checkArr.forEach(function (item) {
                                ids.push(item.uuid);
                            })
                        }
1784
                        const form = new FormData()
1785
                        form.append("username", loginedUserInfo().username);
1786 1787 1788 1789 1790 1791 1792
                        form.append("ids", ids);
                        form.append("reason", this.respModel.reason);
                        form.append("contactName", this.respModel.contactName);
                        form.append("contactTel", this.respModel.contactTel);
                        sendUpdateMt2201(form).then(res =>{
                            if(res.data.code =="200"){
                                Message.success(res.data.msg)
1793 1794
                                this.rows.status="25";
                                this.rows.ext5="修改报发送成功";
1795
                                this.dialogDeleteVisble = false
1796
                            }else {
1797
                                Message.error(res.data.msg)
1798 1799 1800 1801
                            }
                        })
                    }
                })
1802
            },
1803
1804
            // >>>>>>>>>>>>>>>>发送删除报<<<<<<<<<<<<<<<<<<
1805 1806 1807 1808 1809
            handleSendDelete(id) {
                this.batchModel();
                this.restModel.uuid = id;
                this.sendStatus = "remove";
                this.dialogDeleteVisble = true;
1810 1811 1812 1813
                this.$nextTick(()=>{
                    this.$refs.sendDeleteForm.clearValidate()
                })
            },
1814 1815 1816 1817 1818 1819 1820 1821
            // 发送删除报按钮自灰
            deleteStatus(status){
                if(status=='23' || status=='24'||status=='25'){
                    return true;
                }else if(status=='24' ) {
                    return false;
                }
            },
1822 1823 1824
            sendDelete() {
                this.$refs.sendDeleteForm.validate(valid =>{
                    if(valid){
1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835
                        let checkArr = "";
                        let ids = [];
                        if (this.restModel.uuid !== undefined && this.restModel.uuid !== ""){
                            ids.push(this.restModel.uuid);
                        }else {
                            checkArr = this.batchChooseSelection;
                            checkArr.forEach(function (item) {
                                ids.push(item.uuid);
                            })
                        }
                        const form = new FormData()
1836
                        form.append("username", loginedUserInfo().username);
1837 1838 1839 1840 1841 1842 1843 1844
                        form.append("ids", ids);
                        form.append("reason", this.respModel.reason);
                        form.append("contactName", this.respModel.contactName);
                        form.append("contactTel", this.respModel.contactTel);
                        form.append("content", this.respModel.content);
                        sendDeleteMt2201(form).then(res => {
                            if(res.data.code=="200"){
                                Message.success(res.data.msg)
1845 1846
                                this.rows.status="24";
                                this.rows.ext5="删除报发送成功";
1847
                                this.dialogDeleteVisble = false
1848
                            }else {
1849
                                Message.error(res.data.msg)
1850 1851 1852 1853 1854 1855
                            }
                        })
                    }
                })
            },
            //>>>>>>>>>>>>>>>>删除运单<<<<<<<<<<<<<<<<<<
1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893
            handleAwbDelete(row) {
                delete row.parent
                delete row.children
                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(() => {
1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910
                    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: '状态更改失败,请稍后重试'
                    //         })
                    //     }
                    // })
1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924

                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消状态更改'
                            : '状态更改取消'
                    })
                })
            },
            // >>>>>>>>>>>>>>>>新增分单<<<<<<<<<<<<<<<<<<
            handleAddAwbh(row) {
                this.restModel()
                const template = Object.assign({}, row) // copy obj
1925
                this.preModel.uuid = template.uuid
1926 1927
                this.preModel.awba = template.awba
                this.preModel.flightdate = template.flightdate
shenhailong authored
1928
                this.preModel.flightno = template.carrier+template.flightno
1929 1930 1931 1932
                this.preModel.destinationstation = template.destinationstation
                this.preModel.customcode = template.customcode
                this.preModel.awbinfo.shprcountyr = template.awbinfo.shprcountyr
                this.preModel.originstation = template.originstation
1933
                this.preModel.awbinfo.paymodel = template.awbinfo.paymodel
1934 1935 1936
                this.preModel.awbinfo.sairportid = template.awbinfo.sairportid
                this.preModel.awbinfo.eairportid = template.awbinfo.eairportid
                this.preModel.awbinfo.ex5 = template.awbinfo.ex5
1937 1938 1939 1940 1941 1942 1943
                this.preQuery.awba = template.awba
                this.preQuery.flightdate = template.flightdate
                this.preQuery.flightno = template.flightno
                this.preQuery.originstation = template.originstation
                this.preQuery.destinationstation = template.destinationstation
                this.preQuery.customcode = template.customcode
                this.preQuery.carrier = template.carrier
shenhailong authored
1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962
                // getMt2201ListForParam(this.preQuery).then(res => {
                //     this.awbPiece = 0
                //     this.awbWeight = 0
                //     let residuePiece = 0
                //     let residueWeight = 0
                //     const childrenList = res.data.dataList[0].children
                //
                //     if (childrenList.length < 1) {
                //         this.awbPiece = res.data.dataList[0].piece
                //         this.awbWeight = res.data.dataList[0].weight
                //     } else {
                //         for (var i = 0; i < childrenList.length; i++) {
                //             residuePiece += childrenList[i].piece
                //             residueWeight += childrenList[i].weight
                //         }
                //         this.awbPiece = res.data.dataList[0].piece - residuePiece
                //         this.awbWeight = res.data.dataList[0].weight - residueWeight
                //     }
                // })
1963 1964
                this.dialogStatus = 'create'
                this.fenStatus = 'addAwbh'
1965 1966 1967 1968 1969
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.preFormData.clearValidate()
                })
            },
1970
            //获取国家列表
1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988
            getCountryList() {
                getCountry().then(res => {
                    this.countryList = res.data.dataList
                })
            },
            remoteMethod(query) {
                if (query !== '') {
                    this.listLoading = true
                    setTimeout(() => {
                        this.listLoading = false
                        this.countryOption = this.countryResultList.filter(item => {
                            return item.value.toUpperCase().trim()
                                .indexOf(query.toUpperCase()) > -1
                        })
                    }, 200)
                } else {
                    this.countryOption = []
                }
1989
            },
1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004
            remoteMethodAirport(query){
                this.airportCode = []
                if (query !== '') {
                    this.airportLoading = true
                    getAirportCode({airportid: query}).then(res => {
                        if(res !== null){
                            setTimeout(() => {
                                this.airportLoading = false
                                this.airportCode = res.data.data
                            }, 200)
                        }
                    })
                } else {
                    this.airportCode = []
                }
2005
            },
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021

            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 = []
                }
2022
            },
2023
2024 2025 2026 2027 2028 2029 2030 2031
            handleAddpre() {
                const row = {
                    'messageType': 'MT2201'
                }
                this.$router.push({name: "出港航班信息", params: {scopeRow: row}})
            },

            handelBackStep() {
2032 2033
                this.preQuery.messageType = 'MT2201'
                this.$router.push({name: '出港航班信息', params: {scopeRow: this.preQuery}})
2034 2035 2036 2037 2038 2039 2040 2041 2042
            },
            // 导入excel
            fileExceed(){
                this.$message.error('别贪心!一次只能上传一个哦~');
            },
            // 自定义上传
            uploadFile (item) {
                const form = new FormData()
                form.append('file', item.file)
2043 2044 2045
                form.append('userId', loginedUserInfo().userId);
                form.append('enterpriseId', loginedUserInfo().companyId);
                form.append("username", loginedUserInfo().username);
2046
                uploadFileExcel(form).then(res =>{
2047
                    if(res.data.code =='200'){
2048
                        Message.success(res.data.msg)
2049 2050
                        this.getList();
                    }else {
2051
                        Message.error(res.data.msg)
2052 2053
                    }
                })
shenhailong authored
2054
            },
shenhailong authored
2055 2056 2057 2058 2059 2060
            //模板下载
            download () {
                window.location.href = 'http://localhost:12021/static/excel导入模板.xls'
            },
            // 用户id 企业id 赋值
            userId(){
2061 2062
                this.preModel.userId = loginedUserInfo().userId;
                this.preModel.enterpriseId = loginedUserInfo().companyId;
2063 2064 2065 2066
            },

            // 远程查询运输工具申报是否成功
            transportQuery(){
2067
                let _this = this
2068 2069
                if (this.preModel.flightno != undefined && this.preModel.flightno != ''
                    && this.preModel.flightdate != undefined && this.preModel.flightdate != ''){
2070 2071 2072 2073 2074 2075
                    const params = {
                        flightNo: this.preModel.flightno,
                        flightDate: this.preModel.flightdate
                    }
                    selectPredictionInterface(params).then(res =>{
                        if(res.data.data != undefined && res.data.data != ""){
2076 2077 2078 2079 2080 2081 2082 2083
                            let ysgj_data = res.data.data[0]
                            let ysgj_status = ysgj_data.status
                            if (ysgj_status === '02'){
                                _this.alert_type = 'success'
                            }else{
                                _this.alert_type = 'warning'
                            }
                            _this.alert_des = ysgj_data.statusMsg
2084
                        }else {
2085 2086
                            _this.alert_des = "此航班的运输工具申报未做预报动态申报."
                            _this.alert_type = 'error'
2087 2088 2089
                        }
                    })
                }
2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100
            },

            // 批量实体充值
            batchModel(){
                this.respModel = {
                    uuid: undefined,
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: '',
                }
shenhailong authored
2101
            }
2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149
        }
    }

</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-btn {
        margin-left: 10px;
        display: inline-block;
    }

    .el-dialog-div {
        height: 60vh;
        overflow: auto;
    }

    .tableInline {
        line-height: 8px;
    }
2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192
    .el-dialog-div{
        height: 60vh;
        overflow: auto;
    }

    .el-dialog-div .flight-info .select-lable{
        line-height: 27px;
        float:left;
        width:98px;
        font-size:12px;
        text-align: center;
    }

    .el-dialog-div .flight-info .select-lable{
        line-height: 27px;
        float:left;
        width:98px;
        font-size:12px;
        text-align: center;
    }

    .el-dialog-div .flight-info .el-select--mini{
        width: calc(100% - 100px)!important;
    }

    .el-dialog-div .flight-info .el-select--mini .el-input__inner,.el-dialog-div .flight-info .el-date-editor .el-input__inner{
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
    .bpp .el-input__inner {
        background-color: #fff;
        border: 0px;
    }
    .sun{
        position: absolute;
        top: 5px;
        left: 0px;
    }
    .suns{
        position: absolute;
        top: 5px;
        left: 0px;
    }
2193
</style>