Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Elements-SY
2023-08-24 16:19:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
724d41a70f1204fae6800becc8bad15a1ca84571
724d41a7
1 parent
dd685cf7
ET86联调
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
148 additions
and
93 deletions
src/api/et86.js
src/router/index.js
src/views/allocationConfig/et86/edit/index.vue
src/views/allocationConfig/et86/edit/mixins/index.js
src/views/allocationConfig/et86/index.vue
src/api/et86.js
View file @
724d41a
...
...
@@ -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
,
});
...
...
src/router/index.js
View file @
724d41a
...
...
@@ -81,25 +81,11 @@ export const constantRoutes = [
children
:
[],
},
{
path
:
"/e
t86/:name
"
,
path
:
"/e
dit
"
,
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"
,
...
...
src/views/allocationConfig/et86/edit/index.vue
View file @
724d41a
...
...
@@ -202,7 +202,7 @@
<el-form-item label="申报类别">
<el-card shadow="never">
<el-checkbox-group
v-model="checkboxCl
s
ssType"
v-model="checkboxCl
a
ssType"
@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: [], // 已勾选申报类别的数据
checkboxCl
s
ssType: [], // 申报类别
checkboxCl
a
ssType: [], // 申报类别
serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode
minCNYCustomVal: "", //
maxCNYCustomVal: "", //
...
...
@@ -405,23 +406,35 @@ 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.tableData = [
{
id: this.id,
flightNo: "", // 航班号
calculateDay: "", // 航班日期//+1 -1
flightRoute: "", // 航线
routeList: [], // 航线列表
permitOverweight: "N" ? false : true, // 爆仓是否继续配舱 Y-是,N-否
priority: this.id, // 优先等级
ruleId: "", // 维度ID
},
];
this.getAllDictData(); // 获取全部字典
if(this.$route.params.name == "view" || this.$route.params.name == "edit"){
this.queryFindEtesRuleById(this.$route.params); // ET86详情
if (this.$route.query.name == "view" || this.$route.query.name == "edit") {
this.queryFindEtesRuleById(this.$route.query); // ET86详情
} else {
this.tableData = [
{
id: this.id,
flightNo: "", // 航班号
calculateDay: "", // 航班日期//+1 -1
flightRoute: "", // 航线
routeList: [], // 航线列表
permitOverweight: "N" ? false : true, // 爆仓是否继续配舱 Y-是,N-否
priority: this.id, // 优先等级
ruleId: "", // 维度ID
},
];
}
},
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{
this.msgError(msg || "创建失败!");
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
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
;
}
})
data.list.flightRankDtoList; // ET86配舱航班顺位
data.list.fltRuleDto; // ET86配舱航班顺位维度
this.tableData = data.list.flightRankDtoList
}else{
this.msgError(msg || "获取查看失败");
}
console.log(res)
})
});
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 || "获取查看失败");
}
});
},
// 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: t
his.t
ableData, // 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;
...
...
src/views/allocationConfig/et86/edit/mixins/index.js
View file @
724d41a
...
...
@@ -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} 已包含`);
}
}
},
...
...
src/views/allocationConfig/et86/index.vue
View file @
724d41a
...
...
@@ -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,9 +158,15 @@ export default {
type: "warning",
center: true,
}).then(() => {
console.log("删除:", row);
this.msgSuccess("删除成功!");
}).catch(() => {});
deleteEtesRuleById({ id: row.id }).then(res=>{
const { code, msg } = res;
if (code == 200) {
this.msgSuccess("删除成功!");
}else{
this.msgError(msg || "删除失败");
}
})
}).catch(() => {});
},
},
};
...
...
Please
register
or
login
to post a comment