Elements-SY

modify

import request from "@/utils/request";
// ET86查询
/**
* @param createTimeStart; 开始时间
* @param createTimeEnd; 结束时间
* @param status; 1-有效 0-无效 不传查全部
*/
export function findAllEtesRules(data) {
return request({
url: "/etes/findAllEtesRules",
method: "post",
data: data,
});
}
// ET86新增
export function add(data) {
return request({
url: "/etes/add",
method: "post",
data: data,
});
}
// ET86详情
export function findEtesRuleById(data) {
return request({
url: "/etes/findEtesRuleById",
method: "post",
data: data,
});
}
// ET86编辑
export function update(data) {
return request({
url: "/etes/udpate",
method: "post",
data: data,
});
}
......@@ -114,6 +114,7 @@
:style="{ width: item.width }"
:disabled="item.disable"
:placeholder="item.placeholder ? item.placeholder : '请选择日期'"
:value-format="item.format"
clearable
>
</el-date-picker>
......
......@@ -27,8 +27,8 @@
:header-cell-class-name="headerCellClassName"
>
<template v-if="columns.length">
<template v-for="(item, index) in columns">
<column v-if="!item.hidden" :key="index" :attrs="item"></column>
<template v-for="item in columns">
<column v-if="!item.hidden" :key="item.id" :attrs="item"></column>
</template>
</template>
<slot name="column" v-else></slot>
......
......@@ -81,11 +81,25 @@ export const constantRoutes = [
children: [],
},
{
path: "/et86/:edit",
path: "/et86/:name",
component: (resolve) =>
require(["@/views/allocationConfig/et86/edit"], resolve),
name: "edit",
meta: { title: "编辑", icon: "user" },
beforeEnter: (to, from, next) => {
const { params } = to;
if (params.title == "edit") {
to.params.title = "编辑"
to.params.icon = "user";
}else if (params.title == "detail") {
to.params.title = "详情";
to.params.icon = "user";
}else{
to.params.title = "新增";
to.params.icon = "user";
}
next();
},
},
{
path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status",
......
......@@ -155,7 +155,7 @@ export const inputBlurValidate = {
// 报价值【申报价值可以为空为0】
validateCustomVal(value, customVal) {
if (value.length) {
this.queryForm[customVal] = Number(value);
this[customVal] = Number(value);
let coin = {
minCNYCustomVal: "minCNYCustomVal",
maxCNYCustomVal: "minCNYCustomVal",
......@@ -170,20 +170,20 @@ export const inputBlurValidate = {
};
let markCoin = false;
if (customVal == "minCNYCustomVal" || customVal == "maxCNYCustomVal") {
if (this.queryForm.minCNYCustomVal && this.queryForm.maxCNYCustomVal) {
markCoin = Number(this.queryForm.maxCNYCustomVal) < Number(this.queryForm.minCNYCustomVal);
if (this.minCNYCustomVal && this.maxCNYCustomVal) {
markCoin = Number(this.maxCNYCustomVal) < Number(this.minCNYCustomVal);
}
} else {
if (this.queryForm.minSUDCustomVal && this.queryForm.maxSUDCustomVal) {
markCoin = Number(this.queryForm.maxSUDCustomVal) < Number(this.queryForm.minSUDCustomVal);
if (this.minSUDCustomVal && this.maxSUDCustomVal) {
markCoin = Number(this.maxSUDCustomVal) < Number(this.minSUDCustomVal);
}
}
if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(this.queryForm[customVal])) {
if (this.queryForm[customVal] >= 0) {
if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(this[customVal])) {
if (this[customVal] >= 0) {
if (markCoin) {
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = "最小申报价值不得大于最大申报价值";
} else if (this.queryForm[customVal] > currency[customVal]) {
} else if (this[customVal] > currency[customVal]) {
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = `最大申报值不得大于${currency[customVal]}`;
} else {
......
......@@ -10,7 +10,7 @@ export default {
},
// 处理serviceCode包不包含
serviceCodeCofig() {
let str = this.queryForm.serviceCode.replace(/;|;/g, ",");
let str = this.serviceCode.replace(/;|;/g, ",");
let arr = str.split(",");
if (arr[arr.length - 1] == "") {
arr.splice(arr.length - 1, 1);
......@@ -44,7 +44,7 @@ export default {
},
// serviceCode失焦事件
serviceCodeBlur() {
if (this.queryForm.isServiceCode == "1") {
if (this.isServiceCode == "1") {
if (this.serviceCodeCofig().noInclude.length) {
let tip = this.serviceCodeCofig().noInclude.toString();
this.msgError(`${tip} 不包含`);
......
......@@ -22,32 +22,32 @@ export const tableAttr = {
export const columnHeader = (deleteRow) => [
{
label: "航班号",
prop: "fltNo",
prop: "flightNo",
align: "center",
minWidth: 100,
},
{
label: "航班日期",
prop: "fltNoDate",
prop: "calculateDay",
align: "center",
minWidth: 100,
// sortable: true,
// "sort-method": (a, b) => b.updateTime - a.updateTime,
},
{
label: "航线优先级",
prop: "fltRoute",
label: "航线",
prop: "flightRoute",
align: "center",
minWidth: 100,
},
{
label: "爆仓是否继续配舱",
prop: "isOn",
prop: "permitOverweight",
align: "center",
minWidth: 100,
render: (h, params) => {
const { row } = params;
console.log(345678,row);
console.log(345678, row);
// return h("div", `状态-${row.id}`);
},
},
......@@ -80,15 +80,3 @@ export const columnHeader = (deleteRow) => [
},
},
];
export const tableData = [
{
id: "1",
fltNo: "A380",
fltNoDate: "3",
fltRoute: "",
routeList: [],
isOn: "1",
sort: "1", // 排序字段
},
];
......
......@@ -6,7 +6,8 @@ export const formConfig = [
prop: "startTime",
width: "140px",
placeholder: "请选择开始时间",
rules: { required: true, message: "请选择开始时间", trigger: "blur" },
// rules: { required: true, message: "请选择开始时间", trigger: "blur" },
format: "yyyy-MM-dd",
},
{
label: "创建时间(到)",
......@@ -15,7 +16,8 @@ export const formConfig = [
prop: "endTime",
width: "140px",
placeholder: "请选择结束时间",
rules: { required: true, message: "请选择结束时间", trigger: "blur" },
// rules: { required: true, message: "请选择结束时间", trigger: "blur" },
format: "yyyy-MM-dd",
},
{
label: "规则状态",
......@@ -31,7 +33,7 @@ export const formConfig = [
label: "有效",
},
{
value: "3",
value: "0",
label: "无效",
},
],
......
......@@ -6,8 +6,6 @@
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
@input="inputEvent"
@keyup="keyUpEvent"
/>
</el-col>
</el-row>
......@@ -30,12 +28,10 @@
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import { formConfig } from "./formConfig";
import { debounce } from "@/utils";
import { tableAttr, columnHeader, tableData } from "./tableConfig";
import { tableAttr, columnHeader } from "./tableConfig";
import {
allDictData, // 获取全部字典
queryRouteByFltNo, // 航线查询
} from "@/api/destinationFlight";
findAllEtesRules, // ET86查询
} from "@/api/et86";
export default {
components: {
YlForm,
......@@ -44,14 +40,12 @@ export default {
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
// 表单参数
queryForm: { // 表单参数
status: "有效",
},
pageConfig: {
// 分页配置项
pageConfig: { // 分页配置项
isPagination: true,
total: 13,
total: 0,
pageData: {
page: 1,
size: 10,
......@@ -59,71 +53,63 @@ export default {
},
tableAttr: tableAttr, // table配置项
columns: columnHeader(this.viewRow, this.editRow, this.deleteRow), // 表头
tableData: tableData, // 表格数据
tableData: [], // 表格数据
selectionList: [], // table复选框筛选集合
};
},
created() {},
created() {
// ET86查询
this.$nextTick(() => {
this.searchBtn();
});
},
mounted() {},
methods: {
// 航线查询
queryRoute(item) {
queryRouteByFltNo(item).then((res) => {
if (res.code == 200) {
const list = res.data.list;
let routeList = "";
if (list.length) {
list.map((item) => {
routeList += item.route + ",";
});
this.queryForm.fltRoute = routeList.substring(
0,
routeList.length - 1
);
} else {
this.queryForm = {
fltNo: item.fltNo, // 航班号
};
// ET86查询
queryFindAllEtesRules(params) {
this.tableAttr.loadingTable = true;
findAllEtesRules(params)
.then((res) => {
this.tableAttr.loadingTable = false;
const { code, data } = res;
if (code == 200) {
this.tableData = data.list;
this.pageConfig.total = data.total;
}
}
});
},
// input事件
inputEvent: debounce(function () {
this.queryRoute({
fltNo: this.queryForm.fltNo, // 航班号
});
}, 800),
// 回车事件
keyUpEvent(item) {
this.queryRoute(item);
})
.catch(() => {});
},
// table复选框事件
selectionTable(e) {
console.log("selectionTable:", e);
this.selectionList = e;
},
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
console.log("sizeChange:", e);
this.searchBtn();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
console.log("currentChange:", e);
this.searchBtn();
},
// 搜索
searchBtn(row) {
let params = {
...this.queryForm,
createTimeStart: this.queryForm.startTime
? this.queryForm.startTime
: "",
createTimeEnd: this.queryForm.endTime ? this.queryForm.endTime : "",
limitStart: this.pageConfig.pageData.page,
limitSize: this.pageConfig.pageData.size,
status: this.queryForm.status,
};
if (this.queryForm.status == "有效") {
params.status = '1';
params.status = "1";
}
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
console.log(params);
this.queryFindAllEtesRules(params);
});
},
// 重置表单
......@@ -136,43 +122,43 @@ export default {
this.$router.push({
name: "edit",
params: {
edit: 12,
name: "add",
},
});
},
// 查看
viewRow({ row }) {
this.$router.push({
name: "edit",
params: {
name: "view",
id: row.id,
status: row.status
},
});
console.log("查看:", row);
},
// 编辑
editRow(item) {
editRow({ row }) {
this.$router.push({
name: "edit",
params: {
edit: 12,
name: "edit",
id: row.id,
},
});
console.log("修改:", item);
},
// 删除
deleteRow(item) {
deleteRow({ row }) {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
console.log("删除:", item);
}).then(() => {
console.log("删除:", row);
this.msgSuccess("删除成功!");
})
.catch(() => {});
},
// 查看
viewRow({ row }) {
this.$router.push({
name: "edit",
params: {
edit: 12,
},
});
console.log("查看:", row);
}).catch(() => {});
},
},
};
......
const state = {
1: "有效",
3: "无效",
0: "无效",
};
export const tableAttr = {
border: true,
......@@ -56,13 +56,13 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [
},
{
label: "原航班号",
prop: "fltNo",
prop: "originOfFlightNo",
align: "center",
minWidth: 100,
},
{
label: "顺位航班",
prop: "flightRand",
prop: "rankFltNoStr",
align: "center",
minWidth: 100,
},
......@@ -177,114 +177,3 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [
},
},
];
export const tableData = [
{
id: "1",
flightRand: "LZ003;LZ00",
status: "1",
fltNo: "FX0090",
includeUrsa: "URSACODE191",
notIncludeUrsa: "P_3",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "2",
flightRand: "LP001;LP004+1",
status: "3",
fltNo: "FX0090",
includeUrsa: "P_;URSACODE105",
notIncludeUrsa: "P_21",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "3",
flightRand: "CQ00;LZ003;CS0004",
status: "1",
fltNo: "CS0002",
includeUrsa: "URSACODE12",
notIncludeUrsa: "P_2",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "4",
flightRand: "LZ001;LZ002;LZ004",
status: "1",
fltNo: "FX0090",
includeUrsa: "URSACODE192",
notIncludeUrsa: "P_17",
createTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "5",
flightRand: "PS001;PS003",
status: "1",
fltNo: "FX0091",
includeUrsa: "URSACODE10",
notIncludeUrsa: "P_28",
createTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "6",
flightRand: "PS002;PS003",
status: "3",
fltNo: "XN007",
includeUrsa: "URSACODE27",
notIncludeUrsa: "P_4",
createTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "7",
flightRand: "XN001;XN002;XN003;XN004",
status: "1",
fltNo: "XN001",
includeUrsa: "URSACODE34",
notIncludeUrsa: "P_7",
createTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
{
id: "8",
flightRand: "HA004",
status: "3",
fltNo: "LZ007",
includeUrsa: "URSACODE71",
notIncludeUrsa: "P_2",
createTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
{
id: "9",
flightRand: "AB0001;AB123",
status: "1",
fltNo: "AB0001",
includeUrsa: "URSACODE87",
notIncludeUrsa: "P_26",
createTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
];
......
......@@ -388,17 +388,7 @@ export default {
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.msgWarning('待联调!')
// delDict(val).then(res => {
// if (res.code === 200) {
// this.msgSuccess(res.msg)
// } else {
// this.msgWarning(res.msg)
// }
// this.tableSelect() // 回调查询
// }).catch(err => {
// console.log(err)
// })
this.routeDel({ data: [val], id: [val.id] })
}).catch(() => { })
}
} else {
......