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
99b1ad68
Commit
99b1ad68
authored
Jul 10, 2021
by
高铭波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf(order):完工项优化
parent
3b230076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
46 deletions
+90
-46
complete.vue
src/pages/order/complete.vue
+90
-46
No files found.
src/pages/order/complete.vue
View file @
99b1ad68
...
...
@@ -65,10 +65,17 @@
v-show=
"item.fieldsName != 'actualPaid' || show200"
:id=
"`item$
{item.fieldsId}`"
>
<view
class=
"label"
v-if=
"!hiddenTitle.includes(item.formType)"
>
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
{{
item
.
fieldsTitle
}}
</view>
<view
class=
"label"
v-if=
"!hiddenTitle.includes(item.formType)"
>
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
{{
item
.
fieldsTitle
}}
</view>
<template
v-if=
"item.fieldsType"
>
<xh-input
v-if=
"item.formType === 'input'"
...
...
@@ -210,10 +217,28 @@
@
value-change=
"fieldValueChange"
>
</xh-service-more>
<xh-label
v-else-if=
"item.formType==='label'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
<xh-label
v-else-if=
"item.formType === 'label'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
"form[item.fieldsName] || ''"
>
</xh-label>
<xh-parts
ref=
"fileChildParts"
v-else-if=
"item.formType==='parts'"
:categoryId=
"categoryId"
:brandId=
"brandId"
:order-id=
"orderId"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
:disabled=
"orderStatus === '88' || orderStatus === '86'"
@
value-change=
"fieldValueChange"
>
</xh-parts>
<xh-parts
ref=
"fileChildParts"
v-else-if=
"item.formType === 'parts'"
:categoryId=
"categoryId"
:brandId=
"brandId"
:order-id=
"orderId"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
"form[item.fieldsName] || ''"
:disabled=
"orderStatus === '88' || orderStatus === '86'"
@
value-change=
"fieldValueChange"
>
</xh-parts>
</template>
</u-form-item>
</view>
...
...
@@ -274,11 +299,11 @@ import XhTime from "@/components/createCom/XhTime.vue";
import
XhServiceMeasure
from
"@/components/createCom/XhServiceMeasure.vue"
;
import
XhServiceMore
from
"../../components/createCom/XhServiceMore"
;
import
XhLabel
from
"../../components/createCom/XhLabel"
;
import
XhParts
from
"@/components/createCom/XhParts"
import
XhParts
from
"@/components/createCom/XhParts"
;
import
takePhoto
from
"@/components/take/index.vue"
;
import
baseFile
from
"@/components/upload/index"
;
import
Detail
from
"@/components/order/detail.vue"
;
import
returnPartsVue
from
'../parts/returnParts.vue'
;
import
returnPartsVue
from
"../parts/returnParts.vue"
;
// 表单类型map
const
formType
=
new
Map
([
...
...
@@ -306,7 +331,7 @@ const formType = new Map([
[
"date"
,
[
"time"
,
"text"
]],
[
"form"
,
[
"form"
,
"text"
]],
[
"label"
,
[
"label"
,
"text"
]],
[
'parts'
,
[
'parts'
,
'text'
]],
[
"parts"
,
[
"parts"
,
"text"
]],
]);
/**
...
...
@@ -386,10 +411,10 @@ const actions = (name, pass, type, submit) => {
export
default
{
data
()
{
return
{
hiddenTitle
:
[
'location'
,
'form'
,
'label'
,
'parts'
],
hiddenTitle
:
[
"location"
,
"form"
,
"label"
,
"parts"
],
orderId
:
0
,
categoryId
:
0
,
brandId
:
0
,
brandId
:
0
,
orderServiceType
:
""
,
inGuaranteePeriod
:
""
,
partnerCompanyId
:
""
,
...
...
@@ -437,7 +462,7 @@ export default {
currentItemDate
:
{},
photoItem
:
{},
maintainStep
:
"partnerInspectItem"
,
orderStatus
:
''
orderStatus
:
""
,
// showTab: true,
};
},
...
...
@@ -455,7 +480,7 @@ export default {
XhServiceMeasure
,
XhServiceMore
,
XhLabel
,
XhParts
,
XhParts
,
Detail
,
"take-photo"
:
takePhoto
,
},
...
...
@@ -469,12 +494,12 @@ export default {
this
.
maintainStep
=
option
.
maintainStep
;
this
.
orderId
=
option
.
orderId
;
this
.
categoryId
=
option
.
categoryId
;
this
.
brandId
=
option
.
brandId
this
.
brandId
=
option
.
brandId
;
this
.
orderServiceType
=
decodeURIComponent
(
option
.
orderServiceType
);
this
.
inGuaranteePeriod
=
option
.
inGuaranteePeriod
;
this
.
partnerCompanyId
=
option
.
partnerCompanyId
;
this
.
auditResultsId
=
option
.
auditResultsId
;
this
.
orderStatus
=
option
.
orderStatus
this
.
orderStatus
=
option
.
orderStatus
;
// this.showTab =item.partnerCompanyName == '挚达充电桩'
}
else
{
this
.
orderId
=
11880091
;
...
...
@@ -550,6 +575,7 @@ export default {
},
initData
(
res
)
{
this
.
form
=
res
.
data
.
value
||
{};
this
.
loadOrderDetail
();
const
list
=
res
.
data
.
config
.
sort
((
a
,
b
)
=>
a
.
order
-
b
.
order
);
list
.
forEach
((
item
,
index
)
=>
{
...
...
@@ -586,6 +612,23 @@ export default {
if
(
this
.
auditResultsId
)
this
.
checkCompleteError
();
uni
.
hideLoading
();
},
loadOrderDetail
()
{
if
(
!
this
.
$u
.
test
.
isEmpty
(
this
.
form
)
&&
this
.
form
.
hasOwnProperty
(
"installComfirmTime"
)
&&
this
.
$u
.
test
.
isEmpty
(
this
.
form
.
installComfirmTime
))
{
this
.
$u
.
api
.
orderDetail
(
null
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
!
this
.
$u
.
test
.
isEmpty
(
res
.
data
.
checkInDateTime
))
{
this
.
$set
(
this
.
form
,
"installComfirmTime"
,
this
.
moment
(
res
.
data
.
checkInDateTime
).
format
(
"YYYY-MM-DD"
)
);
}
}
});
}
},
checkCompleteError
()
{
// 异常单定位错误项
let
self
=
this
;
...
...
@@ -627,10 +670,11 @@ export default {
});
return
param
;
},
saveComplete
(){
// 保存完工信息
// this.submitParts() // 不调这个接口;没完工不能调提交配件
const
param
=
this
.
handleSaveData
()
this
.
$u
.
api
.
saveCompleteData
(
param
,
this
.
orderId
).
then
((
res
)
=>
{
saveComplete
()
{
// 保存完工信息
// this.submitParts() // 不调这个接口;没完工不能调提交配件
const
param
=
this
.
handleSaveData
();
this
.
$u
.
api
.
saveCompleteData
(
param
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
"保存成功"
,
...
...
@@ -666,17 +710,17 @@ export default {
panelResult
.
submitted
++
;
}
else
if
(
value
&&
Array
.
isArray
(
value
)
&&
value
.
length
>
0
)
{
if
(
ele
.
fieldsName
===
"materialList"
)
{
let
hasMate
=
false
let
hasMate
=
false
;
let
mateRow
=
value
.
find
((
mate
)
=>
{
if
(
mate
.
hasOwnProperty
(
"useLength"
))
{
hasMate
=
true
return
!
this
.
$u
.
test
.
isEmpty
(
mate
.
useLength
)
if
(
mate
.
hasOwnProperty
(
"useLength"
))
{
hasMate
=
true
;
return
!
this
.
$u
.
test
.
isEmpty
(
mate
.
useLength
)
;
}
});
if
(
!
hasMate
||
!
this
.
$u
.
test
.
isEmpty
(
mateRow
))
{
panelResult
.
submitted
++
;
}
panelResult
.
submitted
++
;
panelResult
.
submitted
++
;
}
else
{
panelResult
.
submitted
++
;
}
...
...
@@ -793,26 +837,26 @@ export default {
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
;
});
},
// 提交配件信息
submitParts
()
{
if
(
this
.
form
.
orderSpareParts
)
{
const
orderSpareParts
=
JSON
.
parse
(
this
.
form
.
orderSpareParts
)
const
lists
=
orderSpareParts
.
filter
(
v
=>
v
.
quantity
>
0
)
const
params
=
{
workOrderId
:
this
.
orderId
,
applyType
:
'10'
,
parts
:
lists
?
JSON
.
stringify
(
lists
)
:
''
}
this
.
$u
.
api
.
createParts
(
params
).
then
(
res
=>
{
if
(
res
.
code
!==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
data
,
type
:
'error'
,
})
}
})
}
},
// 提交配件信息
submitParts
()
{
if
(
this
.
form
.
orderSpareParts
)
{
const
orderSpareParts
=
JSON
.
parse
(
this
.
form
.
orderSpareParts
);
const
lists
=
orderSpareParts
.
filter
((
v
)
=>
v
.
quantity
>
0
);
const
params
=
{
workOrderId
:
this
.
orderId
,
applyType
:
"10"
,
parts
:
lists
?
JSON
.
stringify
(
lists
)
:
""
,
};
this
.
$u
.
api
.
createParts
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
!==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
data
,
type
:
"error"
,
});
}
});
}
},
// 提交订单
orderFinish
()
{
const
param
=
this
.
handleSaveData
();
...
...
@@ -828,7 +872,7 @@ export default {
if
(
this
.
inGuaranteePeriod
===
"Y"
)
{
this
.
$u
.
api
.
inOrderFinish
(
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
submitParts
()
this
.
submitParts
();
this
.
$refs
.
uToast
.
show
({
title
:
"提交成功"
,
type
:
"success"
,
...
...
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