|
|
|
@ -10,6 +10,7 @@ import {searchPart, searchPartList} from '@/api/part/partInformation.js'; |
|
|
|
import numberInput from "../../common/numberInput.vue"; |
|
|
|
import {searchAllUmInformationList} from "../../../../api/part/umInformation"; |
|
|
|
import {Decimal} from "decimal.js"; |
|
|
|
import {queryPart} from "../../../../api/part/partInformation"; |
|
|
|
export default { |
|
|
|
name: "testTable", |
|
|
|
components:{ |
|
|
|
@ -380,17 +381,10 @@ export default { |
|
|
|
this.partData.partNo = this.testSoBom.componentPartNo |
|
|
|
this.initPartList(); |
|
|
|
}, |
|
|
|
initPartList(flag){ |
|
|
|
initPartList(){ |
|
|
|
searchPartList(this.partData).then(({data})=>{ |
|
|
|
if (data && data.code === 200) { |
|
|
|
this.partList = data.data; |
|
|
|
if (flag === true){ |
|
|
|
if (this.partList.length === 1 && this.partList[0].partNo === this.testSoBom.componentPartNo){ |
|
|
|
this.dblClickPartTable(this.partList[0]) |
|
|
|
}else { |
|
|
|
this.dblClickPartTable({partNo:this.testSoBom.componentPartNo,partDesc:'',umId:''}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -575,9 +569,26 @@ export default { |
|
|
|
this.testSoBom.assemblyQty = new Decimal(this.testSoBom.requiredQty).div(new Decimal(this.testNumber)).toNumber() |
|
|
|
this.testSoBom.totalCost = new Decimal(this.testSoBom.requiredQty).mul(new Decimal(this.testSoBom.unitCost)).toNumber() |
|
|
|
}, |
|
|
|
changePartNo(val){ |
|
|
|
this.partData.partNo = val |
|
|
|
this.initPartList(true); |
|
|
|
handleQueryPart(){ |
|
|
|
let params = { |
|
|
|
site:this.$store.state.user.site, |
|
|
|
partNo:this.testSoBom.componentPartNo |
|
|
|
} |
|
|
|
queryPart(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
if (data.data && data.data.length === 1){ |
|
|
|
this.dblClickPartTable(data.data[0]) |
|
|
|
}else { |
|
|
|
this.dblClickPartTable({ |
|
|
|
partNo:this.testSoBom.componentPartNo, |
|
|
|
}) |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -632,7 +643,7 @@ export default { |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="物料编码" prop="componentPartNo"> |
|
|
|
<span slot="label" @click="partDialogFlag = true"><a>物料编码</a></span> |
|
|
|
<el-input @change="changePartNo" v-model="testSoBom.componentPartNo"></el-input> |
|
|
|
<el-input @blur="handleQueryPart" v-model="testSoBom.componentPartNo"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="11"> |
|
|
|
|