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
c6e402fe
Commit
c6e402fe
authored
Jun 10, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理措施接口更改
parent
07e3182b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
208 additions
and
190 deletions
+208
-190
order.js
src/common/api/order.js
+2
-0
XhServiceMeasure.vue
src/components/createCom/XhServiceMeasure.vue
+206
-190
No files found.
src/common/api/order.js
View file @
c6e402fe
...
@@ -128,6 +128,7 @@ let orderApiFun = function(vm){
...
@@ -128,6 +128,7 @@ let orderApiFun = function(vm){
* 查询措施
* 查询措施
*/
*/
let
getMeasure
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'wxh-worker-rest/rest/service/'
+
vm
.
vuex_token
+
'/measure/queryMeasureItems'
,
params
);
let
getMeasure
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'wxh-worker-rest/rest/service/'
+
vm
.
vuex_token
+
'/measure/queryMeasureItems'
,
params
);
let
getMeasureV2
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'wxh-worker-rest/rest/service/'
+
vm
.
vuex_token
+
'/measure/queryMeasureItems/V2'
,
params
);
/**
/**
* 查询工单材信息
* 查询工单材信息
...
@@ -208,6 +209,7 @@ let orderApiFun = function(vm){
...
@@ -208,6 +209,7 @@ let orderApiFun = function(vm){
getSignDistance
,
getSignDistance
,
getCompleteConfigAndData
,
getCompleteConfigAndData
,
getMeasure
,
getMeasure
,
getMeasureV2
,
getOrderMaterial
,
getOrderMaterial
,
saveCompleteData
,
saveCompleteData
,
inOrderFinish
,
inOrderFinish
,
...
...
src/components/createCom/XhServiceMeasure.vue
View file @
c6e402fe
<!-- ******************* 单级/多级 选择 ******************* -->
<!-- ******************* 单级/多级 选择 ******************* -->
<
template
>
<
template
>
<view
class=
"picker-box"
:style=
"
{'width': fieldsWidth
}">
<view
class=
"picker-box"
:style=
"
{ width: fieldsWidth
}">
<!--
<view
class=
"u-flex u-row-between text-view"
@
click=
"openPicker"
>
<!--
<view
class=
"u-flex u-row-between text-view"
@
click=
"openPicker"
>
<view
class=
"txt u-flex-1 text-title"
>
{{
text
||
''
}}
</view>
<view
class=
"txt u-flex-1 text-title"
>
{{
text
||
''
}}
</view>
<u-icon
class=
"input-icon"
color=
"#2272FF"
:name=
"showPicker ? 'arrow-up' : 'arrow-down'"
></u-icon>
<u-icon
class=
"input-icon"
color=
"#2272FF"
:name=
"showPicker ? 'arrow-up' : 'arrow-down'"
></u-icon>
</view>
</view>
<u-picker
v-model=
"showPicker"
range-key=
"label"
@
columnchange=
"columnchange"
:mode=
"isNotMulti?'selector':'multiSelector'"
@
confirm=
"pickerConfirm"
:range=
"settings"
></u-picker>
-->
<u-picker
v-model=
"showPicker"
range-key=
"label"
@
columnchange=
"columnchange"
:mode=
"isNotMulti?'selector':'multiSelector'"
@
confirm=
"pickerConfirm"
:range=
"settings"
></u-picker>
-->
<view
class=
"u-flex u-row-between picker-common"
>
<view
class=
"u-flex u-row-between picker-common"
>
<picker
:mode=
"isNotMulti?'selector':'multiSelector'"
:value=
"index"
range-key=
"label"
:range=
"settings"
@
click=
"showPicker = true"
@
change=
"pickerChange"
class=
"txt u-flex-1"
>
<picker
<view>
{{
text
||
'请选择'
}}
</view>
:mode=
"isNotMulti ? 'selector' : 'multiSelector'"
:value=
"index"
range-key=
"label"
:range=
"settings"
@
click=
"showPicker = true"
@
change=
"pickerChange"
class=
"txt u-flex-1"
>
<view>
{{
text
||
"请选择"
}}
</view>
</picker>
</picker>
<u-icon
class=
"input-icon"
color=
"#2272FF"
:name=
"showPicker ? 'arrow-up' : 'arrow-down'"
></u-icon>
<u-icon
class=
"input-icon"
color=
"#2272FF"
:name=
"showPicker ? 'arrow-up' : 'arrow-down'"
></u-icon>
</view>
</view>
<!-- :default-selector='[0, 1]' -->
<!-- :default-selector='[0, 1]' -->
<u-toast
ref=
"uToast"
/>
<u-toast
ref=
"uToast"
/>
...
@@ -18,9 +30,9 @@
...
@@ -18,9 +30,9 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
objMixin
from
'./objMixin'
import
objMixin
from
"./objMixin"
;
export
default
{
export
default
{
name
:
'XhPicker'
,
name
:
"XhPicker"
,
components
:
{},
components
:
{},
mixins
:
[
objMixin
],
mixins
:
[
objMixin
],
props
:
{
props
:
{
...
@@ -29,113 +41,115 @@
...
@@ -29,113 +41,115 @@
type
:
Array
,
type
:
Array
,
default
()
{
default
()
{
return
[
0
];
return
[
0
];
}
},
},
},
// 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容
// 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容
rangeKey
:
{
rangeKey
:
{
type
:
String
,
type
:
String
,
default
:
'label'
default
:
"label"
,
},
},
value
:
{
value
:
{
type
:
String
,
type
:
String
,
default
:
'{}'
default
:
"{}"
,
},
},
orderId
:
{
orderId
:
{
type
:
Number
,
type
:
Number
,
default
:
0
default
:
0
,
},
},
categoryId
:
{
categoryId
:
{
type
:
Number
,
type
:
Number
,
default
:
0
default
:
0
,
},
},
specificationId
:
{
specificationId
:
{
type
:
String
,
type
:
String
,
default
:
'0'
default
:
"0"
,
},
},
orderServiceType
:
{
orderServiceType
:
{
type
:
String
,
type
:
String
,
default
:
'安装'
default
:
"安装"
,
},
},
},
},
filters
:
{},
filters
:
{},
data
()
{
data
()
{
return
{
return
{
isNotMulti
:
true
,
isNotMulti
:
true
,
showPicker
:
false
,
showPicker
:
false
,
settings
:
[],
settings
:
[],
measure
:
[],
measure
:
[],
index
:
''
index
:
""
,
}
};
},
},
computed
:
{
computed
:
{
text
()
{
text
()
{
let
val
=
''
let
val
=
""
;
if
(
this
.
value
)
{
if
(
this
.
value
)
{
let
data
=
JSON
.
parse
(
this
.
value
);
let
data
=
JSON
.
parse
(
this
.
value
);
val
=
data
[
0
].
measureTypeName
+
"-"
+
data
[
0
].
measureName
val
=
data
[
0
].
measureTypeName
+
"-"
+
data
[
0
].
measureName
;
}
}
return
val
return
val
;
},
},
fieldsWidth
()
{
fieldsWidth
()
{
return
this
.
item
.
fieldsWidth
?
(
this
.
item
.
fieldsWidth
+
'rpx'
)
:
'100%'
return
this
.
item
.
fieldsWidth
?
this
.
item
.
fieldsWidth
+
"rpx"
:
"100%"
;
},
},
},
},
watch
:
{
watch
:
{
specificationId
(
val
,
oldVal
)
{
specificationId
(
val
,
oldVal
)
{
this
.
initComponent
()
this
.
initComponent
();
},
},
},
},
mounted
()
{
mounted
()
{
this
.
isNotMulti
=
this
.
orderServiceType
===
'安装'
this
.
isNotMulti
=
this
.
orderServiceType
===
"安装"
;
this
.
initComponent
()
this
.
initComponent
();
},
},
methods
:
{
methods
:
{
openPicker
()
{
openPicker
()
{
if
(
this
.
specificationId
===
'0'
)
{
if
(
this
.
specificationId
===
"0"
)
{
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
'请先选择规格'
,
title
:
"请先选择规格"
,
type
:
'error'
type
:
"error"
,
})
});
return
return
;
}
}
this
.
showPicker
=
true
this
.
showPicker
=
true
;
},
},
initComponent
()
{
initComponent
()
{
if
(
this
.
isNotMulti
)
{
if
(
this
.
isNotMulti
)
{
this
.
initMeasure
()
this
.
initMeasure
();
}
else
{
}
else
{
this
.
initSymptoms
()
this
.
initSymptoms
();
}
}
},
},
initSymptoms
(){
// 初始化现象
initSymptoms
()
{
// 初始化现象
},
},
initCause
(){
// 初始化原因
initCause
()
{
// 初始化原因
},
},
initMeasure
(){
// 初始化措施
initMeasure
()
{
let
self
=
this
// 初始化措施
if
(
self
.
orderId
)
{
if
(
this
.
orderId
)
{
let
param
=
{
let
param
=
{
orderId
:
self
.
orderId
,
orderId
:
this
.
orderId
,
categoryId
:
self
.
categoryId
,
categoryId
:
this
.
categoryId
,
specificationId
:
self
.
specificationId
,
specificationId
:
this
.
specificationId
,
orderServiceTypeText
:
self
.
orderServiceType
orderServiceTypeText
:
this
.
orderServiceType
,
}
};
self
.
$u
.
api
.
getMeasure
(
param
).
then
((
res
)
=>
{
this
.
$u
.
api
.
getMeasureV2
(
param
).
then
(
res
=>
{
console
.
log
(
"res"
,
res
)
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
let
result
=
[]
let
result
=
[];
for
(
let
key
in
res
.
data
)
{
for
(
let
key
in
res
.
data
)
{
self
.
measure
=
res
.
data
[
key
].
measureExtendDtos
this
.
measure
=
res
.
data
[
key
].
measureExtendDtos
;
res
.
data
[
key
].
measureExtendDtos
.
map
((
item
,
index
)
=>
{
res
.
data
[
key
].
measureExtendDtos
.
map
((
item
,
index
)
=>
{
result
.
push
({
"id"
:
item
.
measureId
,
"label"
:
item
.
measureName
})
result
.
push
({
id
:
item
.
measureId
,
label
:
item
.
measureName
});
})
});
}
}
if
(
self
.
orderServiceType
===
'安装'
)
{
if
(
this
.
orderServiceType
===
"安装"
)
{
self
.
settings
=
result
this
.
settings
=
result
;
}
else
{
}
else
{
self
.
settings
[
2
]
=
result
this
.
settings
[
2
]
=
result
;
}
}
console
.
log
(
"this.settings"
,
this
.
settings
)
}
else
{
}
else
{
console
.
log
(
res
.
message
,
"查询措施失败"
);
console
.
log
(
res
.
message
,
"查询措施失败"
);
}
}
...
@@ -143,40 +157,42 @@
...
@@ -143,40 +157,42 @@
}
}
},
},
pickerConfirm
(
data
){
pickerConfirm
(
data
)
{
let
result
=
[]
let
result
=
[];
if
(
this
.
isMulti
){
// 维修
if
(
this
.
isMulti
)
{
// 维修
}
else
{
// 安装
}
else
{
result
.
push
(
this
.
measure
[
data
[
0
]])
// 安装
result
.
push
(
this
.
measure
[
data
[
0
]]);
}
}
this
.
valueChange
(
JSON
.
stringify
(
result
))
this
.
valueChange
(
JSON
.
stringify
(
result
));
},
},
pickerChange
(
data
)
{
pickerChange
(
data
)
{
this
.
showPicker
=
false
this
.
showPicker
=
false
;
this
.
index
=
data
.
detail
.
value
this
.
index
=
data
.
detail
.
value
;
let
result
=
[]
if
(
this
.
isMulti
){
// 维修
}
else
{
// 安装
let
result
=
[];
result
.
push
(
this
.
measure
[
this
.
index
])
if
(
this
.
isMulti
)
{
// 维修
}
else
{
// 安装
result
.
push
(
this
.
measure
[
this
.
index
]);
}
}
this
.
valueChange
(
JSON
.
stringify
(
result
))
this
.
valueChange
(
JSON
.
stringify
(
result
));
},
},
columnchange
(
data
)
{
columnchange
(
data
)
{
// // 树列改变时进行联动操作
// // 树列改变时进行联动操作
// const {column ,index} = data
// const {column ,index} = data
// let arr = [9,10,50]
// let arr = [9,10,50]
// this.settings.splice(column+1,1,arr)
// this.settings.splice(column+1,1,arr)
},
},
}
},
}
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.picker-common
{
.picker-common
{
min-height
:
35px
;
min-height
:
35px
;
background-color
:
#F4F5F
7
;
background-color
:
#f4f5f
7
;
border-radius
:
6px
;
border-radius
:
6px
;
color
:
#333333
;
color
:
#333333
;
padding-left
:
10px
;
padding-left
:
10px
;
...
@@ -191,7 +207,7 @@
...
@@ -191,7 +207,7 @@
}
}
}
}
.text-view
{
.text-view
{
background-color
:
#F4F5F
7
;
background-color
:
#f4f5f
7
;
border-radius
:
12rpx
;
border-radius
:
12rpx
;
padding-left
:
20rpx
;
padding-left
:
20rpx
;
padding-right
:
20rpx
;
padding-right
:
20rpx
;
...
...
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