Browse Source

YT-412:生产退料选择明细的时候需要根据物料来源库位查询按数量需要让其选择批次

intex_online20241111
songguoqiang 1 month ago
parent
commit
b0cc292b98
  1. 30
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

30
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -113,6 +113,7 @@ import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as ruleApi from '@/api/wms/rule/index'
const { loadStart, loadDone } = usePageLoading()
// 退
defineOptions({ name: 'ProductionreturnRequestMain' })
@ -202,7 +203,7 @@ const clearSearchInput = (formField) => {
tableData.value = []
}
}
let fromManagementPrecision = ref('')
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row)
@ -214,6 +215,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// message.warning(`${val[0]['itemCode']}`)
// return
// }
val[0]['batche']
let enableBuy = val[0]['enableBuy']
if(tableData.value.length>0){
enableBuy = tableData.value[0]['enableBuy']
@ -228,7 +230,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
val = val.filter(item=>item['enableBuy']==enableBuy)
let messageItemCodes = []
val.forEach(item=>{
val.forEach(async item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['itemCode'] = item['itemCode']
newRow['enableBuy'] = item['enableBuy']
@ -239,10 +241,32 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if (item['batch'] !== '') {
newRow['batch'] = item['batch']
}else{
newRow['batch'] = '000000'
const a = new Date();
newRow['batch'] = a.toISOString().split('T')[0]; // YYYY-MM-DD
}
// else {
// newRow['batch'] = '000000'
// }
newRow['packUnit'] = item['packUnit']
newRow['packQty'] = item['packQty']
//
row[formField] = val[0][searchField]
await ruleApi.getManagementPrecision({
itemCodes: [row['itemCode']],
locationCode:val[0]['locationCode']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY') {
newRow['batchFormItemType'] = 'FormDate'
newRow['disabled_batch'] = false
} else {
newRow['fromBatchFormItemType'] = ''
newRow['disabled_fromBatch'] = true
}
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])){
messageItemCodes.push(item['itemCode'])
}else{

Loading…
Cancel
Save