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
2710104d
Commit
2710104d
authored
Sep 05, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存图片权限,开票样式
parent
2532d3f7
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
288 additions
and
23 deletions
+288
-23
pages.json
pages.json
+10
-1
bill-style.vue
pages/maintain-bill/bill-style.vue
+140
-0
bill-count.vue
pages/maintain-bill/components/bill-count.vue
+69
-0
index.vue
pages/maintain-bill/index.vue
+37
-14
particulars.vue
pages/maintain-bill/particulars.vue
+1
-1
show.vue
pages/maintain-bill/show.vue
+12
-7
index.js
utils/options/maintain-bill/index.js
+19
-0
No files found.
pages.json
View file @
2710104d
...
@@ -326,7 +326,16 @@
...
@@ -326,7 +326,16 @@
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
}]
}
,{
"path"
:
"bill-style"
,
"style"
:
{
"navigationBarTitleText"
:
"收据样式"
,
"enablePullDownRefresh"
:
false
}
}
]
},
},
{
{
"root"
:
"pages/card"
,
"root"
:
"pages/card"
,
...
...
pages/maintain-bill/bill-style.vue
0 → 100644
View file @
2710104d
<
template
>
<view
class=
"bill-style"
>
<view
class=
"bill-style-title"
>
请选择收据样式
</view>
<view
class=
"card-item"
:class=
"
{ active: item.type === type }" v-for="(item, index) in cardList" :key="index" @click="handleClick(item)">
<view
class=
"card-item-icon"
@
click
.
stop=
"preview(item,index)"
><image
:src=
"item.icon"
mode=
""
></image></view>
<view
class=
"card-item-right"
>
<view
class=
"card-item-right-title"
>
<view
class=
"card-item-right-title-name"
>
{{
item
.
title
}}
</view>
<view
class=
"card-item-right-title-preview"
@
click
.
stop=
"preview(item,index)"
>
<view
class=
"card-item-right-title-preview-icon"
><image
:src=
"previewIcon"
mode=
""
></image></view>
<view
class=
"card-item-right-title-preview-text"
>
预览
</view>
</view>
</view>
<view
class=
"card-item-right-desc"
>
{{
item
.
desc
}}
</view>
</view>
</view>
<submit-button
@
handleClick=
"submit"
text=
"下一步"
></submit-button>
</view>
</
template
>
<
script
>
import
SubmitButton
from
'@/components/submit-button/index.vue'
;
import
{
billBaseUrl
}
from
'@/utils/config.js'
;
export
default
{
components
:
{
SubmitButton
},
data
()
{
return
{
previewIcon
:
billBaseUrl
+
'yulanicon@3x.png'
,
cardList
:
[
{
type
:
'1'
,
icon
:
billBaseUrl
+
'fuwuxiaopiaosuolue@3x.png'
,
image
:
billBaseUrl
+
'weixiuzhangdan-1.png'
,
title
:
'服务小票'
,
desc
:
'适用个人用户的常规生活服务场景'
},
{
type
:
'2'
,
icon
:
billBaseUrl
+
'sgoujupinzhengsuolue@3x.png'
,
image
:
billBaseUrl
+
'dianzipinzheng-1.png'
,
title
:
'收据凭证'
,
desc
:
'适用企业用户的服务、售货、报销等场景'
}
],
previewImages
:[
billBaseUrl
+
'weixiuzhangdan-1.png'
,
billBaseUrl
+
'dianzipinzheng-1.png'
],
type
:
'1'
};
},
methods
:
{
handleClick
(
item
)
{
this
.
type
=
item
.
type
;
},
preview
(
item
,
index
)
{
// 预览图片
uni
.
previewImage
({
urls
:
this
.
previewImages
,
current
:
index
,
longPressActions
:
{
itemList
:
[
'发送给朋友'
,
'保存图片'
,
'收藏'
],
success
:
function
(
data
)
{
console
.
log
(
'选中了第'
+
(
data
.
tapIndex
+
1
)
+
'个按钮,第'
+
(
data
.
index
+
1
)
+
'张图片'
);
},
fail
:
function
(
err
)
{
console
.
log
(
err
.
errMsg
);
}
}
});
},
submit
()
{}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.bill-style
{
color
:
#333333
;
padding
:
0
24rpx
;
&
-title
{
padding-top
:
40rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
line-height
:
32px
;
}
.card-item
{
margin-top
:
40rpx
;
padding
:
24rpx
;
border-radius
:
16rpx
;
border
:
2rpx
solid
#ffffff
;
box-shadow
:
4rpx
8rpx
16rpx
0px
#ffffff
;
width
:
100%
;
display
:
flex
;
align-items
:
flex-start
;
background-color
:
#ffffff
;
&
-icon
{
width
:
240rpx
;
height
:
180rpx
;
margin-right
:
32rpx
;
}
&
-right
{
flex
:
1
;
height
:
100%
;
padding-top
:
16rpx
;
&
-title
{
width
:
100%
;
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
32rpx
;
&
-name
{
font-size
:
40rpx
;
line-height
:
40rpx
;
font-weight
:
bold
;
}
&
-preview
{
font-size
:
24rpx
;
color
:
$default-color
;
line-height
:
24rpx
;
display
:
flex
;
align-items
:
center
;
&
-icon
{
width
:
32rpx
;
height
:
24rpx
;
margin-right
:
8rpx
;
}
}
}
&
-desc
{
font-size
:
24rpx
;
line-height
:
32rpx
;
}
}
}
.active
{
border
:
2rpx
solid
$default-color
;
box-shadow
:
4rpx
8rpx
16rpx
0px
rgba
(
2
,
160
,
116
,
0
.2
);
}
}
</
style
>
pages/maintain-bill/components/bill-count.vue
0 → 100644
View file @
2710104d
<
template
>
<view
class=
"bill-count"
>
<view
class=
"bill-count-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
class=
"bill-count-item-value ellipsis "
:class=
"
{red:detail[item.value]>0}">
{{
detail
[
item
.
value
]
}}
</view>
<view
class=
"bill-count-item-label"
>
{{
item
.
label
}}
</view>
<view
class=
"bill-count-item-line"
v-if=
"index !== list.length - 1"
></view>
</view>
</view>
</
template
>
<
script
>
import
{
billCountOptions
}
from
'@/utils/options/maintain-bill/index.js'
;
export
default
{
props
:{
detail
:{
type
:
Object
,
default
:()
=>
{}
}
},
data
()
{
return
{
list
:
billCountOptions
,
};
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.bill-count
{
// height: 160upx;
display
:
flex
;
padding-top
:
32rpx
;
&
-item
{
width
:
25%
;
height
:
100%
;
padding
:
0
12upx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
position
:
relative
;
&
-value
{
width
:
100%
;
text-align
:
center
;
margin-bottom
:
20upx
;
line-height
:
32upx
;
font-size
:
28upx
;
font-weight
:
bold
;
}
.red
{
color
:
#FC524D
;
}
&
-label
{
font-size
:
24upx
;
color
:
#8d8d8d
;
}
&
-line
{
position
:
absolute
;
right
:
0
;
top
:
50%
;
transform
:
translateY
(
-50%
);
width
:
2upx
;
height
:
32upx
;
background
:
#F6F7FA
;
}
}
}
</
style
>
pages/maintain-bill/index.vue
View file @
2710104d
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
:input-style=
"
{ 'font-size': '26rpx', color: '#333333' }"
:input-style=
"
{ 'font-size': '26rpx', color: '#333333' }"
>
</u-search>
>
</u-search>
</view>
</view>
<view
class=
"head"
>
<view
class=
"head-view"
>
<view
class=
"title-view"
>
<view
class=
"title-view"
>
<view
class=
"left-view"
>
<view
class=
"left-view"
>
<DateRangePicker
ref=
"date-range-picker"
v-model=
"daterange"
:canReset=
"true"
type=
"daterange"
@
change=
"handleClickChange"
>
<DateRangePicker
ref=
"date-range-picker"
v-model=
"daterange"
:canReset=
"true"
type=
"daterange"
@
change=
"handleClickChange"
>
...
@@ -39,6 +41,11 @@
...
@@ -39,6 +41,11 @@
<view
class=
"filter-view"
>
只看欠款
</view>
<view
class=
"filter-view"
>
只看欠款
</view>
</view>
</view>
</view>
</view>
<bill-count
ref=
"bill-count"
:detail=
"statistics"
></bill-count>
</view>
</view>
<view
class=
"content-view"
>
<view
class=
"content-view"
>
<scroll-view
<scroll-view
scroll-y
scroll-y
...
@@ -73,6 +80,7 @@ import CellMaintainBill from '@/components/cell-maintain-bill';
...
@@ -73,6 +80,7 @@ import CellMaintainBill from '@/components/cell-maintain-bill';
import
FabView
from
'@/components/fab-view'
;
import
FabView
from
'@/components/fab-view'
;
import
NoData
from
'@/components/no-data'
;
import
NoData
from
'@/components/no-data'
;
import
PopExport
from
'@/components/pop-export-bill'
;
import
PopExport
from
'@/components/pop-export-bill'
;
import
BillCount
from
'./components/bill-count.vue'
;
import
{
repair
}
from
'@/api/maintain/index.js'
;
import
{
repair
}
from
'@/api/maintain/index.js'
;
import
{
downLoad
}
from
'@/utils/download.js'
;
import
{
downLoad
}
from
'@/utils/download.js'
;
...
@@ -83,7 +91,8 @@ export default {
...
@@ -83,7 +91,8 @@ export default {
CellMaintainBill
,
CellMaintainBill
,
NoData
,
NoData
,
PopExport
,
PopExport
,
FabView
FabView
,
BillCount
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -99,7 +108,12 @@ export default {
...
@@ -99,7 +108,12 @@ export default {
triggered
:
true
,
triggered
:
true
,
freshing
:
false
,
freshing
:
false
,
current
:
1
,
current
:
1
,
size
:
10
size
:
10
,
statistics
:{
income
:
0
,
expense
:
0
,
surplus
:
0
,
}
};
};
},
},
computed
:
{
computed
:
{
...
@@ -284,12 +298,21 @@ export default {
...
@@ -284,12 +298,21 @@ export default {
font-size
:
34rpx
!
important
;
font-size
:
34rpx
!
important
;
}
}
}
}
.head
{
padding
:
0
24rpx
;
}
.head-view
{
padding
:
24rpx
;
background
:
#FFFFFF
;
border-radius
:
16rpx
;
}
.title-view
{
.title-view
{
color
:
#333333
;
color
:
#333333
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
margin
:
24rpx
24rpx
0
24rpx
;
padding-bottom
:
24rpx
;
border-bottom
:
2rpx
solid
#F6F7FA
;
.left-view
{
.left-view
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
pages/maintain-bill/particulars.vue
View file @
2710104d
...
@@ -317,7 +317,7 @@ export default {
...
@@ -317,7 +317,7 @@ export default {
{
{
repairRecordId
:
this
.
billId
,
repairRecordId
:
this
.
billId
,
name
:
''
,
name
:
''
,
number
:
'1'
,
number
:
1
,
unit
:
''
,
unit
:
''
,
unitPrice
:
''
,
unitPrice
:
''
,
total
:
''
total
:
''
...
...
pages/maintain-bill/show.vue
View file @
2710104d
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<view
class=
"detail-list part-view"
>
<view
class=
"detail-list part-view"
>
<view
class=
"table"
>
<view
class=
"table"
>
<view
class=
"table-tr table-th"
>
<view
class=
"table-tr table-th"
>
<view
class=
"table-td"
:class=
"
{
'table-td-mid':key === 1
}" v-for="(item, key) in tableOptions" :key="key">
<view
class=
"table-td"
:class=
"
{
'table-td-mid': key === 1
}" v-for="(item, key) in tableOptions" :key="key">
<view
v-if=
"key === 1"
>
<view
v-if=
"key === 1"
>
<text>
{{
item
.
label
}}
</text>
<text>
{{
item
.
label
}}
</text>
</view>
</view>
...
@@ -41,12 +41,12 @@
...
@@ -41,12 +41,12 @@
</view>
</view>
</view>
</view>
<view
class=
"table-tr"
v-for=
"(item, index) in info.expenseDetails"
:key=
"index"
>
<view
class=
"table-tr"
v-for=
"(item, index) in info.expenseDetails"
:key=
"index"
>
<view
class=
"table-td"
:class=
"
{
'table-td-mid':key === 1
}" v-for="(tdItem, key) in tableOptions" :key="key">
<view
class=
"table-td"
:class=
"
{
'table-td-mid': key === 1
}" v-for="(tdItem, key) in tableOptions" :key="key">
<view
v-if=
"key === 1"
>
<view
v-if=
"key === 1"
>
<text>
<text>
<text>
{{
item
.
unitPrice
}}
</text>
<text>
{{
item
.
unitPrice
}}
</text>
<text
v-if=
"item.unit"
>
/
</text>
<text
v-if=
"item.unit"
>
/
</text>
<text>
{{
item
.
unit
||
""
}}
</text>
<text>
{{
item
.
unit
||
''
}}
</text>
<text>
*
</text>
<text>
*
</text>
<text>
{{
item
.
number
}}
</text>
<text>
{{
item
.
number
}}
</text>
</text>
</text>
...
@@ -578,9 +578,14 @@ export default {
...
@@ -578,9 +578,14 @@ export default {
});
});
};
};
// #ifdef APP-PLUS
// #ifdef APP-PLUS
// getSetting('photoLibrary', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=>
{
if
(
this
.
isIOS
)
{
this
.
saveBillImage
();
this
.
saveBillImage
();
// })
}
else
{
getSetting
(
'android.permission.WRITE_EXTERNAL_STORAGE'
,
'检测到您没打开保存到相册功能权限,是否去设置打开?'
,
res
=>
{
this
.
saveBillImage
();
});
}
// #endif
// #endif
// #ifdef MP-WEIXIN
// #ifdef MP-WEIXIN
getSetting
(
'scope.writePhotosAlbum'
,
'检测到您没打开保存到相册功能权限,是否去设置打开?'
,
res
=>
{
getSetting
(
'scope.writePhotosAlbum'
,
'检测到您没打开保存到相册功能权限,是否去设置打开?'
,
res
=>
{
...
@@ -678,7 +683,7 @@ export default {
...
@@ -678,7 +683,7 @@ export default {
if
(
index
===
1
)
{
if
(
index
===
1
)
{
el
.
css
.
width
=
'304rpx'
;
el
.
css
.
width
=
'304rpx'
;
el
.
css
.
textAlign
=
'center'
;
el
.
css
.
textAlign
=
'center'
;
el
.
text
=
`
${
infoItem
.
unitPrice
}${
infoItem
.
unit
?
'/'
+
infoItem
.
unit
:
''
}
*
${
infoItem
.
number
}
`
;
el
.
text
=
`
${
infoItem
.
unitPrice
}${
infoItem
.
unit
?
'/'
+
infoItem
.
unit
:
''
}
*
${
infoItem
.
number
}
`
;
}
else
if
(
index
===
2
)
{
}
else
if
(
index
===
2
)
{
el
.
css
.
textAlign
=
'right'
;
el
.
css
.
textAlign
=
'right'
;
}
}
...
...
utils/options/maintain-bill/index.js
View file @
2710104d
...
@@ -68,3 +68,22 @@ export const tableOptions = [{
...
@@ -68,3 +68,22 @@ export const tableOptions = [{
label
:
"合计"
,
label
:
"合计"
,
}
}
]
]
export
const
billCountOptions
=
[{
value
:
"income"
,
label
:
"账单"
,
},
{
value
:
"expense"
,
label
:
"应收"
,
},
{
value
:
"surplus"
,
label
:
"实收"
,
},
{
value
:
"surplus"
,
label
:
"欠款"
,
},
]
\ No newline at end of file
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