|
|
<template>
|
|
|
<el-container>
|
|
|
<el-main>
|
|
|
<el-row class="row-bg">
|
|
|
<el-col :span="24">
|
|
|
<div class="grid-content content">在港动态</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<!-- 搜索区域-->
|
|
|
<el-row>
|
|
|
<el-form :inline="true" :model="queryForm" class="demo-form-inline">
|
|
|
<el-col :span="7">
|
|
|
<el-form-item label="航空器注册编号">
|
|
|
<el-input v-model="queryForm.aircraftno" size="small" style="width: 140px" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="航班号">
|
|
|
<el-input v-model="queryForm.flightno" size="small" style="width: 140px" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="航班日期">
|
|
|
<el-date-picker
|
|
|
v-model="queryForm. flightdate"
|
|
|
type="date" size="small"
|
|
|
value-format="yyyyMMdd"
|
|
|
format="yyyyMMdd"
|
|
|
style="width:140px"
|
|
|
placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="5">
|
|
|
<el-form-item>
|
|
|
<el-button size="small" type="primary" @click="transList">查询</el-button>
|
|
|
<el-button size="small" type="success" @click="trans_toAddDialog">新增</el-button>
|
|
|
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
<!-- 表单区域-->
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<div class="grid-content content">在港动态信息</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
border
|
|
|
size="small"
|
|
|
style="width: 100%"
|
|
|
:header-cell-style="{textAlign: 'center'}"
|
|
|
:cell-style="{ textAlign: 'center' }"
|
|
|
>
|
|
|
<el-table-column
|
|
|
fixed
|
|
|
prop="aircraftno"
|
|
|
label="航空器注册编号"
|
|
|
width="120"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
prop="flightno"
|
|
|
label="航班号"
|
|
|
width="140"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="flightdate"
|
|
|
label="航班日期"
|
|
|
width="120"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
prop="flightno"
|
|
|
label="海关关区"
|
|
|
width="120"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
prop="customcode"
|
|
|
label="注册海关关区"
|
|
|
width="120"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
prop="registeredcustom"
|
|
|
label="航空器备案类型"
|
|
|
width="120"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
prop="callport"
|
|
|
label="停靠港"
|
|
|
width="120"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="callarea"
|
|
|
label="停机位"
|
|
|
width="120"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="reasons"
|
|
|
label="滞留原因"
|
|
|
width="120"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="remark"
|
|
|
label="海关备注"
|
|
|
width="120"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
|
label="操作"
|
|
|
width="250"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button style="margin-top: 10px" type="primary" size="mini" @click="trans_toEditDialog(scope.$index,scope.row)">编辑</el-button>
|
|
|
<el-button type="success" size="mini" @click="trans_send(scope.$index,scope.row)">申报</el-button>
|
|
|
<el-button type="danger" size="mini" @click="trans_remove(scope.$index,scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<!--分页区域-->
|
|
|
<div class="block" style="margin-top: 10px">
|
|
|
<el-pagination
|
|
|
:current-page="queryForm.pageNum"
|
|
|
:page-sizes="[10, 50, 100, 500]"
|
|
|
:page-size="queryForm.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="trans_dialog.addDialog"
|
|
|
style="margin-top: -50px"
|
|
|
text-align="center"
|
|
|
width="80%"
|
|
|
@close="trans_addDialogClosed"
|
|
|
>
|
|
|
<el-form ref="form" :inline="true" :model="form" class="demo-form-inline" label-width="100px" style="margin-top: -20px;label:right" :rules="rules" >
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<div class="grid-content content">报给单位</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="海关关区" prop="customcode">
|
|
|
<el-input v-model="form.customcode" size="small" style="width: 140px" placeholder="" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<div class="grid-content content">航空器信息</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="航空器注册号" prop="aircraftno">
|
|
|
<el-input v-model="form.aircraftno" size="small" style="width: 140px" placeholder="" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="注册海关关区" prop="registeredcustom">
|
|
|
<el-input v-model="form.registeredcustom" size="small" style="width: 140px" placeholder="" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="航空器类型" prop="aircrafttype">
|
|
|
<el-input v-model="form.aircrafttype" size="small" style="width: 140px" placeholder="" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<div class="grid-content content">在港申报信息</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="航班号" prop="flightno">
|
|
|
<el-input v-model="form.flightno" size="small" style="width: 140px" placeholder="" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="航班日期" prop="flightdate">
|
|
|
<el-date-picker
|
|
|
v-model="form.flightdate"
|
|
|
value-format="yyyyMMdd"
|
|
|
format="yyyyMMdd" size="small" type="date" placeholder="选择日期" style="width: 140px;" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="停靠港" prop="callport">
|
|
|
<el-input v-model="form.callport" size="small" style="width: 140px" placeholder="" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="停机位" prop="callarea">
|
|
|
<el-input v-model="form.callarea" size="small" style="width: 140px" placeholder="" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<div class="grid-content content">备注信息</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="滞留原因" prop="reasons">
|
|
|
<el-input
|
|
|
v-model="form.reasons"
|
|
|
type="textarea"
|
|
|
:rows="2" size="small" style="width:440px"
|
|
|
placeholder="请输入内容"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="海关备注" prop="remark">
|
|
|
<el-input
|
|
|
v-model="form.remark"
|
|
|
type="textarea"
|
|
|
:rows="2" size="small" style="width:440px"
|
|
|
placeholder="请输入内容"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item>
|
|
|
<el-button size="small" style="margin-left: 500px;width: 100px" type="info" @click="trans_dialog.addDialog = false">取消</el-button>
|
|
|
<el-button type="primary" size="small" style="margin-left: 20px;width: 100px" @click="dialogStatus==='create'?trans_add():trans_edit()">提交</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
</el-row>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {addAircraftStaying, selectAircraftStaying, sendAircraftStaying} from "../../api/transport";
|
|
|
|
|
|
export default {
|
|
|
name: "dynamics" ,
|
|
|
data() {
|
|
|
return {
|
|
|
queryForm: {
|
|
|
aircraftno: '',
|
|
|
flightno: '',
|
|
|
flightdate: '',
|
|
|
pageNum: 1,
|
|
|
pageSize: 10
|
|
|
},
|
|
|
total: 0,
|
|
|
tableData:[
|
|
|
],
|
|
|
dialogMap: {
|
|
|
update: '编辑',
|
|
|
create: '新增'
|
|
|
},
|
|
|
dialogStatus: 'create',
|
|
|
trans_dialog: {
|
|
|
// 添加对话框
|
|
|
addDialog: false,
|
|
|
// 编辑对话框
|
|
|
editDialog: false
|
|
|
},
|
|
|
form:{
|
|
|
aircraftno: '',
|
|
|
customcode: '',
|
|
|
registeredcustom: '',
|
|
|
aircrafttype: '',
|
|
|
flightno: '',
|
|
|
flightdate: '',
|
|
|
callport: '',
|
|
|
callarea: '',
|
|
|
reasons: '',
|
|
|
remark: '',
|
|
|
},
|
|
|
rules: {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.transList();
|
|
|
},
|
|
|
methods: {
|
|
|
// 类型转换
|
|
|
// formatStatus: function(row, column) {
|
|
|
// return row.status == 0 ? '未审核' : row.status == 1 ? '审核通过' : '审核不通过'
|
|
|
// },
|
|
|
handleSizeChange(val) {
|
|
|
this.formInline.pageSize = val
|
|
|
this.transList()
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
this.formInline.pageNum = val
|
|
|
this.transList()
|
|
|
},
|
|
|
// 获取消息标签列表
|
|
|
transList() {
|
|
|
const _this = this
|
|
|
selectAircraftStaying(this.queryForm).then((response) => {
|
|
|
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())
|
|
|
})
|
|
|
},
|
|
|
// 删除
|
|
|
trans_remove(index, row) {
|
|
|
// 弹框询问是否删除?
|
|
|
this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
|
|
|
confirmButtonText: '确定删除',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}
|
|
|
).then(() => {
|
|
|
row.isdelete=1;
|
|
|
addAircraftStaying(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.trans_dialog.addDialog = false
|
|
|
// 刷新列表
|
|
|
this.transList()
|
|
|
}).catch(error => {
|
|
|
this.$message.error(res.msg)
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
},
|
|
|
// 打开新增
|
|
|
trans_toAddDialog() {
|
|
|
this.dialogStatus = 'create'
|
|
|
this.trans_dialog.addDialog = true
|
|
|
},
|
|
|
|
|
|
// 新增功能
|
|
|
trans_add() { // 进行表单的预验证
|
|
|
this.$refs.form.validate(valid => {
|
|
|
// 未通过,表单预校验
|
|
|
if (!valid) return
|
|
|
addAircraftStaying(this.form).then((response) => {
|
|
|
const res = response.data
|
|
|
// 添加失败
|
|
|
if (res.code !== '200') {
|
|
|
// 关闭加载
|
|
|
return this.$message.error(res.msg)
|
|
|
}
|
|
|
// 添加,成功
|
|
|
this.$message.success(res.msg)
|
|
|
// 隐藏对话框
|
|
|
this.trans_dialog.addDialog = false
|
|
|
// 刷新列表
|
|
|
this.transList()
|
|
|
}).catch(error => {
|
|
|
this.$message.error(error.toString())
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
// 打开编辑
|
|
|
trans_toEditDialog(index, row) {
|
|
|
this.trans_dialog.addDialog = true
|
|
|
this.dialogStatus = 'update'
|
|
|
this.$nextTick(() => {
|
|
|
this.form = Object.assign({}, row)
|
|
|
})
|
|
|
},
|
|
|
// 编辑功能
|
|
|
trans_edit() {
|
|
|
// 进行表单的预验证
|
|
|
this.$refs.form.validate(valid => {
|
|
|
// 未通过,表单预校验
|
|
|
if (!valid) return
|
|
|
addAircraftStaying(this.form).then((response) => {
|
|
|
const res = response.data
|
|
|
if (res.code !== '200') {
|
|
|
return this.$message.error(res.msg)
|
|
|
}
|
|
|
this.$message.success(res.msg)
|
|
|
// 隐藏对话框
|
|
|
this.trans_dialog.addDialog = false
|
|
|
// 刷新列表
|
|
|
this.transList()
|
|
|
}).catch(error => {
|
|
|
this.$message.error(error.toString())
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
// 申报
|
|
|
trans_send(index, row) {
|
|
|
sendAircraftStaying(row).then((response) => {
|
|
|
const res = response.data
|
|
|
if (res.code !== '200') {
|
|
|
return this.$message.error(res.msg);
|
|
|
}
|
|
|
this.$message.success('申报成功!');
|
|
|
this.transList();
|
|
|
}).catch(error => {
|
|
|
this.$message.error(error.toString());
|
|
|
});
|
|
|
},
|
|
|
// 关闭对话框
|
|
|
trans_addDialogClosed() {
|
|
|
// 重置对话框
|
|
|
this.$refs.form.resetFields()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<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> |
...
|
...
|
|