Browse Source

YT-448:计划外出库申请校验管理精度数量

intex_online20241111
songguoqiang 1 month ago
parent
commit
8e1f3134da
  1. 37
      src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue
  2. 12
      src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts

37
src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue

@ -93,6 +93,7 @@ import * as UnplannedissueRequestDetailApi from '@/api/wms/unplannedissueRequest
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
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: 'UnplannedissueRequestMain' }) defineOptions({ name: 'UnplannedissueRequestMain' })
@ -109,21 +110,43 @@ const tableColumns = ref([...UnplannedissueRequestMain.allSchemas.tableColumns,.
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const fromManagementPrecision = ref('')
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => { nextTick(async() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
if(formField === 'itemCode'){ if(formField === 'itemCode'){
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['batch']==item['batch']&&item1['packingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['inventoryStatus']==item['inventoryStatus'])) val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['batch']==item['batch']&&item1['packingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['inventoryStatus']==item['inventoryStatus']))
if(val.length==0) return if(val.length==0) return
val.forEach(item=>{ val.forEach(async item=>{
let newRow = JSON.parse(JSON.stringify(tableFormKeys)) let newRow = JSON.parse(JSON.stringify(tableFormKeys))
newRow[formField] =item[searchField] newRow[formField] =item[searchField]
newRow['packingNumber'] = item['packingNumber'] newRow['packingNumber'] = item['packingNumber']
newRow['containerNumber'] = item['containerNumber'] newRow['containerNumber'] = item['containerNumber']
newRow['batch'] = item['batch'] newRow['batch'] = item['batch']
//
await ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:item['locationCode']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY') {//+
if(newRow['batch']==''){
newRow['batch'] = getFormattedDate(); // YYYYMMDD
}
newRow['batchFormItemType'] = 'FormDate'
newRow['disabled_batch'] = false
}else {
newRow['bathFormItemType'] = ''
newRow['disabled_batch'] = true
}
newRow['inventoryStatus'] = item['inventoryStatus'] newRow['inventoryStatus'] = item['inventoryStatus']
newRow['fromLocationCode'] = item['locationCode'] newRow['fromLocationCode'] = item['locationCode']
newRow['itemCode'] = item['itemCode'] newRow['itemCode'] = item['itemCode']
@ -586,4 +609,12 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await UnplannedissueRequestMainApi.importTemplate() importTemplateData.templateUrl = await UnplannedissueRequestMainApi.importTemplate()
}) })
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> </script>

12
src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts

@ -801,13 +801,17 @@ export const UnplannedissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: { table: {
width: 150 width: 150
}, },
tableForm: {
disabled: true,
placeholder: '请选择从批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
},
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true,
valueFormat: 'YYYYMMDD',
} }
},
tableForm: {
disabled:true
} }
}, },
{ {

Loading…
Cancel
Save