jiangyy 3 years ago
parent
commit
07ae951146
  1. 2
      src/assets/scss/buttonstyle.scss
  2. 2
      src/assets/scss/c/config.scss
  3. 15
      src/assets/scss/c/function.scss
  4. 49
      src/assets/scss/modules/management/secretaryLog.scss
  5. 62
      src/assets/scss/modules/shujirizhi-notice.scss
  6. 72
      src/js/store/index.js
  7. 22
      src/utils/index.js
  8. 121
      src/views/main-content.vue
  9. 44
      src/views/main.vue
  10. 18
      src/views/modules/base/community/communityTable.vue
  11. 66
      src/views/modules/communityService/dqfwzx/index.vue
  12. 4
      src/views/modules/communityService/ninePlaces/team/team.vue
  13. 102
      src/views/modules/secretaryLog/cpts/notice.vue
  14. 177
      src/views/modules/secretaryLog/difficulty/difficultyDetail.vue
  15. 412
      src/views/modules/secretaryLog/difficulty/difficultyForm.vue
  16. 533
      src/views/modules/secretaryLog/difficulty/difficultyList.vue
  17. 182
      src/views/modules/secretaryLog/humanisticCare/careDetail.vue
  18. 488
      src/views/modules/secretaryLog/humanisticCare/careForm.vue
  19. 605
      src/views/modules/secretaryLog/humanisticCare/careList.vue
  20. 383
      src/views/modules/secretaryLog/workLog/form.vue
  21. 474
      src/views/modules/secretaryLog/workLog/index.vue
  22. 105
      src/views/tips.vue

2
src/assets/scss/buttonstyle.scss

@ -106,7 +106,7 @@
text-decoration: underline !important;
}
//
//
.div-table-button--qr {
color: #4ec591 !important;
text-decoration: underline !important;

2
src/assets/scss/c/config.scss

@ -11,7 +11,7 @@ $w1: 1200px;
//网站主色 primary color bgcolor
$c1: #ff4c52; // dd000f
$c2: #3b7cff;
$c2: #3e8ef7;
//灰度色 用于字体
$fc0: #010033;

15
src/assets/scss/c/function.scss

@ -87,6 +87,15 @@
text-overflow: ellipsis;
word-wrap: normal;
}
// 强制文本换行 多行
@mixin toeM($num) {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: $num;
-webkit-box-orient: vertical;
}
// 图片居中
@mixin img_hub {
position: absolute;
@ -206,7 +215,7 @@
}
//党员积分排行榜
@mixin img123 {
width:20px;
width: 20px;
height: 20px;
border-radius: 50%;
position: absolute;
@ -225,7 +234,7 @@
width: 67.15px;
height: 67.15px;
position: absolute;
display: block;
display: block;
top: 4px;
border-radius: 100%;
}
@ -258,11 +267,9 @@
display: block;
z-index: 10;
margin-top: 40px;
}
@mixin list {
list-style-type: none;
position: absolute;
padding: 0px;
}

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;
}
}

62
src/assets/scss/modules/shujirizhi-notice.scss

@ -0,0 +1,62 @@
@import "../c/anime";
@import "../c/config";
@import "../c/function";
.m-notice {
position: fixed;
z-index: 10000;
bottom: 0;
right: 0;
background-color: #fff;
box-shadow: 0 0 10px 0 rgba(#000, 0.1);
width: 500px;
height: 300px;
box-sizing: border-box;
padding: 25px;
.header {
margin-bottom: 20px;
font-size: 24px;
font-weight: bold;
color: #3e8ef7;
}
.type {
margin-bottom: 10px;
font-size: 20px;
font-weight: bold;
color: #333;
}
.content {
@include toeM(2);
margin-bottom: 10px;
font-size: 16px;
color: #333;
line-height: 30px;
}
.date {
margin-bottom: 30px;
font-size: 16px;
color: #999;
line-height: 30px;
}
.operate {
display: flex;
justify-content: space-around;
.btn {
box-sizing: border-box;
padding: 0 20px;
width: 180px;
text-align: center;
font-size: 20px;
color: #3e8ef7;
line-height: 40px;
cursor: pointer;
&.z-stress {
background-color: #3e8ef7;
color: #fff;
}
}
}
}

72
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: {
@ -37,7 +39,8 @@ export default new Vuex.Store({
menuList: [],
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)
}
})
}, 60000)
},
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
}

121
src/views/main-content.vue

@ -69,18 +69,60 @@
<router-view />
</keep-alive>
</template>
<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="950px"
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>
</main>
</template>
<script>
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,
workForm,
dForm,
hForm
},
data() {
return {
dialogTitle: '',
dialogFormVisible: false,
iframeUrl: "",
token: "",
customerId: "",
form: {},
formType: '',
formLabelWidth: '120px',
tipsList: []
};
},
created() {
@ -89,6 +131,16 @@ export default {
// })
this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId");
this.loopTips()
},
destroyed() {
this.$store.dispatch('clearInter')
},
computed: {
msgList() {
return this.$store.state.tipsList
}
},
methods: {
changeCustomerName(customerName) {
@ -174,6 +226,75 @@ export default {
// }, '*')
iframe.postMessage({ name: "lalalal" }, "*");
},
loopTips() {
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)
},
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)
})
}
},
};
</script>
<style lang="scss" scoped>
.aui-content {
position: relative;
// height: calc(100vh -50px) !important;
overflow: hidden;
}
</style>

44
src/views/main.vue

@ -1,24 +1,30 @@
<template>
<div v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')"
:class="[
<div
v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')"
:class="[
'aui-wrapper',
{ 'aui-sidebar--fold': $store.state.sidebarFold },
{
'aui-sidebar--noside':
$store.state.sidebarActiveSubMenuList.length == 0 || $store.state.inIframe,
$store.state.sidebarActiveSubMenuList.length == 0 ||
$store.state.inIframe,
},
{ 'z-iframe': $store.state.inIframe },
]">
]"
>
<template v-if="!loading">
<main-navbar ref="ref_navbar"
v-if="!$store.state.inIframe" />
<main-navbar ref="ref_navbar" v-if="!$store.state.inIframe" />
<main-sidebar v-if="!$store.state.inIframe" />
<div class="aui-content__wrapper">
<main-content v-if="!$store.state.contentIsNeedRefresh"
@changeCustomerName="changeCustomerName" />
<main-content
v-if="!$store.state.contentIsNeedRefresh"
@changeCustomerName="changeCustomerName"
/>
</div>
<main-theme-tools v-if="!$store.state.inIframe" />
<!-- <secretary-log-notice v-if="!$store.state.inIframe" /> -->
</template>
</div>
</template>
@ -28,16 +34,17 @@ import MainNavbar from "./main-navbar";
import MainSidebar from "./main-sidebar";
import MainContent from "./main-content";
import MainThemeTools from "./main-theme-tools";
import SecretaryLogNotice from "./modules/secretaryLog/cpts/notice";
import debounce from "lodash/debounce";
import { mapGetters } from "vuex";
import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request";
export default {
provide () {
provide() {
return {
//
refresh () {
refresh() {
this.$store.state.contentIsNeedRefresh = true;
this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false;
@ -45,7 +52,7 @@ export default {
},
};
},
data () {
data() {
return {
loading: true,
userType: localStorage.getItem("userType"),
@ -56,12 +63,13 @@ export default {
MainSidebar,
MainContent,
MainThemeTools,
SecretaryLogNotice,
},
watch: {
$route: "routeHandle",
},
async created () {
async created() {
this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
console.log(this.$store.state.sidebarMenuList);
@ -73,11 +81,11 @@ export default {
},
computed: {},
methods: {
changeCustomerName (customerName) {
changeCustomerName(customerName) {
this.$refs["ref_navbar"].changeCustomerName(customerName);
},
//
windowResizeHandle () {
windowResizeHandle() {
this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false;
window.addEventListener(
@ -89,7 +97,7 @@ export default {
);
},
// ,
routeHandle (route) {
routeHandle(route) {
if (!route.meta.isTab) {
return false;
}
@ -112,7 +120,7 @@ export default {
this.$store.state.contentTabsActiveName = tab.name;
this.syncLevelOneMenuActive(tab.menuId);
},
async syncLevelOneMenuActive (menuId) {
async syncLevelOneMenuActive(menuId) {
await nextTick();
console.log(
"*******************************",
@ -135,7 +143,7 @@ export default {
idx !== -1 ? this.$store.state.sidebarMenuList[idx].children : [];
},
//
async getWorkUserInfo () {
async getWorkUserInfo() {
const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {};
const { data, code, msg } = await requestPost(url, params);

18
src/views/modules/base/community/communityTable.vue

@ -103,8 +103,7 @@
class="diy-button--reset"
size="small"
@click="handleExport">导出</el-button>
<el-button v-if="agencyObj.level == 'community'"
style="margin-left:10px"
<el-button v-if="agencyObj.level == 'community'" style="margin-left:10px"
class="diy-button--qrcode"
size="small"
@click="handleDownQr(agencyObj, 'community')">社区二维码</el-button>
@ -174,7 +173,8 @@
class="div-table-button--qr"
size="small"
@click="handleDownQr(scope.row, 'neighborHood')">二维码</el-button> -->
<el-button type="text"
<el-button
type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
@ -547,7 +547,7 @@ export default {
this.$message.error(msg)
}
},
async handleDownQr (row, type) {
async handleDownQr(row, type) {
// const url = window.SITE_CONFIG['apiURL'] + `/gov/org/icneighborhood/createQrCode/${row.neighborHoodId}`
const url = '/gov/org/agency/create-qrcode'
const _id = type == 'community' ? row.id : row.neighborHoodId
@ -563,11 +563,11 @@ export default {
}).then(res => {
console.log('res----1r', 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) //blob
} else this.$message.error('下载失败')
// this.download(res.data, '1.png')
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
console.log('filename', fileName)
this.download(res.data, fileName) //blob
} else this.$message.error('下载失败')
// this.download(res.data, '1.png')
})
},
//

66
src/views/modules/communityService/dqfwzx/index.vue

@ -17,13 +17,11 @@
:key="'ct' + index"
v-for="(item, index) in tableData"
>
<div
class="item-btn"
v-if="currentIndex == index"
@click="handleEdit"
>
修改
<div class="item-btns">
<a v-if="currentIndex == index" @click="handleEdit">修改</a>
<a v-if="currentIndex == index" @click="handleDel">删除</a>
</div>
<div class="item-name">{{ item.centerName }}</div>
<div class="item-prop">
<div class="prop-field">社区地址</div>
@ -158,7 +156,7 @@
</template>
<script>
import { requestPost } from "@/js/dai/request";
import { requestPost } from "@/js/dai/request2";
import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex";
import editForm from "./cpts/edit";
@ -314,21 +312,19 @@ export default {
this.$refs.eleOrderList.init(this.tableData[this.currentIndex], index);
},
async handleDel(rowData, rowIndex) {
console.log(rowData, rowIndex);
const url =
"/heart/iccommunityselforganization/delcommunityselforganization";
const { tableData } = this;
async handleDel() {
if (!confirm("删除后不可恢复,确定删除?")) return;
const { data, code, msg } = await requestPost(url, {
orgId: tableData[rowIndex].orgId,
});
const item = this.tableData[this.currentIndex];
const url = "/gov/org/icpartyservicecenter/del";
const { data, code, msg } = await requestPost(url, [
item.partyServiceCenterId,
]);
if (code === 0) {
this.$message.success("删除成功!");
this.getTableData();
} else {
this.$message.success("操作失败!");
}
},
@ -361,8 +357,6 @@ export default {
if (code === 0) {
this.agencyId = data.agencyId;
} else {
this.$message.error(msg);
}
},
},
@ -416,21 +410,37 @@ export default {
background-color: #ffffff;
box-shadow: 0 0 10px #6aa;
}
.item-btn {
.item-btns {
position: absolute;
top: 5px;
right: 5px;
font-size: 14px;
color: #00a7a9;
width: 50px;
line-height: 30px;
text-align: center;
cursor: pointer;
&:hover {
// text-decoration: underline;
// width: 120px;
a {
display: inline-block;
margin-left: 1px;
font-size: 14px;
color: #00a7a9;
width: 40px;
line-height: 30px;
text-align: center;
cursor: pointer;
&:nth-child(2) {
color: #d51010;
&:hover {
// text-decoration: underline;
color: #d51010;
}
}
&:hover {
// text-decoration: underline;
color: #00a7a9;
}
}
}
.item-name {
font-size: 16px;
font-weight: bold;

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

@ -4,7 +4,7 @@
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
:label-width="'90px'">
<div>
<el-form-item label="负责人"
@ -470,7 +470,7 @@ export default {
}
.item_width_1 {
width: 230px;
width: 170px;
}
.div_table {

102
src/views/modules/secretaryLog/cpts/notice.vue

@ -0,0 +1,102 @@
<template>
<div class="m-notice a-fade-in-up" v-if="displayed && list.length > 0">
<div class="header">通知提醒</div>
<div class="type">{{ list[0].typeName }}</div>
<div class="content">{{ list[0].content }}</div>
<div class="date">{{ list[0].remindTime }}</div>
<div class="operate">
<div class="btn" @click="read">我知道了</div>
<div class="btn z-stress" @click="checkInfo">查看详情</div>
</div>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request2";
import nextTick from "dai-js/tools/nextTick";
export default {
components: {},
data() {
return {
displayed: false,
lastTime: 0,
list: [
{
memoId: "1",
type: "work_diary",
typeName: "工作日志",
content:
"提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容",
remindTime: "2022-02-22 22:22",
},
],
};
},
computed: {},
watch: {
currentIndex() {},
},
async mounted() {
this.poll();
},
methods: {
async poll() {
let nowTime = new Date().getTime();
if (nowTime - this.lastTime > 60 * 1000) {
this.lastTime = nowTime;
this.getList();
}
await nextTick(1000);
this.poll();
},
checkInfo() {
const { memoId, type } = this.list[0];
if (type == "work_diary") {
this.$router.push({
path: `/main/visual-basicinfo-people/${uid}`,
});
} else if (type == "concern") {
} else if (type == "difficulty") {
}
this.read();
},
async read() {
const item = this.list[0];
const url = "/gov/project/memoAttr/setReaded";
const { data, code, msg } = await requestPost(url, {
memoId: item.memoId,
});
if (code === 0) {
// this.$message.success("");
this.displayed = false;
this.getList();
}
},
async getList() {
const url = "/gov/project/memoAttr/memosToRemind";
const { data, code, msg } = await requestPost(url, {});
if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!");
this.displayed = true;
this.lastTime = new Date().getTime();
// this.list = data;
}
},
},
};
</script>
<style
lang="scss"
src="@/assets/scss/modules/shujirizhi-notice.scss"
scoped
></style>

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

@ -0,0 +1,177 @@
<template>
<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>
</div>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </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 {
difficultyId: '',
formData: {
content: '',//
resolveWay: '',//
remark: '',//
scheduledTime: '',//yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
},
}
},
components: {},
mounted () {
},
methods: {
async initForm (row) {
this.startLoading()
this.difficultyId = row.id
await this.loadFormData()
this.endLoading()
},
async loadFormData () {
// 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
} else {
this.$message.error(msg)
}
},
handleCancle () {
this.$emit('diaClose')
},
//
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({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {},
props: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/secretaryLog.scss";
</style>
<style lang="scss" scoped>
</style>

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

@ -0,0 +1,412 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType==='look'"
class="form">
<el-form-item label="内容"
prop="content"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
placeholder="请输入内容"
v-model="formData.content"></el-input>
</el-form-item>
<el-form-item label="解决方式"
prop="resolveWay"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
placeholder="请输入解决方式"
v-model="formData.resolveWay"></el-input>
</el-form-item>
<el-form-item label="预计处理时间"
style="display: block"
prop="scheduledTime"
label-width="150px">
<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"
clearable
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item label="提醒时间"
style="display: block"
prop="remindTime"
label-width="150px">
<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"
clearable
:picker-options="pickerOptions"
@change="handleTime"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
placeholder="请输入备注"
v-model="formData.remark"></el-input>
</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"
: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 v-if="formType != 'look'" 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'
import { dateFormats } from '@/utils/index'
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() <= Date.now() - 8.64e7;
}
},
difficultyId: '',
formData: {
content: '',//
resolveWay: '',//
remark: '',//
scheduledTime: '',//yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
},
fileList: [],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadvariedfile',
dialogImageUrl: '',
dialogVisible: false
}
},
components: {},
mounted () {
},
methods: {
handleTime() {
if (!this.formData.remindTime) return
var startAt = new Date(this.formData.remindTime) * 1000 /1000;
if(startAt < Date.now()) {
this.formData.remindTime = dateFormats('YYYY-mm-dd HH:MM', new Date());
}
},
async initForm (type, difficultyId) {
this.startLoading()
this.$refs.ref_form.resetFields();
this.formType = type
if (difficultyId) {
this.difficultyId = difficultyId
this.formData.id = difficultyId
await this.loadFormData()
}
this.endLoading()
},
async loadFormData () {
// 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
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()
}
})
},
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)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} 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.fileName;
console.log(a)
a.href = file.attachmentUrl;
a.dispatchEvent(event);
},
resetData () {
this.difficultyId = ''
this.formData = {
content: '',//
resolveWay: '',//
remark: '',//
scheduledTime: '',//yyyy-mm-dd hh:mm
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 {
resiName: [
{ required: true, message: '关怀人员不能为空', trigger: 'blur' }
],
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;
::v-deep .el-textarea__inner {
padding-bottom: 20px;
}
::v-deep .el-input__count {
right: 20px;
line-height: 12px;
}
}
.item_width_2 {
width: 220px;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
> p {
margin: 0;
}
}
</style>

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

@ -0,0 +1,533 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="内容摘要"
prop="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="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"
@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="resolveWay"
header-align="center"
align="center"
label="解决方式"
min-width="120">
</el-table-column>
<el-table-column prop="scheduledTime"
header-align="center"
align="center"
label="预计处理时间"
width="170">
</el-table-column>
<el-table-column prop="remindTime"
header-align="center"
align="center"
label="提醒时间"
width="170">
</el-table-column>
<el-table-column prop="remark"
header-align="center"
align="center"
label="备注"
width="180">
</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 v-if="!scope.row.actId"
type="text"
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"
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="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<difficulty-form ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></difficulty-form>
</el-dialog>
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'详情'"
width="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<difficulty-detail ref="ref_detail"
@diaClose="diaClose"></difficulty-detail>
</el-dialog>
</div>
</template>
<script>
import difficultyForm from './difficultyForm'
import difficultyDetail from './difficultyDetail'
import util from '@js/util.js';
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
scheduledTimeRange: [],
timeRange: [],
formData: {
content: '',//
startTime: '',//yyyy-mm-dd
endTime: '',//yyyy-mm-dd
scheduledStartTime: '',//yyyy-mm-dd
scheduledEndTime: '',// yyyy-mm-dd
},
tableData: [],
//form
formShow: false,
formTitle: '新增',
detailShow: false,
}
},
components: {
difficultyForm, difficultyDetail
},
async created () {
},
async mounted () {
//
await this.loadTable()
},
methods: {
handleSearch () {
this.loadTable()
},
async loadTable () {
this.tableLoading = true
const url = "/gov/project/memoDifficulty/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.detailShow = true
this.formShow = true
this.formTitle = '详情'
this.$nextTick(() => {
this.$refs.ref_form.initForm('look', row.id)
// this.$refs.ref_detail.initForm(row)
})
},
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.scheduledTimeRange = []
this.timeRange = []
this.formData = {
content: '',//
startTime: '',//yyyy-mm-dd
endTime: '',//yyyy-mm-dd
scheduledStartTime: '',//yyyy-mm-dd
scheduledEndTime: '',// yyyy-mm-dd
}
this.pageSize = 10
this.pageNo = 0
this.loadTable()
},
//
async handleExport (row) {
let title = '难点堵点详情'
let url = `/gov/project/memoDifficulty/${row.id}/exportWord`
let params = {}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.doc')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
handleScheduledTimeChange (time) {
if (time) {
this.formData.scheduledStartTime = time[0]
this.formData.scheduledEndTime = time[1]
} else {
this.formData.scheduledStartTime = ''
this.formData.scheduledEndTime = ''
}
},
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()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 380)
},
...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>

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

@ -0,0 +1,182 @@
<template>
<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>
</div>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </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 {
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 () {
},
methods: {
async initForm (row) {
this.startLoading()
this.careId = row.id
await this.loadFormData()
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
} else {
this.$message.error(msg)
}
},
handleCancle () {
this.$emit('diaClose')
},
//
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({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {},
props: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/secretaryLog.scss";
</style>
<style lang="scss" scoped>
</style>

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

@ -0,0 +1,488 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType==='look'"
class="form">
<el-form-item label="关怀类型"
prop="concernType"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
placeholder="请输入关怀类型"
clearable
v-model="formData.concernType">
</el-input>
</el-form-item>
<el-form-item label="关怀人员"
prop="resiName"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
placeholder="请输入关怀人员"
clearable
v-model="formData.resiName">
</el-input>
</el-form-item>
<el-form-item label="电话"
prop="phone"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
placeholder="请输入电话"
clearable
v-model="formData.phone">
</el-input>
</el-form-item>
<el-form-item label="地址"
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入地址"
clearable
v-model="formData.address">
</el-input>
</el-form-item>
<el-form-item label="关怀事项"
prop="content"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
placeholder="请输入关怀事项"
v-model="formData.content"></el-input>
</el-form-item>
<el-form-item label="预计关怀时间"
style="display: block"
prop="scheduledTime"
label-width="150px">
<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"
clearable
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item label="提醒时间"
style="display: block"
prop="remindTime"
label-width="150px">
<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"
clearable
:picker-options="pickerOptions"
@change="handleTime"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item label="状态"
label-width="150px"
prop="status">
<el-select class="item_width_2"
v-model="formData.status"
placeholder="请选择"
clearable>
<el-option class="item_width_2"
v-for="item in stateList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</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"
: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 v-if="formType != 'look'"
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'
import { dateFormats } from '@/utils/index'
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
stateList: [
{
value: 1,
label: '已完成'
},
{
value: 0,
label: '未完成'
},
],
btnDisable: false,
pickerOptions: {
disabledDate (time) {
return time.getTime() <= Date.now() - 8.64e7;
}
},
careId: '',
formData: {
content: '',//怀
concernType: '',//怀
resiName: '',//怀
status: 0,// 0 1
phone: '',//
address: '',//
scheduledTime: '',//怀yyyy-mm-dd hh:mm
remindTime: '',//yyyy-mm-dd hh:mm
attachmentList: []
},
fileList: [],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadvariedfile',
dialogImageUrl: '',
dialogVisible: false
}
},
components: {},
mounted () {
},
methods: {
handleTime () {
if (!this.formData.remindTime) return
var startAt = new Date(this.formData.remindTime) * 1000 / 1000;
if (startAt < Date.now()) {
this.formData.remindTime = dateFormats('YYYY-mm-dd HH:MM', new Date());
}
},
async initForm (type, careId) {
this.startLoading()
this.$refs['ref_form'].resetFields();
this.formType = type
if (careId) {
this.careId = careId
this.formData.id = careId
await this.loadFormData()
}
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(async (valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
await this.addCare()
}
})
},
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)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} 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.fileName;
console.log(a)
a.href = file.attachmentUrl;
a.dispatchEvent(event);
},
resetData () {
this.careId = ''
this.formData = {
content: '',//怀
concernType: '',//怀
resiName: '',//怀
status: 0,// 0 1
phone: '',//
address: '',//
scheduledTime: '',//怀yyyy-mm-dd hh:mm
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 {
resiName: [
{ required: true, message: '关怀人员不能为空', trigger: 'blur' }
],
content: [
{ required: true, message: '关怀事项不能为空', trigger: 'blur' },
],
concernType: [
{ required: false },
],
status: [
{ required: false },
],
phone: [
{ required: false },
],
address: [
{ required: false },
],
scheduledTime: [
{ required: false },
],
remindTime: [
{ required: false },
],
}
},
},
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;
::v-deep .el-textarea__inner {
padding-bottom: 20px;
}
::v-deep .el-input__count {
right: 20px;
line-height: 12px;
}
}
.item_width_2 {
width: 220px;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
> p {
margin: 0;
}
}
</style>

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

@ -0,0 +1,605 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="关怀类型"
prop="concernType">
<el-input v-model="formData.concernType"
size="small"
class="item_width_1"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="关怀人员"
prop="resiName">
<el-input v-model="formData.resiName"
size="small"
class="item_width_1"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<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="status">
<el-select class="item_width_1"
v-model="formData.status"
size="small"
placeholder="全部"
clearable>
<el-option v-for="item in stateList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
<div>
<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"
@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="concernType"
header-align="center"
align="center"
label="关怀类型"
width="180">
</el-table-column>
<el-table-column prop="resiName"
header-align="center"
align="center"
label="关怀人员"
min-width="120">
</el-table-column>
<el-table-column prop="phone"
header-align="center"
align="center"
label="电话"
width="120">
</el-table-column>
<el-table-column prop="address"
header-align="center"
align="center"
label="地址"
min-width="150">
</el-table-column>
<el-table-column prop="content"
header-align="center"
align="center"
label="关怀事项"
min-width="200">
</el-table-column>
<el-table-column prop="scheduledTime"
header-align="center"
align="center"
label="预计关怀时间"
width="170">
</el-table-column>
<el-table-column prop="remindTime"
header-align="center"
align="center"
label="提醒时间"
width="170">
</el-table-column>
<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="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 v-if="!scope.row.actId"
type="text"
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"
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="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<care-form ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></care-form>
</el-dialog>
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'详情'"
width="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<care-detail ref="ref_detail"
@diaClose="diaClose"></care-detail>
</el-dialog>
</div>
</template>
<script>
import careForm from './careForm'
import careDetail from './careDetail'
import util from '@js/util.js';
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
stateList: [
{
value: 1,
label: '已完成'
},
{
value: 0,
label: '未完成'
},
],
scheduledTimeRange: [],
timeRange: [],
formData: {
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: '新增',
detailShow: false,
}
},
components: {
careForm, careDetail
},
async created () {
},
async mounted () {
//
await this.loadTable()
},
methods: {
handleSearch () {
this.loadTable()
},
async loadTable () {
this.tableLoading = true
const url = "/gov/project/memoConcern/page"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/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.detailShow = true
this.formShow = true
this.formTitle = '详情'
this.$nextTick(() => {
// this.$refs.ref_detail.initForm(row)
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.deleteCare(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
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 = {
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.scheduledTimeRange = []
this.timeRange = []
this.formData = {
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
this.loadTable()
},
//
async handleExport (row) {
let title = '人员关怀详情'
let url = `/gov/project/memoConcern/${row.id}/exportWord`
let params = {}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.doc')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
handleScheduledTimeChange (time) {
if (time) {
this.formData.scheduledStartTime = time[0]
this.formData.scheduledEndTime = time[1]
} else {
this.formData.scheduledStartTime = ''
this.formData.scheduledEndTime = ''
}
},
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()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 430)
},
...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;
}
.item_width_2 {
width: 495px;
}
.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;
}
}
.div_btn {
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

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

@ -0,0 +1,383 @@
<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="1000"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
: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="1000"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
: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_2"
v-model="formData.remindTime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
type="datetime"
clearable
:disabled="disabled"
:picker-options="pickerOptions"
@change="handleTime"
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'
import { dateFormats } from '@/utils/index'
let loading //
export default {
data () {
return {
disabled: false,
formType: 'add', // addeditdetail
btnDisable: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() <= Date.now() - 8.64e7;
}
},
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()
},
handleTime() {
if (!this.formData.remindTime) return
var startAt = new Date(this.formData.remindTime) * 1000 /1000;
if(startAt < Date.now()) {
this.formData.remindTime = dateFormats('YYYY-mm-dd HH:MM', new Date());
}
},
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()
}
})
},
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
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} 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;
::v-deep .el-textarea__inner {
padding-bottom: 20px;
}
::v-deep .el-input__count {
right: 20px;
line-height: 12px;
}
}
.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="950px"
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, Date.now())
},
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/memoWorkDiary/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>

105
src/views/tips.vue

@ -0,0 +1,105 @@
<template>
<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">{{ 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>
</div>
</div>
</el-card>
</div>
</template>
<script>
export default {
props: {
show: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => {}
}
},
data() {
return {
showTips: false
}
},
created() {
this.showTips = this.show
},
methods: {
handleClose() {
this.showTips = false
this.$emit('close')
},
handleLook() {
this.$emit('look')
}
}
}
</script>
<style lang="scss" scoped>
.msg-tips {
position: fixed;
right: 0;
bottom: -220px;
z-index: 999;
transition: bottom .5s;
.tips-card {
width: 400px;
height: 200px;
background: #fff;
}
.tips-wr-title {
font-size: 16px;
color: #3E8EF7;
}
.tips-wr-name {
margin-top: 10px;
padding-left: 20px;
font-weight: bold;
}
.tips-wr-desc {
width: 100%;
height: 32px;
margin-top: 10px;
padding-left: 20px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.tips-wr-time {
margin-top: 10px;
padding-left: 20px;
}
.tips-btn {
display: flex;
align-items: center;
justify-content: space-around;
width: 100%;
box-sizing: border-box;
margin-top: 10px;
padding: 0 20px;
text-align: center;
}
}
.hide-tips {
bottom: -220px;
transition: bottom .5s;
}
.show-tips {
bottom: 0px;
transition: bottom .5s;
}
</style>
Loading…
Cancel
Save