Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TFMOM
TF-MOM-WEB
Commits
08dda679
Commit
08dda679
authored
Nov 23, 2023
by
jingnan
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购入库导入修改
parent
3774a0c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
51 deletions
+70
-51
importFile.vue
...s/PurchasingWarehousingNewOrEdit/component/importFile.vue
+15
-3
index.vue
...nents/components/PurchasingWarehousingNewOrEdit/index.vue
+55
-48
No files found.
applications/dee-mes/src/privateComponents/components/PurchasingWarehousingNewOrEdit/component/importFile.vue
View file @
08dda679
...
...
@@ -122,13 +122,25 @@ export default {
},
// 上传excel
upLoadExcel
(
id
,
isNew
)
{
const
reqParams
=
{
id
:
this
.
param
.
id
||
id
||
''
,
billType
:
this
.
param
.
billType
||
''
,
arrivalDate
:
this
.
param
.
arrivalDate
||
''
,
materialTypeId
:
this
.
param
.
materialTypeId
||
''
,
extDxProductAreaId
:
this
.
param
.
extDxProductAreaId
||
''
,
extDxSipplierId
:
this
.
param
.
extDxSipplierId
||
''
}
const
arrReaParams
=
[]
for
(
const
key
in
reqParams
)
{
arrReaParams
.
push
(
`
${
key
}
=
${
reqParams
[
key
]
||
''
}
`
)
}
const
formData
=
new
FormData
()
formData
.
append
(
'file'
,
this
.
file
.
raw
)
this
.
$api
.
apiUploadFile
(
`/InStorageRequestItem/importByExcel?
id=
${
id
}
`
,
formData
).
then
(
res
=>
{
// 调用接口
this
.
$api
.
apiUploadFile
(
`/InStorageRequestItem/importByExcel?
${
arrReaParams
.
join
(
'&'
)
}
`
,
formData
).
then
(
res
=>
{
// 调用接口
this
.
uploading
=
false
this
.
$utils
.
showMessageSuccess
(
res
.
data
.
message
)
const
req
Id
=
isNew
?
id
:
null
this
.
$emit
(
'refreshTable'
,
req
Id
)
const
req
Obj
=
isNew
?
res
.
data
.
items
:
null
this
.
$emit
(
'refreshTable'
,
req
Obj
)
this
.
close
()
}).
catch
(
err
=>
{
this
.
uploading
=
false
...
...
applications/dee-mes/src/privateComponents/components/PurchasingWarehousingNewOrEdit/index.vue
View file @
08dda679
...
...
@@ -490,7 +490,7 @@ export default {
importParam
:
function
()
{
if
(
this
.
form
.
id
)
{
return
{
'id'
:
this
.
form
.
id
...
this
.
form
}
}
else
{
return
{
...
...
@@ -652,8 +652,9 @@ export default {
})
},
// 编辑采购入库明细查询InStorageRequestItem/search
searchInStorageRequestItem
(
id
)
{
this
.
newDataImportResId
=
id
searchInStorageRequestItem
(
reqObj
)
{
!
this
.
form
.
id
&&
reqObj
&&
typeof
(
reqObj
.
id
)
===
'number'
&&
(
this
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
reqObj
)))
this
.
newDataImportResId
=
reqObj
&&
reqObj
.
id
||
''
const
param
=
{
'rootCondition'
:
{
'pageFrom'
:
this
.
pagination
.
currentPage
,
...
...
@@ -665,7 +666,7 @@ export default {
{
'fieldName'
:
'inventoryReq.id'
,
'operator'
:
'EQ'
,
'value'
:
id
||
this
.
currBasicData
.
id
'value'
:
reqObj
&&
reqObj
.
id
||
this
.
currBasicData
&&
this
.
currBasicData
.
id
},
{
'fieldName'
:
'isRoot'
,
...
...
@@ -820,54 +821,60 @@ export default {
this
.
treeTableNoArrange
(
tableData
)
},
submit
(
saveAndImport
,
newData
)
{
const
tableData
=
this
.
submitData
.
slice
()
tableData
.
forEach
((
obj
,
i
)
=>
{
for
(
const
key
in
obj
)
{
if
(
key
===
'storageZone'
)
{
delete
tableData
[
i
][
key
]
// 导入时如果存在明细先调用保存接口再导入,如果不存在明细直接调用导入接口
if
(
this
.
submitData
&&
this
.
submitData
.
length
)
{
const
tableData
=
this
.
submitData
.
slice
()
tableData
.
forEach
((
obj
,
i
)
=>
{
for
(
const
key
in
obj
)
{
if
(
key
===
'storageZone'
)
{
delete
tableData
[
i
][
key
]
}
}
}
if
(
obj
.
children
.
length
>
0
)
{
obj
.
children
.
forEach
((
child
,
j
)
=>
{
for
(
const
ckey
in
child
)
{
if
(
ckey
===
'storageZone'
)
{
delete
tableData
[
i
][
'children'
][
j
][
ckey
]
if
(
obj
.
children
.
length
>
0
)
{
obj
.
children
.
forEach
((
child
,
j
)
=>
{
for
(
const
ckey
in
child
)
{
if
(
ckey
===
'storageZone'
)
{
delete
tableData
[
i
][
'children'
][
j
][
ckey
]
}
}
}
})
})
}
})
const
isVirtualHasChild
=
tableData
.
find
(
item
=>
item
.
isVirtual
&&
item
.
operator
!==
'REMOVE'
&&
(
!
item
.
children
||
!
item
.
children
.
length
||
item
.
children
&&
!
(
item
.
children
.
find
(
child
=>
child
.
operator
!==
'REMOVE'
))))
if
(
isVirtualHasChild
)
return
this
.
$utils
.
showMessageWarning
(
'父件为虚拟件时,必须添加子件!'
)
const
paramOperator
=
this
.
newDataImportResId
?
'MODIFY'
:
this
.
operator
const
param
=
{
'operator'
:
paramOperator
,
'billType'
:
this
.
form
.
billType
,
'arrivalDate'
:
this
.
form
.
arrivalDate
,
'materialTypeIdType'
:
'ExtDxProcessResourceType'
,
'extDxProductAreaIdType'
:
'ExtDxProductArea'
,
'extDxSipplierIdType'
:
'ExtDxSipplier'
,
'subTypeName'
:
'InStoragePurchase'
,
'reqStatus'
:
this
.
form
.
id
?
this
.
form
.
reqStatus
:
'Apply'
,
'extDxProductAreaId'
:
this
.
form
.
extDxProductAreaId
,
'extDxSipplierId'
:
this
.
form
.
extDxSipplierId
,
'materialTypeId'
:
this
.
form
.
materialTypeId
,
'inStorageRequestItems'
:
tableData
}
})
const
isVirtualHasChild
=
tableData
.
find
(
item
=>
item
.
isVirtual
&&
item
.
operator
!==
'REMOVE'
&&
(
!
item
.
children
||
!
item
.
children
.
length
||
item
.
children
&&
!
(
item
.
children
.
find
(
child
=>
child
.
operator
!==
'REMOVE'
))))
if
(
isVirtualHasChild
)
return
this
.
$utils
.
showMessageWarning
(
'父件为虚拟件时,必须添加子件!'
)
const
paramOperator
=
this
.
newDataImportResId
?
'MODIFY'
:
this
.
operator
const
param
=
{
'operator'
:
paramOperator
,
'billType'
:
this
.
form
.
billType
,
'arrivalDate'
:
this
.
form
.
arrivalDate
,
'materialTypeIdType'
:
'ExtDxProcessResourceType'
,
'extDxProductAreaIdType'
:
'ExtDxProductArea'
,
'extDxSipplierIdType'
:
'ExtDxSipplier'
,
'subTypeName'
:
'InStoragePurchase'
,
'reqStatus'
:
this
.
form
.
id
?
this
.
form
.
reqStatus
:
'Apply'
,
'extDxProductAreaId'
:
this
.
form
.
extDxProductAreaId
,
'extDxSipplierId'
:
this
.
form
.
extDxSipplierId
,
'materialTypeId'
:
this
.
form
.
materialTypeId
,
'inStorageRequestItems'
:
tableData
}
if
(
paramOperator
===
'MODIFY'
)
{
param
.
id
=
this
.
newDataImportResId
||
this
.
form
.
id
}
post
(
'/InventoryRequest/batch/recursionAdd'
,
param
).
then
(
res
=>
{
if
(
saveAndImport
===
'saveAndImport'
)
{
this
.
$refs
.
importFile
.
upLoadExcel
(
res
.
items
.
id
,
newData
)
this
.
form
=
this
.
$utils
.
deepClone
(
res
.
items
)
}
else
{
this
.
cancel
()
this
.
$utils
.
showMessageSuccess
(
'保存成功'
)
if
(
paramOperator
===
'MODIFY'
)
{
param
.
id
=
this
.
newDataImportResId
||
this
.
form
.
id
}
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
post
(
'/InventoryRequest/batch/recursionAdd'
,
param
).
then
(
res
=>
{
if
(
saveAndImport
===
'saveAndImport'
)
{
this
.
$refs
.
importFile
.
upLoadExcel
(
res
.
items
.
id
,
newData
)
this
.
form
=
this
.
$utils
.
deepClone
(
res
.
items
)
}
else
{
this
.
cancel
()
this
.
$utils
.
showMessageSuccess
(
'保存成功'
)
}
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
}
else
{
if
(
saveAndImport
!==
'saveAndImport'
)
return
this
.
$utils
.
showMessageWarning
(
'请添加明细!'
)
this
.
$refs
.
importFile
.
upLoadExcel
(
this
.
form
.
id
,
newData
)
}
},
treeTableNoArrange
(
tableData
,
type
)
{
if
(
type
!==
'remove'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment