han\hanst 2 months ago
parent
commit
52916fd778
  1. 32
      src/views/modules/part/bom_create.vue
  2. 7
      src/views/modules/part/part_create.vue
  3. 47
      src/views/modules/part/quicklyCreateBom.vue

32
src/views/modules/part/bom_create.vue

@ -1660,13 +1660,13 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2ConsumptionItem',
serialNumber: '601002Table2OperationNo',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'consumptionItem',
columnProp: 'operationNo',
headerAlign: 'center',
align: 'center',
columnLabel: '消耗项目',
columnLabel: '工序编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -1678,31 +1678,31 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2IssueType',
serialNumber: '601002Table2OperationName',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'issueType',
columnProp: 'operationName',
headerAlign: 'center',
align: 'center',
columnLabel: '生产属性',
align: 'left',
columnLabel: '工序名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2OperationNo',
serialNumber: '601002Table2ConsumptionItem',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'operationNo',
columnProp: 'consumptionItem',
headerAlign: 'center',
align: 'center',
columnLabel: '工序编码',
columnLabel: '消耗项目',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -1714,20 +1714,20 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2OperationName',
serialNumber: '601002Table2IssueType',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'operationName',
columnProp: 'issueType',
headerAlign: 'center',
align: 'left',
columnLabel: '工序名称',
align: 'center',
columnLabel: '生产属性',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 140
},
{
userId: this.$store.state.user.name,

7
src/views/modules/part/part_create.vue

@ -3584,13 +3584,8 @@ export default {
// BU
let buValue = data.data.buNo || this.modalData.buNo || ''
buValue = this.$store.state.user.site+'_'+buValue
let buNoValue = buValue
// buValue 线 "site_buNo"
if (buValue && buValue.includes('_')) {
buNoValue = buValue.split('_')[1]
}
// tempData
this.tempData = {
site: this.$store.state.user.site,

47
src/views/modules/part/quicklyCreateBom.vue

@ -2307,10 +2307,10 @@ export default {
columnWidth: 100
},
{
columnProp: 'partType2',
columnProp: 'tempNo',
headerAlign: "center",
align: "center",
columnLabel: '零件类型',
columnLabel: '模板',
columnHidden: false,
columnImage: false,
status: true,
@ -2318,16 +2318,17 @@ export default {
columnWidth: 100
},
{
columnProp: 'tempNo',
columnProp: 'partType2',
headerAlign: "center",
align: "center",
columnLabel: '模板',
columnLabel: '零件类型',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'umName',
headerAlign: "center",
@ -4681,8 +4682,44 @@ export default {
}
getChooselist1(propLists).then((data) => {
if (data.data && data.data.code === 0){
// umList """"
let umList = data.data.list[this.partList1.length][0] || []
if (Array.isArray(umList) && umList.length > 0) {
try {
const priorityList = []
const otherList = []
umList.forEach(item => {
if (!item) return
const umid = String(item.fieldname1 || item.UMID || '')
const umName = String(item.caption1 || item.UMName || '')
const isQianZhang = umid === '1002' || umName.includes('千张')
const isMi = umName === '米' || (umName.includes('米') && umName.length <= 2 && !umName.includes('千'))
if (isMi || isQianZhang) {
priorityList.push({ item, isMi, isQianZhang })
} else {
otherList.push(item)
}
})
//
priorityList.sort((a, b) => {
if (a.isMi && !b.isMi) return -1
if (!a.isMi && b.isMi) return 1
return 0
})
if (priorityList.length > 0) {
umList = [...priorityList.map(p => p.item), ...otherList]
}
} catch (error) {
console.warn('计量单位排序失败,使用原始顺序:', error)
}
}
for (let i = 0; i < this.partList1.length; i++) {
this.$set(this.partList1[i], 'umList', data.data.list[this.partList1.length][0]);
this.$set(this.partList1[i], 'umList', umList);
this.$set(this.partList1[i], 'partFamilyList', data.data.list[i][0]);
this.$set(this.partList1[i], 'partProductGroupList1', data.data.list[i][1]);
this.$set(this.partList1[i], 'partProductGroupList2', data.data.list[i][2]);

Loading…
Cancel
Save