|
|
@@ -16,11 +16,16 @@
|
|
|
</div>
|
|
|
|
|
|
<el-form
|
|
|
+ ref="preliminaryForm"
|
|
|
:model="preliminaryOpinionForm"
|
|
|
+ :rules="preliminaryRules"
|
|
|
label-width="180px"
|
|
|
:class="{ 'disabled-section': isPreliminaryDisabled }"
|
|
|
>
|
|
|
- <el-form-item label="被监审单位基本情况及主要财务状况:">
|
|
|
+ <el-form-item
|
|
|
+ label="被监审单位基本情况及主要财务状况:"
|
|
|
+ prop="basicSituation"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="preliminaryOpinionForm.basicSituation"
|
|
|
type="textarea"
|
|
|
@@ -30,7 +35,10 @@
|
|
|
:disabled="isPreliminaryDisabled"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="监审项目现行执行的价格标准:">
|
|
|
+ <el-form-item
|
|
|
+ label="监审项目现行执行的价格标准:"
|
|
|
+ prop="currentPriceStandard"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="preliminaryOpinionForm.currentPriceStandard"
|
|
|
type="textarea"
|
|
|
@@ -42,6 +50,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
label="监审项目的成本构成、数据核增核减情况、依据及理由:"
|
|
|
+ prop="costComposition"
|
|
|
>
|
|
|
<el-input
|
|
|
v-model="preliminaryOpinionForm.costComposition"
|
|
|
@@ -52,7 +61,7 @@
|
|
|
:disabled="isPreliminaryDisabled"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="成本审核初步意见:">
|
|
|
+ <el-form-item label="成本审核初步意见:" prop="preliminaryOpinion">
|
|
|
<el-input
|
|
|
v-model="preliminaryOpinionForm.preliminaryOpinion"
|
|
|
type="textarea"
|
|
|
@@ -87,7 +96,7 @@
|
|
|
<i class="iconfont-5039297 icon-wenjian"></i>
|
|
|
<span
|
|
|
class="file-link"
|
|
|
- @click="handleFileView(feedbackForm.feedbackMaterial)"
|
|
|
+ @click="handleFilePreview(feedbackForm.feedbackMaterial)"
|
|
|
>
|
|
|
{{ getFileName(feedbackForm.feedbackMaterial) }}
|
|
|
</span>
|
|
|
@@ -114,8 +123,13 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
|
|
|
- <el-form :model="conclusionOpinionForm" label-width="180px">
|
|
|
- <el-form-item label="成本审核结论意见:">
|
|
|
+ <el-form
|
|
|
+ ref="conclusionForm"
|
|
|
+ :model="conclusionOpinionForm"
|
|
|
+ :rules="conclusionRules"
|
|
|
+ label-width="180px"
|
|
|
+ >
|
|
|
+ <el-form-item label="成本审核结论意见:" prop="conclusionOpinion">
|
|
|
<el-input
|
|
|
v-model="conclusionOpinionForm.conclusionOpinion"
|
|
|
type="textarea"
|
|
|
@@ -125,7 +139,7 @@
|
|
|
:disabled="!isConclusionEditable"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="其他需要说明的事项:">
|
|
|
+ <el-form-item label="其他需要说明的事项:" prop="otherExplanations">
|
|
|
<el-input
|
|
|
v-model="conclusionOpinionForm.otherExplanations"
|
|
|
type="textarea"
|
|
|
@@ -135,7 +149,7 @@
|
|
|
:disabled="!isConclusionEditable"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="备注:">
|
|
|
+ <el-form-item label="备注:" prop="remark">
|
|
|
<el-input
|
|
|
v-model="conclusionOpinionForm.remark"
|
|
|
type="textarea"
|
|
|
@@ -181,6 +195,41 @@
|
|
|
preliminaryOpinion: '',
|
|
|
},
|
|
|
|
|
|
+ preliminaryRules: {
|
|
|
+ basicSituation: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入被监审单位基本情况及主要财务状况',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ { max: 500, message: '长度不能超过 500 个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ currentPriceStandard: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入监审项目现行执行的价格标准',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ { max: 500, message: '长度不能超过 500 个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ costComposition: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入监审项目的成本构成、数据核增核减情况、依据及理由',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ { max: 500, message: '长度不能超过 500 个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ preliminaryOpinion: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入成本审核初步意见',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ { max: 500, message: '长度不能超过 500 个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+
|
|
|
feedbackForm: {
|
|
|
feedbackOpinion: '',
|
|
|
feedbackMaterial: '', // 反馈附件(单个URL字符串)
|
|
|
@@ -192,6 +241,29 @@
|
|
|
otherExplanations: '',
|
|
|
remark: '',
|
|
|
},
|
|
|
+
|
|
|
+ conclusionRules: {
|
|
|
+ conclusionOpinion: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入成本审核结论意见',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ { max: 500, message: '长度不能超过 500 个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ otherExplanations: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入其他需要说明的事项',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ { max: 500, message: '长度不能超过 500 个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ remark: [
|
|
|
+ { required: true, message: '请输入备注', trigger: 'blur' },
|
|
|
+ { max: 500, message: '长度不能超过 500 个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -301,41 +373,54 @@
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 判断是新增还是编辑(根据是否有 id)
|
|
|
- const formData = {
|
|
|
- basicSituation: this.preliminaryOpinionForm.basicSituation || '',
|
|
|
- currentPriceStandard:
|
|
|
- this.preliminaryOpinionForm.currentPriceStandard || '',
|
|
|
- costComposition: this.preliminaryOpinionForm.costComposition || '',
|
|
|
- preliminaryOpinion:
|
|
|
- this.preliminaryOpinionForm.preliminaryOpinion || '',
|
|
|
- taskId: this.id,
|
|
|
+ const form = this.$refs.preliminaryForm
|
|
|
+ if (!form || typeof form.validate !== 'function') {
|
|
|
+ this.$message.error('表单未初始化')
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
- // 如果有 id,则是编辑,需要添加 id 字段
|
|
|
- if (this.preliminaryOpinionForm.id) {
|
|
|
- formData.id = this.preliminaryOpinionForm.id
|
|
|
- }
|
|
|
+ form.validate((valid) => {
|
|
|
+ if (!valid) return
|
|
|
+
|
|
|
+ // 判断是新增还是编辑(根据是否有 id)
|
|
|
+ const formData = {
|
|
|
+ basicSituation: this.preliminaryOpinionForm.basicSituation || '',
|
|
|
+ currentPriceStandard:
|
|
|
+ this.preliminaryOpinionForm.currentPriceStandard || '',
|
|
|
+ costComposition: this.preliminaryOpinionForm.costComposition || '',
|
|
|
+ preliminaryOpinion:
|
|
|
+ this.preliminaryOpinionForm.preliminaryOpinion || '',
|
|
|
+ taskId: this.id,
|
|
|
+ }
|
|
|
|
|
|
- addPreliminaryOpinion(formData)
|
|
|
- .then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message({ type: 'success', message: '初步审核意见已保存' })
|
|
|
- // 保存成功后,如果有返回 id,更新表单中的 id
|
|
|
- if (res.value && res.value.id) {
|
|
|
- this.preliminaryOpinionForm.id = res.value.id
|
|
|
+ // 如果有 id,则是编辑,需要添加 id 字段
|
|
|
+ if (this.preliminaryOpinionForm.id) {
|
|
|
+ formData.id = this.preliminaryOpinionForm.id
|
|
|
+ }
|
|
|
+
|
|
|
+ addPreliminaryOpinion(formData)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '初步审核意见已保存',
|
|
|
+ })
|
|
|
+ // 保存成功后,如果有返回 id,更新表单中的 id
|
|
|
+ if (res.value && res.value.id) {
|
|
|
+ this.preliminaryOpinionForm.id = res.value.id
|
|
|
+ }
|
|
|
+ // 通知父组件刷新列表并关闭弹窗,要求分页回到第一页
|
|
|
+ // this.$emit('refresh', { resetToFirst: true })
|
|
|
+ // this.$emit('close')
|
|
|
+ } else {
|
|
|
+ this.$message({ type: 'error', message: res.message })
|
|
|
}
|
|
|
- // 通知父组件刷新列表并关闭弹窗,要求分页回到第一页
|
|
|
- // this.$emit('refresh', { resetToFirst: true })
|
|
|
- // this.$emit('close')
|
|
|
- } else {
|
|
|
- this.$message({ type: 'error', message: res.message })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- // this.$message({ type: 'error', message: '保存失败,请稍后重试' })
|
|
|
- console.error('保存初步审核意见失败:', error)
|
|
|
- })
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ // this.$message({ type: 'error', message: '保存失败,请稍后重试' })
|
|
|
+ console.error('保存初步审核意见失败:', error)
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
handleSaveConclusionOpinion() {
|
|
|
@@ -344,60 +429,75 @@
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 判断是新增还是编辑(根据是否有 id)
|
|
|
- // 传递所有字段(包括初步意见、结论意见和反馈意见)
|
|
|
- const formData = {
|
|
|
- // 成本监审意见数据(初步意见)
|
|
|
- basicSituation: this.preliminaryOpinionForm.basicSituation || '',
|
|
|
- currentPriceStandard:
|
|
|
- this.preliminaryOpinionForm.currentPriceStandard || '',
|
|
|
- costComposition: this.preliminaryOpinionForm.costComposition || '',
|
|
|
- preliminaryOpinion:
|
|
|
- this.preliminaryOpinionForm.preliminaryOpinion || '',
|
|
|
- // 成本审核结论意见数据
|
|
|
- conclusionOpinion: this.conclusionOpinionForm.conclusionOpinion || '',
|
|
|
- otherExplanations: this.conclusionOpinionForm.otherExplanations || '',
|
|
|
- remark: this.conclusionOpinionForm.remark || '',
|
|
|
- // 监审单位反馈意见数据
|
|
|
- feedbackOpinion: this.feedbackForm.feedbackOpinion || '',
|
|
|
- feedbackMaterials: this.feedbackForm.feedbackMaterial || '', // 反馈附件(单个URL字符串)
|
|
|
- taskId: this.id,
|
|
|
+ const form = this.$refs.conclusionForm
|
|
|
+ if (!form || typeof form.validate !== 'function') {
|
|
|
+ this.$message.error('表单未初始化')
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
- // 如果有初步意见的 id,则添加 id 字段(用于编辑)
|
|
|
- if (this.preliminaryOpinionForm.id) {
|
|
|
- formData.id = this.preliminaryOpinionForm.id
|
|
|
- }
|
|
|
- // 如果有结论意见的 id,也添加(可能是 conclusionId)
|
|
|
- if (
|
|
|
- this.conclusionOpinionForm.id &&
|
|
|
- this.conclusionOpinionForm.id !== this.preliminaryOpinionForm.id
|
|
|
- ) {
|
|
|
- formData.conclusionId = this.conclusionOpinionForm.id
|
|
|
- }
|
|
|
+ form.validate((valid) => {
|
|
|
+ if (!valid) return
|
|
|
|
|
|
- addPreliminaryOpinion(formData)
|
|
|
- .then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message({ type: 'success', message: '审核结论意见已保存' })
|
|
|
- // 保存成功后,如果有返回 id,更新表单中的 id
|
|
|
- if (res.value && res.value.id) {
|
|
|
- this.preliminaryOpinionForm.id = res.value.id
|
|
|
- }
|
|
|
- if (res.value && res.value.conclusionId) {
|
|
|
- this.conclusionOpinionForm.id = res.value.conclusionId
|
|
|
+ // 判断是新增还是编辑(根据是否有 id)
|
|
|
+ // 传递所有字段(包括初步意见、结论意见和反馈意见)
|
|
|
+ const formData = {
|
|
|
+ // 成本监审意见数据(初步意见)
|
|
|
+ basicSituation: this.preliminaryOpinionForm.basicSituation || '',
|
|
|
+ currentPriceStandard:
|
|
|
+ this.preliminaryOpinionForm.currentPriceStandard || '',
|
|
|
+ costComposition: this.preliminaryOpinionForm.costComposition || '',
|
|
|
+ preliminaryOpinion:
|
|
|
+ this.preliminaryOpinionForm.preliminaryOpinion || '',
|
|
|
+ // 成本审核结论意见数据
|
|
|
+ conclusionOpinion:
|
|
|
+ this.conclusionOpinionForm.conclusionOpinion || '',
|
|
|
+ otherExplanations:
|
|
|
+ this.conclusionOpinionForm.otherExplanations || '',
|
|
|
+ remark: this.conclusionOpinionForm.remark || '',
|
|
|
+ // 监审单位反馈意见数据
|
|
|
+ feedbackOpinion: this.feedbackForm.feedbackOpinion || '',
|
|
|
+ feedbackMaterials: this.feedbackForm.feedbackMaterial || '', // 反馈附件(单个URL字符串)
|
|
|
+ taskId: this.id,
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果有初步意见的 id,则添加 id 字段(用于编辑)
|
|
|
+ if (this.preliminaryOpinionForm.id) {
|
|
|
+ formData.id = this.preliminaryOpinionForm.id
|
|
|
+ }
|
|
|
+ // 如果有结论意见的 id,也添加(可能是 conclusionId)
|
|
|
+ if (
|
|
|
+ this.conclusionOpinionForm.id &&
|
|
|
+ this.conclusionOpinionForm.id !== this.preliminaryOpinionForm.id
|
|
|
+ ) {
|
|
|
+ formData.conclusionId = this.conclusionOpinionForm.id
|
|
|
+ }
|
|
|
+
|
|
|
+ addPreliminaryOpinion(formData)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '审核结论意见已保存',
|
|
|
+ })
|
|
|
+ // 保存成功后,如果有返回 id,更新表单中的 id
|
|
|
+ if (res.value && res.value.id) {
|
|
|
+ this.preliminaryOpinionForm.id = res.value.id
|
|
|
+ }
|
|
|
+ if (res.value && res.value.conclusionId) {
|
|
|
+ this.conclusionOpinionForm.id = res.value.conclusionId
|
|
|
+ }
|
|
|
+ // 通知父组件刷新列表并关闭弹窗,要求分页回到第一页
|
|
|
+ // this.$emit('refresh', { resetToFirst: true })
|
|
|
+ // this.$emit('close')
|
|
|
+ } else {
|
|
|
+ this.$message({ type: 'error', message: res.message })
|
|
|
}
|
|
|
- // 通知父组件刷新列表并关闭弹窗,要求分页回到第一页
|
|
|
- // this.$emit('refresh', { resetToFirst: true })
|
|
|
- // this.$emit('close')
|
|
|
- } else {
|
|
|
- this.$message({ type: 'error', message: res.message })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- // this.$message({ type: 'error', message: '保存失败,请稍后重试' })
|
|
|
- console.error('保存审核结论意见失败:', error)
|
|
|
- })
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ // this.$message({ type: 'error', message: '保存失败,请稍后重试' })
|
|
|
+ console.error('保存审核结论意见失败:', error)
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
// 从URL获取文件名
|
|
|
getFileNameFromUrl(url) {
|
|
|
@@ -424,8 +524,7 @@
|
|
|
}
|
|
|
return '未知文件'
|
|
|
},
|
|
|
- // 查看文件
|
|
|
- handleFileView(file) {
|
|
|
+ handleFilePreview(file) {
|
|
|
let fileUrl = ''
|
|
|
if (typeof file === 'string') {
|
|
|
fileUrl = file
|
|
|
@@ -436,22 +535,19 @@
|
|
|
} else if (file && file.savePath) {
|
|
|
fileUrl = file.savePath
|
|
|
}
|
|
|
-
|
|
|
- if (!fileUrl) {
|
|
|
- this.$message &&
|
|
|
- this.$message.warning &&
|
|
|
- this.$message.warning('文件地址无效')
|
|
|
+ const normalized = this.normalizeUrl(fileUrl)
|
|
|
+ if (!normalized) {
|
|
|
+ this.$message.error('暂无文件!')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- const normalized = this.normalizeUrl(fileUrl)
|
|
|
- const suggestName =
|
|
|
- (file && (file.name || file.fileName)) ||
|
|
|
- this.getFileName(file) ||
|
|
|
- '下载文件'
|
|
|
- this.downloadByFetch(normalized, suggestName).catch((e) => {
|
|
|
- console.error('文件下载失败: ', e)
|
|
|
- })
|
|
|
+ // 对文件URL进行Base64编码
|
|
|
+ const encodedUrl = encodeURIComponent(Base64.encode(normalized))
|
|
|
+
|
|
|
+ // 构建 kkFileView 预览URL
|
|
|
+ // onlinePreview - 在线预览
|
|
|
+ // onlinePreview?type=pdf - 强制使用PDF模式预览
|
|
|
+ window.open(`${host}:8012/onlinePreview?url=${encodedUrl}`)
|
|
|
},
|
|
|
normalizeUrl(u) {
|
|
|
if (!u) return ''
|