|
@@ -147,51 +147,83 @@
|
|
|
|
|
|
|
|
<survey-form-dialog
|
|
<survey-form-dialog
|
|
|
:visible.sync="singleDialogVisible"
|
|
:visible.sync="singleDialogVisible"
|
|
|
- :survey-data="{}"
|
|
|
|
|
|
|
+ :survey-data="{ ...(currentTemplateRow || {}), ...surveyDetailData }"
|
|
|
:is-view-mode="true"
|
|
:is-view-mode="true"
|
|
|
|
|
+ :request-type="2"
|
|
|
:audited-unit-id="
|
|
:audited-unit-id="
|
|
|
- (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
|
|
|
|
|
|
|
+ auditedUnitId ||
|
|
|
|
|
+ (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
|
|
|
|
|
+ ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :upload-id="
|
|
|
|
|
+ (currentTemplateRow &&
|
|
|
|
|
+ (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
|
|
|
|
|
+ ''
|
|
|
"
|
|
"
|
|
|
- :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
|
|
|
|
|
:survey-template-id="
|
|
:survey-template-id="
|
|
|
(currentTemplateRow &&
|
|
(currentTemplateRow &&
|
|
|
(currentTemplateRow.templateId ||
|
|
(currentTemplateRow.templateId ||
|
|
|
currentTemplateRow.surveyTemplateId)) ||
|
|
currentTemplateRow.surveyTemplateId)) ||
|
|
|
''
|
|
''
|
|
|
"
|
|
"
|
|
|
- :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
|
|
|
|
|
|
|
+ :catalog-id="
|
|
|
|
|
+ catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
|
|
|
|
|
+ "
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<fixed-table-dialog
|
|
<fixed-table-dialog
|
|
|
:visible.sync="fixedDialogVisible"
|
|
:visible.sync="fixedDialogVisible"
|
|
|
:is-view-mode="true"
|
|
:is-view-mode="true"
|
|
|
|
|
+ :request-type="2"
|
|
|
:audited-unit-id="
|
|
:audited-unit-id="
|
|
|
- (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
|
|
|
|
|
|
|
+ auditedUnitId ||
|
|
|
|
|
+ (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
|
|
|
|
|
+ ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :upload-id="
|
|
|
|
|
+ (currentTemplateRow &&
|
|
|
|
|
+ (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
|
|
|
|
|
+ ''
|
|
|
"
|
|
"
|
|
|
- :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
|
|
|
|
|
:survey-template-id="
|
|
:survey-template-id="
|
|
|
(currentTemplateRow &&
|
|
(currentTemplateRow &&
|
|
|
(currentTemplateRow.templateId ||
|
|
(currentTemplateRow.templateId ||
|
|
|
currentTemplateRow.surveyTemplateId)) ||
|
|
currentTemplateRow.surveyTemplateId)) ||
|
|
|
''
|
|
''
|
|
|
"
|
|
"
|
|
|
- :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
|
|
|
|
|
|
|
+ :catalog-id="
|
|
|
|
|
+ catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :fixed-fields="fixedFields || ''"
|
|
|
|
|
+ :fixed-fieldids="fixedFieldids || ''"
|
|
|
|
|
+ :table-items="tableItems"
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<dynamic-table-dialog
|
|
<dynamic-table-dialog
|
|
|
:visible.sync="dynamicDialogVisible"
|
|
:visible.sync="dynamicDialogVisible"
|
|
|
:is-view-mode="true"
|
|
:is-view-mode="true"
|
|
|
|
|
+ :request-type="2"
|
|
|
:audited-unit-id="
|
|
:audited-unit-id="
|
|
|
- (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
|
|
|
|
|
|
|
+ auditedUnitId ||
|
|
|
|
|
+ (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
|
|
|
|
|
+ ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :upload-id="
|
|
|
|
|
+ (currentTemplateRow &&
|
|
|
|
|
+ (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
|
|
|
|
|
+ ''
|
|
|
"
|
|
"
|
|
|
- :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
|
|
|
|
|
:survey-template-id="
|
|
:survey-template-id="
|
|
|
(currentTemplateRow &&
|
|
(currentTemplateRow &&
|
|
|
(currentTemplateRow.templateId ||
|
|
(currentTemplateRow.templateId ||
|
|
|
currentTemplateRow.surveyTemplateId)) ||
|
|
currentTemplateRow.surveyTemplateId)) ||
|
|
|
''
|
|
''
|
|
|
"
|
|
"
|
|
|
- :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
|
|
|
|
|
|
|
+ :catalog-id="
|
|
|
|
|
+ catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :table-data="dynamicTableData"
|
|
|
|
|
+ :table-items="tableItems"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -208,6 +240,11 @@
|
|
|
import SurveyFormDialog from '@/views/EntDeclaration/auditTaskManagement/components/SurveyFormDialog.vue'
|
|
import SurveyFormDialog from '@/views/EntDeclaration/auditTaskManagement/components/SurveyFormDialog.vue'
|
|
|
import FixedTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/FixedTableDialog.vue'
|
|
import FixedTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/FixedTableDialog.vue'
|
|
|
import DynamicTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/DynamicTableDialog.vue'
|
|
import DynamicTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/DynamicTableDialog.vue'
|
|
|
|
|
+ import {
|
|
|
|
|
+ getSingleRecordSurveyList,
|
|
|
|
|
+ getSurveyDetail,
|
|
|
|
|
+ getDynamicTableData,
|
|
|
|
|
+ } from '@/api/audit/survey'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'AuditReview',
|
|
name: 'AuditReview',
|
|
@@ -225,6 +262,18 @@
|
|
|
type: String,
|
|
type: String,
|
|
|
default: '',
|
|
default: '',
|
|
|
},
|
|
},
|
|
|
|
|
+ auditedUnitId: {
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ catalogId: {
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ taskId: {
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -261,6 +310,11 @@
|
|
|
singleDialogVisible: false,
|
|
singleDialogVisible: false,
|
|
|
fixedDialogVisible: false,
|
|
fixedDialogVisible: false,
|
|
|
dynamicDialogVisible: false,
|
|
dynamicDialogVisible: false,
|
|
|
|
|
+ fixedFields: '',
|
|
|
|
|
+ fixedFieldids: '',
|
|
|
|
|
+ surveyDetailData: {},
|
|
|
|
|
+ dynamicTableData: [],
|
|
|
|
|
+ tableItems: [],
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -407,16 +461,50 @@
|
|
|
// this.$message.error('文件预览失败')
|
|
// this.$message.error('文件预览失败')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- handleViewTemplate(row) {
|
|
|
|
|
|
|
+ async handleViewTemplate(row) {
|
|
|
this.currentTemplateRow = row || null
|
|
this.currentTemplateRow = row || null
|
|
|
const t = String(
|
|
const t = String(
|
|
|
(row && (row.templateType || row.templatetype)) || ''
|
|
(row && (row.templateType || row.templatetype)) || ''
|
|
|
).trim()
|
|
).trim()
|
|
|
if (t === '1') {
|
|
if (t === '1') {
|
|
|
|
|
+ // 单记录:打开前回显数据(type=2)
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.surveyDetailData = {}
|
|
|
|
|
+ const uploadId = (row && (row.uploadId || row.id)) || ''
|
|
|
|
|
+ if (uploadId) {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ uploadId,
|
|
|
|
|
+ auditedUnitId:
|
|
|
|
|
+ this.auditedUnitId || (row && row.auditedUnitId) || '',
|
|
|
|
|
+ type: 2,
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await getSurveyDetail(params)
|
|
|
|
|
+ if (res && res.code === 200 && res.value) {
|
|
|
|
|
+ const detailData = {}
|
|
|
|
|
+ if (Array.isArray(res.value)) {
|
|
|
|
|
+ res.value.forEach((item) => {
|
|
|
|
|
+ if (item.rowid && item.rvalue !== undefined) {
|
|
|
|
|
+ detailData[item.rowid] = item.rvalue
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else if (res.value && typeof res.value === 'object') {
|
|
|
|
|
+ Object.assign(detailData, res.value)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.surveyDetailData = detailData
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('获取单记录详情失败', e)
|
|
|
|
|
+ }
|
|
|
this.singleDialogVisible = true
|
|
this.singleDialogVisible = true
|
|
|
} else if (t === '2') {
|
|
} else if (t === '2') {
|
|
|
|
|
+ // 固定表:先加载固定表配置(表头),参考 CostSurveyTab
|
|
|
|
|
+ const surveyTemplateId =
|
|
|
|
|
+ (row && (row.surveyTemplateId || row.templateId)) || ''
|
|
|
|
|
+ await this.initFixedTableData(surveyTemplateId)
|
|
|
this.fixedDialogVisible = true
|
|
this.fixedDialogVisible = true
|
|
|
} else if (t === '3') {
|
|
} else if (t === '3') {
|
|
|
|
|
+ await this.initDynamicTableData()
|
|
|
this.dynamicDialogVisible = true
|
|
this.dynamicDialogVisible = true
|
|
|
} else {
|
|
} else {
|
|
|
this.$message &&
|
|
this.$message &&
|
|
@@ -424,6 +512,75 @@
|
|
|
this.$message.warning('未知的模板类型,无法打开预置模板')
|
|
this.$message.warning('未知的模板类型,无法打开预置模板')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ async initDynamicTableData() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const row = this.currentTemplateRow || {}
|
|
|
|
|
+ const uploadId = (row && (row.uploadId || row.id)) || ''
|
|
|
|
|
+ const auditedUnitId = this.auditedUnitId || row.auditedUnitId || ''
|
|
|
|
|
+ const catalogId = this.catalogId || row.catalogId || ''
|
|
|
|
|
+ const surveyTemplateId =
|
|
|
|
|
+ (row && (row.surveyTemplateId || row.templateId)) || ''
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ uploadId,
|
|
|
|
|
+ auditedUnitId,
|
|
|
|
|
+ catalogId,
|
|
|
|
|
+ surveyTemplateId,
|
|
|
|
|
+ type: 2,
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await getDynamicTableData(params)
|
|
|
|
|
+ if (res && res.code === 200) {
|
|
|
|
|
+ const records = res.value?.records || res.value || []
|
|
|
|
|
+ this.dynamicTableData = Array.isArray(records) ? records : []
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.dynamicTableData = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 若当前行自带列配置则透传,否则传空数组
|
|
|
|
|
+ this.tableItems = (row && row.tableItems) || []
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('获取动态表数据失败:', e)
|
|
|
|
|
+ this.dynamicTableData = []
|
|
|
|
|
+ this.tableItems = []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async initFixedTableData(surveyTemplateId) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.fixedFields = ''
|
|
|
|
|
+ this.fixedFieldids = ''
|
|
|
|
|
+ this.tableItems = []
|
|
|
|
|
+ if (!surveyTemplateId) return
|
|
|
|
|
+ const params = { surveyTemplateId, type: 2 }
|
|
|
|
|
+ const res = await getSingleRecordSurveyList(params)
|
|
|
|
|
+ if (res && res.code === 200 && res.value) {
|
|
|
|
|
+ this.fixedFields = res.value.fixedFields || ''
|
|
|
|
|
+ this.fixedFieldids = res.value.fixedFieldids || ''
|
|
|
|
|
+ const { itemlist } = res.value || {}
|
|
|
|
|
+ if (Array.isArray(itemlist) && itemlist.length > 0) {
|
|
|
|
|
+ this.tableItems = itemlist.map((item) => ({
|
|
|
|
|
+ id: item.id || item.itemId || '',
|
|
|
|
|
+ rowid: item.rowid || item.id || item.itemId || '',
|
|
|
|
|
+ seq: item.序号,
|
|
|
|
|
+ itemName: item.项目 || item.itemName || '',
|
|
|
|
|
+ unit: item.unit || '',
|
|
|
|
|
+ isCategory: item.isCategory || false,
|
|
|
|
|
+ categorySeq: item.categorySeq || '',
|
|
|
|
|
+ categoryId: item.categoryId || '',
|
|
|
|
|
+ parentid:
|
|
|
|
|
+ item.parentid !== undefined
|
|
|
|
|
+ ? item.parentid
|
|
|
|
|
+ : item.parentId !== undefined
|
|
|
|
|
+ ? item.parentId
|
|
|
|
|
+ : '-1',
|
|
|
|
|
+ validateRules: item.validateRules || {},
|
|
|
|
|
+ linkageRules: item.linkageRules || {},
|
|
|
|
|
+ children: item.children || [],
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ }))
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('加载固定表配置失败:', e)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 查看报表
|
|
// 查看报表
|
|
|
handleViewReport(row) {
|
|
handleViewReport(row) {
|
|
|
this.$message.info(`查看报表:${row.name}`)
|
|
this.$message.info(`查看报表:${row.name}`)
|