Browse Source

九小场所

shibei_master
jiangyy 4 years ago
parent
commit
f44191a0d2
  1. 694
      src/views/modules/communityService/ninePlaces/inspect/inspect.vue
  2. 553
      src/views/modules/communityService/ninePlaces/inspect/unitsForm.vue
  3. 677
      src/views/modules/communityService/ninePlaces/places/places.vue
  4. 553
      src/views/modules/communityService/ninePlaces/places/placesForm.vue
  5. 694
      src/views/modules/communityService/ninePlaces/team/team.vue
  6. 553
      src/views/modules/communityService/ninePlaces/team/unitsForm.vue

694
src/views/modules/communityService/ninePlaces/inspect/inspect.vue

@ -0,0 +1,694 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="所属网格"
prop="gridId">
<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">
<el-input v-model="formData.unitName"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="服务事项"
prop="serviceMatter">
<el-select class="item_width_1"
v-model="formData.serviceMatter"
placeholder="请选择"
clearable>
<el-option v-for="item in serviceList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="分类"
prop="type">
<el-select class="item_width_1"
v-model="formData.type"
placeholder="请选择"
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="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-button style="margin-left:10px"
type="primary"
size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
type="yellow"
size="small"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button style="float:left"
type="green"
size="small"
@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"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="gridName"
header-align="center"
align="center"
label="所属网格"
width="180">
</el-table-column>
<el-table-column prop="unitName"
header-align="center"
align="center"
label="单位名称"
width="180">
</el-table-column>
<el-table-column prop="type"
header-align="center"
align="center"
label="分类"
width="180">
</el-table-column>
<el-table-column prop="serviceMatter"
header-align="center"
align="center"
label="服务事项"
width="180">
</el-table-column>
<el-table-column prop="contact"
header-align="center"
align="center"
label="联系人"
width="100">
</el-table-column>
<el-table-column prop="contactMobile"
header-align="center"
align="center"
label="联系电话"
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 label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate">
<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"
style="color:#00A7A9;text-decoration: underline;"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text"
style="color:#D51010;text-decoration: underline;"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="850px"
top="5vh"
@closed="diaClose">
<units-form ref="ref_form"
:gridList="gridList"
:serviceList="serviceList"
:typeList="typeList"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></units-form>
</el-dialog>
</div>
</template>
<script>
import unitsForm from './unitsForm'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
agencyId: '',
gridList: [],//list
unitList: [],//list
serviceList: [
{
id: "1",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。'
},
{
id: "2",
name: '积极配合'
},
{
id: "3",
name: '积极配合社区安全巡查员进行'
},
{
id: "4",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。并具备安全意识及设备设施'
},
],//list
typeList: [],//list
unitId: '',
formData: {
gridId: '',
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
},
tableData: [],
//form
formShow: false,
formTitle: '新增单位',
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
}
},
components: {
unitsForm
},
async created () {
},
async mounted () {
//
await this.loadService()
//
await this.loadType()
const { user } = this.$store.state
this.agencyId = user.agencyId
//
await this.loadGrid()
await this.loadTable()
},
methods: {
handleSearch () {
this.loadTable()
},
async loadGrid () {
const url = "/gov/org/customergrid/gridoption"
let params = {
agencyId: this.agencyId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.gridList = data
} else {
this.$message.error(msg)
}
},
//
async loadService () {
// 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"
let params = {
dictType: 'party_unit_type'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.typeList = data
} else {
this.$message.error(msg)
}
},
async loadTable () {
this.tableLoading = true
// const url = "/heart/icpartyunit/list"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/list"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
agencyId: this.agencyId,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
handleDetail (row) {
this.formTitle = '详情'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.id)
})
},
handleAdd () {
this.formTitle = '新增'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id)
})
},
addFormCancle () {
this.formShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteUnit(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteUnit (row) {
// const url = "/heart/icpartyunit/delete"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/delete"
let params = {
id: row.id
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
resetSearch () {
this.formData = {
gridId: '',
unitName: '',
serviceMatter: '',
type: '',
contact: '',
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) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 460)
},
rowHeight () {
return (this.clientHeight - 200) + 'px'
},
...mapGetters(['clientHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss";
.div_main {
width: 100%;
}
.div_search {
background: #ffffff;
border-radius: 4px;
padding: 35px 20px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.div_table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 20px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.div_btn {
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

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

@ -0,0 +1,553 @@
<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>

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

@ -0,0 +1,677 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="所属网格"
prop="gridId">
<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">
<el-input v-model="formData.unitName"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="服务事项"
prop="serviceMatter">
<el-select class="item_width_1"
v-model="formData.serviceMatter"
placeholder="请选择"
clearable>
<el-option v-for="item in scaleList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="分类"
prop="type">
<el-select class="item_width_1"
v-model="formData.type"
placeholder="请选择"
clearable>
<el-option v-for="item in placeTypeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</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-button style="margin-left:10px"
type="primary"
size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
type="yellow"
size="small"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button style="float:left"
type="green"
size="small"
@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"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="gridName"
header-align="center"
align="center"
label="所属网格"
width="180">
</el-table-column>
<el-table-column prop="unitName"
header-align="center"
align="center"
label="单位名称"
width="180">
</el-table-column>
<el-table-column prop="type"
header-align="center"
align="center"
label="分类"
width="180">
</el-table-column>
<el-table-column prop="serviceMatter"
header-align="center"
align="center"
label="服务事项"
width="180">
</el-table-column>
<el-table-column prop="contact"
header-align="center"
align="center"
label="联系人"
width="100">
</el-table-column>
<el-table-column prop="contactMobile"
header-align="center"
align="center"
label="联系电话"
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 label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate">
<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"
style="color:#00A7A9;text-decoration: underline;"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text"
style="color:#D51010;text-decoration: underline;"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="850px"
top="5vh"
@closed="diaClose">
<places-form ref="ref_form"
:gridList="gridList"
:scaleList="scaleList"
:placeTypeList="placeTypeList"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></places-form>
</el-dialog>
</div>
</template>
<script>
import placesForm from './placesForm'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
agencyId: '',
gridList: [],//list--
scaleList: [],//list
placeTypeList: [],//list
unitId: '',
formData: {
gridId: '',
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
},
tableData: [],
//form
formShow: false,
formTitle: '新增单位',
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
}
},
components: {
placesForm
},
async created () {
},
async mounted () {
//
await this.loadService()
//
await this.loadType()
const { user } = this.$store.state
this.agencyId = user.agencyId
//
await this.loadGrid()
await this.loadTable()
},
methods: {
handleSearch () {
this.loadTable()
},
async loadGrid () {
const url = "/gov/org/customergrid/gridoption"
let params = {
agencyId: this.agencyId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.gridList = data
} else {
this.$message.error(msg)
}
},
//
async loadService () {
// 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.scaleList = data
} else {
this.$message.error(msg)
}
},
//
async loadType () {
const url = "/sys/dict/data/dictlist"
let params = {
dictType: 'party_unit_type'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.placeTypeList = data
} else {
this.$message.error(msg)
}
},
async loadTable () {
this.tableLoading = true
// const url = "/heart/icpartyunit/list"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/list"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
agencyId: this.agencyId,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
handleDetail (row) {
this.formTitle = '详情'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.id)
})
},
handleAdd () {
this.formTitle = '新增'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id)
})
},
addFormCancle () {
this.formShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteUnit(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteUnit (row) {
// const url = "/heart/icpartyunit/delete"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/delete"
let params = {
id: row.id
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
resetSearch () {
this.formData = {
gridId: '',
unitName: '',
serviceMatter: '',
type: '',
contact: '',
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) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 460)
},
rowHeight () {
return (this.clientHeight - 200) + 'px'
},
...mapGetters(['clientHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss";
.div_main {
width: 100%;
}
.div_search {
background: #ffffff;
border-radius: 4px;
padding: 35px 20px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.div_table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 20px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.div_btn {
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

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

@ -0,0 +1,553 @@
<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>

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

@ -0,0 +1,694 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="所属网格"
prop="gridId">
<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">
<el-input v-model="formData.unitName"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="服务事项"
prop="serviceMatter">
<el-select class="item_width_1"
v-model="formData.serviceMatter"
placeholder="请选择"
clearable>
<el-option v-for="item in serviceList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="分类"
prop="type">
<el-select class="item_width_1"
v-model="formData.type"
placeholder="请选择"
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="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-button style="margin-left:10px"
type="primary"
size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
type="yellow"
size="small"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button style="float:left"
type="green"
size="small"
@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"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="gridName"
header-align="center"
align="center"
label="所属网格"
width="180">
</el-table-column>
<el-table-column prop="unitName"
header-align="center"
align="center"
label="单位名称"
width="180">
</el-table-column>
<el-table-column prop="type"
header-align="center"
align="center"
label="分类"
width="180">
</el-table-column>
<el-table-column prop="serviceMatter"
header-align="center"
align="center"
label="服务事项"
width="180">
</el-table-column>
<el-table-column prop="contact"
header-align="center"
align="center"
label="联系人"
width="100">
</el-table-column>
<el-table-column prop="contactMobile"
header-align="center"
align="center"
label="联系电话"
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 label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate">
<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"
style="color:#00A7A9;text-decoration: underline;"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text"
style="color:#D51010;text-decoration: underline;"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="850px"
top="5vh"
@closed="diaClose">
<units-form ref="ref_form"
:gridList="gridList"
:serviceList="serviceList"
:typeList="typeList"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></units-form>
</el-dialog>
</div>
</template>
<script>
import unitsForm from './unitsForm'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
agencyId: '',
gridList: [],//list
unitList: [],//list
serviceList: [
{
id: "1",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。'
},
{
id: "2",
name: '积极配合'
},
{
id: "3",
name: '积极配合社区安全巡查员进行'
},
{
id: "4",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。并具备安全意识及设备设施'
},
],//list
typeList: [],//list
unitId: '',
formData: {
gridId: '',
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
},
tableData: [],
//form
formShow: false,
formTitle: '新增单位',
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
}
},
components: {
unitsForm
},
async created () {
},
async mounted () {
//
await this.loadService()
//
await this.loadType()
const { user } = this.$store.state
this.agencyId = user.agencyId
//
await this.loadGrid()
await this.loadTable()
},
methods: {
handleSearch () {
this.loadTable()
},
async loadGrid () {
const url = "/gov/org/customergrid/gridoption"
let params = {
agencyId: this.agencyId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.gridList = data
} else {
this.$message.error(msg)
}
},
//
async loadService () {
// 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"
let params = {
dictType: 'party_unit_type'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.typeList = data
} else {
this.$message.error(msg)
}
},
async loadTable () {
this.tableLoading = true
// const url = "/heart/icpartyunit/list"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/list"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
agencyId: this.agencyId,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
handleDetail (row) {
this.formTitle = '详情'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.id)
})
},
handleAdd () {
this.formTitle = '新增'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id)
})
},
addFormCancle () {
this.formShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteUnit(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteUnit (row) {
// const url = "/heart/icpartyunit/delete"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/delete"
let params = {
id: row.id
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
resetSearch () {
this.formData = {
gridId: '',
unitName: '',
serviceMatter: '',
type: '',
contact: '',
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) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 460)
},
rowHeight () {
return (this.clientHeight - 200) + 'px'
},
...mapGetters(['clientHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss";
.div_main {
width: 100%;
}
.div_search {
background: #ffffff;
border-radius: 4px;
padding: 35px 20px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.div_table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 20px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.div_btn {
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

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

@ -0,0 +1,553 @@
<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