|
@@ -318,84 +318,9 @@
|
|
|
<el-input v-model="inputForm.evaluationPersonTwo" placeholder="请填写签字评估师2" ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <!--<el-col :span="12">
|
|
|
- <el-form-item label="项目状态" prop="status"
|
|
|
- :rules="[
|
|
|
- ]">
|
|
|
- <!– <el-input v-model="inputForm.status" placeholder="请填写项目状态" ></el-input>–>
|
|
|
- <el-select v-model="inputForm.status" placeholder="请选择" style="width:100%;">
|
|
|
- <el-option
|
|
|
- v-for="item in $dictUtils.getDictList('project_status')"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>-->
|
|
|
</el-row>
|
|
|
- <el-divider content-position="left"><i class="el-icon-document"></i> 附件信息</el-divider>
|
|
|
- <el-upload ref="upload" style="display: inline-block; margin-left: 5em; :show-header='status'" action=""
|
|
|
- :limit="999" :http-request="httpRequest"
|
|
|
- multiple
|
|
|
- :on-exceed="(files, fileList) =>{
|
|
|
- $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
|
- }"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :show-file-list="false"
|
|
|
- :on-change="changes"
|
|
|
- :on-progress="uploadVideoProcess"
|
|
|
- :file-list="filesArra2">
|
|
|
- <el-button type="info" size="mini" v-if="inputForm.permissionFlag&&showVi">点击上传</el-button>
|
|
|
- </el-upload>
|
|
|
- <div style="height: calc(100% - 80px);margin-top: 10px">
|
|
|
- <!-- 进度条 -->
|
|
|
- <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
|
|
|
- <vxe-table
|
|
|
- style="margin-left: 5em"
|
|
|
- border="inner"
|
|
|
- auto-resize
|
|
|
- resizable
|
|
|
- :loading="loading"
|
|
|
- size="small"
|
|
|
- ref="projectTable"
|
|
|
- show-header-overflow
|
|
|
- show-overflow
|
|
|
- highlight-hover-row
|
|
|
- :menu-config="{}"
|
|
|
- :print-config="{}"
|
|
|
- @sort-change="sortChangeHandle"
|
|
|
- :sort-config="{remote:true}"
|
|
|
- :data="dataListNew"
|
|
|
- :checkbox-config="{}">
|
|
|
- <vxe-column type="seq" width="40"></vxe-column>
|
|
|
- <vxe-column title="文件名称" field="name">
|
|
|
- <template slot-scope="scope">
|
|
|
-<!-- <div v-if="ifName(scope.row) === true">-->
|
|
|
-<!-- <el-image-->
|
|
|
-<!-- style="width: 100px; height: 100px"-->
|
|
|
-<!-- :src="src"-->
|
|
|
-<!-- :preview-src-list="srcList" lazy>-->
|
|
|
-<!-- </el-image>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <div v-else>-->
|
|
|
-<!-- <el-link type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>-->
|
|
|
-<!-- </div>-->
|
|
|
- <el-link type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
- <vxe-column title="创建人" field="createBy"></vxe-column>
|
|
|
- <vxe-column title="创建时间" field="createDate"></vxe-column>
|
|
|
-<!-- <vxe-column title="文件描述" field="description"></vxe-column>-->
|
|
|
- <vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" icon="el-icon-edit" size="small" @click="toHref(scope.row)" :disabled="false">下载</el-button>
|
|
|
- <el-button type="text" icon="el-icon-delete" size="small" v-if="inputForm.permissionFlag&&showVi" @click="deleteMsgById(scope.row, scope.$rowIndex)">删除</el-button>
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
- </vxe-table>
|
|
|
- </div>
|
|
|
-
|
|
|
+ <!-- 附件-->
|
|
|
+ <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
|
</el-form>
|
|
|
<el-image-viewer
|
|
|
v-if="showViewer"
|
|
@@ -413,14 +338,8 @@
|
|
|
<script>
|
|
|
import ProjectService from '@/api/sys/ProjectService'
|
|
|
import SelectUserTree from '@/views/modules/utils/treeUserSelect'
|
|
|
- import OSSSerive, {
|
|
|
- httpRequest,
|
|
|
- openWindowOnUrl,
|
|
|
- toHref,
|
|
|
- handleRemove,
|
|
|
- fileName
|
|
|
- } from '@/api/sys/OSSService'
|
|
|
- import moment from 'moment'
|
|
|
+ import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
|
+ import OSSSerive from '@/api/sys/OSSService'
|
|
|
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
|
|
|
export default {
|
|
|
data () {
|
|
@@ -490,7 +409,8 @@
|
|
|
},
|
|
|
components: {
|
|
|
ElImageViewer,
|
|
|
- SelectUserTree
|
|
|
+ SelectUserTree,
|
|
|
+ UpLoadComponent
|
|
|
},
|
|
|
projectService: null,
|
|
|
ossService: null,
|
|
@@ -499,50 +419,17 @@
|
|
|
this.projectService = new ProjectService()
|
|
|
},
|
|
|
mounted () {
|
|
|
- window.onPreview = this.onPreview
|
|
|
},
|
|
|
methods: {
|
|
|
- uploadVideoProcess (event, file, fileList) {
|
|
|
- this.progressFlag = true // 显示进度条
|
|
|
- this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
|
|
|
- if (this.loadProgress >= 100) {
|
|
|
- this.loadProgress = 100
|
|
|
- setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
|
|
|
- }
|
|
|
- },
|
|
|
- // async getsrc (row) {
|
|
|
- // if (row.id === null || row.id === undefined || row.id === '') {
|
|
|
- // await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
|
|
|
- // return data.data
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // return row.url
|
|
|
- // }
|
|
|
- // },
|
|
|
- // async ifName (row) {
|
|
|
- // let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
|
|
|
- // if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
|
|
|
- // return true
|
|
|
- // } else {
|
|
|
- // return false
|
|
|
- // }
|
|
|
- // },
|
|
|
- async toHref (row) {
|
|
|
- toHref(row)
|
|
|
- },
|
|
|
- onPreview (url) {
|
|
|
- this.url = url
|
|
|
- this.showViewer = true
|
|
|
- },
|
|
|
// 关闭查看器
|
|
|
closeViewer () {
|
|
|
this.url = ''
|
|
|
this.showViewer = false
|
|
|
},
|
|
|
- init (method, id) {
|
|
|
+ async init (method, id) {
|
|
|
this.dataList = []
|
|
|
this.dataListNew = []
|
|
|
- this.ossService.findFileList(id).then(({data}) => {
|
|
|
+ await this.ossService.findFileList(id).then(({data}) => {
|
|
|
data.forEach((item) => {
|
|
|
item.name = item.attachmentName
|
|
|
// item.createBy = item.createBy
|
|
@@ -610,7 +497,6 @@
|
|
|
this.visible = true
|
|
|
this.loading = false
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.upload.clearFiles()
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
this.loading = true
|
|
@@ -622,15 +508,19 @@
|
|
|
this.inputForm.reimbursementDateUi = data.reimbursementDate
|
|
|
this.inputForm.permissionFlag = data.permissionFlag
|
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
+ this.$refs.uploadComponent.newUpload(method, this.dataListNew, 'projectRecords', 1024)
|
|
|
this.loading = false
|
|
|
})
|
|
|
}
|
|
|
+ if (method !== 'edit' && method !== 'view') {
|
|
|
+ this.$refs.uploadComponent.newUpload(method, [], 'projectRecords', 1024)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 表单提交
|
|
|
doSubmit () {
|
|
|
- if (this.progressFlag === true) {
|
|
|
- this.$message.warning('文件正在上传中,请稍等')
|
|
|
+ if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
return
|
|
|
}
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
@@ -638,6 +528,7 @@
|
|
|
this.loading = true
|
|
|
this.inputForm.itemType = '1'
|
|
|
this.inputForm.workAttachments = []
|
|
|
+ this.dataListNew = this.$refs.uploadComponent.getDataList()
|
|
|
this.dataListNew.forEach((item) => {
|
|
|
if (item.id === null || item.id === undefined || item.id === '') {
|
|
|
item.url = item.raw.url
|
|
@@ -645,6 +536,7 @@
|
|
|
item.attachmentFlag = 'projectRecords'
|
|
|
item.fileSize = item.size
|
|
|
item.attachmentName = item.name
|
|
|
+ item.createBy = null
|
|
|
this.inputForm.workAttachments.push(item)
|
|
|
})
|
|
|
if (this.inputForm.evaluationReportDateUi === null || this.inputForm.evaluationReportDateUi === undefined || this.inputForm.evaluationReportDateUi === '') {
|
|
@@ -664,42 +556,12 @@
|
|
|
})
|
|
|
},
|
|
|
close () {
|
|
|
+ this.$refs.uploadComponent.clearUpload()
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.showVi = true
|
|
|
this.visible = false
|
|
|
this.$emit('refreshDataList')
|
|
|
},
|
|
|
- async httpRequest (file) {
|
|
|
- await httpRequest(file, fileName(file), 'projectRecords')
|
|
|
- },
|
|
|
- handleRemove () {
|
|
|
- this.fileList = handleRemove()
|
|
|
- },
|
|
|
- changes (file, fileList) {
|
|
|
- this.dataListNew = []
|
|
|
- this.dataList.forEach((item) => {
|
|
|
- this.dataListNew.push(item)
|
|
|
- })
|
|
|
- fileList.forEach((item) => {
|
|
|
- item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
- item.createBy = this.$store.state.user.name
|
|
|
- this.dataListNew.push(item)
|
|
|
- })
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 1024
|
|
|
- if (isLt2M === false) {
|
|
|
- this.$message.error('文件大小不能超过 ' + 1 + 'G !')
|
|
|
- this.fileList = []
|
|
|
- this.filesArra2 = []
|
|
|
- } else {
|
|
|
- // if (exnameFix(file, '1') === false) {
|
|
|
- // this.fileList = []
|
|
|
- // this.filesArra2 = []
|
|
|
- // }
|
|
|
- }
|
|
|
- },
|
|
|
- async showFile (row) {
|
|
|
- await openWindowOnUrl(row)
|
|
|
- },
|
|
|
// 排序
|
|
|
sortChangeHandle (column) {
|
|
|
this.orders = []
|
|
@@ -708,12 +570,6 @@
|
|
|
}
|
|
|
this.refreshList()
|
|
|
},
|
|
|
- deleteMsgById (row, index) {
|
|
|
- this.dataListNew.splice(index, 1)
|
|
|
- if (row.id !== null && row.id !== '' && row.id !== undefined) {
|
|
|
- this.ossService.deleteMsgById(row.id)
|
|
|
- }
|
|
|
- },
|
|
|
twoDecimalPlaces (num) {
|
|
|
let str = num.toString()
|
|
|
var len1 = str.substr(0, 1)
|