From c348ff70995887f4364ad3a1b4aad693e78466af Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Wed, 10 Jan 2024 13:06:46 +0800
Subject: [PATCH] =?UTF-8?q?2024-01-10=20bom=20routing=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/part/bomManagement.js | 14 ++
src/api/part/partInformation.js | 1 +
src/api/part/routingManagement.js | 6 +
src/views/modules/part/bomManagement.vue | 210 ++++++++++++++-----
src/views/modules/part/routingManagement.vue | 73 ++++++-
5 files changed, 250 insertions(+), 54 deletions(-)
diff --git a/src/api/part/bomManagement.js b/src/api/part/bomManagement.js
index 177c001..e7f5ca6 100644
--- a/src/api/part/bomManagement.js
+++ b/src/api/part/bomManagement.js
@@ -119,5 +119,19 @@ export const deleteBomComponent = data => createAPI(`/plm/bomManagement/deleteBo
*/
export const queryOperationList = data => createAPI(`/plm/bomManagement/queryOperationList`,'post',data)
+/**
+ * 获取物料的bom版本号
+ * @param data
+ * @returns {*}
+ */
+export const getBomEngChgLevel = data => createAPI(`/plm/bomManagement/getBomEngChgLevel`,'post',data)
+
+/**
+ * 获取子料的序号
+ * @param data
+ * @returns {*}
+ */
+export const getComponentLineSequence = data => createAPI(`/plm/bomManagement/getComponentLineSequence`,'post',data)
+
diff --git a/src/api/part/partInformation.js b/src/api/part/partInformation.js
index f46d7d7..4562a6d 100644
--- a/src/api/part/partInformation.js
+++ b/src/api/part/partInformation.js
@@ -124,3 +124,4 @@ export const deleteManufacturer = data => createAPI(`/plm/partInformation/delete
* 修改物料属性值
*/
export const commitItemValue = data => createAPI(`/plm/partInformation/commitItemValue`,'post',data)
+
diff --git a/src/api/part/routingManagement.js b/src/api/part/routingManagement.js
index 5b0a9bc..b60b84e 100644
--- a/src/api/part/routingManagement.js
+++ b/src/api/part/routingManagement.js
@@ -118,6 +118,12 @@ export const deleteRoutingComponent = data => createAPI(`/plm/routingManagement/
* @returns {*}
*/
export const queryOperationList = data => createAPI(`/plm/routingManagement/queryOperationList`,'post',data)
+/**
+ * 获取物料的routing版本号
+ * @param data
+ * @returns {*}
+ */
+export const getRottingRevision = data => createAPI(`/plm/routingManagement/getRottingRevision`,'post',data)
diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue
index 7c2b226..59df5ff 100644
--- a/src/views/modules/part/bomManagement.vue
+++ b/src/views/modules/part/bomManagement.vue
@@ -95,12 +95,15 @@
+
+
+
-
+
-
-
-
+
+
+
@@ -110,7 +113,7 @@
-
+
@@ -135,7 +138,7 @@
-
+
@@ -277,7 +280,7 @@
-
+
@@ -319,7 +322,7 @@
-
+
@@ -332,7 +335,7 @@
+
+ 关闭
+
-
+
+
+
+
子物料编码
子物料编码
-
+
+
+
+
-
-
+
+
-
+
-
+
-
+
-
-
-
-
+
+ 工序
+
-
-
+
+ 发料库位
+
-
-
+
+
-
-
- 工序
-
-
-
- 发料库位
-
-
-
-
+
@@ -477,6 +479,8 @@ import {
updateBomComponent, // 修改bom子明细
deleteBomComponent, // 删除bom子明细
queryOperationList, // 根据物料编码查询工序
+ getBomEngChgLevel, // 获取物料的bom版本号
+ getComponentLineSequence, // 获取子料的序号
} from '@/api/part/bomManagement.js'
import ChooseList from '@/views/modules/common/Chooselist'
import dayjs from "dayjs";
@@ -553,7 +557,9 @@ export default {
createDate: '',
createBy: '',
updateDate: '',
- updateBy: ''
+ updateBy: '',
+ printUnit: '',
+ printUnitName: '',
},
detailData: {
site: this.$store.state.user.site,
@@ -882,6 +888,30 @@ export default {
status: true,
fixed: '',
},
+ {
+ columnProp: 'spec',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '规格型号',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'printUnitName',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '计量单位',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
],
componentPartColumnList: [
{
@@ -907,7 +937,31 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- }
+ },
+ {
+ columnProp: 'spec',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '规格型号',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'printUnitName',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '计量单位',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
],
columnSubDetailList: [
{
@@ -919,7 +973,7 @@ export default {
columnProp: 'lineSequence',
headerAlign: 'center',
align: 'center',
- columnLabel: '排序',
+ columnLabel: '序号',
columnHidden: false,
columnImage: false,
columnSortable: false,
@@ -1199,7 +1253,7 @@ export default {
trigger: 'change'
}
],
- componentPartDesc: [
+ lineSequence: [
{
required: true,
message: ' ',
@@ -1368,7 +1422,9 @@ export default {
engRevision: '',
typeFlag: 'B',
netWeight: 0,
- createBy: this.$store.state.user.name
+ createBy: this.$store.state.user.name,
+ printUnit: '',
+ printUnitName: '',
}
this.detailData = {
site: this.$store.state.user.site,
@@ -1407,8 +1463,11 @@ export default {
engRevision: row.engRevision,
typeFlag: row.typeFlag,
netWeight: row.netWeight,
- updateBy: this.$store.state.user.name
+ updateBy: this.$store.state.user.name,
+ printUnit: row.printUnit,
+ printUnitName: row.printUnitName,
}
+ console.log(row)
// 查bom明细
queryBomDetail(this.modalData).then(({data}) => {
if (data && data.code === 0) {
@@ -1542,7 +1601,7 @@ export default {
printUnitName: '',
qtyPerAssembly: 0,
componentScrap: 0,
- issueType: 'ReserveAndBackflush',
+ issueType: 'Reserve and Backflush',
shrinkageFactor: 0,
lineItemNo: '',
operationName: '',
@@ -1552,6 +1611,16 @@ export default {
createBy: this.$store.state.user.name,
lineSequence: ''
}
+ // 获取子料的序号
+ getComponentLineSequence(this.componentData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.componentData.lineSequence = data.lineSequence
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
this.componentDisableFlag = false
this.componentSaveModal = true
},
@@ -1772,7 +1841,7 @@ export default {
* bom删除
*/
delModal () {
- if(this.bomSelections.length === 0){
+ if (this.bomSelections.length === 0) {
this.$message.warning('请勾选要删除的BOM!')
return
}
@@ -1825,8 +1894,35 @@ export default {
getRowData (row) {
this.modalData.partNo = row.partNo
this.modalData.partDesc = row.partDesc
- this.partModelFlag = false
+ this.modalData.printUnit = row.printUnit
+ this.modalData.printUnitName = row.printUnitName
+ // 获取物料的bom版本号
+ getBomEngChgLevel(this.modalData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.modalData.engChgLevel = data.engChgLevel
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ this.partModelFlag = false
+ })
+ },
+
+ // bom类型改变
+ bomTypeChange () {
+ // 获取物料的bom版本号
+ getBomEngChgLevel(this.modalData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.modalData.engChgLevel = data.engChgLevel
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
},
+
/**
* 双击选中工序
* @param row
@@ -1937,6 +2033,10 @@ export default {
* 新增子明细方法
*/
componentDataSave () {
+ if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) {
+ this.$message.warning('序号不能为空!')
+ return
+ }
if (this.componentData.partNo === '' || this.componentData.partNo == null) {
this.$message.warning('请选择主记录物料编码!')
return
@@ -2286,7 +2386,7 @@ export default {
handleInput (value, type) {
// 大于等于0,且只能输入4位小数
let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1')
- if (val == null || val == undefined || val == '') {
+ if (val === null || val === undefined || val === '') {
val = 0
}
if (type === 1) {
@@ -2295,12 +2395,26 @@ export default {
this.detailData.minLotQty = val
} else if (type === 3) {
this.saveDetailData.minLotQty = val
- } else if (type === 4) {
- this.componentData.qtyPerAssembly = val
- } else if (type === 5) {
+ }
+ // else if (type === 4) {
+ // this.componentData.qtyPerAssembly = val
+ // }
+ else if (type === 5) {
this.componentData.componentScrap = val
}
},
+
+ handleInput16 (value, type) {
+ // 大于等于0,且只能输入4位小数
+ let val = value.replace(/^\D*([0-9]\d*\.?\d{0,16})?.*$/,'$1')
+ if (val === null || val === undefined || val === '') {
+ val = 0
+ }
+ if (type === 1) {
+ this.componentData.qtyPerAssembly = val
+ }
+ },
+
handleInputB (value) {
// 0-100
const reg = /^(([1-9]?\d{0,1}(\.\d{1,2})?)|100|100\.(0){1,2})$/
diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue
index 133280e..c7e69e3 100644
--- a/src/views/modules/part/routingManagement.vue
+++ b/src/views/modules/part/routingManagement.vue
@@ -95,8 +95,11 @@
+
+
+
-
+
@@ -125,7 +128,7 @@
-
+
保存
@@ -452,6 +455,7 @@ import {
updateRoutingComponent, // 修改routing子明细
deleteRoutingComponent, // 删除routing子明细
queryOperationList, // 查询工序列表
+ getRottingRevision, // 获取物料的routing版本号
} from '@/api/part/routingManagement.js'
import ChooseList from '@/views/modules/common/Chooselist'
@@ -523,7 +527,9 @@ export default {
createDate: '',
createBy: '',
updateDate: '',
- updateBy: ''
+ updateBy: '',
+ printUnit: '',
+ printUnitName: '',
},
detailData: {
site: this.$store.state.user.site,
@@ -795,6 +801,30 @@ export default {
status: true,
fixed: '',
},
+ {
+ columnProp: 'spec',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '规格型号',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'printUnitName',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '计量单位',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
],
componentOperationColumnList: [
{
@@ -1325,7 +1355,9 @@ export default {
noteText: '',
phaseInDate: new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''),
phaseOutDate: '',
- createBy: this.$store.state.user.name
+ createBy: this.$store.state.user.name,
+ printUnit: '',
+ printUnitName: '',
}
this.detailData = {
site: this.$store.state.user.site,
@@ -1368,7 +1400,9 @@ export default {
engRevision: row.engRevision,
typeFlag: row.typeFlag,
netWeight: row.netWeight,
- updateBy: this.$store.state.user.name
+ updateBy: this.$store.state.user.name,
+ printUnit: row.printUnit,
+ printUnitName: row.printUnitName,
}
// 查routing明细
queryRoutingDetail(this.modalData).then(({data}) => {
@@ -1809,8 +1843,35 @@ export default {
getRowData (row) {
this.modalData.partNo = row.partNo
this.modalData.partDesc = row.partDesc
- this.partModelFlag = false
+ this.modalData.printUnit = row.printUnit
+ this.modalData.printUnitName = row.printUnitName
+ // 获取物料的routing版本号
+ getRottingRevision(this.modalData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.modalData.routingRevision = data.routingRevision
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ this.partModelFlag = false
+ })
},
+
+ // 工艺类型改变
+ routingTypeChange () {
+ // 获取物料的routing版本号
+ getRottingRevision(this.modalData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.modalData.routingRevision = data.routingRevision
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ },
+
getComponentRowData (row) {
this.componentData.operationId = row.operationId
this.componentData.operationName = row.operationName