Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
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
李俊赕
self-support
Commits
98c31506
Commit
98c31506
authored
Sep 09, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 完工页-仓配库存优化
parent
d8548a31
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
14 deletions
+44
-14
parts.js
src/common/api/parts.js
+1
-1
XhParts.vue
src/components/createCom/XhParts.vue
+27
-5
index.vue
src/components/select-parts/index.vue
+2
-2
complete.vue
src/pages/order/complete.vue
+8
-2
parts.vue
src/pages/order/parts.vue
+6
-4
No files found.
src/common/api/parts.js
View file @
98c31506
...
@@ -44,7 +44,7 @@ let partsApiFun = function (vm) {
...
@@ -44,7 +44,7 @@ let partsApiFun = function (vm) {
/**
/**
* 查询自己的物料仓
* 查询自己的物料仓
*/
*/
let
getMyReserve
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/items/reserve'
,
params
);
let
getMyReserve
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/items/
v2/
reserve'
,
params
);
/**
/**
* 查询工单的配件明细
* 查询工单的配件明细
*/
*/
...
...
src/components/createCom/XhParts.vue
View file @
98c31506
...
@@ -55,6 +55,10 @@ export default {
...
@@ -55,6 +55,10 @@ export default {
type
:
String
,
type
:
String
,
default
:
''
,
default
:
''
,
},
},
orderNumber
:
{
type
:
String
,
default
:
''
,
},
categoryId
:
{
categoryId
:
{
type
:
String
,
type
:
String
,
default
:
''
,
default
:
''
,
...
@@ -89,10 +93,28 @@ export default {
...
@@ -89,10 +93,28 @@ export default {
this
.
getWorkOrderParts
()
this
.
getWorkOrderParts
()
},
},
methods
:
{
methods
:
{
// 获取最新库存
getWorkOrderParts
()
{
getWorkOrderParts
()
{
// this.lists = JSON.parse(this.dataValue) || []
const
lists
=
this
.
dataValue
?
JSON
.
parse
(
this
.
dataValue
).
filter
(
v
=>
v
.
name
)
:
[]
const
lists
=
this
.
dataValue
?
JSON
.
parse
(
this
.
dataValue
)
:
[]
this
.
$u
.
api
this
.
lists
=
lists
.
filter
(
v
=>
v
.
name
)
.
getMyReserve
({
categoryId
:
this
.
categoryId
,
brandId
:
this
.
brandId
,
orderNumber
:
this
.
orderNumber
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
||
[]
this
.
lists
=
lists
.
map
(
v
=>
{
const
row
=
data
.
find
(
item
=>
item
.
skuId
===
v
.
skuId
)
if
(
row
)
{
v
.
max
=
row
.
stock
+
Number
(
row
.
useStock
)
}
return
v
})
console
.
log
(
"this.lists"
,
this
.
lists
)
}
})
},
},
partsChange
(
val
,
index
)
{
partsChange
(
val
,
index
)
{
this
.
$set
(
this
.
lists
[
index
],
'quantity'
,
val
)
this
.
$set
(
this
.
lists
[
index
],
'quantity'
,
val
)
...
@@ -116,7 +138,7 @@ export default {
...
@@ -116,7 +138,7 @@ export default {
valChange
(
val
)
{
valChange
(
val
)
{
if
(
val
)
{
if
(
val
)
{
val
.
forEach
((
v
)
=>
{
val
.
forEach
((
v
)
=>
{
const
index
=
this
.
lists
.
findIndex
((
k
)
=>
k
.
part_id
===
v
.
part_i
d
)
const
index
=
this
.
lists
.
findIndex
((
k
)
=>
k
.
skuId
===
v
.
skuI
d
)
if
(
index
<
0
)
{
if
(
index
<
0
)
{
this
.
lists
.
push
(
v
)
this
.
lists
.
push
(
v
)
}
else
{
}
else
{
...
@@ -130,7 +152,7 @@ export default {
...
@@ -130,7 +152,7 @@ export default {
},
},
toParts
()
{
toParts
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
`/pages/order/parts?workOrderId=
${
this
.
orderId
}
&brandId=
${
this
.
brandId
}
&categoryId=
${
this
.
categoryId
}
`
,
url
:
`/pages/order/parts?workOrderId=
${
this
.
orderId
}
&brandId=
${
this
.
brandId
}
&categoryId=
${
this
.
categoryId
}
&orderNumber=
${
this
.
orderNumber
}
`
,
})
})
},
},
},
},
...
...
src/components/select-parts/index.vue
View file @
98c31506
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
<view
class=
"right-content-name u-line-2"
>
{{
info
.
name
}}
</view>
<view
class=
"right-content-name u-line-2"
>
{{
info
.
name
}}
</view>
<view
class=
"right-content-desc u-line-2"
>
{{
info
.
remark
}}
</view>
<view
class=
"right-content-desc u-line-2"
>
{{
info
.
remark
}}
</view>
<view
class=
"u-flex right-content-opera"
>
<view
class=
"u-flex right-content-opera"
>
<view
class=
"no"
v-if=
"info.
stock
"
>
<view
class=
"no"
v-if=
"info.
max
"
>
可用
{{
info
.
stock
}}
件
可用
{{
info
.
max
}}
件
</view>
</view>
<view
class=
"num"
>
<view
class=
"num"
>
<u-number-box
v-show=
"!info.disabled"
v-model=
"info.quantity"
:min=
"info.min || 0"
:max=
"info.max || info.quantity"
@
change=
"numChange"
></u-number-box>
<u-number-box
v-show=
"!info.disabled"
v-model=
"info.quantity"
:min=
"info.min || 0"
:max=
"info.max || info.quantity"
@
change=
"numChange"
></u-number-box>
...
...
src/pages/order/complete.vue
View file @
98c31506
...
@@ -246,6 +246,7 @@
...
@@ -246,6 +246,7 @@
:categoryId=
"categoryId"
:categoryId=
"categoryId"
:brandId=
"brandId"
:brandId=
"brandId"
:order-id=
"orderId"
:order-id=
"orderId"
:orderNumber=
"orderNumber"
:groupIndex=
"groupIndex"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:item=
"item"
...
@@ -445,6 +446,7 @@ export default {
...
@@ -445,6 +446,7 @@ export default {
orderId
:
0
,
orderId
:
0
,
categoryId
:
0
,
categoryId
:
0
,
brandId
:
0
,
brandId
:
0
,
orderNumber
:
''
,
orderServiceType
:
''
,
orderServiceType
:
''
,
inGuaranteePeriod
:
''
,
inGuaranteePeriod
:
''
,
partnerCompanyId
:
''
,
partnerCompanyId
:
''
,
...
@@ -705,12 +707,16 @@ export default {
...
@@ -705,12 +707,16 @@ export default {
name
:
group
.
name
,
name
:
group
.
name
,
items
:
ele
,
items
:
ele
,
}
}
if
(
ele
.
fieldsName
===
'orderSpareParts'
)
{
const
index
=
errArr
.
findIndex
(
v
=>
v
.
name
===
'备件信息'
||
v
.
name
===
'物料信息'
)
if
(
index
>
-
1
)
return
}
errArr
.
push
(
errGroup
)
errArr
.
push
(
errGroup
)
}
}
})
})
})
})
})
})
// 图片分组
const
result
=
errArr
.
reduce
((
groups
,
item
)
=>
{
const
result
=
errArr
.
reduce
((
groups
,
item
)
=>
{
let
groupFound
=
groups
.
find
((
arrItem
)
=>
item
.
name
===
arrItem
.
name
)
let
groupFound
=
groups
.
find
((
arrItem
)
=>
item
.
name
===
arrItem
.
name
)
if
(
groupFound
)
{
if
(
groupFound
)
{
...
@@ -783,7 +789,7 @@ export default {
...
@@ -783,7 +789,7 @@ export default {
})
})
}
else
{
}
else
{
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
||
res
.
data
,
title
:
res
.
data
||
res
.
message
,
type
:
'error'
,
type
:
'error'
,
})
})
}
}
...
...
src/pages/order/parts.vue
View file @
98c31506
...
@@ -98,6 +98,7 @@ export default {
...
@@ -98,6 +98,7 @@ export default {
this
.
workOrderId
=
parseInt
(
e
.
workOrderId
)
this
.
workOrderId
=
parseInt
(
e
.
workOrderId
)
this
.
categoryId
=
parseInt
(
e
.
categoryId
)
this
.
categoryId
=
parseInt
(
e
.
categoryId
)
this
.
brandId
=
parseInt
(
e
.
brandId
)
this
.
brandId
=
parseInt
(
e
.
brandId
)
this
.
orderNumber
=
e
.
orderNumber
this
.
getReserve
()
this
.
getReserve
()
},
},
methods
:
{
methods
:
{
...
@@ -106,16 +107,18 @@ export default {
...
@@ -106,16 +107,18 @@ export default {
.
getMyReserve
({
.
getMyReserve
({
categoryId
:
this
.
categoryId
,
categoryId
:
this
.
categoryId
,
brandId
:
this
.
brandId
,
brandId
:
this
.
brandId
,
orderNumber
:
this
.
orderNumber
,
keyword
:
this
.
keyword
,
keyword
:
this
.
keyword
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
||
[]
const
data
=
res
.
data
||
[]
this
.
lists
=
data
.
map
((
v
)
=>
{
this
.
lists
=
data
.
map
((
v
)
=>
{
const
max
=
v
.
stock
+
Number
(
v
.
useStock
)
v
.
min
=
1
v
.
min
=
1
v
.
max
=
v
.
stock
v
.
checked
=
false
v
.
checked
=
false
v
.
quantity
=
v
.
stock
v
.
quantity
=
max
v
.
max
=
max
const
images
=
v
.
images
?
v
.
images
.
split
(
','
)
:
[]
const
images
=
v
.
images
?
v
.
images
.
split
(
','
)
:
[]
v
.
images
=
images
[
0
]
v
.
images
=
images
[
0
]
return
v
return
v
...
@@ -147,9 +150,8 @@ export default {
...
@@ -147,9 +150,8 @@ export default {
.
map
((
v
)
=>
{
.
map
((
v
)
=>
{
return
{
return
{
name
:
v
.
name
,
name
:
v
.
name
,
part_i
d
:
v
.
skuId
,
skuI
d
:
v
.
skuId
,
quantity
:
v
.
quantity
,
quantity
:
v
.
quantity
,
max
:
v
.
max
,
cost
:
v
.
cost
||
0
,
cost
:
v
.
cost
||
0
,
}
}
})
})
...
...
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