Browse Source

YT-1361WMS 报废出库申请 新增和导入时,应该校验数量不能大于库存数量

intex_online20241228
zhaoyiran 2 months ago
parent
commit
542fc97c5c
  1. 7
      src/api/wms/scrapRequestDetail/index.ts
  2. 8
      src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue
  3. 15
      src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts

7
src/api/wms/scrapRequestDetail/index.ts

@ -17,12 +17,15 @@ export interface ScrapRequestDetailVO {
itemDesc1: string itemDesc1: string
itemDesc2: string itemDesc2: string
projectCode: string projectCode: string
inventoryQty: number
qty: number qty: number
uom: string uom: string
updateTime: Date updateTime: Date
updater: string updater: string
} }
const message = useMessage() // 消息弹窗
// 查询报废出库申请子列表 // 查询报废出库申请子列表
export const getScrapRequestDetailPage = async (params) => { export const getScrapRequestDetailPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
@ -46,6 +49,10 @@ export const createScrapRequestDetail = async (data: ScrapRequestDetailVO) => {
// 修改报废出库申请子 // 修改报废出库申请子
export const updateScrapRequestDetail = async (data: ScrapRequestDetailVO) => { export const updateScrapRequestDetail = async (data: ScrapRequestDetailVO) => {
if(parseFloat(data.inventoryQty) < parseFloat(data.qty)){
message.warning("数量不能大于库存数量")
return
}
return await request.put({ url: `/wms/scrap-request-detail/update`, data }) return await request.put({ url: `/wms/scrap-request-detail/update`, data })
} }

8
src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue

@ -222,6 +222,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
newRow['singlePrice'] = itemCode ? itemCode['price'] : '' newRow['singlePrice'] = itemCode ? itemCode['price'] : ''
newRow['amount'] = newRow['qty'] * newRow['singlePrice'] newRow['amount'] = newRow['qty'] * newRow['singlePrice']
newRow['inventoryQty'] = item['qty']
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
// row['singlePrice'] = res.price // row['singlePrice'] = res.price
@ -725,6 +726,13 @@ const submitForm = async (formType, submitData) => {
item.amount = Number(item.amount).toFixed(2) item.amount = Number(item.amount).toFixed(2)
}) })
try { try {
const cmdExists = data.subList.some(filter =>
parseFloat(filter.inventoryQty) < parseFloat(filter.qty)
);
if(cmdExists){
message.warning("数量不能大于库存数量")
return
}
if (formType === 'create') { if (formType === 'create') {
console.log('【报废出库子列表】', data.subList) console.log('【报废出库子列表】', data.subList)
if (data.subList.length == 0) { if (data.subList.length == 0) {

15
src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts

@ -1144,6 +1144,21 @@ export const ScrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
// disabled: true // disabled: true
// } // }
// }, // },
{
label: '库存数量 ',
field: 'inventoryQty',
sort: 'custom',
isSearch: false,
isTable: false,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled:true
}
}
},
{ {
label: '数量', label: '数量',
field: 'qty', field: 'qty',

Loading…
Cancel
Save