diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue index 83cf290f..25bd407b 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue @@ -12,14 +12,14 @@ - + - + @@ -32,7 +32,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -95,7 +95,7 @@ @@ -278,7 +278,8 @@ 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 { ITEM_RENDER_EVT } from 'element-plus/es/components/virtual-list/src/defaults' +import {deleteFile, downloadFile} from "@/api/infra/file"; +import download from "@/utils/download"; const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -309,8 +310,10 @@ const formData = ref({ productBomItemDOList: [] }) const formRules = reactive({ - name: [{ required: true, message: '模具类型不能为空', trigger: 'blur' }], - status: [{ required: true, message: '启用状态不能为空', trigger: 'blur' }] + // name: [{ required: true, message: '模具类型不能为空', trigger: 'blur' }], + status: [{ required: true, message: '启用状态不能为空', trigger: 'blur' }], + stockInType :[{ required: true, message: '入库类型不能为空', trigger: 'blur' }], + whId :[{ required: true, message: '入库仓库不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref @@ -455,7 +458,7 @@ const handleDelete2 = (index: number) => { const fileList = ref([ { name: 'element-plus-logo.svg', - url: 'https://element-plus.org/images/element-plus-logo.svg', + url: 'http://127.0.0.1:8080/admin-api/infra/file/5/get/d229467d4ad143582725cc39d16dd04c660034b71e3ddcfe930901639bbccee5.png', uploadTimestamp: '2024-1-12 16:06' }, { @@ -481,6 +484,12 @@ const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { console.log('333') } +// 下载文件 +const downloadAttachment = async (name, url) => { + const data = await downloadFile(url) + download.any(data, name); +} + let uploadTimestamp: any = null const handleBeforeUpload = (file: File) => { uploadTimestamp = new Date().toISOString() // 获取并保存当前时间戳 @@ -532,7 +541,7 @@ const handleWh = (async (wid) => { formData.value.productBomItemDOList.forEach( item =>{ item.rgid = '' item.pnid = '' - item.pnlist = [] + item.pnlist.value = [] }) //------------------- }) @@ -545,8 +554,7 @@ const handleRg = (async (scope) => { pnStatus: 1 }) const dataPn = await PnApi.getPnPage(queryParamsRPn) - pnList.value = [] - pnList.value = dataPn.list + scope.row.pnid = '' scope.row.pnlist = dataPn.list //------------------- }) @@ -585,15 +593,22 @@ const remoteMatCodeSearch = async (query) => { } -const handleMatCode = async (scope) =>{ +const handleMatCode = async (scope,matid) =>{ - if(scope.row.matCode){ + if(matid){ const matVo = await MaterialApi.getMaterial(scope.row.matCode) scope.row.matId = matVo.id scope.row.matName = matVo.name scope.row.matSpec = matVo.spec scope.row.matType = matVo.materialType scope.row.matUnit = matVo.unit + }else{ + scope.row.matId = '' + scope.row.matCode = '' + scope.row.matName = '' + scope.row.matSpec = '' + scope.row.matType = '' + scope.row.matUnit = '' } }