feat(xzdstoragelog): 添加出入库单据生成功能

This commit is contained in:
zxy 2026-04-08 09:32:07 +08:00
parent aebf8c65a7
commit 37f40e1c16

View File

@ -303,16 +303,11 @@ const getList = async () => {
const data = await StorageLogApi.getStorageLogPage(queryParams)
list.value = data.list
total.value = data.total
// 1|
//
// '1|'
list.value.forEach((item) => {
if (!item.priceType) {
item.priceType = '1|临时暂估价'
}
//
if (item.materialDOList && item.materialDOList.length === 1) {
item.matId = item.materialDOList[0].id
}
})
} finally {
loading.value = false
@ -352,8 +347,8 @@ const getMatCode = async () => {
try {
const selectedList = multipleSelection.value || [] //
// 1.
if (!selectedList || selectedList.length == null) {
message.error('提交明细不能为空,请确认')
if (!selectedList || selectedList.length === 0) {
message.error('请先选择数据')
return
}
loading.value = true
@ -362,11 +357,18 @@ const getMatCode = async () => {
//
const data = await StorageLogApi.getStorageLogPage(queryParams)
// list.value Vue
// Vue
data.list?.forEach((newRow) => {
//
if (!queryParams.ids.includes(newRow.id)) return
const row = list.value.find((r) => r.id == newRow.id)
if (!row) return
//
if (!row.priceType) {
row.priceType = '1|临时暂估价'
}
if (newRow.materialDOList && newRow.materialDOList.length > 0) {
// materialDOList
row.materialDOList = newRow.materialDOList
@ -430,29 +432,10 @@ const handleMatSelectFocus = async (row) => {
if (newRow && newRow.materialDOList) {
row.materialDOList = newRow.materialDOList
if (row.matId == null || row.matId === '') {
// matId == 1 > 1
if (newRow.materialDOList.length === 1) {
const mat = newRow.materialDOList[0]
row.matId = mat.id
row.matCode = mat.code
row.matName = mat.name
row._autoSelectMatId = true //
}
} else if (row._autoSelectMatId && newRow.materialDOList.length > 1) {
//
row.matId = undefined
row.matCode = ''
row.matName = ''
row._autoSelectMatId = false
} else {
// matId
// matId
if (row.matId != null && row.matId !== '') {
const mat = newRow.materialDOList.find((m) => m.id == row.matId)
if (mat) {
row.matId = mat.id
row.matCode = mat.code
row.matName = mat.name
} else {
if (!mat) {
row.matId = undefined
row.matCode = ''
row.matName = ''
@ -557,8 +540,8 @@ const submitForm = async () => {
try {
const selectedList = multipleSelection.value || [] //
// 1.
if (!selectedList || selectedList.length == null) {
message.error('提交明细不能为空,请确认')
if (!selectedList || selectedList.length === 0) {
message.error('请先选择数据')
return
}
// 2. 使
@ -688,10 +671,6 @@ const handleMatIdChange = (val, row) => {
// ID
item.matId = val
item._autoSelectMatId = false //
// "1|"
if (!item.priceType) {
item.priceType = '1|临时暂估价'
}
//
const selectedMat = item.materialDOList?.find((m) => m.id === val)
if (selectedMat) {
@ -707,10 +686,6 @@ const handleMatIdChange = (val, row) => {
row.matCode = selectedMat.code
row.matName = selectedMat.name
}
// "1|"
if (!row.priceType) {
row.priceType = '1|临时暂估价'
}
}
}
</script>