From 863fef1679c7a2cb179d1213efa334d679b74d38 Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Wed, 18 Mar 2026 11:35:46 +0800
Subject: [PATCH] =?UTF-8?q?2026-03-18=20Inventory=20Part=E5=92=8C=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E3=80=90=E8=8E=B7=E5=8F=96=E7=BC=96=E7=A0=81=E3=80=91=E3=80=90?=
=?UTF-8?q?=E7=BC=96=E7=A0=81=E8=AF=A6=E6=83=85=E3=80=91=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/modules/code/generation.vue | 26 ++++-
src/views/modules/part/bomManagement.vue | 101 +++++++++---------
src/views/modules/part/partInformation.vue | 16 ++-
src/views/modules/part/recipeManagement.vue | 85 ++++++++-------
.../projectInfo/com_project_info_part.vue | 16 ++-
.../com_technical-add-or-update.vue | 89 +++++++++------
6 files changed, 205 insertions(+), 128 deletions(-)
diff --git a/src/views/modules/code/generation.vue b/src/views/modules/code/generation.vue
index 65cfbcd..2335ad5 100644
--- a/src/views/modules/code/generation.vue
+++ b/src/views/modules/code/generation.vue
@@ -12,6 +12,14 @@ export default {
dialogMode: {
type: Boolean,
default: false
+ },
+ initialErpPartNo: {
+ type: String,
+ default: ''
+ },
+ initialErpPartDesc: {
+ type: String,
+ default: ''
}
},
computed: {
@@ -307,6 +315,22 @@ export default {
watch:{
'searchModel.erpPartNo'(newVal,oldVal){
this.searchModel.erpPartNo = newVal.toUpperCase()
+ },
+ initialErpPartNo: {
+ immediate: true,
+ handler(newVal) {
+ if (this.dialogMode) {
+ this.searchModel.erpPartNo = newVal || ''
+ }
+ }
+ },
+ initialErpPartDesc: {
+ immediate: true,
+ handler(newVal) {
+ if (this.dialogMode) {
+ this.searchModel.erpPartDesc = newVal || ''
+ }
+ }
}
}
}
@@ -333,7 +357,7 @@ export default {
-
+
diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue
index 10adabe..63bd9c7 100644
--- a/src/views/modules/part/bomManagement.vue
+++ b/src/views/modules/part/bomManagement.vue
@@ -1191,6 +1191,7 @@ import ChooseList from '@/views/modules/common/Chooselist'
import {isAuth} from "../../../utils";
import FilterSearch from "../../common/filterSearch.vue";
import {partAllInfoSearchAny} from "../../../api/part/partAllInfoSearch";
+import {partInformationSearch} from "@/api/part/partInformation";
import {
bomManagementSearchAny,
queryComponentPartRecipeList,
@@ -4720,61 +4721,65 @@ export default {
this.$message.warning('请选择生产属性!')
return
}
- this.saveComponentLoading = true
- if (this.componentData.flag === '1') {
- saveBomComponent(this.componentData).then(({data}) => {
- if (data && data.code === 0) {
- this.subDetailList = data.rows.subDetailList
- this.byProductList = data.rows.byProductList
- this.manufStructCostDistribList = data.rows.manufStructCostDistribList
- if (isClose) {
- if (this.subDetailTable === 'by_products') {
- this.saveByProductModal()
+
+ const doSaveBomComponent = () => {
+ this.saveComponentLoading = true
+ if (this.componentData.flag === '1') {
+ saveBomComponent(this.componentData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.subDetailList = data.rows.subDetailList
+ this.byProductList = data.rows.byProductList
+ this.manufStructCostDistribList = data.rows.manufStructCostDistribList
+ if (isClose) {
+ if (this.subDetailTable === 'by_products') {
+ this.saveByProductModal()
+ } else {
+ this.saveComponentModal()
+ }
} else {
- this.saveComponentModal()
+ this.componentSaveModal = false
}
+ this.saveComponentLoading = false
+ this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} })
} else {
- this.componentSaveModal = false
+ this.saveComponentLoading = false
+ this.$alert(data.msg, '错误', { confirmButtonText: '确定' })
}
+ }).catch(() => {
this.saveComponentLoading = false
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {}
- })
- } else {
- this.saveComponentLoading = false
- this.$alert(data.msg, '错误', {
- confirmButtonText: '确定'
- })
- }
- }).catch(()=>{
- this.saveComponentLoading = false
- })
- } else if (this.componentData.flag === '2') {
- updateBomComponent(this.componentData).then(({data}) => {
- if (data && data.code === 0) {
- this.subDetailList = data.rows.subDetailList
- this.byProductList = data.rows.byProductList
- this.componentSaveModal = false
- this.saveComponentLoading = false
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {}
- })
- } else {
+ })
+ } else if (this.componentData.flag === '2') {
+ updateBomComponent(this.componentData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.subDetailList = data.rows.subDetailList
+ this.byProductList = data.rows.byProductList
+ this.componentSaveModal = false
+ this.saveComponentLoading = false
+ this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} })
+ } else {
+ this.saveComponentLoading = false
+ this.$alert(data.msg, '错误', { confirmButtonText: '确定' })
+ }
+ }).catch(() => {
this.saveComponentLoading = false
- this.$alert(data.msg, '错误', {
- confirmButtonText: '确定'
- })
- }
- }).catch(()=>{
- this.saveComponentLoading = false
- })
+ })
+ }
}
+
+ partInformationSearch({
+ site: this.$store.state.user.site,
+ ifsPartNo: this.componentData.componentPart,
+ limit: 1,
+ page: 1
+ }).then(({data}) => {
+ if (data && data.code === 0 && data.page.list.length > 0 && data.page.list[0].drawingNo) {
+ doSaveBomComponent()
+ } else {
+ this.$message.warning('子物料【' + this.componentData.componentPart + '】未获取编码,不能保存!')
+ }
+ }).catch(() => {
+ this.$message.error('验证子物料编码信息失败,请重试!')
+ })
},
// 编辑副产品成本分配方法
diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue
index 27c255a..1dad589 100644
--- a/src/views/modules/part/partInformation.vue
+++ b/src/views/modules/part/partInformation.vue
@@ -169,11 +169,11 @@
-
+
-
- 获取编码
+
+ 获取编码
Copy Part
@@ -1432,7 +1432,7 @@
-
+
@@ -3461,6 +3461,8 @@
filterSearchData: {},
copyFlag2: false,
drawingNoDialogVisible: false,
+ dialogErpPartNo: '',
+ dialogErpPartDesc: '',
partDrawingDetailList: [],
partDrawingDetailDialogVisible: false,
partDrawingDetailLoading: false
@@ -6193,6 +6195,12 @@
this.filterVisible = false
},
+ openDrawingNoDialog() {
+ this.dialogErpPartNo = this.modalData.ifsPartNo || '';
+ this.dialogErpPartDesc = this.modalData.partDesc || '';
+ this.drawingNoDialogVisible = true;
+ },
+
handleCodeGenerated(drawingNo) {
this.modalData.drawingNo = drawingNo;
this.drawingNoDialogVisible = false;
diff --git a/src/views/modules/part/recipeManagement.vue b/src/views/modules/part/recipeManagement.vue
index 4027ca4..97b40c1 100644
--- a/src/views/modules/part/recipeManagement.vue
+++ b/src/views/modules/part/recipeManagement.vue
@@ -1015,6 +1015,7 @@ import FilterSearch from "../../common/filterSearch.vue";
import {bomSearchHeaderAny} from "../../../api/part/bomSearch3";
import {recipeManagementSearchAny} from "../../../api/part/recipeManagement";
import {queryProductGroupId4} from "../../../api/part/bomManagement";
+import {partInformationSearch} from "@/api/part/partInformation";
export default {
// 组件
@@ -4183,52 +4184,56 @@ export default {
this.$message.warning('请选择生产属性!')
return
}
- if (this.componentData.flag === '1') {
- saveRecipeComponent(this.componentData).then(({data}) => {
- if (data && data.code === 0) {
- this.subDetailList = data.rows.subDetailList
- this.byProductList = data.rows.byProductList
- this.manufStructCostDistribList = data.rows.manufStructCostDistribList
- if (isClose) {
- if (this.subDetailTable === 'by_products') {
- this.saveByProductModal()
+
+ const doSaveRecipeComponent = () => {
+ if (this.componentData.flag === '1') {
+ saveRecipeComponent(this.componentData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.subDetailList = data.rows.subDetailList
+ this.byProductList = data.rows.byProductList
+ this.manufStructCostDistribList = data.rows.manufStructCostDistribList
+ if (isClose) {
+ if (this.subDetailTable === 'by_products') {
+ this.saveByProductModal()
+ } else {
+ this.saveComponentModal()
+ }
} else {
- this.saveComponentModal()
+ this.componentSaveModal = false
}
+ this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} })
} else {
+ this.$alert(data.msg, '错误', { confirmButtonText: '确定' })
+ }
+ })
+ } else if (this.componentData.flag === '2') {
+ updateRecipeComponent(this.componentData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.subDetailList = data.rows.subDetailList
+ this.byProductList = data.rows.byProductList
this.componentSaveModal = false
+ this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} })
+ } else {
+ this.$alert(data.msg, '错误', { confirmButtonText: '确定' })
}
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {}
- })
- } else {
- this.$alert(data.msg, '错误', {
- confirmButtonText: '确定'
- })
- }
- })
- } else if (this.componentData.flag === '2') {
- updateRecipeComponent(this.componentData).then(({data}) => {
- if (data && data.code === 0) {
- this.subDetailList = data.rows.subDetailList
- this.byProductList = data.rows.byProductList
- this.componentSaveModal = false
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {}
- })
- } else {
- this.$alert(data.msg, '错误', {
- confirmButtonText: '确定'
- })
- }
- })
+ })
+ }
}
+
+ partInformationSearch({
+ site: this.$store.state.user.site,
+ ifsPartNo: this.componentData.componentPart,
+ limit: 1,
+ page: 1
+ }).then(({data}) => {
+ if (data && data.code === 0 && data.page.list.length > 0 && data.page.list[0].drawingNo) {
+ doSaveRecipeComponent()
+ } else {
+ this.$message.warning('子物料【' + this.componentData.componentPart + '】未获取编码,不能保存!')
+ }
+ }).catch(() => {
+ this.$message.error('验证子物料编码信息失败,请重试!')
+ })
},
// 编辑副产品成本分配方法
diff --git a/src/views/modules/project/projectInfo/com_project_info_part.vue b/src/views/modules/project/projectInfo/com_project_info_part.vue
index b977623..81baca3 100644
--- a/src/views/modules/project/projectInfo/com_project_info_part.vue
+++ b/src/views/modules/project/projectInfo/com_project_info_part.vue
@@ -107,11 +107,11 @@
-
+
-
- 获取编码
+
+ 获取编码
@@ -977,7 +977,7 @@
-
+
@@ -1583,6 +1583,8 @@ import CodeGeneration from "../../code/generation.vue";
modalFlag: false,
modalDisableFlag: false,
drawingNoDialogVisible: false,
+ dialogErpPartNo: '',
+ dialogErpPartDesc: '',
partDrawingDetailList: [],
partDrawingDetailDialogVisible: false,
partDrawingDetailLoading: false,
@@ -3835,6 +3837,12 @@ import CodeGeneration from "../../code/generation.vue";
})
},
+ openDrawingNoDialog() {
+ this.dialogErpPartNo = this.modalData.ifsPartNo || '';
+ this.dialogErpPartDesc = this.modalData.partDesc || '';
+ this.drawingNoDialogVisible = true;
+ },
+
handleCodeGenerated(drawingNo) {
this.modalData.drawingNo = drawingNo;
this.drawingNoDialogVisible = false;
diff --git a/src/views/modules/sampleManagement/com_technical-add-or-update.vue b/src/views/modules/sampleManagement/com_technical-add-or-update.vue
index d72074c..f13850c 100644
--- a/src/views/modules/sampleManagement/com_technical-add-or-update.vue
+++ b/src/views/modules/sampleManagement/com_technical-add-or-update.vue
@@ -443,6 +443,7 @@
getFinalPartData,
searchBMUser,
} from "@/api/sampleManagement/technicalSpecificationList.js"
+ import {partInformationSearch} from "@/api/part/partInformation"
import Chooselist from '@/views/modules/common/Chooselist'
import ChooseUser from '@/views/modules/common/ChooseUser'
export default {
@@ -1149,49 +1150,75 @@
}
this.dataForm.engineerList = []
if (this.dataForm.engineerNo !== '') {
- this.dataForm.engineerList.push(this.dataForm.engineerNo) // Engineer
+ this.dataForm.engineerList.push(this.dataForm.engineerNo)
}
this.dataForm.technicianList = []
if (this.dataForm.technicianNo !== '') {
- this.dataForm.technicianList.push(this.dataForm.technicianNo) // Artwork
+ this.dataForm.technicianList.push(this.dataForm.technicianNo)
}
this.dataForm.csOperatorList = []
if (this.dataForm.csOperater !== '') {
- this.dataForm.csOperatorList.push(this.dataForm.csOperater) // CS
+ this.dataForm.csOperatorList.push(this.dataForm.csOperater)
}
this.dataForm.planOperatorList = []
if (this.dataForm.planOperator !== '') {
- this.dataForm.planOperatorList.push(this.dataForm.planOperator) // Planner
+ this.dataForm.planOperatorList.push(this.dataForm.planOperator)
}
- this.saveLoading = true
- saveTechnicalSpecificationSheet(this.dataForm).then(({data}) => {
- if (data && data.code === 0) {
- this.$message.success( '操作成功')
- this.visible = false
- this.$emit('refreshDataList')
- if (this.jumpFlag) {
- setTimeout(() => {
- let now = Date.now()
- let inData = {
- site: this.$store.state.user.site,
- codeNo: data.row.codeNo,
- buNo: data.row.buNo,
- username: this.$store.state.user.name,
- uuid: now + '',
- activeName: 'baseInfo'
- }
- localStorage.setItem('tsfData', JSON.stringify(inData))
- window.open('#/BMPage/'+now);
- },500)
+
+ const doSave = () => {
+ this.saveLoading = true
+ saveTechnicalSpecificationSheet(this.dataForm).then(({data}) => {
+ if (data && data.code === 0) {
+ this.$message.success('操作成功')
+ this.visible = false
+ this.$emit('refreshDataList')
+ if (this.jumpFlag) {
+ setTimeout(() => {
+ let now = Date.now()
+ let inData = {
+ site: this.$store.state.user.site,
+ codeNo: data.row.codeNo,
+ buNo: data.row.buNo,
+ username: this.$store.state.user.name,
+ uuid: now + '',
+ activeName: 'baseInfo'
+ }
+ localStorage.setItem('tsfData', JSON.stringify(inData))
+ window.open('#/BMPage/' + now);
+ }, 500)
+ }
+ } else {
+ this.$message.error(data.msg)
}
- } else {
- this.$message.error(data.msg)
+ this.saveLoading = false
+ }).catch((error) => {
+ this.$message.error(error)
+ this.saveLoading = false
+ })
+ }
+
+ if (!this.dataForm.id) {
+ if (!this.dataForm.finalPartNo) {
+ this.$message.warning('请先选择IFS物料编码!')
+ return
}
- this.saveLoading = false
- }).catch((error)=>{
- this.$message.error(error)
- this.saveLoading = false
- })
+ partInformationSearch({
+ site: this.$store.state.user.site,
+ ifsPartNo: this.dataForm.finalPartNo,
+ limit: 1,
+ page: 1
+ }).then(({data}) => {
+ if (data && data.code === 0 && data.page.list.length > 0 && data.page.list[0].drawingNo) {
+ doSave()
+ } else {
+ this.$message.warning('该物料未获取编码,不能新增技术参数卡!')
+ }
+ }).catch(() => {
+ this.$message.error('验证物料编码信息失败,请重试!')
+ })
+ return
+ }
+ doSave()
},
changeTestDesc () {