Browse Source

党群服务中心操作按钮颜色冲突2

shibei_master
dai 3 years ago
parent
commit
93dc6c0055
  1. 49
      src/assets/scss/modules/management/secretaryLog.scss
  2. 70
      src/js/store/index.js
  3. 22
      src/utils/index.js
  4. 126
      src/views/main-content.vue
  5. 338
      src/views/modules/secretaryLog/difficulty/difficultyDetail.vue
  6. 560
      src/views/modules/secretaryLog/difficulty/difficultyForm.vue
  7. 379
      src/views/modules/secretaryLog/difficulty/difficultyList.vue
  8. 341
      src/views/modules/secretaryLog/humanisticCare/careDetail.vue
  9. 251
      src/views/modules/secretaryLog/humanisticCare/careForm.vue
  10. 295
      src/views/modules/secretaryLog/humanisticCare/careList.vue
  11. 358
      src/views/modules/secretaryLog/workLog/form.vue
  12. 474
      src/views/modules/secretaryLog/workLog/index.vue
  13. 20
      src/views/tips.vue

49
src/assets/scss/modules/management/secretaryLog.scss

@ -0,0 +1,49 @@
.div_form {
margin: 20px 50px;
}
.form_item {
display: flex;
justify-content: flex-start;
font-size: 15px;
.item_title {
text-align: right;
flex: 0 0 150px;
line-height: 36px;
}
.item_content {
margin-left: 30px;
line-height: 36px;
}
.attach_item {
display: flex;
justify-content: flex-start;
align-items: center;
margin-left: 30px;
line-height: 36px;
.attach_item_name {
margin-left: 10px;
color: #3e8ef7;
text-decoration: underline;
}
.attach_item_name:hover {
cursor: pointer;
color: #1461c7;
}
}
}
.div_btn {
margin-top: 15px;
display: flex;
width: 100%;
justify-content: center;
.btn_right {
margin-left: 50px;
}
}

70
src/js/store/index.js

@ -4,9 +4,11 @@ import cloneDeep from "lodash/cloneDeep";
import user from "./modules/user";
import app from "./modules/app";
import tagsView from "./modules/tagsView";
import { requestPost } from "@/js/dai/request";
import { dateFormats } from "@/utils/index";
Vue.use(Vuex);
let interTimer = null
export default new Vuex.Store({
namespaced: true,
state: {
@ -38,6 +40,7 @@ export default new Vuex.Store({
activeName: "",
},
tipsList: [],
tipsTime: [],
inIframe: window.self !== window.top,
},
modules: {
@ -52,5 +55,70 @@ export default new Vuex.Store({
state[key] = cloneDeep(window.SITE_CONFIG["storeState"][key]);
});
},
SET_TIPS_LIST(state, tipsList) {
let _list = state.tipsList
// state.tipsList = _list.concat(tipsList)
state.tipsList = tipsList
},
SET_TIPS_TIME(state, time) {
state.tipsTime = time
}
},
actions: {
clearInter() {
clearInterval(interTimer)
},
setInterval({ commit, dispatch, state }) {
interTimer = setInterval(() => {
const _t = dateFormats('YYYY-mm-dd HH:MM', (new Date(new Date().toLocaleDateString()).getTime()))
const _tt = new Date(_t).getTime()
console.log('230000---', _t)
const t = dateFormats('YYYY-mm-dd HH:MM', (new Date().getTime()))
const nt = new Date(t).getTime()
// 判断当前时间是否为 00:00
if (nt == _tt) {
dispatch('setTipsTime')
return
}
let times = state.tipsTime
console.log('nt---000', nt)
state.tipsTime.forEach((item, index) => {
const _t = new Date(item).getTime()
if (_t == nt) {
clearInterval(interTimer)
dispatch('setTipsList', item)
times.splice(index, 1)
commit('SET_TIPS_TIME', times)
}
})
}, 10000)
},
setTipsList({ commit }, time) {
return new Promise(async (resolve, reject) => {
const url = '/gov/project/memoAttr/memosToRemind'
const params = {
remindTime: time || ''
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
commit('SET_TIPS_LIST', data)
resolve()
} else reject(msg)
})
},
setTipsTime({ commit, dispatch }) {
return new Promise(async (resolve, reject) => {
if (interTimer) clearInterval(interTimer)
const url = '/gov/project/memoAttr/memoTime'
const { data, code, msg } = await requestPost(url)
if (code === 0) {
commit('SET_TIPS_TIME', data)
if (data.length > 0) dispatch('setInterval')
resolve()
} else reject(msg)
})
}
}
});

22
src/utils/index.js

@ -93,3 +93,25 @@ export function treeDataTranslate(data, id = 'id', pid = 'pid') {
}
return res
}
// 时间格式化
export function dateFormats(fmt, date) {
let ret
const _date = new Date(date)
const opt = {
'Y+': _date.getFullYear().toString(), // 年
'm+': (_date.getMonth() + 1).toString(), // 月
'd+': _date.getDate().toString(), // 日
'H+': _date.getHours().toString(), // 时
'M+': _date.getMinutes().toString(), // 分
'S+': _date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
}
for (const k in opt) {
ret = new RegExp('(' + k + ')').exec(fmt)
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length === 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, '0')))
}
}
return fmt
}

126
src/views/main-content.vue

@ -70,24 +70,29 @@
</keep-alive>
</template>
<Tips v-for="item in $store.state.tipsList" :key="item" @look="handleLook(item)" />
<template v-for="(item, index) in msgList">
<Tips :key="item.memoId"
:info="item"
:show="msgList.length > 0 ? true : false"
@look="handleLook(item, index)" @close="handleClose(item, index)" />
</template>
<el-dialog :title="dialogTitle"
:visible.sync="dialogFormVisible"
:close-on-click-modal="false"
top="5vh"
width="70%"
class="dialog-h"
append-to-body>
<work-form v-if="formType == 'work_diary'" ref="ref_form"
@dialogCancle="dialogFormVisible = false; formType=''" />
<h-form v-if="formType == 'concern'" ref="concern_form"
@dialogCancle="dialogFormVisible = false; formType=''" />
<d-form v-if="formType == 'difficulty'" ref="difficulty_form"
@dialogCancle="dialogFormVisible = false; formType=''" />
<el-dialog title="收货地址" :visible.sync="dialogFormVisible" :close-on-click-modal="false" append-to-body>
<el-form :model="form">
<el-form-item label="活动名称" :label-width="formLabelWidth">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="活动区域" :label-width="formLabelWidth">
<el-select v-model="form.region" placeholder="请选择活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="dialogFormVisible = false"> </el-button>
</div>
</el-dialog>
</main>
</template>
@ -96,19 +101,26 @@
import { isURL } from "@/utils/validate";
import Cookie from "js-cookie";
import Tips from './tips.vue'
import { requestPost } from "@/js/dai/request";
import workForm from './modules/secretaryLog/workLog/form.vue'
import dForm from './modules/secretaryLog/difficulty/difficultyForm.vue'
import hForm from './modules/secretaryLog/humanisticCare/careForm.vue'
export default {
components: {
Tips
Tips,
workForm,
dForm,
hForm
},
data() {
return {
dialogTitle: '',
dialogFormVisible: false,
iframeUrl: "",
token: "",
customerId: "",
form: {
},
form: {},
formType: '',
formLabelWidth: '120px',
tipsList: []
};
@ -120,7 +132,12 @@ export default {
this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId");
// this.loopTips()
this.loopTips()
},
computed: {
msgList() {
return this.$store.state.tipsList
}
},
methods: {
changeCustomerName(customerName) {
@ -207,17 +224,64 @@ export default {
iframe.postMessage({ name: "lalalal" }, "*");
},
loopTips() {
let id = 1
this.timer = setInterval(() => {
id = id + 1
if (id == 5) clearInterval(this.timer)
this.tipsList.push(id)
console.log('id------0', id)
}, 1000)
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
// let id = 1
// this.timer = setInterval(() => {
// id = id + 1
// if (id == 5) clearInterval(this.timer)
// this.tipsList.push(id)
// console.log('id------0', id)
// }, 1000)
},
handleLook(id) {
console.log('look-----', id)
async closeTips(memoId) {
const url = '/gov/project/memoAttr/setReaded'
const params = {
memoId
}
const { data, code, msg } = await requestPost(url, params)
if (code != 0) this.$message.error(msg)
},
async getInfo(item) {
const urls = {
work_diary: '/gov/project/memoWorkDiary',
concern: '/gov/project/memoConcern',
difficulty: '/gov/project/memoDifficulty/detail'
}
const params = {
id: item.memoId,
readFlag: 0
}
const { data, code, msg } = await requestPost(urls[item.type], params)
if (code == 0) {
this.form = { ...data }
} else this.$message.error(msg)
},
handleClose(item, index) {
console.log('close-----', item)
this.$store.state.tipsList.splice(index, 1)
this.closeTips(item.memoId)
},
async handleLook(item, index) {
console.log('look-----', item)
const formType = {
work_diary: 'ref_form',
concern: 'concern_form',
difficulty: 'difficulty_form'
}
this.dialogTitle = item.typeName
// await this.getInfo(item)
this.formType = item.type
this.dialogFormVisible = true
console.log('ref0-----', this.formType)
this.$nextTick(() => {
console.log('this.$refs-----', this.$refs)
this.$refs[formType[item.type]].initForm('look', item.memoId)
this.$store.state.tipsList.splice(index, 1)
this.closeTips(item.memoId)
})
}
},
};

338
src/views/modules/secretaryLog/difficulty/difficultyDetail.vue

@ -1,99 +1,63 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
class="form">
<el-form-item label="服务事项"
label-width="150px"
prop="serviceMatterShow">
<span class="detail_span">{{formData.serviceMatterShow}}</span>
</el-form-item>
<el-form-item label="单位名称"
prop="unitId"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.unitName}}</span>
</el-form-item>
<el-form-item label="活动标题"
prop="title"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.title}}</span>
</el-form-item>
<el-form-item label="活动目标"
prop="target"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.target}}</span>
</el-form-item>
<el-form-item label="活动内容"
prop="target"
label-width="150px"
style="display: block">
<p class="text_p"
v-html="formData.content"></p>
</el-form-item>
<el-form-item label="服务人数"
style="display: block"
prop="peopleCount"
label-width="150px">
<span class="detail_span">{{formData.peopleCount}}</span>
</el-form-item>
<el-form-item label="活动时间"
style="display: block"
prop="activityTime"
label-width="150px">
<span class="detail_span">{{formData.activityTime}}</span>
</el-form-item>
<el-form-item label="活动地址"
prop="address"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.address}}</span>
</el-form-item>
<el-form-item label="活动坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div id="app">
</div>
<div class="dialog-h-content scroll-h div_form">
<div class="form_item">
<div class="item_title">关怀类型</div>
<div class="item_content"> {{formData.concernType}}</div>
</div>
<div class="form_item">
<div class="item_title">关怀人员</div>
<div class="item_content"> {{formData.resiName}}</div>
</div>
<div v-if="formData.phone"
class="form_item">
<div class="item_title">电话</div>
<div class="item_content"> {{formData.phone}}</div>
</div>
<div v-if="formData.address"
class="form_item">
<div class="item_title">地址</div>
<div class="item_content"> {{formData.address}}</div>
</div>
<div class="form_item">
<div class="item_title">关怀事项</div>
<div class="item_content"> {{formData.content}}</div>
</div>
<div v-if="formData.scheduledTime"
class="form_item">
<div class="item_title">预计关怀时间</div>
<div class="item_content"> {{formData.scheduledTime}}</div>
</div>
<div v-if="formData.remindTime"
class="form_item">
<div class="item_title">提醒时间</div>
<div class="item_content"> {{formData.remindTime}}</div>
</div>
<div v-if="formData.status"
class="form_item">
<div class="item_title">状态</div>
<div class="item_content"> {{formData.status==='0'?'未完成':'已完成'}}</div>
</div>
<div v-if="formData.attachmentList.length>0"
class="form_item">
<div class="item_title">附件</div>
<div>
<div class="attach_item"
v-for="(item, index) in formData.attachmentList"
:key="index">
<i class="el-icon-tickets"></i>
<div class="attach_item_name"
@click="handleFileDownload(item)">{{item.fileName}}</div>
</div>
</div>
</el-form-item>
</div>
<el-form-item label="活动结果"
prop="result"
label-width="150px"
style="display: block">
<p class="text_p"
v-html="formData.result"></p>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
@ -101,166 +65,88 @@
@click="handleCancle"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data () {
return {
formData: {},
difficultyId: '',
formData: {
content: '',//
resolveWay: '',//
remark: '',//
scheduledTime: '',//yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
},
}
},
components: {},
mounted () {
this.initMap()
},
methods: {
handleCancle () {
this.$emit('diaClose')
},
async initForm (row) {
this.startLoading()
for (let item of this.serviceList) {
if (row.serviceMatter === item.value) {
row.serviceMatterShow = item.label
}
}
this.formData = { ...row }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.difficultyId = row.id
await this.loadFormData()
this.endLoading()
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
async loadFormData () {
geocoder = new TMap.service.Geocoder(); //
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/detail'
const url = '/gov/project/memoDifficulty/detail'
let params = {
id: this.difficultyId,
readFlag: '0',
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
} else {
this.$message.error(msg)
}
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleCancle () {
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)
this.$emit('diaClose')
},
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
//
});
//
handleFileDownload (file) {
var a = document.createElement('a');
var event = new MouseEvent('click');
a.download = file.fileName;
console.log(a)
a.href = file.attachmentUrl;
a.dispatchEvent(event);
},
//
startLoading () {
loading = Loading.service({
@ -278,34 +164,14 @@ export default {
}
},
computed: {},
props: {
serviceList: {
type: Array,
default: []
},
}
props: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
@import "@/assets/scss/modules/management/secretaryLog.scss";
</style>
<style lang="scss" scoped>
.detail_span {
width: 500px;
font-weight: bold;
text-align: left;
margin: 0 0;
font-size: 16px;
}
.text_p {
margin: 0 0;
border: 3px;
> p {
margin: 0 0;
}
}
</style>

560
src/views/modules/secretaryLog/difficulty/difficultyForm.vue

@ -6,73 +6,24 @@
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType === 'detail'"
:disabled="formType==='look'"
class="form">
<el-form-item label="服务事项"
label-width="150px"
prop="serviceMatterList">
<el-checkbox-group class="item_width_1"
style="display:flex;flex-wrap:wrap"
v-model="formData.serviceMatterList">
<el-checkbox v-for="item in serviceList"
:key="item.value"
:label="item.value">{{item.label}}</el-checkbox>
</el-checkbox-group>
<!-- <el-select class="item_width_1"
v-model="formData.serviceMatter"
placeholder="请选择"
clearable>
<el-option v-for="item in serviceList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
</el-form-item>
<el-form-item label="单位名称"
prop="unitIdList"
label-width="150px"
style="display: block">
<el-checkbox-group class="item_width_1"
style="display:flex;flex-wrap:wrap"
v-model="formData.unitIdList">
<el-checkbox v-for="item in unitList"
:key="item.value"
:label="item.value">{{item.label}}</el-checkbox>
</el-checkbox-group>
<!-- <el-select class="item_width_1"
v-model="formData.unitId"
placeholder="请选择"
clearable>
<el-option v-for="item in unitList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
</el-form-item>
<el-form-item label="活动标题"
prop="title"
<el-form-item label="内容"
prop="content"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
type="textarea"
maxlength="100"
show-word-limit
placeholder="请输入活动标题"
v-model="formData.title">
</el-input>
:rows="3"
placeholder="请输入内容"
v-model="formData.content"></el-input>
</el-form-item>
<el-form-item label="活动目标"
prop="target"
<el-form-item label="解决方式"
prop="resolveWay"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
@ -80,122 +31,78 @@
maxlength="100"
show-word-limit
:rows="3"
placeholder="请输入活动目标,不超过100字"
v-model="formData.target"></el-input>
</el-form-item>
<el-form-item label="活动内容"
prop="target"
label-width="150px"
style="display: block">
<div class="item_width_1">
<Tinymce class="tinymce_view "
v-if="formType!='detail'"
v-model="formData.content"
:height="250"
placeholder="在这里输入文字" />
<p v-else
class="text_p"
v-html="formData.content"></p>
</div>
placeholder="请输入解决方式"
v-model="formData.resolveWay"></el-input>
</el-form-item>
<el-form-item label="服务人数"
<el-form-item label="预计处理时间"
style="display: block"
prop="peopleCount"
prop="scheduledTime"
label-width="150px">
<el-input-number class="item_width_1"
v-model="formData.peopleCount"
:min="0"
label="服务人数"></el-input-number>
<el-date-picker class="item_width_1"
v-model="formData.scheduledTime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
type="datetime"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动时间"
<el-form-item label="提醒时间"
style="display: block"
prop="activityTime"
prop="remindTime"
label-width="150px">
<el-date-picker v-model="formData.activityTime"
value-format="yyyy-MM-dd HH:mm:ss"
<el-date-picker class="item_width_1"
v-model="formData.remindTime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
type="datetime"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动坐标"
prop="longitude"
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<div class="item_width_1">
<div class="div_map">
<div id="app">
</div>
<div class="div_searchmap">
<el-input class="item_width_4"
maxlength="50"
size="mini"
placeholder="请输入关键字"
v-model="keyWords">
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="mini"
@click="handleSearchMap">查询</el-button>
</div>
</div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="formData.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="formData.latitude">
</el-input>
</div>
</div>
</el-form-item>
<el-form-item label="活动地址"
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
v-model="formData.address">
</el-input>
type="textarea"
maxlength="100"
show-word-limit
:rows="3"
placeholder="请输入备注"
v-model="formData.remark"></el-input>
</el-form-item>
<el-form-item label="活动结果"
prop="result"
<el-form-item class="block"
label-width="150px"
style="display: block">
<div class="item_width_1">
<Tinymce class="tinymce_view "
v-if="formType!='detail'"
v-model="formData.result"
:height="250"
placeholder="在这里输入文字" />
<p v-else
class="text_p"
v-html="formData.result"></p>
</div>
style="display: block"
label="添加附件"
prop="attach">
<el-upload class="upload-demo"
:action="uploadUlr"
accept=".doc,.pdf,.xls,.docx,.xlsx"
:on-success="handleFileSuccess"
:on-remove="handleFileRemove"
:on-preview="handleFileDownload"
:limit="3"
:before-upload="beforeUpload"
:file-list="fileList">
<el-button size="small"
:disabled="fileList.length==3"
type="primary">点击上传</el-button>
<div slot="tip"
class="el-upload__tip">最多三个附件只能上传wordexcelpdf文件</div>
</el-upload>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
v-if="formType != 'detail'"
<el-button v-if="formType != 'look'" size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
@ -207,13 +114,9 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import Tinymce from '@c/tinymce/index.vue'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
@ -223,97 +126,66 @@ export default {
btnDisable: false,
keyWords: '',
activityId: '',
difficultyId: '',
formData: {
serviceMatter: '',//
serviceMatterList: [],
unitId: '',//ID
unitIdList: [],
title: '',//
target: '',//
content: '',//
activityTime: '',//
peopleCount: 0,//
result: '', //
address: '', //
longitude: 36.0722275, //
latitude: 120.38945519 //
content: '',//
resolveWay: '',//
remark: '',//
scheduledTime: '',//yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
},
serviceList: []
fileList: [],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadvariedfile',
dialogImageUrl: '',
dialogVisible: false
}
},
components: { Tinymce },
components: {},
mounted () {
this.initMap()
},
methods: {
async initForm (type, activityId) {
async initForm (type, difficultyId) {
this.startLoading()
this.$refs.ref_form.resetFields();
//
await this.loadService()
this.formType = type
if (activityId) {
this.activityId = activityId
this.formData.id = activityId
if (difficultyId) {
this.difficultyId = difficultyId
this.formData.id = difficultyId
await this.loadFormData()
} else {
map.setCenter(new TMap.LatLng(36.0722275, 120.38945519))
this.setMarker(36.0722275, 120.38945519)
}
this.endLoading()
},
//
async loadService () {
const url = "/heart/serviceitem/dict-list"
let params = {
type: 'usable'
// parentCategoryCode: '1010'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.serviceList = data
} else {
this.$message.error(msg)
}
},
//
async loadFormData () {
const url = '/heart/icpartyactivity/detail'
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/detail'
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/detail'
const url = '/gov/project/memoDifficulty/detail'
let params = {
id: this.activityId
id: this.difficultyId,
readFlag: '0',
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
console.log(this.formData.content)
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')
if (data.attachmentList) {
data.attachmentList.forEach(element => {
element.name = element.fileName
element.type = element.attachmentType
element.size = element.attachmentSize
});
this.fileList = data.attachmentList
}
console.log(this.formData.content)
map.setCenter(new TMap.LatLng(parseFloat(this.formData.latitude), parseFloat(this.formData.longitude)))
this.setMarker(this.formData.latitude, this.formData.longitude)
} else {
this.$message.error(msg)
}
@ -324,20 +196,38 @@ export default {
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => {
this.$refs['ref_form'].validate(async (valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
this.addActivity()
await this.addDifficulty()
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
}
})
},
async addActivity () {
let url = '/heart/icpartyactivity/save'
// let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/save"
async addDifficulty () {
if (this.fileList.length > 0) {
this.formData.attachmentList = this.fileList
}
let url = ''
if (this.formType === 'add') {
url = '/gov/project/memoDifficulty/save'
// url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/save"
this.formData.id = ''
} else {
url = '/gov/project/memoDifficulty/update'
// url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/update"
}
const { data, code, msg } = await requestPost(url, this.formData)
@ -364,133 +254,69 @@ export default {
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
beforeUpload (file) {
const array = file.name.split('.')
const extension = array[array.length - 1]
if (extension !== 'xls'
&& extension !== 'xlsx'
&& extension !== 'doc'
&& extension !== 'docx'
&& extension !== 'pdf') {
this.$message.error('只能上传word、excel、pdf文件!')
return false
}
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
},
geocoder = new TMap.service.Geocoder(); //
handleFileRemove (file) {
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
if (file && file.status === "success") {
this.fileList.splice(this.fileList.findIndex(item => item.uid === file.uid), 1)
}
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleFileSuccess (res, file) {
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('未检索到相关位置坐标')
}
})
},
if (res.code === 0 && res.msg === 'success') {
const array = file.name.split('.')
const fileType = array[array.length - 1]
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)
file.fileName = file.name
file.attachmentUrl = res.data.url
file.attachmentSize = file.size
file.attachmentType = 'doc'
file.attachmentFormat = fileType
this.fileList.push(file)
console.log(this.fileList)
} else this.$message.error(res.msg)
},
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
//
});
//
handleFileDownload (file) {
var a = document.createElement('a');
var event = new MouseEvent('click');
a.download = file.fileName;
console.log(a)
a.href = file.attachmentUrl;
a.dispatchEvent(event);
},
resetData () {
this.activityId = ''
this.keyWords = ''
this.difficultyId = ''
this.formData = {
serviceMatter: '',//
serviceMatterList: [],
unitId: '',//ID
unitIdList: [],
title: '',//
target: '',//
content: '',//
activityTime: '',//
peopleCount: 0,//
result: '', //
address: '', //
longitude: 36.0722275, //
latitude: 120.38945519 //
content: '',//
resolveWay: '',//
remark: '',//
scheduledTime: '',//yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
}
},
//
@ -512,44 +338,20 @@ export default {
computed: {
dataRule () {
return {
serviceMatterList: [
{ required: true, message: '服务事项不能为空', trigger: 'blur' }
],
unitIdList: [
{ required: true, message: '单位名称不能为空', trigger: 'blur' },
],
title: [
{ required: true, message: '活动标题不能为空', trigger: 'blur' }
],
target: [
{ required: true, message: '活动目标不能为空', trigger: 'blur' }
resiName: [
{ required: true, message: '关怀人员不能为空', trigger: 'blur' }
],
content: [
{ required: true, message: '活动内容不能为空', trigger: 'blur' }
],
activityTime: [
{ required: true, message: '活动时间不能为空', trigger: 'blur' }
{ required: true, message: '关怀事项不能为空', trigger: 'blur' },
],
result: [
{ required: true, message: '活动结果不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' }
],
longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' }
]
}
},
},
props: {
unitList: {
type: Array,
default: []
},
// serviceList: {
// type: Array,
@ -566,31 +368,11 @@ export default {
<style lang="scss" scoped>
.item_width_1 {
width: 560px;
/deep/.tox .tox-dialog {
z-index: 20000;
}
}
.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;
.item_width_2 {
width: 220px;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
.text_p {
margin: 0;
padding: 0 10px;

379
src/views/modules/secretaryLog/difficulty/difficultyList.vue

@ -6,58 +6,36 @@
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="单位名称"
prop="unitId">
<el-select class="item_width_1"
v-model="formData.unitId"
size="small"
placeholder="全部"
clearable>
<el-option v-for="item in unitList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="服务事项"
prop="serviceMatter">
<el-select class="item_width_2"
v-model="formData.serviceMatter"
size="small"
placeholder="请选择"
clearable>
<el-option v-for="item in serviceList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="活动标题"
prop="title">
<el-input v-model="formData.title"
<el-form-item label="内容摘要"
prop="content">
<el-input v-model="formData.content"
size="small"
class="item_width_1"
clearable
placeholder="请输入内容">
placeholder="请输入内容摘要">
</el-input>
</el-form-item>
<el-form-item label="活动时间"
<el-form-item label="预计处理时间"
prop="scheduledStartTime">
<el-date-picker v-model="scheduledTimeRange"
size="small"
type="daterange"
value-format="yyyy-MM-dd"
@change="handleScheduledTimeChange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="创建时间"
prop="startTime">
<el-date-picker v-model="timeRange"
size="small"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd"
@change="handleTimeChange"
range-separator="至"
start-placeholder="开始时间"
@ -82,26 +60,6 @@
class="diy-button--add"
size="small"
@click="handleAdd">新增</el-button>
<!--
<el-upload ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
class="diy-button--delete">导入</el-button>
</el-upload>
<el-button style="float:left"
class="diy-button--reset"
size="small"
@click="handleExport">导出</el-button>-->
</div>
@ -118,68 +76,74 @@
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="unitName"
<el-table-column prop="content"
header-align="center"
align="center"
label="单位名称"
width="180">
label="内容"
min-width="180">
<template slot-scope="scope">
<div class="twoline">{{scope.row.content}}</div>
</template>
</el-table-column>
<el-table-column prop="title"
<el-table-column prop="resolveWay"
header-align="center"
align="center"
label="活动标题"
min-width="180">
label="解决方式"
min-width="120">
</el-table-column>
<el-table-column prop="address"
<el-table-column prop="scheduledTime"
header-align="center"
align="center"
label="活动地址"
min-width="230">
label="预计处理时间"
width="170">
</el-table-column>
<el-table-column prop="peopleCount"
<el-table-column prop="remindTime"
header-align="center"
align="center"
label="服务人数"
width="100">
label="提醒时间"
width="170">
</el-table-column>
<el-table-column prop="activityTime"
<el-table-column prop="remark"
header-align="center"
align="center"
label="活动时间"
width="230">
label="备注"
width="180">
</el-table-column>
<el-table-column prop="activityTime"
<el-table-column prop="createdTime"
header-align="center"
align="center"
label="来源"
width="100">
<template slot-scope="scope">
<span v-if="scope.row.actId">小程序</span>
<span v-else>管理平台</span>
</template>
label="创建时间"
width="170">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="140"
width="170"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text"
style="color:#1C6AFD;text-decoration: underline;"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button v-if="!scope.row.actId"
type="text"
style="color:#00A7A9;text-decoration: underline;"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button v-if="!scope.row.actId"
type="text"
class="div-table-button--detail"
size="small"
@click="handleExport(scope.row)">导出</el-button>
<el-button type="text"
style="color:#D51010;text-decoration: underline;"
class="div-table-button--delete"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
@ -207,7 +171,6 @@
class="dialog-h"
@closed="diaClose">
<difficulty-form ref="ref_form"
:unitList="unitList"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></difficulty-form>
</el-dialog>
@ -215,13 +178,12 @@
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'活动详情'"
:title="'详情'"
width="950px"
top="5vh"
class="dialog-h"
@closed="detailClosed">
@closed="diaClose">
<difficulty-detail ref="ref_detail"
:serviceList="serviceList"
@diaClose="diaClose"></difficulty-detail>
</el-dialog>
@ -246,52 +208,24 @@ export default {
pageSize: 10,
pageNo: 0,
tableLoading: false,
agencyId: '',
unitList: [],//list
serviceList: [
{
id: "1",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。'
},
{
id: "2",
name: '积极配合'
},
{
id: "3",
name: '积极配合社区安全巡查员进行'
},
{
id: "4",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。并具备安全意识及设备设施'
},
],//list
pickerOptions: { //
disabledDate (time) {
return time.getTime() > (Date.now() - (24 * 60 * 60 * 1000))
}
},
scheduledTimeRange: [],
timeRange: [],
unitId: '',
formData: {
unitId: '',
title: '',
serviceMatter: '',
startTime: '',
endTime: ''
content: '',//
startTime: '',//yyyy-mm-dd
endTime: '',//yyyy-mm-dd
scheduledStartTime: '',//yyyy-mm-dd
scheduledEndTime: '',// yyyy-mm-dd
},
tableData: [],
//form
formShow: false,
formTitle: '新增活动',
formTitle: '新增',
detailShow: false,
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
}
},
@ -302,14 +236,7 @@ export default {
},
async mounted () {
//
await this.loadService()
const { user } = this.$store.state
this.agencyId = user.agencyId
//
await this.loadUnit()
//
await this.loadTable()
},
@ -319,52 +246,12 @@ export default {
this.loadTable()
},
async loadUnit () {
const url = "/heart/icpartyunit/option"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/option"
let params = {
agencyId: this.agencyId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.unitList = data
} else {
this.$message.error(msg)
}
},
//
async loadService () {
const url = "/heart/serviceitem/dict-list"
let params = {
// parentCategoryCode: '1010'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.serviceList = data
} else {
this.$message.error(msg)
}
},
async loadTable () {
this.tableLoading = true
const url = "/heart/icpartyactivity/search"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list"
const url = "/gov/project/memoDifficulty/page"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/page"
let params = {
agencyId: this.agencyId,
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formData
@ -384,21 +271,24 @@ export default {
diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
if (this.formShow) {
this.$refs.ref_form.resetData()
this.formShow = false
} else {
this.detailShow = false
}
detailClosed () {
this.detailShow = false
},
handleDetail (row) {
// this.detailShow = true
this.formTitle = '详情'
this.formShow = true
this.formTitle = '详情'
this.$nextTick(() => {
this.$refs.ref_form.initForm('look', row.id)
// this.$refs.ref_detail.initForm(row)
this.$refs.ref_form.initForm('detail', row.id)
})
},
@ -435,7 +325,7 @@ export default {
type: "warning"
})
.then(() => {
this.deleteActivity(row)
this.deleteDifficulty(row)
})
.catch(err => {
if (err == "cancel") {
@ -445,15 +335,15 @@ export default {
});
},
async deleteActivity (row) {
const url = "/heart/icpartyactivity/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/delete"
async deleteDifficulty (row) {
const url = "/gov/project/memoDifficulty/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/delete"
let ids = [row.id]
let params = {
id: row.id
ids: ids
}
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, ids)
if (code === 0) {
this.$message({
@ -469,14 +359,14 @@ export default {
//
resetSearch () {
this.scheduledTimeRange = []
this.timeRange = []
this.formData = {
gridId: '',
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
content: '',//
startTime: '',//yyyy-mm-dd
endTime: '',//yyyy-mm-dd
scheduledStartTime: '',//yyyy-mm-dd
scheduledEndTime: '',// yyyy-mm-dd
}
this.pageSize = 10
this.pageNo = 0
@ -484,23 +374,18 @@ export default {
},
//
async handleExport () {
let title = '联建活动列表'
const url = "/heart/icpartyactivity/export"
let params = {
agencyId: this.agencyId,
async handleExport (row) {
let title = '难点堵点详情'
let url = `/gov/project/memoDifficulty/${row.id}/exportWord`
...this.formData
}
let params = {}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.xls')
this.download(data, title + '.doc')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
@ -535,72 +420,27 @@ export default {
},
//
beforeUpload (file) {
this.files = file;
const isText = file.type === 'application/vnd.ms-excel'
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
handleScheduledTimeChange (time) {
if (time) {
this.formData.scheduledStartTime = time[0]
this.formData.scheduledEndTime = time[1]
if (!isText && !isTextComputer) {
this.$message.error('请选择正确格式的文件')
return false
} else {
this.fileName = file.name;
return true
}
},
//
handleExceed (files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`)
},
async uploadFile () {
this.loading = true
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
}
//
this.$refs['upload'].clearFiles()
var url = '/heart/icpartyactivity/import'
let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip
const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.formData.scheduledStartTime = ''
this.formData.scheduledEndTime = ''
this.loadTable()
} else {
this.$message.error(msg)
}
},
handleTimeChange (time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-')
const endTimeArray = util.dateFormatter(time[1], 'date').split('-')
this.formData.startTime = time[0]
this.formData.endTime = time[1]
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00'
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59'
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.formData.startTime = ''
this.formData.endTime = ''
// this.startTimeShow = ''
// this.endTimeShow = ''
}
},
@ -634,12 +474,10 @@ export default {
computed: {
tableHeight () {
return (this.clientHeight - 430)
return (this.clientHeight - 380)
},
rowHeight () {
return (this.clientHeight - 200) + 'px'
},
...mapGetters(['clientHeight'])
},
watch: {
@ -665,9 +503,6 @@ export default {
.item_width_1 {
width: 260px;
}
.item_width_2 {
width: 495px;
}
.div_table {
background: #ffffff;
@ -681,9 +516,6 @@ export default {
}
}
.div_btn {
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
@ -691,4 +523,11 @@ export default {
margin-top: 10px;
margin-right: 50px;
}
.twoline {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
</style>

341
src/views/modules/secretaryLog/humanisticCare/careDetail.vue

@ -1,99 +1,64 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
class="form">
<el-form-item label="服务事项"
label-width="150px"
prop="serviceMatterShow">
<span class="detail_span">{{formData.serviceMatterShow}}</span>
</el-form-item>
<el-form-item label="单位名称"
prop="unitId"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.unitName}}</span>
</el-form-item>
<el-form-item label="活动标题"
prop="title"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.title}}</span>
</el-form-item>
<el-form-item label="活动目标"
prop="target"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.target}}</span>
</el-form-item>
<el-form-item label="活动内容"
prop="target"
label-width="150px"
style="display: block">
<p class="text_p"
v-html="formData.content"></p>
</el-form-item>
<el-form-item label="服务人数"
style="display: block"
prop="peopleCount"
label-width="150px">
<span class="detail_span">{{formData.peopleCount}}</span>
</el-form-item>
<el-form-item label="活动时间"
style="display: block"
prop="activityTime"
label-width="150px">
<span class="detail_span">{{formData.activityTime}}</span>
</el-form-item>
<el-form-item label="活动地址"
prop="address"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.address}}</span>
</el-form-item>
<el-form-item label="活动坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div id="app">
</div>
<div class="dialog-h-content scroll-h div_form">
<div v-if="formData.concernType"
class="form_item">
<div class="item_title">关怀类型</div>
<div class="item_content"> {{formData.concernType}}</div>
</div>
<div class="form_item">
<div class="item_title">关怀人员</div>
<div class="item_content"> {{formData.resiName}}</div>
</div>
<div v-if="formData.phone"
class="form_item">
<div class="item_title">电话</div>
<div class="item_content"> {{formData.phone}}</div>
</div>
<div v-if="formData.address"
class="form_item">
<div class="item_title">地址</div>
<div class="item_content"> {{formData.address}}</div>
</div>
<div class="form_item">
<div class="item_title">关怀事项</div>
<div class="item_content"> {{formData.content}}</div>
</div>
<div v-if="formData.scheduledTime"
class="form_item">
<div class="item_title">预计关怀时间</div>
<div class="item_content"> {{formData.scheduledTime}}</div>
</div>
<div v-if="formData.remindTime"
class="form_item">
<div class="item_title">提醒时间</div>
<div class="item_content"> {{formData.remindTime}}</div>
</div>
<div v-if="formData.status"
class="form_item">
<div class="item_title">状态</div>
<div class="item_content"> {{formData.status==='0'?'未完成':'已完成'}}</div>
</div>
<div v-if="formData.attachmentList.length>0"
class="form_item">
<div class="item_title">附件</div>
<div>
<div class="attach_item"
v-for="(item, index) in formData.attachmentList"
:key="index">
<i class="el-icon-tickets"></i>
<div class="attach_item_name"
@click="handleFileDownload(item)">{{item.fileName}}</div>
</div>
</div>
</el-form-item>
</div>
<el-form-item label="活动结果"
prop="result"
label-width="150px"
style="display: block">
<p class="text_p"
v-html="formData.result"></p>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
@ -101,166 +66,92 @@
@click="handleCancle"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data () {
return {
formData: {},
careId: '',
formData: {
content: '',//怀
concernType: '',//怀
resiName: '',//怀
status: '',// 0 1
phone: '',//
address: '',//
scheduledTime: '',//怀yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
},
}
},
components: {},
mounted () {
this.initMap()
},
methods: {
handleCancle () {
this.$emit('diaClose')
},
async initForm (row) {
this.startLoading()
for (let item of this.serviceList) {
if (row.serviceMatter === item.value) {
row.serviceMatterShow = item.label
}
}
this.formData = { ...row }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.careId = row.id
await this.loadFormData()
this.endLoading()
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
async loadFormData () {
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern'
const url = '/gov/project/memoConcern'
let params = {
id: this.careId,
readFlag: '0',
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
geocoder = new TMap.service.Geocoder(); //
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
} else {
this.$message.error(msg)
}
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleCancle () {
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)
this.$emit('diaClose')
},
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
//
});
//
handleFileDownload (file) {
var a = document.createElement('a');
var event = new MouseEvent('click');
a.download = file.fileName;
console.log(a)
a.href = file.attachmentUrl;
a.dispatchEvent(event);
},
//
startLoading () {
loading = Loading.service({
@ -278,34 +169,14 @@ export default {
}
},
computed: {},
props: {
serviceList: {
type: Array,
default: []
},
}
props: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
@import "@/assets/scss/modules/management/secretaryLog.scss";
</style>
<style lang="scss" scoped>
.detail_span {
width: 500px;
font-weight: bold;
text-align: left;
margin: 0 0;
font-size: 16px;
}
.text_p {
margin: 0 0;
border: 3px;
> p {
margin: 0 0;
}
}
</style>

251
src/views/modules/secretaryLog/humanisticCare/careForm.vue

@ -6,50 +6,50 @@
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType === 'detail'"
:disabled="formType==='look'"
class="form">
<el-form-item label="关怀类型"
prop="title"
prop="concernType"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
placeholder="请输入关怀类型"
v-model="formData.title">
v-model="formData.concernType">
</el-input>
</el-form-item>
<el-form-item label="关怀人员"
prop="title"
prop="resiName"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
placeholder="请输入关怀人员"
v-model="formData.title">
v-model="formData.resiName">
</el-input>
</el-form-item>
<el-form-item label="电话"
prop="title"
prop="phone"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
placeholder="请输入电话"
v-model="formData.title">
v-model="formData.phone">
</el-input>
</el-form-item>
<el-form-item label="地址"
prop="title"
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入地址"
v-model="formData.title">
v-model="formData.address">
</el-input>
</el-form-item>
<el-form-item label="关怀事项"
prop="target"
prop="content"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
@ -58,27 +58,29 @@
show-word-limit
:rows="3"
placeholder="请输入关怀事项"
v-model="formData.target"></el-input>
v-model="formData.content"></el-input>
</el-form-item>
<el-form-item label="预计关怀时间"
style="display: block"
prop="activityTime"
prop="scheduledTime"
label-width="150px">
<el-date-picker class="item_width_1"
v-model="formData.activityTime"
value-format="yyyy-MM-dd HH:mm:ss"
<el-date-picker class="item_width_2"
v-model="formData.scheduledTime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
type="datetime"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item label="提醒时间"
style="display: block"
prop="activityTime"
prop="remindTime"
label-width="150px">
<el-date-picker class="item_width_1"
v-model="formData.activityTime"
value-format="yyyy-MM-dd HH:mm:ss"
<el-date-picker class="item_width_2"
v-model="formData.remindTime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
type="datetime"
placeholder="选择时间">
</el-date-picker>
@ -86,10 +88,10 @@
<el-form-item label="状态"
label-width="150px"
prop="serviceMatterList">
prop="status">
<el-select class="item_width_2"
v-model="formData.serviceMatter"
v-model="formData.status"
placeholder="请选择"
clearable>
<el-option class="item_width_2"
@ -103,13 +105,13 @@
</el-form-item>
<el-form-item class="block"
label-width="150px"
style="display: block"
label="添加附件"
prop="attach">
<el-upload class="upload-demo"
:action="uploadUlr"
:data="{customerId:customerId}"
accept=".doc,.pdf,.xls,.docx,.xlsx"
:on-success="handleFileSuccess"
:on-remove="handleFileRemove"
@ -118,9 +120,10 @@
:before-upload="beforeUpload"
:file-list="fileList">
<el-button size="small"
:disabled="fileList.length==3"
type="primary">点击上传</el-button>
<div slot="tip"
class="el-upload__tip">只能上传wordexcelpdf文件</div>
class="el-upload__tip">最多三个附件只能上传wordexcelpdf文件</div>
</el-upload>
</el-form-item>
@ -130,8 +133,7 @@
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
v-if="formType != 'detail'"
<el-button v-if="formType != 'look'" size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
@ -154,44 +156,33 @@ export default {
formType: 'add', // addeditdetail
stateList: [
{
value: '1',
value: 1,
label: '已完成'
},
{
value: '2',
value: 0,
label: '未完成'
},
],
btnDisable: false,
activityId: '',
careId: '',
formData: {
serviceMatter: '',//
serviceMatterList: [],
unitId: '',//ID
unitIdList: [],
title: '',//
target: '',//
content: '',//
activityTime: '',//
peopleCount: 0,//
result: '', //
content: '',//怀
concernType: '',//怀
resiName: '',//怀
status: '',// 0 1
phone: '',//
address: '',//
scheduledTime: '',//怀yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
},
},
serviceList: [],
fileList: [
// {
// name: 'food.jpeg',
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
// }, {
// name: 'food2.jpeg',
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
// }
],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/upload-guide-file',
fileList: [],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadvariedfile',
dialogImageUrl: '',
dialogVisible: false
@ -204,47 +195,92 @@ export default {
methods: {
async initForm (type, activityId) {
async initForm (type, careId) {
this.startLoading()
this.$refs.ref_form.resetFields();
//
await this.loadService()
this.$refs['ref_form'].resetFields();
this.formType = type
if (activityId) {
this.activityId = activityId
this.formData.id = activityId
if (careId) {
this.careId = careId
this.formData.id = careId
await this.loadFormData()
} else {
}
this.endLoading()
},
async loadFormData () {
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern'
const url = '/gov/project/memoConcern'
let params = {
id: this.careId,
readFlag: '0',
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
if (data.attachmentList) {
data.attachmentList.forEach(element => {
element.name = element.fileName
element.type = element.attachmentType
element.size = element.attachmentSize
});
this.fileList = data.attachmentList
}
} else {
this.$message.error(msg)
}
},
async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => {
this.$refs['ref_form'].validate(async (valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
this.addActivity()
await this.addCare()
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
}
})
},
async addActivity () {
let url = '/heart/icpartyactivity/save'
// let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/save"
async addCare () {
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
// if (regPhone.test(this.formData.mobile) === false) {
// this.btnDisable = false
// this.$message({
// type: 'warning',
// message: ''
// })
// return false;
// }
if (this.fileList.length > 0) {
this.formData.attachmentList = this.fileList
}
let url = ''
if (this.formType === 'add') {
url = '/gov/project/memoConcern/save'
// url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/save"
this.formData.id = ''
} else {
url = '/gov/project/memoConcern/update'
// url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/update"
}
const { data, code, msg } = await requestPost(url, this.formData)
@ -284,14 +320,6 @@ export default {
return false
}
// if (!isLt2M) {
// this.$message.warning(' 5MB!')
// return
// }
// return false // false
},
handleFileRemove (file) {
@ -307,8 +335,12 @@ export default {
const array = file.name.split('.')
const fileType = array[array.length - 1]
file.url = res.data.url
file.type = fileType
file.fileName = file.name
file.attachmentUrl = res.data.url
file.attachmentSize = file.size
file.attachmentType = 'doc'
file.attachmentFormat = fileType
this.fileList.push(file)
console.log(this.fileList)
} else this.$message.error(res.msg)
@ -319,28 +351,27 @@ export default {
var a = document.createElement('a');
var event = new MouseEvent('click');
a.download = file.name;
a.download = file.fileName;
console.log(a)
a.href = file.url;
a.href = file.attachmentUrl;
a.dispatchEvent(event);
},
resetData () {
this.activityId = ''
this.careId = ''
this.formData = {
serviceMatter: '',//
serviceMatterList: [],
unitId: '',//ID
unitIdList: [],
title: '',//
target: '',//
content: '',//
activityTime: '',//
peopleCount: 0,//
result: '', //
content: '',//怀
concernType: '',//怀
resiName: '',//怀
status: '',// 0 1
phone: '',//
address: '',//
scheduledTime: '',//怀yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
}
},
@ -363,42 +394,38 @@ export default {
computed: {
dataRule () {
return {
serviceMatterList: [
{ required: true, message: '服务事项不能为空', trigger: 'blur' }
resiName: [
{ required: true, message: '关怀人员不能为空', trigger: 'blur' }
],
unitIdList: [
{ required: true, message: '单位名称不能为空', trigger: 'blur' },
content: [
{ required: true, message: '关怀事项不能为空', trigger: 'blur' },
],
title: [
{ required: true, message: '活动标题不能为空', trigger: 'blur' }
concernType: [
{ required: false },
],
target: [
{ required: true, message: '活动目标不能为空', trigger: 'blur' }
status: [
{ required: false },
],
content: [
{ required: true, message: '活动内容不能为空', trigger: 'blur' }
phone: [
{ required: false },
],
address: [
{ required: false },
],
activityTime: [
{ required: true, message: '活动时间不能为空', trigger: 'blur' }
scheduledTime: [
{ required: false },
],
result: [
{ required: true, message: '活动结果不能为空', trigger: 'blur' }
remindTime: [
{ required: false },
],
longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' }
]
}
},
},
props: {
unitList: {
type: Array,
default: []
},
// serviceList: {
// type: Array,

295
src/views/modules/secretaryLog/humanisticCare/careList.vue

@ -7,8 +7,8 @@
:label-width="'100px'">
<div>
<el-form-item label="关怀类型"
prop="title">
<el-input v-model="formData.title"
prop="concernType">
<el-input v-model="formData.concernType"
size="small"
class="item_width_1"
clearable
@ -17,8 +17,8 @@
</el-form-item>
<el-form-item label="关怀人员"
prop="title">
<el-input v-model="formData.title"
prop="resiName">
<el-input v-model="formData.resiName"
size="small"
class="item_width_1"
clearable
@ -27,8 +27,8 @@
</el-form-item>
<el-form-item label="关怀事项"
prop="title">
<el-input v-model="formData.title"
prop="content">
<el-input v-model="formData.content"
size="small"
class="item_width_1"
clearable
@ -38,13 +38,13 @@
</el-form-item>
<el-form-item label="状态"
prop="unitId">
prop="status">
<el-select class="item_width_1"
v-model="formData.unitId"
v-model="formData.status"
size="small"
placeholder="全部"
clearable>
<el-option v-for="item in unitList"
<el-option v-for="item in stateList"
:key="item.value"
:label="item.label"
:value="item.value">
@ -57,12 +57,12 @@
<div>
<el-form-item label="预计关怀时间"
prop="startTime">
<el-date-picker v-model="timeRange"
prop="scheduledStartTime">
<el-date-picker v-model="scheduledTimeRange"
size="small"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handleTimeChange"
value-format="yyyy-MM-dd"
@change="handleScheduledTimeChange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
@ -74,7 +74,7 @@
<el-date-picker v-model="timeRange"
size="small"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd"
@change="handleTimeChange"
range-separator="至"
start-placeholder="开始时间"
@ -115,56 +115,60 @@
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="unitName"
<el-table-column prop="concernType"
header-align="center"
align="center"
label="关怀类型"
width="180">
</el-table-column>
<el-table-column prop="title"
<el-table-column prop="resiName"
header-align="center"
align="center"
label="关怀人员"
min-width="120">
</el-table-column>
<el-table-column prop="address"
<el-table-column prop="phnoe"
header-align="center"
align="center"
label="电话"
width="120">
</el-table-column>
<el-table-column prop="peopleCount"
<el-table-column prop="address"
header-align="center"
align="center"
label="地址"
min-width="150">
</el-table-column>
<el-table-column prop="activityTime"
<el-table-column prop="content"
header-align="center"
align="center"
label="关怀事项"
min-width="200">
</el-table-column>
<el-table-column prop="activityTime"
<el-table-column prop="scheduledTime"
header-align="center"
align="center"
label="预计关怀时间"
width="170">
</el-table-column>
<el-table-column prop="activityTime"
<el-table-column prop="remindTime"
header-align="center"
align="center"
label="提醒时间"
width="170">
</el-table-column>
<el-table-column prop="activityTime"
<el-table-column prop="status"
header-align="center"
align="center"
label="状态"
width="80">
<template slot-scope="scope">
<div>{{scope.row.status===0?'未完成':'已完成'}}</div>
</template>
</el-table-column>
<el-table-column prop="activityTime"
<el-table-column prop="createdTime"
header-align="center"
align="center"
label="创建时间"
@ -180,22 +184,22 @@
<template slot-scope="scope">
<el-button type="text"
style="color:#1C6AFD;text-decoration: underline;"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button v-if="!scope.row.actId"
type="text"
style="color:#00A7A9;text-decoration: underline;"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button v-if="!scope.row.actId"
type="text"
style="color:#00A7A9;text-decoration: underline;"
class="div-table-button--detail"
size="small"
@click="handleEdit(scope.row)">导出</el-button>
@click="handleExport(scope.row)">导出</el-button>
<el-button type="text"
style="color:#D51010;text-decoration: underline;"
class="div-table-button--delete"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
@ -223,7 +227,6 @@
class="dialog-h"
@closed="diaClose">
<care-form ref="ref_form"
:unitList="unitList"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></care-form>
</el-dialog>
@ -231,13 +234,12 @@
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'活动详情'"
:title="'详情'"
width="950px"
top="5vh"
class="dialog-h"
@closed="detailClosed">
@closed="diaClose">
<care-detail ref="ref_detail"
:serviceList="serviceList"
@diaClose="diaClose"></care-detail>
</el-dialog>
@ -262,53 +264,38 @@ export default {
pageSize: 10,
pageNo: 0,
tableLoading: false,
agencyId: '',
unitList: [],//list
serviceList: [
{
id: "1",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。'
},
{
id: "2",
name: '积极配合'
},
stateList: [
{
id: "3",
name: '积极配合社区安全巡查员进行'
value: 1,
label: '已完成'
},
{
id: "4",
name: '积极配合社区安全巡查员进行场所消防、安全等方面的检查。并具备安全意识及设备设施'
value: 0,
label: '未完成'
},
],//list
pickerOptions: { //
disabledDate (time) {
return time.getTime() > (Date.now() - (24 * 60 * 60 * 1000))
}
},
],
scheduledTimeRange: [],
timeRange: [],
unitId: '',
formData: {
unitId: '',
title: '',
serviceMatter: '',
startTime: '',
endTime: ''
content: '',//怀
concernType: '',//怀
resiName: '',//怀
status: '',// 0 1
startTime: '',// yyyy-mm-dd
endTime: '',// yyyy-mm-dd
scheduledStartTime: '',//怀 yyyy-mm-dd
scheduledEndTime: '',//怀 yyyy-mm-dd
},
tableData: [],
//form
formShow: false,
formTitle: '新增活动',
formTitle: '新增',
detailShow: false,
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
}
},
components: {
@ -318,14 +305,7 @@ export default {
},
async mounted () {
//
await this.loadService()
const { user } = this.$store.state
this.agencyId = user.agencyId
//
await this.loadUnit()
//
await this.loadTable()
},
@ -335,52 +315,12 @@ export default {
this.loadTable()
},
async loadUnit () {
const url = "/heart/icpartyunit/option"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/option"
let params = {
agencyId: this.agencyId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.unitList = data
} else {
this.$message.error(msg)
}
},
//
async loadService () {
const url = "/heart/serviceitem/dict-list"
let params = {
// parentCategoryCode: '1010'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.serviceList = data
} else {
this.$message.error(msg)
}
},
async loadTable () {
this.tableLoading = true
const url = "/heart/icpartyactivity/search"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list"
const url = "/gov/project/memoConcern/page"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/page"
let params = {
agencyId: this.agencyId,
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formData
@ -400,21 +340,25 @@ export default {
diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
if (this.formShow) {
// this.$refs.ref_form.resetData()
this.formShow = false
} else {
this.detailShow = false
}
detailClosed () {
this.detailShow = false
},
handleDetail (row) {
// this.detailShow = true
this.formTitle = '详情'
this.formShow = true
this.formTitle = '详情'
this.$nextTick(() => {
// this.$refs.ref_detail.initForm(row)
this.$refs.ref_form.initForm('detail', row.id)
this.$refs.ref_form.initForm('look', row.id)
})
},
@ -451,7 +395,7 @@ export default {
type: "warning"
})
.then(() => {
this.deleteActivity(row)
this.deleteCare(row)
})
.catch(err => {
if (err == "cancel") {
@ -461,15 +405,15 @@ export default {
});
},
async deleteActivity (row) {
const url = "/heart/icpartyactivity/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/delete"
async deleteCare (row) {
const url = "/gov/project/memoConcern/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/delete"
let ids = [row.id]
let params = {
id: row.id
ids: ids
}
const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, ids)
if (code === 0) {
this.$message({
@ -485,14 +429,17 @@ export default {
//
resetSearch () {
this.scheduledTimeRange = []
this.timeRange = []
this.formData = {
gridId: '',
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
content: '',//怀
concernType: '',//怀
resiName: '',//怀
status: '',// 0 1
startTime: '',// yyyy-mm-dd
endTime: '',// yyyy-mm-dd
scheduledStartTime: '',//怀 yyyy-mm-dd
scheduledEndTime: '',//怀 yyyy-mm-dd
}
this.pageSize = 10
this.pageNo = 0
@ -500,23 +447,18 @@ export default {
},
//
async handleExport () {
let title = '联建活动列表'
async handleExport (row) {
let title = '人员关怀'
const url = "/heart/icpartyactivity/export"
let params = {
agencyId: this.agencyId,
...this.formData
}
let url = `/gov/project/memoConcern/${row.id}/exportWord`
let params = {}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.xls')
this.download(data, title + '.doc')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
@ -551,72 +493,27 @@ export default {
},
//
beforeUpload (file) {
this.files = file;
const isText = file.type === 'application/vnd.ms-excel'
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
handleScheduledTimeChange (time) {
if (time) {
this.formData.scheduledStartTime = time[0]
this.formData.scheduledEndTime = time[1]
if (!isText && !isTextComputer) {
this.$message.error('请选择正确格式的文件')
return false
} else {
this.fileName = file.name;
return true
}
this.formData.scheduledStartTime = ''
this.formData.scheduledEndTime = ''
},
//
handleExceed (files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`)
},
async uploadFile () {
this.loading = true
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
}
//
this.$refs['upload'].clearFiles()
var url = '/heart/icpartyactivity/import'
let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip
const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
handleTimeChange (time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-')
const endTimeArray = util.dateFormatter(time[1], 'date').split('-')
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00'
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59'
this.formData.startTime = time[0]
this.formData.endTime = time[1]
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.formData.startTime = ''
this.formData.endTime = ''
// this.startTimeShow = ''
// this.endTimeShow = ''
}
},
@ -653,9 +550,7 @@ export default {
return (this.clientHeight - 430)
},
rowHeight () {
return (this.clientHeight - 200) + 'px'
},
...mapGetters(['clientHeight'])
},
watch: {

358
src/views/modules/secretaryLog/workLog/form.vue

@ -0,0 +1,358 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
class="form">
<el-form-item label="内容"
prop="content"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="100"
show-word-limit
:rows="3"
:disabled="disabled"
placeholder="请输入内容"
v-model="formData.content"></el-input>
</el-form-item>
<el-form-item label="工作事项"
prop="workType"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="100"
show-word-limit
:rows="3"
:disabled="disabled"
placeholder="请输入工作事项"
v-model="formData.workType"></el-input>
</el-form-item>
<el-form-item label="提醒时间"
style="display: block"
prop="remindTime"
label-width="150px">
<el-date-picker class="item_width_1"
v-model="formData.remindTime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
type="datetime"
:disabled="disabled"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item class="block"
label-width="150px"
style="display: block"
label="添加附件"
prop="attach">
<el-upload class="upload-demo"
:action="uploadUlr"
accept=".doc,.pdf,.xls,.docx,.xlsx"
:on-success="handleFileSuccess"
:on-remove="handleFileRemove"
:on-preview="handleFileDownload"
:limit="3"
:disabled="disabled"
:before-upload="beforeUpload"
:file-list="fileList">
<el-button size="small"
:disabled="fileList.length==3 || disabled"
type="primary">点击上传</el-button>
<div slot="tip"
class="el-upload__tip">最多三个附件只能上传wordexcelpdf文件</div>
</el-upload>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button v-if="!disabled" size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
let loading //
export default {
data () {
return {
disabled: false,
formType: 'add', // addeditdetail
btnDisable: false,
id: '',
formData: {
content: '',//
workType: '',//
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
},
fileList: [],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadvariedfile',
dialogImageUrl: '',
dialogVisible: false
}
},
components: {},
mounted () {
},
methods: {
async initForm (type, id) {
// this.startLoading()
this.$refs.ref_form.resetFields();
this.formType = type
this.disabled = type == 'look' ? true : false
if (id) {
this.id = id
this.formData.id = id
await this.loadFormData()
}
// this.endLoading()
},
async loadFormData () {
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/detail'
const url = '/gov/project/memoWorkDiary'
let params = {
id: this.id,
readFlag: '0',
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
if (data.attachmentList) {
data.attachmentList.forEach(element => {
element.name = element.fileName
element.type = element.attachmentType
element.size = element.attachmentSize
});
this.fileList = data.attachmentList
}
} else {
this.$message.error(msg)
}
},
async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.$refs['ref_form'].validate(async (valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
await this.addDifficulty()
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
}
})
},
async addDifficulty () {
if (this.fileList.length > 0) {
this.formData.attachmentList = this.fileList
}
let url = ''
if (this.formType === 'add') {
url = '/gov/project/memoWorkDiary/save'
// url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/save"
this.formData.id = ''
} else {
url = '/gov/project/memoWorkDiary/update'
// url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/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)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
beforeUpload (file) {
const array = file.name.split('.')
const extension = array[array.length - 1]
if (extension !== 'xls'
&& extension !== 'xlsx'
&& extension !== 'doc'
&& extension !== 'docx'
&& extension !== 'pdf') {
this.$message.error('只能上传word、excel、pdf文件!')
return false
}
},
handleFileRemove (file) {
if (file && file.status === "success") {
this.fileList.splice(this.fileList.findIndex(item => item.uid === file.uid), 1)
}
},
handleFileSuccess (res, file) {
if (res.code === 0 && res.msg === 'success') {
const array = file.name.split('.')
const fileType = array[array.length - 1]
file.fileName = file.name
file.attachmentUrl = res.data.url
file.attachmentSize = file.size
file.attachmentType = 'doc'
file.attachmentFormat = fileType
this.fileList.push(file)
console.log(this.fileList)
} else this.$message.error(res.msg)
},
//
handleFileDownload (file) {
var a = document.createElement('a');
var event = new MouseEvent('click');
a.download = file.name;
console.log(a)
a.href = file.url;
a.dispatchEvent(event);
},
resetData () {
this.id = ''
this.formData = {
content: '',//
workType: '',//
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
content: [
{ required: true, message: '内容不能为空', trigger: 'blur' },
],
}
},
},
props: {
// serviceList: {
// type: Array,
// default: []
// },
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.item_width_1 {
width: 560px;
}
.item_width_2 {
width: 220px;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
> p {
margin: 0;
}
}
</style>

474
src/views/modules/secretaryLog/workLog/index.vue

@ -0,0 +1,474 @@
<template>
<div class="div_main">
<div ref="div_search" class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="内容摘要"
prop="content">
<el-input v-model="formData.content"
size="small"
class="item_width_1"
clearable
placeholder="请输入内容摘要">
</el-input>
</el-form-item>
<el-form-item label="工作事项"
prop="content">
<el-input v-model="formData.workType"
size="small"
class="item_width_1"
clearable
placeholder="请输入内容摘要">
</el-input>
</el-form-item>
<el-form-item label="创建时间"
prop="startTime">
<el-date-picker v-model="timeRange"
size="small"
type="daterange"
value-format="yyyy-MM-dd"
@change="handleTimeChange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-button style="margin-left:10px"
class="diy-button--search"
size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
class="diy-button--reset"
size="small"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button style=""
class="diy-button--add"
size="small"
@click="handleAdd">新增</el-button>
</div>
<el-table class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="content"
header-align="center"
align="center"
label="内容"
min-width="180">
<template slot-scope="scope">
<div class="twoline">{{scope.row.content}}</div>
</template>
</el-table-column>
<el-table-column prop="workType"
header-align="center"
align="center"
label="工作事项"
show-overflow-tooltip=""
min-width="120">
</el-table-column>
<el-table-column prop="remindTime"
header-align="center"
align="center"
label="提醒时间"
width="170">
</el-table-column>
<el-table-column prop="createdTime"
header-align="center"
align="center"
label="创建时间"
width="170">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="170"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button
type="text"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button
type="text"
class="div-table-button--detail"
size="small"
@click="handleExport(scope.row)">导出</el-button>
<el-button type="text"
class="div-table-button--delete"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="70%"
top="5vh"
class="dialog-h"
@closed="diaClose">
<edit-form v-if="formShow" ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></edit-form>
</el-dialog>
</div>
</template>
<script>
import editForm from './form'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
name: 'WorkLog',
data () {
return {
sHeight: 0,
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
scheduledTimeRange: [],
timeRange: [],
formData: {
content: '',//
startTime: '',//yyyy-mm-dd
endTime: '',//yyyy-mm-dd
workType: ''
},
tableData: [],
//form
formShow: false,
formTitle: '新增',
detailShow: false,
}
},
components: {
editForm
},
async created () {
console.log('sHeightcreated-----', this.sHeight, this.tableHeight)
},
async mounted () {
//
await this.loadTable()
console.log('sh-----', this.$refs.div_search.offsetHeight)
this.sHeight = this.$refs.div_search.offsetHeight + 270
console.log('sHeight-----', this.sHeight, this.tableHeight)
},
methods: {
handleSearch () {
this.loadTable()
},
async loadTable () {
this.tableLoading = true
const url = "/gov/project/memoWorkDiary/page"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/page"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
diaClose () {
if (this.formShow) {
this.$refs.ref_form.resetData()
this.formShow = false
} else {
this.detailShow = false
}
},
handleDetail (row) {
this.formShow = true
this.formTitle = '详情'
this.$nextTick(() => {
console.log('this.$refs-----', this.$refs)
this.$refs.ref_form.initForm('look', row.id)
})
},
handleAdd () {
this.formTitle = '新增'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id)
})
},
addFormCancle () {
this.formShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteDifficulty(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteDifficulty (row) {
const url = "/gov/project/memoDifficulty/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/delete"
let ids = [row.id]
let params = {
ids: ids
}
const { data, code, msg } = await requestPost(url, ids)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
resetSearch () {
this.timeRange = []
this.formData = {
content: '',//
startTime: '',//yyyy-mm-dd
endTime: '',//yyyy-mm-dd
workType: ''
}
this.pageSize = 10
this.pageNo = 1
this.loadTable()
},
//
async handleExport (row) {
let url = `/gov/project/memoWorkDiary/${row.id}/exportWord`
let params = {}
await this.$http({
method: 'POST',
url,
data: params,
responseType: 'blob'
}).then(res => {
if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
console.log('filename', fileName)
this.download(res.data, fileName)
} else this.$message.error('导出失败')
})
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
handleTimeChange (time) {
if (time) {
this.formData.startTime = time[0]
this.formData.endTime = time[1]
} else {
this.formData.startTime = ''
this.formData.endTime = ''
}
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
},
computed: {
tableHeight () {
return (this.clientHeight - this.sHeight)
},
...mapGetters(['clientHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
.div_main {
width: 100%;
}
.div_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;
}
.div_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;
}
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
.twoline {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
</style>

20
src/views/tips.vue

@ -1,11 +1,11 @@
<template>
<div class="msg-tips" :class="showTips ? 'show-tips' : 'hide-tips'">
<div class="msg-tips" :class="showTips && 'show-tips'">
<el-card class="tips-card">
<div class="tips-wr">
<div class="tips-wr-title">通知提醒</div>
<div class="tips-wr-name">工作日志</div>
<div class="tips-wr-desc">内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</div>
<div class="tips-wr-time">2022-03-15</div>
<div class="tips-wr-name">{{ info.typeName }}</div>
<div class="tips-wr-desc">{{ info.content }}</div>
<div class="tips-wr-time">{{ info.remindTime }}</div>
<div class="tips-btn">
<el-button type="text" size="small" @click="handleClose">我知道了</el-button>
<el-button class="diy-button--search" size="small" @click="handleLook">查看详情</el-button>
@ -20,7 +20,11 @@ export default {
props: {
show: {
type: Boolean,
default: true
default: false
},
info: {
type: Object,
default: () => {}
}
},
data() {
@ -34,6 +38,7 @@ export default {
methods: {
handleClose() {
this.showTips = false
this.$emit('close')
},
handleLook() {
this.$emit('look')
@ -46,6 +51,7 @@ export default {
.msg-tips {
position: fixed;
right: 0;
bottom: -220px;
z-index: 999;
transition: bottom .5s;
.tips-card {
@ -64,6 +70,7 @@ export default {
}
.tips-wr-desc {
width: 100%;
height: 33px;
margin-top: 10px;
padding-left: 20px;
display: -webkit-box;
@ -89,9 +96,10 @@ export default {
}
.hide-tips {
bottom: -220px;
transition: bottom .5s;
}
.show-tips {
bottom: 0px;
transition: bottom .5s;
}
</style>
Loading…
Cancel
Save