dev
qiuhongwu 5 months ago
parent 8826d2d899
commit 374cf1b48c

@ -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([])
//

Loading…
Cancel
Save