Browse Source

Merge branch 'dev-jichu' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-jichu

shibei_master
13176889840 4 years ago
parent
commit
289dac7d8b
  1. 8
      src/views/modules/base/resi.vue
  2. 752
      src/views/modules/communityService/shzz/cpts/edit.vue
  3. 289
      src/views/modules/communityService/shzz/index.vue
  4. 515
      src/views/modules/communityService/sqzzz/cpts/edit.vue
  5. 535
      src/views/modules/communityService/sqzzz/index.vue

8
src/views/modules/base/resi.vue

@ -372,10 +372,10 @@ export default {
this.$message.error('上传文件只能是xls/xlsx格式!') this.$message.error('上传文件只能是xls/xlsx格式!')
} }
// if (!isLt1M) { if (!isLt1M) {
// this.$message.error(' 10MB!') this.$message.error('上传文件大小不能超过 10MB!')
// } }
return fileType return fileType && isLt1M
}, },
uploadHttpRequest(file) { uploadHttpRequest(file) {
this.importLoading = true this.importLoading = true

752
src/views/modules/communityService/shzz/cpts/edit.vue

@ -1,506 +1,474 @@
<template> <template>
<div> <div>
<div> <div>
<div v-show="!propertyFormShow"> <el-form
<el-form ref="ref_form" ref="ref_form"
:inline="true" :inline="true"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
class="form"> class="form"
>
<el-form-item label="所属组织" <el-form-item
label-width="150px" label="社会组织名称 "
style="display: block"> prop="societyName"
<span>{{ dataForm.agencyName }}</span> label-width="150px"
</el-form-item> style="display: block"
<el-form-item label="所属网格" >
prop="gridId" <el-input
label-width="150px" class="item_width_1"
style="display: block"> maxlength="50"
<el-select class="item_width_1" show-word-limit
v-model="dataForm.gridId" placeholder="请输入社会组织名称 "
placeholder="请选择" v-model="dataForm.societyName"
clearable> >
<el-option v-for="item in gridList" </el-input>
:key="item.gridId" </el-form-item>
:label="item.gridName"
:value="item.gridId"> <el-form-item
</el-option> label="服务事项"
</el-select> prop="serviceMatters"
</el-form-item> label-width="150px"
style="display: block"
<el-form-item label="小区名称" >
prop="neighborHoodName" <el-input
label-width="150px" class="item_width_1"
style="display: block"> type="textarea"
<el-input class="item_width_1" maxlength="1000"
maxlength="50" show-word-limit
show-word-limit :rows="3"
placeholder="请输入小区名称" placeholder="请输入服务事项,不超过1000字"
v-model="dataForm.neighborHoodName"> v-model="dataForm.serviceMatters"
></el-input>
</el-form-item>
<el-form-item
label="负责人姓名 "
prop="personInCharge"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入负责人姓名 "
v-model="dataForm.personInCharge"
>
</el-input>
</el-form-item>
<el-form-item
label="负责人电话 "
prop="mobile"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入负责人电话 "
v-model="dataForm.mobile"
>
</el-input>
</el-form-item>
<el-form-item
label="服务时间 "
prop="serviceTime"
label-width="150px"
style="display: block"
>
<el-date-picker
v-model="dataForm.serviceTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<el-form-item
label="绑定管理员"
prop="adminStaffId"
label-width="150px"
style="display: block"
>
<el-select
class="item_width_1"
v-model="dataForm.adminStaffId"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="item in staffList"
:key="item.staffId"
:label="item.staffName"
:value="item.staffId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block"
>
<div style="width: 500px">
<el-input
class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="dataForm.address"
>
</el-input> </el-input>
</el-form-item> <el-button
<el-form-item label="关联物业" style="margin-left: 10px"
prop="propertyId" type="primary"
label-width="150px" size="small"
style="display: block"> @click="handleSearchMap"
<el-select class="item_width_2" >查询</el-button
v-model="dataForm.propertyId" >
placeholder="请选择" <div id="app" class="div_map"></div>
filterable <div style="margin-top: 10px">
clearable> <span>经度</span>
<el-option v-for="item in propertyList" <el-input
:key="item.propertyId" class="item_width_3"
:label="item.propertyName" maxlength="50"
:value="item.propertyId"> placeholder="请输入经度"
</el-option> v-model="dataForm.longitude"
</el-select> >
</el-input>
<el-button style="margin-left: 10px" <span style="margin-left: 20px">纬度</span>
type="primary" <el-input
size="small" class="item_width_3"
@click="handleAddProperty">添加物业</el-button> maxlength="50"
</el-form-item> placeholder="请输入纬度"
<el-form-item label="详细地址" v-model="dataForm.latitude"
prop="address" >
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入详细地址"
v-model="dataForm.address">
</el-input>
</el-form-item>
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:rows="3"
placeholder="请输入备注,不超过500字"
v-model="dataForm.remark"></el-input>
</el-form-item>
<el-form-item label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<el-input class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="keyWords">
</el-input> </el-input>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap">查询</el-button>
<div id="app"
class="div_map"></div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude">
</el-input>
</div>
</div> </div>
</el-form-item> </div>
</el-form> </el-form-item>
</div> </el-form>
<div v-show="propertyFormShow">
<el-form :inline="false"
:model="propertyForm"
:rules="propertyRule"
class="form">
<el-form-item label="物业名称"
prop="name"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="10"
placeholder="请输入小区名称"
v-model="propertyForm.name">
</el-input>
</el-form-item>
</el-form>
</div>
</div> </div>
<div class="div_btn"> <div class="div_btn">
<el-button @click="handleCancle"> </el-button> <el-button @click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'" <el-button
type="primary" v-if="formType != 'detail'"
:disabled="btnDisable" type="primary"
@click="handleComfirm"> </el-button> :disabled="btnDisable"
@click="handleComfirm"
> </el-button
>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' 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 map;
var markers var search;
var infoWindowList var markers;
let loading // var infoWindowList;
let loading; //
export default { export default {
data () { data() {
return { return {
formType: 'add', // addeditdetail formType: "add", // addeditdetail
agencyId: "",
staffList: [],
gridList: [],
propertyList: [],
btnDisable: false, btnDisable: false,
neighborHoodId: '', //ID societyId: "",
dataForm: { dataForm: {
neighborHoodName: '', // 50 societyName: "",
agencyId: '', // ID serviceMatters: "",
agencyName: '', personInCharge: "",
gridId: '', //ID mobile: "",
propertyId: '', // serviceStartTime: "",
address: '', // serviceEndTime: "",
remark: '', //500 serviceTime: ["", ""],
location: '', // adminStaffId: "",
longitude: '', // address: "",
latitude: '' // longitude: "",
}, latitude: "",
propertyFormShow: false,
propertyForm: {
name: ''
}, },
};
keyWords: '',
agencyObj: {}
}
}, },
components: {}, components: {},
mounted () { computed: {
this.initMap() dataRule() {
return {
societyName: [
{ required: true, message: "社会组织名称 不能为空", trigger: "blur" },
{
min: 1,
max: 50,
message: "社会组织名称 长度在 1 到 50个字符",
trigger: "blur",
},
],
serviceMatters: [
{ required: true, message: "服务事项不能为空", trigger: "blur" },
],
personInCharge: [
{ required: true, message: "负责人姓名不能为空", trigger: "blur" },
],
adminStaffId: [
{ required: true, message: "绑定管理员不能为空", trigger: "blur" },
],
mobile: [
{ required: true, message: "负责人电话不能为空", trigger: "blur" },
],
longitude: [
{ required: true, message: "位置坐标不能为空", trigger: "blur" },
],
};
},
},
props: {},
watch: {
"dataForm.serviceTime": function (val) {
if (Array.isArray(val) && val.length == 2) {
this.dataForm.serviceStartTime = val[0];
this.dataForm.serviceEndTime = val[1];
}
},
},
async mounted() {
this.initMap();
await this.loadAgency();
this.loadStaff();
}, },
methods: { methods: {
// init // init
initMap () { initMap() {
// //
var center = new window.TMap.LatLng(36.0722275, 120.38945519) var center = new window.TMap.LatLng(36.0722275, 120.38945519);
// map TMap.Map() // map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), { map = new window.TMap.Map(document.getElementById("app"), {
center: center, // center: center, //
zoom: 17.2, // zoom: 17.2, //
pitch: 43.5, // pitch: 43.5, //
rotation: 45 // rotation: 45, //
}) });
search = new window.TMap.service.Search({ pageSize: 10 }) search = new window.TMap.service.Search({ pageSize: 10 });
// //
markers = new TMap.MultiMarker({ markers = new TMap.MultiMarker({
map: map, map: map,
geometries: [] geometries: [],
}) });
infoWindowList = Array(10) infoWindowList = Array(10);
// //
map.on('panend', () => { map.on("panend", () => {
this.handleMoveCenter() this.handleMoveCenter();
}) });
this.handleMoveCenter() this.handleMoveCenter();
}, },
setMarker (lat, lng) { setMarker(lat, lng) {
markers.setGeometries([]) markers.setGeometries([]);
markers.add([ markers.add([
{ {
id: '4', id: "4",
styleId: 'marker', styleId: "marker",
position: new TMap.LatLng(lat, lng), position: new TMap.LatLng(lat, lng),
properties: { properties: {
title: 'marker4' title: "marker4",
} },
} },
]) ]);
}, },
handleSearchMap () { handleSearchMap() {
infoWindowList.forEach((infoWindow) => { infoWindowList.forEach((infoWindow) => {
infoWindow.close() infoWindow.close();
}) });
infoWindowList.length = 0 infoWindowList.length = 0;
markers.setGeometries([]) markers.setGeometries([]);
// //
search search
.searchRectangle({ .searchRectangle({
keyword: this.keyWords, keyword: this.dataForm.address,
bounds: map.getBounds() bounds: map.getBounds(),
}) })
.then((result) => { .then((result) => {
let { data } = result let { data } = result;
if (Array.isArray(data) && data.length > 0) { if (Array.isArray(data) && data.length > 0) {
const { const {
location: { lat, lng } location: { lat, lng },
} = data[0] } = data[0];
map.setCenter(new TMap.LatLng(lat, lng)) map.setCenter(new TMap.LatLng(lat, lng));
this.setMarker(lat, lng) this.setMarker(lat, lng);
this.dataForm.latitude = lat this.dataForm.latitude = lat;
this.dataForm.longitude = lng this.dataForm.longitude = lng;
} else { } else {
this.$message.error('未检索到相关位置坐标') this.$message.error("未检索到相关位置坐标");
} }
}) });
}, },
handleMoveCenter () { handleMoveCenter() {
// //
const center = map.getCenter() const center = map.getCenter();
const lat = center.getLat() const lat = center.getLat();
const lng = center.getLng() const lng = center.getLng();
this.dataForm.latitude = lat this.dataForm.latitude = lat;
this.dataForm.longitude = lng this.dataForm.longitude = lng;
this.setMarker(lat, lng) this.setMarker(lat, lng);
}, },
async initForm (type, row, agencyObj) { async initForm(type, row) {
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
// debugger
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
this.formType = type this.formType = type;
console.log(row);
if (row) { if (row) {
this.dataForm = { ...this.dataForm, ...row };
this.dataForm = JSON.parse(JSON.stringify(row)) this.societyId = this.dataForm.societyId;
this.neighborHoodId = this.dataForm.neighborHoodId map.setCenter(new TMap.LatLng(row.latitude, row.longitude));
} }
await this.loadAgency()
await this.loadGrid()
await this.loadProperty()
}, },
// //
async loadAgency () { async loadAgency() {
const url = '/epmetuser/customerstaff/staffbasicinfo' const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {} let params = {};
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.dataForm.agencyId = data.agencyId this.agencyId = data.agencyId;
this.dataForm.agencyName = data.agencyName
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
// //
async loadGrid () { async loadStaff() {
const url = '/gov/org/grid/allgridsnopermission ' const url = "/data/aggregator/org/stafflist";
// const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids"
let params = {
agencyId: this.dataForm.agencyId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) { let params = {
this.gridList = data orgId: this.agencyId,
} else { orgType: "agency",
this.$message.error(msg) pageNo: 1,
} pageSize: 100000,
}, };
//
async loadProperty () {
const url = '/gov/org/propertymanagement/list'
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/list"
let params = {}
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.propertyList = data this.staffList = data.staffList.map((item) => {
return {
staffId: item.staffId,
staffName: item.name + "(" + item.mobile + ")",
};
});
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
handleAddProperty () { async handleComfirm() {
this.propertyForm.name = '' this.btnDisable = true;
this.propertyFormShow = true setTimeout(() => {
}, this.btnDisable = false;
}, 10000);
async handleComfirm () { this.$refs["ref_form"].validate((valid, messageObj) => {
if (!valid) {
if (this.propertyFormShow) { app.util.validateRule(messageObj);
this.btnDisable = false;
this.addProperty() } else {
this.submit();
} else { }
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.addCommunity()
}
})
}
}, },
async addCommunity () {
let url = '' async submit() {
if (this.formType === 'add') { let url = "";
url = '/gov/org/neighborhood/neighborhoodadd' if (this.formType === "add") {
url = "/heart/societyorg/add";
// url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" // url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd"
} else { } else {
url = '/gov/org/neighborhood/neighborhoodupdate' url = "/heart/societyorg/edit";
this.dataForm.neighborHoodId = this.neighborHoodId this.dataForm.societyId = this.societyId;
} }
const { data, code, msg } = await requestPost(url, this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm);
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");
this.btnDisable = false this.btnDisable = false;
} else { } else {
this.btnDisable = false this.btnDisable = false;
this.$message.error(msg) this.$message.error(msg);
} }
}, },
async addProperty () {
if (!this.propertyForm.name || this.propertyForm.name === '') {
this.$message({
type: 'error',
message: '物业名称不能为空'
})
return false
}
const url = '/gov/org/propertymanagement/add'
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add"
let params = {
name: this.propertyForm.name
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) { handleCancle() {
this.$message({ this.resetData();
type: 'success', this.$emit("dialogCancle");
message: '操作成功'
})
this.dataForm.propertyId = data.propertyId
this.propertyForm.name = ''
this.propertyFormShow = false
this.loadProperty()
} else {
this.$message.error(msg)
}
},
handleCancle () {
if (this.propertyFormShow) {
this.propertyForm.name = ''
this.propertyFormShow = false
} else {
this.resetData()
this.$emit('dialogCancle')
}
}, },
resetData () { resetData() {
this.keyWords = '' this.societyId = ""; //ID
this.neighborHoodId = '' //ID
this.dataForm = { this.dataForm = {
neighborHoodName: '', // 50 societyName: "",
agencyId: '', // ID serviceMatters: "",
agencyName: '', personInCharge: "",
gridId: '', //ID mobile: "",
propertyId: '', // serviceStartTime: "",
address: '', // serviceEndTime: "",
remark: '', //500 serviceTime: ["", ""],
location: '', // adminStaffId: "",
longitude: '', // address: "",
latitude: '' // longitude: "",
} latitude: "",
this.propertyFormShow = false };
this.propertyFormShow = false;
}, },
// //
startLoading () { startLoading() {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: '正在加载……', // text: "正在加载……", //
background: 'rgba(0,0,0,.7)' // background: "rgba(0,0,0,.7)", //
}) });
}, },
// //
endLoading () { endLoading() {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close() loading.close();
}
}
},
computed: {
dataRule () {
return {
neighborHoodName: [
{ required: true, message: '小区名称不能为空', trigger: 'blur' },
{
min: 1,
max: 50,
message: '小区名称长度在 1 到 50个字符',
trigger: 'blur'
}
],
agencyId: [
{ required: true, message: '所属组织不能为空', trigger: 'blur' }
],
gridId: [
{ required: true, message: '所属网格不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' }
],
longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' }
]
} }
}, },
propertyRule () {
name: [
{ required: true, message: '物业名称不能为空', trigger: 'blur' }
// { min: 1, max: 50, message: ' 1 50', trigger: 'blur' }
]
}
}, },
props: {} };
}
</script> </script>
<style scoped> <style scoped>
.item_width_1 { .item_width_1 {
width: 500px; width: 500px;

289
src/views/modules/communityService/shzz/index.vue

@ -86,9 +86,24 @@
<el-button type="success" size="small" @click="handleAdd" <el-button type="success" size="small" @click="handleAdd"
>新增</el-button >新增</el-button
> >
<el-button @click="handleRu" type="warning" size="small" <el-upload
>excel导入</el-button ref="upload"
class="upload-btn"
action="uploadUlr"
:limit="1"
:with-credentials="true"
:show-file-list="false"
:auto-upload="true"
:on-progress="handleProgress"
:on-success="handleExcelSuccess"
:before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest"
> >
<el-button type="warning" size="small" :loading="importLoading">{{
importBtnTitle
}}</el-button>
</el-upload>
<el-button @click="handleChu" type="danger" size="small" <el-button @click="handleChu" type="danger" size="small"
>excel导出</el-button >excel导出</el-button
> >
@ -112,14 +127,14 @@
<el-table-column fixed="right" label="操作" align="center" width="120"> <el-table-column fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@click="handleWatch(scope.row, scope.$index)" @click="handleWatch(scope.$index)"
type="text" type="text"
size="small" size="small"
>查看</el-button >查看</el-button
> >
<el-button <el-button
@click="handleEdit(scope.row)" @click="handleEdit(scope.$index)"
type="text" type="text"
size="small" size="small"
style="margin-right: 10px; color: #00a7a9" style="margin-right: 10px; color: #00a7a9"
@ -167,7 +182,7 @@
@closed="handleClose" @closed="handleClose"
> >
<edit-form <edit-form
ref="ref_form" ref="eleEditForm"
@dialogCancle="handleClose" @dialogCancle="handleClose"
@dialogOk="handleEditSuccess" @dialogOk="handleEditSuccess"
></edit-form> ></edit-form>
@ -180,6 +195,7 @@ import { requestPost } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import editForm from "./cpts/edit"; import editForm from "./cpts/edit";
import axios from "axios";
export default { export default {
components: { editForm }, components: { editForm },
@ -195,127 +211,7 @@ export default {
pageSize: window.localStorage.getItem("pageSize") || 20, pageSize: window.localStorage.getItem("pageSize") || 20,
total: 1, total: 1,
tableData: [ tableData: [],
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
{
societyName: "亿联科技",
personInCharge: "嘻嘻",
serviceMatters: "1111111111111",
mobile: "13512345678",
serviceTime: "2001-1-1至2022-2-2",
},
],
fmData: { fmData: {
societyName: "", societyName: "",
@ -325,6 +221,9 @@ export default {
serviceEndTime: "", serviceEndTime: "",
serviceTime: "", serviceTime: "",
}, },
importBtnTitle: "excel导入",
importLoading: false,
}; };
}, },
computed: { computed: {
@ -338,6 +237,9 @@ export default {
if (Array.isArray(val) && val.length == 2) { if (Array.isArray(val) && val.length == 2) {
this.fmData.serviceStartTime = val[0]; this.fmData.serviceStartTime = val[0];
this.fmData.serviceEndTime = val[1]; this.fmData.serviceEndTime = val[1];
} else {
this.fmData.serviceStartTime = "";
this.fmData.serviceEndTime = "";
} }
}, },
}, },
@ -345,6 +247,71 @@ export default {
this.getTableData(); this.getTableData();
}, },
methods: { methods: {
//
handleExcelSuccess(res, file) {
if (res.code === 0 && res.msg === "success") {
console.log("resss---ppp", res);
} else {
this.$message.error(res.msg);
}
},
handleProgress(event, file, fileList) {
console.log("percentage", file.percentage);
},
beforeExcelUpload(file) {
console.log("file", file);
const isType = file.type === "application/vnd.ms-excel";
const isTypeComputer =
file.type ===
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
const fileType = isType || isTypeComputer;
const isLt1M = file.size / 1024 / 1024 < 10;
if (!fileType) {
this.$message.error("上传文件只能是xls/xlsx格式!");
}
if (!isLt1M) {
this.$message.error("上传文件大小不能超过 10MB!");
}
return fileType && isLt1M;
},
uploadHttpRequest(file) {
this.importLoading = true;
this.importBtnTitle = "正在上传中...";
const formData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); //
axios({
url: window.SITE_CONFIG["apiURL"] + "/heart/societyorg/import",
method: "post",
data: formData,
responseType: "blob",
})
.then((res) => {
this.importLoading = false;
this.importBtnTitle = "excel导入";
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
this.getTableData();
})
.catch((err) => {
console.log("失败", err);
param.onError(); //
});
},
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
this.pageSize = val; this.pageSize = val;
@ -366,17 +333,58 @@ export default {
this.getTableData(); this.getTableData();
}, },
handleAdd() { async handleAdd() {
this.formShow = true; this.formShow = true;
await nextTick();
console.log(this.$refs);
this.$refs.eleEditForm.initForm("add");
}, },
handleRu() {},
handleChu() {}, async handleChu() {
handleWatch(rowData, rowIndex) { const url = "/heart/societyorg/export";
console.log(rowData, rowIndex); const { pageSize, pageNo, fmData } = this;
axios({
url: window.SITE_CONFIG["apiURL"] + url,
method: "post",
data: {
pageSize,
pageNo,
...fmData,
},
responseType: "blob",
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
})
.catch((err) => {
console.log("获取导出情失败", err);
return this.$message.error("网络错误");
});
},
async handleWatch(rowIndex) {
this.formShow = true; this.formShow = true;
await nextTick();
this.$refs.eleEditForm.initForm("detail", this.tableData[rowIndex]);
}, },
handleEdit(rowData, rowIndex) {
async handleEdit(rowIndex) {
this.formShow = true; this.formShow = true;
await nextTick();
this.$refs.eleEditForm.initForm("edit", this.tableData[rowIndex]);
}, },
handleEditSuccess() { handleEditSuccess() {
this.handleClose(); this.handleClose();
@ -410,11 +418,14 @@ export default {
}); });
if (code === 0) { if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!"); console.log("列表请求成功!!!!!!!!!!!!!!");
this.total = data.total; this.total = data.total || 0;
this.tableData = data.list.map((item) => { this.tableData = data.list
item.serviceTime = item.serviceStartTime + "至" + item.serviceEndTime; ? data.list.map((item) => {
return item; item.serviceTime =
}); item.serviceStartTime + "至" + item.serviceEndTime;
return item;
})
: [];
} else { } else {
} }
}, },
@ -452,6 +463,10 @@ export default {
} }
.resi-row-btn { .resi-row-btn {
margin-bottom: 13px; margin-bottom: 13px;
.upload-btn {
display: inline-block;
margin: 0 10px;
}
} }
.resi-other { .resi-other {
width: 100%; width: 100%;

515
src/views/modules/communityService/sqzzz/cpts/edit.vue

@ -0,0 +1,515 @@
<template>
<div>
<div>
<el-form
ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form"
>
<el-form-item
label="组织名称 "
prop="organizationName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入组织名称 "
v-model="dataForm.organizationName"
>
</el-input>
</el-form-item>
<el-form-item
label="组织人数 "
prop="organizationPersonCount"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="number"
maxlength="50"
show-word-limit
placeholder="请输入组织人数 "
v-model="dataForm.organizationPersonCount"
>
</el-input>
</el-form-item>
<el-form-item
label="组织成员 "
prop="organizationPersonnel"
label-width="150px"
style="display: block"
>
<div class="m-staffs">
<div
class="item"
:key="'staff' + index"
v-for="(item, index) in dataForm.organizationPersonnel"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="成员姓名"
v-model="item.personName"
/>
<el-input
style="margin-left: 10px"
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="联系电话"
v-model="item.personPhone"
/>
<el-button
style="margin-left: 10px"
size="small"
@click="handleDelStaff(index)"
>删除</el-button
>
</div>
<div class="item-add">
<el-button size="small" @click="handleAddStaff">添加</el-button>
</div>
</div>
</el-form-item>
<el-form-item
label="服务事项"
prop="serviceItem"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:rows="3"
placeholder="请输入服务事项,不超过1000字"
v-model="dataForm.serviceItem"
></el-input>
</el-form-item>
<el-form-item
label="负责人 "
prop="principalName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入负责人 "
v-model="dataForm.principalName"
>
</el-input>
</el-form-item>
<el-form-item
label="联系电话 "
prop="principalPhone"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入联系电话 "
v-model="dataForm.principalPhone"
>
</el-input>
</el-form-item>
<el-form-item
label="创建时间 "
prop="organizationCreatedTime"
label-width="150px"
style="display: block"
>
<el-date-picker
v-model="dataForm.organizationCreatedTime"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<el-form-item
label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block"
>
<div style="width: 500px">
<el-input
class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="dataForm.address"
>
</el-input>
<el-button
style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap"
>查询</el-button
>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude"
>
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude"
>
</el-input>
</div>
</div>
</el-form-item>
</el-form>
</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;
let loading; //
export default {
data() {
return {
formType: "add", // addeditdetail
btnDisable: false,
orgId: "",
dataForm: {
organizationName: "",
serviceItem: "",
organizationPersonCount: "",
principalName: "",
principalPhone: "",
organizationCreatedTime: "",
address: "",
longitude: "",
latitude: "",
organizationPersonnel: [],
},
};
},
components: {},
computed: {
dataRule() {
return {
organizationName: [
{ required: true, message: "组织名称 不能为空", trigger: "blur" },
{
min: 1,
max: 50,
message: "组织名称 长度在 1 到 50个字符",
trigger: "blur",
},
],
organizationPersonCount: [
{ required: true, message: "组织人数不能为空", trigger: "blur" },
],
serviceItem: [
{ required: true, message: "服务事项不能为空", trigger: "blur" },
],
principalName: [
{ required: true, message: "负责人不能为空", trigger: "blur" },
],
principalPhone: [
{ required: true, message: "联系电话不能为空", trigger: "blur" },
],
longitude: [
{ required: true, message: "位置坐标不能为空", trigger: "blur" },
],
};
},
},
props: {},
watch: {},
async mounted() {
this.initMap();
},
methods: {
handleAddStaff() {
this.dataForm.organizationPersonnel = [
...this.dataForm.organizationPersonnel,
{ personName: "", personPhone: "" },
];
},
handleDelStaff(index) {
const { organizationPersonnel } = this.dataForm;
organizationPersonnel.splice(index, 1);
this.dataForm.organizationPersonnel = organizationPersonnel;
},
// 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);
//
map.on("panend", () => {
this.handleMoveCenter();
});
this.handleMoveCenter();
},
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.dataForm.address,
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.dataForm.latitude = lat;
this.dataForm.longitude = lng;
} else {
this.$message.error("未检索到相关位置坐标");
}
});
},
handleMoveCenter() {
//
const center = map.getCenter();
const lat = center.getLat();
const lng = center.getLng();
this.dataForm.latitude = lat;
this.dataForm.longitude = lng;
this.setMarker(lat, lng);
},
async initForm(type, row) {
this.$refs.ref_form.resetFields();
this.formType = type;
console.log(row);
if (row) {
this.dataForm = { ...this.dataForm, ...row };
this.orgId = this.dataForm.orgId;
map.setCenter(new TMap.LatLng(row.latitude, row.longitude));
}
},
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.submit();
}
});
},
async submit() {
let url = "";
if (this.formType === "add") {
url = "/heart/iccommunityselforganization/addcommunityselforganization";
// url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd"
} else {
url =
"/heart/iccommunityselforganization/editcommunityselforganization";
this.dataForm.orgId = this.orgId;
}
const { data, code, msg } = await requestPost(url, this.dataForm);
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.orgId = "";
this.dataForm = {
organizationName: "",
serviceItem: "",
organizationPersonCount: "",
principalName: "",
principalPhone: "",
organizationCreatedTime: "",
address: "",
longitude: "",
latitude: "",
organizationPersonnel: [],
};
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
};
</script>
<style lang="scss" 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 {
margin-top: 10px;
}
.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;
}
.m-staffs {
width: 468px;
.item {
display: flex;
justify-content: space-around;
margin-bottom: 7px;
}
.item-add {
}
}
</style>
<style>
.el-dialog__body {
padding: 0 10px 20px !important;
}
</style>

535
src/views/modules/communityService/sqzzz/index.vue

@ -0,0 +1,535 @@
<template>
<div>
<div class="resi-container">
<el-card class="resi-card">
<el-row class="resi-row-box" :class="openSearch && 'resi-row-more'">
<el-row class="resi-row" :gutter="20">
<el-col :span="8">
<div class="resi-cell">
<div class="resi-cell-label">组织名称</div>
<div class="resi-cell-value" :class="'resi-cell-value-radio'">
<el-input
v-model="fmData.organizationName"
class="resi-cell-input"
size="small"
clearable
placeholder="请输入"
>
</el-input>
</div>
</div>
</el-col>
<el-col :span="16">
<div class="resi-cell">
<div class="resi-cell-label">创建时间</div>
<div class="resi-cell-value" :class="'resi-cell-value-radio'">
<el-date-picker
v-model="fmData.createTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
</div>
</el-col>
</el-row>
</el-row>
<el-row class="resi-search">
<el-col :span="24">
<el-button type="primary" size="small" @click="handleSearch"
>查询</el-button
>
</el-col>
</el-row>
</el-card>
</div>
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button type="success" size="small" @click="handleAdd"
>新增</el-button
>
<el-upload
ref="upload"
class="upload-btn"
action="uploadUlr"
:limit="1"
:with-credentials="true"
:show-file-list="false"
:auto-upload="true"
:on-progress="handleProgress"
:on-success="handleExcelSuccess"
:before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest"
>
<el-button type="warning" size="small" :loading="importLoading">{{
importBtnTitle
}}</el-button>
</el-upload>
<el-button @click="handleChu" type="danger" size="small"
>excel导出</el-button
>
</div>
<el-table
:data="tableData"
border
style="width: 100%"
class="resi-table"
:max-height="maxTableHeight"
>
<el-table-column label="序号" type="index" align="center" width="50" />
<el-table-column prop="organizationName" label="组织名称">
</el-table-column>
<el-table-column prop="organizationPersonCount" label="组织人数">
</el-table-column>
<el-table-column prop="serviceItem" label="服务事项"> </el-table-column>
<el-table-column prop="principalName" label="负责人"> </el-table-column>
<el-table-column prop="principalPhone" label="联系电话">
</el-table-column>
<el-table-column prop="organizationCreatedTime" label="创建时间">
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button
@click="handleWatch(scope.$index)"
type="text"
size="small"
>查看</el-button
>
<el-button
@click="handleEdit(scope.$index)"
type="text"
size="small"
style="margin-right: 10px; color: #00a7a9"
>编辑</el-button
>
<el-popconfirm
title="删除之后无法回复,确认删除?"
@onConfirm="handleDel(scope.row, scope.$index)"
@confirm="handleDel(scope.row, scope.$index)"
>
<el-button
slot="reference"
type="text"
size="small"
style="color: #d51010"
>删除</el-button
>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next"
:total="total"
>
</el-pagination>
</div>
</el-card>
<!-- 修改弹出框 -->
<el-dialog
:visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="850px"
top="5vh"
@closed="handleClose"
>
<edit-form
ref="eleEditForm"
@dialogCancle="handleClose"
@dialogOk="handleEditSuccess"
></edit-form>
</el-dialog>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex";
import editForm from "./cpts/edit";
import axios from "axios";
export default {
components: { editForm },
data() {
return {
openSearch: false,
formShow: false,
formTitle: "",
formShow: false,
pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
total: 1,
tableData: [],
fmData: {
organizationName: "",
startDate: "",
endDate: "",
createTime: ["", ""],
},
importBtnTitle: "excel导入",
importLoading: false,
};
},
computed: {
maxTableHeight() {
return this.clientHeight - 410;
},
...mapGetters(["clientHeight"]),
},
watch: {
"fmData.createTime": function (val) {
if (Array.isArray(val) && val.length == 2) {
this.fmData.startDate = val[0];
this.fmData.endDate = val[1];
} else {
this.fmData.startDate = "";
this.fmData.endDate = "";
}
},
},
mounted() {
this.getTableData();
},
methods: {
//
handleExcelSuccess(res, file) {
if (res.code === 0 && res.msg === "success") {
console.log("resss---ppp", res);
} else {
this.$message.error(res.msg);
}
},
handleProgress(event, file, fileList) {
console.log("percentage", file.percentage);
},
beforeExcelUpload(file) {
console.log("file", file);
const isType = file.type === "application/vnd.ms-excel";
const isTypeComputer =
file.type ===
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
const fileType = isType || isTypeComputer;
const isLt1M = file.size / 1024 / 1024 < 10;
if (!fileType) {
this.$message.error("上传文件只能是xls/xlsx格式!");
}
if (!isLt1M) {
this.$message.error("上传文件大小不能超过 10MB!");
}
return fileType && isLt1M;
},
uploadHttpRequest(file) {
this.importLoading = true;
this.importBtnTitle = "正在上传中...";
const formData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); //
axios({
url:
window.SITE_CONFIG["apiURL"] +
"/heart/iccommunityselforganization/importcommunityselforganization",
method: "post",
data: formData,
responseType: "blob",
})
.then((res) => {
this.importLoading = false;
this.importBtnTitle = "excel导入";
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
this.getTableData();
})
.catch((err) => {
console.log("失败", err);
param.onError(); //
});
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.pageSize = val;
window.localStorage.setItem("pageSize", val);
this.getTableData();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.pageNo = val;
this.getTableData();
},
handleClose() {
this.formShow = false;
},
handleSearch(val) {
console.log(this.fmData);
this.pageNo = 1;
this.getTableData();
},
async handleAdd() {
this.formShow = true;
await nextTick();
console.log(this.$refs);
this.$refs.eleEditForm.initForm("add");
},
async handleChu() {
const url =
"/heart/iccommunityselforganization/exportcommunityselforganization";
const { pageSize, pageNo, fmData } = this;
axios({
url: window.SITE_CONFIG["apiURL"] + url,
method: "post",
data: {
pageSize,
pageNo,
...fmData,
},
responseType: "blob",
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
})
.catch((err) => {
console.log("获取导出情失败", err);
return this.$message.error("网络错误");
});
},
async handleWatch(rowIndex) {
this.formShow = true;
await nextTick();
this.$refs.eleEditForm.initForm("detail", this.tableData[rowIndex]);
},
async handleEdit(rowIndex) {
this.formShow = true;
await nextTick();
this.$refs.eleEditForm.initForm("edit", this.tableData[rowIndex]);
},
handleEditSuccess() {
this.handleClose();
this.getTableData();
},
async handleDel(rowData, rowIndex) {
console.log(rowData, rowIndex);
const url =
"/heart/iccommunityselforganization/delcommunityselforganization";
const { tableData } = this;
const { data, code, msg } = await requestPost(url, {
orgId: tableData[rowIndex].orgId,
});
if (code === 0) {
this.$message.success("删除成功!");
this.getTableData();
} else {
this.$message.success("操作失败!");
}
},
async getTableData() {
const url =
"/heart/iccommunityselforganization/communityselforganizationlist";
const { pageSize, pageNo, fmData } = this;
const { data, code, msg } = await requestPost(url, {
pageSize,
pageNo,
...fmData,
});
if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!");
this.total = data.total || 0;
this.tableData = data.list
? data.list.map((item) => {
return item;
})
: [];
} else {
}
},
},
};
</script>
<style lang="scss" scoped>
.tabs-other-info {
.el-tabs__item {
// width: 50px;
height: 20px;
box-sizing: border-box;
margin-right: 7px;
padding: 0 10px !important;
font-size: 8px;
font-weight: 500;
color: #666666;
line-height: 20px;
background: #ebecf1;
border-radius: 2px;
}
.el-tabs__nav-wrap::after,
.el-tabs__active-bar {
display: none;
}
.el-tabs__nav-next,
.el-tabs__nav-prev {
line-height: 20px;
}
}
.resi-card-table {
margin-top: 20px;
}
.resi-row-btn {
margin-bottom: 13px;
.upload-btn {
display: inline-block;
margin: 0 10px;
}
}
.resi-other {
width: 100%;
display: flex;
.resi-other-title {
width: 100px;
box-sizing: border-box;
margin-bottom: 10px;
// padding: 6px 12px 0 0;
font-size: 16px;
font-weight: 500;
color: #333;
text-align: center;
}
.tabs-other-info {
// padding-left: 60px;
}
}
.resi-btns {
margin-top: 20px;
text-align: center;
}
.resi-container .resi-card {
position: relative;
overflow: visible;
}
.resi-down {
position: absolute;
left: 50%;
bottom: -10px;
display: flex;
justify-content: center;
align-items: center;
width: 46px;
height: 12px;
box-sizing: border-box;
margin-left: -23rpx;
cursor: pointer;
background: #ffffff;
border-radius: 0 0 10px 10px;
img {
display: block;
}
}
.resi-row-box {
// height: 104px;
overflow: hidden;
transition: height 0.5s;
}
.resi-row-more {
height: max-content;
transition: height 0.5s;
}
.resi-row {
margin-bottom: 20px;
}
.resi-search {
.el-col {
text-align: right;
}
}
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-value-radio {
display: flex;
align-items: center;
min-height: 32px;
}
.resi-cell-input {
width: 180px;
}
.resi-cell-select {
width: 180px;
box-sizing: border-box;
margin-right: 10px;
&-middle {
width: 130px;
}
&-small {
width: 88px;
}
}
.resi-cell-select:last-child {
margin-right: 0;
}
}
</style>
Loading…
Cancel
Save