Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
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
刘文虎
account-book
Commits
c0fdb186
Commit
c0fdb186
authored
Sep 30, 2022
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 常用收费项
parent
80c2c057
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
404 additions
and
4 deletions
+404
-4
pages.json
pages.json
+9
-0
charges.vue
pages/maintain-bill/charges.vue
+271
-0
cell-charge.vue
pages/maintain-bill/components/cell-charge.vue
+94
-0
particulars-create.vue
pages/maintain-bill/components/particulars-create.vue
+30
-4
No files found.
pages.json
View file @
c0fdb186
...
@@ -351,6 +351,15 @@
...
@@ -351,6 +351,15 @@
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
{
"path"
:
"charges"
,
"name"
:
"charges"
,
"style"
:
{
"navigationBarTitleText"
:
"收费项"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
},
{
},
{
"path"
:
"detail"
,
"path"
:
"detail"
,
"name"
:
"maintain-bill-detail"
,
"name"
:
"maintain-bill-detail"
,
...
...
pages/maintain-bill/charges.vue
0 → 100644
View file @
c0fdb186
<
template
>
<view
class=
"charges-view"
>
<NavbarRight
title=
"收费项"
/>
<view
class=
"tabs-view"
>
<u-tabs
height=
"62"
activeColor=
"#02A074"
inactive-color=
"#333333"
bg-color=
"#F6F7FA"
bar-height=
"4"
bar-width=
"40"
:bar-style=
"
{ 'background-color': '#02A074' }" :list="tabs" :page="current" @change="change"
font-size="32" bold>
</u-tabs>
</view>
<view
class=
"title-view"
>
<view
class=
"left-view"
>
项目名称
</view>
<view
class=
"right-view"
>
单位
</view>
</view>
<view
class=
"content-view"
>
<scroll-view
scroll-y
style=
"height: 100%; width: 100%"
@
scrolltolower=
"reachBottom"
scroll-anchoring
refresher-enabled=
"true"
:refresher-triggered=
"triggered"
:refresher-threshold=
"100"
refresher-background=
"#F6F7FA"
@
refresherrefresh=
"onRefresh"
@
refresherrestore=
"onRestore"
enable-back-to-top
>
<view
class=
"list-view"
v-if=
"charges && charges.length > 0"
>
<view
v-for=
"(item, index) in charges"
:key=
"index"
class=
"item-view"
>
<CellCharge
:info=
"item"
@
select=
"handleSelect"
@
collect=
"handleCollect"
/>
</view>
<view
class=
"load-more-view"
v-show=
"(page == 1 && !loading) || page > 1"
>
<u-loadmore
:status=
"loadStatus"
bgColor=
"#F6F7FA"
></u-loadmore>
</view>
</view>
<NoData
v-else-if=
"!loading"
customStyle=
"margin-top:100rpx"
:image=
"noData.image"
:text=
"noData.text"
/>
</scroll-view>
</view>
<view
class=
"loading-view"
v-if=
"loading && !freshing"
>
<u-loading
mode=
"flower"
></u-loading>
</view>
<u-toast
ref=
"uToast"
/>
</view>
</
template
>
<
script
>
import
NavbarRight
from
'@/components/navbar-right'
;
import
CellCharge
from
'./components/cell-charge'
;
import
NoData
from
'@/components/no-data'
;
import
{
getChargeList
,
updateCharge
}
from
'@/api/project/index.js'
;
export
default
{
components
:
{
NavbarRight
,
CellCharge
,
NoData
},
data
()
{
return
{
charges
:
[],
loading
:
true
,
loadStatus
:
'loading'
,
triggered
:
true
,
freshing
:
false
,
current
:
0
,
page
:
1
,
size
:
15
,
};
},
computed
:
{
baseUrl
()
{
return
process
.
uniEnv
.
qn_base_url
;
},
tabs
()
{
return
[{
name
:
'最近使用'
},
{
name
:
'我的收藏'
}]
},
noData
()
{
return
{
image
:
this
.
baseUrl
+
'wuweixiuzhangdan@3x.png'
,
text
:
'当前暂无相关信息'
};
},
},
onLoad
(
options
)
{
this
.
freshing
=
false
;
this
.
reloadList
();
},
methods
:
{
reloadList
()
{
this
.
page
=
1
;
this
.
loadStatus
=
'loading'
;
this
.
getChargeList
();
},
getChargeList
()
{
if
(
this
.
page
==
1
)
{
this
.
loading
=
true
;
}
// getChargeList({
// page: this.page,
// collect: this.current,
// size: this.size,
// })
// .then(res => {
var
res
=
{
data
:
{
records
:
[
{
id
:
'1'
,
name
:
'服务'
,
collect
:
true
,
unit
:
'米'
,
},
{
id
:
'2'
,
name
:
'线缆'
,
collect
:
false
,
unit
:
'米'
,
},
{
id
:
'3'
,
name
:
'螺丝'
,
collect
:
true
,
unit
:
'个'
,
}
]
}
}
let
data
=
res
.
data
;
if
(
this
.
page
==
1
)
{
this
.
charges
=
[];
}
if
(
data
.
records
)
{
this
.
charges
.
push
(...
data
.
records
);
this
.
loadStatus
=
data
.
total
>
this
.
charges
.
length
?
'loadmore'
:
'nomore'
;
}
else
{
this
.
loadStatus
=
'nomore'
}
this
.
$nextTick
(()
=>
{
if
(
this
.
freshing
)
{
this
.
triggered
=
false
;
this
.
freshing
=
false
;
}
});
this
.
loading
=
false
;
// })
// .catch(err => {
// this.loading = false;
// console.log(err);
// });
},
change
()
{
this
.
current
=
index
this
.
reloadList
()
},
onRefresh
()
{
if
(
this
.
freshing
)
return
;
this
.
freshing
=
true
;
this
.
reloadList
();
},
onRestore
()
{
this
.
triggered
=
'restore'
;
// 需要重置
},
// 滚动底部
reachBottom
(
e
)
{
if
(
this
.
loadStatus
!=
'loadmore'
)
return
;
this
.
page
+=
1
;
this
.
loadStatus
==
'loading'
;
this
.
getChargeList
();
},
handleCollect
(
id
,
collect
)
{
for
(
var
item
of
this
.
charges
)
{
if
(
item
.
id
==
id
)
{
item
.
collect
=
collect
// this.updateCharge(id)
this
.
$refs
.
uToast
.
show
({
title
:
collect
?
'收藏成功'
:
'取消成功'
,
type
:
'success'
,
duration
:
1500
,
callback
:
()
=>
{
}
});
break
}
}
},
updateCharge
(
id
)
{
updateCharge
({
id
:
id
})
.
then
(
res
=>
{
let
data
=
res
.
data
;
if
(
data
)
{
}
})
.
catch
(
err
=>
{
for
(
var
item
of
this
.
employees
)
{
if
(
item
.
id
==
id
)
{
item
.
collect
=
!
item
.
collect
break
}
}
console
.
log
(
err
);
});
},
handleSelect
(
item
)
{
uni
.
$emit
(
'charge-selected'
,
JSON
.
stringify
(
item
))
this
.
$u
.
route
({
type
:
'navigateBack'
,
params
:
{
}
});
},
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
.charges-view
{
display
:
flex
;
flex-direction
:
column
;
height
:
100vh
;
background-color
:
#f6f7fa
;
.tabs-view
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.title-view
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
font-size
:
28rpx
;
color
:
#8D8D8D
;
margin
:
32rpx
24rpx
24rpx
24rpx
;
.left-view
{
margin-left
:
24rpx
;
}
.right-view
{
width
:
168rpx
;
text-align
:
left
;
}
}
.content-view
{
height
:
100%
;
padding
:
0rpx
24rpx
;
overflow
:
auto
;
.list-view
{
.item-view
{
margin
:
0
0
24rpx
0
;
}
}
.load-more-view
{
padding-bottom
:
44rpx
;
}
}
.loading-view
{
width
:
100%
;
background-color
:
transparent
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
top
:
50%
;
left
:
0
;
position
:
fixed
;
}
}
</
style
>
pages/maintain-bill/components/cell-charge.vue
0 → 100644
View file @
c0fdb186
<
template
>
<view
class=
"cell-charge"
@
click=
"$u.throttle(handleClickCell, 500)"
>
<view
class=
"left-view"
>
{{
info
.
name
}}
</view>
<view
class=
"right-view"
>
<view
class=
"unit-view"
>
{{
info
.
unit
}}
</view>
<view
class=
"collect-view"
@
click
.
stop=
"$u.throttle(handleSelect, 500)"
hover-class=
"u-hover-class"
>
<image
:src=
"collectImage"
class=
"collect-image"
></image>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
info
:
{
type
:
Object
,
default
()
{
return
{
id
:
''
,
name
:
''
,
collect
:
''
,
unit
:
''
,
}
},
}
},
data
()
{
return
{}
},
computed
:
{
baseUrl
()
{
return
process
.
uniEnv
.
qn_base_url
},
collectImage
()
{
return
this
.
baseUrl
+
(
this
.
info
.
collect
?
'dianjishoucang1@3x.png'
:
'shoucangshoufei0@3x.png'
)
},
},
created
()
{
},
methods
:
{
handleSelect
()
{
this
.
info
.
collect
=
!
this
.
info
.
collect
this
.
$emit
(
'collect'
,
this
.
info
.
id
,
this
.
info
.
collect
)
},
handleClickCell
()
{
this
.
$emit
(
'select'
,
{
...
this
.
info
})
}
},
}
</
script
>
<
style
scoped
lang=
"scss"
>
.cell-charge
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
font-weight
:
bold
;
color
:
#333333
;
font-size
:
28rpx
;
padding
:
0
0
0
24rpx
;
min-height
:
112rpx
;
border-radius
:
16rpx
;
background-color
:
#ffffff
;
.left-view
{
min-width
:
440rpx
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
.right-view
{
display
:
flex
;
justify-content
:
flex-end
;
align-items
:
center
;
.unit-view
{}
.collect-view
{
margin-left
:
56rpx
;
width
:
80rpx
;
height
:
80rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.collect-image
{
width
:
32rpx
;
height
:
32rpx
;
}
}
}
}
</
style
>
pages/maintain-bill/components/particulars-create.vue
View file @
c0fdb186
...
@@ -9,9 +9,10 @@
...
@@ -9,9 +9,10 @@
<view
class=
"part-view"
>
<view
class=
"part-view"
>
<view
class=
"item-view"
>
<view
class=
"item-view"
>
<view
class=
"label-view"
>
收费项
</view>
<view
class=
"label-view"
>
收费项
</view>
<view
class=
"value-view"
>
<view
class=
"value-view
charge-view
"
>
<u-input
type=
"text"
:clearable=
"false"
:custom-style=
"customStyle"
cursor-spacing=
'50'
:placeholder-style=
"placeholderStyle"
v-model=
"form.name"
placeholder=
"填写费用名称"
@
blur=
"leaveInput"
<u-input
type=
"text"
:clearable=
"false"
:custom-style=
"customStyle"
cursor-spacing=
'50'
:placeholder-style=
"placeholderStyle"
v-model=
"form.name"
placeholder=
"填写费用名称"
@
blur=
"leaveInput"
@
focus=
"getHeight"
/>
@
focus=
"getHeight"
/>
<ab-button
content=
"常用"
:customStyle=
"customStyleUnit"
@
click=
"chooseCharge"
></ab-button>
</view>
</view>
</view>
</view>
<view
class=
"line-view"
></view>
<view
class=
"line-view"
></view>
...
@@ -118,9 +119,11 @@ export default {
...
@@ -118,9 +119,11 @@ export default {
'margin-left'
:
'24rpx'
,
'margin-left'
:
'24rpx'
,
width
:
'72rpx'
,
width
:
'72rpx'
,
height
:
'40rpx'
,
height
:
'40rpx'
,
'font-size'
:
'24rpx'
,
'font-size'
:
'20rpx'
,
background
:
'#02A074'
,
background
:
'transparent'
,
'border-radius'
:
'8rpx'
'border-radius'
:
' 8rpx'
,
border
:
' 2rpx solid #02A074'
,
color
:
'#02A074'
,
},
},
customStyleSubmit
:{
customStyleSubmit
:{
width
:
'240rpx'
,
width
:
'240rpx'
,
...
@@ -164,6 +167,16 @@ export default {
...
@@ -164,6 +167,16 @@ export default {
return
flag
;
return
flag
;
}
}
},
},
created
()
{
uni
.
$on
(
'charge-selected'
,
res
=>
{
var
form
=
JSON
.
parse
(
res
||
{})
this
.
form
.
unit
=
form
.
unit
this
.
form
.
name
=
form
.
name
});
},
destroyed
()
{
uni
.
$off
(
'charge-selected'
)
},
methods
:
{
methods
:
{
open
(
detail
)
{
open
(
detail
)
{
if
(
detail
&&
detail
.
uid
){
if
(
detail
&&
detail
.
uid
){
...
@@ -228,6 +241,14 @@ export default {
...
@@ -228,6 +241,14 @@ export default {
chooseUnit
()
{
chooseUnit
()
{
this
.
$refs
[
'unit-popup'
].
open
()
this
.
$refs
[
'unit-popup'
].
open
()
},
},
chooseCharge
()
{
this
.
$u
.
route
({
url
:
'/pages/maintain-bill/charges'
,
type
:
'navigateTo'
,
params
:
{
}
});
},
handleChangeUnit
(
e
){
handleChangeUnit
(
e
){
this
.
form
.
unit
=
e
this
.
form
.
unit
=
e
}
}
...
@@ -283,6 +304,11 @@ export default {
...
@@ -283,6 +304,11 @@ export default {
color
:
#333333
;
color
:
#333333
;
text-align
:
right
;
text-align
:
right
;
}
}
.charge-view
{
display
:
flex
;
justify-content
:
flex-end
;
align-items
:
center
;
}
.number-view
{
.number-view
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
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