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
d464455b
Commit
d464455b
authored
Jun 08, 2021
by
高铭波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://git.banshouhui.com/lijundan/self-support
into dev
# Conflicts: # src/pages/order/document.vue
parents
9212b6f8
d20fe5d0
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
723 additions
and
549 deletions
+723
-549
.env.dev.js
.env.dev.js
+3
-3
.env.js
.env.js
+1
-1
order.js
src/common/api/order.js
+13
-1
http.interceptor.js
src/common/http.interceptor.js
+2
-1
complete-check.vue
src/components/complete-check/complete-check.vue
+56
-38
XhCheckbox.vue
src/components/createCom/XhCheckbox.vue
+1
-1
XhFiles.vue
src/components/createCom/XhFiles.vue
+1
-1
XhInput.vue
src/components/createCom/XhInput.vue
+21
-31
XhRadio.vue
src/components/createCom/XhRadio.vue
+2
-1
pages.json
src/pages.json
+3
-3
learn.vue
src/pages/index/learn.vue
+1
-1
order.vue
src/pages/index/order.vue
+1
-0
complete.vue
src/pages/order/complete.vue
+312
-293
detail.vue
src/pages/order/detail.vue
+2
-1
document.vue
src/pages/order/document.vue
+297
-168
list.vue
src/pages/photo/list.vue
+7
-5
No files found.
.env.dev.js
View file @
d464455b
...
...
@@ -5,11 +5,11 @@ const UNI_APP = {
// banshou: 'https://m.banshou.com', //扳手app
},
systemUrl
:
{
apiUrl
:
'http://192.168.
1.22
'
,
//java端域名请求头
apiUrl
:
'http://192.168.
0.62:37080
'
,
//java端域名请求头
// apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
},
qn_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'http://deudn.c.pp.cc/'
,
qn_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'http://deudn.c.pp.cc/'
,
argoDebugMode
:
1
}
module
.
exports
=
UNI_APP
;
.env.js
View file @
d464455b
...
...
@@ -2,7 +2,7 @@
(
function
()
{
let
NODE_ENV
=
'test'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
;
let
VERSION_NUMBER
=
'1.3.
1
'
;
//版本号
let
VERSION_NUMBER
=
'1.3.
2
'
;
//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
NODE_ENV
===
'dev'
)
{
...
...
src/common/api/order.js
View file @
d464455b
...
...
@@ -119,6 +119,11 @@ let orderApiFun = function(vm){
*/
let
getCompleteConfigAndData
=
async
(
orderId
)
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/maintain/info'
);
/**
* 完工项阶段下一步
*/
let
completeNextStep
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/maintain/nextStep'
,
params
);
/**
* 查询措施
*/
...
...
@@ -172,6 +177,10 @@ let orderApiFun = function(vm){
let
otherUser
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'other/auth/'
+
vm
.
vuex_token
+
'/other/user'
,
params
);
// 是否添加客服
let
checkAddCustomer
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'order/revision/'
+
vm
.
vuex_token
+
'/checkAddCustomer'
,
params
);
// 工单文件标签
let
fileLabel
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'config/'
+
vm
.
vuex_token
+
'/finish/file/lable/'
,
params
);
// 工单文件列表
let
fileList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'config/'
+
vm
.
vuex_token
+
'/finish/file'
,
params
);
const
orderApi
=
{
listByRecommendOrder
,
...
...
@@ -212,7 +221,10 @@ let orderApiFun = function(vm){
workerApplyPay
,
allowLogin
,
otherUser
,
checkAddCustomer
checkAddCustomer
,
fileLabel
,
fileList
,
completeNextStep
}
return
orderApi
}
...
...
src/common/http.interceptor.js
View file @
d464455b
...
...
@@ -88,7 +88,8 @@ const install = (Vue, vm) => {
// return result;
case
200
:
return
{
data
:
result
.
data
==
null
?
result
:
result
.
data
,
// result.data的值为0, false, ''的时候也要算有值
// data:result.data == null ? result : result.data, // result.data的值为0, false, ''的时候也要算有值
data
:
result
.
data
,
code
:
code
,
message
:
msg
};
...
...
src/components/complete-check/complete-check.vue
View file @
d464455b
...
...
@@ -9,38 +9,49 @@
mode=
"center"
width=
"690rpx"
>
<view
class=
"slot-content"
>
<view
class=
"check-status"
>
<u-image
width=
"224rpx"
height=
"224rpx"
:src=
"statusImage"
></u-image>
<text
:class=
"['status-txt',
{ 'pass-color': pass }]">
{{
statusTxt
}}
</text>
</view>
<view
class=
"check-list"
>
<view
class=
"u-flex u-row-between list-title"
>
<view
class=
"left-txt"
>
验证项
</view>
<view>
已提交/需提交
</view>
<view
class=
"right-txt"
>
结果
</view>
<view
v-if=
"confirmButtonText !== '确定'"
>
<view
class=
"check-status"
>
<u-image
width=
"224rpx"
height=
"224rpx"
:src=
"statusImage"
></u-image>
<text
:class=
"['status-txt',
{ 'pass-color': pass }]">
{{
statusTxt
}}
</text>
</view>
<view
class=
"u-flex u-row-between list-item"
v-for=
"(item, index) in listData"
:key=
"index"
>
<view
class=
"item-txt left-txt"
style=
"width: 160rpx;text-align: left;"
>
<u-icon
:name=
"item.pass ? passIcon : noPassIcon"
:label=
"item.label"
margin-left=
"12"
label-color=
"#333333"
label-size=
"28"
size=
"32"
></u-icon>
<view
class=
"check-list"
>
<view
class=
"u-flex u-row-between list-title"
>
<view
class=
"left-txt"
>
验证项
</view>
<view>
已提交/需提交
</view>
<view
class=
"right-txt"
>
结果
</view>
</view>
<view
class=
"item-txt"
>
{{
item
.
submitted
}}
/
{{
item
.
required
}}
</view>
<view
:class=
"['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']"
style=
"width: 160rpx;text-align: right;"
>
{{
item
.
pass
?
"通过"
:
"未通过"
}}
<view
class=
"u-flex u-row-between list-item"
v-for=
"(item, index) in listData"
:key=
"index"
>
<view
class=
"item-txt left-txt"
style=
"width: 200rpx;text-align: left;"
>
<u-icon
:name=
"item.pass ? passIcon : noPassIcon"
:label=
"item.label"
margin-left=
"12"
label-color=
"#333333"
label-size=
"28"
size=
"32"
></u-icon>
</view>
<view
class=
"item-txt"
>
{{
item
.
submitted
}}
/
{{
item
.
required
}}
</view>
<view
:class=
"['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']"
style=
"width: 160rpx;text-align: right;"
>
{{
item
.
pass
?
"通过"
:
"未通过"
}}
</view>
</view>
</view>
</view>
<view
v-else
>
<view
class=
"check-status"
>
<text
class=
'status-txt'
style=
"color: #333;"
>
确认安装结果
</text>
</view>
<view
class=
"u-flex no-install"
>
<text
class=
"tips"
>
提交信息,确认安装结论为不安装
</text>
</view>
</view>
<view
class=
"check-bottom"
>
<view
class=
"button cancel"
v-show=
"
!pass"
@
tap=
"cancel"
>
取消
</view>
<view
class=
"button confirm"
@
tap=
"confirm"
>
{{
confirmText
}}
</view>
<view
class=
"button cancel"
v-show=
"
cancelButtonText !== ''"
@
tap=
"cancel"
>
{{
cancelButtonText
}}
</view>
<view
class=
"button confirm"
@
tap=
"confirm"
>
{{
confirmButtonText
}}
</view>
</view>
</view>
</u-popup>
...
...
@@ -79,6 +90,14 @@
{
label
:
'安装信息'
,
submitted
:
15
,
required
:
20
,
pass
:
false
}
]
}
},
confirmButtonText
:
{
type
:
String
,
default
:
'确定'
},
cancelButtonText
:
{
type
:
String
,
default
:
''
}
},
data
()
{
...
...
@@ -104,9 +123,6 @@
statusTxt
()
{
return
this
.
pass
?
"完工校验已通过"
:
"完工校验未通过"
},
confirmText
()
{
return
this
.
pass
?
"确定"
:
"去处理"
},
passIcon
()
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/pass.png'
},
noPassIcon
()
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/no-pass.png'
},
},
...
...
@@ -115,14 +131,7 @@
this
.
$emit
(
'close'
)
},
confirm
()
{
if
(
this
.
pass
)
{
this
.
$emit
(
'change'
)
}
else
{
let
data
=
this
.
listData
.
find
((
item
,
index
)
=>
{
return
item
.
pass
==
false
;
})
this
.
$emit
(
'handle'
,
data
)
}
this
.
$emit
(
'confirm'
)
}
},
...
...
@@ -161,6 +170,15 @@
margin-bottom
:
40rpx
;
}
}
.no-install
{
justify-content
:
center
;
align-items
:
center
;
height
:
200rpx
;
border-top
:
2rpx
solid
#F4F5F7
;
.tips
{
font-size
:
28rpx
;
}
}
.check-bottom
{
display
:
flex
;
justify-content
:
center
;
...
...
@@ -194,7 +212,7 @@
line-height
:
32rpx
;
}
.left-txt
{
width
:
16
0rpx
;
width
:
20
0rpx
;
text-align
:
left
;
}
.right-txt
{
...
...
src/components/createCom/XhCheckbox.vue
View file @
d464455b
...
...
@@ -61,7 +61,7 @@
display
:
flex
;
flex-wrap
:
wrap
;
line-height
:
50rpx
;
max-width
:
46%
;
max-width
:
46%
;
align-items
:
center
;
&
.active
{
background-color
:
#2272FF
;
...
...
src/components/createCom/XhFiles.vue
View file @
d464455b
...
...
@@ -4,7 +4,7 @@
<view
class=
"file-box"
>
<view
class=
"pics u-flex u-flex-wrap"
>
<view
class=
"img-list"
v-for=
"(item,index) in imgList"
:key=
"index"
>
<u-image
class=
"pic"
width=
"160"
height=
"160"
:src=
"item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'"
:border-radius=
"10"
@
click
.
stop=
"prviewImage(item,index)"
></u-image>
<u-image
class=
"pic"
width=
"160"
height=
"160"
:src=
"item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'"
:border-radius=
"10"
@
click
.
stop=
"prviewImage(item,index)"
fade
lazy-load
></u-image>
<view
class=
"icon-del-box"
@
click
.
stop=
"delFile(index)"
>
<view
class=
"icon-del"
></view>
<view
class=
"icon-del rotate"
></view>
...
...
src/components/createCom/XhInput.vue
View file @
d464455b
...
...
@@ -2,7 +2,10 @@
<
template
>
<view
:style=
"
{'width': fieldsWidth}">
<u-input
:type=
"type"
class=
"input-item"
v-model=
"dataValue"
@
input=
"valueChange"
:placeholder=
"placeholder"
:placeholder-style=
"placeholderStyle"
:custom-style=
"customStyle"
:clearable=
"false"
:border=
"border"
border-color=
"#ECECEC"
:maxlength=
"maxlength"
:cursor-spacing=
"10"
hold-keyboard
/>
:custom-style=
"customStyle"
:clearable=
"false"
:border=
"border"
border-color=
"#ECECEC"
:maxlength=
"maxlength"
:cursor-spacing=
"10"
:disabled=
"isDisabled"
hold-keyboard
/>
<view
class=
"content"
v-if=
"slotContent"
>
<text
class=
"txt"
>
{{
slotContent
}}
</text>
</view>
</view>
</
template
>
...
...
@@ -26,42 +29,18 @@
type
:
{
type
:
String
,
default
:
'text'
},
slotContent
:
{
type
:
String
,
default
:
''
}
// width: { // 例如:454rpx
// type: String,
// default: '100%'
// }
},
data
()
{
return
{
inputType
:
'text'
,
// type: 'text'
inputType
:
'text'
}
},
computed
:
{
// type() {
// if (this.item) {
// let ty = this.item.fieldsType.toLocaleLowerCase()
// switch (ty) {
// case 'text':
// return 'textarea'
// case 'password':
// return this.item.fieldsType
// case 'decimal':
// case 'number':
// case 'double':
// case 'integer':
// this.maxlength = 9
// return 'digit'
// case 'textarea':
// default:
// return 'text'
// }
// } else {
// return 'text'
// }
// },
maxlength
()
{
return
this
.
type
==
'digit'
?
9
:
140
},
...
...
@@ -89,6 +68,9 @@
},
backgroundColor
()
{
return
this
.
textarea
?
'transparent'
:
'#F4F5F7'
},
isDisabled
()
{
return
this
.
item
.
fieldsId
===
254
||
this
.
disabled
?
true
:
false
}
},
watch
:
{},
...
...
@@ -97,8 +79,16 @@
}
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
scoped
>
.input-item
{
background
:
#F4F5F7
;
}
.content
{
padding-top
:
20rpx
;
line-height
:
45rpx
;
.txt
{
font-size
:
24rpx
;
color
:
#999
;
}
}
</
style
>
src/components/createCom/XhRadio.vue
View file @
d464455b
...
...
@@ -25,6 +25,7 @@
mounted
()
{},
methods
:
{
setValue
(
txt
){
if
(
this
.
disabled
)
return
this
.
dataValue
=
txt
this
.
valueChange
(
txt
)
}
...
...
@@ -44,7 +45,7 @@
display
:
flex
;
flex-wrap
:
wrap
;
line-height
:
50rpx
;
max-width
:
46%
;
max-width
:
46%
;
align-items
:
center
;
&
.active
{
background-color
:
#2272FF
;
...
...
src/pages.json
View file @
d464455b
...
...
@@ -326,10 +326,10 @@
{
"path"
:
"document"
,
"style"
:
{
"navigationBarTitleText"
:
"
资料
文件"
,
"navigationBarTitleText"
:
"
安装
文件"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
//
"disableScroll"
:
true
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
]
...
...
src/pages/index/learn.vue
View file @
d464455b
...
...
@@ -949,7 +949,7 @@ export default {
/* position: absolute; */
position
:
relative
;
border-radius
:
12
rpx
;
margin-top
:
6
0
rpx
;
margin-top
:
8
0
rpx
;
}
.title
{
...
...
src/pages/index/order.vue
View file @
d464455b
...
...
@@ -301,6 +301,7 @@
+
"&inGuaranteePeriod="
+
item
.
inGuaranteePeriod
+
"&partnerCompanyId="
+
item
.
partnerCompanyId
+
"&auditResultsId="
+
(
item
.
auditResults
?
Object
.
keys
(
item
.
auditResults
)[
Object
.
keys
(
item
.
auditResults
).
length
-
1
]:
''
)
+
"&maintainStep="
+
item
.
maintainStep
})
},
// handleAction(item) {
...
...
src/pages/order/complete.vue
View file @
d464455b
<
template
>
<view
class=
"pg-complete"
>
<complete-check
:show=
"completeCheck
Status"
:list-data=
"completeCheckResult"
:pass=
"pass"
@
close=
"closeCheckResult"
@
handle=
"handerProgrom"
@
change=
"confirm
"
></complete-check>
<complete-check
:show=
"completeCheck
.status"
:list-data=
"completeCheck.result"
:pass=
"pass"
@
close=
"closeCheckResult"
@
confirm=
"confirm"
:confirm-button-text=
"completeCheck.confirmText"
:cancel-button-text=
"completeCheck.cancelText
"
></complete-check>
<view
class=
"com-content"
>
<u-navbar
:background=
"
{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false"
title="完工信息
" title-bold>
</u-navbar>
<u-navbar
:background=
"
{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false"
:title="list[tabIndex].panelName
" title-bold>
</u-navbar>
<u-tabs
class=
"order-tabs"
ref=
"tabs"
:current=
"current"
name=
"panelName"
:list=
"tabList"
@
change=
"swichMenu"
bg-color=
"#2272FF"
inactive-color=
"#a6c6ff"
active-color=
"#fff"
height=
"80"
font-size=
"32"
></u-tabs>
<view
class=
"u-menu-wrap"
>
<!--
<scroll-view
scroll-y
scroll-with-animation
class=
"u-tab-view menu-scroll-view"
:scroll-top=
"scrollTop"
v-if=
"list[tabIndex].items.length > 1 && showTab"
>
<view
v-for=
"(item,index) in list[tabIndex].items"
:key=
"index"
class=
"u-tab-item"
:class=
"[current == index ? 'u-tab-item-active' : '']"
@
tap
.
stop=
"swichMenu(index)"
>
<text
class=
"u-line-1"
>
{{
item
.
name
}}
</text>
</view>
</scroll-view>
-->
<scroll-view
:scroll-top=
"scrollRightTop"
style=
"height: 100%;"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
:scroll-into-view=
"itemId"
>
<u-form
:model=
"form"
ref=
"uForm"
>
<template
v-for=
"(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"
>
<view
class=
"class-item"
:key=
"groupIndex"
>
<view
class=
"title"
v-if=
"groupItem.name !== '基本信息'"
>
{{
groupItem
.
name
}}
</view>
<view
class=
"class-item"
:
id=
"'item' + groupIndex"
:
key=
"groupIndex"
>
<view
class=
"title"
>
{{
groupItem
.
name
}}
</view>
<view
class=
"class-bd"
>
<u-form-item
v-for=
"(item,itemIndex) in groupItem.items"
:key=
"itemIndex"
label-position=
"top"
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"item.fieldsId != 200 || show200"
:id=
"`item$
{item.fieldsId}`">
<view
:class=
"[
{'label-bold': groupItem.name === '基本信息'}, 'label']
" v-if="item.formType!=='location'
&&
item.formType!=='form'
&&
item.formType!=='label'">
<view
class=
"label
"
v-if=
"item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'"
>
<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'"
:groupIndex=
"groupIndex"
:type=
"item.inputType"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
:disabled=
"item.disabled || false"
:slotContent=
"item.fieldsInfo"
@
value-change=
"fieldValueChange"
>
</xh-input>
<xh-multi-input
v-else-if=
"item.formType==='multiinput'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-multi-input>
<xh-radio
v-else-if=
"item.formType==='radio'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
:disabled=
"item.disabled || false"
@
value-change=
"fieldValueChange"
>
</xh-radio>
<xh-checkbox
v-else-if=
"item.formType==='checkbox'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
...
...
@@ -64,10 +57,6 @@
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-scan>
<xh-picker
v-else-if=
"item.formType==='picker'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-picker>
<xh-service-measure
v-else-if=
"item.formType==='servicemeasure'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:orderId=
"orderId"
:categoryId=
"categoryId"
:orderServiceType=
"orderServiceType"
:specificationId=
"form['specificationId'] || 0"
:value=
"form[item.fieldsName]"
...
...
@@ -97,13 +86,9 @@
type=
"primary"
shape=
"circle"
:custom-style=
"customStyle"
:hover-class=
"submitStatus ? '' : 'none'"
>
暂存
</u-button>
<u-button
class=
"btn-submit"
@
click=
"orderFinish"
v-if=
"tabIndex===list.length - 1"
type=
"primary"
shape=
"circle"
:custom-style=
"buttonStyle"
:hover-class=
"submitStatus ? '' : 'none'"
>
完工
</u-button>
<u-button
class=
"btn-submit"
@
click=
"nextStep"
:custom-style=
"buttonStyle"
v-else
<u-button
class=
"btn-submit"
@
click=
"nextStep"
:custom-style=
"buttonStyle"
type=
"primary"
shape=
"circle"
:hover-class=
"submitStatus ? '' : 'none'"
>
下一步
{{ tabIndex === list.length - 1 ? '提交' : '下一步' }}
</u-button>
</view>
</view>
...
...
@@ -121,7 +106,6 @@
import
XhFiles
from
'@/components/createCom/XhFiles.vue'
import
XhLocation
from
'@/components/createCom/XhLocation.vue'
import
XhScan
from
'@/components/createCom/XhScan.vue'
import
XhPicker
from
'@/components/createCom/XhPicker.vue'
import
XhTime
from
'@/components/createCom/XhTime.vue'
import
XhServiceMeasure
from
'@/components/createCom/XhServiceMeasure.vue'
import
XhServiceMore
from
"../../components/createCom/XhServiceMore"
...
...
@@ -129,7 +113,98 @@
import
takePhoto
from
'@/components/take/index.vue'
import
baseFile
from
'@/components/upload/index'
import
Detail
from
"@/components/order/detail.vue"
// import XhRadio from '@/components/createCom/XhRadio.vue'
// 表单类型map
const
formType
=
new
Map
([
[
'text'
,
[
'input'
,
'textarea'
]],
[
'password'
,
[
'password'
,
'input'
]],
[
'textarea'
,
[
'input'
,
'digit'
]],
[
'number'
,
[
'input'
,
'digit'
]],
[
'decimal'
,
[
'input'
,
'digit'
]],
[
'double'
,
[
'input'
,
'digit'
]],
[
'integer'
,
[
'input'
,
'digit'
]],
[
'string'
,
[
'input'
,
'text'
]],
[
'jscode'
,
[
'input'
,
'text'
]],
[
'multiinput'
,
[
'multiinput'
,
'text'
]],
[
'select'
,
[
'select'
,
'text'
]],
[
'specifications'
,
[
'select'
,
'text'
]],
[
'radio'
,
[
'radio'
,
'text'
]],
[
'checkbox'
,
[
'checkbox'
,
'text'
]],
[
'file'
,
[
'file'
,
'text'
]],
[
'photos'
,
[
'file'
,
'text'
]],
[
'location'
,
[
'location'
,
'text'
]],
[
'scan'
,
[
'scan'
,
'text'
]],
[
'machine_code'
,
[
'scan'
,
'text'
]],
[
'service_measures'
,
[
'servicemeasure'
,
'text'
]],
[
'time'
,
[
'time'
,
'text'
]],
[
'date'
,
[
'time'
,
'text'
]],
[
'form'
,
[
'form'
,
'text'
]],
[
'label'
,
[
'label'
,
'text'
]],
])
/**
* modal 弹窗校验
* @description 用于校验下一步的动作
* @property {String} name 当前的订单阶段
* @property {Boolean} pass 是否通过校验
* @property {String}} type 是否有二次勘测或二次安装
* @property {submit} submit 提交或下一步
*/
const
actions
=
(
name
,
pass
,
type
,
submit
)
=>
{
const
handerProgrom
=
{
perfect
:
{
confirmText
:
'去完善'
,
action
:
'handerProgrom'
},
appointment
:
{
confirmText
:
'好的,再次预约'
,
action
:
'appointment'
},
next
:
{
confirmText
:
'下一步'
,
action
:
'nextAction'
},
noPerfectSubmit
:
{
confirmText
:
'去完善'
,
action
:
'handerProgrom'
,
cancelText
:
'部分提交'
,
cancelAction
:
'appointment'
},
submit
:
{
confirmText
:
'提交'
,
action
:
'orderFinish'
,
},
confirm
:
{
confirmText
:
'确定'
,
action
:
'nextAction'
,
}
}
if
(
name
===
'partnerInspectItem'
)
{
// 勘察
if
(
!
pass
)
return
handerProgrom
.
perfect
return
type
?
(
type
===
'01'
?
handerProgrom
.
next
:
handerProgrom
.
appointment
)
:
handerProgrom
.
perfect
}
else
if
(
name
===
'partnerInstallItem'
)
{
// 安装
let
hander
=
''
switch
(
type
){
case
'01'
:
// 安装完成
hander
=
!
pass
?
handerProgrom
.
perfect
:
handerProgrom
.
next
break
;
case
'02'
:
// 二次安装
hander
=
!
pass
?
handerProgrom
.
noPerfectSubmit
:
handerProgrom
.
appointment
break
;
case
'03'
:
//不安装
hander
=
handerProgrom
.
confirm
break
;
default
:
hander
=
handerProgrom
.
perfect
break
;
}
return
hander
}
else
{
// 基础信息
if
(
!
pass
)
return
handerProgrom
.
perfect
return
submit
?
handerProgrom
.
submit
:
handerProgrom
.
next
}
}
export
default
{
data
()
{
return
{
...
...
@@ -143,7 +218,7 @@
tabIndex
:
0
,
scrollTop
:
0
,
//tab标题的滚动条位置
oldScrollTop
:
0
,
current
:
0
,
// 预设当前项的值
current
:
null
,
// 预设当前项的值
menuHeight
:
0
,
// 左边菜单的高度
menuItemHeight
:
0
,
// 左边菜单item的高度
itemId
:
''
,
// 栏目右边scroll-view用于滚动的id
...
...
@@ -155,8 +230,14 @@
form
:
{
// 一维表单
},
submitBtnStatus
:
false
,
completeCheckStatus
:
false
,
completeCheckResult
:
[],
completeCheck
:
{
status
:
false
,
resulut
:
[],
confirmText
:
'去完善'
,
cancelText
:
''
,
action
:
''
,
cancelAction
:
''
},
waitHandlerPanelIndex
:
0
,
waitHandlerGroupIndex
:
0
,
waitHandlerEleIndex
:
0
,
...
...
@@ -174,6 +255,7 @@
takeStatus
:
false
,
currentItemDate
:{},
photoItem
:
{},
maintainStep
:
'partnerInspectItem'
,
// showTab: true,
}
},
...
...
@@ -186,7 +268,6 @@
XhFiles
,
XhLocation
,
XhScan
,
XhPicker
,
XhTime
,
XhServiceMeasure
,
XhServiceMore
,
...
...
@@ -201,18 +282,13 @@
onLoad
(
option
)
{
getApp
().
trackPage
(
'订单完工信息页'
)
if
(
option
)
{
if
(
option
.
pageIndex
)
{
this
.
tabIndex
=
option
.
pageIndex
uni
.
setNavigationBarTitle
({
title
:
this
.
title
});
}
this
.
orderId
=
option
.
orderId
this
.
categoryId
=
option
.
categoryId
this
.
orderServiceType
=
decodeURIComponent
(
option
.
orderServiceType
)
this
.
inGuaranteePeriod
=
option
.
inGuaranteePeriod
this
.
partnerCompanyId
=
option
.
partnerCompanyId
this
.
auditResultsId
=
option
.
auditResultsId
this
.
maintainStep
=
option
.
maintainStep
this
.
orderId
=
option
.
orderId
this
.
categoryId
=
option
.
categoryId
this
.
orderServiceType
=
decodeURIComponent
(
option
.
orderServiceType
)
this
.
inGuaranteePeriod
=
option
.
inGuaranteePeriod
this
.
partnerCompanyId
=
option
.
partnerCompanyId
this
.
auditResultsId
=
option
.
auditResultsId
// this.showTab =item.partnerCompanyName == '挚达充电桩'
}
else
{
...
...
@@ -223,20 +299,10 @@
}
this
.
getCompleteData
()
},
onReady
()
{
// 导航栏滚动切换
this
.
getMenuItemTop
()
},
updated
()
{
//console.log(this.form.name, 'form.name')
},
computed
:
{
pageTitles
()
{
return
[
'勘察信息'
,
'完工信息'
,
'基本信息'
]
},
title
()
{
return
this
.
pageTitles
[
this
.
tabIndex
]
},
tabList
()
{
// 没有数据的时候tab要有占位数据,不然有页面有晃动
return
this
.
list
.
length
>
0
?
this
.
list
[
this
.
tabIndex
].
items
:
[{
name
:
''
}]
},
...
...
@@ -275,11 +341,13 @@
},
methods
:
{
getCompleteData
()
{
//获取工单配置的完工项目
let
self
=
this
if
(
self
.
orderId
){
self
.
$u
.
api
.
getCompleteConfigAndData
(
self
.
orderId
).
then
((
res
)
=>
{
uni
.
showLoading
({
title
:
'加载中'
})
if
(
this
.
orderId
){
this
.
$u
.
api
.
getCompleteConfigAndData
(
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
self
.
initData
(
res
)
this
.
initData
(
res
)
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
...
...
@@ -290,100 +358,33 @@
}
},
initData
(
res
)
{
for
(
var
item
of
res
.
data
.
config
)
{
for
(
var
i
of
item
.
items
)
{
for
(
var
d
of
i
.
items
)
{
var
inputType
=
'text'
var
formType
=
''
var
type
=
d
.
fieldsType
.
toLocaleLowerCase
()
switch
(
type
)
{
case
'text'
:
inputType
=
'textarea'
formType
=
'input'
break
case
'password'
:
inputType
=
'password'
formType
=
'input'
break
case
'textarea'
:
case
'number'
:
case
'decimal'
:
case
'double'
:
case
'integer'
:
formType
=
'input'
inputType
=
'digit'
break
case
'string'
:
formType
=
'input'
,
inputType
=
'text'
break
case
'multiinput'
:
formType
=
'multiinput'
inputType
=
'text'
break
;
case
'select'
:
case
'specifications'
:
formType
=
'select'
inputType
=
'text'
break
case
'radio'
:
formType
=
'radio'
inputType
=
'text'
break
case
'checkbox'
:
formType
=
'checkbox'
inputType
=
'text'
break
case
'file'
:
case
'photos'
:
formType
=
'file'
inputType
=
'text'
break
case
'location'
:
formType
=
'location'
inputType
=
'text'
break
case
'scan'
:
case
'machine_code'
:
formType
=
'scan'
inputType
=
'text'
break
case
'picker'
:
case
'mutipicker'
:
formType
=
'picker'
inputType
=
'text'
break
case
'service_measures'
:
formType
=
'servicemeasure'
inputType
=
'text'
break
case
'time'
:
case
'date'
:
formType
=
'time'
inputType
=
'text'
break
case
'form'
:
formType
=
'form'
inputType
=
'text'
break
case
'label'
:
formType
=
'label'
inputType
=
'text'
break
}
d
.
formType
=
formType
d
.
inputType
=
inputType
this
.
form
=
res
.
data
.
value
||
{}
const
list
=
res
.
data
.
config
.
sort
((
a
,
b
)
=>
a
.
order
-
b
.
order
)
list
.
forEach
((
item
,
index
)
=>
{
if
(
this
.
maintainStep
===
item
.
panelFieldsName
)
this
.
tabIndex
=
index
item
.
items
.
forEach
(
v
=>
{
v
.
items
.
forEach
(
d
=>
{
const
type
=
d
.
fieldsType
.
toLocaleLowerCase
()
const
formMap
=
formType
.
get
(
type
)
||
formType
.
get
(
'text'
)
d
.
formType
=
formMap
[
0
]
d
.
inputType
=
formMap
[
1
]
if
(
d
.
fieldsId
==
200
&&
res
.
data
.
value
)
{
d
.
required
=
res
.
data
.
value
[
'paymentMethodsType'
]
!=
'03'
d
.
required
=
res
.
data
.
value
[
'paymentMethodsType'
]
!=
'03'
}
}
}
}
this
.
list
=
res
.
data
.
config
if
(
d
.
fieldsId
===
252
||
d
.
fieldsId
===
253
)
{
// 申请费用计算
this
.
calcMoney
()
}
})
})
})
this
.
list
=
list
// this.showTab = this.list.length > 1
this
.
form
=
res
.
data
.
value
||
{}
this
.
current
=
0
// 异常单处理
if
(
this
.
auditResultsId
)
this
.
checkCompleteError
()
uni
.
hideLoading
()
},
checkCompleteError
()
{
// 异常单定位错误项
let
self
=
this
...
...
@@ -439,90 +440,173 @@
})
},
checkCompleteItem
(){
let
self
=
this
let
checkResult
=
[]
let
pass
=
true
let
first
=
true
self
.
list
.
forEach
((
panel
,
panelIndex
)
=>
{
let
panelResult
=
{
label
:
panel
.
panelName
,
submitted
:
0
,
required
:
0
,
pass
:
true
}
panel
.
items
.
forEach
((
group
,
groupIndex
)
=>
{
const
lists
=
this
.
tabList
lists
.
forEach
((
group
,
groupIndex
)
=>
{
const
checkRequired
=
group
.
items
.
some
(
v
=>
v
.
required
)
if
(
checkRequired
)
{
let
panelResult
=
{
label
:
group
.
name
,
submitted
:
0
,
required
:
0
,
pass
:
true
}
group
.
items
.
forEach
((
ele
,
eleIndex
)
=>
{
if
(
ele
.
required
){
panelResult
.
required
++
let
value
=
self
.
form
[
ele
.
fieldsName
]
let
value
=
this
.
form
[
ele
.
fieldsName
]
if
(
value
&&!
Array
.
isArray
(
value
)){
panelResult
.
submitted
++
}
else
if
(
value
&&
Array
.
isArray
(
value
)
&&
value
.
length
>
0
){
panelResult
.
submitted
++
}
else
if
(
first
){
// 记录第一个 为空 并且需要必填的项 用于定位
first
=
false
self
.
waitHandlerPanelIndex
=
panel
Index
self
.
waitHandlerGroupIndex
=
groupIndex
self
.
waitHandlerEleIndex
=
eleIndex
self
.
oldItemId
=
`item
${
ele
.
fieldsId
}
`
this
.
waitHandlerPanelIndex
=
this
.
tab
Index
this
.
waitHandlerGroupIndex
=
groupIndex
this
.
waitHandlerEleIndex
=
eleIndex
this
.
oldItemId
=
`item
${
ele
.
fieldsId
}
`
}
}
})
})
panelResult
.
pass
=
panelResult
.
required
<=
panelResult
.
submitted
pass
=
pass
&&
panelResult
.
pass
checkResult
.
push
(
panelResult
)
panelResult
.
pass
=
panelResult
.
required
<=
panelResult
.
submitted
pass
=
pass
&&
panelResult
.
pass
checkResult
.
push
(
panelResult
)
}
})
console
.
log
(
checkResult
)
self
.
completeCheckR
esult
=
checkResult
this
.
completeCheck
.
r
esult
=
checkResult
return
pass
},
confirm
(){
// 检查结果窗口 确认
回调
uni
.
reLaunch
(
{
url
:
'/pages/index/order?type=3'
}
)
// 检查结果窗口取消
回调
closeCheckResult
()
{
this
.
completeCheck
.
status
=
false
this
[
this
.
completeCheck
.
cancelAction
](
)
},
closeCheckResult
(){
// 检查结果窗口取消回调
this
.
completeCheckStatus
=
false
// 检查结果窗口 确认回调
confirm
(){
this
.
completeCheck
.
status
=
false
this
[
this
.
completeCheck
.
action
]()
},
handerProgrom
(){
// 检查结果窗口 去处理回调 定位到缺失的项
this
.
completeCheckStatus
=
false
// 去完善
handerProgrom
(){
this
.
locationCompleteItem
(
this
.
waitHandlerPanelIndex
,
this
.
waitHandlerGroupIndex
,
this
.
waitHandlerEleIndex
)
},
// 去预约
async
appointment
()
{
const
save
=
await
this
.
nextStepSaveData
()
if
(
save
)
{
uni
.
reLaunch
({
url
:
'/pages/index/order?type=0'
})
}
},
// 下一步动作
async
nextAction
()
{
const
save
=
await
this
.
nextStepSaveData
()
if
(
this
.
tabIndex
<
this
.
list
.
length
-
1
&&
save
)
{
this
.
tabIndex
++
this
.
arr
=
[]
this
.
scrollRightTop
=
0
this
.
current
=
0
const
itemId
=
this
.
list
[
this
.
tabIndex
].
items
[
0
].
items
[
0
].
fieldsId
this
.
oldItemId
=
`item
${
itemId
}
`
this
.
$nextTick
(
async
()
=>
{
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
this
.
oldItemId
=
''
})
}
},
// 下一步弹窗处理
nextStep
()
{
this
.
pass
=
this
.
checkCompleteItem
()
const
name
=
this
.
list
[
this
.
tabIndex
].
panelFieldsName
const
type
=
name
===
'partnerInspectItem'
?
this
.
form
.
inspectConclusionType
:
this
.
form
.
constructionConclusionType
const
submit
=
this
.
tabIndex
===
this
.
list
.
length
-
1
const
result
=
actions
(
name
,
this
.
pass
,
type
,
submit
)
this
.
completeCheck
.
status
=
true
this
.
completeCheck
.
confirmText
=
result
.
confirmText
this
.
completeCheck
.
action
=
result
.
action
this
.
completeCheck
.
cancelText
=
result
.
cancelText
||
''
this
.
completeCheck
.
cancelAction
=
result
.
cancelAction
||
''
},
// 下一步数据保存
nextStepSaveData
()
{
const
params
=
{
maintainFields
:
this
.
handleSaveData
(),
currentStep
:
this
.
list
[
this
.
tabIndex
].
panelFieldsName
,
nextStep
:
this
.
list
[
this
.
tabIndex
+
1
].
panelFieldsName
,
}
return
this
.
$u
.
api
.
completeNextStep
(
params
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
return
Promise
.
resolve
(
true
)
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
return
Promise
.
resolve
(
false
)
}
})
},
tabsChange
(
index
){
this
.
tabIndex
=
index
this
.
arr
=
[]
this
.
scrollRightTop
=
0
;
this
.
current
=
0
;
this
.
$nextTick
(
function
()
{
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
this
.
getMenuItemTop
()
})
},
locationCompleteItem
(
panelIndex
,
groupIndex
,
eleIndex
){
// 页面定位到某一项
this
.
tabIndex
=
panelIndex
this
.
arr
=
[]
this
.
scrollRightTop
=
0
;
this
.
current
=
0
;
this
.
current
=
groupIndex
;
this
.
itemId
=
''
this
.
$nextTick
(
function
()
{
this
.
swichMenu
(
groupIndex
)
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
})
},
// 提交订单
orderFinish
(){
let
self
=
this
let
pass
=
this
.
checkCompleteItem
()
if
(
!
pass
){
self
.
completeCheckStatus
=
true
}
else
{
// 先保存完工项
let
param
=
self
.
handleSaveData
()
self
.
$u
.
api
.
saveCompleteData
(
param
,
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
//完工项信息保存成功再次完工工单
console
.
log
(
"完工"
);
this
.
pass
=
pass
if
(
self
.
inGuaranteePeriod
===
'Y'
){
self
.
$u
.
api
.
inOrderFinish
(
self
.
orderId
).
then
((
res
)
=>
{
console
.
log
(
res
)
self
.
completeCheckStatus
=
true
})
}
else
{
self
.
$u
.
api
.
outOrderFinish
({
customerPayType
:
'CASH'
},
self
.
orderId
).
then
((
res
)
=>
{
console
.
log
(
res
)
self
.
completeCheckStatus
=
true
})
}
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
}
})
}
const
param
=
this
.
handleSaveData
()
this
.
$u
.
api
.
saveCompleteData
(
param
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
//完工项信息保存成功再次完工工单
if
(
this
.
inGuaranteePeriod
===
'Y'
){
this
.
$u
.
api
.
inOrderFinish
(
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'提交成功'
,
type
:
'success'
,
callback
:
()
=>
{
uni
.
reLaunch
({
url
:
'/pages/index/order?type=3'
})
}
})
}
})
}
else
{
this
.
$u
.
api
.
outOrderFinish
({
customerPayType
:
'CASH'
},
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'提交成功'
,
type
:
'success'
,
callback
:
()
=>
{
uni
.
reLaunch
({
url
:
'/pages/index/order?type=3'
})
}
})
}
})
}
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
}
})
},
calMaterialCraftListAmount
(
arr
){
let
amount
=
0
...
...
@@ -556,49 +640,34 @@
innerItem
=
groupItem
.
items
[
data
.
itemIndex
]
}
if
(
innerItem
.
fieldsType
===
'multiInput'
){
if
(
innerItem
.
fieldsType
===
'multiInput'
){
// 多个输入框的值触发
let
key
=
Object
.
keys
(
data
.
value
)[
0
]
this
.
form
[
key
]
=
data
.
value
[
key
]
}
else
{
this
.
$set
(
this
.
form
,
innerItem
.
fieldsName
,
data
.
value
)
}
if
(
innerItem
.
fieldsId
==
199
)
{
// 选不需要收款的时候,收款金额修改为非必选
for
(
var
list
of
this
.
list
)
{
// 同时修改基本信息和完工信息
for
(
var
item
of
list
.
items
)
{
for
(
var
i
of
item
.
items
)
{
if
(
i
.
fieldsId
==
200
)
{
i
.
required
=
data
.
value
!=
'03'
}
}
}
}
}
},
nextStep
()
{
if
(
this
.
tabIndex
<
this
.
list
.
length
-
1
)
{
this
.
tabIndex
++
this
.
arr
=
[]
this
.
scrollRightTop
=
0
this
.
current
=
0
this
.
leftMenuStatus
(
0
)
const
itemId
=
this
.
list
[
this
.
tabIndex
].
items
[
0
].
items
[
0
].
fieldsId
this
.
oldItemId
=
`item
${
itemId
}
`
this
.
$nextTick
(
async
()
=>
{
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
})
if
(
innerItem
.
fieldsId
===
199
)
{
// 选不需要收款的时候,收款金额修改为非必选
const
row
=
groupItem
.
items
.
find
(
v
=>
v
.
fieldsId
===
200
)
row
.
required
=
data
.
value
!=
'03'
}
if
(
innerItem
.
fieldsId
===
252
||
innerItem
.
fieldsId
===
253
)
{
// 申请费用计算
this
.
calcMoney
()
}
},
tabsChange
(
index
){
this
.
tabIndex
=
index
this
.
arr
=
[]
this
.
scrollRightTop
=
0
;
this
.
current
=
0
;
this
.
leftMenuStatus
(
0
)
this
.
$nextTick
(
function
()
{
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
this
.
getMenuItemTop
(
)
})
// 申请费用计算
calcMoney
()
{
const
price
=
parseInt
(
this
.
form
.
pipe
)
||
0
const
pipeUseLength
=
parseFloat
(
this
.
form
.
pipeUseLength
)
||
0
if
(
price
&&
pipeUseLength
)
{
const
money
=
(
price
*
pipeUseLength
).
toFixed
(
2
)
this
.
$set
(
this
.
form
,
'pipeAmount'
,
money
)
}
else
{
this
.
$set
(
this
.
form
,
'pipeAmount'
,
0
)
}
},
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
...
...
@@ -692,62 +761,16 @@
if
(
this
.
arr
.
length
==
0
)
{
await
this
.
getMenuItemTop
();
}
if
(
index
==
this
.
current
)
return
;
//
if (index == this.current) return;
this
.
scrollRightTop
=
this
.
oldScrollTop
;
this
.
$nextTick
(
function
()
{
this
.
itemId
=
this
.
oldItemId
if
(
!
this
.
oldItemId
)
this
.
scrollRightTop
=
this
.
arr
[
index
];
this
.
oldItemId
=
''
this
.
current
=
index
;
this
.
leftMenuStatus
(
index
);
})
},
// 获取一个目标元素的高度
getElRect
(
elClass
,
dataVal
)
{
new
Promise
((
resolve
,
reject
)
=>
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
query
.
select
(
'.'
+
elClass
).
fields
({
size
:
true
},
res
=>
{
// 如果节点尚未生成,res值为null,循环调用执行
if
(
!
res
)
{
setTimeout
(()
=>
{
this
.
getElRect
(
elClass
);
},
10
);
return
;
}
this
[
dataVal
]
=
res
.
height
;
resolve
();
}).
exec
();
setTimeout
(()
=>
{
// 没有指定滚动到某一小项,就滚动到大的项
this
.
scrollRightTop
=
this
.
arr
[
index
]
this
.
current
=
index
},
100
)
})
},
// 观测元素相交状态
async
observer
()
{
this
.
tabbar
.
map
((
val
,
index
)
=>
{
let
observer
=
uni
.
createIntersectionObserver
(
this
);
// 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
// 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
observer
.
relativeTo
(
'.right-box'
,
{
top
:
0
}).
observe
(
'#item'
+
index
,
res
=>
{
if
(
res
.
intersectionRatio
>
0
)
{
let
id
=
res
.
id
.
substring
(
4
);
this
.
leftMenuStatus
(
id
);
}
})
})
},
// 设置左边菜单的滚动状态
async
leftMenuStatus
(
index
)
{
this
.
current
=
index
;
// 如果为0,意味着尚未初始化
if
(
this
.
menuHeight
==
0
||
this
.
menuItemHeight
==
0
)
{
await
this
.
getElRect
(
'menu-scroll-view'
,
'menuHeight'
);
await
this
.
getElRect
(
'u-tab-item'
,
'menuItemHeight'
);
}
// 将菜单活动item垂直居中
this
.
scrollTop
=
index
*
this
.
menuItemHeight
+
this
.
menuItemHeight
/
2
-
this
.
menuHeight
/
2
;
},
// 获取右边菜单每个item到顶部的距离
getMenuItemTop
()
{
new
Promise
(
resolve
=>
{
...
...
@@ -768,7 +791,6 @@
}).
exec
()
})
},
// 右边菜单滚动
async
rightScroll
(
e
)
{
this
.
oldScrollTop
=
e
.
detail
.
scrollTop
;
...
...
@@ -776,19 +798,16 @@
await
this
.
getMenuItemTop
();
}
if
(
this
.
timer
)
return
;
if
(
!
this
.
menuHeight
)
{
await
this
.
getElRect
(
'menu-scroll-view'
,
'menuHeight'
);
}
this
.
timer
=
setTimeout
(()
=>
{
// 节流
this
.
timer
=
null
;
// scrollHeight为右边菜单垂直中点位置
let
scrollHeight
=
e
.
detail
.
scrollTop
+
this
.
menuHeight
/
2
;
let
scrollHeight
=
e
.
detail
.
scrollTop
for
(
let
i
=
0
;
i
<
this
.
arr
.
length
;
i
++
)
{
let
height1
=
this
.
arr
[
i
];
let
height2
=
this
.
arr
[
i
+
1
];
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
if
(
!
height2
||
scrollHeight
>=
height1
&&
scrollHeight
<
height2
)
{
this
.
leftMenuStatus
(
i
);
this
.
current
=
i
return
;
}
}
...
...
src/pages/order/detail.vue
View file @
d464455b
...
...
@@ -682,7 +682,7 @@
},
// 去业务材料页面
handleClickFile
()
{
this
.
$u
.
route
({
url
:
'pages/order/document'
})
this
.
$u
.
route
({
url
:
'pages/order/document'
+
'?partnerCompanyId='
+
this
.
order
.
partnerCompanyId
+
'&brandId='
+
this
.
order
.
lianbaoBrandId
})
},
trackOrder
()
{
// 接单成功事件,签到成功事件
...
...
@@ -722,6 +722,7 @@
+
"&inGuaranteePeriod="
+
this
.
order
.
inGuaranteePeriod
+
"&partnerCompanyId="
+
this
.
order
.
partnerCompanyId
+
'&partnerCompanyName='
+
this
.
order
.
partnerCompanyName
+
'&maintainStep='
+
this
.
order
.
maintainStep
})
},
rejectOrder
()
{
// 拒单
...
...
src/pages/order/document.vue
View file @
d464455b
<
template
>
<view
class=
"doc-wrap"
>
<u-navbar
title=
"安装文件"
:border-bottom=
"false"
/>
<view
class=
"filter"
>
<u-icon
class=
"filter-icon"
name=
"bag"
label=
"品牌"
label-size=
"24"
/>
<u-icon
class=
"filter-icon"
name=
"tags"
label=
"品类"
label-size=
"24"
/>
</view>
<view
class=
"content"
>
<view
class=
"title"
>
文件列表
</view>
<view
class=
"item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
class=
"item-left"
>
<u-icon
class=
"item-icon"
name=
"doc"
custom-prefix=
"wxh"
></u-icon>
<text
class=
"item-icon-txt"
>
P
</text>
<view
class=
"item-name"
>
{{
item
.
name
}}
</view>
<view
:class=
"['doc-wrap',
{'order-file': orderFile}]">
<u-navbar
back-icon-color=
"#333333"
background=
"#FFFFFF"
title=
"安装文件"
titleColor=
"#333333"
:border-bottom=
"false"
title-bold
></u-navbar>
<template
v-if=
"!orderFile"
>
<view
v-for=
"(item, key) in labels"
:key=
"key"
class=
"label-list"
>
<view
class=
"label-title"
>
<view>
{{
items
[
key
]
}}
</view>
<view
class=
"label-file-right"
>
<text
class=
"label-right-text"
>
更多
</text>
<u-icon
name=
"arrow-right"
></u-icon>
</view>
</view>
<view
class=
"label-content"
>
<view
v-for=
"(label, ind) in item"
:key=
"ind"
class=
"label-item"
>
<view
:class=
"['label-normal',
{'selected': label.id == selected[key].id}]"
@click="handleClick(key, label)">
{{
label
.
name
}}
</view>
</view>
</view>
</view>
</
template
>
<view
class=
"file-title"
>
文件列表
</view>
<view
class=
"file-list"
>
<view
class=
"file-row"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
class=
"file-left"
>
<view
class=
"file-name"
>
<u-icon
class=
"item-icon"
name=
"doc"
custom-prefix=
"wxh"
fontSize=
"52"
></u-icon>
<image
class=
"file-image"
:src=
"wenjianImage"
></image>
<view
class=
"file-format-text"
>
{{formatText(item.name)}}
</view>
</view>
<text>
{{item.name}}
</text>
</view>
<view
class=
"
item
-right"
>
<u-button
shape=
"circle"
:custom-style=
"shareBtn"
@
click=
"shareDocment(item)
"
>
分享
</u-button>
<u-button
shape=
"circle"
:custom-style=
"viewBtn"
@
click=
"openDocment(item)
"
>
查看
</u-button>
<view
class=
"
file
-right"
>
<u-button
:custom-style=
"shareStyle"
shape=
"circle"
@
click=
"handleShare
"
>
分享
</u-button>
<u-button
:custom-style=
"previewStyle"
shape=
"circle"
@
click=
"handlePreview
"
>
查看
</u-button>
</view>
</view>
<u-loadmore
:status=
"status"
margin-top=
"30"
/>
<u-gap
height=
"316"
/>
<view
class=
"loading-view"
v-if=
"loading"
>
<u-loading
mode=
"flower"
></u-loading>
</view>
<view
class=
"tip-view"
v-else-if=
"list.length <= 0"
>
{{tipText}}
</view>
</view>
</view>
</template>
<
script
>
let
now
=
Date
.
now
();
export
default
{
data
()
{
return
{
list
:
[],
status
:
'loadmore'
,
total
:
0
,
shareData
:
{
title
:
''
,
path
:
''
let
now
=
Date
.
now
()
export
default
{
data
()
{
return
{
list
:
[],
status
:
'loadmore'
,
total
:
0
,
firstLoad
:
true
,
labels
:
{
'1'
:
[],
// 合作商标签列表
'2'
:
[]
// 品牌标签列表
},
selected
:
{
'1'
:
{},
// 选中的合作商
'2'
:
{}
// 选中的品牌
},
loading
:
false
,
orderFile
:
false
,
shareStyle
:
{
marginRight
:
'10rpx'
,
width
:
'100rpx'
,
height
:
'52rpx'
,
background
:
'#FFFFFF'
,
color
:
'#2272FF'
,
fontSize
:
'24rpx'
,
fontWeight
:
'400'
,
lineHeight
:
'52rpx'
},
previewStyle
:
{
width
:
'100rpx'
,
height
:
'52rpx'
,
background
:
'#2272FF'
,
color
:
'#FFFFFF'
,
fontSize
:
'24rpx'
,
fontWeight
:
'400'
,
lineHeight
:
'52rpx'
},
};
},
computed
:
{
items
()
{
return
{
'1'
:
'合作商'
,
'2'
:
'品牌'
}
},
shareBtn
:
{
marginRight
:
'10rpx'
,
width
:
'100rpx'
,
height
:
'52rpx'
,
background
:
'#FFFFFF'
,
color
:
'#2272FF'
,
fontSize
:
'24rpx'
,
fontWeight
:
'400'
,
lineHeight
:
'52rpx'
shareStyle
()
{
return
{
'background-color'
:
'#FFFFFF'
,
'heigth'
:
'52rpx'
,
'width'
:
'100rpx'
,
'color'
:
'#2272FF'
,
'font-size'
:
'24rpx'
,
}
},
viewBtn
:
{
width
:
'100rpx'
,
height
:
'52rpx'
,
background
:
'#2272FF'
,
color
:
'#FFFFFF'
,
fontSize
:
'24rpx'
,
fontWeight
:
'400'
,
lineHeight
:
'52rpx'
previewStyle
()
{
return
{
'background-color'
:
'#2272FF'
,
'heigth'
:
'52rpx'
,
'width'
:
'100rpx'
,
'color'
:
'#FFFFFF'
,
'font-size'
:
'24rpx'
,
}
},
wenjianImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'wenjian-bk.png'
},
tipText
()
{
return
(
this
.
selected
[
'2'
].
name
||
this
.
orderFile
)
?
'暂无文件'
:
'请选择品牌'
}
};
},
onLoad
()
{
console
.
log
(
'onLoad==========='
);
this
.
loadDocuments
();
},
onShareAppMessage
(
res
)
{
console
.
log
(
"shareDocment2"
)
if
(
res
.
from
===
'button'
)
{
// 来自页面内分享按钮
console
.
log
(
res
.
target
);
}
console
.
log
(
res
.
target
);
return
{
title
:
this
.
shareData
.
title
,
path
:
this
.
shareData
.
path
};
},
onReachBottom
()
{
if
(
this
.
list
.
length
>=
this
.
total
)
return
;
console
.
log
(
'onReachBottom==========='
);
this
.
status
=
'loading'
;
this
.
loadDocuments
();
},
methods
:
{
loadDocuments
()
{
let
data
=
[
{
name
:
'挚达-广汽-勘察报告.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-增项收费标准表.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-安装报告.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-自营平台系统相关的免责协议.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
,
'空调'
,
'自营平台'
]
},
{
name
:
'挚达-广汽-报装声明.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-勘察报告.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-增项收费标准表.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-安装报告.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-自营平台系统相关的免责协议.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
,
'空调'
,
'自营平台'
]
},
{
name
:
'挚达-广汽-报装声明.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-勘察报告.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-增项收费标准表.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-安装报告.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-自营平台系统相关的免责协议.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
,
'空调'
,
'自营平台'
]
},
{
name
:
'挚达-广汽-报装声明.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-勘察报告.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-增项收费标准表.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-安装报告.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
},
{
name
:
'挚达-广汽-自营平台系统相关的免责协议.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
,
'空调'
,
'自营平台'
]
},
{
name
:
'挚达-广汽-报装声明.PDF'
,
url
:
''
,
time
:
now
,
from
:
[
'挚达'
,
'充电桩'
]
}
];
this
.
total
=
100
;
let
newList
=
this
.
$u
.
deepMerge
(
this
.
list
,
data
);
this
.
list
=
newList
;
console
.
log
(
'loadDocuments==========='
);
if
(
newList
.
length
>=
this
.
total
)
this
.
status
=
'nomore'
;
else
this
.
status
=
'loadmore'
;
},
/**
* 分享文件
* @param {Object} doc
*/
async
shareDocment
(
doc
)
{
},
/**
* 浏览文件
* @param {Object} doc
*/
openDocment
(
doc
)
{
onLoad
(
e
)
{
if
(
e
.
partnerCompanyId
&&
e
.
brandId
)
{
this
.
orderFile
=
true
this
.
loadFileList
(
e
.
partnerCompanyId
,
e
.
brandId
)
}
else
{
this
.
loadFileLabel
(
'1'
)
}
},
}
};
methods
:
{
handleClick
(
key
,
label
)
{
this
.
selected
[
key
]
=
label
if
(
key
==
'1'
)
{
this
.
selected
[
'2'
]
=
{}
this
.
list
=
[]
this
.
loadFileLabel
(
'2'
,
label
.
id
)
}
else
{
this
.
loadFileList
(
this
.
selected
[
'1'
].
id
,
this
.
selected
[
'2'
].
id
)
}
},
handleShare
()
{
},
handlePreview
()
{
},
async
loadFileLabel
(
type
,
partnerCompanyId
)
{
let
param
=
{
type
:
type
,
// 1:合作商标签,2:品牌标签
}
if
(
type
==
'2'
)
{
param
.
partnerCompanyId
=
partnerCompanyId
// 合作商的标签id
}
let
res
=
await
this
.
$u
.
api
.
fileLabel
(
param
)
if
(
res
&&
res
.
code
==
200
)
{
this
.
labels
[
type
]
=
res
.
data
||
[]
console
.
log
(
this
.
labels
)
if
(
this
.
firstLoad
&&
type
==
'1'
)
{
// 第一次额外加载第一个合作商的品牌标签
this
.
firstLoad
=
false
if
(
this
.
labels
[
type
].
length
>
0
)
{
this
.
selected
[
type
]
=
this
.
labels
[
type
][
0
]
this
.
loadFileLabel
(
'2'
,
this
.
selected
[
type
].
id
)
}
}
}
},
async
loadFileList
(
partnerCompanyId
,
brandId
)
{
this
.
loading
=
true
let
res
=
await
this
.
$u
.
api
.
fileList
({
partnerCompanyId
:
partnerCompanyId
,
// 合作商标签
brandId
:
brandId
// 品牌标签
})
this
.
loading
=
false
if
(
res
&&
res
.
code
==
200
)
{
console
.
log
(
res
.
data
)
this
.
list
=
res
.
data
||
[]
}
},
formatText
(
name
)
{
let
arr
=
name
.
split
(
'.'
)
let
item
=
arr
.
pop
()
return
item
.
substr
(
0
,
1
)
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.doc-wrap
{
background-color
:
#f4f5f7
;
.filter
{
padding-left
:
30rpx
;
height
:
60rpx
;
line-height
:
60rpx
;
z-index
:
2
;
.filter-icon
{
margin-right
:
60rpx
;
.doc-wrap
{
background-color
:
#F4F5F7
;
height
:
100vh
;
display
:
flex
;
flex-direction
:
column
;
&
.order-file
{
background-color
:
#FFFFFF
;
}
}
.content
{
background
:
#ffffff
;
border-radius
:
32rpx
32rpx
0px
0px
;
.title
{
padding
:
30rpx
30rpx
15rpx
30rpx
;
height
:
77rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
.label-list
{
padding
:
0
0
40rpx
30rpx
;
.label-title
{
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
margin-bottom
:
30rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.label-file-right
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
color
:
#2272FF
;
font-size
:
26rpx
;
padding-right
:
30rpx
;
.label-right-text
{
font-weight
:
400
;
}
}
}
.label-content
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
overflow-x
:
auto
;
.label-item
{
padding-right
:
20rpx
;
flex-shrink
:
0
;
.label-normal
{
height
:
60rpx
;
font-size
:
26rpx
;
color
:
#666666
;
background-color
:
#FFFFFF
;
border-radius
:
8rpx
;
padding-left
:
30rpx
;
padding-right
:
30rpx
;
text-align
:
center
;
line-height
:
60rpx
;
&
.selected
{
color
:
#FFFFFF
;
background-color
:
#2272FF
;
}
}
}
}
}
.item
{
margin
:
0
30rpx
;
flex-basis
:
calc
(
100%
);
align-items
:
center
;
min-height
:
102rpx
;
}
.file-title
{
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
padding
:
20rpx
30rpx
;
border-radius
:
32rpx
;
background-color
:
#FFFFFF
;
// margin-top: 10rpx;
}
.file-list
{
padding
:
0
30rpx
;
height
:
100%
;
overflow
:
auto
;
background-color
:
#FFFFFF
;
.file-row
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.item-left
{
margin-top
:
10rpx
;
margin-bottom
:
50rpx
;
.file-left
{
display
:
flex
;
align-items
:
center
;
.item-icon
{
margin-right
:
20rpx
;
font-size
:
52rpx
;
color
:
#2272ff
;
}
.item-icon-txt
{
position
:
absolute
;
width
:
52rpx
;
height
:
52rpx
;
text-align
:
center
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
line-height
:
52rpx
;
}
.item-title
{
width
:
52rpx
;
height
:
52rpx
;
background
:
#2272ff
;
border-radius
:
8rpx
25rpx
8rpx
8rpx
;
}
.item-name
{
word-break
:
break-all
;
max-width
:
380rpx
;
font-size
:
26rpx
;
font-weight
:
400
;
color
:
#333333
;
color
:
#333333
;
font-size
:
26rpx
;
.file-name
{
position
:
relative
;
.file-format-text
{
position
:
absolute
;
width
:
52rpx
;
height
:
52rpx
;
text-align
:
center
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
line-height
:
52rpx
;
margin-right
:
20rpx
;
}
}
}
.item-right
{
.file-right
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
.button-class
{
margin-left
:
10rpx
;
}
}
}
.tip-view
{
color
:
#999999
;
width
:
100%
;
margin-top
:
200rpx
;
text-align
:
center
;
}
.loading-view
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
margin-top
:
200rpx
;
}
}
}
</
style
>
src/pages/photo/list.vue
View file @
d464455b
...
...
@@ -246,16 +246,17 @@
},
async
closeTake
(
img
)
{
if
(
img
!==
undefined
){
// 复制一份 用于保存
if
(
!
this
.
currentItemDate
.
orderImages
)
this
.
currentItemDate
.
orderImages
=
[]
let
saveList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
currentItemDate
.
orderImages
))
const
files
=
img
.
map
(
v
=>
v
.
path
)
const
value
=
await
this
.
saveToTask
(
files
)
if
(
!
this
.
currentItemDate
.
orderImages
)
this
.
currentItemDate
.
orderImages
=
[]
// 复制一份 用于保存
let
saveList
=
this
.
currentItemDate
.
orderImages
.
concat
();
value
.
map
(
item
=>
{
// step1 添加缓存图片 到显示
this
.
currentItemDate
.
orderImages
.
push
(
item
.
path
)
// 文件key添加保存数组中
saveList
.
push
(
item
.
key
)
// step1 添加缓存图片 到显示
this
.
currentItemDate
.
orderImages
.
push
(
item
.
path
)
})
// step2 保存图片
var
data
=
{
...
...
@@ -263,6 +264,7 @@
images
:
Array
.
from
(
saveList
),
fieldsName
:
this
.
currentItemDate
.
fieldName
}
console
.
log
(
"data"
,
data
)
this
.
$u
.
api
.
saveImage
(
data
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
}
else
{
...
...
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