Elements-SY

UI页面调整

......@@ -320,7 +320,7 @@ export default {
},
marginBottom: {
type: Number,
default: 30,
default: 0,
},
view: {
type: Boolean,
......
export const inputBlurValidate = {
data(){
data() {
return {
queryForm: {
minWeight: "",
......@@ -7,6 +7,7 @@ export const inputBlurValidate = {
minNumOfPieces: "",
maxNumOfPieces: "",
},
validateForm: true,
};
},
methods: {
......@@ -36,49 +37,76 @@ export const inputBlurValidate = {
},
// 校验件数方法 【件数可以为空但件数不得为0】只能输入正整数
validateNumOfPieces(value, pieces) {
if (value.length) {
if (value.toString().length) {
// 获取当前输入框有值的情况下
this.queryForm[pieces] = Number(value);
let markPieces = false;
if (pieces == "minNumOfPieces" || pieces == "maxNumOfPieces") {
if (this.queryForm.minNumOfPieces && this.queryForm.maxNumOfPieces) {
markPieces = Number(this.queryForm.maxNumOfPieces) < Number(this.queryForm.minNumOfPieces);
// 最大件数和最小件数都不为空的情况下
if (
this.queryForm.minNumOfPieces.toString() != "" &&
this.queryForm.maxNumOfPieces.toString() != ""
) {
this.validateForm = true;
this.$refs.minNumOfPieces.innerHTML = "";
markPieces = true;
} else {
markPieces = false;
}
}
if (/^\d+$/.test(this.queryForm[pieces])) {
if (markPieces) {
//当最大件数和最小件数都不为空的情况下,最大件数小于最小件数的时候
if (this.queryForm.maxNumOfPieces < this.queryForm.minNumOfPieces) {
if (Array.isArray(this.$refs.minNumOfPieces)) {
this.msgError("最小件数不得大于最大件数");
this.validateForm = false;
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数不得大于最大件数";
this.$refs.minNumOfPieces.innerHTML =
"最小件数不得大于最大件数";
this.validateForm = false;
}
} else if (
this.queryForm.minNumOfPieces < 1 || this.queryForm.maxNumOfPieces < 1
}
//当最大件数和最小件数都不为空的情况下,最大件数和最小件数小于1的时候
else if (
this.queryForm.minNumOfPieces < 1 ||
this.queryForm.maxNumOfPieces < 1
) {
if (Array.isArray(this.$refs.minNumOfPieces)) {
this.msgError("最小件数和最大件数不能小于1");
this.validateForm = false;
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1";
}
} else {
if (!Array.isArray(this.$refs.minNumOfPieces)) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML =
"最小件数和最大件数不能小于1";
this.validateForm = false;
}
}
//当最大件数和最小件数都不为空的情况下,最大件数和最小件数满足大于1左区间小于等于右区间的时候
else {
this.$refs.minNumOfPieces.innerHTML = "";
this.validateForm = true;
}
} else {
// 当左右区间其中一个有值的情况下
if (value.length) {
if (Number(value) < 1) {
if (Array.isArray(this.$refs.minNumOfPieces)) {
this.msgError("件数不得小于1");
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
this.validateForm = false;
} else {
this.msgError("件数不得小于1");
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
this.validateForm = false;
}
} else {
if (!Array.isArray(this.$refs.minNumOfPieces)) {
this.$refs.minNumOfPieces.innerHTML = "";
this.validateForm = true;
}
}
}
......@@ -90,9 +118,38 @@ export const inputBlurValidate = {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "请输入有效件数";
}
return false;
this.validateForm = false;
}
} else {
// 【左右区间不是都有值的情况下】
// 最小件数为空最大件数有值的情况下
if (pieces == "minNumOfPieces" && this.queryForm.maxNumOfPieces > 0) {
this.$refs.minNumOfPieces.innerHTML = "";
this.validateForm = true;
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
this.validateForm = false;
}
// 最大件数为空最小件数有值的情况下
if (pieces == "maxNumOfPieces" && this.queryForm.minNumOfPieces > 0) {
this.$refs.minNumOfPieces.innerHTML = "";
this.validateForm = true;
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
this.validateForm = false;
}
// 左右区间 都为空的情况下
if (
this.queryForm.minNumOfPieces.toString().length == 0 &&
this.queryForm.maxNumOfPieces.toString().length == 0
) {
this.$refs.minNumOfPieces.innerHTML = "";
this.validateForm = true;
}
}
return this.validateForm;
},
// 校验重量方法 【重量可以为空为0 && 最小/大重量的范围0~34KG】允许保留1~5位小数。
validateWeight(value, weight) {
......@@ -101,27 +158,34 @@ export const inputBlurValidate = {
let markWeight = false;
if (weight == "minWeight" || weight == "maxWeight") {
if (this.queryForm.minWeight && this.queryForm.maxWeight) {
markWeight = Number(this.queryForm.maxWeight) < Number(this.queryForm.minWeight);
markWeight =
Number(this.queryForm.maxWeight) <
Number(this.queryForm.minWeight);
}
}
if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(this.queryForm[weight])) {
if (this.queryForm[weight] >= 0) {
if (markWeight) {
if (Array.isArray(this.$refs.minWeight)) {
this.validateForm = false;
this.msgError("最小重量不得大于最大重量");
} else {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量";
}
} else if (this.queryForm[weight] > 34) {
this.validateForm = false;
if (Array.isArray(this.$refs.minWeight)) {
this.msgError("最大重量不能大于34KG");
} else {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最大重量不能大于34KG";
}
} else {
if (!Array.isArray(this.$refs.minWeight)) {
this.validateForm = true;
this.$refs.minWeight.innerHTML = "";
}
}
......@@ -129,13 +193,16 @@ export const inputBlurValidate = {
if (value.length) {
if (Number(value) > 34) {
if (Array.isArray(this.$refs.minWeight)) {
this.validateForm = false;
this.msgError("最大重量不能大于34KG");
} else {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最大重量不能大于34KG";
}
} else {
if (!Array.isArray(this.$refs.minWeight)) {
this.validateForm = true;
this.$refs.minWeight.innerHTML = "";
}
}
......@@ -143,14 +210,16 @@ export const inputBlurValidate = {
}
} else {
if (Array.isArray(this.$refs.minWeight)) {
this.validateForm = false;
this.msgError("请输入正整数,小数保留5位");
} else {
this.validateForm = false;
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位";
}
return false;
}
}
return this.validateForm;
},
// 报价值【申报价值可以为空为0】
validateCustomVal(value, customVal) {
......@@ -171,40 +240,55 @@ export const inputBlurValidate = {
let markCoin = false;
if (customVal == "minCNYCustomVal" || customVal == "maxCNYCustomVal") {
if (this.minCNYCustomVal && this.maxCNYCustomVal) {
markCoin = Number(this.maxCNYCustomVal) < Number(this.minCNYCustomVal);
this.validateForm = false;
markCoin =
Number(this.maxCNYCustomVal) < Number(this.minCNYCustomVal);
}
} else {
if (this.minSUDCustomVal && this.maxSUDCustomVal) {
markCoin = Number(this.maxSUDCustomVal) < Number(this.minSUDCustomVal);
this.validateForm = false;
markCoin =
Number(this.maxSUDCustomVal) < Number(this.minSUDCustomVal);
}
}
if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(this[customVal])) {
if (this[customVal] >= 0) {
if (markCoin) {
this.validateForm = false;
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = "最小申报价值不得大于最大申报价值";
this.$refs[coin[customVal]].innerHTML =
"最小申报价值不得大于最大申报价值";
} else if (this[customVal] > currency[customVal]) {
this.validateForm = false;
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = `最大申报值不得大于${currency[customVal]}`;
this.$refs[
coin[customVal]
].innerHTML = `最大申报值不得大于${currency[customVal]}`;
} else {
this.validateForm = true;
this.$refs[coin[customVal]].innerHTML = "";
}
} else {
if (value.length) {
if (Number(value) > currency[customVal]) {
this.validateForm = false;
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = `最大申报值不得大于${currency[customVal]}`;
this.$refs[
coin[customVal]
].innerHTML = `最大申报值不得大于${currency[customVal]}`;
} else {
this.validateForm = true;
this.$refs[coin[customVal]].innerHTML = "";
}
}
}
} else {
this.validateForm = false;
this.$refs[coin[customVal]].innerHTML = "";
this.$refs[coin[customVal]].innerHTML = "请输入正确申报价值";
return false;
}
}
return this.validateForm;
},
},
};
......
......@@ -147,7 +147,13 @@ export default {
},
methods: {
// HScode黑名单查询
queryFindHsCodeList(params) {
queryFindHsCodeList() {
const { page, size } = this.pageConfig.pageData;
let params = {
limitStart: (page - 1) * size,
limitSize: size,
...this.queryForm,
};
this.tableAttr.loadingTable = true;
findHsCodeList(params)
.then((res) => {
......@@ -206,14 +212,10 @@ export default {
},
// 搜索
searchBtn() {
const { page, size } = this.pageConfig.pageData;
this.pageConfig.pageData.page = 1;
this.pageConfig.pageData.size = 10;
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
let params = {
limitStart: (page - 1) * size,
limitSize: size,
...this.queryForm,
};
this.queryFindHsCodeList(params);
this.queryFindHsCodeList();
});
},
// 确认对话框
......@@ -278,12 +280,12 @@ export default {
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.searchBtn();
this.queryFindHsCodeList();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.searchBtn();
this.queryFindHsCodeList();
},
// table勾选
tableSelectionChange(val) {
......
......@@ -27,7 +27,7 @@ export const tableAttr = {
{
type: "primary",
icon: "el-icon-upload",
btnName: "增加",
btnName: "导入",
size: "mini",
round: false,
loading: false,
......
......@@ -149,7 +149,7 @@
maxlength="1000"
show-word-limit
:rows="4"
placeholder="请输入原航班号"
placeholder="原航班号之间用分号分隔,例:LP001;LP002"
@blur="blurEvent"
:disabled="!getRouter"
></el-input>
......@@ -170,7 +170,7 @@
<el-col :span="10" :offset="1">
<el-input
type="textarea"
v-model="serviceCode"
v-model="queryForm.includeServiceType"
size="medium"
maxlength="1000"
show-word-limit
......@@ -253,7 +253,6 @@
<el-col :span="10">
<el-input
v-model.trim="queryForm.minWeight"
clearable
placeholder="最小重量"
@blur="inputBlurMinWeight($event)"
:disabled="!getRouter"
......@@ -264,7 +263,6 @@
<el-col :span="10">
<el-input
v-model.trim="queryForm.maxWeight"
clearable
placeholder="最大重量"
@blur="inputBlurMaxWeight($event)"
:disabled="!getRouter"
......@@ -278,7 +276,6 @@
<el-col :span="10">
<el-input
v-model.trim="queryForm.minNumOfPieces"
clearable
placeholder="最少件数"
@blur="inputBlurMinPieces($event)"
:disabled="!getRouter"
......@@ -289,7 +286,6 @@
<el-col :span="10">
<el-input
v-model.trim="queryForm.maxNumOfPieces"
clearable
placeholder="最多件数"
@blur="inputBlurMaxPieces($event)"
:disabled="!getRouter"
......@@ -309,7 +305,6 @@
<el-col :span="10">
<el-input
v-model.trim="minCNYCustomVal"
clearable
placeholder="最小申报价值"
@blur="inputBlurMin($event, 'minCNYCustomVal')"
:disabled="!getRouter"
......@@ -323,7 +318,6 @@
<el-col :span="10">
<el-input
v-model.trim="maxCNYCustomVal"
clearable
placeholder="最大申报价值"
@blur="inputBlurMax($event, 'maxCNYCustomVal')"
:disabled="!getRouter"
......@@ -336,7 +330,6 @@
<el-col :span="10">
<el-input
v-model.trim="minSUDCustomVal"
clearable
placeholder="最小申报价值"
@blur="inputBlurMin($event, 'minSUDCustomVal')"
:disabled="!getRouter"
......@@ -350,7 +343,6 @@
<el-col :span="10">
<el-input
v-model.trim="maxSUDCustomVal"
clearable
placeholder="最大申报价值"
@blur="inputBlurMax($event, 'maxSUDCustomVal')"
:disabled="!getRouter"
......@@ -538,9 +530,9 @@ export default {
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;
} else {
data.list.fltRuleDto[key] = false;
}
}
// 将详情获取为null的字段设置为空字符串,目的是为了判断的时候少些为null的判断,保持空数据同一的判断条件;
......@@ -548,6 +540,11 @@ export default {
data.list.fltRuleDto[key] = "";
}
});
if(data.list.fltRuleDto.declarationCategory){
this.checkboxClassType = data.list.fltRuleDto.declarationCategory.split(';');
}else{
this.checkboxClassType = []
}
this.queryForm = data.list.fltRuleDto; // ET86配舱航班顺位维度
} else {
this.msgError(msg || "获取查看失败");
......@@ -743,11 +740,28 @@ export default {
flightRankDtoList: tableData, // ET86配舱航班顺位
fltRuleDto: this.queryForm,
};
parmas.fltRuleDto.multiHs = this.queryForm.multiHs ? "Y" : "N"; // N为单品名,Y为多品名
if (this.$route.query.name == "add") {
// 筛选重复的航班
let repeat = tableData.filter(
(item) =>
item.flightNo == tableData[this.currentIndex].flightNo &&
item.calculateDay == tableData[this.currentIndex].calculateDay &&
item.flightRoute == tableData[this.currentIndex].flightRoute
);
if (tableData.length > 100) {
this.msgError("最多添加100条,请删除后再添加");
return;
}
if (repeat.length > 1) {
this.msgError("ET86配舱航班顺位中存在重复设置");
return;
}
parmas.fltRuleDto.multiHs = this.queryForm.multiHs ? "N" : "Y"; // N为单品名,Y为多品名
if (this.validateForm && this.$route.query.name == "add") {
this.postAdd(parmas); // 新增
} else {
this.postUpdate(parmas); // 修改
if (this.validateForm) {
this.postUpdate(parmas); // 修改
}
}
} else {
console.log("error submit!!");
......
......@@ -5,8 +5,9 @@ export const formConfig = [
name: "originOfFlightNo",
prop: "originOfFlightNo",
placeholder: "请输入原航班号",
span: 6,
span: 5,
trigger: "blur",
labelWidth: "55px",
},
{
label: "修改时间 从",
......@@ -16,7 +17,7 @@ export const formConfig = [
placeholder: "请选择开始时间",
// rules: { required: true, message: "请选择开始时间", trigger: "blur" },
format: "yyyy-MM-dd",
colWidth: "25%",
colWidth: "23%",
inputWidth: "100%",
},
{
......@@ -27,7 +28,7 @@ export const formConfig = [
placeholder: "请选择结束时间",
// rules: { required: true, message: "请选择结束时间", trigger: "blur" },
format: "yyyy-MM-dd",
colWidth: "19%",
colWidth: "20%",
labelWidth: "20px",
inputWidth: "100%",
},
......@@ -42,7 +43,8 @@ export const formConfig = [
{
value: "1",
label: "有效",
}, {
},
{
value: "0",
label: "无效",
},
......@@ -50,7 +52,7 @@ export const formConfig = [
label: "有效",
value: "1",
},
colWidth: "20%",
colWidth: "18%",
labelWidth: "70px",
inputWidth: "100%",
},
......
......@@ -71,12 +71,27 @@ export default {
},
mounted() {
this.$nextTick(() => {
this.tableAttr.maxHeight = window.innerHeight - restTableHeight(this.$refs);
this.tableAttr.maxHeight =
window.innerHeight - restTableHeight(this.$refs);
});
},
methods: {
// ET86查询
queryFindAllEtesRules(params) {
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) => {
......@@ -101,34 +116,22 @@ export default {
},
// 搜索
searchBtn() {
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.pageConfig.pageData.page = 1;
this.pageConfig.pageData.size = 10;
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
this.queryFindAllEtesRules(params);
this.queryFindAllEtesRules();
});
},
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.searchBtn();
this.queryFindAllEtesRules();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.searchBtn();
this.queryFindAllEtesRules();
},
// 添加
addBtn(item) {
......@@ -167,7 +170,7 @@ export default {
},
// 删除
deleteRow({ row }) {
this.$confirm("是否确认删除", "提示", {
this.$confirm("是否确认删除? 删除后该规则设置为无效,不可恢复", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......
......@@ -50,19 +50,19 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [
label: "配载航班",
prop: "rankFltNoStr",
align: "center",
minWidth: 100,
minWidth: 120,
},
{
label: "航线",
prop: "rankFltRouteStr",
align: "center",
minWidth: 100,
minWidth: 140,
},
{
label: "状态",
prop: "status",
align: "center",
minWidth: 80,
minWidth: 50,
render: (h, params) => {
const { row } = params;
return h("div", `${state[row.status]}`);
......@@ -72,7 +72,7 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [
label: "修改时间",
prop: "updateTime",
align: "center",
minWidth: 120,
minWidth: 80,
// sortable: true,
// "sort-method": (a, b) => a.createTime - b.createTime,
},
......@@ -80,13 +80,13 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [
label: "修改人",
prop: "updateUserName",
align: "center",
minWidth: 80,
minWidth: 60,
},
{
label: "操作",
prop: "operate",
align: "center",
minWidth: 125,
minWidth: 90,
fixed: "right",
render: (h, params) => {
let operateData = []
......
......@@ -115,7 +115,7 @@ export default {
},
rules: {
skuName: [
{ required: true, message: "请输入商品名称", trigger: "blur" },
{ required: true, message: "请输入ShipmentDesc", trigger: "blur" },
],
},
pageConfig: {
......@@ -141,12 +141,19 @@ export default {
},
mounted() {
this.$nextTick(() => {
this.tableAttr.maxHeight = window.innerHeight - restTableHeight(this.$refs);
this.tableAttr.maxHeight =
window.innerHeight - restTableHeight(this.$refs);
});
},
methods: {
// HScode黑名单查询
queryFindHsCodeList(params) {
queryFindHsCodeList() {
const { page, size } = this.pageConfig.pageData;
let params = {
limitStart: (page - 1) * size,
limitSize: size,
...this.queryForm,
};
this.tableAttr.loadingTable = true;
findHsCodeList(params)
.then((res) => {
......@@ -205,14 +212,10 @@ export default {
},
// 搜索
searchBtn() {
const { page, size } = this.pageConfig.pageData;
this.pageConfig.pageData.page = 1;
this.pageConfig.pageData.size = 10;
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
let params = {
limitStart: (page - 1) * size,
limitSize: size,
...this.queryForm,
};
this.queryFindHsCodeList(params);
this.queryFindHsCodeList();
});
},
// 确认对话框
......@@ -277,12 +280,12 @@ export default {
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.searchBtn();
this.queryFindHsCodeList();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.searchBtn();
this.queryFindHsCodeList();
},
// table勾选
tableSelectionChange(val) {
......
......@@ -27,7 +27,7 @@ export const tableAttr = {
{
type: "primary",
icon: "el-icon-upload",
btnName: "增加",
btnName: "导入",
size: "mini",
round: false,
loading: false,
......