nz618 1 year ago
parent f582901039
commit 065a3e02fb

Binary file not shown.

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

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

@ -43,9 +43,9 @@
class="checkbox-column" class="checkbox-column"
width="55"> width="55">
</el-table-column> </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>
<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="determination_standard" label="标准" width="280"> </el-table-column>
<el-table-column prop="create_time" label="时间" width="280"> </el-table-column> <el-table-column prop="create_time" label="时间" width="280"> </el-table-column>
</el-table> </el-table>
@ -80,7 +80,7 @@ export default {
page:1, page:1,
page_size:10 page_size:10
}, },
standard:'ASTM D6450(1ml)', standard:'',
standards:[ standards:[
{ {
value:'ASTM D6450(1ml)', value:'ASTM D6450(1ml)',

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

Loading…
Cancel
Save