|
@ -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{ |
|
|