Elements-SY

modify

export const formConfig = [
{
label: "重量(KG)",
type: "Input",
name: "minWeight",
prop: "minWeight",
placeholder: "0",
rules: {
required: true,
message: "最小重量不得小于0KG",
trigger: ["change", "blur"],
},
trigger: "blur", // 事件名
},
{
label: "",
type: "Input",
name: "maxWeight",
prop: "maxWeight",
placeholder: "34",
rules: {
required: true,
message: "最大重量不得大于34KG",
trigger: ["change", "blur"],
},
trigger: "blur", // 事件名
},
{
label: "件数",
type: "Input",
name: "minNumOfPieces",
prop: "minNumOfPieces",
placeholder: "0",
rules: {
required: true,
message: "最小件数不得小于0",
trigger: ["change", "blur"],
},
trigger: "blur", // 事件名
},
{
label: "",
type: "Input",
name: "maxNumOfPieces",
prop: "maxNumOfPieces",
placeholder: "34",
rules: {
required: true,
message: "最大件数不得小于最小件数",
trigger: ["change", "blur"],
},
trigger: "blur", // 事件名
},
];
......@@ -97,7 +97,7 @@
v-model="scope.row.flightRoute"
size="small"
:disabled="scope.row.edit"
@focus="inputFlightRoute(scope)"
@visible-change="visibleChangeRoute($event, scope)"
>
<el-option
v-for="item in scope.row.routeList"
......@@ -431,7 +431,6 @@
<script>
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import { formConfig } from "./formConfig";
import { inputBlurValidate } from "@/utils/mixins";
import { tableAttr } from "./tableConfig";
import {
......@@ -453,7 +452,6 @@ export default {
mixins: [indexMixins, inputBlurValidate],
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
// ET86配舱航班顺位维度
// 表单参数
......@@ -640,22 +638,15 @@ export default {
this.tableAttr.loadingTable = false;
if (res.code == 200) {
const list = res.data.list;
let routeList = [];
if (list.length) {
list.map((item) => {
routeList.push(item);
});
let isEtesRoute = list.filter((item) => item.isEtesRoute == "Y"); // 过滤普通航线
if (isEtesRoute.length == 0) {
this.msgError("该航班下的航线均为普通航线");
}
// console.log(this.currentIndex)
// console.log(this.tableData)
// console.log(this.tableData[this.currentIndex])
// console.log(isEtesRoute)
this.tableData[this.currentIndex].flightRoute = "";
this.tableData[this.currentIndex].routeList = isEtesRoute;
// this.$set(this.tableData[this.currentIndex].routeList, index, isEtesRoute);
this.$set(this.tableData, this.currentIndex, {
...this.tableData[this.currentIndex],
});
} else {
this.msgError("暂无航线");
this.tableData[this.currentIndex].routeList = [];
......@@ -705,14 +696,17 @@ export default {
this.msgError("请输入航班号");
}
},
// 航线聚焦事件
inputFlightRoute({ $index, row }){
// 航线Select下拉框出现/隐藏时触发事件
visibleChangeRoute(e, { $index, row }) {
this.currentIndex = $index;
let params = {
fltNo: row.flightNo
fltNo: row.flightNo,
};
// 出现下拉框时触发
if (e) {
// 航线查询
this.getQueryRouteByFltNo(params);
}
// 航线查询
// this.getQueryRouteByFltNo(params);
},
// 添加ET86配舱航班顺位
addBtn(item) {
......@@ -738,7 +732,7 @@ export default {
},
// 删除
deleBtn(item, $index) {
console.log("删除:",item, $index);
console.log("删除:", item, $index);
this.tableData.splice($index, 1);
},
// 类别
......@@ -819,6 +813,11 @@ export default {
this.postAdd(parmas); // 新增
} else {
if (this.validateForm) {
parmas.flightRankDtoList.map((item) => {
if (item.hasOwnProperty("routeList")) {
delete item.routeList;
}
});
this.postUpdate(parmas); // 修改
}
}
......@@ -835,7 +834,7 @@ export default {
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0];
if (latestView) {
this.$router.push(latestView.fullPath);
this.$router.replace(latestView.fullPath);
} else {
if (view.name === "Dashboard") {
this.$router.replace({ path: "/redirect" + view.fullPath });
......
......@@ -55,50 +55,3 @@ export const formConfig = [
inputWidth: "100%",
},
];
export const editFormConfig = [
{
label: "航班号",
type: "Search",
name: "route",
prop: "fltNo",
placeholder: "请输入航班号",
rules: {
required: true,
message: "请输入航班号",
trigger: ["change", "blur"],
},
http: {
url: "/dictionary/queryRouteByFltNo",
method: "post",
data: {
fltNo: "",
},
},
},
{
label: "",
type: "inputNumber",
name: "count",
prop: "count",
placeholder: "+",
min: 0,
max: 7,
with: "50px",
},
{
label: "航线优先级",
type: "Input",
name: "route",
prop: "fltNum",
placeholder: "请选择航线优先级",
trigger: "focus",
},
{
label: "爆仓是否继续配舱",
type: "Checkbox",
name: "checked",
prop: "checked",
disabled: false,
},
];
......
......@@ -2,14 +2,14 @@
<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"
/>
<yl-form
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
:inline="false"
formWidth="auto"
@blur="blurEvent"
/>
</el-col>
</el-row>
<yl-table
......@@ -37,6 +37,7 @@ import {
findAllEtesRules, // ET86查询
deleteEtesRuleById, // 删除
} from "@/api/et86";
import store from "@/store";
export default {
name: "Et86RuleConfig",
components: {
......@@ -69,6 +70,14 @@ export default {
tableData: [], // 表格数据
};
},
watch: {
$route(to, from) {
// 如果是从edit页面进入的Et86RuleConfig页面,那么删除Et86RuleConfig页面缓存
if (from.name == "edit" && to.name == "Et86RuleConfig") {
store.dispatch("tagsView/delCachedView", to);
}
},
},
created() {
// ET86查询
this.$nextTick(() => {
......