新购类型选择逻辑优化
This commit is contained in:
parent
bec91890d9
commit
238c668ee0
|
|
@ -176,13 +176,7 @@
|
||||||
v-model.number="scope.row.purchaseNum"
|
v-model.number="scope.row.purchaseNum"
|
||||||
controls-position="right" type="number"
|
controls-position="right" type="number"
|
||||||
style="width: 100%" :disabled="scope.row.status!=1&&scope.row.status!=12"
|
style="width: 100%" :disabled="scope.row.status!=1&&scope.row.status!=12"
|
||||||
:min="0"
|
:min="0" @input="v =>scope.row.unitValue == 1? (scope.row.purchaseNum = Number(v.replace(/[^\d.]/g, ''))): (scope.row.purchaseNum = Number(v.replace(/[^\d]/g, '')))"
|
||||||
@input="
|
|
||||||
v =>
|
|
||||||
scope.row.unitValue == 1
|
|
||||||
? (scope.row.purchaseNum = Number(v.replace(/[^\d.]/g, '')))
|
|
||||||
: (scope.row.purchaseNum = Number(v.replace(/[^\d]/g, '')))
|
|
||||||
"
|
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -624,7 +618,6 @@ 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]
|
||||||
|
|
||||||
|
|
@ -638,7 +631,8 @@ export default {
|
||||||
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,
|
||||||
|
rentPrice: node.rentPrice,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -665,7 +659,6 @@ export default {
|
||||||
// 选择变化处理
|
// 选择变化处理
|
||||||
handleTypeChange(val) {
|
handleTypeChange(val) {
|
||||||
if (!val || val.length === 0) return
|
if (!val || val.length === 0) return
|
||||||
|
|
||||||
// 获取新选中的项
|
// 获取新选中的项
|
||||||
const lastSelected = val[val.length - 1]
|
const lastSelected = val[val.length - 1]
|
||||||
const typeData = this.flattenTypeOptions.find(item => item.typeId === lastSelected)
|
const typeData = this.flattenTypeOptions.find(item => item.typeId === lastSelected)
|
||||||
|
|
@ -681,10 +674,25 @@ export default {
|
||||||
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,"typeData")
|
||||||
|
if(typeData.rentPrice>0){//判断是否有租赁价格:有禁用;无修改;
|
||||||
|
typeData.rentPriceDisabled=true
|
||||||
|
}else{
|
||||||
|
typeData.rentPriceDisabled=false
|
||||||
|
}
|
||||||
// 将新项添加到数组开头,实现倒序
|
// 将新项添加到数组开头,实现倒序
|
||||||
this.equipmentList.unshift({
|
this.equipmentList.unshift({
|
||||||
...typeData,
|
...typeData,
|
||||||
preNum: 0
|
preNum: 0,
|
||||||
|
createTime: null,
|
||||||
|
productionTime: this.maForm.productionTime,
|
||||||
|
purchaseTaxPrice: 0,
|
||||||
|
purchaseTaxPrice: 0,
|
||||||
|
purchaseNum : 1,
|
||||||
|
fixCode: '0',
|
||||||
|
status:1,
|
||||||
|
bmFileInfos:[]
|
||||||
|
|
||||||
})
|
})
|
||||||
this.deviceType.push(lastSelected)
|
this.deviceType.push(lastSelected)
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue