|
@@ -144,11 +144,14 @@
|
|
|
|
|
|
},
|
|
|
mounted(){
|
|
|
- if(this.addPagePropsData.subjectId){
|
|
|
- this.$set(this.formData,'subjectId',this.addPagePropsData.subjectId);
|
|
|
+ if(this.addPagePropsData.subId){
|
|
|
+ this.$set(this.formData,'subId',this.addPagePropsData.subId);
|
|
|
}
|
|
|
- if(this.addPagePropsData.chemicalName){
|
|
|
- this.$set(this.formData,'chemicalName',this.addPagePropsData.chemicalName);
|
|
|
+ if(this.addPagePropsData.applyReason){
|
|
|
+ this.$set(this.formData,'applyReason',this.addPagePropsData.applyReason);
|
|
|
+ }
|
|
|
+ if(this.addPagePropsData.cabinetLit){
|
|
|
+ this.$set(this,'cabinetLit',this.addPagePropsData.cabinetLit);
|
|
|
}
|
|
|
this.getSubject();
|
|
|
this.addData();
|
|
@@ -158,12 +161,26 @@
|
|
|
addData(){
|
|
|
let self = this;
|
|
|
for(let i=0;i<self.multipleTableList.length;i++){
|
|
|
- let obj = {
|
|
|
- chemicalId:self.multipleTableList[i].id,
|
|
|
- chemicalName:self.multipleTableList[i].chemicalName,
|
|
|
- list:[{cabinetId:"",applyNum:"",applyText:""}],
|
|
|
+ let num = 0;
|
|
|
+ let newObj = {};
|
|
|
+ if(self.addPagePropsData.list){
|
|
|
+ for(let o=0;o<self.addPagePropsData.list.length;o++){
|
|
|
+ if(self.multipleTableList[i].id == self.addPagePropsData.list[o].chemicalId){
|
|
|
+ num++
|
|
|
+ newObj = JSON.parse(JSON.stringify(self.addPagePropsData.list[o]))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(num == 0){
|
|
|
+ let obj = {
|
|
|
+ chemicalId:self.multipleTableList[i].id,
|
|
|
+ chemicalName:self.multipleTableList[i].chemicalName,
|
|
|
+ list:[{cabinetId:"",applyNum:"",applyText:""}],
|
|
|
+ }
|
|
|
+ self.formData.maxList.push(obj);
|
|
|
+ }else{
|
|
|
+ self.formData.maxList.push(JSON.parse(JSON.stringify(newObj)));
|
|
|
}
|
|
|
- self.formData.maxList.push(obj);
|
|
|
}
|
|
|
},
|
|
|
//删除子项
|
|
@@ -219,8 +236,10 @@
|
|
|
}else if(type == 2){
|
|
|
let obj = {
|
|
|
type:true,
|
|
|
- subjectId:this.formData.subjectId,
|
|
|
- chemicalName:this.formData.chemicalName,
|
|
|
+ subId:this.formData.subId,
|
|
|
+ applyReason:this.formData.applyReason,
|
|
|
+ list:JSON.parse(JSON.stringify(this.formData.maxList)),
|
|
|
+ cabinetLit:this.cabinetLit
|
|
|
};
|
|
|
this.$parent.goPage(3,obj);
|
|
|
}else if(type == 3){
|