|
|
|
@ -54,6 +54,10 @@ |
|
|
|
<el-form-item :label="'净重'"> |
|
|
|
<el-input-number :controls="false" :step="0" v-model="modalData.netWeight" style="width: 90px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="processUnit"> |
|
|
|
<span slot="label" @click="getBaseList(510)"><a>工序单位</a></span> |
|
|
|
<el-input v-model="modalData.processUnitName" readonly style="width: 100px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'损耗率%'"> |
|
|
|
<el-input-number :controls="false" :step="0" disabled v-model="modalData.shrinkageFactor" style="width: 100px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
@ -202,7 +206,7 @@ |
|
|
|
</el-footer> |
|
|
|
|
|
|
|
<!-- 子明细新增模态框 --> |
|
|
|
<el-dialog title="新增子物料" :close-on-click-modal="false" top="25vh" v-drag :visible.sync="componentSaveModal" width="800px"> |
|
|
|
<el-dialog title="子物料" :close-on-click-modal="false" top="25vh" v-drag :visible.sync="componentSaveModal" width="800px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'序号'" prop="lineSequence"> |
|
|
|
<el-input-number :controls="false" :step="0" v-model="componentData.lineSequence" style="width: 49px"></el-input-number> |
|
|
|
@ -219,7 +223,7 @@ |
|
|
|
<el-input v-model="componentData.printUnitName" disabled style="width: 110px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'消耗项目'" prop="consumptionItem"> |
|
|
|
<el-select v-model="componentData.consumptionItem" style="width: 165px"> |
|
|
|
<el-select v-model="componentData.consumptionItem" style="width: 167px"> |
|
|
|
<el-option label="Consumed" value="Consumed"></el-option> |
|
|
|
<el-option label="Not Consumed" value="Not Consumed"></el-option> |
|
|
|
</el-select> |
|
|
|
@ -244,7 +248,7 @@ |
|
|
|
<el-input v-model="componentData.issueToLocName" readonly style="width: 110px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'生产属性'" prop="issueType"> |
|
|
|
<el-select v-model="componentData.issueType" style="width: 165px"> |
|
|
|
<el-select v-model="componentData.issueType" style="width: 167px"> |
|
|
|
<el-option label="Reserve And Backflush" value="Reserve And Backflush"></el-option> |
|
|
|
<el-option label="Reserve" value="Reserve"></el-option> |
|
|
|
<el-option label="Backflush" value="Backflush"></el-option> |
|
|
|
@ -252,12 +256,66 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'实际生产数量'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.productionData" :disabled="!productionDataFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'材料数量'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.materialData" :disabled="!materialDataFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'成品数量'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.finishedProductData" :disabled="!finishedProductDataFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'用量损耗'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.consumptionLoss" :disabled="!consumptionLossFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'涂胶长度'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.coatingLength" :disabled="!coatingLengthFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'胶水克重'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.glueWeight" :disabled="!glueWeightFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'材料宽度'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.materialWidth" :disabled="!materialWidthFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'宽度换算单位'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.widthConversion" :disabled="!widthConversionFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'材料长度1'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.materialLength" :disabled="!materialLengthFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'材料厚度'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.materialThickness" :disabled="!materialThicknessFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'面积单位换算'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.areaConversion" :disabled="!areaConversionFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'密度单位换算'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.densityConversion" :disabled="!densityConversionFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'材料克重'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.materialWeight" :disabled="!materialWeightFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'材料长度2'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.materialLength2" :disabled="!materialLength2Family.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'单位换算'"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-model="componentData.unitConversion" :disabled="!unitConversionFamily.includes(componentData.familyID)" style="width: 115px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px"> |
|
|
|
<el-form-item label="备注"> |
|
|
|
<el-input type="textarea" v-model="componentData.noteText" :rows="3" resize='none' show-word-limit style="width: 759px;height: 20px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:35px;margin-top:65px;text-align:center"> |
|
|
|
<el-button :loading="computeLoading" type="primary" @click="computeQtyPerAssembly()">计算</el-button> |
|
|
|
<el-button v-if="componentData.flag === '1'" type="primary" @click="componentDataSave(true)">应用</el-button> |
|
|
|
<el-button type="primary" @click="componentDataSave(false)">保存</el-button> |
|
|
|
<el-button type="primary" @click="componentSaveModal = false">关闭</el-button> |
|
|
|
@ -520,31 +578,23 @@ import { |
|
|
|
saveBomHeader, // 新增bom主信息 |
|
|
|
} from "@/api/part/quicklyCreateBom.js" |
|
|
|
import { |
|
|
|
bomManagementSearch, // bom列表查询 |
|
|
|
bomManagementSave, // bom新增 |
|
|
|
bomManagementEdit, // bom编辑 |
|
|
|
bomManagementDelete, // bom删除 |
|
|
|
queryBomHeader, // 查询bom主信息 |
|
|
|
queryBomDetail, // 查bom明细 |
|
|
|
bomDetailSave, // bom明细新增 |
|
|
|
bomDetailUpdate, // bom明细编辑 |
|
|
|
bomDetailDelete, // bom明细删除 |
|
|
|
updateAlternativeStatus, // 修改明细状态 |
|
|
|
queryPartList, // 查询物料清单 |
|
|
|
queryPartListBom, // 查出可创建BOM的物料 |
|
|
|
queryBomComponent, // 查询bom子明细 |
|
|
|
saveBomComponent, // 新增bom子明细 |
|
|
|
updateBomComponent, // 修改bom子明细 |
|
|
|
deleteBomComponent, // 删除bom子明细 |
|
|
|
queryOperationList, // 根据物料编码查询工序 |
|
|
|
getComponentLineSequence, // 获取子料的序号 |
|
|
|
copyBom, // 复制bom |
|
|
|
copyAlternative, // 复制alternative, |
|
|
|
queryBomComponentTable, // 刷新子物料 |
|
|
|
getBomEngChgLevel, // 获取物料的BOM版本号 |
|
|
|
queryPartListAll, // 查询包含Purchase(Raw)的物料 |
|
|
|
batchSaveBomComponent, // 批量新增子件 |
|
|
|
exportWordOrPdf, 导出word |
|
|
|
computeQtyPerAssemblySave, // 计算单位用量(新增) |
|
|
|
computeQtyPerAssemblyEdit, // 计算单位用量(修改) |
|
|
|
} from "@/api/part/bomManagement.js" |
|
|
|
import ChooseList from '@/views/modules/common/Chooselist_eam' |
|
|
|
import {Decimal} from "decimal.js"; |
|
|
|
@ -597,7 +647,9 @@ export default { |
|
|
|
printUnit: '', |
|
|
|
printUnitName: '', |
|
|
|
yieldRate: '', |
|
|
|
shrinkageFactor: '' |
|
|
|
shrinkageFactor: '', |
|
|
|
processUnit: '', |
|
|
|
processUnitName: '' |
|
|
|
}, |
|
|
|
detailData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
@ -642,7 +694,23 @@ export default { |
|
|
|
updateBy: '', |
|
|
|
lineSequence: '', |
|
|
|
consumptionItem: '', |
|
|
|
productFlag: '' |
|
|
|
productFlag: '', |
|
|
|
familyID: '', |
|
|
|
productionData: undefined, |
|
|
|
materialData: undefined, |
|
|
|
finishedProductData: undefined, |
|
|
|
consumptionLoss: undefined, |
|
|
|
coatingLength: undefined, |
|
|
|
glueWeight: undefined, |
|
|
|
materialWidth: undefined, |
|
|
|
widthConversion: undefined, |
|
|
|
materialLength: undefined, |
|
|
|
materialThickness: undefined, |
|
|
|
areaConversion: undefined, |
|
|
|
densityConversion: undefined, |
|
|
|
materialWeight: undefined, |
|
|
|
materialLength2: undefined, |
|
|
|
unitConversion: undefined |
|
|
|
}, |
|
|
|
componentPartData: { |
|
|
|
site: '', |
|
|
|
@ -724,6 +792,13 @@ export default { |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
processUnit: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
componentRules: { |
|
|
|
@ -1264,6 +1339,7 @@ export default { |
|
|
|
alternativeLoading: false, |
|
|
|
saveAllLoading: false, |
|
|
|
saveDetailLoading: false, |
|
|
|
computeLoading: false, |
|
|
|
// 控制 |
|
|
|
modalFlag: false, |
|
|
|
modalDisableFlag: false, |
|
|
|
@ -1279,6 +1355,22 @@ export default { |
|
|
|
saveDetailModalFlag :false, |
|
|
|
saveDetailModalDisable: false, |
|
|
|
operationModelFlag: false, |
|
|
|
// ======== 子物料字段分类集合 ======== |
|
|
|
productionDataFamily: ['RFID003', 'RFID004', 'RFID005', 'RFID006', 'RFID007', 'RFID008', 'RFID009', 'RFID012', 'RFID023', 'RFID024', 'RFID025', 'RFID027'], |
|
|
|
materialDataFamily: ['RFID011', 'RFID020', 'RFID021', 'RFID022'], |
|
|
|
finishedProductDataFamily: ['RFID020', 'RFID021', 'RFID022'], |
|
|
|
consumptionLossFamily: ['RFID001', 'RFID002', 'RFID014', 'RFID015', 'RFID016', 'RFID017', 'RFID018', 'RFID019'], |
|
|
|
coatingLengthFamily: ['RFID013'], |
|
|
|
glueWeightFamily: ['RFID013'], |
|
|
|
materialWidthFamily: ['RFID014', 'RFID015'], |
|
|
|
widthConversionFamily: ['RFID014', 'RFID015'], |
|
|
|
materialLengthFamily: ['RFID016', 'RFID017'], |
|
|
|
materialThicknessFamily: ['RFID016', 'RFID017', 'RFID018', 'RFID019'], |
|
|
|
areaConversionFamily: ['RFID016', 'RFID017', 'RFID018', 'RFID019'], |
|
|
|
densityConversionFamily: ['RFID016', 'RFID017', 'RFID018', 'RFID019'], |
|
|
|
materialWeightFamily: ['RFID018', 'RFID019'], |
|
|
|
materialLength2Family: ['RFID018', 'RFID019'], |
|
|
|
unitConversionFamily: ['RFID018', 'RFID019'], |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -1359,7 +1451,9 @@ export default { |
|
|
|
printUnit: row.printUnit, |
|
|
|
printUnitName: row.printUnitName, |
|
|
|
yieldRate: '', |
|
|
|
shrinkageFactor: row.shrinkageFactor |
|
|
|
shrinkageFactor: row.shrinkageFactor, |
|
|
|
processUnit: '', |
|
|
|
processUnitName: '' |
|
|
|
} |
|
|
|
this.detailData = { |
|
|
|
site: row.site, |
|
|
|
@ -1408,7 +1502,9 @@ export default { |
|
|
|
printUnitName: row.printUnitName, |
|
|
|
alternativeNo: row.alternativeNo, |
|
|
|
yieldRate: row.yieldRate, |
|
|
|
shrinkageFactor: new Decimal(100).sub(new Decimal(row.yieldRate)).toNumber() |
|
|
|
shrinkageFactor: new Decimal(100).sub(new Decimal(row.yieldRate)).toNumber(), |
|
|
|
processUnit: row.processUnit, |
|
|
|
processUnitName: row.processUnitName |
|
|
|
} |
|
|
|
this.subDetailTable = 'bom_sub_detail' |
|
|
|
// 查bom明细 |
|
|
|
@ -1443,8 +1539,8 @@ export default { |
|
|
|
this.$message.warning('请先选择制造类型!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.modalData.typeFlag === '' || this.modalData.typeFlag == null) { |
|
|
|
this.$message.warning('请先选择类型!') |
|
|
|
if (this.modalData.processUnit === '' || this.modalData.processUnit == null) { |
|
|
|
this.$message.warning('请先选择工序单位!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.saveHeaderLoading = true |
|
|
|
@ -1468,7 +1564,11 @@ export default { |
|
|
|
typeFlag: data.rows.modalData.typeFlag, |
|
|
|
netWeight: data.rows.modalData.netWeight, |
|
|
|
yieldRate: data.rows.modalData.yieldRate, |
|
|
|
shrinkageFactor: new Decimal(100).sub(new Decimal(data.rows.modalData.yieldRate)).toNumber() |
|
|
|
printUnit: data.rows.modalData.printUnit, |
|
|
|
printUnitName: data.rows.modalData.printUnitName, |
|
|
|
shrinkageFactor: new Decimal(100).sub(new Decimal(data.rows.modalData.yieldRate)).toNumber(), |
|
|
|
processUnit: data.rows.modalData.processUnit, |
|
|
|
processUnitName: data.rows.modalData.processUnitName |
|
|
|
} |
|
|
|
this.detailDataList = data.rows.detailDataList |
|
|
|
this.detailData = data.rows.detailData |
|
|
|
@ -1649,7 +1749,23 @@ export default { |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
lineSequence: '', |
|
|
|
consumptionItem: 'Consumed', |
|
|
|
productFlag: 'component' |
|
|
|
productFlag: 'component', |
|
|
|
familyID: '', |
|
|
|
productionData: undefined, |
|
|
|
materialData: undefined, |
|
|
|
finishedProductData: undefined, |
|
|
|
consumptionLoss: undefined, |
|
|
|
coatingLength: undefined, |
|
|
|
glueWeight: undefined, |
|
|
|
materialWidth: undefined, |
|
|
|
widthConversion: undefined, |
|
|
|
materialLength: undefined, |
|
|
|
materialThickness: undefined, |
|
|
|
areaConversion: undefined, |
|
|
|
densityConversion: undefined, |
|
|
|
materialWeight: undefined, |
|
|
|
materialLength2: undefined, |
|
|
|
unitConversion: undefined |
|
|
|
} |
|
|
|
// 获取子料的序号 |
|
|
|
getComponentLineSequence(this.componentData).then(({data}) => { |
|
|
|
@ -1783,7 +1899,23 @@ export default { |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
lineSequence: row.lineSequence, |
|
|
|
consumptionItem: row.consumptionItem, |
|
|
|
productFlag: 'component' |
|
|
|
productFlag: 'component', |
|
|
|
familyID: row.familyID, |
|
|
|
productionData: row.productionData == null ? undefined : row.productionData, |
|
|
|
materialData: row.materialData == null ? undefined : row.materialData, |
|
|
|
finishedProductData: row.finishedProductData == null ? undefined : row.finishedProductData, |
|
|
|
consumptionLoss: row.consumptionLoss == null ? undefined : row.consumptionLoss, |
|
|
|
coatingLength: row.coatingLength == null ? undefined : row.coatingLength, |
|
|
|
glueWeight: row.glueWeight == null ? undefined : row.glueWeight, |
|
|
|
materialWidth: row.materialWidth == null ? undefined : row.materialWidth, |
|
|
|
widthConversion: row.widthConversion == null ? undefined : row.widthConversion, |
|
|
|
materialLength: row.materialLength == null ? undefined : row.materialLength, |
|
|
|
materialThickness: row.materialThickness == null ? undefined : row.materialThickness, |
|
|
|
areaConversion: row.areaConversion == null ? undefined : row.areaConversion, |
|
|
|
densityConversion: row.densityConversion == null ? undefined : row.densityConversion, |
|
|
|
materialWeight: row.materialWeight == null ? undefined : row.materialWeight, |
|
|
|
materialLength2: row.materialLength2 == null ? undefined : row.materialLength2, |
|
|
|
unitConversion: row.unitConversion == null ? undefined : row.unitConversion, |
|
|
|
} |
|
|
|
this.componentDisableFlag = true |
|
|
|
this.componentSaveModal = true |
|
|
|
@ -1813,6 +1945,10 @@ export default { |
|
|
|
this.$message.warning('请填写BOM版本号!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.modalData.processUnit === '' || this.modalData.processUnit == null) { |
|
|
|
this.$message.warning('请选择工序单位!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { |
|
|
|
this.$message.warning('请选择替代!') |
|
|
|
return |
|
|
|
@ -1842,7 +1978,8 @@ export default { |
|
|
|
status: this.detailData.status, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
informationList: this.subDetailList |
|
|
|
informationList: this.subDetailList, |
|
|
|
processUnit: this.modalData.processUnit |
|
|
|
} |
|
|
|
this.saveAllLoading = true |
|
|
|
bomManagementSave(tempData).then(({data}) => { |
|
|
|
@ -1860,6 +1997,8 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
this.saveAllLoading = false |
|
|
|
}).catch(() => { |
|
|
|
this.saveAllLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
@ -1906,6 +2045,18 @@ export default { |
|
|
|
this.componentData.componentPartDesc = row.partDesc |
|
|
|
this.componentData.printUnit = row.printUnit |
|
|
|
this.componentData.printUnitName = row.printUnitName |
|
|
|
this.componentData.familyID = row.familyID |
|
|
|
if (this.widthConversionFamily.includes(row.familyID)) { |
|
|
|
this.componentData.widthConversion = 1 |
|
|
|
} else if (this.areaConversionFamily.includes(row.familyID)) { |
|
|
|
this.componentData.areaConversion = 1 |
|
|
|
} else if (this.densityConversionFamily.includes(row.familyID)) { |
|
|
|
this.componentData.densityConversion = 1 |
|
|
|
} else if (this.unitConversionFamily.includes(row.familyID)) { |
|
|
|
this.componentData.unitConversion = 1 |
|
|
|
} else if (this.consumptionLossFamily.includes(row.familyID)) { |
|
|
|
this.componentData.consumptionLoss = 1 |
|
|
|
} |
|
|
|
this.componentPartModelFlag = false |
|
|
|
}, |
|
|
|
|
|
|
|
@ -1923,6 +2074,18 @@ export default { |
|
|
|
this.componentData.componentPartDesc = data.page.list[0].partDesc |
|
|
|
this.componentData.printUnit = data.page.list[0].printUnit |
|
|
|
this.componentData.printUnitName = data.page.list[0].printUnitName |
|
|
|
this.componentData.familyID = data.page.list[0].familyID |
|
|
|
if (this.widthConversionFamily.includes(data.page.list[0].familyID)) { |
|
|
|
this.componentData.widthConversion = 1 |
|
|
|
} else if (this.areaConversionFamily.includes(data.page.list[0].familyID)) { |
|
|
|
this.componentData.areaConversion = 1 |
|
|
|
} else if (this.densityConversionFamily.includes(data.page.list[0].familyID)) { |
|
|
|
this.componentData.densityConversion = 1 |
|
|
|
} else if (this.unitConversionFamily.includes(data.page.list[0].familyID)) { |
|
|
|
this.componentData.unitConversion = 1 |
|
|
|
} else if (this.consumptionLossFamily.includes(data.page.list[0].familyID)) { |
|
|
|
this.componentData.consumptionLoss = 1 |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1931,6 +2094,7 @@ export default { |
|
|
|
this.componentData.componentPartDesc = '' |
|
|
|
this.componentData.printUnit = '' |
|
|
|
this.componentData.printUnitName = '' |
|
|
|
this.componentData.familyID = '' |
|
|
|
}, |
|
|
|
|
|
|
|
// 根据物料编码查询工序 |
|
|
|
@ -2062,6 +2226,90 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 计算单位用量 |
|
|
|
computeQtyPerAssembly () { |
|
|
|
if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) { |
|
|
|
this.$message.warning('序号不能为空!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.partNo === '' || this.componentData.partNo == null) { |
|
|
|
this.$message.warning('请选择主记录物料编码!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.bomType === '' || this.componentData.bomType == null) { |
|
|
|
this.$message.warning('请选择主记录制造类型!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) { |
|
|
|
this.$message.warning('请填写主记录BOM版本号!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.componentPart === '' || this.componentData.componentPart == null) { |
|
|
|
this.$message.warning('请选择子物料编码!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.productFlag === 'component' && (this.componentData.consumptionItem === '' || this.componentData.consumptionItem == null)) { |
|
|
|
this.$message.warning('请选择消耗项目!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.componentScrap === '' || this.componentData.componentScrap == null) { |
|
|
|
this.$message.warning('请填写调机量!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) { |
|
|
|
this.$message.warning('请填写损耗率!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.issueType === '' || this.componentData.issueType == null) { |
|
|
|
this.$message.warning('请选择生产属性!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.computeLoading = true |
|
|
|
if (this.componentData.flag === '1') { |
|
|
|
computeQtyPerAssemblySave(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows.subDetailList |
|
|
|
// 换成修改子物料模态框 |
|
|
|
this.updateComponentModal(data.rows.rowData) |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.computeLoading = false |
|
|
|
}).catch(() => { |
|
|
|
this.computeLoading = false |
|
|
|
}) |
|
|
|
} else if (this.componentData.flag === '2') { |
|
|
|
computeQtyPerAssemblyEdit(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows.subDetailList |
|
|
|
// 换成修改子物料模态框 |
|
|
|
this.updateComponentModal(data.rows.rowData) |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.computeLoading = false |
|
|
|
}).catch(() => { |
|
|
|
this.computeLoading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 子物料查询列表 |
|
|
|
queryBatchComponentPartList () { |
|
|
|
this.batchComponentPartData.limit = this.pageSize5 |
|
|
|
@ -2265,10 +2513,14 @@ export default { |
|
|
|
this.tagNo = val |
|
|
|
this.$nextTick(() => { |
|
|
|
let strVal = '' |
|
|
|
let conSql = '' |
|
|
|
if (val === 215) { |
|
|
|
strVal = this.componentData.issueToLoc |
|
|
|
} |
|
|
|
this.$refs.baseList.init(val, strVal) |
|
|
|
if (val === 510) { |
|
|
|
conSql = " and site = '" + this.modalData.site + "'" |
|
|
|
} |
|
|
|
this.$refs.baseList.init(val, strVal, conSql) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
@ -2278,6 +2530,10 @@ export default { |
|
|
|
this.componentData.issueToLoc = val.location_id |
|
|
|
this.componentData.issueToLocName = val.location_name |
|
|
|
} |
|
|
|
if (this.tagNo === 510) { |
|
|
|
this.modalData.processUnit = val.UMID |
|
|
|
this.modalData.processUnitName = val.UMName |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 回车事件 |
|
|
|
|