审查视图

src/views/nmms/ExitPre.vue 92.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<template>
    <!--<div class="app-container">-->
    <div>
        <div>
            <el-row class="row-bg">
                <el-col :span="24">
                    <div class="grid-content content">航班信息</div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content co">
                        <el-col :span="1">
                            <div class="grid-content"></div>
                        </el-col>
                        <el-col :span="20">
                            <div class="grid-content">
16 17 18
                                <span class="titleSpan">航班号:{{this.preQuery.carrier}}{{this.preQuery.flightno}}</span>
                                <span class="titleSpan">航班日期:{{this.preQuery.flightdate}}</span>
                                <span class="titleSpan">航段:{{this.preQuery.originstation}}-{{this.preQuery.destinationstation}}</span>
19 20 21 22 23 24 25
                            </div>
                        </el-col>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content content">预配舱单查询</div>
                </el-col>
shenhailong authored
26
                <el-col :span="22">
27 28 29 30 31 32 33 34
                    <div class="grid-content co">
                        <el-col :span="1">
                            <div class="grid-content"></div>
                        </el-col>
                        <el-col :span="22">
                            <div class="grid-content">
                                <el-col :span="4">
                                    <div class="grid-content">
35
                                        <el-input v-model="preQuery.awba"  placeholder="请输入主单号" clearable></el-input>
36 37 38
                                    </div>
                                </el-col>
                                <div class="grid-content el-btn">
39
                                    <el-button type="warning" style="width:150px" size="medium" icon="el-icon-search" @click="handleSerach">查询</el-button>
40
                                    <el-button v-if="preQuery.flightno === undefined && preData.length<1" type="primary"
41
                                               style="width:150px" size="medium" icon="el-icon-plus"
42 43
                                               @click="handleAddpre">新增预配舱单
                                    </el-button>
44 45 46 47 48 49 50 51
                                    <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">
52
                                        <el-button slot="trigger" style="width:150px" size="medium" icon="el-icon-folder-add" type="success">导入excel</el-button>
53
                                    </el-upload>
54 55 56 57 58 59 60 61 62 63 64
                                </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>
65 66 67
        <el-table :data="preData" stripe
                  style="border-radius: 10px 10px 0px 0px;line-height: 25px;" stripe
                  :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
68 69 70 71 72 73 74
                    @selection-change="handleSelectionChange" v-loading="listLoading"
                  default-expand-all
                  row-key="uuid"
                  border
                  :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
            <el-table-column type="selection" width="55">
            </el-table-column>
75
            <el-table-column label="运单号" width="200" align="center">
76
                <template slot-scope="scope">
77 78
                    <span class="tableInline" v-if="scope.row.awbh !==''">{{scope.row.awbh}}</span>
                    <span class="tableInline" v-else>{{scope.row.awba}}</span>
79 80 81 82
                </template>
            </el-table-column>
            <el-table-column label="运单件数/重量" width="100" align="center">
                <template slot-scope="scope">
83
                   {{scope.row.awbinfo.pcs}}/{{scope.row.awbinfo.weight}}
84 85 86 87
                </template>
            </el-table-column>
            <el-table-column label="预配件数/重量" width="100" align="center">
                <template slot-scope="scope">
88
                    {{scope.row.piece}}/{{scope.row.weight}}
89 90 91 92 93 94 95 96 97 98 99 100 101 102
                </template>
            </el-table-column>
            <el-table-column label="货物描述" width="120" align="center">
                <template slot-scope="scope">
                    {{scope.row.goodsname}}
                </template>
            </el-table-column>
            <el-table-column label="配载时间" width="140" align="center">
                <template slot-scope="scope">
                    {{scope.row.actime}}
                </template>
            </el-table-column>
            <el-table-column label="状态" width="100" align="center">
                <template slot-scope="scope">
103 104 105
                    <span v-if="scope.row.status ==='01'">接受申报</span>
                    <span v-if="scope.row.status ==='02'">待人工审核</span>
                    <span v-if="scope.row.status ==='03'">退单</span>
106 107 108 109 110 111
                    <span v-if="scope.row.status ==='05'">舱单报退单</span>
                    <span v-if="scope.row.status ==='06'">舱单转人工</span>
                    <span v-if="scope.row.status ==='07'">舱单报申报成功</span>
                    <span v-if="scope.row.status ==='08'">已发舱单删除报</span>
                    <span v-if="scope.row.status ==='09'">舱单删除报退单</span>
                    <span v-if="scope.row.status ==='10'">舱单删除报转人工</span>
112 113 114
                    <span v-if="scope.row.status ==='11'">放行</span>
                    <span v-if="scope.row.status ==='12'">拒装</span>
                    <span v-if="scope.row.status ==='13'">禁卸</span>
115 116 117
                    <span v-if="scope.row.status ==='14'">舱单修改报转人工</span>
                    <span v-if="scope.row.status ==='15'">舱单修改报成功</span>
                    <span v-if="scope.row.status ==='16'">海关已存在</span>
118 119 120 121 122
                    <span v-if="scope.row.status ==='21'">可自动发送</span>
                    <span v-if="scope.row.status ==='22'">未发送</span>
                    <span v-if="scope.row.status ==='23'">已发送新增报</span>
                    <span v-if="scope.row.status ==='24'">已发送删除报</span>
                    <span v-if="scope.row.status ==='25'">已发送修改报</span>
123 124 125 126 127 128 129
                </template>
            </el-table-column>
            <el-table-column prop="receipt" label="回执信息" align="center">
                <template slot-scope="scope">
                    {{scope.row.ext5}}
                </template>
            </el-table-column>
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
            <el-table-column label="操作" width="450px" fixed="right" align="center">
                <template slot-scope="scope" >
                    <el-row>
                        <el-col :span="5" style="margin-right: 10px">
                            <el-button type="warning" icon="el-icon-view" size="mini"@click="handleSend(scope.row)">收发明细</el-button>
                        </el-col>
                        <el-col :span="4" style="margin-right: 30px">
                            <el-button type="primary" icon="el-icon-edit" style="width: 100px" size="mini" @click="handleEdit(scope.row)" >编辑</el-button>
                        </el-col>
                        <el-col :span="5" style="margin-right: 10px">
                            <el-button type="info" icon="el-icon-edit" size="mini" @click="handleAwbStatus(scope.row)"
                                       :disabled="scope.row.status === '22'">更改状态
                            </el-button>
                        </el-col>
                        <el-col :span="5">
                            <el-button type="success" icon="el-icon-plus" size="mini" v-if="scope.row.awbh ===''"
                                       @click="handleAddAwbh(scope.row)">新增分单
                            </el-button>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="7" style="margin-right: 10px">
                            <el-button type="success" icon="el-icon-plus" size="mini" style="width: 130px"  @click="handleAwbSend(scope.row)"
                                       :disabled="addStatus(scope.row.status)">发送预配舱单报
                            </el-button>
                        </el-col>
                        <el-col :span="7" style="margin-right: 10px">
                            <el-button type="primary" icon="el-icon-plus" size="mini" style="width: 130px"  @click="handleAwbEdit(scope.row)"
                                       :disabled="editStatus(scope.row.status)">发送预配修改报</el-button>
                            <!--                    <el-button size="mini" type="danger" v-if="isAdmin"  @click="handleAwbDelete(scope.row)">删除运单</el-button>-->
                        </el-col>
                        <el-col :span="7">
                            <el-button type="danger" icon="el-icon-delete" size="mini" style="width: 130px;margin-bottom: 10px"  @click="handleSendDelete(scope.row)"
                                       :disabled="deleteStatus(scope.row.status)">发送预配删除报</el-button>
                        </el-col>
                    </el-row>
167 168
                </template>
            </el-table-column>
169
        </el-table>
170 171
        <div class="btnFoot">
            <el-row>
172
                <el-button type="primary" size="mini" v-if="preQuery.flightno !== undefined | preData.length > 0"
173 174 175
                           @click="handleAddpreInfo">新增预配舱单
                </el-button>
                <el-button type="primary" size="mini" @click="handelBackStep"
176
                           v-if="preQuery.flightno !== undefined || preData.length >0">返回
177 178 179
                </el-button>
            </el-row>
        </div>
180 181

        <pagination background layout="total, prev, pager, next" v-show="total>0" :total="total" :page.sync="preQuery.pageSize" :limit.sync="preQuery.limitSize"
182
                    @pagination="getList"/>
183
184 185
        <el-dialog  top="5vh" :title="dialogMap[dialogStatus]" :visible.sync="dialogFormVisible" width="90%">
            <el-form ref="preFormData" :model="preModel"  :rules="preRoles" label-position="right"
186
                     label-width="80px" size="mini" class="el-dialog-div">
shenhailong authored
187
                <div class="grid-content content" style="font-size: 10px">
188 189 190 191
                    运单信息
                </div>
                <el-row>
                    <el-col :span="7.5">
192 193 194 195
                        <el-form-item label="" prop="awba">
                            <el-input :disabled="dialogStatus !== 'create'" v-model="awba" clearable>
                            <template  slot="prepend" >主单号</template>
                            </el-input>
196 197
                        </el-form-item>
                    </el-col>
198
                    <el-col :span="7.5" v-if="fenStatus === 'addAwbh'">
199 200 201 202
                        <el-form-item label="" prop="awbh">
                            <el-input v-model="awbh" clearable>
                                <template  slot="prepend" >分单号</template>
                            </el-input>
203 204 205
                        </el-form-item>
                    </el-col>
                </el-row>
shenhailong authored
206
                <div class="grid-content content" style="font-size: 10px">
207 208 209 210
                    航班信息
                </div>
                <el-row>
                    <el-col :span="7.5">
211 212 213 214
                        <el-form-item label="" prop="carrier">
                            <el-input v-model="carrier" :disabled="fenStatus === 'addAwbh'" clearable>
                            <template  slot="prepend" >承运人</template>
                            </el-input>
215 216 217
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
218 219 220 221
                        <el-form-item label="" prop="flightno">
                            <el-input v-model="flightno" :disabled="fenStatus === 'addAwbh'" clearable>
                                <template  slot="prepend" >航班号</template>
                            </el-input>
222 223 224
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
225
                        <el-form-item label="" prop="flightdate">
226
                            <el-date-picker :disabled="fenStatus === 'addAwbh'"
227
                                            value-format="yyyy-MM-dd" style="width: 270px"
228 229 230 231 232
                                            v-model="preModel.flightdate" align="right"
                                            type="date" placeholder="请输入航班日期" clearable/>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
233
                        <el-form-item label="" prop="originstation">
234 235 236 237 238 239 240
                            <el-select
                                    filterable
                                    clearable
                                    placeholder="请选择起始站"
                                    :remote-method="remoteMethodAirport"
                                    allow-create remote
                                    v-model="originstation"
241 242
                                    :loading="airportLoading"
                            style="width: 270px">
243 244
                                <el-option v-for="item in airportCode"
                                           :key="item.airportid" :label="item.airportid"
245
                                           :value="item.airportid" :disabled="fenStatus === 'addAwbh'">
246 247 248 249
                                    <span style="float: left">{{ item.airportdescchn }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
                                </el-option>
                            </el-select>
250 251 252
                        </el-form-item>
                    </el-col>
                    <el-col :span="7.5">
253
                        <el-form-item label="" prop="destinationstation">
254
                            <el-select filterable clearable placeholder="请选择目的站" allow-create remote
255
                                       v-model="destinationstation" :remote-method="remoteMethodAirport" style="width: 270px">
256 257
                                <el-option v-for="item in airportCode"
                                           :key="item.airportid" :label="item.airportid"
258
                                           :value="item.airportid" :disabled="fenStatus === 'addAwbh'" >
259 260 261 262
                                    <span style="float: left">{{ item.airportdescchn }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.airportid }}</span>
                                </el-option>
                            </el-select>
263 264 265
                        </el-form-item>
                    </el-col>
                </el-row>
shenhailong authored
266
                <div class="grid-content content" style="font-size: 10px">
zhangFan authored
267
                    航程信息
268
                </div>
zhangFan authored
269 270
                <div>
                    <el-row>
271 272 273 274 275
                        <el-col :span="5">
                            <el-form-item label="" prop="carrier">
                                <el-input v-model="carrier" disabled clearable>
                                <template  slot="prepend" >承运人</template>
                                </el-input>
zhangFan authored
276 277
                            </el-form-item>
                        </el-col>
278 279 280 281 282
                        <el-col :span="5">
                            <el-form-item label="" prop="destinationstation">
                                <el-input v-model="destinationstation" disabled clearable>
                                    <template  slot="prepend" >到达航站</template>
                                </el-input>
zhangFan authored
283 284
                            </el-form-item>
                        </el-col>
285 286 287 288 289
                        <el-col :span="5">
                            <el-form-item label="">
                                <el-input v-model="by1" clearable>
                                    <template  slot="prepend" >承运人1</template>
                                </el-input>
zhangFan authored
290 291
                            </el-form-item>
                        </el-col>
292 293 294 295 296
                        <el-col :span="5">
                            <el-form-item label="">
                                <el-input v-model="dest1" clearable>
                                    <template  slot="prepend" >到达航站1</template>
                                </el-input>
zhangFan authored
297 298
                            </el-form-item>
                        </el-col>
299 300 301 302 303
                        <el-col :span="5">
                            <el-form-item label="">
                                <el-input v-model="by2" clearable>
                                    <template  slot="prepend" >承运人2</template>
                                </el-input>
zhangFan authored
304 305
                            </el-form-item>
                        </el-col>
306 307 308 309 310
                        <el-col :span="5">
                            <el-form-item label="">
                                <el-input v-model="dest2" clearable>
                                    <template  slot="prepend" >到达航站2</template>
                                </el-input>
zhangFan authored
311 312 313 314
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
shenhailong authored
315
                <div class="grid-content content" style="font-size: 10px">
zhangFan authored
316 317
                    货物信息
                </div>
318
                <el-row>
319 320 321 322 323
                    <el-col :span="5">
                        <el-form-item label="" prop="awbinfo.pcs">
                            <el-input v-model="preModel.awbinfo.pcs" clearable>
                                <template  slot="prepend" >运单件数</template>
                            </el-input>
324 325
                        </el-form-item>
                    </el-col>
326 327 328 329 330
                    <el-col :span="5">
                        <el-form-item label="" prop="awbinfo.weight">
                            <el-input v-model="preModel.awbinfo.weight" clearable>
                                <template  slot="prepend" >运单重量</template>
                            </el-input>
331 332
                        </el-form-item>
                    </el-col>
333 334 335 336 337
                    <el-col :span="5">
                        <el-form-item label="" prop="goodsname">
                            <el-input v-model="goodsname" clearable>
                                <template  slot="prepend" >货物描述</template>
                            </el-input>
338 339
                        </el-form-item>
                    </el-col>
340 341 342 343 344
                    <el-col :span="5" v-if="fenStatus !=='addAwbh'">
                        <el-form-item label="" prop="piece">
                            <el-input v-model="preModel.piece" clearable>
                                <template  slot="prepend" >预配件数</template>
                            </el-input>
345 346
                        </el-form-item>
                    </el-col>
347 348 349 350 351
                    <el-col :span="5" v-if="fenStatus ==='addAwbh'">
                            <el-form-item label="" prop="piece">
                                <el-input v-model="preModel.piece" clearable>
                                    <template  slot="prepend" >预配件数</template>
                                </el-input>
352
                            </el-form-item>
shenhailong authored
353
                    </el-col>
354 355 356 357 358
                    <el-col :span="5" v-if="fenStatus !=='addAwbh'">
                        <el-form-item label="" prop="weight">
                            <el-input v-model="preModel.weight" clearable>
                                <template  slot="prepend" >预配重量</template>
                            </el-input>
359 360
                        </el-form-item>
                    </el-col>
361 362 363 364 365
                    <el-col :span="5" v-if="fenStatus ==='addAwbh'">
                        <el-form-item label="" prop="weight">
                            <el-input v-model="preModel.weight" clearable>
                                <template  slot="prepend" >预配重量</template>
                            </el-input>
shenhailong authored
366 367
                        </el-form-item>
                    </el-col>
368 369
                    <el-col :span="5">
                        <el-form-item label="" prop="actime">
370
                            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss"
371 372
                                            v-model="preModel.actime" align="right" style="width: 180px"
                                            type="datetime" placeholder="请选择预配时间"/>
373 374
                        </el-form-item>
                    </el-col>
375 376
                    <el-col :span="5">
                        <el-form-item  label="" prop="customcode">
shenhailong authored
377
                            <el-select  v-model="preModel.customcode"  placeholder="请选择关区代码"
378
                                       filterable clearable :remote-method="remoteMethodCustomCode" :loading="customLoading" remote
379
                                       :disabled="fenStatus === 'addAwbh'">
380 381 382 383 384
                                <el-option v-for="item in customCodeList" :key="item.customcode" :label="item.customcode"
                                           :value="item.customcode">
                                    <span style="float: left">{{ item.customcode }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.customname }}</span>
                                </el-option>
385 386 387
                            </el-select>
                        </el-form-item>
                    </el-col>
388 389
                    <el-col :span="5">
                        <el-form-item label="">
390
                            <el-select v-model="preModel.awbinfo.awbtype" class="filter-item" placeholder="请录入货物类型">
391 392 393 394
                                <el-option v-for="item in customTypes" :key="item.value"
                                           :label="item.label"
                                           :value="item.value">
                                </el-option>
395 396 397
                            </el-select>
                        </el-form-item>
                    </el-col>
398 399 400
                    <el-col :span="5">
                        <el-form-item label="" prop="awbinfo.paymodel">
                            <el-select v-model="preModel.awbinfo.paymodel" class="filter-item" placeholder="请选择付费方式">
401 402 403 404
                                <el-option
                                        v-for="item in payTypes"
                                        :key="item.value"
                                        :label="item.label"
405 406
                                        :value="item.value">
                                </el-option>
407 408 409
                            </el-select>
                        </el-form-item>
                    </el-col>
410 411 412 413 414
                    <el-col :span="5">
                        <el-form-item label="" prop="">
                            <el-input v-model="specopeid" clearable>
                                <template  slot="prepend" >卸货地</template>
                            </el-input>
415 416
                        </el-form-item>
                    </el-col>
417 418 419 420 421
                    <el-col :span="5">
                        <el-form-item  label="" prop="">
                            <el-input v-model="preModel.awbinfo.shpcustomerid" clearable>
                                <template  slot="prepend" >代理人代码</template>
                            </el-input>
422 423
                        </el-form-item>
                    </el-col>
424 425 426 427 428
                    <el-col :span="5">
                        <el-form-item label="" prop="">
                                <el-input v-model="preModel.awbinfo.shpcustomerid" clearable>
                                    <template  slot="prepend" >代理人名称</template>
                                </el-input>
429 430 431
                        </el-form-item>
                    </el-col>
                </el-row>
432 433 434 435 436 437 438 439 440 441 442 443 444
                <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>
shenhailong authored
445
                <div class="grid-content content" style="font-size: 10px">
446
                    发货人信息
447
                    <el-button type="primary" size="mini" @click="consignerSelect()">选择发货人信息</el-button>
448 449
                </div>
                <el-row>
450 451 452 453 454
                    <el-col :span="5">
                        <el-form-item  label="" prop="awbinfo.shprname">
                            <el-input v-model="shprname" clearable>
                                <template  slot="prepend" >发货人名称</template>
                            </el-input>
455 456
                        </el-form-item>
                    </el-col>
457 458 459 460 461
                    <el-col :span="5">
                        <el-form-item label="" prop="awbinfo.shpraddress">
                            <el-input  v-model="shpraddress" clearable>
                                <template  slot="prepend" >地址</template>
                            </el-input>
462 463
                        </el-form-item>
                    </el-col>
464 465 466 467 468
                    <el-col :span="5">
                        <el-form-item label="">
                            <el-input v-model="scityid" maxlength="5" clearable>
                                <template  slot="prepend" >城市代码</template>
                            </el-input>
469 470
                        </el-form-item>
                    </el-col>
471 472 473 474 475
                    <el-col :span="5">
                        <el-form-item label="">
                            <el-input v-model="preModel.awbinfo.shprmobiletype" clearable>
                                <template  slot="prepend" >传真</template>
                            </el-input>
476 477
                        </el-form-item>
                    </el-col>
478 479
                    <el-col :span="5">
                        <el-form-item label="" prop="awbinfo.shprcountyr">
480 481 482 483 484
                            <el-select
                                    :remote-method="remoteMethod"
                                    :loading="listLoading"
                                    v-model="shprcountyr"
                                    filterable
朱兆平 authored
485
                                    allow-create
486
                                    remote
487
                                    placeholder="请选择国家代码" clearable>目的站
488 489 490 491 492 493 494 495 496 497 498
                                <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>
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
                    <el-col :span="7.5">
                        <el-form-item label="" prop="awbinfo.shprtel">
                            <el-input  v-model="preModel.awbinfo.shprtel" clearable>
                                <template  slot="prepend" >电话</template>
                            </el-input>
                        </el-form-item>
                    </el-col>

                    <el-col :span="7.5">
                        <el-form-item label="" prop="awbinfo.shpaeocode">
                            <el-input v-model="shpaeocode" clearable style="width: 270px">
                                <template  slot="prepend" >发货人AEO编码</template>
                            </el-input>
                        </el-form-item>
                    </el-col>
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
                    <!--<el-col :span="7.5">-->
                    <!--<el-form-item label="企业代码类型" prop="awbinfo.shpcomidpre">-->
                    <!--<el-select-->
                    <!--v-model="shpcomidpre"-->
                    <!--filterable-->
                    <!--placeholder="请选择企业代码类型" style="width: 200px;">-->
                    <!--<el-option-->
                    <!--v-for="item in shpCompnyTypeOption"-->
                    <!--:key="item.value"-->
                    <!--:label="item.label"-->
                    <!--:value="item.value"/>-->
                    <!--</el-select>-->
                    <!--</el-form-item>-->
                    <!--</el-col>-->
                    <!--<el-col :span="7.5">-->
                    <!--<el-form-item prop="awbinfo.shpcomidpno" label-width="10px">-->
                    <!--<el-input v-model="shpcomidpno" placeholder="企业代码"/>-->
                    <!--</el-form-item>-->
                    <!--</el-col>-->
                </el-row>
shenhailong authored
535
                <div class="grid-content content" style="font-size: 10px">
536
                    收货人信息
537
                    <el-button type="primary" size="mini" @click="consigneeSelect()">选择收货人信息</el-button>
538 539
                </div>
                <el-row>
540 541 542 543 544
                    <el-col :span="5">
                        <el-form-item  label="" prop="awbinfo.cnsnname">
                            <el-input v-model="cnsnname" clearable>
                                <template  slot="prepend" >收货人名称</template>
                            </el-input>
545 546
                        </el-form-item>
                    </el-col>
547 548 549 550 551
                    <el-col :span="5">
                        <el-form-item label="" prop="awbinfo.cnsnaddress">
                            <el-input  v-model="cnsnaddress" clearable>
                                <template  slot="prepend" >地址</template>
                            </el-input>
552 553
                        </el-form-item>
                    </el-col>
554 555 556 557 558
                    <el-col :span="5">
                        <el-form-item label="">
                            <el-input  v-model="ecityid" clearable maxlength="5">
                                <template  slot="prepend" >城市代码</template>
                            </el-input>
559 560
                        </el-form-item>
                    </el-col>
561 562 563 564 565
                    <el-col :span="5">
                        <el-form-item label="">
                            <el-input v-model="preModel.awbinfo.cnsrmobiletype" clearable>
                                <template  slot="prepend" >传真</template>
                            </el-input>
566 567
                        </el-form-item>
                    </el-col>
568 569
                    <el-col :span="5">
                        <el-form-item label="" prop="awbinfo.cnscountyr">
570 571 572 573 574
                            <el-select
                                    :remote-method="remoteMethod"
                                    :listLoading="listLoading"
                                    v-model="cnscountyr"
                                    filterable
朱兆平 authored
575
                                    allow-create
576
                                    remote
577
                                    placeholder="请选择国家代码" clearable>
578 579 580 581 582 583 584 585 586 587 588
                                <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>
589 590 591 592 593
                    <el-col :span="7.5">
                        <el-form-item label="" prop="awbinfo.cnsntel">
                            <el-input  v-model="preModel.awbinfo.cnsntel" clearable>
                                <template  slot="prepend" >电话</template>
                            </el-input>
594 595
                        </el-form-item>
                    </el-col>
596 597 598 599 600 601

                    <el-col :span="7.5">
                        <el-form-item  label="" prop="awbinfo.cnsaeocode">
                            <el-input v-model="cnsaeocode" clearable style="width: 270px">
                                <template  slot="prepend" >收货人AEO编码</template>
                            </el-input>
602 603
                        </el-form-item>
                    </el-col>
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622

                </el-row>
                <el-row>
                        <el-col :span="6">
                            <el-form-item label="" prop="awbinfo.cnsrctcname">
                                <el-input v-model="cnsrctcname" clearable>
                                    <template  slot="prepend" >收货人名称</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="" prop="awbinfo.cnsrctctel">
                                <el-input v-model="preModel.awbinfo.cnsrctctel" clearable style="width: 270px">
                                    <template  slot="prepend" >收货人电话</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641
                    <!--<el-col :span="7.5">-->
                    <!--<el-form-item label="企业代码类型" prop="awbinfo.csgcustomerid">-->
                    <!--<el-select-->
                    <!--v-model="cnscomidpre"-->
                    <!--filterable-->
                    <!--placeholder="请选择企业代码类型" style="width: 200px;">-->
                    <!--<el-option-->
                    <!--v-for="item in shpCompnyTypeOption"-->
                    <!--:key="item.value"-->
                    <!--:label="item.label"-->
                    <!--:value="item.value"/>-->
                    <!--</el-select>-->
                    <!--</el-form-item>-->
                    <!--</el-col>-->
                    <!--<el-col :span="7.5">-->
                    <!--<el-form-item prop="awbinfo.cnscomidno" label-width="10px">-->
                    <!--<el-input v-model="cnscomidno" placeholder="企业代码"/>-->
                    <!--</el-form-item>-->
                    <!--</el-col>-->
642
                <div v-if="dialogStatus === 'sendUpdate'">
643 644 645 646
                    <div class="grid-content content">
                        运单信息
                    </div>
                    <el-row>
647 648 649 650 651
                        <el-col :span="6">
                            <el-form-item label="" prop="reason">
                                <el-input v-model="preModel.reason" clearable>
                                    <template  slot="prepend" >修改原因</template>
                                </el-input>
652 653
                            </el-form-item>
                        </el-col>
654 655 656 657 658
                        <el-col :span="6">
                            <el-form-item label="" prop="contactName">
                                <el-input v-model="preModel.contactName" clearable>
                                    <template  slot="prepend" >修改人</template>
                                </el-input>
659 660
                            </el-form-item>
                        </el-col>
661 662 663 664 665
                        <el-col :span="6">
                            <el-form-item label="" prop="contactTel">
                                <el-input v-model="preModel.contactTel" clearable maxlength="5">
                                    <template  slot="prepend" >修改人Tel</template>
                                </el-input>
666 667 668 669 670
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
671
            </el-form>
672 673 674 675
            <div slot="footer" class="dialog-footer" style="text-align: center">
                <el-button @click="dialogFormVisible = false" size="medium"
                           style="width: 100px;background-color: #6F8294;color: #ffffff">取消</el-button>
                <el-button type="success" size="medium" style="width: 100px" v-show="dialogStatus!=='sendUpdate'"
676
                           @click="dialogStatus ==='create'? createData():updateData()">保存</el-button>
677
                <el-button type="primary" size="medium" style="width: 100px" v-show="dialogStatus==='sendUpdate'" @click="sendUpdate()">发送</el-button>
678 679
            </div>
        </el-dialog>
680 681 682 683
        <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">
684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712
                    <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>
713 714 715 716 717
                <el-table-column label="操作类型" width="100">
                    <template slot-scope="scope">
                        {{scope.row.opertype}}
                    </template>
                </el-table-column>
718 719
                <el-table-column label="操作人" width="100">
                    <template slot-scope="scope">
720
                        {{scope.row.operusername}}
721 722 723 724
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>
725
        <el-dialog title="删除原因" :visible.sync="dialogDeleteVisble" width="50%">
726 727
        <el-form ref="sendDeleteForm" :model="respModel" :rules="sendDeleteRules" label-width="120px"
                 style="margin-right:50px;">
728 729 730 731
            <el-form-item label="" prop="reason">
                <el-input v-model="respModel.reason" placeholder="删除原因">
                    <template  slot="prepend" >删除&nbsp;&nbsp;&nbsp;&nbsp;原因</template>
                </el-input>
732
            </el-form-item>
733 734 735 736
            <el-form-item label="" prop="contactName">
                <el-input v-model="respModel.contactName" placeholder="操作人姓名">
                    <template  slot="prepend" >删除操作人</template>
                </el-input>
737
            </el-form-item>
738 739 740 741
            <el-form-item label="" prop="contactTel">
                <el-input v-model="respModel.contactTel" placeholder="删除操作人联系方式">
                    <template  slot="prepend" >操作人&nbsp;&nbsp; &nbsp;Tel</template>
                </el-input>
742
            </el-form-item>
743 744 745
            <el-form-item label="">
                <el-input v-model="respModel.content" type="textarea" placeholder="请输入备注">
                </el-input>
746 747 748
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
749 750 751
            <el-button @click="dialogDeleteVisble = false" size="medium"
                       style="width: 100px;background-color: #6F8294;color: #ffffff">取消</el-button>
            <el-button type="primary" size="medium" style="width: 100px" @click="sendDelete()">发送</el-button>
752 753
        </div>
    </el-dialog>
754
755
        <el-dialog title="发货人信息" :visible.sync="dialogSelectVisible" width="70%">
756 757 758 759
            <!--工具条-->
            <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
                <el-form :inline="true" :model="consignerQuery">
                    <el-form-item>
760
                        <el-input v-model="consignerQuery.companyName" placeholder="关键字查询" size="small"></el-input>
761 762
                    </el-form-item>
                    <el-form-item>
763
                        <el-button type="primary" size="small" v-on:click="consignerSelect()">查询</el-button>
764 765 766
                    </el-form-item>
                </el-form>
            </el-col>
767 768 769
            <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"
770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
                      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 prop="enterprise" label="发货人企业代码"  >
                </el-table-column>
                <el-table-column label="操作">
                    <template slot-scope="scope">
787
                        <el-button type="success" size="mini" @click="consignerClick(scope.row)">选择</el-button>
788 789 790 791 792 793
                    </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>
794
        <el-dialog title="收货人信息" :visible.sync="dialogNeeVisible" width="70%">
795 796 797 798
            <!--工具条-->
            <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
                <el-form :inline="true" :model="consignerQuery">
                    <el-form-item>
799
                        <el-input v-model="consigneeQuery.companyName" placeholder="关键字查询" size="small"></el-input>
800 801
                    </el-form-item>
                    <el-form-item>
802
                        <el-button type="primary" v-on:click="consigneeSelect()" size="small">查询</el-button>
803 804 805
                    </el-form-item>
                </el-form>
            </el-col>
806 807 808
            <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"
809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825
                      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 prop="enterprise" label="收货人企业代码"  >
                </el-table-column>
                <el-table-column label="操作">
                    <template slot-scope="scope">
826
                        <el-button type="success" @click="consigneeClick(scope.row)" size="small">选择</el-button>
827 828 829 830 831 832 833
                    </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>
834 835 836 837 838 839
    </div>
</template>
<script>
    import treeTable from '@/components/TreeTable'
    import treeToArray from '@/utils/customEval'
    import Pagination from '@/components/Pagination'
朱兆平 authored
840
    import util from '@/common/js/util'
841 842 843 844 845 846 847 848 849
    import {getCountry, getByCountryCode, getByCountryCodeForName,getCustomCode,getAirportCode} from "@/api/country";
    import {
        getMt2201ListForParam,
        deleteByIsDelete,
        updateStatus,
        updateMT2201,
        addMt2201,
        sendCreateMt2201,
        sendDeleteMt2201,
850 851
        sendUpdateMt2201,
        uploadFileExcel
852
    } from '@/api/exitPre'
853 854
    import {Message} from "element-ui";
    import {getResponseForParam} from '@/api/responseDetail'
855 856
    import { getList} from '../../api/consigner/consigner';
    import { getList as neeList} from '../../api/consigner/consignee';
zhangFan authored
857 858 859 860 861 862 863
    import {
        validAwb,
        validAlphabets,
        validAlphabetsAndNum,
        validAlphabetsAndSpanceKey,
        validatorNum
    } from "@/utils/validate"
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 906 907 908 909 910 911 912 913 914 915 916 917 918 919
                consignerList: [],
                dialogNeeVisible: false,
                consigneeList: [],
                consignerQuery: {
                    companyName: '',
                    total: 0,
                    pageSize: 1,
                    limitSize: 5,
                },
                consigneeQuery: {
                    companyName: '',
                    total: 0,
                    pageSize: 1,
                    limitSize: 5,
                },
                dialogSelectVisible: false,
920
                preQuery: {
921
                    pageSize: 1,
922
                    limitSize: 30,
923 924
                    awba: undefined,
                    carrier: undefined,
925 926 927 928 929
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    messageType: undefined
930 931 932 933 934 935 936 937 938 939 940 941 942 943
                },
                dialogMap: {
                    update: '编辑预配舱单',
                    create: '添加预配舱单',
                    addAwbh: '添加分单'
                },
                customTypes: [
                    {label: '普通货物', value: '001'},
                    {label: '国际转运货物', value: '002'},
                    {label: '国内转关', value: '003'},
                    {label: '空箱', value: '004'},
                    {label: '快件', value: '005'}],
                payTypes: [{label: '预付', value: '0'}, {label: '到付', value: '1'}],
                splitcodes: [{label: '是', value: 'T'}, {label: '否', value: 'P'}],
944 945
                customCodeList: [],
                airportCode:[],
946
                dialogStatus: undefined,
947
                fenStatus:undefined,
948
                dialogTableVisible: false,
949
                dialogDeleteVisble: false,
950
                listLoading: false,
951 952
                customLoading:false,
                airportLoading:false,
953 954 955 956 957 958 959 960
                disabledStatus: false,
                dialogFormVisible: false,
                countryOption: [],
                countryList: [],
                countryResultList: [],
                awbPiece: undefined,
                awbWeight: undefined,
                preRoles: {
zhangFan authored
961 962 963 964
                    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}],
965 966 967
                    flightdate: [{required: true, message: '航班日期必须输入', trigger: 'change'}],
                    carrier: [{required: true, trigger: 'blur', validator: validatorAwbh}],
                    flightno: [{required: true, trigger: 'blur', validator: validatorAwbh}],
zhangFan authored
968
                    actime: [{required: true, trigger: 'blur', message: '预配时间不能为空'}],
969 970
                    customcode: [{required: true, message: '关区代码必须选择', trigger: 'change'}],
                    awba: [{required: true, trigger: 'blur', validator: validatorAwb}],
zhangFan authored
971
                    awbh: [{required: true, trigger: 'blur', validator: validatorAwbh}],
972
                    'awbinfo.paymodel': [{required: true, message: '付款方式必选', trigger: 'change'}],
973
                    goodsname: [{required: true, trigger: 'change', validator: validAlphabetsSpanceKey}],
zhangFan authored
974
                    ex5: [{required: true, message: '货物描述不能为空', trigger: 'blur'}],
975 976 977
                    reason:[{required: true, message: '修改原因不能为空', trigger: 'blur'}],
                    contactName:[{required: true, message: '修改操作人不能为空', trigger: 'blur'}],
                    contactTel:[{required: true, message: '修改操作人联系方式不能为空', trigger: 'blur'}],
978 979 980 981 982 983 984 985 986
                    '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
987 988
                    'awbinfo.weight': [{required: true, trigger: 'change', validator: validatorNums}],
                    'awbinfo.pcs': [{required: true, trigger: 'change', validator: validatorNums}],
989 990
                },
                preModel: {
991
                    uuid: undefined,
992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008
                    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,
1009 1010 1011
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
1012 1013 1014
                    awbinfo: {
                        pcs: undefined,
                        weight: undefined,
zhangFan authored
1015 1016
                        scityid: undefined,
                        ecityid: undefined,
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
                        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
1040
                        by1: '',
1041 1042 1043 1044 1045 1046 1047
                        dest1: undefined,
                        by2: undefined,
                        dest2: undefined,
                        by3: undefined,
                        dest3: undefined,
                        eairportid: undefined,
                        csgcustomerid: undefined,
1048
                        paymodel: '0',
1049
                        awbtype: undefined
1050 1051 1052
                    },
                    user: {
                        username: this.username
1053 1054
                    }
                },
1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071
                respModel: {
                    uuid: undefined,
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: '',
                    flightNo: undefined,
                    awba: undefined,
                    customCode: undefined,
                    flightDate: undefined,
                    awbh: ''
                },
                sendDeleteRules:{
                    reason:[{required:true,message:'删除原因不能为空',trigger:'blur'}],
                    contactName:[{required:true,message:'删除操作人不能为空',trigger:'blur'}],
                    contactTel:[{required:true,message:'操作人联系方式不能为空',trigger:'blur'}]
                },
1072
                preData: [],
1073 1074
                detailData: [],
                rows:[]
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086
            }
        },
        mounted() {
            // 延迟加载,否则会出错
            setTimeout(() => {
                this.countryResultList = this.countryList.map(item => {
                    return {value: item.countryCode, label: item.countryNameCn}
                })
            }, 1000)
        },
        created() {
            if (this.$route.params.flightData !== undefined) {
1087 1088 1089 1090 1091 1092 1093 1094
                this.preQuery.carrier = this.$route.params.flightData.flightno.substring(0, 2)
                this.preQuery.flightno = this.$route.params.flightData.flightno.substring(2)
                this.preQuery.flightdate = this.$route.params.flightData.flightdate
                this.preQuery.originstation = this.$route.params.flightData.originstation
                this.preQuery.destinationstation = this.$route.params.flightData.destinationstation
                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)
                }
1095 1096 1097
                this.getList()
            }
            this.getCountryList()
zhangFan authored
1098
            let username = JSON.parse(sessionStorage.getItem('user')).username
1099
            if (username === 'admin') {
zhangFan authored
1100 1101
                this.isAdmin = true
            }
1102
        },
1103 1104

        // 验证
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162
        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
1163
                    this.preModel.goodsname = val.toUpperCase()
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178
                }
            },
            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
1179
                    this.preModel.awbinfo.shprname = val.toUpperCase()
1180 1181 1182 1183 1184 1185 1186
                }
            },
            shpraddress: {
                get: function () {
                    return this.preModel.awbinfo.shpraddress
                },
                set: function (val) {
zhangFan authored
1187
                    this.preModel.awbinfo.shpraddress = val.toUpperCase()
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202
                }
            },
            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
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219
                    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()
1220 1221 1222 1223 1224 1225 1226
                }
            },
            cnsnname: {
                get: function () {
                    return this.preModel.awbinfo.cnsnname
                },
                set: function (val) {
zhangFan authored
1227
                    this.preModel.awbinfo.cnsnname = val.toUpperCase()
1228 1229 1230 1231 1232 1233 1234
                }
            },
            cnsnaddress: {
                get: function () {
                    return this.preModel.awbinfo.cnsnaddress
                },
                set: function (val) {
zhangFan authored
1235
                    this.preModel.awbinfo.cnsnaddress = val.toUpperCase()
1236 1237 1238 1239 1240 1241 1242
                }
            },
            cnscountyr: {
                get: function () {
                    return this.preModel.awbinfo.cnscountyr
                },
                set: function (val) {
zhangFan authored
1243
                    this.preModel.awbinfo.cnscountyr = val.toUpperCase()
1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263
                }
            },
            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
1264
                    return util.checkNull(this.preModel.awbinfo.by1)?this.preModel.awbinfo.by1:''
1265 1266
                },
                set: function (val) {
朱兆平 authored
1267
                    this.preModel.awbinfo.by1 = util.checkNull(val)?val.toUpperCase().trim():''
1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314
                }
            },
            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()
                }
            },
        },
        methods: {
            // >>>>>>>>>>>>>>>>获取list集合<<<<<<<<<<<<<<<<<<
            getList() {
                this.listLoading = true
1315 1316
                if (this.preQuery.awba !== undefined && this.preQuery.awba !== '') {
                    getMt2201ListForParam(this.preQuery).then(res => {
1317 1318 1319
                        this.preData = res.data.data.list
                        this.total = res.data.data.total
                        if (res.data.data.list.length > 0) {
1320 1321 1322 1323 1324 1325
                            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
1326 1327 1328 1329 1330 1331
                        }
                        setTimeout(() => {
                            this.listLoading = false
                        }, 1500)
                    })
                } else {
1332
                    getMt2201ListForParam(this.preQuery).then(res => {
1333
                        this.preData = res.data.data.list
1334
1335
                        this.total = res.data.data.total
1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364
                        setTimeout(() => {
                            this.listLoading = false
                        }, 1500)
                    })
                }
            },
            // >>>>>>>>>>>>>>>>重置实体<<<<<<<<<<<<<<<<<<
            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
1365 1366
                        scityid: undefined,
                        ecityid: undefined,
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 1398
                        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,
1399
                        paymodel: '0',
1400 1401 1402
                    },
                    user: {
                        username : JSON.parse(sessionStorage.getItem('user')).username
1403 1404 1405 1406 1407
                    }
                }
            },
            // >>>>>>>>>>>>>>>>新增主单<<<<<<<<<<<<<<<<<<
            handleAddpreInfo() {
shenhailong authored
1408 1409

                this.fenStatus=undefined;
1410
                this.restModel()
1411 1412 1413 1414
                this.preModel.carrier = this.preQuery.carrier
                this.preModel.flightno = this.preQuery.flightno
                this.preModel.flightdate = this.preQuery.flightdate
                this.preModel.originstation = this.preQuery.originstation
朱兆平 authored
1415
                this.preModel.destinationstation = this.preQuery.destinationstation
1416
                this.preModel.customcode = this.preQuery.customcode
1417 1418 1419 1420 1421 1422 1423 1424 1425
                this.dialogStatus = 'create'
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.preFormData.clearValidate()
                })
            },
            createData() {
                this.$refs.preFormData.validate(valid => {
                    if (valid) {
zhangFan authored
1426
                        addMt2201(this.preModel).then(res => {
1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441
                            if (res.data.count > 0) {
                                Message.success("新增成功")
                                this.dialogFormVisible = false
                                this.getList()
                            } else {
                                Message.error("新增失败,请检查数据")
                            }
                        })
                    }
                })
            },
            // >>>>>>>>>>>>>>>>多选<<<<<<<<<<<<<<<<<<
            handleSelectionChange() {

            },
1442 1443 1444 1445 1446 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 1472 1473 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 1506 1507 1508 1509 1510 1511 1512
            // 远程获取发货人信息
            consignerSelect(){
                this.dialogSelectVisible = true;
                this.listLoading = true;
                let para = {
                    pageSize: this.consignerQuery.pageSize,
                    limitSize: this.consignerQuery.limitSize,
                    companyName: this.consignerQuery.companyName
                };
                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,
                    companyName: this.consigneeQuery.companyName
                };
                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){
                console.log(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;
            },
1513 1514
            // >>>>>>>>>>>>>>>>搜索<<<<<<<<<<<<<<<<<<
            handleSerach() {
王勇 authored
1515 1516 1517 1518 1519
                // this.preQuery.flightno = undefined
                // this.preQuery.carrier = undefined
                // this.preQuery.originstation = undefined
                // this.preQuery.flightdate = undefined
                // this.preQuery.destinationstation = undefined
1520 1521 1522 1523 1524 1525
                this.getList()
            },
            // >>>>>>>>>>>>>>>>收发明细<<<<<<<<<<<<<<<<<<
            handleSend(row) {
                const resQuery = {
                    carrier: row.carrier,
1526 1527
                    flightno: row.flightno,
                    flightdate: row.flightdate,
1528
                    orpertype: row.orpertype,
1529 1530 1531 1532 1533 1534 1535 1536 1537 1538
                    awba: row.awba,
                    awbh: row.awbh,
                    messageType: 'MT2201'
                }
                this.dialogTableVisible = true
                getResponseForParam(resQuery).then(res => {
                    this.detailData = res.data
                })
            },
            // >>>>>>>>>>>>>>>>发送舱单报<<<<<<<<<<<<<<<<<<
1539 1540 1541
            handleAwbSend(row) {
                delete row.parent
                delete row.children
1542
                this.rows = row;
1543 1544 1545 1546 1547
                this.$confirm("是否发送", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '发送',
                    cancelButtonText: '取消'
                }).then(() => {
1548 1549 1550
                    if (row.awbh === null) {
                        row.awbh = ''
                    }
1551 1552 1553
                    row.user = {
                        username : JSON.parse(sessionStorage.getItem('user')).username
                    }
1554 1555 1556
                    sendCreateMt2201(row).then(res => {
                        if (res.data.count > 0) {
                            Message.success(res.data.respMessage)
1557 1558
                            this.rows.status="23";
                            this.rows.ext5="新增报发送成功";
1559 1560 1561 1562 1563
                        } else {
                            Message.error(res.data.respMessage)
                        }
                    })
                })
1564
            },
1565 1566 1567 1568 1569 1570 1571 1572
            // 发送舱单报 按钮自灰
            addStatus(status){
                if(status=='23' || status=='24'||status=='25'){
                    return true;
                }else if(status=='22' ) {
                    return false;
                }
            },
1573 1574
            // >>>>>>>>>>>>>>>>更新运单数据<<<<<<<<<<<<<<<<<<
            handleEdit(row) {
1575 1576
                this.dialogStatus = undefined;
                this.fenStatus = undefined;
1577 1578
                this.preModel = Object.assign({}, row)
                this.dialogStatus = 'update'
1579 1580 1581 1582
                if (row.awbh !== undefined && row.awbh !== ""){
                    this.fenStatus = 'addAwbh'
                }
1583 1584 1585 1586 1587 1588
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.preFormData.clearValidate()
                })
            },
            updateData() {
1589
                let _this = this;
1590 1591 1592 1593
                this.$refs.preFormData.validate(valid => {
                    if (valid) {
                        delete this.preModel.parent
                        delete this.preModel.children
1594 1595 1596 1597 1598
                        _this.preModel.user= {
                            username : JSON.parse(sessionStorage.getItem('user')).username
                        }

                        updateMT2201(_this.preModel).then(res => {
1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610
                            if (res.data.count > 0) {
                                Message.success("修改成功")
                                this.dialogFormVisible = false
                                this.getList()
                            } else {
                                Message.error("修改失败,请检查数据")
                            }
                        })
                    }
                })
            },
            // >>>>>>>>>>>>>>>>发送修改报<<<<<<<<<<<<<<<<<<
1611 1612 1613
            handleAwbEdit(row) {
                delete row.parent
                delete row.children
1614
                this.rows = row;
1615 1616 1617 1618 1619 1620
                this.preModel = Object.assign({}, row)
                this.dialogStatus = 'sendUpdate'
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.preFormData.clearValidate()
                })
1621
            },
1622 1623 1624 1625 1626 1627 1628 1629
            // 发送修改报自灰
            editStatus(status){
                if(status=='23' || status=='24'||status=='25'){
                    return true;
                }else if(status=='25' ) {
                    return false;
                }
            },
1630 1631 1632 1633
            sendUpdate(){
                this.respModel.reason = this.preModel.reason
                this.respModel.contactName = this.preModel.contactName
                this.respModel.contactTel = this.preModel.contactTel
1634 1635 1636 1637 1638 1639 1640 1641 1642 1643
                //
                delete this.preModel._expanded
                delete this.preModel._level
                delete this.preModel._marginLeft
                delete this.preModel._show
                delete this.preModel._width

                const reason = this.preModel.reason
                const contactName = this.preModel.contactName
                const contactTel = this.preModel.contactTel
1644 1645
                const username = JSON.parse(sessionStorage.getItem('user')).username
1646
1647 1648
                this.$refs.preFormData.validate(valid =>{
                    if(valid){
1649 1650 1651 1652 1653 1654 1655 1656
                        delete this.preModel.reason
                        delete this.preModel.contactName
                        delete this.preModel.contactTel
                        const map = {
                            'mt2201': this.preModel,
                            'reason' : reason,
                            'contactName': contactName,
                            'contactTel':  contactTel,
1657
                            'username': username,
1658
                        }
1659 1660 1661
                        sendUpdateMt2201(map).then(res =>{
                            if(res.data.count >0){
                                Message.success(res.data.respMessage)
1662 1663
                                this.rows.status="25";
                                this.rows.ext5="修改报发送成功";
1664 1665 1666 1667 1668 1669 1670
                                this.dialogFormVisible = false
                            }else {
                                Message.error(res.data.respMessage)
                            }
                        })
                    }
                })
1671
            },
1672
1673
            // >>>>>>>>>>>>>>>>发送删除报<<<<<<<<<<<<<<<<<<
1674 1675
            handleSendDelete(row) {
                this.respModel = {
1676
                    carrier: undefined,
1677 1678 1679 1680 1681 1682 1683 1684
                    reason: undefined,
                    contactName: undefined,
                    contactTel: undefined,
                    content: '',
                    flightNo: undefined,
                    awba: undefined,
                    customCode: undefined,
                    flightDate: undefined,
1685 1686
                    awbh: '',
                    username: JSON.parse(sessionStorage.getItem('user')).username,
1687
                }
1688
                this.rows = row;
1689 1690
                this.dialogDeleteVisble = true
                this.respModel.awba = row.awba
1691
                this.respModel.flightNo = row.flightno
1692 1693 1694
                this.respModel.customCode = row.customcode
                this.respModel.awbh = row.awbh
                this.respModel.flightDate = row.flightdate
1695
                this.respModel.carrier = row.carrier
1696 1697 1698 1699
                this.$nextTick(()=>{
                    this.$refs.sendDeleteForm.clearValidate()
                })
            },
1700 1701 1702 1703 1704 1705 1706 1707
            // 发送删除报按钮自灰
            deleteStatus(status){
                if(status=='23' || status=='24'||status=='25'){
                    return true;
                }else if(status=='24' ) {
                    return false;
                }
            },
1708 1709 1710 1711 1712 1713 1714
            sendDelete() {
                this.$refs.sendDeleteForm.validate(valid =>{
                    if(valid){
                        sendDeleteMt2201(this.respModel).then(res => {
                            if(res.data.count>0){
                                Message.success(res.data.respMessage)
                                this.dialogDeleteVisble = false
1715 1716
                                this.rows.status="24";
                                this.rows.ext5="删除报发送成功";
1717 1718 1719 1720 1721 1722 1723 1724
                            }else {
                                Message.error(res.data.respMessage)
                            }
                        })
                    }
                })
            },
            //>>>>>>>>>>>>>>>>删除运单<<<<<<<<<<<<<<<<<<
1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762
            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(() => {
1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779
                    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: '状态更改失败,请稍后重试'
                    //         })
                    //     }
                    // })
1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793

                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消状态更改'
                            : '状态更改取消'
                    })
                })
            },
            // >>>>>>>>>>>>>>>>新增分单<<<<<<<<<<<<<<<<<<
            handleAddAwbh(row) {
                this.restModel()
                const template = Object.assign({}, row) // copy obj
1794
                this.preModel.uuid = template.uuid
1795 1796 1797 1798 1799 1800 1801 1802
                this.preModel.awba = template.awba
                this.preModel.flightdate = template.flightdate
                this.preModel.flightno = template.flightno
                this.preModel.destinationstation = template.destinationstation
                this.preModel.customcode = template.customcode
                this.preModel.carrier = template.carrier
                this.preModel.awbinfo.shprcountyr = template.awbinfo.shprcountyr
                this.preModel.originstation = template.originstation
1803
                this.preModel.awbinfo.paymodel = template.awbinfo.paymodel
1804 1805 1806
                this.preModel.awbinfo.sairportid = template.awbinfo.sairportid
                this.preModel.awbinfo.eairportid = template.awbinfo.eairportid
                this.preModel.awbinfo.ex5 = template.awbinfo.ex5
1807 1808 1809 1810 1811 1812 1813 1814
                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
                getMt2201ListForParam(this.preQuery).then(res => {
1815 1816 1817 1818 1819
                    this.awbPiece = 0
                    this.awbWeight = 0
                    let residuePiece = 0
                    let residueWeight = 0
                    const childrenList = res.data.dataList[0].children
1820
1821 1822 1823 1824 1825 1826 1827 1828
                    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
                        }
zhangFan authored
1829 1830
                        this.awbPiece = res.data.dataList[0].piece - residuePiece
                        this.awbWeight = res.data.dataList[0].weight - residueWeight
1831 1832
                    }
                })
1833 1834
                this.dialogStatus = 'create'
                this.fenStatus = 'addAwbh'
1835 1836 1837 1838 1839
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.$refs.preFormData.clearValidate()
                })
            },
1840
            //获取国家列表
1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858
            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 = []
                }
1859
            },
1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874
            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 = []
                }
1875
            },
1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891

            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 = []
                }
1892
            },
1893
1894 1895 1896 1897 1898 1899 1900 1901
            handleAddpre() {
                const row = {
                    'messageType': 'MT2201'
                }
                this.$router.push({name: "出港航班信息", params: {scopeRow: row}})
            },

            handelBackStep() {
1902 1903
                this.preQuery.messageType = 'MT2201'
                this.$router.push({name: '出港航班信息', params: {scopeRow: this.preQuery}})
1904 1905 1906 1907 1908 1909 1910 1911 1912
            },
            // 导入excel
            fileExceed(){
                this.$message.error('别贪心!一次只能上传一个哦~');
            },
            // 自定义上传
            uploadFile (item) {
                const form = new FormData()
                form.append('file', item.file)
shenhailong authored
1913
                form.append("username", JSON.parse(sessionStorage.getItem('user')).username);
1914 1915 1916 1917 1918 1919 1920 1921
                uploadFileExcel(form).then(res =>{
                    if(res.data.count >0){
                        Message.success(res.data.respMessage)
                        this.getList();
                    }else {
                        Message.error(res.data.respMessage)
                    }
                })
shenhailong authored
1922
            },
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971
        }
    }

</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;
    }
</style>