Browse Source

周报后台管理

master
wanggongfeng 6 years ago
parent
commit
e3a0c2fa74
  1. 100
      src/views/modules/workRecord/weekrecordinfo.vue
  2. 75
      src/views/modules/workRecord/weekrecordinfoDetail.vue

100
src/views/modules/workRecord/weekrecordinfo.vue

@ -2,11 +2,48 @@
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__weekrecordinfo}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<!-- <el-form-item>
<el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
</el-form-item> -->
<div>
<el-form-item label="周报内容" prop="content" label-width="90px">
<el-input v-model="dataForm.content" placeholder="会议内容" clearable maxlength="20" @keyup.native="btKeyUpContent" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="发布人" prop="nickName" label-width="90px">
<el-input v-model="dataForm.nickName" placeholder="发布人" clearable maxlength="10" @keyup.native="btKeyUpNickName" style="width:200px"></el-input>
</el-form-item>
</div>
<el-form-item label="所属机构" label-width="90px">
<el-cascader
v-model="ids"
:options="options"
:props="{ checkStrictly: true }"
clearable
>
</el-cascader>
</el-form-item>
<el-form-item label="发布时间" prop="startTime" label-width="90px">
<el-date-picker v-model="dataForm.startTime"
type="date"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间"
style="width:200px">
</el-date-picker>
</el-form-item>
<el-form-item label="至" prop="endTime">
<el-date-picker v-model="dataForm.endTime"
type="date"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间"
style="width:200px">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="getDataListOverWrite()">{{ $t('query') }}</el-button>
</el-form-item>
<!-- <el-form-item>
<el-button v-if="$hasPermission('news:weekrecordinfo:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
@ -14,6 +51,9 @@
<el-form-item>
<el-button type="primary" @click="addHandle('',false,'1')">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('news:weekrecordinfo:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
@ -66,23 +106,75 @@ export default {
getDataListURL: '/workRecord/weekrecordinfo/page',
getDataListIsPage: true,
deleteURL: '/workRecord/weekrecordinfo',
deleteIsBatch: true
deleteIsBatch: true,
exportURL: '/workRecord/weekrecordinfo/export'
},
dataForm: {
id: ''
}
},
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.endTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal + ' 00:00:00').getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.startTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal + ' 00:00:00').getTime()
}
}
},
ids: [],
options: []
}
},
created: function () {
this.getDataList()
this.getOptions()
},
components: {
AddOrUpdate
},
watch: {
ids: function (val) {
if (val.length === 0) {
this.dataForm.deptId = ''
} else {
this.dataForm.deptId = this.ids[val.length - 1]
}
}
},
methods: {
addHandle (id, disabled, isAdd) {
this.$parent.selectComponent = 'WeekrecordinfoDetail'
this.$router.push({ path: '/workRecord-weekrecordinforoute', query: { id: id, disabled: disabled, isAdd: isAdd } })
},
getOptions () {
this.$http
.get(`/sys/user/deptOptions/getByLoginUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => {})
},
getDataListOverWrite () {
this.page = 1
this.getDataList()
},
btKeyUpContent (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.content = e.target.value
},
btKeyUpNickName (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.createdBy = e.target.value
}
}
}

75
src/views/modules/workRecord/weekrecordinfoDetail.vue

@ -1,5 +1,5 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<el-card shadow="never" class="aui-card--fill" v-loading="pageloading">
<div class="mod-__masteruserrelation}">
<el-form label-width="500px" label-position="left" :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :disabled="pageDisabled">
<div v-for="(item, index) in this.dataForm.totalConfigList" :key="index">
@ -51,6 +51,22 @@
</el-dialog>
<div><font color="gray">1~9张图</font></div>
</el-form-item>
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="90px">
<el-upload
class="upload-demo"
:action="uploadUrl"
:before-remove="beforeFileRemove"
:file-list="dataForm.files"
:before-upload="beforeAvatarFileUpload"
:on-remove="handleFileRemove"
:on-success="handleAvatarFileSuccess"
:on-error="handelError"
:on-preview="handleFileCardPreview"
style="width:480px">
<el-button size="small">点击上传</el-button>
<div slot="tip" class="el-upload__tip">支持.wordPDFExcel文件</div>
</el-upload>
</el-form-item>
</el-form>
<el-form>
<el-form-item style="margin-left:35px;">
@ -76,6 +92,7 @@ export default {
content: '',
state: '',
images: [],
files: [],
totalConfigList: []
},
isShowArr: [
@ -88,8 +105,10 @@ export default {
pageDisabled: false,
uploadUrl: '',
loading: false,
fileloading: false,
dialogImageUrl: '',
dialogVisible: false
dialogVisible: false,
pageloading: true
}
},
computed: {
@ -102,16 +121,12 @@ export default {
}
},
created: function () {
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}`
this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}`
},
mounted () {
this.pageDisabled = this.$route.query.disabled
this.hideUpload = this.$route.query.disabled
// if (this.$route.query.id !== '' && this.$route.query.id != null) {
// this.dataForm.id = this.$route.query.id
// this.getInfo()
// }
this.getFormDataInfo()
},
methods: {
@ -150,6 +165,7 @@ export default {
},
handelError () {
this.loading = false
this.fileloading = false
this.isAble = false
this.$message.error('上传文件失败!')
},
@ -166,28 +182,40 @@ export default {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
// --------------------
handleFileCardPreview (file) {
window.location.href = `${window.SITE_CONFIG['apiURL']}/oss/file/download?fileUrl=${file.url}`
// window.location.href = `http://219.146.91.110:10000/epdc-api/oss/file/download?fileUrl=${file.url}`
},
beforeFileRemove (file, fileList) {
return this.$confirm(`确定移除${file.name}`)
},
handleAvatarFileSuccess (res, file) {
this.fileloading = false
this.isAble = false
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName, name: res.data.fileName })
},
handleFileRemove (file, fileList) {
for (var i = 0; i < this.dataForm.files.length; i++) {
let item = this.dataForm.files[i]
if (item.url === file.url) {
this.dataForm.files.splice(i, 1)
}
}
},
beforeAvatarFileUpload (file) {
this.fileloading = true
this.isAble = true
// const isJPG = file.type === 'image/jpeg'
// const isPNG = file.type === 'image/png'
// const isLt1M = file.size / 1024 / 1024 < 1
},
//
backToUserRelationList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'Weekrecordinfo'
this.$router.push({ path: '/workRecord-weekrecordinforoute' })
},
//
// getInfo () {
// this.$http.get(`/workRecord/weekrecordinfo/${this.dataForm.id}`).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.dataForm = {
// ...this.dataForm,
// ...res.data
// }
// // ()
// if (!this.$route.query.disabled) {
// this.hideUpload = this.dataForm.images.length >= 9
// }
// }).catch(() => {})
// },
//
getFormDataInfo () {
let postData = {
@ -195,6 +223,7 @@ export default {
isAdd: this.$route.query.isAdd
}
this.$http.post(`/workRecord/resourcesdictionary/getResourcesDictionaryInitInfo`, postData).then(({ data: res }) => {
this.pageloading = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}

Loading…
Cancel
Save