Browse Source

YT-641制品回收变更

intex_online20241111
zhaoyiran 3 months ago
parent
commit
a3717d4eca
  1. 6
      src/api/wms/productredressRequestDetail/index.ts
  2. 11
      src/views/wms/productionManage/productredress/productredressRequestMain/index.vue
  3. 27
      src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts

6
src/api/wms/productredressRequestDetail/index.ts

@ -27,9 +27,11 @@ export interface ProductredressRequestDetailVO {
itemDesc2: string
projectCode: string
qty: number
inventoryQty: number
uom: string
toOwnerCode: string
}
const message = useMessage() // 消息弹窗
// 查询制品回收申请子列表
export const getProductredressRequestDetailPage = async (params) => {
@ -54,6 +56,10 @@ export const createProductredressRequestDetail = async (data: ProductredressRequ
// 修改制品回收申请子
export const updateProductredressRequestDetail = async (data: ProductredressRequestDetailVO) => {
if(parseFloat(data.inventoryQty) < parseFloat(data.qty)){
message.warning("回收数量不能大于库存数量")
return
}
return await request.put({ url: `/wms/productredress-request-detail/update`, data })
}

11
src/views/wms/productionManage/productredress/productredressRequestMain/index.vue

@ -155,6 +155,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['itemCode'] = item['itemCode']
newRow['qty'] = item['qty']
newRow['inventoryQty'] = item['qty']
newRow['uom'] = item['uom']
newRow['packingNumber'] = item['packingNumber']
newRow['batch'] = item['batch']
@ -189,6 +190,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
if (formField == 'itemCode') {
setV['itemCode'] = val[0]['itemCode']
setV['qty'] = val[0]['qty']
setV['inventoryQty'] = val[0]['qty']
setV['uom'] = val[0]['uom']
setV['packingNumber'] = val[0]['packingNumber']
setV['batch'] = val[0]['batch']
@ -450,8 +452,15 @@ const submitForm = async (formType, submitData) => {
data.subList.forEach(item=>{
item['workStationCode'] = data['workStationCode']
})
const cmdExists = data.subList.some(filter =>
parseFloat(filter.inventoryQty) < parseFloat(filter.qty)
);
if(cmdExists){
message.warning("回收数量不能大于库存数量")
return
}
if(data.subList.find(item => (item.qty <= 0))) {
message.warning('数量必须大于0')
message.warning('回收数量必须大于0')
formRef.value.formLoading = false
return
}

27
src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts

@ -644,6 +644,21 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
}
}
},
{
label: '库存数量 ',
field: 'inventoryQty',
sort: 'custom',
isSearch: false,
isTable: false,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled:true
}
}
},
{
label: '回收数量',
field: 'qty',
@ -651,13 +666,17 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
component: 'InputNumber',
componentProps: {
disabled: true
min: 0,
precision: 6,
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6,
}
},
// {

Loading…
Cancel
Save