|
@@ -258,7 +258,7 @@
|
|
|
<!-- 立项依据 -->
|
|
<!-- 立项依据 -->
|
|
|
<el-form-item label="立项依据:">
|
|
<el-form-item label="立项依据:">
|
|
|
<UploadComponent
|
|
<UploadComponent
|
|
|
- :upload-mode="'single'"
|
|
|
|
|
|
|
+ :upload-mode="'multiple'"
|
|
|
:max-size="50 * 1024 * 1024"
|
|
:max-size="50 * 1024 * 1024"
|
|
|
:allowed-types="['xlsx', 'xls', 'doc', 'docx', 'pdf']"
|
|
:allowed-types="['xlsx', 'xls', 'doc', 'docx', 'pdf']"
|
|
|
:files-list="accordingFileList"
|
|
:files-list="accordingFileList"
|
|
@@ -271,7 +271,7 @@
|
|
|
<!-- 其他材料 -->
|
|
<!-- 其他材料 -->
|
|
|
<el-form-item label="其他材料:">
|
|
<el-form-item label="其他材料:">
|
|
|
<UploadComponent
|
|
<UploadComponent
|
|
|
- :upload-mode="'single'"
|
|
|
|
|
|
|
+ :upload-mode="'multiple'"
|
|
|
:max-size="50 * 1024 * 1024"
|
|
:max-size="50 * 1024 * 1024"
|
|
|
:allowed-types="['xlsx', 'xls', 'doc', 'docx', 'pdf']"
|
|
:allowed-types="['xlsx', 'xls', 'doc', 'docx', 'pdf']"
|
|
|
:files-list="otherFileList"
|
|
:files-list="otherFileList"
|
|
@@ -511,15 +511,24 @@
|
|
|
: []
|
|
: []
|
|
|
if (this.formData.auditPeriod) {
|
|
if (this.formData.auditPeriod) {
|
|
|
this.formData.auditPeriodArray = this.formData.auditPeriod
|
|
this.formData.auditPeriodArray = this.formData.auditPeriod
|
|
|
- .split(',')
|
|
|
|
|
|
|
+ .split(',')
|
|
|
.map((year) => ({ value: year }))
|
|
.map((year) => ({ value: year }))
|
|
|
}
|
|
}
|
|
|
this.formData.auditedUnitId = this.initialData.auditedUnitId
|
|
this.formData.auditedUnitId = this.initialData.auditedUnitId
|
|
|
? this.initialData.auditedUnitId.split(',')
|
|
? this.initialData.auditedUnitId.split(',')
|
|
|
: []
|
|
: []
|
|
|
|
|
+ if (this.initialData.accordingFileUrl) {
|
|
|
|
|
+ this.accordingFileList =
|
|
|
|
|
+ this.initialData.accordingFileUrl.split(',')
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.initialData.otherFileUrl) {
|
|
|
|
|
+ this.otherFileList = this.initialData.otherFileUrl.split(',')
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
// 当弹窗关闭时重置表单
|
|
// 当弹窗关闭时重置表单
|
|
|
if (!val) {
|
|
if (!val) {
|
|
|
|
|
+ this.accordingFileList = []
|
|
|
|
|
+ this.otherFileList = []
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
if (this.$refs.initiationForm) {
|
|
if (this.$refs.initiationForm) {
|
|
|
this.$refs.initiationForm.resetFields()
|
|
this.$refs.initiationForm.resetFields()
|
|
@@ -527,23 +536,50 @@
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
} else if (this.type === 3) {
|
|
} else if (this.type === 3) {
|
|
|
- this.formData.projectName = this.initialData.projectName
|
|
|
|
|
- this.formData.auditType = this.initialData.auditType
|
|
|
|
|
- this.formData.catalogId = this.initialData.catalogId
|
|
|
|
|
- this.formData.areaCode = this.initialData.areaCode
|
|
|
|
|
- this.formData.auditedUnitName = this.initialData.auditedUnitName
|
|
|
|
|
- this.formData.auditedUnitId = this.initialData.auditedUnitId
|
|
|
|
|
- ? this.initialData.auditedUnitId.split(',')
|
|
|
|
|
- : []
|
|
|
|
|
- this.formData.orgId = this.initialData.orgId
|
|
|
|
|
- this.formData.planYear = this.initialData.planYear
|
|
|
|
|
- if (this.formData.auditPeriod) {
|
|
|
|
|
- this.formData.auditPeriodArray = this.initialData.auditPeriod
|
|
|
|
|
- .split(',')
|
|
|
|
|
- .map((year) => ({ value: year }))
|
|
|
|
|
|
|
+ // 当弹窗显示时设置数据
|
|
|
|
|
+ if (val && this.initialData) {
|
|
|
|
|
+ this.formData.projectName = this.initialData.projectName
|
|
|
|
|
+ this.formData.auditType = this.initialData.auditType
|
|
|
|
|
+ this.formData.catalogId = this.initialData.catalogId
|
|
|
|
|
+ this.formData.areaCode = this.initialData.areaCode
|
|
|
|
|
+ this.formData.auditedUnitName = this.initialData.auditedUnitName
|
|
|
|
|
+ this.formData.auditedUnitId = this.initialData.auditedUnitId
|
|
|
|
|
+ ? this.initialData.auditedUnitId.split(',')
|
|
|
|
|
+ : []
|
|
|
|
|
+ this.formData.orgId = this.initialData.orgId
|
|
|
|
|
+ this.formData.planYear = this.initialData.planYear
|
|
|
|
|
+ if (this.formData.auditPeriod) {
|
|
|
|
|
+ this.formData.auditPeriodArray = this.initialData.auditPeriod
|
|
|
|
|
+ .split(',')
|
|
|
|
|
+ .map((year) => ({ value: year }))
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 当弹窗关闭时重置表单
|
|
|
|
|
+ if (!val) {
|
|
|
|
|
+ this.accordingFileList = []
|
|
|
|
|
+ this.otherFileList = []
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ if (this.$refs.initiationForm) {
|
|
|
|
|
+ this.$refs.initiationForm.resetFields()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- this.formData.areaCode = ''
|
|
|
|
|
|
|
+ // 当弹窗显示时初始化数据
|
|
|
|
|
+ if (val) {
|
|
|
|
|
+ this.formData.areaCode = ''
|
|
|
|
|
+ // 其他初始化逻辑
|
|
|
|
|
+ }
|
|
|
|
|
+ // 当弹窗关闭时重置表单
|
|
|
|
|
+ if (!val) {
|
|
|
|
|
+ this.accordingFileList = []
|
|
|
|
|
+ this.otherFileList = []
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ if (this.$refs.initiationForm) {
|
|
|
|
|
+ this.$refs.initiationForm.resetFields()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
'formData.districtId'(districtId) {
|
|
'formData.districtId'(districtId) {
|
|
@@ -573,6 +609,8 @@
|
|
|
getAllUnitList() {
|
|
getAllUnitList() {
|
|
|
getAllUnitList().then((res) => {
|
|
getAllUnitList().then((res) => {
|
|
|
this.unitList = res.value || []
|
|
this.unitList = res.value || []
|
|
|
|
|
+ // 过滤掉状态为停用的数据
|
|
|
|
|
+ this.unitList = this.unitList.filter((item) => item.status == 1)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
// 获取默认维度
|
|
// 获取默认维度
|
|
@@ -606,25 +644,53 @@
|
|
|
// 立项依据文件处理
|
|
// 立项依据文件处理
|
|
|
saveAccordingFiles(data) {
|
|
saveAccordingFiles(data) {
|
|
|
this.accordingFileList = data
|
|
this.accordingFileList = data
|
|
|
- this.formData.accordingFileUrl = data[0]?.savePath || ''
|
|
|
|
|
|
|
+ // 将所有文件的savePath以逗号分隔的形式保存
|
|
|
|
|
+ this.formData.accordingFileUrl = data
|
|
|
|
|
+ .map((file) => file.savePath)
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .join(',')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // 移除立项依据文件
|
|
|
|
|
- removeAccordingFile() {
|
|
|
|
|
- this.accordingFileList = []
|
|
|
|
|
- this.formData.accordingFileUrl = ''
|
|
|
|
|
|
|
+ // 移除立项依据文件(支持单个文件删除)
|
|
|
|
|
+ removeAccordingFile(index) {
|
|
|
|
|
+ // 如果传入索引,则删除单个文件
|
|
|
|
|
+ if (typeof index === 'number') {
|
|
|
|
|
+ this.accordingFileList.splice(index, 1)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 否则清空所有文件
|
|
|
|
|
+ this.accordingFileList = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 更新文件路径字符串
|
|
|
|
|
+ this.formData.accordingFileUrl = this.accordingFileList
|
|
|
|
|
+ .map((file) => file.savePath)
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .join(',')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 其他材料文件处理
|
|
// 其他材料文件处理
|
|
|
saveOtherFiles(data) {
|
|
saveOtherFiles(data) {
|
|
|
this.otherFileList = data
|
|
this.otherFileList = data
|
|
|
- this.formData.otherFileUrl = data[0]?.savePath || ''
|
|
|
|
|
|
|
+ // 将所有文件的savePath以逗号分隔的形式保存
|
|
|
|
|
+ this.formData.otherFileUrl = data
|
|
|
|
|
+ .map((file) => file.savePath)
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .join(',')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // 移除其他材料文件
|
|
|
|
|
- removeOtherFile() {
|
|
|
|
|
- this.otherFileList = []
|
|
|
|
|
- this.formData.otherFileUrl = ''
|
|
|
|
|
|
|
+ // 移除其他材料文件(支持单个文件删除)
|
|
|
|
|
+ removeOtherFile(index) {
|
|
|
|
|
+ // 如果传入索引,则删除单个文件
|
|
|
|
|
+ if (typeof index === 'number') {
|
|
|
|
|
+ this.otherFileList.splice(index, 1)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 否则清空所有文件
|
|
|
|
|
+ this.otherFileList = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 更新文件路径字符串
|
|
|
|
|
+ this.formData.otherFileUrl = this.otherFileList
|
|
|
|
|
+ .map((file) => file.savePath)
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .join(',')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 处理地区选择变化
|
|
// 处理地区选择变化
|