|
@@ -283,7 +283,7 @@
|
|
|
</a-form-model>
|
|
|
</a-card>
|
|
|
<projectPopup ref="projectPopup" @okData="okData"></projectPopup>
|
|
|
- <inventoryPopup ref="inventoryPopup" @okData="okDataInvent"></inventoryPopup>
|
|
|
+ <inventoryPopup ref="inventoryPopup" @okData="okDataInvent" @okDataMultiple="addDataMultiple"></inventoryPopup>
|
|
|
<deparmentPopup ref="deparmentPopup" @okData="okDataDeparment"></deparmentPopup>
|
|
|
<OperatorsPopup ref="OperatorsPopup" @okData="okDataOperators"></OperatorsPopup>
|
|
|
<organizationPopup ref="organizationPopup" @okData="okDataOrganization"></organizationPopup>
|
|
@@ -721,7 +721,12 @@
|
|
|
})
|
|
|
},
|
|
|
addList(){
|
|
|
- this.formTable.dataSource.push({rowNo: this.formTable.dataSource.length+1,projectCode:this.form.projectCode,projectName:this.form.projectName,rate:''})
|
|
|
+ if(this.form.orgName&&this.form.orgName!==''){
|
|
|
+ this.$refs.inventoryPopup.visible = true
|
|
|
+ this.$refs.inventoryPopup.getData(this.form.planOrg,'add')
|
|
|
+ }else{
|
|
|
+ this.$message.warning("请选择组织!")
|
|
|
+ }
|
|
|
},
|
|
|
onSearchProject(){
|
|
|
if(this.form.orgName&&this.form.orgName!==''){
|
|
@@ -751,7 +756,7 @@
|
|
|
onSearchInventory(record){
|
|
|
if(this.form.orgName&&this.form.orgName!==''){
|
|
|
this.$refs.inventoryPopup.visible = true
|
|
|
- this.$refs.inventoryPopup.getData(this.form.planOrg )
|
|
|
+ this.$refs.inventoryPopup.getData(this.form.planOrg,'edit')
|
|
|
this.$refs.inventoryPopup.record=record
|
|
|
}else{
|
|
|
this.$message.warning("请选择组织!")
|
|
@@ -789,8 +794,6 @@
|
|
|
this.$set(recoerd,'unit',data.unit )
|
|
|
this.$set(recoerd,'auxiliaryUnit',data.auxiliaryUnit )
|
|
|
this.$set(recoerd,'inventory',data.ID )
|
|
|
- this.$set(recoerd,'quantity','' )
|
|
|
- this.$set(recoerd,'unQuantity','')
|
|
|
data.rate = data.rate?data.rate:1
|
|
|
this.$set(recoerd,'rate',data.rate)
|
|
|
this.$set(recoerd,'quantity','')
|
|
@@ -803,6 +806,32 @@
|
|
|
}
|
|
|
this.$refs.formRef.clearValidate(['inventoryName']);
|
|
|
},
|
|
|
+ addDataMultiple(rows){
|
|
|
+ rows.map(item=>{
|
|
|
+ var obj ={}
|
|
|
+ this.$set(obj,'inventoryCode',item.Code)
|
|
|
+ this.$set(obj,'inventoryName',item.Name)
|
|
|
+ this.$set(obj,'specs',item.SPECS)
|
|
|
+ this.$set(obj,'attribute',item.Code1 )
|
|
|
+ this.$set(obj,'unit',item.unit )
|
|
|
+ this.$set(obj,'auxiliaryUnit',item.auxiliaryUnit )
|
|
|
+ this.$set(obj,'inventory',item.ID )
|
|
|
+ item.rate = item.rate?item.rate:1
|
|
|
+ this.$set(obj,'rate',item.rate)
|
|
|
+ this.$set(obj,'quantity','')
|
|
|
+ this.$set(obj,'unQuantity','')
|
|
|
+ this.$set(obj,'rowNo',this.formTable.dataSource.length+1)
|
|
|
+ this.$set(obj,'projectCode',this.form.projectCode)
|
|
|
+ this.$set(obj,'projectName',this.form.projectName)
|
|
|
+ var attributeArr = item.Code1.split("-")
|
|
|
+ if(attributeArr.length==4){
|
|
|
+ this.$set(obj,'color',attributeArr[1])
|
|
|
+ this.$set(obj,'fixedLength',attributeArr[2])
|
|
|
+ this.$set(obj,'widthHeight',attributeArr[3])
|
|
|
+ }
|
|
|
+ this.formTable.dataSource.push(obj)
|
|
|
+ })
|
|
|
+ },
|
|
|
okDataDeparment(data){
|
|
|
this.$set(this.form,'planDept',data.Name)
|
|
|
this.$set(this.form,'planDeptId',data.ID)
|