|
|
|
@ -33,7 +33,7 @@ export default { |
|
|
|
height:{ |
|
|
|
type:Number, |
|
|
|
default:300 |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
model:{ |
|
|
|
prop:"dataList", |
|
|
|
@ -63,6 +63,8 @@ export default { |
|
|
|
assemblyQty: [{required: true,message: ' ',trigger: ['change','blur']}], |
|
|
|
fixedScrapQty: [{required: true,message: ' ',trigger: ['change','blur']}], |
|
|
|
scrapFactor: [{required: true,message: ' ',trigger: ['change','blur']}], |
|
|
|
unitCost: [{required: true,message: ' ',trigger: ['change','blur']}], |
|
|
|
totalCost: [{required: true,message: ' ',trigger: ['change','blur']}], |
|
|
|
}, |
|
|
|
testSoBom:{ |
|
|
|
site:this.$store.state.user.site, |
|
|
|
@ -83,6 +85,8 @@ export default { |
|
|
|
rmTypeDb:0, |
|
|
|
issuedType:undefined, |
|
|
|
remark:undefined, |
|
|
|
unitCost:0, |
|
|
|
totalCost:0, |
|
|
|
}, |
|
|
|
selectionTestSoBomList:[], |
|
|
|
testSoBomColumnList:[{ |
|
|
|
@ -135,7 +139,7 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
columnWidth: 200 |
|
|
|
},{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
@ -153,41 +157,44 @@ export default { |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
},{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
serialNumber: '102001Table3AssemblyQty', |
|
|
|
tableId: '102001Table3', |
|
|
|
tableName: '测试产品结构', |
|
|
|
columnProp: 'assemblyQty', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
columnLabel: '单位用量', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
},{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
serialNumber: '102001Table3FixedScrapQty', |
|
|
|
tableId: '102001Table3', |
|
|
|
tableName: '测试产品结构', |
|
|
|
columnProp: 'fixedScrapQty', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
columnLabel: '固定损耗', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
},{ |
|
|
|
}, |
|
|
|
// { |
|
|
|
// userId: this.$store.state.user.name, |
|
|
|
// functionId: 102001, |
|
|
|
// serialNumber: '102001Table3AssemblyQty', |
|
|
|
// tableId: '102001Table3', |
|
|
|
// tableName: '测试产品结构', |
|
|
|
// columnProp: 'assemblyQty', |
|
|
|
// headerAlign: 'center', |
|
|
|
// align: 'left', |
|
|
|
// columnLabel: '单位用量', |
|
|
|
// columnHidden: false, |
|
|
|
// columnImage: false, |
|
|
|
// columnSortable: false, |
|
|
|
// sortLv: 0, |
|
|
|
// status: true, |
|
|
|
// fixed: '', |
|
|
|
// columnWidth: 100 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// userId: this.$store.state.user.name, |
|
|
|
// functionId: 102001, |
|
|
|
// serialNumber: '102001Table3FixedScrapQty', |
|
|
|
// tableId: '102001Table3', |
|
|
|
// tableName: '测试产品结构', |
|
|
|
// columnProp: 'fixedScrapQty', |
|
|
|
// headerAlign: 'center', |
|
|
|
// align: 'left', |
|
|
|
// columnLabel: '固定损耗', |
|
|
|
// columnHidden: false, |
|
|
|
// columnImage: false, |
|
|
|
// columnSortable: false, |
|
|
|
// sortLv: 0, |
|
|
|
// status: true, |
|
|
|
// fixed: '', |
|
|
|
// columnWidth: 100 |
|
|
|
// }, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
serialNumber: '102001Table3UmName', |
|
|
|
@ -204,24 +211,26 @@ export default { |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
},{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
serialNumber: '102001Table3ScrapFactor', |
|
|
|
tableId: '102001Table3', |
|
|
|
tableName: '测试产品结构', |
|
|
|
columnProp: 'scrapFactor', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
columnLabel: '报废率%', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
},{ |
|
|
|
}, |
|
|
|
// { |
|
|
|
// userId: this.$store.state.user.name, |
|
|
|
// functionId: 102001, |
|
|
|
// serialNumber: '102001Table3ScrapFactor', |
|
|
|
// tableId: '102001Table3', |
|
|
|
// tableName: '测试产品结构', |
|
|
|
// columnProp: 'scrapFactor', |
|
|
|
// headerAlign: 'center', |
|
|
|
// align: 'left', |
|
|
|
// columnLabel: '报废率%', |
|
|
|
// columnHidden: false, |
|
|
|
// columnImage: false, |
|
|
|
// columnSortable: false, |
|
|
|
// sortLv: 0, |
|
|
|
// status: true, |
|
|
|
// fixed: '', |
|
|
|
// columnWidth: 100 |
|
|
|
// }, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
serialNumber: '102001Table3RequiredQty', |
|
|
|
@ -229,7 +238,7 @@ export default { |
|
|
|
tableName: '测试产品结构', |
|
|
|
columnProp: 'requiredQty', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
align: 'right', |
|
|
|
columnLabel: '需求数量', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -275,6 +284,42 @@ export default { |
|
|
|
// fixed: '', |
|
|
|
// columnWidth: 100 |
|
|
|
// }, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
serialNumber: '102001Table3UnitCost', |
|
|
|
tableId: '102001Table3', |
|
|
|
tableName: '测试产品结构', |
|
|
|
columnProp: 'unitCost', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'right', |
|
|
|
columnLabel: '单价', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
serialNumber: '102001Table3TotalCost', |
|
|
|
tableId: '102001Table3', |
|
|
|
tableName: '测试产品结构', |
|
|
|
columnProp: 'totalCost', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'right', |
|
|
|
columnLabel: '总价', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 102001, |
|
|
|
@ -291,7 +336,7 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
columnWidth: 140 |
|
|
|
}, |
|
|
|
// { |
|
|
|
// userId: this.$store.state.user.name, |
|
|
|
@ -330,10 +375,21 @@ export default { |
|
|
|
} |
|
|
|
this.partList = []; |
|
|
|
}, |
|
|
|
initPartList(){ |
|
|
|
openPartDialog(){ |
|
|
|
this.partData.partNo = this.testSoBom.componentPartNo |
|
|
|
this.initPartList(); |
|
|
|
}, |
|
|
|
initPartList(flag){ |
|
|
|
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:''}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -406,6 +462,8 @@ export default { |
|
|
|
rmTypeDb:0, |
|
|
|
issuedType:undefined, |
|
|
|
remark:undefined, |
|
|
|
unitCost:0, |
|
|
|
totalCost:0, |
|
|
|
} |
|
|
|
}, |
|
|
|
clearTable(){ |
|
|
|
@ -509,6 +567,14 @@ export default { |
|
|
|
computeQuantityRequired(){ |
|
|
|
let total = new Decimal(this.testNumber).mul(new Decimal(this.testSoBom.assemblyQty)).div((new Decimal(100).sub(new Decimal(this.testSoBom.scrapFactor))).div(new Decimal(100))) |
|
|
|
this.testSoBom.requiredQty = new Decimal(total.toFixed(3,Decimal.ROUND_FLOOR)).toSignificantDigits().toNumber(); |
|
|
|
}, |
|
|
|
computeTotalCost(val){ |
|
|
|
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); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -563,7 +629,7 @@ export default { |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="物料编码" prop="componentPartNo"> |
|
|
|
<span slot="label" @click="partDialogFlag = true"><a>物料编码</a></span> |
|
|
|
<el-input readonly v-model="testSoBom.componentPartNo"></el-input> |
|
|
|
<el-input @change="changePartNo" v-model="testSoBom.componentPartNo"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="11"> |
|
|
|
@ -580,17 +646,17 @@ export default { |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-col :span="8" v-if="false"> |
|
|
|
<el-form-item label="单位用量" prop="assemblyQty"> |
|
|
|
<el-input-number style="width: 100%;margin-top: -5px;" @input="computeQuantityRequired" :min="0" v-model="testSoBom.assemblyQty" :controls="false"></el-input-number> |
|
|
|
<el-input-number style="width: 100%;margin-top: -5px;" :min="0" v-model="testSoBom.assemblyQty" :controls="false"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-col :span="8" v-if="false"> |
|
|
|
<el-form-item label="固定损耗" prop="fixedScrapQty"> |
|
|
|
<el-input-number style="width: 100%;margin-top: -5px;" @input="computeQuantityRequired" :min="0" v-model="testSoBom.fixedScrapQty" :controls="false"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-col :span="8" v-if="false"> |
|
|
|
<el-form-item label="报废率%" prop="scrapFactor"> |
|
|
|
<el-input-number @input="computeQuantityRequired" style="width: 100%;margin-top: -5px;" :max="100" :min="0" v-model="testSoBom.scrapFactor" :controls="false"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
@ -617,7 +683,21 @@ export default { |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="需求数量" prop="requiredQty"> |
|
|
|
<el-input-number disabled style="width: 100%;margin-top: -5px;" :min="0" v-model="testSoBom.requiredQty" :controls="false"></el-input-number> |
|
|
|
<el-input-number @input="computeTotalCost" style="width: 100%;margin-top: -5px;" :min="0" v-model="testSoBom.requiredQty" :controls="false"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="单价" prop="unitCost"> |
|
|
|
<el-input-number @input="computeTotalCost" style="width: 100%;margin-top: -5px;" :min="0" v-model="testSoBom.unitCost" :controls="false"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="8">--> |
|
|
|
<!-- <el-form-item label=" ">--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- </el-col>--> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="总价" prop="totalCost"> |
|
|
|
<el-input-number disabled style="width: 100%;margin-top: -5px;" :min="0" v-model="testSoBom.totalCost" :controls="false"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
@ -635,7 +715,7 @@ export default { |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="物料列表" width="35%" append-to-body |
|
|
|
@close="closePartDialog" v-drag |
|
|
|
@close="closePartDialog" @open="openPartDialog" v-drag |
|
|
|
:visible.sync="partDialogFlag"> |
|
|
|
<!--搜索条件--> |
|
|
|
<el-form :model="partData" ref="partDataForm" label-position="top"> |
|
|
|
|