|
|
@@ -104,6 +104,8 @@
|
|
|
:catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
|
|
|
:table-items="tableItems"
|
|
|
:audit-periods="auditPeriods"
|
|
|
+ :project-audit-periods="projectAuditPeriods"
|
|
|
+ :project-audit-period="projectAuditPeriod"
|
|
|
/>
|
|
|
|
|
|
<!-- 动态表弹窗(查看) -->
|
|
|
@@ -134,6 +136,7 @@
|
|
|
getSingleRecordSurveyList,
|
|
|
getDynamicTableData,
|
|
|
} from '@/api/audit/survey'
|
|
|
+ import { getProjectInformationInfo } from '@/api/auditTaskProcessing'
|
|
|
import SurveyFormDialog from '@/views/EntDeclaration/auditTaskManagement/components/SurveyFormDialog.vue'
|
|
|
import FixedTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/FixedTableDialog.vue'
|
|
|
import DynamicTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/DynamicTableDialog.vue'
|
|
|
@@ -144,6 +147,10 @@
|
|
|
auditedUnitId: { type: String, default: '' },
|
|
|
catalogId: { type: String, default: '' },
|
|
|
taskId: { type: String, default: '' },
|
|
|
+ // 立项项目ID(用于拉取立项信息中的监审期间)
|
|
|
+ projectId: { type: String, default: '' },
|
|
|
+ // 父级可直接传入监审期间(可选,字符串或数组)
|
|
|
+ auditPeriod: { type: [String, Array], default: '' },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -154,6 +161,9 @@
|
|
|
surveyDetailData: {},
|
|
|
tableItems: [],
|
|
|
auditPeriods: [],
|
|
|
+ // 立项信息中的监审期间(原样与数组形式)
|
|
|
+ projectAuditPeriod: '',
|
|
|
+ projectAuditPeriods: [],
|
|
|
dynamicTableData: [],
|
|
|
singleDialogVisible: false,
|
|
|
fixedDialogVisible: false,
|
|
|
@@ -173,6 +183,18 @@
|
|
|
this.loadList()
|
|
|
}
|
|
|
},
|
|
|
+ // 父组件若更新了监审期间,立即解析至本地(作为兜底)
|
|
|
+ auditPeriod: {
|
|
|
+ handler(val) {
|
|
|
+ if (!val) return
|
|
|
+ if (Array.isArray(val)) {
|
|
|
+ this.auditPeriods = val.map((p) => String(p))
|
|
|
+ } else {
|
|
|
+ this.auditPeriods = this.parseAuditPeriod(val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
console.log('auditedUnitId', this.auditedUnitId)
|
|
|
@@ -314,6 +336,8 @@
|
|
|
async initFixedTableData() {
|
|
|
this.tableItems = []
|
|
|
this.auditPeriods = []
|
|
|
+ this.projectAuditPeriod = ''
|
|
|
+ this.projectAuditPeriods = []
|
|
|
const row = this.currentTemplateRow || {}
|
|
|
const surveyTemplateId = row.templateId || row.surveyTemplateId || ''
|
|
|
if (!surveyTemplateId) return
|
|
|
@@ -356,6 +380,40 @@
|
|
|
const periodStr =
|
|
|
row.auditPeriod || (res.value && res.value.auditPeriod) || ''
|
|
|
this.auditPeriods = this.parseAuditPeriod(periodStr)
|
|
|
+ // 优先从立项信息中获取监审期间并覆盖(按需求回显年份)
|
|
|
+ try {
|
|
|
+ if (this.projectId) {
|
|
|
+ const projRes = await getProjectInformationInfo(this.projectId)
|
|
|
+ const projVal = projRes && projRes.value
|
|
|
+ if (projVal) {
|
|
|
+ // 记录原始与数组两种形式,供弹窗优先使用
|
|
|
+ if (projVal.auditPeriod) {
|
|
|
+ this.projectAuditPeriod = projVal.auditPeriod
|
|
|
+ this.projectAuditPeriods = Array.isArray(
|
|
|
+ projVal.auditPeriod
|
|
|
+ )
|
|
|
+ ? projVal.auditPeriod.map((p) => String(p))
|
|
|
+ : this.parseAuditPeriod(projVal.auditPeriod)
|
|
|
+ } else if (
|
|
|
+ Array.isArray(projVal.auditPeriodArray) &&
|
|
|
+ projVal.auditPeriodArray.length
|
|
|
+ ) {
|
|
|
+ this.projectAuditPeriods = projVal.auditPeriodArray
|
|
|
+ .map((it) => it && (it.value || it))
|
|
|
+ .map((p) => String(p))
|
|
|
+ .filter((s) => s && s.trim())
|
|
|
+ this.projectAuditPeriod = this.projectAuditPeriods.join(',')
|
|
|
+ }
|
|
|
+ // 同步覆盖父级传入/配置解析的 auditPeriods
|
|
|
+ if (this.projectAuditPeriods.length > 0) {
|
|
|
+ this.projectAuditPeriod = this.projectAuditPeriods.slice()
|
|
|
+ console.log(this.projectAuditPeriod, '监审期间')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ // 忽略立项信息拉取失败,保留已有解析结果
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
this.tableItems = []
|