|
|
@@ -8,6 +8,8 @@
|
|
|
v-for="type in documentData.documentTypes"
|
|
|
:key="type.id"
|
|
|
class="type-item"
|
|
|
+ :class="{ active: activeDocumentTypeId === type.id }"
|
|
|
+ @click="handleDocumentTypeClick(type)"
|
|
|
>
|
|
|
{{ type.documentName }}
|
|
|
</div>
|
|
|
@@ -138,10 +140,11 @@
|
|
|
<el-form
|
|
|
v-loading="loading.saveDocument"
|
|
|
:model="document"
|
|
|
- label-width="160px"
|
|
|
+ label-width="170px"
|
|
|
size="small"
|
|
|
+ :rules="documentRules"
|
|
|
>
|
|
|
- <el-form-item label="选择模板:">
|
|
|
+ <el-form-item label="选择模板:" prop="documentId">
|
|
|
<el-select
|
|
|
v-model="document.documentId"
|
|
|
placeholder="请选择模板"
|
|
|
@@ -156,7 +159,7 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="通知书文号:" prop="documentWhId">
|
|
|
+ <el-form-item label="通知书文号:" prop="documentNumber">
|
|
|
<el-input
|
|
|
v-model="document.documentNumber"
|
|
|
placeholder="请选择通知书文号"
|
|
|
@@ -172,7 +175,7 @@
|
|
|
选择文号
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="被监审单位:">
|
|
|
+ <el-form-item label="被监审单位:" prop="enterpriseId">
|
|
|
<el-select
|
|
|
v-model="document.enterpriseId"
|
|
|
placeholder="请选择被监审单位"
|
|
|
@@ -188,9 +191,9 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="是否推送被监审单位:">
|
|
|
+ <el-form-item label="是否推送被监审单位:" prop="isPushed">
|
|
|
<!-- 是否推送被监审单位 -->
|
|
|
- <el-radio-group v-model="document.isPush">
|
|
|
+ <el-radio-group v-model="document.isPushed">
|
|
|
<el-radio label="1">是</el-radio>
|
|
|
<el-radio label="0">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
@@ -227,24 +230,28 @@
|
|
|
label="数据项"
|
|
|
width="120"
|
|
|
align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="label"
|
|
|
+ prop="labelValue"
|
|
|
label="标签"
|
|
|
width="100"
|
|
|
align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
prop="originalText"
|
|
|
label="描述"
|
|
|
min-width="120"
|
|
|
- align="left"
|
|
|
+ align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
prop="dataValue"
|
|
|
label="数据值"
|
|
|
min-width="150"
|
|
|
- align="left"
|
|
|
+ align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
></el-table-column>
|
|
|
</el-table>
|
|
|
<div style="margin-top: 10px; font-size: 12px; color: #909399">
|
|
|
@@ -320,13 +327,7 @@
|
|
|
},
|
|
|
documentData: {
|
|
|
type: Object,
|
|
|
- default: () => ({
|
|
|
- documentTypes: [],
|
|
|
- list: [],
|
|
|
- pagination: {},
|
|
|
- dataList: [],
|
|
|
- documentColumns: [],
|
|
|
- }),
|
|
|
+ default: () => {},
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
@@ -334,12 +335,14 @@
|
|
|
dictData: {
|
|
|
whGenerateType: [],
|
|
|
},
|
|
|
+ activeDocumentTypeId: '',
|
|
|
document: {
|
|
|
documentId: '',
|
|
|
documentWhId: '',
|
|
|
documentNumber: '',
|
|
|
enterpriseId: [],
|
|
|
dataList: [],
|
|
|
+ isPushed: '1',
|
|
|
},
|
|
|
loading: {
|
|
|
saveDocument: false,
|
|
|
@@ -362,6 +365,36 @@
|
|
|
},
|
|
|
selectDocumentWhSelection: [],
|
|
|
costDocumentTemplateFiles: [],
|
|
|
+ documentRules: {
|
|
|
+ documentNumber: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择通知书文号',
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ enterpriseId: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择被监审单位',
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ documentId: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择模板',
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ isPushed: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择否推送被监审单位',
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -405,23 +438,15 @@
|
|
|
]
|
|
|
},
|
|
|
},
|
|
|
- // 添加watch监听project变化,确保项目数据更新时重新加载数据
|
|
|
- watch: {
|
|
|
- project: {
|
|
|
- handler(newVal) {
|
|
|
- if (newVal && newVal.projectId) {
|
|
|
- // 通知父组件需要加载数据
|
|
|
- this.$emit('refresh', newVal.projectId)
|
|
|
- }
|
|
|
- },
|
|
|
- deep: true,
|
|
|
- immediate: true,
|
|
|
- },
|
|
|
- },
|
|
|
+ watch: {},
|
|
|
mounted() {
|
|
|
this.loadOpts()
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleDocumentTypeClick(data) {
|
|
|
+ this.activeDocumentTypeId = data.id
|
|
|
+ this.$emit('refresh', data)
|
|
|
+ },
|
|
|
getEnterpriseName(row) {
|
|
|
// 处理enterpriseId,无论是数组还是逗号分隔的字符串
|
|
|
let enterpriseIds = []
|
|
|
@@ -477,6 +502,10 @@
|
|
|
documentWhId: '',
|
|
|
documentNumber: '',
|
|
|
enterpriseId: [],
|
|
|
+ isPushed: '1', // 默认设置为'1'(是)
|
|
|
+ }
|
|
|
+ if (this.activeDocumentTypeId) {
|
|
|
+ this.document.documentId = this.activeDocumentTypeId
|
|
|
}
|
|
|
this.costProjectDocumentFiles = []
|
|
|
},
|
|
|
@@ -507,10 +536,6 @@
|
|
|
this.selectDocumentWhSelection = selection
|
|
|
}
|
|
|
},
|
|
|
- // 选择文档类型
|
|
|
- selectDocumentType(doc) {
|
|
|
- // this.documentData.selectedDoc = doc.value
|
|
|
- },
|
|
|
handleTemplateChange() {
|
|
|
this.fileUrl = this.documentData.documentTypes.find(
|
|
|
(item) => item.id === this.document.documentId
|
|
|
@@ -566,8 +591,8 @@
|
|
|
documentId: this.document.documentId,
|
|
|
documentNumber: this.document.documentNumber,
|
|
|
documentWhId: this.document.documentWhId,
|
|
|
- costProjectDocumentFiles: this.costProjectDocumentFiles || [],
|
|
|
- // isPushed: this.document.isPushed,
|
|
|
+ costProjectDocumentFiles: this.costDocumentTemplateFiles,
|
|
|
+ isPushed: this.document.isPushed, // 添加isPushed字段
|
|
|
projectId: this.project.projectId,
|
|
|
// electronicDocumentUrl: '',
|
|
|
enterpriseId: this.document.enterpriseId.join(','), // 保存时转换为逗号分隔的字符串
|
|
|
@@ -594,13 +619,13 @@
|
|
|
documentId: this.document.documentId,
|
|
|
documentNumber: this.document.documentNumber,
|
|
|
documentWhId: this.document.documentWhId,
|
|
|
- costProjectDocumentFiles: this.costProjectDocumentFiles || [],
|
|
|
+ costProjectDocumentFiles: this.costDocumentTemplateFiles || [],
|
|
|
enterpriseId: enterpriseId,
|
|
|
// electronicDocumentUrl: '',
|
|
|
// feedbackDocumentUrl: '',
|
|
|
// feedbackTime: '',
|
|
|
// generateTime: '',
|
|
|
- isPushed: this.document.isPushed,
|
|
|
+ isPushed: this.document.isPushed, // 使用isPushed,如果不存在则使用isPushed
|
|
|
// orderNum: 0,
|
|
|
// pushTime: '',
|
|
|
// scanDocumentUrl: '',
|
|
|
@@ -611,7 +636,7 @@
|
|
|
.then(() => {
|
|
|
this.loading.saveDocument = false
|
|
|
this.$message.success('保存成功!')
|
|
|
- this.dialogVisible = false
|
|
|
+ this.documentDialogVisible = false
|
|
|
this.activeView = ''
|
|
|
this.$emit('refresh', this.project.projectId)
|
|
|
})
|
|
|
@@ -746,8 +771,15 @@
|
|
|
: []
|
|
|
this.document = {
|
|
|
...row,
|
|
|
+ documentId: Number(row.documentId),
|
|
|
enterpriseId,
|
|
|
+ // 确保isPushed有值,如果row中没有,设置默认值'1'
|
|
|
+ isPushed: row.isPushed !== undefined ? row.isPushed : '1',
|
|
|
}
|
|
|
+ this.fileUrl = this.documentData.documentTypes.find(
|
|
|
+ (item) => item.id === this.document.documentId
|
|
|
+ ).fileUrl
|
|
|
+ this.getDocumentData(this.document.documentId)
|
|
|
},
|
|
|
|
|
|
// 签章
|
|
|
@@ -800,7 +832,11 @@
|
|
|
}
|
|
|
|
|
|
.type-item:hover {
|
|
|
- color: #409eff;
|
|
|
+ color: $base-color-default;
|
|
|
+ }
|
|
|
+
|
|
|
+ .type-item.active {
|
|
|
+ color: $base-color-default;
|
|
|
}
|
|
|
|
|
|
.documents-content {
|