Elements-SY

ET86联调

......@@ -35,7 +35,16 @@ export function findEtesRuleById(data) {
// ET86编辑
export function update(data) {
return request({
url: "/etes/udpate",
url: "/etes/update",
method: "post",
data: data,
});
}
// ET86删除
export function deleteEtesRuleById(data) {
return request({
url: "/etes/deleteEtesRuleById",
method: "post",
data: data,
});
......
......@@ -81,25 +81,11 @@ export const constantRoutes = [
children: [],
},
{
path: "/et86/:name",
path: "/edit",
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();
},
meta: { title: "编辑", icon: "user", noCache: false },
},
{
path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status",
......
......@@ -202,7 +202,7 @@
<el-form-item label="申报类别">
<el-card shadow="never">
<el-checkbox-group
v-model="checkboxClsssType"
v-model="checkboxClassType"
@change="changeCheckboxCargoType"
style="display: flex"
v-if="cargoType.length"
......@@ -331,11 +331,11 @@
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-col :span="24" v-if="getRouter">
<el-form-item label="">
<el-button type="primary" @click="submitForm('ruleForm')"
>保存</el-button
>
<el-button type="primary" @click="submitForm('ruleForm')">{{
getRouter
}}</el-button>
</el-form-item>
</el-col>
</el-row>
......@@ -371,10 +371,11 @@ export default {
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: { // ET86配舱航班顺位维度
queryForm: {
// ET86配舱航班顺位维度
// 表单参数
id: "", // 维度ID
originOfFlightNo: "", // 原航班号
originOfFlightNo: "A380", // 原航班号
includeServiceType: "", // 服务种类包含
notIncludeServiceType: "", // 服务种类不包含
includeUrsa: "", // URSA包含
......@@ -397,7 +398,7 @@ export default {
serviceCode: "", // 服务种类内容
cargoType: [], // 申报类别调用接口获取所有的申报类别
checkboxCargoType: [], // 已勾选申报类别的数据
checkboxClsssType: [], // 申报类别
checkboxClassType: [], // 申报类别
serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode
minCNYCustomVal: "", //
maxCNYCustomVal: "", //
......@@ -405,8 +406,23 @@ export default {
maxSUDCustomVal: "", //
};
},
computed: {},
computed: {
// 获取路由参数
getRouter() {
if (this.$route.query.name == "add") {
return "保存";
} else if (this.$route.query.name == "edit") {
return "修改";
} else {
return false;
}
},
},
created() {
this.getAllDictData(); // 获取全部字典
if (this.$route.query.name == "view" || this.$route.query.name == "edit") {
this.queryFindEtesRuleById(this.$route.query); // ET86详情
} else {
this.tableData = [
{
id: this.id,
......@@ -419,9 +435,6 @@ export default {
ruleId: "", // 维度ID
},
];
this.getAllDictData(); // 获取全部字典
if(this.$route.params.name == "view" || this.$route.params.name == "edit"){
this.queryFindEtesRuleById(this.$route.params); // ET86详情
}
},
mounted() {},
......@@ -480,37 +493,58 @@ export default {
// ET86新增
postAdd(params) {
add(params).then((res) => {
const { code, msg } = res
if(code == 200){
this.msgSuccess(msg || "创建成功!")
}else{
const { code, msg } = res;
if (code == 200) {
this.msgSuccess(msg || "创建成功!");
this.$router.push("/et86");
} else {
this.msgError(msg || "创建失败!");
}
});
},
// ET86详情
queryFindEtesRuleById({ id, status }){
findEtesRuleById({ id: id.toString(), status: status }).then(res=>{
const { code, data, msg } = res
if(code == 200){
data.list.flightRankDtoList.map(item=>{
if(item.permitOverweight == "N"){
item.permitOverweight = false
}else{
item.permitOverweight = true
}
})
data.list.flightRankDtoList; // ET86配舱航班顺位
data.list.fltRuleDto; // ET86配舱航班顺位维度
this.tableData = data.list.flightRankDtoList
}else{
queryFindEtesRuleById({ id, status }) {
findEtesRuleById({ id: id, status: status }).then((res) => {
const { code, data, msg } = res;
if (code == 200) {
data.list.flightRankDtoList.map((item) => {
if (item.permitOverweight == "N") {
item.permitOverweight = false;
} else {
item.permitOverweight = true;
}
});
this.tableData = data.list.flightRankDtoList; // ET86配舱航班顺位
Object.keys(data.list.fltRuleDto).map((key) => {
if (key == "multiHs") {
if (data.list.fltRuleDto[key] == "N") {
data.list.fltRuleDto[key] = false;
} else {
data.list.fltRuleDto[key] = true;
}
}
if (data.list.fltRuleDto[key] == null) {
data.list.fltRuleDto[key] = "";
}
});
this.queryForm = data.list.fltRuleDto; // ET86配舱航班顺位维度
} else {
this.msgError(msg || "获取查看失败");
}
console.log(res)
})
});
},
// ET86编辑
postUpdate() {},
postUpdate(parmas) {
update(parmas).then((res) => {
const { code, msg } = res;
if (code == 200) {
this.msgSuccess(msg || "修改成功!");
this.$router.push("/et86");
} else {
this.msgError(msg || "修改失败!");
}
});
},
// 获取所有数据字典
getAllDictData() {
allDictData().then((res) => {
......@@ -518,7 +552,7 @@ export default {
this.msgError(res.msg);
return;
}
this.queryForm.cargoType = res.data.cargoType; // 申报类别
this.cargoType = res.data.cargoType; // 申报类别
if (res.data.serviceCode.length) {
this.getObj(res.data);
}
......@@ -593,7 +627,7 @@ export default {
changeCheck({ $index, row }) {
this.tableData.map((item, i) => {
if ($index !== i) {
item.isOn = false;
item.permitOverweight = false;
}
});
},
......@@ -613,25 +647,33 @@ export default {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.minCNYCustomVal.length != "" || this.maxCNYCustomVal.length != "") {
// 爆仓是否继续配舱
const newtTableData = JSON.parse(JSON.stringify(this.tableData));
const tableData = newtTableData;
tableData.filter((item) => {
if (item.permitOverweight == false) {
item.permitOverweight = "N";
} else {
item.permitOverweight = "Y";
}
});
if (
this.minCNYCustomVal.length != "" ||
this.maxCNYCustomVal.length != ""
) {
this.queryForm.currencyCd = "CNY";
this.queryForm.minCustomVal = this.minCNYCustomVal;
this.queryForm.maxCustomVal = this.maxCNYCustomVal;
} else if (this.minSUDCustomVal.length != "" || this.maxSUDCustomVal.length != "") {
} else if (
this.minSUDCustomVal.length != "" ||
this.maxSUDCustomVal.length != ""
) {
this.queryForm.currencyCd = "USD";
this.queryForm.minCustomVal = this.minSUDCustomVal;
this.queryForm.maxCustomVal = this.maxSUDCustomVal;
} else {
this.queryForm.currencyCd = "CNY";
}
// 爆仓是否继续配舱
this.tableData.map((item) => {
if (item.permitOverweight == false) {
item.permitOverweight = "Y";
} else {
item.permitOverweight = "N";
}
});
let fltNo = this.tableData.some((item) => item.flightNo == "");
let fltNoRoute = this.tableData.some(
(item) => item.flightRoute == ""
......@@ -648,14 +690,24 @@ export default {
this.msgError("原航班号不可为空");
return;
}
this.queryForm.includeServiceType = this.isServiceCode == "1" && this.serviceCode.length >0 ? this.serviceCode : ""; // 包含服务种类
this.queryForm.notIncludeServiceType = this.isServiceCode == "2" && this.serviceCode.length >0 ? this.serviceCode : ""; // 不包含服务种类
this.queryForm.includeServiceType =
this.isServiceCode == "1" && this.serviceCode.length > 0
? this.serviceCode
: ""; // 包含服务种类
this.queryForm.notIncludeServiceType =
this.isServiceCode == "2" && this.serviceCode.length > 0
? this.serviceCode
: ""; // 不包含服务种类
let parmas = {
flightRankDtoList: this.tableData, // ET86配舱航班顺位
fltRuleDto: this.queryForm
flightRankDtoList: tableData, // ET86配舱航班顺位
fltRuleDto: this.queryForm,
};
parmas.fltRuleDto.multiHs = multiHs ? "Y" : "N"; // N为单品名,Y为多品名
this.postAdd(parmas);
parmas.fltRuleDto.multiHs = this.queryForm.multiHs ? "Y" : "N"; // N为单品名,Y为多品名
if (this.$route.query.name == "add") {
this.postAdd(parmas); // 新增
} else {
this.postUpdate(parmas); // 修改
}
} else {
console.log("error submit!!");
return false;
......
......@@ -47,12 +47,12 @@ export default {
if (this.isServiceCode == "1") {
if (this.serviceCodeCofig().noInclude.length) {
let tip = this.serviceCodeCofig().noInclude.toString();
this.msgError(`${tip} 不包含`);
// this.msgError(`${tip} 不包含`);
}
} else {
if (this.serviceCodeCofig().include.length) {
let tip = this.serviceCodeCofig().include.toString();
this.msgError(`${tip} 已包含`);
// this.msgError(`${tip} 已包含`);
}
}
},
......
......@@ -31,6 +31,7 @@ import { formConfig } from "./formConfig";
import { tableAttr, columnHeader } from "./tableConfig";
import {
findAllEtesRules, // ET86查询
deleteEtesRuleById, // 删除
} from "@/api/et86";
export default {
components: {
......@@ -120,8 +121,8 @@ export default {
addBtn(item) {
console.log("add:", item);
this.$router.push({
name: "edit",
params: {
path: "/edit",
query: {
name: "add",
},
});
......@@ -129,8 +130,8 @@ export default {
// 查看
viewRow({ row }) {
this.$router.push({
name: "edit",
params: {
path: "/edit",
query: {
name: "view",
id: row.id,
status: row.status
......@@ -141,10 +142,11 @@ export default {
// 编辑
editRow({ row }) {
this.$router.push({
name: "edit",
params: {
path: "/edit",
query: {
name: "edit",
id: row.id,
status: row.status
},
});
},
......@@ -156,8 +158,14 @@ export default {
type: "warning",
center: true,
}).then(() => {
console.log("删除:", row);
deleteEtesRuleById({ id: row.id }).then(res=>{
const { code, msg } = res;
if (code == 200) {
this.msgSuccess("删除成功!");
}else{
this.msgError(msg || "删除失败");
}
})
}).catch(() => {});
},
},
......