Browse Source

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

syhx
zhang_li 2 months ago
parent
commit
a7a2738e55
  1. 42
      src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue
  2. 38
      src/views/wms/basicDataManage/itemManage/itemarea/index.vue

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

@ -49,6 +49,7 @@
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onBlur="onBlur"
@onChange="onChange"
/>
<!-- 详情 -->
@ -189,29 +190,37 @@ const handleDisable = async (id: number) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
nextTick(() => {
if (type == "update") {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
}
if (item.field == 'warehouseCode') {
}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
}
if (item.field == 'warehouseCode') {
}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
}
})
}
basicFormRef.value.open(type, row)
})
}
// form
@ -320,6 +329,27 @@ const searchFormClick = (searchData) => {
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() => {

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

@ -118,6 +118,7 @@ const isShowButton = ref(true)
const updataTableColumns = (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 ) => {
@ -147,6 +148,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV['areaCode'] = val[0]['code']
setV['areaType'] = val[0]['type']
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') {
setV['inPackUnit'] = val[0]['packUnit']
@ -305,28 +321,38 @@ const handleDisable = async (id: number) => {
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
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
}
if (item.field == 'itemCode') {
}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
}
if (item.field == 'itemCode') {
}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 = [] //
formRef.value.open(type, row)
}
/**

Loading…
Cancel
Save