|
|
@ -72,7 +72,7 @@ |
|
|
</el-pagination> |
|
|
</el-pagination> |
|
|
|
|
|
|
|
|
<!-- 物料新增/编辑模态框 --> |
|
|
<!-- 物料新增/编辑模态框 --> |
|
|
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="1000px"> |
|
|
|
|
|
|
|
|
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" @close="handleDialogClose" width="1000px"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
<el-form-item label="物料编码" prop="partNo" :rules="rules.partNo"> |
|
|
<el-form-item label="物料编码" prop="partNo" :rules="rules.partNo"> |
|
|
<el-input v-model="modalData.partNo" disabled style="width: 128px"></el-input> |
|
|
<el-input v-model="modalData.partNo" disabled style="width: 128px"></el-input> |
|
|
@ -529,7 +529,7 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-footer style="height:35px;margin-top: 20px;text-align:center"> |
|
|
<el-footer style="height:35px;margin-top: 20px;text-align:center"> |
|
|
<el-button type="primary" @click="saveData()">保存</el-button> |
|
|
<el-button type="primary" @click="saveData()">保存</el-button> |
|
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="closeModal()">关闭</el-button> |
|
|
</el-footer> |
|
|
</el-footer> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
@ -1726,7 +1726,14 @@ import { |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
itemSelections: [] |
|
|
|
|
|
|
|
|
itemSelections: [], |
|
|
|
|
|
watchers: [], |
|
|
|
|
|
unwatchTable: null, // 用于保存监听器的取消函数 |
|
|
|
|
|
mainInfoFlag: false, // 主信息标识 |
|
|
|
|
|
costsInfoFlag: false, // costs标识 |
|
|
|
|
|
manufacturingInfoFlag: false, // Manufacturing标识 |
|
|
|
|
|
planningInfoFlag: false, // planning标识 |
|
|
|
|
|
partItemInfoFlag: false, // 属性信息标识 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -1735,6 +1742,75 @@ import { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 重置标识 |
|
|
|
|
|
resetFlags () { |
|
|
|
|
|
this.mainInfoFlag = false |
|
|
|
|
|
this.costsInfoFlag = false |
|
|
|
|
|
this.manufacturingInfoFlag = false |
|
|
|
|
|
this.planningInfoFlag = false |
|
|
|
|
|
this.partItemInfoFlag = false |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 设置监听 |
|
|
|
|
|
setupWatchers() { |
|
|
|
|
|
this.teardownWatchers() |
|
|
|
|
|
const groups = { |
|
|
|
|
|
mainInfoFlag: ['partType', 'hazardCode', 'productGroupId4', 'productGroupId3', |
|
|
|
|
|
'umId', 'groupId', 'productGroupId1', 'familyId', 'productGroupId2', 'typeDesignation', |
|
|
|
|
|
'assetClass', 'dimQuality', 'partStatus', 'weightNet', 'uomForWeightNet', 'frequencyClass', |
|
|
|
|
|
'abcClass', 'volumeNet', 'uomForVolumeNet', 'lifecycleStage', 'manufacturingLeadTime', |
|
|
|
|
|
'countryOfOrigin', 'expectedLeadTime', 'durabilityDay', 'regionOfOrigin', 'intrastatConvFactor', |
|
|
|
|
|
'customsStatNo', 'remark', 'inventoryValuationMethod', 'partCostGroupId', 'inventoryPartCostLevel', |
|
|
|
|
|
'invoiceConsideration', 'zeroCostFlag'], |
|
|
|
|
|
costsInfoFlag: ['estimatedMaterialCost'], |
|
|
|
|
|
manufacturingInfoFlag: ['cumLeadTime', 'backFlushPart', 'byProdAsSupplyInMrpDb', 'unprotectedLeadTime', |
|
|
|
|
|
'issueType', 'mrpControlFlagDb', 'fixedLeadTimeDay', 'overReporting', 'useTheoreticalDensityDb', |
|
|
|
|
|
'variableLeadTimeDay', 'overReportTolerance', 'fixedLeadTimeHour', 'density', 'variableLeadTimeHour'], |
|
|
|
|
|
planningInfoFlag: ['planningMethod', 'safetyStock', 'minOrderQty', 'maxOrderQty', 'mulOrderQty', |
|
|
|
|
|
'safetyLeadTime', 'shrinkageFac', 'stdOrderQty'], |
|
|
|
|
|
} |
|
|
|
|
|
Object.entries(groups).forEach(([flagName, keys]) => { |
|
|
|
|
|
keys.forEach(key => { |
|
|
|
|
|
const unwatch = this.$watch( |
|
|
|
|
|
() => this.modalData[key], |
|
|
|
|
|
(newVal, oldVal) => { |
|
|
|
|
|
if (oldVal === undefined) return; // 忽略初始化赋值 |
|
|
|
|
|
if (newVal !== oldVal && !this[flagName]) { |
|
|
|
|
|
this[flagName] = true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
this.watchers.push(unwatch) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
let isFirstChange = true |
|
|
|
|
|
this.unwatchTable = this.$watch( |
|
|
|
|
|
() => JSON.stringify(this.partItemList), |
|
|
|
|
|
(newVal, oldVal) => { |
|
|
|
|
|
if (isFirstChange) { |
|
|
|
|
|
isFirstChange = false |
|
|
|
|
|
return // 第一次不处理 |
|
|
|
|
|
} |
|
|
|
|
|
if (newVal !== oldVal) { |
|
|
|
|
|
this.partItemInfoFlag = true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 清除监听 |
|
|
|
|
|
teardownWatchers () { |
|
|
|
|
|
// 清除其他信息监听 |
|
|
|
|
|
this.watchers.forEach(unwatch => unwatch()) |
|
|
|
|
|
this.watchers = [] |
|
|
|
|
|
// 清除属性监听 |
|
|
|
|
|
if (this.unwatchTable) { |
|
|
|
|
|
this.unwatchTable() |
|
|
|
|
|
this.unwatchTable = null |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 子明细每页数 |
|
|
// 子明细每页数 |
|
|
sizeChangeHandle (val) { |
|
|
sizeChangeHandle (val) { |
|
|
this.pageSize = val |
|
|
this.pageSize = val |
|
|
@ -2038,6 +2114,11 @@ import { |
|
|
ifsPartNo: '', |
|
|
ifsPartNo: '', |
|
|
showInQueryFlag: 'Y', |
|
|
showInQueryFlag: 'Y', |
|
|
temporaryPartFlag: 'Y', |
|
|
temporaryPartFlag: 'Y', |
|
|
|
|
|
mainInfoFlag: false, // 主信息标识 |
|
|
|
|
|
costsInfoFlag: false, // costs标识 |
|
|
|
|
|
manufacturingInfoFlag: false, // Manufacturing标识 |
|
|
|
|
|
planningInfoFlag: false, // planning标识 |
|
|
|
|
|
partItemInfoFlag: false // 属性信息标识 |
|
|
} |
|
|
} |
|
|
this.partItemList = [] |
|
|
this.partItemList = [] |
|
|
this.modalFlag = true |
|
|
this.modalFlag = true |
|
|
@ -2161,7 +2242,14 @@ import { |
|
|
ifsPartNo: data.rows.ifsPartNo, |
|
|
ifsPartNo: data.rows.ifsPartNo, |
|
|
showInQueryFlag: data.rows.showInQueryFlag, |
|
|
showInQueryFlag: data.rows.showInQueryFlag, |
|
|
temporaryPartFlag: data.rows.temporaryPartFlag, |
|
|
temporaryPartFlag: data.rows.temporaryPartFlag, |
|
|
} |
|
|
|
|
|
|
|
|
mainInfoFlag: false, // 主信息标识 |
|
|
|
|
|
costsInfoFlag: false, // costs标识 |
|
|
|
|
|
manufacturingInfoFlag: false, // Manufacturing标识 |
|
|
|
|
|
planningInfoFlag: false, // planning标识 |
|
|
|
|
|
partItemInfoFlag: false // 属性信息标识 |
|
|
|
|
|
} |
|
|
|
|
|
this.resetFlags() // 重置标识 |
|
|
|
|
|
this.setupWatchers() // 设置监听 |
|
|
this.getPartCharacteristicList(row.testPartNo) |
|
|
this.getPartCharacteristicList(row.testPartNo) |
|
|
this.modalFlag = true |
|
|
this.modalFlag = true |
|
|
this.modalDisableFlag = true |
|
|
this.modalDisableFlag = true |
|
|
@ -2284,6 +2372,11 @@ import { |
|
|
ifsPartNo: data.rows.ifsPartNo, |
|
|
ifsPartNo: data.rows.ifsPartNo, |
|
|
showInQueryFlag: 'Y', |
|
|
showInQueryFlag: 'Y', |
|
|
temporaryPartFlag: 'Y', |
|
|
temporaryPartFlag: 'Y', |
|
|
|
|
|
mainInfoFlag: false, // 主信息标识 |
|
|
|
|
|
costsInfoFlag: false, // costs标识 |
|
|
|
|
|
manufacturingInfoFlag: false, // Manufacturing标识 |
|
|
|
|
|
planningInfoFlag: false, // planning标识 |
|
|
|
|
|
partItemInfoFlag: false // 属性信息标识 |
|
|
} |
|
|
} |
|
|
this.getPartCharacteristicList(row.testPartNo) |
|
|
this.getPartCharacteristicList(row.testPartNo) |
|
|
this.modalFlag = true |
|
|
this.modalFlag = true |
|
|
@ -2295,6 +2388,18 @@ import { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 关闭模态框 |
|
|
|
|
|
closeModal () { |
|
|
|
|
|
this.modalFlag = false |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 模态框关闭事件 |
|
|
|
|
|
handleDialogClose () { |
|
|
|
|
|
if (this.modalData.flag === '2') { |
|
|
|
|
|
this.teardownWatchers() // 清除监听 |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 物料信息新增 / 编辑 |
|
|
// 物料信息新增 / 编辑 |
|
|
saveData () { |
|
|
saveData () { |
|
|
if (this.modalData.partNo === '' || this.modalData.partNo == null) { |
|
|
if (this.modalData.partNo === '' || this.modalData.partNo == null) { |
|
|
@ -2380,6 +2485,11 @@ import { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
this.modalData.mainInfoFlag = this.mainInfoFlag |
|
|
|
|
|
this.modalData.costsInfoFlag = this.costsInfoFlag |
|
|
|
|
|
this.modalData.manufacturingInfoFlag = this.manufacturingInfoFlag |
|
|
|
|
|
this.modalData.planningInfoFlag = this.planningInfoFlag |
|
|
|
|
|
this.modalData.partItemInfoFlag = this.partItemInfoFlag |
|
|
partInformationEdit2(this.modalData).then(({data}) => { |
|
|
partInformationEdit2(this.modalData).then(({data}) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.searchTable() |
|
|
this.searchTable() |
|
|
|