出入库附件上传

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

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

Loading…
Cancel
Save