|
@@ -106,10 +106,86 @@
|
|
|
</el-row>
|
|
|
|
|
|
</el-form>
|
|
|
- <!-- 附件-->
|
|
|
- <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
|
+ <el-divider content-position="left"><i class="el-icon-document"></i>
|
|
|
+ <span>附件信息</span>
|
|
|
+ </el-divider>
|
|
|
+ <el-row :gutter="15" >
|
|
|
+ <el-col :span="24">
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ show-overflow
|
|
|
+ ref="clientTable"
|
|
|
+ class="vxe-table-element"
|
|
|
+ style="margin-left: 5em"
|
|
|
+ :row-config="{keyField: 'id'}"
|
|
|
+ :column-config="{resizable: true}"
|
|
|
+ :tree-config="{transform: true, expandAll: true}"
|
|
|
+ :key="tableKey"
|
|
|
+ :data="tableData">
|
|
|
+ <vxe-column field="name" title="文件要求" width="260px" tree-node>
|
|
|
+ <template #default="scope">
|
|
|
+ <span style="font-weight: bold"
|
|
|
+ v-if="scope.row.parentId === '0'"
|
|
|
+ >{{ scope.row.name }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-if="scope.row.parentId !== '0' && scope.row.mustFlag === 1"
|
|
|
+ ><span style="color: red;font-weight: bold">* </span>{{ scope.row.name }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-if="scope.row.parentId !== '0' && scope.row.mustFlag === 0"
|
|
|
+ >{{ scope.row.name }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="attachmentName" title="文件描述/文件名称" show-overflow="false">
|
|
|
+ <template #default="scope">
|
|
|
+ <span
|
|
|
+ v-if="scope.row.levelFlag === 2"
|
|
|
+ >
|
|
|
+ <span style="font-weight: bold">文件格式及大小:{{ scope.row.size }}</span>
|
|
|
+ <br>
|
|
|
+ <span>{{ scope.row.type }}</span>
|
|
|
+ </span>
|
|
|
+ <el-link v-if="scope.row.levelFlag === 3" type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.attachmentName}}</el-link>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="workAttachmentType" width="100px" title="文件类型"></vxe-column>
|
|
|
+ <vxe-column field="createDate" title="上传时间" width="100px"></vxe-column>
|
|
|
+ <vxe-column field="fileSize" width="100px" title="文件大小(M)">
|
|
|
+ <template #default="scope">
|
|
|
+ {{getSize(scope.row.fileSize)}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
|
|
|
+ <vxe-column
|
|
|
+ title="操作"
|
|
|
+ width="100px"
|
|
|
+ fixed="right"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.levelFlag === 2"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ :disabled="status === 'taskFormDetail'|| method ==='view'"
|
|
|
+ @click="openFileForm(scope.row.id,this.inputForm.id)"
|
|
|
+ >编辑</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.levelFlag === 3"
|
|
|
+ type="info"
|
|
|
+ size="small"
|
|
|
+ @click="toHref(scope.row)" >下载</el-button>
|
|
|
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+<!-- <UpLoadComponent ref="uploadComponent"></UpLoadComponent>-->
|
|
|
+ <FileForm ref="fileForm" @getFiles="getFiles"></FileForm>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -117,6 +193,7 @@
|
|
|
import ProjectInfoService from "@/api/jy/ProjectInfoService";
|
|
|
import UserSelectSignatory from '../workClientInfo/clientUserSelect'
|
|
|
import UpLoadComponent from '@/views/common/JyEiaUpLoadComponent'
|
|
|
+ import FileForm from './fileForm'
|
|
|
export default {
|
|
|
props: {
|
|
|
businessId: {
|
|
@@ -157,7 +234,9 @@
|
|
|
remarks:''
|
|
|
},
|
|
|
keyWatch: '',
|
|
|
- tabName:''
|
|
|
+ tabName:'',
|
|
|
+ tableData: [],
|
|
|
+ tableKey :'1'
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -168,7 +247,7 @@
|
|
|
computed: {
|
|
|
bus: {
|
|
|
get () {
|
|
|
- this.$refs.uploadComponent.setDividerName('附件')
|
|
|
+ // this.$refs.uploadComponent.setDividerName('附件')
|
|
|
return this.businessId
|
|
|
|
|
|
},
|
|
@@ -196,13 +275,14 @@
|
|
|
'loading': {
|
|
|
handler (newVal) {
|
|
|
this.$emit('changeLoading', newVal)
|
|
|
- this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
+ // this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
components: {
|
|
|
UserSelectSignatory,
|
|
|
UpLoadComponent,
|
|
|
+ FileForm,
|
|
|
},
|
|
|
methods: {
|
|
|
getKeyWatch (keyWatch) {
|
|
@@ -244,10 +324,14 @@
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = true
|
|
|
- this.$refs.uploadComponent.clearUpload()
|
|
|
+ // this.$refs.uploadComponent.clearUpload()
|
|
|
// this.$refs.archiveFile.clearUpload()
|
|
|
console.log('id',this.inputForm.id)
|
|
|
this.projectInfoService.findByIdEia(this.inputForm.id).then((data) => {
|
|
|
+ this.projectInfoService.getAttachmentList(data.projectId,this.inputForm.id).then((data) => {
|
|
|
+ this.tableData = data
|
|
|
+ console.log("getAttachmentList",this.tableData)
|
|
|
+ })
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
this.inputForm.contractName=data.jyProjectList.contractName
|
|
|
this.inputForm.contractAmount=data.jyProjectList.contractAmount
|
|
@@ -262,19 +346,20 @@
|
|
|
this.inputForm.projectLeader=data.jyProjectList.leader
|
|
|
this.inputForm.projectId=data.projectId
|
|
|
this.inputForm.remarks=data.remarks
|
|
|
- console.log('data', data)
|
|
|
+ console.log('data', this.inputForm)
|
|
|
if (this.status === 'taskFormDetail') {
|
|
|
method = 'view'
|
|
|
}
|
|
|
console.log('method2',method)
|
|
|
- this.$refs.uploadComponent.newUpload(method, this.inputForm.fileList, 'jyProjectEia', null, '附件', null, null, null)
|
|
|
+
|
|
|
+ // this.$refs.uploadComponent.newUpload(method, this.inputForm.fileList, 'jyProjectEia', null, '附件', null, null, null)
|
|
|
// this.$refs.archiveFile.newUpload('view', [], 'cwWorkContract', null, null, null, null, false)
|
|
|
this.loading = false
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
close () {
|
|
|
- this.$refs.uploadComponent.clearUpload()
|
|
|
+ // this.$refs.uploadComponent.clearUpload()
|
|
|
this.inputForm = {
|
|
|
id: '',
|
|
|
contractName:'',
|
|
@@ -344,116 +429,46 @@
|
|
|
// 表单提交
|
|
|
async doSubmit (status, callback) {
|
|
|
this.loading = true
|
|
|
- if (await this.$refs.uploadComponent.checkProgress()) {
|
|
|
- this.loading = false
|
|
|
- throw new Error()
|
|
|
- }
|
|
|
if (status === 'save') {
|
|
|
// 暂存
|
|
|
- this.loading = true
|
|
|
this.inputForm.status = '1'
|
|
|
- if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.projectInfoService.saveFormEia(this.inputForm).then((data) => {
|
|
|
+ this.inputForm.assignee = this.inputForm.auditPeople
|
|
|
+ this.inputForm.id = data.businessId
|
|
|
+ callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.loading = false
|
|
|
- throw new Error()
|
|
|
- }else {
|
|
|
- this.$refs.uploadComponent.getDataList().then((list)=>{
|
|
|
- if (this.commonJS.isNotEmpty(list)){
|
|
|
- list.forEach((item, index) => {
|
|
|
- if (this.commonJS.isEmpty(item.jyFileType)) {
|
|
|
- this.$message.error('第' + (index + 1) + '条附件信息没有填写文件类型')
|
|
|
- this.loading = false
|
|
|
- throw new Error('第' + (index + 1) + '条附件信息没有填写文件类型')
|
|
|
- }
|
|
|
- })
|
|
|
- }else {
|
|
|
- this.$message.error('请上传文件')
|
|
|
- this.loading = false
|
|
|
- throw new Error('请上传文件')
|
|
|
- }
|
|
|
- this.inputForm.fileList = list
|
|
|
- this.projectInfoService.saveFormEia(this.inputForm).then((data) => {
|
|
|
- this.inputForm.assignee = this.inputForm.auditPeople
|
|
|
- this.inputForm.id = data.businessId
|
|
|
- callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.loading = false
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
return
|
|
|
} else if (status === 'start') {
|
|
|
// 送审 待审核
|
|
|
this.inputForm.status = '2'
|
|
|
} else if (status === 'agree') {
|
|
|
// 审核同意
|
|
|
- if (this.$store.state.user.office.name ==='办公室'){
|
|
|
- this.inputForm.status = '5'
|
|
|
- }else {
|
|
|
- this.inputForm.status = '2'
|
|
|
- }
|
|
|
+ this.inputForm.status = '5'
|
|
|
}
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
|
- if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
- this.loading = false
|
|
|
- throw new Error()
|
|
|
- }else {
|
|
|
- var count=0
|
|
|
- var count1=0
|
|
|
- var count2=0
|
|
|
- this.$refs.uploadComponent.getDataList().then((list)=>{
|
|
|
- if (this.commonJS.isNotEmpty(list)){
|
|
|
- list.forEach((item, index) => {
|
|
|
- if (this.commonJS.isEmpty(item.jyFileType)) {
|
|
|
- this.$message.error('第' + (index + 1) + '条附件信息没有填写文件类型')
|
|
|
- this.loading = false
|
|
|
- throw new Error('第' + (index + 1) + '条附件信息没有填写文件类型')
|
|
|
- } else if (this.$store.state.user.office.name === '办公室'){
|
|
|
- if (item.jyFileType === '3'){
|
|
|
- count2++
|
|
|
- }
|
|
|
- /*if (count2 === 0){
|
|
|
- this.$message.error('请上传文件资质')
|
|
|
- this.loading = false
|
|
|
- throw new Error('请上传文件资质')
|
|
|
- }*/
|
|
|
- }
|
|
|
- // if (list.length < 2){
|
|
|
- // this.$message.error('承诺书或信息表未上传')
|
|
|
- // this.loading = false
|
|
|
- // throw new Error('承诺书或信息表未上传')
|
|
|
- // }
|
|
|
-
|
|
|
- if (item.jyFileType === '1'){
|
|
|
- count++
|
|
|
- }
|
|
|
- if (item.jyFileType === '2'){
|
|
|
- count1++
|
|
|
- }
|
|
|
- /*if (count === 0 || count1 === 0){
|
|
|
- this.$message.error('承诺书或信息表未上传')
|
|
|
- this.loading = false
|
|
|
- throw new Error('承诺书或信息表未上传')
|
|
|
- }*/
|
|
|
- })
|
|
|
- }else {
|
|
|
- this.$message.error('请上传文件')
|
|
|
- this.loading = false
|
|
|
- throw new Error('请上传文件')
|
|
|
- }
|
|
|
-
|
|
|
- this.inputForm.fileList = list
|
|
|
- this.projectInfoService.saveFormEia(this.inputForm).then((data) => {
|
|
|
- this.inputForm.id = data.businessId
|
|
|
- callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.loading = false
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- })
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ console.log('item',item)
|
|
|
+ if (item.levelFlag === 2 && item.mustFlag === 1){
|
|
|
+ console.log('len',item.children.length)
|
|
|
+ if (item.children.length === 0){
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('文件未上传')
|
|
|
+ throw new Error('文件未上传')
|
|
|
+ }
|
|
|
}
|
|
|
+ })
|
|
|
+ this.projectInfoService.saveFormEia(this.inputForm).then((data) => {
|
|
|
+ this.inputForm.id = data.businessId
|
|
|
+ callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
} else {
|
|
|
this.loading = false
|
|
|
}
|
|
@@ -480,7 +495,7 @@
|
|
|
// 驳回
|
|
|
this.inputForm.status = '4'
|
|
|
this.loading = true
|
|
|
- this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
|
|
|
+ // this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
|
|
|
this.projectInfoService.saveFormEia(this.inputForm).then((data) => {
|
|
|
this.loading = false
|
|
|
}).catch(() => {
|
|
@@ -561,8 +576,43 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ },
|
|
|
+ //测试按钮
|
|
|
+ openFileForm(id,typeId){
|
|
|
+ this.$refs.fileForm.init("add", id,typeId)
|
|
|
+ },
|
|
|
+ showFile (row) {
|
|
|
+ console.log("showFile",row)
|
|
|
+ row.name = row.attachmentName
|
|
|
+ openWindowOnUrl(row)
|
|
|
+ },
|
|
|
+ toHref (row) {
|
|
|
+ console.log("toHref",row)
|
|
|
+ toHref(row)
|
|
|
+ },
|
|
|
+ getFiles(){
|
|
|
+ this.projectInfoService.getAttachmentList(this.inputForm.projectId,this.inputForm.id).then((data) => {
|
|
|
+ this.tableData = data
|
|
|
+ console.log('data',data)
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ getSize (value) {
|
|
|
+ if (this.commonJS.isEmpty(value)) {
|
|
|
+ return ''
|
|
|
+ } else {
|
|
|
+ let val = parseInt(value)
|
|
|
+ let k = 1024
|
|
|
+ let sizes = ['B', 'KB', 'MB', 'GB', 'PB', 'TB', 'EB', 'ZB', 'YB']
|
|
|
+ let i = Math.floor(Math.log(val) / Math.log(k))
|
|
|
+ let result = val / Math.pow(k, i);
|
|
|
+ let kb = parseFloat(result.toPrecision(3));
|
|
|
+ return kb + '' + sizes[i]
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|