需求添加

main
nz618 1 year ago
parent d2dc30700d
commit ea20db6799

Binary file not shown.

@ -57,4 +57,11 @@ export function againExperiment(data) {
data: Qs.stringify(data)
})
}
// 样品名称搜索
export function getExperimentInfo(data) {
return request({
url: '/experiment/get_experiment_info',
method: 'post',
data: Qs.stringify(data)
})
}

@ -32,8 +32,8 @@ try{
// }));
Vue.use(new VueSocketIO({
// connection: SocketIO("http://192.168.101.75:5001", {
// connection: SocketIO("http://127.0.0.1:5001", {
connection: SocketIO("http://192.168.101.50:5001", {
connection: SocketIO("http://127.0.0.1:5001", {
// connection: SocketIO("http://192.168.101.50:5001", {
autoConnect: true // 自动连接
}),
extraHeaders: { "Access-Control-Allow-Origin": "*" }

@ -43,9 +43,9 @@
class="checkbox-column"
width="55">
</el-table-column>
<el-table-column prop="material_name" label="名称" width="180">
<el-table-column prop="material_name" label="样品名称" width="180">
</el-table-column>
<el-table-column prop="flash_point_value" label="温度"> </el-table-column>
<el-table-column prop="flash_point_value" label="闪点温度"> </el-table-column>
<el-table-column prop="determination_standard" label="标准" width="280"> </el-table-column>
<el-table-column prop="create_time" label="时间" width="280"> </el-table-column>
</el-table>
@ -80,7 +80,7 @@ export default {
page:1,
page_size:10
},
standard:'ASTM D6450(1ml)',
standard:'',
standards:[
{
value:'ASTM D6450(1ml)',

@ -1,25 +1,14 @@
<template>
<div class="fitstStep">
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-position="top"
>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="top">
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="测定标准" prop="determination_standard">
<el-select
v-model="ruleForm.determination_standard"
placeholder="请选择测定标准"
style="width: 100%"
>
<el-option v-for='item in standards' :key='item.value' :label='item.label' :value='item.value'/>
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
</el-select>
<el-form-item label="样品名称" prop="material_name">
<el-input v-model="ruleForm.material_name" placeholder="请输入样品名称" @input="handSearch(ruleForm.material_name)">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="预期闪点" prop="expected_flash_point">
<el-input v-model="ruleForm.expected_flash_point" @input="handInput" class="flash rightBorder">
@ -27,32 +16,23 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="6" >
<div class="set" @click="handSet"></div>
<el-col :span="6">
<div class="set" @click="handSet"></div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="温度选择" prop="temperature_selection">
<el-select
v-model="ruleForm.temperature_selection"
@change="handChange"
:disabled="isDisabled"
placeholder="请选择温度"
style="width: 100%"
>
<el-option v-for='item in temps' :key='item.value' :label='item.label' :value='item.value'/>
<el-select v-model="ruleForm.temperature_selection" @change="handChange" :disabled="isDisabled"
placeholder="请选择温度" style="width: 100%">
<el-option v-for='item in temps' :key='item.value' :label='item.label' :value='item.value' />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="初始温度" prop="initial_temperature_set">
<el-input
class="rightBorder"
v-model="ruleForm.initial_temperature_set"
:disabled="isDisabled"
placeholder="≤预期闪点-18℃"
>
<el-input class="rightBorder" v-model="ruleForm.initial_temperature_set" :disabled="isDisabled"
placeholder="≤预期闪点-18℃">
<template slot="append"></template>
</el-input>
@ -61,19 +41,19 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="样品名称" prop="material_name">
<el-input v-model="ruleForm.material_name" placeholder="请输入样品名称">
</el-input>
<el-form-item label="测定标准" prop="determination_standard">
<el-select v-model="ruleForm.determination_standard" placeholder="请选择测定标准" style="width: 100%">
<el-option v-for='item in standards' :key='item.value' :label='item.label' :value='item.value' />
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="最终温度" prop="final_temperature_set">
<el-input
class="rightBorder"
v-model="ruleForm.final_temperature_set"
:disabled="isDisabled"
placeholder="≥预期闪点+10℃"
>
<el-input class="rightBorder" v-model="ruleForm.final_temperature_set" :disabled="isDisabled"
placeholder="≥预期闪点+10℃">
<template slot="append"></template>
</el-input>
</el-form-item>
@ -94,30 +74,30 @@
</el-col>
</el-row>
</el-form>
<div class="model" v-show="isShow">
<span class="icon">!</span>
<div class="dec">请确定您已连接好制冷装置</div>
<div class="tip">请确定连接好制冷装置再继续</div>
<div class="bottom">
<div class="cancel button" @click="handCancel"></div>
<div class="continue button" @click="handContinue"></div>
</div>
<span class="icon">!</span>
<div class="dec">请确定您已连接好制冷装置</div>
<div class="tip">请确定连接好制冷装置再继续</div>
<div class="bottom">
<div class="cancel button" @click="handCancel"></div>
<div class="continue button" @click="handContinue"></div>
</div>
</div>
</div>
</template>
<script>
import { addExperiment } from "@/api/step";
import { addExperiment, getExperimentInfo } from "@/api/step";
import { getInitParams } from "@/api/setSystem";
export default {
data() {
return {
isDisabled:false,
initialMinNum:100,
initialMaxNum:420,
isShow:false,
standards:[
isDisabled: false,
initialMinNum: 100,
initialMaxNum: 420,
isShow: false,
standards: [
// {
// value:'ASTM D6450(1ml)',
// label:'ASTM D6450(1ml)'
@ -131,46 +111,46 @@ export default {
// label:'SH/T 0768(1ml)'
// },
],
temps:[
temps: [
{
value:'高温测定(100~420℃)',
label:'高温测定(100~420℃)'
value: '高温测定(100~420℃)',
label: '高温测定(100~420℃)'
},
{
value:'低温测试(-25~100℃)',
label:'低温测试(-25~100℃)'
value: '低温测试(-25~100℃)',
label: '低温测试(-25~100℃)'
},
],
ruleForm: {
determination_standard: "",
temperature_selection:'高温测定(100~420℃)',
expected_flash_point:'',
initial_temperature_set:'',
material_name:'',
final_temperature_set:'',
material_code:'',
user_id:JSON.parse(sessionStorage.LoginUser).user_id
temperature_selection: '高温测定(100~420℃)',
expected_flash_point: '',
initial_temperature_set: '',
material_name: '',
final_temperature_set: '',
material_code: '',
user_id: JSON.parse(sessionStorage.LoginUser).user_id
},
rules: {
determination_standard:[
determination_standard: [
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
temperature_selection:[
temperature_selection: [
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
material_name:[
material_name: [
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
material_code:[
material_code: [
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
expected_flash_point:[
expected_flash_point: [
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
initial_temperature_set:[
initial_temperature_set: [
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
final_temperature_set:[
final_temperature_set: [
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
},
@ -194,115 +174,155 @@ export default {
// },
// },
mounted(){
mounted() {
this.getInit()
},
methods: {
handChange(val){
if(val=='低温测试(-25~100℃)'){
this.isShow=true
}else{
this.isShow=false
handSearch(name){
console.log('样品名称',name)
getExperimentInfo({material_name:name}).then(res => {
console.log(res,'搜索',res.data.data)
if (res.data.data.length > 0) {
this.ruleForm.determination_standard=res.data.data[0].determination_standard;
this.ruleForm.temperature_selection=res.data.data[0].temperature_selection;
this.ruleForm.expected_flash_point=res.data.data[0].expected_flash_point;
this.ruleForm.initial_temperature_set=res.data.data[0].initial_temperature_set;
this.ruleForm.final_temperature_set=res.data.data[0].final_temperature_set;
this.ruleForm.material_code=res.data.data[0].material_code;
} else {
// this.$message.warning('')
}
})
},
handChange(val) {
if (val == '低温测试(-25~100℃)') {
this.isShow = true
} else {
this.isShow = false
}
},
handInput(val){
console.log(val,'闪电值')
if(val!='未知'){
this.isDisabled=false;
}
handInput(val) {
console.log(val, '闪电值')
if (val != '未知') {
this.isDisabled = false;
}
},
getInit(){
getInitParams().then(res=>{
if(res.data.data.length>0){
res.data.data.map(item=>{
getInit() {
getInitParams().then(res => {
if (res.data.data.length > 0) {
res.data.data.map(item => {
this.standards.push({
value:item.determination_standard,
label:item.determination_standard,
value: item.determination_standard,
label: item.determination_standard,
})
})
}else{
} else {
this.$message.warning('请初始化测定标准参数')
}
})
},
handSet() {
this.ruleForm.expected_flash_point='未知';
this.ruleForm.temperature_selection='低温测试(-25~100℃)';
this.ruleForm.initial_temperature_set='10';
this.ruleForm.final_temperature_set='100';
this.isDisabled=true
this.ruleForm.expected_flash_point = '未知';
this.ruleForm.temperature_selection = '低温测试(-25~100℃)';
this.ruleForm.initial_temperature_set = '10';
this.ruleForm.final_temperature_set = '100';
this.isDisabled = true
},
handCancel(){
this.ruleForm.temperature_selection='高温测定(100~420℃)'
this.isShow=false
handCancel() {
this.ruleForm.temperature_selection = '高温测定(100~420℃)'
this.isShow = false
},
handContinue(){
this.isShow=false
this.ruleForm.temperature_selection='低温测试(-25~100℃)'
handContinue() {
this.isShow = false
this.ruleForm.temperature_selection = '低温测试(-25~100℃)'
},
handBack(){
this.$router.push({path:'/home'})
handBack() {
this.$router.push({ path: '/home' })
},
handTake(formName){
var that=this
handTake(formName) {
var that = this
this.$refs[formName].validate((valid) => {
if (valid) {
if(that.ruleForm.expected_flash_point!='未知'&&isNaN(that.ruleForm.expected_flash_point)){
return that.$message.warning('预期闪点只能设置为数值或未知!')
}
if(!isNaN(that.ruleForm.expected_flash_point)){
console.log(Number(that.ruleForm.expected_flash_point)-Number(that.ruleForm.initial_temperature_set),'测试')
if(Number(that.ruleForm.expected_flash_point)-Number(that.ruleForm.initial_temperature_set)<18){
if (valid) {
if (that.ruleForm.expected_flash_point != '未知' && isNaN(that.ruleForm.expected_flash_point)) {
return that.$message.warning('预期闪点只能设置为数值或未知!')
}
if (Number(that.ruleForm.final_temperature_set) < Number(that.ruleForm.initial_temperature_set)) {
return that.$message.warning('最终温度不能小于初始温度')
}
if (that.ruleForm.temperature_selection == '高温测定(100~420℃)') {
if (118 <= Number(that.ruleForm.expected_flash_point) && Number(that.ruleForm.expected_flash_point) <= 402) {
if (Number(that.ruleForm.expected_flash_point) - Number(that.ruleForm.initial_temperature_set) < 18) {
return that.$message.warning('初始温度<=预期闪点18℃')
}
if(Number(that.ruleForm.final_temperature_set)-Number(that.ruleForm.expected_flash_point)<10){
}
if (Number(that.ruleForm.expected_flash_point) && Number(that.ruleForm.expected_flash_point) <= 410) {
if (Number(that.ruleForm.final_temperature_set) - Number(that.ruleForm.expected_flash_point) < 10) {
return that.$message.warning('最终温度>=预期闪点10℃')
}
}
if(Number(that.ruleForm.final_temperature_set)<Number(that.ruleForm.initial_temperature_set)){
return that.$message.warning('最终温度不能小于初始温度')
if (that.ruleForm.expected_flash_point < 100 || that.ruleForm.initial_temperature_set > 420) {
return that.$message.warning('高温模式下闪电值为100~420℃')
}
if(that.ruleForm.temperature_selection=='高温测定(100~420℃)'){
if(that.ruleForm.initial_temperature_set<100||that.ruleForm.initial_temperature_set>420){
return that.$message.warning('高温模式下初始温度范围为100-420℃')
}
if(that.ruleForm.final_temperature_set<100||that.ruleForm.final_temperature_set>420){
return that.$message.warning('高温模式下最终温度范围为100-420℃')
}
}else if(that.ruleForm.temperature_selection=='低温测试(-25~100℃)'){
if(that.ruleForm.initial_temperature_set<-25||that.ruleForm.initial_temperature_set>100){
return that.$message.warning('低温模式下初始温度范围为-25~100℃')
if (that.ruleForm.initial_temperature_set < 100 || that.ruleForm.initial_temperature_set > 420) {
return that.$message.warning('高温模式下初始温度范围为100-420℃')
}
if (that.ruleForm.final_temperature_set < 100 || that.ruleForm.final_temperature_set > 420) {
return that.$message.warning('高温模式下最终温度范围为100-420℃')
}
} else if (that.ruleForm.temperature_selection == '低温测试(-25~100℃)') {
if (!isNaN(that.ruleForm.expected_flash_point)) {
console.log(-7 <= Number(that.ruleForm.expected_flash_point) && Number(that.ruleForm.expected_flash_point) <= 92, '测试33')
if (-7 <= Number(that.ruleForm.expected_flash_point) && Number(that.ruleForm.expected_flash_point) <= 92) {
if (Number(that.ruleForm.expected_flash_point) - Number(that.ruleForm.initial_temperature_set) < 18) {
return that.$message.warning('初始温度<=预期闪点18℃')
}
}
if(that.ruleForm.final_temperature_set<-25||that.ruleForm.final_temperature_set>100){
return that.$message.warning('低温模式下最终温度范围为-25~100℃')
if (Number(that.ruleForm.expected_flash_point) && Number(that.ruleForm.expected_flash_point) <= 90) {
if (Number(that.ruleForm.final_temperature_set) - Number(that.ruleForm.expected_flash_point) < 10) {
return that.$message.warning('最终温度>=预期闪点10℃')
}
}
}
if (that.ruleForm.expected_flash_point < -25 || that.ruleForm.expected_flash_point > 100) {
return that.$message.warning('低温模式下闪点温度范围为-25~100℃')
}
if (that.ruleForm.initial_temperature_set < -25 || that.ruleForm.initial_temperature_set > 100) {
return that.$message.warning('低温模式下初始温度范围为-25~100℃')
}
if (that.ruleForm.final_temperature_set < -25 || that.ruleForm.final_temperature_set > 100) {
return that.$message.warning('低温模式下最终温度范围为-25~100℃')
}
addExperiment(this.ruleForm).then(res=>{
if(res.data.status==0){
localStorage.setItem('experiment_info',JSON.stringify(res.data.data))
this.$emit('next')
}else{
this.$message.error(res.data.message)
}
})
}
})
addExperiment(this.ruleForm).then(res => {
if (res.data.status == 0) {
localStorage.setItem('experiment_info', JSON.stringify(res.data.data))
this.$emit('next')
} else {
this.$message.error(res.data.message)
}
})
}
})
}
},
};
</script>
<style lang="less" >
.el-select-dropdown__item{
height: 68px;
background: #F6F6F6;
border-radius: 0px 0px 0px 0px;
opacity: 1;
font-size: 28px;
border:2px solid #E4E4E4;
line-height: 68px;
}
.el-select-dropdown__item {
height: 68px;
background: #F6F6F6;
border-radius: 0px 0px 0px 0px;
opacity: 1;
font-size: 28px;
border: 2px solid #E4E4E4;
line-height: 68px;
}
.fitstStep {
.el-form {
margin-top: 28px;
@ -315,10 +335,11 @@ export default {
color: #666666;
margin-bottom: 12px;
}
//
.el-form-item__content {
// width: 440px;
.el-input__inner {
height: 68px;
background: #ffffff;
@ -328,12 +349,15 @@ export default {
font-size: 28px;
color: #3a3a3a;
}
.rightBorder .el-input__inner {
border-right: 0;
}
.flash {
width: 220px;
}
.el-input-group__append,
.el-input-group__prepend {
background: #ffffff;
@ -343,6 +367,7 @@ export default {
font-size: 28px;
}
}
.set {
width: 220px;
height: 68px;
@ -355,6 +380,7 @@ export default {
text-align: center;
line-height: 68px;
}
.goBack {
width: 208px;
height: 84px;
@ -367,6 +393,7 @@ export default {
text-align: center;
margin-top: 36px;
}
.sampling {
width: 208px;
height: 84px;
@ -380,80 +407,89 @@ export default {
margin-top: 36px;
}
}
.footer{
.footer {
width: 1024px;
height: 40px;
background: #3A3A3A;
border-radius: 0px 0px 0px 0px;
opacity: 0.18;
text-align: center;
span{
z-index:99;
font-size: 24px;
color: red;
line-height: 40px;
span {
z-index: 99;
font-size: 24px;
color: red;
line-height: 40px;
}
}
.model{
.model {
position: fixed;
top:116px;
left:286px;
width:440px;
height:534px;
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
top: 116px;
left: 286px;
width: 440px;
height: 534px;
box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
border-radius: 8px 8px 8px 8px;
background:#fff;
.icon{
display:block ;
border-radius: 50%;
margin:80px auto 0;
width: 94px;
height: 94px;
background: linear-gradient(180deg, #FFB300 0%, #FF7D00 100%);
font-size: 80px;
color:#fff;
text-align: center;
background: #fff;
.icon {
display: block;
border-radius: 50%;
margin: 80px auto 0;
width: 94px;
height: 94px;
background: linear-gradient(180deg, #FFB300 0%, #FF7D00 100%);
font-size: 80px;
color: #fff;
text-align: center;
}
.dec{
margin:70px auto 0;
font-size: 28px;
font-weight: bold;
color: #3A3A3A;
text-align: center;
.dec {
margin: 70px auto 0;
font-size: 28px;
font-weight: bold;
color: #3A3A3A;
text-align: center;
}
.tip{
margin:32px auto 0;
font-size: 24px;
font-weight: 400;
color: #C3C3C3;
text-align: center;
.tip {
margin: 32px auto 0;
font-size: 24px;
font-weight: 400;
color: #C3C3C3;
text-align: center;
}
.bottom{
margin-top:64px;
display: flex;
justify-content: center;
text-align: center;
width:100%;
height:70px;
.button{
width: 136px;
height: 68px;
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
border-radius: 8px 8px 8px 8px;
font-size: 28px;
}
.cancel{
background: linear-gradient(180deg, #FFFFFF 0%, #ECECEC 100%);
color: #3A3A3A;
margin-right:12px;
line-height:68px;
}
.continue{
background: linear-gradient(180deg, #FF7B83 0%, #850006 100%);
color: #fff;
line-height:68px;
}
.bottom {
margin-top: 64px;
display: flex;
justify-content: center;
text-align: center;
width: 100%;
height: 70px;
.button {
width: 136px;
height: 68px;
box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
border-radius: 8px 8px 8px 8px;
font-size: 28px;
}
.cancel {
background: linear-gradient(180deg, #FFFFFF 0%, #ECECEC 100%);
color: #3A3A3A;
margin-right: 12px;
line-height: 68px;
}
.continue {
background: linear-gradient(180deg, #FF7B83 0%, #850006 100%);
color: #fff;
line-height: 68px;
}
}
}
}

@ -4,8 +4,8 @@ import axios from 'axios'
const service = axios.create({
// baseURL: 'http:///127.0.0.1:5555/',
// baseURL: 'http://127.0.0.1:5001/api',
baseURL: 'http://192.168.101.50:5001/api',
// baseURL: 'http://127.0.0.1:5001/api',
// baseURL: 'http://192.168.101.50:5001/api',
baseURL: 'http://127.0.0.1:5001/api',
timeout: 15000,
})

Loading…
Cancel
Save