jiangyy 3 years ago
parent
commit
29542d9f13
  1. 4
      src/views/modules/base/epidemic/antiInfo.vue
  2. 826
      src/views/modules/communityService/fuwujilu/addForm.vue
  3. 484
      src/views/modules/communityService/fuwujilu/detailForm.vue
  4. 665
      src/views/modules/shequzhili/event/cpts/process-form-demand.vue

4
src/views/modules/base/epidemic/antiInfo.vue

@ -292,7 +292,7 @@
:close-on-press-escape="false"
:title="formTitle"
width="1150px"
:z-index="1000"
:z-index="2000"
top="5vh"
class="dialog-h"
@closed="handleCnalceForm">
@ -863,7 +863,7 @@ export default {
let params = {
id
}
this.$message.error('111')
// this.$message.error('111')
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {

826
src/views/modules/communityService/fuwujilu/addForm.vue

File diff suppressed because it is too large

484
src/views/modules/communityService/fuwujilu/detailForm.vue

@ -1,511 +1,377 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div v-if="initLoading"
class="m-row">
<div v-if="initLoading" class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">服务名称</span>
<span>{{ formData.serviceName||'--' }}</span>
<span>{{ formData.serviceName || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务组织</span>
<span>{{ serviceOrgName||'--' }}</span>
<span>{{ serviceOrgName || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务范围</span>
<span>{{ formData.gridIdListName ||'--' }}</span>
<span>{{ formData.gridIdListName || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">政策依据</span>
<span>{{ formData.policyTitle||'--' }}</span>
<el-button v-if="formData.policyId"
style="margin-left: 10px"
type="primary"
size="small"
@click="handlePersonList">预览</el-button>
<span>{{ formData.policyTitle || "--" }}</span>
<el-button
v-if="formData.policyId"
style="margin-left: 10px"
type="primary"
size="small"
@click="handlePersonList"
>预览</el-button
>
</div>
<div class="info-prop">
<span class="info-title-2">经办人</span>
<span>{{ formData.principalName||'--' }}</span>
<span>{{ formData.principalName || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">联系方式</span>
<span>{{ formData.principalContact||'--' }}</span>
<span>{{ formData.principalContact || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务时间</span>
<span>{{ formData.serviceTimeStart||'--' }}</span>
<span>{{ formData.serviceTimeEnd||'--' }}</span>
<span>{{ formData.serviceTimeStart || "--" }}</span
>
<span>{{ formData.serviceTimeEnd || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">备注</span>
<span>{{ formData.remark||'--' }}</span>
<span>{{ formData.remark || "--" }}</span>
</div>
<div v-show="formData.serviceStatus==='completed'">
<div v-show="formData.serviceStatus === 'completed'">
<h3 class="d-h3">反馈内容</h3>
<div class="info-prop">
<span class="info-title-2">服务目标</span>
<span>{{ feedbackFormData.serviceGoal||'--' }}</span>
<span>{{ feedbackFormData.serviceGoal || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务效果</span>
<span>{{ feedbackFormData.serviceEffect||'--' }}</span>
<span>{{ feedbackFormData.serviceEffect || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务人数</span>
<span>{{ feedbackFormData.servicePeopleNumber||0 }}</span>
<span>{{ feedbackFormData.servicePeopleNumber || 0 }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务状态</span>
<span>{{ feedbackFormData.serviceStatusShow||'--' }}</span>
<span>{{ feedbackFormData.serviceStatusShow || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">满意度</span>
<span>{{ feedbackFormData.satisfactionShow||'--' }}</span>
<span>{{ feedbackFormData.satisfactionShow || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地理位置</span>
<span>{{ feedbackFormData.address||'--' }}</span>
<span>{{ feedbackFormData.address || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
</div>
</div>
<div class="info-prop">
<span class="info-title-2">附件</span>
<file-list v-if="fileList.length>0"
:fileList="fileList"></file-list>
<file-list
v-if="fileList.length > 0"
:fileList="fileList"
></file-list>
<span v-else>--</span>
</div>
</div>
</div>
</div>
</div>
<div class="div-btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small" @click="handleCancle"> </el-button>
</div>
<el-dialog v-if="showPersonList"
:visible.sync="showPersonList"
:append-to-body="true"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'政策预览'"
width="1150px"
top="5vh"
class="dialog-h"
@closed="showPersonList = false">
<person-list ref="ref_detail_form"
:policyId="policyId"
:ruleList="ruleList"
@handleOk="handleOk"
@handleClose="handleClose">
<el-dialog
v-if="showPersonList"
:visible.sync="showPersonList"
:append-to-body="true"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'政策预览'"
width="1150px"
top="5vh"
class="dialog-h"
@closed="showPersonList = false"
>
<person-list
ref="ref_detail_form"
:policyId="policyId"
:ruleList="ruleList"
@handleOk="handleOk"
@handleClose="handleClose"
>
</person-list>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request";
import personList from "../policy/personList";
import fileList from '@/views/components/fileList'
import fileList from "@/views/components/fileList";
import daiMap from "@/utils/dai-map";
var map;
let loading; //
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data () {
data() {
return {
initLoading: false,
keyWords: '',
keyWords: "",
formData: {},
feedbackFormData: {
serviceProjectId: '',// id
serviceName: '',
serviceGoal: '',//
serviceEffect: '',//
servicePeopleNumber: null,//
serviceStatus: 'completed',// in_servicecompleted:
satisfaction: '',//:bad:good:perfect
longitude: '',//
latitude: '',//
address: '',
fileList: [],//
serviceProjectId: "", // id
serviceName: "",
serviceGoal: "", //
serviceEffect: "", //
servicePeopleNumber: null, //
serviceStatus: "completed", // in_servicecompleted:
satisfaction: "", //:bad:good:perfect
longitude: "", //
latitude: "", //
address: "",
fileList: [], //
},
policyId: "",
showPersonList: false,
ruleList: [],
policyList: [],
}
};
},
components: { personList, fileList },
async mounted () {
await this.getPolicyList()
async mounted() {
await this.getPolicyList();
// if (this.serviceRecordId) {//
await this.loadInfo()
this.initLoading = true
await this.loadInfo();
this.initLoading = true;
if (this.formData.serviceStatus === 'completed') {
if (
this.formData.serviceStatus === "completed" &&
this.feedbackFormData.latitude
) {
this.$nextTick(() => {
this.initMap()
})
this.initMap();
});
}
},
methods: {
diaDestroy () {
if (map) {
map.destroy()
}
},
diaDestroy() {},
//
async handlePersonList () {
async handlePersonList() {
if (!this.formData.policyId) {
this.$message.info('请先选择政策')
return false
this.$message.info("请先选择政策");
return false;
}
this.policyId = this.formData.policyId
await this.loadRuleList()
this.policyId = this.formData.policyId;
await this.loadRuleList();
this.showPersonList = true;
},
async loadRuleList () {
async loadRuleList() {
const url = "/heart/policy/rulelist/" + this.policyId;
const url = "/heart/policy/rulelist/" + this.policyId
let params = {};
let params = {}
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.ruleList = data
this.ruleList = data;
} else {
this.$message.error(msg)
this.$message.error(msg);
}
},
handleClose () {
this.showPersonList = false
handleClose() {
this.showPersonList = false;
},
async getPolicyList() {
const url = "/heart/policy/policyListSelect";
async getPolicyList () {
const url = '/heart/policy/policyListSelect'
let params = {}
let params = {};
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.policyList = data
this.policyList = data;
} else {
this.$message.error(msg)
this.$message.error(msg);
}
},
//
async loadInfo () {
const url = '/heart/icServiceRecordV2/detail'
async loadInfo() {
const url = "/heart/icServiceRecordV2/detail";
let params = {
serviceRecordId: this.serviceRecordId
}
serviceRecordId: this.serviceRecordId,
};
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.formData = { ...data }
this.formData.serviceRecordId = this.serviceRecordId
this.feedbackFormData = { ...data.feedback }
this.formData.policyName = ''
this.formData.gridIdListName = ''
this.feedbackFormData.serviceStatusShow = ''
this.feedbackFormData.satisfactionShow = ''
let arr = []
this.formData.gridIdList.forEach(element => {
arr.push(element.objectName)
this.formData = { ...data };
this.formData.serviceRecordId = this.serviceRecordId;
this.feedbackFormData = { ...data.feedback };
this.formData.policyName = "";
this.formData.gridIdListName = "";
this.feedbackFormData.serviceStatusShow = "";
this.feedbackFormData.satisfactionShow = "";
let arr = [];
this.formData.gridIdList.forEach((element) => {
arr.push(element.objectName);
});
this.formData.gridIdListName = arr.join(',')
this.statusArray.forEach(element => {
this.formData.gridIdListName = arr.join(",");
this.statusArray.forEach((element) => {
if (this.formData.serviceStatus === element.value) {
this.feedbackFormData.serviceStatusShow = element.label
this.feedbackFormData.serviceStatusShow = element.label;
}
});
this.satisfyArray.forEach(element => {
this.satisfyArray.forEach((element) => {
if (this.feedbackFormData.satisfaction === element.value) {
this.feedbackFormData.satisfactionShow = element.label
this.feedbackFormData.satisfactionShow = element.label;
}
});
this.policyList.forEach(element => {
this.policyList.forEach((element) => {
if (this.formData.policyId === element.policyId) {
this.formData.policyName = element.title
this.formData.policyName = element.title;
}
});
this.fileList = []
if (data.feedback && data.feedback.fileList && data.feedback.fileList.length > 0) {
data.feedback.fileList.forEach(element => {
this.fileList = [];
if (
data.feedback &&
data.feedback.fileList &&
data.feedback.fileList.length > 0
) {
data.feedback.fileList.forEach((element) => {
let obj = {
name: element.name,
format: element.format,
url: element.url,
type: element.type
}
this.fileList.push(obj)
type: element.type,
};
this.fileList.push(obj);
});
}
} else {
this.$message.error(msg)
this.$message.error(msg);
}
},
handleCancle () {
this.resetData()
this.$emit('diaDetailClose')
handleCancle() {
this.resetData();
this.$emit("diaDetailClose");
},
// init
initMap () {
//
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude
longitude = this.formData.longitude
}
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
var center = new window.TMap.LatLng(latitude, latitude)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
initMap() {
let { latitude, longitude } = this.feedbackFormData;
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
map = new daiMap(
document.getElementById("app_detail"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
this.formData.address = result.result.address
//
});
},
handleOk () {
this.showPersonList = false
handleOk() {
this.showPersonList = false;
},
resetData () {
this.formData = {}
resetData() {
this.formData = {};
},
//
startLoading () {
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close()
loading.close();
}
}
},
},
computed: {
dataRule () {
dataRule() {
return {
serviceTimeStart: [
{ required: true, message: '服务时间不能为空', trigger: 'blur' }
{ required: true, message: "服务时间不能为空", trigger: "blur" },
],
}
};
},
},
props: {
serviceRecordId: {
type: String,
required: true
required: true,
},
serviceOrgName: {
type: String,
required: true
required: true,
},
satisfyArray: {
type: Array,
default () {
return []
}
default() {
return [];
},
},
statusArray: {
type: Array,
default () {
return []
}
default() {
return [];
},
},
}
}
},
};
</script>
<style lang="scss" scoped >
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/detail-main.scss";
</style>
</style>

665
src/views/modules/shequzhili/event/cpts/process-form-demand.vue

@ -1,10 +1,12 @@
<template>
<div class="">
<el-form ref="ref_form"
:inline="false"
:model="formData"
:rules="dataRule"
label-width="100px">
<el-form
ref="ref_form"
:inline="false"
:model="formData"
:rules="dataRule"
label-width="100px"
>
<!-- <el-form-item label="事件分类"
label-width="150px"
prop="categoryId">
@ -17,105 +19,124 @@
:show-all-levels="false"
@change="handleChangeCate"></el-cascader>
</el-form-item> -->
<el-form-item label="服务内容"
label-width="150px"
:class="{'form-item':source==='visiual'}"
prop="content">
<div :class="{'visiual-form':source==='visiual'}">
<el-input v-model="formData.content"
:autosize="{ minRows: 2, maxRows: 10 }"
type="textarea"
clearable
class="cell-width-area"
placeholder="请输入内容"></el-input>
<el-form-item
label="服务内容"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
prop="content"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<el-input
v-model="formData.content"
:autosize="{ minRows: 2, maxRows: 10 }"
type="textarea"
clearable
class="cell-width-area"
placeholder="请输入内容"
></el-input>
</div>
</el-form-item>
<el-form-item label="服务类型"
label-width="150px"
:class="{'form-item':source==='visiual'}"
prop="categoryCode">
<div :class="{'visiual-form':source==='visiual'}">
<el-cascader v-model="formData.categoryCode"
:options="demandOptions"
clearable
class="cell-width-1"
@change="handleCateSlect"></el-cascader>
<el-form-item
label="服务类型"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
prop="categoryCode"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<el-cascader
v-model="formData.categoryCode"
:options="demandOptions"
clearable
class="cell-width-1"
@change="handleCateSlect"
></el-cascader>
</div>
</el-form-item>
<el-form-item label="服务时间"
label-width="150px"
:class="{'form-item':source==='visiual'}"
prop="wantServiceTime">
<div :class="{'visiual-form':source==='visiual'}">
<el-date-picker v-model="formData.wantServiceTime"
type="datetime"
class="cell-width-1"
clearable
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间">
<el-form-item
label="服务时间"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
prop="wantServiceTime"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<el-date-picker
v-model="formData.wantServiceTime"
type="datetime"
class="cell-width-1"
clearable
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
>
</el-date-picker>
</div>
</el-form-item>
<el-form-item label="需求人"
label-width="150px"
:class="{'form-item':source==='visiual'}"
prop="demandUserName">
<div :class="{'visiual-form':source==='visiual'}">
<el-input v-model="formData.demandUserName"
class="cell-width-1"></el-input>
<el-form-item
label="需求人"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
prop="demandUserName"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<el-input
v-model="formData.demandUserName"
class="cell-width-1"
></el-input>
</div>
</el-form-item>
<el-form-item label="联系电话"
label-width="150px"
:class="{'form-item':source==='visiual'}"
prop="demandUserMobile">
<div :class="{'visiual-form':source==='visiual'}">
<el-input v-model="formData.demandUserMobile"
class="cell-width-1"></el-input>
<el-form-item
label="联系电话"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
prop="demandUserMobile"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<el-input
v-model="formData.demandUserMobile"
class="cell-width-1"
></el-input>
</div>
</el-form-item>
<el-form-item label="服务地点"
prop="serviceLocation"
:class="{'form-item':source==='visiual'}"
label-width="150px"
style="display: block">
<div :class="{'visiual-form':source==='visiual'}">
<el-input class="cell-width-1"
v-model="formData.serviceLocation">
<el-form-item
label="服务地点"
prop="serviceLocation"
:class="{ 'form-item': source === 'visiual' }"
label-width="150px"
style="display: block"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<el-input class="cell-width-1" v-model="formData.serviceLocation">
</el-input>
</div>
</el-form-item>
<el-form-item label="位置坐标"
:class="{'form-item':source==='visiual'}"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<el-form-item
label="位置坐标"
:class="{ 'form-item': source === 'visiual' }"
prop="longitude"
label-width="150px"
style="display: block"
>
<div style="width: 500px">
<div class="div_map">
<div id="app_map">
</div>
<div id="app_map"></div>
<div class="div_searchmap">
<el-input class="cell-width-map"
maxlength="50"
size="mini"
placeholder="请输入关键字"
v-model="keyWords">
<el-input
class="cell-width-map"
maxlength="50"
size="mini"
placeholder="请输入关键字"
v-model="keyWords"
>
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="mini"
@click="handleSearchMap">查询</el-button>
<el-button
style="margin-left: 10px"
type="primary"
size="mini"
@click="handleSearchMap"
>查询</el-button
>
</div>
</div>
@ -136,103 +157,108 @@
</div>
</el-form-item>
<el-form-item label="门牌号"
:class="{'form-item':source==='visiual'}"
label-width="150px"
prop="locationDetail">
<div :class="{'visiual-form':source==='visiual'}">
<el-input v-model="formData.locationDetail"
class="cell-width-1"></el-input>
<el-form-item
label="门牌号"
:class="{ 'form-item': source === 'visiual' }"
label-width="150px"
prop="locationDetail"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<el-input
v-model="formData.locationDetail"
class="cell-width-1"
></el-input>
</div>
</el-form-item>
<el-form-item label="服务方"
:class="{'form-item':source==='visiual'}"
label-width="150px"
prop="serverId">
<el-form-item
label="服务方"
:class="{ 'form-item': source === 'visiual' }"
label-width="150px"
prop="serverId"
>
<template>
<div :class="[{'single-select':source==='visiual'},'sel-service']">
<el-select v-model="formData.serviceType"
class="cell-width-1"
placeholder="请选择"
clearable
@change="handleServiceChange('add', $event)">
<el-option v-for="item in serviceOptions"
:key="item.value"
:label="item.label"
:value="item.value">
<div
:class="[{ 'single-select': source === 'visiual' }, 'sel-service']"
>
<el-select
v-model="formData.serviceType"
class="cell-width-1"
placeholder="请选择"
clearable
@change="handleServiceChange('add', $event)"
>
<el-option
v-for="item in serviceOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
-
<el-select v-model="formData.serverId"
class="cell-width-1"
filterable
placeholder="请选择"
clearable>
<el-option v-for="item in serviceOptiondList"
:key="item.value"
:label="item.label"
:value="item.value">
<el-select
v-model="formData.serverId"
class="cell-width-1"
filterable
placeholder="请选择"
clearable
>
<el-option
v-for="item in serviceOptiondList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
</template>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request";
import formVltHelper from "dai-js/tools/formVltHelper";
import { isCard } from "@/utils/validate";
import daiMap from "@/utils/dai-map";
let loading; //
var map
var search
var markers
var infoWindowList
var geocoder //
var map;
function iniFmData () {
function iniFmData() {
return {
operationType: '2',//[0: 1: 2:]
icEventId: '',//Id
gridId: '',//
categoryCode: '',//
parentCode: '',//
content: '',// 1000
reportType: 'self_help',// communitybuilding_caption;party;self_help
reportUserName: '',//
reportUserMobile: '',//
reportTime: '',//
demandUserId: '',// user.idic_resi_user.id
demandUserName: '',//
demandUserMobile: '',//
wantServiceTime: '',//
serviceType: '',
serverId: '',
locationDetail: '',
serviceLocation: '',//
latitude: '',//
longitude: '',//
operationType: "2", //[0: 1: 2:]
icEventId: "", //Id
gridId: "", //
categoryCode: "", //
parentCode: "", //
content: "", // 1000
reportType: "self_help", // communitybuilding_caption;party;self_help
reportUserName: "", //
reportUserMobile: "", //
reportTime: "", //
demandUserId: "", // user.idic_resi_user.id
demandUserName: "", //
demandUserMobile: "", //
wantServiceTime: "", //
serviceType: "",
serverId: "",
locationDetail: "",
serviceLocation: "", //
latitude: "", //
longitude: "", //
// categoryId: ''
};
}
export default {
data () {
data() {
return {
btnDisable: false,
customerId: localStorage.getItem("customerId"),
demandOptions: [],
serviceOptions: [
],
serviceOptions: [],
serviceOptiondList: [],
casOptions: [],
@ -241,25 +267,25 @@ export default {
selCateObj: {},
optionProps: {
multiple: false,
value: 'id',
label: 'name',
children: 'subCategory',
value: "id",
label: "name",
children: "subCategory",
},
formData: iniFmData(),
okflag: false,
//
keyWords: '',
keyWords: "",
eventDetailCopy: {}
eventDetailCopy: {},
};
},
components: {},
computed: {
dataRule () {
computed: {
dataRule() {
return {
// categoryId: [
// { required: true, message: "", trigger: "blur" },
@ -285,14 +311,11 @@ export default {
serverId: [
{ required: true, message: "服务方不能为空", trigger: "blur" },
],
};
},
},
props: {
props: {
demandUserId: {
type: String,
default: "",
@ -312,156 +335,142 @@ export default {
eventDetailData: {
type: Object,
default () {
return {}
}
default() {
return {};
},
},
source: {//manage visiual
source: {
//manage visiual
type: String,
default: 'manage'
}
default: "manage",
},
},
watch: {
demandUserName: function (val) {
this.formData.reportUserName = val
this.formData.demandUserName = val
this.formData.reportUserName = val;
this.formData.demandUserName = val;
},
demandUserMobile: function (val) {
this.formData.reportUserMobile = val
this.formData.demandUserMobile = val
this.formData.reportUserMobile = val;
this.formData.demandUserMobile = val;
},
demandUserId: function (val) {
this.formData.demandUserId = val
this.formData.demandUserId = val;
},
},
created () {
},
async mounted () {
const { user } = this.$store.state
this.agencyId = user.agencyId
this.getCategoryList();
this.getDemandOptions();
this.getServiceOption()
// this.formData = { ...this.formDataTemp }
this.initMap()
async mounted() {
const { user } = this.$store.state;
this.agencyId = user.agencyId;
if (this.eventId) {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
this.formData.reportUserMobile = this.eventDetailCopy.mobile
this.formData.reportUserName = this.eventDetailCopy.name
this.formData.reportTime = this.eventDetailCopy.happenTime
this.formData.gridId = this.eventDetailCopy.gridId
this.formData.demandUserId = this.eventDetailCopy.reportUserId
this.formData.demandUserName = this.eventDetailCopy.name
this.formData.demandUserMobile = this.eventDetailCopy.mobile
if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) {
this.formData.reportUserMobile = this.eventDetailCopy.mobile;
this.formData.reportUserName = this.eventDetailCopy.name;
this.formData.reportTime = this.eventDetailCopy.happenTime;
this.formData.gridId = this.eventDetailCopy.gridId;
this.formData.demandUserId = this.eventDetailCopy.reportUserId;
this.formData.demandUserName = this.eventDetailCopy.name;
this.formData.demandUserMobile = this.eventDetailCopy.mobile;
if (
this.eventDetailCopy.parentCategoryId &&
this.eventDetailCopy.categoryId
) {
// this.selCategoryArray = []
// this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId)
// this.selCategoryArray.push(this.eventDetailCopy.categoryId)
// this.formData.categoryId = this.eventDetailCopy.categoryId
// this.selCateObj = {
// name: this.eventDetailCopy.categoryName,
// id: this.eventDetailCopy.categoryId
// }
}
} else {
this.formData.demandUserName = this.demandUserName
this.formData.demandUserMobile = this.demandUserMobile
this.formData.demandUserId = this.demandUserId
this.formData.demandUserName = this.demandUserName;
this.formData.demandUserMobile = this.demandUserMobile;
this.formData.demandUserId = this.demandUserId;
}
this.getCategoryList();
this.getDemandOptions();
this.getServiceOption();
this.initMap();
},
methods: {
async getCategoryList() {
const url = "/gov/issue/issueprojectcategorydict/list";
async getCategoryList () {
const url = "/gov/issue/issueprojectcategorydict/list"
let params = {};
let params = {}
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
let treeDataNew = this.filterTree(data)
let treeDataNew = this.filterTree(data);
//
++this.iscascaderShow
this.casOptions = []
this.casOptions = treeDataNew
++this.iscascaderShow;
this.casOptions = [];
this.casOptions = treeDataNew;
} else {
this.$message.error(msg)
this.$message.error(msg);
}
},
handleChangeCate () {
console.log(this.$refs["myCascader"].getCheckedNodes()[0].data)
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
this.formData.categoryId = this.selCateObj.id
handleChangeCate() {
console.log(this.$refs["myCascader"].getCheckedNodes()[0].data);
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data;
this.formData.categoryId = this.selCateObj.id;
},
//
filterTree (arr) {
let childs = arr
filterTree(arr) {
let childs = arr;
for (let i = childs.length; i--; i > 0) {
if (childs[i].subCategory) {
if (childs[i].subCategory.length) {
this.filterTree(childs[i].subCategory)
this.filterTree(childs[i].subCategory);
} else {
delete childs[i].subCategory
delete childs[i].subCategory;
}
}
}
return arr
return arr;
},
async getDemandOptions () {
const url = "/heart/icresidemanddict/demandoption"
let params = {}
async getDemandOptions() {
const url = "/heart/icresidemanddict/demandoption";
let params = {};
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.demandOptions = this.getFlagData(
this.getTreeData(data),
"usableFlag"
);
} else {
this.$message.error(msg)
this.$message.error(msg);
}
},
async getServiceOption () {
const url = "/sys/dict/data/dictlist"
let params = { dictType: "user_demand_service_type", }
async getServiceOption() {
const url = "/sys/dict/data/dictlist";
let params = { dictType: "user_demand_service_type" };
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.serviceOptions = data;
} else {
this.$message.error(msg)
this.$message.error(msg);
}
},
getTreeData (data) {
getTreeData(data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
@ -476,7 +485,8 @@ export default {
});
return arr;
},
getFlagData (data, flag) {
getFlagData(data, flag) {
if (!Array.isArray(data)) return [];
let arr1 = data.filter((item) => item[flag]);
let arr2 = arr1.map((item) => {
@ -488,7 +498,7 @@ export default {
return arr2;
},
handleCateSlect (val) {
handleCateSlect(val) {
console.log("val", val);
if (val.length === 1) {
this.demandOptions.forEach((item) => {
@ -501,7 +511,7 @@ export default {
}
},
handleServiceChange (type, val) {
handleServiceChange(type, val) {
if (val === "social_org") {
if (type === "add") {
this.getServiceuserList(val, "add_demand");
@ -513,8 +523,7 @@ export default {
}
},
async getServiceuserList (serviceType, query) {
async getServiceuserList(serviceType, query) {
if (!serviceType) return false;
const { demandUserId } = this.formData;
const params = {
@ -523,154 +532,83 @@ export default {
queryPurpose: query,
};
const url = "/heart/userdemand/servicelist";
const url = "/heart/userdemand/servicelist"
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.serviceOptiondList = data.filter(
(item) => item.value != demandUserId
);
} else {
this.$message.error(msg)
this.$message.error(msg);
}
},
async getDemandInfo () {
this.okflag = false
async getDemandInfo() {
this.okflag = false;
this.$refs["ref_form"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
// this.formData.categoryId = this.selCateObj.id
} else {
this.okflag = true
this.okflag = true;
}
});
},
resetData() {},
resetData () {
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_map'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
initMap() {
let { latitude, longitude } = this.$store.state.user;
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
map = new daiMap(
document.getElementById("app_map"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
//
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
handleMoveCenter () {
async handleMoveCenter() {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
const { lat, lng } = map.getCenter();
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;
}
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
async handleSearchMap() {
const { msg, data } = await map.searchNearby(this.keyWords);
if (msg == "success") {
const { lat, lng } = data;
map.setCenter(lat, lng);
map.setMarker(lat, lng);
this.formData.latitude = lat;
this.formData.longitude = lng;
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
this.$message.error("未检索到相关位置坐标");
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
this.formData.serviceLocation = result.result.address
//
});
},
//
startLoading () {
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -678,7 +616,7 @@ export default {
});
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
@ -688,14 +626,11 @@ export default {
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/a_customize.scss";
@import "@/assets/scss/modules/shequzhili/event-info.scss";
</style>
<style>
.el-dialog__body {
padding: 0 10px 20px !important;

Loading…
Cancel
Save