Browse Source

Merge remote-tracking branch 'origin/feature/workRecord'

master
李鹏飞 6 years ago
parent
commit
6efa234c1f
  1. 8
      src/views/modules/sys/resourcestotalrelation-list.vue
  2. 14
      src/views/modules/sys/totalconfig-add-or-update.vue
  3. 8
      src/views/modules/sys/totalconfig-list.vue
  4. 8
      src/views/modules/sys/totalconfig-select-list.vue
  5. 15
      src/views/modules/workRecord/dailyrecordinfo-add-or-update.vue
  6. 8
      src/views/modules/workRecord/dailyrecordinfo.vue
  7. 2
      src/views/modules/workRecord/dailyrecordinfoDetail.vue
  8. 124
      src/views/modules/workRecord/monthexcellentcase.vue
  9. 291
      src/views/modules/workRecord/monthexcellentcaseDetail.vue
  10. 29
      src/views/modules/workRecord/monthexcellentcaseroute.vue
  11. 125
      src/views/modules/workRecord/monthexcellentgrid.vue
  12. 325
      src/views/modules/workRecord/monthexcellentgridDetail.vue
  13. 29
      src/views/modules/workRecord/monthexcellentgridroute.vue
  14. 174
      src/views/modules/workRecord/monthrecordinfo.vue
  15. 283
      src/views/modules/workRecord/monthrecordinfoDetail.vue
  16. 33
      src/views/modules/workRecord/monthrecordinforoute.vue
  17. 128
      src/views/modules/workRecord/weekrecordinfo.vue
  18. 170
      src/views/modules/workRecord/weekrecordinfoDetail.vue

8
src/views/modules/sys/resourcestotalrelation-list.vue

@ -52,6 +52,7 @@
<el-table-column prop="spec" label="规格" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" label="排序" header-align="center" align="center"></el-table-column>
<el-table-column prop="autoFlag" label="是否自动计算" :formatter="autoFlagFormatter" header-align="center" align="center"></el-table-column>
<el-table-column prop="mustFlag" label="是否必须输入" :formatter="mustFlagFormatter" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('workRecord:relation:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
@ -129,6 +130,13 @@ export default {
return '是'
}
},
mustFlagFormatter: function (row, column) {
if (row.mustFlag === '0') {
return '否'
} else if (row.mustFlag === '1') {
return '是'
}
},
selectHandle () {
this.selectListVisible = true
this.$nextTick(() => {

14
src/views/modules/sys/totalconfig-add-or-update.vue

@ -33,6 +33,14 @@
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="mustFlag"
label="必须输入"
size="mini">
<el-radio-group v-model="dataForm.mustFlag">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
@ -55,7 +63,8 @@ export default {
totalStyle: '',
spec: '',
sort: 0,
autoFlag: '0'
autoFlag: '0',
mustFlag: '0'
}
}
},
@ -76,6 +85,9 @@ export default {
],
autoFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
mustFlag : [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}

8
src/views/modules/sys/totalconfig-list.vue

@ -45,6 +45,7 @@
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" label="排序" header-align="center" align="center"></el-table-column>
<el-table-column prop="autoFlag" label="是否自动计算" :formatter="autoFlagFormatter" header-align="center" align="center"></el-table-column>
<el-table-column prop="mustFlag" label="是否必须输入" :formatter="mustFlagFormatter" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('workRecord:totalconfig:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
@ -100,6 +101,13 @@ export default {
return '是'
}
},
mustFlagFormatter: function (row, column) {
if (row.mustFlag === '0') {
return '否'
} else if (row.mustFlag === '1') {
return '是'
}
},
selectData(){
this.page = 1
this.getDataList()

8
src/views/modules/sys/totalconfig-select-list.vue

@ -55,6 +55,7 @@
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" label="排序" header-align="center" align="center"></el-table-column>
<el-table-column prop="autoFlag" label="是否自动计算" :formatter="autoFlagFormatter" header-align="center" align="center"></el-table-column>
<el-table-column prop="mustFlag" label="是否必须输入" :formatter="mustFlagFormatter" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('workRecord:relation:select')" type="text" size="small" @click="SubmitHandle(scope.row.id)">选择</el-button>
@ -130,6 +131,13 @@ export default {
return '是'
}
},
mustFlagFormatter: function (row, column) {
if (row.mustFlag === '0') {
return '否'
} else if (row.mustFlag === '1') {
return '是'
}
},
SubmitHandle(configId) {
if(!configId && this.dataListSelections.length <= 0) {
return this.$message({

15
src/views/modules/workRecord/dailyrecordinfo-add-or-update.vue

@ -1,21 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<!-- <el-form-item label="用户ID" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户ID"></el-input>
</el-form-item>
<el-form-item label="用户姓名" prop="nickName">
<el-input v-model="dataForm.nickName" placeholder="用户姓名"></el-input>
</el-form-item>
<el-form-item label="头像" prop="userFace">
<el-input v-model="dataForm.userFace" placeholder="头像"></el-input>
</el-form-item>
<el-form-item label="部门名称" prop="deptName">
<el-input v-model="dataForm.deptName" placeholder="部门名称"></el-input>
</el-form-item>
<el-form-item label="部门Id" prop="deptId">
<el-input v-model="dataForm.deptId" placeholder="部门Id"></el-input>
</el-form-item> -->
<el-form-item v-if="dailyTypeArr.length > 0" label="随手记" prop="dailyType">
<el-select v-model="dataForm.dailyType" placeholder="随手记类型" @change="selectModel($event)" clearable style="width:90%">
<el-option v-for="item in dailyTypeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >

8
src/views/modules/workRecord/dailyrecordinfo.vue

@ -86,7 +86,7 @@
<el-table-column prop="createdTime" label="发布时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addHandle(scope.row.id,false)">{{ $t('update') }}</el-button>
<el-button :disabled="scope.row.isUpdate == '0'" type="text" size="small" @click="addHandle(scope.row.id,false)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="addHandle(scope.row.id,true)">{{ '查看' }}</el-button>
<el-button v-if="$hasPermission('news:dailyrecordinfo:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
@ -138,7 +138,9 @@ export default {
}
},
dataForm: {
id: ''
id: '',
content: '',
nickName: ''
},
meetTypeArr: [],
dailyTypeArr: [],
@ -185,7 +187,7 @@ export default {
},
btKeyUpNickName (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.createdBy = e.target.value
this.dataForm.nickName = e.target.value
},
addHandle (id, disabled) {
this.$parent.selectComponent = 'DailyrecordinfoDetail'

2
src/views/modules/workRecord/dailyrecordinfoDetail.vue

@ -36,7 +36,7 @@
<div><font color="gray">地图选择地址可手动修改</font></div>
</el-form-item>
<el-form-item label="参加人数" prop="joinNum" label-width="100px">
<el-input-number v-model="dataForm.joinNum" :min="1" :max="100000000" label="参加人数" precision></el-input-number>
<el-input-number v-model="dataForm.joinNum" :min="1" :max="100000000" label="参加人数" :precision="0"></el-input-number>
</el-form-item>
<el-form-item label="会议内容" prop="content" label-width="100px">
<el-input

124
src/views/modules/workRecord/monthexcellentcase.vue

@ -2,11 +2,48 @@
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__monthexcellentcase}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<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-input v-model="dataForm.id" placeholder="id" clearable></el-input>
<el-button @click="getDataListOverWrite()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button type="primary" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('news:monthexcellentcase:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
@ -16,18 +53,18 @@
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" label="主键" header-align="center" align="center"></el-table-column>
<el-table-column prop="infoId" label="信息ID" header-align="center" align="center"></el-table-column>
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="nickName" label="发布人" header-align="center" align="center"></el-table-column>
<el-table-column prop="content" label="内容" header-align="center" align="center"></el-table-column>
<el-table-column prop="delFlag" label="逻辑删除标识" header-align="center" align="center"></el-table-column>
<el-table-column prop="revision" label="乐观锁" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdBy" label="创建人" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="updatedBy" label="更新人" header-align="center" align="center"></el-table-column>
<el-table-column prop="updatedTime" label="更新时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="发布时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button :disabled="scope.row.isUpdate == '0'" type="text" size="small" @click="addHandle(scope.row.id,'0')">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="addHandle(scope.row.id,'1')">{{ '查看' }}</el-button>
<el-button v-if="$hasPermission('news:monthexcellentcase:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('news:monthexcellentcase:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
@ -56,18 +93,73 @@ export default {
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/news/monthexcellentcase/page',
getDataListURL: '/workRecord/monthexcellentcase/page',
getDataListIsPage: true,
deleteURL: '/news/monthexcellentcase',
deleteIsBatch: true
deleteURL: '/workRecord/monthexcellentcase',
deleteIsBatch: true,
exportURL: '/workRecord/monthexcellentcase/export'
},
dataForm: {
id: ''
}
id: '',
content: '',
nickName: ''
},
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: []
}
},
components: {
AddOrUpdate
},
watch: {
ids: function (val) {
if (val.length === 0) {
this.dataForm.deptId = ''
} else {
this.dataForm.deptId = this.ids[val.length - 1]
}
}
},
created: function () {
this.getDataList()
this.getOptions()
},
methods: {
addHandle (id, disabled) {
this.$parent.selectComponent = 'MonthexcellentcaseDetail'
this.$router.push({ path: '/workRecord-Monthexcellentcaseroute', query: { id: id, disabled: disabled } })
},
getDataListOverWrite () {
this.page = 1
this.getDataList()
},
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(() => {})
}
}
}
</script>

291
src/views/modules/workRecord/monthexcellentcaseDetail.vue

@ -0,0 +1,291 @@
<template>
<el-card shadow="never" class="aui-card--fill" v-loading="pageloading">
<div class="mod-__masteruserrelation}">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'" :disabled="pageDisabled">
<el-form-item label="会议内容" prop="content" label-width="100px">
<el-input
type="textarea"
:rows="6"
placeholder="请输入会议内容,2000字以内"
v-model="dataForm.content"
maxlength="2000"
style="width:50%">
</el-input>
</el-form-item>
<el-form-item label="添加图片" v-loading="loading" prop="images" label-width="90px">
<el-upload
:action="uploadUrl"
:class="{hide:hideUpload}"
list-type="picture-card"
:file-list="dataForm.images"
:limit=9
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:on-success="handleAvatarSuccess"
:on-error="handelError"
:before-upload="beforeAvatarUpload"
style="width:480px">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</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="uploadFileUrl"
: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;">
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button>
<el-button v-if="!pageDisabled" type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</div>
</el-card>
</template>
<script>
import debounce from 'lodash/debounce'
import Cookies from 'js-cookie'
import 'quill/dist/quill.snow.css'
import MapSelect from './map-select'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
userId: '',
nickName: '',
userFace: '',
deptId: '',
deptName: '',
startDate: '',
endDate: '',
content: '',
state: '',
images: [],
files: []
},
isAble: false,
hideUpload: false,
pageDisabled: false,
uploadUrl: '',
uploadFileUrl: '',
loading: false,
dialogImageUrl: '',
dialogVisible: false,
isAutoRemoveFile: true,
fileloading: false,
pageloading: true
}
},
computed: {
dataRule () {
return {
content: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
created: function () {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}`
this.uploadFileUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}`
// this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
// this.uploadFileUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}`
},
components: {
MapSelect
},
mounted () {
if (this.$route.query.disabled === '0') {
this.pageDisabled = false
this.hideUpload = false
} else {
this.pageDisabled = true
this.hideUpload = true
}
if (this.$route.query.id !== '' && this.$route.query.id != null) {
this.dataForm.id = this.$route.query.id
this.getInfo()
} else {
this.pageloading = false
}
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId
}
},
methods: {
init () {
this.dataForm.id = this.$route.query.id
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
beforeAvatarUpload (file) {
if (this.dataForm.length === 9) {
this.$message.error('最多上传9张图片!')
return false
}
this.loading = true
this.isAble = true
const isJPG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png'
//
if (!isJPG && !isPNG) {
this.$message.error('上传文件必须是jpg、png格式!')
this.loading = false
return false
}
},
handleAvatarSuccess (res, file) {
this.loading = false
this.isAble = false
this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, recordType: 2, fileName: res.data.fileName })
this.hideUpload = this.dataForm.images.length >= 9
},
handelError () {
this.loading = false
this.fileloading = false
this.isAble = false
this.$message.error('上传文件失败!')
},
handleRemove (file, fileList) {
for (var i = 0; i < this.dataForm.images.length; i++) {
let item = this.dataForm.images[i]
if (item.url === file.url) {
this.dataForm.images.splice(i, 1)
}
}
this.hideUpload = this.dataForm.images.length >= 9
},
handlePictureCardPreview (file) {
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) {
if (this.isAutoRemoveFile) {
return this.$confirm(`确定移除${file.name}`)
}
this.isAutoRemoveFile = true
},
beforeAvatarFileUpload (file) {
this.fileloading = true
this.isAble = true
if (file.size === 0) {
this.isAutoRemoveFile = false
this.$message.error('文件为空文件,请上传非空文件!')
this.fileloading = false
this.isAble = false
return false
}
},
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)
}
}
},
handleAvatarFileSuccess (res, file) {
this.fileloading = false
this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
return false
}
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 2, fileName: res.data.fileName, name: res.data.fileName })
},
//
backToUserRelationList () {
this.$emit('refreshDataList')
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} else {
this.$parent.selectComponent = 'Monthexcellentcase'
this.$router.push({ path: '/workRecord-Monthexcellentcaseroute' })
}
},
//
getInfo () {
this.$http.get(`/workRecord/monthexcellentcase/${this.dataForm.id}`).then(({ data: res }) => {
this.pageloading = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
// ()
if (this.$route.query.disabled === '0') {
this.hideUpload = this.dataForm.images.length >= 9
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/workRecord/monthexcellentcase/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.isAble = false
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.isAble = false
this.visible = false
this.$emit('refreshDataList')
//
this.backToUserRelationList()
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
</style>

29
src/views/modules/workRecord/monthexcellentcaseroute.vue

@ -0,0 +1,29 @@
<template>
<keep-alive include="monthexcellentcase">
<component :is="selectComponent"></component>
</keep-alive>
</template>
<script>
import Monthexcellentcase from './monthexcellentcase'
import MonthexcellentcaseDetail from './monthexcellentcaseDetail'
export default {
data () {
return {
selectComponent: Monthexcellentcase
}
},
components: {
Monthexcellentcase,
MonthexcellentcaseDetail
},
methods: {
init () {
this.selectComponent = Monthexcellentcase
}
}
}
</script>
<style lang="scss" scoped>
</style>

125
src/views/modules/workRecord/monthexcellentgrid.vue

@ -2,11 +2,48 @@
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__monthexcellentgrid}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<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-input v-model="dataForm.id" placeholder="id" clearable></el-input>
<el-button @click="getDataListOverWrite()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button type="primary" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('news:monthexcellentgrid:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
@ -16,20 +53,19 @@
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" label="主键" header-align="center" align="center"></el-table-column>
<el-table-column prop="infoId" label="信息ID" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptId" label="部门ID" header-align="center" align="center"></el-table-column>
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="nickName" label="发布人" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="content" label="内容" header-align="center" align="center"></el-table-column>
<el-table-column prop="revision" label="乐观锁" header-align="center" align="center"></el-table-column>
<el-table-column prop="delFlag" label="逻辑删除标识" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdBy" label="创建人" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="updatedBy" label="更新人" header-align="center" align="center"></el-table-column>
<el-table-column prop="updatedTime" label="更新时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="发布时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button :disabled="scope.row.isUpdate == '0'" type="text" size="small" @click="addHandle(scope.row.id,'0')">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="addHandle(scope.row.id,'1')">{{ '查看' }}</el-button>
<el-button v-if="$hasPermission('news:monthexcellentgrid:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('news:monthexcellentgrid:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
@ -58,18 +94,73 @@ export default {
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/news/monthexcellentgrid/page',
getDataListURL: '/workRecord/monthexcellentgrid/page',
getDataListIsPage: true,
deleteURL: '/news/monthexcellentgrid',
deleteIsBatch: true
deleteURL: '/workRecord/monthexcellentgrid',
deleteIsBatch: true,
exportURL: '/workRecord/monthexcellentgrid/export'
},
dataForm: {
id: ''
}
id: '',
content: '',
nickName: ''
},
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: []
}
},
components: {
AddOrUpdate
},
watch: {
ids: function (val) {
if (val.length === 0) {
this.dataForm.deptId = ''
} else {
this.dataForm.deptId = this.ids[val.length - 1]
}
}
},
created: function () {
this.getDataList()
this.getOptions()
},
methods: {
addHandle (id, disabled) {
this.$parent.selectComponent = 'MonthexcellentgridDetail'
this.$router.push({ path: '/workRecord-Monthexcellentgridroute', query: { id: id, disabled: disabled } })
},
getDataListOverWrite () {
this.page = 1
this.getDataList()
},
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(() => {})
}
}
}
</script>

325
src/views/modules/workRecord/monthexcellentgridDetail.vue

@ -0,0 +1,325 @@
<template>
<el-card shadow="never" class="aui-card--fill" v-loading="pageloading">
<div class="mod-__masteruserrelation}">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'" :disabled="pageDisabled">
<el-form-item label="选择网格" label-width="90px">
<el-cascader
ref="name"
v-model="ids"
:options="options"
:props="{ checkStrictly: true }"
clearable
>
</el-cascader>
</el-form-item>
<el-form-item label="会议内容" prop="content" label-width="100px">
<el-input
type="textarea"
:rows="6"
placeholder="请输入会议内容,2000字以内"
v-model="dataForm.content"
maxlength="2000"
style="width:50%">
</el-input>
</el-form-item>
<el-form-item label="添加图片" v-loading="loading" prop="images" label-width="90px">
<el-upload
:action="uploadUrl"
:class="{hide:hideUpload}"
list-type="picture-card"
:file-list="dataForm.images"
:limit=9
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:on-success="handleAvatarSuccess"
:on-error="handelError"
:before-upload="beforeAvatarUpload"
style="width:480px">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</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="uploadFileUrl"
: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;">
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button>
<el-button v-if="!pageDisabled" type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</div>
</el-card>
</template>
<script>
import debounce from 'lodash/debounce'
import Cookies from 'js-cookie'
import 'quill/dist/quill.snow.css'
import MapSelect from './map-select'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
userId: '',
nickName: '',
userFace: '',
deptId: '',
deptName: '',
startDate: '',
endDate: '',
content: '',
state: '',
images: [],
files: []
},
isAble: false,
hideUpload: false,
pageDisabled: false,
uploadUrl: '',
uploadFileUrl: '',
loading: false,
dialogImageUrl: '',
dialogVisible: false,
isAutoRemoveFile: true,
fileloading: false,
pageloading: true,
ids: [],
options: []
}
},
computed: {
dataRule () {
return {
content: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
watch: {
ids: function (val) {
if (val.length === 0) {
this.dataForm.deptId = ''
} else {
this.dataForm.deptId = this.ids[val.length - 1]
}
this.dataForm.deptName = this.$refs['name'].getCheckedNodes()[0].label
}
},
created: function () {
this.getOptions()
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}`
// this.uploadFileUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}`
this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
this.uploadFileUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}`
},
components: {
MapSelect
},
mounted () {
if (this.$route.query.disabled === '0') {
this.pageDisabled = false
this.hideUpload = false
} else {
this.pageDisabled = true
this.hideUpload = true
}
if (this.$route.query.id !== '' && this.$route.query.id != null) {
this.dataForm.id = this.$route.query.id
this.getInfo()
} else {
this.pageloading = false
}
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId
}
},
methods: {
init () {
this.dataForm.id = this.$route.query.id
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
beforeAvatarUpload (file) {
if (this.dataForm.length === 9) {
this.$message.error('最多上传9张图片!')
return false
}
this.loading = true
this.isAble = true
const isJPG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png'
//
if (!isJPG && !isPNG) {
this.$message.error('上传文件必须是jpg、png格式!')
this.loading = false
return false
}
},
handleAvatarSuccess (res, file) {
this.loading = false
this.isAble = false
this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, recordType: 4, fileName: res.data.fileName })
this.hideUpload = this.dataForm.images.length >= 9
},
handelError () {
this.loading = false
this.fileloading = false
this.isAble = false
this.$message.error('上传文件失败!')
},
handleRemove (file, fileList) {
for (var i = 0; i < this.dataForm.images.length; i++) {
let item = this.dataForm.images[i]
if (item.url === file.url) {
this.dataForm.images.splice(i, 1)
}
}
this.hideUpload = this.dataForm.images.length >= 9
},
handlePictureCardPreview (file) {
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) {
if (this.isAutoRemoveFile) {
return this.$confirm(`确定移除${file.name}`)
}
this.isAutoRemoveFile = true
},
beforeAvatarFileUpload (file) {
this.fileloading = true
this.isAble = true
if (file.size === 0) {
this.isAutoRemoveFile = false
this.$message.error('文件为空文件,请上传非空文件!')
this.fileloading = false
this.isAble = false
return false
}
},
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)
}
}
},
handleAvatarFileSuccess (res, file) {
this.fileloading = false
this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
return false
}
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 4, fileName: res.data.fileName, name: res.data.fileName })
},
//
backToUserRelationList () {
this.$emit('refreshDataList')
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} else {
this.$parent.selectComponent = 'Monthexcellentgrid'
this.$router.push({ path: '/workRecord-Monthexcellentgridroute' })
}
},
//
getInfo () {
this.$http.get(`/workRecord/monthexcellentgrid/${this.dataForm.id}`).then(({ data: res }) => {
this.pageloading = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
// ()
if (this.$route.query.disabled === '0') {
this.hideUpload = this.dataForm.images.length >= 9
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/workRecord/monthexcellentgrid/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.isAble = false
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.isAble = false
this.visible = false
this.$emit('refreshDataList')
//
this.backToUserRelationList()
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false }),
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(() => {})
}
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
</style>

29
src/views/modules/workRecord/monthexcellentgridroute.vue

@ -0,0 +1,29 @@
<template>
<keep-alive include="monthexcellentgrid">
<component :is="selectComponent"></component>
</keep-alive>
</template>
<script>
import Monthexcellentgrid from './monthexcellentgrid'
import MonthexcellentgridDetail from './monthexcellentgridDetail'
export default {
data () {
return {
selectComponent: Monthexcellentgrid
}
},
components: {
Monthexcellentgrid,
MonthexcellentgridDetail
},
methods: {
init () {
this.selectComponent = Monthexcellentgrid
}
}
}
</script>
<style lang="scss" scoped>
</style>

174
src/views/modules/workRecord/monthrecordinfo.vue

@ -2,40 +2,81 @@
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__monthrecordinfo}">
<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>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<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="getDataListOverWrite()">{{ $t('query') }}</el-button>
</el-form-item>
<!-- <el-form-item>
<el-button v-if="$hasPermission('news:monthrecordinfo:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="addHandle('','0')">{{ $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:monthrecordinfo:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" label="主键" header-align="center" align="center"></el-table-column>
<el-table-column prop="userId" label="用户ID" header-align="center" align="center"></el-table-column>
<el-table-column prop="nickName" label="用户姓名" header-align="center" align="center"></el-table-column>
<el-table-column prop="userFace" label="头像" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptId" label="部门Id" header-align="center" align="center"></el-table-column>
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="nickName" label="发布人" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="startDate" label="统计开始时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="endDate" label="统计结束时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="content" label="内容" header-align="center" align="center"></el-table-column>
<el-table-column prop="state" label="月报状态:0为提交,1已提交" header-align="center" align="center"></el-table-column>
<el-table-column prop="revision" label="乐观锁" header-align="center" align="center"></el-table-column>
<el-table-column prop="delFlag" label="逻辑删除标识" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdBy" label="创建人" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="updatedBy" label="更新人" header-align="center" align="center"></el-table-column>
<el-table-column prop="updatedTime" label="更新时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="startDate" label="统计开始时间" header-align="center" align="center" :formatter="dateFormat"></el-table-column>
<el-table-column prop="endDate" label="统计结束时间" header-align="center" align="center" :formatter="dateFormat"></el-table-column>
<el-table-column prop="content" label="内容" header-align="center" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="state" label="月报状态" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="发布时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('news:monthrecordinfo:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button :disabled="scope.row.isUpdate == '0'" type="text" size="small" @click="addHandle(scope.row.id,'0')">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="addHandle(scope.row.id,'1')">{{ '查看' }}</el-button>
<el-button :disabled="scope.row.isUpdate == '0'" type="text" size="small" @click="addCaseHandle(scope.row.id,'0')">{{ '新建优秀案例' }}</el-button>
<el-button :disabled="scope.row.isUpdate == '0'" type="text" size="small" @click="addGridHandle(scope.row.id,'0')">{{ '新建示范网格' }}</el-button>
<el-button v-if="$hasPermission('news:monthrecordinfo:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
@ -63,18 +104,101 @@ export default {
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/news/monthrecordinfo/page',
getDataListURL: '/workRecord/monthrecordinfo/page',
getDataListIsPage: true,
deleteURL: '/news/monthrecordinfo',
deleteIsBatch: true
deleteURL: '/workRecord/monthrecordinfo',
deleteIsBatch: true,
exportURL: '/workRecord/monthrecordinfo/export'
},
dataForm: {
id: ''
}
id: '',
content: '',
nickName: ''
},
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: []
}
},
components: {
AddOrUpdate
},
watch: {
ids: function (val) {
if (val.length === 0) {
this.dataForm.deptId = ''
} else {
this.dataForm.deptId = this.ids[val.length - 1]
}
}
},
created: function () {
this.getDataList()
this.getOptions()
},
methods: {
addHandle (id, disabled) {
this.$parent.selectComponent = 'MonthrecordinfoDetail'
this.$router.push({ path: '/workRecord-Monthrecordinforoute', query: { id: id, disabled: disabled } })
},
addCaseHandle (infoId, disabled) {
this.$parent.selectComponent = 'MonthexcellentcaseDetail'
this.$router.push({ path: '/workRecord-Monthrecordinforoute', query: { id: '', disabled: disabled, infoId: infoId } })
},
addGridHandle (infoId, disabled) {
this.$parent.selectComponent = 'MonthexcellentgridDetail'
this.$router.push({ path: '/workRecord-Monthrecordinforoute', query: { id: '', disabled: disabled, infoId: infoId } })
},
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(() => {})
},
dateFormat (row, column) {
let date = row[column.property]
return date.length >= 10 ? date.substring(0, 10) : date
},
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.nickName = e.target.value
}
}
}
</script>
<style>
.el-tooltip__popper {
max-width: 80%;
color: #353434 !important;
background:#ffffff !important;
word-break:break-all;
}
</style>

283
src/views/modules/workRecord/monthrecordinfoDetail.vue

@ -0,0 +1,283 @@
<template>
<el-card shadow="never" class="aui-card--fill" v-loading="pageloading">
<div class="mod-__masteruserrelation}">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'" :disabled="pageDisabled">
<el-form-item label="会议内容" prop="content" label-width="100px">
<el-input
type="textarea"
:rows="6"
placeholder="请输入会议内容,2000字以内"
v-model="dataForm.content"
maxlength="2000"
style="width:50%">
</el-input>
</el-form-item>
<el-form-item label="添加图片" v-loading="loading" prop="images" label-width="90px">
<el-upload
:action="uploadUrl"
:class="{hide:hideUpload}"
list-type="picture-card"
:file-list="dataForm.images"
:limit=9
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:on-success="handleAvatarSuccess"
:on-error="handelError"
:before-upload="beforeAvatarUpload"
style="width:480px">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</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="uploadFileUrl"
: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;">
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button>
<el-button v-if="!pageDisabled" type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</div>
</el-card>
</template>
<script>
import debounce from 'lodash/debounce'
import Cookies from 'js-cookie'
import 'quill/dist/quill.snow.css'
import MapSelect from './map-select'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
userId: '',
nickName: '',
userFace: '',
deptId: '',
deptName: '',
startDate: '',
endDate: '',
content: '',
state: '',
images: [],
files: []
},
isAble: false,
hideUpload: false,
pageDisabled: false,
uploadUrl: '',
uploadFileUrl: '',
loading: false,
dialogImageUrl: '',
dialogVisible: false,
isAutoRemoveFile: true,
fileloading: false,
pageloading: true
}
},
computed: {
dataRule () {
return {
content: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
created: function () {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}`
this.uploadFileUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}`
// this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
// this.uploadFileUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}`
},
components: {
MapSelect
},
mounted () {
if (this.$route.query.disabled === '0') {
this.pageDisabled = false
this.hideUpload = false
} else {
this.pageDisabled = true
this.hideUpload = true
}
if (this.$route.query.id !== '' && this.$route.query.id != null) {
this.dataForm.id = this.$route.query.id
this.getInfo()
} else {
this.pageloading = false
}
},
methods: {
init () {
this.dataForm.id = this.$route.query.id
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
beforeAvatarUpload (file) {
if (this.dataForm.length === 9) {
this.$message.error('最多上传9张图片!')
return false
}
this.loading = true
this.isAble = true
const isJPG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png'
//
if (!isJPG && !isPNG) {
this.$message.error('上传文件必须是jpg、png格式!')
this.loading = false
return false
}
},
handleAvatarSuccess (res, file) {
this.loading = false
this.isAble = false
this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, recordType: 1, fileName: res.data.fileName })
this.hideUpload = this.dataForm.images.length >= 9
},
handelError () {
this.loading = false
this.fileloading = false
this.isAble = false
this.$message.error('上传文件失败!')
},
handleRemove (file, fileList) {
for (var i = 0; i < this.dataForm.images.length; i++) {
let item = this.dataForm.images[i]
if (item.url === file.url) {
this.dataForm.images.splice(i, 1)
}
}
this.hideUpload = this.dataForm.images.length >= 9
},
handlePictureCardPreview (file) {
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) {
if (this.isAutoRemoveFile) {
return this.$confirm(`确定移除${file.name}`)
}
this.isAutoRemoveFile = true
},
beforeAvatarFileUpload (file) {
this.fileloading = true
this.isAble = true
if (file.size === 0) {
this.isAutoRemoveFile = false
this.$message.error('文件为空文件,请上传非空文件!')
this.fileloading = false
this.isAble = false
return false
}
},
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)
}
}
},
handleAvatarFileSuccess (res, file) {
this.fileloading = false
this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
return false
}
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 1, fileName: res.data.fileName, name: res.data.fileName })
},
//
backToUserRelationList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
},
//
getInfo () {
this.$http.get(`/workRecord/monthrecordinfo/${this.dataForm.id}`).then(({ data: res }) => {
this.pageloading = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
// ()
if (this.$route.query.disabled === '0') {
this.hideUpload = this.dataForm.images.length >= 9
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/workRecord/monthrecordinfo/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.isAble = false
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.isAble = false
this.visible = false
this.$emit('refreshDataList')
//
this.backToUserRelationList()
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
</style>

33
src/views/modules/workRecord/monthrecordinforoute.vue

@ -0,0 +1,33 @@
<template>
<keep-alive include="monthrecordinfo">
<component :is="selectComponent"></component>
</keep-alive>
</template>
<script>
import Monthrecordinfo from './monthrecordinfo'
import MonthrecordinfoDetail from './monthrecordinfoDetail'
import MonthexcellentcaseDetail from './monthexcellentcaseDetail'
import MonthexcellentgridDetail from './monthexcellentgridDetail'
export default {
data () {
return {
selectComponent: Monthrecordinfo
}
},
components: {
Monthrecordinfo,
MonthrecordinfoDetail,
MonthexcellentcaseDetail,
MonthexcellentgridDetail
},
methods: {
init () {
this.selectComponent = Monthrecordinfo
}
}
}
</script>
<style lang="scss" scoped>
</style>

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

@ -2,17 +2,57 @@
<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>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="addHandle('',false,'1')">{{ $t('add') }}</el-button>
<el-button type="primary" @click="addHandle('','0','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>
@ -26,15 +66,15 @@
</el-table-column>
<el-table-column prop="nickName" label="发布人" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="startDate" label="统计开始时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="endDate" label="统计结束时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="content" label="内容" header-align="center" align="center"></el-table-column>
<el-table-column prop="startDate" label="统计开始时间" header-align="center" align="center" :formatter="dateFormat"></el-table-column>
<el-table-column prop="endDate" label="统计结束时间" header-align="center" align="center" :formatter="dateFormat"></el-table-column>
<el-table-column prop="content" label="内容" header-align="center" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="state" label="周报状态" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="发布时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addHandle(scope.row.id,false,'0')">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="addHandle(scope.row.id,true,'0')">{{ '查看' }}</el-button>
<el-button :disabled="scope.row.isUpdate == '0'" type="text" size="small" @click="addHandle(scope.row.id,'0','0')">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="addHandle(scope.row.id,'1','0')">{{ '查看' }}</el-button>
<el-button v-if="$hasPermission('news:weekrecordinfo:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('news:weekrecordinfo:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
@ -66,24 +106,90 @@ export default {
getDataListURL: '/workRecord/weekrecordinfo/page',
getDataListIsPage: true,
deleteURL: '/workRecord/weekrecordinfo',
deleteIsBatch: true
deleteIsBatch: true,
exportURL: '/workRecord/weekrecordinfo/export'
},
dataForm: {
id: ''
}
id: '',
content: '',
nickName: ''
},
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: {
dateFormat (row, column) {
let date = row[column.property]
return date.length >= 10 ? date.substring(0, 10) : date
},
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.nickName = e.target.value
}
}
}
</script>
<style>
.el-tooltip__popper {
max-width: 80%;
color: #353434 !important;
background:#ffffff !important;
word-break:break-all;
}
</style>

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

@ -1,10 +1,10 @@
<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">
<div>
<el-form-item :label="item.totalDescribe" prop="showFlag" >
<el-form-item :label="item.totalDescribe" prop="showFlag" style="font-weight:bold;">
<el-select v-model="item.showFlag" placeholder="是否显示" style="width:100px">
<el-option v-for="meetTypeItem in isShowArr" :key="meetTypeItem.dictValue" :label="meetTypeItem.dictName" :value="meetTypeItem.dictValue" >
</el-option>
@ -13,22 +13,22 @@
</div>
<el-row :gutter="10">
<div v-for="(configitem, configindex) in item.configList" :key="configindex">
<el-col :span="6">
<el-form-item v-if="item.showFlag == '1'" :label="configitem.totalName" prop="total" :label-width="configitem.totalName.length*17+'px'">
<el-input-number v-model="configitem.total" :min="0" :max="100000000" label="数量" style="width: 10rem;"></el-input-number>
<el-col :span="colspan">
<el-form-item v-if="item.showFlag == '1'" :label="configitem.totalName" prop="total" :label-width="configitem.totalName.length*17+'px'" style="font-weight:normal;margin-left:42px;">
<el-input-number v-model="configitem.total" :min="0" :max="100000000" label="数量" style="width: 10rem;" :precision="0"></el-input-number>
</el-form-item>
</el-col>
</div>
</el-row>
</div>
<el-form-item label="14、本周小结" prop="content" label-width="110px">
<el-form-item label="14、本周小结" prop="content" label-width="110px" style="font-weight:bold;">
<el-input
type="textarea"
:rows="3"
:rows="6"
placeholder="请输入本周小结,2000字以内"
v-model="dataForm.content"
maxlength="2000"
style="max-width:515px">
style="max-width:562px">
</el-input>
</el-form-item>
<el-form-item label="添加图片" v-loading="loading" prop="images" label-width="90px">
@ -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="uploadFileUrl"
: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;">
@ -73,9 +89,11 @@ export default {
visible: false,
dataForm: {
id: '',
showFlag: '1',
content: '',
state: '',
images: [],
files: [],
totalConfigList: []
},
isShowArr: [
@ -87,9 +105,14 @@ export default {
hideUpload: false,
pageDisabled: false,
uploadUrl: '',
uploadFileUrl: '',
loading: false,
fileloading: false,
dialogImageUrl: '',
dialogVisible: false
dialogVisible: false,
pageloading: true,
isAutoRemoveFile: true,
colspan: 6
}
},
computed: {
@ -97,22 +120,51 @@ export default {
return {
content: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
showFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
created: function () {
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}`
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}`
this.uploadFileUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}`
// this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
// this.uploadFileUrl = `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()
// }
if (this.$route.query.disabled === '0') {
this.pageDisabled = false
this.hideUpload = false
} else {
this.pageDisabled = true
this.hideUpload = true
}
this.getFormDataInfo()
//
if (document.body.clientWidth) {
if (document.body.clientWidth < 1530 && document.body.clientWidth > 1220) {
this.colspan = 8
} else if (document.body.clientWidth < 1220 && document.body.clientWidth > 750) {
this.colspan = 12
} else if (document.body.clientWidth < 750) {
this.colspan = 24
} else {
this.colspan = 6
}
window.onresize = () => {
if (document.body.clientWidth < 1530 && document.body.clientWidth > 1220) {
this.colspan = 8
} else if (document.body.clientWidth < 1220 && document.body.clientWidth > 750) {
this.colspan = 12
} else if (document.body.clientWidth < 750) {
this.colspan = 24
} else {
this.colspan = 6
}
}
}
},
methods: {
init () {
@ -150,6 +202,7 @@ export default {
},
handelError () {
this.loading = false
this.fileloading = false
this.isAble = false
this.$message.error('上传文件失败!')
},
@ -166,28 +219,54 @@ 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) {
if (this.isAutoRemoveFile) {
return this.$confirm(`确定移除${file.name}`)
}
this.isAutoRemoveFile = true
},
handleAvatarFileSuccess (res, file) {
this.fileloading = false
this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
return 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
if (file.size === 0) {
this.isAutoRemoveFile = false
this.$message.error('文件为空文件,请上传非空文件!')
this.fileloading = false
this.isAble = false
return false
}
// 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 +274,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)
}
@ -203,13 +283,35 @@ export default {
...res.data
}
// ()
if (!this.$route.query.disabled) {
if (this.$route.query.disabled === '0') {
this.hideUpload = this.dataForm.images.length >= 9
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
// 0
let remindInfo = ''
for (var i = 0; i < this.dataForm.totalConfigList.length; i++) {
for (var j = 0; j < this.dataForm.totalConfigList[i].configList.length; j++) {
if (this.dataForm.totalConfigList[i].configList[j].total <= 0 && this.dataForm.totalConfigList[i].showFlag === '1' && this.dataForm.totalConfigList[i].configList[j].mustFlag === '1') {
remindInfo += '第' + (i + 1) + '项、'
break
}
}
}
if (remindInfo.length > 0) {
remindInfo = remindInfo.substring(0, remindInfo.length - 1)
this.$confirm(remindInfo + '存在未完善信息,请完善后提交!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
}).catch(() => {})
return false
}
//
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false

Loading…
Cancel
Save