jinhui.wang

更新代码

This diff is collapsed. Click to expand it.
<template>
<div>
<el-dialog
title="货物配舱"
width="80%"
:visible.sync="dialogVisible"
:close-on-click-modal="false"
:append-to-body="true"
>
<el-divider content-position="left">已选货物信息</el-divider>
<el-table
:data="tableData"
size="mini"
height="200"
max-height="200"
border
stripe
highlight-current-row
style="width: 100%"
>
<el-table-column type="index" label="序号" align="center">
</el-table-column>
<el-table-column
v-for="(item, index) in cargoHeader"
header-align="center"
align="center"
:prop="item.value"
:label="item.name"
:key="index"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
<el-form
ref="form"
label-position="right"
label-width="auto"
style="width: 400px; margin: 30px auto"
>
<el-form-item label="航班号" prop="fltNo">
<el-input
v-model="fltNo"
size="medium"
placeholder="请输入航班号"
style="width: 350px"
></el-input>
</el-form-item>
<el-form-item label="航班日期:" prop="fltDate">
<el-date-picker
v-model="formData.fltDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
size="medium"
style="width: 350px"
>
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogBeforeClose">取 消</el-button>
<el-button type="primary" @click="submit" :loading="loading">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { allocationFlight } from "@/api/cargoSelect";
import { MessageBox } from "element-ui";
export default {
props: {
dialogVisible: {
type: Boolean,
default: false,
},
tableData: {
type: Array,
default: null,
},
},
data() {
return {
formData: {
ids: [],
fltNo: undefined,
fltDate: undefined,
overweight: false,
},
cargoHeader: [
{ name: "口岸代码", value: "portName" },
{ name: "运单号", value: "waybillNo" },
{ name: "货物状态", value: "statusName" },
{ name: "站点", value: "siteName" },
{ name: "申报类型", value: "typeName" },
{ name: "URSA", value: "ursa" },
{ name: "实际重量", value: "actualWeight" },
{ name: "件数", value: "qty" },
{ name: "ACCS原航班号", value: "fltNoAccs" },
{ name: "ACCS原航班日期", value: "fltDateAccs" },
{ name: "品名描述", value: "nameDescription" },
{ name: "是否自动", value: "cargoRulesStatus" },
{ name: "创建人", value: "createUserName" },
{ name: "创建时间", value: "createTime" },
],
rules: {
fltNo: [
{
required: true,
message: "航班号不能为空",
trigger: "blur",
},
],
fltDate: [
{
required: true,
message: "航班日期不能为空",
trigger: "change",
},
],
},
loading:false
};
},
methods: {
cleaerForm() {
this.formData = {
ids: [],
fltNo: undefined,
fltDate: undefined,
overweight: false,
};
},
//确定配舱
submit() {
this.loading = true;
let arr = [];
this.tableData.forEach((item) => {
arr.push(item.id);
});
this.formData.ids = arr;
if (this.formData.fltNo && this.formData.fltDate) {
allocationFlight(this.formData).then((res) => {
//code 200 配舱成功 202 重量已满需要确认 其余code直接输出msg
if (res.code === 200) {
this.$message({
message: "货物配舱成功",
type: "success",
});
this.cleaerForm();
this.loading = false;
this.$emit("dialogBeforeClose", { close: false, reload: true });
} else if (res.code === 202) {
MessageBox.confirm(res.msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.formData.overweight = true; //确定继续overweight变为true再次请求接口
allocationFlight(this.formData).then((res) => {
if (res.code === 200) {
this.$message({
message: "货物配舱成功",
type: "success",
});
} else {
this.$message({
message: res.msg,
type: "warning",
});
}
});
this.cleaerForm();
this.loading = false;
this.$emit("dialogBeforeClose", { close: false, reload: true });
})
.catch(() => {
//取消 取消当前配舱
this.$message({
message: "配舱已取消",
type: "success",
});
this.cleaerForm();
this.loading = false;
this.$emit("dialogBeforeClose", {
close: false,
reload: true,
});
});
} else {
this.loading = false;
this.$message({
message: res.msg,
type: "warning",
});
}
}).catch(()=>{
this.loading = false;
});
} else {
this.loading = false;
this.$message({
message: "航班号或航班日期不能为空",
type: "warning",
});
}
},
dialogBeforeClose() {
this.cleaerForm();
this.$emit("dialogBeforeClose", { close: false, reload: true });
},
},
computed: {
fltNo: {
get: function () {
return this.formData.fltNo;
},
set: function (val) {
this.formData.fltNo = val.toUpperCase();
},
},
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div style="margin: 40px" class="app-container">
<el-form
:inline="true"
:model="queryParams"
class="demo-form-inline"
size="small"
>
<el-form-item label="航班号">
<el-input
v-model.trim="purposeOfFlightNo"
placeholder="航班号"
@keyup.enter.native="getList"
></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="queryParams.status" placeholder="状态">
<el-option label="有效" value="1"></el-option>
<el-option label="停用" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="getList"
size="mini"
>查询</el-button
>
</el-form-item>
</el-form>
<el-button
style="margin-bottom: 20px"
type="primary"
icon="el-icon-plus"
size="mini"
@click="
$router.push({
name: 'FlightAllocConfigAdd',
params: { handle: 'add' },
})
"
>添加</el-button
>
<el-table :data="flyList" v-loading="loading" size="small">
<el-table-column
prop="purposeOfFlightNo"
label="航班号"
align="center"
></el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.status === '0'">无效</span>
<span v-if="scope.row.status === '1'">有效</span>
<span v-if="scope.row.status === '2'">配置中</span>
<span v-if="scope.row.status === '3'">停用</span>
</template>
</el-table-column>
<el-table-column prop="createUserName" label="操作人" align="center">
</el-table-column>
<el-table-column prop="createTime" label="更新时间" align="center">
</el-table-column>
<el-table-column label="操作" prop="id" align="center">
<template slot-scope="scope">
<el-button
type="text"
size="mini"
icon="el-icon-view"
@click="handleClick(scope.row.id, 'detail')"
>查看</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
@click="handleClick(scope.row.id, 'update')"
>修改</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
@click="del(scope.row.id, scope.row.status)"
>删除</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-video-pause"
@click="changeStatus(scope.row.id, 3)"
v-if="scope.row.status == '1'"
>停用</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-video-play"
@click="changeStatus(scope.row.id, 1)"
v-else
>启用</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="getList"
@current-change="getList"
:current-page.sync="curPage"
:page-sizes="[10, 20, 30, 40]"
:page-size.sync="limit"
layout="prev, pager, next, jumper, sizes, total"
:total="total"
background
:hide-on-single-page="true"
style="margin-top: 40px; text-align: right"
>
</el-pagination>
</div>
</template>
<script>
import {
findFlightNo,
delFlightId,
enableOrDisable,
} from "@/api/destinationFlight";
export default {
name: "FlightAllocConfig",
data() {
return {
queryParams: {
purposeOfFlightNo: "",
status: "1",
start: 0,
limit: 10,
},
flyList: [],
curPage: 1,
limit: 10,
total: 0,
loading: false,
};
},
activated(){
this.getList()
},
methods: {
getList() {
this.queryParams.limit = this.limit;
if (this.curPage > 1) {
this.queryParams.start = (this.curPage - 1) * this.queryParams.limit;
} else {
this.queryParams.start = 0;
}
this.loading = true;
findFlightNo(this.queryParams).then((response) => {
if (response.code != 200) {
this.$message({
showClose: true,
message: response.msg,
type: "error",
});
return;
}
this.flyList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
});
},
//跳转到查看,修改页面
handleClick(flightiId, handle) {
this.$router.push({
name: "FlightAllocConfigInfo",
params: { handle: handle, id: flightiId },
});
},
//删除规则
del(id, status) {
if (status == "1") {
this.$confirm("航班规则生效中,无法删除,请停用后再操作", "警告", {
confirmButtonText: "确定",
showCancelButton: false,
type: "warning",
});
} else {
this.$confirm("是否确认删除此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
showCancelButton: true,
type: "warning",
}).then(() => {
delFlightId(id)
.then((res) => {
this.$message({
message: res.msg,
type: res.code === 200 ? "success" : "warning",
});
this.getList();
})
.catch(() => {});
});
}
},
//启用,停用
changeStatus(id, status) {
let tip = status === 1 ? "启用" : "停用";
this.$confirm("是否确认" + tip + "此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
enableOrDisable(id, status)
.then((res) => {
if (res.code != 200) {
this.msgError(res.msg);
} else {
this.getList();
this.msgSuccess(tip + "成功");
}
})
.catch(() => {});
});
},
},
created() {
this.getList();
},
computed: {
purposeOfFlightNo: {
get: function () {
return this.queryParams.purposeOfFlightNo;
},
set: function (val) {
this.queryParams.purposeOfFlightNo = val.toUpperCase();
},
},
},
};
</script>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
<template>
<div class="app-container">
<el-form
class="form-header"
:model="queryParams"
label-position="right"
label-width="auto"
size="medium"
>
<el-row>
<el-col :span="6">
<el-form-item label="航班日期从" prop="fltDateStart">
<el-date-picker
value-format="yyyy-MM-dd"
class="formItem"
v-model="queryParams.fltDateStart"
type="date"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="到" prop="fltDateEnd">
<el-date-picker
value-format="yyyy-MM-dd"
class="formItem"
v-model="queryParams.fltDateEnd"
type="date"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班号">
<el-input
type="textarea"
v-model="fltNo"
clearable
class="formItem"
placeholder="AC001;AC002"
rows="1"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运单号">
<el-input
clearable
type="textarea"
v-model="queryParams.waybillNo"
class="formItem"
placeholder="请输入运单号(回车间隔)"
rows="1"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="站点">
<el-input
type="textarea"
v-model="siteName"
class="formItem"
placeholder="PVG;PEK"
clearable
rows="1"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="URSA">
<el-input
clearable
type="textarea"
v-model="ursa"
class="formItem"
placeholder="S_;P_;E2"
rows="1"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-switch
v-model="queryParams.reExport"
active-color="#13ce66"
active-text="重新导出"
style="padding-left: 35px"
>
</el-switch>
</el-col>
</el-row>
<div style="margin-top: 25px">
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button
type="warning"
:disabled="tableData.length == 0"
@click="xlse()"
:loading="downLoadingTip.downloading"
icon="el-icon-download"
size="mini"
>{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出"
}}</el-button
>
</div>
</el-form>
<el-table
max-height="500"
highlight-current-row
border
stripe
v-loading="loading"
:data="tableData"
>
<el-table-column
label="运单号"
align="center"
prop="waybillNo"
width="150"
/>
<el-table-column
:show-overflow-tooltip="true"
label="品牌描述"
align="center"
prop="nameDescription"
width="150"
/>
<el-table-column
label="航班日期"
align="center"
prop="fltDate"
width="150"
/>
<el-table-column label="航班号" align="center" prop="fltNo" />
<el-table-column
label="航班路线"
align="center"
prop="route"
width="150"
/>
<el-table-column
label="配置航班类型"
align="center"
prop="kindName"
width="130"
/>
<el-table-column label="尺寸" align="center" prop="sizeStr" />
<el-table-column label="件数" align="center" prop="qty" />
<el-table-column label="实际重量" align="center" prop="actualWeight" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
layout=" prev, pager, next, jumper, sizes,total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.limitSize"
@pagination="findAllFltData"
/>
</div>
</template>
<script>
import { findCagroPreData } from "@/api/cargoSelect";
import { cargoXlsxPre } from "@/utils/zipdownload";
export default {
name: "CAPreQualificationExport",
data() {
return {
//导出
downLoadingTip: {
tip: "",
downloading: false,
},
tableData: [], //表格数据
// 遮罩层
loading: false,
// 弹出层标题
title: "",
// 总条数
total: 0,
// 原航班规则数据
findAllFltDatList: [],
// 新增修改查看规则弹出层
open: false,
// 查询参数
queryParams: {
limitStart: 0, //当前条数【代表第几条数据 +1开始】
pageNum: 1,
limitSize: 20, //一页显示多少条数据
fltDateStart: undefined, //航班日期开始
fltDateEnd: undefined, //航班日期结束
reExport: false,
//航班号
fltNo: null,
//运单号
waybillNo: "",
//站点
siteName: "",
//ursa
ursa: "",
},
// 表单校验
rules: {},
};
},
created() {},
methods: {
// 导出表格
xlse() {
this.downLoadingTip.downloading = true;
this.downLoadingTip.tip = "正在导出结果集请耐心等待";
let cargoXlse = { title: "航班预审表", cargoExportPreQueryDto: {} };
cargoXlse.cargoExportPreQueryDto = JSON.parse(
JSON.stringify(this.queryParams)
);
cargoXlse.cargoExportPreQueryDto.limitStart = 0;
cargoXlse.cargoExportPreQueryDto.limitSize = -1;
cargoXlsxPre("/cargo/excelPre", cargoXlse)
.then(() => {
this.downLoadingTip.downloading = false;
this.downLoadingTip.tip = "";
this.progress = 100;
})
.catch(() => {
this.downLoadingTip.downloading = false;
this.downLoadingTip.tip = "";
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.start = 0;
this.findAllFltData();
},
/** 预审信息查寻*/
findAllFltData() {
this.loading = true;
if (this.queryParams.pageNum > 1) {
this.queryParams.limitStart =
(this.queryParams.pageNum - 1) * this.queryParams.limitSize;
} else {
this.queryParams.limitStart = 0;
}
findCagroPreData(this.queryParams).then((response) => {
if (response.code == 200) {
this.tableData = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
} else {
this.msgError(response.msg);
}
});
},
},
computed: {
fltNo: {
get: function () {
return this.queryParams.fltNo;
},
set: function (val) {
this.queryParams.fltNo = val.toUpperCase();
},
},
siteName: {
get: function () {
return this.queryParams.siteName;
},
set: function (val) {
this.queryParams.siteName = val.toUpperCase();
},
},
ursa: {
get: function () {
return this.queryParams.ursa;
},
set: function (val) {
this.queryParams.ursa = val.toUpperCase();
},
},
},
};
</script>
<style scoped>
.tips {
float: right;
color: #606266;
font-size: 14px;
margin-right: 40px;
}
</style>
<template>
<div style="margin: 20px">
<el-form :inline="true" :model="form" class="demo-form-inline" size="small">
<el-form-item>
<el-upload action="/caPreReviewImport/importFlight" name="file" :http-request="uploadExcel"
:on-remove="handleRemove" :limit="1" :on-exceed="handleExceed" :file-list="fileList" accept=".xlsx"
class="upload-demo">
<el-button type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="downloadTempleate">下载模板</el-button>
</el-form-item>
</el-form>
<div style="font-size: 12px; font-weight: 700">
提示:<span style="color: #1890ff">以下为所提交的数据或出错信息</span>
</div>
<el-table ref="filterTable" :data="tableData" v-loading="loading" style="width: 100%; margin-top: 20px" size="small" border>
<el-table-column label="行号" prop="line" fixed width="50" align="center">
</el-table-column>
<el-table-column label="错误信息" prop="errorMessage" fixed width="300">
<template slot-scope="scope">
<div v-for="(m, key) in scope.row.errorMessage" :key="key">
{{ m }}
</div>
</template>
</el-table-column>
<el-table-column v-if="tableData.length == 0"></el-table-column>
<el-table-column v-if="tableData.length > 0" label="运单号" align="center" prop="A" />
<el-table-column v-if="tableData.length > 0" label="品名描述" align="center" prop="B" />
<el-table-column v-if="tableData.length > 0" label="航班日期" align="center" prop="C" />
<el-table-column v-if="tableData.length > 0" label="航班号" align="center" prop="D" />
<el-table-column v-if="tableData.length > 0" label="预审意见" align="center" prop="E" />
<!-- <el-table-column v-for="(value, key) in this.tableData[0]" :key="key"
v-if="key != 'errorMessage' && key != 'line'" :label="key" :prop="key" width="120"></el-table-column>-->
</el-table>
</div>
</template>
<script>
import {
downLoadTemplate,
importcaPreReview,
} from "@/api/caPreReviewImport";
export default {
name:"CAPreReviewImport",
data() {
return {
// 遮罩层
loading: false,
flightType: [],
form: {
type: "",
region: "",
},
fileList: [],
tableData: [],
};
},
methods: {
downloadTempleate() {
let fileName = "航班预审导入模板.xlsx";
downLoadTemplate().then((res) => {
if (res) {
const blob = new Blob([res]);
const link = document.createElement("a"); //创建a标签
link.download = fileName; //a标签添加属性
link.style.display = "none";
link.href = URL.createObjectURL(blob);
document.body.appendChild(link);
link.click(); //执行下载
URL.revokeObjectURL(link.href); //释放url
document.body.removeChild(link); //释放标签
} else {
this.$message.error("下载失败");
}
});
},
uploadExcel(option) {
//上传excel
const file = option.file;
this.loading=true;
importcaPreReview(file, this.form.type).then((res) => {
this.loading=false;
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
} else {
this.$message.error(res.msg);
this.tableData = res.data;
}
} else {
this.$message.success(res.msg);
this.tableData = res.data;
}
});
},
handleRemove(file, fileList) {
//清掉上传的文件
this.tableData = [];
this.fileList = [];
},
handleExceed(files) {
//重复上传文件
let file = {};
file.file = files[0];
file.name = files[0].name;
this.fileList = [];
this.fileList.push(file);
this.uploadExcel(file);
},
},
created() {
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.upload-demo {
float: right;
}
.el-upload-list {
display: inline-block;
margin-left: 10px;
vertical-align: top;
}
</style>
<template>
<div style="margin: 20px">
<el-form :inline="true" :model="form" class="demo-form-inline" size="small">
<el-form-item label="航班种类">
<el-select v-model="form.type" placeholder="航班种类">
<el-option
v-for="item in flightType"
:key="item.id"
:label="item.englishName"
:value="item.code"
>{{ item.englishName }}</el-option
>
</el-select>
</el-form-item>
<el-form-item>
<el-upload
action="/flightInfoImport/importFlight"
name="file"
:http-request="uploadExcel"
:on-remove="handleRemove"
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList"
accept=".xlsx"
class="upload-demo"
>
<el-button type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="downloadTempleate"
>下载模板</el-button
>
</el-form-item>
</el-form>
<div style="font-size: 12px; font-weight: 700">
提示:<span style="color: #1890ff">以下为所提交的数据或出错信息</span>
</div>
<el-table
ref="filterTable"
:data="tableData"
style="width: 100%; margin-top: 20px"
size="small"
border
>
<el-table-column label="行号" prop="line" fixed width="50" align="center">
</el-table-column>
<el-table-column label="错误信息" prop="errorMessage" fixed width="200">
<template slot-scope="scope">
<div v-for="(m, key) in scope.row.errorMessage" :key="key">
{{ m }}
</div>
</template>
</el-table-column>
<el-table-column v-if="tableData.length == 0"></el-table-column>
<el-table-column
v-for="(value, key) in this.tableData[0]"
:key="key"
v-if="key != 'errorMessage' && key != 'line'"
:label="key"
:prop="key"
width="120"
></el-table-column>
</el-table>
</div>
</template>
<script>
import {
filghtKindData,
downLoadTemplate,
importFlight,
} from "@/api/flightInfoImport";
export default {
name: "FlightInformationImport",
data() {
return {
flightType: [],
form: {
type: "",
region: "",
},
fileList: [],
tableData: [],
};
},
methods: {
downloadTempleate() {
let downloadType = "";
let fileName = "";
switch (this.form.type) {
case "flightKind20":
downloadType = "whiteTail";
fileName = "航班信息导入模板WhiteTail.xlsx";
break;
case "flightKind30":
downloadType = "purpleTail";
fileName = "航班信息导入模板PurpleTail.xlsx";
break;
default:
this.$confirm("此类航班暂无模板,请选择其他类型航班", "提示", {
confirmButtonText: "确定",
showCancelButton: false,
type: "warning",
});
}
if (downloadType != "") {
downLoadTemplate(downloadType).then((res) => {
if (res) {
const blob = new Blob([res]);
const link = document.createElement("a"); //创建a标签
link.download = fileName; //a标签添加属性
link.style.display = "none";
link.href = URL.createObjectURL(blob);
document.body.appendChild(link);
link.click(); //执行下载
URL.revokeObjectURL(link.href); //释放url
document.body.removeChild(link); //释放标签
} else {
this.$message.error("下载失败");
}
});
}
},
uploadExcel(option) {
//上传excel
const file = option.file;
importFlight(file, this.form.type).then((res) => {
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
} else {
this.$message.error(res.msg);
this.tableData = res.data;
}
} else {
this.$message.success("导入成功");
this.tableData = res.data;
}
});
},
handleRemove(file, fileList) {
//清掉上传的文件
this.tableData = [];
this.fileList = [];
},
handleExceed(files) {
//重复上传文件
let file = {};
file.file = files[0];
file.name = files[0].name;
this.fileList = [];
this.fileList.push(file);
this.uploadExcel(file);
},
},
created() {
filghtKindData().then((response) => {
if (response.code != 200) {
this.$message({
message: response.msg,
type: "error",
});
}
this.flightType = response.data;
this.form.type = response.data[0].code;
});
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.upload-demo {
float: right;
}
.el-upload-list {
display: inline-block;
margin-left: 10px;
vertical-align: top;
}
</style>
\ No newline at end of file
This diff is collapsed. Click to expand it.