Browse Source

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

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

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

@ -113,6 +113,7 @@ import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam' import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as ruleApi from '@/api/wms/rule/index'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// 退 // 退
defineOptions({ name: 'ProductionreturnRequestMain' }) defineOptions({ name: 'ProductionreturnRequestMain' })
@ -202,7 +203,7 @@ const clearSearchInput = (formField) => {
tableData.value = [] tableData.value = []
} }
} }
let fromManagementPrecision = ref('')
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
console.log('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']}`) // message.warning(`${val[0]['itemCode']}`)
// return // return
// } // }
val[0]['batche']
let enableBuy = val[0]['enableBuy'] let enableBuy = val[0]['enableBuy']
if(tableData.value.length>0){ if(tableData.value.length>0){
enableBuy = tableData.value[0]['enableBuy'] enableBuy = tableData.value[0]['enableBuy']
@ -228,7 +230,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
val = val.filter(item=>item['enableBuy']==enableBuy) val = val.filter(item=>item['enableBuy']==enableBuy)
let messageItemCodes = [] let messageItemCodes = []
val.forEach(item=>{ val.forEach(async item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['itemCode'] = item['itemCode'] newRow['itemCode'] = item['itemCode']
newRow['enableBuy'] = item['enableBuy'] newRow['enableBuy'] = item['enableBuy']
@ -238,11 +240,33 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// 000000 // 000000
if (item['batch'] !== '') { if (item['batch'] !== '') {
newRow['batch'] = item['batch'] newRow['batch'] = item['batch']
} else { }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['packUnit'] = item['packUnit']
newRow['packQty'] = item['packQty'] 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'])){ if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])){
messageItemCodes.push(item['itemCode']) messageItemCodes.push(item['itemCode'])
}else{ }else{

Loading…
Cancel
Save