|
|
@ -653,8 +653,6 @@ const subFormLoading = ref(false) // 子表单的加载中
|
|
|
|
const subFormRules = reactive({
|
|
|
|
const subFormRules = reactive({
|
|
|
|
matId: [{ required: true, message: '物料不能为空', trigger: 'blur' }],
|
|
|
|
matId: [{ required: true, message: '物料不能为空', trigger: 'blur' }],
|
|
|
|
matCode: [{ 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' }]
|
|
|
|
storageOkQty: [{ required: true, message: '出库数量不能为空', trigger: 'blur' }]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -694,9 +692,7 @@ const getProject = async (pro, scope) => {
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
item.matId == scope.value.row.matId &&
|
|
|
|
item.matId == scope.value.row.matId &&
|
|
|
|
item.whId == scope.value.row.whId &&
|
|
|
|
item.whId == scope.value.row.whId
|
|
|
|
item.rgId == scope.value.row.rgId &&
|
|
|
|
|
|
|
|
item.pnId == scope.value.row.pnId
|
|
|
|
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
item.projectNo = pro.projectSubId
|
|
|
|
item.projectNo = pro.projectSubId
|
|
|
|
item.projectSubName = pro.projectSubName
|
|
|
|
item.projectSubName = pro.projectSubName
|
|
|
@ -731,15 +727,18 @@ const handleStatus = async (num) => {
|
|
|
|
// 校验子表单
|
|
|
|
// 校验子表单
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
await matSubFormRef.value.validate()
|
|
|
|
await matSubFormRef.value.validate()
|
|
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var repeatItem = []
|
|
|
|
var repeatItem = []
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
formData.value.matItemDOList.filter(
|
|
|
|
formData.value.matItemDOList.filter(
|
|
|
|
(mat) => mat.matId == item.matId && mat.pnId == item.pnId
|
|
|
|
(mat) => mat.matId == item.matId
|
|
|
|
).length > 1
|
|
|
|
).length > 1
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
var tmpCode = '[' + item.matCode + ']'
|
|
|
|
var tmpCode = '[' + item.matCode + ']'
|
|
|
@ -763,7 +762,6 @@ const handleStatus = async (num) => {
|
|
|
|
matCurrentData.find(
|
|
|
|
matCurrentData.find(
|
|
|
|
(mat) =>
|
|
|
|
(mat) =>
|
|
|
|
mat.matId == rest.matId &&
|
|
|
|
mat.matId == rest.matId &&
|
|
|
|
mat.pnId == rest.pnId &&
|
|
|
|
|
|
|
|
mat.matRest < Number(rest.storageOkQty)
|
|
|
|
mat.matRest < Number(rest.storageOkQty)
|
|
|
|
) !== undefined ||
|
|
|
|
) !== undefined ||
|
|
|
|
rest.storageOkQty.length == 0
|
|
|
|
rest.storageOkQty.length == 0
|
|
|
@ -779,7 +777,6 @@ const handleStatus = async (num) => {
|
|
|
|
await message.confirm('确认提交出库信息?')
|
|
|
|
await message.confirm('确认提交出库信息?')
|
|
|
|
//保存表单数据
|
|
|
|
//保存表单数据
|
|
|
|
await saveFormData()
|
|
|
|
await saveFormData()
|
|
|
|
|
|
|
|
|
|
|
|
data.outbound = useUserStore().getUser.id
|
|
|
|
data.outbound = useUserStore().getUser.id
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
await StorageApi.updateStorage(data)
|
|
|
|
await StorageApi.updateStorage(data)
|
|
|
@ -955,7 +952,7 @@ const submitForm = async () => {
|
|
|
|
var repeatItem = []
|
|
|
|
var repeatItem = []
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
if (
|
|
|
|
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
|
|
|
|
.length > 1
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
var tmpCode = '[' + item.matCode + ']'
|
|
|
|
var tmpCode = '[' + item.matCode + ']'
|
|
|
@ -990,7 +987,6 @@ const submitForm = async () => {
|
|
|
|
matCurrentData.find(
|
|
|
|
matCurrentData.find(
|
|
|
|
(mat) =>
|
|
|
|
(mat) =>
|
|
|
|
mat.matId == rest.matId &&
|
|
|
|
mat.matId == rest.matId &&
|
|
|
|
mat.pnId == rest.pnId &&
|
|
|
|
|
|
|
|
mat.matRest < Number(rest.storageOkQty)
|
|
|
|
mat.matRest < Number(rest.storageOkQty)
|
|
|
|
) !== undefined ||
|
|
|
|
) !== undefined ||
|
|
|
|
rest.storageOkQty.length == 0
|
|
|
|
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) => {
|
|
|
|
const handleDelete2 = (index: number) => {
|
|
|
@ -1052,14 +1021,9 @@ const handleDelete2 = (index: number) => {
|
|
|
|
|
|
|
|
|
|
|
|
//仓库全数据
|
|
|
|
//仓库全数据
|
|
|
|
const whList = ref([])
|
|
|
|
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()
|
|
|
|
//await getMatList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const getMatList = async (name) => {
|
|
|
|
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([])
|
|
|
|
const matLastData = ref([])
|
|
|
|
// 按钮控制
|
|
|
|
// 按钮控制
|
|
|
|