Elements-SY

Merge branch 'et86' into 2023-08-14

......@@ -17,7 +17,7 @@
</el-row>
<el-table
:max-height="attrs.maxHeight"
empty-text
:empty-text="emptyText"
v-bind="attrs"
v-loading="loadingTable"
:data="tableData"
......@@ -82,6 +82,10 @@ export default {
},
},
},
emptyText: {
type: String,
default: "暂无数据",
},
loadingTable: {
type: Boolean,
default: false,
......@@ -93,7 +97,6 @@ export default {
tableData: {
type: Array,
default: () => [],
required: true,
},
pageConfig: {
type: Object,
......@@ -127,8 +130,6 @@ export default {
}
},
mounted() {
this.getTrCurrentHeight();
window.addEventListener("resize", this.getTrCurrentHeight);
//阻止火狐拖拽新建新页面
document.body.addEventListener(
"drop",
......@@ -138,13 +139,19 @@ export default {
},
false
);
if (this.tableData.length) {
this.getTrCurrentHeight();
window.addEventListener("resize", this.getTrCurrentHeight);
// 拖拽行更新排序
// this.rowDrop();
// 拖拽列更新排序
this.columnDrop();
}
},
destroyed() {
if (this.tableData.length) {
window.removeEventListener("resize", this.getTrCurrentHeight);
}
},
methods: {
......
<template>
<div class="form-header demo-edit">
<el-row style="padding: 20px 0">
<el-col>
<el-divider content-position="left">ET86配舱航班顺位</el-divider>
</el-col>
</el-row>
<el-row :gutter="24" justify="center">
<el-col :span="18">
<yl-table
:emptyText="tableEmptyText"
:attrs="tableAttr"
:loadingTable="tableAttr.loadingTable"
:tableData="tableData"
:pageConfig="pageConfig"
@search="searchBtn"
@add="addBtn"
@delete="deleBtn"
>
<template #column>
<el-table-column
type="index"
label="序号"
width="50"
align="center"
></el-table-column>
<el-table-column
label="航班号"
prop="fltNo"
min-width="100"
......@@ -30,7 +40,7 @@
</template>
</el-table-column>
<el-table-column
label="航班日期"
label="加减天数"
prop="fltNoDate"
width="100"
align="center"
......@@ -50,27 +60,21 @@
</template>
</el-table-column>
<el-table-column
label="航线优先级"
label="航线"
prop="fltRoute"
min-width="100"
align="center"
>
<template slot-scope="scope">
<el-popover
placement="top-start"
:title="`${scope.row.fltNo} 航线`"
width="200"
trigger="hover"
:content="scope.row.fltRoute"
:disabled="scope.row.fltRoute | fltRoute"
<el-select v-model="scope.row.fltRoute" placeholder="请选择">
<el-option
v-for="item in scope.row.routeList"
:key="item.id"
:label="item.route"
:value="item.route"
>
<el-input
slot="reference"
v-model="scope.row.fltRoute"
:readonly="scope.row.edit | isEdit"
placeholder="请选择航线优先级"
/>
</el-popover>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
......@@ -83,6 +87,7 @@
<el-checkbox
v-model="scope.row.isOn"
:disabled="scope.row.edit | isEdit"
@change="changeCheck(scope)"
></el-checkbox>
</template>
</el-table-column>
......@@ -115,8 +120,21 @@
class="config-form"
>
<el-row class="rowPadding">
<el-col :span="12">
<el-form-item label="原航班号">
<el-input
type="textarea"
v-model="queryForm.fltNo"
size="medium"
maxlength="1000"
show-word-limit
:rows="4"
placeholder="请输入原航班号"
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="服务类型">
<el-form-item label="服务种类">
<!-- <div class="label-title label-service-type">服务类型</div> -->
<el-col :span="4">
<el-radio-group
......@@ -143,8 +161,66 @@
</el-col>
<el-col :span="24">
<el-col :span="9">
<el-form-item label="重量(KG)">
<el-col :span="12">
<el-form-item label="URSA包含">
<el-input
type="textarea"
v-model="queryForm.includeUrsa"
size="medium"
maxlength="1000"
show-word-limit
:rows="4"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="URSA不包含">
<el-input
type="textarea"
v-model="queryForm.notIncludeUrsa"
size="medium"
maxlength="1000"
show-word-limit
:rows="4"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"
></el-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="申报类别">
<el-card shadow="never">
<el-checkbox-group
v-model="queryForm.checkboxClsssType"
@change="checkboxSingleName"
style="display: flex"
v-if="queryForm.cargoType.length"
>
<el-checkbox
v-for="item in queryForm.cargoType"
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
>
<Tooltips :content="item.chineseName" :refName="item.code">
</Tooltips>
</el-checkbox>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="3">
<el-form-item label="单品名">
<el-checkbox v-model="queryForm.singleName"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="" class="custom-label">
<span class="custom-label-title">重量(KG)</span>
<el-col :span="10">
<el-input
v-model.trim="queryForm.minWeight"
......@@ -167,8 +243,8 @@
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="件数">
<el-col :span="8">
<el-form-item label="件数" class="custom-label-pieces">
<el-col :span="10">
<el-input
v-model.trim="queryForm.minNumOfPieces"
......@@ -191,115 +267,71 @@
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="单品名">
<el-checkbox v-model="queryForm.singleName"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="包含URSA">
<el-input
type="textarea"
v-model="queryForm.includeUrsa"
size="medium"
maxlength="1000"
show-word-limit
:rows="4"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"
></el-input>
</el-form-item>
<el-col :span="3">
<el-form-item label="申报价值"></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="包含URSA">
<el-col :span="8">
<el-form-item label="" class="custom-label">
<span class="custom-label-title">人民币</span>
<el-col :span="10">
<el-input
type="textarea"
v-model="queryForm.notIncludeUrsa"
size="medium"
maxlength="1000"
show-word-limit
:rows="4"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"
v-model.trim="queryForm.minCNYCustomVal"
clearable
placeholder="最小申报价值"
@blur="inputBlur('minCNYCustomVal')"
></el-input>
</el-form-item>
<span
ref="minCNYCustomVal"
class="el-form-item__error"
></span>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="原航班号">
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input
type="textarea"
v-model="queryForm.fltNo"
size="medium"
maxlength="1000"
show-word-limit
:rows="4"
placeholder="请输入原航班号"
v-model.trim="queryForm.maxCNYCustomVal"
clearable
placeholder="最大申报价值"
@blur="inputBlur('maxCNYCustomVal')"
></el-input>
</el-form-item>
<span
ref="maxCNYCustomVal"
class="el-form-item__error"
></span>
</el-col>
<el-col :span="24">
<el-form-item label="类别Class">
<el-card shadow="never">
<el-checkbox-group
v-model="queryForm.checkboxClsssType"
@change="checkboxSingleName"
style="display: flex"
v-if="queryForm.cargoType.length"
>
<el-checkbox
v-for="item in queryForm.cargoType"
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
>
<Tooltips :content="item.chineseName" :refName="item.code">
</Tooltips>
</el-checkbox>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="申报价值">
<el-col :span="4">
<el-select
v-model="queryForm.customVal"
@change="selectChange"
placeholder="请选择"
>
<el-option
v-for="item in queryForm.customValOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
<el-col :span="4" :offset="1">
<el-col :span="8">
<el-form-item label="美元" class="custom-label-pieces">
<el-col :span="10">
<el-input
v-model.trim="queryForm.minCustomVal"
v-model.trim="queryForm.minSUDCustomVal"
clearable
placeholder="最小申报价值"
@blur="inputBlur('minCustomVal')"
@blur="inputBlur('minSUDCustomVal')"
></el-input>
<span ref="minCustomVal" class="el-form-item__error"></span>
<span
ref="minSUDCustomVal"
class="el-form-item__error"
></span>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="4">
<el-col :span="10">
<el-input
v-model.trim="queryForm.maxCustomVal"
v-model.trim="queryForm.maxSUDCustomVal"
clearable
placeholder="最大申报价值"
@blur="inputBlur('maxCustomVal')"
@blur="inputBlur('maxSUDCustomVal')"
></el-input>
<span ref="maxCustomVal" class="el-form-item__error"></span>
<span
ref="maxSUDCustomVal"
class="el-form-item__error"
></span>
</el-col>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="">
<el-button type="primary" @click="submitForm('ruleForm')"
......@@ -315,72 +347,57 @@
<script>
import YlForm from "@/components/YlForm";
// import YlInput from "@/components/YlInput";
import YlTable from "@/components/YlTable";
import { formConfig } from "./formConfig";
import { debounce } from "@/utils";
import { tableAttr, columnHeader, tableData } from "./tableConfig";
import { tableAttr } from "./tableConfig";
import {
allDictData, // 获取全部字典
queryRouteByFltNo, // 航线查询
findDestinationFltRuleByFlightNo, // 获取航班下航线维度
} from "@/api/destinationFlight";
import { validateRules } from "./mixins";
import indexMixins from "./mixins";
export default {
name: "edit",
components: {
YlForm,
YlTable,
// YlInput,
},
mixins: [validateRules],
mixins: [indexMixins],
data() {
return {
test: "测试",
formConfig: formConfig, // 表单配置项
queryForm: {
// 表单参数
fltNo: "", // 原航班号
isServiceCode: "1", // 服务种类
serviceCode: "",
singleName: false, // 单品名
minWeight: null,
maxWeight: null,
minNumOfPieces: null,
maxNumOfPieces: null,
isServiceCode: "1",
serviceCode: "",
serviceCodeData: [],
singleName: false,
includeUrsa: "",
notIncludeUrsa: "",
fltNo: "",
checkboxClsssType: [],
cargoType: [],
cargoStatus: [],
puporpux: [],
handlingCode: [],
subCategory: [],
customVal: "人民币",
minCustomVal: "",
maxCustomVal: "",
customValOptions: [
{
value: "USD",
label: "美元",
},
{
value: "CNY",
label: "人民币",
},
],
includeUrsa: "", // URSA包含
notIncludeUrsa: "", // URSA不包含
checkboxClsssType: [], // 申报类别
minCNYCustomVal: "", //
maxCNYCustomVal: "", //
minSUDCustomVal: "", //
maxSUDCustomVal: "", //
serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode
cargoType: [], // 申报类别
},
pageConfig: {
// 分页配置项
isPagination: false,
},
tableAttr: tableAttr, // table配置项
tableEmptyText: "请添加配舱航班",
tableData: [],
currentIndex: 0, // 记录当前table 列的索引位置
};
},
computed: {},
created() {
this.getAllDictData();
......@@ -410,126 +427,9 @@ export default {
}
},
},
directives: {
focus: {
// 绑定判断
inserted: function (el, binding, vnode) {
console.log(el.children[0].value);
console.log(binding);
console.log(vnode);
},
},
},
methods: {
// input失焦事件
inputBlur(name) {
if (name == "minWeight") {
this.validateMaxWeight("maxWeight");
this.validateMinWeight(name);
}
if (name == "maxWeight") {
this.validateMinWeight("minWeight");
this.validateMaxWeight(name);
}
if (name == "minNumOfPieces") {
this.validateMaxPieces("maxNumOfPieces");
this.validateMinPieces(name);
}
if (name == "maxNumOfPieces") {
this.validateMinPieces("minNumOfPieces");
this.validateMaxPieces(name);
}
if (name == "minCustomVal") {
this.validateMaxCustomVal("maxCustomVal");
this.validateMinCustomVal(name);
}
if (name == "maxCustomVal") {
this.validateMinCustomVal("minCustomVal");
this.validateMaxCustomVal(name);
}
},
// 获取编辑详情数据
getEdit() {
tableData.map((item) => {
if (item.isOn == "0") {
item.isOn = false;
} else {
item.isOn = true;
}
});
this.tableData = tableData;
},
// 获取字典
getObj({ serviceCode }) {
let service_Code = [];
serviceCode.map((item) => {
service_Code.push(item.chineseName);
});
this.serviceCodeData = service_Code;
},
// 处理serviceCode包不包含
serviceCodeCofig() {
let str = this.queryForm.serviceCode.replace(/;|;/g, ",");
let arr = str.split(",");
if (arr[arr.length - 1] == "") {
arr.splice(arr.length - 1, 1);
}
let noHasCode = this.serviceCodeData.filter(
(v) => !arr.some((val) => val == v)
);
let hasCode = this.serviceCodeData.filter((v) =>
arr.some((val) => val == v)
);
let includeCode = arr.filter((v) => !hasCode.some((val) => val == v));
return {
include: hasCode,
noInclude: includeCode,
};
},
// radio包含不包含serviceCode
isServiceCode(val) {
// 包含
// 勾选的时候去校验 || 输入的时候去校验
if (val == 1) {
if (this.serviceCodeCofig().noInclude.length) {
let tip = this.serviceCodeCofig().noInclude.toString();
this.msgError(`${tip} 不包含`);
}
} else {
if (this.serviceCodeCofig().include.length) {
let tip = this.serviceCodeCofig().include.toString();
this.msgError(`${tip} 已包含`);
}
}
},
// serviceCode失焦事件
serviceCodeBlur() {
if (this.queryForm.isServiceCode == "1") {
if (this.serviceCodeCofig().noInclude.length) {
let tip = this.serviceCodeCofig().noInclude.toString();
this.msgError(`${tip} 不包含`);
}
} else {
if (this.serviceCodeCofig().include.length) {
let tip = this.serviceCodeCofig().include.toString();
this.msgError(`${tip} 已包含`);
}
}
},
// 表单提交
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
getEdit() {},
// 获取所有数据字典
getAllDictData() {
allDictData().then((res) => {
......@@ -537,8 +437,7 @@ export default {
this.msgError(res.msg);
return;
}
this.queryForm.cargoType = res.data.cargoType; //
this.queryForm.cargoStatus = res.data.cargoStatus; //
this.queryForm.cargoType = res.data.cargoType; // 申报类别
if (res.data.serviceCode.length) {
this.getObj(res.data);
}
......@@ -546,27 +445,22 @@ export default {
},
// 航线查询
getQueryRouteByFltNo(item) {
this.tableAttr.loadingTable = true;
queryRouteByFltNo(item).then((res) => {
this.tableAttr.loadingTable = false;
if (res.code == 200) {
const list = res.data.list;
let routeList = "";
let routeList = [];
if (list.length) {
list.map((item) => {
routeList += item.route + ",";
routeList.push(item);
});
this.tableData[this.currentIndex].fltRoute = routeList.substring(
0,
routeList.length - 1
);
this.queryForm.fltRoute = routeList.substring(
0,
routeList.length - 1
);
this.tableData[this.currentIndex].fltRoute = "";
this.tableData[this.currentIndex].routeList = routeList;
} else {
this.queryForm = {
fltNo: item.fltNo, // 航班号
fltRoute: "", // 航线
};
this.msgError("暂无航线");
this.tableData[this.currentIndex].routeList = [];
this.tableData[this.currentIndex].fltRoute = "";
}
}
});
......@@ -590,23 +484,11 @@ export default {
if (params.fltNo) {
this.getQueryRouteByFltNo(params);
} else {
this.tableData[this.currentIndex].fltRoute = "";
this.tableData[this.currentIndex].routeList = [];
this.msgError("请输入航班号");
}
console.log(this.tableData[this.currentIndex]);
}, 800),
// 申报价值selectChange
selectChange(val) {
if (this.queryForm.minCustomVal && this.queryForm.maxCustomVal) {
this.validateMaxCustomVal("maxCustomVal");
}
},
// 搜索
searchBtn(row) {
// this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
// console.log(val);
// });
console.log(this.tableData);
},
// 添加
addBtn(item) {
console.log("add:", item);
......@@ -614,10 +496,19 @@ export default {
fltNo: "",
fltNoDate: "",
fltRoute: "",
isOn: "0",
routeList: [],
isOn: "0" ? false : true,
sort: "0", // 排序字段
});
},
// 是否爆仓
changeCheck({ $index, row }) {
this.tableData.map((item, i) => {
if ($index !== i) {
item.isOn = false;
}
});
},
// 删除
deleBtn(item, $index) {
this.tableData.splice($index, 1);
......@@ -626,6 +517,41 @@ export default {
checkboxSingleName(val) {
console.log(val);
},
// input失焦事件
inputBlur(name) {
if (name == "minWeight") {
this.validateMaxWeight("maxWeight");
this.validateMinWeight(name);
}
if (name == "maxWeight") {
this.validateMinWeight("minWeight");
this.validateMaxWeight(name);
}
if (name == "minNumOfPieces") {
this.validateMaxPieces("maxNumOfPieces");
this.validateMinPieces(name);
}
if (name == "maxNumOfPieces") {
this.validateMinPieces("minNumOfPieces");
this.validateMaxPieces(name);
}
if (name == "minCNYCustomVal" || name == "minSUDCustomVal") {
let coin = {
minCNYCustomVal: "CNY",
minSUDCustomVal: "USD",
};
this.validateMaxCustomVal(coin[name]);
this.validateMinCustomVal(coin[name]);
}
if (name == "maxCNYCustomVal" || name == "maxSUDCustomVal") {
let coin = {
maxCNYCustomVal: "CNY",
maxSUDCustomVal: "USD",
};
this.validateMinCustomVal(coin[name]);
this.validateMaxCustomVal(coin[name]);
}
},
// 表单提交
submitForm(formName) {
this.$refs[formName].validate((valid) => {
......@@ -650,4 +576,40 @@ export default {
color: #606266;
font-weight: 700;
}
::v-deep .custom-label {
.el-form-item__content{
display: flex;
margin-left: 0 !important;
span{
font-size: 14px;
color: #606266;
font-weight: 700;
float: right;
margin-right: 10px;
text-align: end;
}
.custom-label-title{
width: 120px;
}
.el-input__suffix{
right: -15px !important;
}
.el-form-item__error{
color: #ff4949;
font-size: 12px;
line-height: 1;
padding-top: 4px;
position: absolute;
top: 100%;
left: 0;
font-weight: 500;
width: 100% !important;
}
}
}
::v-deep .custom-label-pieces {
.el-form-item__content{
width: 80%;
}
}
</style>
......
export const validateRules = {
export default {
methods: {
// 获取字典
getObj({ serviceCode }) {
let service_Code = [];
serviceCode.map((item) => {
service_Code.push(item.chineseName);
});
this.serviceCodeData = service_Code;
},
// 处理serviceCode包不包含
serviceCodeCofig() {
let str = this.queryForm.serviceCode.replace(/;|;/g, ",");
let arr = str.split(",");
if (arr[arr.length - 1] == "") {
arr.splice(arr.length - 1, 1);
}
let noHasCode = this.serviceCodeData.filter(
(v) => !arr.some((val) => val == v)
);
let hasCode = this.serviceCodeData.filter((v) =>
arr.some((val) => val == v)
);
let includeCode = arr.filter((v) => !hasCode.some((val) => val == v));
return {
include: hasCode,
noInclude: includeCode,
};
},
// radio包含不包含serviceCode
isServiceCode(val) {
// 包含
// 勾选的时候去校验 || 输入的时候去校验
if (val == 1) {
if (this.serviceCodeCofig().noInclude.length) {
let tip = this.serviceCodeCofig().noInclude.toString();
this.msgError(`${tip} 不包含`);
}
} else {
if (this.serviceCodeCofig().include.length) {
let tip = this.serviceCodeCofig().include.toString();
this.msgError(`${tip} 已包含`);
}
}
},
// serviceCode失焦事件
serviceCodeBlur() {
if (this.queryForm.isServiceCode == "1") {
if (this.serviceCodeCofig().noInclude.length) {
let tip = this.serviceCodeCofig().noInclude.toString();
this.msgError(`${tip} 不包含`);
}
} else {
if (this.serviceCodeCofig().include.length) {
let tip = this.serviceCodeCofig().include.toString();
this.msgError(`${tip} 已包含`);
}
}
},
// 最小重量
validateMinWeight(name) {
if (/^(0|[1-9]\d*)(.\d{1,3})?$/.test(Number(this.queryForm[name]))) {
// 最小重量大于0小于100,并且最小重量小于最大重量
if (
Number(this.queryForm[name]) >= 0 &&
Number(this.queryForm[name]) < 100 &&
Number(this.queryForm[name]) < Number(this.queryForm.maxWeight)
) {
if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm[name]))) {
// 最小重量大于0~34,并且最小重量不得大于最大重量
if (this.queryForm[name] && this.queryForm.maxWeight) {
if (Number(this.queryForm[name]) > Number(this.queryForm.maxWeight)) {
this.$refs.minWeight.innerHTML = "";
return true;
this.$refs.minWeight.innerHTML =
"最小重量大于0~34,并且最小重量不得大于最大重量";
return false;
} else {
this.$refs.maxWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "";
}
if (Number(this.queryForm[name]) > 34) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最大重量34KG";
return false;
}
} else if (Number(this.queryForm[name]) < 0) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML =
"最小重量大于0~34,并且最小重量不得大于最大重量";
return false;
} else if (Number(this.queryForm[name]) > 34) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML =
"最小重量大于0小于100,并且最小重量小于最大重量";
"最小重量大于0~34,并且最小重量不得大于最大重量";
return false;
} else {
this.$refs.minWeight.innerHTML = "";
}
} else {
this.$refs.maxWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "请输入正整数,小数保留3位";
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位";
return false;
}
},
......@@ -27,44 +99,75 @@ export const validateRules = {
validateMaxWeight(name) {
// 最大重量
if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm[name]))) {
// 最大重量大于0小于100,并且最大重量大于最小重量
if (
Number(this.queryForm[name]) >= 0 &&
Number(this.queryForm[name]) < 100 &&
Number(this.queryForm[name]) > Number(this.queryForm.minWeight)
) {
this.$refs.maxWeight.innerHTML = "";
return true;
// 最大重量大于0~34,并且最大重量不得小于最小重量
if (this.queryForm[name] && this.queryForm.minWeight) {
if (Number(this.queryForm[name]) < Number(this.queryForm.minWeight)) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML =
"最大重量大于0~34,并且最大重量不得小于最小重量";
return false;
} else {
this.$refs.minWeight.innerHTML = "";
this.$refs.maxWeight.innerHTML =
"最大重量大于0小于100,并且最大重量大于最小重量";
}
if (Number(this.queryForm[name]) > 34) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML = "最大重量34KG";
return false;
}
} else if (Number(this.queryForm[name]) < 0) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML =
"最大重量大于0~34,并且最大重量不得小于最小重量";
return false;
} else if (Number(this.queryForm[name]) > 34) {
this.$refs.minWeight.innerHTML = "";
this.$refs.minWeight.innerHTML =
"最大重量大于0~34,并且最大重量不得小于最小重量";
return false;
} else {
this.$refs.minWeight.innerHTML = "";
}
} else {
this.$refs.minWeight.innerHTML = "";
this.$refs.maxWeight.innerHTML = "请输入正整数,小数保留3位";
this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位";
return false;
}
},
// 最少件数
validateMinPieces(name) {
if (/^\d+$/.test(Number(this.queryForm[name]))) {
if (this.queryForm[name] && this.queryForm.maxNumOfPieces) {
if (
Number(this.queryForm[name]) >= 0 &&
Number(this.queryForm[name]) < 100 &&
Number(this.queryForm[name]) < Number(this.queryForm.maxNumOfPieces)
Number(this.queryForm[name]) > Number(this.queryForm.maxNumOfPieces)
) {
// 最少件数 大于0小于100并且最少件数小于最多件数
// 最少件数1~100,并且最少件数不得大于最多件数
this.$refs.minNumOfPieces.innerHTML = "";
return true;
this.$refs.minNumOfPieces.innerHTML =
"最少件数1~100,并且最少件数不得大于最多件数";
return false;
} else {
this.$refs.maxNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "";
}
if (Number(this.queryForm[name]) > 100) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "件数范围1~100";
return false;
}
} else if (Number(this.queryForm[name]) < 1) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML =
"最少件数 大于0小于100并且最少件数小于最多件数";
"最少件数1~100,并且最少件数不得大于最多件数";
return false;
} else if (Number(this.queryForm[name]) > 100) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML =
"最少件数1~100,并且最少件数不得大于最多件数";
return false;
} else {
this.$refs.minNumOfPieces.innerHTML = "";
}
} else {
this.$refs.maxNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "请输入有效件数";
return false;
}
......@@ -72,18 +175,35 @@ export const validateRules = {
// 最多件数
validateMaxPieces(name) {
if (/^\d+$/.test(Number(this.queryForm[name]))) {
if (this.queryForm[name] && this.queryForm.maxNumOfPieces) {
if (
Number(this.queryForm[name]) >= 0 &&
Number(this.queryForm[name]) < 100 &&
Number(this.queryForm[name]) > Number(this.queryForm.minNumOfPieces)
Number(this.queryForm[name]) < Number(this.queryForm.minNumOfPieces)
) {
// 最少件数 大于0小于100并且最少件数小于最多件数
this.$refs.maxNumOfPieces.innerHTML = "";
return true;
// 最多件数1~100,并且最多件数不得小于最小件数
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML =
"最多件数1~100,并且最多件数不得小于最小件数";
return false;
} else {
this.$refs.minNumOfPieces.innerHTML = "";
}
if (Number(this.queryForm[name]) > 100) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML = "件数范围1~100";
return false;
}
} else if (Number(this.queryForm[name]) < 1) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML =
"最多件数1~100,并且最多件数不得小于最小件数";
return false;
} else if (Number(this.queryForm[name]) > 100) {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.minNumOfPieces.innerHTML =
"最多件数1~100,并且最多件数不得小于最小件数";
return false;
} else {
this.$refs.minNumOfPieces.innerHTML = "";
this.$refs.maxNumOfPieces.innerHTML =
"最多件数 大于0小于100并且最少件数小于最多件数";
}
} else {
this.$refs.minNumOfPieces.innerHTML = "";
......@@ -95,88 +215,166 @@ export const validateRules = {
// 最小申报价值
validateMinCustomVal(name) {
// 申报价值
if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm[name]))) {
if (
this.queryForm.customVal == "USD" ||
this.queryForm.customVal == "美元"
/^(0|[1-9]\d*)(.\d{1,2})?$/.test(
Number(
this.queryForm.minCNYCustomVal || this.queryForm.minSUDCustomVal
)
)
) {
if (name == "USD" || name == "美元") {
// 申报价值(美元)0~600
if (
Number(this.queryForm[name]) >= 0 &&
Number(this.queryForm[name]) < 600 &&
Number(this.queryForm[name]) < Number(this.queryForm.maxCustomVal)
this.queryForm.minSUDCustomVal &&
this.queryForm.maxSUDCustomVal
) {
// 最小申报价值大于0小于600,并且最小申报价值小于最大申报价值
this.$refs.minCustomVal.innerHTML = "";
return true;
if (
Number(this.queryForm.minSUDCustomVal) >
Number(this.queryForm.maxSUDCustomVal)
) {
this.$refs.minSUDCustomVal.innerHTML =
"最小申报价值不得大于最大申报价值";
return false;
} else {
this.$refs.maxCustomVal.innerHTML = "";
this.$refs.minCustomVal.innerHTML = `申报价值(美元)0~600`;
this.$refs.minSUDCustomVal.innerHTML = "";
}
if (Number(this.queryForm.minSUDCustomVal) > 600) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600";
return false;
}
} else if (Number(this.queryForm.minSUDCustomVal) < 0) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "申报价值(美元)0~600";
return false;
} else if (Number(this.queryForm.minSUDCustomVal) > 600) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600";
return false;
} else {
this.$refs.minSUDCustomVal.innerHTML = "";
return true;
}
} else {
// 申报价值(人民币)0~2000
if (
Number(this.queryForm[name]) >= 0 &&
Number(this.queryForm[name]) < 2000 &&
Number(this.queryForm[name]) < Number(this.queryForm.maxCustomVal)
this.queryForm.minCNYCustomVal &&
this.queryForm.maxCNYCustomVal
) {
// 最大申报价值大于0小于2000,并且最大申报价值大于最小申报价值
this.$refs.minCustomVal.innerHTML = "";
return true;
if (
Number(this.queryForm.minCNYCustomVal) >
Number(this.queryForm.maxCNYCustomVal)
) {
this.$refs.minCNYCustomVal.innerHTML =
"最小申报价值不得大于最大申报价值";
return false;
} else {
this.$refs.maxCustomVal.innerHTML = "";
this.$refs.minCustomVal.innerHTML = `申报价值(人民币)0~2000`;
this.$refs.minCNYCustomVal.innerHTML = "";
}
if (Number(this.queryForm.minCNYCustomVal) > 2000) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "最大申报值不得大于2000";
return false;
}
} else if (Number(this.queryForm.minCNYCustomVal) < 0) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "申报价值(人民币)0~2000";
return false;
} else if (Number(this.queryForm.minCNYCustomVal) > 2000) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "最大申报值不得大于2000";
return false;
} else {
this.$refs.minCNYCustomVal.innerHTML = "";
return true;
}
}
} else {
this.$refs.maxCustomVal.innerHTML = "";
this.$refs.minCustomVal.innerHTML = "请输入正确申报价值";
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "请输入正确申报价值";
return false;
}
},
// 最大申报价值
validateMaxCustomVal(name) {
// 申报价值
if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm[name]))) {
if (
this.queryForm.customVal == "USD" ||
this.queryForm.customVal == "美元"
/^(0|[1-9]\d*)(.\d{1,2})?$/.test(
Number(
this.queryForm.maxCNYCustomVal || this.queryForm.maxSUDCustomVal
)
)
) {
if (name == "USD" || name == "美元") {
// 申报价值(美元)0~600
if (
Number(this.queryForm[name]) >= 0 &&
Number(this.queryForm[name]) < 600 &&
Number(this.queryForm[name]) > Number(this.queryForm.minCustomVal)
this.queryForm.minSUDCustomVal &&
this.queryForm.maxSUDCustomVal
) {
// 最小申报价值大于0小于600,并且最小申报价值小于最大申报价值
this.$refs.maxCustomVal.innerHTML = "";
return true;
if (
Number(this.queryForm.minSUDCustomVal) >
Number(this.queryForm.maxSUDCustomVal)
) {
this.$refs.minSUDCustomVal.innerHTML =
"最小申报价值不得大于最大申报价值";
return false;
} else {
this.$refs.minCustomVal.innerHTML = "";
this.$refs.maxCustomVal.innerHTML = `申报价值(美元)0~600`;
this.$refs.minSUDCustomVal.innerHTML = "";
}
if (Number(this.queryForm.maxCNYCustomVal) > 600) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600";
return false;
}
} else if (Number(this.queryForm.maxCNYCustomVal) < 0) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "申报价值(美元)0~600";
return false;
} else if (Number(this.queryForm.maxCNYCustomVal) > 600) {
this.$refs.minSUDCustomVal.innerHTML = "";
this.$refs.minSUDCustomVal.innerHTML = "最大申报值不得大于600";
return false;
} else {
this.$refs.minSUDCustomVal.innerHTML = "";
return true;
}
} else {
// 申报价值(人民币)0~2000
if (
Number(this.queryForm[name]) >= 0 &&
Number(this.queryForm[name]) < 2000 &&
Number(this.queryForm[name]) > Number(this.queryForm.minCustomVal)
this.queryForm.minCNYCustomVal &&
this.queryForm.maxCNYCustomVal
) {
// 最大申报价值大于0小于2000,并且最大申报价值大于最小申报价值
this.$refs.maxCustomVal.innerHTML = "";
return true;
if (
Number(this.queryForm.minCNYCustomVal) >
Number(this.queryForm.maxCNYCustomVal)
) {
this.$refs.minCNYCustomVal.innerHTML =
"最小申报价值不得大于最大申报价值";
return false;
} else {
this.$refs.minCustomVal.innerHTML = "";
this.$refs.maxCustomVal.innerHTML = `申报价值(人民币)0~2000`;
this.$refs.minCNYCustomVal.innerHTML = "";
}
if (Number(this.queryForm.maxCNYCustomVal) > 2000) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "最大申报值不得大于2000";
return false;
}
} else if (Number(this.queryForm.maxCNYCustomVal) < 0) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "申报价值(人民币)0~2000";
return false;
} else if (Number(this.queryForm.maxCNYCustomVal) > 2000) {
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.minCNYCustomVal.innerHTML = "最大申报值不得大于2000";
return false;
} else {
this.$refs.minCNYCustomVal.innerHTML = "";
return true;
}
}
} else {
this.$refs.minCustomVal.innerHTML = "";
this.$refs.maxCustomVal.innerHTML = "请输入正确申报价值";
this.$refs.minCNYCustomVal.innerHTML = "";
this.$refs.maxCNYCustomVal.innerHTML = "请输入正确申报价值";
return false;
}
},
......
......@@ -6,15 +6,6 @@ export const tableAttr = {
btnCofig: {
isBtn: true,
btnGroup: [
// {
// type: "primary", // text、primary、danger
// icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
// btnName: "搜索",
// size: "mini", // medium / small / mini
// round: false,
// loading: false,
// event: "search",
// },
{
type: "primary",
icon: "el-icon-plus",
......@@ -24,15 +15,6 @@ export const tableAttr = {
loading: false,
event: "add",
},
// {
// type: "danger",
// icon: "el-icon-delete",
// btnName: "删除",
// size: "mini",
// round: false,
// loading: false,
// event: "delete",
// },
],
},
};
......@@ -104,7 +86,8 @@ export const tableData = [
id: "1",
fltNo: "A380",
fltNoDate: "3",
fltRoute: "CAN",
fltRoute: "",
routeList: [],
isOn: "1",
sort: "1", // 排序字段
},
......
......@@ -27,15 +27,11 @@ export const formConfig = [
data: [
{
value: "1",
label: "新增",
},
{
value: "2",
label: "修改",
label: "有效",
},
{
value: "3",
label: "删除",
label: "无效",
},
],
label: "",
......
......@@ -22,8 +22,6 @@
@search="searchBtn"
@restForm="restForm"
@add="addBtn"
@upload="uploadBtn"
@download="downloadBtn"
>
</yl-table>
</div>
......@@ -134,14 +132,6 @@ export default {
},
});
},
// 上传
uploadBtn(item) {
console.log("upload:", item);
},
// 导出
downloadBtn(item) {
console.log("download:", item);
},
// 编辑
editRow(item) {
this.$router.push({
......
const state = {
1: "新增",
2: "修改",
3: "删除",
1: "有效",
3: "无效",
};
export const tableAttr = {
border: true,
......@@ -38,28 +37,10 @@ export const tableAttr = {
loading: false,
event: "add",
},
{
type: "primary",
icon: "el-icon-upload",
btnName: "上传",
size: "mini",
round: false,
loading: false,
event: "upload",
},
{
type: "primary",
icon: "el-icon-download",
btnName: "导出",
size: "mini",
round: false,
loading: false,
event: "download",
},
],
},
};
export const columnHeader = (editRow, deleteRow, viewRow) => [
export const columnHeader = (viewRow, editRow, deleteRow) => [
{
type: "selection",
align: "center",
......@@ -74,12 +55,30 @@ export const columnHeader = (editRow, deleteRow, viewRow) => [
width: "50",
},
{
label: "原航班号",
prop: "fltNo",
align: "center",
minWidth: 100,
},
{
label: "顺位航班",
prop: "flightRand",
align: "center",
minWidth: 100,
},
{
label: "URSA包含",
prop: "includeUrsa",
align: "center",
minWidth: 100,
},
{
label: "URSA不包含",
prop: "notIncludeUrsa",
align: "center",
minWidth: 100,
},
{
label: "状态",
prop: "status",
align: "center",
......@@ -98,14 +97,14 @@ export const columnHeader = (editRow, deleteRow, viewRow) => [
"sort-method": (a, b) => b.createTime - a.createTime,
},
{
label: "修改时间",
prop: "updateTime",
label: "创建人",
prop: "createUserName",
align: "center",
minWidth: 100,
},
{
label: "创建人",
prop: "createUserName",
label: "修改时间",
prop: "updateTime",
align: "center",
minWidth: 100,
},
......@@ -129,50 +128,50 @@ export const columnHeader = (editRow, deleteRow, viewRow) => [
props: {
type: "text",
size: "mini",
icon: "el-icon-edit",
icon: "el-icon-view",
},
on: {
click() {
editRow(params);
viewRow(params);
},
},
},
"修改"
"查看"
),
h(
"el-button",
{
style: {
color: "#ff4949",
},
props: {
type: "text",
size: "mini",
icon: "el-icon-delete",
icon: "el-icon-edit",
},
on: {
click() {
deleteRow(params);
editRow(params);
},
},
},
"删除"
"修改"
),
h(
"el-button",
{
style: {
color: "#ff4949",
},
props: {
type: "text",
size: "mini",
icon: "el-icon-view",
icon: "el-icon-delete",
},
on: {
click() {
viewRow(params);
deleteRow(params);
},
},
},
"查看"
"删除"
),
]);
},
......@@ -184,81 +183,108 @@ export const tableData = [
id: "1",
flightRand: "LZ003;LZ00",
status: "1",
createTime: "2023-08-11",
updateTime: "2023-08-11",
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",
createTime: "2023-08-11",
updateTime: "2023-08-11",
fltNo: "FX0090",
includeUrsa: "P_;URSACODE105",
notIncludeUrsa: "P_21",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "3",
flightRand: "LZ002;LZ003;LZ001",
flightRand: "CQ00;LZ003;CS0004",
status: "1",
createTime: "2023-08-10",
updateTime: "2023-08-10",
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: "2",
status: "1",
fltNo: "FX0090",
includeUrsa: "URSACODE192",
notIncludeUrsa: "P_17",
createTime: "2023-08-11",
updateTime: "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",
updateTime: "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",
updateTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "7",
flightRand: "FX0092;FX0095;FX0094;FX0090",
flightRand: "XN001;XN002;XN003;XN004",
status: "1",
fltNo: "XN001",
includeUrsa: "URSACODE34",
notIncludeUrsa: "P_7",
createTime: "2023-08-10",
updateTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
{
id: "8",
flightRand: "AB060;AC005;AC204",
status: "2",
flightRand: "HA004",
status: "3",
fltNo: "LZ007",
includeUrsa: "URSACODE71",
notIncludeUrsa: "P_2",
createTime: "2023-08-10",
updateTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
{
id: "9",
flightRand: "FX0090;FX0092",
flightRand: "AB0001;AB123",
status: "1",
fltNo: "AB0001",
includeUrsa: "URSACODE87",
notIncludeUrsa: "P_26",
createTime: "2023-08-10",
updateTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
];
......