指标区间添加两个单位输入框

master
yujialong 8 months ago
parent 96320065ac
commit aa26695fd2
  1. 16
      public/index.html
  2. 99
      src/views/Transaction.vue
  3. 3
      vue.config.js

@ -1,15 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title>判分点管理系统</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
properly without JavaScript enabled. Please enable it to
continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->

@ -94,7 +94,7 @@
<div class="business">
<div class="label">{{isSt ? '关卡' : '业务'}}</div>
<el-select v-model="formData.lcJudgmentPoint.business"
placeholder="请选择业务">
:placeholder="'请选择' + (isSt ? '关卡' : '业务')">
<el-option v-for="(item, i) in businessList"
:key="i"
:label="item.name"
@ -298,36 +298,22 @@
</template>
<template v-if="scope.row.type == 5">
<div class="box">
<div class="box"
style="padding: 0;">
<div class="line">
<!--
<span class="label">选择指标</span>
<div class="action">
<el-select
v-model="scope.row.value1"
:disabled="isView || scope.row.isDisabled"
size="mini"
>
<el-option
v-for="(item, index) in scope.row.items"
:key="index"
:label="item.options"
:value="item.itemId"
></el-option>
</el-select>
</div>
-->
<div>{{ scope.row.name }}</div>
</div>
<div class="line">
<span class="label">交易指标区间</span>
<div class="line"
style="flex-direction: column;">
<p class="label">交易指标区间</p>
<div class="action">
<div class="inputs">
<div class="inputs range">
<el-select v-model="scope.row.value2"
:disabled="isView || scope.row.isDisabled"
size="mini"
clearable>
clearable
placeholder="符号">
<el-option v-for="(item, i) in leftSymbols"
:key="i"
:value="item.name"></el-option>
@ -335,15 +321,29 @@
<el-input class="number-input"
v-model.trim="scope.row.value3"
:disabled="isView || scope.row.isDisabled"
size="mini"></el-input>
size="mini"
placeholder="数值" />
<el-input class="number-input"
v-model.trim="scope.row.value4"
:disabled="isView || scope.row.isDisabled"
size="mini"></el-input>
size="mini"
placeholder="单位" />
<span>~</span>
<el-input class="number-input"
v-model.trim="scope.row.value5"
:disabled="isView || scope.row.isDisabled"
size="mini"
placeholder="数值" />
<el-input class="number-input"
v-model.trim="scope.row.value6"
:disabled="isView || scope.row.isDisabled"
size="mini"
placeholder="单位" />
<el-select :disabled="isView || scope.row.isDisabled"
v-model="scope.row.value5"
v-model="scope.row.value7"
size="mini"
clearable>
clearable
placeholder="符号">
<el-option v-for="(item, i) in rightSymbols"
:key="i"
:value="item.name"></el-option>
@ -769,13 +769,17 @@ export default {
const temp = item.emptyTwo.split('~')
if (temp.length) {
const symbol = temp[0].match(/[<>=]+/g)
const num = temp[0].match(/[^<>=]+/g)
const num = temp[0].match(/\d+/g)
const unit = temp[0].match(/[^<>=\d]+/g)
const symbol1 = temp.length > 1 ? temp[1].match(/[<>=]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/[^<>=]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/\d+/g) : ''
const unit1 = temp.length > 1 ? temp[1].match(/[^<>=\d]+/g) : ''
obj.value2 = symbol ? symbol[0] : ''
obj.value3 = num ? num[0] : ''
obj.value4 = num1 ? num1[0] : ''
obj.value5 = symbol1 ? symbol1[0] : ''
obj.value4 = unit ? unit[0] : ''
obj.value5 = num1 ? num1[0] : ''
obj.value6 = unit1 ? unit1[0] : ''
obj.value7 = symbol1 ? symbol1[0] : ''
}
}
tempArr.push(obj);
@ -833,13 +837,17 @@ export default {
const temp = item.emptyTwo.split('~')
if (temp.length) {
const symbol = temp[0].match(/[<>=]+/g)
const num = temp[0].match(/[^<>=]+/g)
const num = temp[0].match(/\d+/g)
const unit = temp[0].match(/[^<>=\d]+/g)
const symbol1 = temp.length > 1 ? temp[1].match(/[<>=]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/[^<>=]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/\d+/g) : ''
const unit1 = temp.length > 1 ? temp[1].match(/[^<>=\d]+/g) : ''
obj.value2 = symbol ? symbol[0] : ''
obj.value3 = num ? num[0] : ''
obj.value4 = num1 ? num1[0] : ''
obj.value5 = symbol1 ? symbol1[0] : ''
obj.value4 = unit ? unit[0] : ''
obj.value5 = num1 ? num1[0] : ''
obj.value6 = unit1 ? unit1[0] : ''
obj.value7 = symbol1 ? symbol1[0] : ''
}
} else if (item.type == 6) {
obj.subjectId = Number(item.emptyOne);
@ -983,7 +991,7 @@ export default {
return;
}
if (!point.business) {
this.$message.warning(`请选择业务`);
this.$message.warning(`请选择${this.isSt ? '关卡' : '业务'}`);
return;
}
if (!point.experimentalRequirements) {
@ -1037,7 +1045,7 @@ export default {
} else if (i.type == 5) {
// obj.emptyOne = i.value1; //
obj.emptyOne = i.subjectId ? i.subjectId.toString() : "";
obj.emptyTwo = `${i.value2 || ''}${i.value3}${i.value4 ? '~' + i.value4 : ''}${i.value5 || ''}`;
obj.emptyTwo = `${i.value2 || ''}${i.value3}${i.value4}${i.value5 ? '~' + i.value5 : ''}${i.value6}${i.value7 || ''}`;
} else if (i.type == 6) {
const money = []
const { moneys } = this
@ -1116,7 +1124,9 @@ export default {
value2: "",
value3: "",
value4: "",
value5: ""
value5: "",
value6: "",
value7: "",
});
} else {
this.tableData.push({
@ -1132,7 +1142,9 @@ export default {
value2: "",
value3: "",
value4: "",
value5: ""
value5: "",
value6: "",
value7: "",
});
}
} else {
@ -1199,10 +1211,10 @@ export default {
if ((!row.value2 || !row.value5) && !this.isSt) {
this.$message.warning(`请选择交易指标区间`);
return;
} else if ((!row.value3 || !row.value4) && !this.isSt) {
} else if ((!row.value3 || !row.value5) && !this.isSt) {
this.$message.warning(`请输入交易指标区间`);
return;
} else if (row.value3 && row.value4 && !isNaN(row.value3) && !isNaN(row.value4) && +row.value3 > +row.value4) {
} else if (row.value3 && row.value5 && !isNaN(row.value3) && !isNaN(row.value5) && +row.value3 > +row.value5) {
this.$message.warning(`第一个指标必须小于第二个指标`);
return;
}
@ -1547,6 +1559,11 @@ export default {
margin-left: 0;
}
}
&.range {
/deep/ .el-input {
width: 80px;
}
}
}
&.a-line {

@ -26,5 +26,6 @@ module.exports = {
lintOnSave: true,
devServer: {
port: 8087
}
},
productionSourceMap: false,
}
Loading…
Cancel
Save