|
|
|
@ -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()
|
|
|
|
|