Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
fca1826a
Commit
fca1826a
authored
Sep 29, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 维修单字段隐藏切换
parent
51227e1b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
24 deletions
+40
-24
complete.vue
src/pages/order/complete.vue
+40
-24
No files found.
src/pages/order/complete.vue
View file @
fca1826a
...
...
@@ -64,9 +64,7 @@
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"
((item.fieldsName != 'actualPaid' &&
item.fieldsName != 'eSerialNum') ||
show200) &&
checkFields(item.fieldsName) &&
((readOnly &&
!$u.test.isEmpty(form[item.fieldsName])) ||
!readOnly)
...
...
@@ -442,6 +440,24 @@ const actions = (name, pass, type, submit) => {
}
}
const
fields
=
{
'paymentMethodsType'
:
{
// 基本信息-不需要收款
fieldsName
:
[
'actualPaid'
,
'eSerialNum'
],
value
:
'03'
},
'usePart'
:
{
// 维修工单-是否使用配件
fieldsName
:
[
'partName'
],
value
:
'02'
},
'getMoney'
:
{
// 维修工单-是否收款
fieldsName
:
[
'feeValue'
,
'feeProject'
],
value
:
'02'
}
}
const
fieldsNameArr
=
Object
.
values
(
fields
).
map
(
v
=>
v
.
fieldsName
).
reduce
((
acc
,
cur
)
=>
[...
acc
,
...
cur
],
[])
export
default
{
data
()
{
return
{
...
...
@@ -606,6 +622,17 @@ export default {
},
},
methods
:
{
checkFields
(
name
)
{
let
status
=
true
if
(
fieldsNameArr
.
includes
(
name
))
{
Object
.
entries
(
fields
).
forEach
(
v
=>
{
if
(
v
[
1
].
fieldsName
.
includes
(
name
))
{
status
=
this
.
form
[
v
[
0
]]
?
this
.
form
[
v
[
0
]]
!==
v
[
1
].
value
:
false
}
})
}
return
status
},
getCompleteData
()
{
//获取工单配置的完工项目
uni
.
showLoading
({
...
...
@@ -630,6 +657,7 @@ export default {
const
data
=
Object
.
create
(
res
.
data
.
config
,
{})
const
list
=
data
.
sort
((
a
,
b
)
=>
a
.
order
-
b
.
order
)
if
(
this
.
readOnly
)
this
.
tabIndex
=
0
list
.
forEach
((
item
,
index
)
=>
{
if
(
this
.
maintainStep
===
item
.
panelFieldsName
&&
!
this
.
readOnly
)
{
this
.
tabIndex
=
index
...
...
@@ -640,16 +668,8 @@ export default {
const
formMap
=
formType
.
get
(
type
)
||
formType
.
get
(
'text'
)
d
.
formType
=
formMap
[
0
]
d
.
inputType
=
formMap
[
1
]
if
(
d
.
fieldsName
===
'actualPaid'
&&
res
.
data
.
value
)
{
d
.
required
=
res
.
data
.
value
[
'paymentMethodsType'
]
?
res
.
data
.
value
[
'paymentMethodsType'
]
!=
'03'
:
false
}
if
(
d
.
fieldsName
===
'eSerialNum'
&&
res
.
data
.
value
)
{
d
.
required
=
res
.
data
.
value
[
'paymentMethodsType'
]
?
res
.
data
.
value
[
'paymentMethodsType'
]
!=
'03'
:
false
}
d
.
required
=
this
.
checkFields
(
d
.
fieldsName
)
if
(
d
.
fieldsName
===
'pipe'
||
d
.
fieldsName
===
'pipeUseLength'
)
{
// 申请费用计算
this
.
calcMoney
()
...
...
@@ -1126,17 +1146,13 @@ export default {
}
}
if
(
innerItem
.
fieldsName
===
'paymentMethodsType'
)
{
// 选不需要收款的时候,收款金额修改为非必选
const
actualPaid
=
groupItem
.
items
.
find
(
(
v
)
=>
v
.
fieldsName
===
'actualPaid'
)
if
(
actualPaid
)
actualPaid
.
required
=
data
.
value
!=
'03'
const
eSerialNum
=
groupItem
.
items
.
find
(
(
v
)
=>
v
.
fieldsName
===
'eSerialNum'
)
if
(
eSerialNum
)
eSerialNum
.
required
=
data
.
value
!=
'03'
// 根据选择的值隐藏对应的项
if
(
fields
[
innerItem
.
fieldsName
])
{
groupItem
.
items
.
forEach
(
c
=>
{
if
(
fields
[
innerItem
.
fieldsName
][
'fieldsName'
].
includes
(
c
.
fieldsName
))
{
c
.
required
=
data
.
value
!==
fields
[
innerItem
.
fieldsName
][
'value'
]
}
})
}
if
(
...
...
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