|
@ -1,5 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div style="height:600px;overflow:auto;padding: 20px;" class="form-class"> |
|
|
<div style="height: 600px; overflow: auto; padding: 20px" class="form-class"> |
|
|
<el-form |
|
|
<el-form |
|
|
:model="dataForm" |
|
|
:model="dataForm" |
|
|
:rules="dataRule" |
|
|
:rules="dataRule" |
|
@ -8,7 +8,12 @@ |
|
|
label-width="120px" |
|
|
label-width="120px" |
|
|
> |
|
|
> |
|
|
<el-form-item label="所属组织名称" prop="orgId"> |
|
|
<el-form-item label="所属组织名称" prop="orgId"> |
|
|
<el-select v-model="dataForm.orgId" placeholder="所属组织名称" @change="orgChangeHandle" :disabled='dialogTitle == "查看"'> |
|
|
<el-select |
|
|
|
|
|
v-model="dataForm.orgId" |
|
|
|
|
|
placeholder="所属组织名称" |
|
|
|
|
|
@change="orgChangeHandle" |
|
|
|
|
|
:disabled="dialogTitle == '查看'" |
|
|
|
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
ref="org" |
|
|
ref="org" |
|
|
v-for="item in organizationList" |
|
|
v-for="item in organizationList" |
|
@ -23,7 +28,7 @@ |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="dataForm.name" |
|
|
v-model="dataForm.name" |
|
|
placeholder="核酸检测点名称" |
|
|
placeholder="核酸检测点名称" |
|
|
:disabled='dialogTitle == "查看"' |
|
|
:disabled="dialogTitle == '查看'" |
|
|
></el-input> |
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="服务时间" prop="serveTime"> |
|
|
<el-form-item label="服务时间" prop="serveTime"> |
|
@ -32,7 +37,7 @@ |
|
|
type="textarea" |
|
|
type="textarea" |
|
|
:rows="2" |
|
|
:rows="2" |
|
|
placeholder="请输入服务时间,如:每日开放 上午:8:00-11:30 ;下午:13:00-17:00" |
|
|
placeholder="请输入服务时间,如:每日开放 上午:8:00-11:30 ;下午:13:00-17:00" |
|
|
:disabled='dialogTitle == "查看"' |
|
|
:disabled="dialogTitle == '查看'" |
|
|
></el-input> |
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="咨询电话" prop="mobile"> |
|
|
<el-form-item label="咨询电话" prop="mobile"> |
|
@ -40,23 +45,29 @@ |
|
|
v-model="dataForm.mobile" |
|
|
v-model="dataForm.mobile" |
|
|
placeholder="咨询电话" |
|
|
placeholder="咨询电话" |
|
|
:change="check_num()" |
|
|
:change="check_num()" |
|
|
:disabled='dialogTitle == "查看"' |
|
|
:disabled="dialogTitle == '查看'" |
|
|
></el-input> |
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="检测点地址" prop="address"> |
|
|
<el-form-item label="检测点地址" prop="address"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="dataForm.address" |
|
|
v-model="dataForm.address" |
|
|
placeholder="例:青岛市时代国际广场" |
|
|
placeholder="例:青岛市时代国际广场" |
|
|
|
|
|
style="width:65%;" |
|
|
></el-input> |
|
|
></el-input> |
|
|
<el-button |
|
|
<el-button |
|
|
style="margin-left: 10px" |
|
|
style="margin-left: 10px" |
|
|
type="primary" |
|
|
type="primary" |
|
|
size="small" |
|
|
size="small" |
|
|
@click="handleSearchMap" |
|
|
@click="handleSearchMap" |
|
|
>查询</el-button |
|
|
>查询</el-button |
|
|
> |
|
|
> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="位置坐标" prop="longitude" style="display: block" class="position_label"> |
|
|
<el-form-item |
|
|
|
|
|
label="位置坐标" |
|
|
|
|
|
prop="longitude" |
|
|
|
|
|
style="display: block" |
|
|
|
|
|
class="position_label" |
|
|
|
|
|
> |
|
|
<div> |
|
|
<div> |
|
|
<!-- <el-input |
|
|
<!-- <el-input |
|
|
class="item_width_4" |
|
|
class="item_width_4" |
|
@ -87,7 +98,7 @@ |
|
|
placeholder="请输入经度" |
|
|
placeholder="请输入经度" |
|
|
v-model="dataForm.longitude" |
|
|
v-model="dataForm.longitude" |
|
|
disabled |
|
|
disabled |
|
|
style="width: 200px;margin-left: 20px;" |
|
|
style="width: 200px; margin-left: 20px" |
|
|
> |
|
|
> |
|
|
</el-input> |
|
|
</el-input> |
|
|
<span style="margin-left: 20px">纬度</span> |
|
|
<span style="margin-left: 20px">纬度</span> |
|
@ -97,7 +108,7 @@ |
|
|
placeholder="请输入纬度" |
|
|
placeholder="请输入纬度" |
|
|
v-model="dataForm.latitude" |
|
|
v-model="dataForm.latitude" |
|
|
disabled |
|
|
disabled |
|
|
style="width: 200px;margin-left: 20px;" |
|
|
style="width: 200px; margin-left: 20px" |
|
|
> |
|
|
> |
|
|
</el-input> |
|
|
</el-input> |
|
|
</div> |
|
|
</div> |
|
@ -106,9 +117,12 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div class="submit"> |
|
|
<div class="submit"> |
|
|
<el-button @click="closeSubmit">{{ $t("cancel") }}</el-button> |
|
|
<el-button @click="closeSubmit">{{ $t("cancel") }}</el-button> |
|
|
<el-button v-if='dialogTitle != "查看"' type="primary" @click="dataFormSubmitHandle()">{{ |
|
|
<el-button |
|
|
$t("confirm") |
|
|
v-if="dialogTitle != '查看'" |
|
|
}}</el-button> |
|
|
type="primary" |
|
|
|
|
|
@click="dataFormSubmitHandle()" |
|
|
|
|
|
>{{ $t("confirm") }}</el-button |
|
|
|
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
@ -213,29 +227,32 @@ export default { |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.getFormInfo(); |
|
|
this.getFormInfo(); |
|
|
}, |
|
|
}, |
|
|
props:{ |
|
|
props: { |
|
|
dialogTitle:{ |
|
|
dialogTitle: { |
|
|
type:String, |
|
|
type: String, |
|
|
default:'' |
|
|
default: "", |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
closeSubmit(){ |
|
|
closeSubmit() { |
|
|
this.$emit('closeDialog') |
|
|
this.$emit("closeDialog"); |
|
|
}, |
|
|
}, |
|
|
orgChangeHandle(val){ |
|
|
orgChangeHandle(val) { |
|
|
for(var i = 0 ; i < this.organizationList.length ; i++){ |
|
|
for (var i = 0; i < this.organizationList.length; i++) { |
|
|
if( this.organizationList[i].orgId === val){ |
|
|
if (this.organizationList[i].orgId === val) { |
|
|
this.dataForm.orgName=this.organizationList[i].orgName |
|
|
this.dataForm.orgName = this.organizationList[i].orgName; |
|
|
return false |
|
|
return false; |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
initMap() { |
|
|
initMap() { |
|
|
// 定义地图中心点坐标 |
|
|
// 定义地图中心点坐标 |
|
|
let _this = this |
|
|
let _this = this; |
|
|
var center = new window.TMap.LatLng(_this.dataForm.latitude, _this.dataForm.longitude); |
|
|
var center = new window.TMap.LatLng( |
|
|
|
|
|
_this.dataForm.latitude, |
|
|
|
|
|
_this.dataForm.longitude |
|
|
|
|
|
); |
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
map = new window.TMap.Map(document.getElementById("map_add"), { |
|
|
map = new window.TMap.Map(document.getElementById("map_add"), { |
|
|
center: center, // 设置地图中心点坐标 |
|
|
center: center, // 设置地图中心点坐标 |
|
@ -250,12 +267,14 @@ export default { |
|
|
geometries: [], |
|
|
geometries: [], |
|
|
}); |
|
|
}); |
|
|
infoWindowList = Array(10); |
|
|
infoWindowList = Array(10); |
|
|
|
|
|
|
|
|
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|
|
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|
|
|
|
|
|
|
|
// 监听地图平移结束 |
|
|
// 监听地图平移结束 |
|
|
map.on("panend", () => { |
|
|
map.on("panend", () => { |
|
|
this.handleMoveCenter(); |
|
|
this.handleMoveCenter(); |
|
|
}); |
|
|
}); |
|
|
this.handleMoveCenter(); |
|
|
// this.handleMoveCenter() |
|
|
this.convert(); |
|
|
this.convert(); |
|
|
}, |
|
|
}, |
|
|
handleMoveCenter() { |
|
|
handleMoveCenter() { |
|
@ -356,9 +375,9 @@ export default { |
|
|
this.$refs["dataForm"].resetFields(); |
|
|
this.$refs["dataForm"].resetFields(); |
|
|
if (this.dataForm.id) { |
|
|
if (this.dataForm.id) { |
|
|
this.getInfo(); |
|
|
this.getInfo(); |
|
|
}else{ |
|
|
} else { |
|
|
this.dataForm.longitude = "120.38945519" |
|
|
this.dataForm.longitude = "120.38945519"; |
|
|
this.dataForm.latitude = "36.0722275" |
|
|
this.dataForm.latitude = "36.0722275"; |
|
|
this.initMap(); |
|
|
this.initMap(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -377,9 +396,9 @@ export default { |
|
|
...res.data, |
|
|
...res.data, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
if(!this.dataForm.longitude && !this.dataForm.latitude){ |
|
|
if (!this.dataForm.longitude && !this.dataForm.latitude) { |
|
|
this.dataForm.longitude = "120.38945519" |
|
|
this.dataForm.longitude = "120.38945519"; |
|
|
this.dataForm.latitude = "36.0722275" |
|
|
this.dataForm.latitude = "36.0722275"; |
|
|
} |
|
|
} |
|
|
this.initMap(); |
|
|
this.initMap(); |
|
|
}) |
|
|
}) |
|
@ -406,7 +425,7 @@ export default { |
|
|
duration: 500, |
|
|
duration: 500, |
|
|
onClose: () => { |
|
|
onClose: () => { |
|
|
this.$emit("refreshDataList"); |
|
|
this.$emit("refreshDataList"); |
|
|
this.closeSubmit() |
|
|
this.closeSubmit(); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
@ -427,17 +446,17 @@ export default { |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
<style scoped> |
|
|
<style scoped> |
|
|
.position_label >>> .el-form-item__label::before{ |
|
|
.position_label >>> .el-form-item__label::before { |
|
|
color:#fff!important; |
|
|
color: #fff !important; |
|
|
} |
|
|
} |
|
|
.submit{ |
|
|
.submit { |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
margin: auto; |
|
|
margin: auto; |
|
|
} |
|
|
} |
|
|
.form-class .el-input{ |
|
|
.form-class .el-input { |
|
|
width: 75%; |
|
|
width: 75%; |
|
|
} |
|
|
} |
|
|
.form-class .el-textarea{ |
|
|
.form-class .el-textarea { |
|
|
width: 75%!important; |
|
|
width: 75% !important; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|