Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-settings
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3a7eb9bb
authored
Apr 13, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
cb4f2da0
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
41 deletions
src/components/province-city/index.vue
src/config/index.js
src/views/account/addAccount.vue
src/views/account/components/baseInfo.vue
src/views/account/components/selectProduct.vue
src/views/account/detailAccount.vue
src/views/account/editAccount.vue
src/views/baseInfo/editInfo.vue
src/components/province-city/index.vue
View file @
3a7eb9b
<
template
>
<div>
<el-form
ref=
"provinceForm"
:model=
"provinceForm"
label-width=
"80px"
inline=
"true"
class=
"province"
>
<el-select
v-model=
"provinceForm.provinceName"
placeholder=
"选择省份"
@
change=
"selectProvince"
>
<el-select
v-model=
"provinceForm.provinceName"
placeholder=
"选择省份"
@
change=
"selectProvince"
class=
"select-padding"
>
<el-option
v-for=
"item in AllData"
:key=
"item.provinceCode"
:label=
"item.provinceName"
:value=
"item.provinceName"
@
click
.
native=
"selectProvince(item)"
></el-option>
</el-select>
<el-select
v-model=
"provinceForm.cityName"
placeholder=
"选择您所在的市"
style=
"width:250px"
@
change=
"selectCity"
>
<el-select
v-model=
"provinceForm.cityName"
placeholder=
"选择您所在的市"
style=
"width:250px"
@
change=
"selectCity"
class=
"select-padding"
>
<el-option
v-for=
"item in cityList"
:key=
"item.cityCode"
:label=
"item.cityName"
:value=
"item.cityName"
@
click
.
native=
"selectCity(item)"
></el-option>
</el-select>
</el-form>
...
...
@@ -29,18 +29,28 @@ export default {
}
}
},
inject
:
[
'provinceEditAccount'
],
mounted
()
{
// 初始化
this
.
getProvinceList
()
console
.
log
(
this
.
provinceEditAccount
,
'===='
)
// if (this.province.provinceName) {
// console.log('++++')
// this.init(this.province.provinceName, this.province.cityName)
// }
},
methods
:
{
init
(
provinceName
,
cityName
)
{
console
.
log
(
provinceName
,
cityName
)
console
.
log
(
111111
)
console
.
log
(
this
.
AllData
)
this
.
provinceForm
=
{
provinceName
:
provinceName
,
cityName
:
cityName
}
this
.
AllData
.
map
(
item
=>
{
if
(
provinceName
==
item
.
provinceName
)
{
console
.
log
(
111111
)
this
.
cityList
=
item
.
cityInfoList
this
.
provinceForm
.
provinceCode
=
item
.
provinceCode
this
.
cityList
.
map
(
itm
=>
{
...
...
@@ -53,9 +63,11 @@ export default {
},
async
getProvinceList
()
{
const
{
provinceInfoList
:
provinceList
}
=
await
this
.
provinceList
// this.AllData = provinceList
this
.
$set
(
this
,
'AllData'
,
provinceList
)
console
.
log
(
this
.
AllData
)
this
.
AllData
=
provinceList
// this.$set(this, 'AllData', provinceList)
if
(
this
.
provinceEditAccount
)
{
this
.
init
(
this
.
provinceEditAccount
.
provinceName
,
this
.
provinceEditAccount
.
cityName
)
}
},
// 选择省
selectProvince
(
val
)
{
...
...
@@ -76,4 +88,7 @@ export default {
.province
{
display
:
inline-flex
;
}
.select-padding
{
margin-right
:
10px
;
}
</
style
>
src/config/index.js
View file @
3a7eb9b
...
...
@@ -11,12 +11,12 @@
let
cfg
=
require
(
'./conf.js'
)
import
{
Http
}
from
'glsx-common'
let
timeout
=
30000
//超时时间
export
const
fetchConfig
=
function
(
isEnv
=
tru
e
)
{
//
if (isEnv) {
//
let { request } = cfg
//
Object.assign(request, { timeout })
//
return Promise.resolve(cfg)
//
}
export
const
fetchConfig
=
function
(
isEnv
=
fals
e
)
{
if
(
isEnv
)
{
let
{
request
}
=
cfg
Object
.
assign
(
request
,
{
timeout
})
return
Promise
.
resolve
(
cfg
)
}
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
return
new
Http
().
get
(
'http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config'
)
}
...
...
src/views/account/addAccount.vue
View file @
3a7eb9b
src/views/account/components/baseInfo.vue
View file @
3a7eb9b
...
...
@@ -211,11 +211,9 @@ export default {
checkBrandList
(
chant
)
{
let
merchantBrandMain
=
chant
.
filter
(
item
=>
item
)
this
.
$set
(
this
.
accountAddForm
,
'merchantBrandMain'
,
merchantBrandMain
)
console
.
log
(
this
.
accountAddForm
.
merchantBrandMain
)
if
(
!
this
.
accountAddForm
.
merchantBrandMain
)
{
this
.
accountAddForm
.
merchantBrandMain
=
[]
}
console
.
log
(
this
.
accountAddForm
.
merchantBrandMain
)
this
.
$refs
.
brandListTree
.
getCheckList
(
this
.
accountAddForm
.
merchantBrandMain
)
},
checkBusinessType
(
type
)
{
...
...
@@ -275,12 +273,20 @@ export default {
// 截取省市
var
provinceIdx
=
address
.
indexOf
(
'省'
)
var
cityIdx
=
address
.
indexOf
(
'市'
)
// provinceIdx == -1 ? (provinceIdx = 0) : provinceIdx
var
province
=
address
.
slice
(
0
,
provinceIdx
)
var
city
=
address
.
slice
(
provinceIdx
+
1
,
cityIdx
)
// 如果没有省
if
(
provinceIdx
==
-
1
)
{
provinceIdx
=
0
city
=
address
.
slice
(
provinceIdx
,
cityIdx
)
province
=
city
}
// 判断省市是否匹配
if
(
this
.
accountAddForm
.
provinceName
)
{
if
(
this
.
accountAddForm
.
provinceName
!==
province
&&
this
.
accountAddForm
.
cityName
!==
city
)
{
if
(
this
.
accountAddForm
.
provinceName
!==
province
||
this
.
accountAddForm
.
cityName
!==
city
)
{
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
this
.
accountAddForm
.
merchantAddress
=
''
return
}
}
...
...
@@ -298,7 +304,9 @@ export default {
},
// 获取省
getProvince
(
provinceName
,
provinceCode
)
{
this
.
accountAddForm
.
merchantAddress
=
''
this
.
$set
(
this
.
accountAddForm
,
'merchantAddress'
,
''
)
// 强制更新 merchantAddress
this
.
$forceUpdate
()
this
.
accountAddForm
.
provinceName
=
provinceName
this
.
accountAddForm
.
provinceCode
=
provinceCode
},
...
...
src/views/account/components/selectProduct.vue
View file @
3a7eb9b
...
...
@@ -72,7 +72,6 @@ export default {
},
methods
:
{
handleClik
(
tab
,
event
)
{
console
.
log
(
tab
,
event
)
const
tabId
=
tab
.
name
const
productTab
=
this
.
tabMenu
.
find
(
i
=>
i
.
accounttypeId
==
tabId
)
this
.
productTab
=
productTab
.
productsArr
[
0
]
?
productTab
.
productsArr
[
0
].
productId
:
''
...
...
@@ -81,7 +80,6 @@ export default {
this
.
$parent
.
editStatus
=
true
this
.
productTab
=
data
.
length
!=
0
?
data
[
data
.
length
-
1
].
productId
:
''
const
{
tabName
,
tabMenu
,
productTab
}
=
this
console
.
log
(
tabName
,
data
)
// 设置全选
var
arr
=
tabMenu
.
find
(
i
=>
i
.
accounttypeId
==
tabName
).
products
.
find
(
j
=>
j
.
productId
==
productTab
).
merchantProTreeResponses
this
.
$refs
[
`tree_
${
tabName
}
_
${
productTab
}
`
][
0
].
setCheckedKeys
(
this
.
getAllId
(
arr
))
...
...
@@ -108,7 +106,6 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
addStyle
()
})
console
.
log
(
this
.
tabMenu
)
this
.
accountTypes
=
tabMenu
.
map
(
item
=>
{
return
{
products
:
null
,
...
...
@@ -128,7 +125,6 @@ export default {
account
=
'accountTypeSearchRequest'
}
this
.
$apis
.
store
[
account
](
params
).
then
(
res
=>
{
console
.
log
(
res
)
let
tabMenu
=
res
this
.
accountList
=
tabMenu
.
map
(
item
=>
{
return
{
...
...
@@ -140,8 +136,6 @@ export default {
// productId: ''
}
})
console
.
log
(
this
.
accountList
)
this
.
accountTypes
=
tabMenu
.
map
(
item
=>
{
return
{
products
:
null
,
...
...
@@ -160,9 +154,7 @@ export default {
this
.
$apis
.
store
.
findPermissionsByMerId
(
params
).
then
(
res
=>
{
this
.
tabMenu_x
=
util
.
deepClone
(
res
)
res
.
forEach
(
item
=>
{
console
.
log
(
item
)
this
.
accountList
.
forEach
(
itm
=>
{
console
.
log
(
itm
)
if
(
item
.
accounttypeId
==
itm
.
accounttypeId
)
{
this
.
tabMenu
.
push
(
itm
)
item
.
products
.
forEach
(
i
=>
{
...
...
@@ -192,7 +184,6 @@ export default {
this
.
accountList
=
util
.
deepClone
(
this
.
tabMenu_s
)
this
.
tabMenu_x
.
forEach
(
item
=>
{
this
.
accountList
.
forEach
(
itm
=>
{
console
.
log
(
itm
)
if
(
item
.
accounttypeId
==
itm
.
accounttypeId
)
{
this
.
tabMenu
.
push
(
itm
)
item
.
products
.
forEach
(
i
=>
{
...
...
@@ -244,7 +235,6 @@ export default {
this
.
uniteChildSame
(
currentObj
,
true
)
}
else
{
// 未选中 处理子节点全部未选中
console
.
log
(
currentObj
)
if
(
currentObj
.
children
!==
null
)
{
if
(
currentObj
.
children
.
length
!==
0
)
{
this
.
uniteChildSame
(
currentObj
,
false
)
...
...
@@ -290,7 +280,6 @@ export default {
uniteChildSame
(
treeList
,
isSelected
)
{
const
tree_ref
=
`tree_
${
this
.
tabName
}
_
${
this
.
productTab
}
`
this
.
$refs
[
tree_ref
][
0
].
setChecked
(
treeList
.
id
,
isSelected
)
console
.
log
(
treeList
)
if
(
treeList
.
children
!==
null
)
{
for
(
let
i
=
0
;
i
<
treeList
.
children
.
length
;
i
++
)
{
this
.
uniteChildSame
(
treeList
.
children
[
i
],
isSelected
)
...
...
@@ -327,7 +316,6 @@ export default {
let
productList
=
[]
item
.
productsArr
.
forEach
(
itm
=>
{
const
checkedNodes
=
this
.
$refs
[
`tree_
${
item
.
accounttypeId
}
_
${
itm
.
productId
}
`
]
?
this
.
$refs
[
`tree_
${
item
.
accounttypeId
}
_
${
itm
.
productId
}
`
][
0
].
getCheckedNodes
()
:
[]
console
.
log
(
checkedNodes
)
const
menuIdList
=
checkedNodes
// .filter((item) => item.logo === "menu")
.
filter
(
item
=>
item
.
logo
!==
'function'
&&
item
.
logo
!==
'functionValue'
&&
item
.
logo
!==
'neglect'
)
...
...
@@ -359,7 +347,6 @@ export default {
})
})
}
console
.
log
(
menuIdList
,
functionIdList
,
functionValueIdLists
,
list
)
if
(
this
.
roleType
)
{
productList
.
push
({
productId
:
itm
.
productId
,
...
...
@@ -388,7 +375,6 @@ export default {
}
}
})
console
.
log
(
this
.
accountTypes
)
return
this
.
accountTypes
}
},
...
...
src/views/account/detailAccount.vue
View file @
3a7eb9b
...
...
@@ -136,6 +136,16 @@
<span
class=
"itemName"
>
主营品牌:
</span>
<span
class=
"itemValue"
>
{{ firstPageObj.merchantBrandName || '-' }}
</span>
</el-col>
<el-col
:span=
"12"
class=
"flexCol"
>
<span
class=
"itemName"
>
驻店电话:
</span>
<span
class=
"itemValue"
>
{{ firstPageObj.residentPhone || '-' }}
</span>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
class=
"flexCol"
>
<span
class=
"itemName"
>
营业时间:
</span>
<span
class=
"itemValue"
>
{{ firstPageObj.bussinessBegintime ? firstPageObj.bussinessBegintime + '-' + firstPageObj.bussinessEndtime : '-' }}
</span>
</el-col>
</el-row>
</div>
</div>
...
...
@@ -348,7 +358,7 @@ export default {
},
//将后台返回数据中数值为空的字段全部替换为“-”
formateNullFieldData
(
initialData
)
{
const
isEmpty
=
function
(
val
)
{
const
isEmpty
=
function
(
val
)
{
if
(
!
String
(
val
)
||
String
(
val
)
===
'null'
)
{
return
'-'
}
...
...
@@ -356,7 +366,7 @@ export default {
}
var
that
=
this
if
(
initialData
instanceof
Array
)
{
initialData
.
forEach
(
function
(
val
,
key
,
array
)
{
initialData
.
forEach
(
function
(
val
,
key
,
array
)
{
array
[
key
]
=
that
.
formateNullFieldData
(
val
)
})
}
else
if
(
initialData
instanceof
Object
)
{
...
...
@@ -404,7 +414,6 @@ export default {
findMenuFunTreeByMerId
()
{
this
.
$apis
.
merchant
.
findMenuFunTreeByMerId
({
id
:
this
.
merchantId
}).
then
(
res
=>
{
if
(
res
)
{
console
.
log
(
res
,
'功能树的信息'
)
this
.
powerDataArray
=
res
this
.
handlerTreeDom
()
}
...
...
@@ -451,7 +460,6 @@ export default {
})
)
this
.
merchantProTreeResponsesArray
=
this
.
toContiuneTree
(
this
.
merchantProTreeResponsesArray
,
0
,
maxval
)
console
.
log
(
this
.
merchantProTreeResponsesArray
)
this
.
maxval
=
maxval
-
1
this
.
$nextTick
(()
=>
{
this
.
changeTreeClass
(
maxval
)
...
...
@@ -499,11 +507,8 @@ export default {
// param.pageNum=this.$refs.subMerchantTable.page.pageNum
this
.
$apis
.
merchant
.
getSecondTable
(
param
).
then
(
res
=>
{
if
(
res
)
{
console
.
log
(
'2'
,
res
)
let
data
=
this
.
formateNullFieldData
(
res
)
this
.
subMerchantTableList
=
data
this
.
subMerchantTableTotal
=
res
.
length
}
// total > 50?calc(100vh - '199px'): calc(100vh - '152px')
...
...
@@ -549,7 +554,6 @@ export default {
this
.
getFirstInfo
()
this
.
findMenuFunTreeByMerId
()
this
.
getSecondInfo
()
this
.
getSecondTree
()
},
...
...
src/views/account/editAccount.vue
View file @
3a7eb9b
...
...
@@ -173,6 +173,11 @@ export default {
}
}
},
provide
()
{
return
{
provinceEditAccount
:
this
.
accountAddForm
}
},
watch
:
{
filterText
(
val
)
{
this
.
$refs
.
brandTree
.
filter
(
val
)
...
...
@@ -432,7 +437,6 @@ export default {
merchantBrandMain
})
// 省市回显
this
.
$refs
.
baseInfoForm
.
init
(
this
.
accountAddForm
.
provinceName
,
this
.
accountAddForm
.
cityName
)
merchantBrandMain
=
merchantBrandMain
.
replaceAll
(
';'
,
','
).
split
(
','
)
this
.
$refs
.
baseInfoForm
.
checkBrandList
(
merchantBrandMain
)
this
.
$refs
.
baseInfoForm
.
checkBusinessType
(
businessType
)
...
...
src/views/baseInfo/editInfo.vue
View file @
3a7eb9b
...
...
@@ -28,7 +28,6 @@
<el-input
v-model=
"infoForm.residentPhone"
placeholder=
"此电话会在小程序上显示,请填写真实有效的电话或手机号"
></el-input>
<div
@
click=
"showTelDia"
class=
"show-address"
>
显示位置
</div>
</el-form-item>
<!--
<div
@
click=
"showTelDia"
class=
"show-address"
>
显示位置
</div>
-->
<el-form-item
size=
"small"
label=
"主营品牌"
style=
"height: 500px"
>
<select-brand
:brandListTree=
"brandListTree"
ref=
"brandListTree"
></select-brand>
</el-form-item>
...
...
@@ -123,7 +122,6 @@ export default {
})
})
this
.
brandListTree
=
brandListTree
if
(
!
this
.
infoForm
.
merchantBrandMain
)
{
this
.
infoForm
.
merchantBrandMain
=
[]
}
else
{
...
...
@@ -160,8 +158,9 @@ export default {
var
city
=
address
.
slice
(
provinceIdx
+
1
,
cityIdx
)
// 判断省市是否匹配
if
(
this
.
infoForm
.
provinceName
)
{
if
(
this
.
infoForm
.
provinceName
!==
province
&&
this
.
infoForm
.
cityName
!==
city
)
{
if
(
this
.
infoForm
.
provinceName
!==
province
||
this
.
infoForm
.
cityName
!==
city
)
{
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
this
.
infoForm
.
merchantAddress
=
''
return
}
}
...
...
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