|
@@ -279,12 +279,20 @@
|
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-input
|
|
|
|
|
- v-if="scope.row.originalText !== '需要提供材料'"
|
|
|
|
|
- v-model="scope.row.dataValue"
|
|
|
|
|
- size="small"
|
|
|
|
|
- placeholder="请输入数据值"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
|
|
+ <div v-if="scope.row.originalText !== '需要提供材料'">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="scope.row.originalText.includes('时间')"
|
|
|
|
|
+ v-model="scope.row.dataValue.split(' ')[0]"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ placeholder="请输入数据值"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-else
|
|
|
|
|
+ v-model="scope.row.dataValue"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ placeholder="请输入数据值"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </div>
|
|
|
<!-- 否则显示上传按钮 -->
|
|
<!-- 否则显示上传按钮 -->
|
|
|
<div v-else>
|
|
<div v-else>
|
|
|
<el-button
|
|
<el-button
|
|
@@ -439,13 +447,13 @@
|
|
|
selectDocumentWhSelection: [],
|
|
selectDocumentWhSelection: [],
|
|
|
costDocumentTemplateFiles: [],
|
|
costDocumentTemplateFiles: [],
|
|
|
documentRules: {
|
|
documentRules: {
|
|
|
- // documentNumber: [
|
|
|
|
|
- // {
|
|
|
|
|
- // required: true,
|
|
|
|
|
- // message: '请选择通知书文号',
|
|
|
|
|
- // trigger: 'change',
|
|
|
|
|
- // },
|
|
|
|
|
- // ],
|
|
|
|
|
|
|
+ documentNumber: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请选择通知书文号',
|
|
|
|
|
+ trigger: 'change',
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
enterpriseId: [
|
|
enterpriseId: [
|
|
|
{
|
|
{
|
|
|
required: true,
|
|
required: true,
|
|
@@ -528,10 +536,10 @@
|
|
|
let year = date.getFullYear()
|
|
let year = date.getFullYear()
|
|
|
let month = String(date.getMonth() + 1).padStart(2, '0')
|
|
let month = String(date.getMonth() + 1).padStart(2, '0')
|
|
|
let day = String(date.getDate()).padStart(2, '0')
|
|
let day = String(date.getDate()).padStart(2, '0')
|
|
|
- let hours = String(date.getHours()).padStart(2, '0')
|
|
|
|
|
- let minutes = String(date.getMinutes()).padStart(2, '0')
|
|
|
|
|
- let seconds = String(date.getSeconds()).padStart(2, '0')
|
|
|
|
|
- item.dataValue = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
|
|
|
|
|
|
+ let hour = String(date.getHours()).padStart(2, '0')
|
|
|
|
|
+ let minute = String(date.getMinutes()).padStart(2, '0')
|
|
|
|
|
+ let second = String(date.getSeconds()).padStart(2, '0')
|
|
|
|
|
+ item.dataValue = `${year}-${month}-${day} ${hour}:${minute}:${second}`
|
|
|
}
|
|
}
|
|
|
if (
|
|
if (
|
|
|
item.originalText.includes('需要提供材料') &&
|
|
item.originalText.includes('需要提供材料') &&
|
|
@@ -663,6 +671,7 @@
|
|
|
// this.document.enterpriseId = this.project.auditedUnitId
|
|
// this.document.enterpriseId = this.project.auditedUnitId
|
|
|
// }
|
|
// }
|
|
|
this.loadOpts()
|
|
this.loadOpts()
|
|
|
|
|
+ this.fileUrl = ''
|
|
|
if (this.activeDocumentTypeId) {
|
|
if (this.activeDocumentTypeId) {
|
|
|
this.document.documentId = this.activeDocumentTypeId
|
|
this.document.documentId = this.activeDocumentTypeId
|
|
|
this.handleTemplateChange()
|
|
this.handleTemplateChange()
|
|
@@ -824,6 +833,17 @@
|
|
|
this.$message.error('请填写必填项!')
|
|
this.$message.error('请填写必填项!')
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
+ // 判断this.costDocumentTemplateFiles里面的值是否为空,一次性提示所有为空的值需要填写
|
|
|
|
|
+ let emptyFields = []
|
|
|
|
|
+ this.costDocumentTemplateFiles.forEach((item) => {
|
|
|
|
|
+ if (!item.dataValue && item.originalText !== '需要提供材料') {
|
|
|
|
|
+ emptyFields.push(item.originalText)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ if (emptyFields.length > 0) {
|
|
|
|
|
+ this.$message.error(emptyFields.join('、') + '不能为空!')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
this.loading.saveDocument = true
|
|
this.loading.saveDocument = true
|
|
|
if (this.document.id) {
|
|
if (this.document.id) {
|
|
|
updateCostProjectDocument({
|
|
updateCostProjectDocument({
|
|
@@ -856,12 +876,28 @@
|
|
|
: this.document.enterpriseId,
|
|
: this.document.enterpriseId,
|
|
|
electronicDocumentUrl: this.fileUrl,
|
|
electronicDocumentUrl: this.fileUrl,
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
this.loading.saveDocument = false
|
|
this.loading.saveDocument = false
|
|
|
this.$message.success('保存成功!')
|
|
this.$message.success('保存成功!')
|
|
|
- this.documentDialogVisible = false
|
|
|
|
|
- this.activeView = ''
|
|
|
|
|
|
|
+ // this.documentDialogVisible = false
|
|
|
|
|
+ // this.activeView = ''
|
|
|
this.$emit('refresh', this.project.projectId)
|
|
this.$emit('refresh', this.project.projectId)
|
|
|
|
|
+ if (res.value) {
|
|
|
|
|
+ this.handleEditDocument({
|
|
|
|
|
+ id: res.value,
|
|
|
|
|
+ ...this.document,
|
|
|
|
|
+ projectId: this.project.projectId,
|
|
|
|
|
+ costProjectDocumentFiles:
|
|
|
|
|
+ this.costDocumentTemplateFiles || [],
|
|
|
|
|
+ enterpriseId: this.isMultipleMode
|
|
|
|
|
+ ? this.document.enterpriseId.join(',')
|
|
|
|
|
+ : this.document.enterpriseId,
|
|
|
|
|
+ electronicDocumentUrl: this.fileUrl,
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.documentDialogVisible = false
|
|
|
|
|
+ this.activeView = ''
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
this.loading.saveDocument = false
|
|
this.loading.saveDocument = false
|
|
@@ -1003,7 +1039,7 @@
|
|
|
// 构建 kkFileView 预览URL
|
|
// 构建 kkFileView 预览URL
|
|
|
// onlinePreview - 在线预览
|
|
// onlinePreview - 在线预览
|
|
|
// onlinePreview?type=pdf - 强制使用PDF模式预览
|
|
// onlinePreview?type=pdf - 强制使用PDF模式预览
|
|
|
- window.open(`${host}:8012/onlinePreview?url=${encodedUrl}`)
|
|
|
|
|
|
|
+ window.open(`${host}:8012/onlinePreview?url=${encodedUrl}&type=pdf`)
|
|
|
},
|
|
},
|
|
|
// 编辑文档
|
|
// 编辑文档
|
|
|
handleEditDocument(row) {
|
|
handleEditDocument(row) {
|
|
@@ -1022,7 +1058,17 @@
|
|
|
// 确保isPushed有值,如果row中没有,设置默认值'1'
|
|
// 确保isPushed有值,如果row中没有,设置默认值'1'
|
|
|
isPushed: row.isPushed !== undefined ? row.isPushed : '1',
|
|
isPushed: row.isPushed !== undefined ? row.isPushed : '1',
|
|
|
}
|
|
}
|
|
|
- this.fileUrl = this.document.electronicDocumentUrl
|
|
|
|
|
|
|
+ // this.fileUrl = this.document.electronicDocumentUrl
|
|
|
|
|
+ // 从API中获取文件URL
|
|
|
|
|
+ downDocument({
|
|
|
|
|
+ id: row.id,
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ if (res.state) {
|
|
|
|
|
+ this.fileUrl = res.value || ''
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('获取文件URL失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
this.getDocumentData()
|
|
this.getDocumentData()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -1164,7 +1210,6 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
handleUploadClick(row) {
|
|
handleUploadClick(row) {
|
|
|
- console.log('handleUploadClick', row)
|
|
|
|
|
let loading = null
|
|
let loading = null
|
|
|
// 第一步:创建文件选择器
|
|
// 第一步:创建文件选择器
|
|
|
const input = document.createElement('input')
|
|
const input = document.createElement('input')
|