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
fa906c14
Commit
fa906c14
authored
Jun 24, 2021
by
Morson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 申请配件接口对接
parent
65d8b0e4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
262 additions
and
35 deletions
+262
-35
parts.js
src/common/api/parts.js
+11
-1
pages.json
src/pages.json
+10
-1
addSite.vue
src/pages/mine/address/addSite.vue
+2
-2
index.vue
src/pages/mine/address/index.vue
+17
-2
application.vue
src/pages/parts/application.vue
+76
-29
nodes.vue
src/pages/parts/nodes.vue
+146
-0
No files found.
src/common/api/parts.js
View file @
fa906c14
...
...
@@ -9,6 +9,10 @@ let partsApiFun = function(vm){
* 配件申请单-查询网点地址信息
*/
let
getSiteAddress
=
async
()
=>
await
vm
.
$u
.
get
(
coverage
+
vm
.
vuex_token
+
'/getSiteAddress'
);
/**
* 配件申请单-修改网点地址信息
*/
let
updateAddress
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
coverage
+
vm
.
vuex_token
+
'/updateSiteAddress'
,
params
);
/**
* 配件过滤-品类列表
*/
...
...
@@ -21,12 +25,18 @@ let partsApiFun = function(vm){
* 查询配件列表
*/
let
getPartsList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/parts'
,
params
);
/**
* 配件申请单-创建申请单/使用备件
*/
let
applyParts
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
parts
+
vm
.
vuex_token
+
'/orders'
,
params
)
const
partsApi
=
{
getSiteAddress
,
updateAddress
,
getCategoryList
,
getBrandList
,
getPartsList
getPartsList
,
applyParts
}
return
partsApi
}
...
...
src/pages.json
View file @
fa906c14
...
...
@@ -518,7 +518,16 @@
"navigationBarTitleText"
:
"配件选择"
}
}
]
,{
"path"
:
"nodes"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"enablePullDownRefresh"
:
false
}
}
]
}
],
"preloadRule"
:
{
...
...
src/pages/mine/address/addSite.vue
View file @
fa906c14
...
...
@@ -29,7 +29,8 @@
></u-field>
</view>
<view
class=
"bottom"
>
<button
class=
"btn, bottom-btn"
@
click=
"show = true"
><text
class=
"button-text"
>
保存
</text></button>
<button
class=
"btn, bottom-btn"
v-if=
"siteType=='select'"
@
click=
"$u.throttle(commitSite, 500)"
><text
class=
"button-text"
>
提交
</text></button>
<button
class=
"btn, bottom-btn"
v-else
@
click=
"show = true"
><text
class=
"button-text"
>
保存
</text></button>
<!--
<view
class=
"default"
>
<view
class=
"left"
>
<view
class=
"set"
>
设置默认地址
</view>
...
...
@@ -101,7 +102,6 @@ export default {
if
(
!
this
.
vuex_token
)
{
this
.
$u
.
route
({
url
:
'pages/login/index'
});
}
debugger
if
(
e
)
{
if
(
e
.
type
===
'add'
)
{
this
.
title
=
'新增地址'
;
...
...
src/pages/mine/address/index.vue
View file @
fa906c14
...
...
@@ -2,7 +2,7 @@
<view
class=
"address-wrap"
>
<w-navbar
title=
"收货地址"
></w-navbar>
<view
class=
"body"
v-if=
"hasAdderss"
>
<w-address
@
editSite=
"toAddSite"
:info=
"address"
:is-default=
"true"
/>
<w-address
@
editSite=
"toAddSite"
:info=
"address
Info
"
:is-default=
"true"
/>
</view>
</view>
</
template
>
...
...
@@ -15,6 +15,8 @@ export default {
background
:
{
backgroundColor
:
'none'
},
address
:
''
,
region
:
[],
siteList
:
[]
};
},
...
...
@@ -28,7 +30,7 @@ export default {
hasAdderss
()
{
return
this
.
settled
&&
this
.
settled
.
address
&&
this
.
settled
.
id_card_name
},
address
()
{
address
Info
()
{
return
{
name
:
this
.
settled
.
id_card_name
||
this
.
settled
.
nickname
||
this
.
settled
.
name
,
mobile
:
this
.
settled
.
mobile
,
...
...
@@ -50,6 +52,19 @@ export default {
getData
()
{
let
self
=
this
app
.
getBaseInfo
(
self
);
this
.
getMineSite
()
},
getMineSite
()
{
this
.
$u
.
api
.
getSiteAddress
().
then
((
res
)
=>
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
this
.
address
=
res
.
data
.
address
this
.
region
=
[
res
.
data
.
provinceName
,
res
.
data
.
cityName
,
res
.
data
.
districtName
]
}
})
},
toAddSite
(
title
){
this
.
$u
.
route
({
...
...
src/pages/parts/application.vue
View file @
fa906c14
...
...
@@ -30,7 +30,7 @@
</view>
<view
class=
"card address"
>
<view
class=
"title"
>
收件信息
</view>
<view
class=
"subsection
u-flex u-row-center
"
>
<view
class=
"subsection"
>
<u-subsection
:list=
"siteTypes"
:current=
"curType"
:bold=
"false"
font-size=
"26"
height=
"76"
...
...
@@ -45,7 +45,7 @@
</view>
</view>
<view
class=
"bottom"
>
<u-button
shape=
"circle"
:disabled=
"
disabled"
:hair-line=
"false"
:custom-style=
"customStyle"
hover-class=
"none
"
>
提交
</u-button>
<u-button
shape=
"circle"
:disabled=
"
isEmptyParts"
:hair-line=
"false"
:custom-style=
"customStyle"
hover-class=
"none"
@
click=
"submitParts
"
>
提交
</u-button>
</view>
</view>
</
template
>
...
...
@@ -59,6 +59,7 @@ export default {
data
()
{
return
{
orderId
:
0
,
applyType
:
0
,
order
:
{},
parts
:
[],
disabled
:
false
,
...
...
@@ -93,16 +94,21 @@ export default {
},
onLoad
(
e
)
{
this
.
orderId
=
e
&&
Number
(
e
.
orderId
)
||
0
this
.
applyType
=
e
&&
Number
(
e
.
applyType
)
||
0
this
.
initData
()
},
methods
:
{
initData
()
{
this
.
loadMineAddress
()
this
.
loadOrderInfo
()
this
.
parts
=
[
{
name
:
'正泰漏保'
,
num
:
2
},
{
name
:
'电缆VJV3*10'
,
num
:
1
},
{
name
:
'挚达系统广汽充电桩'
,
num
:
0
},
{
name
:
'空开盒子'
,
num
:
100
}
]
},
loadMineAddress
()
{
this
.
mine
.
address
=
"广东省深圳市宝安区宝城67区留芳路6号庭威产业园3栋10C"
this
.
mine
.
region
=
[
'广东省'
,
'深圳市'
,
'宝安区'
]
this
.
$u
.
api
.
getSiteAddress
().
then
((
res
)
=>
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
this
.
mine
.
address
=
res
.
data
.
address
...
...
@@ -144,22 +150,9 @@ export default {
mobile
:
this
.
order
.
contactPhone
,
address
:
address
,
region
:
region
,
code
:
[
this
.
order
.
contactProvince
,
this
.
order
.
contactCity
,
this
.
order
.
contactCommunity
,
]
}
}
},
loadParts
()
{
this
.
parts
=
[
{
name
:
'正泰漏保'
,
num
:
2
},
{
name
:
'电缆VJV3*10'
,
num
:
1
},
{
name
:
'挚达系统广汽充电桩'
,
num
:
0
},
{
name
:
'空开盒子'
,
num
:
100
}
]
},
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
...
...
@@ -178,9 +171,7 @@ export default {
mobile
:
this
.
addressInfo
.
mobile
,
address
:
address
,
region
:
this
.
addressInfo
.
region
.
join
(
'-'
),
code
:
this
.
addressInfo
.
code
&&
this
.
addressInfo
.
code
.
join
(
'-'
),
};
console
.
log
(
"editSite"
,
params
)
this
.
$u
.
route
({
url
:
"pages/mine/address/addSite"
,
params
:
params
...
...
@@ -198,6 +189,60 @@ export default {
url
:
"pages/parts/addParts"
})
},
updateParts
(
parts
)
{
if
(
this
.
$u
.
test
.
isEmpty
(
parts
))
{
this
.
parts
=
[]
}
else
{
this
.
parts
=
parts
}
},
/**
* workOrderId 工单ID,保内申请时必须指定
* applyType 申请类型:0 保内,1 备件,2 购买,10 使用备件
* remark 申请备注
* parts 申请的配件明细,JSON 格式,指定多条要申请的配件信息,
* 数组中的每个对象需要 part_id(配件ID)和 quantity(申请数量)两个字段。
* 如果没有选择明细,请保持空。此时必须填写备注
* barcode 产品条码
* measures 服务措施
* name 收件人姓名
* phoneNumber 收件人电话号码
* province 收件地址:省
* city 收件地址:市
* district 收件地址:区
* street 收件地址:街道
* address 收件详细地址
* images 申请图片文件、可以传多张
*/
submitParts
()
{
const
address
=
this
.
addressInfo
let
params
=
{
workOrderId
:
orderId
,
applyType
:
this
.
applyType
,
remark
:
this
.
remark
,
parts
:
JSON
.
stringty
(
parts
),
barcode
:
this
.
order
.
barcode
,
measures
:
this
.
order
.
measures
,
name
:
address
.
name
,
phoneNumber
:
address
.
mobile
,
province
:
address
.
region
[
0
],
city
:
address
.
region
[
1
],
district
:
address
.
region
[
2
],
address
:
address
.
address
,
}
this
.
$u
.
api
.
applyParts
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$u
.
route
({
url
:
"pages/parts/nodes"
})
}
else
{
console
.
log
(
res
.
message
,
"配件申请失败!"
);
}
});
this
.
$u
.
route
({
url
:
"pages/parts/nodes"
})
}
}
};
</
script
>
...
...
@@ -259,20 +304,18 @@ export default {
}
.address
{
.subsection
{
padding-top
:
-6rpx
;
padding-bottom
:
34rpx
;
border-bottom
:
2rpx
solid
#F4F5F7
;
// /deep/ .u-subsection {
// width: 372rpx;
// .u-item-bg {
// border-radius: 32rpx !important;
// }
// }
margin
:
-6rpx
0
34rpx
0
;
padding
:
0
129rpx
;
/
deep
/
.u-subsection
{
.u-item-bg
{
border-radius
:
32rpx
!
important
;
}
}
}
.body
{
border-top
:
2rpx
solid
#F4F5F7
;
padding-top
:
10rpx
;
padding-bottom
:
52rpx
;
}
}
}
...
...
@@ -281,6 +324,10 @@ export default {
left
:
76rpx
;
right
:
76rpx
;
bottom
:
68rpx
;
/
deep
/
button
[
disabled
]
:not
([
type
])
{
background-color
:
#D1D4D4
!
important
;
}
}
}
</
style
>
src/pages/parts/nodes.vue
0 → 100644
View file @
fa906c14
<
template
>
<view
class=
"u-flex-col u-col-center node-wrap"
>
<u-gap
height=
"200"
></u-gap>
<u-image
width=
"224rpx"
height=
"224rpx"
:src=
"qnFile(nodeInfo.icon)"
></u-image>
<view
class=
"title"
>
{{
nodeInfo
.
title
}}
</view>
<view
v-show=
"isReturn"
class=
"return"
>
<u-divider
color=
"#F4F5F7"
half-width=
"345"
margin-top=
"30"
:use-slot=
"false"
></u-divider>
<view
class=
"return-title u-text-center"
>
返件编号
</view>
<view
class=
"u-flex u-row-between return-row"
>
<view
class=
"return-no"
>
{{
returnNo
}}
</view>
<view
class=
"vertical-bar"
></view>
<button
class=
"copy-btn"
@
tap=
"copyText"
:data-text=
"returnNo"
>
复制
</button>
</view>
</view>
<view
class=
"message"
>
{{
nodeInfo
.
message
}}
</view>
<u-gap
v-show=
"isParts"
height=
"192"
></u-gap>
<u-gap
v-show=
"isReturn"
height=
"160"
></u-gap>
<button
class=
"back-btn"
@
click=
"goBack"
>
{{
nodeInfo
.
btnTxt
}}
</button>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
curType
:
0
,
returnNo
:
'RT20210610000001'
,
nodes
:
[
{
type
:
'parts'
,
icon
:
'successful.png'
,
title
:
'您的配件申请已提交成功'
,
message
:
'工作人员正在加紧审核中'
,
btnTxt
:
'我知道了'
},
{
type
:
'return'
,
icon
:
'successful.png'
,
title
:
'您的返件信息已提交成功'
,
message
:
'请将返件编号复制发给唯修汇对接人'
,
btnTxt
:
'我知道了'
}
]
}
},
computed
:
{
nodeInfo
()
{
return
this
.
nodes
[
this
.
curType
]
},
isReturn
()
{
return
this
.
nodes
[
this
.
curType
].
type
==
'return'
},
isParts
()
{
return
this
.
nodes
[
this
.
curType
].
type
==
'parts'
}
},
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
goBack
()
{
this
.
$u
.
route
({
type
:
'back'
})
},
copyText
(
e
)
{
console
.
log
(
e
)
uni
.
setClipboardData
({
data
:
e
.
currentTarget
.
dataset
.
text
,
success
:
function
(
res
)
{
uni
.
getClipboardData
({
success
:
function
(
res
)
{
uni
.
showToast
({
title
:
'复制成功'
})
}
})
}
})
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.node-wrap
{
width
:
750rpx
;
height
:
100vh
;
overflow
:
auto
;
background-color
:
#FFFFFF
;
.title
{
font-size
:
40rpx
;
font-weight
:
bold
;
color
:
#2272FF
;
line-height
:
40rpx
;
margin-bottom
:
30rpx
;
}
.return
{
.return-title
{
margin-top
:
60rpx
;
font-size
:
40rpx
;
font-weight
:
bold
;
color
:
#333333
;
}
.return-row
{
margin
:
52rpx
38rpx
;
.return-no
{
font-size
:
40rpx
;
font-weight
:
500
;
color
:
#2272FF
;
line-height
:
60rpx
;
}
.vertical-bar
{
width
:
4rpx
;
height
:
60rpx
;
background
:
#F4F5F7
;
}
.copy-btn
{
width
:
120rpx
;
height
:
48rpx
;
border-radius
:
24rpx
;
border
:
2rpx
solid
#999999
;
font-size
:
26rpx
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
48rpx
;
margin
:
0
;
}
}
}
.message
{
font-size
:
26rpx
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
26rpx
;
}
.back-btn
{
width
:
400rpx
;
height
:
104rpx
;
background
:
#2272FF
;
border-radius
:
52rpx
;
font-size
:
32rpx
;
font-weight
:
600
;
color
:
#FFFFFF
;
line-height
:
104rpx
;
}
}
</
style
>
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