审查视图

src/views/transit/transit.vue 48.6 KB
1 2 3 4
<template xmlns:el-col="http://www.w3.org/1999/html">
    <section>
<!--        <el-row  class="toolbar">-->
<!--            <el-col :span="2">-->
5
<!--                <el-input-->
6 7 8
<!--                        v-model="formTrn.customscode"-->
<!--                        placeholder="关区"-->
<!--                        style="width: 100px"-->
9
<!--                />-->
10 11
<!--            </el-col>-->
<!--            <el-col :span="3">-->
12
<!--                <el-input-->
13 14
<!--                        v-model="formTrn.username"-->
<!--                        placeholder="申报用户"-->
15 16
<!--                        style="width: 160px"-->
<!--                />-->
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<!--            </el-col>-->
<!--            <el-col :span="3">-->
<!--&lt;!&ndash;                <el-input&ndash;&gt;-->
<!--&lt;!&ndash;                        v-model="formTrn.trnmode"&ndash;&gt;-->
<!--&lt;!&ndash;                        placeholder="转关方式"&ndash;&gt;-->
<!--&lt;!&ndash;                        style="width: 140px"&ndash;&gt;-->
<!--&lt;!&ndash;                />&ndash;&gt;-->
<!--                <el-select v-model="formTrn.trnmode" placeholder="请选择转关方式" size="mini" style="width: 160px">-->
<!--                    <el-option label="0-非转关运抵模式" value="0"></el-option>-->
<!--                    <el-option label="1-南方转关运抵模式" value="1"></el-option>-->
<!--                    <el-option label="2-北方转关运抵模式" value="2"></el-option>-->
<!--                    <el-option label="3-水运中转运抵模式" value="3"></el-option>-->
<!--                </el-select>-->
<!--            </el-col>-->
<!--            <el-col :span="3">-->
<!--                <el-input-->
<!--                        v-model="formTrn.unloadcode"-->
<!--                        placeholder="卸货地代码"-->
<!--                        style="width: 160px"-->
<!--                />-->
<!--            </el-col>-->
<!--            <el-col :span="7">-->
<!--&lt;!&ndash;                <el-input&ndash;&gt;-->
<!--&lt;!&ndash;                        v-model="formTrn.creattime"&ndash;&gt;-->
<!--&lt;!&ndash;                        placeholder="新增时间段"&ndash;&gt;-->
<!--&lt;!&ndash;                        style="width: 160px"&ndash;&gt;-->
<!--&lt;!&ndash;                />&ndash;&gt;-->
<!--                <el-date-picker-->
<!--                        v-model="formTrn.creattime"-->
<!--                        type="daterange"-->
<!--                        align="right"-->
<!--                        unlink-panels-->
<!--                        range-separator="至"-->
<!--                        start-placeholder="开始日期"-->
<!--                        end-placeholder="结束日期"-->
<!--                        value-format="yyyy-MM-dd"-->
<!--                        format="yyyy-MM-dd"-->
<!--                        :picker-options="pickerOptions">-->
<!--                </el-date-picker>-->
<!--            </el-col>-->
<!--            <el-col :span="5">-->
<!--                <el-button type="primary" icon="el-icon-search" @click="trnList">查询</el-button>-->
<!--                <el-button type="success" icon="el-icon-edit" @click="addTrn">新增</el-button>-->
<!--                <el-button type="warning" icon="el-icon-edit"  :loading="batchSendLoading" @click="batchTrn">批量申报</el-button>-->
<!--            </el-col>-->
<!--        </el-row>-->
63
        <el-row class="toolbar" style="height: 100px">
64
            <el-form :inline="true" :model="formTrn">
65
                <el-row style="margin-top: -5px">
66 67 68 69 70 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
                    <el-col :span="6">
                        <el-form-item>
                            <el-input
                                    v-model="formTrn.customscode"
                                    placeholder="关区" style="width: 210px"
                            >
                                <template slot="prepend">关&nbsp;&nbsp;&nbsp;区</template>
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item>
                            <el-input
                                    v-model="formTrn.username"
                                    placeholder="申报用户" style="width: 210px"
                            >
                                <template slot="prepend">申报用户</template>
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item>
                            <el-input
                                    v-model="formTrn.unloadcode"
                                    placeholder="卸货地代码" style="width: 210px"
                            >
                                <template slot="prepend">卸货地代码</template>
                            </el-input>
                        </el-form-item>
                    </el-col>
朱兆平 authored
96 97 98
                </el-row>
                <el-row style="margin-top:0">
                    <el-col :span="6">
99 100 101 102 103 104 105 106 107 108 109 110
                        <el-form-item>
                            <div style="display: inline-block;background-color: #6F8294;color: white;
                            border-top-left-radius: 4px;margin-right: -4px;padding-right: 14px;font-size: 12px;
                            border-bottom-left-radius:4px;padding-left: 14px">转关方式</div>
                            <el-select v-model="formTrn.trnmode" placeholder="请选择转关方式" size="mini" style="width: 136px">
                                <el-option label="0-非转关运抵模式" value="0"></el-option>
                                <el-option label="1-南方转关运抵模式" value="1"></el-option>
                                <el-option label="2-北方转关运抵模式" value="2"></el-option>
                                <el-option label="3-水运中转运抵模式" value="3"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
朱兆平 authored
111
                    <el-col :span="10">
112 113 114
                        <el-form-item>
                            <div style="display: inline-block;background-color: #6F8294;color: white;
                            border-top-left-radius: 4px;margin-right: -4px;padding-right: 14px;font-size: 12px;
115
                            border-bottom-left-radius:4px;padding-left: 14px">申报时间段</div>
116
                            <el-date-picker
117
                                    v-model="searchTime"
118 119 120 121 122 123 124 125 126 127 128 129
                                    type="daterange"
                                    unlink-panels
                                    range-separator="-"
                                    start-placeholder="开始日期"
                                    end-placeholder="结束日期"
                                    value-format="yyyy-MM-dd"
                                    format="yyyy-MM-dd" style="width: 300px"
                                    :picker-options="pickerOptions">
                                <template slot="prepend">新增时间段</template>
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
朱兆平 authored
130
                    <el-col :span="8" >
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
                        <el-form-item>
                            <el-button type="primary" icon="el-icon-search" @click="trnList">查&nbsp;&nbsp;询</el-button>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="success" icon="el-icon-edit" @click="addTrn">新&nbsp;&nbsp;增</el-button>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="warning" icon="el-icon-edit"  :loading="batchSendLoading" @click="batchTrn">批量申报</el-button>
                        </el-form-item>
                    </el-col>
<!--                    <el-col :span="6">-->
<!--                        <el-form-item>-->
<!--                            <el-date-picker-->
<!--                                    v-model="formTrn.creattime"-->
<!--                                    type="daterange"-->
<!--                                    unlink-panels-->
<!--                                    range-separator="至"-->
<!--                                    start-placeholder="开始日期"-->
<!--                                    end-placeholder="结束日期"-->
<!--                                    value-format="yyyy-MM-dd"-->
<!--                                    format="yyyy-MM-dd"-->
<!--                                    :picker-options="pickerOptions">-->
<!--                                <template slot="prepend">新增时间段</template>-->
<!--                            </el-date-picker>-->
<!--                        </el-form-item>-->
<!--                    </el-col>-->

                </el-row>
            </el-form>
160
        </el-row>
小范 authored
161
        <el-row class="rowTwo">
162 163 164 165 166 167
            <el-table
                    v-loading="listLoading"
                    :data="tableData"
                    border
                    highlight-current-row
                    @selection-change="trnSelectionChange"
168 169 170
                    tooltip-effect="dark"
                    style="border-radius: 10px 10px 0px 0px;line-height: 25px"
                    :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
171 172 173 174 175 176 177
            >
                <el-table-column
                        type="selection"
                        :selectable="checkSelectable"
                        fixed="left"
                        width="55"
                />
小范 authored
178
                <el-table-column label="统一编号" width="150">
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
                    <template slot-scope="scope">
                        <span>{{ scope.row.seqno }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="转关方式" width="140">
                    <template slot-scope="scope">
                        <span v-if="scope.row.trnmode ==='0'">非转关运抵模式</span>
                        <span v-if="scope.row.trnmode ==='1'">南方转关运抵模式</span>
                        <span v-if="scope.row.trnmode ==='2'">北方转关运抵模式</span>
                        <span v-if="scope.row.trnmode ==='3'">水运中转运抵模式</span>
<!--                        <span>{{ scope.row.trnmode }}</span>-->
                    </template>
                </el-table-column>
                <el-table-column label="申报地海关" width="100">
                    <template slot-scope="scope">
                        <span>{{ scope.row.customscode }}</span>
                    </template>
                </el-table-column>
小范 authored
197 198 199 200 201
<!--                <el-table-column label="集装箱(器)编号" width="140">-->
<!--                    <template slot-scope="scope">-->
<!--                        <span>{{ scope.row.contaid }}</span>-->
<!--                    </template>-->
<!--                </el-table-column>-->
202 203 204 205 206
                <el-table-column label="总提运单号" width="140">
                    <template slot-scope="scope">
                        <span>{{ scope.row.billno }}</span>
                    </template>
                </el-table-column>
小范 authored
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
<!--                <el-table-column label="进出境运输方式代码" width="120">-->
<!--                    <template slot-scope="scope">-->
<!--                        <span v-if="scope.row.trafmode ==='2'">江海运输</span>-->
<!--                        <span v-if="scope.row.trafmode ==='3'">铁路运输</span>-->
<!--                        <span v-if="scope.row.trafmode ==='4'">汽车运输</span>-->
<!--                        <span v-if="scope.row.trafmode ==='5'">航空运输</span>-->
<!--                        <span v-if="scope.row.trafmode ==='6'">邮件运输</span>-->
<!--&lt;!&ndash;                        <span>{{ scope.row.trafmode }}</span>&ndash;&gt;-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column label="境内运输工具名称" width="140">-->
<!--                    <template slot-scope="scope">-->
<!--                        <span>{{ scope.row.trafname }}</span>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column label="境内运输工具航(班)次" width="160">-->
<!--                    <template slot-scope="scope">-->
<!--                        <span>{{ scope.row.voyageno }}</span>-->
<!--                    </template>-->
<!--                </el-table-column>-->
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
                <el-table-column label="境内运输方式" width="120">
                    <template slot-scope="scope">
                        <span v-if="scope.row.trafway ==='2'">江海运输</span>
                        <span v-if="scope.row.trafway ==='3'">铁路运输</span>
                        <span v-if="scope.row.trafway ==='4'">汽车运输</span>
                        <span v-if="scope.row.trafway ==='5'">航空运输</span>
                        <span v-if="scope.row.trafway ==='6'">邮件运输</span>
<!--                        <span>{{ scope.row.trafway }}</span>-->
                    </template>
                </el-table-column>
                <el-table-column label="托运货物件数" width="100">
                    <template slot-scope="scope">
                        <span>{{ scope.row.packno }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="货物总毛重" width="100">
                    <template slot-scope="scope">
                        <span>{{ scope.row.grosswt }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="卸货地代码" width="120">
                    <template slot-scope="scope">
                        <span>{{ scope.row.unloadcode }}</span>
                    </template>
                </el-table-column>
朱兆平 authored
252
                <el-table-column label="时间" width="180">
小范 authored
253 254 255 256 257 258 259 260 261 262 263
                    <template slot-scope="scope">
                        <span>{{ scope.row.creattime }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="申报状态" width="120">
                    <template slot-scope="scope">
                        <span v-if="scope.row.dstatus ==='000'">未申报/已暂存</span>
                        <span v-if="scope.row.dstatus ==='001'">已申报</span>
                    </template>
                </el-table-column>
                <el-table-column label="回执状态" width="120">
264
                    <template slot-scope="scope">
小范 authored
265 266 267 268
                        <el-tag type="success" v-if="scope.row.customResponseStatus ==='0'">申报成功</el-tag>
                        <el-tag type="danger" v-if="scope.row.customResponseStatus ==='1'">申报失败</el-tag>
                        <el-tag type="success" v-if="scope.row.customResponseStatus ==='S'">申报成功</el-tag>
                        <el-tag type="danger" v-if="scope.row.customResponseStatus ==='F'">申报失败</el-tag>
269 270
                    </template>
                </el-table-column>
小范 authored
271
                <el-table-column label="回执内容" width="220">
272
                    <template slot-scope="scope">
朱兆平 authored
273 274 275 276 277 278 279
                            <span :style="{'color':scope.row.customResponseStatus=='0'?'rgb(103,194,58)'
                                                    :scope.row.customResponseStatus=='1'?'rgb(245,110,110)':scope.row.customResponseStatus=='S'?'rgb(103,194,58)'
                                                    :scope.row.customResponseStatus=='F'?'rgb(245,110,110)':'rgb(60,62,66)'}">{{ scope.row.customResponseText }}</span>
                        <br/>
                        <el-button type="text"   @click="check(scope.row)">
                                查看回执
                        </el-button>
280 281
                    </template>
                </el-table-column>
282
                <el-table-column label="操作" align="center" width="200" fixed="right">
283
                    <template slot-scope="scope">
小范 authored
284
                        <el-row>
285
                            <el-button type="success" @click="editTrn(scope.$index,scope.row)">编&emsp;&emsp;辑</el-button>
朱兆平 authored
286
                            <el-button type="danger"  :disabled="scope.row.customResponseText && scope.row.customResponseText !== undefined && scope.row.customResponseText.length>0" @click="delTrn(scope.row)">
287 288 289 290 291 292
                                删&emsp;&emsp;除
                            </el-button>
                        </el-row>
                        <el-row>
                            <el-button type="warning" :disabled="scope.row.customResponseText && scope.row.customResponseText !== undefined && scope.row.customResponseText.length>0" @click="declareTrn(scope.row)">
                                申&emsp;&emsp;报
小范 authored
293
                            </el-button>
朱兆平 authored
294
                            <el-button type="info" @click="statusTrn(scope.row)">
小范 authored
295 296 297
                                修改状态
                            </el-button>
                        </el-row>
298 299 300 301
                    </template>
                </el-table-column>
            </el-table>
            <!--分页区域-->
302
            <div style="margin-top: 10px" class="toolbar">
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
                <el-pagination
                        :current-page="formTrn.pageNum"
                        :page-sizes="[10, 50, 100, 500]"
                        :page-size="formTrn.pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total"
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                />
            </div>

        </el-row>
        <el-row>
            <el-dialog
                    :title="dialogMap[dialogStatus]"
                    :visible.sync="trn_dialog.addDialog"
                    style="margin-top: -50px"
                    text-align="center"
321
                    width="85%"
322 323
                    @close="trn_addDialogClosed"
            >
朱兆平 authored
324
                <el-form ref="form" :inline="true" :model="form" class="demo-form-inline" label-width="120px" style="margin-top: -20px;" label-position="right" :rules="rules" >
朱兆平 authored
325
                    <el-divider></el-divider>
326 327
                    <el-row>
                        <el-col :span="24">
朱兆平 authored
328
                            <div class="grid-content content">信息表单 [id: {{form.autoid}}]-[申报用户:{{form.username}}]</div>
329 330 331
                        </el-col>
                    </el-row>
                    <el-row>
332
                        <el-col :span="8">
333
                            <el-form-item label="海关申报序号" prop="seqno">
334
                                <el-input v-model="form.seqno" placeholder="" disabled suffix-icon=“xxxx”></el-input>
335 336
                            </el-form-item>
                        </el-col>
337
                        <el-col :span="8">
338
                            <el-form-item label="海关关区" prop="customscode">
339
                                <el-input v-model="customscode" placeholder="" suffix-icon=“xxxx” oninput="value=value.replace(/[^\d]/g,'')"
340
                                          maxLength='4'/>
341 342
                            </el-form-item>
                        </el-col>
343
                        <el-col :span="8">
小范 authored
344 345 346 347 348 349 350 351
                            <el-form-item label="转关方式" prop="trnmode">
                                <!--                                <el-input v-model="form.trnmode" size="small"/>-->
                                <el-select v-model="form.trnmode" placeholder="请选择" size="mini">
                                    <el-option label="0-非转关运抵模式" value="0"></el-option>
                                    <el-option label="1-南方转关运抵模式" value="1"></el-option>
                                    <el-option label="2-北方转关运抵模式" value="2"></el-option>
                                    <el-option label="3-水运中转运抵模式" value="3"></el-option>
                                </el-select>
352 353
                            </el-form-item>
                        </el-col>
小范 authored
354
355
小范 authored
356
小范 authored
357 358
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label="操作员卡号" prop="inputopid">-->
朱兆平 authored
359
<!--                                <el-input v-model="form.inputopid" placeholder="" />-->
小范 authored
360 361 362 363
<!--                            </el-form-item>-->
<!--                        </el-col>-->
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label="操作员姓名" prop="inputopname">-->
朱兆平 authored
364
<!--                                <el-input v-model="form.inputopname" placeholder="" />-->
小范 authored
365 366 367 368 369
<!--                            </el-form-item>-->
<!--                        </el-col>-->
                    </el-row>
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label="报关公司" prop="applyname">-->
朱兆平 authored
370
<!--                                <el-input v-model="form.applyname" placeholder="" />-->
小范 authored
371 372 373 374
<!--                            </el-form-item>-->
<!--                        </el-col>-->
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label="十位海关编码" prop="applycode">-->
朱兆平 authored
375
<!--                                <el-input v-model="form.applycode" placeholder="" />-->
小范 authored
376 377 378 379
<!--                            </el-form-item>-->
<!--                        </el-col>-->
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label="组织机构代码" prop="copcode">-->
朱兆平 authored
380
<!--                                <el-input v-model="form.copcode" placeholder="" />-->
小范 authored
381 382 383
<!--                            </el-form-item>-->
<!--                        </el-col>-->
                    <el-row>
384 385 386 387 388 389 390 391 392 393
                        <el-col :span="8">
                            <el-tooltip content="运抵编号:北方模式必填;南方模式免填;水运中转模式选填。运抵编号规则:4位申报地海关代码+2位卸货地代码+6位编号生成日期(顺序为年(2位)月(2位))日(2位))+6位流水号"  effect="light">
                                <el-form-item label="运抵编号" prop="arriveno">
                                    <el-input suffix-icon=“xxxx” v-model="form.arriveno" :disabled="form.trnmode==1" placeholder=""
                                    />
                                </el-form-item>
                            </el-tooltip>

                        </el-col>
                        <el-col :span="8">
394
                            <el-form-item label="运单号" prop="billno">
小范 authored
395
                                <el-input suffix-icon=“xxxx” v-model="form.billno" placeholder="限填大写字母数字下滑杠" @keyup.native="form.billno=form.billno.replace(/[^A-Z0-9_]/g,'')" />
396 397
                            </el-form-item>
                        </el-col>
398 399
                        <el-col :span="8">
                            <el-form-item label="进出境运输方式" prop="trafmode">
朱兆平 authored
400
<!--                                <el-input v-model="form.trafmode" placeholder="" />-->
401 402 403 404
                                <el-select v-model="form.trafmode" placeholder="请选择" size="mini" >
                                    <el-option label="2-江海运输" value="2"></el-option>
                                    <el-option label="3-铁路运输" value="3"></el-option>
                                    <el-option label="4-汽车运输" value="4"></el-option>
小范 authored
405 406
                                    <el-option label="5-航空运输" value="5"></el-option>
                                    <el-option label="6-邮件运输" value="6"></el-option>
407 408 409
                                </el-select>
                            </el-form-item>
                        </el-col>
410 411 412 413

                    </el-row>
                    <el-row>
                        <el-col :span="8">
小范 authored
414 415
                            <el-tooltip content="运输工具名称:北方模式选填;南方模式填写@+13位载货清单号;水运中转模式必填:境内水路运输填报驳船船名,境内铁路运输填报车名(主管海关4位关别代码+TRAIN);境内公路运输填报车名(主管海关4位关别代码+TRUCK)" placement="bottom" effect="light">
                                <el-form-item label="运输工具名称" prop="trafname">
416
                                    <el-input suffix-icon=“xxxx” v-model="form.trafname" placeholder="" />
小范 authored
417 418 419
                                </el-form-item>
                            </el-tooltip>
420
                        </el-col>
421
                        <el-col :span="8">
小范 authored
422 423
                            <el-tooltip content="启运时间:北方模式选填;南方模式免填;水运中转模式必填:境内水路运输填报驳船航次号,境内铁路、公路运输填报6位启运日期(顺序为年(2位)月(2位)日(2位))" placement="bottom" effect="light">
                                <el-form-item label="启运时间"  prop="voyageno">
朱兆平 authored
424
                                    <!--                                <el-input v-model="form.voyageno" placeholder="" />-->
小范 authored
425 426 427 428 429
                                    <el-date-picker
                                            v-model="form.voyageno"
                                            type="date"  size="mini"
                                            value-format="yyMMdd"
                                            format="yyMMdd"  :disabled="form.trnmode==1"
430
                                            style="width:93%"
小范 authored
431 432 433 434 435
                                            placeholder="选择日期">
                                    </el-date-picker>
                                </el-form-item>
                            </el-tooltip>
436
                        </el-col>
437
                        <el-col :span="8">
438
                            <el-form-item label="境内运输方式" prop="trafway">
朱兆平 authored
439
<!--                                <el-input v-model="form.trafway" placeholder="" />-->
440 441 442 443
                                <el-select v-model="form.trafway" placeholder="请选择" size="mini">
                                    <el-option label="2-江海运输" value="2"></el-option>
                                    <el-option label="3-铁路运输" value="3"></el-option>
                                    <el-option label="4-汽车运输" value="4"></el-option>
小范 authored
444 445
                                    <el-option label="5-航空运输" value="5"></el-option>
                                    <el-option label="6-邮件运输" value="6"></el-option>
446 447 448
                                </el-select>
                            </el-form-item>
                        </el-col>
449 450 451 452

                    </el-row>
                    <el-row>
                        <el-col :span="8">
453
                            <el-form-item label="托运件数" prop="packno">
小范 authored
454
                                <el-input suffix-icon=“xxxx” v-model="form.packno" placeholder="" oninput="value=value.replace(/[^\d]/g,'')" />
455 456
                            </el-form-item>
                        </el-col>
457
                        <el-col :span="8">
458
                            <el-form-item label="托运重量" prop="grosswt">
小范 authored
459
                                <el-input suffix-icon=“xxxx” v-model="form.grosswt" placeholder="" oninput="value=value.replace(/[^\d.]/g,'')" />
460 461
                            </el-form-item>
                        </el-col>
462
                        <el-col :span="8">
463
                            <el-form-item label="卸货地代码" prop="unloadcode">
朱兆平 authored
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
<!--                                <el-input suffix-icon=“xxxx” v-model="unloadcode" placeholder="" />-->
                                <el-autocomplete
                                        suffix-icon=“xxxx”
                                        v-model="unloadcode"
                                        :fetch-suggestions="unloadcodeSearchAsync"
                                        placeholder=""
                                        @select="unloadcodeSelect"
                                        clearable
                                >
                                    <template slot-scope="{item}">
                                        <el-tooltip placement="right">
                                            <div slot="content">{{item.value}} - {{item.label}}</div>
                                            <span>{{item.label}}</span>
                                        </el-tooltip>
                                    </template>

                                </el-autocomplete>
481 482
                            </el-form-item>
                        </el-col>
小范 authored
483 484
                    </el-row>
                    <el-row>
485
                        <el-col :span="8">
小范 authored
486 487
                            <el-tooltip content="集装箱(器)编号:集装箱货物必填:4个字母即货主编码、6位数字序列号以及1位检测数字组成;非集装箱货物免填" placement="bottom" effect="light">
                                <el-form-item label="集装箱编号" prop="contaid">
488
                                    <el-input suffix-icon=“xxxx” v-model="form.contaid" placeholder="" />
小范 authored
489 490
                                </el-form-item>
                            </el-tooltip>
小范 authored
491
小范 authored
492
                        </el-col>
493
                        <el-col :span="8">
朱兆平 authored
494
                            <el-form-item label="到达卸货地时间" prop="arrivetime">
495 496 497 498
<!--                                <el-input v-model="form.arrivetime" size="mini" placeholder="" />-->
                                <el-date-picker
                                        v-model="form.arrivetime"
                                        type="datetime" size="mini"
小范 authored
499 500
                                        value-format="yyyyMMddHHmmss"
                                        format="yyyyMMddHHmmss"
501
                                        style="width:93%"
502 503 504 505
                                        placeholder="选择日期时间">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
506
                        <el-col :span="8">
小范 authored
507 508
                            <el-tooltip content="集装箱(器)尺寸:集装箱货物必填;非集装箱货物免填" placement="bottom" effect="light">
                                <el-form-item label="集装器尺寸" prop="contatype">
509
                                    <el-input suffix-icon=“xxxx” v-model="form.contatype" placeholder="" />
小范 authored
510 511 512
                                </el-form-item>
                            </el-tooltip>
513
                        </el-col>
小范 authored
514
515 516 517 518 519 520 521
                    </el-row>
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="备注" prop="notes">
                                <el-input
                                        v-model="form.notes"
                                        type="textarea"
522
                                        :rows="1"  style="width: 520px"
523 524 525 526 527
                                        placeholder="请输入内容"
                                />
                            </el-form-item>
                        </el-col>
                    </el-row>
528 529 530 531 532
                    <el-row  align="middle">
                        <el-col :span="24" :offset="9">
                            <el-form-item >
                                    <el-button style="width: 100px" type="info" @click="trn_dialog.addDialog = false">取消</el-button>
                                    <el-button type="primary" style="width: 100px" @click="dialogStatus==='create'?trn_add():trn_edit()">提交</el-button>
533 534 535 536 537 538
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </el-dialog>
        </el-row>
小范 authored
539 540 541 542 543 544 545
<!--        回执明细弹框-->
        <DetailedLog
                ref="detailedlog"
                :message-id="detailedlogId"
                :visible="dialogDetailedLogVisible"
                @updateVisible="updateVisible"
        />
546
    </section>
547 548 549 550
</template>

<script>
    import {selectTrans,delTrans,batchSend,ediTrans,send,addTrans} from "../../api/trn";
小范 authored
551 552
    import DetailedLog from '@/components/detailedDialog'
    import  uti from '@/utils'
朱兆平 authored
553
    import loginedUserInfo from "@/api/user";
朱兆平 authored
554
    import unloadingCode from "@/common/customs/trans_arrive_unloadingCode";
朱兆平 authored
555
    import {mapActions, mapGetters} from 'vuex'
小范 authored
556
557 558 559

    export default {
        name: "transit",
小范 authored
560 561
        components: { DetailedLog },
562 563
        data(){
            return{
小范 authored
564 565 566 567
                //组件数据
                detailedlogId: '',
                dialogDetailedLogVisible: false,
                detailedList: [],
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600
                pickerOptions: {
                    shortcuts: [{
                        text: '最近一周',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近一个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近三个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                            picker.$emit('pick', [start, end]);
                        }
                    }]
                },
                formTrn: {
                    customscode:'',
                    username:'',
                    trnmode:'',
                    unloadcode:'',
                    creattime:'',
601 602
                    startDate:'',
                    endDate:'',
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
                    pageNum: 1,
                    pageSize: 10
                },
                total: 0,
                dialogMap: {
                    update: '编辑',
                    create: '新增'
                },
                dialogStatus: 'create',
                trn_dialog: {
                    // 添加对话框
                    addDialog: false,
                    // 编辑对话框
                    editDialog: false
                },
                batchSendLoading: false,
                listLoading: false,
                tableData: [],
                //批量选中的
                selectedWaybillList: [],
                //新增编辑表单
                form: {
                    autoid:'',
                    seqno:'',
627
                    ieflag:'E',
628
                    customscode:'4604',
629 630 631 632 633 634 635 636
                    inputopid: '',
                    inputopname:'',
                    applyname:'',
                    applycode:'',
                    copcode:'',
                    arriveno:'',
                    contaid:'',
                    billno:'',
637
                    trafmode:'5',
638 639
                    trafname:'',
                    voyageno:'',
640
                    trafway:'5',
641 642
                    packno:'',
                    grosswt:'',
643
                    unloadcode:'460043',
小范 authored
644
                    arrivetime: '',
645
                    contatype:'',
小范 authored
646
                    trnmode:'2',
647
                    notes:'',
小范 authored
648
                    opertype:'A',
朱兆平 authored
649
                    sign:'',
小范 authored
650 651 652 653
                    signdate:'',
                    clientseqno:'',
                    hostid:'',
                    certno:'',
朱兆平 authored
654
                    username:''
655 656 657

                },
                rules: {
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672
                    // trafmode: [
                    //     {  required: true, message: '请输入', trigger: 'change' }
                    // ],
                    // trafway: [
                    //     {  required: true, message: '请输入', trigger: 'change' }
                    // ],
                    packno: [
                        {  required: true, message: '请输入', trigger: 'change' }
                    ],
                    grosswt: [
                        {  required: true, message: '请输入', trigger: 'change' }
                    ],
                    trnmode: [
                        {  required: true, message: '请输入', trigger: 'change' }
                    ],
673 674 675 676 677 678 679
                }

            }
        },
        mounted() {
            //获取列表
            this.trnList();
朱兆平 authored
680
681
        },
小范 authored
682
        computed:{
朱兆平 authored
683
            ...mapGetters(['getUserInfoStore','getUserMenuStore']),
684
            //海关关区
小范 authored
685 686
            customscode: {
                get: function () {
687
                    //呈现的数据
小范 authored
688 689 690
                    return this.form.customscode
                },
                set:function (val) {
691
                    //操作的数据
小范 authored
692 693 694 695 696 697
                    this.form.customscode = val;
                    let loadcode = ''
                    if (this.unloadcode && this.unloadcode.length >= 2) {
                        let length = this.unloadcode.length
                        loadcode = this.unloadcode.substring(length - 2, length)
                    }
698
                    //给运抵编号赋值
小范 authored
699 700 701
                    this.form.arriveno = this.customscode + loadcode + new Date().format('yyMMddHHmmss');
                }
            },
702
            //卸货地代码
小范 authored
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718
            unloadcode: {
                get: function () {
                    return this.form.unloadcode
                },
                set:function (val) {
                    this.form.unloadcode = val
                    let loadcode = ''
                    console.log(this.unloadcode.length)
                    if (this.unloadcode && this.unloadcode.length >= 2) {
                        let length = this.unloadcode.length
                        loadcode = this.unloadcode.substring(length - 2, length)
                    }
                    console.log(loadcode+"aaaa")
                    this.form.arriveno = this.customscode + loadcode + new Date().format('yyMMddHHmmss');
                }
            },
719
            username: function () {
朱兆平 authored
720
                var user = this.getUserInfoStore;
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736
                if (user) {
                    return  user.username || '';
                }
            },
            searchTime: {
                get:function () {
                    return this.formTrn.creattime
                },
                set:function (val) {
                    this.formTrn.creattime = val
                    if (val && val.length===2){
                        this.formTrn.startDate = val[0]
                        this.formTrn.endDate = val[1]
                    }
                }
            }
小范 authored
737 738

        },
739
        methods:{
小范 authored
740 741 742 743 744 745 746 747 748
            //查看回执按钮
            check(row) {
                this.dialogDetailedLogVisible = true
                this.autoid = row.autoid
                this.$refs.detailedlog.check(row.autoid)
            },
            updateVisible(val) {
                this.dialogDetailedLogVisible = val
            },
749 750 751 752 753 754 755 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 783 784 785 786 787 788 789 790 791 792 793 794
            //分页
            handleSizeChange(val) {
                this.formTrn.pageSize = val
                this.trnList()
            },
            handleCurrentChange(val) {
                this.formTrn.pageNum = val
                this.trnList()
            },
            //修改状态
            statusTrn(row) {
                this.$confirm('修改状态', '确认信息', {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '确定',
                    cancelButtonText: '取消'
                }).then(() => {
                    row.customResponseText = undefined
                })
            },
            // 删除
            delTrn(row) {
                // 弹框询问是否删除?
                this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
                        confirmButtonText: '确定删除',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }
                ).then(() => {
                    delTrans(row).then((response) => {
                        console.log(row)
                        const res = response.data
                        if (res.code !== '200') {
                            return this.$message.error(res.msg)
                        }
                        this.$message.success(res.msg)
                        // 刷新列表
                        this.trnList()
                    }).catch(error => {
                        this.$message.error(res.msg)
                    })
                }).catch(() => {
                })
            },
            // 获取消息标签列表
            trnList() {
                const _this = this
795 796 797
                let para = Object.assign({}, this.formTrn)
                para.creattime = ''
                selectTrans(para).then((response) => {
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818
                    const res = response.data
                    if (res.code !== '200') {
                        return _this.$message.error('获取消息收发记录,失败!')
                    }
                    // 获取列表数据
                    _this.tableData = res.data.list
                    // 获取列表的总记录数
                    _this.total = res.data.total
                    _this.$message.success('获取消息收发记录,成功!')
                }).catch(error => {
                    // 关闭加载
                    _this.$message.error(error.toString())
                })
            },
            //新增编辑弹框关闭重置
            trn_addDialogClosed() {
                // 重置对话框
                this.$refs.form.resetFields()
            },
            // 打开新增
            addTrn() {
819
                Object.keys(this.form).forEach(key => (this.form[key] = ''));
820 821
                this.dialogStatus = 'create'
                this.trn_dialog.addDialog = true
小范 authored
822
                this.form.arrivetime = new Date().format('yyyyMMddHHmmss')
823 824
                this.form.username = this.username
                this.form.ieflag = 'E'
朱兆平 authored
825 826 827
                this.form.trnmode = '2'
                this.form.trafmode= '5'
                this.form.trafway = '5'
828 829
                this.form.unloadcode = '460043'
                this.form.customscode = '4604'
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 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886
            },

            // 新增功能
            trn_add() {     // 进行表单的预验证
                this.$refs.form.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return
                    addTrans(this.form).then((response) => {
                        const res = response.data
                        // 添加失败
                        if (res.code !== '200') {
                            // 关闭加载
                            return this.$message.error(res.msg)
                        }
                        // 添加,成功
                        this.$message.success(res.msg)
                        // 隐藏对话框
                        this.trn_dialog.addDialog = false
                        // 刷新列表
                        this.trnList()
                    }).catch(error => {
                        this.$message.error(error.toString())
                    })
                })
            },
            // 打开编辑
            editTrn(index, row) {
                this.form = Object.assign({}, row)
                this.trn_dialog.addDialog = true
                this.dialogStatus = 'update'
                this.$nextTick(() => {
                    this.form = Object.assign({}, row)
                })
            },
            // 编辑功能
            trn_edit() {
                // 进行表单的预验证
                this.$refs.form.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return
                    ediTrans(this.form).then((response) => {
                        const res = response.data
                        if (res.code !== '200') {
                            return this.$message.error(res.msg)
                        }
                        this.$message.success(res.msg)
                        // 隐藏对话框
                        this.trn_dialog.addDialog = false
                        // 刷新列表
                        this.trnList()
                    }).catch(error => {
                        this.$message.error(error.toString())
                    })
                })
            },
            // 申报
            declareTrn(row) {
朱兆平 authored
887
                row.customResponseText = '已申报'
小范 authored
888
                row.opertype= "C"
889 890 891
                send(row).then((response) => {
                    const res = response.data
                    if (res.code !== '200') {
892 893 894 895 896 897 898 899
                        this.$message({
                            dangerouslyUseHTMLString: true,
                            showClose: true,
                            type:'error',
                            duration:0,
                            message: '<strong>'+ res.msg +'</strong><br/>' + '<span>'+ res.error+'</span>'
                        });
                        return
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
                    }
                    this.$message.success('申报成功!');
                    this.trnList();
                }).catch(error => {
                    this.$message.error(error.toString());
                });
            },
            // 产生回执的不批量发送
            checkSelectable: function(row) {
                if (row.customResponseText && row.customResponseText !== undefined && row.customResponseText.length > 0) {
                    return false
                } else {
                    return true
                }
            },
            //批量选中
            trnSelectionChange: function(selectRows) {
                console.log(selectRows)
                const list = []
                if (selectRows) {
                    selectRows.forEach(function(item, index) {
                        list.push(item.autoid)
                    })
                }
                this.selectedWaybillList = list
            },
            //批量申报
            batchTrn() {
                this.batchSendLoading = true
                if (this.selectedWaybillList && this.selectedWaybillList.length > 0) {
                    batchSend(this.selectedWaybillList).then(res => {
                        if (res.code === '200') {
                            Message.success('批量申报成功')
                        } else {
                            Message.error('批量申报成功,请稍后重试')
                        }
                    }).catch(action => {
                        this.$message({
                            type: 'info',
                            message: action === 'cancel'
                                ? '取消修改'
                                : '停留在当前页面'
                        })
                    })
                    this.batchSendLoading = false
                    setTimeout(() => {
                        this.trnList()
                    }, 1000)
                    Message.success('批量申报执行完毕')
                } else {
                    Message.error('请选择需要批量发送的运单')
                }
            },
朱兆平 authored
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969
            unloadcodeSearchAsync(queryString, cb) {
                let customs_unloadingCode  = unloadingCode;
                console.log(customs_unloadingCode)
                let results = queryString ? customs_unloadingCode.filter(this.unloadcodeFilter(queryString)) : customs_unloadingCode;
                clearTimeout(this.timeout);
                this.timeout = setTimeout(() => {
                    cb(results);
                }, 1000 * Math.random());
            },
            unloadcodeFilter(queryString) {
                return (unloadingCode) => {
                    return (unloadingCode.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
                };
            },
            unloadcodeSelect(item) {
                console.log(item);
            }
970 971 972 973 974
        }

    }
</script>
975
<style  scoped>
976 977 978
    .toolbar{
        height: 60px;
        background-color: white;
979
        /*line-height: 60px;*/
980 981 982 983 984
        vertical-align: middle;
        border-radius: 5px 5px 5px 5px;
        padding: 15px 0 0 20px;
        box-shadow: 0px 5px 5px #e5e8eb;
    }
小范 authored
985 986
    .rowTwo{
    }
987
</style>