From 374cf1b48c6f1cca14fae9b45253b80904e2c68a Mon Sep 17 00:00:00 2001 From: qiuhongwu Date: Wed, 15 May 2024 14:59:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/biz/storage/StorageOut.vue | 78 ++----------------- 1 file changed, 8 insertions(+), 70 deletions(-) diff --git a/mes-ui/mes-ui-admin-vue3/src/views/biz/storage/StorageOut.vue b/mes-ui/mes-ui-admin-vue3/src/views/biz/storage/StorageOut.vue index 035b47fe..4187cbaf 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/biz/storage/StorageOut.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/biz/storage/StorageOut.vue @@ -653,8 +653,6 @@ const subFormLoading = ref(false) // 子表单的加载中 const subFormRules = reactive({ matId: [{ required: true, message: '物料不能为空', trigger: 'blur' }], matCode: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }], - rgId: [{ required: true, message: '库区不能为空', trigger: 'blur' }], - pnId: [{ required: true, message: '库位不能为空', trigger: 'blur' }], storageOkQty: [{ required: true, message: '出库数量不能为空', trigger: 'blur' }] }) @@ -694,9 +692,7 @@ const getProject = async (pro, scope) => { formData.value.matItemDOList.forEach((item) => { if ( item.matId == scope.value.row.matId && - item.whId == scope.value.row.whId && - item.rgId == scope.value.row.rgId && - item.pnId == scope.value.row.pnId + item.whId == scope.value.row.whId ) { item.projectNo = pro.projectSubId item.projectSubName = pro.projectSubName @@ -731,15 +727,18 @@ const handleStatus = async (num) => { // 校验子表单 try { await matSubFormRef.value.validate() + } catch (e) { return } + + var repeatItem = [] formData.value.matItemDOList.forEach((item) => { if ( formData.value.matItemDOList.filter( - (mat) => mat.matId == item.matId && mat.pnId == item.pnId + (mat) => mat.matId == item.matId ).length > 1 ) { var tmpCode = '[' + item.matCode + ']' @@ -763,7 +762,6 @@ const handleStatus = async (num) => { matCurrentData.find( (mat) => mat.matId == rest.matId && - mat.pnId == rest.pnId && mat.matRest < Number(rest.storageOkQty) ) !== undefined || rest.storageOkQty.length == 0 @@ -779,7 +777,6 @@ const handleStatus = async (num) => { await message.confirm('确认提交出库信息?') //保存表单数据 await saveFormData() - data.outbound = useUserStore().getUser.id } else { await StorageApi.updateStorage(data) @@ -955,7 +952,7 @@ const submitForm = async () => { var repeatItem = [] formData.value.matItemDOList.forEach((item) => { if ( - formData.value.matItemDOList.filter((mat) => mat.matId == item.matId && mat.pnId == item.pnId) + formData.value.matItemDOList.filter((mat) => mat.matId == item.matId) .length > 1 ) { var tmpCode = '[' + item.matCode + ']' @@ -990,7 +987,6 @@ const submitForm = async () => { matCurrentData.find( (mat) => mat.matId == rest.matId && - mat.pnId == rest.pnId && mat.matRest < Number(rest.storageOkQty) ) !== undefined || rest.storageOkQty.length == 0 @@ -1017,33 +1013,6 @@ const submitForm = async () => { } } -const onAddItem = () => { - if (formData.value.whId) { - const newData = { - // 新数据的属性 - stockId: 0, - matId: '', - matName: '', - matCode: '', - matType: '', - matSpec: '', - matUnit: '', - whId: '', - rgId: '', - pnId: '', - pnlist: ref([]), - storageOkQty: '', - lotNo: '', - description: '', - productBomItemValueDOList: [], - matList: matList.value - } - - formData.value.matItemDOList.push(newData) - } else { - message.alertWarning('请选择出库仓库') - } -} //删除新增物料信息 const handleDelete2 = (index: number) => { @@ -1052,14 +1021,9 @@ const handleDelete2 = (index: number) => { //仓库全数据 const whList = ref([]) -//库区全数据 -const rgList = ref([]) -//库位全数据 -const pnList = ref([]) -const handleWh = async (wid) => { - formData.value.matItemDOList = [] - formData.value.rgId = '' +const handleWh = async () => { + formData.value.matItemDOList = [] //await getMatList() } const getMatList = async (name) => { @@ -1085,33 +1049,7 @@ const getMatList = async (name) => { // ) } -const matSelectLoading = ref(false) -const remoteMatNameSearch = async (name) => { - matSelectLoading.value = true - // 获得物料列表 - await getMatList(name) - matSelectLoading.value = false -} - -const handleMatName = async (scope, matid) => { - scope.row.matId = scope.row.matList.find((item) => item.id === matid)?.id - scope.row.matName = scope.row.matList.find((item) => item.id === matid)?.name - scope.row.matCode = scope.row.matList.find((item) => item.id === matid)?.code - scope.row.matSpec = scope.row.matList.find((item) => item.id === matid)?.spec - scope.row.matType = scope.row.matList.find((item) => item.id === matid)?.materialType - scope.row.matUnit = scope.row.matList.find((item) => item.id === matid)?.unit - - scope.row.rgId = '' - scope.row.pnId = '' - if (matid.length == 0) { - } - scope.row.pnlist = pnList.value.filter( - (pn) => - pn.wh_id == formData.value.whId && - matLastData.value.filter((mat) => mat.matId == matid && mat.pnId == pn.id).length > 0 - ) -} const matLastData = ref([]) // 按钮控制