领料退料物资类型选择逻辑优化
This commit is contained in:
parent
238c668ee0
commit
a331ba90fb
|
|
@ -113,7 +113,7 @@
|
|||
>
|
||||
<span v-html="highlightText(item.fullPath, searchKeyword)"></span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">
|
||||
库存:{{ item.storageNum }}
|
||||
出库:{{ item.num }}
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
|
@ -686,22 +686,21 @@ export default {
|
|||
},
|
||||
// 处理类型数据
|
||||
processTypeData(data) {
|
||||
const result = []
|
||||
|
||||
const result = []
|
||||
const traverse = (node, parents = []) => {
|
||||
const path = [...parents, node.typeName]
|
||||
|
||||
const path = [...parents, node.typeName]
|
||||
if (!node.children || node.children.length === 0) {
|
||||
result.push({
|
||||
typeId: node.typeId,
|
||||
typeName: node.typeName,
|
||||
fullPath: path.join(' / '),
|
||||
searchKey: path.join('').toLowerCase(),
|
||||
storageNum: node.storageNum || 0,
|
||||
num: node.num || 0,
|
||||
maTypeName: parents[parents.length - 1] || '',
|
||||
specificationType: node.typeName,
|
||||
unitName: node.unitName,
|
||||
unitValue: node.unitValue
|
||||
unitValue: node.unitValue,
|
||||
manageType: node.manageType
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -740,14 +739,21 @@ export default {
|
|||
type: 'warning'
|
||||
})
|
||||
this.tempDeviceType = this.tempDeviceType.filter(id => id !== lastSelected)
|
||||
} else if (typeData.storageNum <= 0) {
|
||||
this.$message.error('所选物资规格类型暂时无库存,无法申请!')
|
||||
} else if (typeData.num <= 0) {
|
||||
this.$message.error('所选物资规格类型暂时无出库,无法申请!')
|
||||
this.tempDeviceType = this.tempDeviceType.filter(id => id !== lastSelected)
|
||||
} else {
|
||||
console.log(typeData)
|
||||
// 将新项添加到数组开头,实现倒序
|
||||
this.equipmentList.unshift({
|
||||
...typeData,
|
||||
preNum: 0
|
||||
preNum: 0,
|
||||
typeModel: typeData.typeName,
|
||||
typeName:typeData.specificationType,
|
||||
apDetection: '',
|
||||
remark:'',
|
||||
maCodeList:[],
|
||||
bmFileInfos:[]
|
||||
})
|
||||
this.deviceType.push(lastSelected)
|
||||
this.$message({
|
||||
|
|
|
|||
|
|
@ -683,7 +683,6 @@ export default {
|
|||
// 将新项添加到数组开头,实现倒序
|
||||
this.equipmentList.unshift({
|
||||
...typeData,
|
||||
preNum: 0,
|
||||
createTime: null,
|
||||
productionTime: this.maForm.productionTime,
|
||||
purchaseTaxPrice: 0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue