Browse Source

物料库区配置管理,库区管理管理精度修改

syhx
zhang_li 1 month ago
parent
commit
a7a2738e55
  1. 74
      src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue
  2. 68
      src/views/wms/basicDataManage/itemManage/itemarea/index.vue

74
src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue

@ -49,6 +49,7 @@
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
@onBlur="onBlur" @onBlur="onBlur"
@onChange="onChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -189,29 +190,37 @@ const handleDisable = async (id: number) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
if(type == "update"){
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
}
if (item.field == 'warehouseCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
})
}else {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = false
}
if (item.field == 'warehouseCode') {
item.componentProps.disabled = false
item.componentProps.isSearchList = true
}
})
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
nextTick(() => {
if (type == "update") {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
}else if (item.field == 'warehouseCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
} else if (item.field == 'manageMode') {
if (row.type == 'WIP') {
item.componentProps.options = manageModeOptions.value
} else {
item.componentProps.options =manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
}
}
})
}else {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = false
}else if (item.field == 'warehouseCode') {
item.componentProps.disabled = false
item.componentProps.isSearchList = true
}else if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
basicFormRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value
}
})
}
})
} }
// form // form
@ -320,6 +329,27 @@ const searchFormClick = (searchData) => {
const onBlur = (field, e)=>{ const onBlur = (field, e)=>{
} }
const manageModeOptions = ref(JSON.parse(JSON.stringify(Area.allSchemas.formSchema.find(item=>item.field == 'manageMode').componentProps.options)))
const onChange = (field, e)=>{
if (field == 'type') {
if (e == 'WIP') {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value
basicFormRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value
}
})
} else {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
basicFormRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value
}
})
}
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async() => { onMounted(async() => {

68
src/views/wms/basicDataManage/itemManage/itemarea/index.vue

@ -118,6 +118,7 @@ const isShowButton = ref(true)
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const manageModeOptions = ref(JSON.parse(JSON.stringify(Itemarea.allSchemas.formSchema.find(item=>item.field == 'manageMode').componentProps.options)))
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
@ -147,6 +148,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV['areaCode'] = val[0]['code'] setV['areaCode'] = val[0]['code']
setV['areaType'] = val[0]['type'] setV['areaType'] = val[0]['type']
setV['manageMode'] = val[0]['manageMode'] setV['manageMode'] = val[0]['manageMode']
if (val[0]['type'] == 'WIP') {
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value
setV['manageMode'] = item.componentProps.options[0].value
}
})
} else {
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
setV['manageMode'] = item.componentProps.options[0].value
}
})
}
}else if(formField == 'inPackUnit') { }else if(formField == 'inPackUnit') {
setV['inPackUnit'] = val[0]['packUnit'] setV['inPackUnit'] = val[0]['packUnit']
@ -305,28 +321,38 @@ const handleDisable = async (id: number) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: number) => {
if(type == "update"){
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'areaCode') {
item.componentProps.isSearchList = false,
item.componentProps.disabled = true
}
if (item.field == 'itemCode') {
item.componentProps.isSearchList = false,
item.componentProps.disabled = true
}})
}else {
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'areaCode') {
item.componentProps.isSearchList = true
}
if (item.field == 'itemCode') {
item.componentProps.isSearchList = true
}
})
}
tableData.value = [] //
formRef.value.open(type, row) formRef.value.open(type, row)
nextTick(() => {
if(type == "update"){
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'areaCode') {
item.componentProps.isSearchList = false,
item.componentProps.disabled = true
}else if (item.field == 'itemCode') {
item.componentProps.isSearchList = false,
item.componentProps.disabled = true
} else if (item.field == 'manageMode') {
if (row.areaType == 'WIP') {
item.componentProps.options = manageModeOptions.value
} else {
item.componentProps.options =manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
}
}
})
}else {
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'areaCode') {
item.componentProps.isSearchList = true
}else if (item.field == 'itemCode') {
item.componentProps.isSearchList = true
}else if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
formRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value
}
})
}
})
tableData.value = [] //
} }
/** /**

Loading…
Cancel
Save