|
@@ -143,59 +143,88 @@
|
|
|
<el-button type="primary" @click="handleAuditSubmit">提交</el-button>
|
|
<el-button type="primary" @click="handleAuditSubmit">提交</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
- <!-- 单记录弹窗 -->
|
|
|
|
|
<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) || ''"
|
|
|
|
|
- :request-type="2"
|
|
|
|
|
|
|
+ :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) || ''"
|
|
|
|
|
- :request-type="2"
|
|
|
|
|
|
|
+ :catalog-id="
|
|
|
|
|
+ catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :project-audit-periods="projectAuditPeriods"
|
|
|
|
|
+ :project-audit-period="projectAuditPeriod"
|
|
|
|
|
+ :audit-periods="auditPeriods"
|
|
|
|
|
+ :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) || ''"
|
|
|
|
|
- :request-type="2"
|
|
|
|
|
|
|
+ :catalog-id="
|
|
|
|
|
+ catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :table-data="dynamicTableData"
|
|
|
|
|
+ :table-items="tableItems"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -226,6 +255,10 @@
|
|
|
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 } from '@/api/audit/survey'
|
|
|
|
|
+ import { getDynamicTableData } from '@/api/audit/survey'
|
|
|
|
|
+ import { getProjectInformationInfo } from '@/api/auditTaskProcessing'
|
|
|
|
|
+ import { getSurveyDetail } from '@/api/audit/survey'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'AuditReview',
|
|
name: 'AuditReview',
|
|
@@ -251,6 +284,24 @@
|
|
|
type: Array,
|
|
type: Array,
|
|
|
default: () => [],
|
|
default: () => [],
|
|
|
},
|
|
},
|
|
|
|
|
+ auditedUnitId: {
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ catalogId: {
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ // 任务ID,用于在缺少 uploadId 时回退查询详情
|
|
|
|
|
+ taskId: {
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ // 立项信息ID(用于获取监审期间)
|
|
|
|
|
+ projectId: {
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -280,6 +331,17 @@
|
|
|
singleDialogVisible: false,
|
|
singleDialogVisible: false,
|
|
|
fixedDialogVisible: false,
|
|
fixedDialogVisible: false,
|
|
|
dynamicDialogVisible: false,
|
|
dynamicDialogVisible: false,
|
|
|
|
|
+ // 固定表/动态表所需的配置与数据(用于弹窗透传)
|
|
|
|
|
+ fixedFields: '',
|
|
|
|
|
+ fixedFieldids: '',
|
|
|
|
|
+ tableItems: [],
|
|
|
|
|
+ dynamicTableData: [],
|
|
|
|
|
+ // 立项信息监审期间
|
|
|
|
|
+ projectAuditPeriods: [],
|
|
|
|
|
+ projectAuditPeriod: '',
|
|
|
|
|
+ auditPeriods: [],
|
|
|
|
|
+ // 详情回显数据(供单记录弹窗 survey-data 绑定使用)
|
|
|
|
|
+ surveyDetailData: {},
|
|
|
// 资料审核表单数据
|
|
// 资料审核表单数据
|
|
|
auditForm: {
|
|
auditForm: {
|
|
|
auditedStatus: '通过', // 默认审核通过
|
|
auditedStatus: '通过', // 默认审核通过
|
|
@@ -464,21 +526,177 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 查看预置模板,按模板类型打开不同弹窗
|
|
// 查看预置模板,按模板类型打开不同弹窗
|
|
|
- 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),与 costSurvey 实现保持一致的回显逻辑
|
|
|
|
|
+ this.surveyDetailData = {}
|
|
|
|
|
+ await this.loadSingleRecordDetail()
|
|
|
this.singleDialogVisible = true
|
|
this.singleDialogVisible = true
|
|
|
} else if (t === '2') {
|
|
} else if (t === '2') {
|
|
|
- this.fixedDialogVisible = true
|
|
|
|
|
|
|
+ // 与 components 版本一致:先拉取固定表表头与项配置
|
|
|
|
|
+ const surveyTemplateId =
|
|
|
|
|
+ (row && (row.surveyTemplateId || row.templateId)) || ''
|
|
|
|
|
+ Promise.all([
|
|
|
|
|
+ this.initFixedTableData(surveyTemplateId),
|
|
|
|
|
+ this.fetchProjectAuditPeriods(),
|
|
|
|
|
+ ]).then(() => {
|
|
|
|
|
+ this.fixedDialogVisible = true
|
|
|
|
|
+ })
|
|
|
} else if (t === '3') {
|
|
} else if (t === '3') {
|
|
|
|
|
+ await this.initDynamicTableData()
|
|
|
this.dynamicDialogVisible = true
|
|
this.dynamicDialogVisible = true
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.warning('未知的模板类型,无法打开预置模板')
|
|
this.$message.warning('未知的模板类型,无法打开预置模板')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 预取动态表数据(type=2),与 costSurvey 一致的参数拼装,但本页使用 type=2
|
|
|
|
|
+ async initDynamicTableData() {
|
|
|
|
|
+ this.dynamicTableData = []
|
|
|
|
|
+ const row = this.currentTemplateRow || {}
|
|
|
|
|
+ const uploadId = row.uploadId || row.id || ''
|
|
|
|
|
+ const auditedUnitId = row.auditedUnitId || this.auditedUnitId || ''
|
|
|
|
|
+ const catalogId = row.catalogId || this.catalogId || ''
|
|
|
|
|
+ const surveyTemplateId = row.templateId || row.surveyTemplateId || ''
|
|
|
|
|
+ if (!uploadId) return
|
|
|
|
|
+ try {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ uploadId,
|
|
|
|
|
+ ...(auditedUnitId ? { auditedUnitId } : {}),
|
|
|
|
|
+ catalogId,
|
|
|
|
|
+ surveyTemplateId,
|
|
|
|
|
+ type: 2,
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await getDynamicTableData(params)
|
|
|
|
|
+ if (res && res.code === 200) {
|
|
|
|
|
+ const records =
|
|
|
|
|
+ (res.value && (res.value.records || res.value)) || []
|
|
|
|
|
+ this.dynamicTableData = Array.isArray(records) ? records : []
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ this.dynamicTableData = []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取立项信息监审期间,供固定表年份优先回显
|
|
|
|
|
+ async fetchProjectAuditPeriods() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.projectAuditPeriods = []
|
|
|
|
|
+ this.projectAuditPeriod = ''
|
|
|
|
|
+ const pid = this.projectId
|
|
|
|
|
+ if (!pid) return
|
|
|
|
|
+ const res = await getProjectInformationInfo(pid)
|
|
|
|
|
+ const periodStr =
|
|
|
|
|
+ (res &&
|
|
|
|
|
+ res.value &&
|
|
|
|
|
+ (res.value.auditPeriod || res.value.auditperiod)) ||
|
|
|
|
|
+ ''
|
|
|
|
|
+ if (typeof periodStr === 'string' && periodStr.trim()) {
|
|
|
|
|
+ const arr = periodStr
|
|
|
|
|
+ .split(',')
|
|
|
|
|
+ .map((y) => String(y).trim())
|
|
|
|
|
+ .filter((y) => /^(19|20)\d{2}$/.test(y))
|
|
|
|
|
+ this.projectAuditPeriods = arr
|
|
|
|
|
+ this.projectAuditPeriod = arr.join(',')
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('获取立项信息监审期间失败', e)
|
|
|
|
|
+ this.projectAuditPeriods = []
|
|
|
|
|
+ this.projectAuditPeriod = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 预取单记录详情(type=2),将数组结果映射为 { rowid: rvalue } 的对象,供弹窗回显
|
|
|
|
|
+ async loadSingleRecordDetail() {
|
|
|
|
|
+ this.surveyDetailData = {}
|
|
|
|
|
+ const row = this.currentTemplateRow || {}
|
|
|
|
|
+ const uploadId = row.uploadId || row.id || ''
|
|
|
|
|
+ const auditedUnitId = row.auditedUnitId || this.auditedUnitId || ''
|
|
|
|
|
+ const hasUpload = Boolean(uploadId)
|
|
|
|
|
+ const hasTask = Boolean(this.taskId)
|
|
|
|
|
+ if (!hasUpload && !hasTask) return
|
|
|
|
|
+ try {
|
|
|
|
|
+ const params = hasUpload
|
|
|
|
|
+ ? { uploadId, type: 2, ...(auditedUnitId ? { auditedUnitId } : {}) }
|
|
|
|
|
+ : { taskId: this.taskId, type: 2 }
|
|
|
|
|
+ const res = await getSurveyDetail(params)
|
|
|
|
|
+ if (res && res.code === 200 && res.value) {
|
|
|
|
|
+ const detail = {}
|
|
|
|
|
+ const val = res.value
|
|
|
|
|
+ if (Array.isArray(val)) {
|
|
|
|
|
+ val.forEach((item) => {
|
|
|
|
|
+ if (!item || typeof item !== 'object') return
|
|
|
|
|
+ const key =
|
|
|
|
|
+ item.rowid !== undefined
|
|
|
|
|
+ ? item.rowid
|
|
|
|
|
+ : item.rowId !== undefined
|
|
|
|
|
+ ? item.rowId
|
|
|
|
|
+ : item.id !== undefined
|
|
|
|
|
+ ? item.id
|
|
|
|
|
+ : undefined
|
|
|
|
|
+ const value =
|
|
|
|
|
+ item.rvalue !== undefined
|
|
|
|
|
+ ? item.rvalue
|
|
|
|
|
+ : item.rValue !== undefined
|
|
|
|
|
+ ? item.rValue
|
|
|
|
|
+ : item.value !== undefined
|
|
|
|
|
+ ? item.value
|
|
|
|
|
+ : item.val !== undefined
|
|
|
|
|
+ ? item.val
|
|
|
|
|
+ : ''
|
|
|
|
|
+ if (key !== undefined) detail[key] = value
|
|
|
|
|
+ })
|
|
|
|
|
+ } else if (val && typeof val === 'object') {
|
|
|
|
|
+ Object.assign(detail, val)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.surveyDetailData = detail
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ this.surveyDetailData = {}
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取固定表配置(表头与项),与 components/task/components/submitData.vue 保持一致
|
|
|
|
|
+ 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)
|
|
|
|
|
+ this.tableItems = []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 查看报表
|
|
// 查看报表
|
|
|
handleViewReport(row) {
|
|
handleViewReport(row) {
|
|
|
this.$message.info(`查看报表:${row.name}`)
|
|
this.$message.info(`查看报表:${row.name}`)
|