Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-purchase
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 86f3940c
authored
May 08, 2023
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
0b9b22a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
31 deletions
src/api/modules/sysBase.js
src/views/purchaseOrder/components/addressCom.vue
src/api/modules/sysBase.js
View file @
86f3940
import
{
http
,
http_common
}
from
'@/main'
import
{
http
,
http_common
}
from
'@/main'
const
path
=
"dj.api."
const
defaultPath
=
'scrm.api.carlife.'
...
...
@@ -40,5 +40,15 @@ const uploadImg = params => {
noSignAttr
:
[
'file'
]
})
}
// 获取省市区信息
const
getAreaInfoApi
=
function
(
params
)
{
params
.
method
=
`
${
path
}
yseMerchantOffline.getAreaInfo`
return
http
({
url
:
'rop-scrm-smartcarlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getGoodsCategoryConfiguration
,
uploadImg
,
uploadVideo
}
export
default
{
get
AreaInfoApi
,
get
GoodsCategoryConfiguration
,
uploadImg
,
uploadVideo
}
src/views/purchaseOrder/components/addressCom.vue
View file @
86f3940
<
template
>
<el-drawer
class=
"shoppingCartDrawerCon"
title=
"收货地址管理"
size=
"500px"
:visible
.
sync=
"dialogShow"
:direction=
"direction"
>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
label-width=
"100px"
default-width=
"350px"
:form-ref=
"editChildRef"
:form-obj=
"editForm"
:form-data=
"editFormData"
:form-rules=
"editRule"
></glsx-combi-form>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
label-width=
"100px"
default-width=
"350px"
:form-ref=
"editChildRef"
:form-obj=
"editForm"
:form-data=
"editFormData"
:form-rules=
"editRule"
>
<span
slot=
"provincesAndCities"
>
<!-- slot-scope="scope" -->
<el-cascader
v-model=
"editForm.provincesAndCities"
size=
"mini"
ref=
"cascader"
placeholder=
"请选择 省/市/区"
style=
"width:350px"
:options=
"provincesAndCities_options"
:props=
"
{ label: 'name', value: 'code', children: 'childrenList' }" />
</span>
</glsx-combi-form>
<div
class=
"footer-btn"
>
<el-button
@
click=
"submit"
type=
"primary"
>
保存
</el-button>
<el-button
@
click=
"dialogShow = false"
>
取消
</el-button>
</div>
</el-drawer>
</
template
>
...
...
@@ -52,29 +55,45 @@ export default {
placeholder
:
'请输入电话号码'
},
{
label
:
'收货地址'
,
label
:
''
,
name
:
'provincesAndCities'
,
type
:
'other'
,
addHtml
:
'provincesAndCities'
,
style
:
{
'padding-left'
:
'104px'
}
},
{
label
:
''
,
name
:
'contactAddress'
,
type
:
'input'
,
maxlength
:
50
,
placeholder
:
'请输入收货地址'
,
inputType
:
'textarea'
inputType
:
'textarea'
,
rows
:
3
,
style
:
{
'padding-left'
:
'104px'
}
// tips: '如XX店车主关怀活动'
}
],
editForm
:
{
contactName
:
''
,
contactPhone
:
''
,
contactAddress
:
''
contactAddress
:
''
,
provincesAndCities
:
[]
},
provincesAndCities_options
:
[],
editRule
:
{
contactName
:
[{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'change'
}],
contactPhone
:
[{
required
:
true
,
message
:
'请输入电话号码'
,
trigger
:
'change'
},
{
validator
:
checkPhone
,
trigger
:
'blur'
}],
contactAddress
:
[{
required
:
true
,
message
:
'请输入收货地址'
,
trigger
:
'change'
}]
contactPhone
:
[
{
required
:
true
,
message
:
'请输入电话号码'
,
trigger
:
'change'
},
{
validator
:
checkPhone
,
trigger
:
'blur'
}
],
contactAddress
:
[{
required
:
true
,
message
:
'请输入收货地址'
,
trigger
:
'change'
}],
provincesAndCities
:
[{
required
:
true
,
message
:
'请选择省市区'
,
trigger
:
'change'
}]
},
editChildRef
:
'editChildRef'
}
},
computed
:
{
...
...
@@ -90,13 +109,22 @@ export default {
watch
:
{
visible
(
val
)
{
if
(
val
)
{
this
.
editForm
=
this
.
addressInfo
?
this
.
$common
.
utils
.
deepClone
(
this
.
addressInfo
)
:
{}
console
.
log
(
this
.
addressInfo
)
if
(
this
.
addressInfo
)
{
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
this
.
addressInfo
)
this
.
editForm
.
provincesAndCities
=
[
this
.
addressInfo
.
provinceId
,
this
.
addressInfo
.
cityId
,
this
.
addressInfo
.
countyId
]
}
else
{
this
.
editForm
=
{}
}
}
}
},
methods
:
{
handleDetailClose
()
{
// 获取省市区信息
getAreaInfo
()
{
this
.
$apis
.
sysBase
.
getAreaInfoApi
({
areaType
:
'2'
}).
then
(
res
=>
{
this
.
provincesAndCities_options
=
res
.
areaList
})
},
handleOkFn
()
{
// console.log('您点击了确定')
...
...
@@ -108,38 +136,40 @@ export default {
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
const
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
this
.
$apis
.
purchaseShopping
.
addressSave
(
params
).
then
((
result
)
=>
{
this
.
$notify
({
type
:
'success'
,
title
:
'保存成功'
this
.
$apis
.
purchaseShopping
.
addressSave
(
params
)
.
then
(
result
=>
{
this
.
$notify
({
type
:
'success'
,
title
:
'保存成功'
})
this
.
dialogShow
=
false
this
.
$emit
(
'handleConfirmAddress'
)
})
this
.
dialogShow
=
false
this
.
$emit
(
'handleConfirmAddress'
)
}).
catch
((
err
)
=>
{
})
.
catch
(
err
=>
{})
}
})
},
navBack
()
{
}
navBack
()
{}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.shoppingCartDrawerCon
{
//
position
:
relative
;
::v-deep
.el-drawer__header
{
/deep/
.el-drawer__header
{
border-bottom
:
1px
solid
#e7eaec
;
margin-bottom
:
20px
;
padding-bottom
:
10px
;
font-weight
:
600
;
font-size
:
20px
;
}
/
deep
/
.el-textarea
{
.el-textarea__inner
{
height
:
auto
!important
;
}
}
.footer-btn
{
text-align
:
center
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment