Browse Source

2025-06-10

选择物料时能够看到/跳转这个物料的BOM信息(产品BOM、配方BOM)
操作中增加BOM的查看(仅查看,不可编辑)
master
fengyuan_yang 9 months ago
parent
commit
6be148088d
  1. 5
      src/api/part/recipeManagement.js
  2. 189
      src/views/modules/part/bomManagement.vue
  3. 169
      src/views/modules/part/recipeManagement.vue
  4. 6
      src/views/modules/sampleManagement/com_technical-add-or-update.vue

5
src/api/part/recipeManagement.js

@ -203,4 +203,9 @@ export const queryPartListRecipe = data => createAPI(`/plm/recipeManagement/quer
*/
export const queryPartListAll = data => createAPI(`/plm/recipeManagement/queryPartListAll`,'post',data)
/**
* 查子物料Recipe
*/
export const queryComponentPartRecipeList = data => createAPI(`/plm/recipeManagement/queryComponentPartRecipeList`,'post',data)

189
src/views/modules/part/bomManagement.vue

@ -465,7 +465,7 @@
</el-dialog>
<!-- 子明细物料模态框 -->
<el-dialog title="物料清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="940px">
<el-dialog title="物料清单" top="10vh" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="940px">
<el-form :inline="true" label-position="top" :model="componentPartData">
<el-form-item :label="'PLM物料编码'">
<el-input v-model="componentPartData.plmPartNo" clearable style="width: 120px"></el-input>
@ -489,7 +489,11 @@
<el-table
:height="250"
:data="componentPartList"
ref="componentPartTable"
:row-style="rowStyle"
@row-dblclick="getComponentRowData"
@row-click="componentPartClickRow"
@current-change="changeCurrentRow"
border
style="width: 100%;">
<el-table-column
@ -519,6 +523,33 @@
:total="totalPage3"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 子物料页签 -->
<el-tabs v-model="componentTable" style="width: 100%;height: 300px" type="border-card" @tab-click="tabClick" class="sub_detail-tab">
<!-- 子物料BOM -->
<el-tab-pane label="BOM" name="component_part_bom">
<el-table
:data="componentPartBomList"
height="250px"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnComponentPartList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<el-footer style="height:35px;margin-top:10px;text-align:center">
<el-button type="primary" @click="componentPartModelFlag = false">关闭</el-button>
</el-footer>
@ -933,6 +964,7 @@ import {
queryMultiLevelStructureTable, //
queryPartListBom, // BOM
queryPartListAll, // Purchase(Raw)
queryComponentPartBomList, // BOM
} from '@/api/part/bomManagement.js'
import ChooseList from '@/views/modules/common/Chooselist'
@ -1035,6 +1067,7 @@ export default {
//
detailTable: 'bom_detail',
subDetailTable: 'bom_sub_detail',
componentTable: 'component_part_bom',
// ======== ========
modalData: {
flag: '',
@ -1203,6 +1236,7 @@ export default {
itemCostDistribution: '',
updateBy: '',
},
componentPartCurrentRow: {},
// ======== ========
dataList: [],
partList: [],
@ -1217,6 +1251,7 @@ export default {
checkedByProduct: [],
operationList: [],
multiLevelStructureList: [],
componentPartBomList: [],
// ======== ========
columnList: [
{
@ -2521,6 +2556,96 @@ export default {
columnWidth: 100
},
],
columnComponentPartList: [
{
columnProp: 'engChgLevel',
headerAlign: "center",
align: "center",
columnLabel: 'BOM版本号',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 60
},
{
columnProp: 'bomType',
headerAlign: "center",
align: "center",
columnLabel: '制造类型',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'alternativeNo',
headerAlign: "center",
align: "center",
columnLabel: '替代编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 80
},
{
columnProp: 'alternativeDescription',
headerAlign: "center",
align: "left",
columnLabel: '替代名称',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'componentPart',
headerAlign: "center",
align: "left",
columnLabel: '子物料编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'componentPartDesc',
headerAlign: "center",
align: "left",
columnLabel: '子物料名称',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 200
},
{
columnProp: 'qtyPerAssembly',
headerAlign: "center",
align: "right",
columnLabel: '单位用量',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 140
},
{
columnProp: 'printUnit',
headerAlign: "center",
align: "left",
columnLabel: '计量单位',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 80
},
],
// ======== ========
rules: {
partNo: [
@ -3078,10 +3203,6 @@ export default {
this.$message.warning('请先选择替代!')
return
}
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
// this.$message.warning('!')
// return
// }
this.componentData = {
flag: '1',
site: this.$store.state.user.site,
@ -3128,10 +3249,6 @@ export default {
this.$message.warning('请先选择替代!')
return
}
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
// this.$message.warning('!')
// return
// }
this.componentData = {
flag: '1',
site: this.$store.state.user.site,
@ -3174,10 +3291,6 @@ export default {
//
updateComponentModal (row) {
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
// this.$message.warning('!')
// return
// }
this.componentData = {
flag: '2',
site: row.site,
@ -3210,10 +3323,6 @@ export default {
//
updateByProductModal (row) {
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
// this.$message.warning('!')
// return
// }
this.componentData = {
flag: '2',
site: row.site,
@ -3246,10 +3355,6 @@ export default {
//
updateManufStructCostDistribModal (row) {
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
// this.$message.warning('!')
// return
// }
this.manufStructCostDistribData = {
site: row.site,
partNo: row.partNo,
@ -3514,6 +3619,48 @@ export default {
})
},
// table
tabClick () {
if (this.componentTable === 'component_part_bom') {
this.queryComponentPartBomList()
}
},
// Bom
queryComponentPartBomList () {
let tempData = {
site: this.$store.state.user.site,
partNo: this.componentPartCurrentRow.partNo,
}
queryComponentPartBomList(tempData).then(({data}) => {
if (data && data.code === 0) {
this.componentPartBomList = data.rows
} else {
this.componentPartBomList = []
}
})
},
rowStyle ({row}) {
if (this.componentPartCurrentRow.partNo === row.partNo) {
return { 'background-color': '#E8F7F6', cursor: 'pointer' }
}
},
//
componentPartClickRow (row, column) {
this.componentPartCurrentRow = JSON.parse(JSON.stringify(row))
},
//
changeCurrentRow (row, oldRow) {
//
if (row) {
this.componentPartCurrentRow = JSON.parse(JSON.stringify(row))
this.tabClick()
}
},
// copy
queryCopyPartModal () {
this.copyPartData.limit = this.pageSize4

169
src/views/modules/part/recipeManagement.vue

@ -360,7 +360,7 @@
</el-dialog>
<!-- 子明细物料模态框 -->
<el-dialog title="物料清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="940px">
<el-dialog title="物料清单" top="10vh" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="940px">
<el-form :inline="true" label-position="top" :model="componentPartData">
<el-form-item :label="'PLM物料编码'">
<el-input v-model="componentPartData.plmPartNo" clearable style="width: 120px"></el-input>
@ -384,7 +384,11 @@
<el-table
:height="250"
:data="componentPartList"
ref="componentPartTable"
:row-style="rowStyle"
@row-dblclick="getComponentRowData"
@row-click="componentPartClickRow"
@current-change="changeCurrentRow"
border
style="width: 100%;">
<el-table-column
@ -414,6 +418,33 @@
:total="totalPage3"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 子物料页签 -->
<el-tabs v-model="componentTable" style="width: 100%;height: 300px" type="border-card" @tab-click="tabClick" class="sub_detail-tab">
<!-- 子物料BOM -->
<el-tab-pane label="BOM" name="component_part_bom">
<el-table
:data="componentPartBomList"
height="250px"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnComponentPartList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<el-footer style="height:35px;margin-top:10px;text-align:center">
<el-button type="primary" @click="componentPartModelFlag = false">关闭</el-button>
</el-footer>
@ -839,6 +870,7 @@ import {
queryMultiLevelStructureTable, //
queryPartListRecipe, // Recipe
queryPartListAll, // Purchase(Raw)
queryComponentPartRecipeList, //
} from '@/api/part/recipeManagement.js'
import ChooseList from '@/views/modules/common/Chooselist'
@ -941,6 +973,7 @@ export default {
//
detailTable: 'recipe_detail',
subDetailTable: 'recipe_sub_detail',
componentTable: 'component_part_bom',
// ======== ========
modalData: {
flag: '',
@ -1133,6 +1166,7 @@ export default {
itemCostDistribution: '',
updateBy: '',
},
componentPartCurrentRow: {},
// ======== ========
dataList: [],
partList: [],
@ -1147,6 +1181,7 @@ export default {
checkedByProduct: [],
operationList: [],
multiLevelStructureList: [],
componentPartBomList: [],
// ======== ========
columnList: [
{
@ -2505,6 +2540,96 @@ export default {
columnWidth: 100
},
],
columnComponentPartList: [
{
columnProp: 'engChgLevel',
headerAlign: "center",
align: "center",
columnLabel: 'BOM版本号',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 60
},
{
columnProp: 'bomType',
headerAlign: "center",
align: "center",
columnLabel: '制造类型',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'alternativeNo',
headerAlign: "center",
align: "center",
columnLabel: '替代编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 80
},
{
columnProp: 'alternativeDescription',
headerAlign: "center",
align: "left",
columnLabel: '替代名称',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'componentPart',
headerAlign: "center",
align: "left",
columnLabel: '子物料编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'componentPartDesc',
headerAlign: "center",
align: "left",
columnLabel: '子物料名称',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 200
},
{
columnProp: 'qtyPerAssembly',
headerAlign: "center",
align: "right",
columnLabel: '单位用量',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 140
},
{
columnProp: 'printUnit',
headerAlign: "center",
align: "left",
columnLabel: '计量单位',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 80
},
],
// ======== ========
rules: {
partNo: [
@ -3516,6 +3641,48 @@ export default {
})
},
// table
tabClick () {
if (this.componentTable === 'component_part_bom') {
this.queryComponentPartBomList()
}
},
// Bom
queryComponentPartBomList () {
let tempData = {
site: this.$store.state.user.site,
partNo: this.componentPartCurrentRow.partNo,
}
queryComponentPartRecipeList(tempData).then(({data}) => {
if (data && data.code === 0) {
this.componentPartBomList = data.rows
} else {
this.componentPartBomList = []
}
})
},
rowStyle ({row}) {
if (this.componentPartCurrentRow.partNo === row.partNo) {
return { 'background-color': '#E8F7F6', cursor: 'pointer' }
}
},
//
componentPartClickRow (row, column) {
this.componentPartCurrentRow = JSON.parse(JSON.stringify(row))
},
//
changeCurrentRow (row, oldRow) {
//
if (row) {
this.componentPartCurrentRow = JSON.parse(JSON.stringify(row))
this.tabClick()
}
},
// copy
queryCopyPartModal () {
this.copyPartData.limit = this.pageSize4

6
src/views/modules/sampleManagement/com_technical-add-or-update.vue

@ -112,7 +112,7 @@
<el-form-item :label="'备注'">
<el-input
type="textarea"
v-model="dataForm.remark"
v-model="dataForm.remarkPage"
:rows="3"
resize='none'
maxlength="120"
@ -437,7 +437,7 @@
partDesc: '',
status: '',
revNo: '',
remark: '',
remarkPage: '',
technician: '',
quotationOfficer: '',
engineer: '',
@ -840,7 +840,7 @@
partDesc: '',
status: '',
revNo: 1,
remark: '',
remarkPage: '',
technician: '',
quotationOfficer: '',
engineer: '',

Loading…
Cancel
Save