Browse Source

九小场所

shibei_master
jiangyy 4 years ago
parent
commit
783b6bc00b
  1. 2
      src/views/modules/base/community/buildTable.vue
  2. 2
      src/views/modules/base/community/communityTable.vue
  3. 2
      src/views/modules/base/community/roomTable.vue
  4. 10
      src/views/modules/communityParty/regionalParty/units.vue
  5. 8
      src/views/modules/communityParty/regionalParty/unitsForm.vue
  6. 330
      src/views/modules/communityService/ninePlaces/places/places.vue
  7. 394
      src/views/modules/communityService/ninePlaces/places/placesForm.vue
  8. 380
      src/views/modules/communityService/ninePlaces/team/team.vue
  9. 440
      src/views/modules/communityService/ninePlaces/team/teamForm.vue
  10. 553
      src/views/modules/communityService/ninePlaces/team/unitsForm.vue

2
src/views/modules/base/community/buildTable.vue

@ -118,7 +118,7 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[10, 20, 50]" :page-sizes="[20, 50, 100, 200]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next, total" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">

2
src/views/modules/base/community/communityTable.vue

@ -119,7 +119,7 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[10, 20, 50]" :page-sizes="[20, 50, 100, 200]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next, total" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">

2
src/views/modules/base/community/roomTable.vue

@ -129,7 +129,7 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[10, 20, 50]" :page-sizes="[20, 50, 100, 200]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next, total" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">

10
src/views/modules/communityParty/regionalParty/units.vue

@ -151,7 +151,7 @@
label="分类" label="分类"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column prop="serviceMatter" <el-table-column prop="serviceMatterShow"
header-align="center" header-align="center"
align="center" align="center"
label="服务事项" label="服务事项"
@ -404,6 +404,14 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
this.tableData = data.list this.tableData = data.list
this.tableData.forEach(item => {
item.serviceMatterShow = ''
if (item.serviceMatterList.length > 0) {
item.serviceMatterShow = item.serviceMatterList.jone('')
}
});
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }

8
src/views/modules/communityParty/regionalParty/unitsForm.vue

@ -54,12 +54,12 @@
</el-form-item> </el-form-item>
<el-form-item label="服务事项" <el-form-item label="服务事项"
prop="serviceMatter" prop="serviceMatterList"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-checkbox-group class="item_width_1" <el-checkbox-group class="item_width_1"
style="display:flex;flex-wrap:wrap" style="display:flex;flex-wrap:wrap"
v-model="formData.serviceMatter"> v-model="formData.serviceMatterList">
<el-checkbox v-for="item in serviceList" <el-checkbox v-for="item in serviceList"
:key="item.value" :key="item.value"
:label="item.value">{{item.label}}</el-checkbox> :label="item.value">{{item.label}}</el-checkbox>
@ -197,7 +197,7 @@ export default {
formData: { formData: {
gridId: '', gridId: '',
unitName: '', unitName: '',
serviceMatter: [], serviceMatterList: [],
type: '', type: '',
contact: '', contact: '',
contactMobile: '', contactMobile: '',
@ -429,7 +429,7 @@ export default {
this.formData = { this.formData = {
gridId: '', gridId: '',
unitName: '', unitName: '',
serviceMatter: [], serviceMatterList: [],
type: '', type: '',
contact: '', contact: '',
contactMobile: '', contactMobile: '',

330
src/views/modules/communityService/ninePlaces/places/places.vue

@ -6,7 +6,30 @@
ref="ref_searchform" ref="ref_searchform"
:label-width="'100px'"> :label-width="'100px'">
<div> <div>
<el-form-item label="所属网格"
<el-form-item label="场所名称"
prop="placeOrgName">
<el-input v-model="formData.placeOrgName"
class="item_width_1"
size="small"
clearable
placeholder="请输入九小场所名称">
</el-input>
</el-form-item>
<el-form-item label="联系电话"
prop="mobile">
<el-input v-model="formData.mobile"
class="item_width_1"
size="small"
clearable
placeholder="请输入电话">
</el-input>
</el-form-item>
<el-form-item label="场所区域"
prop="gridId"> prop="gridId">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="formData.gridId" v-model="formData.gridId"
@ -20,20 +43,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="单位名称"
prop="unitName">
<el-input v-model="formData.unitName"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item> </div>
<el-form-item label="服务事项" <div>
prop="serviceMatter"> <el-form-item label="规模"
prop="scale">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="formData.serviceMatter" v-model="formData.scale"
placeholder="请选择" placeholder="请选择"
clearable> clearable>
<el-option v-for="item in scaleList" <el-option v-for="item in scaleList"
@ -44,12 +60,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> <el-form-item label="场所类型"
<div> prop="ninePlacsVal">
<el-form-item label="分类"
prop="type">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="formData.type" v-model="formData.ninePlacsVal"
placeholder="请选择" placeholder="请选择"
clearable> clearable>
<el-option v-for="item in placeTypeList" <el-option v-for="item in placeTypeList"
@ -59,27 +73,6 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item>
<el-form-item label="联系人"
prop="contact">
<el-input v-model="formData.contact"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="联系电话"
prop="contactMobile">
<el-input v-model="formData.contactMobile"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item> </el-form-item>
<el-button style="margin-left:10px" <el-button style="margin-left:10px"
@ -94,32 +87,9 @@
</el-form> </el-form>
</div> </div>
<div class="div_table"> <div class="div_table">
<div class="div_btn"> <el-button type="green"
<el-button style="float:left"
type="green"
size="small" size="small"
@click="handleAdd">新增</el-button> @click="handleAdd">新增</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"
type="red">导入</el-button>
<el-button style="float:left"
type="yellow"
size="small"
@click="handleExport">导出</el-button>
</el-upload>
</div>
<el-table class="table" <el-table class="table"
:data="tableData" :data="tableData"
@ -133,61 +103,43 @@
align="center" align="center"
type="index" type="index"
width="50"></el-table-column> width="50"></el-table-column>
<el-table-column prop="gridName" <el-table-column prop="placeOrgName"
header-align="center" header-align="center"
align="center" align="center"
label="所属网格" label="场所名称"
width="180"> min-width="280">
</el-table-column> </el-table-column>
<el-table-column prop="unitName" <el-table-column prop="address"
header-align="center" header-align="center"
align="center" align="center"
label="单位名称" label="场所地址"
width="180"> min-width="280">
</el-table-column> </el-table-column>
<el-table-column prop="type" <el-table-column prop="ninePlaceName"
header-align="center" header-align="center"
align="center" align="center"
label="分类" label="场所类型"
width="180"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="serviceMatter" <el-table-column prop="scale"
header-align="center" header-align="center"
align="center" align="center"
label="服务事项" label="规模"
width="180"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="contact" <el-table-column prop="personInCharge"
header-align="center" header-align="center"
align="center" align="center"
label="联系人" label="负责人"
width="100"> min-width="100">
</el-table-column> </el-table-column>
<el-table-column prop="contactMobile" <el-table-column prop="mobile"
header-align="center" header-align="center"
align="center" align="center"
label="联系电话" label="联系电话"
width="110"> min-width="110">
</el-table-column>
<el-table-column prop="memberCount"
header-align="center"
align="center"
label="在职党员数"
width="150">
</el-table-column>
<el-table-column prop="satisfaction"
header-align="center"
align="center"
label="群众满意度"
width="150">
</el-table-column>
<el-table-column prop="remark"
header-align="center"
align="center"
label="备注"
:show-overflow-tooltip="true"
width="150">
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
width="140" width="140"
@ -196,10 +148,6 @@
class="operate"> class="operate">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text"
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@ -216,7 +164,7 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[10, 20, 50]" :page-sizes="[20, 50, 100, 200]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next, total" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">
@ -266,25 +214,20 @@ export default {
scaleList: [],//list scaleList: [],//list
placeTypeList: [],//list placeTypeList: [],//list
unitId: '',
formData: { formData: {
gridId: '', placeOrgName: '',//
unitName: '', mobile: '',//
serviceMatter: '', scale: '',// 0:10 1:10-20 2:21-40 3:41-100 4:100
type: '', gridId: '',//Id
contact: '', ninePlacsVal: '',//Value
contactMobile: '' isPage: true,//(:true :false)
}, },
tableData: [], tableData: [],
//form //form
formShow: false, formShow: false,
formTitle: '新增单位', formTitle: '新增场所',
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
} }
}, },
@ -295,11 +238,11 @@ export default {
}, },
async mounted () { async mounted () {
// //
await this.loadService() await this.loadScale()
// //
await this.loadType() await this.loadPlaceType()
const { user } = this.$store.state const { user } = this.$store.state
this.agencyId = user.agencyId this.agencyId = user.agencyId
@ -332,13 +275,12 @@ export default {
}, },
// //
async loadService () { async loadScale () {
// const url = "/heart/icresidemanddict/subcodelist" const url = "/sys/dict/data/dictlist"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icresidemanddict/subcodelist"
let params = { let params = {
parentCategoryCode: '1010' dictType: 'scale'
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -351,12 +293,12 @@ export default {
} }
}, },
// //
async loadType () { async loadPlaceType () {
const url = "/sys/dict/data/dictlist" const url = "/sys/dict/data/dictlist"
let params = { let params = {
dictType: 'party_unit_type' dictType: 'nine_small_places'
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -373,12 +315,11 @@ export default {
async loadTable () { async loadTable () {
this.tableLoading = true this.tableLoading = true
// const url = "/heart/icpartyunit/list" // const url = "/gov/org/placeorg/getlist"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/list" const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/getlist"
let params = { let params = {
pageSize: this.pageSize, pageSize: this.pageSize,
pageNo: this.pageNo, pageNo: this.pageNo,
agencyId: this.agencyId,
...this.formData ...this.formData
} }
@ -420,7 +361,7 @@ export default {
this.formTitle = '修改' this.formTitle = '修改'
this.formShow = true this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id) this.$refs.ref_form.initForm('edit', row.placeOrgId)
}) })
}, },
@ -441,7 +382,7 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.deleteUnit(row) this.deletePlace(row)
}) })
.catch(err => { .catch(err => {
if (err == "cancel") { if (err == "cancel") {
@ -451,12 +392,12 @@ export default {
}); });
}, },
async deleteUnit (row) { async deletePlace (row) {
// const url = "/heart/icpartyunit/delete" // const url = "/gov/org/placeorg/del"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/delete" const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/del"
let params = { let params = {
id: row.id placeOrgId: row.placeOrgId
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -476,118 +417,15 @@ export default {
// //
resetSearch () { resetSearch () {
this.formData = { this.formData = {
gridId: '', placeOrgName: '',//
unitName: '', mobile: '',//
serviceMatter: '', scale: '',// 0:10 1:10-20 2:21-40 3:41-100 4:100
type: '', gridId: '',//Id
contact: '', ninePlacsVal: '',//Value
contactMobile: '' isPage: true,//(:true :false)
}
},
//
async handleExport () {
let title = '联建单位列表'
const url = "/partyunit/export"
let params = {
ownerName: this.ownerName,
ownerPhone: this.ownerPhone,
level: this.agencyObj.level,
id: this.agencyObj.id
}
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 = '/partyunit/import'
let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip
const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
handleSizeChange (val) { handleSizeChange (val) {
this.pageSize = val this.pageSize = val

394
src/views/modules/communityService/ninePlaces/places/placesForm.vue

@ -9,151 +9,92 @@
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
class="form"> class="form">
<el-form-item label="所属网格" <el-form-item label="场所类型"
prop="gridId"
label-width="150px" label-width="150px"
style="display: block"> prop="ninePlacsVal">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="formData.gridId" v-model="formData.ninePlacsVal"
placeholder="全部" placeholder="请选择"
clearable> clearable>
<el-option v-for="item in gridList" <el-option v-for="item in placeTypeList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item>
<el-form-item label="单位名称"
prop="unitName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入单位名称"
v-model="formData.unitName">
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="分类"
prop="type" <el-form-item label="场所区域"
prop="gridId"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="formData.type" v-model="formData.gridId"
placeholder="请选择" placeholder="全部"
filterable
clearable> clearable>
<el-option v-for="item in typeList" <el-option v-for="item in gridList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="服务事项"
prop="serviceMatter"
label-width="150px"
style="display: block">
<el-checkbox-group class="item_width_1"
style="display:flex;flex-wrap:wrap"
v-model="formData.serviceMatter">
<el-checkbox v-for="item in serviceList"
:key="item.value"
:label="item.value">{{item.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item> <el-form-item label="场所名称"
<el-form-item label="联系人"
prop="contact"
label-width="150px" label-width="150px"
style="display: block"> prop="placeOrgName">
<el-input class="item_width_1" <el-input v-model="formData.placeOrgName"
placeholder="请输入联系人姓名" class="item_width_1"
v-model="formData.contact"> clearable
placeholder="请输入九小场所名称">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系电话" <el-form-item label="场所地址"
prop="contactMobile"
label-width="150px" label-width="150px"
style="display: block"> prop="address">
<el-input class="item_width_1" <el-input v-model="formData.address"
placeholder="请输入联系人电话" class="item_width_1"
v-model="formData.contactMobile"> clearable
placeholder="请输入场所地址">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="在职党员"
style="display: block" <el-form-item label="规模"
prop="memberCount"
label-width="150px">
<el-input-number class="item_width_1"
v-model="formData.memberCount"
:min="1"
label="单元数"></el-input-number>
</el-form-item>
<el-form-item label="备注"
prop="remark"
label-width="150px" label-width="150px"
style="display: block"> prop="scale">
<el-input class="item_width_1" <el-select class="item_width_1"
type="textarea" v-model="formData.scale"
maxlength="500" placeholder="请选择"
show-word-limit clearable>
:rows="3" <el-option v-for="item in scaleList"
placeholder="请输入备注,不超过500字" :key="item.value"
v-model="formData.remark"></el-input> :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="位置坐标" <el-form-item label="负责人"
prop="longitude"
label-width="150px" label-width="150px"
style="display: block"> prop="personInCharge">
<div style="width:500px"> <el-input v-model="formData.personInCharge"
class="item_width_1"
<div class="div_map"> clearable
<div id="app"> placeholder="请输入负责人姓名">
</div>
<div class="div_searchmap">
<el-input class="item_width_4"
maxlength="50"
size="mini"
placeholder="请输入关键字"
v-model="keyWords">
</el-input> </el-input>
<el-button style="margin-left: 10px"
type="primary"
size="mini"
@click="handleSearchMap">查询</el-button>
</div>
</div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="formData.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="formData.latitude">
</el-input>
</div>
</div>
</el-form-item> </el-form-item>
<el-form-item label="联系电话"
<el-form-item label="地理位置"
prop="address"
label-width="150px" label-width="150px"
style="display: block"> prop="mobile">
<el-input v-model="formData.mobile"
<el-input class="item_width_1" class="item_width_1"
v-model="formData.address"> type='number'
clearable
placeholder="请输入电话">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -176,14 +117,6 @@ import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading // let loading //
export default { export default {
data () { data () {
@ -192,41 +125,33 @@ export default {
btnDisable: false, btnDisable: false,
unitId: '', placeOrgId: '',
keyWords: '',
formData: { formData: {
gridId: '', gridId: '',
unitName: '', ninePlacsVal: '',
serviceMatter: [], placeOrgName: '',
type: '', address: '',
contact: '', scale: '',
contactMobile: '', personInCharge: '',
memberCount: 0, mobile: ''
remark: '', //500
address: '', //
longitude: 36.0722275, //
latitude: 120.38945519 //
}, },
} }
}, },
components: {}, components: {},
mounted () { mounted () {
this.initMap()
}, },
methods: { methods: {
async initForm (type, unitId) { async initForm (type, placeOrgId) {
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
// debugger
// map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
this.formType = type this.formType = type
if (unitId) { if (placeOrgId) {
this.unitId = unitId this.placeOrgId = placeOrgId
this.formData.id = unitId this.formData.placeOrgId = placeOrgId
await this.loadFormData() await this.loadFormData()
} }
@ -234,10 +159,10 @@ export default {
// //
async loadFormData () { async loadFormData () {
// const url = '/heart/icpartyunit/detail' // const url = '/gov/org/placeorg/detail'
const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/detail' const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/detail'
let params = { let params = {
id: this.unitId placeOrgId: this.placeOrgId
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -263,16 +188,16 @@ export default {
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
this.btnDisable = false this.btnDisable = false
} else { } else {
this.addUnit() this.addPlace()
} }
}) })
}, },
async addUnit () { async addPlace () {
// const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; // // const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
// if (regPhone.test(this.formData.contactMobile) === false) { // if (regPhone.test(this.formData.mobile) === false) {
// this.btnDisable = false // this.btnDisable = false
// this.$message({ // this.$message({
// type: 'warning', // type: 'warning',
@ -281,18 +206,23 @@ export default {
// return false; // return false;
// } // }
// let url = '/heart/icpartyunit/save' let url = ''
let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/save"
// if (this.formType === 'edit') { if (this.formType === 'edit') {
// this.formData.id = this.unitId // url = '/gov/org/placeorg/edit'
// } url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/edit'
} else {
// url = "/gov/org/placeorg/add"
url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/add"
}
const { data, code, msg } = await requestPost(url, this.formData) const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) { if (code === 0) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '新增联建单位成功' message: '操作成功'
}) })
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
@ -311,133 +241,16 @@ export default {
}, },
// 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
//
});
},
resetData () { resetData () {
this.unitId = '' this.placeOrgId = ''
this.keyWords = ''
this.formData = { this.formData = {
gridId: '', gridId: '',
unitName: '', ninePlacsVal: '',
serviceMatter: [], placeOrgName: '',
type: '', address: '',
contact: '', scale: '',
contactMobile: '', personInCharge: '',
memberCount: 0, mobile: ''
remark: '', //500
address: '', //
longitude: '', //
latitude: '' //
} }
}, },
// //
@ -462,27 +275,24 @@ export default {
gridId: [ gridId: [
{ required: true, message: '所属网格不能为空', trigger: 'blur' } { required: true, message: '所属网格不能为空', trigger: 'blur' }
], ],
unitName: [ ninePlacsVal: [
{ required: true, message: '单位名称不能为空', trigger: 'blur' }, { required: true, message: '场所类型不能为空', trigger: 'blur' },
], ],
type: [ placeOrgName: [
{ required: true, message: '分类不能为空', trigger: 'blur' } { required: true, message: '场所名称不能为空', trigger: 'blur' }
], ],
contact: [ address: [
{ required: true, message: '联系人不能为空', trigger: 'blur' } { required: true, message: '场所地址不能为空', trigger: 'blur' }
],
contactMobile: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' }
], ],
memberCount: [ scale: [
{ required: true, message: '在职党员数不能为空', trigger: 'blur' } { required: true, message: '场所规模不能为空', trigger: 'blur' }
], ],
address: [ personInCharge: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' } { required: true, message: '负责人不能为空', trigger: 'blur' }
], ],
longitude: [ mobile: [
{ required: true, message: '坐标不能为空', trigger: 'blur' } { required: true, message: '联系电话不能为空', trigger: 'blur' }
] ]
} }
}, },
@ -494,11 +304,11 @@ export default {
type: Array, type: Array,
default: [] default: []
}, },
typeList: { scaleList: {
type: Array, type: Array,
default: [] default: []
}, },
serviceList: { placeTypeList: {
type: Array, type: Array,
default: [] default: []
}, },

380
src/views/modules/communityService/ninePlaces/team/team.vue

@ -6,37 +6,37 @@
ref="ref_searchform" ref="ref_searchform"
:label-width="'100px'"> :label-width="'100px'">
<div> <div>
<el-form-item label="所属网格"
prop="gridId"> <el-form-item label="负责人"
<el-select class="item_width_1" prop="personInCharge">
v-model="formData.gridId" <el-input v-model="formData.personInCharge"
placeholder="全部" class="item_width_1"
clearable> size="small"
<el-option v-for="item in gridList" clearable
:key="item.value" placeholder="请输入负责人姓名">
:label="item.label" </el-input>
:value="item.value">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="单位名称"
prop="unitName"> <el-form-item label="联系电话"
<el-input v-model="formData.unitName" prop="mobile">
<el-input v-model="formData.mobile"
class="item_width_1" class="item_width_1"
size="small" size="small"
clearable clearable
placeholder="请输入内容"> placeholder="请输入电话">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="服务事项" </div>
prop="serviceMatter"> <div>
<el-form-item label="负责区域"
prop="gridId">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="formData.serviceMatter" v-model="formData.gridId"
placeholder="请选择" placeholder="全部"
clearable> clearable>
<el-option v-for="item in serviceList" <el-option v-for="item in gridList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
@ -44,42 +44,20 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</div>
<div> <el-form-item label="场所类型"
<el-form-item label="分类" prop="ninePlacsVal">
prop="type">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="formData.type" v-model="formData.ninePlacsVal"
placeholder="请选择" placeholder="请选择"
clearable> clearable>
<el-option v-for="item in typeList" <el-option v-for="item in placeTypeList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item>
<el-form-item label="联系人"
prop="contact">
<el-input v-model="formData.contact"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="联系电话"
prop="contactMobile">
<el-input v-model="formData.contactMobile"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item> </el-form-item>
<el-button style="margin-left:10px" <el-button style="margin-left:10px"
@ -94,32 +72,9 @@
</el-form> </el-form>
</div> </div>
<div class="div_table"> <div class="div_table">
<div class="div_btn"> <el-button type="green"
<el-button style="float:left"
type="green"
size="small" size="small"
@click="handleAdd">新增</el-button> @click="handleAdd">新增</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"
type="red">导入</el-button>
<el-button style="float:left"
type="yellow"
size="small"
@click="handleExport">导出</el-button>
</el-upload>
</div>
<el-table class="table" <el-table class="table"
:data="tableData" :data="tableData"
@ -133,61 +88,49 @@
align="center" align="center"
type="index" type="index"
width="50"></el-table-column> width="50"></el-table-column>
<el-table-column prop="gridName" <el-table-column prop="placeOrgName"
header-align="center"
align="center"
label="所属网格"
width="180">
</el-table-column>
<el-table-column prop="unitName"
header-align="center" header-align="center"
align="center" align="center"
label="单位名称" label="分队名称"
width="180"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="type" <el-table-column prop="address"
header-align="center" header-align="center"
align="center" align="center"
label="分类" label="负责人"
width="180"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="serviceMatter" <el-table-column prop="ninePlaceName"
header-align="center" header-align="center"
align="center" align="center"
label="服务事项" label="联系电话"
width="180"> min-width="110">
</el-table-column>
<el-table-column prop="contact"
header-align="center"
align="center"
label="联系人"
width="100">
</el-table-column> </el-table-column>
<el-table-column prop="contactMobile" <el-table-column prop="scale"
header-align="center" header-align="center"
align="center" align="center"
label="联系电话" label="负责区域"
width="110"> min-width="280">
</el-table-column> </el-table-column>
<el-table-column prop="memberCount" <el-table-column prop="personInCharge"
header-align="center" header-align="center"
align="center" align="center"
label="在职党员数" label="负责场所类型"
width="150"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="satisfaction" <el-table-column prop="mobile"
header-align="center" header-align="center"
align="center" align="center"
label="群众满意度" label="监察计划"
width="150"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="remark" <el-table-column prop="mobile"
header-align="center" header-align="center"
align="center" align="center"
label="备注" label="创建时间"
:show-overflow-tooltip="true" min-width="120">
width="150">
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
width="140" width="140"
@ -216,7 +159,7 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[10, 20, 50]" :page-sizes="[20, 50, 100, 200]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next, total" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">
@ -232,12 +175,11 @@
width="850px" width="850px"
top="5vh" top="5vh"
@closed="diaClose"> @closed="diaClose">
<units-form ref="ref_form" <team-form ref="ref_form"
:gridList="gridList" :gridList="gridList"
:serviceList="serviceList" :placeTypeList="placeTypeList"
:typeList="typeList"
@dialogCancle="addFormCancle" @dialogCancle="addFormCancle"
@dialogOk="addFormOk"></units-form> @dialogOk="addFormOk"></team-form>
</el-dialog> </el-dialog>
</div> </div>
@ -245,7 +187,7 @@
<script> <script>
import unitsForm from './unitsForm' import teamForm from './teamForm'
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@ -260,63 +202,37 @@ export default {
pageSize: 10, pageSize: 10,
pageNo: 0, pageNo: 0,
tableLoading: false, tableLoading: false,
agencyId: '', agencyId: '',
gridList: [],//list gridList: [],//list--
unitList: [],//list scaleList: [],//list
serviceList: [ placeTypeList: [],//list
{
id: "1",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。'
},
{
id: "2",
name: '积极配合'
},
{
id: "3",
name: '积极配合社区安全巡查员进行'
},
{
id: "4",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。并具备安全意识及设备设施'
},
],//list
typeList: [],//list
unitId: '',
formData: { formData: {
gridId: '', personInCharge: '',//
unitName: '', mobile: '',//
serviceMatter: '', gridId: '',//Id
type: '', ninePlacsVal: '',//Value
contact: '', isPage: true,//(:true :false)
contactMobile: ''
}, },
tableData: [], tableData: [],
//form //form
formShow: false, formShow: false,
formTitle: '新增单位', formTitle: '新增巡查人员',
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
} }
}, },
components: { components: {
unitsForm teamForm
}, },
async created () { async created () {
}, },
async mounted () { async mounted () {
// //
await this.loadService() await this.loadPlaceType()
//
await this.loadType()
const { user } = this.$store.state const { user } = this.$store.state
this.agencyId = user.agencyId this.agencyId = user.agencyId
@ -349,37 +265,18 @@ export default {
}, },
// //
async loadService () { async loadPlaceType () {
// const url = "/heart/icresidemanddict/subcodelist"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icresidemanddict/subcodelist"
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" const url = "/sys/dict/data/dictlist"
let params = { let params = {
dictType: 'party_unit_type' dictType: 'nine_small_places'
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.typeList = data this.placeTypeList = data
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -390,12 +287,11 @@ export default {
async loadTable () { async loadTable () {
this.tableLoading = true this.tableLoading = true
// const url = "/heart/icpartyunit/list" // const url = "/gov/org/placeorg/getlist"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/list" const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/getlist"
let params = { let params = {
pageSize: this.pageSize, pageSize: this.pageSize,
pageNo: this.pageNo, pageNo: this.pageNo,
agencyId: this.agencyId,
...this.formData ...this.formData
} }
@ -421,7 +317,7 @@ export default {
this.formTitle = '详情' this.formTitle = '详情'
this.formShow = true this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.id) this.$refs.ref_form.initForm('detail', row.teamId, this.agencyId)
}) })
}, },
@ -429,7 +325,7 @@ export default {
this.formTitle = '新增' this.formTitle = '新增'
this.formShow = true this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null) this.$refs.ref_form.initForm('add', null, this.agencyId)
}) })
}, },
@ -437,7 +333,7 @@ export default {
this.formTitle = '修改' this.formTitle = '修改'
this.formShow = true this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id) this.$refs.ref_form.initForm('edit', row.teamId, this.agencyId)
}) })
}, },
@ -458,7 +354,7 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.deleteUnit(row) this.deleteTeam(row)
}) })
.catch(err => { .catch(err => {
if (err == "cancel") { if (err == "cancel") {
@ -468,12 +364,12 @@ export default {
}); });
}, },
async deleteUnit (row) { async deleteTeam (row) {
// const url = "/heart/icpartyunit/delete" // const url = "/gov/org/placepatrolteam/del"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/delete" const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteam/del"
let params = { let params = {
id: row.id teamId: row.teamId
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -493,118 +389,14 @@ export default {
// //
resetSearch () { resetSearch () {
this.formData = { this.formData = {
gridId: '', personInCharge: '',//
unitName: '', mobile: '',//
serviceMatter: '', gridId: '',//Id
type: '', ninePlacsVal: '',//Value
contact: '', isPage: true,//(:true :false)
contactMobile: ''
} }
}, },
//
async handleExport () {
let title = '联建单位列表'
const url = "/partyunit/export"
let params = {
ownerName: this.ownerName,
ownerPhone: this.ownerPhone,
level: this.agencyObj.level,
id: this.agencyObj.id
}
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 = '/partyunit/import'
let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip
const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
handleSizeChange (val) { handleSizeChange (val) {
this.pageSize = val this.pageSize = val

440
src/views/modules/communityService/ninePlaces/team/teamForm.vue

@ -0,0 +1,440 @@
<template>
<div>
<div>
<div>
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="分队名称"
label-width="150px"
prop="teamName">
<el-input v-model="formData.teamName"
class="item_width_1"
clearable
placeholder="请输入分队名称">
</el-input>
</el-form-item>
<el-form-item label="负责区域"
prop="gridIdArray"
label-width="150px"
style="display: block">
<el-select class="item_width_1"
v-model="formData.gridIdArray"
placeholder="全部"
multiple
clearable>
<el-option v-for="item in gridList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="负责场所类型"
prop="ninePlacsArray"
label-width="150px"
style="display: block">
<el-checkbox-group class="item_width_1"
style="display:flex;flex-wrap:wrap"
v-model="formData.ninePlacsArray">
<el-checkbox v-for="item in placeTypeList"
:key="item.value"
:label="item.value">{{item.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="巡查计划"
prop="plan"
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="formData.plan"></el-input>
</el-form-item>
<el-form-item label="创建时间"
style="display: block"
prop="time"
label-width="150px">
<el-date-picker v-model="formData.time"
value-format="yyyyMMdd"
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="负责人"
label-width="150px"
prop="personInCharge">
<el-input v-model="formData.personInCharge"
class="item_width_1"
clearable
placeholder="请输入负责人姓名">
</el-input>
</el-form-item>
<el-form-item label="联系电话"
label-width="150px"
prop="mobile">
<el-input v-model="formData.mobile"
class="item_width_1"
type='number'
clearable
placeholder="请输入电话">
</el-input>
</el-form-item>
<el-form-item label="成员"
label-width="150px"
prop="member">
<el-button v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
size="mini"
icon="el-icon-plus"
@click="handleAddPerson"></el-button>
<div v-for="(item,index) in memberList"
:key="index"
class="div_person_list">
<span style="font-weight: bold">姓名</span>
<el-input v-if="item.isEdit"
v-model="item.name"
class="item_width_3"
clearable
placeholder="请输入电话">
</el-input>
<span class="item_width_span_3"
v-if="!item.isEdit">{{item.name}}</span>
<span style="font-weight: bold;margin-left:20px">联系电话</span>
<el-input v-if="item.isEdit"
v-model="item.mobile"
class="item_width_4"
clearable
placeholder="请输入电话">
</el-input>
<span class="item_width_span_4"
v-if="!item.isEdit">{{item.mobile}}</span>
<el-button style="margin-left:30px"
type="red"
size="mini"
@click="handleDelPerson(index)">删除</el-button>
</div>
</el-form-item>
</el-form>
</div>
</div>
<div class="div_btn">
<el-button @click="handleCancle"> </el-button>
<el-button 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'
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
teamId: '',
formData: {
agencyId: '',//Id
teamName: '',//
gridIds: '',//
gridIdArray: [],
ninePlacsVals: '',//
ninePlacsArray: [],
plan: '',//
time: '',//
personInCharge: '',//
mobile: '',//
memberList: ''//
},
memberList: [
{
name: '成吉思汗',
mobile: '19999999999',
isEdit: false,
},
{
name: '成吉思汗',
mobile: '17465666567',
isEdit: true,
}
],
}
},
components: {},
mounted () {
},
methods: {
async initForm (type, teamId, agencyId) {
this.$refs.ref_form.resetFields();
this.formData.agencyId = agencyId
this.formType = type
if (teamId) {
this.teamId = teamId
this.formData.teamId = teamId
await this.loadFormData()
}
},
//
async loadFormData () {
// const url = '/gov/org/placepatrolteam/detail'
const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteam/detail'
let params = {
placePatrolTeamId: this.teamId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
} 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.addTeam()
}
})
},
handleAddPerson () {
let obj = {
name: '',
mobile: '',
isEdit: true
}
this.memberList.push(obj)
},
handleDelPerson (index) {
this.memberList.splice(index, 1)
},
async addTeam () {
// const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
// if (regPhone.test(this.formData.mobile) === false) {
// this.btnDisable = false
// this.$message({
// type: 'warning',
// message: ''
// })
// return false;
// }
if (this.formData.gridIdArray.length > 0) {
this.formData.gridIds = this.formData.gridIdArray.join(',')
} else {
return false
}
if (this.formData.ninePlacsArray.length > 0) {
this.formData.ninePlacsVals = this.formData.ninePlacsArray.join(',')
} else {
return false
}
let url = ''
if (this.formType === 'edit') {
// url = '/gov/org/placeorg/edit'
url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/edit'
} else {
// url = "/gov/org/placepatrolteam/add"
url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteam/add"
}
const { data, code, msg } = 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(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
resetData () {
this.teamId = ''
this.formData = {
agencyId: '',//Id
teamName: '',//
gridIds: '',//
gridIdArray: [],
ninePlacsVals: '',//
ninePlacsArray: [],
plan: '',//
time: '',//
personInCharge: '',//
mobile: '',//
member: '1'//
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
teamName: [
{ required: true, message: '分队名称不能为空', trigger: 'blur' }
],
gridIdArray: [
{ required: true, message: '负责区域不能为空', trigger: 'blur' },
],
ninePlacsArray: [
{ required: true, message: '场所类型不能为空', trigger: 'blur' }
],
plan: [
{ required: true, message: '巡查计划 不能为空', trigger: 'blur' }
],
personInCharge: [
{ required: true, message: '负责人不能为空', trigger: 'blur' }
],
mobile: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' }
],
member: [
{ required: true, message: '成员不能为空', trigger: 'blur' }
]
}
},
},
props: {
gridList: {
type: Array,
default: []
},
placeTypeList: {
type: Array,
default: []
},
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/buttonstyle.scss";
.item_width_1 {
width: 500px;
}
.item_width_2 {
width: 400px;
}
.item_width_3 {
margin-left: 10px;
width: 120px;
}
.item_width_4 {
margin-left: 10px;
width: 150px;
}
.item_width_span_3 {
margin-left: 10px;
width: 120px;
}
.item_width_span_4 {
margin-left: 10px;
width: 150px;
}
.div_btn {
display: flex;
justify-content: flex-end;
}
.form {
margin-top: 30px;
}
.div_person_list {
margin-top: 10px;
width: 500px;
display: flex;
}
</style>
<style lang=scss>
.el-dialog__body {
padding: 0 10px 20px !important;
}
</style>

553
src/views/modules/communityService/ninePlaces/team/unitsForm.vue

@ -1,553 +0,0 @@
<template>
<div>
<div>
<div>
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="所属网格"
prop="gridId"
label-width="150px"
style="display: block">
<el-select class="item_width_1"
v-model="formData.gridId"
placeholder="全部"
clearable>
<el-option v-for="item in gridList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="单位名称"
prop="unitName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入单位名称"
v-model="formData.unitName">
</el-input>
</el-form-item>
<el-form-item label="分类"
prop="type"
label-width="150px"
style="display: block">
<el-select class="item_width_1"
v-model="formData.type"
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-checkbox-group class="item_width_1"
style="display:flex;flex-wrap:wrap"
v-model="formData.serviceMatter">
<el-checkbox v-for="item in serviceList"
:key="item.value"
:label="item.value">{{item.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="联系人"
prop="contact"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入联系人姓名"
v-model="formData.contact">
</el-input>
</el-form-item>
<el-form-item label="联系电话"
prop="contactMobile"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入联系人电话"
v-model="formData.contactMobile">
</el-input>
</el-form-item>
<el-form-item label="在职党员"
style="display: block"
prop="memberCount"
label-width="150px">
<el-input-number class="item_width_1"
v-model="formData.memberCount"
:min="1"
label="单元数"></el-input-number>
</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="formData.remark"></el-input>
</el-form-item>
<el-form-item label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div class="div_map">
<div id="app">
</div>
<div class="div_searchmap">
<el-input class="item_width_4"
maxlength="50"
size="mini"
placeholder="请输入关键字"
v-model="keyWords">
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="mini"
@click="handleSearchMap">查询</el-button>
</div>
</div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="formData.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="formData.latitude">
</el-input>
</div>
</div>
</el-form-item>
<el-form-item label="地理位置"
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
v-model="formData.address">
</el-input>
</el-form-item>
</el-form>
</div>
</div>
<div class="div_btn">
<el-button @click="handleCancle"> </el-button>
<el-button 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', // addeditdetail
btnDisable: false,
unitId: '',
keyWords: '',
formData: {
gridId: '',
unitName: '',
serviceMatter: [],
type: '',
contact: '',
contactMobile: '',
memberCount: 0,
remark: '', //500
address: '', //
longitude: 36.0722275, //
latitude: 120.38945519 //
},
}
},
components: {},
mounted () {
this.initMap()
},
methods: {
async initForm (type, unitId) {
this.$refs.ref_form.resetFields();
// debugger
// map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
this.formType = type
if (unitId) {
this.unitId = unitId
this.formData.id = unitId
await this.loadFormData()
}
},
//
async loadFormData () {
// const url = '/heart/icpartyunit/detail'
const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/detail'
let params = {
id: this.unitId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
} 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 () {
// const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
// if (regPhone.test(this.formData.contactMobile) === false) {
// this.btnDisable = false
// this.$message({
// type: 'warning',
// message: ''
// })
// return false;
// }
// let url = '/heart/icpartyunit/save'
let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/save"
// if (this.formType === 'edit') {
// this.formData.id = this.unitId
// }
const { data, code, msg } = 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(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
// 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
//
});
},
resetData () {
this.unitId = ''
this.keyWords = ''
this.formData = {
gridId: '',
unitName: '',
serviceMatter: [],
type: '',
contact: '',
contactMobile: '',
memberCount: 0,
remark: '', //500
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 {
gridId: [
{ required: true, message: '所属网格不能为空', trigger: 'blur' }
],
unitName: [
{ required: true, message: '单位名称不能为空', trigger: 'blur' },
],
type: [
{ required: true, message: '分类不能为空', trigger: 'blur' }
],
contact: [
{ required: true, message: '联系人不能为空', trigger: 'blur' }
],
contactMobile: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' }
],
memberCount: [
{ required: true, message: '在职党员数不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' }
],
longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' }
]
}
},
},
props: {
gridList: {
type: Array,
default: []
},
typeList: {
type: Array,
default: []
},
serviceList: {
type: Array,
default: []
},
}
}
</script>
<style scoped>
.item_width_1 {
width: 500px;
}
.item_width_2 {
width: 400px;
}
.item_width_3 {
margin-left: 10px;
width: 200px;
}
.item_width_4 {
width: 200px;
}
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
.div_btn {
display: flex;
justify-content: flex-end;
}
.el-tabs {
margin: 0 20px;
}
.el-upload__tip {
color: rgb(155, 155, 155);
margin: 0;
}
.form {
margin-top: 30px;
}
</style>
<style lang=scss>
.el-dialog__body {
padding: 0 10px 20px !important;
}
</style>
Loading…
Cancel
Save