|
|
@ -91,6 +91,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
|
import {importTemplateHoldOk} from "@/api/wms/inventorymoveRequestMain"; |
|
|
|
import * as ruleApi from '@/api/wms/rule/index' |
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
|
// 隔离转线边申请HoldtoWipRequestMain |
|
|
|
// 只有隔离转线边申请在使用的 |
|
|
@ -288,16 +289,18 @@ InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
const fromManagementPrecision = ref('') |
|
|
|
const toManagementPrecision = ref('') |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
nextTick(() => { |
|
|
|
nextTick(async () => { |
|
|
|
console.log(formField) |
|
|
|
if (type == 'tableForm') { |
|
|
|
if(formField == 'fromPackingNumber'){ |
|
|
|
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus'])) |
|
|
|
if(val.length==0) return |
|
|
|
val.forEach(item=>{ |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
|
if (formField == 'fromPackingNumber') { |
|
|
|
val = val.filter(item => !tableData.value.find(item1 => item1['itemCode'] == item['itemCode'] && item1['fromBatch'] == item['batch'] && item1['fromPackingNumber'] == item['packingNumber'] && item1['fromLocationCode'] == item['locationCode'] && item1['fromInventoryStatus'] == item['inventoryStatus'])) |
|
|
|
if (val.length == 0) return |
|
|
|
val.forEach(item => { |
|
|
|
const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...item })) |
|
|
|
newRow['fromPackingNumber'] = item['packingNumber'] |
|
|
|
newRow['fromContainerNumber'] = item['containerNumber'] |
|
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
@ -306,12 +309,41 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
newRow['fromLocationCode'] = item['locationCode'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
newRow['qty'] = item['qty'] |
|
|
|
|
|
|
|
|
|
|
|
newRow['toInventoryStatus'] = "OK" //HoldtoWipRequestMain 隔离转线边 |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} else if (formField == 'toLocationCode') {//到库位代码 |
|
|
|
//从批次 |
|
|
|
await ruleApi.getManagementPrecision({ |
|
|
|
itemCodes: [row['itemCode']], |
|
|
|
locationCode: row['fromLocationCode'] |
|
|
|
}).then((res) => { |
|
|
|
fromManagementPrecision.value = res[0].ManagementPrecision |
|
|
|
}) |
|
|
|
|
|
|
|
if (fromManagementPrecision.value == 'BY_QUANTITY') {//如果从批次+物料管理精度是按数量 |
|
|
|
//到批次 |
|
|
|
await ruleApi.getManagementPrecision({ |
|
|
|
itemCodes: [row['itemCode']], |
|
|
|
locationCode: val[0][searchField] |
|
|
|
}).then((res) => { |
|
|
|
toManagementPrecision.value = res[0].ManagementPrecision |
|
|
|
}) |
|
|
|
if (toManagementPrecision.value != 'BY_QUANTITY') {//到批次+物料管理精度非数量需要添加批次 |
|
|
|
if (row['fromBatch'] == '') { |
|
|
|
row['fromBatch'] = getFormattedDate(); // 获取 YYYYMMDD 格式的日期 |
|
|
|
} |
|
|
|
row['fromBatchFormItemType'] = 'FormDate' |
|
|
|
row['disabled_fromBatch'] = false |
|
|
|
} else { |
|
|
|
row['fromBatchFormItemType'] = '' |
|
|
|
row['disabled_fromBatch'] = true |
|
|
|
} |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} else { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
@ -708,4 +740,11 @@ onMounted(async () => { |
|
|
|
importTemplateData.templateUrl = await InventorymoveRequestMainApi.importTemplateExceptMove() |
|
|
|
|
|
|
|
}) |
|
|
|
const getFormattedDate = () =>{ |
|
|
|
const a = new Date(); |
|
|
|
const year = a.getFullYear(); |
|
|
|
const month = String(a.getMonth() + 1).padStart(2, '0'); |
|
|
|
const day = String(a.getDate()).padStart(2, '0'); |
|
|
|
return `${year}${month}${day}`; |
|
|
|
} |
|
|
|
</script> |
|
|
|