审查视图

src/views/nmms_import/OrigMaster.vue 81.0 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
<template>
    <el-container>
        <el-main style="background-color: white">
            <!--检索条目部分-->
            <el-row class="row-bg">
                <el-col :span="24">
                    <div class="grid-content content">航班信息</div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content co">
                        <el-col :span="1">
                            <div class="grid-content"></div>
                        </el-col>
                        <el-col :span="20">
                            <div class="grid-content">
                                <span>航班号:{{defaultQuery.flightno}}</span>
                                <span>航班日期:{{defaultQuery.flightdate}}</span>
                                <span>航段:{{defaultQuery.originstation}}-{{defaultQuery.destinationstation}}</span>
                            </div>
                        </el-col>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content content">进港舱单查询</div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content co">
                        <el-col :span="1">
                            <div class="grid-content"></div>
                        </el-col>
                        <el-col :span="22">
                            <div class="grid-content">
33
                                <el-col :span="9" class="pub">
34
                                    <div class="grid-content">
35
                                        <el-input v-model="defaultQuery.awba" placeholder="请输入主单号" style="width: 250px" clearable>
36 37
                                            <template slot="prepend">主单号</template>
                                        </el-input>
38 39
                                    </div>
                                </el-col>
40
                                <el-col :span="3" class="pub">
41
                                    <div class="grid-content">
42
                                        <el-button type="primary" size="mini" v-on:click="getList" icon="el-icon-search">&nbsp;查&emsp;&nbsp;询&nbsp;</el-button>
43 44
                                    </div>
                                </el-col>
45
                                <el-col :span="3" class="pub">
46
                                    <div class="grid-content">
xudada authored
47
                                        <el-dropdown @command="handleCommand">
48
                                            <el-button  size="mini" type="success" icon="el-icon-download">
49
                                                导出文件
xudada authored
50 51 52 53 54 55
                                            </el-button>
                                            <el-dropdown-menu slot="dropdown">
                                                <el-dropdown-item command="PDF">导出PDF</el-dropdown-item>
                                                <el-dropdown-item command="EXCEL">导出EXCEL</el-dropdown-item>
                                            </el-dropdown-menu>
                                        </el-dropdown>
56 57
                                    </div>
                                </el-col>
58 59
                                <el-col :span="3">
                                    <div class="grid-content">
60
                                        <el-button type="warning"  @click="toggleRowExpansion" icon="el-icon-sort" size="mini">
61 62 63 64
                                            全部{{ isExpansion ? "折叠" : "展开" }}
                                        </el-button>
                                    </div>
                                </el-col>
65 66 67 68 69 70 71 72 73 74 75 76 77
                            </div>
                        </el-col>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="grid-content content" style="margin-top: 6px">舱单明细</div>
                </el-col>
            </el-row>
            <!--查询列表部分-->
            <el-row>
                <el-col :span="24">
                    <template>
                        <el-table
xudada authored
78 79 80
                                class="table"
                                id="pdfDom"
                                v-loading="tableloading"
81
                                ref="dataTreeList"
82 83
                                :data="tableData"
                                tooltip-effect="dark"
84 85
                                style="border-radius: 10px 10px 0px 0px;line-height: 25px;min-height: 500px"
                                :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
86 87 88 89 90 91 92 93 94 95 96
                                @selection-change="handleSelectionChange"
                                row-key="uuid"
                                border
                                default-expand-all
                                :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
                            <el-table-column
                                    type="selection"
                                    width="50">
                            </el-table-column>
                                <el-table-column
                                        label="运单号"
97
                                        width="185">
xudada authored
98 99
                                    <template slot-scope="scope">
                                        <span v-if="scope.row.awbh==''||scope.row.awbh==null">
100 101
                                            {{scope.row.awba}}<i style="margin-left: 2px" class="el-icon-menu" :style="{'color':scope.row.splitcode=='P'?'rgb(255,77,81)'
                                            :scope.row.splitcode=='M'?'rgb(255,77,81)':scope.row.splitcode=='D'?'rgb(255,77,81)':'rgba(255,255,255,0)'}"></i>
xudada authored
102 103 104 105 106
                                        </span>
                                        <span v-else>
                                            {{scope.row.awbh}}
                                        </span>
                                    </template>
107 108 109 110
                                </el-table-column>
                            <el-table-column
                                    prop="awbinfo.pcs"
                                    label="总件数"
111 112
                                    width="70">
113 114 115 116
                            </el-table-column>
                            <el-table-column
                                    prop="awbinfo.weight"
                                    label="总重量"
117
                                    width="70">
118 119 120 121
                            </el-table-column>
                            <el-table-column
                                    prop="piece"
                                    label="舱单件数"
122 123
                                    width="80">
                                <template slot-scope="scope">
124 125 126 127
                                    <span v-if="scope.row.awbinfo==null" style="color: #ff4d51;font-weight: bold">
                                           {{scope.row.piece}}
                                        </span>
                                    <span v-else-if="scope.row.awbinfo.pcs!=scope.row.piece" style="color: #ff4d51;font-weight: bold">
128 129 130 131 132 133
                                           {{scope.row.piece}}
                                        </span>
                                    <span v-else>
                                            {{scope.row.piece}}
                                        </span>
                                </template>
134 135 136 137
                            </el-table-column>
                            <el-table-column
                                    prop="weight"
                                    label="舱单重量"
138 139
                                    width="100">
                                <template slot-scope="scope" style="text-align: center">
140 141 142 143
                                    <span v-if="scope.row.awbinfo==null" style="color: #ff4d51;font-weight: bold">
                                           {{scope.row.weight}}
                                        </span>
                                    <span v-else-if="scope.row.weight != scope.row.awbinfo.weight" style="color: #ff4d51;font-weight: bold">
144 145 146 147 148 149
                                           {{scope.row.weight}}
                                        </span>
                                    <span v-else>
                                            {{scope.row.weight}}
                                        </span>
                                </template>
150 151 152 153 154 155 156 157 158
                            </el-table-column>
                            <el-table-column
                                    prop="goodsname"
                                    label="货品名称"
                                    width="140">
                            </el-table-column>
                            <el-table-column
                                    prop="status"
                                    label="状态"
xudada authored
159
                                    width="100" :formatter="formatStatus">
160 161
                            </el-table-column>
                            <el-table-column
xudada authored
162
                                    label="回执内容"
163
                                    width="260">
xudada authored
164
                                <template slot-scope="scope">
165 166 167 168 169 170 171
                                    <span v-if="scope.row.ext5 && scope.row.ext5.indexOf('异常') != -1" style="color: #F56C6C">
                                       {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.ext5 && scope.row.ext5.indexOf('不通过') != -1" style="color: #F56C6C">
                                       {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.ext5 && scope.row.ext5.indexOf('不接受') != -1" style="color: #F56C6C">
172 173 174
                                       {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.status=='01' || scope.row.status=='11'" style="color: #67C23A">
xudada authored
175 176 177 178 179 180 181 182 183 184 185 186
                                        {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.status=='02' || scope.row.status=='03'" style="color: #E6A23C">
                                        {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.status=='12' || scope.row.status=='13'" style="color: #F56C6C">
                                        {{scope.row.ext5}}
                                    </span>
                                    <span v-else style="color: #909399;">
                                        {{scope.row.ext5}}
                                    </span>
                                </template>
187 188 189 190
                            </el-table-column>
                            <el-table-column
                                    prop="operation"
                                    label="操作"
191
                                    width="380"
192 193
                                    show-overflow-tooltip>
                                <template slot-scope="scope">
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
                                    <el-row>
                                        <el-button
                                                size="mini"
                                                type="info"
                                                @click="handleDetail(scope.$index, scope.row)">收发明细
                                        </el-button>
                                        <el-button
                                                v-if="scope.row.awbh==''||scope.row.awbh==null"
                                                size="mini"
                                                type="success"
                                                @click="handleEdit(scope.$index, scope.row)">编辑主单
                                        </el-button>
                                        <el-button
                                                v-else
                                                size="mini"
                                                type="success"
                                                @click="handleFen(scope.$index, scope.row)">编辑分单
                                        </el-button>
                                        <el-button
                                                size="mini"
                                                type="primary"
                                                @click="handleSend(scope.$index, scope.row)"
216
                                                :disabled="btSendStatusFormater(scope.row.status)">发舱单报
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
                                        </el-button>
                                        <el-button
                                                size="mini"
                                                type="warning"
                                                @click="UpdateStatus(scope.$index, scope.row)">更改状态
                                        </el-button>
                                    </el-row>
                                    <el-row style="margin-bottom: 5px;margin-top: 30px">

                                        <el-button
                                                v-if="scope.row.awbh==''||scope.row.awbh==null"
                                                size="mini"
                                                @click="Importallocation(scope.$index, scope.row)">分拨申请
                                        </el-button>
                                        <el-button
                                                v-else
                                                disabled=""
234
                                                size="mini"
235 236 237 238 239 240 241 242 243 244 245
                                                @click="Importallocation(scope.$index, scope.row)">分拨申请
                                        </el-button>
<!--                                        style="background-color: #63cdda;color: white"-->
                                        <el-button
                                                v-if="scope.row.awbh==''||scope.row.awbh==null"
                                                size="mini"
                                                @click="Allocatearrive(scope.$index, scope.row)">分拨运抵
                                        </el-button>
                                        <el-button
                                                v-else
                                                disabled=""
246
                                                size="mini"
247 248 249 250 251 252 253
                                                @click="Allocatearrive(scope.$index, scope.row)">分拨运抵
                                        </el-button>
<!--                                        style="background-color:#778beb;color: white"-->
                                        <el-button
                                                size="mini"
                                                style="background-color:#f19066;color: white"
                                                @click="handleUpdate(scope.$index, scope.row)"
254
                                                :disabled="btEditStatusFormater(scope.row.status)">发修改报
255 256 257 258 259
                                        </el-button>
                                        <el-button
                                                size="mini"
                                                type="danger"
                                                @click="handleDelete(scope.$index, scope.row)"
260
                                                :disabled="btDeleStatusFormater(scope.row.status)">发删除报
261 262 263
                                        </el-button>
                                    </el-row>
264 265 266 267 268 269 270 271
                                </template>
                            </el-table-column>
                        </el-table>
                    </template>
                </el-col>
            </el-row>
            <!--编辑主单-->
            <el-dialog :title="'原始舱单信息'+textMap[dialogStatus]" :visible.sync="outerVisible" width="90%">
272
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-position="labelPosition" size="mini">
273 274 275 276 277 278
                    <!--航班信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <div class="grid-content content">航班信息</div>
                        </el-col>
                        <el-row class="flightInfo">
279
                            <el-col :span="6">
280
                                <el-form-item  prop="awba">
281
                                    <div v-if="dialogStatus === 'update'">
282 283 284
                                        <el-input disabled="" v-model="ruleForm.awba" style="width: 200px">
                                            <template slot="prepend">运单号</template>
                                        </el-input>
285 286
                                    </div>
                                    <div v-else>
287 288 289
                                        <el-input v-model="ruleForm.awba" style="width: 200px">
                                            <template slot="prepend">运单号</template>
                                        </el-input>
290 291 292
                                    </div>
                                </el-form-item>
                            </el-col>
293
                            <el-col :span="6">
294 295 296 297 298 299 300 301 302 303 304
                                <el-form-item  prop="flightno">
                                        <el-input disabled="" v-model="ruleForm.flightno" style="width: 200px">
                                            <template slot="prepend">航班号</template>
                                        </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item prop="originstation">
                                    <el-input disabled="" v-model="ruleForm.originstation" style="width: 200px">
                                        <template slot="prepend">航段</template>
                                    </el-input>
305 306
                                </el-form-item>
                            </el-col>
307
                            <el-col :span="6">
308
                                <el-form-item label="" required>
309
                                        <el-form-item prop="flightdate">
310 311 312
                                            <div class="ip">
                                                航班日期
                                            </div>
313 314
                                                <el-date-picker disabled="" type="date" placeholder="选择日期" :clearable="false"
                                                                v-model="ruleForm.flightdate"
315
                                                                style="width: 145px">
316 317

                                                </el-date-picker>
318 319 320
                                        </el-form-item>
                                </el-form-item>
                            </el-col>
321 322
                        </el-row>
                        <el-row  class="flightInfo">
323
                            <el-col :span="6">
324 325 326 327 328
                                <el-form-item prop="splitcode">
                                    <div class="ip">
                                        是否分批
                                    </div>
                                    <el-select v-model="ruleForm.splitcode" placeholder="" style="width: 110px">
329 330 331 332 333
                                        <el-option v-for="item in splitcodes" :key="item.value" :label="item.label"
                                                   :value="item.value"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
334
                            <el-col :span="1.5">
335 336 337
                                <el-form-item prop="splitcode">
                                    <el-button size="mini" type="primary" @click="dialogStatus==='create'?createData('ruleForm'):updateData('ruleForm')" style="float: right">保存</el-button>
                                </el-form-item>
338 339 340
                            </el-col>
                        </el-row>
                        <el-row class="flightInfo">
341
                            <el-col :span="6">
342
                                <div v-if="FenStatus === 'addAwbh'">
343 344 345 346
                                <el-form-item prop="awbh">
                                        <el-input v-model="ruleForm.awbh" style="width: 200px">
                                            <template slot="prepend">分单号</template>
                                        </el-input>
347 348 349
                                </el-form-item>
                                    </div>
                                <div v-else>
350 351 352 353
                                    <el-form-item style="display: none" prop="awbh" >
                                        <el-input v-model="ruleForm.awbh" style="width: 200px">
                                            <template slot="prepend">分单号</template>
                                        </el-input>
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371
                                    </el-form-item>
                                </div>
                            </el-col>
                        </el-row>
                    </el-row>
                    <!--运单信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <div class="grid-content content">运单信息</div>
                        </el-col>
                    </el-row>
                    <!--航程信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <el-divider content-position="left">航程信息</el-divider>
                        </el-col>
                    </el-row>
                    <el-row style="margin-bottom: 0px;">
372
                        <el-col :span="6">
373 374 375 376
                            <el-form-item prop="awbinfo.sairportid" >
                                <el-input v-model="ruleForm.awbinfo.sairportid" onkeyup="this.value=this.value.toUpperCase()" style="width: 200px">
                                    <template slot="prepend">起始站</template>
                                </el-input>
377 378
                            </el-form-item>
                        </el-col>
379 380 381 382 383
                        <el-col :span="6">
                            <el-form-item  prop="awbinfo.by1">
                                <el-input v-model="ruleForm.awbinfo.by1" onkeyup="this.value=this.value.toUpperCase()" style="width: 200px">
                                    <template slot="prepend">承运人1</template>
                                </el-input>
384 385
                            </el-form-item>
                        </el-col>
386 387 388 389 390 391
                        <el-col :span="6">
                            <el-form-item prop="awbinfo.dest1">
                                <el-input v-model="ruleForm.awbinfo.dest1" style="width: 200px">
                                    <template slot="prepend">到达站1</template>

                                </el-input>
392 393
                            </el-form-item>
                        </el-col>
394 395 396 397 398 399
                        <el-col :span="6">
                            <el-form-item prop="awbinfo.by2">
                                <el-input v-model="ruleForm.awbinfo.by2" onkeyup="this.value=this.value.toUpperCase()" style="width: 200px">
                                    <template slot="prepend">承运人2</template>

                                </el-input>
400 401
                            </el-form-item>
                        </el-col>
402 403
                    </el-row>
                    <el-row>
404
                        <el-col :span="6">
405 406 407 408
                            <el-form-item prop="awbinfo.dest2">
                                <el-input v-model="ruleForm.awbinfo.dest2" onkeyup="this.value=this.value.toUpperCase()" style="width: 200px">
                                    <template slot="prepend">到达站2</template>
                                </el-input>
409 410
                            </el-form-item>
                        </el-col>
411 412 413 414 415
                        <el-col :span="6">
                            <el-form-item prop="awbinfo.by3">
                                <el-input v-model="ruleForm.awbinfo.by3" onkeyup="this.value=this.value.toUpperCase()" style="width: 200px">
                                    <template slot="prepend">承运人3</template>
                                </el-input>
416 417
                            </el-form-item>
                        </el-col>
418 419 420 421 422
                        <el-col :span="6">
                            <el-form-item prop="awbinfo.dest3">
                                <el-input v-model="ruleForm.awbinfo.dest3" onkeyup="this.value=this.value.toUpperCase()" style="width: 200px">
                                    <template slot="prepend">到达站3</template>
                                </el-input>
423 424
                            </el-form-item>
                        </el-col>
425 426 427 428 429
                        <el-col :span="6">
                            <el-form-item prop="awbinfo.eairportid">
                                <el-input v-model="ruleForm.awbinfo.eairportid" onkeyup="this.value=this.value.toUpperCase()" style="width: 200px">
                                    <template slot="prepend">目的站</template>
                                </el-input>
430 431 432 433 434 435 436 437 438 439 440
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <!--货物信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <el-divider content-position="left">货物信息</el-divider>
                        </el-col>
                    </el-row>
                    <el-row style="margin-bottom: 0px;">
                        <el-row class="product">
441
                            <el-col :span="6">
442 443 444 445
                                <el-form-item label="" prop="awbinfo.pcs">
                                    <el-input type="number" v-model="ruleForm.awbinfo.pcs"  style="width: 200px">
                                        <template slot="prepend">总件数</template>
                                    </el-input>
446 447 448
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
449 450 451 452
                                <el-form-item label="" prop="awbinfo.weight">
                                    <el-input type="number" v-model="ruleForm.awbinfo.weight" style="width: 200px">
                                        <template slot="prepend">总重量</template>
                                    </el-input>
453 454 455
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
456 457 458 459
                                <el-form-item label="" prop="piece">
                                    <el-input type="number" v-model="ruleForm.piece" style="width: 200px">
                                        <template slot="prepend">舱单件数</template>
                                    </el-input>
460 461 462
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
463 464 465 466
                                <el-form-item label="" prop="weight">
                                    <el-input type="number" v-model="ruleForm.weight" style="width: 200px">
                                        <template slot="prepend">舱单重量</template>
                                    </el-input>
467 468 469 470
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row class="product">
471
                            <el-col :span="6">
472 473 474 475
                                <el-form-item label="" prop="specopeid">
                                    <el-input v-model="ruleForm.awbinfo.specopeid" style="width: 200px">
                                        <template slot="prepend">特货代码</template>
                                    </el-input>
476 477
                                </el-form-item>
                            </el-col>
478
                            <el-col :span="6">
479 480 481 482
                                <el-form-item label="" prop="customcode">
                                    <div class="ip">
                                        海关关区
                                    </div>
483 484
                                    <el-select v-model="ruleForm.customcode"
                                               filterable
485
                                               allow-create
486 487 488
                                               default-first-option
                                               remote
                                               :remote-method="remoteMethod2"
489
                                               :loading="loading" placeholder="请选择" style="width: 115px">
490 491 492 493 494 495 496 497
                                        <el-option
                                                v-for="item in customcodes"
                                                :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>
498 499 500
                                    </el-select>
                                </el-form-item>
                            </el-col>
501 502
                            <el-col :span="6" >
                                <el-form-item label="" prop="awbinfo.awbtype">
503
                                    <div class="ip">
504
                                        海关状态
505
                                    </div>
506 507
                                    <el-select v-model="ruleForm.awbinfo.awbtype" placeholder="" style="width: 110px">
                                        <el-option v-for="(item,index) in customext5" :key="index" :label="item.label"
508 509 510 511
                                                   :value="item.value"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
512 513
                            <el-col :span="6">
                                <el-form-item label="" prop="paymodel">
514
                                    <div class="ip">
515
                                        付费方式
516
                                    </div>
517 518
                                    <el-select v-model="ruleForm.awbinfo.paymodel" placeholder="" style="width: 120px">
                                        <el-option v-for="item in paymodel" :key="item.value" :label="item.label"
519 520 521 522
                                                   :value="item.value"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
523 524 525
                        </el-row>
                        <el-row class="product">
                            <el-col :span="12">
526
                                <el-form-item label="" prop="goodsname">
527
                                    <el-input v-model="ruleForm.goodsname" style="width: 100%">
528 529
                                        <template slot="prepend">货物描述</template>
                                    </el-input>
530 531 532 533 534 535 536 537 538 539 540
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-row>
                    <!--发货人信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <el-divider content-position="left">发货人信息</el-divider>
                        </el-col>
                    </el-row>
                    <el-row style="margin-bottom: 0px;">
541
                        <el-col :span="6">
542 543 544 545
                            <el-form-item label="" prop="awbinfo.shprname">
                                <el-input v-model="ruleForm.awbinfo.shprname" style="width: 200px">
                                    <template slot="prepend">发货人称</template>
                                </el-input>
546 547
                            </el-form-item>
                        </el-col>
548
549
                        <el-col :span="6">
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
                            <el-form-item label="" prop="awbinfo.shpraddress">
                                <el-input v-model="ruleForm.awbinfo.shpraddress" style="width: 200px">
                                    <template slot="prepend">地址</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="5">
                            <el-form-item label="" prop="awbinfo.shprtel">
                                <el-input v-model="ruleForm.awbinfo.shprtel" style="width: 200px">
                                    <template slot="prepend">电话</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="" prop="awbinfo.shprcountyr">
                                <div class="ip">
                                    国家代码
                                </div>
568 569
                                <el-select v-model="ruleForm.awbinfo.shprcountyr"
                                           filterable
570
                                           allow-create
571 572
                                           default-first-option
                                           remote
573
                                           :remote-method="remoteMethod"  style="width: 110px"
574
                                           :loading="loading" placeholder="请选择">
575 576 577 578 579 580 581 582 583
                                    <el-option
                                            v-for="item in shprcountyrs"
                                            :key="item.countryCode"
                                            :label="item.countryCode"
                                            :value="item.countryCode">
                                        <span style="float: left">{{ item.countryNameCn }}</span>
                                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.countryCode }}</span>
                                    </el-option>
                                </el-select>
584 585 586 587 588 589 590 591 592 593
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <!--收货人信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <el-divider content-position="left">收货人信息</el-divider>
                        </el-col>
                    </el-row>
                    <el-row style="margin-bottom: 5px">
594
                        <el-col :span="6">
595 596 597 598
                            <el-form-item label="" prop="awbinfo.cnsnname">
                                <el-input v-model="ruleForm.awbinfo.cnsnname" style="width: 200px">
                                    <template slot="prepend">收货人称</template>
                                </el-input>
599 600
                            </el-form-item>
                        </el-col>
601
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620
                        <el-col :span="6">
                            <el-form-item label="" prop="awbinfo.cnsnaddress">
                                <el-input v-model="ruleForm.awbinfo.cnsnaddress" style="width: 200px">
                                    <template slot="prepend">地址</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="5">
                            <el-form-item label="" prop="awbinfo.cnsntel">
                                <el-input v-model="ruleForm.awbinfo.cnsntel" style="width: 200px">
                                    <template slot="prepend">电话</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="" prop="awbinfo.cnscountyr">
                                <div class="ip">
                                    国家代码
                                </div>
621 622
                                <el-select v-model="ruleForm.awbinfo.cnscountyr"
                                           filterable
623
                                           allow-create
624 625
                                           default-first-option
                                           remote
626
                                           :remote-method="remoteMethod"  style="width: 110px"
627
                                           :loading="loading" placeholder="请选择">
628 629 630 631 632 633 634 635
                                    <el-option
                                            v-for="item in cnscountyrs"
                                            :key="item.countryCode"
                                            :label="item.countryCode"
                                            :value="item.countryCode">
                                        <span style="float: left">{{ item.countryNameCn }}</span>
                                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.countryCode }}</span>
                                    </el-option>
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <!--分单信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <div class="grid-content content" v-if="dialogStatus === 'update'">
                                <span>航班信息</span>
                                <el-button type="primary" v-on:click="addFen('ruleForm')" size="mini">新增分单</el-button>
                            </div>
                            <div class="grid-content content" v-else>
                                <span>航班信息</span>
                                <el-button type="primary" disabled="" @click="innerVisible = true" size="mini">新增分单</el-button>
                            </div>
                        </el-col>
                    </el-row>
                    <!--分单列表-->
                    <el-row>
                        <el-col :span="24">
                            <template>
                                <el-table
                                        :data="tableData2"
659 660
                                        style="border-radius: 10px 10px 0px 0px;line-height: 25px;min-height: 500px"
                                        :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small">
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706
                                    <el-table-column
                                            prop="awbh"
                                            label="分单号"
                                            width="150">
                                    </el-table-column>
                                    <el-table-column
                                            prop="pcs"
                                            label="件数"
                                            width="120">
                                    </el-table-column>
                                    <el-table-column
                                            prop="wei"
                                            label="重量"
                                            width="120">
                                    </el-table-column>
                                    <el-table-column
                                            prop="piece"
                                            label="舱单件数"
                                            width="120">
                                    </el-table-column>
                                    <el-table-column
                                            prop="weight"
                                            label="舱单重量"
                                            width="120">
                                    </el-table-column>
                                    <el-table-column
                                            prop="goodsname"
                                            label="货物名称"
                                            width="300">
                                    </el-table-column>
                                    <el-table-column
                                            fixed="right"
                                            label="操作"
                                            width="130">
                                        <template slot-scope="scope">
                                            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑
                                            </el-button>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </template>
                        </el-col>
                    </el-row>
                </el-form>
            </el-dialog>
            <!--footer部分-->
707
            <el-row style="margin-top: 20px">
708 709
                <el-col :span="2.5" class="pub">
                    <div class="grid-content">
710
                        <el-button type="primary" size="mini" v-on:click="addOrig()">新增原始舱单</el-button>
711 712 713 714
                    </div>
                </el-col>
                <el-col :span="2.5" class="pub">
                    <div class="grid-content">
715 716 717 718 719 720
                        <el-button type="primary" size="mini" :disabled="batich" @click="batchdel()">批量发送删除报</el-button>
                    </div>
                </el-col>
                <el-col :span="2.5" class="pub">
                    <div class="grid-content">
                        <el-button type="primary" size="mini" :disabled="batich" @click="batchaplly()">批量申请</el-button>
721 722
                    </div>
                </el-col>
723
                <el-col :span="1.5" class="pub">
724
                    <div class="grid-content">
xudada authored
725
                        <el-button type="primary" @click="back" size="mini">返回</el-button>
726 727 728
                    </div>
                </el-col>
                <el-col :span="2.5" class="pub">
729
                    <div class="grid-content"><span>主单数:{{sumNmmsCount}}</span></div>
730 731
                </el-col>
                <el-col :span="3.5" class="pub">
732
                    <div class="grid-content"><span>舱单总件数:{{sumNmmsPrice}}</span></div>
733
                </el-col>
734
                <el-col :span="7.5" class="pub">
735
                    <div class="grid-content"><span>舱单总重量:{{sumNmmsWeight}}</span></div>
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751
                </el-col>
            </el-row>
            <!--对话提示框-->
            <el-row>
                <el-dialog
                        title="系统提示"
                        :visible.sync="centerDialogVisible"
                        width="30%"
                        center>
                    <span>{{msg}}</span>
                      <span slot="footer" class="dialog-footer">
                          <el-button @click="centerDialogVisible = false">取 消</el-button>
                        <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
                      </span>
                </el-dialog>
            </el-row>
752 753
            <!--发送删除报修改报提示框-->
            <el-row>
754
                <el-dialog :title="'提交'+Reason[udStatus]+'信息'" :visible.sync="dialogFormVisible">
755
                    <el-form :model="Udform" :rules="udrules" ref="Udform" class="demo-ruleForm">
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782
                        <el-row style="margin: 10px auto">
                            <el-col :span="22">
                                <el-form-item label="" prop="operreason">
                                    <div class="ip">
                                        操作原因
                                    </div>
                                    <el-input autosize type="textarea" v-model="Udform.operreason" style="width: 80%">
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="11" style="margin-right: 10px">
                                <el-form-item label="" prop="operperson">
                                    <el-input v-model="Udform.operperson" style="width: 200px">
                                        <template slot="prepend">操作人</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label="" prop="opertel">
                                    <el-input v-model="Udform.opertel" style="width: 250px">
                                        <template slot="prepend">联系电话</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
783
                    </el-form>
784
                    <div slot="footer" class="dialog-footer" style="margin-top: 30px" align="center">
785
                        <el-button @click="dialogFormVisible = false">取 消</el-button>
786
                        <el-button type="primary" @click="udStatus==='delete'?deleteUdForm('Udform'):updateUdForm('Udform')">确 定</el-button>
787 788 789
                    </div>
                </el-dialog>
            </el-row>
xudada authored
790 791 792
            <!--明细列表弹出框-->
            <el-row>
                <el-dialog title="回执明细列表" :visible.sync="dialogTableVisible" width="70%">
793 794
                    <el-table :data="gridData" style="border-radius: 10px 10px 0px 0px;line-height: 25px;min-height: 500px"
                              :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small">
xudada authored
795
                        <el-table-column property="busdate" label="时间" width="160"></el-table-column>
796
                        <el-table-column property="operusername" label="操作人" width="130"></el-table-column>
xudada authored
797 798 799 800 801 802
                        <el-table-column property="buspiece" label="发送件数" width="130"></el-table-column>
                        <el-table-column property="busweight" label="发送重量" width="130"></el-table-column>
                        <el-table-column property="cusrestext" label="回执内容"></el-table-column>
                    </el-table>
                </el-dialog>
            </el-row>
803 804 805 806 807
        </el-main>
    </el-container>
</template>
<!--自定义CSS样式-->
<style scoped>
808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823
    .ip{
        max-width: 100px;
        margin-right: -4px;
        display: inline-block;
        background-color: #6F8294;
        color: #ffffff;
        border: 1px solid #DCDFE6;
        vertical-align: middle;
        padding: 0 18px;
        white-space: nowrap;
        border-top-right-radius: 0px;
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 0px;
        font-size: 10px;
    }
824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871
    .grid-content {
        height: 36px;
        line-height: 36px;
    }
    .el-dialog__body{text-align: center}
    .content {
        border-left: 4px #409EFF solid;
        padding-left: 10px;
        background-color: #f9fafc;
        margin-bottom: 2px
    }

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

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

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

    .el-form-item {
        margin-bottom: 2px;
    }

    .flightInfo {
        margin-bottom: 0px
    }

    .el-dialog__body {
        padding: 10px 20px;
    }

    .el-col {
        margin-right: 0px
    }

    .product {
        margin-bottom: 5px;
    }

    .pub {
        margin-right: 10px;
    }
xudada authored
872 873 874 875 876 877 878 879 880
    .el-dropdown {
        vertical-align: top;
    }
    .el-dropdown + .el-dropdown {
        margin-left: 15px;
    }
    .el-icon-arrow-down {
        font-size: 12px;
    }
881 882 883
</style>

<script>
884
    import { getMt1201List,addMt1201,ediMt1201,getFenList,getCountryCode,selectCustomcode,sendCreateMt1201,sendEditeMt1201,sendRemoveMt1201,sendBatchDelMt1201,sendBatchApllyMt1201 } from '../../api/mt1201'
xudada authored
885
    import{addResponse,selectResponseList} from "../../api/InResponse";
xudada authored
886 887
    import FileSaver from "file-saver";
    import XLSX from "xlsx";
888 889
    import htmlToPdf from "../../api/htmlToPdf";
    import loginUserInfo from '@/api/base.js'
890
    import {mapActions, mapGetters} from 'vuex'
891
    import {loginedUserInfo} from "../../api/user";
892
    import jsutil from "@/common/js/util";
893
    export default {
894
        name:'Origmaster',
895 896 897
        data() {
            /*初始数据*/
            return {
898
                isExpansion:true,
899 900 901 902 903 904 905
                defaultQuery:{
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    awba: undefined
                },
906
                LoginUserInfo: loginedUserInfo(),
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923
                FenQuery:{
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    awba: undefined
                },
                tableData: [],
                tableData2: [],
                multipleSelection: [],
                outerVisible: false,
                innerVisible: false,
                dialogStatus:'',
                textMap:{
                    update: '编辑',
                    create: '添加'
                },
924 925 926 927
                Reason:{
                    update: '修改',
                    delete: '删除'
                },
928 929 930 931
                ruleForm: {
                    awba: undefined,
                    awbh: undefined,
                    passage: undefined,
xudada authored
932
                    customcode: undefined,
933 934 935 936 937 938 939 940
                    flightno: undefined,
                    flightdate: undefined,
                    originstation: undefined,
                    destinationstation: undefined,
                    piece: undefined,
                    weight: undefined,
                    goodsname: undefined,
                    splitcode: 'T',
941
                    isDelete:0,
942 943
                    uldType: undefined,
                    uldNo: undefined,
xudada authored
944
                    status: '22',
945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963
                    awbinfo: {
                        specopeid: undefined,
                        shprname: undefined,
                        shprmobiletype: undefined,
                        shprtel: undefined,
                        shpraddress: undefined,
                        shprcountyr: undefined,
                        shpcomidpre: undefined,
                        shpcomidpno: undefined,
                        cnsnname: undefined,
                        cnsrmobiletype: undefined,
                        cnsntel: undefined,
                        cnsnaddress: undefined,
                        cnscountyr: undefined,
                        cnscomidpre: undefined,
                        cnscomidno: undefined,
                        cnsrctcname: undefined,
                        cnsrctctel: undefined,
                        cargonm: undefined,
xudada authored
964
                        sairportid: '',
965 966 967 968 969 970 971 972 973 974 975
                        dest1city: undefined,
                        by1: undefined,
                        dest1: undefined,
                        by2: undefined,
                        dest2: undefined,
                        by3: undefined,
                        dest3: undefined,
                        eairportid: undefined,
                        csgcustomerid: undefined,
                        paymodel: 'PP',
                        pcs: undefined,
976 977
                        weight: undefined,
                        awbtype:'001',
978
                    },
979
                    userinfo: {
980
                        username: loginedUserInfo().username
981
                    },
xudada authored
982 983
                    waybill:undefined,
                    customText:undefined
984
                },
xudada authored
985
                paymodel:[{value:'PP',label:'预付'},{value:'CC',label:'到付'}],
986 987 988 989 990 991
                customext5:  [
                    {value:'001',label:'普通货物'},
                    {value:'002',label:'国际转运货物'},
                    {value:'003',label:'国内转关'},
                    {value:'004',label:'空箱'},
                    {value:'005',label:'快件'}],
992 993
                customcodes:[],
                customcode:'',
994 995 996 997 998 999 1000 1001
                rules: {
                    waybill: [{required: true, message: '请输入运单号', trigger: 'blur'}],
                    flightno: [{required: true, message: '航班号必须输入', trigger: 'blur'}],
                    flightdate: [{required: true, message: '航班日期必须选择', trigger: 'blur'}],
                    originstation: [{required: true, message: '航段必须输入', trigger: 'blur'}],
                    splitcode: [{required: true, message: '必须选择', trigger: 'blur'}],
                    piece: [{required: true, message: '舱单件数必须输入且为数字', trigger: 'blur'}],
                    weight: [{required: true, message: '舱单重量必须输入且为数字', trigger: 'blur'}],
1002
                    'awbinfo.sairportid': [{required: false, message: '起始站必须输入', trigger: 'blur'}],
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
                    'awbinfo.eairportid': [{required: true, message: '目的站必须输入', trigger: 'blur'}],
                    'awbinfo.by1': [{required: true, message: '第一承运人必须输入', trigger: 'blur'}],
                    'awbinfo.dest1': [{required: true, message: '第一到达站人必须输入', trigger: 'blur'}],
                    'awbinfo.pcs': [{required: true, message: '总件数必须输入且为数字', trigger: 'blur'}],
                    'awbinfo.weight': [{required: true, message: '总重量必须输入且为数字', trigger: 'blur'}],
                    'awbinfo.shprname': [{required: true, message: '发货人不能为空', trigger: 'blur'}],
                    'awbinfo.shprtel': [{required: true, message: '发货电话不能为空', trigger: 'blur'}],
                    'awbinfo.shpraddress': [{required: true, message: '发货地址不能为空', trigger: 'blur'}],
                    'awbinfo.shprcountyr': [{required: true, message: '国家代码不能为空', trigger: 'change'}],
                    'awbinfo.cnsnname': [{required: true, message: '收货人不能为空', trigger: 'blur'}],
                    'awbinfo.cnsntel': [{required: true, message: '收货电话不能为空', trigger: 'blur'}],
                    'awbinfo.cnsnaddress': [{required: true, message: '收获地址不能为空', trigger: 'blur'}],
                    'awbinfo.cnscountyr': [{required: true, message: '国家代码不能为空', trigger: 'change'}],
                    'awbinfo.paymodel':[{required: true, message: '付费方式必须选择', trigger: 'change'}],
1017
                    'awbinfo.awbtype':[{required: true, message: '海关状态必须选择', trigger: 'change'}],
1018 1019 1020 1021 1022
                    customcode:[{required: true, message: '海关关区必须选择', trigger: 'change'}],
                    goodsname:[{required: true, message: '货物描述必须填写', trigger: 'blur'}]
                },
                labelPosition: 'left',
                splitcodes: [{value:'T',label:'否'},{value:'P',label:'是'}],
1023 1024 1025
                shprcountyrs:[],
                cnscountyrs:[],
                countryCode:'',
1026 1027 1028
                msg:'',
                code:'',
                centerDialogVisible:false,
1029 1030 1031 1032
                FenStatus:'',
                sumNmmsCount:0,
                sumNmmsPrice:0,
                sumNmmsWeight:0,
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048
                dialogFormVisible: false,
                formLabelWidth: '100px',
                Udform:{
                    operreason:'',
                    operperson:'',
                    opertel:'',
                    flightdate:'',
                    flightno:'',
                    carrier:'',
                    awbano:'',
                    awbhno:'',
                    bustype:'',
                    busdate:'',
                    busweight:'',
                    buspiece:'',
                    opertype:'',
xudada authored
1049
                    cusrestext:''
1050 1051 1052 1053 1054 1055
                },
                udrules:{
                    operreason: [{required: true, message: '请输入操作原因', trigger: 'blur'}],
                    operperson: [{required: true, message: '请输入操作人', trigger: 'blur'}],
                    opertel: [{required: true, message: '请输入操作人联系电话', trigger: 'blur'}],
                },
1056 1057
                udStatus:'',
                loading:false,
xudada authored
1058
                temprows:{},
xudada authored
1059
                dialogTableVisible:false,
xudada authored
1060
                gridData:[],
1061
                tableloading:false,
1062 1063 1064 1065
                htmlTitle:'',
                batich:true,
                batichboolean:false,
                uuids:[],
1066 1067 1068
            }
        },
        methods: {
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080
            toggleRowExpansion() {
                this.isExpansion = !this.isExpansion;
                this.toggleRowExpansionAll(this.tableData, this.isExpansion);
            },
            toggleRowExpansionAll(data, isExpansion) {
                data.forEach((item) => {
                    this.$refs.dataTreeList.toggleRowExpansion(item, isExpansion);
                    if (item.children !== undefined && item.children !== null) {
                        this.toggleRowExpansionAll(item.children, isExpansion);
                    }
                });
            },
xudada authored
1081 1082
            //导出PDF,EXCEL文件
            handleCommand(command) {
1083
                if(command=='EXCEL'){
xudada authored
1084 1085
                    this.$message('正在为您下载' + command+'文件');
                    this.downLoad();
1086
                }else{
xudada authored
1087
                    this.htmlTitle=this.defaultQuery.flightno+this.defaultQuery.flightdate;
1088
                    htmlToPdf.downloadPDF(document.querySelector('#pdfDom'), this.htmlTitle)
xudada authored
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109
                    this.$message('正在为您下载' + command+'文件');
                    //this.getPdf();
                }
            },
            downLoad(){
                var wb = XLSX.utils.table_to_book(document.querySelector(".table"));
                var wbout = XLSX.write(wb, {
                    bookType: "xlsx",
                    bookSST: true,
                    type: "array"
                });
                try {
                    FileSaver.saveAs(
                        new Blob([wbout], { type: "application/octet-stream" }),
                        this.defaultQuery.flightno+this.defaultQuery.flightdate+ ".xlsx" //  name+'.xlsx'表示导出的excel表格名字
                    );
                } catch (e) {
                    if (typeof console !== "undefined") console.log(e, wbout);
                }
                return wbout;
            },
xudada authored
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
            //回执收发明细
            handleDetail(index,row){
                if(row.flightno.length>4){
                    row.flightno=row.flightno.substring(2);
                }
                let params={awbano:row.awba,awbhno:row.awbh,carrier:row.carrier,flightno:row.flightno,flightdate:row.flightdate,bustype:'MT1201'}
                selectResponseList(params).then(res=>{
                    this.dialogTableVisible=true;
                    let response=res.data.data;
                        this.gridData=response;
1120
                        console.log(response)
xudada authored
1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139
                });
            },
            //更改状态
            UpdateStatus(column,row){
                this.$confirm("是否发送更改状态", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '确认更改',
                    cancelButtonText: '取消更改'
                }).then(() => {
                    row.status = '22';
                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消状态更改'
                            : '状态更改取消'
                    })
                })
            },
xudada authored
1140 1141 1142 1143 1144 1145 1146
            //状态识别
            formatStatus: function(row,column){
               return row.status=='01'?'接受申报':row.status=='02'?'待人工审核':row.status=='03'?'退单'
                   :row.status=='11'?'放行':row.status=='12'?'拒装':row.status=='13'?'禁卸'
                   :row.status=='21'?'可自动发送':row.status=='22'?'未发送':row.status=='23'?'已发送新增报'
                   :row.status=='24'?'已发送删除报':row.status=='25'?'已发送修改报':'';
            },
xudada authored
1147
            //发送舱单报按钮,删除,修改判定事件
1148 1149 1150 1151 1152 1153 1154
            // btSendStatusFormater:(status) => {
            //     if(status=='23' || status=='24'||status=='25'){
            //          return true;
            //     }else if(status=='22' ) {
            //         return false;
            //     }
            // },
xudada authored
1155
            btSendStatusFormater:(status) => {
1156
                if(status=='22'){
xudada authored
1157
                    return false;
1158 1159
                }else {
                    return true;
xudada authored
1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175
                }
            },
            btEditStatusFormater:(status) => {
                if(status=='23' || status=='24'||status=='25'){
                    return true;
                }else if(status=='22' ) {
                    return false;
                }
            },
            btDeleStatusFormater:(status) => {
                if(status=='23' || status=='24'||status=='25'){
                    return true;
                }else if(status=='22' ) {
                    return false;
                }
            },
1176
            /*多选框功能批量选择*/
1177 1178
            handleSelectionChange(val) {
                this.multipleSelection = val;
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
                if(this.multipleSelection!=null && this.multipleSelection!=""){
                    this.batich=false;
                }else{
                    this.batich=true;
                }

            },
            //批量删除
            batchdel(){
                let ids=[];
                this.multipleSelection.forEach(function (item) {
                    ids.push(item.uuid);
                })
                this.uuids=ids;
                this.udStatus='delete';
                this.dialogFormVisible=true;
                this.batichboolean=true;
            },
            //批量申请
            batchaplly(){
                let ids=[];
                this.multipleSelection.forEach(function (item) {
                    ids.push(item.uuid);
                })
                sendBatchApllyMt1201(ids).then(res=>{
                    let response=res.data;
                    this.code=response.code;
                    if(this.code=='200'){
                        this.centerDialogVisible=true;
                        this.msg=response.msg;
                    }else{
                        this.centerDialogVisible=true;
                        this.msg=response.msg;
                    }
                });
1214 1215 1216 1217 1218 1219 1220
            },
            /*编辑主单信息*/
            handleEdit(index, row){
                this.outerVisible = true;
                this.dialogStatus='update';
                this.FenStatus='ediAwbh';
                this.ruleForm=row;
1221
                //this.ruleForm.originstation=this.defaultQuery.originstation+"-"+this.defaultQuery.destinationstation;
1222
                this.ruleForm.flightno=this.defaultQuery.flightno;
1223 1224 1225 1226 1227 1228
                this.FenQuery.awba=row.awba;
                this.FenQuery.flightno= row.flightno;
                this.FenQuery.flightdate=row.flightdate
                this.FenQuery.originstation=this.defaultQuery.originstation;
                this.FenQuery.destinationstation=row.destinationstation;
                this.getFenList(this.FenQuery);
1229 1230 1231
                // this.$nextTick(function () {
                //     this.$refs.formName.resetFields();
                // });
1232 1233 1234 1235 1236 1237 1238 1239
            },
            /*编辑分单信息*/
            handleFen(index,row){
                this.outerVisible = true;
                this.dialogStatus='update';
                this.FenStatus='addAwbh';
                this.ruleForm=row;
                this.ruleForm.flightno=row.carrier+row.flightno;
1240
               // this.ruleForm.originstation=row.originstation+"-"+row.destinationstation;
1241 1242
            },
            //发送舱单报
1243 1244 1245 1246 1247 1248
            handleSend(index,row){
                if(row.flightno.length>4){
                    row.flightno=row.flightno.substring(2)
                }else{
                    row.flightno=row.flightno;
                }
1249
                const map = {'mt1201':row,'username':loginedUserInfo().username}
1250 1251 1252 1253 1254
                sendCreateMt1201(map).then(res=>{
                    let response=res.data;
                    //console.log(res);
                    this.code=response.code;
                    if(this.code=='200'){
xudada authored
1255
                        row.status='23'
xudada authored
1256
                        row.customText='舱单报发送成功';
1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281
                        this.outerVisible = false;
                        this.centerDialogVisible=true;
                        this.msg=response.msg;
                    }else{
                        this.outerVisible = false;
                        this.centerDialogVisible=true;
                        this.msg=response.msg;
                    }
                });
            },
            //发送舱单删除报
            handleDelete(index,row){
                this.udStatus='delete';
                this.dialogFormVisible=true;
                this.Udform.awbano=row.awba;
                this.Udform.awbhno=row.awbh;
                this.Udform.carrier=row.carrier;
                this.Udform.flightno=row.flightno.substring(2);
                this.Udform.flightdate=row.flightdate;
                this.Udform.bustype='MT1201';
                this.Udform.busdate=Date.parse(new Date());
                this.Udform.busweight=row.weight;
                this.Udform.buspiece=row.piece;
                this.Udform.opertype='发送舱单删除报';
                if(row.flightno.length>4){
xudada authored
1282 1283
                    row.flightno=row.flightno.substring(2);
                }
xudada authored
1284
                this.temprows= row;
1285
                this.batichboolean=false;
1286 1287 1288
            },
            //提交发送舱单删除报表单
            deleteUdForm(formName){
xudada authored
1289 1290
                this.$refs[formName].validate((valid) => {
                    if (valid) {
1291
                        if(this.batichboolean){
1292
                            let arr={ids:this.uuids,reason:this.Udform.operreason,contactName:loginedUserInfo().username,contactTel:this.Udform.opertel,content:''}
1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314
                            sendBatchDelMt1201(arr).then(res=>{
                                let response=res.data;
                                this.code=response.code;
                                if(this.code=='200'){
                                    this.centerDialogVisible=true;
                                    this.msg=response.msg;
                                }else{
                                    this.centerDialogVisible=true;
                                    this.msg=response.msg;
                                }
                            });
                        }else{
                            const map = {'flightNo':this.temprows.flightno,
                                'flightDate':this.temprows.flightdate,
                                'awba':this.temprows.awba,
                                'content':'',
                                'customCode':this.temprows.customcode,
                                'awbh':this.temprows.awbh,
                                'reason' :this.Udform.operreason,
                                'contactName':this.Udform.operperson,
                                'contactTel':this.Udform.opertel,
                                'carrier':this.Udform.carrier,
1315
                                'username':loginedUserInfo().username}
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334
                            sendRemoveMt1201(map).then(res=>{
                                let response=res.data;
                                //console.log(res);
                                this.code=response.code;
                                if(this.code=='200'){
                                    this.temprows.status='24';
                                    this.temprows.customText='舱单删除报发送成功';
                                    this.dialogFormVisible=false;
                                    this.outerVisible = false;
                                    this.centerDialogVisible=true;
                                    this.msg=response.msg;
                                }else{
                                    this.dialogFormVisible=false;
                                    this.outerVisible = false;
                                    this.centerDialogVisible=true;
                                    this.msg=response.msg;
                                }
                            });
                        }
xudada authored
1335 1336 1337
                    } else {
                        console.log('error submit!!');
                        return false;
1338 1339
                    }
                });
xudada authored
1340
1341
            },
1342 1343
            /*发送舱单修改报*/
            handleUpdate(index,row){
1344
                this.udStatus='update';
1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355
                this.dialogFormVisible=true;
                this.Udform.awbano=row.awba;
                this.Udform.awbhno=row.awbh;
                this.Udform.carrier=row.carrier;
                this.Udform.flightno=row.flightno.substring(2);
                this.Udform.flightdate=row.flightdate;
                this.Udform.bustype='MT1201';
                this.Udform.busdate=Date.parse(new Date());
                this.Udform.busweight=row.weight;
                this.Udform.buspiece=row.piece;
                this.Udform.opertype='发送舱单修改报';
1356 1357 1358 1359
                if(row.flightno.length>4){
                    row.flightno=row.flightno.substring(2);
                }else{
                    row.flightno=row.flightno;
1360
                }
xudada authored
1361
                this.temprows=row;
1362 1363
            },
            //提交发送舱单修改报表单
1364
            updateUdForm(formName){
1365
                this.$refs[formName].validate((valid) => {
xudada authored
1366 1367 1368 1369
                    if (valid) {
                        const map = {'mt1201':this.temprows,
                            'reason' :this.Udform.operreason,
                            'contactName':this.Udform.operperson,
1370
                            'contactTel':this.Udform.opertel,
1371
                            'username':loginedUserInfo().username}
xudada authored
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393
                        sendEditeMt1201(map).then(res=>{
                            let response=res.data;
                            //console.log(res);
                            this.code=response.code;
                            if(this.code=='200'){
                                this.temprows.status='25'
                                this.temprows.customText='舱单修改报发送成功';
                                this.dialogFormVisible=false;
                                this.outerVisible = false;
                                this.centerDialogVisible=true;
                                this.msg=response.msg;
                            }else{
                                this.dialogFormVisible=false;
                                this.outerVisible = false;
                                this.centerDialogVisible=true;
                                this.msg=response.msg;
                            }
                        });
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
1394
                });
xudada authored
1395
1396
            },
1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407
            /*编辑分单列表信息*/
            handleClick(row) {
                this.outerVisible = true;
                this.dialogStatus='update';
                this.FenStatus='addAwbh';
                this.ruleForm=row;
                this.ruleForm.flightno=row.carrier+row.flightno;
                this.ruleForm.originstation=row.originstation+"-"+row.destinationstation;
            },
            /*获取默认值*/
            getDefaultData(){
1408 1409 1410 1411 1412 1413 1414
                if(
                    jsutil.checkNull(this.$route.query)
                    && jsutil.checkNull(this.$route.query.flightno)
                    && jsutil.checkNull(this.$route.query.flightdate)
                    && jsutil.checkNull(this.$route.query.originstation)
                    && jsutil.checkNull(this.$route.query.destinationstation)
                ) {
1415 1416 1417 1418 1419 1420 1421 1422 1423 1424
                    this.defaultQuery.flightno =this.$route.query.flightno;
                    this.defaultQuery.flightdate = this.$route.query.flightdate;
                    this.defaultQuery.originstation = this.$route.query.originstation;
                    this.defaultQuery.destinationstation = this.$route.query.destinationstation;
                    this.defaultQuery.awba = this.$route.query.awba;
                    this.getList();
                }else {
                    this.$router.push({
                        path:'/enter'
                    })
1425
                }
1426
1427 1428 1429
            },
            /*获取默认数据列表*/
            getList(){
1430
                let _this = this;
小范 authored
1431
                this.tableloading=true;
1432
                getMt1201List(this.defaultQuery).then(res =>{
1433 1434 1435
                    this.sumNmmsCount=0;
                    this.sumNmmsPrice=0;
                    this.sumNmmsWeight=0;
1436 1437
                    let response=res.data.data;
                    this.tableData=response;
xudada authored
1438
                    this.tableloading=false;
1439 1440 1441 1442
                    response.forEach((item,i) => {
                        if(item.awba!=null&&item.awbh=="");
                        this.sumNmmsCount=Number(this.sumNmmsCount)+1;
                        this.sumNmmsPrice=Number(this.sumNmmsPrice)+Number(item.piece);
1443
                        this.sumNmmsWeight=Number(Number(this.sumNmmsWeight)+Number(item.weight)).toFixed(2);
1444
                    })
1445 1446 1447 1448 1449 1450 1451
                }).catch(error => {
                    _this.tableloading=false;
                    _this.$message({
                        //  饿了么的消息弹窗组件
                        message: error,
                        type: "error"
                    });
1452 1453 1454
                });
            },
            /*获取国家代码*/
1455 1456 1457 1458 1459
            remoteMethod:function(query){
                this.shprcountyrs=[];
                this.cnscountyrs=[];
                let params={countryCode:query};
                this.loading = true;
1460
                getCountryCode(params).then(res =>{
1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471
                    if (res !== '') {
                        setTimeout(() => {
                            this.loading = false;
                            this.shprcountyrs=res.data.data;
                            this.cnscountyrs=res.data.data;
                        }, 200);
                    } else {
                        this.shprcountyrs = [];
                        this.cnscountyrs=[];
                    }
1472 1473 1474
                });
            },
            //获取关区代码
1475 1476 1477 1478
            remoteMethod2:function(query){
                this.customcodes=[];
                let params={customcode:query};
                this.loading = true;
1479
                selectCustomcode(params).then(res =>{
1480 1481 1482 1483 1484 1485 1486 1487 1488
                    if (res !== '') {
                        setTimeout(() => {
                            this.loading = false;
                            this.customcodes=res.data.data;
                        }, 200);
                    } else {
                        this.customcodes = [];
                    }
1489 1490 1491 1492 1493 1494 1495
                });
            },
            //新增原始舱单按钮
            addOrig(){
                this.dialogStatus="create";
                this.outerVisible = true;
                this.FenStatus='ediAwbh';
1496 1497 1498
                this.ruleForm.flightno=this.$route.query.flightno;
                this.ruleForm.flightdate=this.$route.query.flightdate;
                this.ruleForm.originstation=this.$route.query.originstation+"-"+this.$route.query.destinationstation;
1499 1500 1501 1502 1503 1504 1505 1506
            },
            //新增原始分单
            addFen(formName){
                this.dialogStatus="create";
                this.outerVisible = true;
                this.FenStatus='addAwbh';
            },
            //新增原始舱单数据
1507 1508
            createData:function(formName){
                let _this = this;
1509 1510
                this.$refs[formName].validate((valid) => {
                    if (valid) {
1511 1512 1513
                        _this.ruleForm.userinfo = {
                            username: ''
                        }
1514
                        _this.ruleForm.userinfo.username=loginedUserInfo().username;
1515 1516
                        _this.ruleForm.status='22';
                        addMt1201(_this.ruleForm).then(res=>{
1517
                            let response=res.data;
1518 1519 1520 1521 1522 1523 1524
                            _this.code=response.code;
                            if(_this.code=='200'){
                                _this.outerVisible = false;
                                _this.$refs[formName].resetFields();
                                _this.centerDialogVisible=true;
                                _this.msg=response.msg;
                                _this.getList();
1525
                            }else{
1526 1527 1528 1529
                                _this.outerVisible = false;
                                _this.centerDialogVisible=true;
                                _this.$refs[formName].resetFields();
                                _this.msg=response.msg;
1530 1531 1532 1533 1534 1535 1536 1537 1538 1539
                            }
                    });
                    } else {
                        console.log('error submit!!');
                return false;
            }
            });

            },
            //修改原始舱单数据
1540 1541
            updateData: function(formName){
                let _this = this;
1542 1543
                this.$refs[formName].validate((valid) => {
                    if (valid) {
1544 1545 1546
                        _this.ruleForm.userinfo = {
                            username: ''
                        }
1547
                        _this.ruleForm.userinfo.username=loginedUserInfo().username;
1548
                        _this.ruleForm.originstation=_this.ruleForm.originstation+"-"+_this.ruleForm.destinationstation;
1549
                        ediMt1201(_this.ruleForm).then(res=>{
1550 1551
                            let response=res.data;
                        //console.log(res);
1552 1553 1554 1555 1556 1557
                        _this.code=response.code;
                        if(_this.code=='200'){
                            _this.outerVisible = false;
                            _this.centerDialogVisible=true;
                            _this.msg=response.msg;
                            _this.getList();
1558
                        }else{
1559 1560 1561
                            _this.outerVisible = false;
                            _this.centerDialogVisible=true;
                            _this.msg=response.msg;
1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579
                        }
                    });
                    } else {
                        console.log('error submit!!');
                return false;
            }
            });
            },
            //获取分单列表
            getFenList(data){
                getFenList(data).then(res =>{
                    //console.log(res);
                    let response=res.data.data;
                this.tableData2=response;
            });
            },
            //分拨申请
            Importallocation(index,row){
xudada authored
1580
                this.$router.push({name:'进港分拨',params:{carrier:row.carrier,flightno:row.flightno,awba:row.awba,flightdate:row.flightdate,
1581 1582 1583 1584 1585
                    turnpiece:row.awbinfo.pcs,turnweight:row.awbinfo.weight,customcode:row.customcode}});

            },
            //分拨运抵
            Allocatearrive(index,row){
xudada authored
1586
                this.$router.push({name:'分拨运抵',params:{carrier:row.carrier,flightno:row.flightno,awba:row.awba,flightdate:row.flightdate,
1587
                    turnpiece:row.awbinfo.pcs,turnweight:row.awbinfo.weight,customcode:row.customcode,goodsname:row.goodsname}});
xudada authored
1588
            },
1589
1590
            //返回上一层
xudada authored
1591
            back(){
1592
                this.$router.go(-1);
xudada authored
1593
            },
1594 1595

        },
1596 1597 1598
        computed:{
            ...mapGetters(['getUserInfoStore','getUserMenuStore']) // 动态计算属性,相当于this.$store.getters.resturantName
        },
1599
        /*渲染方法*/
1600
        activated(){
1601
            this.getDefaultData();
1602
            this.isExpansion=true;
1603 1604
        }
    }
1605
</script>