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
c21bb82d
Commit
c21bb82d
authored
Jun 29, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
备件选择
parent
83b2f6e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
spareCell.vue
src/components/parts/spareCell.vue
+20
-12
spare.vue
src/pages/mine/warehouse/spare.vue
+2
-1
No files found.
src/components/parts/spareCell.vue
View file @
c21bb82d
<
template
>
<
template
>
<view
class=
"spare-item"
>
<view
class=
"spare-item"
>
<view
class=
"left-view"
>
<view
class=
"left-view"
>
<u-checkbox
v-if=
"showChecked"
icon-size=
"28"
size=
"40"
v-model=
"
item.selected
"
@
change=
"handleChange"
shape=
"circle"
/>
<u-checkbox
v-if=
"showChecked"
icon-size=
"28"
size=
"40"
v-model=
"
check
"
@
change=
"handleChange"
shape=
"circle"
/>
<image
class=
"image-view"
:src=
"imageUrl"
></image>
<image
class=
"image-view"
:src=
"imageUrl"
></image>
<view
class=
"info-view"
>
<view
class=
"info-view"
>
<view
class=
"name-text"
>
{{
item
.
name
}}
</view>
<view
class=
"name-text"
>
{{
item
.
name
}}
</view>
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</view>
</view>
<view
class=
"count-view"
>
<view
class=
"count-view"
>
<view
v-if=
"showChecked"
>
<view
v-if=
"showChecked"
>
<u-number-box
v-model=
"
item.quantity
"
:min=
"item.min || 0"
:max=
"item.max || item[type]"
@
change=
"numChange"
></u-number-box>
<u-number-box
v-model=
"
value
"
:min=
"item.min || 0"
:max=
"item.max || item[type]"
@
change=
"numChange"
></u-number-box>
</view>
</view>
<text
v-else
>
x
{{
item
[
type
]
||
0
}}
</text>
<text
v-else
>
x
{{
item
[
type
]
||
0
}}
</text>
</view>
</view>
...
@@ -39,10 +39,12 @@
...
@@ -39,10 +39,12 @@
noteText
:
{
noteText
:
{
type
:
String
,
type
:
String
,
default
:
''
default
:
''
}
}
,
},
},
data
()
{
data
()
{
return
{
return
{
value
:
0
,
check
:
false
,
oldCount
:
0
oldCount
:
0
}
}
},
},
...
@@ -60,21 +62,27 @@
...
@@ -60,21 +62,27 @@
watch
:
{
watch
:
{
showChecked
(
val
)
{
showChecked
(
val
)
{
this
.
oldCount
=
0
this
.
oldCount
=
0
}
},
'item.quantity'
(
val
)
{
this
.
value
=
val
},
'item.selected'
(
val
)
{
this
.
check
=
val
this
.
value
=
val
?
this
.
item
.
stock
:
0
},
},
},
methods
:
{
methods
:
{
handleChange
()
{
handleChange
(
event
)
{
this
.
item
.
selected
=
!
this
.
item
.
selected
this
.
value
=
event
.
value
?
this
.
item
.
stock
:
0
this
.
$emit
(
'change'
,
this
.
item
.
selected
)
this
.
$emit
(
'change'
,
event
.
value
)
},
},
numChange
(
event
)
{
numChange
(
event
)
{
if
(
event
.
value
==
0
&&
this
.
oldCount
>
0
)
{
if
(
event
.
value
==
0
&&
this
.
oldCount
>
0
)
{
this
.
item
.
selected
=
false
this
.
check
=
false
this
.
$emit
(
'change'
,
this
.
item
.
selected
)
this
.
$emit
(
'change'
,
this
.
check
)
}
else
if
(
event
.
value
>
0
&&
this
.
oldCount
==
0
)
{
}
else
if
(
event
.
value
>
0
&&
this
.
oldCount
==
0
)
{
this
.
item
.
selected
=
true
this
.
check
=
true
this
.
$emit
(
'change'
,
this
.
item
.
selected
)
this
.
$emit
(
'change'
,
this
.
check
)
}
}
this
.
oldCount
=
event
.
value
this
.
oldCount
=
event
.
value
this
.
$emit
(
'numChange'
,
event
.
value
)
this
.
$emit
(
'numChange'
,
event
.
value
)
...
...
src/pages/mine/warehouse/spare.vue
View file @
c21bb82d
...
@@ -144,7 +144,8 @@
...
@@ -144,7 +144,8 @@
this
.
partsList
=
[]
this
.
partsList
=
[]
let
list
=
res
.
data
||
[]
let
list
=
res
.
data
||
[]
for
(
var
item
of
list
)
{
for
(
var
item
of
list
)
{
item
.
selected
=
false
item
.
selected
=
false
item
.
quantity
=
0
this
.
partsList
.
push
(
item
)
this
.
partsList
.
push
(
item
)
}
}
...
...
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