|
@ -1,246 +1,217 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<div class="dialog-h-content scroll-h"> |
|
|
<div class="dialog-h-content scroll-h"> |
|
|
<el-form |
|
|
<el-form ref="ref_form" |
|
|
ref="ref_form" |
|
|
:inline="true" |
|
|
:inline="true" |
|
|
:model="dataForm" |
|
|
:model="dataForm" |
|
|
:rules="dataRule" |
|
|
:rules="dataRule" |
|
|
:disabled="formType === 'detail'" |
|
|
:disabled="formType === 'detail'" |
|
|
class="form"> |
|
|
class="form" |
|
|
<el-form-item label="组织名称 " |
|
|
> |
|
|
prop="organizationName" |
|
|
<el-form-item |
|
|
label-width="150px" |
|
|
label="组织名称 " |
|
|
style="display: block"> |
|
|
prop="organizationName" |
|
|
<el-input class="item_width_1" |
|
|
label-width="150px" |
|
|
maxlength="50" |
|
|
style="display: block" |
|
|
show-word-limit |
|
|
> |
|
|
placeholder="请输入组织名称 " |
|
|
<el-input |
|
|
v-model="dataForm.organizationName"> |
|
|
class="item_width_1" |
|
|
|
|
|
maxlength="50" |
|
|
|
|
|
show-word-limit |
|
|
|
|
|
placeholder="请输入组织名称 " |
|
|
|
|
|
v-model="dataForm.organizationName" |
|
|
|
|
|
> |
|
|
|
|
|
</el-input> |
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
<el-form-item label="分类名称 " |
|
|
label="分类名称 " |
|
|
prop="categoryCode" |
|
|
prop="categoryCode" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
<el-select v-model="dataForm.categoryCode" |
|
|
> |
|
|
placeholder="请选择" |
|
|
<el-select |
|
|
clearable> |
|
|
v-model="dataForm.categoryCode" |
|
|
<el-option v-for="item in categoryList" |
|
|
placeholder="请选择" |
|
|
:key="item.value" |
|
|
clearable |
|
|
:label="item.label" |
|
|
> |
|
|
:value="item.value"> |
|
|
<el-option |
|
|
|
|
|
v-for="item in categoryList" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value" |
|
|
|
|
|
> |
|
|
|
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
<el-form-item label="组织人数 " |
|
|
label="组织人数 " |
|
|
prop="organizationPersonCount" |
|
|
prop="organizationPersonCount" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
<el-input class="item_width_1" |
|
|
> |
|
|
type="number" |
|
|
<el-input |
|
|
maxlength="50" |
|
|
class="item_width_1" |
|
|
show-word-limit |
|
|
type="number" |
|
|
placeholder="请输入组织人数 " |
|
|
maxlength="50" |
|
|
v-model="dataForm.organizationPersonCount"> |
|
|
show-word-limit |
|
|
|
|
|
placeholder="请输入组织人数 " |
|
|
|
|
|
v-model="dataForm.organizationPersonCount" |
|
|
|
|
|
> |
|
|
|
|
|
</el-input> |
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item |
|
|
<el-form-item label="组织成员 " |
|
|
label="组织成员 " |
|
|
prop="organizationPersonnel" |
|
|
prop="organizationPersonnel" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
|
|
|
> |
|
|
|
|
|
<div class="m-staffs"> |
|
|
<div class="m-staffs"> |
|
|
<div |
|
|
<div class="item" |
|
|
class="item" |
|
|
:key="'staff' + index" |
|
|
:key="'staff' + index" |
|
|
v-for="(item, index) in dataForm.organizationPersonnel"> |
|
|
v-for="(item, index) in dataForm.organizationPersonnel" |
|
|
<el-autocomplete class="item_width_1" |
|
|
> |
|
|
v-model="item.personName" |
|
|
<el-autocomplete |
|
|
:fetch-suggestions="querySearchVolunteer" |
|
|
class="item_width_1" |
|
|
placeholder="成员姓名" |
|
|
v-model="item.personName" |
|
|
:maxlength="50" |
|
|
:fetch-suggestions="querySearchVolunteer" |
|
|
show-word-limit |
|
|
placeholder="成员姓名" |
|
|
@select="(vItem) => handleSelectVolunteer(index, vItem)" |
|
|
:maxlength="50" |
|
|
:disabled="item.icResiUserId != ''"></el-autocomplete> |
|
|
show-word-limit |
|
|
|
|
|
@select="(vItem) => handleSelectVolunteer(index, vItem)" |
|
|
<el-input style="margin-left: 10px" |
|
|
:disabled="item.icResiUserId != ''" |
|
|
class="item_width_1" |
|
|
></el-autocomplete> |
|
|
show-word-limit |
|
|
|
|
|
placeholder="联系电话" |
|
|
<el-input |
|
|
:disabled="item.icResiUserId != ''" |
|
|
style="margin-left: 10px" |
|
|
v-model="item.personPhone" /> |
|
|
class="item_width_1" |
|
|
|
|
|
show-word-limit |
|
|
<el-button style="margin-left: 10px" |
|
|
placeholder="联系电话" |
|
|
size="small" |
|
|
:disabled="item.icResiUserId != ''" |
|
|
@click="handleDelStaff(index)">删除</el-button> |
|
|
v-model="item.personPhone" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
style="margin-left: 10px" |
|
|
|
|
|
size="small" |
|
|
|
|
|
@click="handleDelStaff(index)" |
|
|
|
|
|
>删除</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="item-add"> |
|
|
<div class="item-add"> |
|
|
<el-button size="small" @click="handleAddStaff">添加</el-button> |
|
|
<el-button size="small" |
|
|
|
|
|
@click="handleAddStaff">添加</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item |
|
|
<el-form-item label="服务事项" |
|
|
label="服务事项" |
|
|
prop="serviceItem" |
|
|
prop="serviceItem" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
<el-input class="item_width_1" |
|
|
> |
|
|
type="textarea" |
|
|
<el-input |
|
|
maxlength="1000" |
|
|
class="item_width_1" |
|
|
show-word-limit |
|
|
type="textarea" |
|
|
:rows="3" |
|
|
maxlength="1000" |
|
|
placeholder="请输入服务事项,不超过1000字" |
|
|
show-word-limit |
|
|
v-model="dataForm.serviceItem"></el-input> |
|
|
:rows="3" |
|
|
|
|
|
placeholder="请输入服务事项,不超过1000字" |
|
|
|
|
|
v-model="dataForm.serviceItem" |
|
|
|
|
|
></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item |
|
|
<el-form-item label="负责人 " |
|
|
label="负责人 " |
|
|
prop="principalName" |
|
|
prop="principalName" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
<el-input class="item_width_1" |
|
|
> |
|
|
maxlength="50" |
|
|
<el-input |
|
|
show-word-limit |
|
|
class="item_width_1" |
|
|
placeholder="请输入负责人 " |
|
|
maxlength="50" |
|
|
v-model="dataForm.principalName"> |
|
|
show-word-limit |
|
|
|
|
|
placeholder="请输入负责人 " |
|
|
|
|
|
v-model="dataForm.principalName" |
|
|
|
|
|
> |
|
|
|
|
|
</el-input> |
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item |
|
|
<el-form-item label="联系电话 " |
|
|
label="联系电话 " |
|
|
prop="principalPhone" |
|
|
prop="principalPhone" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
<el-input class="item_width_1" |
|
|
> |
|
|
maxlength="50" |
|
|
<el-input |
|
|
show-word-limit |
|
|
class="item_width_1" |
|
|
placeholder="请输入联系电话 " |
|
|
maxlength="50" |
|
|
v-model="dataForm.principalPhone"> |
|
|
show-word-limit |
|
|
|
|
|
placeholder="请输入联系电话 " |
|
|
|
|
|
v-model="dataForm.principalPhone" |
|
|
|
|
|
> |
|
|
|
|
|
</el-input> |
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item |
|
|
<el-form-item label="创建时间" |
|
|
label="创建时间" |
|
|
prop="organizationCreatedTime" |
|
|
prop="organizationCreatedTime" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
<el-date-picker v-model="dataForm.organizationCreatedTime" |
|
|
> |
|
|
placeholder="创建时间" |
|
|
<el-date-picker |
|
|
value-format="yyyy-MM-dd"> |
|
|
v-model="dataForm.organizationCreatedTime" |
|
|
|
|
|
placeholder="创建时间" |
|
|
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
|
|
> |
|
|
|
|
|
</el-date-picker> |
|
|
</el-date-picker> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item |
|
|
<el-form-item label="地图位置" |
|
|
label="位置坐标" |
|
|
prop="longitude" |
|
|
prop="longitude" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
|
|
|
> |
|
|
|
|
|
<div style="width: 500px"> |
|
|
<div style="width: 500px"> |
|
|
<el-input |
|
|
<!-- <el-input class="item_width_4" |
|
|
class="item_width_4" |
|
|
maxlength="50" |
|
|
maxlength="50" |
|
|
placeholder="请输入关键字" |
|
|
placeholder="请输入关键字" |
|
|
v-model="keyWords"> |
|
|
v-model="dataForm.address" |
|
|
|
|
|
> |
|
|
|
|
|
</el-input> |
|
|
</el-input> |
|
|
<el-button |
|
|
<el-button style="margin-left: 10px" |
|
|
style="margin-left: 10px" |
|
|
type="default" |
|
|
type="default" |
|
|
size="small" |
|
|
size="small" |
|
|
@click="handleSearchMap">查询</el-button> --> |
|
|
@click="handleSearchMap" |
|
|
|
|
|
>查询</el-button |
|
|
<el-select v-model="searchValue" |
|
|
> |
|
|
filterable |
|
|
<div id="app" class="div_map"></div> |
|
|
style="width: 500px" |
|
|
<div style="margin-top: 10px" v-show="false"> |
|
|
remote |
|
|
|
|
|
:reserve-keyword="true" |
|
|
|
|
|
placeholder="请输入关键词" |
|
|
|
|
|
:remote-method="remoteMethod" |
|
|
|
|
|
:loading="loading"> |
|
|
|
|
|
<el-option v-for="(item,index) in searchOptions" |
|
|
|
|
|
@click.native="handleClickKey(index)" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
<div id="app" |
|
|
|
|
|
class="div_map"></div> |
|
|
|
|
|
<!-- <div style="margin-top: 10px" |
|
|
|
|
|
v-show="false"> |
|
|
<span>经度</span> |
|
|
<span>经度</span> |
|
|
<el-input |
|
|
<el-input class="item_width_3" |
|
|
class="item_width_3" |
|
|
maxlength="50" |
|
|
maxlength="50" |
|
|
placeholder="请输入经度" |
|
|
placeholder="请输入经度" |
|
|
v-model="dataForm.longitude"> |
|
|
v-model="dataForm.longitude" |
|
|
|
|
|
> |
|
|
|
|
|
</el-input> |
|
|
</el-input> |
|
|
<span style="margin-left: 20px">纬度</span> |
|
|
<span style="margin-left: 20px">纬度</span> |
|
|
<el-input |
|
|
<el-input class="item_width_3" |
|
|
class="item_width_3" |
|
|
maxlength="50" |
|
|
maxlength="50" |
|
|
placeholder="请输入纬度" |
|
|
placeholder="请输入纬度" |
|
|
v-model="dataForm.latitude"> |
|
|
v-model="dataForm.latitude" |
|
|
|
|
|
> |
|
|
|
|
|
</el-input> |
|
|
</el-input> |
|
|
</div> |
|
|
</div> --> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item |
|
|
<el-form-item label="所在位置 " |
|
|
label="备注" |
|
|
prop="address" |
|
|
prop="remark" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
<el-input class="item_width_1" |
|
|
> |
|
|
maxlength="50" |
|
|
<el-input |
|
|
show-word-limit |
|
|
class="item_width_1" |
|
|
placeholder="请输入位置 " |
|
|
type="textarea" |
|
|
v-model="dataForm.address"> |
|
|
maxlength="500" |
|
|
</el-input> |
|
|
show-word-limit |
|
|
</el-form-item> |
|
|
:rows="3" |
|
|
|
|
|
placeholder="请输入备注,不超过500字" |
|
|
<el-form-item label="备注" |
|
|
v-model="dataForm.remark" |
|
|
prop="remark" |
|
|
></el-input> |
|
|
label-width="150px" |
|
|
|
|
|
style="display: block"> |
|
|
|
|
|
<el-input class="item_width_1" |
|
|
|
|
|
type="textarea" |
|
|
|
|
|
maxlength="500" |
|
|
|
|
|
show-word-limit |
|
|
|
|
|
:rows="3" |
|
|
|
|
|
placeholder="请输入备注,不超过500字" |
|
|
|
|
|
v-model="dataForm.remark"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</div> |
|
|
</div> |
|
|
<div class="div_btn resi-btns"> |
|
|
<div class="div_btn resi-btns"> |
|
|
<el-button size="small" @click="handleCancle">取 消</el-button> |
|
|
<el-button size="small" |
|
|
<el-button |
|
|
@click="handleCancle">取 消</el-button> |
|
|
v-if="formType != 'detail'" |
|
|
<el-button v-if="formType != 'detail'" |
|
|
type="primary" |
|
|
type="primary" |
|
|
size="small" |
|
|
size="small" |
|
|
:disabled="btnDisable" |
|
|
:disabled="btnDisable" |
|
|
@click="handleComfirm" |
|
|
@click="handleComfirm">确 定</el-button> |
|
|
>确 定</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
@ -263,10 +234,15 @@ var geocoder; // 新建一个正逆地址解析类 |
|
|
export default { |
|
|
export default { |
|
|
components: {}, |
|
|
components: {}, |
|
|
props: {}, |
|
|
props: {}, |
|
|
data() { |
|
|
data () { |
|
|
return { |
|
|
return { |
|
|
formType: "add", //表单操作类型 add新增,edit编辑,detail详情 |
|
|
formType: "add", //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
|
|
|
|
|
|
|
|
searchOptions: [], |
|
|
|
|
|
searchValue: '', |
|
|
|
|
|
resultList: [], |
|
|
|
|
|
loading: false, |
|
|
|
|
|
|
|
|
btnDisable: false, |
|
|
btnDisable: false, |
|
|
|
|
|
|
|
|
orgId: "", |
|
|
orgId: "", |
|
@ -289,7 +265,7 @@ export default { |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
dataRule() { |
|
|
dataRule () { |
|
|
return { |
|
|
return { |
|
|
organizationName: [ |
|
|
organizationName: [ |
|
|
{ required: true, message: "组织名称 不能为空", trigger: "blur" }, |
|
|
{ required: true, message: "组织名称 不能为空", trigger: "blur" }, |
|
@ -324,25 +300,67 @@ export default { |
|
|
}, |
|
|
}, |
|
|
watch: {}, |
|
|
watch: {}, |
|
|
|
|
|
|
|
|
async mounted() { |
|
|
async mounted () { |
|
|
this.getCategoryList(); |
|
|
this.getCategoryList(); |
|
|
this.getVolunteerList(); |
|
|
this.getVolunteerList(); |
|
|
this.initMap(); |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
querySearchVolunteer(queryString, cb) { |
|
|
|
|
|
|
|
|
async remoteMethod (query) { |
|
|
|
|
|
|
|
|
|
|
|
if (query !== '') { |
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
|
|
|
|
const { msg, data } = await map.searchNearby(query); |
|
|
|
|
|
this.loading = false; |
|
|
|
|
|
this.resultList = [] |
|
|
|
|
|
|
|
|
|
|
|
if (msg == "success" && data.resultList && data.resultList.length > 0) { |
|
|
|
|
|
|
|
|
|
|
|
if (data.resultList && data.resultList.length > 0) { |
|
|
|
|
|
this.resultList = data.resultList |
|
|
|
|
|
this.searchOptions = this.resultList.map(item => { |
|
|
|
|
|
return { value: `${item.hotPointID}`, label: `${item.address + item.name}` }; |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.searchOptions = [ |
|
|
|
|
|
{ |
|
|
|
|
|
value: '0', |
|
|
|
|
|
label: '未检索到结果' |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.searchOptions = []; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleClickKey (index) { |
|
|
|
|
|
let selPosition = this.resultList[index] |
|
|
|
|
|
let lonlat = selPosition.lonlat.split(" ") |
|
|
|
|
|
map.setCenter(lonlat[1], lonlat[0]); |
|
|
|
|
|
map.setMarker(lonlat[1], lonlat[0]); |
|
|
|
|
|
this.dataForm.latitude = lonlat[0]; |
|
|
|
|
|
this.dataForm.longitude = lonlat[1]; |
|
|
|
|
|
this.dataForm.address = selPosition.address + selPosition.name |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
querySearchVolunteer (queryString, cb) { |
|
|
const { volunteerList } = this; |
|
|
const { volunteerList } = this; |
|
|
var results = queryString |
|
|
var results = queryString |
|
|
? volunteerList.filter((item) => { |
|
|
? volunteerList.filter((item) => { |
|
|
return item.value.indexOf(queryString) !== -1; |
|
|
return item.value.indexOf(queryString) !== -1; |
|
|
}) |
|
|
}) |
|
|
: volunteerList; |
|
|
: volunteerList; |
|
|
// 调用 callback 返回建议列表的数据 |
|
|
// 调用 callback 返回建议列表的数据 |
|
|
cb(results); |
|
|
cb(results); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleSelectVolunteer(index, vItem) { |
|
|
handleSelectVolunteer (index, vItem) { |
|
|
this.dataForm.organizationPersonnel[index] = { |
|
|
this.dataForm.organizationPersonnel[index] = { |
|
|
personName: vItem.name, |
|
|
personName: vItem.name, |
|
|
personPhone: vItem.mobile, |
|
|
personPhone: vItem.mobile, |
|
@ -350,7 +368,7 @@ export default { |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getVolunteerList() { |
|
|
async getVolunteerList () { |
|
|
const url = "/epmetuser/icresiuser/volunteer-list"; |
|
|
const url = "/epmetuser/icresiuser/volunteer-list"; |
|
|
const params = {}; |
|
|
const params = {}; |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
@ -368,7 +386,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getCategoryList() { |
|
|
async getCategoryList () { |
|
|
const url = "/sys/dict/data/dictlist"; |
|
|
const url = "/sys/dict/data/dictlist"; |
|
|
const params = { |
|
|
const params = { |
|
|
dictType: "self_org_category", |
|
|
dictType: "self_org_category", |
|
@ -380,21 +398,42 @@ export default { |
|
|
this.$message.error(msg); |
|
|
this.$message.error(msg); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
handleAddStaff() { |
|
|
handleAddStaff () { |
|
|
this.dataForm.organizationPersonnel = [ |
|
|
this.dataForm.organizationPersonnel = [ |
|
|
...this.dataForm.organizationPersonnel, |
|
|
...this.dataForm.organizationPersonnel, |
|
|
{ personName: "", personPhone: "", icResiUserId: "" }, |
|
|
{ personName: "", personPhone: "", icResiUserId: "" }, |
|
|
]; |
|
|
]; |
|
|
}, |
|
|
}, |
|
|
handleDelStaff(index) { |
|
|
handleDelStaff (index) { |
|
|
const { organizationPersonnel } = this.dataForm; |
|
|
const { organizationPersonnel } = this.dataForm; |
|
|
organizationPersonnel.splice(index, 1); |
|
|
organizationPersonnel.splice(index, 1); |
|
|
this.dataForm.organizationPersonnel = organizationPersonnel; |
|
|
this.dataForm.organizationPersonnel = organizationPersonnel; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
async initForm (type, row) { |
|
|
initMap() { |
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
|
|
|
|
|
|
|
|
this.formType = type; |
|
|
|
|
|
console.log(row); |
|
|
|
|
|
|
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
|
|
|
if (row) { |
|
|
|
|
|
this.dataForm = { ...this.dataForm, ...row }; |
|
|
|
|
|
this.orgId = this.dataForm.orgId; |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.dataForm.latitude = latitude |
|
|
|
|
|
this.dataForm.longitude = longitude |
|
|
|
|
|
} |
|
|
|
|
|
if (!map) { |
|
|
|
|
|
this.initMap(this.dataForm.latitude, this.dataForm.longitude); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
|
|
|
initMap (latitude, longitude) { |
|
|
|
|
|
|
|
|
map = new daiMap( |
|
|
map = new daiMap( |
|
|
document.getElementById("app"), |
|
|
document.getElementById("app"), |
|
@ -410,22 +449,27 @@ export default { |
|
|
map.on("dragend", (e) => { |
|
|
map.on("dragend", (e) => { |
|
|
this.handleMoveCenter(e); |
|
|
this.handleMoveCenter(e); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async handleSearchMap() { |
|
|
map.setCenter(latitude, longitude); |
|
|
const { msg, data } = await map.searchNearby(this.dataForm.address); |
|
|
map.setMarker(latitude, longitude); |
|
|
if (msg == "success") { |
|
|
|
|
|
const { lat, lng } = data; |
|
|
|
|
|
map.setCenter(lat, lng); |
|
|
|
|
|
map.setMarker(lat, lng); |
|
|
|
|
|
this.dataForm.latitude = lat; |
|
|
|
|
|
this.dataForm.longitude = lng; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error("未检索到相关位置坐标"); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleMoveCenter(e) { |
|
|
// async handleSearchMap () { |
|
|
|
|
|
// const { msg, data } = await map.searchNearby(this.keyWords); |
|
|
|
|
|
// if (msg == "success") { |
|
|
|
|
|
// const { lat, lng } = data; |
|
|
|
|
|
// map.setCenter(lat, lng); |
|
|
|
|
|
// map.setMarker(lat, lng); |
|
|
|
|
|
// this.dataForm.latitude = lat; |
|
|
|
|
|
// this.dataForm.longitude = lng; |
|
|
|
|
|
// this.handleMoveCenter() |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error("未检索到相关位置坐标"); |
|
|
|
|
|
// } |
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
async handleMoveCenter () { |
|
|
//修改地图中心点 |
|
|
//修改地图中心点 |
|
|
const { lat, lng } = map.getCenter(); |
|
|
const { lat, lng } = map.getCenter(); |
|
|
this.dataForm.latitude = lat; |
|
|
this.dataForm.latitude = lat; |
|
@ -434,28 +478,16 @@ export default { |
|
|
|
|
|
|
|
|
let { msg, data } = await map.getAddress(lat, lng); |
|
|
let { msg, data } = await map.getAddress(lat, lng); |
|
|
if (msg == "success") { |
|
|
if (msg == "success") { |
|
|
this.dataForm.address = data.address; |
|
|
this.dataForm.address = data.address |
|
|
|
|
|
this.searchValue = data.address |
|
|
|
|
|
this.searchOptions = [] |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async initForm(type, row) { |
|
|
|
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
|
|
|
|
|
|
|
|
this.formType = type; |
|
|
|
|
|
console.log(row); |
|
|
|
|
|
if (row) { |
|
|
|
|
|
this.dataForm = { ...this.dataForm, ...row }; |
|
|
|
|
|
this.orgId = this.dataForm.orgId; |
|
|
|
|
|
|
|
|
|
|
|
await nextTick(800); |
|
|
|
|
|
if (map) { |
|
|
|
|
|
map.setCenter(row.latitude, row.longitude); |
|
|
|
|
|
map.setMarker(row.latitude, row.longitude); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async handleComfirm() { |
|
|
async handleComfirm () { |
|
|
this.btnDisable = true; |
|
|
this.btnDisable = true; |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
this.btnDisable = false; |
|
|
this.btnDisable = false; |
|
@ -488,7 +520,7 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async submit() { |
|
|
async submit () { |
|
|
let url = ""; |
|
|
let url = ""; |
|
|
if (this.formType === "add") { |
|
|
if (this.formType === "add") { |
|
|
url = "/heart/iccommunityselforganization/addcommunityselforganization"; |
|
|
url = "/heart/iccommunityselforganization/addcommunityselforganization"; |
|
@ -516,11 +548,16 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleCancle() { |
|
|
handleCancle () { |
|
|
this.resetData(); |
|
|
this.resetData(); |
|
|
this.$emit("dialogCancle"); |
|
|
this.$emit("dialogCancle"); |
|
|
}, |
|
|
}, |
|
|
resetData() { |
|
|
resetData () { |
|
|
|
|
|
|
|
|
|
|
|
this.searchValue = '' |
|
|
|
|
|
this.searchOptions = [] |
|
|
|
|
|
this.resultList = [] |
|
|
|
|
|
|
|
|
this.orgId = ""; |
|
|
this.orgId = ""; |
|
|
this.dataForm = { |
|
|
this.dataForm = { |
|
|
organizationName: "", |
|
|
organizationName: "", |
|
@ -538,7 +575,7 @@ export default { |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
// 开启加载动画 |
|
|
// 开启加载动画 |
|
|
startLoading() { |
|
|
startLoading () { |
|
|
loading = Loading.service({ |
|
|
loading = Loading.service({ |
|
|
lock: true, // 是否锁定 |
|
|
lock: true, // 是否锁定 |
|
|
text: "正在加载……", // 加载中需要显示的文字 |
|
|
text: "正在加载……", // 加载中需要显示的文字 |
|
@ -546,7 +583,7 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// 结束加载动画 |
|
|
// 结束加载动画 |
|
|
endLoading() { |
|
|
endLoading () { |
|
|
// clearTimeout(timer); |
|
|
// clearTimeout(timer); |
|
|
if (loading) { |
|
|
if (loading) { |
|
|
loading.close(); |
|
|
loading.close(); |
|
|