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
84df2036
Commit
84df2036
authored
Jul 25, 2022
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 导出维修账单
parent
cd001626
Pipeline
#2926
canceled with stages
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
36 deletions
+86
-36
index.js
api/maintain/index.js
+1
-1
index.vue
components/pop-export-bill/index.vue
+7
-4
bill.vue
pages/index/bill/bill.vue
+2
-2
detail.vue
pages/maintain-bill/detail.vue
+1
-2
index.vue
pages/maintain-bill/index.vue
+56
-22
particulars.vue
pages/maintain-bill/particulars.vue
+19
-5
No files found.
api/maintain/index.js
View file @
84df2036
...
...
@@ -44,7 +44,7 @@ export async function repair(data) {
export
async
function
repairExport
(
data
)
{
return
request
({
url
:
`/rest/repair/export`
,
method
:
'
GE
T'
,
method
:
'
POS
T'
,
data
,
noLoading
:
true
})
...
...
components/pop-export-bill/index.vue
View file @
84df2036
...
...
@@ -40,7 +40,7 @@
</view>
<view
class=
"buttons-view"
>
<view
class=
"right-view"
>
<u-button
:custom-style=
"customConFirm"
@
click=
"handleClickConfirm"
>
<u-button
:custom-style=
"customConFirm"
@
click=
"handleClickConfirm"
:loading=
"loading"
>
<view
class=
"confirm-view"
>
{{
confirmText
}}
</view>
</u-button>
</view>
...
...
@@ -74,12 +74,14 @@ export default {
return
{
show
:
false
,
daterange
:
[],
currentIndex
:
1
currentIndex
:
1
,
loading
:
false
}
},
watch
:
{
visible
(
val
)
{
this
.
show
=
val
this
.
loading
=
false
},
},
computed
:
{
...
...
@@ -120,8 +122,9 @@ export default {
this
.
$emit
(
'update:visible'
,
val
)
},
handleClickConfirm
()
{
this
.
changeVisibleValue
(
false
)
this
.
$emit
(
'confirm'
,
this
.
currentIndex
==
0
?
[]
:
this
.
daterange
)
// this.changeVisibleValue(false)
this
.
loading
=
true
this
.
$emit
(
'confirm'
,
this
.
currentIndex
==
0
?
null
:
this
.
daterange
)
},
handleClose
()
{
this
.
changeVisibleValue
(
false
)
...
...
pages/index/bill/bill.vue
View file @
84df2036
...
...
@@ -135,8 +135,8 @@ export default {
},
handleClickConfirm
(
range
)
{
console
.
log
(
range
);
let
startTime
=
''
;
let
endTime
=
''
;
let
startTime
=
null
;
let
endTime
=
null
;
if
(
range
)
{
startTime
=
range
[
0
];
endTime
=
range
[
1
];
...
...
pages/maintain-bill/detail.vue
View file @
84df2036
...
...
@@ -156,7 +156,7 @@ import {
repairSettle
,
repairSync
,
repairDelete
,
repairSend
,
repairSend
}
from
'@/api/maintain/index.js'
export
default
{
...
...
@@ -492,7 +492,6 @@ export default {
var
index
=
0
for
(
var
item
of
pages
)
{
if
(
item
.
route
.
indexOf
(
'pages/maintain-bill/index'
)
!=
-
1
)
{
console
.
log
(
'---back----'
,
pages
.
length
-
index
)
uni
.
navigateBack
({
delta
:
pages
.
length
-
index
-
1
,
})
...
...
pages/maintain-bill/index.vue
View file @
84df2036
...
...
@@ -6,7 +6,7 @@
text=
"导出账单"
imageWidth=
"20"
:image=
"outImage"
@
click=
"handlClic
kOu
t"
@
click=
"handlClic
Expor
t"
/>
<view
class=
"search-bar"
>
<u-search
...
...
@@ -86,17 +86,14 @@
:image=
"currentNoData.image"
:text=
"currentNoData.text"
/>
<view
class=
"loading-view"
v-if=
"loading && !_freshing"
><u-loading
mode=
"flower"
></u-loading
></view>
</scroll-view>
</view>
<
PopExport
:visible
.
sync=
"visible"
@
confirm=
"handleClickConfirm"
/>
<
view
class=
"loading-view"
v-if=
"loading && !_freshing"
><u-loading
mode=
"flower"
></u-loading
></view>
<PopExport
:visible
.
sync=
"visible"
@
confirm=
"handleClickConfirm"
/>
<FabView
@
click=
"handleClickFab"
/>
<u-toast
ref=
"uToast"
/>
<u-toast
ref=
"uToast"
/>
</view>
</
template
>
...
...
@@ -108,6 +105,7 @@ import FabView from '@/components/fab-view'
import
NoData
from
'@/components/no-data'
import
PopExport
from
'@/components/pop-export-bill'
import
{
repairExport
,
repair
}
from
'@/api/maintain/index.js'
import
{
downLoad
}
from
'@/utils/download.js'
export
default
{
components
:
{
...
...
@@ -166,10 +164,14 @@ export default {
:
''
},
start
()
{
return
this
.
daterange
.
length
>
0
&&
this
.
daterange
[
0
]
?
this
.
daterange
[
0
]
+
' 00:00:00'
:
''
return
this
.
daterange
.
length
>
0
&&
this
.
daterange
[
0
]
?
this
.
daterange
[
0
]
+
' 00:00:00'
:
''
},
end
()
{
return
this
.
daterange
.
length
>
0
&&
this
.
daterange
[
1
]
?
this
.
daterange
[
1
]
+
' 00:00:00'
:
''
return
this
.
daterange
.
length
>
0
&&
this
.
daterange
[
1
]
?
this
.
daterange
[
1
]
+
' 00:00:00'
:
''
},
},
onLoad
()
{
...
...
@@ -281,11 +283,43 @@ export default {
params
:
{},
})
},
handlClic
kOu
t
()
{
handlClic
Expor
t
()
{
this
.
visible
=
true
},
handleClickConfirm
(
range
)
{
var
param
=
{
end
:
null
,
start
:
null
,
}
if
(
range
)
{
param
=
{
end
:
range
[
0
]
+
' 00:00:00'
,
start
:
range
[
1
]
+
' 00:00:00'
,
}
}
// 导出
repairExport
(
param
)
.
then
((
res
)
=>
{
if
(
res
)
{
this
.
saveFile
(
res
)
}
this
.
loading
=
false
})
.
catch
((
res
)
=>
{
if
(
res
)
{
this
.
saveFile
(
res
)
}
this
.
loading
=
false
})
},
async
saveFile
(
file
)
{
try
{
let
res
=
await
downLoad
(
file
)
this
.
visible
=
false
}
catch
(
e
)
{
this
.
visible
=
false
console
.
log
(
'saveFile_error'
,
e
)
}
},
},
}
...
...
@@ -374,16 +408,16 @@ export default {
.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
;
}
}
.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/particulars.vue
View file @
84df2036
...
...
@@ -128,7 +128,7 @@
confirmText=
"确认"
content=
"确认删除该条明细吗?"
/>
<u-toast
ref=
"uToast"
/>
<u-toast
ref=
"uToast"
/>
</view>
</
template
>
...
...
@@ -237,8 +237,7 @@ export default {
},
onReady
()
{},
onUnload
()
{},
onShow
()
{
},
onShow
()
{},
methods
:
{
repairDetail
()
{
this
.
loading
=
true
...
...
@@ -322,7 +321,7 @@ export default {
.
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
uni
.
$emit
(
'maintain-bill-detail'
)
this
.
to
Detail
Page
()
this
.
toPage
()
this
.
buttonLoading
=
false
}
})
...
...
@@ -330,6 +329,21 @@ export default {
this
.
buttonLoading
=
false
})
},
toPage
()
{
var
pages
=
getCurrentPages
()
var
index
=
0
for
(
var
item
of
pages
)
{
if
(
item
.
route
.
indexOf
(
'pages/maintain-bill/detail'
)
!=
-
1
)
{
uni
.
navigateBack
({
delta
:
pages
.
length
-
index
-
1
,
})
return
}
index
++
}
// 回首页
this
.
toDetailPage
()
},
toDetailPage
()
{
this
.
$u
.
route
({
url
:
'pages/maintain-bill/detail'
,
...
...
@@ -340,7 +354,7 @@ export default {
})
},
handleClickSkip
(
date
)
{
this
.
to
Detail
Page
()
this
.
toPage
()
},
handleClickSure
()
{
this
.
editeRepair
()
...
...
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