|
|
@ -1,243 +1,185 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div class="dialog-h-content scroll-h"> |
|
|
|
<el-form |
|
|
|
ref="ref_form" |
|
|
|
:inline="true" |
|
|
|
:model="dataForm" |
|
|
|
:rules="dataRule" |
|
|
|
:disabled="formType === 'detail'" |
|
|
|
class="form" |
|
|
|
> |
|
|
|
<el-form-item |
|
|
|
label="组织名称 " |
|
|
|
prop="organizationName" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入组织名称 " |
|
|
|
v-model="dataForm.organizationName" |
|
|
|
> |
|
|
|
<el-form ref="ref_form" |
|
|
|
:inline="true" |
|
|
|
:model="dataForm" |
|
|
|
:rules="dataRule" |
|
|
|
:disabled="formType === 'detail'" |
|
|
|
class="form"> |
|
|
|
<el-form-item label="组织名称 " |
|
|
|
prop="organizationName" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入组织名称 " |
|
|
|
v-model="dataForm.organizationName"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label="分类名称 " |
|
|
|
prop="categoryCode" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
v-model="dataForm.categoryCode" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in categoryList" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
> |
|
|
|
<el-form-item label="分类名称 " |
|
|
|
prop="categoryCode" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-select v-model="dataForm.categoryCode" |
|
|
|
placeholder="请选择" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in categoryList" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label="组织人数 " |
|
|
|
prop="organizationPersonCount" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
type="number" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入组织人数 " |
|
|
|
v-model="dataForm.organizationPersonCount" |
|
|
|
> |
|
|
|
<el-form-item label="组织人数 " |
|
|
|
prop="organizationPersonCount" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
type="number" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入组织人数 " |
|
|
|
v-model="dataForm.organizationPersonCount"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="组织成员 " |
|
|
|
prop="organizationPersonnel" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-form-item label="组织成员 " |
|
|
|
prop="organizationPersonnel" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<div class="m-staffs"> |
|
|
|
<div |
|
|
|
class="item" |
|
|
|
:key="'staff' + index" |
|
|
|
v-for="(item, index) in dataForm.organizationPersonnel" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="成员姓名" |
|
|
|
v-model="item.personName" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-input |
|
|
|
style="margin-left: 10px" |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="联系电话" |
|
|
|
v-model="item.personPhone" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-button |
|
|
|
style="margin-left: 10px" |
|
|
|
size="small" |
|
|
|
@click="handleDelStaff(index)" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
<div class="item" |
|
|
|
:key="'staff' + index" |
|
|
|
v-for="(item, index) in dataForm.organizationPersonnel"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="成员姓名" |
|
|
|
v-model="item.personName" /> |
|
|
|
|
|
|
|
<el-input style="margin-left: 10px" |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="联系电话" |
|
|
|
v-model="item.personPhone" /> |
|
|
|
|
|
|
|
<el-button style="margin-left: 10px" |
|
|
|
size="small" |
|
|
|
@click="handleDelStaff(index)">删除</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="item-add"> |
|
|
|
<el-button size="small" @click="handleAddStaff">添加</el-button> |
|
|
|
<el-button size="small" |
|
|
|
@click="handleAddStaff">添加</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="服务事项" |
|
|
|
prop="serviceItem" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
type="textarea" |
|
|
|
maxlength="1000" |
|
|
|
show-word-limit |
|
|
|
:rows="3" |
|
|
|
placeholder="请输入服务事项,不超过1000字" |
|
|
|
v-model="dataForm.serviceItem" |
|
|
|
></el-input> |
|
|
|
<el-form-item label="服务事项" |
|
|
|
prop="serviceItem" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
type="textarea" |
|
|
|
maxlength="1000" |
|
|
|
show-word-limit |
|
|
|
:rows="3" |
|
|
|
placeholder="请输入服务事项,不超过1000字" |
|
|
|
v-model="dataForm.serviceItem"></el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="负责人 " |
|
|
|
prop="principalName" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入负责人 " |
|
|
|
v-model="dataForm.principalName" |
|
|
|
> |
|
|
|
<el-form-item label="负责人 " |
|
|
|
prop="principalName" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入负责人 " |
|
|
|
v-model="dataForm.principalName"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="联系电话 " |
|
|
|
prop="principalPhone" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入联系电话 " |
|
|
|
v-model="dataForm.principalPhone" |
|
|
|
> |
|
|
|
<el-form-item label="联系电话 " |
|
|
|
prop="principalPhone" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入联系电话 " |
|
|
|
v-model="dataForm.principalPhone"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="创建时间" |
|
|
|
prop="organizationCreatedTime" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-date-picker |
|
|
|
v-model="dataForm.organizationCreatedTime" |
|
|
|
placeholder="创建时间" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
> |
|
|
|
<el-form-item label="创建时间" |
|
|
|
prop="organizationCreatedTime" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-date-picker v-model="dataForm.organizationCreatedTime" |
|
|
|
placeholder="创建时间" |
|
|
|
value-format="yyyy-MM-dd"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="位置坐标" |
|
|
|
prop="longitude" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-form-item label="位置坐标" |
|
|
|
prop="longitude" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<div style="width: 500px"> |
|
|
|
<el-input |
|
|
|
class="item_width_4" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入关键字" |
|
|
|
v-model="dataForm.address" |
|
|
|
> |
|
|
|
<el-input class="item_width_4" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入关键字" |
|
|
|
v-model="dataForm.address"> |
|
|
|
</el-input> |
|
|
|
<el-button |
|
|
|
style="margin-left: 10px" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
@click="handleSearchMap" |
|
|
|
>查询</el-button |
|
|
|
> |
|
|
|
<div id="app" class="div_map"></div> |
|
|
|
<el-button style="margin-left: 10px" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
@click="handleSearchMap">查询</el-button> |
|
|
|
<div id="app" |
|
|
|
class="div_map"></div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<span>经度</span> |
|
|
|
<el-input |
|
|
|
class="item_width_3" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入经度" |
|
|
|
v-model="dataForm.longitude" |
|
|
|
> |
|
|
|
<el-input class="item_width_3" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入经度" |
|
|
|
v-model="dataForm.longitude"> |
|
|
|
</el-input> |
|
|
|
<span style="margin-left: 20px">纬度</span> |
|
|
|
<el-input |
|
|
|
class="item_width_3" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入纬度" |
|
|
|
v-model="dataForm.latitude" |
|
|
|
> |
|
|
|
<el-input class="item_width_3" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入纬度" |
|
|
|
v-model="dataForm.latitude"> |
|
|
|
</el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="备注" |
|
|
|
prop="remark" |
|
|
|
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 label="备注" |
|
|
|
prop="remark" |
|
|
|
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> |
|
|
|
</div> |
|
|
|
<div class="div_btn resi-btns"> |
|
|
|
<el-button size="small" @click="handleCancle">取 消</el-button> |
|
|
|
<el-button |
|
|
|
v-if="formType != 'detail'" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
:disabled="btnDisable" |
|
|
|
@click="handleComfirm" |
|
|
|
>确 定</el-button |
|
|
|
> |
|
|
|
<el-button size="small" |
|
|
|
@click="handleCancle">取 消</el-button> |
|
|
|
<el-button v-if="formType != 'detail'" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
:disabled="btnDisable" |
|
|
|
@click="handleComfirm">确 定</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -255,7 +197,7 @@ var infoWindowList; |
|
|
|
let loading; // 加载动画 |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
formType: "add", //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
|
|
|
@ -281,7 +223,7 @@ export default { |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
computed: { |
|
|
|
dataRule() { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
organizationName: [ |
|
|
|
{ required: true, message: "组织名称 不能为空", trigger: "blur" }, |
|
|
@ -316,15 +258,15 @@ export default { |
|
|
|
props: {}, |
|
|
|
watch: {}, |
|
|
|
|
|
|
|
async created() { |
|
|
|
async created () { |
|
|
|
this.getCategoryList(); |
|
|
|
}, |
|
|
|
async mounted() { |
|
|
|
async mounted () { |
|
|
|
this.initMap(); |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
async getCategoryList() { |
|
|
|
async getCategoryList () { |
|
|
|
const url = "/sys/dict/data/dictlist"; |
|
|
|
const params = { |
|
|
|
dictType: "self_org_category", |
|
|
@ -336,19 +278,19 @@ export default { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
handleAddStaff() { |
|
|
|
handleAddStaff () { |
|
|
|
this.dataForm.organizationPersonnel = [ |
|
|
|
...this.dataForm.organizationPersonnel, |
|
|
|
{ personName: "", personPhone: "" }, |
|
|
|
]; |
|
|
|
}, |
|
|
|
handleDelStaff(index) { |
|
|
|
handleDelStaff (index) { |
|
|
|
const { organizationPersonnel } = this.dataForm; |
|
|
|
organizationPersonnel.splice(index, 1); |
|
|
|
this.dataForm.organizationPersonnel = organizationPersonnel; |
|
|
|
}, |
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
|
initMap() { |
|
|
|
initMap () { |
|
|
|
// 定义地图中心点坐标 |
|
|
|
var center = new window.TMap.LatLng(36.0722275, 120.38945519); |
|
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
@ -374,7 +316,7 @@ export default { |
|
|
|
this.handleMoveCenter(); |
|
|
|
}, |
|
|
|
|
|
|
|
setMarker(lat, lng) { |
|
|
|
setMarker (lat, lng) { |
|
|
|
markers.setGeometries([]); |
|
|
|
markers.add([ |
|
|
|
{ |
|
|
@ -388,7 +330,7 @@ export default { |
|
|
|
]); |
|
|
|
}, |
|
|
|
|
|
|
|
handleSearchMap() { |
|
|
|
handleSearchMap () { |
|
|
|
infoWindowList.forEach((infoWindow) => { |
|
|
|
infoWindow.close(); |
|
|
|
}); |
|
|
@ -416,7 +358,7 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
handleMoveCenter() { |
|
|
|
handleMoveCenter () { |
|
|
|
//修改地图中心点 |
|
|
|
const center = map.getCenter(); |
|
|
|
const lat = center.getLat(); |
|
|
@ -426,7 +368,7 @@ export default { |
|
|
|
this.setMarker(lat, lng); |
|
|
|
}, |
|
|
|
|
|
|
|
async initForm(type, row) { |
|
|
|
async initForm (type, row) { |
|
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
|
|
|
|
this.formType = type; |
|
|
@ -438,7 +380,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async handleComfirm() { |
|
|
|
async handleComfirm () { |
|
|
|
this.btnDisable = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.btnDisable = false; |
|
|
@ -448,26 +390,25 @@ export default { |
|
|
|
app.util.validateRule(messageObj); |
|
|
|
this.btnDisable = false; |
|
|
|
} else { |
|
|
|
if (!formVltHelper.userOrMobile(this.dataForm.principalPhone)) { |
|
|
|
return this.$message({ |
|
|
|
type: "error", |
|
|
|
message: "手机号格式有误", |
|
|
|
}); |
|
|
|
} |
|
|
|
// if (!formVltHelper.userOrMobile(this.dataForm.principalPhone)) { |
|
|
|
// return this.$message({ |
|
|
|
// type: "error", |
|
|
|
// message: "手机号格式有误", |
|
|
|
// }); |
|
|
|
// } |
|
|
|
const { |
|
|
|
dataForm: { organizationPersonnel }, |
|
|
|
} = this; |
|
|
|
let vlt = organizationPersonnel.every((item) => { |
|
|
|
return ( |
|
|
|
item.personName && |
|
|
|
item.personPhone && |
|
|
|
formVltHelper.userOrMobile(item.personPhone) |
|
|
|
item.personPhone |
|
|
|
); |
|
|
|
}); |
|
|
|
if (!vlt) { |
|
|
|
return this.$message({ |
|
|
|
type: "error", |
|
|
|
message: "成员姓名/手机号为空或格式有误", |
|
|
|
message: "成员姓名/手机号为空", |
|
|
|
}); |
|
|
|
} |
|
|
|
this.submit(); |
|
|
@ -475,7 +416,7 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async submit() { |
|
|
|
async submit () { |
|
|
|
let url = ""; |
|
|
|
if (this.formType === "add") { |
|
|
|
url = "/heart/iccommunityselforganization/addcommunityselforganization"; |
|
|
@ -503,11 +444,11 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleCancle() { |
|
|
|
handleCancle () { |
|
|
|
this.resetData(); |
|
|
|
this.$emit("dialogCancle"); |
|
|
|
}, |
|
|
|
resetData() { |
|
|
|
resetData () { |
|
|
|
this.orgId = ""; |
|
|
|
this.dataForm = { |
|
|
|
organizationName: "", |
|
|
@ -525,7 +466,7 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading() { |
|
|
|
startLoading () { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: "正在加载……", // 加载中需要显示的文字 |
|
|
@ -533,7 +474,7 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading() { |
|
|
|
endLoading () { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close(); |
|
|
|