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
25bac99d
Commit
25bac99d
authored
Jun 29, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
备件库数量修改
parent
4e216908
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
136 additions
and
135 deletions
+136
-135
spareCell.vue
src/components/parts/spareCell.vue
+136
-135
No files found.
src/components/parts/spareCell.vue
View file @
25bac99d
<
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=
"check"
@
change=
"handleChange"
shape=
"circle"
/>
<u-checkbox
v-if=
"showChecked"
icon-size=
"28"
size=
"40"
v-model=
"check"
@
change=
"handleChange"
<image
class=
"image-view"
:src=
"imageUrl"
></image>
shape=
"circle"
/>
<view
class=
"info-view"
>
<image
class=
"image-view"
:src=
"imageUrl"
></image>
<view
class=
"name-text"
>
{{
item
.
name
}}
</view>
<view
class=
"info-view"
>
<view>
{{
remarkText
}}
</view>
<view
class=
"name-text"
>
{{
item
.
name
}}
</view>
</view>
<view>
{{
remarkText
}}
</view>
</view>
</view>
<view
class=
"count-view"
>
</view>
<view
v-if=
"showChecked"
>
<view
class=
"count-view"
>
<u-number-box
v-model=
"value"
:min=
"item.min || 0"
:max=
"item.max || item[type]"
@
change=
"numChange"
></u-number-box>
<view
v-if=
"showChecked"
>
</view>
<u-number-box
v-model=
"value"
:min=
"item.min || 0"
:max=
"item.max || item[type]"
@
minus=
"numChange"
<text
v-else
>
x
{{
item
[
type
]
||
0
}}
</text>
@
plus=
"numChange"
@
blur=
"numChange"
></u-number-box>
</view>
</view>
</view>
<text
v-else
>
x
{{
item
[
type
]
||
0
}}
</text>
</
template
>
</view>
</view>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
props
:
{
props
:
{
showChecked
:
{
// 是否显示勾选
showChecked
:
{
// 是否显示勾选
type
:
Boolean
,
type
:
Boolean
,
default
()
{
default
()
{
return
false
return
false
}
}
},
},
type
:
{
// 'stock' 仓库; 'quantity' 订单
type
:
{
// 'stock' 仓库; 'quantity' 订单
type
:
String
,
type
:
String
,
default
:
'quantity'
default
:
'quantity'
},
},
item
:
{
item
:
{
type
:
Object
,
type
:
Object
,
default
()
{
default
()
{
return
{}
return
{}
}
}
},
},
noteText
:
{
noteText
:
{
type
:
String
,
type
:
String
,
default
:
''
default
:
''
},
},
},
},
data
()
{
data
()
{
return
{
return
{
value
:
0
,
value
:
0
,
// 选数
check
:
false
,
check
:
false
,
// 选中
oldCount
:
0
oldCount
:
0
// 旧选数
}
}
},
},
computed
:
{
computed
:
{
remarkText
()
{
remarkText
()
{
if
(
this
.
item
.
categoryName
||
this
.
item
.
brandName
)
{
if
(
this
.
item
.
categoryName
||
this
.
item
.
brandName
)
{
return
(
this
.
item
.
categoryName
||
'通用'
)
+
'-'
+
(
this
.
item
.
brandName
||
'通用'
)
return
(
this
.
item
.
categoryName
||
'通用'
)
+
'-'
+
(
this
.
item
.
brandName
||
'通用'
)
}
else
{
}
else
{
return
'通用'
return
'通用'
}
}
},
},
imageUrl
()
{
imageUrl
()
{
return
this
.
item
.
images
?
process
.
uniEnv
.
systemUrl
.
apiUrl
+
this
.
item
.
images
.
split
(
','
).
shift
()
:
this
.
placeholderImage
return
this
.
item
.
images
?
process
.
uniEnv
.
systemUrl
.
apiUrl
+
this
.
item
.
images
.
split
(
','
).
shift
()
:
this
},
.
placeholderImage
placeholderImage
()
{
},
return
process
.
uniEnv
.
qn_base_url
+
'morentupian.png'
placeholderImage
()
{
},
return
process
.
uniEnv
.
qn_base_url
+
'morentupian.png'
},
},
watch
:
{
},
showChecked
(
val
)
{
watch
:
{
this
.
oldCount
=
0
showChecked
(
val
)
{
},
this
.
oldCount
=
0
'item.quantity'
(
val
)
{
},
this
.
value
=
val
'item.quantity'
(
val
)
{
},
this
.
value
=
val
'item.selected'
(
val
)
{
},
this
.
check
=
val
'item.selected'
(
val
)
{
this
.
value
=
val
?
this
.
item
.
stock
:
0
this
.
check
=
val
},
this
.
value
=
val
?
this
.
item
.
stock
:
0
},
},
methods
:
{
},
handleChange
(
event
)
{
methods
:
{
this
.
value
=
event
.
value
?
this
.
item
.
stock
:
0
handleChange
(
event
)
{
this
.
$emit
(
'change'
,
event
.
value
)
this
.
value
=
event
.
value
?
this
.
item
.
stock
:
0
},
this
.
oldCount
=
this
.
value
numChange
(
event
)
{
this
.
$emit
(
'change'
,
event
.
value
)
if
(
event
.
value
==
0
&&
this
.
oldCount
>
0
)
{
},
this
.
check
=
false
numChange
(
event
)
{
this
.
$emit
(
'change'
,
this
.
check
)
if
(
event
.
value
==
0
&&
this
.
oldCount
>
0
)
{
}
else
if
(
event
.
value
>
0
&&
this
.
oldCount
==
0
)
{
this
.
check
=
false
this
.
check
=
true
this
.
$emit
(
'change'
,
this
.
check
)
this
.
$emit
(
'change'
,
this
.
check
)
}
else
if
(
event
.
value
>
0
&&
this
.
oldCount
==
0
)
{
}
this
.
check
=
true
this
.
oldCount
=
event
.
value
this
.
$emit
(
'change'
,
this
.
check
)
this
.
$emit
(
'numChange'
,
event
.
value
)
}
},
this
.
oldCount
=
event
.
value
}
this
.
$emit
(
'numChange'
,
event
.
value
)
}
},
</
script
>
}
}
<
style
lang=
"scss"
scoped
>
</
script
>
.spare-item
{
display
:
flex
;
<
style
lang=
"scss"
scoped
>
// width: 100%;
.spare-item
{
justify-content
:
space-between
;
display
:
flex
;
align-items
:
flex-end
;
justify-content
:
space-between
;
// padding: 30rpx;
align-items
:
flex-end
;
// background-color: #FFFFFF;
// border-radius: 12rpx;
.left-view
{
.left-view
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
.image-view
{
.image-view
{
width
:
120rpx
;
width
:
120rpx
;
height
:
120rpx
;
height
:
120rpx
;
margin-right
:
20rpx
;
margin-right
:
20rpx
;
flex-shrink
:
0
;
flex-shrink
:
0
;
}
}
.info-view
{
.info-view
{
font-size
:
24rpx
;
font-size
:
24rpx
;
color
:
#333333
;
color
:
#333333
;
.name-text
{
.name-text
{
font-size
:
32rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#333333
;
color
:
#333333
;
margin-bottom
:
30rpx
;
margin-bottom
:
30rpx
;
}
}
}
}
}
}
.count-view
{
.count-view
{
font-size
:
28rpx
;
font-size
:
28rpx
;
color
:
#333333
;
color
:
#333333
;
}
}
}
}
</
style
>
</
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