Browse Source

通知提醒

shibei_master
13176889840 3 years ago
parent
commit
1f21fb1d43
  1. 39
      src/js/store/index.js
  2. 22
      src/utils/index.js
  3. 75
      src/views/main-content.vue
  4. 10
      src/views/modules/secretaryLog/difficulty/difficultyForm.vue
  5. 2
      src/views/modules/secretaryLog/difficulty/difficultyList.vue
  6. 10
      src/views/modules/secretaryLog/humanisticCare/careForm.vue
  7. 2
      src/views/modules/secretaryLog/humanisticCare/careList.vue
  8. 358
      src/views/modules/secretaryLog/workLog/form.vue
  9. 474
      src/views/modules/secretaryLog/workLog/index.vue
  10. 8
      src/views/tips.vue

39
src/js/store/index.js

@ -5,9 +5,10 @@ import user from "./modules/user";
import app from "./modules/app"; import app from "./modules/app";
import tagsView from "./modules/tagsView"; import tagsView from "./modules/tagsView";
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import { dateFormats } from "@/utils/index";
Vue.use(Vuex); Vue.use(Vuex);
let interTimer = null
export default new Vuex.Store({ export default new Vuex.Store({
namespaced: true, namespaced: true,
state: { state: {
@ -56,13 +57,42 @@ export default new Vuex.Store({
}, },
SET_TIPS_LIST(state, tipsList) { SET_TIPS_LIST(state, tipsList) {
let _list = state.tipsList let _list = state.tipsList
state.tipsList = _list.concat(tipsList) // state.tipsList = _list.concat(tipsList)
state.tipsList = tipsList
}, },
SET_TIPS_TIME(state, time) { SET_TIPS_TIME(state, time) {
state.tipsTime = time state.tipsTime = time
} }
}, },
actions: { 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) { setTipsList({ commit }, time) {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const url = '/gov/project/memoAttr/memosToRemind' const url = '/gov/project/memoAttr/memosToRemind'
@ -76,13 +106,16 @@ export default new Vuex.Store({
} else reject(msg) } else reject(msg)
}) })
}, },
setTipsTime({ commit }) { setTipsTime({ commit, dispatch }) {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
if (interTimer) clearInterval(interTimer)
const url = '/gov/project/memoAttr/memoTime' const url = '/gov/project/memoAttr/memoTime'
const { data, code, msg } = await requestPost(url) const { data, code, msg } = await requestPost(url)
if (code === 0) { if (code === 0) {
commit('SET_TIPS_TIME', data) commit('SET_TIPS_TIME', data)
if (data.length > 0) dispatch('setInterval')
resolve() resolve()
} else reject(msg) } else reject(msg)
}) })

22
src/utils/index.js

@ -93,3 +93,25 @@ export function treeDataTranslate(data, id = 'id', pid = 'pid') {
} }
return res 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
}

75
src/views/main-content.vue

@ -70,28 +70,29 @@
</keep-alive> </keep-alive>
</template> </template>
<template v-for="(item, index) in $store.state.tipsList"> <template v-for="(item, index) in msgList">
<Tips :key="item.memoId" <Tips :key="item.memoId"
:info="item" :info="item"
@look="handleLook(item)" @close="handleClose(item, index)" /> :show="msgList.length > 0 ? true : false"
@look="handleLook(item, index)" @close="handleClose(item, index)" />
</template> </template>
<el-dialog title="提示信息" :visible.sync="dialogFormVisible" :close-on-click-modal="false" append-to-body> <el-dialog :title="dialogTitle"
<el-form :model="form"> :visible.sync="dialogFormVisible"
<el-form-item label="活动名称" :label-width="formLabelWidth"> :close-on-click-modal="false"
<el-input v-model="form.name" autocomplete="off"></el-input> top="5vh"
</el-form-item> width="70%"
<el-form-item label="活动区域" :label-width="formLabelWidth"> class="dialog-h"
<el-select v-model="form.region" placeholder="请选择活动区域"> append-to-body>
<el-option label="区域一" value="shanghai"></el-option> <work-form v-if="formType == 'work_diary'" ref="ref_form"
<el-option label="区域二" value="beijing"></el-option> @dialogCancle="dialogFormVisible = false; formType=''" />
</el-select>
</el-form-item> <h-form v-if="formType == 'concern'" ref="concern_form"
</el-form> @dialogCancle="dialogFormVisible = false; formType=''" />
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button> <d-form v-if="formType == 'difficulty'" ref="difficulty_form"
<el-button type="primary" @click="dialogFormVisible = false"> </el-button> @dialogCancle="dialogFormVisible = false; formType=''" />
</div>
</el-dialog> </el-dialog>
</main> </main>
</template> </template>
@ -101,19 +102,25 @@ import { isURL } from "@/utils/validate";
import Cookie from "js-cookie"; import Cookie from "js-cookie";
import Tips from './tips.vue' import Tips from './tips.vue'
import { requestPost } from "@/js/dai/request"; 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 { export default {
components: { components: {
Tips Tips,
workForm,
dForm,
hForm
}, },
data() { data() {
return { return {
dialogTitle: '',
dialogFormVisible: false, dialogFormVisible: false,
iframeUrl: "", iframeUrl: "",
token: "", token: "",
customerId: "", customerId: "",
form: { form: {},
formType: '',
},
formLabelWidth: '120px', formLabelWidth: '120px',
tipsList: [] tipsList: []
}; };
@ -127,6 +134,11 @@ export default {
this.loopTips() this.loopTips()
}, },
computed: {
msgList() {
return this.$store.state.tipsList
}
},
methods: { methods: {
changeCustomerName(customerName) { changeCustomerName(customerName) {
this.$emit("changeCustomerName", customerName); this.$emit("changeCustomerName", customerName);
@ -250,11 +262,26 @@ export default {
this.$store.state.tipsList.splice(index, 1) this.$store.state.tipsList.splice(index, 1)
this.closeTips(item.memoId) this.closeTips(item.memoId)
}, },
async handleLook(item) { async handleLook(item, index) {
console.log('look-----', item) console.log('look-----', item)
await this.getInfo(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 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)
})
} }
}, },
}; };

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

@ -6,7 +6,7 @@
:inline="true" :inline="true"
:model="formData" :model="formData"
:rules="dataRule" :rules="dataRule"
:disabled="formType==='detail'" :disabled="formType==='look'"
class="form"> class="form">
<el-form-item label="内容" <el-form-item label="内容"
@ -102,7 +102,7 @@
<div class="div_btn"> <div class="div_btn">
<el-button size="small" <el-button size="small"
@click="handleCancle"> </el-button> @click="handleCancle"> </el-button>
<el-button size="small" <el-button v-if="formType != 'look'" size="small"
type="primary" type="primary"
:disabled="btnDisable" :disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"> </el-button>
@ -196,13 +196,15 @@ export default {
setTimeout(() => { setTimeout(() => {
this.btnDisable = false this.btnDisable = false
}, 10000) }, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => { this.$refs['ref_form'].validate(async (valid, messageObj) => {
if (!valid) { if (!valid) {
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
this.btnDisable = false this.btnDisable = false
} else { } else {
this.addDifficulty() await this.addDifficulty()
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} }
}) })

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

@ -286,7 +286,7 @@ export default {
this.formShow = true this.formShow = true
this.formTitle = '详情' this.formTitle = '详情'
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.id) this.$refs.ref_form.initForm('look', row.id)
// this.$refs.ref_detail.initForm(row) // this.$refs.ref_detail.initForm(row)
}) })

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

@ -6,7 +6,7 @@
:inline="true" :inline="true"
:model="formData" :model="formData"
:rules="dataRule" :rules="dataRule"
:disabled="formType==='detail'" :disabled="formType==='look'"
class="form"> class="form">
<el-form-item label="关怀类型" <el-form-item label="关怀类型"
@ -133,7 +133,7 @@
<div class="div_btn"> <div class="div_btn">
<el-button size="small" <el-button size="small"
@click="handleCancle"> </el-button> @click="handleCancle"> </el-button>
<el-button size="small" <el-button v-if="formType != 'look'" size="small"
type="primary" type="primary"
:disabled="btnDisable" :disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"> </el-button>
@ -241,13 +241,15 @@ export default {
setTimeout(() => { setTimeout(() => {
this.btnDisable = false this.btnDisable = false
}, 10000) }, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => { this.$refs['ref_form'].validate(async (valid, messageObj) => {
if (!valid) { if (!valid) {
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
this.btnDisable = false this.btnDisable = false
} else { } else {
this.addCare() await this.addCare()
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} }
}) })

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

@ -357,7 +357,7 @@ export default {
this.formTitle = '详情' this.formTitle = '详情'
this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.ref_detail.initForm(row) // this.$refs.ref_detail.initForm(row)
this.$refs.ref_form.initForm('detail', row.id) this.$refs.ref_form.initForm('look', row.id)
}) })
}, },

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>

8
src/views/tips.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="msg-tips" :class="showTips ? 'show-tips' : 'hide-tips'"> <div class="msg-tips" :class="showTips && 'show-tips'">
<el-card class="tips-card"> <el-card class="tips-card">
<div class="tips-wr"> <div class="tips-wr">
<div class="tips-wr-title">通知提醒</div> <div class="tips-wr-title">通知提醒</div>
@ -20,7 +20,7 @@ export default {
props: { props: {
show: { show: {
type: Boolean, type: Boolean,
default: true default: false
}, },
info: { info: {
type: Object, type: Object,
@ -51,6 +51,7 @@ export default {
.msg-tips { .msg-tips {
position: fixed; position: fixed;
right: 0; right: 0;
bottom: -220px;
z-index: 999; z-index: 999;
transition: bottom .5s; transition: bottom .5s;
.tips-card { .tips-card {
@ -95,9 +96,10 @@ export default {
} }
.hide-tips { .hide-tips {
bottom: -220px; bottom: -220px;
transition: bottom .5s;
} }
.show-tips { .show-tips {
bottom: 0px; bottom: 0px;
transition: bottom .5s;
} }
</style> </style>
Loading…
Cancel
Save