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
041f5d9e
Commit
041f5d9e
authored
Jul 23, 2022
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 创建维修账单
parent
af61fda6
Pipeline
#2889
canceled with stages
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
338 additions
and
252 deletions
+338
-252
index.vue
components/cell-maintain-bill/index.vue
+4
-4
index.vue
components/cell-particular/index.vue
+24
-20
create.vue
pages/maintain-bill/create.vue
+65
-52
detail.vue
pages/maintain-bill/detail.vue
+37
-72
index.vue
pages/maintain-bill/index.vue
+65
-65
particulars.vue
pages/maintain-bill/particulars.vue
+142
-39
show.vue
pages/maintain-bill/show.vue
+1
-0
No files found.
components/cell-maintain-bill/index.vue
View file @
041f5d9e
...
@@ -8,11 +8,11 @@
...
@@ -8,11 +8,11 @@
<view
class=
"title-view"
>
<view
class=
"title-view"
>
<view>
{{
info
.
id
}}
</view>
<view>
{{
info
.
id
}}
</view>
<view
class=
"status-view"
<view
class=
"status-view"
><text
:style=
"'color:' + statusSetting[info.settleState].color"
>
{{
><text
:style=
"'color:' + statusSetting[info.settleState
.code
].color"
>
{{
statusSetting
[
info
.
settleState
].
text
statusSetting
[
info
.
settleState
.
code
].
text
}}
</text
}}
</text
>
·
<text
:style=
"'color:' + statusSetting[info.sendStatus].color"
>
{{
>
·
<text
:style=
"'color:' + statusSetting[info.sendStatus
.code
].color"
>
{{
statusSetting
[
info
.
sendStatus
].
text
statusSetting
[
info
.
sendStatus
.
code
].
text
}}
</text></view
}}
</text></view
>
>
</view>
</view>
...
...
components/cell-particular/index.vue
View file @
041f5d9e
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<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"
>
<u-number-box
color=
"#cccccc"
size=
"28"
v-model=
"number"
bg-color=
"#ffffff"
></u-number-box>
<u-number-box
min=
"1"
color=
"#cccccc"
size=
"28"
v-model=
"number"
bg-color=
"#ffffff"
></u-number-box>
</view>
</view>
</view>
</view>
<view
class=
"line-view"
></view>
<view
class=
"line-view"
></view>
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
:clearable=
"false"
:clearable=
"false"
:custom-style=
"customStyle"
:custom-style=
"customStyle"
:placeholder-style=
"placeholderStyle"
:placeholder-style=
"placeholderStyle"
v-model=
"
p
rice"
v-model=
"
unitP
rice"
placeholder=
"填写单价费用"
placeholder=
"填写单价费用"
/>
/>
</view>
</view>
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
:clearable=
"false"
:clearable=
"false"
:custom-style=
"customStyle"
:custom-style=
"customStyle"
:placeholder-style=
"placeholderStyle"
:placeholder-style=
"placeholderStyle"
v-model=
"
al
l"
v-model=
"
tota
l"
placeholder=
"填写总价费用"
placeholder=
"填写总价费用"
/>
/>
</view>
</view>
...
@@ -81,26 +81,28 @@ export default {
...
@@ -81,26 +81,28 @@ export default {
return
{
return
{
name
:
''
,
name
:
''
,
number
:
''
,
number
:
''
,
p
rice
:
''
,
unitP
rice
:
''
,
al
l
:
''
,
tota
l
:
''
,
}
}
},
},
watch
:
{
watch
:
{
showDelete
(
val
)
{
console
.
log
(
'------showDelete------'
,
val
)
},
name
(
value
)
{
name
(
value
)
{
this
.
handleChange
(
'name'
,
value
)
this
.
handleChange
(
{
'name'
:
value
}
)
},
},
number
(
value
)
{
number
(
value
)
{
this
.
handleChange
(
'number'
,
value
)
if
(
this
.
unitPrice
&&
this
.
number
)
{
this
.
total
=
this
.
formatCount
(
Number
(
this
.
unitPrice
)
*
Number
(
this
.
number
))
}
this
.
handleChange
({
'number'
:
value
})
},
},
price
(
value
)
{
unitPrice
(
value
)
{
this
.
handleChange
(
'price'
,
value
)
if
(
this
.
unitPrice
&&
this
.
number
)
{
this
.
total
=
this
.
formatCount
(
Number
(
this
.
unitPrice
)
*
Number
(
this
.
number
))
}
this
.
handleChange
({
'unitPrice'
:
value
})
},
},
al
l
(
value
)
{
tota
l
(
value
)
{
this
.
handleChange
(
'all'
,
value
)
this
.
handleChange
(
{
'total'
:
value
}
)
},
},
},
},
computed
:
{
computed
:
{
...
@@ -117,19 +119,21 @@ export default {
...
@@ -117,19 +119,21 @@ export default {
},
},
created
()
{
created
()
{
this
.
name
=
this
.
defaultInfo
.
name
this
.
name
=
this
.
defaultInfo
.
name
this
.
price
=
this
.
defaultInfo
.
price
this
.
unitPrice
=
this
.
formatCount
(
this
.
defaultInfo
.
unitPrice
)
this
.
number
=
this
.
defaultInfo
.
number
this
.
number
=
this
.
defaultInfo
.
number
this
.
all
=
this
.
defaultInfo
.
all
this
.
total
=
this
.
formatCount
(
this
.
defaultInfo
.
total
)
},
},
methods
:
{
methods
:
{
handleChange
(
key
,
value
)
{
handleChange
(
obj
)
{
this
.
$emit
(
'change'
,
{
key
:
key
,
value
:
value
}
)
this
.
$emit
(
'change'
,
obj
)
},
},
handleClickDelete
()
{
handleClickDelete
()
{
console
.
log
(
'(-----handleClickDelete-----)'
)
this
.
$emit
(
'delete'
)
this
.
$emit
(
'delete'
)
},
},
formatCount
(
count
)
{
return
(
Math
.
trunc
((
count
||
0
)
*
100
)
/
100
).
toFixed
(
2
)
},
},
},
}
}
</
script
>
</
script
>
...
...
pages/maintain-bill/create.vue
View file @
041f5d9e
...
@@ -147,6 +147,7 @@
...
@@ -147,6 +147,7 @@
:custom-style=
"customConFirm"
:custom-style=
"customConFirm"
@
click=
"handleClickSure"
@
click=
"handleClickSure"
:disabled=
"!canConfirm"
:disabled=
"!canConfirm"
:loading=
"buttonLoading"
>
>
<view
class=
"confirm-view"
>
确定
</view>
<view
class=
"confirm-view"
>
确定
</view>
</u-button>
</u-button>
...
@@ -193,10 +194,7 @@ export default {
...
@@ -193,10 +194,7 @@ export default {
},
},
showDatePicker
:
false
,
showDatePicker
:
false
,
showTimePicker
:
false
,
showTimePicker
:
false
,
defaultTime
:
this
.
$u
.
timeFormat
(
buttonLoading
:
false
,
new
Date
().
getTime
(),
'yyyy-mm-dd hh:MM:ss'
),
}
}
},
},
computed
:
{
computed
:
{
...
@@ -305,10 +303,12 @@ export default {
...
@@ -305,10 +303,12 @@ export default {
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
// 测试数据
// 测试数据
options
.
billId
=
'
9988
'
options
.
billId
=
'
1550685581418168320
'
if
(
options
&&
options
.
billId
)
{
if
(
options
&&
options
.
billId
)
{
this
.
billId
=
options
.
billId
this
.
billId
=
options
.
billId
}
if
(
this
.
billId
)
{
this
.
repairDetail
()
this
.
repairDetail
()
}
}
},
},
...
@@ -316,7 +316,8 @@ export default {
...
@@ -316,7 +316,8 @@ export default {
this
.
$refs
.
uForm
.
setRules
(
this
.
rules
)
this
.
$refs
.
uForm
.
setRules
(
this
.
rules
)
},
},
onUnload
()
{},
onUnload
()
{},
onShow
()
{},
onShow
()
{
},
methods
:
{
methods
:
{
repairDetail
()
{
repairDetail
()
{
this
.
loading
=
true
this
.
loading
=
true
...
@@ -331,52 +332,52 @@ export default {
...
@@ -331,52 +332,52 @@ export default {
})
})
.
catch
((
res
)
=>
{
.
catch
((
res
)
=>
{
this
.
loading
=
false
this
.
loading
=
false
// 测试数据
this
.
setForm
(
res
.
data
)
})
})
},
},
setForm
(
data
)
{
setForm
(
data
)
{
// 测试
// 测试
var
data
=
{
// var data = {
id
:
'8778788'
,
// id: '8778788',
settleState
:
'NO'
,
// settleState: 'NO',
sendStatus
:
'WAIT'
,
// sendStatus: 'WAIT',
customer
:
{
// customer: {
name
:
'张三'
,
// name: '张三',
phone
:
'1231312313423'
,
// phone: '1231312313423',
},
// },
repairTime
:
'2077-87-87 12:23:43'
,
// repairTime: '2022-07-07 12:23:43',
actualAmount
:
'40'
,
// actualAmount: '40',
receivableAmount
:
'80'
,
// receivableAmount: '80',
address
:
'fdsafdsafdasfdafd发撒发大水范德萨范德萨范德萨发大水发'
,
// address: '详细地址:广东省深圳市',
remark
:
'维修格力牌柜机一台,更换压缩机收费800
\
nfdsadfsafdasfads'
,
// remark: '维修格力牌柜机一台,更换压缩机收费800\nfdsadfsafdasfads',
attach
:
[
// attach: [
'http://reu2asz23.hn-bkt.clouddn.com/icon%2Fbeizhutu%403x.png'
,
// 'http://reu2asz23.hn-bkt.clouddn.com/icon%2Fbeizhutu%403x.png',
'http://reu2asz23.hn-bkt.clouddn.com/icon/wuweixiuzhangdan@3x.png'
,
// 'http://reu2asz23.hn-bkt.clouddn.com/icon/wuweixiuzhangdan@3x.png',
'http://reu2asz23.hn-bkt.clouddn.com/icon/wusousuojieguo@3x.png'
,
// 'http://reu2asz23.hn-bkt.clouddn.com/icon/wusousuojieguo@3x.png',
],
// ],
histories
:
[
// histories: [
{
// {
createTime
:
'2099-98-76 09:09:87'
,
// createTime: '2099-98-76 09:09:87',
type
:
'SETTLE'
,
// type: 'SETTLE',
},
// },
{
// {
createTime
:
'2099-98-76 09:09:87'
,
// createTime: '2099-98-76 09:09:87',
type
:
'ENSURE'
,
// type: 'ENSURE',
},
// },
{
// {
createTime
:
'2099-98-76 09:09:87'
,
// createTime: '2099-98-76 09:09:87',
type
:
'SEND'
,
// type: 'SEND',
},
// },
{
// {
createTime
:
'2099-98-76 09:09:87'
,
// createTime: '2099-98-76 09:09:87',
type
:
'CREATE'
,
// type: 'CREATE',
},
// },
],
// ],
syncFlag
:
false
,
// syncFlag: false,
}
// latitude: '22.55329',
// longitude: '113.88308'
// }
this
.
form
=
{
this
.
form
=
{
id
:
data
.
id
,
customerName
:
data
.
customer
.
name
,
customerName
:
data
.
customer
.
name
,
customerPhone
:
data
.
customer
.
phone
,
customerPhone
:
data
.
customer
.
phone
,
receivableAmount
:
data
.
receivableAmount
,
receivableAmount
:
data
.
receivableAmount
,
...
@@ -384,8 +385,8 @@ export default {
...
@@ -384,8 +385,8 @@ export default {
repairTime
:
data
.
repairTime
,
repairTime
:
data
.
repairTime
,
partTime
:
data
.
partTime
,
partTime
:
data
.
partTime
,
address
:
data
.
address
,
address
:
data
.
address
,
latitude
:
''
,
latitude
:
data
.
latitude
,
longitude
:
''
,
longitude
:
data
.
longitude
,
remark
:
data
.
remark
,
remark
:
data
.
remark
,
attach
:
data
.
attach
,
attach
:
data
.
attach
,
}
}
...
@@ -437,12 +438,24 @@ export default {
...
@@ -437,12 +438,24 @@ export default {
})
})
},
},
editeRepair
()
{
editeRepair
()
{
this
.
buttonLoading
=
true
editeRepair
(
this
.
form
).
then
((
res
)
=>
{
editeRepair
(
this
.
form
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
billId
=
res
.
data
this
.
toParticulars
()
this
.
buttonLoading
=
false
}
}
}).
catch
((
res
)
=>
{
}).
catch
((
res
)
=>
{
this
.
buttonLoading
=
false
})
},
toParticulars
()
{
this
.
$u
.
route
({
url
:
'pages/maintain-bill/particulars'
,
type
:
'navigateTo'
,
params
:
{
billId
:
this
.
billId
,
},
})
})
},
},
formatCount
(
count
)
{
formatCount
(
count
)
{
...
...
pages/maintain-bill/detail.vue
View file @
041f5d9e
...
@@ -9,11 +9,11 @@
...
@@ -9,11 +9,11 @@
/>
/>
<view
class=
"content-view"
>
<view
class=
"content-view"
>
<view
class=
"status-view"
<view
class=
"status-view"
><text
:style=
"'color:' + statusSetting[info.settleState].color"
>
{{
><text
:style=
"'color:' + statusSetting[info.settleState
.code
].color"
>
{{
statusSetting
[
info
.
settleState
].
text
statusSetting
[
info
.
settleState
.
code
].
text
}}
</text
}}
</text
>
·
<text
:style=
"'color:' + statusSetting[info.sendStatus].color"
>
{{
>
·
<text
:style=
"'color:' + statusSetting[info.sendStatus
.code
].color"
>
{{
statusSetting
[
info
.
sendStatus
].
text
statusSetting
[
info
.
sendStatus
.
code
].
text
}}
</text></view
}}
</text></view
>
>
<view
class=
"info-view part-view"
>
<view
class=
"info-view part-view"
>
...
@@ -102,7 +102,12 @@
...
@@ -102,7 +102,12 @@
</view>
</view>
</view>
</view>
<view
class=
"right-view"
>
<view
class=
"right-view"
>
<u-button
:custom-style=
"customStatus"
@
click=
"handleClickStatus"
:disabled=
"info.syncFlag"
class=
"status-button"
>
<u-button
:custom-style=
"customStatus"
@
click=
"handleClickStatus"
:disabled=
"info.syncFlag"
class=
"status-button"
>
<view
<view
class=
"status-view"
class=
"status-view"
:style=
"'color: ' + syncFlagSettings.color"
:style=
"'color: ' + syncFlagSettings.color"
...
@@ -168,7 +173,7 @@ export default {
...
@@ -168,7 +173,7 @@ export default {
return
this
.
baseUrl
+
'huishouye@3x.png'
return
this
.
baseUrl
+
'huishouye@3x.png'
},
},
isSure
()
{
isSure
()
{
return
this
.
info
.
sendStatus
==
'SURE'
return
this
.
info
.
sendStatus
.
code
==
'SURE'
},
},
// sendStatus WAIT:未发送;WAIT_SURE:未确定;SURE:已确定
// sendStatus WAIT:未发送;WAIT_SURE:未确定;SURE:已确定
// settleState NO:未结清;YES:已结清
// settleState NO:未结清;YES:已结清
...
@@ -192,7 +197,7 @@ export default {
...
@@ -192,7 +197,7 @@ export default {
}
}
},
},
settleState
()
{
settleState
()
{
return
this
.
info
.
settleState
==
'YES'
return
this
.
info
.
settleState
.
code
==
'YES'
},
},
moneyKeys
()
{
moneyKeys
()
{
var
result
=
var
result
=
...
@@ -254,7 +259,7 @@ export default {
...
@@ -254,7 +259,7 @@ export default {
confirmText
:
'确定'
,
confirmText
:
'确定'
,
content
:
'是否将该账单转入账单明细统计?'
,
content
:
'是否将该账单转入账单明细统计?'
,
bottomTip
:
''
,
bottomTip
:
''
,
}
},
]
]
},
},
currentPopInfo
()
{
currentPopInfo
()
{
...
@@ -295,7 +300,9 @@ export default {
...
@@ -295,7 +300,9 @@ export default {
height
:
'104rpx'
,
height
:
'104rpx'
,
'border-radius'
:
'16rpx'
,
'border-radius'
:
'16rpx'
,
width
:
this
.
isSure
?
'372rpx'
:
'240rpx'
,
width
:
this
.
isSure
?
'372rpx'
:
'240rpx'
,
background
:
this
.
isSure
?
''
:
'linear-gradient(100deg, transparent 32rpx, #02a074 0)'
,
background
:
this
.
isSure
?
''
:
'linear-gradient(100deg, transparent 32rpx, #02a074 0)'
,
}
}
},
},
// CREATE:创建账单;SEND:发送客户;ENSURE:客户确认;SETTLE:标记为已结清
// CREATE:创建账单;SEND:发送客户;ENSURE:客户确认;SETTLE:标记为已结清
...
@@ -313,7 +320,7 @@ export default {
...
@@ -313,7 +320,7 @@ export default {
this
.
billId
=
options
.
billId
this
.
billId
=
options
.
billId
}
}
// 测试数据
// 测试数据
this
.
billId
=
'
8786788
'
this
.
billId
=
'
1550685581418168320
'
uni
.
$on
(
'maintain-bill-detail'
,
(
res
)
=>
{
uni
.
$on
(
'maintain-bill-detail'
,
(
res
)
=>
{
this
.
repairDetail
()
this
.
repairDetail
()
...
@@ -344,46 +351,6 @@ export default {
...
@@ -344,46 +351,6 @@ export default {
})
})
.
catch
((
res
)
=>
{
.
catch
((
res
)
=>
{
this
.
loading
=
false
this
.
loading
=
false
// 测试数据
this
.
info
=
{
id
:
'8778788'
,
settleState
:
'NO'
,
sendStatus
:
'WAIT'
,
customer
:
{
name
:
'张三'
,
phone
:
'1231312313423'
,
},
repairTime
:
'2077-87-87 12:23:43'
,
actualAmount
:
'40'
,
receivableAmount
:
'80'
,
address
:
'fdsafdsafdasfdafd发撒发大水范德萨范德萨范德萨发大水发'
,
remark
:
'维修格力牌柜机一台,更换压缩机收费800
\
nfdsadfsafdasfads'
,
attach
:
[
'http://reu2asz23.hn-bkt.clouddn.com/icon%2Fbeizhutu%403x.png'
,
'http://reu2asz23.hn-bkt.clouddn.com/icon/wuweixiuzhangdan@3x.png'
,
'http://reu2asz23.hn-bkt.clouddn.com/icon/wusousuojieguo@3x.png'
,
],
histories
:
[
{
createTime
:
'2099-98-76 09:09:87'
,
type
:
'SETTLE'
,
},
{
createTime
:
'2099-98-76 09:09:87'
,
type
:
'ENSURE'
,
},
{
createTime
:
'2099-98-76 09:09:87'
,
type
:
'SEND'
,
},
{
createTime
:
'2099-98-76 09:09:87'
,
type
:
'CREATE'
,
},
],
syncFlag
:
false
,
}
})
})
},
},
...
@@ -418,7 +385,6 @@ export default {
...
@@ -418,7 +385,6 @@ export default {
})
})
},
},
handleClickChange
()
{
handleClickChange
()
{
console
.
log
(
'--------handleClickChange---------'
)
this
.
$u
.
route
({
this
.
$u
.
route
({
url
:
'pages/maintain-bill/create'
,
url
:
'pages/maintain-bill/create'
,
type
:
'navigateTo'
,
type
:
'navigateTo'
,
...
@@ -437,7 +403,6 @@ export default {
...
@@ -437,7 +403,6 @@ export default {
}
}
},
},
handleClickPreview
(
index
)
{
handleClickPreview
(
index
)
{
console
.
log
(
'-------handleClickPreview-------'
,
index
,
this
.
info
.
attach
)
uni
.
previewImage
({
uni
.
previewImage
({
urls
:
this
.
info
.
attach
,
urls
:
this
.
info
.
attach
,
current
:
index
,
current
:
index
,
...
...
pages/maintain-bill/index.vue
View file @
041f5d9e
...
@@ -230,72 +230,72 @@ export default {
...
@@ -230,72 +230,72 @@ export default {
onlyDebt
:
this
.
onlyDebt
,
onlyDebt
:
this
.
onlyDebt
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
//
let data = res.data
let
data
=
res
.
data
// 测试
// 测试
let
data
=
{
//
let data = {
records
:
[
//
records: [
{
//
{
id
:
'878788'
,
//
id: '878788',
settleState
:
'YES'
,
//
settleState: 'YES',
sendStatus
:
'WAIT'
,
//
sendStatus: 'WAIT',
customerName
:
'张三'
,
//
customerName: '张三',
customerPhone
:
'14141241413'
,
//
customerPhone: '14141241413',
repairTime
:
'2077-87-87 12:23:43'
,
//
repairTime: '2077-87-87 12:23:43',
actualAmount
:
'20'
,
//
actualAmount: '20',
receivableAmount
:
'80'
,
//
receivableAmount: '80',
},
//
},
{
//
{
id
:
'8783788'
,
//
id: '8783788',
settleState
:
'NO'
,
//
settleState: 'NO',
sendStatus
:
'SURE'
,
//
sendStatus: 'SURE',
customerName
:
'张三'
,
//
customerName: '张三',
customerPhone
:
'14141241413'
,
//
customerPhone: '14141241413',
repairTime
:
'2077-87-87 12:23:43'
,
//
repairTime: '2077-87-87 12:23:43',
actualAmount
:
'80'
,
//
actualAmount: '80',
receivableAmount
:
'80'
,
//
receivableAmount: '80',
},
//
},
{
//
{
id
:
'8787488'
,
//
id: '8787488',
settleState
:
'NO'
,
//
settleState: 'NO',
sendStatus
:
'WAIT'
,
//
sendStatus: 'WAIT',
customerName
:
'张三'
,
//
customerName: '张三',
customerPhone
:
'14141241413'
,
//
customerPhone: '14141241413',
repairTime
:
'2077-87-87 12:23:43'
,
//
repairTime: '2077-87-87 12:23:43',
actualAmount
:
'20'
,
//
actualAmount: '20',
receivableAmount
:
'80'
,
//
receivableAmount: '80',
},
//
},
{
//
{
id
:
'8785788'
,
//
id: '8785788',
settleState
:
'YES'
,
//
settleState: 'YES',
sendStatus
:
'SURE'
,
//
sendStatus: 'SURE',
customerName
:
'张三'
,
//
customerName: '张三',
customerPhone
:
'14141241413'
,
//
customerPhone: '14141241413',
repairTime
:
'2077-87-87 12:23:43'
,
//
repairTime: '2077-87-87 12:23:43',
actualAmount
:
'80'
,
//
actualAmount: '80',
receivableAmount
:
'80'
,
//
receivableAmount: '80',
},
//
},
{
//
{
id
:
'8786788'
,
//
id: '8786788',
settleState
:
'YES'
,
//
settleState: 'YES',
sendStatus
:
'WAIT_SURE'
,
//
sendStatus: 'WAIT_SURE',
customerName
:
'张三'
,
//
customerName: '张三',
customerPhone
:
'14141241413'
,
//
customerPhone: '14141241413',
repairTime
:
'2077-87-87 12:23:43'
,
//
repairTime: '2077-87-87 12:23:43',
actualAmount
:
'20'
,
//
actualAmount: '20',
receivableAmount
:
'80'
,
//
receivableAmount: '80',
},
//
},
{
//
{
id
:
'8778788'
,
//
id: '8778788',
settleState
:
'NO'
,
//
settleState: 'NO',
sendStatus
:
'WAIT'
,
//
sendStatus: 'WAIT',
customerName
:
'张三'
,
//
customerName: '张三',
customerPhone
:
'14141241413'
,
//
customerPhone: '14141241413',
repairTime
:
'2077-87-87 12:23:43'
,
//
repairTime: '2077-87-87 12:23:43',
actualAmount
:
'80'
,
//
actualAmount: '80',
receivableAmount
:
'80'
,
//
receivableAmount: '80',
},
//
},
],
//
],
}
//
}
if
(
this
.
current
==
1
)
{
if
(
this
.
current
==
1
)
{
this
.
records
=
[]
this
.
records
=
[]
}
}
...
...
pages/maintain-bill/particulars.vue
View file @
041f5d9e
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
:clearable=
"false"
:clearable=
"false"
:custom-style=
"customStyle"
:custom-style=
"customStyle"
:placeholder-style=
"placeholderStyle"
:placeholder-style=
"placeholderStyle"
v-model=
"
price
"
v-model=
"
info.faultRecord.category
"
placeholder=
"填写品牌名称"
placeholder=
"填写品牌名称"
/>
/>
</view>
</view>
...
@@ -42,11 +42,11 @@
...
@@ -42,11 +42,11 @@
<view
class=
"label-view"
>
型号
</view>
<view
class=
"label-view"
>
型号
</view>
<view
class=
"value-view"
>
<view
class=
"value-view"
>
<u-input
<u-input
type=
"
digi
t"
type=
"
tex
t"
:clearable=
"false"
:clearable=
"false"
:custom-style=
"customStyle"
:custom-style=
"customStyle"
:placeholder-style=
"placeholderStyle"
:placeholder-style=
"placeholderStyle"
v-model=
"
al
l"
v-model=
"
info.faultRecord.machineMode
l"
placeholder=
"填写型号名称"
placeholder=
"填写型号名称"
/>
/>
</view>
</view>
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
:clearable=
"false"
:clearable=
"false"
:custom-style=
"customAreaStyle"
:custom-style=
"customAreaStyle"
:placeholder-style=
"placeholderStyle"
:placeholder-style=
"placeholderStyle"
v-model=
"
form.phone
"
v-model=
"
info.faultRecord.symptom
"
placeholder=
"填写故障现象详细信息"
placeholder=
"填写故障现象详细信息"
/>
/>
</view>
</view>
...
@@ -76,14 +76,14 @@
...
@@ -76,14 +76,14 @@
:clearable=
"false"
:clearable=
"false"
:custom-style=
"customAreaStyle"
:custom-style=
"customAreaStyle"
:placeholder-style=
"placeholderStyle"
:placeholder-style=
"placeholderStyle"
v-model=
"
form.phone
"
v-model=
"
info.faultRecord.repairResult
"
placeholder=
"填写检修结果详细信息"
placeholder=
"填写检修结果详细信息"
/>
/>
</view>
</view>
</view>
</view>
</view>
</view>
<view
class=
"list-view"
>
<view
class=
"list-view"
>
<view
v-for=
"(item, index) in
list
"
:key=
"index"
>
<view
v-for=
"(item, index) in
info.expenseDetails
"
:key=
"index"
>
<CellParticulars
<CellParticulars
:showDelete=
"showDeleteButton"
:showDelete=
"showDeleteButton"
:defaultInfo=
"item"
:defaultInfo=
"item"
...
@@ -114,6 +114,7 @@
...
@@ -114,6 +114,7 @@
:custom-style=
"customConFirm"
:custom-style=
"customConFirm"
@
click=
"handleClickSure"
@
click=
"handleClickSure"
:disabled=
"!canConfirm"
:disabled=
"!canConfirm"
:loading=
"buttonLoading"
>
>
<view
class=
"confirm-view"
>
保存
</view>
<view
class=
"confirm-view"
>
保存
</view>
</u-button>
</u-button>
...
@@ -134,6 +135,7 @@
...
@@ -134,6 +135,7 @@
import
NavbarRight
from
'@/components/navbar-right'
import
NavbarRight
from
'@/components/navbar-right'
import
CellParticulars
from
'@/components/cell-particular'
import
CellParticulars
from
'@/components/cell-particular'
import
PopNormal
from
'@/components/pop-normal'
import
PopNormal
from
'@/components/pop-normal'
import
{
repairDetail
,
editeRepair
}
from
'@/api/maintain/index.js'
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -143,19 +145,16 @@ export default {
...
@@ -143,19 +145,16 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
billId
:
''
,
visible
:
false
,
visible
:
false
,
info
:
{},
info
:
{
list
:
[
expenseDetails
:
[],
{
faultRecord
:
null
,
name
:
'a'
,
number
:
'1'
,
price
:
'2'
,
all
:
'3'
,
},
},
],
showRecord
:
false
,
showRecord
:
false
,
canConfirm
:
false
,
currentIndex
:
0
,
currentIndex
:
0
,
buttonLoading
:
false
,
faultRecord
:
{},
// 存储临时值
}
}
},
},
computed
:
{
computed
:
{
...
@@ -177,7 +176,7 @@ export default {
...
@@ -177,7 +176,7 @@ export default {
}
}
},
},
showDeleteButton
()
{
showDeleteButton
()
{
return
this
.
list
.
length
>
1
return
this
.
info
.
expenseDetails
.
length
>
1
},
},
placeholderStyle
()
{
placeholderStyle
()
{
return
'color:#ccc;font-size:28rpx;font-weight: bold;'
return
'color:#ccc;font-size:28rpx;font-weight: bold;'
...
@@ -199,35 +198,113 @@ export default {
...
@@ -199,35 +198,113 @@ export default {
'border-radius'
:
'16rpx'
,
'border-radius'
:
'16rpx'
,
}
}
},
},
canConfirm
()
{
for
(
var
item
of
this
.
info
.
expenseDetails
)
{
for
(
var
key
of
this
.
expenseDetailsKeys
)
{
if
(
!
item
[
key
])
{
return
false
}
}
}
if
(
this
.
info
.
faultRecord
)
{
for
(
var
key
of
this
.
faultRecordKeys
)
{
console
.
log
(
key
,
this
.
info
.
faultRecord
[
key
])
if
(
!
this
.
info
.
faultRecord
[
key
])
{
return
false
}
}
}
return
true
},
expenseDetailsKeys
()
{
return
[
'name'
,
'number'
,
'unitPrice'
,
'total'
]
},
faultRecordKeys
()
{
return
[
'category'
,
'machineModel'
,
'repairResult'
,
'symptom'
]
},
},
onLoad
(
options
)
{
// 测试数据
options
.
billId
=
'1550685581418168320'
if
(
options
&&
options
.
billId
)
{
this
.
billId
=
options
.
billId
}
if
(
this
.
billId
)
{
this
.
repairDetail
()
}
},
},
onLoad
(
options
)
{},
onReady
()
{},
onReady
()
{},
onUnload
()
{},
onUnload
()
{},
onShow
()
{},
onShow
()
{
methods
:
{
handleChangeShowRecord
(
event
)
{
this
.
showRecord
=
event
.
value
},
},
handleChange
(
event
,
index
)
{
methods
:
{
this
.
list
[
index
][
event
.
key
]
=
event
.
value
repairDetail
()
{
for
(
var
item
of
this
.
list
)
{
this
.
loading
=
true
for
(
var
key
in
item
)
{
repairDetail
({
if
(
!
this
.
list
[
index
][
key
])
{
id
:
this
.
billId
,
this
.
canConfirm
=
false
})
return
.
then
((
res
)
=>
{
if
(
res
.
data
)
{
this
.
setInfo
(
res
.
data
)
}
}
this
.
loading
=
false
})
.
catch
((
res
)
=>
{
this
.
loading
=
false
})
},
setInfo
(
data
)
{
var
array
=
data
.
expenseDetails
&&
data
.
expenseDetails
.
length
>
0
?
data
.
expenseDetails
:
[{
repairRecordId
:
data
.
id
}]
this
.
info
=
{
id
:
data
.
id
,
expenseDetails
:
array
,
faultRecord
:
data
.
faultRecord
,
// 上一页的数据
customerName
:
data
.
customer
.
name
,
customerPhone
:
data
.
customer
.
phone
,
receivableAmount
:
data
.
receivableAmount
,
actualAmount
:
data
.
actualAmount
,
repairTime
:
data
.
repairTime
,
partTime
:
data
.
partTime
,
address
:
data
.
address
,
latitude
:
data
.
latitude
,
longitude
:
data
.
longitude
,
remark
:
data
.
remark
,
attach
:
data
.
attach
,
}
}
this
.
faultRecord
=
data
.
faultRecord
||
{
category
:
''
,
machineModel
:
''
,
repairResult
:
''
,
symptom
:
''
,
repairRecordId
:
data
.
id
,
}
}
this
.
canConfirm
=
true
this
.
showRecord
=
this
.
info
.
faultRecord
!=
null
},
handleChangeShowRecord
(
event
)
{
this
.
showRecord
=
event
this
.
info
.
faultRecord
=
this
.
showRecord
?
this
.
faultRecord
:
null
},
handleChange
(
event
,
index
)
{
this
.
$set
(
this
.
info
.
expenseDetails
,
index
,
{
...
this
.
info
.
expenseDetails
[
index
],
...
event
,
})
},
},
handleClickAdd
()
{
handleClickAdd
()
{
this
.
list
=
[
this
.
info
.
expenseDetails
=
[
...
this
.
list
,
...
this
.
info
.
expenseDetails
,
{
{
repairRecordId
:
this
.
billId
,
name
:
''
,
name
:
''
,
number
:
''
,
number
:
'
1
'
,
p
rice
:
''
,
unitP
rice
:
''
,
al
l
:
''
,
tota
l
:
''
,
},
},
]
]
},
},
...
@@ -238,8 +315,34 @@ export default {
...
@@ -238,8 +315,34 @@ export default {
handleClickConfirm
()
{
handleClickConfirm
()
{
this
.
list
.
splice
(
this
.
currentIndex
,
1
)
this
.
list
.
splice
(
this
.
currentIndex
,
1
)
},
},
handleClickSkip
(
date
)
{},
editeRepair
()
{
handleClickSure
()
{},
this
.
buttonLoading
=
true
editeRepair
(
this
.
info
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
this
.
toDetailPage
()
this
.
buttonLoading
=
false
}
})
.
catch
((
res
)
=>
{
this
.
buttonLoading
=
false
})
},
toDetailPage
()
{
this
.
$u
.
route
({
url
:
'pages/maintain-bill/detail'
,
type
:
'navigateTo'
,
params
:
{
billId
:
this
.
billId
,
},
})
},
handleClickSkip
(
date
)
{
this
.
toDetailPage
()
},
handleClickSure
()
{
this
.
editeRepair
()
},
},
},
}
}
</
script
>
</
script
>
...
...
pages/maintain-bill/show.vue
View file @
041f5d9e
...
@@ -310,6 +310,7 @@ export default {
...
@@ -310,6 +310,7 @@ export default {
type
:
'switchTab'
,
type
:
'switchTab'
,
})
})
},
},
init
()
{
init
()
{
this
.
loading
=
false
this
.
loading
=
false
this
.
info
=
{
this
.
info
=
{
...
...
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