Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xoadoPlatform
Project
Overview
Details
Activity
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
yaohui
xoadoPlatform
Commits
d1f2dca9
Commit
d1f2dca9
authored
Nov 18, 2021
by
weix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业信息功能
parent
dfd2e90e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
523 additions
and
5 deletions
+523
-5
config.js
src/config/config.js
+1
-0
index.vue
src/views/dashboard/index.vue
+522
-5
No files found.
src/config/config.js
View file @
d1f2dca9
...
...
@@ -11,6 +11,7 @@ const config = {
PLATFORMID
:
'c5a4fa00c46fa80c64eb89f231983323'
,
// 平台信息domain
HOST_URL
:
'zhiyun.xoado.com'
,
// HOST_URL: 'hgcx.99zcx.com',
// 调度中心ip
// DISPATCH_IP: 'http://jjdispatch.xoado.com'
}
...
...
src/views/dashboard/index.vue
View file @
d1f2dca9
<
template
xmlns=
"http://www.w3.org/1999/html"
>
<el-card
style=
"text-align: left;"
type=
"flex"
justify=
"end"
align=
"end"
>
<
template
>
<div>
<!-- 基本信息 -->
<el-card
style=
"margin-bottom: 10px;"
>
<el-row
class=
"title-row"
type=
"flex"
justify=
"space-between"
align=
"center"
>
<div
class=
"title-left"
>
基本信息
</div>
<div>
<el-button
type=
"primary"
size=
"mini"
class=
"edit-button"
@
click=
"centerDialogVisible = true"
>
编辑
</el-button>
</div>
</el-row>
<el-row
style=
"padding-top: 10px;"
>
<el-col
class=
"col-left"
>
<div
class=
"demo-image__lazy"
style=
"display: flex;justify-content: center;"
>
<el-image
:src=
"platformForm.logo"
style=
"width: 150px;height: 150px"
lazy
></el-image>
</div>
</el-col>
<el-col
class=
"col-right"
>
<div>
<p>
<span
style=
"font-size: 20px;font-weight: 800;"
v-if=
"!!platformForm.org && !!platformForm.org.organizeName"
>
{{
platformForm
.
org
.
organizeName
}}
</span
>
</p>
</div>
<div>
<p>
<span>
企业简称
</span>
<span>
:
</span>
<span>
{{
platformForm
.
org
.
orgForShort
}}
</span>
</p>
</div>
<div>
<p>
<span>
信用代码
</span>
<span>
:
</span>
<span>
{{
platformForm
.
org
.
usci
}}
</span>
</p>
</div>
<div>
<p>
<span>
办公地址
</span>
<span>
:
</span>
<span>
{{
platformForm
.
org
.
address
}}
</span>
</p>
</div>
</el-col>
</el-row>
</el-card>
<!-- 简介 -->
<el-card
style=
"margin-bottom: 10px;"
>
<el-row
class=
"title-row"
type=
"flex"
justify=
"space-between"
align=
"center"
>
<div
class=
"title-left"
>
简介
</div>
<div>
<el-button
type=
"primary"
size=
"mini"
class=
"edit-button"
@
click=
"centerDialogVisible = true"
>
编辑
</el-button>
</div>
</el-row>
<el-row
style=
"padding-top: 10px;"
>
{{
platformForm
.
org
.
scode
}}
</el-row>
</el-card>
<!-- 管理员 -->
<el-card
style=
"margin-bottom: 10px;"
>
<el-row
class=
"title-row"
type=
"flex"
justify=
"space-between"
align=
"center"
>
<div
class=
"title-left"
>
管理员
</div>
</el-row>
<el-row
style=
"padding: 0 0 0 17px;"
>
管理员:
{{
platformForm
.
org
.
manager
.
managerName
+
'('
+
platformForm
.
org
.
manager
.
phoneNumber
.
substring
(
0
,
3
)
+
'****'
+
platformForm
.
org
.
manager
.
phoneNumber
.
substring
(
7
,
11
)
+
')'
}}
<el-button
type=
"text"
style=
"margin-left: 20px"
@
click=
"replaceManager"
>
更换管理员
</el-button>
</el-row>
</el-card>
<el-dialog
title=
"运营商管理"
:visible
.
sync=
"operatorDialogVisible"
width=
"30%"
center
>
<el-form
ref=
"form"
:model=
"operatorForm"
label-width=
"80px"
>
<el-form-item
label=
"企业logo:"
>
<el-upload
class=
"avatar-uploader"
list-type=
"picture-card"
action=
"https://apps.xoado.com/cloud/tools/files/upload"
:headers=
"headers"
:show-file-list=
"false"
:auto-upload=
"true"
:data=
"UnderLineUpdata"
name=
"image"
:on-success=
"photoUrlSuccess"
>
<img
v-if=
"operatorForm.imageUrl"
:src=
"operatorForm.imageUrl"
class=
"avatar"
/>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
<el-form-item
label=
"企业简称:"
>
<el-input
v-model=
"operatorForm.enterpriseDescribe"
></el-input>
</el-form-item>
<el-form-item
label=
"办公地址:"
>
<el-input
type=
"textarea"
v-model=
"operatorForm.address"
></el-input>
</el-form-item>
<el-form-item
label=
"法人:"
>
<el-input
v-model=
"operatorForm.opername"
:readonly=
"!!Data.opername"
></el-input>
</el-form-item>
<el-form-item
label=
"法人身份证号:"
>
<el-input
v-model=
"operatorForm.operIdcard"
:readonly=
"!!Data.operIdcard"
></el-input>
</el-form-item>
<el-form-item
label=
"公司简介:"
>
<el-input
type=
"textarea"
v-model=
"operatorForm.companyDescribe"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmitOrganization"
>
确认
</el-button
>
<el-button
@
click=
"operatorDialogVisible = false"
>
取消
</el-button>
</el-form-item>
</el-form>
</el-dialog>
<!--更换管理员-->
<el-dialog
title=
"更换管理员"
:visible
.
sync=
"administratorDialogVisible"
width=
"500px"
center
>
<div
class=
"Replace"
>
<el-form
ref=
"ReplaceForm"
:model=
"ReplaceForm"
label-width=
"160px"
>
<el-form-item
label=
"管理员:"
>
<el-select
v-model=
"ReplaceForm.user"
@
visible-change=
"Business"
placeholder=
"请选择员工"
@
change=
"updateInfo"
>
<el-option
v-for=
"item in options"
:key=
"item.phoneNumber"
:label=
"item.userName"
:value=
"item.userid"
></el-option>
</el-select>
<!--
<p
style=
"font-size: 14px"
>
(请输入关键字搜索,验证后生效)
</p>
-->
</el-form-item>
<el-form-item
label=
"手机号:"
>
{{
ReplaceForm
.
Phone
}}
</el-form-item>
<el-form-item
label=
"验证码:"
>
<el-input
v-model=
"ReplaceForm.Verification"
placeholder=
"请输入验证码"
label=
"验证码"
style=
"width: 120px; display: inline-block"
onkeyup=
"this.value=this.value.replace(/[^\d.]/g,'');"
maxlength=
"6"
></el-input>
<el-button
style=
"display: inline-block; margin-left: 10px"
@
click=
"Yanzheng"
class=
"YanzhengBtn"
:disabled=
"Btndisabled"
>
{{
smscontent
}}
</el-button
>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmitAdministrator"
>
确认
</el-button
>
<el-button
@
click=
"administratorDialogVisible = false"
>
取消
</el-button
>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
branchInfo
,
getBranchId
}
from
"@/port/dashboard"
;
import
{
getVerificationCode
,
Organizations
,
platformsDomain
,
}
from
"@/port/account"
;
import
{
updateOrganizationInfo
,
updatePlatformInfo
,
updatePlatformDetail
,
updateSpecifiedDetail
,
}
from
"@/port/set-request"
;
import
{
HOST_URL
}
from
"@/config/index"
export
default
{
name
:
"index"
,
data
()
{
return
{
info
:
'baaaaaaaaaaa'
activeName
:
"enterprise"
,
dialogReplace
:
false
,
centerDialogVisible
:
false
,
operatorDialogVisible
:
false
,
administratorDialogVisible
:
false
,
imageUrl
:
""
,
radio
:
"1"
,
input
:
""
,
options
:
[],
Data
:
{
opername
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
opername
,
operIdcard
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
operIdcard
,
},
platformForm
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)),
ReplaceForm
:
{
Phone
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
manager
.
phoneNumber
,
user
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
manager
.
managerName
,
Verification
:
""
,
newId
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
manager
.
managerId
,
},
mechanismformconfig
:
""
,
urls
:
[
"https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg"
,
],
form
:
{
name
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
name
,
describe
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
))
.
describe
,
// sitePortal: JSON.parse(sessionStorage.getItem("ManPlatformData")).home,
homeUrl
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
homeurl
,
},
operatorForm
:
{
imageUrl
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
logoUrl
,
enterpriseDescribe
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)
).
org
.
orgForShort
,
address
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
address
,
companyDescribe
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
))
.
org
.
scode
,
opername
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
opername
,
operIdcard
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
operIdcard
,
},
smscontent
:
"获取验证码"
,
Btndisabled
:
false
,
headers
:
{},
UnderLineUpdata
:
{
urlType
:
"OfflineContract"
,
},
};
},
created
()
{
let
parentid
=
sessionStorage
.
getItem
(
"parentid"
);
getBranchId
(
parentid
).
then
((
res
)
=>
{
if
(
res
.
status
&&
res
.
status
==
200
&&
!!
res
.
data
.
branchId
)
branchInfo
(
res
.
data
.
branchId
).
then
((
res
)
=>
{
if
(
res
.
status
&&
res
.
status
==
200
)
{
this
.
mechanismformconfig
=
res
.
data
;
}
});
});
this
.
headers
=
{
XOADOAPPACCESSCODE
:
this
.
$store
.
state
.
user
.
code
,
XOADOTOKENID
:
this
.
$store
.
state
.
user
.
token
,
XOADOPLATFORMID
:
this
.
$store
.
getters
.
platformId
};
},
methods
:
{
photoUrlSuccess
(
response
,
file
,
fileList
)
{
let
that
=
this
;
if
(
file
.
response
.
status
==
200
)
{
that
.
operatorForm
.
imageUrl
=
file
.
response
.
data
[
0
].
url
;
}
}
},
mustFun
()
{
// 获取当前的urlhost
let
hosturl
=
HOST_URL
;
// 根据当前的URL 获取所属平台信息
platformsDomain
(
hosturl
).
then
((
res
)
=>
{
let
json
=
{
phone
:
res
.
data
.
telephone
,
logo
:
res
.
data
.
logo
,
id
:
res
.
data
.
ownerid
,
platformid
:
res
.
data
.
platformid
,
homeurl
:
res
.
data
.
home
.
url
,
name
:
res
.
data
.
name
,
describe
:
res
.
data
.
describe
,
home
:
res
.
data
.
home
.
url
,
brandName
:
res
.
data
.
brandName
,
appLink
:
res
.
data
.
appLink
,
type
:
res
.
data
.
platformOvertType
,
Data
:
res
.
data
,
org
:
[],
};
// axios.defaults.headers.XOADOPLATFORMID = json.platformid;
// this.$store.commit('user/SET_PLATFORMID', json.platformid)
// document.title = res.data.name;
Organizations
(
json
.
id
).
then
((
res
)
=>
{
json
.
org
=
res
.
data
;
// axios.defaults.headers.XOADOPLATFORMID = json.platformid;
this
.
platformForm
=
json
;
});
});
},
replaceManager
()
{
this
.
administratorDialogVisible
=
true
;
},
updateInfo
(
val
)
{
console
.
log
(
val
);
let
res
=
this
.
options
.
filter
((
item
)
=>
{
return
item
.
userid
==
val
;
});
this
.
ReplaceForm
.
Phone
=
res
[
0
].
phoneNumber
;
},
Business
(
item
)
{
let
data
=
{};
let
id
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
organizeid
;
let
json
=
{};
this
.
options
=
[];
updatePlatformDetail
(
json
,
id
).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
console
.
log
(
res
.
data
);
this
.
options
=
res
.
data
.
map
((
item
)
=>
{
return
{
userName
:
item
.
name
,
userid
:
item
.
userid
,
phoneNumber
:
item
.
phoneNumber
,
};
});
console
.
log
(
JSON
.
stringify
(
this
.
options
));
}
});
// this.options.forEach(f => {
// if (f.phoneNumber == item) {
// data = f;
// }
// });
// this.ReplaceForm.newId = data.userId;
},
onSubmitAdministrator
()
{
let
id
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
organizeid
;
let
json
=
{
managerId
:
this
.
ReplaceForm
.
user
,
};
updateSpecifiedDetail
(
json
,
id
).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
this
.
$message
.
success
(
"修改成功"
);
this
.
mustFun
();
this
.
administratorDialogVisible
=
false
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
},
onSubmitOrganization
()
{
let
json
=
{
logoImageUrl
:
this
.
operatorForm
.
imageUrl
,
orgForShort
:
this
.
operatorForm
.
enterpriseDescribe
,
address
:
this
.
operatorForm
.
address
,
orgInfo
:
{
info
:
this
.
operatorForm
.
companyDescribe
},
operIdcard
:
this
.
operatorForm
.
operIdcard
,
operName
:
this
.
operatorForm
.
opername
,
};
let
id
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"ManPlatformData"
)).
org
.
organizeid
;
updatePlatformInfo
(
json
,
id
).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
this
.
$message
.
success
(
"修改成功"
);
this
.
mustFun
();
this
.
operatorDialogVisible
=
false
;
}
else
{
this
.
mustFun
();
this
.
$message
.
error
(
res
.
data
.
msg
);
}
});
},
onSubmit
()
{
let
parentid
=
sessionStorage
.
getItem
(
"parentid"
);
let
json
=
{
brandName
:
this
.
form
.
name
,
describe
:
this
.
form
.
describe
,
home
:
{
url
:
this
.
form
.
homeUrl
,
},
};
updateOrganizationInfo
(
json
).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
this
.
$message
.
success
(
"修改成功"
);
this
.
centerDialogVisible
=
false
;
this
.
mustFun
();
getBranchId
(
parentid
).
then
((
res
)
=>
{
if
(
res
.
status
&&
res
.
status
==
200
&&
!!
res
.
data
.
branchId
)
branchInfo
(
res
.
data
.
branchId
).
then
((
res
)
=>
{
if
(
res
.
status
&&
res
.
status
==
200
)
{
this
.
mechanismformconfig
=
res
.
data
;
}
});
});
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
},
handleAvatarSuccess
(
res
,
file
)
{
this
.
imageUrl
=
URL
.
createObjectURL
(
file
.
raw
);
},
beforeAvatarUpload
(
file
)
{
const
isJPG
=
file
.
type
===
"image/jpeg"
;
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
if
(
!
isJPG
)
{
this
.
$message
.
error
(
"上传头像图片只能是 JPG 格式!"
);
}
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
"上传头像图片大小不能超过 2MB!"
);
}
return
isJPG
&&
isLt2M
;
},
Yanzheng
()
{
if
(
!
/^1
[
3456789
]\d{9}
$/
.
test
(
this
.
ReplaceForm
.
Phone
))
{
this
.
$message
.
error
(
"手机号码错误"
);
return
;
}
this
.
Btndisabled
=
true
;
this
.
smscontent
=
"发送中..."
;
let
Data
=
{
phoneNumber
:
this
.
ReplaceForm
.
Phone
,
};
getVerificationCode
(
Data
).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
this
.
$message
({
message
:
"验证码发送成功"
,
type
:
"success"
,
});
this
.
timer
=
60
;
this
.
smscontent
=
this
.
timer
+
"s后重试"
;
let
auth_timer
=
setInterval
(()
=>
{
// 定时器设置每秒递减
this
.
timer
--
;
// 递减时间
this
.
smscontent
=
this
.
timer
+
"秒后重试"
;
if
(
this
.
timer
<=
0
)
{
this
.
smscontent
=
"获取验证码"
;
// 60s时间结束还原v-show状态并清除定时器
clearInterval
(
auth_timer
);
this
.
Btndisabled
=
false
;
}
},
1000
);
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
},
},
};
</
script
>
<
style
scoped
lang=
"scss"
>
.title-row
{
padding-bottom
:
5px
;
border-bottom
:
1px
solid
#e4e7ed
;
}
.title-left
{
display
:
flex
;
align-items
:
center
;
font-size
:
18px
;
font-weight
:
800
;
}
.
title-left
:
:
before
{
content
:
''
;
margin-right
:
10px
;
//position: absolute;
width
:
5px
;
height
:
60%
;
background-color
:
#0099ff
;
}
.edit-button
{
padding
:
8px
25px
;
}
.col-left
{
width
:
200px
;
}
.col-right
{
padding-left
:
20px
;
width
:
calc
(
100%
-
200px
);
div
{
padding-bottom
:
5px
;
}
}
</
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