Browse Source

2026-03-18

Inventory Part和项目信息页面增加【获取编码】【编码详情】功能
master
fengyuan_yang 3 months ago
parent
commit
863fef1679
  1. 26
      src/views/modules/code/generation.vue
  2. 101
      src/views/modules/part/bomManagement.vue
  3. 16
      src/views/modules/part/partInformation.vue
  4. 85
      src/views/modules/part/recipeManagement.vue
  5. 16
      src/views/modules/project/projectInfo/com_project_info_part.vue
  6. 89
      src/views/modules/sampleManagement/com_technical-add-or-update.vue

26
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 {
</el-col>
<el-col :span="3">
<el-form-item label="IFS Part No" :show-message="false">
<el-input v-model="searchModel.erpPartNo" @blur="handleBlurErpPartNo"></el-input>
<el-input v-model="searchModel.erpPartNo" :disabled="dialogMode && !!initialErpPartNo" @blur="handleBlurErpPartNo"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">

101
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('验证子物料编码信息失败,请重试!')
})
},
//

16
src/views/modules/part/partInformation.vue

@ -169,11 +169,11 @@
<el-form-item label="物料名称 / Part Desc." prop="partDesc" :rules="rules.partDesc" style="margin-left: -10px">
<el-input v-model="modalData.partDesc" clearable style="width: 330px"></el-input>
</el-form-item>
<el-form-item v-if="modalData.flag === '2' && !copyFlag2" label="编码">
<el-form-item v-if="modalData.flag === '2' && !copyFlag2 && modalData.status === 'Y'" label="编码">
<el-input v-model="modalData.drawingNo" readonly style="width: 150px" placeholder="获取编码后填入"></el-input>
</el-form-item>
<el-form-item v-if="modalData.flag === '2' && !copyFlag2" :label="' '">
<el-button type="primary" @click="drawingNoDialogVisible = true">获取编码</el-button>
<el-form-item v-if="modalData.flag === '2' && !copyFlag2 && modalData.status === 'Y'" :label="' '">
<el-button type="primary" @click="openDrawingNoDialog">获取编码</el-button>
</el-form-item>
<el-form-item v-if="modalData.flag === '2' && !copyFlag2" :label="' '">
<el-button type="primary" @click="toCopyPartModal">Copy Part</el-button>
@ -1432,7 +1432,7 @@
<!-- 获取编码对话框 -->
<el-dialog title="获取编码" :close-on-click-modal="false" top="5vh" v-drag :visible.sync="drawingNoDialogVisible" width="1100px" @close="drawingNoDialogVisible = false">
<code-generation :dialog-mode="true" @code-saved="handleCodeGenerated"></code-generation>
<code-generation :dialog-mode="true" :initial-erp-part-no="dialogErpPartNo" :initial-erp-part-desc="dialogErpPartDesc" @code-saved="handleCodeGenerated"></code-generation>
</el-dialog>
<!-- 编码详情对话框 -->
@ -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;

85
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('验证子物料编码信息失败,请重试!')
})
},
//

16
src/views/modules/project/projectInfo/com_project_info_part.vue

@ -107,11 +107,11 @@
<el-form-item label="物料名称 / Part Desc." prop="partDesc" :rules="rules.partDesc" style="margin-left: -10px">
<el-input v-model="modalData.partDesc" clearable style="width: 300px"></el-input>
</el-form-item>
<el-form-item v-if="modalData.flag === '2'" label="编码">
<el-form-item v-if="modalData.flag === '2' && modalData.status === 'Y'" label="编码">
<el-input v-model="modalData.drawingNo" readonly style="width: 150px" placeholder="获取编码后填入"></el-input>
</el-form-item>
<el-form-item v-if="modalData.flag === '2'" :label="' '">
<el-button type="primary" @click="drawingNoDialogVisible = true">获取编码</el-button>
<el-form-item v-if="modalData.flag === '2' && modalData.status === 'Y'" :label="' '">
<el-button type="primary" @click="openDrawingNoDialog">获取编码</el-button>
</el-form-item>
<el-form-item label="客户料号" prop="customerPartNo" :rules="rules.customerPartNo">
<el-input v-model="modalData.customerPartNo" clearable style="width: 120px"></el-input>
@ -977,7 +977,7 @@
<!-- 获取编码对话框 -->
<el-dialog title="获取编码" :close-on-click-modal="false" top="5vh" v-drag :visible.sync="drawingNoDialogVisible" width="1100px" @close="drawingNoDialogVisible = false">
<code-generation :dialog-mode="true" @code-saved="handleCodeGenerated"></code-generation>
<code-generation :dialog-mode="true" :initial-erp-part-no="dialogErpPartNo" :initial-erp-part-desc="dialogErpPartDesc" @code-saved="handleCodeGenerated"></code-generation>
</el-dialog>
<!-- 编码详情对话框 -->
@ -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;

89
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 () {

Loading…
Cancel
Save