审查视图

src/views/airtransport/queryBill.vue 18.1 KB
小范 authored
1 2 3 4 5 6 7 8
<template>
    <el-container>
        <el-main>
            <el-row class="row-bg">
                <el-col :span="24">
                    <div class="grid-content content">单据查询</div>
                </el-col>
            </el-row>
xudada authored
9
            <!--搜索区域-->
小范 authored
10 11
            <el-row>
                 <el-form :label-position="labelPosition" :model="queryBill" :rules="rules" ref="queryBill"
小范 authored
12
                      class="demo-ruleForm">
小范 authored
13
                    <el-col :span="5">
小范 authored
14
                        <el-form-item label="航班号:" prop="flightNo" label-width="70px">
小范 authored
15
                            <el-input v-model="queryBill.flightNo"></el-input>
小范 authored
16 17
                        </el-form-item>
                    </el-col>
小范 authored
18
                    <el-col :span="5" >
小范 authored
19 20
                        <el-form-item label="航空器注册号:" prop="aircraftNo" label-width="110px" >
                            <el-input v-model="queryBill.aircraftNo"></el-input>
小范 authored
21 22
                        </el-form-item>
                    </el-col>
小范 authored
23 24 25 26 27
                     <el-col :span="5" >
                     <el-form-item label="进出港:" prop="accessFlag" label-width="70px">
                         <el-input v-model="queryBill.accessFlag"></el-input>
                     </el-form-item>
                 </el-col>
小范 authored
28
                    <el-col :span="5" >
小范 authored
29
                        <el-form-item label="航班日期:" prop="flightDate" label-width="80px" >
小范 authored
30 31 32
                            <el-date-picker
                                    v-model="queryBill.flightDate"
                                    type="date"
xudada authored
33 34
                                    value-format="yyyyMMdd"
                                    format="yyyyMMdd"
小范 authored
35 36 37 38
                                    placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
小范 authored
39 40 41

                    <el-col :span="2" >
                        <el-button type="primary" @click="submitForm()" style="padding-left:10px">查询</el-button>
小范 authored
42 43 44
                    </el-col>
                 </el-form>
            </el-row>
xudada authored
45
            <!--表单区域-->
小范 authored
46 47 48 49
            <el-row>
                <el-table
                        :data="tableData"
                        border
小范 authored
50
                        v-loading="tableloading"
小范 authored
51 52 53 54
                        style="width: 100%;margin-bottom: 10px">
                    <el-table-column
                            fixed="left"
                            label="操作"
小范 authored
55
                            width="200">
小范 authored
56 57 58 59 60
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
                                    type="primary"
                                    @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
小范 authored
61 62 63
                            <el-button
                                    size="mini"
                                    type="primary"
xudada authored
64
                                    @click="showPerson(scope.$index,scope.row)">添加机组人员</el-button>
小范 authored
65 66 67 68
                        </template>
                    </el-table-column>
                    <el-table-column
                            prop=aircraftNo"
xudada authored
69
                            label="航空器注册号">
小范 authored
70 71 72
                    </el-table-column>
                    <el-table-column
                            prop="flightNo"
xudada authored
73
                            label="航班号">
小范 authored
74 75 76
                    </el-table-column>
                    <el-table-column
                            prop="flightDate"
xudada authored
77
                            label="航班日期">
小范 authored
78 79 80
                    </el-table-column>
                    <el-table-column
                            prop="accessFlag"
xudada authored
81
                            label="进出港标识">
小范 authored
82 83 84
                    </el-table-column>
                    <el-table-column
                            prop="departureAirport"
xudada authored
85
                            label="出发港">
小范 authored
86 87 88
                    </el-table-column>
                    <el-table-column
                            prop="departuredatetime"
xudada authored
89
                            label="出发时间">
小范 authored
90 91 92
                    </el-table-column>
                    <el-table-column
                            prop="arrivalAirport"
xudada authored
93
                            label="目的港">
小范 authored
94 95 96
                    </el-table-column>
                    <el-table-column
                            prop="arrivaldatetime"
xudada authored
97
                            label="到达时间">
小范 authored
98 99 100
                    </el-table-column>
                    <el-table-column
                            prop="statusMsg"
xudada authored
101
                            label="海关回执">
小范 authored
102 103
                    </el-table-column>
                    <el-table-column
xudada authored
104
                            fixed="right"
小范 authored
105 106
                            prop=""
                            label="报文操作"
小范 authored
107
                            width="280">
小范 authored
108 109 110
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
小范 authored
111 112
                                    type="primary"
                                    @click="selectDetail(scope.$index,scope.row)">查看回执</el-button>
小范 authored
113
                            <el-button size="mini" type="success">保存并发送</el-button>
小范 authored
114 115 116 117 118 119 120 121 122 123 124 125 126 127
                            <el-button
                                    size="mini"
                                    type="danger"
                                    @click="handleDel(scope.$index, scope.row)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-row>
            <el-row>
                <div class="block">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
小范 authored
128 129
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="pageSize"
小范 authored
130
                            layout="total, sizes, prev, pager, next, jumper"
小范 authored
131
                            :total="total">
小范 authored
132 133 134
                    </el-pagination>
                </div>
            </el-row>
小范 authored
135
            <!--查看回执弹框-->
小范 authored
136 137
            <el-dialog title="回执明细" :visible.sync="dialogTableVisible">
                <el-table :data="gridData">
xudada authored
138 139 140 141 142
                    <el-table-column property="sendtime" label="操作时间" ></el-table-column>
                    <el-table-column property="createBy" label="操作人" ></el-table-column>
                    <el-table-column property="flightNo" label="航班号"></el-table-column>
                    <el-table-column property="flightDate" label="航班日期" ></el-table-column>
                    <el-table-column property="receiptContent" label="回执内容" ></el-table-column>
小范 authored
143 144
                </el-table>
            </el-dialog>
小范 authored
145
        </el-main>
小范 authored
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 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
        <!--添加机组人员dialog-->
        <el-row>
            <el-dialog title="机组人员添加" :visible.sync="dialogTableVisibles" >
                <el-form :model="billperson" :rules="brules" ref="billperson" label-width="130px"  class="demo-ruleForm">
                    <el-row>
                        <el-col :span="10">
                            <el-form-item label="姓名" prop="name">
                                <el-input v-model="billperson.name" placeholder="请输入"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="性别" prop="gender">
                                <el-input v-model="billperson.gender" placeholder="M/F"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="证件类型" prop="certType">
                                <el-input v-model="billperson.certType" placeholder="请输入"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="证件号码" prop="ceterNo">
                                <el-input v-model="billperson.ceterNo" placeholder="请输入"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="国籍" prop="nationality">
                                <el-input v-model="billperson.nationality" placeholder="请输入"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10">
                            <el-form-item label="职务" prop="gareer">
                                <el-input v-model="billperson.gareer" placeholder="请输入"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="24">
                            <el-form-item label="备注" prop="meno">
                                <el-input v-model="billperson.meno" placeholder="请输入"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="24">   <el-button type="primary" @click="submitPerson('billperson')" style="float: right">提 交</el-button></el-col>
                    </el-row>
                </el-form>
                <el-row>
                    <el-table
                            :data="tableData2"
                            border
                            style="width: 100%;margin-bottom: 10px">
                        <el-table-column
小范 authored
195
                                fixed="left"
小范 authored
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
                                prop="name"
                                label="姓名">
                        </el-table-column>
                        <el-table-column
                                prop="gender"
                                label="性别">
                        </el-table-column>
                        <el-table-column
                                prop="nationality"
                                label="国籍">
                        </el-table-column>
                        <el-table-column
                                prop="certType"
                                label="证件类型">
                        </el-table-column>
                        <el-table-column
                                prop="ceterNo"
                                label="证件编辑">
                        </el-table-column>
                        <el-table-column
                                prop="gareer"
                                label="职务">
                        </el-table-column>
                        <el-table-column
小范 authored
220
                                fixed="right"
小范 authored
221 222 223 224 225 226 227
                                prop="meno"
                                label="备注">
                        </el-table-column>
                    </el-table>
                </el-row>
            </el-dialog>
        </el-row>
小范 authored
228 229 230 231 232 233 234 235 236 237 238 239 240 241
        <!--对话提示框-->
        <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>
小范 authored
242
小范 authored
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
    </el-container>
</template>
<style scoped>
    .grid-content {
        height: 36px;
        line-height: 36px;
    }
    .el-dialog__body{text-align: center}
    .content {
        border-left: 4px #409EFF solid;
        padding-left: 10px;
        background-color: #f9fafc;
        margin-bottom: 2px
    }

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

</style>
<script>
小范 authored
264
    import { addBillPerson, editBill, selectBill, selectReturnMsg} from "../../api/transport";
小范 authored
265
    import loginUserInfo from "../../api/base";
小范 authored
266 267 268 269 270 271 272 273 274
    export default {
        data(){
            return{
                queryBill:{
                    flightNo:undefined,
                    aircraftNo:undefined,
                    flightDate:undefined,
                    accessFlag:undefined,
                },
小范 authored
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
                billperson:{
                    autoId:undefined,
                    name:undefined,
                    gender:undefined,
                    gareer:undefined,
                    nationality:undefined,
                    certType:undefined,
                    ceterNo:undefined,
                    createTime:undefined,
                    createBy:loginUserInfo.username,
                    updateTime:undefined,
                    updateBy:loginUserInfo.username,
                    meno:undefined,
                    isDelete:undefined,
                    billsId:undefined
                },
                brules:{
                    name: [
                        {required: true, message: '请输入', trigger: 'blur'}
                    ],
                    gender: [
                        {required: true, message: '请输入', trigger: 'blur'}
                    ],
                    certType: [
                        {required: true, message: '请输入', trigger: 'blur'}
                    ],
                    ceterNo: [
                        {required: true, message: '请输入', trigger: 'blur'}
                    ],
                    nationality: [
                        {required: true, message: '请输入', trigger: 'blur'}
                    ],
                    gareer: [
                        {required: true, message: '请输入', trigger: 'blur'}
                    ],
                },
                dialogTableVisibles:false,
小范 authored
312
                tableloading:false,
小范 authored
313 314
                rules:{},
                labelPosition:'left',
小范 authored
315 316 317
                currentPage: 1,
                pageSize:10,
                total:0,
小范 authored
318
                tableData:[],
小范 authored
319
                tableData2:[],
xudada authored
320
                gridData:[],
小范 authored
321
                dialogTableVisible: false,
小范 authored
322 323
                centerDialogVisible:false,
                msg:undefined
小范 authored
324 325 326
            }
        },
        methods: {
小范 authored
327
            //添加机组人员按钮
xudada authored
328 329 330 331
            showPerson(index,row){
                this.dialogTableVisibles=true;
                this.billperson.billsId=row.uuid;
            },
小范 authored
332
            //提交按钮
xudada authored
333
            submitPerson(formName){
小范 authored
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
                //console.log(this.billperson.billsId)
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        addBillPerson(this.billperson).then(res=>{
                            let response=res.data;
                            if(response.code=='200'){
                                this.centerDialogVisible=true;
                                this.msg=response.msg;
                            }else{
                                this.msg=response.msg;
                            }
                        });
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
xudada authored
351
            },
xudada authored
352 353
            //查询回执列表
            selectDetail(index,row){
小范 authored
354
                this.gridData=[];
xudada authored
355 356 357 358 359 360 361
                this.dialogTableVisible=true;
                let params={messageid:row.messageid};
                selectReturnMsg(params).then(res=>{
                    let response=res.data.data;
                    this.gridData=response;
                });
            },
小范 authored
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
            //获取单据列表
            submitForm(){
                let params={currentPage:this.currentPage,pageSize:this.pageSize,flightNo:this.queryBill.flightNo,
                    aircraftNo:this.queryBill.aircraftNo,flightDate:this.queryBill.flightDate,accessFlag:this.queryBill.accessFlag};
                this.tableloading=true;
                selectBill(params).then(res=>{
                    let response=res.data.data;
                    this.tableData=response.list;
                    this.tableloading=false;
                    this.total=response.total;
                });
            },
            //列表删除功能
            handleDel(index,row){
                this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    editBill(row).then(res=>{
                        let response=res.data;
                        if(response.code=='200'){
                            this.$message({
                                type: 'info',
                                message: '删除成功'
                            });
                            this.submitForm();
                        }else{
                            this.$message({
                                type: 'info',
                                message: '删除失败'
                            });                            }
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            //获取默认值
            defaultData(){
小范 authored
404
                Object.assign(this.queryBill, this.$route.query);
小范 authored
405 406 407
            },
            //编辑单据查询
            handleEdit(index,row){
xudada authored
408
                this.$router.push({path:'/bill',query:row})
小范 authored
409 410
            },
            //分页
小范 authored
411
            handleSizeChange(val) {
xudada authored
412
                this.pageSize=val;
小范 authored
413 414
            },
            handleCurrentChange(val) {
xudada authored
415 416
                this.currentPage=val;
                this.submitForm();
小范 authored
417 418
            }
        },
小范 authored
419 420 421 422 423
        //渲染方法
        mounted(){
            this.defaultData();
            this.submitForm();
        }
小范 authored
424 425
    }
</script>