审查视图

src/views/nmms_import/TallyMster.vue 49.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<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">
25
                                <el-col :span="9">
26
                                    <div class="grid-content">
27 28 29
                                        <el-input v-model="defaultQuery.awba" placeholder="请输入主单号" style="width: 250px">
                                            <template slot="prepend">主单号</template>
                                        </el-input>
30 31
                                    </div>
                                </el-col>
32
                                <el-col :span="2"><div class="grid-content"><el-button type="primary" v-on:click="getMt5201List" size="mini">查询</el-button></div></el-col>
33 34 35 36 37 38 39 40 41 42 43
                            </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
44
                                ref="multipleTable"
45 46
                                :data="tableData"
                                tooltip-effect="dark"
xudada authored
47
                                v-loading="tableLoading"
48 49
                                style="border-radius: 10px 10px 0px 0px;line-height: 25px;min-height: 500px"
                                :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
50 51 52 53 54 55 56 57 58 59 60
                                @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="运单号"
xudada authored
61
                                    width="185"
62
                                    show-overflow-tooltip>
xudada authored
63 64 65 66 67 68 69 70
                                <template slot-scope="scope">
                                        <span v-if="scope.row.awbh==''||scope.row.awbh==null">
                                            {{scope.row.awba}}
                                        </span>
                                    <span v-else>
                                            {{scope.row.awbh}}
                                        </span>
                                </template>
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
                            </el-table-column>
                            <el-table-column
                                    prop="totalpiece"
                                    label="舱单件数"
                                    width="80"
                                    show-overflow-tooltip>
                            </el-table-column>
                            <el-table-column
                                    prop="totalweight"
                                    label="舱单重量"
                                    width="80"
                                    show-overflow-tooltip>
                            </el-table-column>
                            <el-table-column
                                    prop="piece"
                                    label="理货件数"
                                    width="80"
                                    show-overflow-tooltip>
                            </el-table-column>
                            <el-table-column
                                    prop="weight"
                                    label="理货重量"
                                    width="80"
                                    show-overflow-tooltip>
                            </el-table-column>
                            <el-table-column
                                    prop="starttime"
                                    label="卸货时间"
                                    type="date"
                                    width="160">
                            </el-table-column>
                            <el-table-column
                                    prop="status"
                                    label="状态"
xudada authored
105
                                    width="100" :formatter="formatStatus">
106 107
                            </el-table-column>
                            <el-table-column
xudada authored
108 109 110
                                    label="回执内容"
                                    width="250">
                                <template slot-scope="scope">
111 112 113 114 115 116 117
                                    <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">
118 119 120
                                       {{scope.row.ext5}}
                                    </span>
                                    <span v-else-if="scope.row.status=='01' || scope.row.status=='11'" style="color: #67C23A">
xudada authored
121 122 123 124 125 126 127 128 129 130 131 132
                                        {{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>
133 134 135 136
                            </el-table-column>
                            <el-table-column
                                    prop="operation"
                                    label="操作"
137
                                    width="285"
138 139
                                    show-overflow-tooltip>
                                <template slot-scope="scope">
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 167 168 169 170 171 172 173
                                    <el-row type="flex" justify="space-between">
                                        <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="handleMain(scope.$index, scope.row)">编辑主单</el-button>
                                        <el-button
                                                v-else
                                                size="mini"
                                                type="success"
                                                @click="handleFen(scope.$index, scope.row)">编辑分单
                                        </el-button>
                                    </el-row>
                                    <el-row type="flex" justify="space-between">
                                        <el-button
                                                size="mini"
                                                type="primary"
                                                :disabled="btSendStatusFormater(scope.row.status)"
                                                @click="handleCreate(scope.$index, scope.row)">发理货报</el-button>
                                        <el-button
                                                size="mini"
                                                type="danger"
                                                :disabled="btDeleStatusFormater(scope.row.status)"
                                                @click="handleDelete(scope.$index, scope.row)">发删除报</el-button>
                                        <el-button
                                                size="mini"
                                                type="warning"
                                                @click="UpdateStatus(scope.$index, scope.row)">更改状态
                                        </el-button>
                                    </el-row>
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
                                </template>
                            </el-table-column>
                        </el-table>
                    </template>
                </el-col>
            </el-row>
            <!--编辑主单-->
            <el-dialog :title="'进港理货信息'+textMap[dialogStatus]" :visible.sync="outerVisible" width="90%">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-position="labelPosition"
                         label-width="78px" size="mini">
                    <!--航班信息部分-->
                    <el-row class="flightInfo">
                        <el-col :span="24">
                            <div class="grid-content content" style="margin-bottom: 10px;">航班信息</div>
                        </el-col>
                        <el-row class="flightInfo">
                            <el-col :span="6">
191
                                <el-form-item label="" prop="awba">
192
                                    <div v-if="dialogStatus === 'update'">
193 194 195
                                        <el-input disabled="" v-model="ruleForm.awba" style="width: 200px">
                                            <template slot="prepend">运单号</template>
                                        </el-input>
196 197
                                    </div>
                                    <div v-else>
198 199 200
                                        <el-input v-model="ruleForm.awba" style="width: 200px">
                                            <template slot="prepend">运单号</template>
                                        </el-input>
201 202 203
                                    </div>
                                </el-form-item>
                            </el-col>
204
                            <el-col :span="4" style="margin-right: -15px">
205
                                <div v-if="FenStatus === 'addAwbh'">
206 207 208 209
                                    <el-form-item label="" prop="awbh">
                                        <el-input v-model="ruleForm.awbh" style="width: 200px">
                                            <template slot="prepend">分单号</template>
                                        </el-input>
210 211 212
                                    </el-form-item>
                                </div>
                                <div v-else>
213 214 215 216
                                    <el-form-item style="display: none" label="" prop="awbh">
                                        <el-input v-model="ruleForm.awbh" style="width: 200px">
                                            <template slot="prepend">分单号</template>
                                        </el-input>
217 218 219 220
                                    </el-form-item>
                                </div>
                            </el-col>
                            <el-col :span="6">
221 222 223 224
                                <el-form-item label="" prop="flightno">
                                    <el-input disabled="" v-model="ruleForm.flightno" style="width: 200px">
                                        <template slot="prepend">航班号</template>
                                    </el-input>
225 226
                                </el-form-item>
                            </el-col>
227 228 229 230
                            <el-col :span="9">
                                <el-form-item label="" required  prop="flightdate">
                                    <div class="ip">
                                        航班日期                                    </div>
231 232
                                            <el-date-picker disabled="" type="date" placeholder="选择日期" :clearable="false"
                                                            v-model="ruleForm.flightdate"
233
                                                            style="width: 120px;"></el-date-picker>
234 235 236 237 238
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row class="flightInfo">
                            <el-col :span="6">
239 240 241 242
                                <el-form-item label="" prop="originstation">
                                    <el-input  style="width: 200px" disabled="" v-model="ruleForm.originstation" onkeyup="this.value=this.value.toUpperCase()">
                                        <template slot="prepend">起始站</template>
                                    </el-input>
243 244
                                </el-form-item>
                            </el-col>
245 246 247 248 249
                            <el-col :span="7">
                                <el-form-item label="" prop="destinationstation">
                                    <el-input style="width: 200px"  disabled="" v-model="ruleForm.destinationstation" onkeyup="this.value=this.value.toUpperCase()">
                                        <template slot="prepend">目的站</template>
                                    </el-input>
250 251
                                </el-form-item>
                            </el-col>
252
                            <el-col :span="2">
253 254 255 256 257 258 259 260 261 262 263 264 265
                                <el-button size="mini" type="primary" @click="dialogStatus==='create'?createData('ruleForm'):updateData('ruleForm')" style="float: right">保存</el-button>
                            </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 style="margin-bottom: 0px;">
                        <el-row class="product">
                            <el-col :span="6">
266 267 268 269
                                <el-form-item label="" prop="pcs">
                                    <el-input type="number" v-model="ruleForm.pcs" style="width: 200px">
                                        <template slot="prepend">舱单件数</template>
                                    </el-input>
270 271 272
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
273 274 275 276
                                <el-form-item label="" prop="wei">
                                    <el-input type="number" v-model="ruleForm.wei" style="width: 200px">
                                        <template slot="prepend">舱单重量</template>
                                    </el-input>
277 278 279
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
280 281 282 283
                                <el-form-item label="" prop="piece">
                                    <el-input type="number" v-model="ruleForm.piece" style="width: 200px">
                                        <template slot="prepend">理货件数</template>
                                    </el-input>
284 285 286
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
287 288 289 290
                                <el-form-item label="" prop="weight">
                                    <el-input type="number" v-model="ruleForm.weight" style="width: 200px">
                                        <template slot="prepend">理货重量</template>
                                    </el-input>
291 292 293 294 295
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-row>
                    <el-row class="flightInfo">
296 297 298 299 300
                        <el-col :span="7">
                            <el-form-item label="" prop="customcode">
                                <div class="ip">
                                    海关关区
                                </div>
301 302 303 304 305 306
                                <el-select v-model="ruleForm.customcode"
                                           filterable
                                           allow-create
                                           default-first-option
                                           remote
                                           :remote-method="remoteMethod2"
307
                                           :loading="loading" placeholder="请选择" style="width: 115px">
308 309 310 311 312 313 314 315
                                    <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>
316 317 318
                                </el-select>
                            </el-form-item>
                        </el-col>
319 320
                        <el-col :span="12" style="margin-left: -45px">
                            <el-form-item label="" required>
321
                                    <el-form-item prop="starttime">
322 323 324
                                        <div class="ip">
                                            卸货时间
                                        </div>
325 326
                                        <el-date-picker type="datetime" placeholder="选择日期" :clearable="false" value-format="yyyy-MM-dd HH:mm:ss"
                                                        v-model="ruleForm.starttime"
327
                                                        style="width: 200px;"></el-date-picker>
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
                                    </el-form-item>
                            </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"
351 352
                                        style="border-radius: 10px 10px 0px 0px;line-height: 25px;min-height: 500px"
                                        :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small">
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390
                                    <el-table-column
                                            prop="awbh"
                                            label="分单号"
                                            width="250">
                                    </el-table-column>
                                    <el-table-column
                                            prop="piece"
                                            label="舱单件数"
                                            width="200">
                                    </el-table-column>
                                    <el-table-column
                                            prop="weight"
                                            label="舱单重量"
                                            width="200">
                                    </el-table-column>
                                    <el-table-column
                                            prop="goodsname"
                                            label="卸货时间"
                                            width="250">
                                    </el-table-column>
                                    <el-table-column
                                            fixed="right"
                                            label="操作"
                                            width="230">
                                        <template slot-scope="scope">
                                            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑
                                            </el-button>
                                            <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>
            <!--底部按钮及理货信息-->
391
            <el-row style="margin-top: 20px">
392
                <el-col :span="2.5"><div class="grid-content"><el-button type="primary" v-on:click="addTally" size="mini">新增进港理货</el-button></div></el-col>
393 394
                <el-col :span="2.5"><div class="grid-content"><el-button type="primary" size="mini" :disabled="batich" @click="batchdel()">批量发送删除报</el-button></div></el-col>
                <el-col :span="2.5"><div class="grid-content"><el-button type="primary" size="mini" :disabled="batich" @click="batchaplly()">批量申请</el-button></div></el-col>
395
                <el-col :span="1.5"><div class="grid-content"><el-button type="primary" @click="back" size="mini">返回</el-button></div></el-col>
396 397
                <el-col :span="2.5"><div class="grid-content"><span>主单数:{{sumNmmsCount}}</span></div></el-col>
                <el-col :span="3.5"><div class="grid-content"><span>理货总件数:{{sumNmmsPrice}}</span></div></el-col>
398
                <el-col :span="7.5"><div class="grid-content"><span>理货总重量:{{sumNmmsWeight}}</span></div></el-col>
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413
            </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>
414 415 416 417
            <!--发送删除报修改报提示框-->
            <el-row>
                <el-dialog :title="'提交'+Reason[udStatus]+'信息'" :visible.sync="dialogFormVisible">
                    <el-form :model="Udform" :rules="udrules" ref="Udform" class="demo-ruleForm">
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
<!--                        <el-form-item label="操作原因" prop="operreason">-->
<!--                            <el-input type="textarea" v-model="Udform.operreason"></el-input>-->
<!--                        </el-form-item>-->
<!--                        <el-form-item label="操作人" prop="operperson">-->
<!--                            <el-input v-model="Udform.operperson"></el-input>-->
<!--                        </el-form-item>-->
<!--                        <el-form-item label="联系电话" prop="opertel">-->
<!--                            <el-input v-model="Udform.opertel"></el-input>-->
<!--                        </el-form-item>-->
                        <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>
454
                    </el-form>
455
                    <div slot="footer" class="dialog-footer" style="margin-top: 30px" align="center">
456 457 458 459 460
                        <el-button @click="dialogFormVisible = false">取 消</el-button>
                        <el-button type="primary" @click="deleteUdForm('Udform')">确 定</el-button>
                    </div>
                </el-dialog>
            </el-row>
xudada authored
461 462 463
            <!--明细列表弹出框-->
            <el-row>
                <el-dialog title="回执明细列表" :visible.sync="dialogTableVisible" width="70%">
464 465
                    <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
466 467
                        <el-table-column property="busdate" label="时间" width="160"></el-table-column>
                        <el-table-column property="username" label="操作人" width="130"></el-table-column>
468 469
                        <el-table-column property="buspiece" label="发送件数" width="100"></el-table-column>
                        <el-table-column property="busweight" label="发送重量" width="100"></el-table-column>
xudada authored
470 471 472 473
                        <el-table-column property="cusrestext" label="回执内容"></el-table-column>
                    </el-table>
                </el-dialog>
            </el-row>
474 475 476 477
        </el-main>
    </el-container>
</template>
<style scoped>
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493
    .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;
    }
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
    .grid-content{height: 36px;line-height: 36px;margin-right: 5px;}
    .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}
    .flightInfo {
        margin-bottom: 0px
    }
    .el-form-item {
        margin-bottom: 2px;
    }

    .flightInfo {
        margin-bottom: 3px
    }

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

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

    .product {
        margin-bottom: 5px;
    }

    .pub {
        margin-right: 10px;
    }
</style>

<script>
xudada authored
528
    import{addResponse,selectResponseList} from "../../api/InResponse";
529
    import { getMt5201List,addMt5201,ediMt5201,delMt5201,sendCreateMt520x,sendRemoveMt520x,selectCustomcode,sendbatchRemoveMt5201,sendbatchCreateMt5201} from '../../api/mt5201'
530
    import loginUserInfo from '@/api/base'
531
    import {sendBatchApllyMt1201, sendBatchDelMt1201} from "../../api/mt1201";
532
    import {mapActions, mapGetters} from 'vuex'
533
    import {loginedUserInfo} from "../../api/user";
534
    export default {
535
        name:'Tallymster',
536 537 538 539 540 541 542
        data() {
            return {
                defaultQuery:{
                    flightno:undefined,
                    flightdate:undefined,
                    originstation:undefined,
                    destinationstation:undefined,
543
                    awba:undefined,
544
                },
545
                LoginUserInfo: loginUserInfo,
546 547 548 549 550 551 552 553 554 555
                tableData: [],
                tableData2: [],
                multipleSelection: [],
                outerVisible: false,
                dialogStatus:'',
                labelPosition: 'left',
                textMap:{
                    update: '编辑',
                    create: '添加'
                },
556
                customcodes:[],
557 558
                ruleForm:{
                    awba:undefined,
xudada authored
559
                    awbh:undefined,
560 561 562 563 564 565 566 567 568
                    carrier:undefined,
                    flightno:undefined,
                    flightdate:undefined,
                    originstation:undefined,
                    destinationstation:undefined,
                    piece:undefined,
                    weight:undefined,
                    starttime:undefined,
                    endtime:undefined,
xudada authored
569
                    customcode:undefined,
570 571 572
                    goodsname:undefined,
                    actime:undefined,
                    rcfdep:"MT5201",
xudada authored
573
                    status:'22',
574 575
                    isdelete:undefined,
                    pcs:undefined,
xudada authored
576
                    wei:undefined,
577 578
                    ext5:undefined,
                    userinfo: {
579
                        username: loginedUserInfo().username
580
                    },
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595
                },
                FenStatus:'',
                rules: {
                    awba: [{required: true, message: '请输入运单号', trigger: 'blur'}],
                    flightno: [{required: true, message: '航班号必须输入', trigger: 'blur'}],
                    flightdate: [{required: true, message: '航班日期必须选择', trigger: 'blur'}],
                    originstation: [{required: true, message: '航段必须输入', trigger: 'blur'}],
                    piece: [{required: true, message: '舱单件数必须输入且为数字', trigger: 'blur'}],
                    weight: [{required: true, message: '舱单重量必须输入且为数字', trigger: 'blur'}],
                    customcode:[{required: true, message: '海关关区必须选择', trigger: 'change'}],
                    goodsname:[{required: true, message: '货物描述必须填写', trigger: 'blur'}],
                    starttime: [{required: true, message: '卸货时间必须选择', trigger: 'blur'}]
                },
                centerDialogVisible:false,
                msg:'',
596 597 598
                sumNmmsCount:0,
                sumNmmsPrice:0,
                sumNmmsWeight:0,
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
                Udform:{
                    operreason:'',
                    operperson:'',
                    opertel:'',
                    flightdate:'',
                    flightno:'',
                    carrier:'',
                    awbano:'',
                    awbhno:'',
                    bustype:'',
                    busdate:'',
                    busweight:'',
                    buspiece:'',
                    opertype:'',
                },
                udrules:{
                    operreason: [{required: true, message: '请输入操作原因', trigger: 'blur'}],
                    operperson: [{required: true, message: '请输入操作人', trigger: 'blur'}],
                    opertel: [{required: true, message: '请输入操作人联系电话', trigger: 'blur'}],
                },
                Reason:{
                    update: '修改',
                    delete: '删除'
                },
                udStatus:'',
                dialogFormVisible: false,
                rows:{},
                loading:false,
xudada authored
627
                dialogTableVisible:false,
xudada authored
628
                gridData:[],
629 630 631 632
                tableLoading:false,
                batich:true,
                batichboolean:false,
                uuids:[],
633 634 635
            }
        },
        methods: {
xudada authored
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667
            //更改状态
            UpdateStatus(column,row){
                this.$confirm("是否发送更改状态", "确认消息", {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '确认更改',
                    cancelButtonText: '取消更改'
                }).then(() => {
                    row.status = '22';
                }).catch(action => {
                    this.$message({
                        type: 'info',
                        message: action === 'cancel'
                            ? '取消状态更改'
                            : '状态更改取消'
                    })
                })
            },
            //发送舱单报按钮判定事件
            btSendStatusFormater:(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;
                }
            },
xudada authored
668 669 670 671 672 673 674 675 676 677 678 679
            //回执收发明细
            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:'MT5201'}
                selectResponseList(params).then(res=>{
                    this.dialogTableVisible=true;
                    let response=res.data.data;
                    this.gridData=response;
                });
            },
xudada authored
680 681 682 683 684 685 686
            //状态适配
            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'?'已发送修改报':'';
            },
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 713
            //获取关区代码
            remoteMethod2:function(query){
                this.customcodes=[];
                let params={customcode:query};
                this.loading = true;
                selectCustomcode(params).then(res =>{
                    if (res !== '') {
                        setTimeout(() => {
                            this.loading = false;
                            this.customcodes=res.data.data;
                        }, 200);
                    } else {
                        this.customcodes = [];
                    }

                });
            },
            //发送理货报
            handleCreate(index,row){
                if(row.flightno.length>4){
                    row.flightno=row.flightno.substring(2)
                }else{
                    row.flightno=row.flightno;
                }
                if(row.awbh==null){
                    row.awbh="";
                }
714
                const map = {'mt520x':row,'username':loginedUserInfo().username}
715 716 717 718 719
                sendCreateMt520x(map).then(res=>{
                    let response=res.data;
                    //console.log(res);
                    this.code=response.code;
                    if(this.code=='200'){
xudada authored
720 721
                        row.status='23'
                        row.ext5='理货报发送成功';
722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746
                        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.dialogFormVisible=true;
                this.udStatus='delete';
                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='MT5201';
                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
747 748
                    row.flightno=row.flightno.substring(2);
                }
749 750 751 752
                if(row.awbh==null){
                    row.awbh="";
                }
                this.rows=row;
753
                this.batichboolean=false;
754 755
            },
            //发送理化删除报提交表单
xudada authored
756 757 758
            deleteUdForm(formName){
                this.$refs[formName].validate((valid) => {
                    if (valid) {
759
                        if(this.batichboolean){
760
                            let arr={ids:this.uuids,reason:this.Udform.operreason,contactName:loginedUserInfo().username,contactTel:this.Udform.opertel,content:''}
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783
                            sendbatchRemoveMt5201(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.rows.flightno,
                                'flightDate':this.rows.flightdate,
                                'awba':this.rows.awba,
                                'content':'',
                                'customCode':this.rows.customcode,
                                'awbh':this.rows.awbh,
                                'reason' :this.Udform.operreason,
                                'contactName':this.Udform.operperson,
                                'contactTel':this.Udform.opertel,
                                'rcfdep':this.rows.rcfdep,
                                'carrier':this.rows.carrier,
784
                                'username':loginedUserInfo().username}
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804
                            sendRemoveMt520x(map).then(res=>{
                                let response=res.data;
                                //console.log(res);
                                this.code=response.code;
                                if(this.code=='200'){
                                    this.rows.status='24';
                                    this.rows.ext5='理货删除报发送成功';
                                    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
805 806 807
                    } else {
                        console.log('error submit!!');
                        return false;
808 809
                    }
                });
xudada authored
810
811
            },
812 813 814
            //批量选中事件
            handleSelectionChange(val) {
                this.multipleSelection = val;
815 816 817 818 819 820 821 822 823 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
                if(this.multipleSelection!=null && this.multipleSelection!=""){
                    this.batich=false;
                }else{
                    this.batich=true;
                }
            },
            //批量申请
            batchaplly(){
                let ids=[];
                this.multipleSelection.forEach(function (item) {
                    ids.push(item.uuid);
                })
                sendbatchCreateMt5201(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;
                    }
                });
            },
            //批量删除
            batchdel(){
                let ids=[];
                this.multipleSelection.forEach(function (item) {
                    ids.push(item.uuid);
                })
                this.uuids=ids;
                this.udStatus='delete';
                this.dialogFormVisible=true;
                this.batichboolean=true;
849 850 851 852 853 854 855
            },
            //编辑主单
            handleMain(index,row){
                this.outerVisible = true;
                this.dialogStatus='update';
                this.FenStatus='ediAwbh';
                this.ruleForm=row;
856
                this.ruleForm.flightno=row.carrier+row.flightno;
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873
            },
            //编辑分单
            handleFen(index,row){
                this.outerVisible = true;
                this.dialogStatus='update';
                this.FenStatus='addAwbh';
                this.ruleForm=row;
                this.ruleForm.flightno=row.carrier+row.flightno;
            },
            //新增分单
            addFen(formName){
                this.dialogStatus="create";
                this.outerVisible = true;
                this.FenStatus='addAwbh';
            },
            //获取默认值
            getDefaultData(){
xudada authored
874 875 876 877 878
                this.defaultQuery.flightno = JSON.parse(this.$route.query.flightno);
                this.defaultQuery.flightdate = JSON.parse(this.$route.query.flightdate);
                this.defaultQuery.originstation = JSON.parse(this.$route.query.originstation);
                this.defaultQuery.destinationstation = JSON.parse(this.$route.query.destinationstation);
                this.defaultQuery.awba=JSON.parse(this.$route.query.awba);
879 880 881
            },
            //获取进港理货列表
            getMt5201List(){
xudada authored
882
                this.tableLoading=true;
883
                getMt5201List(this.defaultQuery).then(res =>{
884 885 886
                    this.sumNmmsCount=0;
                    this.sumNmmsPrice=0;
                    this.sumNmmsWeight=0;
887
                    let response=res.data.data;
888
                    this.tableData=response;
xudada authored
889
                    this.tableLoading=false;
890 891 892 893 894 895
                    response.forEach((item,i) => {
                        if(item.awba!=null&&item.awbh=="");
                        this.sumNmmsCount=Number(this.sumNmmsCount)+1;
                        this.sumNmmsPrice=Number(this.sumNmmsPrice)+Number(item.piece);
                        this.sumNmmsWeight=Number(this.sumNmmsWeight)+Number(item.weight);
                    })
896 897 898 899 900 901 902
            });
            },
            //新增理货按钮事件
            addTally(){
                this.outerVisible = true;
                this.dialogStatus="create";
                this.FenStatus='ediAwbh';
xudada authored
903 904 905 906
                this.ruleForm.flightno=JSON.parse(this.$route.query.flightno);
                this.ruleForm.flightdate=JSON.parse(this.$route.query.flightdate);
                this.ruleForm.originstation=JSON.parse(this.$route.query.originstation);
                this.ruleForm.destinationstation=JSON.parse(this.$route.query.destinationstation);
907 908
            },
            //新增原始舱单数据
909 910
            createData:function(formName){
                let _this = this;
911 912
                this.$refs[formName].validate((valid) => {
                    if (valid) {
913 914 915
                        _this.ruleForm.userinfo = {
                            username: ''
                        }
916
                        _this.ruleForm.userinfo.username=loginedUserInfo().username;
917
                        _this.ruleForm.status='22';
xudada authored
918
                        //this.ruleForm.endtime=this.ruleForm.starttime.add(Calendar.MINUTE, 15);
919
                        addMt5201(_this.ruleForm).then(res=>{
920
                            let response=res.data;
921 922 923 924 925 926 927
                            _this.code=response.code;
                        if(_this.code=='200'){
                            _this.outerVisible = false;
                            _this.$refs[formName].resetFields();
                            _this.centerDialogVisible=true;
                            _this.msg=response.msg;
                            _this.getMt5201List();
928
                        }else{
929 930 931 932
                            _this.outerVisible = false;
                            _this.centerDialogVisible=true;
                            _this.$refs[formName].resetFields();
                            _this.msg=response.msg;
933 934 935 936 937 938 939 940 941
                        }
                    });
                    } else {
                        console.log('error submit!!');
                return false;
            }
            });
            },
            //修改进港理货数据
942 943
            updateData:function(formName){
                let _this = this;
944 945
                this.$refs[formName].validate((valid) => {
                    if (valid) {
946 947 948
                        _this.ruleForm.userinfo = {
                            username: ''
                        }
949
                        _this.ruleForm.userinfo.username=loginedUserInfo().username;
950
                        ediMt5201(_this.ruleForm).then(res=>{
951
                            let response=res.data;
952 953 954 955 956 957
                            _this.code=response.code;
                        if(_this.code=='200'){
                            _this.outerVisible = false;
                            _this.centerDialogVisible=true;
                            _this.msg=response.msg;
                            _this.getMt5201List();
958
                        }else{
959 960 961
                            _this.outerVisible = false;
                            _this.centerDialogVisible=true;
                            _this.msg=response.msg;
962 963 964 965 966 967 968 969
                        }
                    });
                    } else {
                        console.log('error submit!!');
                return false;
            }
            });
            },
xudada authored
970 971 972
            back(){
                this.$router.go(-1);//返回上一层
            },
973
        },
974 975 976
        computed:{
            ...mapGetters(['getUserInfoStore','getUserMenuStore']) // 动态计算属性,相当于this.$store.getters.resturantName
        },
977
        //渲染方法
978
        activated(){
979 980 981 982
            this.getDefaultData();
            this.getMt5201List();
        }
    }
983
</script>