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
73a21cbe
Commit
73a21cbe
authored
Oct 09, 2022
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 收费项接口调试
parent
005fb4fc
Pipeline
#3670
canceled with stages
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
115 additions
and
79 deletions
+115
-79
index.js
api/maintain/index.js
+20
-0
charges.vue
pages/maintain-bill/charges.vue
+47
-68
cell-charge.vue
pages/maintain-bill/components/cell-charge.vue
+10
-10
particulars-create.vue
pages/maintain-bill/components/particulars-create.vue
+1
-1
getters.js
store/getters.js
+1
-0
bill.js
store/modules/bill.js
+24
-0
common.js
utils/common.js
+12
-0
No files found.
api/maintain/index.js
View file @
73a21cbe
...
@@ -130,3 +130,23 @@ export async function repairSign(data) {
...
@@ -130,3 +130,23 @@ export async function repairSign(data) {
noLoading
:
true
noLoading
:
true
})
})
}
}
// 获取用户服务项列表
export
async
function
getRepairServiceTemplate
(
data
)
{
return
request
({
url
:
`/rest/repair/getRepairServiceTemplate`
,
method
:
'GET'
,
data
,
noLoading
:
true
})
}
// 收藏-取消收藏服务项
export
async
function
dealCollect
(
data
)
{
return
request
({
url
:
`/rest/repair/dealCollect/
${
data
.
id
}
`
,
method
:
'GET'
,
data
,
noLoading
:
true
})
}
\ No newline at end of file
pages/maintain-bill/charges.vue
View file @
73a21cbe
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<NavbarRight
title=
"收费项"
/>
<NavbarRight
title=
"收费项"
/>
<view
class=
"tabs-view"
>
<view
class=
"tabs-view"
>
<u-tabs
height=
"62"
activeColor=
"#02A074"
inactive-color=
"#333333"
bg-color=
"#F6F7FA"
bar-height=
"4"
<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"
bar-width=
"40"
:bar-style=
"
{ 'background-color': '#02A074' }" :list="tabs" :
current
="current" @change="change"
font-size="32" bold>
</u-tabs>
font-size="32" bold>
</u-tabs>
</view>
</view>
<view
class=
"title-view"
>
<view
class=
"title-view"
>
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
refresher-background=
"#F6F7FA"
@
refresherrefresh=
"onRefresh"
@
refresherrestore=
"onRestore"
enable-back-to-top
>
refresher-background=
"#F6F7FA"
@
refresherrefresh=
"onRefresh"
@
refresherrestore=
"onRestore"
enable-back-to-top
>
<view
class=
"list-view"
v-if=
"charges && charges.length > 0"
>
<view
class=
"list-view"
v-if=
"charges && charges.length > 0"
>
<view
v-for=
"(item, index) in charges"
:key=
"index"
class=
"item-view"
>
<view
v-for=
"(item, index) in charges"
:key=
"index"
class=
"item-view"
>
<CellCharge
:info=
"item"
@
select=
"handleSelect"
@
collect=
"handleCollect"
/>
<CellCharge
:info=
"item"
@
select=
"handleSelect"
@
collect
Flag
=
"handleCollect"
/>
</view>
</view>
<view
class=
"load-more-view"
v-show=
"(page == 1 && !loading) || page > 1"
>
<view
class=
"load-more-view"
v-show=
"(page == 1 && !loading) || page > 1"
>
<u-loadmore
:status=
"loadStatus"
bgColor=
"#F6F7FA"
></u-loadmore>
<u-loadmore
:status=
"loadStatus"
bgColor=
"#F6F7FA"
></u-loadmore>
...
@@ -36,8 +36,8 @@
...
@@ -36,8 +36,8 @@
import
NavbarRight
from
'@/components/navbar-right'
;
import
NavbarRight
from
'@/components/navbar-right'
;
import
CellCharge
from
'./components/cell-charge'
;
import
CellCharge
from
'./components/cell-charge'
;
import
NoData
from
'@/components/no-data'
;
import
NoData
from
'@/components/no-data'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
get
ChargeList
,
updateCharge
}
from
'@/api/project
/index.js'
;
import
{
get
RepairServiceTemplate
,
dealCollect
}
from
'@/api/maintain
/index.js'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -58,6 +58,7 @@ export default {
...
@@ -58,6 +58,7 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
...
mapGetters
([
'chargeIndex'
]),
baseUrl
()
{
baseUrl
()
{
return
process
.
uniEnv
.
qn_base_url
;
return
process
.
uniEnv
.
qn_base_url
;
},
},
...
@@ -77,54 +78,31 @@ export default {
...
@@ -77,54 +78,31 @@ export default {
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
this
.
freshing
=
false
;
this
.
freshing
=
false
;
this
.
current
=
this
.
chargeIndex
this
.
reloadList
();
this
.
reloadList
();
},
},
methods
:
{
methods
:
{
reloadList
()
{
reloadList
()
{
this
.
page
=
1
;
this
.
page
=
1
;
this
.
loadStatus
=
'loading'
;
this
.
loadStatus
=
'loading'
;
this
.
get
ChargeList
();
this
.
get
RepairServiceTemplate
();
},
},
get
ChargeList
()
{
get
RepairServiceTemplate
()
{
if
(
this
.
page
==
1
)
{
if
(
this
.
page
==
1
)
{
this
.
loading
=
true
;
this
.
loading
=
true
;
}
}
// getChargeList({
getRepairServiceTemplate
({
// page: this.page,
page
:
this
.
page
,
// collect: this.current,
collectFlag
:
this
.
current
==
0
?
false
:
true
,
// size: this.size,
size
:
this
.
size
,
// })
})
// .then(res => {
.
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
;
let
data
=
res
.
data
;
if
(
this
.
page
==
1
)
{
if
(
this
.
page
==
1
)
{
this
.
charges
=
[];
this
.
charges
=
[];
}
}
if
(
data
.
records
)
{
if
(
data
)
{
this
.
charges
.
push
(...
data
.
records
);
this
.
charges
.
push
(...
data
);
this
.
loadStatus
=
data
.
total
>
this
.
charges
.
length
?
'loadmore'
:
'nomore'
;
this
.
loadStatus
=
data
.
total
>
this
.
charges
.
length
?
'loadmore'
:
'nomore'
;
}
else
{
}
else
{
this
.
loadStatus
=
'nomore'
this
.
loadStatus
=
'nomore'
...
@@ -136,15 +114,16 @@ export default {
...
@@ -136,15 +114,16 @@ export default {
}
}
});
});
this
.
loading
=
false
;
this
.
loading
=
false
;
//
})
})
//
.catch(err => {
.
catch
(
err
=>
{
//
this.loading = false;
this
.
loading
=
false
;
//
console.log(err);
console
.
log
(
err
);
//
});
});
},
},
change
()
{
change
(
index
)
{
this
.
current
=
index
this
.
current
=
index
this
.
reloadList
()
this
.
reloadList
()
this
.
$store
.
dispatch
(
'Save_charge_index'
,
index
);
},
},
onRefresh
()
{
onRefresh
()
{
...
@@ -160,16 +139,18 @@ export default {
...
@@ -160,16 +139,18 @@ export default {
if
(
this
.
loadStatus
!=
'loadmore'
)
return
;
if
(
this
.
loadStatus
!=
'loadmore'
)
return
;
this
.
page
+=
1
;
this
.
page
+=
1
;
this
.
loadStatus
==
'loading'
;
this
.
loadStatus
==
'loading'
;
this
.
get
ChargeList
();
this
.
get
RepairServiceTemplate
();
},
},
handleCollect
(
id
,
collect
)
{
handleCollect
(
id
,
collect
Flag
)
{
for
(
var
item
of
this
.
charges
)
{
for
(
var
item
of
this
.
charges
)
{
if
(
item
.
id
==
id
)
{
if
(
item
.
id
==
id
)
{
item
.
collect
=
collect
item
.
collectFlag
=
collectFlag
// this.updateCharge(id)
this
.
dealCollect
({
collectFlag
:
collectFlag
,
id
:
id
})
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
collect
?
'收藏成功'
:
'取消成功'
,
title
:
collect
Flag
?
'收藏成功'
:
'取消成功'
,
type
:
'success'
,
type
:
'success'
,
duration
:
1500
,
duration
:
1500
,
callback
:
()
=>
{
callback
:
()
=>
{
...
@@ -179,10 +160,8 @@ export default {
...
@@ -179,10 +160,8 @@ export default {
}
}
}
}
},
},
updateCharge
(
id
)
{
dealCollect
(
params
)
{
updateCharge
({
dealCollect
(
params
)
id
:
id
})
.
then
(
res
=>
{
.
then
(
res
=>
{
let
data
=
res
.
data
;
let
data
=
res
.
data
;
if
(
data
)
{
if
(
data
)
{
...
@@ -190,8 +169,8 @@ export default {
...
@@ -190,8 +169,8 @@ export default {
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
for
(
var
item
of
this
.
employees
)
{
for
(
var
item
of
this
.
employees
)
{
if
(
item
.
id
==
id
)
{
if
(
item
.
id
==
params
.
id
)
{
item
.
collect
=
!
item
.
collect
item
.
collect
Flag
=
!
item
.
collectFlag
break
break
}
}
}
}
...
...
pages/maintain-bill/components/cell-charge.vue
View file @
73a21cbe
<
template
>
<
template
>
<view
class=
"cell-charge"
@
click=
"$u.throttle(handleClickCell, 500)"
>
<view
class=
"cell-charge"
@
click=
"$u.throttle(handleClickCell, 500)"
>
<view
class=
"left-view"
>
{{
info
.
n
ame
}}
</view>
<view
class=
"left-view"
>
{{
info
.
serviceN
ame
}}
</view>
<view
class=
"right-view"
>
<view
class=
"right-view"
>
<view
class=
"unit-view"
>
{{
info
.
unit
}}
</view>
<view
class=
"unit-view"
>
{{
info
.
unit
}}
</view>
<view
class=
"collect-view"
@
click
.
stop=
"$u.throttle(handleSelect, 500)"
hover-class=
"u-hover-class"
>
<view
class=
"collect
Flag
-view"
@
click
.
stop=
"$u.throttle(handleSelect, 500)"
hover-class=
"u-hover-class"
>
<image
:src=
"collectImage"
class=
"collect-image"
></image>
<image
:src=
"collectImage"
class=
"collect
Flag
-image"
></image>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -18,8 +18,8 @@ export default {
...
@@ -18,8 +18,8 @@ export default {
default
()
{
default
()
{
return
{
return
{
id
:
''
,
id
:
''
,
n
ame
:
''
,
serviceN
ame
:
''
,
collect
:
''
,
collect
Flag
:
''
,
unit
:
''
,
unit
:
''
,
}
}
},
},
...
@@ -33,14 +33,14 @@ export default {
...
@@ -33,14 +33,14 @@ export default {
return
process
.
uniEnv
.
qn_base_url
return
process
.
uniEnv
.
qn_base_url
},
},
collectImage
()
{
collectImage
()
{
return
this
.
baseUrl
+
(
this
.
info
.
collect
?
'dianjishoucang1@3x.png'
:
'shoucangshoufei0@3x.png'
)
return
this
.
baseUrl
+
(
this
.
info
.
collect
Flag
?
'dianjishoucang1@3x.png'
:
'shoucangshoufei0@3x.png'
)
},
},
},
},
created
()
{
},
created
()
{
},
methods
:
{
methods
:
{
handleSelect
()
{
handleSelect
()
{
this
.
info
.
collect
=
!
this
.
info
.
collect
this
.
info
.
collect
Flag
=
!
this
.
info
.
collectFlag
this
.
$emit
(
'collect
'
,
this
.
info
.
id
,
this
.
info
.
collect
)
this
.
$emit
(
'collect
Flag'
,
this
.
info
.
id
,
this
.
info
.
collectFlag
)
},
},
handleClickCell
()
{
handleClickCell
()
{
this
.
$emit
(
'select'
,
{
...
this
.
info
})
this
.
$emit
(
'select'
,
{
...
this
.
info
})
...
@@ -75,7 +75,7 @@ export default {
...
@@ -75,7 +75,7 @@ export default {
.unit-view
{}
.unit-view
{}
.collect-view
{
.collect
Flag
-view
{
margin-left
:
56rpx
;
margin-left
:
56rpx
;
width
:
80rpx
;
width
:
80rpx
;
height
:
80rpx
;
height
:
80rpx
;
...
@@ -83,7 +83,7 @@ export default {
...
@@ -83,7 +83,7 @@ export default {
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
.collect-image
{
.collect
Flag
-image
{
width
:
32rpx
;
width
:
32rpx
;
height
:
32rpx
;
height
:
32rpx
;
}
}
...
...
pages/maintain-bill/components/particulars-create.vue
View file @
73a21cbe
...
@@ -171,7 +171,7 @@ export default {
...
@@ -171,7 +171,7 @@ export default {
uni
.
$on
(
'charge-selected'
,
res
=>
{
uni
.
$on
(
'charge-selected'
,
res
=>
{
var
form
=
JSON
.
parse
(
res
||
{})
var
form
=
JSON
.
parse
(
res
||
{})
this
.
form
.
unit
=
form
.
unit
this
.
form
.
unit
=
form
.
unit
this
.
form
.
name
=
form
.
n
ame
this
.
form
.
name
=
form
.
serviceN
ame
});
});
},
},
destroyed
()
{
destroyed
()
{
...
...
store/getters.js
View file @
73a21cbe
...
@@ -13,5 +13,6 @@ const getters = {
...
@@ -13,5 +13,6 @@ const getters = {
customId
:
state
=>
state
.
bill
.
customId
,
customId
:
state
=>
state
.
bill
.
customId
,
canGetLocation
:
state
=>
state
.
map
.
canGetLocation
,
canGetLocation
:
state
=>
state
.
map
.
canGetLocation
,
prevProjectId
:
state
=>
state
.
workpoint
.
prevProjectId
,
prevProjectId
:
state
=>
state
.
workpoint
.
prevProjectId
,
chargeIndex
:
state
=>
state
.
bill
.
chargeIndex
,
}
}
export
default
getters
export
default
getters
store/modules/bill.js
View file @
73a21cbe
...
@@ -5,12 +5,16 @@ import {
...
@@ -5,12 +5,16 @@ import {
setCustomId
,
setCustomId
,
getCustomId
,
getCustomId
,
removeCustomId
,
removeCustomId
,
setChargeIndex
,
getChargeIndex
,
removeChargeIndex
,
}
from
"@/utils/common.js"
}
from
"@/utils/common.js"
const
state
=
{
const
state
=
{
billType
:
getBillType
()
||
'INCOME'
,
billType
:
getBillType
()
||
'INCOME'
,
customId
:
getCustomId
()
||
null
,
customId
:
getCustomId
()
||
null
,
chargeIndex
:
getChargeIndex
()
||
0
,
}
}
const
mutations
=
{
const
mutations
=
{
...
@@ -30,6 +34,14 @@ const mutations = {
...
@@ -30,6 +34,14 @@ const mutations = {
state
.
customId
=
null
state
.
customId
=
null
removeCustomId
()
removeCustomId
()
},
},
SAVE__CHARGE_INDEX
:
(
state
,
data
)
=>
{
state
.
chargeIndex
=
data
setChargeIndex
(
data
)
},
REMOVE_CHARGE_INDEX
:
(
state
,
data
)
=>
{
state
.
chargeIndex
=
null
removeChargeIndex
()
},
}
}
const
actions
=
{
const
actions
=
{
...
@@ -57,6 +69,18 @@ const actions = {
...
@@ -57,6 +69,18 @@ const actions = {
})
=>
{
})
=>
{
commit
(
"REMOVE_CUSTOM_ID"
)
commit
(
"REMOVE_CUSTOM_ID"
)
},
},
Save_charge_index
:({
state
,
commit
},
data
)
=>
{
commit
(
"SAVE__CHARGE_INDEX"
,
data
)
},
Remove_charge_index
:({
state
,
commit
})
=>
{
commit
(
"REMOVE_CHARGE_INDEX"
)
},
}
}
export
default
{
export
default
{
...
...
utils/common.js
View file @
73a21cbe
...
@@ -154,6 +154,18 @@ export function removeProjectId() {
...
@@ -154,6 +154,18 @@ export function removeProjectId() {
uni
.
removeStorageSync
(
"PROJECT-ID"
)
uni
.
removeStorageSync
(
"PROJECT-ID"
)
}
}
export
function
setChargeIndex
(
data
)
{
uni
.
setStorageSync
(
"CHARGE-INDEX"
,
data
);
}
export
function
getChargeIndex
()
{
return
uni
.
getStorageSync
(
"CHARGE-INDEX"
)
||
0
}
export
function
removeChargeIndex
()
{
uni
.
removeStorageSync
(
"CHARGE-INDEX"
)
}
export
function
checkLoginAndVip
(
callback
)
{
export
function
checkLoginAndVip
(
callback
)
{
if
(
checkToken
())
{
if
(
checkToken
())
{
if
(
checkVip
())
{
if
(
checkVip
())
{
...
...
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