Elements-SY

modify

......@@ -143,15 +143,9 @@ export function delFlight(data) {
//查询航线
/**
<<<<<<< HEAD
* @param fltNo 航班号
* @param page 页数
* @param size 页长
=======
* @param fltNo 航班号
* @param page 页数
* @param size 页长
>>>>>>> test
*/
export function queryRoute(data) {
return request({
......@@ -211,3 +205,11 @@ export function checkFlightRoute(data) {
})
}
//更新航线
export function updateRoute(data) {
return request({
url: `/dictionary/updateRoute`,
method: "post",
data: data,
});
}
......
......@@ -418,8 +418,11 @@ export default {
<style lang="scss">
.tablePagination {
margin-top: 10px;
text-align: right;
height: 25px;
margin-bottom: 10px;
margin-top: 15px;
padding: 10px 20px !important;
}
.w-table {
......
......@@ -4,7 +4,7 @@
<sidebar class="sidebar-container"
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }" />
<div :class="{ hasTagsView: needTagsView }" class="main-container">
<div :class="{ 'fixed-header': fixedHeader }" ref="headerRef">
<div class="headerRef" :class="{ 'fixed-header': fixedHeader }" ref="headerRef">
<navbar />
<tags-view v-if="needTagsView" />
</div>
......
......@@ -416,7 +416,8 @@ function getPropertyValue(el) {
);
}
// 获取页面内除了table其他模块所占的高
// 获取页面内除了table其他模块所占的高,
// 以及margin-top margin-bottom padding-top padding-bottom
export function restTableHeight($refs) {
let heigth = 0;
Object.keys($refs).map((key) => {
......@@ -448,5 +449,7 @@ export function restTableHeight($refs) {
heigth += getPropertyValue($refs[key]);
}
});
return heigth;
// 右边栏top-header全局组件的高
let topHeaderClientHeight = document.querySelector(".headerRef").clientHeight;
return heigth + topHeaderClientHeight;
}
......
......@@ -674,7 +674,6 @@ export default {
} else {
obj.route = this.$route.params.route ? this.$route.params.route : ''
}
this.getRouteDimension(obj)
}
}
......@@ -691,7 +690,7 @@ export default {
},
activated() {
this.routeSatus = this.$route.params.routeStatus
if (!this.$route.params.createStatus) {
if (!this.$route.params.createStatus && this.$route.params.createStatus !== undefined) {
if (this.$route.params.handle == 'add') {
if (this.infoForm.fltNo && this.infoForm.fltNo != null && this.infoForm.fltNo != '') {
this.getRoutes(this.infoForm.fltNo)
......@@ -715,7 +714,6 @@ export default {
} else {
obj.route = this.$route.params.route ? this.$route.params.route : ''
}
this.getRouteDimension(obj)
}
}
......@@ -776,11 +774,14 @@ export default {
this.infoForm.list = []
let obj = {
purposeOfFlightNo: val.fltNo,
flightDate: val.fltDate,
flightDate: val.fltDate, //
flightRoute: val.route,
flightRouteListStr: val.flightRouteListStr,
status: val.status ? val.status : ''
}
if(this.$route.params.handle == "updated"){
delete obj.flightRoute
}
if (this.$route.params.handle != 'add') {
findDestinationFltRuleByFlightNo(obj).then(res => {
if (res.code === 200) {
......@@ -841,7 +842,8 @@ export default {
}
})
}
} else {
}
else {
//未请求到数据
if (this.infoForm.route != null && this.infoForm.route != '' && this.infoForm.route != ' ') {
let params = {
......@@ -977,13 +979,41 @@ export default {
console.log(err)
})
} else if (this.routeSatus == 'flightInformationMaintenancePurple Tail') {
this.routeList.forEach((route) => {
let query = {
purposeOfFlightNo: val.fltNo,
flightRoute: val.route,
flightRouteListStr: val.flightRouteListStr,
status: val.status ? val.status : ''
}
//航班类型Purple Tail展示全部航线维度
findDestinationFltRuleByFlightNo(query).then(result => {
const { code, data } = result;
if(code == 200){
this.routeList = data.routeList;
let routesStatus = 1
if(data.routeList.length){
this.routeList.forEach(route => {
data.list.forEach(item => {
if (route.route === item.flightRoute) {
routesStatus = 2
// item.id = undefined
// item.status = undefined
// item.flightRoute = this.infoForm.route
// item.routePriority = route.routePriority
this.infoForm.list.push(this.dataHandle(item))
}
})
if (routesStatus == 1) {
this.infoForm.list.push({
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: route.route,
routePriority: route.routePriority,
})
}
})
}
}
})
}
}
......
......@@ -42,24 +42,24 @@
<el-col :span="6">
<el-form-item label="运单号">
<el-input ref='userInfo' type="textarea" v-model="formData.waybillNo" class="formItem"
placeholder="请输入运单号(回车间隔)" :rows="4" :maxlength="12000" clearable></el-input>
placeholder="请输入运单号(回车间隔)" :rows="1" :maxlength="12000" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="配载航班号">
<el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :rows="4"
<el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :rows="1"
clearable @change="planeNoChange"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="URSA">
<el-input type="textarea" v-model="ursa" class="formItem" placeholder="S_;P_;E2" :rows="4" clearable>
<el-input type="textarea" v-model="ursa" class="formItem" placeholder="S_;P_;E2" :rows="1" clearable>
</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" :rows="4" clearable>
<el-input type="textarea" v-model="siteName" class="formItem" placeholder="PVG;PEK" :rows="1" clearable>
</el-input>
</el-form-item>
</el-col>
......@@ -156,7 +156,7 @@
<el-col :span="6">
<el-form-item label="发件人账号">
<el-input ref='userInfo' type="textarea" v-model="formData.shipperAccount" class="formItem"
placeholder="请输入发件人账号(;间隔)" :rows="4" :maxlength="12000" clearable></el-input>
placeholder="请输入发件人账号(;间隔)" :rows="1" :maxlength="12000" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
......
<template>
<div ref="formHeaderRef" class="form-header container">
<el-row>
<el-col>
<yl-form
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
:inline="false"
formWidth="auto"
@blur="blurEvent"
/>
</el-col>
</el-row>
<yl-table
ref="ylTable"
:attrs="tableAttr"
:loadingTable="tableAttr.loadingTable"
:columns="columns"
:tableData="tableData"
:pageConfig="pageConfig"
@sizeChange="handleSizeChange"
@currentChange="handleCurrentChange"
@search="searchBtn"
@add="addBtn"
>
</yl-table>
</div>
</template>
<script>
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import { formConfig } from "./formConfig";
import { tableAttr, columnHeader } from "./tableConfig";
import { restTableHeight, sortList } from "@/utils";
import store from '@/store'
import {
findAllEtesRules, // ET86查询
deleteEtesRuleById, // 删除
} from "@/api/et86";
export default {
components: {
YlForm,
YlTable,
},
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
// 表单参数
status: "有效",
},
pageConfig: {
// 分页配置项
isPagination: true,
total: 0,
pageData: {
page: 1,
size: 10,
},
},
tableAttr: tableAttr, // table配置项
columns: columnHeader(this.indexAdd, this.viewRow, this.editRow, this.deleteRow), // 表头
tableData: [], // 表格数据
};
},
created() {
// ET86查询
this.$nextTick(() => {
this.searchBtn();
});
},
mounted() {
this.$nextTick(() => {
this.tableAttr.maxHeight =
window.innerHeight - restTableHeight(this.$refs);
});
},
methods: {
// ET86查询
queryFindAllEtesRules() {
const { page, size } = this.pageConfig.pageData;
let params = {
originOfFlightNo: this.queryForm.originOfFlightNo,
updateTimeStart: this.queryForm.startTime
? this.queryForm.startTime
: "",
updateTimeEnd: this.queryForm.endTime ? this.queryForm.endTime : "",
limitStart: (page - 1) * size,
limitSize: size,
status: this.queryForm.status,
};
if (this.queryForm.status == "有效") {
params.status = "1";
}
this.tableAttr.loadingTable = true;
findAllEtesRules(params)
.then((res) => {
this.tableAttr.loadingTable = false;
const { code, data } = res;
if (code == 200) {
const valid = data.list.filter((item) => item.status == "1"); // 有效
const invalid = data.list.filter((item) => item.status == "0"); // 无效
this.tableData = valid.concat(invalid);
this.pageConfig.total = data.total;
}
})
.catch(() => {});
},
// 失焦事件
blurEvent({ originOfFlightNo }) {
this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo);
},
// 搜索
searchBtn() {
this.pageConfig.pageData.page = 1;
this.pageConfig.pageData.size = 10;
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
this.queryFindAllEtesRules();
});
},
// 翻页序号递增
indexAdd(index){
const page = this.pageConfig.pageData.page // 当前页码
const pagesize = this.pageConfig.pageData.size // 每页条数
return index + 1 + (page - 1) * pagesize
},
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.queryFindAllEtesRules();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.queryFindAllEtesRules();
},
// 添加
addBtn(item) {
this.$router.push({
path: "/edit",
query: {
name: "add",
},
});
},
// 重置表单
restForm() {
this.$refs.ruleForm.resetFields("ruleForm");
},
// 查看
viewRow({ row }) {
this.$router.push({
path: "/edit",
query: {
name: "view",
id: row.id,
status: row.status,
},
});
},
// 编辑
editRow({ row }) {
this.$router.push({
path: "/edit",
query: {
name: "edit",
id: row.id,
status: row.status,
},
});
},
// 删除
deleteRow({ row }) {
this.$confirm("是否确认删除? 删除后该规则设置为无效,不可恢复", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
deleteEtesRuleById({ id: row.id }).then((res) => {
const { code, msg } = res;
if (code == 200) {
this.searchBtn();
this.msgSuccess("删除成功!");
} else {
this.msgError(msg || "删除失败");
}
});
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped></style>
......@@ -506,6 +506,44 @@ export default {
serviceCodeTableSelectAll(val) {
this.nowSelect = val
},
<<<<<<< HEAD
=======
// 确认消息提示
confirmHandle($index, row){
this.$confirm(row.msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
let params = {
id: row.id,
fltNo: row.fltNo,
route: row.route,
isEtesRoute: row.isEtesRoute ? "Y" : "N"
}
this.updateRouteSubmit(params);
})
.catch(() => {
this.tableData[$index].isEtesRoute = !this.tableData[$index].isEtesRoute;
});
},
// checkBox是否设置ET86航线
checkboxIsEtesRoute({ $index, row }){
if(!row.isEtesRoute){
/*
将ET86设置成普通航线要查询校验该航线有没有设置维度,
如果该航线设置了ET86维度是否考虑将该航线下的维度删掉再进行操作;
*/
row.msg = "是否将该航线设置为非ET86航线?";
this.confirmHandle($index, row)
}else{
row.msg = "是否将该航线设置为ET86航线?";
this.confirmHandle($index, row)
}
}
>>>>>>> test
}
}
</script>
......