Commit 765429ee by lixiaomin

修改原料

parent 14294dff
...@@ -130,19 +130,25 @@ export default { ...@@ -130,19 +130,25 @@ export default {
var regular=/(^[+]{0,1}([0-9]+)$)/; var regular=/(^[+]{0,1}([0-9]+)$)/;
let hang=0; let hang=0;
for(let i=0;i<this.experienceList.length;i++){ for(let i=0;i<this.experienceList.length;i++){
hang=i+1; // hang=i+1;
if(!regular.test(this.experienceList[i].milli_second)){ // if(!regular.test(this.experienceList[i].milli_second)){
this.$message.error('第'+hang+'行,秒,请输入大于0的正数'); // this.$message.error('第'+hang+'行,秒,请输入大于0的正数');
return; // return;
}else{ // }else{
// this.experienceList[i].milli_second=parseFloat(this.experienceList[i].milli_second);
// }
// if(!regular.test(this.experienceList[i].quantity)){
// this.$message.error('第'+hang+'行,克,请输入大于0的正数');
// return;
// }else{
// this.experienceList[i].quantity=parseFloat(this.experienceList[i].quantity);
// }
if(this.experienceList[i].milli_second){
this.experienceList[i].milli_second=parseFloat(this.experienceList[i].milli_second); this.experienceList[i].milli_second=parseFloat(this.experienceList[i].milli_second);
} }
if(!regular.test(this.experienceList[i].quantity)){ if(this.experienceList[i].quantity){
this.$message.error('第'+hang+'行,克,请输入大于0的正数');
return;
}else{
this.experienceList[i].quantity=parseFloat(this.experienceList[i].quantity); this.experienceList[i].quantity=parseFloat(this.experienceList[i].quantity);
} }
} }
let obj={ let obj={
"machine_id": this.machine_id, "machine_id": this.machine_id,
......
...@@ -51,7 +51,8 @@ export default { ...@@ -51,7 +51,8 @@ export default {
materialList:[], materialList:[],
ros_code:"", ros_code:"",
component_name:"", component_name:"",
materialId:"" materialId:"",
machineState:null
}; };
}, },
created() { created() {
...@@ -65,6 +66,7 @@ export default { ...@@ -65,6 +66,7 @@ export default {
this.comDiaLog=true; this.comDiaLog=true;
this.machineId=row.id; this.machineId=row.id;
this.activeName="first"; this.activeName="first";
this.machineState=row.state
this.getComponentList(); this.getComponentList();
}, },
getComponentList(){ getComponentList(){
...@@ -100,6 +102,10 @@ export default { ...@@ -100,6 +102,10 @@ export default {
}, },
//提交原料 //提交原料
submitMaterial(){ submitMaterial(){
if(this.machineState!=3 && this.machineState!=7){
this.$message.error('只有状态为待运营测试或运维中才能修改!');
return;
}
let materialName=""; let materialName="";
for(let i=0;i<this.materialList.length;i++){ for(let i=0;i<this.materialList.length;i++){
if(this.materialId==this.materialList[i].id){ if(this.materialId==this.materialList[i].id){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment