出入库附件上传

出入库附件上传
pull/1/head
siontion 9 months ago
parent f8cce3b6ad
commit 5c4c864597

@ -197,7 +197,7 @@
</el-button>
</el-upload>
</el-col>
<el-table :data="matUploadFiles" class="hl-table">
<el-table :data="formData.attachments" class="hl-table">
<el-table-column prop="name" label="文件名称" align="center">
<template #default="scope">
<!-- <div></div> -->
@ -288,10 +288,12 @@ import * as MaterialApi from '@/api/heli/material'
import * as WarehouseApi from '@/api/heli/warehouse'
import * as RgApi from '@/api/heli/rg'
import * as PnApi from '@/api/heli/pn'
import { deleteFile, downloadFile } from "@/api/infra/file"
import { deleteFile, downloadFile ,getFilePage} from "@/api/infra/file"
import download from "@/utils/download"
import * as UserApi from "@/api/system/user";
const reload = inject('reload')
const { t } = useI18n() //
const message = useMessage() //
@ -370,10 +372,6 @@ const handleDeleteAttachment = async (index, type) => {
matUploadFiles.value = matUploadFiles.value.filter(file1 => {
return file1.name != attachment.name || file1.businessFileType != type;
})
protocolUploadFiles.value = protocolUploadFiles.value.filter(file2 => {
return file2.name != attachment.name || file2.businessFileType != type;
})
}
}
//
@ -400,6 +398,7 @@ const open = async (type: string, id?: number) => {
}
defineExpose({ open }) // open
const storageid = ref()
var commonResult = ''
/** 提交表单 */
const emit = defineEmits(['success']) // success
@ -414,27 +413,31 @@ const submitForm = async () => {
//
storageid.value = await StorageApi.createStorage(data)
//
formData.value.productBomItemDOList.forEach(item => {
item.stockId = storageid.value
item.whId = formData.value.whId
})
const dataMats = formData.value.productBomItemDOList as unknown as StorageMatApi.StorageMatVO[]
await StorageMatApi.createStorageMatBatch(dataMats)
//
matUploadFiles.value = { 'businessType': 'STORAGE', 'businessId': storageid, 'businessFileType': '' }
matUploadFiles.value?.submit()
message.success(t('common.createSuccess'))
commonResult = 'common.createSuccess'
} else {
storageid.value = await StorageApi.getStorage(router.query.id)
await StorageApi.updateStorage(data)
message.success(t('common.updateSuccess'))
commonResult = 'common.updateSuccess'
}
//
goback()
emit('success')
//
formData.value.productBomItemDOList.forEach(item => {
item.stockId = storageid.value.id
item.whId = formData.value.whId
})
const dataMats = formData.value.productBomItemDOList as unknown as StorageMatApi.StorageMatVO[]
//await StorageMatApi.createStorageMatBatch(dataMats)
//
matUploadFiles.value = { 'businessType': 'STORAGE', 'businessId': storageid, 'businessFileType': '' }
matUploadRef.value!.submit()
message.success(t(commonResult))
//
reload();
router.query.id = storageid.value.id;
} finally {
formLoading.value = false
}
@ -618,15 +621,25 @@ onMounted(async () => {
const matVos = await MaterialApi.getMaterialPage(queryParamsMat2)
formData.value.productBomItemDOList.forEach(item => {
item.matId = matVos.list.find( (record) => record.id === item.matId)?.id
//item.matCode = matVos.list.find( (record) => record.id === item.matId)?.id
item.matName = matVos.list.find( (record) => record.id === item.matId)?.name
item.matSpec = matVos.list.find( (record) => record.id === item.matId)?.spec
item.matType = matVos.list.find( (record) => record.id === item.matId)?.materialType
item.matUnit = matVos.list.find( (record) => record.id === item.matId)?.unit
})
item.matId = matVos.list.find((record) => record.id === item.matId)?.id
//item.matCode = matVos.list.find( (record) => record.id === item.matId)?.id
item.matName = matVos.list.find((record) => record.id === item.matId)?.name
item.matSpec = matVos.list.find((record) => record.id === item.matId)?.spec
item.matType = matVos.list.find((record) => record.id === item.matId)?.materialType
item.matUnit = matVos.list.find((record) => record.id === item.matId)?.unit
})
//
//
let attParams = {
pageNo: 1,
pageSize: 99,
businessId: router.query.id,
businessType: 'STORAGE'
}
formData.value.attachments = (await getFilePage(attParams)).list;
}
userList.value = await UserApi.getSimpleUserList()

Loading…
Cancel
Save