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
cb59949c
Commit
cb59949c
authored
Aug 11, 2023
by
xioln
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回入库和供外出库
parent
d15cfd92
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
805 additions
and
3 deletions
+805
-3
index.vue
...nents/components/AddOutStorageOfferDetailDialog/index.vue
+93
-0
index.vue
...onents/components/AddPutStorageBackDetailDialog/index.vue
+151
-0
index.vue
...rivateComponents/components/ChemicalTestProcess/index.vue
+17
-0
PrintTag.vue
...onents/components/OutStorageCallBackFlowInfo/PrintTag.vue
+177
-0
index.vue
...omponents/components/OutStorageCallBackFlowInfo/index.vue
+86
-0
index.vue
...mponents/components/OutStorageCallBackReqAmount/index.vue
+3
-3
addOutStorageOfferDetailDialog.vue
...OfferDetail/components/addOutStorageOfferDetailDialog.vue
+92
-0
index.vue
...vateComponents/components/OutStorageOfferDetail/index.vue
+186
-0
No files found.
applications/dee-mes/src/privateComponents/components/AddOutStorageOfferDetailDialog/index.vue
0 → 100644
View file @
cb59949c
/**
* @Description: 供外出库添加明细
* @author xioln
* @date 2023-08-09
* @FilePath: applications/dee-mes/src/privateComponents/components/AddOutStorageOfferDetailDialog/index.vue
*/
<
template
>
<div
class=
"addOutStorageOfferDetail-dialog"
>
<dee-as-com
ref=
"OfferTable"
class=
"list-table"
:lay-config=
"
{ typeName: 'ExtDxProcessMaterial', layKey: 'table'}"
@selectionChange="selectionChange"
/>
<div
slot=
"footer"
class=
"foot-btn-box"
>
<el-button
type=
"primary"
@
click=
"submitEvent"
>
确认
</el-button>
<el-button
@
click=
"cancelEvent"
>
取消
</el-button>
</div>
</div>
</
template
>
<
script
>
export
default
{
componentName
:
'供外出库添加明细'
,
name
:
'AddOutStorageOfferDetailDialog'
,
components
:
{},
props
:
{
basicData
:
{
type
:
Object
,
default
:
()
=>
{}
}
},
data
()
{
return
{
selection
:
[],
defaultData
:
{}
}
},
computed
:
{},
watch
:
{
'value'
:
{
immediate
:
true
,
handler
(
val
)
{
console
.
log
(
'val'
,
val
)
}
}
},
created
()
{
// 初始化数据
console
.
log
(
'basicData'
,
this
.
basicData
)
},
methods
:
{
selectionChange
(
val
)
{
this
.
selection
=
val
},
submitEvent
()
{
console
.
log
(
'this.basicData'
,
this
.
basicData
)
const
selection
=
this
.
selection
.
filter
(
r
=>
{
if
(
!
this
.
basicData
.
inStorageRequestItems
)
{
return
true
}
return
!
this
.
basicData
.
inStorageRequestItems
.
find
(
item
=>
r
.
id
===
item
.
extMaterialId
)
})
console
.
log
(
'selection'
,
selection
)
if
(
selection
.
length
)
{
const
data
=
selection
.
map
(
r
=>
{
return
{
'subTypeName'
:
'OutStorageOutItem'
,
'extMaterial'
:
r
,
'extMaterialId'
:
r
.
id
}
})
this
.
$emit
(
'submitEvent'
,
{
formData
:
data
})
}
},
cancelEvent
()
{
this
.
$emit
(
'cancel'
)
}
}
}
</
script
>
<
style
lang=
'scss'
>
.addOutStorageOfferDetail-dialog
{
.list-table
{
height
:
510px
!
important
;
}
.foot-btn-box
{
display
:
flex
;
margin-top
:
10px
;
justify-content
:
center
;
align-content
:
center
;
}
}
</
style
>
applications/dee-mes/src/privateComponents/components/AddPutStorageBackDetailDialog/index.vue
0 → 100644
View file @
cb59949c
/**
* @Description:
* @author cxg
* @date 2022/03/29
*/
<
template
>
<div
class=
"addPutStorageBackDetail-dialog"
>
<dee-as-com
ref=
"materielSearch"
:lay-config=
"
{ typeName: 'JobResponseOutStorageRecall', layKey: 'search' }"
:basic-data="defaultData"
@searchEvent="searchEvent"
/>
<dee-as-com
ref=
"materielTable"
class=
"list-table"
:lay-config=
"
{ typeName: 'JobResponseOutStorageRecall', layKey: 'table' }"
@selectionChange="selectionChange"
/>
<div
slot=
"footer"
class=
"foot-btn-box"
>
<el-button
type=
"primary"
@
click=
"submitEvent"
>
确认
</el-button>
<el-button
@
click=
"cancelEvent"
>
取消
</el-button>
</div>
</div>
</
template
>
<
script
>
export
default
{
componentName
:
'添加返厂入库物料弹框'
,
name
:
'AddPutStorageBackDetailDialog'
,
components
:
{},
props
:
{
basicData
:
{
type
:
Object
,
default
:
()
=>
{
}
}
},
data
()
{
return
{
selection
:
[],
defaultData
:
{}
}
},
computed
:
{},
mounted
()
{
},
methods
:
{
searchEvent
(
val
)
{
// const materialType = this.findByNameVnode(this, 'DeeAsForm').form.materialType
val
.
items
.
push
({
fieldName
:
'subTypeName'
,
operator
:
'EQ'
,
value
:
'JobResponseOutStorageRecall'
}
/*, { fieldName: 'inventory.materialType', operator: 'EQ', value: materialType }*/
,
{
fieldName
:
'state'
,
operator
:
'EQ'
,
value
:
'Finish'
})
if
(
this
.
basicData
.
billType
)
{
val
.
items
.
push
({
fieldName
:
'inventory.jobResponse.jobOrder.inventoryReq.billType'
,
operator
:
'EQ'
,
value
:
this
.
basicData
.
billType
})
}
if
(
this
.
basicData
.
materialType
)
{
val
.
items
.
push
({
fieldName
:
'inventory.jobResponse.jobOrder.extMaterial.resType2Id'
,
operator
:
'EQ'
,
value
:
this
.
basicData
.
materialType
})
}
val
.
items
.
push
({
fieldName
:
'inventory.jobResponse.jobOrderId'
,
operator
:
'NEQ'
,
value
:
0
})
val
.
openProps
=
[{
'name'
:
'inventory'
}]
const
el
=
this
.
$refs
[
'materielTable'
]
el
.
$refs
.
asCom
.
getData
(
val
.
items
,
val
.
items
)
},
findByNameVnode
(
obj
,
targetName
)
{
if
(
obj
&&
obj
.
$vnode
&&
obj
.
$vnode
.
tag
&&
obj
.
$vnode
.
tag
.
includes
(
targetName
))
{
return
obj
}
else
{
return
this
.
findByNameVnode
(
obj
.
$parent
,
targetName
)
}
},
selectionChange
(
val
)
{
this
.
selection
=
val
},
submitEvent
()
{
this
.
selection
=
this
.
$refs
[
'materielTable'
].
$refs
[
'asCom'
].
selectedData
if
(
this
.
selection
.
length
)
{
const
showData
=
this
.
findByNameVnode
(
this
,
'DeeAsTable'
).
showData
if
(
showData
.
length
)
{
this
.
selection
=
this
.
selection
.
filter
(
item
=>
!
showData
.
some
(
x
=>
x
.
inventoryId
===
item
.
inventoryId
))
}
const
data
=
this
.
selection
.
map
(
r
=>
{
return
{
'subTypeName'
:
'InStorageRecallItem'
,
'reqStatus'
:
'Apply'
,
'outStorageId'
:
r
.
inventory
&&
r
.
inventory
.
jobResponseId
||
''
,
'outStorageIdType'
:
r
.
inventory
&&
r
.
inventory
.
jobResponseIdType
||
''
,
'inventoryId'
:
r
.
inventoryId
||
''
,
'inventoryIdType'
:
r
.
inventoryIdType
||
''
,
'purchaseUnitId'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
extMaterial
.
extUnitId
||
''
,
'purchaseUnitIdType'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
extMaterial
.
extUnitIdType
||
''
,
'extDxSipplierId'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
extDxSipplierId
||
''
,
'extDxSipplierIdType'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
extDxSipplierIdType
||
''
,
extDxSipplier
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
extDxSipplier
||
''
,
extMaterial
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
extMaterial
||
''
,
storageZone
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
storageZone
||
''
,
storageCondition
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
storageCondition
||
''
,
'extMaterialId'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
extMaterialId
||
''
,
'extMaterialIdType'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
extMaterialIdType
||
''
,
'arrivalDate'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
arrivalDate
||
''
,
'reqAmount'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
reqAmount
||
''
,
'airModel'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
airModel
||
''
,
'sorties'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
sorties
||
''
,
'manufacturer'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
manufacturer
||
''
,
'contractNo'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
contractNo
||
''
,
'stockPrice'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
stockPrice
||
''
,
'lotNo'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
lotNo
||
''
,
'taxRate'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
taxRate
||
''
,
'taxUnitPrice'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
taxUnitPrice
||
''
,
'taxPrice'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
taxPrice
||
''
,
'stockUnitPrice'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
stockUnitPrice
||
''
,
'purchaseOrderNo'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
purchaseOrderNo
||
''
,
'operator'
:
'ADD'
,
remark
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
remark
||
''
,
'isRoot'
:
r
.
inventory
&&
r
.
inventory
.
jobResponse
.
jobOrder
.
isRoot
}
})
this
.
$emit
(
'submitEvent'
,
{
formData
:
data
})
}
},
cancelEvent
()
{
this
.
$emit
(
'cancel'
)
}
}
}
</
script
>
<
style
lang=
'scss'
>
.addPutStorageBackDetail-dialog
{
.list-table
{
height
:
450px
!
important
;
}
.foot-btn-box
{
display
:
flex
;
justify-content
:
center
;
align-content
:
center
;
margin-top
:
10px
;
}
}
</
style
>
applications/dee-mes/src/privateComponents/components/ChemicalTestProcess/index.vue
View file @
cb59949c
...
...
@@ -40,6 +40,23 @@ export default {
// 初始化数据
},
methods
:
{
ddd
(
bindForm
,
currentComponent
)
{
if
(
bindForm
.
experimentAmount
>
bindForm
.
reqAmount
)
{
this
.
$utils
.
showMessageWarning
(
'试验数量不能大于入库数量('
+
bindForm
.
reqAmount
+
')'
)
// throw ('试验数量不能大于入库数量(' + bindForm.reqAmount + ')')
}
var
obj
=
{}
for
(
var
key
in
bindForm
)
{
if
([
'reportNo'
,
'isDestroy'
,
'purchaseUnit'
,
'isPass'
,
'experimentAmount'
,
'objFileLinks'
].
includes
(
key
))
{
obj
[
key
]
=
bindForm
[
key
]
}
}
console
.
log
(
'bindForm'
,
bindForm
)
console
.
log
(
'currentComponent'
,
currentComponent
)
obj
.
operator
=
'MODIFY'
obj
.
subTypeName
=
'JobResponseInExperment'
return
obj
}
}
}
...
...
applications/dee-mes/src/privateComponents/components/OutStorageCallBackFlowInfo/PrintTag.vue
0 → 100644
View file @
cb59949c
<!--
* @Author: Lean
* @Date: 2021-03-01 14:40:26
* @LastEditTime: 2021-03-09 20:17:23
* @Description: 打印标签
* @FilePath: applications/dee-mes/src/privateComponents/components/WarehousingConfirmationConfirm/component/PrintTag.vue
-->
<!--
@prop config
@prop Number config.width 设置宽度 default = 300
@prop Array config.prints 打印的数据
@prop String config.prints[].QRcode 二维码
@prop String config.prints[].propertys 二维码下显示的属性
* 测试参数结构
config: {
width: 300,
prints: [
{
text: 'asdasdasd',
propertys: [
{ label: '编码', value: '' },
{ label: '名称', value: '' }
]
},
{
text: 'asdasdasd',
propertys: [
{ label: '编码', value: '' },
{ label: '名称', value: '' }
]
}
]
}
-->
<
template
>
<section
ref=
"print"
class=
"print"
>
<section
v-for=
"(item, index) in config.prints || []"
:key=
"index"
:style=
"
{ width: '19%' }"
class="item"
>
<header>
<vue-qr
style=
"height:218px;"
:size=
"config.width"
:margin=
"0"
:text=
"item.text.toString()"
:qid=
"index.toString()"
/>
</header>
<footer>
<ul>
<li
v-for=
"property in item.propertys"
:key=
"property.label"
>
<p>
{{
property
.
label
}}
</p>
<span>
{{
property
.
value
}}
</span>
</li>
</ul>
</footer>
</section>
</section>
</
template
>
<
script
>
import
VueQr
from
'vue-qr'
export
default
{
name
:
'Print'
,
components
:
{
VueQr
},
props
:
{
config
:
{
type
:
Object
,
default
:
()
=>
{
return
{
width
:
300
,
prints
:
[]
}
}
}
},
data
()
{
return
{
timer
:
null
,
flag
:
true
}
},
beforeDestroy
()
{
this
.
timer
=
null
},
methods
:
{
print
()
{
if
(
this
.
flag
)
{
this
.
flag
=
false
this
.
timer
=
setInterval
(()
=>
{
if
(
this
.
$refs
.
print
.
innerHTML
)
{
this
.
printTag
()
clearInterval
(
this
.
timer
)
}
},
300
)
setTimeout
(()
=>
{
this
.
flag
=
true
},
1000
)
}
},
printTag
()
{
var
iframe
=
document
.
createElement
(
'IFRAME'
)
var
doc
=
null
iframe
.
setAttribute
(
'style'
,
'position:absolute; width:0; height:0; margin-top: -1000px; margin-left: -1000px;'
)
document
.
body
.
appendChild
(
iframe
)
doc
=
iframe
.
contentWindow
.
document
doc
.
write
(
`
<style>
ul, li {
margin: 0;
padding: 0;
list-style: none;
font-size: 17px;
}
.item {
min-height:700px;
}
li {
position: relative;
width: 306px;
display: flex;
padding: 0 5px;
align-items: center;
border-left: 2px solid #222;
border-right: 2px solid #222;
border-bottom: 2px solid #222;
}
li::after{
content: '';
position: absolute;
left: calc(35% - 5px);
top: 0;
height: 100%;
border-left: 2px solid #222;
width: 0;
}
ul {
width: 320px;
border-top: 4px solid #222;
}
li p {
margin: 0;
width: 35%;
padding: 3.5px 0;
}
li span {
display: inline-block;
width: 65%;
text-align: left;
padding-left: 6px;
}
img {
width: 320px;
height:290px;
margin-bottom: 4px;
}
</style>
`
)
doc
.
write
(
this
.
$refs
.
print
.
innerHTML
)
doc
.
close
()
iframe
.
contentWindow
.
focus
()
iframe
.
contentWindow
.
print
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.print
{
position
:
absolute
;
z-index
:
-999
;
left
:
-1000px
;
top
:
-1110px
;
}
</
style
>
applications/dee-mes/src/privateComponents/components/OutStorageCallBackFlowInfo/index.vue
0 → 100644
View file @
cb59949c
/**
* @Description: 召回出库物料明细
* @author xioln
* @date 2023-08-02
*/
<
template
>
<div>
<DeeAsCom
v-if=
"basicData"
ref=
"list"
:basic-data=
"basicData"
:lay-config=
"
{
typeName: 'OutStorageRecallItem',
layKey: 'flowView'
}"
@tb-printCode="tbPrintCode"
/>
<PrintTag
ref=
"print"
:config=
"printConfig"
/>
</div>
</
template
>
<
script
>
import
PrintTag
from
'./PrintTag.vue'
export
default
{
componentName
:
'召回出库物料明细'
,
name
:
'OutStorageCallBackFlowInfo'
,
components
:
{
PrintTag
},
props
:
{
basicData
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
return
{
// 打印标签
printConfig
:
{
visible
:
false
,
width
:
300
,
prints
:
[]
}
}
},
mounted
()
{
},
methods
:
{
tbPrintCode
()
{
const
selection
=
this
.
$refs
[
'list'
].
$refs
[
'asCom'
].
selectedData
// 获取需要打印的数据
this
.
printConfig
.
prints
=
[]
selection
.
forEach
((
row
)
=>
{
this
.
printConfig
=
Object
.
assign
({},
this
.
printConfig
,
{
visible
:
true
})
this
.
printConfig
.
prints
.
push
({
text
:
row
.
id
,
propertys
:
[
{
label
:
'编码'
,
value
:
row
.
extMaterial
.
resCode
},
{
label
:
'名称'
,
value
:
row
.
extMaterial
.
resName
},
{
label
:
'型号/牌号/件号'
,
value
:
row
.
extMaterial
.
modelNo
},
{
label
:
'规格'
,
value
:
row
.
extMaterial
.
spec
},
{
label
:
'批号'
,
value
:
row
.
lotNo
},
{
label
:
'系列号/序列号'
,
value
:
row
.
serialNo
},
{
label
:
'机型'
,
value
:
row
.
airModel
},
{
label
:
'验收单号'
,
value
:
row
.
purchaseOrderNo
},
{
label
:
'保证保管期'
,
value
:
''
},
{
label
:
'出库数量'
,
value
:
row
.
reqAmount
},
{
label
:
'贮存期'
,
value
:
''
},
{
label
:
'库位号'
,
value
:
''
},
{
label
:
'计量单位'
,
value
:
row
.
extMaterial
.
extUnit
.
unitName
},
{
label
:
'AO号'
,
value
:
''
},
{
label
:
'备注'
,
value
:
row
.
remark
||
''
}
]
})
})
this
.
$refs
.
print
.
print
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
applications/dee-mes/src/privateComponents/components/OutStorageCallBackReqAmount/index.vue
View file @
cb59949c
...
...
@@ -20,8 +20,8 @@ export default {
default
:
()
=>
{}
},
value
:
{
type
:
String
,
default
:
'0'
type
:
Number
,
default
:
0
}
},
data
()
{
...
...
@@ -35,7 +35,7 @@ export default {
if
(
this
.
value
!==
'0'
)
{
this
.
reqAmount
=
Number
(
this
.
value
)
}
if
(
this
.
form
.
inventory
.
usableAmount
)
{
if
(
this
.
form
.
inventory
&&
this
.
form
.
inventory
.
usableAmount
)
{
this
.
maxNum
=
this
.
form
.
inventory
.
usableAmount
}
else
{
this
.
maxNum
=
1
...
...
applications/dee-mes/src/privateComponents/components/OutStorageOfferDetail/components/addOutStorageOfferDetailDialog.vue
0 → 100644
View file @
cb59949c
/**
* @Description: 供外出库添加明细弹框
* @author xioln
* @date 2023-08-09
* @FilePath: applications/dee-mes/src/privateComponents/components/OutStorageOfferDetail/components/addOutStorageOfferDetailDialog.vue
*/
<
template
>
<div
class=
"addOutStorageOfferDetail-dialog"
>
<dee-as-com
ref=
"OfferTable"
class=
"list-table"
:lay-config=
"
{ typeName: 'ExtDxProcessMaterial', layKey: 'table'}"
@selectionChange="selectionChange"
/>
<div
slot=
"footer"
class=
"foot-btn-box"
>
<el-button
type=
"primary"
@
click=
"submitEvent"
>
确认
</el-button>
<el-button
@
click=
"cancelEvent"
>
取消
</el-button>
</div>
</div>
</
template
>
<
script
>
export
default
{
// componentName: '供外出库添加明细弹窗',
// name: 'AddOutStorageOfferDetailDialog',
components
:
{},
props
:
{
basicData
:
{
type
:
Object
,
default
:
()
=>
{}
}
},
data
()
{
return
{
selection
:
[],
defaultData
:
{}
}
},
computed
:
{},
created
()
{
// 初始化数据
console
.
log
(
'basicData'
,
this
.
basicData
)
},
methods
:
{
sss
(
OKAffirmRequestParams
)
{
// OKAffirmRequestParams = {
// ...this.form,
// inStorageRequestItems: selectedData
// }
},
selectionChange
(
val
)
{
this
.
selection
=
val
},
submitEvent
()
{
console
.
log
(
'this.basicData'
,
this
.
basicData
)
const
selection
=
this
.
selection
.
filter
(
r
=>
{
if
(
!
this
.
basicData
.
inStorageRequestItems
)
{
return
true
}
return
!
this
.
basicData
.
inStorageRequestItems
.
find
(
item
=>
r
.
id
===
item
.
extMaterialId
)
})
console
.
log
(
'selection'
,
selection
)
if
(
selection
.
length
)
{
const
data
=
selection
.
map
(
r
=>
{
return
{
'subTypeName'
:
'OutStorageOutItem'
,
'extMaterial'
:
r
,
'extMaterialId'
:
r
.
id
,
'operator'
:
'add'
}
})
this
.
$emit
(
'submitEvent'
,
{
formData
:
data
})
}
},
cancelEvent
()
{
this
.
$emit
(
'cancel'
)
}
}
}
</
script
>
<
style
lang=
'scss'
>
.addOutStorageOfferDetail-dialog
{
.list-table
{
height
:
510px
!
important
;
}
.foot-btn-box
{
display
:
flex
;
margin-top
:
10px
;
justify-content
:
center
;
align-content
:
center
;
}
}
</
style
>
applications/dee-mes/src/privateComponents/components/OutStorageOfferDetail/index.vue
0 → 100644
View file @
cb59949c
/**
* @Description: 供外出库申请明细
* @author xioln
* @date 2023-08-09
* @FilePath: applications/dee-mes/src/privateComponents/components/OutStorageOfferDetail/index.vue
*/
<
template
>
<div
class=
"outStorageOffer-detail"
>
<dee-table
:columns=
"tableColumns"
:data=
"tableData"
:index-row=
"
{ title: '序号', width: '60', align: 'center', fixed: true }"
selection-row
@selection-change="handleSelectionChange"
>
<dee-tools
slot=
"header"
:tools=
"tools"
mode=
"normal"
:collapse=
"false"
/>
</dee-table>
<dee-dialog
width=
"70%"
title=
"添加供外出库申请明细"
:visible=
"dialogVisible"
>
<addOutStorageOfferDetailDialog
ref=
"addOffer"
:basic-data=
"form"
@
submitEvent=
"addData"
@
cancel=
"cancel"
/>
</dee-dialog>
</div>
</
template
>
<
script
>
import
AddOutStorageOfferDetailDialog
from
'./components/addOutStorageOfferDetailDialog'
import
{
post
}
from
'@/utils/http'
export
default
{
componentName
:
'供外出库申请明细'
,
name
:
'OutStorageOfferDetail'
,
components
:
{
AddOutStorageOfferDetailDialog
},
props
:
{
form
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
return
{
dialogVisible
:
false
,
tableColumns
:
[
{
title
:
'物料编码'
,
key
:
'extMaterial.resCode'
,
align
:
'center'
},
{
title
:
'物料名称'
,
key
:
'extMaterial.resName'
,
align
:
'center'
},
{
title
:
'牌号/型号/件号'
,
key
:
'extMaterial.modelNo'
,
align
:
'center'
,
minWidth
:
'120'
},
{
title
:
'规格'
,
key
:
'extMaterial.spec'
,
align
:
'center'
},
{
title
:
'单位名称'
,
key
:
'extMaterial.extUnit.unitName'
,
align
:
'center'
},
{
title
:
'申领数量'
,
key
:
'reqAmount'
,
align
:
'center'
,
minWidth
:
'120'
,
component
:
{
show
:
true
,
render
:
(
h
,
data
,
column
,
index
)
=>
{
return
(
<
el
-
input
-
number
size
=
'small'
v
-
model
=
{
data
.
reqAmount
}
on
-
change
=
{(
e
)
=>
{
this
.
tableData
=
this
.
tableData
.
map
(
item
=>
{
if
(
item
.
extMaterialId
===
data
.
extMaterialId
)
{
item
.
reqAmount
=
e
}
return
item
})
}}
/>
)
}
}
},
{
title
:
'技术条件'
,
key
:
'extMaterial.techSpec'
,
align
:
'center'
},
{
title
:
'供应状态'
,
key
:
'extMaterial.supplyStatus'
,
align
:
'center'
},
{
title
:
'物料类型'
,
key
:
'extMaterial.resType2.typeName'
,
align
:
'center'
},
{
title
:
'占用数量'
,
key
:
'allocatedAmount'
,
align
:
'center'
}
],
tableData
:
[],
tools
:
[{
name
:
'添加入库明细'
,
icon
:
'/icons/c-add.png'
,
handler
:
{
click
:
()
=>
{
if
(
!
this
.
form
.
extWorkCenterId
)
{
this
.
$utils
.
showMessageWarning
(
'请先选择库房!'
)
return
}
this
.
dialogVisible
=
true
}
}
},
{
name
:
'保存占用'
,
icon
:
'/icons/c-creatBook.png'
,
handler
:
{
click
:
()
=>
{
this
.
occupy
()
}
}
},
{
name
:
'移除'
,
icon
:
'/icons/c-delete.png'
,
handler
:
{
click
:
()
=>
{
this
.
remove
()
}
}
}],
param
:
{}
}
},
computed
:
{
},
watch
:
{
tableData
:
{
immediate
:
true
,
deep
:
true
,
handler
(
data
)
{
this
.
$emit
(
'input'
,
data
)
}
}
},
created
()
{
// 初始化数据
},
methods
:
{
addData
(
data
)
{
console
.
log
(
'data'
,
data
)
this
.
tableData
=
data
.
formData
this
.
dialogVisible
=
false
},
handleSelectionChange
(
v
)
{
this
.
selectTableData
=
v
},
cancel
()
{
this
.
dialogVisible
=
false
},
occupy
()
{
const
param
=
{
...
this
.
form
,
inStorageRequestItems
:
this
.
tableData
,
subTypeName
:
'OutStorageOut'
,
operator
:
'ADD'
}
post
(
'OutStorageRequest/outStorageOut/saveAndTake'
,
param
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
const
data
=
res
.
items
.
inStorageRequestItems
const
tableData
=
[...
this
.
tableData
]
data
.
forEach
(
item
=>
{
tableData
.
forEach
(
v
=>
{
if
(
v
.
extMaterialId
===
item
.
extMaterialId
)
{
v
.
id
=
item
.
id
v
.
operator
=
'MODIFY'
v
.
outStorageOutId
=
res
.
items
.
id
v
.
allocatedAmount
=
this
.
sumArray
(
item
.
inventoryJobResponses
,
'allocatedAmount'
)
}
})
})
this
.
tableData
=
tableData
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
},
remove
()
{
this
.
$confirm
(
'此操作将永久删除该文件, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
post
(
`InStorageRequestItem/outStorageOutItem/delete?requestItemIds=
${
this
.
selectTableData
.
map
(
item
=>
item
.
id
).
join
(
','
)}
`
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'删除成功!'
})
this
.
tableData
=
this
.
tableData
.
filter
(
item
=>
!
this
.
selectTableData
.
map
(
item
=>
item
.
extMaterialId
).
includes
(
item
.
extMaterialId
))
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消删除'
})
})
},
sumArray
(
array
,
key
)
{
let
sum
=
0
for
(
let
i
=
0
;
i
<
array
.
length
;
i
++
)
{
sum
+=
Number
(
array
[
i
][
key
])
}
return
sum
}
}
}
</
script
>
<
style
lang=
'scss'
></
style
>
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