Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
bc2d1dc3
Commit
bc2d1dc3
authored
Apr 10, 2024
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 质检
parent
8b7564ca
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
218 additions
and
61 deletions
+218
-61
src/styles/common.scss
+4
-0
src/types/api/order.ts
+5
-0
src/views/order/ProductInfo.vue
+26
-5
src/views/order/SendOrder.vue
+19
-4
src/views/order/Shipment.vue
+81
-16
src/views/order/hook/useShipment.ts
+57
-18
src/views/order/index.vue
+26
-18
No files found.
src/styles/common.scss
View file @
bc2d1dc3
...
...
@@ -49,6 +49,10 @@ img {
.flex-1
{
flex
:
1
;
}
.font-bold
{
font-weight
:
bold
;
}
.margin-top-10
{
margin-top
:
10px
;
}
...
...
src/types/api/order.ts
View file @
bc2d1dc3
...
...
@@ -58,6 +58,7 @@ export interface OrderData {
shipmentList
?:
string
sourceType
?:
string
moreable
?:
boolean
}
export
interface
ProductList
{
id
:
number
...
...
@@ -81,6 +82,8 @@ export interface ProductList {
createTime
?:
string
updateTime
?:
string
version
?:
string
|
number
passNum
?:
number
notPassNum
?:
number
}
export
interface
MemoList
{
...
...
@@ -156,6 +159,8 @@ export interface DetailList {
notShipmentNum
?:
number
productName
?:
string
facotoryNo
?:
string
notPassNum
?:
number
passNum
?:
number
}
export
interface
LogListData
{
...
...
src/views/order/ProductInfo.vue
View file @
bc2d1dc3
...
...
@@ -44,13 +44,16 @@
<div
class=
"order-list-expand_item_info_title"
>
<span
class=
"order-list-expand_item_label"
>
发货状态:
</span>
<span
v-if=
"
item.shipmentNum
=== item.num"
v-if=
"
(item.shipmentNum || 0) - (item.notPassNum || 0)
=== item.num"
class=
"order-list-expand_item_value"
>
<el-tag
effect=
"dark"
type=
"success"
>
已发货
</el-tag>
</span>
<span
v-if=
"item.num !== item.shipmentNum && item.shipmentNum !== 0"
v-if=
"
item.num !== (item.shipmentNum || 0) - (item.notPassNum || 0) &&
(item.shipmentNum || 0) > 0
"
class=
"order-list-expand_item_value"
>
<el-tag
effect=
"dark"
>
部分发货
</el-tag>
...
...
@@ -72,18 +75,36 @@
</div>
<div
class=
"order-list-expand_item_info_title"
>
<span
class=
"order-list-expand_item_label"
>
购买数:
</span>
<span
class=
"order-list-expand_item_value"
>
{{
item
.
num
||
'--'
}}
</span>
<span
class=
"order-list-expand_item_value"
>
{{
item
.
num
||
0
}}
</span>
</div>
<div
class=
"order-list-expand_item_info_title"
>
<span
class=
"order-list-expand_item_label"
>
已发数:
</span>
<span
class=
"order-list-expand_item_value"
>
{{
item
.
shipmentNum
||
'--'
item
.
shipmentNum
||
0
}}
</span>
</div>
<div
class=
"order-list-expand_item_info_title"
>
<span
class=
"order-list-expand_item_label"
>
未发数:
</span>
<span
class=
"order-list-expand_item_value"
>
{{
(
item
.
num
||
0
)
-
(
item
.
shipmentNum
||
0
)
(
item
.
num
||
0
)
-
((
item
.
shipmentNum
||
0
)
-
(
item
.
notPassNum
||
0
))
}}
</span>
</div>
<div
class=
"order-list-expand_item_info_title"
>
<span
class=
"order-list-expand_item_label"
>
待质检:
</span>
<span
class=
"order-list-expand_item_value"
>
{{
(
item
.
shipmentNum
||
0
)
-
((
item
.
passNum
||
0
)
+
(
item
.
notPassNum
||
0
))
}}
</span>
</div>
<div
class=
"order-list-expand_item_info_title"
>
<span
class=
"order-list-expand_item_label"
>
质检(通过):
</span>
<span
class=
"order-list-expand_item_value"
>
{{
item
.
passNum
||
0
}}
</span>
</div>
<div
class=
"order-list-expand_item_info_title"
>
<span
class=
"order-list-expand_item_label"
>
质检(不通过):
</span>
<span
class=
"order-list-expand_item_value"
>
{{
item
.
notPassNum
||
0
}}
</span>
</div>
<div
class=
"order-list-expand_item_info_title"
>
...
...
src/views/order/SendOrder.vue
View file @
bc2d1dc3
...
...
@@ -18,7 +18,11 @@
:key=
"i"
class=
"send-order-prop-list"
>
<div
v-for=
"pi in p"
:key=
"pi.key"
class=
"send-order-prop-item"
>
<div
v-for=
"(pi, index) in p"
:key=
"index"
class=
"send-order-prop-item"
>
{{
pi
.
label
}}
:
{{
val
(
od
,
pi
.
key
)
}}
</div>
</div>
...
...
@@ -42,7 +46,7 @@
<
script
lang=
"ts"
setup
>
import
{
val
}
from
'@/utils'
import
type
{
SendOrderData
}
from
'@/types/api/order'
import
type
{
DetailList
,
SendOrderData
}
from
'@/types/api/order'
import
type
{
PropType
}
from
'vue'
defineProps
({
...
...
@@ -60,12 +64,23 @@ const productProps = [
],
[
{
label
:
'生产单号'
,
key
:
'subOrderNumber'
},
{
label
:
'工厂'
,
key
:
'facotoryNo'
},
],
[
{
label
:
'生产数'
,
key
:
'productionNum'
},
{
label
:
'发货数'
,
key
:
'shipmentNum'
},
{
label
:
'未发数'
,
key
:
'notShipmentNum'
},
{
label
:
'未发数'
,
key
:
(
data
:
DetailList
)
=>
(
data
.
productionNum
||
0
)
-
((
data
.
shipmentNum
||
0
)
-
(
data
.
notPassNum
||
0
)),
},
{
label
:
'待质检'
,
key
:
(
data
:
DetailList
)
=>
(
data
.
shipmentNum
||
0
)
-
((
data
.
passNum
||
0
)
+
(
data
.
notPassNum
||
0
)),
},
{
label
:
'质检(通过)'
,
key
:
'passNum'
},
{
label
:
'质检(不通过)'
,
key
:
'notPassNum'
},
],
]
...
...
src/views/order/Shipment.vue
View file @
bc2d1dc3
<
template
>
<div
v-if=
"orderList.length"
class=
"shipment-info"
>
<div
v-if=
"orderList.length"
class=
"shipment-order"
>
<div
ref=
"shipmentOrderRef"
class=
"shipment-info"
>
<div
v-for=
"o in orderList"
:key=
"o.id"
class=
"shipment-info-item"
>
<div
class=
"shipment-info-item-header"
>
<div
class=
"shipment-info-item-header--title"
>
...
...
@@ -25,8 +26,12 @@
<div
v-for=
"item in o.productList"
:key=
"item.id"
:class=
"
{ 'active-row': item.subOrderNumber === orderNumber }"
:data-id=
"item.id"
:class=
"
{
'active-row': item.subOrderNumber === currentRow.subOrderNumber,
}"
class="shipment-info-item-content-item"
@click="onRowClick(item)"
>
<div
class=
"image"
>
<img
:src=
"item.variantImage"
/>
...
...
@@ -44,21 +49,24 @@
style=
"width: 90px; flex: none"
>
<span
class=
"label"
>
购买数:
</span>
<span
class=
"value"
>
{{
item
.
num
||
'--'
}}
</span>
<span
class=
"value"
>
{{
item
.
num
||
0
}}
</span>
</div>
<div
class=
"shipment-info-item-content-item--info"
style=
"width: 90px; flex: none"
>
<span
class=
"label"
>
已发数:
</span>
<span
class=
"value"
>
{{
item
.
shipmentNum
||
'--'
}}
</span>
<span
class=
"value"
>
{{
item
.
shipmentNum
||
0
}}
</span>
</div>
<div
class=
"shipment-info-item-content-item--info"
style=
"width: 90px; flex: none"
>
<span
class=
"label"
>
未发数:
</span>
<span
class=
"value"
>
{{
(
item
.
num
||
0
)
-
(
item
.
shipmentNum
||
0
)
}}
</span>
<span
class=
"value"
>
{{
(
item
.
num
||
0
)
-
((
item
.
shipmentNum
||
0
)
-
(
item
.
notPassNum
||
0
))
}}
</span>
</div>
<div
class=
"shipment-info-item-content-item--info"
...
...
@@ -70,32 +78,90 @@
</div>
</div>
</div>
</div>
<ElEmpty
v-else
class=
"shipment-info"
></ElEmpty>
<div
class=
"shipment-order-detail_info"
>
<div
class=
"shipment-order-detail_info_image"
>
<img
:src=
"currentRow.variantImage"
style=
"width: 100%"
/>
</div>
<div
class=
"shipment-order-detail_info_other"
>
<div
class=
"order-norm"
>
<span
class=
"order-norm-label"
style=
"margin-right: 6px"
>
规格:
</span>
<span
class=
"order-norm-value"
:title=
"currentRow.variantSku"
>
{{
currentRow
.
variantSku
}}
</span>
</div>
<div
class=
"order-count"
style=
"line-height: 26px"
>
<span
class=
"order-count-label"
style=
"margin-right: 6px"
>
拣货数:
</span>
<span
class=
"order-count-value"
style=
"font-size: 16px; font-weight: bold; color: red"
>
{{
currentRow
.
count
}}
</span>
</div>
</div>
</div>
</div>
<ElEmpty
v-else
class=
"shipment-order"
></ElEmpty>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
OrderData
}
from
'@/types/api/order'
;
import
{
PropType
}
from
'vue'
;
import
{
OrderData
,
ProductList
}
from
'@/types/api/order'
import
{
PropType
}
from
'vue'
import
useShipment
from
'./hook/useShipment'
const
emit
=
defineEmits
<
{
(
e
:
'changeCurrentRow'
,
v
:
ProductList
):
void
}
>
()
defineProps
({
orderList
:
{
type
:
Array
as
PropType
<
OrderData
[]
>
,
default
:
()
=>
[],
},
orderNumber
:
{
type
:
String
,
default
:
()
=>
''
,
currentRow
:
{
type
:
Object
as
PropType
<
ProductList
>
,
default
:
()
=>
{}
,
},
})
const
{
shipmentOrderRef
}
=
useShipment
()
const
onRowClick
=
(
item
:
ProductList
)
=>
{
emit
(
'changeCurrentRow'
,
item
)
}
</
script
>
<
style
lang=
"scss"
scoped
>
.shipment-
info
{
height
:
600px
;
.shipment-
order
{
overflow
:
hidden
;
margin-top
:
20px
;
height
:
600px
;
display
:
flex
;
gap
:
10px
;
}
.shipment-info
{
width
:
50%
;
border
:
1px
solid
#eee
;
overflow
:
auto
;
font-size
:
13px
;
}
.shipment-order-detail_info
{
width
:
50%
;
display
:
flex
;
gap
:
6px
;
}
.shipment-order-detail_info_image
{
flex
:
1
;
overflow
:
hidden
;
border
:
1px
solid
#eee
;
}
.shipment-order-detail_info_other
{
width
:
200px
;
}
.image
{
...
...
@@ -114,7 +180,6 @@ defineProps({
padding
:
10px
;
}
.shipment-info-item-content-item
{
display
:
flex
;
justify-content
:
space-between
;
...
...
src/views/order/hook/useShipment.ts
View file @
bc2d1dc3
import
{
getOrderBySubOrderNumber
,
saveOrder
}
from
'@/api/order'
import
{
OrderData
,
ShipmentForm
,
ShipmentOrderRes
}
from
'@/types/api/order'
import
{
OrderData
,
ProductList
,
ShipmentForm
,
ShipmentOrderRes
,
}
from
'@/types/api/order'
import
{
useValue
}
from
'@/utils/hooks/useValue'
import
{
showError
}
from
'@/utils/ui'
import
{
ref
}
from
'vue'
...
...
@@ -17,8 +22,9 @@ export default function useShipment(callback?: () => void) {
const
shipmentVisible
=
ref
(
false
)
const
isLock
=
ref
(
false
)
const
inputRef
=
ref
()
const
orderNumber
=
ref
(
''
)
const
currentRow
=
ref
<
ProductList
>
(
)
const
shipmentLoading
=
ref
(
false
)
const
shipmentOrderRef
=
ref
()
const
searchShipmentByOrderNumber
=
async
()
=>
{
const
code
=
productionOrderNumber
.
value
shipmentVisible
.
value
=
true
...
...
@@ -37,12 +43,19 @@ export default function useShipment(callback?: () => void) {
if
(
rowData
)
break
}
if
(
rowData
)
{
orderNumber
.
value
=
code
const
unShipmentNum
=
(
rowData
.
num
||
0
)
-
(
rowData
.
shipmentNum
||
0
)
currentRow
.
value
=
rowData
const
unShipmentNum
=
(
rowData
.
num
||
0
)
-
(
rowData
.
shipmentNum
||
0
)
+
(
rowData
.
notPassNum
||
0
)
if
(
unShipmentNum
>
(
rowData
.
count
||
0
))
{
rowData
.
count
||
rowData
.
count
===
0
?
(
rowData
.
count
+=
1
)
:
(
rowData
.
count
=
0
)
rowData
.
count
=
unShipmentNum
if
(
+
rowData
.
count
>
1
)
{
ElMessageBox
.
confirm
(
`该产品未发数为
${
rowData
.
count
}
件`
,
'重要提示'
,
{
confirmButtonText
:
'确定'
,
type
:
'warning'
,
}).
catch
(()
=>
{})
}
}
else
{
ElMessage
({
message
:
'拣货数不能大于未发数'
,
...
...
@@ -50,9 +63,18 @@ export default function useShipment(callback?: () => void) {
offset
:
window
.
innerHeight
/
2
,
})
}
inputRef
.
value
.
focus
()
productionOrderNumber
.
value
=
''
isLock
.
value
=
false
inputRef
.
value
.
focus
()
if
(
shipmentOrderRef
.
value
)
{
const
rowEl
=
shipmentOrderRef
.
value
.
querySelector
(
`div[data-id="
${
rowData
.
id
}
"]`
,
)
if
(
!
rowEl
)
return
rowEl
.
scrollIntoView
()
}
}
else
{
getPackingData
(
code
)
}
...
...
@@ -63,13 +85,30 @@ export default function useShipment(callback?: () => void) {
const
res
=
await
getOrderBySubOrderNumber
(
code
)
if
(
res
.
data
)
{
for
(
const
item
of
res
.
data
.
productList
||
[])
{
if
(
item
.
num
)
{
item
.
count
=
0
}
if
(
item
.
subOrderNumber
===
code
)
{
item
.
count
||
item
.
count
===
0
?
(
item
.
count
+=
1
)
:
(
item
.
count
=
0
)
item
.
count
=
(
item
.
num
||
0
)
-
((
item
.
shipmentNum
||
0
)
-
(
item
.
notPassNum
||
0
))
if
(
+
item
.
count
>
1
)
{
ElMessageBox
.
confirm
(
`该产品未发数为
${
item
.
count
}
件`
,
'重要提示'
,
{
confirmButtonText
:
'确定'
,
type
:
'warning'
,
},
).
catch
(()
=>
{})
}
currentRow
.
value
=
item
if
(
shipmentOrderRef
.
value
)
{
const
rowEl
=
shipmentOrderRef
.
value
.
querySelector
(
`div[data-id="
${
item
.
id
}
"]`
,
)
if
(
!
rowEl
)
return
rowEl
.
scrollIntoView
()
}
}
}
const
index
=
orderList
.
value
.
findIndex
(
...
...
@@ -79,10 +118,9 @@ export default function useShipment(callback?: () => void) {
orderList
.
value
.
unshift
(
res
.
data
)
}
}
orderNumber
.
value
=
code
inputRef
.
value
.
focus
()
productionOrderNumber
.
value
=
''
isLock
.
value
=
false
inputRef
.
value
.
focus
()
}
catch
(
e
)
{
productionOrderNumber
.
value
=
''
isLock
.
value
=
false
...
...
@@ -127,7 +165,7 @@ export default function useShipment(callback?: () => void) {
erpSubOrderNumber
:
jj
.
erpSubOrderNumber
,
subOrderNumber
:
jj
.
subOrderNumber
,
sendOutQuantity
:
jj
.
count
,
version
:
jj
.
version
version
:
jj
.
version
,
}
order
.
push
(
subOrder
)
}
...
...
@@ -156,16 +194,17 @@ export default function useShipment(callback?: () => void) {
}
return
{
shipmentFormRef
,
shipmentOrderRef
,
productionOrderNumber
,
shipmentVisible
,
inputRef
,
shipmentForm
,
orderNumber
,
currentRow
,
shipmentLoading
,
orderList
,
searchShipmentByOrderNumber
,
saveShipment
,
confirmDelivery
,
onShipmentDialogOpened
onShipmentDialogOpened
,
}
}
src/views/order/index.vue
View file @
bc2d1dc3
...
...
@@ -43,10 +43,10 @@
style=
"width: 160px"
></ElInput>
</ElFormItem>
<ElFormItem
label=
"内部
便
签"
>
<ElFormItem
label=
"内部
标
签"
>
<ElInput
v-model=
"searchForm.internalMemo"
placeholder=
"内部
便
签"
placeholder=
"内部
标
签"
clearable
style=
"width: 160px"
></ElInput>
...
...
@@ -80,24 +80,25 @@
<
span
v
-
if
=
"statusCode === 2"
class
=
"item"
>
<
ElButton
type
=
"success"
@
click
=
"confirmProduce"
>
确认生产
<
/ElButton
>
<
/span
>
<
span
v
-
if
=
"statusCode === 3 || statusCode === 4"
class
=
"item"
>
<
ElButton
type
=
"success"
@
click
=
"confirmDelivery"
>
发货
<
/ElButton
>
<
/span
>
<
span
class
=
"item"
>
<
span
v
-
if
=
"statusCode === 2 || statusCode === 3"
class
=
"item"
>
<
ElButton
type
=
"warning"
is
-
dark
@
click
=
"downloadManuscript"
>
下载稿件
<
/ElButto
n
>
<
/span
>
<
span
class
=
"item"
>
<
span
v
-
if
=
"statusCode === 2 || statusCode === 3"
class
=
"item"
>
<
ElButton
type
=
"primary"
dark
@
click
=
"printManuscript"
>
打印生产单
<
/ElButto
n
>
<
/span
>
<
span
class
=
"item"
>
<
ElButton
type
=
"
success
"
@
click
=
"addInternalTag"
<
ElButton
type
=
"
warning
"
@
click
=
"addInternalTag"
>
添加内部标签
<
/ElButto
n
>
<
/span
>
<
span
v
-
if
=
"statusCode === 3 || statusCode === 4"
class
=
"item"
>
<
ElButton
type
=
"success"
@
click
=
"confirmDelivery"
>
发货
<
/ElButton
>
<
/span
>
<
/div
>
<
div
ref
=
"tableWrapperRef"
...
...
@@ -227,7 +228,7 @@
>
<
/div
>
<
div
v
-
if
=
"statusCode
== 4 || statusCode == 5
"
v
-
if
=
"statusCode
!== 2 && statusCode !== 3
"
class
=
"order-list-expand_item_info_title"
>
<
ElButton
...
...
@@ -300,7 +301,7 @@
header
-
align
=
"center"
><
/ElTableColumn
>
<
ElTableColumn
label
=
"内部
便
签"
label
=
"内部
标
签"
width
=
"350"
header
-
align
=
"center"
><
/ElTableColumn
>
...
...
@@ -330,7 +331,8 @@
v
-
model
=
"shipmentVisible"
title
=
"发货"
:
close
-
on
-
click
-
modal
=
"false"
width
=
"1300px"
width
=
"1600px"
top
=
"6vh"
@
opened
=
"onShipmentDialogOpened"
>
<
div
class
=
"header-search"
>
...
...
@@ -339,7 +341,7 @@
v
-
model
=
"productionOrderNumber"
clearable
size
=
"large"
placeholder
=
"
这里是扫码输入框
"
placeholder
=
"
请输入生产单号
"
@
keyup
.
enter
=
"searchShipmentByOrderNumber"
/>
<
el
-
button
...
...
@@ -352,7 +354,8 @@
<
Shipment
v
-
loading
=
"shipmentLoading"
:
order
-
list
=
"orderList"
:
order
-
number
=
"orderNumber"
:
current
-
row
=
"currentRow"
@
change
-
current
-
row
=
"onChangeCurrentRow"
/>
<
div
class
=
"shipment-logistics-info margin-top-20"
>
<
ElForm
ref
=
"shipmentFormRef"
:
model
=
"shipmentForm"
:
rules
=
"rules"
>
...
...
@@ -459,6 +462,7 @@ import type {
LogisticsData
,
SendOrderData
,
LogListData
,
ProductList
,
}
from
'@/types/api/order'
import
{
onMounted
,
reactive
,
ref
}
from
'vue'
import
useElTableColumnWidth
from
'@/utils/hooks/useElTableColumnWidth'
...
...
@@ -492,7 +496,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
shopNumber
:
''
,
internalMemo
:
''
,
erpOrderNumber
:
''
,
subOrderNumber
:
''
subOrderNumber
:
''
,
}
)
const
tabsNav
=
ref
<
Tab
[]
>
([])
...
...
@@ -554,7 +558,7 @@ const {
shipmentVisible
,
inputRef
,
shipmentForm
,
orderNumber
,
currentRow
,
shipmentLoading
,
orderList
,
searchShipmentByOrderNumber
,
...
...
@@ -771,6 +775,10 @@ const cancelOrder = async (id: number) => {
showError
(
e
)
}
}
const
onChangeCurrentRow
=
(
item
:
ProductList
)
=>
{
currentRow
.
value
=
item
}
<
/script
>
<
style
lang
=
"scss"
scoped
>
.
header
-
filter
-
form
{
...
...
@@ -780,7 +788,7 @@ const cancelOrder = async (id: number) => {
}
}
.
header
-
filter
-
tab
{
margin
-
top
:
2
0
px
;
margin
-
top
:
1
0
px
;
}
.
tabs
{
...
...
@@ -810,11 +818,11 @@ const cancelOrder = async (id: number) => {
}
.
order
-
content
{
margin
-
top
:
2
0
px
;
margin
-
top
:
1
0
px
;
}
.
order
-
list
{
margin
-
top
:
2
0
px
;
margin
-
top
:
1
0
px
;
flex
:
1
;
:
deep
(.
el
-
table__expand
-
icon
>
.
el
-
icon
)
{
display
:
none
;
...
...
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