|
|
@@ -7,6 +7,7 @@
|
|
|
:form-fields="formFields"
|
|
|
:is-view-mode="isViewMode"
|
|
|
:audited-unit-id="auditedUnitId"
|
|
|
+ :request-type="1"
|
|
|
:upload-id="
|
|
|
currentSurveyRow && currentSurveyRow.id ? currentSurveyRow.id : uploadId
|
|
|
"
|
|
|
@@ -26,7 +27,10 @@
|
|
|
:survey-data="{ ...currentSurveyRow, fixedHeaders }"
|
|
|
:table-items="tableItems"
|
|
|
:audit-periods="auditPeriods"
|
|
|
+ :project-audit-periods="auditPeriods"
|
|
|
+ :project-audit-period="auditPeriod"
|
|
|
:is-view-mode="isViewMode"
|
|
|
+ :request-type="1"
|
|
|
:audited-unit-id="auditedUnitId"
|
|
|
:upload-id="
|
|
|
currentSurveyRow && currentSurveyRow.id ? currentSurveyRow.id : uploadId
|
|
|
@@ -49,6 +53,7 @@
|
|
|
:table-data="dynamicTableData"
|
|
|
:table-items="tableItems"
|
|
|
:is-view-mode="isViewMode"
|
|
|
+ :request-type="1"
|
|
|
:audited-unit-id="auditedUnitId"
|
|
|
:upload-id="
|
|
|
currentSurveyRow && (currentSurveyRow.uploadId || currentSurveyRow.id)
|
|
|
@@ -326,10 +331,58 @@
|
|
|
pendingDynamicRow: null,
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ auditPeriod: {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ handler() {
|
|
|
+ this.syncAuditPeriodsFromProp()
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
mounted() {
|
|
|
// 表单字段配置在打开弹窗时动态加载,不需要在 mounted 中初始化
|
|
|
+ this.syncAuditPeriodsFromProp()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 同步并规范化来自 props 的监审期间到本地数组
|
|
|
+ syncAuditPeriodsFromProp() {
|
|
|
+ const input = this.auditPeriod
|
|
|
+ if (!input) {
|
|
|
+ this.auditPeriods = []
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (Array.isArray(input)) {
|
|
|
+ this.auditPeriods = input.map((p) => String(p))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const str = String(input).trim()
|
|
|
+ if (!str) {
|
|
|
+ this.auditPeriods = []
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (str.includes(',')) {
|
|
|
+ this.auditPeriods = str
|
|
|
+ .split(',')
|
|
|
+ .map((s) => s.trim())
|
|
|
+ .filter(Boolean)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (str.includes('-')) {
|
|
|
+ const parts = str.split('-')
|
|
|
+ if (parts.length === 2) {
|
|
|
+ const start = parseInt(parts[0].trim())
|
|
|
+ const end = parseInt(parts[1].trim())
|
|
|
+ const years = []
|
|
|
+ if (!isNaN(start) && !isNaN(end) && end >= start) {
|
|
|
+ for (let y = start; y <= end; y++) years.push(String(y))
|
|
|
+ }
|
|
|
+ this.auditPeriods = years
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.auditPeriods = [str]
|
|
|
+ },
|
|
|
// 处理在线填报点击
|
|
|
async handleOnlineFillClick(row) {
|
|
|
this.currentSurveyRow = row
|
|
|
@@ -345,7 +398,7 @@
|
|
|
const params = {
|
|
|
uploadId: row.id,
|
|
|
auditedUnitId: this.auditedUnitId,
|
|
|
- type: 2,
|
|
|
+ type: 1,
|
|
|
}
|
|
|
const res = await getSurveyDetail(params)
|
|
|
console.log('单记录详情数据', res)
|
|
|
@@ -461,7 +514,7 @@
|
|
|
formData.append('taskId', taskId)
|
|
|
if (materialId) formData.append('materialId', materialId)
|
|
|
if (periodRecordId) formData.append('periodRecordId', periodRecordId)
|
|
|
- formData.append('type', '2')
|
|
|
+ formData.append('type', '1')
|
|
|
|
|
|
let loading
|
|
|
try {
|
|
|
@@ -511,7 +564,7 @@
|
|
|
// this.$message.warning('缺少模板或版本信息,无法下载')
|
|
|
// return
|
|
|
// }
|
|
|
- const params = { surveyTemplateId, versionId, type: 2 }
|
|
|
+ const params = { surveyTemplateId, versionId, type: 1 }
|
|
|
const res = await downloadTemplate(params)
|
|
|
loading.close()
|
|
|
// 处理响应数据(可能是 axios 响应或直接 Blob)
|
|
|
@@ -584,7 +637,7 @@
|
|
|
auditedUnitId,
|
|
|
catalogId,
|
|
|
surveyTemplateId,
|
|
|
- type: 2,
|
|
|
+ type: 1,
|
|
|
}
|
|
|
|
|
|
const res = await getDynamicTableData(params)
|
|
|
@@ -632,7 +685,7 @@
|
|
|
try {
|
|
|
const params = {
|
|
|
surveyTemplateId: this.currentSurveyRow.surveyTemplateId,
|
|
|
- type: 2,
|
|
|
+ type: 1,
|
|
|
}
|
|
|
// 调用 getListBySurveyTemplateIdAndVersion 获取完整的字段配置(包含校验规则)
|
|
|
const res = await getListBySurveyTemplateIdAndVersion(params)
|
|
|
@@ -1018,94 +1071,94 @@
|
|
|
},
|
|
|
// 获取假数据表单字段配置(用于测试)
|
|
|
getMockFormFields() {
|
|
|
- return [
|
|
|
- {
|
|
|
- prop: 'institutionName',
|
|
|
- label: '机构名称',
|
|
|
- type: 'input',
|
|
|
- colSpan: 12,
|
|
|
- defaultValue: '幼儿园基本情况',
|
|
|
- placeholder: '请输入机构名称',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'institutionNature',
|
|
|
- label: '机构性质',
|
|
|
- type: 'select',
|
|
|
- colSpan: 12,
|
|
|
- dictType: 'institutionNature', // 字典类型
|
|
|
- defaultValue: '公办',
|
|
|
- placeholder: '请选择机构性质',
|
|
|
- required: true,
|
|
|
- clearable: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'institutionLevel',
|
|
|
- label: '机构评定等级',
|
|
|
- type: 'select',
|
|
|
- colSpan: 12,
|
|
|
- dictType: 'institutionLevel', // 字典类型
|
|
|
- defaultValue: '省一级',
|
|
|
- placeholder: '请选择机构评定等级',
|
|
|
- required: true,
|
|
|
- clearable: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'educationMode',
|
|
|
- label: '机构办学方式',
|
|
|
- type: 'select',
|
|
|
- colSpan: 12,
|
|
|
- dictType: 'educationMode', // 字典类型
|
|
|
- defaultValue: '全日制',
|
|
|
- placeholder: '请选择机构办学方式',
|
|
|
- required: true,
|
|
|
- clearable: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'institutionAddress',
|
|
|
- label: '机构地址',
|
|
|
- type: 'input',
|
|
|
- colSpan: 12,
|
|
|
- placeholder: '请输入机构地址',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'formFiller',
|
|
|
- label: '机构填表人',
|
|
|
- type: 'input',
|
|
|
- colSpan: 12,
|
|
|
- placeholder: '请输入机构填表人',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'financialManager',
|
|
|
- label: '机构财务负责人',
|
|
|
- type: 'input',
|
|
|
- colSpan: 12,
|
|
|
- placeholder: '请输入机构财务负责人',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'contactPhone',
|
|
|
- label: '机构联系电话',
|
|
|
- type: 'input',
|
|
|
- colSpan: 12,
|
|
|
- placeholder: '请输入机构联系电话',
|
|
|
- required: true,
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入机构联系电话',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- {
|
|
|
- pattern: /^1[3-9]\d{9}$/,
|
|
|
- message: '请输入正确的手机号码',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ]
|
|
|
+ // return [
|
|
|
+ // {
|
|
|
+ // prop: 'institutionName',
|
|
|
+ // label: '机构名称',
|
|
|
+ // type: 'input',
|
|
|
+ // colSpan: 12,
|
|
|
+ // defaultValue: '幼儿园基本情况',
|
|
|
+ // placeholder: '请输入机构名称',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'institutionNature',
|
|
|
+ // label: '机构性质',
|
|
|
+ // type: 'select',
|
|
|
+ // colSpan: 12,
|
|
|
+ // dictType: 'institutionNature', // 字典类型
|
|
|
+ // defaultValue: '公办',
|
|
|
+ // placeholder: '请选择机构性质',
|
|
|
+ // required: true,
|
|
|
+ // clearable: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'institutionLevel',
|
|
|
+ // label: '机构评定等级',
|
|
|
+ // type: 'select',
|
|
|
+ // colSpan: 12,
|
|
|
+ // dictType: 'institutionLevel', // 字典类型
|
|
|
+ // defaultValue: '省一级',
|
|
|
+ // placeholder: '请选择机构评定等级',
|
|
|
+ // required: true,
|
|
|
+ // clearable: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'educationMode',
|
|
|
+ // label: '机构办学方式',
|
|
|
+ // type: 'select',
|
|
|
+ // colSpan: 12,
|
|
|
+ // dictType: 'educationMode', // 字典类型
|
|
|
+ // defaultValue: '全日制',
|
|
|
+ // placeholder: '请选择机构办学方式',
|
|
|
+ // required: true,
|
|
|
+ // clearable: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'institutionAddress',
|
|
|
+ // label: '机构地址',
|
|
|
+ // type: 'input',
|
|
|
+ // colSpan: 12,
|
|
|
+ // placeholder: '请输入机构地址',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'formFiller',
|
|
|
+ // label: '机构填表人',
|
|
|
+ // type: 'input',
|
|
|
+ // colSpan: 12,
|
|
|
+ // placeholder: '请输入机构填表人',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'financialManager',
|
|
|
+ // label: '机构财务负责人',
|
|
|
+ // type: 'input',
|
|
|
+ // colSpan: 12,
|
|
|
+ // placeholder: '请输入机构财务负责人',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'contactPhone',
|
|
|
+ // label: '机构联系电话',
|
|
|
+ // type: 'input',
|
|
|
+ // colSpan: 12,
|
|
|
+ // placeholder: '请输入机构联系电话',
|
|
|
+ // required: true,
|
|
|
+ // rules: [
|
|
|
+ // {
|
|
|
+ // required: true,
|
|
|
+ // message: '请输入机构联系电话',
|
|
|
+ // trigger: 'blur',
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // pattern: /^1[3-9]\d{9}$/,
|
|
|
+ // message: '请输入正确的手机号码',
|
|
|
+ // trigger: 'blur',
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // ]
|
|
|
},
|
|
|
// 初始化固定表数据
|
|
|
async initFixedTableData() {
|
|
|
@@ -1118,7 +1171,7 @@
|
|
|
try {
|
|
|
const params = {
|
|
|
surveyTemplateId: this.currentSurveyRow.surveyTemplateId,
|
|
|
- type: 2,
|
|
|
+ type: 1,
|
|
|
}
|
|
|
const res = await getSingleRecordSurveyList(params)
|
|
|
|
|
|
@@ -1198,7 +1251,7 @@
|
|
|
try {
|
|
|
const headerRes = await getListBySurveyTemplateIdAndVersion({
|
|
|
surveyTemplateId: this.currentSurveyRow.surveyTemplateId,
|
|
|
- type: 2,
|
|
|
+ type: 1,
|
|
|
})
|
|
|
|
|
|
if (headerRes && headerRes.code === 200) {
|