|
@@ -1,99 +1,99 @@
|
|
<template>
|
|
<template>
|
|
-<div>
|
|
|
|
- <el-dialog
|
|
|
|
- :title="title"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- append-to-body
|
|
|
|
- v-dialogDrag
|
|
|
|
- :visible.sync="visible">
|
|
|
|
- <el-form size="small" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view' || method === 'read'?'readonly':''" :disabled="method==='view' || method === 'read'" @keyup.enter.native="doSubmit()"
|
|
|
|
- label-width="120px" @submit.native.prevent>
|
|
|
|
- <el-row :gutter="15">
|
|
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :title="title"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ append-to-body
|
|
|
|
+ v-dialogDrag
|
|
|
|
+ :visible.sync="visible">
|
|
|
|
+ <el-form size="small" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view' || method === 'read'?'readonly':''" :disabled="method==='view' || method === 'read'" @keyup.enter.native="doSubmit()"
|
|
|
|
+ label-width="120px" @submit.native.prevent>
|
|
|
|
+ <el-row :gutter="15">
|
|
|
|
+ <el-col :span="24">
|
|
<el-form-item label="类型" prop="type"
|
|
<el-form-item label="类型" prop="type"
|
|
- :rules="[
|
|
|
|
|
|
+ :rules="[
|
|
{required: true, message:'类型不能为空', trigger:'blur'}
|
|
{required: true, message:'类型不能为空', trigger:'blur'}
|
|
]">
|
|
]">
|
|
- <el-select v-model="inputForm.type" placeholder="请选择" style="width: 100%;">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in $dictUtils.getDictList('oa_notify_type')"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value">
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <el-select v-model="inputForm.type" placeholder="请选择" style="width: 100%;">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in $dictUtils.getDictList('oa_notify_type')"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
<el-form-item label="标题" prop="title"
|
|
<el-form-item label="标题" prop="title"
|
|
- :rules="[
|
|
|
|
|
|
+ :rules="[
|
|
{required: true, message:'标题不能为空', trigger:'blur'}
|
|
{required: true, message:'标题不能为空', trigger:'blur'}
|
|
]">
|
|
]">
|
|
- <el-input v-model="inputForm.title" placeholder="请填写标题" ></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <el-input v-model="inputForm.title" placeholder="请填写标题" ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
<el-form-item label="内容" prop="content"
|
|
<el-form-item label="内容" prop="content"
|
|
- :rules="[
|
|
|
|
|
|
+ :rules="[
|
|
{required: true, message:'内容不能为空', trigger:'blur'}
|
|
{required: true, message:'内容不能为空', trigger:'blur'}
|
|
]">
|
|
]">
|
|
- <el-input type="textarea" :rows="8" v-model="inputForm.content" placeholder="请填写内容" ></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <el-input type="textarea" :rows="8" v-model="inputForm.content" placeholder="请填写内容" ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
<el-form-item label="附件" prop="files">
|
|
<el-form-item label="附件" prop="files">
|
|
- <el-upload ref="files"
|
|
|
|
- :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/notify/notify`"
|
|
|
|
- :headers="{token: $cookie.get('token')}"
|
|
|
|
- :on-preview="(file, fileList) => {$window.location.href = file.url}"
|
|
|
|
- :on-success="(response, file, fileList) => {
|
|
|
|
|
|
+ <el-upload ref="files"
|
|
|
|
+ :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/notify/notify`"
|
|
|
|
+ :headers="{token: $cookie.get('token')}"
|
|
|
|
+ :on-preview="(file, fileList) => {$window.location.href = file.url}"
|
|
|
|
+ :on-success="(response, file, fileList) => {
|
|
inputForm.files = fileList.map(item => item.url || item.response.url).join('|')
|
|
inputForm.files = fileList.map(item => item.url || item.response.url).join('|')
|
|
}"
|
|
}"
|
|
- :on-error="(response) => {
|
|
|
|
|
|
+ :on-error="(response) => {
|
|
$message.error(response.message)
|
|
$message.error(response.message)
|
|
}"
|
|
}"
|
|
- :on-remove="(file, fileList) => {
|
|
|
|
|
|
+ :on-remove="(file, fileList) => {
|
|
$http.delete(`/sys/file/webupload/deleteByUrl?url=${file.url}`).then(({data}) => {
|
|
$http.delete(`/sys/file/webupload/deleteByUrl?url=${file.url}`).then(({data}) => {
|
|
$message.success(data)
|
|
$message.success(data)
|
|
})
|
|
})
|
|
inputForm.files = fileList.map(item => item.url).join('|')
|
|
inputForm.files = fileList.map(item => item.url).join('|')
|
|
}"
|
|
}"
|
|
- :before-remove="(file, fileList) => {
|
|
|
|
|
|
+ :before-remove="(file, fileList) => {
|
|
return $confirm(`确定移除 ${file.name}?`)
|
|
return $confirm(`确定移除 ${file.name}?`)
|
|
}"
|
|
}"
|
|
- multiple
|
|
|
|
- :limit="5"
|
|
|
|
- :on-exceed="(files, fileList) =>{
|
|
|
|
|
|
+ multiple
|
|
|
|
+ :limit="5"
|
|
|
|
+ :on-exceed="(files, fileList) =>{
|
|
$message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
$message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
}"
|
|
}"
|
|
- :file-list="filesArra">
|
|
|
|
- <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
- <div slot="tip" class="el-upload__tip">添加相关附件</div>
|
|
|
|
- </el-upload>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24" v-if="method !== 'read'">
|
|
|
|
|
|
+ :file-list="filesArra">
|
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
+ <div slot="tip" class="el-upload__tip">添加相关附件</div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" v-if="method !== 'read'">
|
|
<el-form-item label="状态" prop="status"
|
|
<el-form-item label="状态" prop="status"
|
|
- :rules="[
|
|
|
|
|
|
+ :rules="[
|
|
{required: true, message:'状态不能为空', trigger:'blur'}
|
|
{required: true, message:'状态不能为空', trigger:'blur'}
|
|
]">
|
|
]">
|
|
- <el-radio-group v-model="inputForm.status">
|
|
|
|
- <el-radio v-for="item in $dictUtils.getDictList('oa_notify_status')" :label="item.value" :key="item.id">{{item.label}}</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24">
|
|
|
|
- <el-form-item label="接收人" prop="notifyRecordIds"
|
|
|
|
- :rules="[
|
|
|
|
|
|
+ <el-radio-group v-model="inputForm.status">
|
|
|
|
+ <el-radio v-for="item in $dictUtils.getDictList('oa_notify_status')" :label="item.value" :key="item.id">{{item.label}}</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="接收人" prop="notifyRecordIds"
|
|
|
|
+ :rules="[
|
|
{required: true, message:'接收人不能为空', trigger:'blur'}
|
|
{required: true, message:'接收人不能为空', trigger:'blur'}
|
|
]">
|
|
]">
|
|
- <user-select :value="inputForm.notifyRecordIds" @getValue='(value) => {inputForm.notifyRecordIds=value}'></user-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24" v-if="method ==='view' && inputForm.status === '1'">
|
|
|
|
- <el-form-item label="接收人">
|
|
|
|
|
|
+ <user-select :value="inputForm.notifyRecordIds" @getValue='(value) => {inputForm.notifyRecordIds=value}'></user-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" v-if="method ==='view' && inputForm.status === '1'">
|
|
|
|
+ <el-form-item label="接收人">
|
|
<el-table
|
|
<el-table
|
|
- size="small"
|
|
|
|
|
|
+ size="small"
|
|
:data="notifyRecordDTOList"
|
|
:data="notifyRecordDTOList"
|
|
style="width: 100%">
|
|
style="width: 100%">
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -120,31 +120,21 @@
|
|
width="180">
|
|
width="180">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
-
|
|
|
|
- <el-upload ref="upload" style="display: inline-block; margin-left: 5em;" action=""
|
|
|
|
- :limit="1" :http-request="httpRequest"
|
|
|
|
- :on-remove="handleRemove" :on-change="onChange" :before-upload="beforeAvatarUpload"
|
|
|
|
- :on-success="handleUploadSuccess" :file-list="fileS">
|
|
|
|
- <el-button type="info" size="mini">点击上传</el-button>
|
|
|
|
- </el-upload>
|
|
|
|
-
|
|
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- </el-form>
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
|
|
+ </el-form>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
<el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
|
|
<el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
|
|
<el-button size="small" type="primary" v-if="method != 'view' && method != 'read'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
|
|
<el-button size="small" type="primary" v-if="method != 'view' && method != 'read'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
|
|
</span>
|
|
</span>
|
|
- </el-dialog>
|
|
|
|
-</div>
|
|
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import UserSelect from '@/components/userSelect'
|
|
import UserSelect from '@/components/userSelect'
|
|
import NotifyService from '@/api/notify/NotifyService'
|
|
import NotifyService from '@/api/notify/NotifyService'
|
|
- import {client, headers} from '@/api/sys/OSSService'
|
|
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -227,62 +217,6 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- },
|
|
|
|
- onChange (file, files) {
|
|
|
|
- // console.log(file, 'file', files, 'Filest');
|
|
|
|
- this.fileList = files
|
|
|
|
- },
|
|
|
|
- handleUploadSuccess (response, file, files) {
|
|
|
|
- console.log(response, file, files, 'response, file, fileList')
|
|
|
|
- },
|
|
|
|
- handleRemove (e, files) {
|
|
|
|
- this.fileList = files
|
|
|
|
- },
|
|
|
|
- beforeAvatarUpload (file) {
|
|
|
|
- // 文件大小校验
|
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 10
|
|
|
|
- if (!isLt2M) {
|
|
|
|
- this.$message.error('文件大小不能超过 10M !')
|
|
|
|
- }
|
|
|
|
- return isLt2M
|
|
|
|
- },
|
|
|
|
- httpRequest (file) { // 阿里云OSS上传
|
|
|
|
- // 判断扩展名
|
|
|
|
- const tmpcnt = file.file.name.lastIndexOf('.') // 获取.的下标
|
|
|
|
- const uploadFileName = file.file.name.substring(0, tmpcnt) // 获取文件名
|
|
|
|
- console.log(uploadFileName, '文件名——uploadFileName')
|
|
|
|
- const exname = file.file.name.substring(tmpcnt + 1) // 获取后缀名
|
|
|
|
- console.log(exname, '后缀名')
|
|
|
|
- const names = ['jpg', 'jpeg', 'webp', 'png', 'bmp', 'exe', 'yml', 'txt']
|
|
|
|
- if (names.indexOf(exname) < 0) {
|
|
|
|
- this.$message.error('不支持的格式!')
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- const now = new Date()
|
|
|
|
- const year = now.getFullYear()
|
|
|
|
- const month = now.getMonth()+1
|
|
|
|
- const day = now.getDate()>10?now.getDate():'0'+now.getDate()
|
|
|
|
- const filePath = 'attachment-file/workAttachment/'+year+'/'+month+'/'+day+'/'+now.getTime()
|
|
|
|
- console.log(filePath, '文件存储路径')
|
|
|
|
- const fileName = filePath + uploadFileName
|
|
|
|
- console.log(fileName, '文件名')
|
|
|
|
- client.put(
|
|
|
|
- fileName,
|
|
|
|
- file.file,
|
|
|
|
- {
|
|
|
|
- headers
|
|
|
|
- }
|
|
|
|
- ).then(res => {
|
|
|
|
- console.log(res, 'res---header ')
|
|
|
|
- // this.handleUploadSuccess()
|
|
|
|
- // if (res.url) {
|
|
|
|
- // this.url.push(res.url)
|
|
|
|
- // } else {
|
|
|
|
- // this.$message.error('文件上传失败')
|
|
|
|
- // }
|
|
|
|
- }).catch(err => {
|
|
|
|
- console.log(err, 'err')
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|