领料退料物资类型选择逻辑优化

This commit is contained in:
zzyuan 2025-01-08 15:53:32 +08:00
parent 238c668ee0
commit a331ba90fb
2 changed files with 16 additions and 11 deletions

View File

@ -113,7 +113,7 @@
> >
<span v-html="highlightText(item.fullPath, searchKeyword)"></span> <span v-html="highlightText(item.fullPath, searchKeyword)"></span>
<span style="float: right; color: #8492a6; font-size: 13px"> <span style="float: right; color: #8492a6; font-size: 13px">
:{{ item.storageNum }} :{{ item.num }}
</span> </span>
</el-option> </el-option>
</el-select> </el-select>
@ -686,22 +686,21 @@ export default {
}, },
// //
processTypeData(data) { processTypeData(data) {
const result = [] const result = []
const traverse = (node, parents = []) => { const traverse = (node, parents = []) => {
const path = [...parents, node.typeName] const path = [...parents, node.typeName]
if (!node.children || node.children.length === 0) { if (!node.children || node.children.length === 0) {
result.push({ result.push({
typeId: node.typeId, typeId: node.typeId,
typeName: node.typeName, typeName: node.typeName,
fullPath: path.join(' / '), fullPath: path.join(' / '),
searchKey: path.join('').toLowerCase(), searchKey: path.join('').toLowerCase(),
storageNum: node.storageNum || 0, num: node.num || 0,
maTypeName: parents[parents.length - 1] || '', maTypeName: parents[parents.length - 1] || '',
specificationType: node.typeName, specificationType: node.typeName,
unitName: node.unitName, unitName: node.unitName,
unitValue: node.unitValue unitValue: node.unitValue,
manageType: node.manageType
}) })
} }
@ -740,14 +739,21 @@ export default {
type: 'warning' type: 'warning'
}) })
this.tempDeviceType = this.tempDeviceType.filter(id => id !== lastSelected) this.tempDeviceType = this.tempDeviceType.filter(id => id !== lastSelected)
} else if (typeData.storageNum <= 0) { } else if (typeData.num <= 0) {
this.$message.error('所选物资规格类型暂时无,无法申请!') this.$message.error('所选物资规格类型暂时无库,无法申请!')
this.tempDeviceType = this.tempDeviceType.filter(id => id !== lastSelected) this.tempDeviceType = this.tempDeviceType.filter(id => id !== lastSelected)
} else { } else {
console.log(typeData)
// //
this.equipmentList.unshift({ this.equipmentList.unshift({
...typeData, ...typeData,
preNum: 0 preNum: 0,
typeModel: typeData.typeName,
typeName:typeData.specificationType,
apDetection: '',
remark:'',
maCodeList:[],
bmFileInfos:[]
}) })
this.deviceType.push(lastSelected) this.deviceType.push(lastSelected)
this.$message({ this.$message({

View File

@ -683,7 +683,6 @@ export default {
// //
this.equipmentList.unshift({ this.equipmentList.unshift({
...typeData, ...typeData,
preNum: 0,
createTime: null, createTime: null,
productionTime: this.maForm.productionTime, productionTime: this.maForm.productionTime,
purchaseTaxPrice: 0, purchaseTaxPrice: 0,