diff --git a/src/api/part/bomManagement.js b/src/api/part/bomManagement.js
index 5c29220..09e2fab 100644
--- a/src/api/part/bomManagement.js
+++ b/src/api/part/bomManagement.js
@@ -186,3 +186,16 @@ export const saveBomComponentByExcel = data => createAPI(`/part/bomManagement/sa
export const exportWordOrPdf = data => createAPI(`/testWord/test2/exportWordOrPdf`,'post', data, 'download')
+/**
+ * 计算单位用量(新增)
+ * @param data
+ * @returns {*}
+ */
+export const computeQtyPerAssemblySave = data => createAPI(`/part/bomManagement/computeQtyPerAssemblySave`,'post',data)
+/**
+ * 计算单位用量(修改)
+ * @param data
+ * @returns {*}
+ */
+export const computeQtyPerAssemblyEdit = data => createAPI(`/part/bomManagement/computeQtyPerAssemblyEdit`,'post',data)
+
diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue
index 1204a6a..e874f16 100644
--- a/src/views/modules/part/bomManagement.vue
+++ b/src/views/modules/part/bomManagement.vue
@@ -18,14 +18,14 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -139,7 +139,7 @@
-
+
@@ -178,6 +178,10 @@
+
+ 工序单位
+
+
@@ -465,7 +469,7 @@
-
+
@@ -528,20 +532,22 @@
+
+
-
-
+
+
@@ -566,13 +572,13 @@
-
+ 计算
应用
保存
关闭
@@ -1059,7 +1065,9 @@ import {
getBomEngChgLevel, // 获取物料的BOM版本号
queryPartListAll, // 查询包含Purchase(Raw)的物料
batchSaveBomComponent, // 批量新增子件
- exportWordOrPdf, 导出word
+ exportWordOrPdf, // 导出word
+ computeQtyPerAssemblySave, // 计算单位用量(新增)
+ computeQtyPerAssemblyEdit, // 计算单位用量(修改)
} from '@/api/part/bomManagement.js'
import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
@@ -1168,6 +1176,7 @@ export default {
saveAllLoading: false,
copyLoading: false,
alternativeLoading: false,
+ computeLoading: false,
// 初始页签
detailTable: 'bom_detail',
subDetailTable: 'bom_sub_detail',
@@ -1195,7 +1204,9 @@ export default {
printUnit: '',
printUnitName: '',
yieldRate: '',
- shrinkageFactor: ''
+ shrinkageFactor: '',
+ processUnit: '',
+ processUnitName: ''
},
detailData: {
site: this.$store.state.user.site,
@@ -2039,6 +2050,13 @@ export default {
message: ' ',
trigger: ['blur','change']
}
+ ],
+ processUnit: [
+ {
+ required: true,
+ message: ' ',
+ trigger: ['blur','change']
+ }
]
},
detailRules: {
@@ -2464,7 +2482,9 @@ export default {
printUnit: '',
printUnitName: '',
yieldRate: '',
- shrinkageFactor: ''
+ shrinkageFactor: '',
+ processUnit: '',
+ processUnitName: ''
}
this.detailData = {
site: '',
@@ -2514,7 +2534,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明细
@@ -2867,6 +2889,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
@@ -2896,7 +2922,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
}
// if (this.modalData.flag === '1') {
this.saveAllLoading = true
@@ -2920,6 +2947,8 @@ export default {
})
}
this.saveAllLoading = false
+ }).catch(() => {
+ this.saveAllLoading = false
})
// } else {
// this.saveAllLoading = true
@@ -2991,7 +3020,6 @@ export default {
})
}
})
- }).catch(() => {
})
},
@@ -3111,6 +3139,17 @@ export default {
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
},
@@ -3245,6 +3284,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
}
}
@@ -3253,6 +3304,7 @@ export default {
this.componentData.componentPartDesc = ''
this.componentData.printUnit = ''
this.componentData.printUnitName = ''
+ this.componentData.familyID = ''
},
// copy物料编码失焦事件
@@ -3462,6 +3514,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
+ })
+ }
+ },
+
// 批量新增子件
batchComponentDataSave () {
this.$confirm("是否确认添加该"+ this.choosePartList.length +"条子件记录?", "提示", {
@@ -3582,8 +3718,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
@@ -3604,10 +3740,13 @@ export default {
effPhaseInDate: data.rows.modalData.effPhaseInDate,
effPhaseOutDate: data.rows.modalData.effPhaseOutDate,
engRevision: data.rows.modalData.engRevision,
- 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
@@ -4004,10 +4143,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)
})
},
/**
@@ -4019,6 +4162,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
+ }
},
// ======== 导出相关方法 ========
diff --git a/src/views/modules/part/bomSearch3.vue b/src/views/modules/part/bomSearch3.vue
index 1f96cf7..0c5f850 100644
--- a/src/views/modules/part/bomSearch3.vue
+++ b/src/views/modules/part/bomSearch3.vue
@@ -18,12 +18,10 @@
-
-
-
-
-
-
+
+
+
+
@@ -186,6 +184,7 @@ export default {
partDesc: '',
bomType: '',
engChgLevel: '',
+ partType2: '',
page: 1,
limit: 10
},
@@ -254,6 +253,24 @@ export default {
fixed: '',
columnWidth: 300
},
+ {
+ userId: this.$store.state.user.name,
+ functionId: 601002002,
+ serialNumber: '601002002Table1PartType2Desc',
+ tableId: '601002002Table1',
+ tableName: 'BOMHeader表',
+ columnProp: 'partType2Desc',
+ headerAlign: 'center',
+ align: 'left',
+ columnLabel: '零件类型',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },
{
userId: this.$store.state.user.name,
functionId: 601002002,
@@ -262,7 +279,7 @@ export default {
tableName: 'BOMHeader表',
columnProp: 'bomType',
headerAlign: 'center',
- align: 'left',
+ align: 'center',
columnLabel: '制造类型',
columnHidden: false,
columnImage: false,
@@ -270,7 +287,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 120
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
diff --git a/src/views/modules/part/bom_create.vue b/src/views/modules/part/bom_create.vue
index f0affa1..a390071 100644
--- a/src/views/modules/part/bom_create.vue
+++ b/src/views/modules/part/bom_create.vue
@@ -54,6 +54,10 @@
+
+ 工序单位
+
+
@@ -202,7 +206,7 @@
-
+
@@ -219,7 +223,7 @@
-
+
@@ -244,7 +248,7 @@
-
+
@@ -252,12 +256,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 计算
应用
保存
关闭
@@ -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
+ }
},
// 回车事件