Commit 96bf93d4 by wusiyi

fix: 修复默认配货区被清空bug

parent c018e910
......@@ -572,6 +572,14 @@ watch(visible, async (value: boolean) => {
sortingAreaId.value = hit.id
warehouseId.value = hit.warehouseId
isAutoPrint.value = hit.autoPrint
} else {
const defaultArea =
sortingAreaList.value.find(
(item) => item.defaultWarehouse === 1 && item.areaCode === 'AREA_0',
) || sortingAreaList.value[0]
sortingAreaId.value = defaultArea.id
warehouseId.value = defaultArea.warehouseId
isAutoPrint.value = defaultArea.autoPrint || false
}
} else {
/* 先找一次,确认本地值是否存在于列表 */
......@@ -1566,13 +1574,6 @@ const getSortingAreaList = async () => {
const res = await getSortingRuleListApi({})
if (res.code !== 200) return
sortingAreaList.value = res.data.records
const defaultArea =
sortingAreaList.value.find(
(item) => item.defaultWarehouse === 1 && item.areaCode === 'AREA_0',
) || sortingAreaList.value[0]
sortingAreaId.value = defaultArea.id
warehouseId.value = defaultArea.warehouseId
isAutoPrint.value = defaultArea.autoPrint || false
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment