Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pda-scan
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
ximai
mes-pda-scan
Commits
800e9a6e
Commit
800e9a6e
authored
Dec 17, 2025
by
chicheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批次相关调整
parent
6024e992
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
644 additions
and
182 deletions
+644
-182
NavBar.vue
components/NavBar/NavBar.vue
+88
-68
th_TH.json
lang/th_TH.json
+10
-1
zh_CN.json
lang/zh_CN.json
+59
-50
Main.vue
pages/dhd/Main.vue
+34
-3
scanning.vue
pages/dhd/scanning.vue
+73
-18
scanningList.vue
pages/dhd/scanningList.vue
+104
-7
Main.vue
pages/finishedProductStorage/Main.vue
+8
-8
Main.vue
pages/forstorage/Main.vue
+6
-13
Edit.vue
pages/moctcforcreate/Edit.vue
+223
-4
Info.vue
pages/moctcforcreate/Info.vue
+18
-3
card.vue
pages/stockTransfer/components/card.vue
+21
-7
No files found.
components/NavBar/NavBar.vue
View file @
800e9a6e
...
@@ -5,7 +5,18 @@
...
@@ -5,7 +5,18 @@
:autoBack=
"true"
:autoBack=
"true"
>
>
</u-navbar>
-->
</u-navbar>
-->
<uni-nav-bar
shadow
:left-icon=
"left"
:right-icon=
"right"
:title=
"title"
color=
"#fff"
:border=
'border'
@
clickLeft=
"handleBack"
@
clickRight=
"$emit(`clickRight`)"
backgroundColor=
"#6200ee"
/>
<uni-nav-bar
shadow
:left-icon=
"left"
:title=
"title"
color=
"#fff"
:border=
'border'
@
clickLeft=
"handleBack"
backgroundColor=
"#6200ee"
:left-width=
"0"
:right-width=
"160"
>
<template
slot=
"right"
>
<view
class=
"nav-right-icons"
>
<view
v-if=
"extraRight"
class=
"nav-right-icon"
@
click=
"$emit('clickExtraRight')"
>
<uni-icons
:type=
"extraRight"
size=
"28"
color=
"#fff"
/>
</view>
<view
v-if=
"right"
class=
"nav-right-icon"
style=
"margin-left:12rpx"
@
click=
"$emit('clickRight')"
>
<uni-icons
:type=
"right"
size=
"28"
color=
"#fff"
/>
</view>
</view>
</
template
>
</uni-nav-bar>
</view>
</view>
</template>
</template>
...
@@ -30,6 +41,10 @@
...
@@ -30,6 +41,10 @@
type
:
String
,
type
:
String
,
default
:
''
default
:
''
},
},
extraRight
:
{
type
:
String
,
default
:
''
},
border
:
{
border
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
...
@@ -57,11 +72,16 @@
...
@@ -57,11 +72,16 @@
::v-deep
.uni-navbar__header-btns-left
{
::v-deep
.uni-navbar__header-btns-left
{
display
:
none
;
display
:
none
;
}
}
::v-deep
.uniui-checkbox
{
.nav-right-icons
{
font-size
:
47px
!
important
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
}
::v-deep
.uniui-person
{
.nav-right-icon
{
font-size
:
47px
!
important
;
padding
:
8rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
}
}
}
...
...
lang/th_TH.json
View file @
800e9a6e
...
@@ -230,5 +230,14 @@
...
@@ -230,5 +230,14 @@
"立即升级"
:
"อัปเกรดทันที"
,
"立即升级"
:
"อัปเกรดทันที"
,
"领用套数"
:
"จํานวนชุดที่จะใช้"
,
"领用套数"
:
"จํานวนชุดที่จะใช้"
,
"采购发票"
:
"ใบแจ้งหนี้การจัดซื้อ"
,
"采购发票"
:
"ใบแจ้งหนี้การจัดซื้อ"
,
"请按顺序先进先出"
:
"กรุณาตรวจสอบตามลำดับการสิ้นสุดก่อน"
"请按顺序先进先出"
:
"กรุณาตรวจสอบตามลำดับการสิ้นสุดก่อน"
,
"扫码到货"
:
"สแกนรับสินค้า"
,
"请扫描条码"
:
"กรุณาสแกนบาร์โค้ด"
,
"继续扫码"
:
"สแกนต่อ"
,
"编辑明细"
:
"แก้ไขรายละเอียด"
,
"扫码结果"
:
"ผลการสแกน"
,
"pcs"
:
"pcs"
,
"图号"
:
"หมายเลขแบบ"
,
"生产日期"
:
"วันที่ผลิต"
,
"有效日期"
:
"วันหมดอายุ"
}
}
lang/zh_CN.json
View file @
800e9a6e
...
@@ -229,5 +229,14 @@
...
@@ -229,5 +229,14 @@
"暂不升级"
:
"暂不升级"
,
"暂不升级"
:
"暂不升级"
,
"立即升级"
:
"立即升级"
,
"立即升级"
:
"立即升级"
,
"领用套数"
:
"领用套数"
,
"领用套数"
:
"领用套数"
,
"采购发票"
:
"采购发票"
"采购发票"
:
"采购发票"
,
"扫码到货"
:
"扫码到货"
,
"请扫描条码"
:
"请扫描条码"
,
"继续扫码"
:
"继续扫码"
,
"编辑明细"
:
"编辑明细"
,
"扫码结果"
:
"扫码结果"
,
"pcs"
:
"pcs"
,
"图号"
:
"图号"
,
"生产日期"
:
"生产日期"
,
"有效日期"
:
"有效日期"
}
}
pages/dhd/Main.vue
View file @
800e9a6e
...
@@ -51,7 +51,9 @@
...
@@ -51,7 +51,9 @@
<scanningList
<scanningList
:item=
"item"
:item=
"item"
:idx=
"index"
:idx=
"index"
:editable=
"false"
@
deleGonds=
"deleGonds"
@
deleGonds=
"deleGonds"
@
updateItem=
"updateItem"
/>
/>
</view>
</view>
</ContentLoadingMore>
</ContentLoadingMore>
...
@@ -153,8 +155,21 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
...
@@ -153,8 +155,21 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
newGoodsList
.
forEach
(
newItem
=>
{
newGoodsList
.
forEach
(
newItem
=>
{
const
existingIndex
=
this
.
goodsList
.
findIndex
(
item
=>
item
.
joinlabel
===
newItem
.
joinlabel
);
const
existingIndex
=
this
.
goodsList
.
findIndex
(
item
=>
item
.
joinlabel
===
newItem
.
joinlabel
);
if
(
existingIndex
>
-
1
)
{
if
(
existingIndex
>
-
1
)
{
//
如果已存在,直接替换数量(因为scanning页面已经处理了累加逻辑)
//
保持原有到货数量合并逻辑
this
.
goodsList
[
existingIndex
].
arrivalQuantity
=
Number
(
newItem
.
arrivalQuantity
);
this
.
goodsList
[
existingIndex
].
arrivalQuantity
=
Number
(
newItem
.
arrivalQuantity
);
// 同步日期与批号(若提供)
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
newItem
,
'productionDate'
))
{
this
.
goodsList
[
existingIndex
].
productionDate
=
newItem
.
productionDate
;
}
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
newItem
,
'effectiveDate'
))
{
this
.
goodsList
[
existingIndex
].
effectiveDate
=
newItem
.
effectiveDate
;
}
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
newItem
,
'batchNo'
))
{
this
.
goodsList
[
existingIndex
].
batchNo
=
newItem
.
batchNo
;
}
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
newItem
,
'mb022'
))
{
this
.
goodsList
[
existingIndex
].
mb022
=
newItem
.
mb022
;
}
}
else
{
}
else
{
// 如果不存在,添加新项
// 如果不存在,添加新项
this
.
goodsList
.
push
(
newItem
);
this
.
goodsList
.
push
(
newItem
);
...
@@ -172,6 +187,12 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
...
@@ -172,6 +187,12 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
deleGonds
(
idx
)
{
deleGonds
(
idx
)
{
this
.
goodsList
.
splice
(
idx
,
1
);
this
.
goodsList
.
splice
(
idx
,
1
);
},
},
updateItem
(
payload
)
{
const
{
idx
,
key
,
value
}
=
payload
||
{}
if
(
typeof
idx
===
'number'
&&
key
)
{
this
.
$set
(
this
.
goodsList
,
idx
,
{
...
this
.
goodsList
[
idx
],
[
key
]:
value
})
}
},
goSubmit
(){
goSubmit
(){
if
(
!
this
.
goodsList
.
length
)
return
;
if
(
!
this
.
goodsList
.
length
)
return
;
if
(
!
this
.
daohuoForm
.
warehouse
)
return
this
.
$u
.
toast
(
i18n
.
t
(
'请选择到货仓'
));
if
(
!
this
.
daohuoForm
.
warehouse
)
return
this
.
$u
.
toast
(
i18n
.
t
(
'请选择到货仓'
));
...
@@ -179,7 +200,17 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
...
@@ -179,7 +200,17 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
this
.
$u
.
api
.
confirmArrival
({
this
.
$u
.
api
.
confirmArrival
({
warehouse
:
this
.
daohuoForm
.
warehouse
,
warehouse
:
this
.
daohuoForm
.
warehouse
,
invoiceNo
:
this
.
daohuoForm
.
invoiceNo
,
invoiceNo
:
this
.
daohuoForm
.
invoiceNo
,
details
:
this
.
goodsList
.
map
(
v
=>
({
arrivalQuantity
:
v
.
arrivalQuantity
,
materialNo
:
v
.
materialNo
,
purchaseNo
:
v
.
purchaseNo
,
purchaseSerial
:
v
.
purchaseSerial
,
purchaseType
:
v
.
purchaseType
,
supplierNo
:
v
.
supplierNo
}))
details
:
this
.
goodsList
.
map
(
v
=>
({
arrivalQuantity
:
v
.
arrivalQuantity
,
materialNo
:
v
.
materialNo
,
purchaseNo
:
v
.
purchaseNo
,
purchaseSerial
:
v
.
purchaseSerial
,
purchaseType
:
v
.
purchaseType
,
supplierNo
:
v
.
supplierNo
,
productionDate
:
v
.
productionDate
,
effectiveDate
:
v
.
effectiveDate
,
batchNo
:
v
.
batchNo
}))
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
...
...
pages/dhd/scanning.vue
View file @
800e9a6e
...
@@ -6,15 +6,24 @@
...
@@ -6,15 +6,24 @@
<view
style=
"padding: 0 10px;"
>
<view
style=
"padding: 0 10px;"
>
<view
class=
"scan-input-container"
>
<view
class=
"scan-input-container"
>
<input
<input
style=
"
width: 100%
; height: 60px; border: 1px solid #ddd; border-radius: 8px; padding: 0 15px; font-size: 16px;"
style=
"
flex: 1
; height: 60px; border: 1px solid #ddd; border-radius: 8px; padding: 0 15px; font-size: 16px;"
type=
"text"
type=
"text"
v-model=
"input"
v-model=
"input"
:focus=
"isFocus"
:focus=
"isFocus"
:disabled=
"isEditMode"
@
focus=
"focus"
@
focus=
"focus"
@
blur=
"blur"
@
blur=
"blur"
@
confirm=
"inputCC"
@
confirm=
"inputCC"
:placeholder=
"$t('请扫描条码')"
:placeholder=
"$t('请扫描条码')"
/>
/>
<u-button
type=
"default"
size=
"mini"
@
click=
"toggleEditMode"
class=
"mode-toggle-btn"
>
{{
isEditMode
?
$t
(
'继续扫码'
)
:
$t
(
'编辑明细'
)
}}
</u-button>
</view>
</view>
<view
v-if=
"goodsList.length > 0"
class=
"scan-result-title"
>
{{
$t
(
'扫码结果'
)
}}
</view>
<view
v-if=
"goodsList.length > 0"
class=
"scan-result-title"
>
{{
$t
(
'扫码结果'
)
}}
</view>
...
@@ -25,7 +34,9 @@
...
@@ -25,7 +34,9 @@
<scanningList
<scanningList
:item=
"item"
:item=
"item"
:idx=
"index"
:idx=
"index"
:editable=
"isEditMode"
@
deleGonds=
"deleGonds"
@
deleGonds=
"deleGonds"
@
updateItem=
"updateItem"
/>
/>
</view>
</view>
</ContentLoadingMore>
</ContentLoadingMore>
...
@@ -52,6 +63,8 @@ export default {
...
@@ -52,6 +63,8 @@ export default {
return
{
return
{
goodsList
:
[],
goodsList
:
[],
isFocus
:
false
,
isFocus
:
false
,
isEditMode
:
false
,
isEditingDetails
:
false
,
input
:
''
,
input
:
''
,
btnArr
:
[
btnArr
:
[
{
{
...
@@ -78,6 +91,7 @@ export default {
...
@@ -78,6 +91,7 @@ export default {
},
},
methods
:
{
methods
:
{
focus
(){
focus
(){
if
(
this
.
isEditMode
||
this
.
isEditingDetails
)
return
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
uni
.
hideKeyboard
();
uni
.
hideKeyboard
();
...
@@ -88,7 +102,9 @@ export default {
...
@@ -88,7 +102,9 @@ export default {
this
.
isFocus
=
false
;
this
.
isFocus
=
false
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
!
this
.
isEditMode
&&
!
this
.
isEditingDetails
)
{
this
.
isFocus
=
true
;
this
.
isFocus
=
true
;
}
},
500
);
},
500
);
});
});
},
},
...
@@ -108,7 +124,8 @@ export default {
...
@@ -108,7 +124,8 @@ export default {
"materialNo"
:
arr
[
4
],
"materialNo"
:
arr
[
4
],
"purchaseNo"
:
arr
[
2
],
"purchaseNo"
:
arr
[
2
],
"purchaseSerial"
:
arr
[
3
],
"purchaseSerial"
:
arr
[
3
],
"purchaseType"
:
arr
[
1
]
"purchaseType"
:
arr
[
1
],
"supplierNo"
:
arr
[
0
]
})
})
if
(
!
data
.
success
)
return
this
.
input
=
''
if
(
!
data
.
success
)
return
this
.
input
=
''
const
index
=
this
.
goodsList
.
findIndex
(
v
=>
v
.
joinlabel
===
arr
.
slice
(
0
,
5
).
join
(
'-'
))
const
index
=
this
.
goodsList
.
findIndex
(
v
=>
v
.
joinlabel
===
arr
.
slice
(
0
,
5
).
join
(
'-'
))
...
@@ -130,20 +147,8 @@ export default {
...
@@ -130,20 +147,8 @@ export default {
mb001
:
arr
[
4
]
mb001
:
arr
[
4
]
})
})
// 根据mb022属性判断批次管理
// 直接使用后端返回的默认批次号
let
batchNo
=
''
const
batchNo
=
(
data
&&
data
.
data
&&
data
.
data
.
defBatchNo
)
?
data
.
data
.
defBatchNo
:
''
if
(
data
.
data
&&
data
.
data
.
invmb
.
mb022
===
'Y'
)
{
// 批次管理:生成批号:品号+客户+日期yyyyMMdd
const
today
=
new
Date
()
const
dateStr
=
today
.
getFullYear
().
toString
()
+
(
today
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
)
+
today
.
getDate
().
toString
().
padStart
(
2
,
'0'
)
const
customer
=
arr
[
0
]
// 使用供应商号作为客户,如果没有则使用默认值
batchNo
=
arr
[
4
]
+
customer
+
dateStr
}
else
{
// 非批次管理:使用默认批次号
batchNo
=
data
.
data
&&
data
.
data
.
defBatchNo
?
data
.
data
.
defBatchNo
:
''
}
this
.
goodsList
.
push
({
this
.
goodsList
.
push
({
supplierNo
:
arr
[
0
],
supplierNo
:
arr
[
0
],
...
@@ -156,6 +161,23 @@ export default {
...
@@ -156,6 +161,23 @@ export default {
mb002
:
data1
.
data
[
'mb002'
],
mb002
:
data1
.
data
[
'mb002'
],
mb029
:
data1
.
data
[
'mb029'
],
mb029
:
data1
.
data
[
'mb029'
],
batchNo
:
batchNo
,
batchNo
:
batchNo
,
productionDate
:
(()
=>
{
const
today
=
new
Date
()
const
yy
=
today
.
getFullYear
()
const
mm
=
String
(
today
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
dd
=
String
(
today
.
getDate
()).
padStart
(
2
,
'0'
)
return
`
${
yy
}${
mm
}${
dd
}
`
})(),
effectiveDate
:
(()
=>
{
const
shelf
=
Number
(
data1
.
data
[
'udf07'
])
||
0
if
(
!
shelf
)
return
''
const
today
=
new
Date
()
today
.
setDate
(
today
.
getDate
()
+
shelf
)
const
yy
=
today
.
getFullYear
()
const
mm
=
String
(
today
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
dd
=
String
(
today
.
getDate
()).
padStart
(
2
,
'0'
)
return
`
${
yy
}${
mm
}${
dd
}
`
})(),
joinlabel
:
arr
.
slice
(
0
,
5
).
join
(
'-'
)
joinlabel
:
arr
.
slice
(
0
,
5
).
join
(
'-'
)
})
})
}
}
...
@@ -174,6 +196,30 @@ export default {
...
@@ -174,6 +196,30 @@ export default {
}
}
}
}
},
},
updateItem
(
payload
)
{
const
{
idx
,
key
,
value
}
=
payload
||
{}
if
(
typeof
idx
===
'number'
&&
key
)
{
this
.
$set
(
this
.
goodsList
,
idx
,
{
...
this
.
goodsList
[
idx
],
[
key
]:
value
})
const
pages
=
getCurrentPages
();
const
prevPage
=
pages
[
pages
.
length
-
2
];
if
(
prevPage
&&
prevPage
.
$vm
)
{
prevPage
.
$vm
.
updateGoodsList
(
this
.
goodsList
);
}
}
},
toggleEditMode
()
{
this
.
isEditMode
=
!
this
.
isEditMode
if
(
this
.
isEditMode
)
{
this
.
isFocus
=
false
uni
.
hideKeyboard
()
}
else
{
this
.
$nextTick
(()
=>
{
setTimeout
(()
=>
{
this
.
isFocus
=
true
},
300
)
})
}
},
deleGonds
(
idx
)
{
deleGonds
(
idx
)
{
this
.
goodsList
.
splice
(
idx
,
1
);
this
.
goodsList
.
splice
(
idx
,
1
);
// 删除后也同步到主页面
// 删除后也同步到主页面
...
@@ -194,6 +240,15 @@ export default {
...
@@ -194,6 +240,15 @@ export default {
.scan-input-container
{
.scan-input-container
{
margin
:
20rpx
0
;
margin
:
20rpx
0
;
display
:
flex
;
align-items
:
center
;
}
.mode-toggle-btn
{
margin-left
:
12rpx
;
height
:
60px
;
line-height
:
60px
;
white-space
:
nowrap
;
}
}
.scan-result-title
{
.scan-result-title
{
...
...
pages/dhd/scanningList.vue
View file @
800e9a6e
...
@@ -3,22 +3,67 @@
...
@@ -3,22 +3,67 @@
<view
class=
"listItemTitle"
>
<view
class=
"listItemTitle"
>
<view
class=
"item"
style=
"border-bottom: 1px solid #d8dbdf;"
>
<view
class=
"item"
style=
"border-bottom: 1px solid #d8dbdf;"
>
<view>
{{
item
.
purchaseNo
}}
|
{{
item
.
purchaseSerial
}}
</view>
<view>
{{
item
.
purchaseNo
}}
|
{{
item
.
purchaseSerial
}}
</view>
<view>
{{
item
.
arrivalQuantity
}}
pcs
<view>
{{
item
.
arrivalQuantity
}}
{{
$t
(
'pcs'
)
}}
<text
style=
"margin-left: 40rpx"
><u-icon
name=
"minus"
color=
"#000"
size=
"32"
@
click=
"deleGonds(idx)"
></u-icon></text>
<text
style=
"margin-left: 40rpx"
><u-icon
name=
"minus"
color=
"#000"
size=
"32"
@
click=
"deleGonds(idx)"
></u-icon></text>
</view>
</view>
</view>
</view>
<view
class=
"item"
>
<view
class=
"item"
>
<view>
品号:
{{
item
.
materialNo
}}
</view>
<view>
{{
$t
(
'品号:'
)
}}
{{
item
.
materialNo
}}
</view>
</view>
</view>
<view
class=
"item"
>
品名:
{{
item
.
mb002
}}
</view>
<view
class=
"item"
>
{{
$t
(
'品名:'
)
}}{{
item
.
mb002
}}
</view>
<view
class=
"item"
>
图号:
{{
item
.
mb029
}}
</view>
<view
class=
"item"
>
{{
$t
(
'图号'
)
}}
:
{{
item
.
mb029
}}
</view>
<view
class=
"item"
>
批号:
{{
item
.
batchNo
}}
</view>
<view
class=
"item"
>
<view>
{{
$t
(
'批号:'
)
}}
</view>
<view
style=
"flex: 1; text-align: left;"
>
<view
v-if=
"!editable"
>
{{
item
.
batchNo
||
'-'
}}
</view>
<input
v-else
type=
"text"
:value=
"item.batchNo"
@
input=
"onBatchNoInput"
@
focus=
"onEditStart"
@
blur=
"onEditEnd"
style=
"width: 420rpx; display: inline-block; text-align: right; border: 1px solid #ddd; border-radius: 6px; padding: 0 10px; height: 60rpx; font-size: 28rpx;"
:placeholder=
"$t('请输入批号')"
/>
</view>
</view>
<view
class=
"item"
>
<view>
{{
$t
(
'生产日期'
)
}}
:
</view>
<view
style=
"flex: 1; text-align: left;"
>
<view
v-if=
"!editable"
>
{{
formatNoDash
(
item
.
productionDate
)
||
'-'
}}
</view>
<uni-datetime-picker
v-else
type=
"date"
:border=
"false"
:clearIcon=
"true"
:value=
"formatWithDash(item.productionDate)"
@
change=
"onProdDateChange"
/>
</view>
</view>
<view
class=
"item"
>
<view>
{{
$t
(
'有效日期'
)
}}
:
</view>
<view
style=
"flex: 1; text-align: left;"
>
<view
v-if=
"!editable"
>
{{
formatNoDash
(
item
.
effectiveDate
)
||
'-'
}}
</view>
<uni-datetime-picker
v-else
type=
"date"
:border=
"false"
:clearIcon=
"true"
:value=
"formatWithDash(item.effectiveDate)"
:start=
"formatWithDash(item.productionDate) || ''"
@
change=
"onEffDateChange"
/>
</view>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
i18n
from
'../../lang/index'
import
StickyNavBar
from
'@/components/StickyNavBar/index.vue'
;
import
StickyNavBar
from
'@/components/StickyNavBar/index.vue'
;
import
ContentLoadingMore
from
'@/components/ContentLoadingMore/index.vue'
;
import
ContentLoadingMore
from
'@/components/ContentLoadingMore/index.vue'
;
import
BottomBtn
from
'@/components/BottomBtn/index.vue'
;
import
BottomBtn
from
'@/components/BottomBtn/index.vue'
;
...
@@ -38,6 +83,10 @@ export default {
...
@@ -38,6 +83,10 @@ export default {
idx
:
{
idx
:
{
type
:
Number
,
type
:
Number
,
default
:
0
default
:
0
},
editable
:
{
type
:
Boolean
,
default
:
true
}
}
},
},
computed
:{
computed
:{
...
@@ -52,6 +101,54 @@ export default {
...
@@ -52,6 +101,54 @@ export default {
methods
:
{
methods
:
{
deleGonds
(
idx
)
{
deleGonds
(
idx
)
{
this
.
$emit
(
'deleGonds'
,
idx
)
this
.
$emit
(
'deleGonds'
,
idx
)
},
onProdDateChange
(
val
)
{
const
prodDash
=
typeof
val
===
'string'
?
val
:
(
val
&&
val
.
detail
?
val
.
detail
.
value
:
val
)
const
prodNoDash
=
this
.
formatNoDash
(
prodDash
)
this
.
$emit
(
'updateItem'
,
{
idx
:
this
.
idx
,
key
:
'productionDate'
,
value
:
prodNoDash
})
const
shelf
=
Number
(
this
.
item
.
udf07
)
||
0
if
(
shelf
>
0
&&
prodNoDash
)
{
const
eDateDash
=
this
.
addDays
(
this
.
formatWithDash
(
prodNoDash
),
shelf
)
this
.
$emit
(
'updateItem'
,
{
idx
:
this
.
idx
,
key
:
'effectiveDate'
,
value
:
this
.
formatNoDash
(
eDateDash
)
})
}
},
onEffDateChange
(
val
)
{
const
effDash
=
typeof
val
===
'string'
?
val
:
(
val
&&
val
.
detail
?
val
.
detail
.
value
:
val
)
const
prodDash
=
this
.
formatWithDash
(
this
.
item
.
productionDate
)
if
(
this
.
item
.
productionDate
&&
effDash
&&
effDash
<
prodDash
)
{
this
.
$emit
(
'updateItem'
,
{
idx
:
this
.
idx
,
key
:
'effectiveDate'
,
value
:
this
.
item
.
productionDate
})
}
else
{
this
.
$emit
(
'updateItem'
,
{
idx
:
this
.
idx
,
key
:
'effectiveDate'
,
value
:
this
.
formatNoDash
(
effDash
)
})
}
},
addDays
(
yyyyMMdd
,
days
)
{
const
[
y
,
m
,
d
]
=
yyyyMMdd
.
split
(
'-'
).
map
(
n
=>
Number
(
n
))
const
dt
=
new
Date
(
y
,
(
m
||
1
)
-
1
,
d
||
1
)
dt
.
setDate
(
dt
.
getDate
()
+
days
)
const
yy
=
dt
.
getFullYear
()
const
mm
=
String
(
dt
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
dd
=
String
(
dt
.
getDate
()).
padStart
(
2
,
'0'
)
return
`
${
yy
}
-
${
mm
}
-
${
dd
}
`
},
onBatchNoInput
(
e
)
{
const
val
=
typeof
e
===
'string'
?
e
:
(
e
&&
e
.
detail
?
e
.
detail
.
value
:
''
)
this
.
$emit
(
'updateItem'
,
{
idx
:
this
.
idx
,
key
:
'batchNo'
,
value
:
val
})
},
onEditStart
()
{
this
.
$emit
(
'editing'
,
true
)
},
onEditEnd
()
{
this
.
$emit
(
'editing'
,
false
)
},
formatNoDash
(
val
)
{
return
val
?
String
(
val
).
replace
(
/-/g
,
''
)
:
''
},
formatWithDash
(
val
)
{
if
(
!
val
)
return
''
const
s
=
String
(
val
)
if
(
s
.
includes
(
'-'
))
return
s
if
(
s
.
length
===
8
)
return
`
${
s
.
slice
(
0
,
4
)}
-
${
s
.
slice
(
4
,
6
)}
-
${
s
.
slice
(
6
)}
`
return
s
}
}
}
}
};
};
...
...
pages/finishedProductStorage/Main.vue
View file @
800e9a6e
...
@@ -61,7 +61,7 @@ import i18n from '../../lang/index'
...
@@ -61,7 +61,7 @@ import i18n from '../../lang/index'
return
{
return
{
form
:
{
form
:
{
boxCode
:
null
,
boxCode
:
null
,
workOrderType
:
null
,
workOrderType
:
'5101'
,
workOrderNo
:
null
,
workOrderNo
:
null
,
quantity
:
null
,
quantity
:
null
,
},
},
...
...
pages/forstorage/Main.vue
View file @
800e9a6e
...
@@ -80,7 +80,6 @@
...
@@ -80,7 +80,6 @@
<u-form-item
prop=
"batchNo"
:label=
"$t('批号:')"
>
<u-form-item
prop=
"batchNo"
:label=
"$t('批号:')"
>
<input
<input
v-model
.
number=
"form.batchNo"
v-model
.
number=
"form.batchNo"
disabled
type=
"text"
type=
"text"
@
confirm=
"submit"
@
confirm=
"submit"
>
>
...
@@ -180,7 +179,7 @@ import i18n from '../../lang/index'
...
@@ -180,7 +179,7 @@ import i18n from '../../lang/index'
form
:
{
form
:
{
tg010
:
'01'
,
tg010
:
'01'
,
tg001
:
'5801'
,
tg001
:
'5801'
,
tg014
:
'510
1
'
,
tg014
:
'510'
,
tg015
:
null
,
tg015
:
null
,
// tc006: null,
// tc006: null,
// tb005: null,
// tb005: null,
...
@@ -227,13 +226,7 @@ import i18n from '../../lang/index'
...
@@ -227,13 +226,7 @@ import i18n from '../../lang/index'
this
.
$u
.
api
.
getMocta
(
params
).
then
(
res
=>
{
this
.
$u
.
api
.
getMocta
(
params
).
then
(
res
=>
{
if
(
res
.
success
&&
res
.
data
)
{
if
(
res
.
success
&&
res
.
data
)
{
const
moctaData
=
res
.
data
const
moctaData
=
res
.
data
// 生成批次号:品号(ta006)+工厂编号(ta019)+日期yyyyMMdd
this
.
form
.
batchNo
=
moctaData
.
batchNo
const
today
=
new
Date
()
const
dateStr
=
today
.
getFullYear
().
toString
()
+
(
today
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
)
+
today
.
getDate
().
toString
().
padStart
(
2
,
'0'
)
this
.
form
.
batchNo
=
(
moctaData
.
ta006
||
''
).
trim
()
+
(
moctaData
.
ta019
||
''
).
trim
()
+
dateStr
}
else
{
}
else
{
this
.
form
.
batchNo
=
""
this
.
form
.
batchNo
=
""
this
.
$u
.
toast
(
i18n
.
t
(
'未找到工单信息'
))
this
.
$u
.
toast
(
i18n
.
t
(
'未找到工单信息'
))
...
@@ -277,7 +270,7 @@ import i18n from '../../lang/index'
...
@@ -277,7 +270,7 @@ import i18n from '../../lang/index'
this
.
form
=
{
this
.
form
=
{
tg010
:
'01'
,
tg010
:
'01'
,
tg001
:
'5801'
,
tg001
:
'5801'
,
tg014
:
'510
1
'
,
tg014
:
'510'
,
tg015
:
null
,
tg015
:
null
,
// tc006: null,
// tc006: null,
// tb005: null,
// tb005: null,
...
...
pages/moctcforcreate/Edit.vue
View file @
800e9a6e
<
template
>
<
template
>
<view
class=
"page"
>
<view
class=
"page"
>
<NavBar
:title=
"$t('修改领料单信息')"
right=
"checkbox"
@
clickRight=
"submit"
></NavBar>
<StickyNavBar>
<NavBar
:title=
"$t('修改领料单信息')"
right=
"checkbox"
:extraRight=
"form.islot ? 'plus' : ''"
@
clickRight=
"submit"
@
clickExtraRight=
"openAddBatch"
></NavBar>
</StickyNavBar>
<view
class=
"infoedit"
>
<view
class=
"infoedit"
>
<u-form
ref=
"form"
:modelValue=
"form"
class=
"login-form"
:labelWidth=
"160"
>
<u-form
ref=
"form"
:modelValue=
"form"
class=
"login-form"
:labelWidth=
"160"
>
<u-form-item
prop=
"tb006"
:label=
"$t('工艺:')"
class=
"disabled"
>
<u-form-item
prop=
"tb006"
:label=
"$t('工艺:')"
class=
"disabled"
>
...
@@ -52,6 +60,7 @@
...
@@ -52,6 +60,7 @@
>
>
</input>
</input>
</u-form-item>
</u-form-item>
<view
v-if=
"form.islot"
class=
"batch-block default"
>
<u-form-item
prop=
"te025"
:label=
"$t('库位:')"
>
<u-form-item
prop=
"te025"
:label=
"$t('库位:')"
>
<zxz-uni-data-select
<zxz-uni-data-select
v-model=
"form.te025"
v-model=
"form.te025"
...
@@ -79,6 +88,54 @@
...
@@ -79,6 +88,54 @@
>
>
</input>
</input>
</u-form-item>
</u-form-item>
</view>
<template
v-else
>
<u-form-item
prop=
"te025"
:label=
"$t('库位:')"
>
<zxz-uni-data-select
v-model=
"form.te025"
:localdata=
"locationOptions"
placeholder=
"请选择库位"
:disabled=
"loading"
@
change=
"onLocationChange"
/>
</u-form-item>
<u-form-item
prop=
"te010"
:label=
"$t('批次号:')"
>
<zxz-uni-data-select
v-model=
"form.te010"
:localdata=
"batchOptions"
placeholder=
"请选择批次号"
:disabled=
"loading"
@
change=
"onBatchChange"
/>
</u-form-item>
<u-form-item
prop=
"quantity"
:label=
"$t('领料数量:')"
>
<input
v-model
.
number=
"form.quantity"
type=
"text"
@
confirm=
"submit"
>
</input>
</u-form-item>
</
template
>
<view
v-if=
"form.islot"
class=
"batch-blocks"
>
<view
class=
"batch-block"
v-for=
"(item, idx) in chargaArr"
:key=
"idx"
>
<view
class=
"batch-row"
>
<text>
{{$t('库位:')}}
</text>
<text
class=
"batch-value"
>
{{item.te025}}
</text>
</view>
<view
class=
"batch-row"
>
<text>
{{$t('批次号:')}}
</text>
<text
class=
"batch-value"
>
{{item.te010 || $t('无批号')}}
</text>
</view>
<view
class=
"batch-row"
>
<text>
{{$t('领料数量:')}}
</text>
<text
class=
"batch-value"
>
{{item.quantity}}
</text>
</view>
<view
class=
"batch-actions"
>
<u-icon
name=
"trash"
size=
"28"
color=
"#d9534f"
@
click=
"removeBatch(item)"
></u-icon>
</view>
</view>
</view>
<u-form-item
style=
"width:100%;"
>
<u-form-item
style=
"width:100%;"
>
<button
<button
size=
"medium"
size=
"medium"
...
@@ -91,6 +148,42 @@
...
@@ -91,6 +148,42 @@
</u-form-item>
</u-form-item>
</u-form>
</u-form>
</view>
</view>
<uni-popup
ref=
"addBatchPopup"
type=
"bottom"
>
<view
style=
"padding:24rpx;background:#fff;"
>
<u-form
:modelValue=
"newBatch"
:labelWidth=
"160"
>
<u-form-item
:label=
"$t('库位:')"
>
<zxz-uni-data-select
v-model=
"newBatch.te025"
:localdata=
"locationOptions"
placeholder=
"请选择库位"
:disabled=
"loading"
@
change=
"onNewLocationChange"
/>
</u-form-item>
<u-form-item
:label=
"$t('批次号:')"
>
<zxz-uni-data-select
v-model=
"newBatch.te010"
:localdata=
"newBatchBatchOptions"
placeholder=
"请选择批次号"
:disabled=
"loading"
/>
</u-form-item>
<u-form-item
:label=
"$t('领料数量:')"
>
<input
v-model
.
number=
"newBatch.quantity"
type=
"text"
></input>
</u-form-item>
<u-form-item
style=
"width:100%;"
>
<view
style=
"display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:20rpx"
>
<button
size=
"medium"
type=
"default"
style=
"width:48%"
@
click=
"$refs.addBatchPopup.close()"
>
<span>
{{$t('取消')}}
</span>
</button>
<button
size=
"medium"
type=
"primary"
style=
"width:48%"
@
click=
"confirmAddBatch"
>
<span>
{{$t('添加')}}
</span>
</button>
</view>
</u-form-item>
</u-form>
</view>
</uni-popup>
</view>
</view>
</template>
</template>
...
@@ -107,7 +200,7 @@ import i18n from '../../lang/index'
...
@@ -107,7 +200,7 @@ import i18n from '../../lang/index'
onLoad
(
option
)
{
onLoad
(
option
)
{
if
(
option
.
info
)
{
if
(
option
.
info
)
{
let
data
=
JSON
.
parse
(
decodeURIComponent
(
option
.
info
));
let
data
=
JSON
.
parse
(
decodeURIComponent
(
option
.
info
));
this
.
index
=
option
.
index
this
.
index
=
Number
(
option
.
index
)
this
.
info
=
data
this
.
info
=
data
this
.
form
=
data
.
moctes
[
this
.
index
]
this
.
form
=
data
.
moctes
[
this
.
index
]
// 页面加载时查询库存
// 页面加载时查询库存
...
@@ -127,6 +220,12 @@ import i18n from '../../lang/index'
...
@@ -127,6 +220,12 @@ import i18n from '../../lang/index'
inventoryData
:
[],
// 库存数据
inventoryData
:
[],
// 库存数据
locationOptions
:
[],
// 库位选项
locationOptions
:
[],
// 库位选项
batchOptions
:
[],
// 批次号选项
batchOptions
:
[],
// 批次号选项
newBatchBatchOptions
:
[],
newBatch
:
{
te025
:
''
,
te010
:
''
,
quantity
:
null
},
form
:
{
form
:
{
cd003
:
null
,
cd003
:
null
,
tb003
:
null
,
tb003
:
null
,
...
@@ -227,6 +326,84 @@ import i18n from '../../lang/index'
...
@@ -227,6 +326,84 @@ import i18n from '../../lang/index'
// 比如更新可领数量等
// 比如更新可领数量等
}
}
},
},
openAddBatch
()
{
if
(
!
this
.
form
.
islot
)
return
if
(
!
this
.
locationOptions
.
length
)
{
this
.
loadInventoryData
()
}
this
.
newBatch
=
{
te025
:
this
.
locationOptions
[
0
]?.
value
||
''
,
te010
:
''
,
quantity
:
null
}
if
(
this
.
newBatch
.
te025
)
{
this
.
onNewLocationChange
({
value
:
this
.
newBatch
.
te025
})
}
else
{
this
.
newBatchBatchOptions
=
[]
}
this
.
$refs
.
addBatchPopup
.
open
()
},
onNewLocationChange
(
location
)
{
if
(
!
location
)
{
this
.
newBatchBatchOptions
=
[]
this
.
newBatch
.
te010
=
''
return
}
const
batches
=
this
.
inventoryData
.
filter
(
item
=>
item
.
ml003
===
location
.
value
)
.
map
(
item
=>
({
text
:
item
.
ml004
||
i18n
.
t
(
'无批号'
),
value
:
item
.
ml004
||
''
}))
this
.
newBatchBatchOptions
=
batches
if
(
this
.
newBatchBatchOptions
.
length
>
0
)
{
if
(
!
this
.
newBatch
.
te010
||
!
this
.
newBatchBatchOptions
.
some
(
opt
=>
opt
.
value
===
this
.
newBatch
.
te010
))
{
this
.
newBatch
.
te010
=
this
.
newBatchBatchOptions
[
0
].
value
}
}
},
confirmAddBatch
()
{
if
(
!
this
.
form
.
islot
)
return
if
(
!
this
.
newBatch
.
te025
)
{
return
this
.
$u
.
toast
(
i18n
.
t
(
'请输入库位'
))
}
if
(
!
this
.
newBatch
.
quantity
&&
this
.
newBatch
.
quantity
!==
0
)
{
return
this
.
$u
.
toast
(
i18n
.
t
(
'请输入领料数量'
))
}
if
(
this
.
form
.
te025
===
this
.
newBatch
.
te025
&&
(
this
.
form
.
te010
||
''
)
===
(
this
.
newBatch
.
te010
||
''
))
{
return
this
.
$u
.
toast
(
i18n
.
t
(
'不能重复添加相同批次'
))
}
const
duplicate
=
this
.
chargaArr
.
some
(
cur
=>
cur
.
tb003
===
this
.
form
.
tb003
&&
cur
.
te025
===
this
.
newBatch
.
te025
&&
(
cur
.
te010
||
''
)
===
(
this
.
newBatch
.
te010
||
''
))
if
(
duplicate
)
{
return
this
.
$u
.
toast
(
i18n
.
t
(
'不能重复添加相同批次'
))
}
const
used
=
this
.
chargaArr
.
reduce
((
pre
,
cur
)
=>
pre
+
(
Number
(
cur
.
quantity
)
||
0
),
0
)
const
total
=
Number
(
this
.
form
.
tb004
)
||
0
const
remaining
=
total
-
used
if
(
Number
(
this
.
newBatch
.
quantity
)
>
remaining
)
{
return
this
.
$u
.
toast
(
i18n
.
t
(
'超出可领料数量'
))
}
const
item
=
{
tb003
:
this
.
form
.
tb003
,
tb006
:
this
.
form
.
tb006
,
ta001
:
this
.
form
.
ta001
,
ta002
:
this
.
form
.
ta002
,
ta006
:
this
.
form
.
ta006
,
tb004
:
this
.
form
.
tb004
,
tb009
:
this
.
form
.
tb009
,
batch
:
true
,
show
:
true
,
te010
:
this
.
newBatch
.
te010
,
te025
:
this
.
newBatch
.
te025
,
quantity
:
Number
(
this
.
newBatch
.
quantity
)
||
0
}
this
.
getValue
(
item
,
null
)
this
.
$refs
.
addBatchPopup
.
close
()
this
.
$u
.
toast
(
i18n
.
t
(
'添加成功'
))
},
removeBatch
(
batch
)
{
const
idx
=
this
.
info
.
moctes
.
findIndex
(
it
=>
it
.
batch
&&
it
.
tb003
===
this
.
form
.
tb003
&&
it
.
te025
===
batch
.
te025
&&
it
.
te010
===
batch
.
te010
)
if
(
idx
!==
-
1
)
{
this
.
getValue
(
null
,
idx
,
true
)
this
.
$u
.
toast
(
i18n
.
t
(
'删除成功'
))
}
},
calckw
(
str
){
calckw
(
str
){
if
(
!
str
)
return
i18n
.
t
(
'批号'
)
if
(
!
str
)
return
i18n
.
t
(
'批号'
)
...
@@ -243,7 +420,9 @@ import i18n from '../../lang/index'
...
@@ -243,7 +420,9 @@ import i18n from '../../lang/index'
ta002
:
this
.
form
.
ta002
,
ta002
:
this
.
form
.
ta002
,
ta006
:
this
.
form
.
ta006
,
ta006
:
this
.
form
.
ta006
,
tb004
:
this
.
form
.
tb004
,
tb004
:
this
.
form
.
tb004
,
tb009
:
this
.
form
.
tb009
,
batch
:
true
,
batch
:
true
,
show
:
true
,
te010
:
this
.
form
.
te010
,
te010
:
this
.
form
.
te010
,
te025
:
this
.
form
.
te025
,
te025
:
this
.
form
.
te025
,
quantity
:
0
quantity
:
0
...
@@ -286,6 +465,15 @@ import i18n from '../../lang/index'
...
@@ -286,6 +465,15 @@ import i18n from '../../lang/index'
if
(
tb004
<
quantity
)
return
this
.
$u
.
toast
(
i18n
.
t
(
'超出可领料数量'
))
if
(
tb004
<
quantity
)
return
this
.
$u
.
toast
(
i18n
.
t
(
'超出可领料数量'
))
}
}
}
else
{
}
else
{
const
defaultQty
=
Number
(
this
.
form
[
'quantity'
])
||
0
const
batchSum
=
this
.
chargaArr
.
reduce
((
pre
,
cur
)
=>
pre
+
(
Number
(
cur
.
quantity
)
||
0
),
0
)
if
(
defaultQty
&&
!
this
.
form
[
'te025'
])
{
return
this
.
$u
.
toast
(
i18n
.
t
(
'请输入库位'
))
}
const
tb004
=
Number
(
this
.
form
[
'tb004'
])
||
0
if
(
defaultQty
+
batchSum
>
tb004
)
{
return
this
.
$u
.
toast
(
i18n
.
t
(
'超出可领料数量'
))
}
}
}
let
pages
=
getCurrentPages
()
let
pages
=
getCurrentPages
()
...
@@ -296,6 +484,9 @@ import i18n from '../../lang/index'
...
@@ -296,6 +484,9 @@ import i18n from '../../lang/index'
// 3. 给上一页面实例绑定getValue()方法和参数(注意是$vm)
// 3. 给上一页面实例绑定getValue()方法和参数(注意是$vm)
prevPage
.
$vm
.
getValue
(
this
.
info
)
prevPage
.
$vm
.
getValue
(
this
.
info
)
// 触发全局事件,通知 Info 页面更新
uni
.
$emit
(
'moctcForCreateUpdate'
,
this
.
info
)
// 4. 返回上一页面
// 4. 返回上一页面
uni
.
navigateBack
({
uni
.
navigateBack
({
delta
:
1
// 返回的页面数
delta
:
1
// 返回的页面数
...
@@ -340,6 +531,34 @@ import i18n from '../../lang/index'
...
@@ -340,6 +531,34 @@ import i18n from '../../lang/index'
justify-content
:
space-between
;
justify-content
:
space-between
;
}
}
}
}
.batch-blocks
{
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
gap
:
20rpx
;
padding
:
10rpx
0
;
}
.batch-block
{
width
:
100%
;
background
:
#fff
;
border
:
1px
solid
#e6e6e6
;
border-radius
:
12rpx
;
padding
:
20rpx
;
}
.batch-row
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
12rpx
;
}
.batch-value
{
color
:
#333
;
}
.batch-actions
{
display
:
flex
;
justify-content
:
flex-end
;
margin-top
:
8rpx
;
}
// 下拉框样式优化
// 下拉框样式优化
::v-deep
.uni-select
{
::v-deep
.uni-select
{
...
...
pages/moctcforcreate/Info.vue
View file @
800e9a6e
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
<view
class=
"itemtitle"
>
<view
class=
"itemtitle"
>
<text>
{{
item
.
tb006
}}
</text>
<text>
{{
item
.
tb006
}}
</text>
<view>
<view>
<text
style=
"color: #006400"
>
{{
item
.
quantity
}}
</text>
<text
style=
"color: #006400"
>
{{
calcTotalQuantity
(
item
)
}}
</text>
</view>
</view>
</view>
</view>
<view>
<view>
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
</view>
</view>
<view>
<view>
<text>
{{
$t
(
'领料数量'
)
}}
</text>
<text>
{{
$t
(
'领料数量'
)
}}
</text>
<text>
{{
item
.
quantity
}}
</text>
<text>
{{
calcTotalQuantity
(
item
)
}}
</text>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -134,6 +134,14 @@ import i18n from '../../lang/index'
...
@@ -134,6 +134,14 @@ import i18n from '../../lang/index'
this
.
chargaArr
=
data
.
moctes
this
.
chargaArr
=
data
.
moctes
this
.
info
=
data
this
.
info
=
data
}
}
uni
.
$on
(
'moctcForCreateUpdate'
,
(
data
)
=>
{
if
(
this
.
info
&&
data
.
ta001
===
this
.
info
.
ta001
&&
data
.
ta002
===
this
.
info
.
ta002
)
{
this
.
getValue
(
data
)
}
})
},
onUnload
()
{
uni
.
$off
(
'moctcForCreateUpdate'
)
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -150,6 +158,13 @@ import i18n from '../../lang/index'
...
@@ -150,6 +158,13 @@ import i18n from '../../lang/index'
created
()
{
created
()
{
},
},
methods
:
{
methods
:
{
calcTotalQuantity
(
item
)
{
const
base
=
Number
(
item
.
quantity
)
||
0
const
batchSum
=
this
.
chargaArr
.
filter
(
v
=>
v
.
batch
&&
v
.
tb003
===
item
.
tb003
)
.
reduce
((
pre
,
cur
)
=>
pre
+
(
Number
(
cur
.
quantity
)
||
0
),
0
)
return
Math
.
round
((
base
+
batchSum
)
*
1000000
)
/
1000000
},
filterCK
(
e
){
filterCK
(
e
){
console
.
log
(
'e'
,
e
.
detail
.
value
)
console
.
log
(
'e'
,
e
.
detail
.
value
)
if
(
!
e
.
detail
.
value
)
{
if
(
!
e
.
detail
.
value
)
{
...
...
pages/stockTransfer/components/card.vue
View file @
800e9a6e
...
@@ -16,8 +16,15 @@
...
@@ -16,8 +16,15 @@
:
placeholder
=
"$t('请输入调拨数')"
@
change
=
"handleChangeNum"
/>
:
placeholder
=
"$t('请输入调拨数')"
@
change
=
"handleChangeNum"
/>
<
/uni-forms-item>
<
/uni-forms-item>
<
uni
-
forms
-
item
:
label
=
"`${$t('调入仓库')
}
:`"
>
<
uni
-
forms
-
item
:
label
=
"`${$t('调入仓库')
}
:`"
>
<
zxz
-
uni
-
data
-
select
filterable
v
-
model
=
"info.allocateWarehouse"
dataKey
=
"text"
dataValue
=
"value"
<
zxz
-
uni
-
data
-
select
:
localdata
=
"warehouseRange"
@
change
=
"handleChange"
/>
filterable
v
-
model
=
"info.allocateWarehouse"
dataKey
=
"text"
dataValue
=
"value"
:
localdata
=
"warehouseRange"
@
change
=
"handleChange"
@
inputChange
=
"handleWarehouseInput"
/>
<
/uni-forms-item>
<
/uni-forms-item>
<
uni
-
forms
-
item
:
label
=
"`${$t('调入储位')
}
:`"
>
<
uni
-
forms
-
item
:
label
=
"`${$t('调入储位')
}
:`"
>
<
zxz
-
uni
-
data
-
select
filterable
v
-
model
=
"info.allocateLocation"
dataKey
=
"text"
dataValue
=
"value"
<
zxz
-
uni
-
data
-
select
filterable
v
-
model
=
"info.allocateLocation"
dataKey
=
"text"
dataValue
=
"value"
...
@@ -74,7 +81,7 @@
...
@@ -74,7 +81,7 @@
return
{
return
{
...
item
,
...
item
,
value
:
item
.
mc001
,
value
:
item
.
mc001
,
text
:
item
.
mc002
,
text
:
`${item.mc001
}
|${item.mc002
}
`
,
}
}
}
)
}
)
}
)
}
)
...
@@ -108,6 +115,13 @@
...
@@ -108,6 +115,13 @@
handleChange
()
{
handleChange
()
{
this
.
getStorageList
();
this
.
getStorageList
();
}
,
}
,
handleWarehouseInput
(
val
)
{
const
code
=
String
(
val
||
''
).
trim
();
if
(
!
code
)
return
;
const
match
=
this
.
warehouseRange
.
find
(
w
=>
w
.
value
===
code
);
this
.
info
.
allocateWarehouse
=
match
?
match
.
value
:
code
;
this
.
getStorageList
();
}
,
}
}
}
}
<
/script>
<
/script>
...
...
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