# Conflicts: # src/views/modules/communityParty/regionalParty/activitysForm.vueshibei_master
|
After Width: | Height: | Size: 467 B |
|
After Width: | Height: | Size: 501 B |
|
After Width: | Height: | Size: 534 B |
|
After Width: | Height: | Size: 526 B |
|
After Width: | Height: | Size: 582 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 557 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 666 B |
|
After Width: | Height: | Size: 662 B |
|
After Width: | Height: | Size: 526 B |
|
After Width: | Height: | Size: 713 B |
|
After Width: | Height: | Size: 640 B |
|
After Width: | Height: | Size: 557 B |
|
After Width: | Height: | Size: 580 B |
|
After Width: | Height: | Size: 713 B |
|
After Width: | Height: | Size: 662 B |
|
After Width: | Height: | Size: 667 B |
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 661 B |
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 698 B |
|
After Width: | Height: | Size: 776 B |
|
After Width: | Height: | Size: 541 B |
|
After Width: | Height: | Size: 501 B |
|
After Width: | Height: | Size: 565 B |
|
After Width: | Height: | Size: 597 B |
|
After Width: | Height: | Size: 567 B |
|
After Width: | Height: | Size: 570 B |
|
After Width: | Height: | Size: 565 B |
|
After Width: | Height: | Size: 597 B |
|
After Width: | Height: | Size: 560 B |
|
After Width: | Height: | Size: 569 B |
|
After Width: | Height: | Size: 569 B |
|
After Width: | Height: | Size: 560 B |
|
After Width: | Height: | Size: 501 B |
|
After Width: | Height: | Size: 501 B |
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 563 B |
|
After Width: | Height: | Size: 488 B |
|
After Width: | Height: | Size: 356 B |
|
After Width: | Height: | Size: 278 B |
@ -0,0 +1,628 @@ |
|||
@import "../../c/config"; |
|||
@import "../../c/function"; |
|||
@import "./c/common"; |
|||
.div_top { |
|||
margin-left: 10px; |
|||
height: 35px; |
|||
.router_line { |
|||
width: 212px; |
|||
height: 1px; |
|||
border: 1px solid #ffffff; |
|||
opacity: 0.09; |
|||
/* opacity: 0.09; */ |
|||
} |
|||
.div_router { |
|||
margin-top: 5px; |
|||
font-size: 16px; |
|||
|
|||
.router_parents { |
|||
color: #a0c3d9; |
|||
|
|||
.arrow { |
|||
padding: 0 5px; |
|||
} |
|||
} |
|||
.router_parents:hover { |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.router_child { |
|||
color: #ffffff; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.div_content { |
|||
display: flex; |
|||
|
|||
.div_map { |
|||
box-sizing: border-box; |
|||
width: 100%; |
|||
// padding: 10px 5px 13px; |
|||
// margin-top: 8px; |
|||
height: calc(88vh - 15px); |
|||
color: #fff; |
|||
// background: url('../../../img/modules/visual/warning-box.png') no-repeat |
|||
// center; |
|||
// background-size: 100% 100%; |
|||
position: relative; |
|||
} |
|||
|
|||
.div_data { |
|||
flex: 0 0 610px; |
|||
margin-left: 12px; |
|||
|
|||
.div_tips{ |
|||
box-sizing: border-box; |
|||
width: 100%; |
|||
height: 302px; |
|||
color: #fff; |
|||
background: url('../../../img/modules/visual/warning-box.png') no-repeat |
|||
center; |
|||
background-size: 100% 100%; |
|||
|
|||
.div_coverage{ |
|||
padding: 30px 10px 32px 10px; |
|||
display: flex; |
|||
justify-content: space-around; |
|||
|
|||
.coverage_item{ |
|||
// padding-right:11px; |
|||
|
|||
>img{ |
|||
width:16px; |
|||
height:16px; |
|||
} |
|||
|
|||
>span{ |
|||
margin-left:6px; |
|||
font-size: 14px; |
|||
font-family: PingFang SC; |
|||
font-weight: 400; |
|||
color: #FFFFFF; |
|||
} |
|||
} |
|||
|
|||
.coverage_item:hover{ |
|||
cursor: pointer; |
|||
} |
|||
} |
|||
|
|||
.div_category { |
|||
box-sizing: border-box; |
|||
height:238px; |
|||
padding:0 10px 20px; |
|||
|
|||
.category_item { |
|||
|
|||
margin-bottom: 15px; |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
// margin:auto; |
|||
|
|||
|
|||
.list_item { |
|||
display: flex; |
|||
// padding: 18px 59px 0; |
|||
justify-content: flex-start; |
|||
flex:0 0 145px; |
|||
align-items: center; |
|||
|
|||
> img { |
|||
height: 16px; |
|||
width: 16px; |
|||
|
|||
// line-height: 25px; |
|||
} |
|||
.item_content{ |
|||
width:120px; |
|||
margin-left:8px; |
|||
font-size: 16px; |
|||
font-family: PingFang SC; |
|||
font-weight: 400; |
|||
|
|||
// line-height: 25px; |
|||
color: #e5effa; |
|||
} |
|||
|
|||
.item_content_sel{ |
|||
color: #5da8fd; |
|||
} |
|||
|
|||
} |
|||
|
|||
.list_item:hover{ |
|||
cursor: pointer; |
|||
} |
|||
|
|||
::v-deep .el-popper { |
|||
padding: 0px; |
|||
} |
|||
// |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
.div_category { |
|||
/deep/ .el-scrollbar__wrap { |
|||
overflow-x: hidden !important; |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
.div_info { |
|||
box-sizing: border-box; |
|||
width: 100%; |
|||
margin-top:10px; |
|||
height: calc(88vh - 302px - 10px); |
|||
color: #fff; |
|||
background: url('../../../img/modules/visual/warning-box.png') no-repeat |
|||
center; |
|||
background-size: 100% 100%; |
|||
padding: 32px 21px 20px 20px; |
|||
|
|||
.div_search_list { |
|||
margin: 0 auto; |
|||
text-align: center; |
|||
width: 559px; |
|||
height: 48px; |
|||
background-color: #011168; |
|||
border-radius: 4px; |
|||
border: none; |
|||
box-shadow: 0 0 10px inset #1a5afd; |
|||
// border-radius: 8px; |
|||
display: flex; |
|||
justify-content: flex-end; |
|||
|
|||
.icon { |
|||
display: flex; |
|||
align-items: center; |
|||
margin-left: 29px; |
|||
margin-top: 14px; |
|||
|
|||
> img { |
|||
width: 20px; |
|||
height: 20px; |
|||
} |
|||
} |
|||
|
|||
.btn { |
|||
text-align: center; |
|||
flex: 0 0 113px; |
|||
height: 48px; |
|||
background: linear-gradient(90deg, #1A5AFD, #26C4FF); |
|||
border-radius: 0px 4px 4px 0px; |
|||
font-size: 20px; |
|||
font-family: PingFang SC; |
|||
font-weight: 400; |
|||
color: #ffffff; |
|||
line-height: 48px; |
|||
} |
|||
.btn:hover { |
|||
cursor: pointer; |
|||
} |
|||
} |
|||
|
|||
|
|||
.tb { |
|||
height: calc(88vh - 302px - 10px - 150px); |
|||
overflow-y: auto; |
|||
@include scrollBar; |
|||
margin-top:20px; |
|||
} |
|||
|
|||
.m-pagination { |
|||
position: absolute; |
|||
box-sizing: border-box; |
|||
right: 5px; |
|||
bottom: 5px; |
|||
width: 100%; |
|||
height: 40px; |
|||
display: flex; |
|||
justify-content: flex-end; |
|||
|
|||
/deep/ .el-pagination.is-background .el-pager li:not(.disabled).active { |
|||
background: #0266d1; |
|||
color: #000d3f; |
|||
} |
|||
|
|||
/deep/ .el-pagination .el-pager li { |
|||
background: #002e74; |
|||
} |
|||
|
|||
/deep/ .el-pagination .btn-prev { |
|||
background: #002e74; |
|||
} |
|||
|
|||
/deep/ .el-pagination .btn-next { |
|||
background: #002e74; |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
|
|||
.div_community_info { |
|||
box-sizing: border-box; |
|||
flex: 0 0 calc(100vw - 620px); |
|||
// width: calc(100vw - 560px); |
|||
|
|||
height: calc(88vh - 10px); |
|||
color: #fff; |
|||
background: url('../../../img/modules/visual/warning-box.png') no-repeat |
|||
center; |
|||
background-size: 100% 100%; |
|||
|
|||
.div_select { |
|||
margin-top: 28px; |
|||
margin-left: 24px; |
|||
display: flex; |
|||
.customer_select { |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
|
|||
> span { |
|||
width: auto; |
|||
font-size: 22px; |
|||
font-family: PingFang SC; |
|||
font-weight: 800; |
|||
color: #ffffff; |
|||
line-height: 34px; |
|||
} |
|||
} |
|||
> img { |
|||
height: 34px; |
|||
width: 46px; |
|||
} |
|||
|
|||
.tip_title { |
|||
line-height: 34px; |
|||
margin-left: 12px; |
|||
font-size: 22px; |
|||
font-family: PingFang SC; |
|||
font-weight: 800; |
|||
color: #ffffff; |
|||
} |
|||
} |
|||
|
|||
.div_room_bar { |
|||
box-sizing: border-box; |
|||
|
|||
margin-top: 9px; |
|||
height: calc(88vh - 120px); |
|||
} |
|||
|
|||
.div_room { |
|||
// height: calc(88vh - 40px); |
|||
// margin-top: 9px; |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
justify-content: flex-start; |
|||
margin: 0 21px 0 21px; |
|||
|
|||
.item:hover { |
|||
cursor: pointer; |
|||
} |
|||
.item_sel { |
|||
box-shadow: 0 0 10px inset #1a5afd; |
|||
} |
|||
.item { |
|||
background-color: #011168; |
|||
margin-top: 12px; |
|||
width: 244px; |
|||
height: 190px; |
|||
border: 1px solid #037ddc; |
|||
border-radius: 8px; |
|||
text-align: center; |
|||
margin-left: 11px; |
|||
position: relative; |
|||
|
|||
// &:first-child { |
|||
// margin-left: 0; |
|||
// } |
|||
|
|||
.housename { |
|||
margin-top: 70px; |
|||
font-size: 24px; |
|||
font-family: PingFang SC; |
|||
font-weight: 500; |
|||
color: #ffffff; |
|||
// line-height: 180px; |
|||
} |
|||
|
|||
.icon_party { |
|||
position: absolute; |
|||
top: 10px; |
|||
left: 12px; |
|||
} |
|||
.icon_roomstate { |
|||
position: absolute; |
|||
top: 16px; |
|||
right: 16px; |
|||
font-size: 14px; |
|||
font-family: PingFang SC; |
|||
font-weight: 500; |
|||
color: #ffffff; |
|||
} |
|||
|
|||
.icon_category { |
|||
position: absolute; |
|||
bottom: 14px; |
|||
left: 9px; |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
// margin-left: 7px; |
|||
|
|||
.div_icon_item{ |
|||
.icon_img{ |
|||
margin-left: 5px; |
|||
width: 21px; |
|||
height: 20px; |
|||
} |
|||
.icon_name{ |
|||
text-align: center; |
|||
display: flex; |
|||
justify-content: center; |
|||
} |
|||
} |
|||
|
|||
} |
|||
.div_user:hover { |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.div_user { |
|||
position: absolute; |
|||
bottom: 10px; |
|||
right: 11px; |
|||
width: 88px; |
|||
height: 30px; |
|||
background: #073082; |
|||
border-radius: 15px; |
|||
|
|||
> img { |
|||
width: 10px; |
|||
height: 6px; |
|||
margin-left: 4px; |
|||
} |
|||
|
|||
> span { |
|||
font-size: 14px; |
|||
font-family: PingFang SC; |
|||
font-weight: 400; |
|||
color: #ffffff; |
|||
line-height: 30px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.div_room::after { |
|||
content: ''; |
|||
flex: 1; |
|||
} |
|||
} |
|||
|
|||
.user_list { |
|||
position: relative; |
|||
z-index: 10; |
|||
|
|||
background: #020340; |
|||
border: 1px solid #0a359b; |
|||
border-radius: 4px; |
|||
box-shadow: 0 0 10px inset #1a5afd; |
|||
|
|||
.user_item { |
|||
padding: 9px 8px 0 12px; |
|||
font-size: 14px; |
|||
font-family: PingFang SC; |
|||
font-weight: 400; |
|||
color: #ffffff; |
|||
line-height: 10px; |
|||
|
|||
.user_item_content { |
|||
display: flex; |
|||
// justify-content: space-between; |
|||
align-items: center; |
|||
|
|||
.name { |
|||
max-width: 80%; |
|||
text-align: left; |
|||
} |
|||
|
|||
> img { |
|||
margin-left: auto; |
|||
|
|||
margin-top: 4px; |
|||
width: 8px; |
|||
height: 12px; |
|||
} |
|||
} |
|||
|
|||
.item_line { |
|||
margin-top: 9px; |
|||
width: 70px; |
|||
height: 0px; |
|||
border: 1px dotted #1797ff31; |
|||
border-width: 0.5px; |
|||
} |
|||
.last_line { |
|||
border: 1px dotted #1797ff00; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.m-sidebar { |
|||
position: absolute; |
|||
right: 0; |
|||
top: 50px; |
|||
z-index: 1000; |
|||
width: 370px; |
|||
height: 470px; |
|||
overflow: hidden; |
|||
|
|||
.wrap { |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
background-color: rgba(rgb(173, 173, 173), 0); |
|||
transform: translateX(-5px); |
|||
transition: all ease 1s; |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.wrap-hidden { |
|||
transform: translateX(339px); |
|||
} |
|||
|
|||
.div_agency_list { |
|||
width: 320px; |
|||
height: 470px; |
|||
color: #fff; |
|||
background: url('../../../img/modules/visual/box-2.png') no-repeat center; |
|||
background-size: 100% 100%; |
|||
padding: 45px 20px 35px 20px; |
|||
|
|||
.agency_main { |
|||
height: 100%; |
|||
position: relative; |
|||
} |
|||
|
|||
.agency_main { |
|||
/deep/ .el-scrollbar__wrap { |
|||
overflow-x: hidden !important; |
|||
} |
|||
} |
|||
|
|||
.no-data-img { |
|||
text-align: center; |
|||
margin-top: 50px; |
|||
margin-left: 15px; |
|||
} |
|||
.agency_list { |
|||
.agency_item { |
|||
// height: 60px; |
|||
padding: 15px 0; |
|||
font-size: 17px; |
|||
font-family: PingFang SC; |
|||
font-weight: 400; |
|||
color: #ffffff; |
|||
// line-height: 50px; |
|||
padding-left: 12px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
// padding-top: 15px; |
|||
|
|||
.agency_item_name { |
|||
// line-height: 20px; |
|||
} |
|||
} |
|||
|
|||
.agency_item_on { |
|||
background: #08216c; |
|||
border-radius: 2px; |
|||
} |
|||
|
|||
.agency_item:hover { |
|||
cursor: pointer; |
|||
background-color: #011168; |
|||
border-radius: 4px 0 0 4px; |
|||
border: none; |
|||
box-shadow: 0 0 10px inset #1a5afd; |
|||
border-radius: 2px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.arrow_tip { |
|||
margin-right: -2px; |
|||
margin-left: 10px; |
|||
> img { |
|||
width: 22px; |
|||
height: 176px; |
|||
} |
|||
} |
|||
.arrow_tip:hover { |
|||
cursor: pointer; |
|||
} |
|||
} |
|||
|
|||
.m-room-pop { |
|||
@include shield; |
|||
background-color: rgba(#000, 0.9); |
|||
overflow-y: auto; |
|||
|
|||
.wrap { |
|||
position: relative; |
|||
margin: 120px auto; |
|||
width: 680px; |
|||
|
|||
.title { |
|||
padding: 10px; |
|||
font-size: 22px; |
|||
font-family: PingFang SC; |
|||
font-weight: 800; |
|||
color: #ffffff; |
|||
display: flex; |
|||
align-items: center; |
|||
|
|||
img { |
|||
display: block; |
|||
margin-right: 5px; |
|||
} |
|||
span { |
|||
display: block; |
|||
} |
|||
} |
|||
|
|||
.btn-close { |
|||
position: absolute; |
|||
top: -15px; |
|||
right: -15px; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.list { |
|||
// display: flex; |
|||
// flex-wrap: wrap; |
|||
padding: 5px 60px 5px 30px; |
|||
|
|||
.item { |
|||
position: relative; |
|||
box-sizing: border-box; |
|||
padding: 0 15px; |
|||
width: 100%; |
|||
color: #fff; |
|||
font-size: 18px; |
|||
font-family: PingFang SC; |
|||
font-weight: 400; |
|||
color: #ffffff; |
|||
line-height: 24px; |
|||
margin: 15px 0; |
|||
|
|||
&::before { |
|||
position: absolute; |
|||
left: 0; |
|||
top: 9px; |
|||
content: ""; |
|||
display: block; |
|||
width: 7px; |
|||
height: 7px; |
|||
background: #0c81fe; |
|||
border-radius: 3px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,715 @@ |
|||
<template> |
|||
<div> |
|||
<div class="dialog-h-content scroll-h"> |
|||
<el-form |
|||
v-if="iniLoaded" |
|||
ref="ref_form" |
|||
:model="fmData" |
|||
:inline="true" |
|||
:disabled="formType === 'watch'" |
|||
class="m-fm" |
|||
:class="editParamsDiv ? 'z-div' : ''" |
|||
> |
|||
<div class="list"> |
|||
<el-form-item |
|||
v-for="item in editParams1" |
|||
label-width="150px" |
|||
style="display: block" |
|||
:key="'edit' + item.keyName" |
|||
:label="item.field" |
|||
:prop="item.keyName" |
|||
:rules="item.rules || []" |
|||
> |
|||
<template v-if="item.type == 'input'"> |
|||
<el-input |
|||
v-if=" |
|||
formType == 'add' || (formType == 'edit' && !item.editDisable) |
|||
" |
|||
v-model="fmData[item.keyName]" |
|||
class="item-input" |
|||
size="small" |
|||
clearable |
|||
show-word-limit |
|||
:maxlength="item.maxlength || ''" |
|||
:placeholder="item.placeholder || '请输入'" |
|||
> |
|||
</el-input> |
|||
|
|||
<div class="item-show" v-else> |
|||
{{ fmData[item.keyName] || "--" }} |
|||
</div> |
|||
</template> |
|||
|
|||
<template v-if="item.type == 'textarea'"> |
|||
<el-input |
|||
v-if=" |
|||
formType == 'add' || (formType == 'edit' && !item.editDisable) |
|||
" |
|||
v-model="fmData[item.keyName]" |
|||
type="textarea" |
|||
class="item-input" |
|||
size="small" |
|||
clearable |
|||
show-word-limit |
|||
:rows="3" |
|||
:maxlength="item.maxlength || ''" |
|||
:placeholder="item.placeholder || '请输入'" |
|||
> |
|||
</el-input> |
|||
|
|||
<div class="item-show" v-else> |
|||
{{ fmData[item.keyName] || "--" }} |
|||
</div> |
|||
</template> |
|||
|
|||
<template v-if="item.type == 'number'"> |
|||
<el-input-number |
|||
v-model="fmData[item.keyName]" |
|||
class="item-number" |
|||
size="small" |
|||
clearable |
|||
:precision="item.precision || 0" |
|||
:step="item.step || 1" |
|||
:min="item.min || 0" |
|||
:max="item.max || 999999999999" |
|||
:placeholder="item.placeholder || '请输入'" |
|||
> |
|||
</el-input-number> |
|||
<span v-if="item.unitName">({{ item.unitName }})</span> |
|||
</template> |
|||
|
|||
<template v-else-if="item.type == 'select'"> |
|||
<el-select |
|||
v-model="fmData[item.keyName]" |
|||
:placeholder="item.placeholder || '请选择'" |
|||
size="small" |
|||
clearable |
|||
class="item-select" |
|||
> |
|||
<el-option |
|||
v-for="subItem in item.optionList" |
|||
:key="subItem.value" |
|||
:label="subItem.label" |
|||
:value="subItem.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</template> |
|||
|
|||
<template v-else-if="item.type == 'address'"> |
|||
<div class="address-item"> |
|||
<el-input |
|||
class="address-item-input" |
|||
:placeholder="item.placeholder || '请输入所在地址'" |
|||
v-model="fmData[item.keyName]" |
|||
:maxlength="item.maxlength || ''" |
|||
show-word-limit |
|||
> |
|||
</el-input> |
|||
<el-button |
|||
style="margin-left: 10px" |
|||
type="default" |
|||
size="small" |
|||
ref="mapSearch" |
|||
@click="handleSearchMap(item)" |
|||
>查询</el-button |
|||
> |
|||
<div id="app" class="div_map"></div> |
|||
<div style="margin-top: 10px" v-show="false"> |
|||
<span>经度</span> |
|||
<el-input |
|||
class="address-item-input2" |
|||
maxlength="50" |
|||
placeholder="请输入经度" |
|||
v-model="fmData[item.supKeys[0]]" |
|||
> |
|||
</el-input> |
|||
<span style="margin-left: 20px">纬度</span> |
|||
<el-input |
|||
class="address-item-input2" |
|||
maxlength="50" |
|||
placeholder="请输入纬度" |
|||
v-model="fmData[item.supKeys[1]]" |
|||
> |
|||
</el-input> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
</el-form-item> |
|||
</div> |
|||
|
|||
<div class="list" v-if="editParams2.length > 0"> |
|||
<el-form-item |
|||
v-for="item in editParams2" |
|||
label-width="150px" |
|||
style="display: block" |
|||
:key="'edit' + item.keyName" |
|||
:label="item.field" |
|||
:prop="item.keyName" |
|||
:rules="item.rules || []" |
|||
> |
|||
<template v-if="item.type == 'input'"> |
|||
<el-input |
|||
v-if=" |
|||
formType == 'add' || (formType == 'edit' && !item.editDisable) |
|||
" |
|||
v-model="fmData[item.keyName]" |
|||
class="item-input" |
|||
size="small" |
|||
clearable |
|||
show-word-limit |
|||
:maxlength="item.maxlength || ''" |
|||
:placeholder="item.placeholder || '请输入'" |
|||
> |
|||
</el-input> |
|||
|
|||
<div class="item-show" v-else> |
|||
{{ fmData[item.keyName] || "--" }} |
|||
</div> |
|||
</template> |
|||
|
|||
<template v-if="item.type == 'textarea'"> |
|||
<el-input |
|||
v-if=" |
|||
formType == 'add' || (formType == 'edit' && !item.editDisable) |
|||
" |
|||
v-model="fmData[item.keyName]" |
|||
type="textarea" |
|||
class="item-input" |
|||
size="small" |
|||
clearable |
|||
show-word-limit |
|||
:rows="3" |
|||
:maxlength="item.maxlength || ''" |
|||
:placeholder="item.placeholder || '请输入'" |
|||
> |
|||
</el-input> |
|||
|
|||
<div class="item-show" v-else> |
|||
{{ fmData[item.keyName] || "--" }} |
|||
</div> |
|||
</template> |
|||
|
|||
<template v-if="item.type == 'number'"> |
|||
<el-input-number |
|||
v-model="fmData[item.keyName]" |
|||
class="item-number" |
|||
size="small" |
|||
clearable |
|||
:precision="item.precision || 0" |
|||
:step="item.step || 1" |
|||
:min="item.min || 0" |
|||
:max="item.max || 999999999999" |
|||
:placeholder="item.placeholder || '请输入'" |
|||
> |
|||
</el-input-number> |
|||
<span v-if="item.unitName">({{ item.unitName }})</span> |
|||
</template> |
|||
|
|||
<template v-else-if="item.type == 'select'"> |
|||
<el-select |
|||
v-model="fmData[item.keyName]" |
|||
:placeholder="item.placeholder || '请选择'" |
|||
size="small" |
|||
clearable |
|||
class="item-select" |
|||
> |
|||
<el-option |
|||
v-for="subItem in item.optionList" |
|||
:key="subItem.value" |
|||
:label="subItem.label" |
|||
:value="subItem.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</template> |
|||
|
|||
<template v-else-if="item.type == 'address'"> |
|||
<div class="address-item"> |
|||
<el-input |
|||
class="address-item-input" |
|||
:placeholder="item.placeholder || '请输入所在地址'" |
|||
v-model="fmData[item.keyName]" |
|||
:maxlength="item.maxlength || ''" |
|||
show-word-limit |
|||
> |
|||
</el-input> |
|||
<el-button |
|||
style="margin-left: 10px" |
|||
type="default" |
|||
size="small" |
|||
@click="handleSearchMap(item)" |
|||
>查询</el-button |
|||
> |
|||
<div id="app" class="div_map"></div> |
|||
<div style="margin-top: 10px" v-show="false"> |
|||
<span>经度</span> |
|||
<el-input |
|||
class="address-item-input2" |
|||
maxlength="50" |
|||
placeholder="请输入经度" |
|||
v-model="fmData[item.supKeys[0]]" |
|||
> |
|||
</el-input> |
|||
<span style="margin-left: 20px">纬度</span> |
|||
<el-input |
|||
class="address-item-input2" |
|||
maxlength="50" |
|||
placeholder="请输入纬度" |
|||
v-model="fmData[item.supKeys[1]]" |
|||
> |
|||
</el-input> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
</el-form-item> |
|||
</div> |
|||
</el-form> |
|||
|
|||
<div class="div_btn resi-btns" v-if="!formBtnFixed"> |
|||
<el-button size="small" @click="handleCancle">取 消</el-button> |
|||
<el-button |
|||
v-if="formType != 'watch'" |
|||
type="primary" |
|||
size="small" |
|||
:disabled="btnDisable" |
|||
@click="handleComfirm" |
|||
>确 定</el-button |
|||
> |
|||
</div> |
|||
|
|||
<slot |
|||
v-bind:id="formId" |
|||
v-bind:info="fmData" |
|||
v-bind:formType="formType" |
|||
></slot> |
|||
</div> |
|||
|
|||
<div class="div_btn resi-btns" v-if="formBtnFixed"> |
|||
<el-button size="small" @click="handleCancle">取 消</el-button> |
|||
<el-button |
|||
v-if="formType != 'watch'" |
|||
type="primary" |
|||
size="small" |
|||
:disabled="btnDisable" |
|||
@click="handleComfirm" |
|||
>确 定</el-button |
|||
> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import nextTick from "dai-js/tools/nextTick"; |
|||
import Schema from "async-validator"; |
|||
|
|||
var map; |
|||
var search; |
|||
var markers; |
|||
var infoWindowList; |
|||
var geocoder; // 新建一个正逆地址解析类 |
|||
|
|||
export default { |
|||
props: { |
|||
formId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
formType: { |
|||
type: String, |
|||
default: "info", |
|||
}, |
|||
formBtnFixed: { |
|||
type: Boolean, |
|||
default: true, |
|||
}, |
|||
idName: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
addUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
editUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
delUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
infoUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
|
|||
editParams: { |
|||
type: Array, |
|||
default: () => [], |
|||
}, |
|||
editFixedParams: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
editParamsDiv: { |
|||
type: Number, |
|||
default: 0, |
|||
}, |
|||
editElseRules: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
iniLoaded: false, |
|||
|
|||
btnDisable: false, |
|||
|
|||
fmData: {}, |
|||
|
|||
editParams1: [], |
|||
editParams2: [], |
|||
}; |
|||
}, |
|||
components: {}, |
|||
computed: {}, |
|||
watch: { |
|||
editParams: { |
|||
handler() { |
|||
this.computeFmData(); |
|||
}, |
|||
deep: true, |
|||
}, |
|||
}, |
|||
|
|||
async mounted() { |
|||
this.initForm(); |
|||
}, |
|||
|
|||
methods: { |
|||
async initForm() { |
|||
this.iniFmData(); |
|||
|
|||
if (this.formId && this.formType != "add") { |
|||
this.getInfo(); |
|||
} |
|||
}, |
|||
|
|||
computeFmData() { |
|||
console.log(this.fmData); |
|||
}, |
|||
|
|||
iniFmData() { |
|||
const { editParams, fmData, editParamsDiv } = this; |
|||
editParams.forEach((item, index) => { |
|||
fmData[item.keyName] = item.value || ""; |
|||
if (item.supValues) { |
|||
item.supValues.forEach((value, index) => { |
|||
fmData[item.supKeys[index]] = value; |
|||
}); |
|||
} |
|||
|
|||
if (item.type == "select") { |
|||
if (item.optionUrl) { |
|||
this.getFmOptions( |
|||
index, |
|||
item.optionUrl, |
|||
item.optionUrlParams || {} |
|||
); |
|||
} |
|||
} else if (item.type == "address") { |
|||
this.$nextTick(async () => { |
|||
await nextTick(300); |
|||
this.initMap(item); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
this.fmData = { ...fmData }; |
|||
if (editParamsDiv) { |
|||
this.editParams1 = editParams.slice(0, editParamsDiv); |
|||
this.editParams2 = editParams.slice(editParamsDiv); |
|||
} else { |
|||
this.editParams1 = editParams; |
|||
} |
|||
console.log("------------------------------------", this.fmData); |
|||
this.iniLoaded = true; |
|||
}, |
|||
|
|||
async getFmOptions(index, url, params) { |
|||
const { data, code, msg } = await requestPost(url, { |
|||
...params, |
|||
}); |
|||
|
|||
if (code === 0) { |
|||
this.editParams[index].optionList = data || []; |
|||
} else { |
|||
this.$message.error("请求检索基础数据失败!"); |
|||
} |
|||
}, |
|||
|
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap(item) { |
|||
let { latitude, longitude } = this.$store.state.user; |
|||
if (!latitude || latitude == "" || latitude == "0") { |
|||
latitude = 39.9088810666821; |
|||
longitude = 116.39743841556731; |
|||
} |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(latitude, longitude); |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById("app"), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 15, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45, // 设置地图旋转角度 |
|||
}); |
|||
|
|||
search = new window.TMap.service.Search({ pageSize: 10 }); |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [], |
|||
}); |
|||
infoWindowList = Array(10); |
|||
|
|||
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|||
|
|||
// 监听地图平移结束 |
|||
map.on("panend", (e) => { |
|||
this.handleMoveCenter(item, e); |
|||
}); |
|||
// this.handleMoveCenter(item); |
|||
}, |
|||
|
|||
setMarker(lat, lng) { |
|||
markers.setGeometries([]); |
|||
markers.add([ |
|||
{ |
|||
id: "4", |
|||
styleId: "marker", |
|||
position: new TMap.LatLng(lat, lng), |
|||
properties: { |
|||
title: "marker4", |
|||
}, |
|||
}, |
|||
]); |
|||
}, |
|||
|
|||
handleSearchMap(item) { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close(); |
|||
}); |
|||
infoWindowList.length = 0; |
|||
markers.setGeometries([]); |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.fmData[item.keyName], |
|||
bounds: map.getBounds(), |
|||
}) |
|||
.then((result) => { |
|||
let { data } = result; |
|||
if (Array.isArray(data) && data.length > 0) { |
|||
const { |
|||
location: { lat, lng }, |
|||
} = data[0]; |
|||
map.setCenter(new TMap.LatLng(lat, lng)); |
|||
this.setMarker(lat, lng); |
|||
// item.supValues[0] = lng; |
|||
// item.supValues[1] = lat; |
|||
this.fmData[item.supKeys[0]] = lng; |
|||
this.fmData[item.supKeys[1]] = lat; |
|||
} else { |
|||
this.$message.error("未检索到相关位置坐标"); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
handleMoveCenter(item, e) { |
|||
console.log(e); |
|||
//修改地图中心点 |
|||
const center = map.getCenter(); |
|||
const lat = center.getLat(); |
|||
const lng = center.getLng(); |
|||
// item.supValues[0] = lng; |
|||
// item.supValues[1] = lat; |
|||
this.fmData[item.supKeys[0]] = lng; |
|||
this.fmData[item.supKeys[1]] = lat; |
|||
this.setMarker(lat, lng); |
|||
|
|||
if (e && e.originalEvent) { |
|||
geocoder |
|||
.getAddress({ location: new TMap.LatLng(lat, lng) }) // 将给定的坐标位置转换为地址 |
|||
.then((result) => { |
|||
this.fmData[item.keyName] = result.result.address; |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
async getInfo() { |
|||
let url = this.infoUrl; |
|||
if (!url) return; |
|||
const { idName, formId } = this; |
|||
|
|||
if (url.endsWith("/")) { |
|||
url += formId; |
|||
} |
|||
|
|||
const params = { |
|||
[idName]: formId, |
|||
}; |
|||
|
|||
const { data, code, msg } = await requestPost(url, params); |
|||
if (code === 0) { |
|||
this.fmData = { |
|||
...this.fmData, |
|||
...data, |
|||
}; |
|||
|
|||
await nextTick(600); |
|||
if (map) { |
|||
if (data.latitude) { |
|||
map.setCenter(new TMap.LatLng(data.latitude, data.longitude)); |
|||
} else { |
|||
if (this.formType == "edit" && this.$refs && this.$refs.mapSearch) { |
|||
this.$refs.mapSearch[0].handleClick(); |
|||
} |
|||
} |
|||
} |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
watchImg(src) { |
|||
window.open(src); |
|||
}, |
|||
|
|||
async handleComfirm() { |
|||
this.btnDisable = true; |
|||
setTimeout(() => { |
|||
this.btnDisable = false; |
|||
}, 5000); |
|||
|
|||
console.log(this.$refs["ref_form"]); |
|||
|
|||
this.$refs["ref_form"].validate((valid, messageObj) => { |
|||
console.log(valid, messageObj); |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj); |
|||
this.btnDisable = false; |
|||
} else { |
|||
if (this.editElseRules) { |
|||
const validator = new Schema(this.editElseRules); |
|||
validator |
|||
.validate(this.fmData) |
|||
.then(() => { |
|||
this.submit(); |
|||
}) |
|||
.catch(({ err, fields }) => { |
|||
console.log("--------------", err, fields); |
|||
app.util.validateRule(fields); |
|||
}); |
|||
} else { |
|||
this.submit(); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
async submit() { |
|||
let url = ""; |
|||
let params = { |
|||
...this.fmData, |
|||
...this.editFixedParams, |
|||
// serviceType: this.fmData.serviceTypeArr.join(","), |
|||
}; |
|||
|
|||
if (this.formType === "add") { |
|||
url = this.addUrl; |
|||
} else { |
|||
url = this.editUrl; |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params); |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "操作成功", |
|||
}); |
|||
this.$emit("afterEdit"); |
|||
this.btnDisable = false; |
|||
} else { |
|||
this.btnDisable = false; |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
handleCancle() { |
|||
this.$emit("close"); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.m-fm { |
|||
margin-top: 30px; |
|||
|
|||
&.z-div { |
|||
display: flex; |
|||
|
|||
.item-input { |
|||
width: 225px; |
|||
} |
|||
.item-select { |
|||
width: 225px; |
|||
} |
|||
.item-number { |
|||
width: 125px; |
|||
} |
|||
|
|||
.address-item { |
|||
width: 450px; |
|||
|
|||
.address-item-input { |
|||
width: 85%; |
|||
} |
|||
.address-item-input2 { |
|||
margin-left: 5px; |
|||
width: 40%; |
|||
} |
|||
} |
|||
} |
|||
.item-input { |
|||
width: 450px; |
|||
} |
|||
.item-select { |
|||
width: 225px; |
|||
} |
|||
.item-number { |
|||
width: 225px; |
|||
} |
|||
|
|||
.address-item { |
|||
width: 450px; |
|||
|
|||
.address-item-input { |
|||
width: 85%; |
|||
} |
|||
.address-item-input2 { |
|||
margin-left: 5px; |
|||
width: 40%; |
|||
} |
|||
} |
|||
.div_map { |
|||
margin-top: 10px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,645 @@ |
|||
<template> |
|||
<div class="div_main"> |
|||
<div v-show="true"> |
|||
<div class="div_search" ref="ref_search"> |
|||
<el-form :inline="true" ref="ref_searchform" label-width="100px"> |
|||
<div> |
|||
<el-form-item |
|||
v-for="item in searchParams" |
|||
:key="'serach' + item.keyName" |
|||
:label="item.field" |
|||
:prop="item.keyName" |
|||
> |
|||
<template v-if="item.type == 'input'"> |
|||
<el-input |
|||
v-model="item.value" |
|||
class="item_width_1" |
|||
size="small" |
|||
clearable |
|||
:placeholder="item.placeholder || '请输入'" |
|||
> |
|||
</el-input> |
|||
</template> |
|||
<template v-else-if="item.type == 'select'"> |
|||
<el-select |
|||
v-model="item.value" |
|||
:placeholder="item.placeholder || '请选择'" |
|||
size="small" |
|||
clearable |
|||
class="item_width_2" |
|||
> |
|||
<el-option |
|||
v-for="item in item.optionList" |
|||
:key="'serach' + item.keyName + item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</template> |
|||
</el-form-item> |
|||
|
|||
<el-button |
|||
style="margin-left: 30px; margin-bottom: 20px" |
|||
size="small" |
|||
class="diy-button--search" |
|||
@click="handleSearch" |
|||
>查询</el-button |
|||
> |
|||
<el-button |
|||
style="margin-left: 10px; margin-bottom: 20px" |
|||
size="small" |
|||
class="diy-button--reset" |
|||
@click="resetSearch" |
|||
>重置</el-button |
|||
> |
|||
</div> |
|||
</el-form> |
|||
</div> |
|||
|
|||
<div class="div_table"> |
|||
<div class="div_btn"> |
|||
<el-button |
|||
class="diy-button--add" |
|||
v-if="addUrl" |
|||
size="small" |
|||
@click="handleAdd" |
|||
>新增</el-button |
|||
> |
|||
|
|||
<el-button |
|||
v-if="mubanUrl" |
|||
class="btn_upload diy-button--export" |
|||
size="small" |
|||
@click="handleExportModule('room')" |
|||
>下载模板</el-button |
|||
> |
|||
|
|||
<el-upload |
|||
v-if="importUrl" |
|||
ref="upload" |
|||
class="upload-btn" |
|||
action="uploadUlr" |
|||
:limit="1" |
|||
:accept="'.xls,.xlsx'" |
|||
:with-credentials="true" |
|||
:show-file-list="false" |
|||
:auto-upload="true" |
|||
:before-upload="beforeExcelUpload" |
|||
:http-request="uploadHttpRequest" |
|||
> |
|||
<el-button size="small" class="btn_upload diy-button--delete" |
|||
>导入</el-button |
|||
> |
|||
</el-upload> |
|||
|
|||
<el-button |
|||
v-if="exportUrl" |
|||
@click="handleExport" |
|||
class="btn_upload diy-button--reset" |
|||
size="small" |
|||
>导出</el-button |
|||
> |
|||
</div> |
|||
|
|||
<el-table |
|||
:data="tableData" |
|||
border |
|||
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }" |
|||
class="table" |
|||
style="width: 100%" |
|||
:height="maxTableHeight" |
|||
> |
|||
<template v-for="item in tableParams" :prop="item.keyName"> |
|||
<el-table-column |
|||
v-if="item.type == 'no'" |
|||
:key="'table-no' + item.keyName" |
|||
:label="item.field" |
|||
fixed="left" |
|||
type="index" |
|||
align="center" |
|||
width="50" |
|||
/> |
|||
|
|||
<el-table-column |
|||
v-else-if="item.type == 'text'" |
|||
:key="'table' + item.keyName" |
|||
:prop="item.keyName" |
|||
:label="item.field" |
|||
align="center" |
|||
:width="item.width || ''" |
|||
:show-overflow-tooltip="true" |
|||
> |
|||
</el-table-column> |
|||
</template> |
|||
|
|||
<el-table-column |
|||
fixed="right" |
|||
label="操作" |
|||
align="center" |
|||
width="200" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
@click="handleWatch(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class=".div-table-button--detail" |
|||
>查看</el-button |
|||
> |
|||
<el-button |
|||
v-if="editUrl && editAuth(scope.row)" |
|||
@click="handleEdit(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--edit" |
|||
>{{ editBtnName(scope.row) }}</el-button |
|||
> |
|||
<el-popconfirm |
|||
v-if="delUrl && delAuth(scope.row)" |
|||
title="删除之后无法回复,确认删除?" |
|||
@onConfirm="handleDelete(scope.row, scope.$index)" |
|||
@confirm="handleDelete(scope.row, scope.$index)" |
|||
> |
|||
<el-button |
|||
slot="reference" |
|||
type="text" |
|||
size="small" |
|||
style="margin-left: 10px" |
|||
class="div-table-button--delete" |
|||
>删除</el-button |
|||
> |
|||
</el-popconfirm> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<div> |
|||
<el-pagination |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="pageNo" |
|||
:page-sizes="[20, 50, 100, 200]" |
|||
:page-size="parseInt(pageSize)" |
|||
layout="sizes, prev, pager, next, total" |
|||
:total="total" |
|||
> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 修改弹出框 --> |
|||
<el-dialog |
|||
v-if="formShow" |
|||
:visible.sync="formShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="formTitle" |
|||
:width="editParamsDiv ? '1100px' : '850px'" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
@closed="handleClose" |
|||
> |
|||
<edit-form |
|||
ref="eleEditForm" |
|||
:idName="idName" |
|||
:formId="formId" |
|||
:formType="formType" |
|||
:infoUrl="infoUrl" |
|||
:addUrl="addUrl" |
|||
:editUrl="editUrl" |
|||
:editParams="editParams" |
|||
:editParamsDiv="editParamsDiv" |
|||
:editElseRules="editElseRules" |
|||
:editFixedParams="editFixedParams" |
|||
:formBtnFixed="formBtnFixed" |
|||
@close="handleClose" |
|||
@afterEdit="handleEditSuccess" |
|||
> |
|||
<template v-slot="{ id, formType, info }"> |
|||
<slot |
|||
name="editElse" |
|||
v-bind:id="id" |
|||
v-bind:formType="formType" |
|||
v-bind:info="info" |
|||
></slot> |
|||
</template> |
|||
</edit-form> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import { mapGetters } from "vuex"; |
|||
import axios from "axios"; |
|||
import editForm from "./cpts/edit"; |
|||
import nextTick from "dai-js/tools/nextTick"; |
|||
|
|||
export default { |
|||
components: { editForm }, |
|||
|
|||
props: { |
|||
searchParams: { |
|||
type: Array, |
|||
default: () => [], |
|||
}, |
|||
searchUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
|
|||
tableParams: { |
|||
type: Array, |
|||
default: () => [], |
|||
}, |
|||
|
|||
tableUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
|
|||
addUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
editUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
delUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
infoUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
exportUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
importUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
mubanUrl: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
|
|||
editAuth: { |
|||
type: Function, |
|||
default: () => true, |
|||
}, |
|||
editBtnName: { |
|||
type: Function, |
|||
default: () => "编辑", |
|||
}, |
|||
delAuth: { |
|||
type: Function, |
|||
default: () => true, |
|||
}, |
|||
|
|||
editParams: { |
|||
type: Array, |
|||
default: () => [], |
|||
}, |
|||
editElseRules: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
editFixedParams: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
editParamsDiv: { |
|||
type: Number, |
|||
default: 0, |
|||
}, |
|||
|
|||
idName: { |
|||
type: String, |
|||
default: "id", |
|||
}, |
|||
|
|||
formBtnFixed: { |
|||
type: Boolean, |
|||
default: true, |
|||
}, |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
tableData: [], |
|||
|
|||
pageNo: 1, |
|||
pageSize: window.localStorage.getItem("pageSize") || 20, |
|||
total: 1, |
|||
|
|||
formId: "", |
|||
formShow: false, |
|||
formTitle: "详情", |
|||
formType: "", // 列表list 新增add 修改edit 详情info |
|||
|
|||
ref_search_height: 100, |
|||
}; |
|||
}, |
|||
|
|||
computed: { |
|||
maxTableHeight() { |
|||
const { ref_search_height } = this; |
|||
return this.$store.state.inIframe |
|||
? this.clientHeight - ref_search_height - 260 + this.iframeHeight |
|||
: this.clientHeight - ref_search_height - 260; |
|||
}, |
|||
...mapGetters(["clientHeight", "iframeHeight"]), |
|||
}, |
|||
|
|||
watch: {}, |
|||
|
|||
async mounted() { |
|||
console.log(this.$store.state); |
|||
this.user = this.$store.state.user; |
|||
|
|||
this.agencyId = this.user.agencyId; |
|||
|
|||
this.iniSearchData(); |
|||
|
|||
this.getTableData(); |
|||
|
|||
await nextTick(100); |
|||
this.computeSearchHeight(); |
|||
}, |
|||
methods: { |
|||
computeSearchHeight() { |
|||
this.ref_search_height = this.$refs["ref_search"].clientHeight; |
|||
console.log(this.$refs["ref_search"]); |
|||
console.log(this.ref_search_height); |
|||
}, |
|||
|
|||
iniSearchData() { |
|||
const { searchParams } = this; |
|||
searchParams.forEach((item, index) => { |
|||
if (item.type == "select") { |
|||
if (item.optionUrl) { |
|||
this.getFmOptions( |
|||
index, |
|||
item.optionUrl, |
|||
item.optionUrlParams || {} |
|||
); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
async getFmOptions(index, url, params) { |
|||
const { data, code, msg } = await requestPost(url, { |
|||
...params, |
|||
}); |
|||
|
|||
if (code === 0) { |
|||
this.searchParams[index].optionList = data || []; |
|||
} else { |
|||
this.$message.error("请求检索基础数据失败!"); |
|||
} |
|||
}, |
|||
|
|||
handleSearch(val) { |
|||
this.pageNo = 1; |
|||
|
|||
this.getTableData(); |
|||
}, |
|||
|
|||
beforeExcelUpload(file) { |
|||
console.log("file", file); |
|||
const isType = file.type === "application/vnd.ms-excel"; |
|||
const isTypeComputer = |
|||
file.type === |
|||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; |
|||
const fileType = isType || isTypeComputer; |
|||
const isLt1M = file.size / 1024 / 1024 < 10; |
|||
if (!fileType) { |
|||
this.$message.error("上传文件只能是xls/xlsx格式!"); |
|||
} |
|||
|
|||
if (!isLt1M) { |
|||
this.$message.error("上传文件大小不能超过 10MB!"); |
|||
} |
|||
return fileType && isLt1M; |
|||
}, |
|||
async uploadHttpRequest(file) { |
|||
let { importUrl: url } = this; |
|||
if (!url) return; |
|||
|
|||
this.$message({ |
|||
showClose: true, |
|||
message: "导入中,请到系统管理-导入记录中查看进度", |
|||
duration: 0, |
|||
}); |
|||
|
|||
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|||
formData.append("file", file.file); //添加文件对象 |
|||
await this.$http |
|||
.post(url, formData) |
|||
.then((res) => { |
|||
console.log("res-up", res); |
|||
if (res.data.code == 0 && res.data.msg == "success") { |
|||
// this.$message.success('导入成功') |
|||
this.getTableData(); |
|||
this.$refs.upload.clearFiles(); |
|||
} else this.$message.error(res.data.msg); |
|||
}) |
|||
.catch((err) => { |
|||
console.log("失败", err); |
|||
file.onError(); //上传失败的文件会从文件列表中删除 |
|||
// this.$message.error('导入失败') |
|||
}); |
|||
}, |
|||
|
|||
async handleExportModule() { |
|||
let { mubanUrl: url } = this; |
|||
if (!url) return; |
|||
|
|||
await this.$http({ |
|||
method: "POST", |
|||
url, |
|||
responseType: "blob", |
|||
data: {}, |
|||
}) |
|||
.then((res) => { |
|||
// this.download(res.data, title + '.xls') |
|||
if (res.headers["content-disposition"]) { |
|||
let fileName = window.decodeURI( |
|||
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|||
); |
|||
console.log("filename", fileName); |
|||
let blob = new Blob([res.data], { |
|||
type: "application/vnd.ms-excel", |
|||
}); |
|||
var url = window.URL.createObjectURL(blob); |
|||
var aLink = document.createElement("a"); |
|||
aLink.style.display = "none"; |
|||
aLink.href = url; |
|||
aLink.setAttribute("download", fileName); |
|||
document.body.appendChild(aLink); |
|||
aLink.click(); |
|||
document.body.removeChild(aLink); //下载完成移除元素 |
|||
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|||
} else this.$message.error("下载失败"); |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err", err); |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
async handleExport() { |
|||
const { exportUrl: url } = this; |
|||
if (!url) return; |
|||
|
|||
const { pageSize, pageNo } = this; |
|||
|
|||
axios({ |
|||
url: window.SITE_CONFIG["apiURL"] + url, |
|||
method: "post", |
|||
data: { |
|||
pageSize, |
|||
pageNo, |
|||
...this.computeFmData(), |
|||
}, |
|||
responseType: "blob", |
|||
}) |
|||
.then((res) => { |
|||
let fileName = window.decodeURI( |
|||
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|||
); |
|||
console.log("filename", fileName); |
|||
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" }); |
|||
var url = window.URL.createObjectURL(blob); |
|||
var aLink = document.createElement("a"); |
|||
aLink.style.display = "none"; |
|||
aLink.href = url; |
|||
aLink.setAttribute("download", fileName); |
|||
document.body.appendChild(aLink); |
|||
aLink.click(); |
|||
document.body.removeChild(aLink); //下载完成移除元素 |
|||
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|||
}) |
|||
.catch((err) => { |
|||
console.log("获取导出情失败", err); |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
handleAdd() { |
|||
this.formType = "add"; |
|||
this.formTitle = "新增"; |
|||
this.formShow = true; |
|||
}, |
|||
|
|||
handleWatch(row) { |
|||
const { idName } = this; |
|||
this.formType = "watch"; |
|||
this.formId = row[idName]; |
|||
this.formTitle = "查看"; |
|||
this.formShow = true; |
|||
}, |
|||
|
|||
handleEdit(row) { |
|||
const { idName } = this; |
|||
this.formType = "edit"; |
|||
this.formId = row[idName]; |
|||
this.formTitle = "修改"; |
|||
this.formShow = true; |
|||
}, |
|||
|
|||
handleClose() { |
|||
this.formShow = false; |
|||
this.getTableData(); |
|||
}, |
|||
|
|||
handleEditSuccess() { |
|||
this.handleClose(); |
|||
// this.getTableData(); |
|||
}, |
|||
|
|||
async handleDelete(rowData, rowIndex) { |
|||
console.log(rowData, rowIndex); |
|||
let { delUrl: url } = this; |
|||
if (!url) return; |
|||
|
|||
const { tableData, idName } = this; |
|||
const idValue = tableData[rowIndex][idName]; |
|||
if (url.endsWith("/")) { |
|||
url += idValue; |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, { |
|||
[idName]: idValue, |
|||
}); |
|||
|
|||
if (code === 0) { |
|||
this.$message.success("删除成功!"); |
|||
this.getTableData(); |
|||
} else { |
|||
this.$message.error("操作失败!"); |
|||
} |
|||
}, |
|||
|
|||
computeFmData() { |
|||
let fmData = {}; |
|||
this.searchParams.forEach((item) => { |
|||
fmData[item.keyName] = item.value; |
|||
}); |
|||
return fmData; |
|||
}, |
|||
|
|||
async getTableData() { |
|||
const { tableUrl: url, searchParams } = this; |
|||
if (!url) return; |
|||
|
|||
const { pageSize, pageNo } = this; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
pageSize, |
|||
pageNo, |
|||
...this.computeFmData(), |
|||
}); |
|||
|
|||
if (code === 0) { |
|||
this.total = data.total || 0; |
|||
this.tableData = data.list |
|||
? data.list.map((item) => { |
|||
return item; |
|||
}) |
|||
: []; |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
handleSizeChange(val) { |
|||
this.pageSize = val; |
|||
window.localStorage.setItem("pageSize", val); |
|||
this.getTableData(); |
|||
}, |
|||
handleCurrentChange(val) { |
|||
this.pageNo = val; |
|||
this.getTableData(); |
|||
}, |
|||
|
|||
resetSearch() { |
|||
this.searchParams.forEach((item) => { |
|||
item.value = ""; |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/buttonstyle.scss"; |
|||
@import "@/assets/scss/modules/management/list-main.scss"; |
|||
// @import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|||
</style> |
|||
@ -0,0 +1,588 @@ |
|||
<template> |
|||
<div class="div_main"> |
|||
<div class="div_search"> |
|||
<el-form :inline="true" |
|||
:model="formData" |
|||
ref="ref_searchform" |
|||
:label-width="'100px'"> |
|||
|
|||
<el-form-item label="场所名称" |
|||
prop="name"> |
|||
<el-input v-model="formData.name" |
|||
class="item_width_1" |
|||
clearable |
|||
size="small" |
|||
placeholder="请输入内容"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="场所分类" |
|||
prop="serviceMatter"> |
|||
<el-select class="item_width_1" |
|||
v-model="formData.category" |
|||
placeholder="请选择" |
|||
size="small" |
|||
clearable> |
|||
<el-option v-for="item in serviceList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
|
|||
<el-button style="margin-left:10px" |
|||
class="diy-button--search" |
|||
size="small" |
|||
@click="handleSearch">查询</el-button> |
|||
<el-button style="margin-left:10px" |
|||
class="diy-button--reset" |
|||
size="small" |
|||
@click="resetSearch">重置</el-button> |
|||
|
|||
</el-form> |
|||
</div> |
|||
<div class="div_table"> |
|||
<div class="div_btn"> |
|||
<el-button class="diy-button--add" |
|||
size="small" |
|||
@click="handleAdd">新增</el-button> |
|||
<el-button class="diy-button--search" |
|||
style="margin-left:10px" |
|||
size="small" |
|||
@click="handleExportModule('room')">下载模板</el-button> |
|||
<el-upload ref="upload" |
|||
:multiple='false' |
|||
:show-file-list='false' |
|||
:before-upload="beforeUpload" |
|||
action="" |
|||
accept=".xls,.xlsx" |
|||
:limit="1" |
|||
:on-exceed="handleExceed" |
|||
:http-request="uploadFile"> |
|||
<el-button style="margin-left:10px" |
|||
size="small" |
|||
class="diy-button--delete">导入</el-button> |
|||
|
|||
</el-upload> |
|||
<el-button style="float:left;margin-left:10px" |
|||
class="diy-button--reset" |
|||
size="small" |
|||
@click="handleExport">导出</el-button> |
|||
|
|||
</div> |
|||
|
|||
<el-table class="table" |
|||
:data="tableData" |
|||
border |
|||
:height="tableHeight" |
|||
v-loading="tableLoading" |
|||
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" |
|||
style="width: 100%"> |
|||
<el-table-column label="序号" |
|||
header-align="center" |
|||
align="center" |
|||
type="index" |
|||
width="50"></el-table-column> |
|||
|
|||
<el-table-column prop="name" |
|||
header-align="center" |
|||
align="center" |
|||
label="场所名称" |
|||
min-width="100"> |
|||
</el-table-column> |
|||
<el-table-column prop="categoryName" |
|||
header-align="center" |
|||
align="center" |
|||
label="场所类别" |
|||
min-width="80"> |
|||
</el-table-column> |
|||
<el-table-column prop="areaCovered" |
|||
header-align="center" |
|||
align="center" |
|||
label="占地面积" |
|||
show-overflow-tooltip |
|||
min-width="250"> |
|||
|
|||
</el-table-column> |
|||
<el-table-column prop="capacity" |
|||
header-align="center" |
|||
align="center" |
|||
label="容纳人数" |
|||
width="80"> |
|||
</el-table-column> |
|||
<el-table-column prop="address" |
|||
header-align="center" |
|||
align="center" |
|||
show-overflow-tooltip |
|||
label="地址" |
|||
width="120"> |
|||
</el-table-column> |
|||
|
|||
<el-table-column label="操作" |
|||
fixed="right" |
|||
width="250" |
|||
header-align="center" |
|||
align="center" |
|||
class="operate"> |
|||
<template slot-scope="scope"> |
|||
|
|||
<el-button type="text" |
|||
class="div-table-button--detail" |
|||
size="small" |
|||
@click="handleDetail(scope.row)">查看</el-button> |
|||
<el-button v-if="scope.row.agencyId === agencyId && (scope.row.longitude === '' || scope.row.longitude === null || scope.row.latitude === '' || scope.row.latitude === null) && scope.row.sourceType === 'import'" |
|||
type="text" |
|||
class="div-table-button--edit" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">待完善</el-button> |
|||
<el-button v-else-if="scope.row.agencyId === agencyId && (scope.row.longitude !== '' && scope.row.longitude !== null && scope.row.latitude !== '' && scope.row.latitude !== null) && scope.row.sourceType === 'import'" |
|||
type="text" |
|||
class="div-table-button--edit" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">修改</el-button> |
|||
<el-button v-else-if="scope.row.agencyId === agencyId && scope.row.sourceType === 'add'" |
|||
type="text" |
|||
class="div-table-button--edit" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">修改</el-button> |
|||
|
|||
<el-button v-if="scope.row.agencyId === agencyId" |
|||
type="text" |
|||
class="div-table-button--delete" |
|||
size="small" |
|||
@click="handleDelete(scope.row)">删除</el-button> |
|||
|
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div> |
|||
<el-pagination @size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="pageNo" |
|||
:page-sizes="[20, 50, 100, 200]" |
|||
:page-size="pageSize" |
|||
layout="sizes, prev, pager, next, total" |
|||
:total="total"> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 修改弹出框 --> |
|||
<el-dialog :visible.sync="formShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="formTitle" |
|||
:destroy-on-close="true" |
|||
width="950px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
@closed="editDiaClose"> |
|||
<csgl-form ref="ref_form" |
|||
:typeList="typeList" |
|||
@dialogCancle="addFormCancle" |
|||
@dialogOk="addFormOk"></csgl-form> |
|||
</el-dialog> |
|||
|
|||
<el-dialog :visible.sync="detailShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="'城市管理详情'" |
|||
width="950px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
@closed="diaClose"> |
|||
<csgl-detail ref="ref_detail" |
|||
@diaClose="diaClose"></csgl-detail> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import csglForm from './csglForm' |
|||
import csglDetail from './csglDetail' |
|||
|
|||
import { requestPost } from "@/js/dai/request"; |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
loading: false, |
|||
total: 0, |
|||
pageSize: 20, |
|||
pageNo: 0, |
|||
tableLoading: false, |
|||
agencyId: '', |
|||
name: '', |
|||
category: '', |
|||
typeList: [],//分类list |
|||
serviceList: [], |
|||
|
|||
formData: { |
|||
name: '' |
|||
}, |
|||
|
|||
tableData: [], |
|||
|
|||
//form相关 |
|||
formShow: false, |
|||
formTitle: '新增场所', |
|||
detailShow: false, |
|||
|
|||
files: "", |
|||
fileName: "", |
|||
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import' |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
csglForm, csglDetail |
|||
}, |
|||
async created () { |
|||
|
|||
}, |
|||
async mounted () { |
|||
//获取服务事项 |
|||
await this.loadService() |
|||
|
|||
const { user } = this.$store.state |
|||
this.agencyId = user.agencyId |
|||
|
|||
await this.loadTable() |
|||
}, |
|||
|
|||
methods: { |
|||
handleSearch () { |
|||
this.loadTable() |
|||
}, |
|||
async handleExportModule () { |
|||
let url = "/gov/org/icCityManagement/download"; |
|||
|
|||
let params = {}; |
|||
await this.$http({ |
|||
method: "POST", |
|||
url, |
|||
responseType: "blob", |
|||
data: params, |
|||
}) |
|||
.then((res) => { |
|||
// this.download(res.data, title + '.xls') |
|||
if (res.headers["content-disposition"]) { |
|||
let fileName = window.decodeURI( |
|||
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|||
); |
|||
console.log("filename", fileName); |
|||
let blob = new Blob([res.data], { |
|||
type: "application/vnd.ms-excel", |
|||
}); |
|||
var url = window.URL.createObjectURL(blob); |
|||
var aLink = document.createElement("a"); |
|||
aLink.style.display = "none"; |
|||
aLink.href = url; |
|||
aLink.setAttribute("download", fileName); |
|||
document.body.appendChild(aLink); |
|||
aLink.click(); |
|||
document.body.removeChild(aLink); //下载完成移除元素 |
|||
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|||
} else this.$message.error("下载失败"); |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err", err); |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
//获取服务事项下拉框 |
|||
async loadService () { |
|||
// const url = "/heart/serviceitem/dict-list" |
|||
const url = "/gov/org/coverage/dict-select-list/city_management" |
|||
|
|||
|
|||
let params = { |
|||
// parentCategoryCode: '1010' |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.serviceList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
async loadTable () { |
|||
this.tableLoading = true |
|||
|
|||
const url = "/gov/org/icCityManagement/list" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icCityManagement/list" |
|||
let params = { |
|||
pageSize: this.pageSize, |
|||
pageNo: this.pageNo, |
|||
category: this.category, |
|||
...this.formData |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.total = data.total |
|||
this.tableData = data.list |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
this.tableLoading = false |
|||
}, |
|||
|
|||
editDiaClose () { |
|||
this.$refs.ref_form.resetData() |
|||
this.formShow = false |
|||
}, |
|||
diaClose () { |
|||
this.detailShow = false |
|||
this.finishDiaShow = false |
|||
this.scoreDiaShow = false |
|||
}, |
|||
|
|||
handleDetail (row) { |
|||
this.detailShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_detail.initForm(row) |
|||
}) |
|||
}, |
|||
|
|||
handleAdd () { |
|||
this.formTitle = '新增' |
|||
this.formShow = 'edit' |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('add', null) |
|||
}) |
|||
}, |
|||
|
|||
handleEdit (row) { |
|||
this.formTitle = '修改' |
|||
this.formShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('edit', row.icCityManagementId) |
|||
}) |
|||
}, |
|||
|
|||
addFormCancle () { |
|||
this.formShow = false |
|||
}, |
|||
addFormOk () { |
|||
this.formShow = false |
|||
this.loadTable() |
|||
}, |
|||
|
|||
async handleDelete (row) { |
|||
|
|||
this.$confirm("确认删除?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}) |
|||
.then(() => { |
|||
this.deleteUnit(row) |
|||
}) |
|||
.catch(err => { |
|||
if (err == "cancel") { |
|||
|
|||
} |
|||
|
|||
}); |
|||
}, |
|||
|
|||
async deleteUnit (row) { |
|||
const url = "/gov/org/icCityManagement/del" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icCityManagement/del" |
|||
|
|||
let params = { |
|||
icCityManagementId: row.icCityManagementId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "删除成功" |
|||
}); |
|||
|
|||
this.loadTable() |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
//重置搜索条件 |
|||
resetSearch () { |
|||
this.formData = { |
|||
serviceMatter: '', |
|||
type: '', |
|||
contact: '', |
|||
contactMobile: '' |
|||
} |
|||
this.pageSize = 10 |
|||
this.pageNo = 0 |
|||
// this.loadTable() |
|||
}, |
|||
|
|||
//导出表格 |
|||
async handleExport () { |
|||
let title = '城市管理图层' |
|||
|
|||
const url = "/gov/org/icCityManagement/export" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icCityManagement/export" |
|||
let params = { |
|||
...this.formData |
|||
} |
|||
|
|||
app.ajax.exportFilePost( |
|||
url, |
|||
params, |
|||
(data, rspMsg) => { |
|||
|
|||
this.download(data, title + '.xls') |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.$message.error(rspMsg); |
|||
} |
|||
); |
|||
|
|||
}, |
|||
|
|||
// 下载文件 |
|||
download (data, fileName) { |
|||
if (!data) { |
|||
return |
|||
} |
|||
|
|||
var csvData = new Blob([data]) |
|||
|
|||
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
|||
window.navigator.msSaveOrOpenBlob(csvData, fileName); |
|||
} |
|||
// for Non-IE (chrome, firefox etc.) |
|||
else { |
|||
var a = document.createElement('a'); |
|||
document.body.appendChild(a); |
|||
a.style = 'display: none'; |
|||
var url = window.URL.createObjectURL(csvData); |
|||
a.href = url; |
|||
a.download = fileName; |
|||
a.click(); |
|||
a.remove(); |
|||
window.URL.revokeObjectURL(url); |
|||
} |
|||
|
|||
}, |
|||
|
|||
// 上传文件之前的钩子 |
|||
beforeUpload (file) { |
|||
this.files = file; |
|||
|
|||
const isText = file.type === 'application/vnd.ms-excel' |
|||
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|||
|
|||
if (!isText && !isTextComputer) { |
|||
this.$message.error('请选择正确格式的文件') |
|||
return false |
|||
} else { |
|||
this.fileName = file.name; |
|||
return true |
|||
} |
|||
|
|||
}, |
|||
// 上传文件个数超过定义的数量 |
|||
handleExceed (files, fileList) { |
|||
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) |
|||
}, |
|||
|
|||
async uploadFile () { |
|||
this.loading = true |
|||
|
|||
if (this.fileName == "") { |
|||
this.$message.warning('请选择要上传的文件!') |
|||
return false |
|||
} |
|||
|
|||
//清空上传列表 |
|||
this.$refs['upload'].clearFiles() |
|||
|
|||
var url = '/gov/org/icCityManagement/import' |
|||
let fileFormData = new FormData(); |
|||
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|||
|
|||
const { data, code, msg } = await requestPost(url, fileFormData) |
|||
if (code === 0) { |
|||
this.$message({ |
|||
showClose: true, |
|||
message: "导入中,请到系统管理-导入记录中查看进度", |
|||
duration: 0, |
|||
}); |
|||
|
|||
this.loadTable() |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
|
|||
}, |
|||
|
|||
handleSizeChange (val) { |
|||
this.pageSize = val |
|||
this.pageNo = 1 |
|||
this.loadTable() |
|||
}, |
|||
handleCurrentChange (val) { |
|||
this.pageNo = val |
|||
this.loadTable() |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
tableHeight () { |
|||
|
|||
return this.$store.state.inIframe ? this.clientHeight - 350 + this.iframeHeight : this.clientHeight - 350 |
|||
|
|||
}, |
|||
|
|||
...mapGetters(['clientHeight', 'iframeHeight']) |
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/buttonstyle.scss"; |
|||
@import "@/assets/scss/modules/management/list-main.scss"; |
|||
</style> |
|||
@ -0,0 +1,257 @@ |
|||
<template> |
|||
<div> |
|||
<div class="dialog-h-content scroll-h"> |
|||
|
|||
<el-form ref="ref_form" |
|||
:inline="true" |
|||
:model="formData" |
|||
class="form"> |
|||
|
|||
<el-form-item label="场所名称:" |
|||
prop="name" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<span>{{formData.name}}</span> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="场所类别:" |
|||
prop="categoryName" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
|
|||
<span>{{formData.categoryName}}</span> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="占地面积:" |
|||
prop="areaCovered" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<span>{{formData.areaCovered}}</span> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="容纳人数:" |
|||
prop="capacity" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<span>{{formData.capacity}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="地址:" |
|||
style="display: block" |
|||
prop="address" |
|||
label-width="150px"> |
|||
<div class="item_width_1"> |
|||
<span>{{formData.address}}</span> |
|||
<div id="app" class="div_map"></div> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button size="small" |
|||
@click="handleCancle">取 消</el-button> |
|||
|
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
var map |
|||
var search |
|||
var markers |
|||
var infoWindowList |
|||
var geocoder // 新建一个正逆地址解析类 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
formData: {}, |
|||
|
|||
} |
|||
}, |
|||
components: {}, |
|||
async mounted () { |
|||
await this.initMap() |
|||
}, |
|||
|
|||
methods: { |
|||
handleCancle () { |
|||
|
|||
this.$emit('diaClose') |
|||
|
|||
}, |
|||
|
|||
async initForm (row) { |
|||
this.startLoading() |
|||
this.formData = { ...row } |
|||
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|||
this.setMarker(this.formData.latitude, this.formData.longitude) |
|||
|
|||
this.endLoading() |
|||
|
|||
}, |
|||
|
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap () { |
|||
// 定义地图中心点坐标 |
|||
let { latitude, longitude } = this.$store.state.user; |
|||
console.log('lat'+latitude+',lon'+longitude) |
|||
if (!latitude || latitude == "" || latitude == "0") { |
|||
latitude = 39.9088810666821; |
|||
longitude = 116.39743841556731; |
|||
} |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(latitude, longitude); |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById('app'), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45 // 设置地图旋转角度 |
|||
}) |
|||
|
|||
search = new window.TMap.service.Search({ pageSize: 10 }) |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [] |
|||
}) |
|||
infoWindowList = Array(10) |
|||
|
|||
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|||
|
|||
// 监听地图平移结束 |
|||
map.on('panend', () => { |
|||
this.handleMoveCenter() |
|||
}) |
|||
this.handleMoveCenter() |
|||
this.convert() |
|||
}, |
|||
|
|||
setMarker (lat, lng) { |
|||
markers.setGeometries([]) |
|||
markers.add([ |
|||
{ |
|||
id: '4', |
|||
styleId: 'marker', |
|||
position: new TMap.LatLng(lat, lng), |
|||
properties: { |
|||
title: 'marker4' |
|||
} |
|||
} |
|||
]) |
|||
}, |
|||
|
|||
handleSearchMap () { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close() |
|||
}) |
|||
infoWindowList.length = 0 |
|||
markers.setGeometries([]) |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.keyWords, |
|||
bounds: map.getBounds() |
|||
}) |
|||
.then((result) => { |
|||
let { data } = result |
|||
if (Array.isArray(data) && data.length > 0) { |
|||
const { |
|||
location: { lat, lng } |
|||
} = data[0] |
|||
|
|||
|
|||
map.setCenter(new TMap.LatLng(lat, lng)) |
|||
this.setMarker(lat, lng) |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.convert() |
|||
} else { |
|||
this.$message.error('未检索到相关位置坐标') |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
handleMoveCenter () { |
|||
//修改地图中心点 |
|||
const center = map.getCenter() |
|||
const lat = center.getLat() |
|||
const lng = center.getLng() |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.setMarker(lat, lng) |
|||
this.convert(lat, lng) |
|||
}, |
|||
|
|||
convert (lat, lng) { |
|||
markers.setGeometries([]); |
|||
// var input = document.getElementById('location').value.split(','); |
|||
let location |
|||
if (lat && lng) { |
|||
location = new TMap.LatLng(lat, lng); |
|||
} else { |
|||
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude); |
|||
} |
|||
|
|||
// map.setCenter(location); |
|||
markers.updateGeometries([ |
|||
{ |
|||
id: 'main', // 点标注数据数组 |
|||
position: location, |
|||
}, |
|||
]); |
|||
geocoder |
|||
.getAddress({ location: location }) // 将给定的坐标位置转换为地址 |
|||
.then((result) => { |
|||
// this.formData.address = result.result.address |
|||
// 显示搜索到的地址 |
|||
}); |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|||
</style> |
|||
<style scoped> |
|||
.detail_span { |
|||
width: 500px; |
|||
font-weight: bold; |
|||
text-align: left; |
|||
margin: 0 0; |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.form { |
|||
margin-top: 30px; |
|||
} |
|||
</style> |
|||
|
|||
|
|||
@ -0,0 +1,469 @@ |
|||
<template> |
|||
<div> |
|||
|
|||
<div class="dialog-h-content scroll-h"> |
|||
<el-form ref="ref_form" |
|||
:inline="true" |
|||
:model="formData" |
|||
:rules="dataRule" |
|||
:disabled="formType === 'detail'" |
|||
class="form"> |
|||
|
|||
<el-form-item label="场所名称" |
|||
prop="name" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder="请输入场所名称" |
|||
v-model="formData.name"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<!--<el-form-item label="场所类型" |
|||
prop="categoryName" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<el-select class="item_width_1" |
|||
v-model="formData.categoryName" |
|||
placeholder="请选择" |
|||
filterable |
|||
clearable> |
|||
<el-option v-for="item in typeList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item>--> |
|||
<el-form-item label="场所分类" |
|||
prop="serviceMatter" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<el-select class="item_width_1" |
|||
v-model="formData.category" |
|||
placeholder="请选择" |
|||
size="small" |
|||
filterable |
|||
clearable> |
|||
<el-option v-for="item in serviceList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
|
|||
<el-form-item label="占地面积" |
|||
style="display: block" |
|||
prop="areaCovered" |
|||
label-width="150px"> |
|||
<el-input-number class="item_width_4" |
|||
v-model="formData.areaCovered" |
|||
:precision="2" |
|||
:step="0.01" |
|||
:min="0" |
|||
:max="9600000" |
|||
label="占地面积"></el-input-number>平方公里 |
|||
</el-form-item> |
|||
<el-form-item label="容纳人数" |
|||
style="display: block" |
|||
prop="capacity" |
|||
label-width="150px"> |
|||
<el-input-number class="item_width_4" |
|||
v-model="formData.capacity" |
|||
:min="0" |
|||
:max="9999" |
|||
label="容纳人数"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="地址" |
|||
prop="address" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<div class="item_width_1"> |
|||
<el-input |
|||
style="width:420px" |
|||
:placeholder="'请输入所在地址'" |
|||
v-model="formData.address"> |
|||
</el-input> |
|||
<el-button |
|||
style="margin-left: 10px" |
|||
type="default" |
|||
size="small" |
|||
@click="handleSearchMap">查询</el-button> |
|||
<div id="app" class="div_map"></div> |
|||
</div> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
|
|||
<div class="div_btn"> |
|||
<el-button size="small" |
|||
@click="handleCancle">取 消</el-button> |
|||
<el-button size="small" |
|||
v-if="formType != 'detail'" |
|||
type="primary" |
|||
:disabled="btnDisable" |
|||
@click="handleComfirm">确 定</el-button> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost } from '@/js/dai/request' |
|||
|
|||
|
|||
|
|||
var map |
|||
var search |
|||
var markers |
|||
var infoWindowList |
|||
var geocoder // 新建一个正逆地址解析类 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|||
|
|||
btnDisable: false, |
|||
serviceList: [], |
|||
icCityManagementId: '', |
|||
keyWords: '', |
|||
formData: { |
|||
name: '', |
|||
category: '',//场所分类字典表值 |
|||
areaCovered: '',//占地面积 |
|||
capacity: 0,//容纳人数 |
|||
address: '', //详细地址 |
|||
longitude: 36.0722275, //经度 |
|||
latitude: 120.38945519 //纬度 |
|||
}, |
|||
cityManagement: { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
components: {}, |
|||
mounted () { |
|||
this.initMap() |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
async initForm (type, icCityManagementId) { |
|||
this.startLoading() |
|||
this.$refs.ref_form.resetFields(); |
|||
|
|||
//获取服务事项 |
|||
await this.loadService() |
|||
|
|||
this.formType = type |
|||
if (icCityManagementId) { |
|||
this.icCityManagementId = icCityManagementId |
|||
this.formData.icCityManagementId = icCityManagementId |
|||
await this.loadFormData() |
|||
} else { |
|||
// map.setCenter(new TMap.LatLng(36.0722275, 120.38945519)) |
|||
// this.setMarker(36.0722275, 120.38945519) |
|||
} |
|||
|
|||
this.endLoading() |
|||
|
|||
}, |
|||
|
|||
//获取服务事项下拉框 |
|||
async loadService () { |
|||
const url = "/gov/org/coverage/dict-select-list/city_management" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/coverage/dict-select-list/city_management" |
|||
let params = { |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.serviceList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
//加载组织 |
|||
async loadFormData () { |
|||
const url = '/gov/org/icCityManagement/detail' |
|||
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/icCityManagement/detail' |
|||
let params = { |
|||
icCityManagementId: this.icCityManagementId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
if (null != data){ |
|||
data : this.cityManagement |
|||
} |
|||
this.formData = { ...data } |
|||
// let { latitude, longitude } = this.$store.state.user; |
|||
// const lat = this.formData.latitude === null || this.formData.latitude === '' ? latitude : this.formData.latitude; |
|||
// const lon = this.formData.longitude === null || this.formData.longitude === '' ? longitude : this.formData.longitude; |
|||
if (this.formData.latitude !== null && this.formData.latitude !== '' && this.formData.longitude !== null && this.formData.longitude !== ''){ |
|||
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|||
this.setMarker(this.formData.latitude, this.formData.longitude) |
|||
} |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
|
|||
|
|||
async handleComfirm () { |
|||
|
|||
this.btnDisable = true |
|||
setTimeout(() => { |
|||
this.btnDisable = false |
|||
}, 10000) |
|||
this.$refs['ref_form'].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj) |
|||
this.btnDisable = false |
|||
} else { |
|||
this.addUnit() |
|||
} |
|||
|
|||
}) |
|||
|
|||
|
|||
}, |
|||
async addUnit () { |
|||
let url = '' |
|||
if (this.formType === 'add'){ |
|||
url = '/gov/org/icCityManagement/add' |
|||
}else { |
|||
url = '/gov/org/icCityManagement/edit' |
|||
} |
|||
const { data, code, msg, internalMsg } = await requestPost(url, this.formData) |
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '操作成功' |
|||
}) |
|||
this.resetData() |
|||
this.$emit('dialogOk') |
|||
this.btnDisable = false |
|||
} else { |
|||
this.btnDisable = false |
|||
this.$message.error(internalMsg) |
|||
} |
|||
}, |
|||
|
|||
handleCancle () { |
|||
this.resetData() |
|||
this.$emit('dialogCancle') |
|||
|
|||
}, |
|||
|
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap () { |
|||
// 定义地图中心点坐标 |
|||
let { latitude, longitude } = this.$store.state.user; |
|||
console.log('lat'+latitude+',lon'+longitude) |
|||
if (!latitude || latitude == "" || latitude == "0") { |
|||
latitude = 39.9088810666821; |
|||
longitude = 116.39743841556731; |
|||
} |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(latitude, longitude); |
|||
// var center = new window.TMap.LatLng(36.52799, 120.7553) |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById('app'), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45 // 设置地图旋转角度 |
|||
}) |
|||
|
|||
search = new window.TMap.service.Search({ pageSize: 10 }) |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [] |
|||
}) |
|||
infoWindowList = Array(10) |
|||
|
|||
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|||
|
|||
// 监听地图平移结束 |
|||
map.on('panend', () => { |
|||
this.handleMoveCenter() |
|||
}) |
|||
// this.handleMoveCenter() |
|||
this.convert() |
|||
}, |
|||
|
|||
setMarker (lat, lng) { |
|||
markers.setGeometries([]) |
|||
markers.add([ |
|||
{ |
|||
id: '4', |
|||
styleId: 'marker', |
|||
position: new TMap.LatLng(lat, lng), |
|||
properties: { |
|||
title: 'marker4' |
|||
} |
|||
} |
|||
]) |
|||
}, |
|||
|
|||
handleSearchMap () { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close() |
|||
}) |
|||
infoWindowList.length = 0 |
|||
markers.setGeometries([]) |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.formData.address, |
|||
bounds: map.getBounds() |
|||
}) |
|||
.then((result) => { |
|||
let { data } = result |
|||
if (Array.isArray(data) && data.length > 0) { |
|||
const { |
|||
location: { lat, lng } |
|||
} = data[0] |
|||
|
|||
|
|||
map.setCenter(new TMap.LatLng(lat, lng)) |
|||
this.setMarker(lat, lng) |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.convert() |
|||
} else { |
|||
this.$message.error('未检索到相关位置坐标') |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
handleMoveCenter () { |
|||
//修改地图中心点 |
|||
const center = map.getCenter() |
|||
const lat = center.getLat() |
|||
const lng = center.getLng() |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.setMarker(lat, lng) |
|||
this.convert(lat, lng) |
|||
}, |
|||
|
|||
convert (lat, lng) { |
|||
markers.setGeometries([]); |
|||
// var input = document.getElementById('location').value.split(','); |
|||
let location |
|||
if (lat && lng) { |
|||
location = new TMap.LatLng(lat, lng); |
|||
} else { |
|||
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude); |
|||
} |
|||
|
|||
// map.setCenter(location); |
|||
markers.updateGeometries([ |
|||
{ |
|||
id: 'main', // 点标注数据数组 |
|||
position: location, |
|||
}, |
|||
]); |
|||
geocoder |
|||
.getAddress({ location: location }) // 将给定的坐标位置转换为地址 |
|||
.then((result) => { |
|||
// this.formData.address = result.result.address === '' || result.result.address === null ? this.formData.address : result.result.address |
|||
this.formData.address = this.formData.address !== '' && this.formData.address !== null && (this.formData.longitude === '' || this.formData.longitude === null) ? this.formData.address : result.result.address |
|||
// 显示搜索到的地址 |
|||
}); |
|||
}, |
|||
|
|||
|
|||
resetData () { |
|||
this.unitId = '' |
|||
this.keyWords = '' |
|||
this.formData = { |
|||
name: '', |
|||
category: '',//场所分类字典表值 |
|||
areaCovered: '',//占地面积 |
|||
capacity: 0,//容纳人数 |
|||
address: '', //详细地址 |
|||
longitude: '', //经度 |
|||
latitude: '' //纬度 |
|||
} |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
|
|||
name: [ |
|||
{ required: true, message: '场所名称不能为空', trigger: 'blur' }, |
|||
], |
|||
categoryName: [ |
|||
{ required: true, message: '场所类型不能为空', trigger: 'blur' } |
|||
], |
|||
address: [ |
|||
{ required: true, message: '地址不能为空', trigger: 'blur' } |
|||
], |
|||
longitude: [ |
|||
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|||
], |
|||
latitude: [ |
|||
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|||
] |
|||
} |
|||
}, |
|||
|
|||
}, |
|||
props: { |
|||
|
|||
typeList: { |
|||
type: Array, |
|||
default: [] |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
.div_map { |
|||
position: relative; |
|||
} |
|||
.div_searchmap { |
|||
z-index: 5000; |
|||
position: absolute; |
|||
top: 5px; |
|||
left: 5px; |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss" scoped > |
|||
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|||
</style> |
|||
@ -0,0 +1,661 @@ |
|||
<template> |
|||
<div class="div_main"> |
|||
<div class="div_search"> |
|||
<el-form :inline="true" |
|||
:model="formData" |
|||
ref="ref_searchform" |
|||
:label-width="'100px'"> |
|||
<div> |
|||
|
|||
<el-form-item label="场所名称" |
|||
prop="name"> |
|||
<el-input v-model="formData.name" |
|||
class="item_width_1" |
|||
clearable |
|||
size="small" |
|||
placeholder="请输入内容"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="场所分类" |
|||
prop="serviceMatter"> |
|||
<el-select class="item_width_1" |
|||
v-model="formData.category" |
|||
placeholder="请选择" |
|||
size="small" |
|||
clearable> |
|||
<el-option v-for="item in serviceList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-button style="margin-left:10px" |
|||
class="diy-button--search" |
|||
size="small" |
|||
@click="handleSearch">查询</el-button> |
|||
<el-button style="margin-left:10px" |
|||
class="diy-button--reset" |
|||
size="small" |
|||
@click="resetSearch">重置</el-button> |
|||
</div> |
|||
</el-form> |
|||
</div> |
|||
<div class="div_table"> |
|||
<div class="div_btn"> |
|||
<el-button class="diy-button--add" |
|||
size="small" |
|||
@click="handleAdd">新增</el-button> |
|||
|
|||
<el-button class="diy-button--search" |
|||
style="margin-left:10px" |
|||
size="small" |
|||
@click="handleExportModule('room')">下载模板</el-button> |
|||
<el-upload ref="upload" |
|||
:multiple='false' |
|||
:show-file-list='false' |
|||
:before-upload="beforeUpload" |
|||
action="" |
|||
accept=".xls,.xlsx" |
|||
:limit="1" |
|||
:on-exceed="handleExceed" |
|||
:http-request="uploadFile"> |
|||
<el-button style="margin-left:10px" |
|||
class="diy-button--delete" |
|||
size="small">导入</el-button> |
|||
</el-upload> |
|||
<el-button style="float:left;margin-left:10px" |
|||
class="diy-button--reset" |
|||
size="small" |
|||
@click="handleExport">导出</el-button> |
|||
</div> |
|||
|
|||
<el-table class="table" |
|||
:data="tableData" |
|||
border |
|||
:height="tableHeight" |
|||
v-loading="tableLoading" |
|||
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" |
|||
style="width: 100%"> |
|||
<el-table-column label="序号" |
|||
header-align="center" |
|||
align="center" |
|||
type="index" |
|||
width="50"></el-table-column> |
|||
|
|||
<el-table-column prop="name" |
|||
header-align="center" |
|||
align="center" |
|||
label="场所名称" |
|||
min-width="100"> |
|||
</el-table-column> |
|||
<el-table-column prop="categoryName" |
|||
header-align="center" |
|||
align="center" |
|||
label="场所类别" |
|||
min-width="80"> |
|||
</el-table-column> |
|||
<el-table-column prop="areaCovered" |
|||
header-align="center" |
|||
align="center" |
|||
label="占地面积" |
|||
show-overflow-tooltip |
|||
min-width="250"> |
|||
</el-table-column> |
|||
<el-table-column prop="capacity" |
|||
header-align="center" |
|||
align="center" |
|||
label="容纳人数" |
|||
width="80"> |
|||
</el-table-column> |
|||
<el-table-column prop="address" |
|||
header-align="center" |
|||
align="center" |
|||
show-overflow-tooltip |
|||
label="地址" |
|||
width="120"> |
|||
</el-table-column> |
|||
<el-table-column label="操作" |
|||
fixed="right" |
|||
width="250" |
|||
header-align="center" |
|||
align="center" |
|||
class="operate"> |
|||
<template slot-scope="scope"> |
|||
|
|||
<el-button type="text" |
|||
class="div-table-button--detail" |
|||
size="small" |
|||
@click="handleDetail(scope.row)">查看</el-button> |
|||
<el-button v-if="scope.row.agencyId === agencyId && (scope.row.longitude === '' || scope.row.longitude === null || scope.row.latitude === '' || scope.row.latitude === null) && scope.row.sourceType === 'import'" |
|||
type="text" |
|||
class="div-table-button--edit" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">待完善</el-button> |
|||
<el-button v-else-if="scope.row.agencyId === agencyId && scope.row.longitude !== '' && scope.row.longitude !== null && scope.row.latitude !== '' && scope.row.latitude !== null && scope.row.sourceType === 'import'" |
|||
type="text" |
|||
class="div-table-button--edit" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">修改</el-button> |
|||
<el-button v-else-if="scope.row.agencyId === agencyId && scope.row.sourceType === 'add'" |
|||
type="text" |
|||
class="div-table-button--edit" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">修改</el-button> |
|||
<el-button v-if="scope.row.agencyId === agencyId" |
|||
type="text" |
|||
class="div-table-button--delete" |
|||
size="small" |
|||
@click="handleDelete(scope.row)">删除</el-button> |
|||
|
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div> |
|||
<el-pagination @size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="pageNo" |
|||
:page-sizes="[10, 20, 50]" |
|||
:page-size="pageSize" |
|||
layout="sizes, prev, pager, next, total" |
|||
:total="total"> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 修改弹出框 --> |
|||
<el-dialog :visible.sync="formShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="formTitle" |
|||
:destroy-on-close="true" |
|||
width="950px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
@closed="editDiaClose"> |
|||
<ggfw-form ref="ref_form" |
|||
:typeList="typeList" |
|||
@dialogCancle="addFormCancle" |
|||
@dialogOk="addFormOk"></ggfw-form> |
|||
</el-dialog> |
|||
|
|||
<el-dialog :visible.sync="detailShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="'公共服务详情'" |
|||
width="950px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
@closed="diaClose"> |
|||
<ggfw-detail ref="ref_detail" |
|||
@diaClose="diaClose"></ggfw-detail> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import ggfwForm from './ggfwForm' |
|||
import ggfwDetail from './ggfwDetail' |
|||
|
|||
import { requestPost } from "@/js/dai/request"; |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
loading: false, |
|||
total: 0, |
|||
pageSize: 20, |
|||
pageNo: 0, |
|||
tableLoading: false, |
|||
agencyId: '', |
|||
|
|||
unitList: [],//单位list |
|||
serviceList: [],//服务list |
|||
typeList: [],//分类list |
|||
formData: { |
|||
name: '', |
|||
category: '' |
|||
}, |
|||
tableData: [], |
|||
|
|||
//form相关 |
|||
formShow: false, |
|||
formTitle: '新增单位', |
|||
detailShow: false, |
|||
|
|||
//完成情况 |
|||
finishDiaTitle: '区域化党建单位完成情况', |
|||
finishDiaShow: false, |
|||
//积分记录 |
|||
scoreDiaTitle: '积分记录', |
|||
scoreDiaShow: false, |
|||
|
|||
files: "", |
|||
fileName: "", |
|||
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/icPublicService/import' |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
ggfwForm, ggfwDetail |
|||
}, |
|||
async created () { |
|||
|
|||
}, |
|||
async mounted () { |
|||
//获取服务事项 |
|||
await this.loadService() |
|||
|
|||
//获取分类 |
|||
await this.loadType() |
|||
|
|||
const { user } = this.$store.state |
|||
this.agencyId = user.agencyId |
|||
|
|||
await this.loadTable() |
|||
}, |
|||
|
|||
methods: { |
|||
handleSearch () { |
|||
this.loadTable() |
|||
}, |
|||
async handleExportModule () { |
|||
let url = "/gov/org/icPublicService/download"; |
|||
// let url = "http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/download"; |
|||
|
|||
let params = {}; |
|||
await this.$http({ |
|||
method: "POST", |
|||
url, |
|||
responseType: "blob", |
|||
data: params, |
|||
}) |
|||
.then((res) => { |
|||
// this.download(res.data, title + '.xls') |
|||
if (res.headers["content-disposition"]) { |
|||
let fileName = window.decodeURI( |
|||
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|||
); |
|||
console.log("filename", fileName); |
|||
let blob = new Blob([res.data], { |
|||
type: "application/vnd.ms-excel", |
|||
}); |
|||
var url = window.URL.createObjectURL(blob); |
|||
var aLink = document.createElement("a"); |
|||
aLink.style.display = "none"; |
|||
aLink.href = url; |
|||
aLink.setAttribute("download", fileName); |
|||
document.body.appendChild(aLink); |
|||
aLink.click(); |
|||
document.body.removeChild(aLink); //下载完成移除元素 |
|||
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|||
} else this.$message.error("下载失败"); |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err", err); |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
//获取服务事项下拉框 |
|||
async loadService () { |
|||
const url = "/gov/org/coverage/dict-select-list/public_service" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/coverage/dict-select-list/public_service" |
|||
let params = { |
|||
// parentCategoryCode: '1010' |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.serviceList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
//获取分类 |
|||
async loadType () { |
|||
const url = "/sys/dict/data/dictlist" |
|||
|
|||
let params = { |
|||
dictType: 'party_unit_type' |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.typeList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
async loadTable () { |
|||
this.tableLoading = true |
|||
|
|||
const url = "/gov/org/icPublicService/list" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/list" |
|||
let params = { |
|||
pageSize: this.pageSize, |
|||
pageNo: this.pageNo, |
|||
...this.formData |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.total = data.total |
|||
this.tableData = data.list |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
this.tableLoading = false |
|||
}, |
|||
|
|||
editDiaClose () { |
|||
this.$refs.ref_form.resetData() |
|||
this.formShow = false |
|||
}, |
|||
diaClose () { |
|||
this.detailShow = false |
|||
this.finishDiaShow = false |
|||
this.scoreDiaShow = false |
|||
}, |
|||
|
|||
handleDetail (row) { |
|||
this.detailShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_detail.initForm(row) |
|||
}) |
|||
}, |
|||
|
|||
//完成情况 |
|||
handleFinish (row) { |
|||
this.finishDiaTitle = row.name + '完成情况' |
|||
this.finishDiaShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_finish.initTable(row) |
|||
}) |
|||
}, |
|||
//积分记录 |
|||
handleScore (row) { |
|||
this.scoreDiaShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_score.initForm(row.icPublicServiceId) |
|||
}) |
|||
}, |
|||
|
|||
handleAdd () { |
|||
this.formTitle = '新增' |
|||
this.formShow = 'edit' |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('add', null) |
|||
}) |
|||
}, |
|||
|
|||
handleEdit (row) { |
|||
this.formTitle = '修改' |
|||
this.formShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('edit', row.icPublicServiceId) |
|||
}) |
|||
}, |
|||
|
|||
addFormCancle () { |
|||
this.formShow = false |
|||
}, |
|||
addFormOk () { |
|||
this.formShow = false |
|||
this.loadTable() |
|||
|
|||
}, |
|||
|
|||
async handleDelete (row) { |
|||
|
|||
this.$confirm("确认删除?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}) |
|||
.then(() => { |
|||
this.deleteUnit(row) |
|||
}) |
|||
.catch(err => { |
|||
if (err == "cancel") { |
|||
|
|||
} |
|||
|
|||
}); |
|||
}, |
|||
|
|||
async deleteUnit (row) { |
|||
const url = "/gov/org/icPublicService/del" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/del" |
|||
|
|||
let params = { |
|||
icPublicServiceId: row.icPublicServiceId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "删除成功" |
|||
}); |
|||
|
|||
this.loadTable() |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
//重置搜索条件 |
|||
resetSearch () { |
|||
this.formData = { |
|||
name: '', |
|||
category: '' |
|||
} |
|||
this.pageSize = 10 |
|||
this.pageNo = 0 |
|||
// this.loadTable() |
|||
}, |
|||
|
|||
//导出表格 |
|||
async handleExport () { |
|||
let title = '公共服务图层列表' |
|||
|
|||
const url = "/gov/org/icPublicService/export" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/export" |
|||
let params = { |
|||
agencyId: this.agencyId, |
|||
...this.formData |
|||
} |
|||
|
|||
app.ajax.exportFilePost( |
|||
url, |
|||
params, |
|||
(data, rspMsg) => { |
|||
|
|||
this.download(data, title + '.xls') |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.$message.error(rspMsg); |
|||
} |
|||
); |
|||
|
|||
}, |
|||
|
|||
// 下载文件 |
|||
download (data, fileName) { |
|||
if (!data) { |
|||
return |
|||
} |
|||
|
|||
var csvData = new Blob([data]) |
|||
|
|||
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
|||
window.navigator.msSaveOrOpenBlob(csvData, fileName); |
|||
} |
|||
// for Non-IE (chrome, firefox etc.) |
|||
else { |
|||
var a = document.createElement('a'); |
|||
document.body.appendChild(a); |
|||
a.style = 'display: none'; |
|||
var url = window.URL.createObjectURL(csvData); |
|||
a.href = url; |
|||
a.download = fileName; |
|||
a.click(); |
|||
a.remove(); |
|||
window.URL.revokeObjectURL(url); |
|||
} |
|||
|
|||
}, |
|||
|
|||
// 上传文件之前的钩子 |
|||
beforeUpload (file) { |
|||
this.files = file; |
|||
|
|||
const isText = file.type === 'application/vnd.ms-excel' |
|||
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|||
|
|||
if (!isText && !isTextComputer) { |
|||
this.$message.error('请选择正确格式的文件') |
|||
return false |
|||
} else { |
|||
this.fileName = file.name; |
|||
return true |
|||
} |
|||
|
|||
}, |
|||
// 上传文件个数超过定义的数量 |
|||
handleExceed (files, fileList) { |
|||
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) |
|||
}, |
|||
|
|||
async uploadFile () { |
|||
this.loading = true |
|||
|
|||
if (this.fileName == "") { |
|||
this.$message.warning('请选择要上传的文件!') |
|||
return false |
|||
} |
|||
|
|||
//清空上传列表 |
|||
this.$refs['upload'].clearFiles() |
|||
|
|||
var url = '/gov/org/icPublicService/import' |
|||
// var url = 'http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/import' |
|||
let fileFormData = new FormData(); |
|||
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|||
|
|||
const { data, code, msg } = await requestPost(url, fileFormData) |
|||
if (code === 0) { |
|||
this.$message({ |
|||
showClose: true, |
|||
message: "导入中,请到系统管理-导入记录中查看进度", |
|||
duration: 0, |
|||
}); |
|||
|
|||
this.loadTable() |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
|
|||
}, |
|||
|
|||
handleSizeChange (val) { |
|||
this.pageSize = val |
|||
this.pageNo = 1 |
|||
this.loadTable() |
|||
}, |
|||
handleCurrentChange (val) { |
|||
this.pageNo = val |
|||
this.loadTable() |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
tableHeight () { |
|||
|
|||
return this.$store.state.inIframe ? this.clientHeight - 350 + this.iframeHeight : this.clientHeight - 350 |
|||
|
|||
}, |
|||
|
|||
...mapGetters(['clientHeight', 'iframeHeight']) |
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
@import "@/assets/scss/buttonstyle.scss"; |
|||
@import "@/assets/scss/modules/management/list-main.scss"; |
|||
.div_main { |
|||
width: 100%; |
|||
} |
|||
|
|||
.div_search { |
|||
background: #ffffff; |
|||
border-radius: 4px; |
|||
padding: 30px 20px 5px; |
|||
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1); |
|||
} |
|||
|
|||
.item_width_1 { |
|||
width: 260px; |
|||
} |
|||
.item_width_2 { |
|||
width: 620px; |
|||
} |
|||
|
|||
.div_table { |
|||
background: #ffffff; |
|||
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1); |
|||
border-radius: 4px; |
|||
margin-top: 15px; |
|||
// padding: 23px 30px 10px; |
|||
|
|||
.table { |
|||
margin-top: 20px; |
|||
} |
|||
} |
|||
|
|||
.el-row { |
|||
/* margin-bottom: 20px; */ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
margin-top: 10px; |
|||
margin-right: 50px; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,249 @@ |
|||
<template> |
|||
<div> |
|||
<div class="dialog-h-content scroll-h"> |
|||
|
|||
<el-form ref="ref_form" |
|||
:inline="true" |
|||
:model="formData" |
|||
class="form"> |
|||
|
|||
<el-form-item label="场所名称:" |
|||
prop="name" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<span>{{formData.name}}</span> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="场所类别:" |
|||
prop="categoryName" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
|
|||
<span>{{formData.categoryName}}</span> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="占地面积:" |
|||
prop="areaCovered" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<span>{{formData.areaCovered}}</span> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="容纳人数:" |
|||
prop="capacity" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<span>{{formData.capacity}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="地址:" |
|||
style="display: block" |
|||
prop="address" |
|||
label-width="150px"> |
|||
<div class="item_width_1"> |
|||
<span>{{formData.address}}</span> |
|||
<div id="app" class="div_map"></div> |
|||
</div> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button size="small" |
|||
@click="handleCancle">取 消</el-button> |
|||
|
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
var map |
|||
var search |
|||
var markers |
|||
var infoWindowList |
|||
var geocoder // 新建一个正逆地址解析类 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
formData: {}, |
|||
|
|||
} |
|||
}, |
|||
components: {}, |
|||
mounted () { |
|||
this.initMap() |
|||
}, |
|||
|
|||
methods: { |
|||
handleCancle () { |
|||
|
|||
this.$emit('diaClose') |
|||
|
|||
}, |
|||
|
|||
async initForm (row) { |
|||
this.startLoading() |
|||
this.formData = { ...row } |
|||
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|||
this.setMarker(this.formData.latitude, this.formData.longitude) |
|||
|
|||
this.endLoading() |
|||
|
|||
}, |
|||
|
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap () { |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(36.0722275, 120.38945519) |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById('app'), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45 // 设置地图旋转角度 |
|||
}) |
|||
|
|||
search = new window.TMap.service.Search({ pageSize: 10 }) |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [] |
|||
}) |
|||
infoWindowList = Array(10) |
|||
|
|||
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|||
|
|||
// 监听地图平移结束 |
|||
map.on('panend', () => { |
|||
this.handleMoveCenter() |
|||
}) |
|||
this.handleMoveCenter() |
|||
this.convert() |
|||
}, |
|||
|
|||
setMarker (lat, lng) { |
|||
markers.setGeometries([]) |
|||
markers.add([ |
|||
{ |
|||
id: '4', |
|||
styleId: 'marker', |
|||
position: new TMap.LatLng(lat, lng), |
|||
properties: { |
|||
title: 'marker4' |
|||
} |
|||
} |
|||
]) |
|||
}, |
|||
|
|||
handleSearchMap () { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close() |
|||
}) |
|||
infoWindowList.length = 0 |
|||
markers.setGeometries([]) |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.keyWords, |
|||
bounds: map.getBounds() |
|||
}) |
|||
.then((result) => { |
|||
let { data } = result |
|||
if (Array.isArray(data) && data.length > 0) { |
|||
const { |
|||
location: { lat, lng } |
|||
} = data[0] |
|||
|
|||
|
|||
map.setCenter(new TMap.LatLng(lat, lng)) |
|||
this.setMarker(lat, lng) |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.convert() |
|||
} else { |
|||
this.$message.error('未检索到相关位置坐标') |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
handleMoveCenter () { |
|||
//修改地图中心点 |
|||
const center = map.getCenter() |
|||
const lat = center.getLat() |
|||
const lng = center.getLng() |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.setMarker(lat, lng) |
|||
this.convert(lat, lng) |
|||
}, |
|||
|
|||
convert (lat, lng) { |
|||
markers.setGeometries([]); |
|||
// var input = document.getElementById('location').value.split(','); |
|||
let location |
|||
if (lat && lng) { |
|||
location = new TMap.LatLng(lat, lng); |
|||
} else { |
|||
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude); |
|||
} |
|||
|
|||
// map.setCenter(location); |
|||
markers.updateGeometries([ |
|||
{ |
|||
id: 'main', // 点标注数据数组 |
|||
position: location, |
|||
}, |
|||
]); |
|||
geocoder |
|||
.getAddress({ location: location }) // 将给定的坐标位置转换为地址 |
|||
.then((result) => { |
|||
// this.formData.address = result.result.address |
|||
// 显示搜索到的地址 |
|||
}); |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|||
</style> |
|||
<style scoped> |
|||
.detail_span { |
|||
width: 500px; |
|||
font-weight: bold; |
|||
text-align: left; |
|||
margin: 0 0; |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.form { |
|||
margin-top: 30px; |
|||
} |
|||
</style> |
|||
|
|||
|
|||
@ -0,0 +1,450 @@ |
|||
<template> |
|||
<div> |
|||
|
|||
<div class="dialog-h-content scroll-h"> |
|||
<el-form ref="ref_form" |
|||
:inline="true" |
|||
:model="formData" |
|||
:rules="dataRule" |
|||
:disabled="formType === 'detail'" |
|||
class="form"> |
|||
|
|||
<el-form-item label="场所名称" |
|||
prop="name" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder="请输入场所名称" |
|||
v-model="formData.name"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="场所类型" |
|||
prop="category" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<el-select class="item_width_1" |
|||
v-model="formData.category" |
|||
placeholder="请选择" |
|||
filterable |
|||
clearable> |
|||
<el-option v-for="item in serviceList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
|
|||
<el-form-item label="占地面积" |
|||
style="display: block" |
|||
prop="areaCovered" |
|||
label-width="150px"> |
|||
<el-input-number class="item_width_4" |
|||
v-model="formData.areaCovered" |
|||
:precision="2" |
|||
:step="0.01" |
|||
:min="0" |
|||
:max="9600000" |
|||
label="占地面积"></el-input-number>平方公里 |
|||
</el-form-item> |
|||
<el-form-item label="容纳人数" |
|||
style="display: block" |
|||
prop="capacity" |
|||
label-width="150px"> |
|||
<el-input-number class="item_width_4" |
|||
v-model="formData.capacity" |
|||
:min="0" |
|||
:max="9999" |
|||
label="容纳人数"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="地址" |
|||
prop="address" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<div class="item_width_1"> |
|||
<el-input |
|||
style="width:420px" |
|||
:placeholder="'请输入所在地址'" |
|||
v-model="formData.address"> |
|||
</el-input> |
|||
<el-button |
|||
style="margin-left: 10px" |
|||
type="default" |
|||
size="small" |
|||
@click="handleSearchMap">查询</el-button> |
|||
<div id="app" class="div_map"></div> |
|||
</div> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
|
|||
<div class="div_btn"> |
|||
<el-button size="small" |
|||
@click="handleCancle">取 消</el-button> |
|||
<el-button size="small" |
|||
v-if="formType != 'detail'" |
|||
type="primary" |
|||
:disabled="btnDisable" |
|||
@click="handleComfirm">确 定</el-button> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost } from '@/js/dai/request' |
|||
|
|||
|
|||
|
|||
var map |
|||
var search |
|||
var markers |
|||
var infoWindowList |
|||
var geocoder // 新建一个正逆地址解析类 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|||
|
|||
btnDisable: false, |
|||
|
|||
icPublicServiceId: '', |
|||
keyWords: '', |
|||
formData: { |
|||
name: '',//场所名称 |
|||
category: '', |
|||
areaCovered: '',//占地面积 |
|||
capacity: '',//容纳人数 |
|||
address: '', //详细地址 |
|||
longitude: 36.0722275, //经度 |
|||
latitude: 120.38945519 //纬度 |
|||
}, |
|||
serviceList: [],//服务list |
|||
publicServiceData: {}, |
|||
} |
|||
}, |
|||
components: {}, |
|||
mounted () { |
|||
this.initMap() |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
async initForm (type, icPublicServiceId) { |
|||
this.startLoading() |
|||
this.$refs.ref_form.resetFields(); |
|||
|
|||
//获取服务事项 |
|||
await this.loadService() |
|||
|
|||
this.formType = type |
|||
if (icPublicServiceId) { |
|||
this.icPublicServiceId = icPublicServiceId |
|||
this.formData.icPublicServiceId = icPublicServiceId |
|||
await this.loadFormData() |
|||
} else { |
|||
// map.setCenter(new TMap.LatLng(36.0722275, 120.38945519)) |
|||
// this.setMarker(36.0722275, 120.38945519) |
|||
} |
|||
|
|||
this.endLoading() |
|||
|
|||
}, |
|||
|
|||
//获取服务事项下拉框 |
|||
async loadService () { |
|||
const url = "/gov/org/coverage/dict-select-list/public_service" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/coverage/dict-select-list/public_service" |
|||
let params = { |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.serviceList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
//加载组织 |
|||
async loadFormData () { |
|||
const url = '/gov/org/icPublicService/detail' |
|||
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/detail' |
|||
let params = { |
|||
icPublicServiceId: this.icPublicServiceId |
|||
} |
|||
const { data, code, msg } = await requestPost(url, params) |
|||
if (code === 0) { |
|||
console.log(data) |
|||
if (null != data) { |
|||
data: this.publicServiceData |
|||
} |
|||
|
|||
this.formData = { ...data } |
|||
// let { latitude, longitude } = this.$store.state.user; |
|||
// const lat = this.formData.latitude === null || this.formData.latitude === '' ? '' : this.formData.latitude; |
|||
// const lon = this.formData.longitude === null || this.formData.longitude === '' ? '' : this.formData.longitude; |
|||
if (this.formData.latitude !== null && this.formData.latitude !== '' && this.formData.longitude !== null && this.formData.longitude !== ''){ |
|||
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|||
this.setMarker(this.formData.latitude, this.formData.longitude) |
|||
} |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
|
|||
|
|||
async handleComfirm () { |
|||
|
|||
this.btnDisable = true |
|||
setTimeout(() => { |
|||
this.btnDisable = false |
|||
}, 10000) |
|||
this.$refs['ref_form'].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj) |
|||
this.btnDisable = false |
|||
} else { |
|||
this.addUnit() |
|||
} |
|||
|
|||
}) |
|||
|
|||
|
|||
}, |
|||
async addUnit () { |
|||
let url = '' |
|||
if (this.formType === 'add'){ |
|||
url = '/gov/org/icPublicService/add' |
|||
}else { |
|||
url = '/gov/org/icPublicService/edit' |
|||
} |
|||
const { data, code, msg,internalMsg } = await requestPost(url, this.formData) |
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '操作成功' |
|||
}) |
|||
this.resetData() |
|||
this.$emit('dialogOk') |
|||
this.btnDisable = false |
|||
} else { |
|||
this.btnDisable = false |
|||
this.$message.error(internalMsg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
handleCancle () { |
|||
this.resetData() |
|||
this.$emit('dialogCancle') |
|||
|
|||
}, |
|||
|
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap () { |
|||
let { latitude, longitude } = this.$store.state.user; |
|||
console.log('lat'+latitude+',lon'+longitude) |
|||
if (!latitude || latitude == "" || latitude == "0") { |
|||
latitude = 39.9088810666821; |
|||
longitude = 116.39743841556731; |
|||
} |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(latitude, longitude); |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById('app'), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45 // 设置地图旋转角度 |
|||
}) |
|||
|
|||
search = new window.TMap.service.Search({ pageSize: 10 }) |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [] |
|||
}) |
|||
infoWindowList = Array(10) |
|||
|
|||
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|||
|
|||
// 监听地图平移结束 |
|||
map.on('panend', () => { |
|||
this.handleMoveCenter() |
|||
}) |
|||
// this.handleMoveCenter() |
|||
this.convert() |
|||
}, |
|||
|
|||
setMarker (lat, lng) { |
|||
markers.setGeometries([]) |
|||
markers.add([ |
|||
{ |
|||
id: '4', |
|||
styleId: 'marker', |
|||
position: new TMap.LatLng(lat, lng), |
|||
properties: { |
|||
title: 'marker4' |
|||
} |
|||
} |
|||
]) |
|||
}, |
|||
|
|||
handleSearchMap () { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close() |
|||
}) |
|||
infoWindowList.length = 0 |
|||
markers.setGeometries([]) |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.formData.address, |
|||
bounds: map.getBounds() |
|||
}) |
|||
.then((result) => { |
|||
let { data } = result |
|||
if (Array.isArray(data) && data.length > 0) { |
|||
const { |
|||
location: { lat, lng } |
|||
} = data[0] |
|||
|
|||
|
|||
map.setCenter(new TMap.LatLng(lat, lng)) |
|||
this.setMarker(lat, lng) |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.convert() |
|||
} else { |
|||
this.$message.error('未检索到相关位置坐标') |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
handleMoveCenter () { |
|||
//修改地图中心点 |
|||
const center = map.getCenter() |
|||
const lat = center.getLat() |
|||
const lng = center.getLng() |
|||
this.formData.latitude = lat |
|||
this.formData.longitude = lng |
|||
this.setMarker(lat, lng) |
|||
this.convert(lat, lng) |
|||
}, |
|||
|
|||
convert (lat, lng) { |
|||
markers.setGeometries([]); |
|||
// var input = document.getElementById('location').value.split(','); |
|||
let location |
|||
if (lat && lng) { |
|||
location = new TMap.LatLng(lat, lng); |
|||
} else { |
|||
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude); |
|||
} |
|||
|
|||
// map.setCenter(location); |
|||
markers.updateGeometries([ |
|||
{ |
|||
id: 'main', // 点标注数据数组 |
|||
position: location, |
|||
}, |
|||
]); |
|||
geocoder |
|||
.getAddress({ location: location }) // 将给定的坐标位置转换为地址 |
|||
.then((result) => { |
|||
console.log(this.formData) |
|||
// this.formData.address = result.result.address === '' || result.result.address === null ? this.formData.address : result.result.address |
|||
this.formData.address = this.formData.address !== '' && this.formData.address !== null && (this.formData.longitude === '' || this.formData.longitude === null) ? this.formData.address : result.result.address |
|||
// 显示搜索到的地址 |
|||
}); |
|||
}, |
|||
|
|||
|
|||
resetData () { |
|||
this.icPublicServiceId = '' |
|||
this.keyWords = '' |
|||
this.formData = { |
|||
name: '', |
|||
category: '', |
|||
areaCovered: '', |
|||
capacity: '', |
|||
address: '', //详细地址 |
|||
longitude: '', //经度 |
|||
latitude: '' //纬度 |
|||
} |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
|
|||
name: [ |
|||
{ required: true, message: '场所名称不能为空', trigger: 'blur' }, |
|||
], |
|||
category: [ |
|||
{ required: true, message: '场所类别不能为空', trigger: 'blur' } |
|||
], |
|||
address: [ |
|||
{ required: true, message: '地址不能为空', trigger: 'blur' } |
|||
], |
|||
/*longitude: [ |
|||
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|||
], |
|||
latitude: [ |
|||
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|||
]*/ |
|||
} |
|||
}, |
|||
|
|||
}, |
|||
props: { |
|||
|
|||
typeList: { |
|||
type: Array, |
|||
default: [] |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
.div_map { |
|||
position: relative; |
|||
} |
|||
.div_searchmap { |
|||
z-index: 5000; |
|||
position: absolute; |
|||
top: 5px; |
|||
left: 5px; |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss" scoped > |
|||
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|||
</style> |
|||
@ -0,0 +1,179 @@ |
|||
<template> |
|||
<div> |
|||
<base-page |
|||
:searchParams="searchParams" |
|||
:tableParams="tableParams" |
|||
:tableUrl="tableUrl" |
|||
:addUrl="addUrl" |
|||
:editUrl="editUrl" |
|||
:delUrl="delUrl" |
|||
:editAuth="editAuth" |
|||
:delAuth="delAuth" |
|||
:infoUrl="infoUrl" |
|||
:exportUrl="exportUrl" |
|||
:importUrl="importUrl" |
|||
:mubanUrl="mubanUrl" |
|||
:editParams="editParams" |
|||
:editElseRules="editElseRules" |
|||
:editBtnName="(item) => (!item.latitude ? '待完善' : '修改')" |
|||
idName="icDangerousChemicalsId" |
|||
></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/cpts/base/index"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
searchParams: [ |
|||
{ field: "企业名称", keyName: "name", type: "input" }, |
|||
{ |
|||
field: "企业类型", |
|||
keyName: "category", |
|||
type: "select", |
|||
optionUrl: "/gov/org/coverage/dict-select-list/dangerous_chemicals", |
|||
optionUrlParams: {}, |
|||
optionList: [], |
|||
}, |
|||
{ |
|||
field: "危化品种类", |
|||
keyName: "dangerType", |
|||
type: "select", |
|||
optionUrl: "/sys/dict/data/dictlist", |
|||
optionUrlParams: { |
|||
dictType: "ic_danger_type", |
|||
}, |
|||
optionList: [], |
|||
}, |
|||
], |
|||
|
|||
tableParams: [ |
|||
{ field: "序号", keyName: "", type: "no" }, |
|||
{ field: "企业名称", keyName: "name", type: "text" }, |
|||
{ field: "企业类别", keyName: "categoryName", type: "text" }, |
|||
{ field: "周边安全间距", keyName: "safeDistanceName", type: "text" }, |
|||
{ field: "危化品种类", keyName: "dangerTypeName", type: "text" }, |
|||
{ field: "经营地址", keyName: "address", type: "text" }, |
|||
{ field: "负责人", keyName: "principalName", type: "text" }, |
|||
{ field: "联系电话", keyName: "principalMobile", type: "text" }, |
|||
{ field: "备注", keyName: "remark", type: "text" }, |
|||
], |
|||
tableUrl: "/gov/org/icDangerousChemicals/list", |
|||
mubanUrl: "/gov/org/icDangerousChemicals/download", |
|||
importUrl: "/gov/org/icDangerousChemicals/import", |
|||
exportUrl: "/gov/org/icDangerousChemicals/export", |
|||
|
|||
addUrl: "/gov/org/icDangerousChemicals/add", |
|||
editUrl: "/gov/org/icDangerousChemicals/edit", |
|||
infoUrl: "/gov/org/icDangerousChemicals/detail", |
|||
delUrl: "/gov/org/icDangerousChemicals/del", |
|||
editAuth(item) { |
|||
return item.agencyId == this.$store.state.user.agencyId; |
|||
}, |
|||
delAuth(item) { |
|||
return item.agencyId == this.$store.state.user.agencyId; |
|||
}, |
|||
|
|||
editParams: [ |
|||
{ |
|||
field: "企业名称", |
|||
keyName: "name", |
|||
type: "input", |
|||
maxlength: 50, |
|||
editDisabled: true, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "企业名称不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: "企业分类", |
|||
keyName: "category", |
|||
type: "select", |
|||
optionUrl: "/gov/org/coverage/dict-select-list/dangerous_chemicals", |
|||
optionUrlParams: { |
|||
// dictType: "ic_service_type", |
|||
}, |
|||
optionList: [], |
|||
editDisabled: true, |
|||
rules: [ |
|||
{ required: true, message: "企业分类不能为空", trigger: "blur" }, |
|||
], |
|||
}, |
|||
{ |
|||
field: "周边安全间距", |
|||
keyName: "safeDistance", |
|||
type: "number", |
|||
precision: 2, |
|||
step: 0.01, |
|||
min: 0, |
|||
max: 1000000000, |
|||
unitName: "公里", |
|||
}, |
|||
{ |
|||
field: "危化品种类", |
|||
keyName: "dangerType", |
|||
type: "select", |
|||
optionUrl: "/sys/dict/data/dictlist", |
|||
optionUrlParams: { |
|||
dictType: "ic_danger_type", |
|||
}, |
|||
optionList: [], |
|||
editDisabled: true, |
|||
}, |
|||
{ |
|||
field: "负责人", |
|||
keyName: "principalName", |
|||
type: "input", |
|||
maxlength: 50, |
|||
}, |
|||
{ |
|||
field: "联系电话", |
|||
keyName: "principalMobile", |
|||
type: "input", |
|||
maxlength: 50, |
|||
}, |
|||
{ |
|||
field: "经营地址", |
|||
keyName: "address", |
|||
type: "address", |
|||
maxlength: 50, |
|||
supKeys: ["longitude", "latitude"], |
|||
supValues: ["", ""], |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "经营地址坐标不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
{ field: "备注", keyName: "remark", type: "textarea" }, |
|||
], |
|||
editElseRules: { |
|||
longitude: { |
|||
type: "number", |
|||
required: true, |
|||
message: "请拖动地图选择坐标点", |
|||
}, |
|||
}, |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,540 @@ |
|||
<template> |
|||
<div class="m-record" style="padding: 0 20px"> |
|||
<h3>巡查记录</h3> |
|||
<div class="mt10" v-if="formType == 'edit'"> |
|||
<el-button |
|||
size="small" |
|||
class="diy-button--add" |
|||
:disabled="btnDisabled || disabled" |
|||
@click="handleAdd" |
|||
>新增</el-button |
|||
> |
|||
</div> |
|||
<el-table |
|||
:data="tableData" |
|||
row-key="id" |
|||
border |
|||
style="width: 100%" |
|||
:header-cell-style="getRowClass" |
|||
> |
|||
<el-table-column label="序号" type="index" align="center" width="50"> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="patrolTime" |
|||
label="巡查时间" |
|||
align="center" |
|||
width="200px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-date-picker |
|||
v-if="scope.row.isEdit" |
|||
v-model="scope.row.patrolTime" |
|||
type="date" |
|||
class="input-width" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期" |
|||
> |
|||
</el-date-picker> |
|||
<div v-else class="div-content">{{ scope.row.patrolTime }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="staffId" |
|||
label="巡查人员" |
|||
align="center" |
|||
width="200px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-select |
|||
v-if="scope.row.isEdit" |
|||
v-model="scope.row.staffId" |
|||
placeholder="请选择" |
|||
class="input-width" |
|||
@change="handleChangeStaff(scope.row)" |
|||
clearable |
|||
> |
|||
<el-option |
|||
v-for="subItem in optionStaff" |
|||
:key="subItem.value" |
|||
:label="subItem.label" |
|||
:value="subItem.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
<div v-else class="div-content">{{ scope.row.staffName }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="mobile" |
|||
label="联系电话" |
|||
align="center" |
|||
width="200px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-input |
|||
v-if="scope.row.isEdit" |
|||
type="number" |
|||
v-model="scope.row.mobile" |
|||
placeholder="请输入" |
|||
class="input-width" |
|||
clearable |
|||
disabled |
|||
></el-input> |
|||
<div v-else class="div-content">{{ scope.row.mobile }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="result" |
|||
label="巡查结果" |
|||
align="center" |
|||
width="200px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-select |
|||
v-if="scope.row.isEdit" |
|||
v-model="scope.row.result" |
|||
placeholder="请选择" |
|||
class="input-width" |
|||
size="small" |
|||
clearable |
|||
> |
|||
<el-option |
|||
v-for="subItem in optionResult" |
|||
:key="subItem.value" |
|||
:label="subItem.label" |
|||
:value="subItem.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
<div v-else class="div-content">{{ scope.row.resultName }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="detailed" |
|||
label="隐患明细" |
|||
align="center" |
|||
width="200px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-input |
|||
v-if="scope.row.isEdit" |
|||
type="text" |
|||
v-model="scope.row.detailed" |
|||
placeholder="请输入" |
|||
class="input-width" |
|||
maxlength="500" |
|||
clearable |
|||
></el-input> |
|||
<div v-else class="div-content">{{ scope.row.detailed }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="imgList" |
|||
label="图片列表" |
|||
align="center" |
|||
width="150px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div v-if="scope.row.isEdit"> |
|||
<el-upload |
|||
class="avatar-uploader" |
|||
:action="uploadUrl" |
|||
:data="{ customerId: customerId }" |
|||
:show-file-list="true" |
|||
:limit="3" |
|||
:file-list="scope.row.imgShowList" |
|||
:on-success="(res) => handleImgSuccess(res, scope.row)" |
|||
:on-remove="(res) => handleImgRemove(res, scope.row)" |
|||
list-type="picture" |
|||
:before-upload="beforeImgUpload" |
|||
> |
|||
<i class="el-icon-plus avatar-uploader-icon"></i> 最多三张图片 |
|||
</el-upload> |
|||
</div> |
|||
|
|||
<div v-else class="div-content"> |
|||
<el-image |
|||
v-if="scope.row.imgList.length > 0" |
|||
style="width: 100px; height: 50px" |
|||
:src="scope.row.imgList[0]" |
|||
fit="cover" |
|||
:preview-src-list="scope.row.imgList" |
|||
></el-image> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="reviewTime" |
|||
label="拟复查时间" |
|||
align="center" |
|||
width="200px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-date-picker |
|||
v-if="scope.row.isEdit" |
|||
v-model="scope.row.reviewTime" |
|||
type="date" |
|||
class="input-width" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期" |
|||
> |
|||
</el-date-picker> |
|||
<div v-else class="div-content">{{ scope.row.patrolTime }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
v-if="!disabled" |
|||
fixed="right" |
|||
label="操作" |
|||
align="center" |
|||
width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<template v-if="scope.row.isEdit"> |
|||
<el-button |
|||
@click="handleEdit(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-edit" |
|||
>保存</el-button |
|||
> |
|||
<el-button |
|||
@click="handleChange(scope.row, 'cancle')" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-edit" |
|||
>取消</el-button |
|||
> |
|||
</template> |
|||
<template v-else> |
|||
<el-button |
|||
v-if="formType == 'edit'" |
|||
@click="handleChange(scope.row, 'edit')" |
|||
type="text" |
|||
size="small" |
|||
:disabled="disabled" |
|||
class="btn-color-edit" |
|||
>修改</el-button |
|||
> |
|||
<el-popconfirm |
|||
v-if="formType == 'edit'" |
|||
title="删除之后无法恢复,确认删除?" |
|||
@onConfirm="del(scope.row)" |
|||
@confirm="del(scope.row)" |
|||
> |
|||
<el-button |
|||
slot="reference" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-del" |
|||
style="margin-left: 10px" |
|||
>删除</el-button |
|||
> |
|||
</el-popconfirm> |
|||
</template> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { requestPost } from "@/js/dai/request"; |
|||
|
|||
export default { |
|||
props: { |
|||
enterpriseId: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
enterpriseInfo: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
disabled: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
formType: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
uploadUrl: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2", |
|||
customerId: localStorage.getItem("customerId"), |
|||
|
|||
btnDisabled: false, |
|||
btnType: "cancle", |
|||
isEdit: false, |
|||
tableData: [], |
|||
tempRow: {}, |
|||
|
|||
optionResult: [ |
|||
{ |
|||
label: "合格", |
|||
value: "0", |
|||
}, |
|||
{ |
|||
label: "不合格", |
|||
value: "1", |
|||
}, |
|||
], |
|||
optionStaff: [ |
|||
// { |
|||
// label: "人名", |
|||
// value: "staffId", |
|||
// }, |
|||
], |
|||
}; |
|||
}, |
|||
|
|||
computed: { |
|||
allowOperate() { |
|||
const { |
|||
enterpriseInfo: { agencyId }, |
|||
} = this; |
|||
return agencyId && agencyId == this.$store.state.user.agencyId; |
|||
}, |
|||
}, |
|||
watch: { |
|||
enterpriseId: { |
|||
handler(val) { |
|||
console.log("val------points", val); |
|||
if (val.length > 0) { |
|||
this.btnDisabled = false; |
|||
this.getList(); |
|||
} else this.btnDisabled = true; |
|||
}, |
|||
immediate: true, |
|||
}, |
|||
}, |
|||
|
|||
created() { |
|||
this.getOptionStaff(); |
|||
}, |
|||
|
|||
methods: { |
|||
beforeImgUpload(file) { |
|||
console.log(file); |
|||
const isLt1M = file.size / 1024 / 1024 < 10; |
|||
const srcType = file.type; |
|||
const format = file.name.split(".").pop(); |
|||
|
|||
if (!isLt1M) { |
|||
this.$message.error("上传文件大小不能超过 10MB!"); |
|||
return false; |
|||
} |
|||
if (srcType.indexOf("image") == -1) { |
|||
this.$message.error("仅限图片格式"); |
|||
return false; |
|||
} |
|||
return true; |
|||
}, |
|||
|
|||
handleImgSuccess(res, row) { |
|||
console.log("handleImgSuccess", res); |
|||
if (res.code === 0 && res.msg === "success") { |
|||
row.imgList.push(res.data.url); |
|||
this.computeImgShowList(row); |
|||
} else { |
|||
this.$message.error(res.msg); |
|||
} |
|||
}, |
|||
|
|||
computeImgShowList(row) { |
|||
row.imgShowList = row.imgList.map((url) => { |
|||
return { name: "", url }; |
|||
}); |
|||
}, |
|||
|
|||
handleImgRemove(file, row) { |
|||
console.log("handleImgRemove", file); |
|||
let url = file.url || file.response.data.url; |
|||
if (url) { |
|||
row.imgList = row.imgList.filter((item) => item !== url); |
|||
this.computeImgShowList(row); |
|||
} |
|||
}, |
|||
|
|||
getRowClass({ rowIndex, columnIndex }) { |
|||
if (rowIndex === 0) { |
|||
return "background: #2195fe; color: #fff;"; |
|||
} |
|||
}, |
|||
|
|||
handleChange(row, type) { |
|||
console.log("type----", type); |
|||
if (type == "cancle") { |
|||
row = { ...this.tempRow }; |
|||
row.isEdit = false; |
|||
if (this.btnType == "add") this.tableData.pop(); |
|||
this.getList(); |
|||
console.log("row----", row); |
|||
} else { |
|||
this.tempRow = { ...row }; |
|||
row.isEdit = true; |
|||
} |
|||
this.btnType = type; |
|||
this.isEdit = !this.isEdit; |
|||
}, |
|||
|
|||
handleChangeStaff(row) { |
|||
const { staffId } = row; |
|||
const { optionStaff } = this; |
|||
let item = optionStaff.find((item) => item.value == staffId); |
|||
if (item) { |
|||
row.staffName = item.name; |
|||
row.mobile = item.mobile; |
|||
} |
|||
}, |
|||
|
|||
async getOptionStaff() { |
|||
let url = `/data/aggregator/org/staff-select-list/${this.$store.state.user.agencyId}`; |
|||
const { data, code, msg } = await requestPost(url, {}); |
|||
|
|||
if (code === 0) { |
|||
this.optionStaff = data || []; |
|||
} else { |
|||
this.$message.error("请求工作人员数据失败!"); |
|||
} |
|||
}, |
|||
|
|||
async handleEdit(row) { |
|||
if (this.btnType == "add") this.save(row); |
|||
else this.edit(row); |
|||
}, |
|||
|
|||
handleAdd() { |
|||
this.btnType = "add"; |
|||
this.isEdit = true; |
|||
|
|||
const item = { |
|||
isEdit: true, |
|||
enterpriseId: this.enterpriseId, |
|||
patrolTime: "", |
|||
staffId: "", |
|||
staffName: "", |
|||
mobile: "", |
|||
result: "", |
|||
imgList: [], |
|||
reviewTime: "", |
|||
}; |
|||
this.computeImgShowList(item); |
|||
this.tableData.push(item); |
|||
}, |
|||
|
|||
async save(row) { |
|||
const params = { |
|||
partyMemberId: this.enterpriseId, |
|||
...row, |
|||
}; |
|||
await this.$http |
|||
.post("/gov/org/enterprise/addorupdate-patrol", params) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
this.$message.success("保存成功"); |
|||
row.isEdit = false; |
|||
this.isEdit = false; |
|||
this.btnType = "cancle"; |
|||
this.getList(); |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err", err); |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
async edit(row) { |
|||
const params = { |
|||
...row, |
|||
}; |
|||
|
|||
await this.$http |
|||
.post("/gov/org/enterprise/addorupdate-patrol", params) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
this.$message.success("保存成功"); |
|||
row.isEdit = false; |
|||
this.isEdit = false; |
|||
this.getList(); |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err", err); |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
async del(row) { |
|||
await this.$http |
|||
.post(`/gov/org/enterprise/del-patrol/${row.patrolId}`) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
this.$message.success("删除成功"); |
|||
this.getList(); |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err", err); |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
async getList() { |
|||
const { enterpriseId } = this; |
|||
|
|||
const params = {}; |
|||
|
|||
await this.$http |
|||
.post(`/gov/org/enterprise/patrollist/${enterpriseId}`, { |
|||
params, |
|||
}) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
this.tableData = res.data.list.map((item) => { |
|||
this.computeImgShowList(item); |
|||
return { |
|||
...item, |
|||
isEdit: false, |
|||
}; |
|||
}); |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err", err); |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.m-record { |
|||
.mt10 { |
|||
margin-bottom: 10px; |
|||
} |
|||
.input-width { |
|||
width: 170px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,250 @@ |
|||
<template> |
|||
<div> |
|||
<base-page |
|||
:searchParams="searchParams" |
|||
:tableParams="tableParams" |
|||
:tableUrl="tableUrl" |
|||
:addUrl="addUrl" |
|||
:editUrl="editUrl" |
|||
:delUrl="delUrl" |
|||
:infoUrl="infoUrl" |
|||
:editAuth="editAuth" |
|||
:delAuth="delAuth" |
|||
:exportUrl="exportUrl" |
|||
:importUrl="importUrl" |
|||
:mubanUrl="mubanUrl" |
|||
:editParams="editParams" |
|||
:editElseRules="editElseRules" |
|||
:editFixedParams="editFixedParams" |
|||
:editParamsDiv="5" |
|||
:editBtnName="(item) => (!item.latitude ? '待完善' : '修改')" |
|||
:formBtnFixed="false" |
|||
idName="enterpriseId" |
|||
> |
|||
<template v-slot:editElse="{ id, formType, info }"> |
|||
<record |
|||
v-if="formType != 'add' && id" |
|||
:formType="formType" |
|||
:enterpriseId="id" |
|||
:enterpriseInfo="info" |
|||
></record> |
|||
</template> |
|||
</base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/cpts/base/index"; |
|||
import record from "./cpts/record"; |
|||
|
|||
export default { |
|||
components: { basePage, record }, |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
searchParams: [ |
|||
{ field: "场所名称", keyName: "placeOrgName", type: "input" }, |
|||
{ field: "联系电话", keyName: "mobile", type: "input" }, |
|||
{ |
|||
field: "场所区域", |
|||
keyName: "gridId", |
|||
type: "select", |
|||
optionUrl: "/gov/org/customergrid/gridoption", |
|||
optionUrlParams: { |
|||
agencyId: this.$store.state.user.agencyId, |
|||
purpose: "query", |
|||
}, |
|||
optionList: [], |
|||
}, |
|||
{ |
|||
field: "场所类型", |
|||
keyName: "placeType", |
|||
type: "select", |
|||
optionUrl: "/gov/org/coverage/dict-select-list/enterprise_patrol", |
|||
optionUrlParams: {}, |
|||
optionList: [], |
|||
}, |
|||
{ |
|||
field: "规模", |
|||
keyName: "scale", |
|||
type: "select", |
|||
optionUrl: "/sys/dict/data/dictlist", |
|||
optionUrlParams: { |
|||
dictType: "scale", |
|||
}, |
|||
optionList: [], |
|||
}, |
|||
{ |
|||
field: "巡查结果", |
|||
keyName: "result", |
|||
type: "select", |
|||
optionUrl: "", |
|||
optionUrlParams: {}, |
|||
optionList: [ |
|||
{ |
|||
value: "0", |
|||
label: "合格", |
|||
}, |
|||
{ |
|||
value: "1", |
|||
label: "不合格", |
|||
}, |
|||
], |
|||
}, |
|||
{ field: "隐患明细", keyName: "detailed", type: "input" }, |
|||
], |
|||
|
|||
tableParams: [ |
|||
{ field: "序号", keyName: "", type: "no" }, |
|||
{ field: "场所名称", keyName: "placeOrgName", type: "text" }, |
|||
{ field: "场所地址", keyName: "address", type: "text" }, |
|||
{ field: "场所类型", keyName: "placeTypeName", type: "text" }, |
|||
{ field: "规模", keyName: "scaleName", type: "text" }, |
|||
{ field: "负责人", keyName: "personInCharge", type: "text" }, |
|||
{ field: "联系电话", keyName: "mobile", type: "text" }, |
|||
{ field: "最新检查时间", keyName: "latestPatrolTime", type: "text" }, |
|||
{ field: "最新结果", keyName: "latestResultName", type: "text" }, |
|||
], |
|||
tableUrl: "/gov/org/enterprise/list", |
|||
mubanUrl: "/gov/org/enterprise/download-tem", |
|||
importUrl: "/gov/org/enterprise/import", |
|||
exportUrl: "/gov/org/enterprise/export", |
|||
|
|||
addUrl: "/gov/org/enterprise/addOrUpdate", |
|||
editUrl: "/gov/org/enterprise/addOrUpdate", |
|||
infoUrl: "/gov/org/enterprise/detail/", |
|||
delUrl: "/gov/org/enterprise/delete/", |
|||
editAuth(item) { |
|||
return item.agencyId == this.$store.state.user.agencyId; |
|||
}, |
|||
delAuth(item) { |
|||
return item.agencyId == this.$store.state.user.agencyId; |
|||
}, |
|||
|
|||
editParams: [ |
|||
{ |
|||
field: "场所类型", |
|||
keyName: "placeType", |
|||
type: "select", |
|||
optionUrl: "/gov/org/coverage/dict-select-list/enterprise_patrol", |
|||
optionUrlParams: { |
|||
// dictType: "ic_service_type", |
|||
}, |
|||
optionList: [], |
|||
editDisabled: true, |
|||
rules: [ |
|||
{ required: true, message: "场所类型不能为空", trigger: "blur" }, |
|||
], |
|||
}, |
|||
{ |
|||
field: "场所区域", |
|||
keyName: "gridId", |
|||
type: "select", |
|||
optionUrl: "/gov/org/customergrid/gridoption", |
|||
optionUrlParams: { |
|||
agencyId: this.$store.state.user.agencyId, |
|||
purpose: "addorupdate", |
|||
}, |
|||
optionList: [], |
|||
editDisabled: true, |
|||
rules: [ |
|||
{ required: true, message: "场所区域不能为空", trigger: "blur" }, |
|||
], |
|||
}, |
|||
{ |
|||
field: "场所名称", |
|||
keyName: "placeOrgName", |
|||
type: "input", |
|||
maxlength: 50, |
|||
editDisabled: true, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "场所名称不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: "规模", |
|||
keyName: "scale", |
|||
type: "select", |
|||
optionUrl: "/sys/dict/data/dictlist", |
|||
optionUrlParams: { |
|||
dictType: "scale", |
|||
}, |
|||
optionList: [], |
|||
editDisabled: false, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "规模不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: "负责人", |
|||
keyName: "personInCharge", |
|||
type: "input", |
|||
|
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "负责人不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: "联系电话", |
|||
keyName: "mobile", |
|||
maxlength: 50, |
|||
type: "input", |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "联系电话不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: "场所地址", |
|||
keyName: "address", |
|||
type: "address", |
|||
maxlength: 50, |
|||
supKeys: ["longitude", "latitude"], |
|||
supValues: ["", ""], |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "场所地址坐标不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
editFixedParams: { |
|||
agencyId: this.$store.state.user.agencyId, |
|||
}, |
|||
editElseRules: { |
|||
longitude: { |
|||
type: "number", |
|||
required: true, |
|||
message: "请拖动地图选择坐标点", |
|||
}, |
|||
}, |
|||
}; |
|||
}, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,150 @@ |
|||
<template> |
|||
<div> |
|||
<base-page |
|||
:searchParams="searchParams" |
|||
:tableParams="tableParams" |
|||
:tableUrl="tableUrl" |
|||
:addUrl="addUrl" |
|||
:editUrl="editUrl" |
|||
:delUrl="delUrl" |
|||
:editAuth="editAuth" |
|||
:delAuth="delAuth" |
|||
:infoUrl="infoUrl" |
|||
:exportUrl="exportUrl" |
|||
:importUrl="importUrl" |
|||
:mubanUrl="mubanUrl" |
|||
:editParams="editParams" |
|||
:editElseRules="editElseRules" |
|||
:editBtnName="(item) => (!item.latitude ? '待完善' : '修改')" |
|||
idName="icSuperiorResourceId" |
|||
></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/cpts/base/index"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
searchParams: [ |
|||
{ field: "场所名称", keyName: "name", type: "input" }, |
|||
{ |
|||
field: "场所分类", |
|||
keyName: "category", |
|||
type: "select", |
|||
optionUrl: "/gov/org/coverage/dict-select-list/superior_resource", |
|||
optionUrlParams: {}, |
|||
optionList: [], |
|||
}, |
|||
], |
|||
|
|||
tableParams: [ |
|||
{ field: "序号", keyName: "", type: "no" }, |
|||
{ field: "场所名称", keyName: "name", type: "text" }, |
|||
{ field: "场所类别", keyName: "categoryName", type: "text" }, |
|||
{ field: "占地面积", keyName: "areaCoveredName", type: "text" }, |
|||
{ field: "容纳人数", keyName: "capacityName", type: "text" }, |
|||
{ field: "地址", keyName: "address", type: "text" }, |
|||
], |
|||
tableUrl: "/gov/org/icSuperiorResource/list", |
|||
mubanUrl: "/gov/org/icSuperiorResource/download", |
|||
importUrl: "/gov/org/icSuperiorResource/import", |
|||
exportUrl: "/gov/org/icSuperiorResource/export", |
|||
|
|||
addUrl: "/gov/org/icSuperiorResource/add", |
|||
editUrl: "/gov/org/icSuperiorResource/edit", |
|||
infoUrl: "/gov/org/icSuperiorResource/detail", |
|||
delUrl: "/gov/org/icSuperiorResource/del", |
|||
editAuth(item) { |
|||
return item.agencyId == this.$store.state.user.agencyId; |
|||
}, |
|||
delAuth(item) { |
|||
return item.agencyId == this.$store.state.user.agencyId; |
|||
}, |
|||
|
|||
editParams: [ |
|||
{ |
|||
field: "场所名称", |
|||
keyName: "name", |
|||
type: "input", |
|||
maxlength: 50, |
|||
editDisabled: true, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "场所名称不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: "场所分类", |
|||
keyName: "category", |
|||
type: "select", |
|||
optionUrl: "/gov/org/coverage/dict-select-list/superior_resource", |
|||
optionUrlParams: { |
|||
// dictType: "ic_service_type", |
|||
}, |
|||
optionList: [], |
|||
editDisabled: true, |
|||
rules: [ |
|||
{ required: true, message: "场所分类不能为空", trigger: "blur" }, |
|||
], |
|||
}, |
|||
{ |
|||
field: "占地面积", |
|||
keyName: "areaCovered", |
|||
type: "number", |
|||
min: 0, |
|||
max: 1000000000, |
|||
precision: 2, |
|||
step: 0.01, |
|||
unitName: "平方公里", |
|||
}, |
|||
{ |
|||
field: "容纳人数", |
|||
keyName: "capacity", |
|||
type: "number", |
|||
min: 0, |
|||
max: 1000000000, |
|||
// unitName: "个", |
|||
}, |
|||
{ |
|||
field: "位置坐标", |
|||
keyName: "address", |
|||
type: "address", |
|||
maxlength: 50, |
|||
supKeys: ["longitude", "latitude"], |
|||
supValues: ["", ""], |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: "地址坐标不能为空", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
editElseRules: { |
|||
longitude: { |
|||
type: "number", |
|||
required: true, |
|||
message: "请拖动地图选择坐标点", |
|||
}, |
|||
}, |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<div> |
|||
<base-page :elseParams="elseParams"></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/shequzhili/tuceng/zhonghe/base"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
elseParams: [ |
|||
{ |
|||
queryType: "list_equal", |
|||
tableName: "ic_special", |
|||
columnName: "SPECIAL_RQLB", |
|||
columnValue: ["anzhibangjiao"], |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,879 @@ |
|||
<template> |
|||
<div class="resi-container"> |
|||
<el-card ref="searchCard" class="search-card"> |
|||
<el-form |
|||
ref="searchForm" |
|||
:inline="true" |
|||
:model="fmData" |
|||
:label-width="'100px'" |
|||
class="demo-form-inline" |
|||
> |
|||
<div> |
|||
<el-form-item prop="gridId" label="所属组织"> |
|||
<div class="resi-cell-value"> |
|||
<el-cascader class="customer_cascader" |
|||
ref="myCascader" |
|||
clearable |
|||
v-model="agencyIdArray" |
|||
:options="orgOptions" |
|||
:props="orgOptionProps" |
|||
:show-all-levels="false" |
|||
@change="handleChangeAgency"></el-cascader> |
|||
</div> |
|||
</el-form-item> |
|||
<!-- <el-form-item prop="gridId" label="所属网格"> |
|||
<div class="resi-cell-value"> |
|||
<el-select |
|||
v-model.trim="fmData.gridId" |
|||
placeholder="请选择网格" |
|||
size="small" |
|||
clearable |
|||
class="resi-cell-select" |
|||
@change="handleChangeGrid" |
|||
> |
|||
<el-option |
|||
v-for="item in optionsG" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</div> |
|||
</el-form-item> --> |
|||
|
|||
<el-form-item label="所属房屋"> |
|||
<div class="resi-cell-value"> |
|||
<div class="resi-cell-col"> |
|||
<el-form-item prop="villageId"> |
|||
<el-select |
|||
v-model.trim="fmData.villageId" |
|||
placeholder="请选择小区" |
|||
size="small" |
|||
clearable |
|||
class="resi-cell-select" |
|||
@change="handleChangeV" |
|||
> |
|||
<el-option |
|||
v-for="item in optionsV" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item prop="buildId"> |
|||
<el-select |
|||
v-model.trim="fmData.buildId" |
|||
placeholder="楼号" |
|||
size="small" |
|||
clearable |
|||
:disabled="changeVDisabled" |
|||
class="resi-cell-select resi-cell-select-middle" |
|||
@change="handleChangeB" |
|||
> |
|||
<el-option |
|||
v-for="item in optionsB" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item prop="unitId"> |
|||
<el-select |
|||
v-model.trim="fmData.unitId" |
|||
placeholder="单元" |
|||
size="small" |
|||
clearable |
|||
:disabled="changeBDisabled" |
|||
class="resi-cell-select resi-cell-select-middle" |
|||
@change="handleChangeD" |
|||
> |
|||
<el-option |
|||
v-for="item in optionsD" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item prop="homeId"> |
|||
<el-select |
|||
v-model.trim="fmData.homeId" |
|||
placeholder="房号" |
|||
size="small" |
|||
clearable |
|||
:disabled="changeDDisabled" |
|||
class="resi-cell-select resi-cell-select-middle" |
|||
> |
|||
<el-option |
|||
v-for="item in optionsH" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</div> |
|||
</div> |
|||
</el-form-item> |
|||
</div> |
|||
|
|||
<div> |
|||
<el-form-item label="姓名" prop="name"> |
|||
<el-input |
|||
v-model="fmData.name" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入" |
|||
> |
|||
</el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="手机号" prop="mobile"> |
|||
<el-input |
|||
v-model="fmData.mobile" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入" |
|||
> |
|||
</el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="身份证号" prop="idCard"> |
|||
<el-input |
|||
v-model="fmData.idCard" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入" |
|||
> |
|||
</el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button |
|||
class="diy-button--search" |
|||
size="small" |
|||
@click="handleSearch" |
|||
>查询</el-button |
|||
> |
|||
<el-button |
|||
class="diy-button--reset" |
|||
size="small" |
|||
@click="resetForm('searchForm')" |
|||
>重置</el-button |
|||
> |
|||
</el-form-item> |
|||
</div> |
|||
</el-form> |
|||
</el-card> |
|||
<el-card class="resi-card-table"> |
|||
<div class="resi-row-btn"> |
|||
<el-button @click="handleChu" class="diy-button--reset" size="small" |
|||
>导出</el-button |
|||
> |
|||
</div> |
|||
<el-table |
|||
:data="tableData" |
|||
border |
|||
style="width: 100%" |
|||
class="resi-table" |
|||
:height="tableHeight" |
|||
> |
|||
<el-table-column |
|||
label="序号" |
|||
fixed="left" |
|||
type="index" |
|||
align="center" |
|||
width="50" |
|||
/> |
|||
|
|||
<el-table-column |
|||
prop="GRID_ID" |
|||
align="center" |
|||
label="所属网格" |
|||
min-width="160" |
|||
:show-overflow-tooltip="true" |
|||
> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="HOME_ID" |
|||
label="所属房屋" |
|||
align="center" |
|||
min-width="160" |
|||
:show-overflow-tooltip="true" |
|||
/> |
|||
|
|||
<el-table-column |
|||
prop="NAME" |
|||
align="center" |
|||
label="姓名" |
|||
:show-overflow-tooltip="true" |
|||
> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="MOBILE" |
|||
width="140" |
|||
align="center" |
|||
label="手机" |
|||
:show-overflow-tooltip="true" |
|||
> |
|||
</el-table-column> |
|||
|
|||
<el-table-column prop="GENDER" align="center" width="60" label="性别"> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="ID_CARD" |
|||
align="center" |
|||
min-width="160" |
|||
label="身份证号" |
|||
:show-overflow-tooltip="true" |
|||
> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="BIRTHDAY" |
|||
align="center" |
|||
label="出生日期" |
|||
:show-overflow-tooltip="true" |
|||
> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
prop="REMARKS" |
|||
align="center" |
|||
label="备注" |
|||
:show-overflow-tooltip="true" |
|||
> |
|||
</el-table-column> |
|||
|
|||
<el-table-column fixed="right" label="操作" align="center" width="120"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
@click="handleWatch(scope.$index)" |
|||
type="text" |
|||
size="small" |
|||
>查看</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<div> |
|||
<el-pagination |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="pageNo" |
|||
:page-sizes="[20, 50, 100, 200]" |
|||
:page-size="parseInt(pageSize)" |
|||
layout="sizes, prev, pager, next, total" |
|||
:total="total" |
|||
> |
|||
</el-pagination> |
|||
</div> |
|||
</el-card> |
|||
|
|||
<people-more |
|||
v-if="showedPeopleMoreInfo && currentPepeleId" |
|||
:userId="currentPepeleId" |
|||
:gridName="currentPepeleGridName" |
|||
@close="showedPeopleMoreInfo = false" |
|||
/> |
|||
|
|||
<el-dialog |
|||
:visible.sync="diyDialog" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
width="1150px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
> |
|||
<diy-info |
|||
v-if="diyDialog" |
|||
ref="ref_diy" |
|||
:list="exportList" |
|||
:search="computeQueryParams()" |
|||
@close="diyDialog = false" |
|||
></diy-info> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import nextTick from "dai-js/tools/nextTick"; |
|||
import { mapGetters } from "vuex"; |
|||
import peopleMore from "@/views/modules/shequ/cpts/people-more"; |
|||
import diyInfo from "@/views/modules/base/diyInfo.vue"; |
|||
|
|||
export default { |
|||
props: { |
|||
elseParams: { |
|||
type: Array, |
|||
default: () => [], |
|||
}, |
|||
}, |
|||
|
|||
components: { peopleMore, diyInfo }, |
|||
data() { |
|||
return { |
|||
openSearch: false, |
|||
|
|||
formShow: false, |
|||
formTitle: "", |
|||
|
|||
pageNo: 1, |
|||
pageSize: window.localStorage.getItem("pageSize") || 20, |
|||
total: 1, |
|||
|
|||
tableData: [], |
|||
|
|||
optionsV: [], |
|||
optionsB: [], |
|||
optionsH: [], |
|||
optionsD: [], |
|||
optionsG: [], |
|||
orgOptions: [], |
|||
orgOptionProps:{ |
|||
multiple: false, |
|||
value: 'agencyId', |
|||
label: 'agencyName', |
|||
children: 'subAgencyList', |
|||
checkStrictly: true |
|||
}, |
|||
agencyIdArray:[], |
|||
|
|||
optionsWelfare: [ |
|||
{ |
|||
value: "1", |
|||
label: "是", |
|||
}, |
|||
{ |
|||
value: "0", |
|||
label: "否", |
|||
}, |
|||
], |
|||
|
|||
fmData: { |
|||
agencyId:"", |
|||
gridId: "", |
|||
villageId: "", |
|||
buildId: "", |
|||
unitId: "", |
|||
homeId: "", |
|||
name: "", |
|||
mobile: "", |
|||
idCard: "", |
|||
}, |
|||
rangeTime: [], |
|||
|
|||
searchH: 0, |
|||
tableHeight: 0, |
|||
|
|||
// 显示人员详情 |
|||
showedPeopleMoreInfo: false, |
|||
|
|||
currentPepeleId: "", |
|||
currentPepeleGridName: "", |
|||
|
|||
diyDialog: false, |
|||
exportList: [], |
|||
}; |
|||
}, |
|||
computed: { |
|||
...mapGetters(["clientHeight", "iframeHeight"]), |
|||
maxTableHeight() { |
|||
console.log("computed-searchH---", this.searchH); |
|||
const h = this.clientHeight - this.searchH + this.iframeHeight; |
|||
const _h = this.clientHeight - this.searchH; |
|||
console.log("computed-searchH---_h", _h); |
|||
return this.$store.state.inIframe ? h : _h; |
|||
}, |
|||
|
|||
changeVDisabled() { |
|||
return !this.fmData.villageId; |
|||
}, |
|||
changeBDisabled() { |
|||
return !this.fmData.buildId; |
|||
}, |
|||
changeDDisabled() { |
|||
return !this.fmData.unitId; |
|||
}, |
|||
}, |
|||
watch: { |
|||
rangeTime: function (val) { |
|||
console.log("val----", val); |
|||
if (Array.isArray(val) && val.length == 2) { |
|||
this.fmData.startTime = val[0]; |
|||
this.fmData.endTime = val[1]; |
|||
} else { |
|||
this.fmData.startTime = ""; |
|||
this.fmData.endTime = ""; |
|||
} |
|||
}, |
|||
searchH() { |
|||
const h = this.clientHeight - this.searchH + this.iframeHeight; |
|||
const _h = this.clientHeight - this.searchH; |
|||
console.log("computed-searchH---_h", _h); |
|||
|
|||
this.$nextTick(() => { |
|||
this.tableHeight = this.$store.state.inIframe ? h : _h; |
|||
}); |
|||
}, |
|||
}, |
|||
mounted() { |
|||
this.getOrgTreeList(); |
|||
this.getGridList(); |
|||
this.getValiheList(); |
|||
this.getTableData(); |
|||
this.searchH = this.$refs.searchCard.$el.offsetHeight + 270; |
|||
console.log("searchH----", this.$refs.searchCard.$el.offsetHeight); |
|||
}, |
|||
methods: { |
|||
async handleWatch(rowIndex) { |
|||
let item = this.tableData[rowIndex]; |
|||
this.currentPepeleId = item.icResiUserId; |
|||
this.currentPepeleGridName = item.GRID_ID; |
|||
await nextTick(); |
|||
this.showedPeopleMoreInfo = true; |
|||
}, |
|||
|
|||
handleClearVillage() { |
|||
this.fmData.buildId = ""; |
|||
this.fmData.homeId = ""; |
|||
}, |
|||
handleClearBuild() { |
|||
this.fmData.buildId = ""; |
|||
this.fmData.unitId = ""; |
|||
this.fmData.homeId = ""; |
|||
}, |
|||
handleClearDan() { |
|||
this.fmData.unitId = ""; |
|||
this.fmData.homeId = ""; |
|||
}, |
|||
handleChangeGrid(val) { |
|||
console.log("val", val); |
|||
this.fmData.villageId = ""; |
|||
this.fmData.buildId = ""; |
|||
this.fmData.unitId = ""; |
|||
this.fmData.homeId = ""; |
|||
this.getValiheList(); |
|||
}, |
|||
handleChangeV(val) { |
|||
console.log("val", val); |
|||
this.fmData.buildId = ""; |
|||
this.fmData.unitId = ""; |
|||
this.fmData.homeId = ""; |
|||
this.getBuildList(); |
|||
}, |
|||
handleChangeB(val) { |
|||
console.log("val", val); |
|||
this.fmData.unitId = ""; |
|||
this.fmData.homeId = ""; |
|||
this.getUniList(); |
|||
}, |
|||
handleChangeD(val) { |
|||
console.log("val", val); |
|||
this.fmData.homeId = ""; |
|||
this.getHouseList(); |
|||
}, |
|||
|
|||
getOrgTreeList() { |
|||
const { user } = this.$store.state |
|||
this.$http |
|||
.post('/gov/org/customeragency/agencygridtree', {}) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
console.log('获取组织树成功', res.data) |
|||
this.orgOptions=[] |
|||
this.orgOptions .push( res.data) |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
|
|||
getGridList() { |
|||
const { user } = this.$store.state; |
|||
this.$http |
|||
.post("/gov/org/customergrid/gridoption", { |
|||
agencyId: user.agencyId, |
|||
purpose: "query", |
|||
}) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
console.log("获取查询详情成功", res.data); |
|||
this.optionsG = res.data; |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
getValiheList() { |
|||
const { user } = this.$store.state; |
|||
this.$http |
|||
.post("/gov/org/icneighborhood/neighborhoodoption", { |
|||
gridId: this.fmData.gridId, |
|||
agencyId: this.fmData.agencyId, |
|||
// agencyId: user.agencyId |
|||
}) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
console.log("获取查询详情成功", res.data); |
|||
this.optionsV = res.data; |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
getBuildList() { |
|||
this.$http |
|||
.post("/gov/org/icbuilding/buildingoption", { |
|||
neighborHoodId: this.fmData.villageId, |
|||
}) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
console.log("获取查询详情成功", res.data); |
|||
this.optionsB = res.data; |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
getUniList() { |
|||
this.$http |
|||
.post("/gov/org/icbuildingunit/unitoption", { |
|||
buildingId: this.fmData.buildId, |
|||
}) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
console.log("获取查询详情成功", res.data); |
|||
this.optionsD = res.data; |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
getHouseList() { |
|||
this.$http |
|||
.post("/gov/org/ichouse/houseoption", { unitId: this.fmData.unitId }) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg); |
|||
} else { |
|||
console.log("获取查询详情成功", res.data); |
|||
this.optionsH = res.data; |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
return this.$message.error("网络错误"); |
|||
}); |
|||
}, |
|||
|
|||
handleSizeChange(val) { |
|||
console.log(`每页 ${val} 条`); |
|||
this.pageSize = val; |
|||
window.localStorage.setItem("pageSize", val); |
|||
this.getTableData(); |
|||
}, |
|||
handleCurrentChange(val) { |
|||
console.log(`当前页: ${val}`); |
|||
this.pageNo = val; |
|||
this.getTableData(); |
|||
}, |
|||
|
|||
handleClose() { |
|||
this.formShow = false; |
|||
}, |
|||
handleSearch(val) { |
|||
console.log(this.fmData); |
|||
this.pageNo = 1; |
|||
this.getTableData(); |
|||
}, |
|||
resetForm(formName) { |
|||
this.$refs[formName].resetFields(); |
|||
this.handleSearch(); |
|||
}, |
|||
|
|||
handleChangeAgency(val) { |
|||
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|||
|
|||
if (obj) { |
|||
if(obj.level === 'grid'){ |
|||
this.fmData.gridId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; |
|||
this.fmData.agencyId='' |
|||
}else{ |
|||
this.fmData.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; |
|||
this.fmData.gridId = '' |
|||
} |
|||
|
|||
}else{ |
|||
this.fmData.agencyId='' |
|||
this.fmData.gridId = '' |
|||
} |
|||
|
|||
|
|||
this.fmData.villageId = '' |
|||
this.fmData.buildId = '' |
|||
this.fmData.unitId = '' |
|||
this.fmData.homeId = '' |
|||
this.getValiheList() |
|||
}, |
|||
|
|||
computeQueryParams() { |
|||
const { pageSize, pageNo, elseParams, fmData } = this; |
|||
let conditions=[] |
|||
if(fmData.agencyId){ |
|||
conditions.push({ |
|||
queryType: "like", |
|||
tableName: "ic_resi_user", |
|||
columnName: "AGENCY_ID", |
|||
columnValue: [fmData.agencyId], |
|||
},) |
|||
} |
|||
|
|||
if(fmData.gridId){ |
|||
conditions.push( |
|||
{ |
|||
queryType: "equal", |
|||
tableName: "ic_resi_user", |
|||
columnName: "GRID_ID", |
|||
columnValue: [fmData.gridId], |
|||
} |
|||
) |
|||
} |
|||
|
|||
if(fmData.villageId){ |
|||
conditions.push( |
|||
{ |
|||
queryType: "equal", |
|||
tableName: "ic_resi_user", |
|||
columnName: "VILLAGE_ID", |
|||
columnValue: [fmData.villageId], |
|||
} |
|||
) |
|||
} |
|||
|
|||
if(fmData.buildId){ |
|||
conditions.push({ |
|||
queryType: "equal", |
|||
tableName: "ic_resi_user", |
|||
columnName: "BUILD_ID", |
|||
columnValue: [fmData.buildId], |
|||
}) |
|||
} |
|||
|
|||
if(fmData.unitId){ |
|||
conditions.push({ |
|||
queryType: "equal", |
|||
tableName: "ic_resi_user", |
|||
columnName: "UNIT_ID", |
|||
columnValue: [fmData.unitId], |
|||
}) |
|||
} |
|||
|
|||
if(fmData.homeId){ |
|||
conditions.push({ |
|||
queryType: "equal", |
|||
tableName: "ic_resi_user", |
|||
columnName: "HOME_ID", |
|||
columnValue: [fmData.homeId], |
|||
}) |
|||
} |
|||
|
|||
if(fmData.name){ |
|||
conditions.push({ |
|||
queryType: "like", |
|||
tableName: "ic_resi_user", |
|||
columnName: "NAME", |
|||
columnValue: [fmData.name], |
|||
}) |
|||
} |
|||
if(fmData.mobile){ |
|||
conditions.push({ |
|||
queryType: "like", |
|||
tableName: "ic_resi_user", |
|||
columnName: "MOBILE", |
|||
columnValue: [fmData.mobile], |
|||
}) |
|||
} |
|||
if(fmData.idCard){ |
|||
conditions.push({ |
|||
queryType: "like", |
|||
tableName: "ic_resi_user", |
|||
columnName: "ID_CARD", |
|||
columnValue: [fmData.idCard], |
|||
}) |
|||
} |
|||
|
|||
return { |
|||
formCode: "resi_base_info", |
|||
pageSize, |
|||
pageNo, |
|||
conditions: [ |
|||
|
|||
...conditions, |
|||
|
|||
...elseParams, |
|||
], |
|||
}; |
|||
}, |
|||
|
|||
async handleChu() { |
|||
this.getExportList(); |
|||
}, |
|||
|
|||
async getExportList() { |
|||
const url = "/oper/customize//icformitemgroup/list"; |
|||
let params = { |
|||
formCode: "resi_base_info", |
|||
}; |
|||
|
|||
const { data, code, msg } = await requestPost(url, params); |
|||
|
|||
if (code === 0) { |
|||
data.forEach((item) => { |
|||
(async (id) => { |
|||
// item.queryItemList = await this.getExportChildList(id) |
|||
item.queryItemList = []; |
|||
})(item.id); |
|||
}); |
|||
this.exportList = [...data]; |
|||
this.$nextTick(() => { |
|||
this.diyDialog = true; |
|||
}); |
|||
console.log("获取详情成功getExportList----", this.exportList); |
|||
} else { |
|||
this.$message.error(msg); |
|||
} |
|||
}, |
|||
|
|||
async getTableData() { |
|||
const url = "/epmetuser/icresiuser/listresi"; |
|||
const { data, code, msg } = await requestPost(url, { |
|||
...this.computeQueryParams(), |
|||
}); |
|||
if (code === 0) { |
|||
console.log("列表请求成功!!!!!!!!!!!!!!"); |
|||
this.total = data.total || 0; |
|||
this.tableData = data.list |
|||
? data.list.map((item) => { |
|||
return item; |
|||
}) |
|||
: []; |
|||
} else { |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/buttonstyle.scss"; |
|||
|
|||
.resi-container .resi-card-table { |
|||
::v-deep .el-table th { |
|||
color: #fff; |
|||
background-color: rgba(33, 149, 254, 1); |
|||
// border-right: 1px solid rgba(33, 149, 254, 1); |
|||
} |
|||
} |
|||
.resi-table { |
|||
::v-deep .el-button--text { |
|||
text-decoration: underline; |
|||
} |
|||
} |
|||
.resi-card-table { |
|||
margin-top: 20px; |
|||
} |
|||
.resi-row-btn { |
|||
margin-bottom: 13px; |
|||
.upload-btn { |
|||
display: inline-block; |
|||
margin: 0 10px; |
|||
} |
|||
} |
|||
|
|||
.resi-btns { |
|||
margin-top: 20px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.resi-container .resi-card { |
|||
position: relative; |
|||
overflow: visible; |
|||
} |
|||
|
|||
.demo-form-inline { |
|||
// display: flex; |
|||
// align-items: center; |
|||
// margin-bottom: 20px; |
|||
|
|||
.resi-cell-label { |
|||
flex-shrink: 0; |
|||
min-width: 0; |
|||
box-sizing: border-box; |
|||
margin-right: 15px; |
|||
// text-align: right; |
|||
// line-height: 32; |
|||
} |
|||
.resi-cell-label1 { |
|||
width: max-content; |
|||
} |
|||
.resi-cell-value-radio { |
|||
display: flex; |
|||
align-items: center; |
|||
min-height: 32px; |
|||
} |
|||
.resi-cell-input { |
|||
width: 200px; |
|||
} |
|||
.resi-cell--daterange { |
|||
max-width: 260px; |
|||
} |
|||
.resi-cell-select { |
|||
width: 200px; |
|||
box-sizing: border-box; |
|||
margin-right: 10px; |
|||
&-middle { |
|||
width: 120px; |
|||
} |
|||
&-small { |
|||
width: 88px; |
|||
} |
|||
} |
|||
.resi-cell-select:last-child { |
|||
margin-right: 0; |
|||
} |
|||
} |
|||
|
|||
.mt10 { |
|||
margin-top: 10px; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<div> |
|||
<base-page :elseParams="elseParams"></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/shequzhili/tuceng/zhonghe/base"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
elseParams: [ |
|||
{ |
|||
queryType: "list_equal", |
|||
tableName: "ic_special", |
|||
columnName: "SPECIAL_RQLB", |
|||
columnValue: ["buliangqingshaonian"], |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<div> |
|||
<base-page :elseParams="elseParams"></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/shequzhili/tuceng/zhonghe/base"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
elseParams: [ |
|||
{ |
|||
queryType: "list_equal", |
|||
tableName: "ic_special", |
|||
columnName: "SPECIAL_RQLB", |
|||
columnValue: ["shequjiaozheng"], |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<div> |
|||
<base-page :elseParams="elseParams"></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/shequzhili/tuceng/zhonghe/base"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
elseParams: [ |
|||
{ |
|||
queryType: "list_equal", |
|||
tableName: "ic_special", |
|||
columnName: "SPECIAL_RQLB", |
|||
columnValue: ["xidurenyuan"], |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<div> |
|||
<base-page :elseParams="elseParams"></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/shequzhili/tuceng/zhonghe/base"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
elseParams: [ |
|||
{ |
|||
queryType: "list_equal", |
|||
tableName: "ic_special", |
|||
columnName: "SPECIAL_RQLB", |
|||
columnValue: ["xiejiaorenyuan"], |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<div> |
|||
<base-page :elseParams="elseParams"></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/shequzhili/tuceng/zhonghe/base"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
elseParams: [ |
|||
{ |
|||
queryType: "equal", |
|||
tableName: "ic_resi_user", |
|||
columnName: "IS_XFRY", |
|||
columnValue: ["1"], |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<div> |
|||
<base-page :elseParams="elseParams"></base-page> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import basePage from "@/views/modules/shequzhili/tuceng/zhonghe/base"; |
|||
|
|||
export default { |
|||
props: {}, |
|||
|
|||
data() { |
|||
return { |
|||
elseParams: [ |
|||
{ |
|||
queryType: "list_equal", |
|||
tableName: "ic_special", |
|||
columnName: "SPECIAL_RQLB", |
|||
columnValue: ["zhaoshizhaohuojingshenbing"], |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
components: { basePage }, |
|||
computed: {}, |
|||
watch: {}, |
|||
|
|||
async mounted() {}, |
|||
|
|||
methods: {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||