|
|
|
@ -202,6 +202,14 @@
|
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue: '' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '库存数量', |
|
|
|
|
key: 'number', |
|
|
|
|
type: FormTypes.inputNumber, |
|
|
|
|
width: '200px', |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue: '' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '调拨目标', |
|
|
|
|
key: 'allotTarget', |
|
|
|
@ -259,8 +267,9 @@
|
|
|
|
|
add: '/hy/processMaterialsAllot/add', |
|
|
|
|
edit: '/hy/processMaterialsAllot/edit', |
|
|
|
|
queryById: '/hy/processMaterialsAllot/queryById', |
|
|
|
|
descriptionRake: '/suppliesstronger/processSuppliesStronger/descriptionName', //查询物料组 |
|
|
|
|
merchandiseNewsList: '/suppliesstronger/processSuppliesStronger/merchandiseNews', |
|
|
|
|
descriptionRake: '/wastematerials/processWasteMaterials/wasteMaterialsName', //查询物料组 |
|
|
|
|
merchandiseNewsList: '/wastematerials/processWasteMaterials/merchandiseNewsName', |
|
|
|
|
unitWasteNameUrl: '/unitwaste/processUnitWasteWarehouseCode/unitWasteName', |
|
|
|
|
processMaterialsAllotList: { |
|
|
|
|
list: '/hy/processMaterialsAllot/queryProcessMaterialsAllotListByMainId' |
|
|
|
|
} |
|
|
|
@ -354,10 +363,10 @@
|
|
|
|
|
if (item.merchandiseNewsId === record.row.equipment) { |
|
|
|
|
materialName = { |
|
|
|
|
name: item.merchandiseName, |
|
|
|
|
unit: item.materialsUnit, |
|
|
|
|
unit: item.unit, |
|
|
|
|
supplierName: item.supplierName, |
|
|
|
|
price: item.price, |
|
|
|
|
residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber, |
|
|
|
|
number : item.number === undefined ? 0 : item.number, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -371,51 +380,46 @@
|
|
|
|
|
'materialUnit': materialName.unit, |
|
|
|
|
'supplier': materialName.supplierName, |
|
|
|
|
'materialPrice': materialName.price, |
|
|
|
|
'actualSendNumber': materialName.residueNumber, |
|
|
|
|
'materialAmount': materialName.price * materialName.residueNumber, |
|
|
|
|
'number': materialName.number, |
|
|
|
|
'materialAmount': 0, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
console.log("",values); |
|
|
|
|
// console.log("",values); |
|
|
|
|
this.$refs.processMaterialsAllotList.setValues(values); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 根据请发数量计算 |
|
|
|
|
if(record.row.pleaseSendNumber !== '' && record.row.pleaseSendNumber !== undefined){ |
|
|
|
|
// console.log("执行了",record.row) |
|
|
|
|
if(record.row.allotNumber !== '' && record.row.allotNumber !== undefined){ |
|
|
|
|
let res = record.row; |
|
|
|
|
let materialName = {} |
|
|
|
|
this.bigIdMerchandiseNewsList.forEach(item => { |
|
|
|
|
if (item.merchandiseNewsId === record.row.equipment) { |
|
|
|
|
materialName = { |
|
|
|
|
residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber, |
|
|
|
|
number : item.number === undefined ? 0 : item.number, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// console.log("materialName.residueNumber",materialName.residueNumber) |
|
|
|
|
if(parseInt( res.pleaseSendNumber) > parseInt( materialName.residueNumber )){ |
|
|
|
|
if(parseInt( res.allotNumber) > parseInt( materialName.number )){ |
|
|
|
|
// console.log("大于") |
|
|
|
|
this.$message.warn("输入请发数不能大于库存数") |
|
|
|
|
res.pleaseSendNumber = materialName.residueNumber; |
|
|
|
|
res.actualSendNumber = materialName.residueNumber; |
|
|
|
|
}else{ |
|
|
|
|
// console.log("小于") |
|
|
|
|
res.actualSendNumber = res.pleaseSendNumber; |
|
|
|
|
this.$message.warn("输入调拨数量不能大于库存数量") |
|
|
|
|
res.allotNumber = materialName.number; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let value = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: res.id, |
|
|
|
|
values: { |
|
|
|
|
// 'equipment': res.equipment, |
|
|
|
|
'equipment': res.equipment, |
|
|
|
|
// 'materialGroup': res.materialGroup, |
|
|
|
|
// 'materialName': res.materialName, |
|
|
|
|
// 'materialUnit': res.materialUnit, |
|
|
|
|
// 'supplier': res.supplier, |
|
|
|
|
// 'materialPrice': res.materialPrice, |
|
|
|
|
'actualSendNumber': res.actualSendNumber, |
|
|
|
|
'pleaseSendNumber': res.pleaseSendNumber, |
|
|
|
|
'materialAmount': res.materialPrice * res.actualSendNumber, |
|
|
|
|
// 'materialName': res.name, |
|
|
|
|
// 'materialUnit': res.unit, |
|
|
|
|
// 'supplier': res.supplierName, |
|
|
|
|
// 'materialPrice': res.price, |
|
|
|
|
// 'number': res.number, |
|
|
|
|
'allotNumber': res.allotNumber, |
|
|
|
|
'materialAmount': res.materialPrice * parseInt( res.allotNumber), |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
@ -509,6 +513,25 @@
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getAction(this.url.unitWasteNameUrl,null).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
if(this.processMaterialsAllotListTable.columns[7].options.length > 0){ |
|
|
|
|
this.processMaterialsAllotListTable.columns[7].options = []; |
|
|
|
|
} |
|
|
|
|
res.result.forEach( item => { |
|
|
|
|
this.processMaterialsAllotListTable.columns[7].options.push({ |
|
|
|
|
title : item.departName, |
|
|
|
|
value : item.libraryAssociationIdInvisible, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|