Browse Source

志愿组织

feature
是小王呀\24601 1 year ago
parent
commit
f1e6541f7b
  1. 237
      src/views/modules/volunteer/VoluntaryOrganization/MemberManagement.vue
  2. 848
      src/views/modules/volunteer/VoluntaryOrganization/add.vue
  3. 853
      src/views/modules/volunteer/VoluntaryOrganization/edit.vue
  4. 677
      src/views/modules/volunteer/VoluntaryOrganization/index.vue
  5. 847
      src/views/modules/volunteer/VoluntaryOrganization/info.vue
  6. 136
      src/views/modules/volunteer/VoluntaryOrganization/process.vue
  7. 2
      src/views/modules/volunteer/activityArchive/add.vue
  8. 2
      src/views/modules/volunteer/activityArchive/select.vue

237
src/views/modules/volunteer/VoluntaryOrganization/MemberManagement.vue

@ -0,0 +1,237 @@
<template>
<div class="g-main" style="padding: 30px;">
<el-form :inline="true" :model="formData" class="demo-form-inline" style="">
<el-form-item label="姓名">
<el-input v-model.trim="formData.name" size="small" class="item_width_1" clearable
placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item label="加入时间" label-width="100px">
<el-date-picker v-model="formData.createdTimeFrom" type="datetime" placeholder="开始时间"
format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
<span style="margin: 0 10px;"></span>
<el-date-picker v-model="formData.createdTimeTo" type="datetime" placeholder="结束时间"
format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" @change="actcontrolTime">
</el-date-picker>
</el-form-item>
</el-form>
<div style="display: flex; justify-content: flex-end; margin-bottom: 10px;">
<el-button type="primary" @click="handleSearch">查询</el-button>
</div>
<div >
<el-table :data="tableData" border height="250" >
<el-table-column label="序号" width="80" header-align="center" align="center" type="index"></el-table-column>
<el-table-column prop="pointsClassName" header-align="center" align="center" label="加入时间">
</el-table-column>
<el-table-column prop="createdTime" header-align="center" align="center" label="所属社区">
</el-table-column>
. <el-table-column prop="operationName" header-align="center" align="center" label="姓名">
</el-table-column>
<el-table-column prop="pointsDelta" header-align="center" align="center" label="身份证号">
</el-table-column>
<el-table-column prop="pointsDelta" header-align="center" align="center" label="手机号">
</el-table-column>
<el-table-column prop="pointsDelta" header-align="center" align="center" label="活动次数">
</el-table-column>
<el-table-column prop="pointsDelta" header-align="center" align="center" label="服务时常">
</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>
<div class="flex flex-center1 flex-center2">
<el-button type="info" @click="handleremove">取消</el-button>
<el-button type="danger" @click="handleSubmit">确定</el-button>
</div>
<div>
</div>
</div>
</template>
<script>
import { requestPost,requestGet } from "@/js/dai/request";
export default {
name: "see",
data() {
return {
formData:{
createdTimeTo:"",
createdTimeTo:"",
pointsClass:"",
optionsStatus: [
{
code:1,
name:"活动积分"
},
{
code:2,
name:"平台积分"
},
{
code:3,
name:"操作积分"
},
],
},
labelPosition: 'right',
tableData: [],
integralnum: 1,
radio:3,
textarea: '',
options: [],
behaviorName: '',
description:"",
pointsDelta:"",
Positive:'',
pageSize: 10,
pageNo: 1,
total: 0,
};
},
props:{
list:{
type: Object,
default: () => {}
}
},
created() {
console.log(this.list,"list");
this.getlist()
this.getpoint1s()
},
computed:{
},
methods: {
//
actcontrolTime(){
console.log("dislfj");
if(this.formData.createdTimeFrom>this.formData.createdTimeTo){
this.$message.error('活动结束时间不能在活动开始时间之前');
this.formData.createdTimeTo=''
return
}
},
//
handleSearch(val) {
this.pageNo = 1;
this.getlist();
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.pageSize = val;
window.localStorage.setItem("pageSize", val);
this.getlist();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.pageNo = val;
this.getlist();
},
//+-
handleRadioChange(val){
console.log(val);
this.Positive = val === 3 ? '+' : val === 6 ? '-' : '';
console.log(this.Positive);
},
//
async getpoint1s() {
const url = "/voluntary/points/adjustVolunteerPoints/reasonsList";
let params={
}
await requestGet(url,params).then((res)=>{
if (res.code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!");
this.optionsStatus = res.data
console.log(this.optionsStatus);
} else {
}
})
},
//
// async getTableData() {
// const url = "/voluntary/points/adjustVolunteerPoints/commit";
// let params={
// volunteerId:this.list.id,
// reason:this.behaviorName,
// description:this.description,
// pointsDelta:this.Positive+this.integralnum,
// primaryPoints:this.tableData.points
// // volunteerId:this.list.id,
// // mobile:this.formData.phone,
// // name:this.formData.name
// }
// console.log(params,"params");
// const { data, code, msg } = await requestPost(url,params);
// if (code === 0) {
// console.log("");
// this.$message({
// message: "",
// type: "success",
// });
// this.$emit('summDetailClose')
// } else {
// }
// },
async getlist() {
const url = "/voluntary/points/listPointsChangeRecord";
let params={
volunteerId:this.list.id,
createdTimeFrom:this.formData.createdTimeFrom,
createdTimeTo:this.formData.createdTimeTo,
// description:this.description,
pointsClass:this.formData.pointsClass,
pageNo:this.pageNo,
pageSize:this.pageSize,
// pointsDelta:this.Positive+this.integralnum,
// primaryPoints:this.tableData.points
// volunteerId:this.list.id,
// mobile:this.formData.phone,
// name:this.formData.name
}
console.log(params,"params");
const { data, code, msg } = await requestGet(url,params);
if (code === 0) {
this.tableData=data.list
this.total=data.total
console.log("列表请求成功!!!!!!!!!!!!!!");
// console.log("");
// this.$message({
// message: "",
// type: "success",
// });
// this.$emit('summDetailClose')
} else {
}
},
handleSubmit(){
this.$emit('MemberManagementClose')
},
handleremove(){
this.$emit('MemberManagementClose')
},
handleadjustment(value) {
console.log(value,"num");
},
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/volunteet.scss";
</style>

848
src/views/modules/volunteer/VoluntaryOrganization/add.vue

@ -0,0 +1,848 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form" :inline="true" :model="formData" :rules="dataRule"
class="form">
<el-row>
<el-col :span="12">
<el-form-item label="所属组织" prop="agencyName" label-width="150px">
<el-input v-model.trim="formData.agencyName" size="small" clearable placeholder="请输入活动名称" :disabled="true"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织名称" prop="OrganizationName" label-width="150px">
<el-input v-model.trim="formData.OrganizationName" size="small" clearable placeholder="请输入活动名称"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="服务类型" label-width="150px" prop="Servicetype">
<el-select multiple-limit='4' class="u-item-width-normal" v-model.trim="formData.Servicetype" placeholder="请选择" clearable multiple>
<el-option v-for="item in ServicetypeList" :key="item.Servicetypeust" :label="item.typeName" :value="item.id" >
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织类型" label-width="150px" prop="Organizationaltype">
<el-select class="u-item-width-normal" v-model.trim="formData.Organizationaltype" placeholder="请选择" clearable >
<el-option v-for="item in OrganizationaltypeList" :key="item.typeName" :label="item.typeName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动地点" prop="address" label-width="150px" style="display: block">
<div style="width: 634px">
<el-select v-model.trim="searchValue" filterable style="width: 634px" remote :reserve-keyword="true"
placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading">
<el-option v-for="(item, index) in searchOptions" @click.native="handleClickKey(index)"
:key="item.value || index" :label="item.label" :value="item.value">
</el-option>
</el-select>
<div id="app_activity" class="div_map"></div>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管理员姓名" prop="AdministratorName" label-width="150px">
<el-input v-model.trim="formData.AdministratorName" size="small" clearable placeholder="请输入管理员姓名"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号" prop="Administratorphone" label-width="150px">
<el-input v-model.trim="formData.Administratorphone" size="small" clearable placeholder="请输入手机号"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="身份证号" prop="AdministratorIDCard" label-width="150px">
<el-input v-model.trim="formData.AdministratorIDCard" size="small" clearable placeholder="请输入身份证号"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织封面图" label-width="150px" prop="fileList">
<template>
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image>
</template>
</el-form-item>
</el-col>
<el-form-item label="组织介绍" prop="Organizational" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type="textarea" autosize placeholder="请填写组织介绍" v-model.trim="formData.Organizational" :autosize="{ minRows:4., maxRows: 10}" >
</el-input>
</div>
</el-form-item>
<el-form-item label="志愿品牌" prop="Volunteerbrand" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type="textarea" autosize placeholder="请输入内容" v-model.trim="formData.Volunteerbrand" :autosize="{ minRows:4., maxRows: 10}" >
</el-input>
</div>
</el-form-item>
<el-form-item label="品牌展示图" label-width="150px" prop="VolunteerPic">
<template>
<upload-image :defaultFileList="formData.VolunteerPic" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image>
</template>
</el-form-item>
</el-row></el-form>
</div>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" 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'
import Tinymce from '@c/tinymce2/index.vue'
import daiMap from "@/utils/dai-map";
import util from '@js/util.js';
// import UploadImage from './upload-image.vue'
import UploadImage from '@/views/modules/plugins/rent/upload-image.vue'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data() {
return {
activityImgs: [],//
fileList:[],
searchValue:"",
ServicetypeList:[
{ label: "敬老爱老", value: 1 },
{ label: "助残帮困", value: 2 },
{ label: "扶贫帮困", value: 3 },
{ label: "环保绿化", value: 4 },
{ label: "文化教育", value: 5 },
{ label: "扶贫帮困", value: 6 },
{ label: "其他", value: 7 },
],
OrganizationaltypeList:[
{ label: "社区", value: 1 },
{ label: "企业", value: 2 },
{ label: "学校", value: 3 },
],
formData:
{
VolunteerPic:"",//
Volunteerbrand:"",//
Organizational:"",//
fileList: [],//
AdministratorIDCard:"",//
Administratorphone:"",//
AdministratorName:"",//
Organizationaltype:"",//
Servicetype:"",//
OrganizationName:"",//
agencyName:"",//
Servicetype:[],
id: "",
typeId: "",
activityName: "",//
status: 0,//
assistingParty: "",//
startTime: "",//
endTime: "",//
coverPic: "",//
content: "",//
address: "",//
online: 0,//
cutOffTime: "",//
points: 0,//
participants: 0,//
sendMessage: 0,//
sumUp: "",//
activityImgs: [],//
longitude: this.$store.state.user.longitude, //
latitude: this.$store.state.user.latitude,//
},
corganizerList: [],
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId'),
}
},
components: { Tinymce, UploadImage },
mounted() {
this.formData.agencyName=this.$store.state.user.agencyName
this.activityType()
this.listServerOrg()
},
methods: {
validateContent() {
// 使HTML
const textContent = this.stripHtml(this.formData.sumUp);
if (textContent.trim() === '') {
this.formData.sumUp = null;
}
},
stripHtml(html) {
const div = document.createElement('div');
div.innerHTML = html;
return div.textContent || div.innerText || '';
},
//
handleImgSuccess(res, file, fileList) {
if (res.code === 0 && res.msg === 'success') {
let format = file.name.split('.').pop();
let srcType = file.raw.type;
let type = 'file';
if (srcType.indexOf('image') != -1) {
type = 'image';
} else if (srcType.indexOf('video') != -1) {
type = 'video';
}
// this.formData.activityImgs.push({
// format,
// name: file.name,
// size: file.size,
// type,
// url: res.data.url
// });
// console.log('this.formData.activityImgs',res.data.url)
this.formData.activityImgs.push(res.data.url);
} else {
this.$message.error(res.msg);
}
},
//
handleImgRemove(file) {
console.log('handleImgRemove', file);
if (file.response) {
let index = this.formData.activityImgs.findIndex(item => item.url == file.response.data.url);
this.formData.activityImgs.splice(index, 1);
} else if (file.url) {
let index = this.formData.activityImgs.findIndex(item => item.url == file.url);
this.formData.activityImgs.splice(index, 1);
}
},
//
handleImgPreview(file) {
console.log(file);
window.open(file.url || file.response.data.url);
},
//
handleImgExceed() {
this.$message({
type: 'warning',
message: '文件数量最多不超过三个'
});
},
//
beforeImgUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 10;
const srcType = file.type;
const format = file.name.split('.').pop();
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!');
return false;
}
if (srcType.indexOf('image') == -1) {
this.$message.error('仅限图片格式');
return false;
}
return true;
},
async activityType() {
const url = "/actual/base/activityType/page"
let params = {
// agencyId: this.agencyId
pageSize: 20,
pageNo: 1,
typeName: "",
enabled: 1
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.typeList = data.list
} else {
this.$message.error(msg)
}
this.$nextTick(() => {
if (!map) {
this.initMap(this.formData.latitude, this.formData.longitude);
console.log("map", map,this.formData.latitude, this.formData.longitude)
} else {
map.setCenter(this.formData.latitude, this.formData.longitude);
map.setMarker(this.formData.latitude, this.formData.longitude);
console.log("mapmapmap", map)
}
})
},
handleOnlineRegistration(value) {
//
if (value) {
this.online = true;
this.formData.online = 1;
} else {
this.online = false;
this.formData.cutOffTime = ''
this.formData.online = 0;
}
},
// onChangeFileList(e) {
// if (e.length > 0) {
// let item = e[0];
// let ob = {
// fileType: '0',
// fileUrl: item.response.data.url
// };
// this.fileList = [ob];
// this.formData.coverPic = ob.fileUrl;
// }
// },
removedImg() {
this.formData.coverPic = ''
},
onChangeFileList(e) {
console.log(e, 'sssssb');
this.fileList = e.length > 0 ? e.map(item => ({
fileType: '0',
fileUrl: item.response.data.url
})) : []; // efileList
if (e.length > 0) {
this.formData.coverPic = e[0].response.data.url;
} else {
this.formData.coverPic = '';
}
},
onChangeImgs(e, rowIndex = 0) {
console.log('onChangeFileList', e)
if (e.length > 0) {
this.activityImgs = []
e.forEach(item => {
let ob = {
fileType: '0',
fileUrl: item.response.data.url
}
this.activityImgs.push(ob)
})
}
},
// onChangeImgs(e) {
// this.activityImgs = [];
// if (e.length > 0) {
// e.forEach(item => {
// let ob = {
// fileType: '0',
// fileUrl: item.response.data.url
// };
// this.activityImgs.push(ob);
// });
// console.log('this.activityImgs',this.activityImgs)
// }
// },
handleChange(value) {},
handleTimeChange(time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'time').split('-')
console.log(startTimeArray);
const endTimeArray = util.dateFormatter(time[1], 'time').split('-')
console.log(endTimeArray);
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2]
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2]
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.formData.startTime = ''
this.formData.endTime = ''
}
},
async initForm(type, activityId) {
this.startLoading()
this.formType = type
if (type === 'edit') {
if (activityId.activityImgs || activityId.sumUp) {
this.records = true
} else {
this.records = false
}
this.formData = activityId
this.timeRange = [this.formData.startTime, this.formData.endTime]
console.log(activityId,"activityId");
if (activityId.coverPic) {
let ob = {
fileType: '0',
fileUrl: activityId.coverPic
};
this.fileList = [ob];
this.formData.coverPic = ob.fileUrl;
if (this.formData.online == 1) {
this.online = true
}
}
} else if (type === 'records') {
this.records = true
} else if (type === 'summary') {
this.formData = activityId
this.formData.activityImgs = []
console.log("this.formData", this.formData)
this.records = true
this.summary = false
} else {
this.records = false
}
this.endLoading()
},
async getDemandOptions() {
this.$http
.post("/actual/base/serviceitem/listAllCategory")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log(res.data);
this.demandOptions = this.getFlagData(
this.getTreeData(res.data),
"usableFlag"
);
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
getFlagData(data, flag) {
if (!Array.isArray(data)) return [];
let arr1 = data.filter((item) => item[flag]);
let arr2 = arr1.map((item) => {
if (item.childCateList)
return { ...item, childCateList: this.getFlagData(item.childCateList, flag) };
else return item;
});
return arr2;
},
getTreeData(data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
if (item.childCateList) {
if (item.childCateList.length === 0)
_item = { ...item, childCateList: undefined };
else _item = { ...item, childCateList: this.getTreeData(item.childCateList) };
} else {
_item = { ...item };
}
return _item;
});
return arr;
},
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 loadFormData() {
const url = '/actual/base/icpartyactivity/detail'
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/detail'
let params = {
id: this.activityId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
let style_img = "style='width:50px;height:40px;' "
if (this.formData.content) {
// this.formData.content = this.formData.content.replace(/<img/g, "<img style='width:200px;height:120px;'")
// let array=this.formData.content.split('<img')
}
} else {
this.$message.error(msg)
}
},
async handleComfirm() {
if (!this.formData.agencyName) {
this.$message.error('请选择所属组织');
return;
}
if (!this.formData.Organizational) {
this.$message.error('请输入组织介绍');
return;
}
if (this.fileList.length === 0) {
this.$message.error('请上传封面图片');
return;
}
if (!this.formData.AdministratorIDCard) {
this.$message.error('请输入身份证信息');
return;
}
if (!this.formData.Administratorphone) {
this.$message.error('请输入管理员电话');
return;
}
if (!this.formData.AdministratorName) {
this.$message.error('请输入管理员姓名');
return;
}
if (!this.formData.Organizationaltype) {
this.$message.error('请输入组织类型');
return;
}
if (!this.formData.Servicetype) {
this.$message.error('请输入服务类型');
return;
}
if (!this.formData.OrganizationName) {
this.$message.error('请输入组织名称');
return;
}
console.log(this.formData,"this.formData");
this.addActivity()
},
async addActivity() {
if (this.formType === 'edit' || this.formType === 'summary') {
let url = '/actual/base/communityActivity/update'
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)
}
} else {
let url = '/actual/base/communityActivity/save'
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() {
console.log("sdlkfjklsdf ");
this.$emit('showAddClose')
},
// init
initMap(latitude, longitude) {
console.log(latitude, longitude,"564564568");
map = new daiMap(
document.getElementById("app_activity"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
/* map.on("dragend", (e) => {
this.handleMoveCenter(e);
});*/
map.on("click", (e) => {
this.handleMoveCenter(e);
});
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
async handleMoveCenter(e) {
//
// const { lat, lng } = map.getCenter();
const { lat, lng } = e.latLng;
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address;
this.searchValue=data.address
console.log(this.formData.address, this.formData.longitude, this.formData.latitude," this.formData.address ");
this.searchValue = data.address
this.searchOptions = []
// console.log('data,this.searchValue ', this.searchValue)
}
},
async remoteMethod(query) {
console.log(query, "sfsvsdv");
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = []
if (msg == "success" && data.resultList && data.resultList.length > 0) {
if (data.resultList && data.resultList.length > 0) {
this.resultList = data.resultList
console.log(this.resultList, "this.resultList");
this.searchOptions = this.resultList.map(item => {
return { value: `${item.id}`, label: `${item.address + item.title}` };
});
console.log(this.searchOptions, "this.searchOptions");
}
} else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
]
}
} else {
this.searchOptions = [];
}
},
handleClickKey(index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.searchValue = selPosition.address + selPosition.name
},
resetData() {
this.timeRange = []
this.fileList = []
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.activityId = ''
this.keyWords = ''
this.online = false
this.formType = ''
this.summary = true
this.formData = {
id: "",
typeId: "",
activityName: "",//
status: 0,//
assistingParty: "",//
startTime: "",//
endTime: "",//
coverPic: "",//
content: "",//
address: "",//
online: 0,//
cutOffTime: "",//
points: 0,//
participants: 0,//
sendMessage: 0,//
sumUp: "",//
activityImgs: [],//
longitude: this.$store.state.user.longitude, //
latitude: this.$store.state.user.latitude//
// longitude: null, //
// latitude: null//
}
map=""
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule() {
return {
OrganizationName: [
{ required: true, message: '组织名称不能为空', trigger: 'blur' }
],
Servicetype: [
{ required: true, message: '请选择服务类型', trigger: 'blur' }
],
Organizationaltype: [
{ required: true, message: '请选择组织类型', trigger: 'blur' }
],
AdministratorName: [
{ required: true, message: '请输入管理员姓名', trigger: 'blur' }
],
AdministratorIDCard: [
{ required: true, message: '身份证号不能为空不能为空', trigger: 'blur' },
{ pattern: /^(?:[1-9]\d{5}(18|19|20)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)|[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3})$/, message: '请输入正确的身份证号', trigger: 'blur' }
],
Administratorphone: [
{ required: true, message: '管理员电话不能为空不能为空', trigger: 'blur' },
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
],
fileList: [
{ required: true, message: '请上传组织封面图', trigger: 'blur' }
],
Organizational: [
{ required: true, message: '请填写组织介绍', trigger: 'blur' },
{ min:50, message: '请输入50字以上的介绍', trigger: 'blur'}
],
points: [
{ required: true, message: '请选择活动积分', trigger: 'blur' }
],
sumUp: [
{ required: true, message: '请输入活动总结', trigger: 'blur' }
],
activityImgs: [
{ required: true, message: '请选择活动照片', trigger: 'blur' }
]
}
},
},
props: {
},
destroyed () {
map = null
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.item_width_1 {
width: 634px;
/deep/.tox .tox-dialog {
z-index: 20000;
}
}
.u-item-width-normal{
width: 222px;
}
.tinymce_view {
::v-deep .tox .tox-dialog {
z-index: 2000000000;
}
}
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
>p {
margin: 0;
}
}
</style>

853
src/views/modules/volunteer/VoluntaryOrganization/edit.vue

@ -0,0 +1,853 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form" :inline="true" :model="formData" :rules="dataRule"
class="form">
<el-row>
<el-col :span="12">
<el-form-item label="所属组织" prop="agencyName" label-width="150px">
<el-input v-model.trim="formData.agencyName" size="small" clearable placeholder="请输入活动名称" :disabled="true"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织名称" prop="OrganizationName" label-width="150px">
<el-input v-model.trim="formData.OrganizationName" size="small" clearable placeholder="请输入活动名称"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="服务类型" label-width="150px" prop="Servicetype">
<el-select multiple-limit='4' class="u-item-width-normal" v-model.trim="formData.Servicetype" placeholder="请选择" clearable multiple>
<el-option v-for="item in ServicetypeList" :key="item.Servicetypeust" :label="item.typeName" :value="item.id" >
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织类型" label-width="150px" prop="Organizationaltype">
<el-select class="u-item-width-normal" v-model.trim="formData.Organizationaltype" placeholder="请选择" clearable >
<el-option v-for="item in OrganizationaltypeList" :key="item.typeName" :label="item.typeName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动地点" prop="address" label-width="150px" style="display: block">
<div style="width: 634px">
<el-select v-model.trim="searchValue" filterable style="width: 634px" remote :reserve-keyword="true"
placeholder="请输入关键词" :remote-method="remoteMethod" >
<el-option v-for="(item, index) in searchOptions" @click.native="handleClickKey(index)"
:key="item.value || index" :label="item.label" :value="item.value">
</el-option>
</el-select>
<div id="app_activity" class="div_map"></div>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管理员姓名" prop="AdministratorName" label-width="150px">
<el-input v-model.trim="formData.AdministratorName" size="small" clearable placeholder="请输入管理员姓名"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号" prop="Administratorphone" label-width="150px">
<el-input v-model.trim="formData.Administratorphone" size="small" clearable placeholder="请输入手机号"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="身份证号" prop="AdministratorIDCard" label-width="150px">
<el-input v-model.trim="formData.AdministratorIDCard" size="small" clearable placeholder="请输入身份证号"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织封面图" label-width="150px" prop="fileList">
<template>
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image>
</template>
</el-form-item>
</el-col>
<el-form-item label="组织介绍" prop="Organizational" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type="textarea" autosize placeholder="请填写组织介绍" v-model.trim="formData.Organizational" :autosize="{ minRows:4., maxRows: 10}" >
</el-input>
</div>
</el-form-item>
<el-form-item label="志愿品牌" prop="Volunteerbrand" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type="textarea" autosize placeholder="请输入内容" v-model.trim="formData.Volunteerbrand" :autosize="{ minRows:4., maxRows: 10}" >
</el-input>
</div>
</el-form-item>
<el-form-item label="品牌展示图" label-width="150px" prop="VolunteerPic">
<template>
<upload-image :defaultFileList="formData.VolunteerPic" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image>
</template>
</el-form-item>
</el-row></el-form>
</div>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" 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'
import Tinymce from '@c/tinymce2/index.vue'
import daiMap from "@/utils/dai-map";
import util from '@js/util.js';
// import UploadImage from './upload-image.vue'
import UploadImage from '@/views/modules/plugins/rent/upload-image.vue'
var map
var search
var markers
var infoWindowList
var geocoder //
export default {
data() {
return {
activityImgs: [],//
fileList:[],
searchValue:"",
ServicetypeList:[
{ label: "敬老爱老", value: 1 },
{ label: "助残帮困", value: 2 },
{ label: "扶贫帮困", value: 3 },
{ label: "环保绿化", value: 4 },
{ label: "文化教育", value: 5 },
{ label: "扶贫帮困", value: 6 },
{ label: "其他", value: 7 },
],
OrganizationaltypeList:[
{ label: "社区", value: 1 },
{ label: "企业", value: 2 },
{ label: "学校", value: 3 },
],
formData:
{
VolunteerPic:"",//
Volunteerbrand:"",//
Organizational:"",//
fileList: [],//
AdministratorIDCard:"",//
Administratorphone:"",//
AdministratorName:"",//
Organizationaltype:"",//
Servicetype:"",//
OrganizationName:"",//
agencyName:"",//
Servicetype:[],
id: "",
typeId: "",
activityName: "",//
status: 0,//
assistingParty: "",//
startTime: "",//
endTime: "",//
coverPic: "",//
content: "",//
address: "",//
online: 0,//
cutOffTime: "",//
points: 0,//
participants: 0,//
sendMessage: 0,//
sumUp: "",//
activityImgs: [],//
longitude: this.$store.state.user.longitude, //
latitude: this.$store.state.user.latitude,//
},
corganizerList: [],
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId'),
}
},
components: { Tinymce, UploadImage },
props: {
VolunteerList: {
type: Array,
default: []
},
},
mounted() {
console.log(this.VolunteerList,"this.VolunteerList");
this.formData=this.VolunteerList
this.activityType()
this.listServerOrg()
},
methods: {
validateContent() {
// 使HTML
const textContent = this.stripHtml(this.formData.sumUp);
if (textContent.trim() === '') {
this.formData.sumUp = null;
}
},
stripHtml(html) {
const div = document.createElement('div');
div.innerHTML = html;
return div.textContent || div.innerText || '';
},
//
handleImgSuccess(res, file, fileList) {
if (res.code === 0 && res.msg === 'success') {
let format = file.name.split('.').pop();
let srcType = file.raw.type;
let type = 'file';
if (srcType.indexOf('image') != -1) {
type = 'image';
} else if (srcType.indexOf('video') != -1) {
type = 'video';
}
// this.formData.activityImgs.push({
// format,
// name: file.name,
// size: file.size,
// type,
// url: res.data.url
// });
// console.log('this.formData.activityImgs',res.data.url)
this.formData.activityImgs.push(res.data.url);
} else {
this.$message.error(res.msg);
}
},
//
handleImgRemove(file) {
console.log('handleImgRemove', file);
if (file.response) {
let index = this.formData.activityImgs.findIndex(item => item.url == file.response.data.url);
this.formData.activityImgs.splice(index, 1);
} else if (file.url) {
let index = this.formData.activityImgs.findIndex(item => item.url == file.url);
this.formData.activityImgs.splice(index, 1);
}
},
//
handleImgPreview(file) {
console.log(file);
window.open(file.url || file.response.data.url);
},
//
handleImgExceed() {
this.$message({
type: 'warning',
message: '文件数量最多不超过三个'
});
},
//
beforeImgUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 10;
const srcType = file.type;
const format = file.name.split('.').pop();
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!');
return false;
}
if (srcType.indexOf('image') == -1) {
this.$message.error('仅限图片格式');
return false;
}
return true;
},
async activityType() {
const url = "/actual/base/activityType/page"
let params = {
// agencyId: this.agencyId
pageSize: 20,
pageNo: 1,
typeName: "",
enabled: 1
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.typeList = data.list
} else {
this.$message.error(msg)
}
this.$nextTick(() => {
if (!map) {
this.initMap(this.formData.latitude, this.formData.longitude);
console.log("map", map,this.formData.latitude, this.formData.longitude)
} else {
map.setCenter(this.formData.latitude, this.formData.longitude);
map.setMarker(this.formData.latitude, this.formData.longitude);
console.log("mapmapmap", map)
}
})
},
handleOnlineRegistration(value) {
//
if (value) {
this.online = true;
this.formData.online = 1;
} else {
this.online = false;
this.formData.cutOffTime = ''
this.formData.online = 0;
}
},
// onChangeFileList(e) {
// if (e.length > 0) {
// let item = e[0];
// let ob = {
// fileType: '0',
// fileUrl: item.response.data.url
// };
// this.fileList = [ob];
// this.formData.coverPic = ob.fileUrl;
// }
// },
removedImg() {
this.formData.coverPic = ''
},
onChangeFileList(e) {
console.log(e, 'sssssb');
this.fileList = e.length > 0 ? e.map(item => ({
fileType: '0',
fileUrl: item.response.data.url
})) : []; // efileList
if (e.length > 0) {
this.formData.coverPic = e[0].response.data.url;
} else {
this.formData.coverPic = '';
}
},
onChangeImgs(e, rowIndex = 0) {
console.log('onChangeFileList', e)
if (e.length > 0) {
this.activityImgs = []
e.forEach(item => {
let ob = {
fileType: '0',
fileUrl: item.response.data.url
}
this.activityImgs.push(ob)
})
}
},
// onChangeImgs(e) {
// this.activityImgs = [];
// if (e.length > 0) {
// e.forEach(item => {
// let ob = {
// fileType: '0',
// fileUrl: item.response.data.url
// };
// this.activityImgs.push(ob);
// });
// console.log('this.activityImgs',this.activityImgs)
// }
// },
handleChange(value) {},
handleTimeChange(time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'time').split('-')
console.log(startTimeArray);
const endTimeArray = util.dateFormatter(time[1], 'time').split('-')
console.log(endTimeArray);
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2]
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2]
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.formData.startTime = ''
this.formData.endTime = ''
}
},
async initForm(type, activityId) {
this.startLoading()
this.formType = type
if (type === 'edit') {
if (activityId.activityImgs || activityId.sumUp) {
this.records = true
} else {
this.records = false
}
this.formData = activityId
this.timeRange = [this.formData.startTime, this.formData.endTime]
console.log(activityId,"activityId");
if (activityId.coverPic) {
let ob = {
fileType: '0',
fileUrl: activityId.coverPic
};
this.fileList = [ob];
this.formData.coverPic = ob.fileUrl;
if (this.formData.online == 1) {
this.online = true
}
}
} else if (type === 'records') {
this.records = true
} else if (type === 'summary') {
this.formData = activityId
this.formData.activityImgs = []
console.log("this.formData", this.formData)
this.records = true
this.summary = false
} else {
this.records = false
}
this.endLoading()
},
async getDemandOptions() {
this.$http
.post("/actual/base/serviceitem/listAllCategory")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log(res.data);
this.demandOptions = this.getFlagData(
this.getTreeData(res.data),
"usableFlag"
);
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
getFlagData(data, flag) {
if (!Array.isArray(data)) return [];
let arr1 = data.filter((item) => item[flag]);
let arr2 = arr1.map((item) => {
if (item.childCateList)
return { ...item, childCateList: this.getFlagData(item.childCateList, flag) };
else return item;
});
return arr2;
},
getTreeData(data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
if (item.childCateList) {
if (item.childCateList.length === 0)
_item = { ...item, childCateList: undefined };
else _item = { ...item, childCateList: this.getTreeData(item.childCateList) };
} else {
_item = { ...item };
}
return _item;
});
return arr;
},
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 loadFormData() {
const url = '/actual/base/icpartyactivity/detail'
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/detail'
let params = {
id: this.activityId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
let style_img = "style='width:50px;height:40px;' "
if (this.formData.content) {
// this.formData.content = this.formData.content.replace(/<img/g, "<img style='width:200px;height:120px;'")
// let array=this.formData.content.split('<img')
}
} else {
this.$message.error(msg)
}
},
async handleComfirm() {
if (!this.formData.agencyName) {
this.$message.error('请选择所属组织');
return;
}
if (!this.formData.Organizational) {
this.$message.error('请输入组织介绍');
return;
}
if (this.fileList.length === 0) {
this.$message.error('请上传封面图片');
return;
}
if (!this.formData.AdministratorIDCard) {
this.$message.error('请输入身份证信息');
return;
}
if (!this.formData.Administratorphone) {
this.$message.error('请输入管理员电话');
return;
}
if (!this.formData.AdministratorName) {
this.$message.error('请输入管理员姓名');
return;
}
if (!this.formData.Organizationaltype) {
this.$message.error('请输入组织类型');
return;
}
if (!this.formData.Servicetype) {
this.$message.error('请输入服务类型');
return;
}
if (!this.formData.OrganizationName) {
this.$message.error('请输入组织名称');
return;
}
console.log(this.formData,"this.formData");
this.addActivity()
},
async addActivity() {
if (this.formType === 'edit' || this.formType === 'summary') {
let url = '/actual/base/communityActivity/update'
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)
}
} else {
let url = '/actual/base/communityActivity/save'
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() {
console.log("sdlkfjklsdf ");
this.$emit('showInfoClose')
},
// init
initMap(latitude, longitude) {
console.log(latitude, longitude,"564564568");
map = new daiMap(
document.getElementById("app_activity"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
/* map.on("dragend", (e) => {
this.handleMoveCenter(e);
});*/
map.on("click", (e) => {
this.handleMoveCenter(e);
});
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
async handleMoveCenter(e) {
//
// const { lat, lng } = map.getCenter();
const { lat, lng } = e.latLng;
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address;
this.searchValue=data.address
console.log(this.formData.address, this.formData.longitude, this.formData.latitude," this.formData.address ");
this.searchValue = data.address
this.searchOptions = []
// console.log('data,this.searchValue ', this.searchValue)
}
},
async remoteMethod(query) {
console.log(query, "sfsvsdv");
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = []
if (msg == "success" && data.resultList && data.resultList.length > 0) {
if (data.resultList && data.resultList.length > 0) {
this.resultList = data.resultList
console.log(this.resultList, "this.resultList");
this.searchOptions = this.resultList.map(item => {
return { value: `${item.id}`, label: `${item.address + item.title}` };
});
console.log(this.searchOptions, "this.searchOptions");
}
} else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
]
}
} else {
this.searchOptions = [];
}
},
handleClickKey(index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.searchValue = selPosition.address + selPosition.name
},
resetData() {
this.timeRange = []
this.fileList = []
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.activityId = ''
this.keyWords = ''
this.online = false
this.formType = ''
this.summary = true
this.formData = {
id: "",
typeId: "",
activityName: "",//
status: 0,//
assistingParty: "",//
startTime: "",//
endTime: "",//
coverPic: "",//
content: "",//
address: "",//
online: 0,//
cutOffTime: "",//
points: 0,//
participants: 0,//
sendMessage: 0,//
sumUp: "",//
activityImgs: [],//
longitude: this.$store.state.user.longitude, //
latitude: this.$store.state.user.latitude//
// longitude: null, //
// latitude: null//
}
map=""
},
// //
// startLoading() {
// loading = Loading.service({
// lock: true, //
// text: '', //
// background: 'rgba(0,0,0,.7)' //
// })
// },
// //
// endLoading() {
// // clearTimeout(timer);
// if (loading) {
// loading.close()
// }
// }
},
computed: {
dataRule() {
return {
OrganizationName: [
{ required: true, message: '组织名称不能为空', trigger: 'blur' }
],
Servicetype: [
{ required: true, message: '请选择服务类型', trigger: 'blur' }
],
Organizationaltype: [
{ required: true, message: '请选择组织类型', trigger: 'blur' }
],
AdministratorName: [
{ required: true, message: '请输入管理员姓名', trigger: 'blur' }
],
AdministratorIDCard: [
{ required: true, message: '身份证号不能为空不能为空', trigger: 'blur' },
{ pattern: /^(?:[1-9]\d{5}(18|19|20)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)|[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3})$/, message: '请输入正确的身份证号', trigger: 'blur' }
],
Administratorphone: [
{ required: true, message: '管理员电话不能为空不能为空', trigger: 'blur' },
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
],
fileList: [
{ required: true, message: '请上传组织封面图', trigger: 'blur' }
],
Organizational: [
{ required: true, message: '请填写组织介绍', trigger: 'blur' },
{ min:50, message: '请输入50字以上的介绍', trigger: 'blur'}
],
points: [
{ required: true, message: '请选择活动积分', trigger: 'blur' }
],
sumUp: [
{ required: true, message: '请输入活动总结', trigger: 'blur' }
],
activityImgs: [
{ required: true, message: '请选择活动照片', trigger: 'blur' }
]
}
},
},
props: {
},
destroyed () {
map = null
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.item_width_1 {
width: 634px;
/deep/.tox .tox-dialog {
z-index: 20000;
}
}
.u-item-width-normal{
width: 222px;
}
.tinymce_view {
::v-deep .tox .tox-dialog {
z-index: 2000000000;
}
}
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
>p {
margin: 0;
}
}
</style>

677
src/views/modules/volunteer/VoluntaryOrganization/index.vue

@ -0,0 +1,677 @@
<template>
<div class="g-main">
<div class="m-search">
<el-form :inline="true" ref="ref_searchform" :label-width="'100px'">
<div>
<el-form-item label="组织名称">
<el-input v-model.trim="formData.OrganizationName" size="small" class="item_width_1" clearable
placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item label="组织类型">
<el-select v-model="formData.Organizationaltype" placeholder="请选择" clearable>
<el-option v-for="item in formData.optionstype" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
<div class="block">
<div style="display: flex; justify-content: flex-end;">
<el-button style="margin-left:10px" class="diy-button--blue" size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px" class="diy-button--white" size="small"
@click="resetSearch">重置</el-button>
</div>
</div>
</el-form>
</div>
<div class="m-table">
<el-button style="" class="diy-button--add" size="small" @click="handleAdd">新增</el-button>
<el-button style="" class="diy-button--add" size="small" @click="handleExportModule()">下载模板</el-button>
<el-button class="diy-button--white" size="small">
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" action="uploadUlr"
:limit="1" :accept="'.xls,.xlsx'" :with-credentials="true" :show-file-list="false"
:auto-upload="true" :on-progress="handleProgress" :on-success="handleExcelSuccess"
:before-upload="beforeExcelUpload" :http-request="uploadHttpRequest">
导入
</el-upload>
</el-button>
<el-table class="table" :data="tableData" border style="width: 100%">
<el-table-column label="序号" header-align="center" align="center" type="index"
width="80"></el-table-column>
<el-table-column prop="agencyName" header-align="center" align="center" label="所属组织"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column prop="OrganizationName" header-align="center" align="center" label="组织名称"
:show-overflow-tooltip="true">
<!-- <template slot-scope="scope">
<span>{{ scope.row.enabled === 1 ? '关闭' : '显示' }}</span>
</template> -->
</el-table-column>
<el-table-column prop="Servicetype" header-align="center" align="center" label="服务类型"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column prop="Organizationaltype" header-align="center" align="center" label="成员数"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column prop="AdministratorName" header-align="center" align="center" label="管理员"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column prop="Administratorphone" header-align="center" align="center" label="联系电话"
:show-overflow-tooltip="true">
</el-table-column>
<!-- <el-table-column prop="createdTime" header-align="center" align="center" label="注册时间" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column prop="points" header-align="center" align="center" label="积分":show-overflow-tooltip="true">
</el-table-column>
<el-table-column prop="actNum" header-align="center" align="center" label="活动次数":show-overflow-tooltip="true">
</el-table-column> -->
<el-table-column label="操作" fixed="right" width="250" header-align="center" align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text" style="color:#1C6AFD;" size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" style="color:#1C6AFD;" size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" style="color:#1C6AFD;" size="small"
@click="handleshowMember(scope.row)">成员管理</el-button>
<el-button type="text" style="color:#1C6AFD;" size="small"
@click="handleintegral(scope.row)">删除</el-button>
<el-button type="text" style="color:#1C6AFD;" size="small"
@click="handleprocessl(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>
<el-dialog :visible.sync="showAdd" :close-on-click-modal="false" :close-on-press-escape="false" title="新增"
width="850px" top="10vh" class="dialog-h" @closed="showAddClose">
<add v-if="showAdd" @showAddClose="showAddClose" />
</el-dialog>
<el-dialog :visible.sync="showInfo" :close-on-click-modal="false" :close-on-press-escape="false" title="查看"
width="850px" top="10vh" class="dialog-h" @closed="showInfoClose">
<info v-if="showInfo" :VolunteerList="fmData" @showInfoClose="showInfoClose" />
</el-dialog>
<el-dialog :visible.sync="showEdit" :close-on-click-modal="false" :close-on-press-escape="false" title="修改"
width="850px" top="10vh" class="dialog-h" @closed="showEditClose">
<edit v-if="showEdit" :VolunteerList="fmData" @showEditClose="showEditClose" />
</el-dialog>
<el-dialog :visible.sync="showMember" :close-on-click-modal="false" :close-on-press-escape="false"
title="成员管理" width="1000px" top="10vh" class="dialog-h" @closed="MemberManagementClose">
<MemberManagement v-if="showMember" :list="fmData" @MemberManagementClose="MemberManagementClose" />
</el-dialog>
<el-dialog :visible.sync="showprocess" :close-on-click-modal="false" :close-on-press-escape="false" title="审查"
width="850px" top="10vh" class="dialog-h" @closed="handleprocesslClose">
<process v-if="showprocess" @handleprocesslClose="handleprocesslClose" :VolunteerList="EditList"/>
</el-dialog>
</div>
</div>
</template>
<script>
import { requestPost, requestGet } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex";
import add from "./add.vue"
import info from "./info.vue"
import edit from "./edit.vue"
import MemberManagement from "./MemberManagement.vue"
import process from "./process.vue"
// import Record from "./activeRecord"
// import integral from "./integral"
// // import projectInfo from "./cpts/project-info";
import axios from "axios";
export default {
components: { add, info,edit,MemberManagement,process},
data() {
return {
formData: {
organization: "",
service_type: "",
optionstype: [
{ value: "1", label: "志愿者服务组织" },
{ value: "2", label: "志愿者服务团队" },
]
},
showprocess:false,
EditList:{},
showAdd: false,
showMember: false,
showEdit: false,
// pageType: "list", // list dispose info issue-info
pageNo: 1,
pageSize: 20,
total: 1,
tableData: [
{
VolunteerPic: "https://example.com/path/to/volunteer_pic.jpg",
Volunteerbrand: "阳光志愿者",
Organizational: "致力于社区服务和环境保护的非营利组织。",
fileList: [
"https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/20240902/afc68283a231434aa8b83ec9d9be762e.jpg",
],
AdministratorIDCard: "11010519800101001X",
Administratorphone: "13800138000",
AdministratorName: "张三",
Organizationaltype: "非营利组织",
Servicetype: "教育支持、环境保护",
OrganizationName: "绿意志愿服务中心",
agencyName: "城市志愿服务联盟",
longitude: 120.37280504155444 ,
latitude: 36.098042952884704,
searchValue:"山东省青岛市市北区南宁路79-7号",
Servicetype:1,
searchOptions:[]
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic1.jpg",
Volunteerbrand: "爱心行动",
Organizational: "专注于儿童教育和社区发展的慈善组织。",
fileList: [
"https://example.com/path/to/cover_pic3.jpg",
"https://example.com/path/to/cover_pic4.jpg"
],
AdministratorIDCard: "220202199003070029",
Administratorphone: "13911112222",
AdministratorName: "李四",
Organizationaltype: "慈善机构",
Servicetype: "儿童教育、社区发展",
OrganizationName: "希望之光慈善会",
agencyName: "慈善联盟"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic2.jpg",
Volunteerbrand: "绿色地球",
Organizational: "致力于环境保护和生态平衡的非政府组织。",
fileList: [
"https://example.com/path/to/cover_pic5.jpg",
"https://example.com/path/to/cover_pic6.jpg"
],
AdministratorIDCard: "330106199101090033",
Administratorphone: "13722222333",
AdministratorName: "王五",
Organizationaltype: "非政府组织",
Servicetype: "环境保护、生态平衡",
OrganizationName: "自然之友环保协会",
agencyName: "环保行动网络"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic3.jpg",
Volunteerbrand: "文化传承",
Organizational: "专注于文化遗产保护和传统艺术推广的组织。",
fileList: [
"https://example.com/path/to/cover_pic7.jpg",
"https://example.com/path/to/cover_pic8.jpg"
],
AdministratorIDCard: "440301199201100025",
Administratorphone: "13533333444",
AdministratorName: "赵六",
Organizationaltype: "文化保护",
Servicetype: "文化遗产、传统艺术",
OrganizationName: "文化遗产保护协会",
agencyName: "文化传承联盟"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic3.jpg",
Volunteerbrand: "文化传承",
Organizational: "专注于文化遗产保护和传统艺术推广的组织。",
fileList: [
"https://example.com/path/to/cover_pic7.jpg",
"https://example.com/path/to/cover_pic8.jpg"
],
AdministratorIDCard: "440301199201100025",
Administratorphone: "13533333444",
AdministratorName: "赵六",
Organizationaltype: "文化保护",
Servicetype: "文化遗产、传统艺术",
OrganizationName: "文化遗产保护协会",
agencyName: "文化传承联盟"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic4.jpg",
Volunteerbrand: "科技先锋",
Organizational: "推动科技创新和教育的组织。",
fileList: [
"https://example.com/path/to/cover_pic9.jpg",
"https://example.com/path/to/cover_pic10.jpg"
],
AdministratorIDCard: "510107199205070012",
Administratorphone: "13666666777",
AdministratorName: "钱七",
Organizationaltype: "科技教育",
Servicetype: "科技创新、教育普及",
OrganizationName: "科技创新中心",
agencyName: "科技教育促进会"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic5.jpg",
Volunteerbrand: "健康使者",
Organizational: "致力于公共健康和医疗援助的组织。",
fileList: [
"https://example.com/path/to/cover_pic11.jpg",
"https://example.com/path/to/cover_pic12.jpg"
],
AdministratorIDCard: "320106199301080018",
Administratorphone: "13877777888",
AdministratorName: "孙八",
Organizationaltype: "公共健康",
Servicetype: "健康教育、医疗援助",
OrganizationName: "健康促进基金会",
agencyName: "医疗援助网络"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic6.jpg",
Volunteerbrand: "法律援助",
Organizational: "提供法律咨询和援助服务的组织。",
fileList: [
"https://example.com/path/to/cover_pic13.jpg",
"https://example.com/path/to/cover_pic14.jpg"
],
AdministratorIDCard: "370102199401090039",
Administratorphone: "13988888999",
AdministratorName: "李九",
Organizationaltype: "法律服务",
Servicetype: "法律咨询、权益保护",
OrganizationName: "法律援助中心",
agencyName: "法律服务联盟"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic7.jpg",
Volunteerbrand: "动物之友",
Organizational: "关注动物福利和野生动物保护的组织。",
fileList: [
"https://example.com/path/to/cover_pic15.jpg",
"https://example.com/path/to/cover_pic16.jpg"
],
AdministratorIDCard: "21010219950109003X",
Administratorphone: "13500001111",
AdministratorName: "周十",
Organizationaltype: "动物保护",
Servicetype: "动物福利、野生动物保护",
OrganizationName: "动物保护协会",
agencyName: "动物福利网络"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic8.jpg",
Volunteerbrand: "城市绿化",
Organizational: "致力于城市绿化和公园维护的组织。",
fileList: [
"https://example.com/path/to/cover_pic17.jpg",
"https://example.com/path/to/cover_pic18.jpg"
],
AdministratorIDCard: "120101199601090011",
Administratorphone: "13600002222",
AdministratorName: "吴十一",
Organizationaltype: "环境保护",
Servicetype: "城市绿化、公园维护",
OrganizationName: "城市绿化促进会",
agencyName: "绿化行动联盟"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic9.jpg",
Volunteerbrand: "艺术之声",
Organizational: "推广艺术文化和支持艺术家的组织。",
fileList: [
"https://example.com/path/to/cover_pic19.jpg",
"https://example.com/path/to/cover_pic20.jpg"
],
AdministratorIDCard: "420107199701100027",
Administratorphone: "13711112233",
AdministratorName: "郑十二",
Organizationaltype: "文化艺术",
Servicetype: "艺术推广、文化活动",
OrganizationName: "艺术文化中心",
agencyName: "艺术支持网络"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic10.jpg",
Volunteerbrand: "青年力量",
Organizational: "支持青年发展和创业的组织。",
fileList: [
"https://example.com/path/to/cover_pic21.jpg",
"https://example.com/path/to/cover_pic22.jpg"
],
AdministratorIDCard: "330106199801100012",
Administratorphone: "13822224444",
AdministratorName: "王十三",
Organizationaltype: "青年发展",
Servicetype: "青年培训、创业支持",
OrganizationName: "青年发展基金会",
agencyName: "青年创业促进会"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic11.jpg",
Volunteerbrand: "教育之光",
Organizational: "致力于改善教育质量和提供教育资源的组织。",
fileList: [
"https://example.com/path/to/cover_pic23.jpg",
"https://example.com/path/to/cover_pic24.jpg"
],
AdministratorIDCard: "510107199901200015",
Administratorphone: "13933335555",
AdministratorName: "冯十四",
Organizationaltype: "教育支持",
Servicetype: "教育质量提升、资源提供",
OrganizationName: "教育发展基金会",
agencyName: "教育支持联盟"
},
{
VolunteerPic: "https://example.com/path/to/volunteer_pic12.jpg",
Volunteerbrand: "社区伙伴",
Organizational: "促进社区发展和邻里互助的组织。",
fileList: [
"https://example.com/path/to/cover_pic25.jpg",
"https://example.com/path/to/cover_pic26.jpg"
],
AdministratorIDCard: "32010620000109003X",
Administratorphone: "13500006666",
AdministratorName: "陈十五",
Organizationaltype: "社区发展",
Servicetype: "社区建设、邻里互助",
OrganizationName: "社区发展协会",
agencyName: "社区互助网络"
}
],
showInfo:false,
};
},
computed: {
maxTableHeight() {
return this.$store.state.inIframe
? this.clientHeight - 400 + this.iframeHeigh
: this.clientHeight - 400;
},
...mapGetters(["clientHeight", "iframeHeight"]),
},
watch: {
},
mounted() {
this.getTableData();
},
methods: {
//
handleprocessl(row){
this.showprocess=true
this.EditList=row
console.log(row,this.fmData,"row");
},
//
handleprocesslClose(){
this.showprocess=false
},
//
handleshowMember(){
this.showMember=true
},
//
MemberManagementClose(){
this.showMember=false
},
//
handleEdit(row){
this.showEdit=true,
this.EditList=row
console.log(row,this.fmData,"row");
},
//
showEditClose(){
this.showEdit=false
},
//
handleAdd(){
this.showAdd=true
},
//
showAddClose(){
console.log("sdlkfjklsdf1");
this.showAdd=false
},
//
showInfoClose(){
this.showEdit=false
},
//
async getTableData() {
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/project-list";
const url = "/voluntary/volunteerInfo/page";
let params={
pageSize:this.pageSize,
pageNo:this.pageNo,
mobile:this.formData.mobile,
name:this.formData.name
}
const { data, code, msg } = await requestPost(url,params);
if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!");
this.total = data.total || 0;
// this.tableData = data.list
} else {
}
},
//
async uploadHttpRequest(file) {
this.importLoading = true;
this.importBtnTitle = '正在上传中...';
this.$message({
showClose: true,
dangerouslyUseHTMLString: true,
message: "导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度",
duration: 3000
});
let than = this;
document.getElementById('clickA').addEventListener('click', function () {
than.$router.replace('/main/importRecord-index');
});
const formData = new FormData(); //FormDataappend('key', value)
formData.append('file', file.file); //
formData.append('code', ''); //
let url = '/governance/icEvent/importEvent'
if (this.importType == 2) {
url = '/governance/icEvent/importAwo'
}
console.log(url)
await this.$http
.post(url, formData)
.then(res => {
if (res.data.code == 0 && res.data.msg == 'success') {
const data = res.data.data;
this.dataList = [
...Object.keys(data.option.exist).map(k => {
return {
index: k,
srcField: data.option.exist[k],
exist: true,
field: data.option.exist[k]
};
}),
...Object.keys(data.option.notExist).map(k => {
return {
index: k,
srcField: data.option.notExist[k],
exist: false,
field: ''
};
})
];
this.importOption = data.option;
this.importCode = data.code;
this.fileData = file;
} else this.$message.error(res.data.msg);
})
.catch(err => {
console.log('失败', err);
file.onError(); //
});
this.importLoading = false;
this.importBtnTitle = '导入';
this.$refs.upload.clearFiles();
this.getTableData();
},
handleExcelSuccess(res, file) {
if (!res.code === 0 && !res.msg === 'success') {
this.$message.error(res.msg);
}
},
beforeExcelUpload(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;
},
handleintegral(row){
this.fmData=row
this.integral=true
console.log(row,"row");
},
diaClose(){
this.formShow=false
},
resetSearch(){
this.formData=[]
},
handleDetail(row){
console.log(row,"row");
this.showInfo=true
this.fmData=row
},
summDetailClose(){
this.showAdd=false
this.getTableData()
},
async handleExportModule() {
let url = "/heart/iccommunityselforganization/import-template-download";
let params = {};
await this.$http({
method: "POST",
url,
responseType: "blob",
data: params,
})
.then((res) => {
if (res.headers["content-disposition"]) {
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
} else this.$message.error("下载失败");
})
.catch((err) => {
console.log("err", err);
return this.$message.error("网络错误");
});
},
handleProgress(event, file, fileList) {
console.log("percentage", file.percentage);
},
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();
},
//
handleSearch(val) {
console.log(this.fmData);
this.pageNo = 1;
this.getTableData();
},
handleClose() {
this.pageType = "list";
this.currentProject = {
projectId: "",
};
},
handleEditSuccess() {
this.handleClose();
this.getTableData();
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/list-main.scss";
.g-main {
width: 100%;
}
.m-search {
background: #ffffff;
border-radius: 4px;
padding: 30px 20px 5px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.item_width_2 {
width: 495px;
}
.m-table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 15px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.div_btn {
display: flex;
justify-content: space-between;
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

847
src/views/modules/volunteer/VoluntaryOrganization/info.vue

@ -0,0 +1,847 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form" :inline="true" :model="formData" :rules="dataRule"
class="form">
<el-row>
<el-col :span="12">
<el-form-item label="所属组织" prop="agencyName" label-width="150px">
<el-input v-model.trim="formData.agencyName" size="small" clearable placeholder="请输入活动名称" :disabled="true"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织名称" prop="OrganizationName" label-width="150px">
<el-input v-model.trim="formData.OrganizationName" :disabled="true" size="small" clearable placeholder="请输入活动名称"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="服务类型" label-width="150px" prop="Servicetype" :disabled="true">
<el-select :disabled="true" multiple-limit='4' class="u-item-width-normal" v-model.trim="formData.Servicetype" placeholder="请选择" clearable multiple>
<el-option v-for="item in ServicetypeList" :key="item.value" :label="item.label" :value="item.value" >
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :disabled="true" label="组织类型" label-width="150px" prop="Organizationaltype" >
<el-select class="u-item-width-normal" v-model.trim="formData.Organizationaltype" placeholder="请选择" clearable :disabled="true">
<el-option v-for="item in Organizationaltype" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动地点" prop="address" label-width="150px" style="display: block" >
<div style="width: 634px">
<el-select v-model.trim="searchValue" filterable style="width: 634px" remote :reserve-keyword="true" :disabled="true"
placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading">
<el-option v-for="(item, index) in searchOptions" @click.native="handleClickKey(index)"
:key="item.value || index" :label="item.label" :value="item.value">
</el-option>
</el-select>
<div id="app_activity" class="div_map"></div>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管理员姓名" prop="AdministratorName" label-width="150px">
<el-input v-model.trim="formData.AdministratorName" size="small" clearable placeholder="请输入管理员姓名" :disabled="true"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号" prop="Administratorphone" label-width="150px">
<el-input v-model.trim="formData.Administratorphone" size="small" clearable placeholder="请输入手机号" :disabled="true"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="身份证号" prop="AdministratorIDCard" label-width="150px">
<el-input v-model.trim="formData.AdministratorIDCard" size="small" clearable placeholder="请输入身份证号" :disabled="true"
class="u-item-width-normal"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织封面图" label-width="150px" prop="fileList">
<template>
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image>
</template>
</el-form-item>
</el-col>
<el-form-item label="组织介绍" prop="Organizational" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input :disabled="true" type="textarea" autosize placeholder="请填写组织介绍" v-model.trim="formData.Organizational" :autosize="{ minRows:4., maxRows: 10}" >
</el-input>
</div>
</el-form-item>
<el-form-item label="志愿品牌" prop="Volunteerbrand" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input :disabled="true" type="textarea" autosize placeholder="请输入内容" v-model.trim="formData.Volunteerbrand" :autosize="{ minRows:4., maxRows: 10}" >
</el-input>
</div>
</el-form-item>
<el-form-item label="品牌展示图" label-width="150px" prop="VolunteerPic">
<template>
<upload-image :defaultFileList="formData.VolunteerPic" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image>
</template>
</el-form-item>
</el-row></el-form>
</div>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" 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'
import Tinymce from '@c/tinymce2/index.vue'
import daiMap from "@/utils/dai-map";
import util from '@js/util.js';
// import UploadImage from './upload-image.vue'
import UploadImage from '@/views/modules/plugins/rent/upload-image.vue'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data() {
return {
ServicetypeList:[
{ label: "敬老爱老", value: 1 },
{ label: "助残帮困", value: 2 },
{ label: "扶贫帮困", value: 3 },
{ label: "环保绿化", value: 4 },
{ label: "文化教育", value: 5 },
{ label: "扶贫帮困", value: 6 },
{ label: "其他", value: 7 },
],
OrganizationaltypeList:[
{ label: "社区", value: 1 },
{ label: "企业", value: 2 },
{ label: "学校", value: 3 },
],
activityImgs: [],//
fileList:[],
formData:
{
VolunteerPic:"",//
Volunteerbrand:"",//
Organizational:"",//
fileList: [],//
AdministratorIDCard:"",//
Administratorphone:"",//
AdministratorName:"",//
Organizationaltype:"",//
Servicetype:"",//
OrganizationName:"",//
agencyName:"",//
Servicetype:[],
id: "",
typeId: "",
activityName: "",//
status: 0,//
assistingParty: "",//
startTime: "",//
endTime: "",//
coverPic: "",//
content: "",//
address: "",//
online: 0,//
cutOffTime: "",//
points: 0,//
participants: 0,//
sendMessage: 0,//
sumUp: "",//
activityImgs: [],//
longitude: this.$store.state.user.longitude, //
latitude: this.$store.state.user.latitude,//
},
corganizerList: [],
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId'),
}
},
components: { Tinymce, UploadImage },
props: {
VolunteerList: {
type: Array,
default: []
},
},
mounted() {
this.formData.agencyName=this.$store.state.user.agencyName
console.log(this.VolunteerList,"this.VolunteerList");
this.formData=this.VolunteerList
},
methods: {
validateContent() {
// 使HTML
const textContent = this.stripHtml(this.formData.sumUp);
if (textContent.trim() === '') {
this.formData.sumUp = null;
}
},
stripHtml(html) {
const div = document.createElement('div');
div.innerHTML = html;
return div.textContent || div.innerText || '';
},
//
handleImgSuccess(res, file, fileList) {
if (res.code === 0 && res.msg === 'success') {
let format = file.name.split('.').pop();
let srcType = file.raw.type;
let type = 'file';
if (srcType.indexOf('image') != -1) {
type = 'image';
} else if (srcType.indexOf('video') != -1) {
type = 'video';
}
// this.formData.activityImgs.push({
// format,
// name: file.name,
// size: file.size,
// type,
// url: res.data.url
// });
// console.log('this.formData.activityImgs',res.data.url)
this.formData.activityImgs.push(res.data.url);
} else {
this.$message.error(res.msg);
}
},
//
handleImgRemove(file) {
console.log('handleImgRemove', file);
if (file.response) {
let index = this.formData.activityImgs.findIndex(item => item.url == file.response.data.url);
this.formData.activityImgs.splice(index, 1);
} else if (file.url) {
let index = this.formData.activityImgs.findIndex(item => item.url == file.url);
this.formData.activityImgs.splice(index, 1);
}
},
//
handleImgPreview(file) {
console.log(file);
window.open(file.url || file.response.data.url);
},
//
handleImgExceed() {
this.$message({
type: 'warning',
message: '文件数量最多不超过三个'
});
},
//
beforeImgUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 10;
const srcType = file.type;
const format = file.name.split('.').pop();
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!');
return false;
}
if (srcType.indexOf('image') == -1) {
this.$message.error('仅限图片格式');
return false;
}
return true;
},
async activityType() {
const url = "/actual/base/activityType/page"
let params = {
// agencyId: this.agencyId
pageSize: 20,
pageNo: 1,
typeName: "",
enabled: 1
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.typeList = data.list
} else {
this.$message.error(msg)
}
this.$nextTick(() => {
if (!map) {
this.initMap(this.formData.latitude, this.formData.longitude);
console.log("map", map,this.formData.latitude, this.formData.longitude)
} else {
map.setCenter(this.formData.latitude, this.formData.longitude);
map.setMarker(this.formData.latitude, this.formData.longitude);
console.log("mapmapmap", map)
}
})
},
handleOnlineRegistration(value) {
//
if (value) {
this.online = true;
this.formData.online = 1;
} else {
this.online = false;
this.formData.cutOffTime = ''
this.formData.online = 0;
}
},
// onChangeFileList(e) {
// if (e.length > 0) {
// let item = e[0];
// let ob = {
// fileType: '0',
// fileUrl: item.response.data.url
// };
// this.fileList = [ob];
// this.formData.coverPic = ob.fileUrl;
// }
// },
removedImg() {
this.formData.coverPic = ''
},
onChangeFileList(e) {
console.log(e, 'sssssb');
this.fileList = e.length > 0 ? e.map(item => ({
fileType: '0',
fileUrl: item.response.data.url
})) : []; // efileList
if (e.length > 0) {
this.formData.coverPic = e[0].response.data.url;
} else {
this.formData.coverPic = '';
}
},
onChangeImgs(e, rowIndex = 0) {
console.log('onChangeFileList', e)
if (e.length > 0) {
this.activityImgs = []
e.forEach(item => {
let ob = {
fileType: '0',
fileUrl: item.response.data.url
}
this.activityImgs.push(ob)
})
}
},
// onChangeImgs(e) {
// this.activityImgs = [];
// if (e.length > 0) {
// e.forEach(item => {
// let ob = {
// fileType: '0',
// fileUrl: item.response.data.url
// };
// this.activityImgs.push(ob);
// });
// console.log('this.activityImgs',this.activityImgs)
// }
// },
handleChange(value) {},
handleTimeChange(time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'time').split('-')
console.log(startTimeArray);
const endTimeArray = util.dateFormatter(time[1], 'time').split('-')
console.log(endTimeArray);
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2]
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2]
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.formData.startTime = ''
this.formData.endTime = ''
}
},
async initForm(type, activityId) {
this.startLoading()
this.formType = type
if (type === 'edit') {
if (activityId.activityImgs || activityId.sumUp) {
this.records = true
} else {
this.records = false
}
this.formData = activityId
this.timeRange = [this.formData.startTime, this.formData.endTime]
console.log(activityId,"activityId");
if (activityId.coverPic) {
let ob = {
fileType: '0',
fileUrl: activityId.coverPic
};
this.fileList = [ob];
this.formData.coverPic = ob.fileUrl;
if (this.formData.online == 1) {
this.online = true
}
}
} else if (type === 'records') {
this.records = true
} else if (type === 'summary') {
this.formData = activityId
this.formData.activityImgs = []
console.log("this.formData", this.formData)
this.records = true
this.summary = false
} else {
this.records = false
}
this.endLoading()
},
async getDemandOptions() {
this.$http
.post("/actual/base/serviceitem/listAllCategory")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log(res.data);
this.demandOptions = this.getFlagData(
this.getTreeData(res.data),
"usableFlag"
);
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
getFlagData(data, flag) {
if (!Array.isArray(data)) return [];
let arr1 = data.filter((item) => item[flag]);
let arr2 = arr1.map((item) => {
if (item.childCateList)
return { ...item, childCateList: this.getFlagData(item.childCateList, flag) };
else return item;
});
return arr2;
},
getTreeData(data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
if (item.childCateList) {
if (item.childCateList.length === 0)
_item = { ...item, childCateList: undefined };
else _item = { ...item, childCateList: this.getTreeData(item.childCateList) };
} else {
_item = { ...item };
}
return _item;
});
return arr;
},
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 loadFormData() {
const url = '/actual/base/icpartyactivity/detail'
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/detail'
let params = {
id: this.activityId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
let style_img = "style='width:50px;height:40px;' "
if (this.formData.content) {
// this.formData.content = this.formData.content.replace(/<img/g, "<img style='width:200px;height:120px;'")
// let array=this.formData.content.split('<img')
}
} else {
this.$message.error(msg)
}
},
async handleComfirm() {
if (!this.formData.agencyName) {
this.$message.error('请选择所属组织');
return;
}
if (!this.formData.Organizational) {
this.$message.error('请输入组织介绍');
return;
}
if (this.fileList.length === 0) {
this.$message.error('请上传封面图片');
return;
}
if (!this.formData.AdministratorIDCard) {
this.$message.error('请输入身份证信息');
return;
}
if (!this.formData.Administratorphone) {
this.$message.error('请输入管理员电话');
return;
}
if (!this.formData.AdministratorName) {
this.$message.error('请输入管理员姓名');
return;
}
if (!this.formData.Organizationaltype) {
this.$message.error('请输入组织类型');
return;
}
if (!this.formData.Servicetype) {
this.$message.error('请输入服务类型');
return;
}
if (!this.formData.OrganizationName) {
this.$message.error('请输入组织名称');
return;
}
console.log(this.formData,"this.formData");
this.addActivity()
},
async addActivity() {
if (this.formType === 'edit' || this.formType === 'summary') {
let url = '/actual/base/communityActivity/update'
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)
}
} else {
let url = '/actual/base/communityActivity/save'
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() {
console.log("sdlkfjklsdf ");
this.$emit('showAddClose')
},
// init
initMap(latitude, longitude) {
console.log(latitude, longitude,"564564568");
map = new daiMap(
document.getElementById("app_activity"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
/* map.on("dragend", (e) => {
this.handleMoveCenter(e);
});*/
map.on("click", (e) => {
this.handleMoveCenter(e);
});
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
async handleMoveCenter(e) {
//
// const { lat, lng } = map.getCenter();
const { lat, lng } = e.latLng;
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address
console.log(this.formData.address," this.formData.address ");
this.searchValue = data.address
this.searchOptions = []
// console.log('data,this.searchValue ', this.searchValue)
}
},
async remoteMethod(query) {
console.log(query, "sfsvsdv");
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = []
if (msg == "success" && data.resultList && data.resultList.length > 0) {
if (data.resultList && data.resultList.length > 0) {
this.resultList = data.resultList
console.log(this.resultList, "this.resultList");
this.searchOptions = this.resultList.map(item => {
return { value: `${item.id}`, label: `${item.address + item.title}` };
});
console.log(this.searchOptions, "this.searchOptions");
}
} else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
]
}
} else {
this.searchOptions = [];
}
},
handleClickKey(index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.formData.address = selPosition.address + selPosition.name
},
resetData() {
this.timeRange = []
this.fileList = []
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.activityId = ''
this.keyWords = ''
this.online = false
this.formType = ''
this.summary = true
this.formData = {
id: "",
typeId: "",
activityName: "",//
status: 0,//
assistingParty: "",//
startTime: "",//
endTime: "",//
coverPic: "",//
content: "",//
address: "",//
online: 0,//
cutOffTime: "",//
points: 0,//
participants: 0,//
sendMessage: 0,//
sumUp: "",//
activityImgs: [],//
longitude: this.$store.state.user.longitude, //
latitude: this.$store.state.user.latitude//
// longitude: null, //
// latitude: null//
}
map=""
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule() {
return {
OrganizationName: [
{ required: true, message: '组织名称不能为空', trigger: 'blur' }
],
Servicetype: [
{ required: true, message: '请选择服务类型', trigger: 'blur' }
],
Organizationaltype: [
{ required: true, message: '请选择组织类型', trigger: 'blur' }
],
AdministratorName: [
{ required: true, message: '请输入管理员姓名', trigger: 'blur' }
],
AdministratorIDCard: [
{ required: true, message: '身份证号不能为空不能为空', trigger: 'blur' },
{ pattern: /^(?:[1-9]\d{5}(18|19|20)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)|[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3})$/, message: '请输入正确的身份证号', trigger: 'blur' }
],
Administratorphone: [
{ required: true, message: '管理员电话不能为空不能为空', trigger: 'blur' },
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
],
fileList: [
{ required: true, message: '请上传组织封面图', trigger: 'blur' }
],
Organizational: [
{ required: true, message: '请填写组织介绍', trigger: 'blur' },
{ min:50, message: '请输入50字以上的介绍', trigger: 'blur'}
],
points: [
{ required: true, message: '请选择活动积分', trigger: 'blur' }
],
sumUp: [
{ required: true, message: '请输入活动总结', trigger: 'blur' }
],
activityImgs: [
{ required: true, message: '请选择活动照片', trigger: 'blur' }
]
}
},
},
destroyed () {
map = null
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.item_width_1 {
width: 634px;
/deep/.tox .tox-dialog {
z-index: 20000;
}
}
.u-item-width-normal{
width: 222px;
}
.tinymce_view {
::v-deep .tox .tox-dialog {
z-index: 2000000000;
}
}
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
>p {
margin: 0;
}
}
</style>

136
src/views/modules/volunteer/VoluntaryOrganization/process.vue

@ -0,0 +1,136 @@
<template>
<div>
<div style="display: flex;white-space: nowrap; padding: 30px;" >
<el-form style="padding-left: 50px;" :label-position="labelPosition" :model="tableData">
<el-form-item label="组织名称">
<div> {{ tableData.OrganizationName }}</div>
</el-form-item>
<el-form-item label="服务类型">
{{ tableData.Servicetype }}
</el-form-item>
<el-form-item label="组织类型">
{{ tableData.Organizationaltype}}
</el-form-item>
<el-form-item label="管理员姓名">
{{ tableData.AdministratorName}}
</el-form-item>
<el-form-item label="身份证号">
{{ tableData.AdministratorIDCard }}
</el-form-item>
<el-form-item label="手机号">
{{ tableData.Administratorphone }}
</el-form-item>
<el-form-item label="所属组织">
{{ tableData.agencyName }}
</el-form-item>
<el-form-item label="详细地址">
{{ tableData.address }}
</el-form-item>
<el-form-item label="组织介绍">
{{ tableData.Organizational}}
</el-form-item>
<el-form-item label="附件">
{{ tableData.address}}
</el-form-item>
<el-form-item label="申请时间">
{{ tableData.redeemerOrgName}}
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<div style="display: flex; margin-bottom: 20px; margin-left: 75px;">
<h4>审核结果</h4>
<div style="display: flex; justify-items:center; align-items: center;">
<el-radio v-model="radio" label="1" style="margin-right:20px">通过</el-radio>
<div class="flex flex-x flex-center2">
<el-radio v-model="radio" label="2" style="margin-right: 10px;">不通过</el-radio>
<el-input v-if="radio == '2'" type="number" v-model="stockQty" style="width: 200px;"
placeholder="请说明原因"></el-input>
</div>
</div>
</div>
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" v-if="formType != 'detail'" type="primary" :disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { requestPost,requestGet } from "@/js/dai/request";
export default {
name: "see",
data() {
return {
radio:'1',
stockQty:"",
labelPosition: 'right',
tableData: [],
awardId:""
};
},
props:{
VolunteerList:{
type: Object,
default: () => {}
}
},
created() {
console.log(this.VolunteerList,"list");
this.tableData=this.VolunteerList
// this.awardId=this.list.id
// this.getTableData()
},
methods: {
//
handleCancle(){
this.$emit('handleprocesslClose')
},
//
handleComfirm(){
this.$emit('handleprocesslClose')
},
getTableData() {
console.log(this.formData);
const url = "/voluntary/pointsAward/admin/detail";
let params = {
id:this.awardId
}
requestGet(url, params).then((res) =>{
console.log(res,"res");
if(res.code===0){
console.log("列表请求成功!!!!!!!!!!!!!!");
console.log(res.data, "data");
this.tableData = res.data
console.log(this.tableData, "this.tableData");
}
})
// const { data, code, msg } = requestGet(url, params)
// console.log(data,"data");
// if (code === 0) {
// console.log("");
// console.log(data,"data");
// this.tableData = data
// console.log(this.tableData,"this.tableData");
// } else {
// }
},
},
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>

2
src/views/modules/volunteer/activityArchive/add.vue

@ -35,7 +35,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="活动积分" prop="integral" >
<el-input-number v-model="formData.points" :min="1" :max="10" label="描述文字"></el-input-number>
<el-input-number v-model="formData.points" :min="1" label="描述文字"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">

2
src/views/modules/volunteer/activityArchive/select.vue

@ -35,7 +35,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="活动积分" prop="integral" >
<el-input-number v-model="formData.points" :min="1" :max="10" label="描述文字"></el-input-number>
<el-input-number v-model="formData.points" :min="1" label="描述文字"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">

Loading…
Cancel
Save