出入库附件上传

出入库附件上传
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'
//
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'))
} else { } else {
storageid.value = await StorageApi.getStorage(router.query.id)
await StorageApi.updateStorage(data) await StorageApi.updateStorage(data)
message.success(t('common.updateSuccess')) commonResult = 'common.updateSuccess'
} }
// //
goback() formData.value.productBomItemDOList.forEach(item => {
emit('success') 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 { } finally {
formLoading.value = false formLoading.value = false
} }
@ -618,15 +621,25 @@ onMounted(async () => {
const matVos = await MaterialApi.getMaterialPage(queryParamsMat2) const matVos = await MaterialApi.getMaterialPage(queryParamsMat2)
formData.value.productBomItemDOList.forEach(item => { formData.value.productBomItemDOList.forEach(item => {
item.matId = matVos.list.find( (record) => record.id === item.matId)?.id item.matId = matVos.list.find((record) => record.id === item.matId)?.id
//item.matCode = 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.matName = matVos.list.find((record) => record.id === item.matId)?.name
item.matSpec = matVos.list.find( (record) => record.id === item.matId)?.spec item.matSpec = matVos.list.find((record) => record.id === item.matId)?.spec
item.matType = matVos.list.find( (record) => record.id === item.matId)?.materialType item.matType = matVos.list.find((record) => record.id === item.matId)?.materialType
item.matUnit = matVos.list.find( (record) => record.id === item.matId)?.unit 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() userList.value = await UserApi.getSimpleUserList()

Loading…
Cancel
Save