CostSurveyTab.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <template>
  2. <div>
  3. <!-- 调查表填报弹窗(单记录类型) -->
  4. <survey-form-dialog
  5. :visible.sync="surveyFormDialogVisible"
  6. :survey-data="{ ...currentSurveyRow, ...surveyDetailData }"
  7. :form-fields="formFields"
  8. :is-view-mode="isViewMode"
  9. :audited-unit-id="auditedUnitId"
  10. :upload-id="
  11. currentSurveyRow && currentSurveyRow.id ? currentSurveyRow.id : uploadId
  12. "
  13. :survey-template-id="
  14. currentSurveyRow && currentSurveyRow.surveyTemplateId
  15. ? currentSurveyRow.surveyTemplateId
  16. : surveyTemplateId
  17. "
  18. :catalog-id="catalogId"
  19. @save="handleSurveyFormSave"
  20. @refresh="handleRefresh"
  21. />
  22. <!-- 固定表填报弹窗 -->
  23. <fixed-table-dialog
  24. :visible.sync="fixedTableDialogVisible"
  25. :survey-data="currentSurveyRow"
  26. :table-items="tableItems"
  27. :audit-periods="auditPeriods"
  28. :is-view-mode="isViewMode"
  29. :audited-unit-id="auditedUnitId"
  30. :upload-id="
  31. currentSurveyRow && currentSurveyRow.id ? currentSurveyRow.id : uploadId
  32. "
  33. :survey-template-id="
  34. currentSurveyRow && currentSurveyRow.surveyTemplateId
  35. ? currentSurveyRow.surveyTemplateId
  36. : surveyTemplateId
  37. "
  38. :catalog-id="catalogId"
  39. @save="handleFixedTableSave"
  40. @refresh="handleRefresh"
  41. />
  42. <!-- 动态表填报弹窗 -->
  43. <dynamic-table-dialog
  44. :visible.sync="dynamicTableDialogVisible"
  45. :survey-data="currentSurveyRow"
  46. :table-data="dynamicTableData"
  47. :table-items="tableItems"
  48. :is-view-mode="isViewMode"
  49. @save="handleDynamicTableSave"
  50. />
  51. <el-table
  52. style="width: 100%; margin-top: 20px"
  53. :data="paginatedData"
  54. border
  55. size="medium"
  56. >
  57. <!-- 序号列 -->
  58. <el-table-column prop="index" label="序号" width="60" align="center">
  59. <template slot-scope="scope">
  60. {{ scope.$index + 1 }}
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="成本调查表" min-width="220">
  64. <template slot-scope="scope">
  65. <span
  66. :style="{
  67. color: scope.row.isDisabled ? '#909399' : '#409EFF',
  68. cursor: scope.row.isDisabled ? 'default' : 'pointer',
  69. }"
  70. @click="
  71. !scope.row.isDisabled && $emit('handle-survey-click', scope.row)
  72. "
  73. >
  74. {{ scope.row.name }}
  75. </span>
  76. </template>
  77. </el-table-column>
  78. <!-- 资料类型列 -->
  79. <el-table-column
  80. prop="dataType"
  81. label="资料类型"
  82. width="120"
  83. align="center"
  84. ></el-table-column>
  85. <!-- 表格类型列 -->
  86. <el-table-column
  87. prop="tableType"
  88. label="表格类型"
  89. width="120"
  90. align="center"
  91. ></el-table-column>
  92. <!-- 是否必填列 -->
  93. <el-table-column
  94. prop="isRequired"
  95. label="是否必填"
  96. width="100"
  97. align="center"
  98. >
  99. <template slot-scope="scope">
  100. <span>
  101. {{
  102. scope.row.isRequired === '是' ||
  103. scope.row.isRequired === '1' ||
  104. scope.row.isRequired === 1
  105. ? '是'
  106. : '否'
  107. }}
  108. </span>
  109. </template>
  110. </el-table-column>
  111. <!-- 是否上传列(红色“未上传”、绿色“已上传”) -->
  112. <el-table-column label="是否上传" width="100" align="center">
  113. <template slot-scope="scope">
  114. <span
  115. :style="{
  116. color: scope.row.isUploaded === true ? '#67c23a' : '#f56c6c',
  117. }"
  118. >
  119. {{ scope.row.isUploaded === true ? '已上传' : '未上传' }}
  120. </span>
  121. </template>
  122. </el-table-column>
  123. <!-- 操作列(根据“是否上传”“表格类型”显示不同按钮) -->
  124. <el-table-column label="操作" width="280" align="center">
  125. <template slot-scope="scope">
  126. <template v-if="scope.row.isUploaded">
  127. <el-button
  128. type="text"
  129. size="small"
  130. :disabled="isViewMode"
  131. @click="handleOnlineFillClick(scope.row)"
  132. >
  133. 在线填报
  134. </el-button>
  135. <el-button
  136. type="text"
  137. size="small"
  138. :disabled="isViewMode"
  139. @click="$emit('handle-modify', scope.row)"
  140. >
  141. 修改
  142. </el-button>
  143. <el-button
  144. type="text"
  145. size="small"
  146. :disabled="isViewMode"
  147. @click="$emit('handle-data-download', scope.row)"
  148. >
  149. 数据下载
  150. </el-button>
  151. <el-button
  152. type="text"
  153. size="small"
  154. :disabled="isViewMode"
  155. @click="$emit('handle-data-upload', scope.row)"
  156. >
  157. 数据上传
  158. </el-button>
  159. </template>
  160. <template v-else>
  161. <el-button
  162. type="text"
  163. size="small"
  164. :disabled="isViewMode"
  165. @click="handleOnlineFillClick(scope.row)"
  166. >
  167. 在线填报
  168. </el-button>
  169. <el-button
  170. v-if="scope.row.tableType === '动态表'"
  171. type="text"
  172. size="small"
  173. :disabled="isViewMode"
  174. @click="$emit('handle-template-download', scope.row)"
  175. >
  176. 模版下载
  177. </el-button>
  178. <el-button
  179. type="text"
  180. size="small"
  181. :disabled="isViewMode"
  182. @click="$emit('handle-data-upload', scope.row)"
  183. >
  184. 数据上传
  185. </el-button>
  186. </template>
  187. </template>
  188. </el-table-column>
  189. </el-table>
  190. <el-pagination
  191. background
  192. layout="total, sizes, prev, pager, next"
  193. :current-page="pagination.currentPage"
  194. :page-sizes="[10, 20, 30, 50]"
  195. :page-size="pagination.pageSize"
  196. :total="pagination.total"
  197. style="margin-top: 20px; text-align: right"
  198. @current-change="$emit('handle-page-change', $event)"
  199. @size-change="$emit('handle-size-change', $event)"
  200. />
  201. </div>
  202. </template>
  203. <script>
  204. import SurveyFormDialog from './SurveyFormDialog.vue'
  205. import FixedTableDialog from './FixedTableDialog.vue'
  206. import DynamicTableDialog from './DynamicTableDialog.vue'
  207. import {
  208. getSingleRecordSurveyList,
  209. getSurveyDetail,
  210. } from '@/api/audit/survey'
  211. export default {
  212. name: 'CostSurveyTab',
  213. components: {
  214. SurveyFormDialog,
  215. FixedTableDialog,
  216. DynamicTableDialog,
  217. },
  218. props: {
  219. paginatedData: {
  220. type: Array,
  221. default: () => [],
  222. },
  223. pagination: {
  224. type: Object,
  225. default: () => ({ currentPage: 1, pageSize: 10, total: 0 }),
  226. },
  227. isViewMode: {
  228. type: Boolean,
  229. default: false,
  230. },
  231. // 被监审单位ID
  232. auditedUnitId: {
  233. type: String,
  234. default: '',
  235. },
  236. // 上传记录ID
  237. uploadId: {
  238. type: String,
  239. default: '',
  240. },
  241. // 成本调查表模板ID
  242. surveyTemplateId: {
  243. type: String,
  244. default: '',
  245. },
  246. // 目录ID
  247. catalogId: {
  248. type: String,
  249. default: '',
  250. },
  251. // 监审期间(从立项信息中获取)
  252. auditPeriod: {
  253. type: [String, Array],
  254. default: null,
  255. },
  256. },
  257. data() {
  258. return {
  259. surveyFormDialogVisible: false,
  260. fixedTableDialogVisible: false,
  261. dynamicTableDialogVisible: false,
  262. currentSurveyRow: null,
  263. // 表单字段配置(可以从后台获取,或通过 props 传入)
  264. formFields: [],
  265. // 表单详情数据(用于回显)
  266. surveyDetailData: {},
  267. // 固定表数据配置
  268. tableItems: [],
  269. // 监审期间(年份数组)
  270. auditPeriods: [],
  271. // 动态表数据
  272. dynamicTableData: [],
  273. }
  274. },
  275. mounted() {
  276. // 表单字段配置在打开弹窗时动态加载,不需要在 mounted 中初始化
  277. },
  278. methods: {
  279. // 处理在线填报点击
  280. async handleOnlineFillClick(row) {
  281. this.currentSurveyRow = row
  282. // 重置详情数据
  283. this.surveyDetailData = {}
  284. // 如果表格类型是"单记录",弹出调查表填报弹窗
  285. if (row.tableType === '单记录') {
  286. // 如果该行有 id,先调用接口获取详情数据
  287. if (row.id && this.auditedUnitId) {
  288. try {
  289. const params = {
  290. uploadId: row.id,
  291. auditedUnitId: this.auditedUnitId,
  292. }
  293. const res = await getSurveyDetail(params)
  294. console.log('单记录详情数据', res)
  295. if (res && res.code === 200 && res.value) {
  296. // 将详情数据转换为表单数据格式
  297. // 接口返回的数据可能是数组格式 [{rowid: 'xxx', rkey: 'xxx', rvalue: 'xxx'}, ...]
  298. // 需要转换为 {rowid: 'rvalue', ...} 的格式
  299. const detailData = {}
  300. if (Array.isArray(res.value)) {
  301. res.value.forEach((item) => {
  302. if (item.rowid && item.rvalue !== undefined) {
  303. detailData[item.rowid] = item.rvalue
  304. }
  305. })
  306. } else if (res.value) {
  307. // 如果不是数组,可能是对象格式,直接使用
  308. Object.assign(detailData, res.value)
  309. }
  310. this.surveyDetailData = detailData
  311. console.log('转换后的详情数据', this.surveyDetailData)
  312. }
  313. } catch (err) {
  314. console.error('获取单记录详情失败', err)
  315. }
  316. }
  317. // 调用接口获取单记录表单字段配置(详情数据已准备好)
  318. await this.initFormFields()
  319. // 接口调用完成后会自动打开弹窗(在 initFormFields 中处理)
  320. } else if (row.tableType === '固定表') {
  321. // 如果表格类型是"固定表",弹出固定表填报弹窗
  322. // 调用接口获取固定表配置
  323. await this.initFixedTableData()
  324. // 接口调用完成后会自动打开弹窗(在 initFixedTableData 中处理)
  325. } else if (row.tableType === '动态表') {
  326. // 如果表格类型是"动态表",弹出动态表填报弹窗
  327. this.initDynamicTableData()
  328. this.dynamicTableDialogVisible = true
  329. } else {
  330. // 其他类型,触发原有事件
  331. this.$emit('handle-online-fill', row)
  332. }
  333. },
  334. // 处理调查表保存
  335. handleSurveyFormSave(formData) {
  336. // 可以将保存的数据传递给父组件
  337. this.$emit('handle-survey-form-save', {
  338. row: this.currentSurveyRow,
  339. formData: formData,
  340. })
  341. },
  342. // 处理刷新事件
  343. handleRefresh() {
  344. // 触发父组件的刷新事件
  345. this.$emit('handle-survey-form-save', {
  346. row: this.currentSurveyRow,
  347. formData: {},
  348. })
  349. },
  350. // 处理固定表保存
  351. handleFixedTableSave(tableData) {
  352. // 可以将保存的数据传递给父组件
  353. this.$emit('handle-fixed-table-save', {
  354. row: this.currentSurveyRow,
  355. tableData: tableData,
  356. })
  357. },
  358. // 处理动态表保存
  359. handleDynamicTableSave(tableData) {
  360. // 可以将保存的数据传递给父组件
  361. this.$emit('handle-dynamic-table-save', {
  362. row: this.currentSurveyRow,
  363. tableData: tableData,
  364. })
  365. },
  366. // 初始化动态表数据
  367. initDynamicTableData() {
  368. // 如果当前行有动态表数据,则使用
  369. if (this.currentSurveyRow && this.currentSurveyRow.dynamicTableData) {
  370. this.dynamicTableData = this.currentSurveyRow.dynamicTableData
  371. } else {
  372. // 使用空数组,组件内部会使用假数据
  373. this.dynamicTableData = []
  374. }
  375. // 初始化表格项配置(用于详情/编辑时显示表单)
  376. if (this.currentSurveyRow && this.currentSurveyRow.tableItems) {
  377. this.tableItems = this.currentSurveyRow.tableItems
  378. } else {
  379. // 使用固定表的假数据配置
  380. this.tableItems = this.getMockTableItems()
  381. }
  382. },
  383. // 初始化表单字段配置
  384. async initFormFields() {
  385. // 如果是单记录类型,调用接口获取表单字段配置
  386. if (
  387. this.currentSurveyRow &&
  388. this.currentSurveyRow.tableType === '单记录' &&
  389. this.currentSurveyRow.surveyTemplateId
  390. ) {
  391. try {
  392. const params = {
  393. surveyTemplateId: this.currentSurveyRow.surveyTemplateId,
  394. }
  395. const res = await getSingleRecordSurveyList(params)
  396. console.log('单记录表单字段配置', res)
  397. if (res && res.code === 200 && res.value) {
  398. // 将接口返回的数据转换为表单字段配置格式
  399. const { fixedFields, fixedFieldids } = res.value
  400. if (fixedFields && fixedFieldids) {
  401. // 将 fixedFields 和 fixedFieldids 按逗号分割
  402. const labels = fixedFields.split(',').map((item) => item.trim())
  403. const ids = fixedFieldids.split(',').map((item) => item.trim())
  404. console.log('labels', labels)
  405. console.log('ids', ids)
  406. // 组合成表单字段配置数组
  407. this.formFields = labels.map((label, index) => ({
  408. prop: ids[index] || `field_${index}`, // 使用 fixedFieldids 作为 prop
  409. label: label, // 使用 fixedFields 作为 label
  410. type: 'input', // 默认类型为 input
  411. colSpan: 12, // 默认占一半宽度
  412. placeholder: `请输入${label}`,
  413. rules: [],
  414. defaultValue: '',
  415. disabled: false,
  416. clearable: true,
  417. multiple: false,
  418. required: false,
  419. }))
  420. } else {
  421. // 如果没有 fixedFields 和 fixedFieldids,使用默认配置
  422. this.formFields = this.getMockFormFields()
  423. }
  424. } else {
  425. // 接口返回失败,使用默认配置
  426. this.formFields = this.getMockFormFields()
  427. }
  428. // 打开弹窗
  429. this.surveyFormDialogVisible = true
  430. } catch (err) {
  431. console.error('获取单记录表单字段配置失败', err)
  432. // 出错时使用默认配置
  433. this.formFields = this.getMockFormFields()
  434. this.surveyFormDialogVisible = true
  435. }
  436. } else if (this.currentSurveyRow && this.currentSurveyRow.formFields) {
  437. // 如果当前行有表单配置,则使用
  438. this.formFields = this.currentSurveyRow.formFields
  439. this.surveyFormDialogVisible = true
  440. } else {
  441. // 使用假数据作为测试(实际开发中应该从后台获取)
  442. this.formFields = this.getMockFormFields()
  443. this.surveyFormDialogVisible = true
  444. }
  445. },
  446. // 获取假数据表单字段配置(用于测试)
  447. getMockFormFields() {
  448. return [
  449. {
  450. prop: 'institutionName',
  451. label: '机构名称',
  452. type: 'input',
  453. colSpan: 12,
  454. defaultValue: '幼儿园基本情况',
  455. placeholder: '请输入机构名称',
  456. required: true,
  457. },
  458. {
  459. prop: 'institutionNature',
  460. label: '机构性质',
  461. type: 'select',
  462. colSpan: 12,
  463. dictType: 'institutionNature', // 字典类型
  464. defaultValue: '公办',
  465. placeholder: '请选择机构性质',
  466. required: true,
  467. clearable: true,
  468. },
  469. {
  470. prop: 'institutionLevel',
  471. label: '机构评定等级',
  472. type: 'select',
  473. colSpan: 12,
  474. dictType: 'institutionLevel', // 字典类型
  475. defaultValue: '省一级',
  476. placeholder: '请选择机构评定等级',
  477. required: true,
  478. clearable: true,
  479. },
  480. {
  481. prop: 'educationMode',
  482. label: '机构办学方式',
  483. type: 'select',
  484. colSpan: 12,
  485. dictType: 'educationMode', // 字典类型
  486. defaultValue: '全日制',
  487. placeholder: '请选择机构办学方式',
  488. required: true,
  489. clearable: true,
  490. },
  491. {
  492. prop: 'institutionAddress',
  493. label: '机构地址',
  494. type: 'input',
  495. colSpan: 12,
  496. placeholder: '请输入机构地址',
  497. required: true,
  498. },
  499. {
  500. prop: 'formFiller',
  501. label: '机构填表人',
  502. type: 'input',
  503. colSpan: 12,
  504. placeholder: '请输入机构填表人',
  505. required: true,
  506. },
  507. {
  508. prop: 'financialManager',
  509. label: '机构财务负责人',
  510. type: 'input',
  511. colSpan: 12,
  512. placeholder: '请输入机构财务负责人',
  513. required: true,
  514. },
  515. {
  516. prop: 'contactPhone',
  517. label: '机构联系电话',
  518. type: 'input',
  519. colSpan: 12,
  520. placeholder: '请输入机构联系电话',
  521. required: true,
  522. rules: [
  523. {
  524. required: true,
  525. message: '请输入机构联系电话',
  526. trigger: 'blur',
  527. },
  528. {
  529. pattern: /^1[3-9]\d{9}$/,
  530. message: '请输入正确的手机号码',
  531. trigger: 'blur',
  532. },
  533. ],
  534. },
  535. ]
  536. },
  537. // 初始化固定表数据
  538. async initFixedTableData() {
  539. // 如果是固定表类型,调用接口获取固定表配置
  540. if (
  541. this.currentSurveyRow &&
  542. this.currentSurveyRow.tableType === '固定表' &&
  543. this.currentSurveyRow.surveyTemplateId
  544. ) {
  545. try {
  546. const params = {
  547. surveyTemplateId: this.currentSurveyRow.surveyTemplateId,
  548. }
  549. const res = await getSingleRecordSurveyList(params)
  550. console.log('固定表配置数据', res)
  551. if (res && res.code === 200 && res.value) {
  552. // 将接口返回的数据转换为固定表配置格式
  553. // 固定表使用 itemlist,不使用 fixedFields 和 fixedFieldids
  554. const { itemlist } = res.value
  555. console.log('itemlist', itemlist)
  556. // 如果有 itemlist,使用 itemlist 作为表格项配置
  557. if (itemlist && Array.isArray(itemlist) && itemlist.length > 0) {
  558. this.tableItems = itemlist.map((item, index) => ({
  559. id: item.id || item.itemId || '',
  560. rowid: item.rowid || item.id || item.itemId || '', // rowid 用于父子关系
  561. seq: item.序号, // 序号就是序号
  562. itemName: item.项目 || '', // 项目就是项目
  563. unit: item.unit || '', // 单位是 unit
  564. isCategory: item.isCategory || false,
  565. categorySeq: item.categorySeq || '',
  566. categoryId: item.categoryId || '',
  567. parentid:
  568. item.parentid !== undefined
  569. ? item.parentid
  570. : item.parentId !== undefined
  571. ? item.parentId
  572. : '-1', // 父项ID,默认为 '-1'(父项)
  573. validateRules: item.validateRules || {},
  574. linkageRules: item.linkageRules || {},
  575. children: item.children || [],
  576. ...item, // 保留其他字段
  577. }))
  578. } else {
  579. // 如果没有 itemlist,使用假数据
  580. this.tableItems = this.getMockTableItems()
  581. }
  582. } else {
  583. // 接口返回失败,使用默认配置
  584. this.tableItems = this.getMockTableItems()
  585. }
  586. } catch (err) {
  587. console.error('获取固定表配置失败', err)
  588. // 出错时使用默认配置
  589. this.tableItems = this.getMockTableItems()
  590. }
  591. } else if (this.currentSurveyRow && this.currentSurveyRow.tableItems) {
  592. // 如果当前行有表格配置,则使用
  593. this.tableItems = this.currentSurveyRow.tableItems
  594. } else {
  595. // 使用假数据作为测试(实际开发中应该从后台获取)
  596. this.tableItems = this.getMockTableItems()
  597. }
  598. // 初始化监审期间(从立项信息中获取)
  599. if (this.auditPeriod) {
  600. // 如果传入了监审期间,使用传入的值
  601. if (Array.isArray(this.auditPeriod)) {
  602. this.auditPeriods = this.auditPeriod.map((p) => String(p))
  603. } else {
  604. this.auditPeriods = this.parseAuditPeriod(this.auditPeriod)
  605. }
  606. } else if (this.currentSurveyRow && this.currentSurveyRow.auditPeriod) {
  607. // 如果当前行有监审期间,使用当前行的
  608. this.auditPeriods = this.parseAuditPeriod(
  609. this.currentSurveyRow.auditPeriod
  610. )
  611. } else {
  612. // 默认使用最近3年
  613. const currentYear = new Date().getFullYear()
  614. this.auditPeriods = [
  615. String(currentYear - 2),
  616. String(currentYear - 1),
  617. String(currentYear),
  618. ]
  619. }
  620. // 打开弹窗
  621. this.fixedTableDialogVisible = true
  622. },
  623. // 解析监审期间字符串(如 "2022,2023,2024" 或 "2022-2024")
  624. parseAuditPeriod(periodStr) {
  625. if (!periodStr) return []
  626. if (periodStr.includes(',')) {
  627. return periodStr.split(',').map((p) => p.trim())
  628. }
  629. if (periodStr.includes('-')) {
  630. const parts = periodStr.split('-')
  631. if (parts.length === 2) {
  632. const start = parseInt(parts[0].trim())
  633. const end = parseInt(parts[1].trim())
  634. const years = []
  635. for (let year = start; year <= end; year++) {
  636. years.push(String(year))
  637. }
  638. return years
  639. }
  640. }
  641. return [String(periodStr)]
  642. },
  643. // 获取假数据表格配置(用于测试)
  644. getMockTableItems() {
  645. return [
  646. {
  647. id: '1',
  648. itemName: '班级数',
  649. unit: '个',
  650. isCategory: false,
  651. seq: 1,
  652. validateRules: {
  653. required: true,
  654. type: 'number',
  655. min: 0,
  656. },
  657. },
  658. {
  659. id: '2',
  660. itemName: '幼儿学生人数',
  661. unit: '人',
  662. isCategory: false,
  663. seq: 2,
  664. validateRules: {
  665. required: true,
  666. type: 'number',
  667. min: 0,
  668. },
  669. },
  670. {
  671. id: 'III',
  672. itemName: '在取做保职工总人数',
  673. unit: '人',
  674. isCategory: true,
  675. categorySeq: 'III',
  676. children: [
  677. {
  678. id: '3-1',
  679. itemName: '行政管理人员数',
  680. unit: '人',
  681. isCategory: false,
  682. categoryId: 'III',
  683. seq: 3,
  684. validateRules: {
  685. required: true,
  686. type: 'number',
  687. min: 0,
  688. },
  689. linkageRules: {
  690. parent: 'III',
  691. relation: 'sum',
  692. },
  693. },
  694. {
  695. id: '3-2',
  696. itemName: '教师人数',
  697. unit: '人',
  698. isCategory: false,
  699. categoryId: 'III',
  700. seq: 4,
  701. validateRules: {
  702. required: true,
  703. type: 'number',
  704. min: 0,
  705. },
  706. linkageRules: {
  707. parent: 'III',
  708. relation: 'sum',
  709. },
  710. },
  711. {
  712. id: '3-3',
  713. itemName: '保育员人数',
  714. unit: '人',
  715. isCategory: false,
  716. categoryId: 'III',
  717. seq: 5,
  718. validateRules: {
  719. required: true,
  720. type: 'number',
  721. min: 0,
  722. },
  723. linkageRules: {
  724. parent: 'III',
  725. relation: 'sum',
  726. },
  727. },
  728. {
  729. id: '3-4',
  730. itemName: '医务人员',
  731. unit: '人',
  732. isCategory: false,
  733. categoryId: 'III',
  734. seq: 6,
  735. validateRules: {
  736. required: true,
  737. type: 'number',
  738. min: 0,
  739. },
  740. linkageRules: {
  741. parent: 'III',
  742. relation: 'sum',
  743. },
  744. },
  745. {
  746. id: '3-5',
  747. itemName: '工勤人员',
  748. unit: '人',
  749. isCategory: false,
  750. categoryId: 'III',
  751. seq: 7,
  752. validateRules: {
  753. required: true,
  754. type: 'number',
  755. min: 0,
  756. },
  757. linkageRules: {
  758. parent: 'III',
  759. relation: 'sum',
  760. },
  761. children: [
  762. {
  763. id: '3-5-1',
  764. itemName: '炊事员',
  765. unit: '人',
  766. isCategory: false,
  767. categoryId: '3-5',
  768. seq: 8,
  769. validateRules: {
  770. required: true,
  771. type: 'number',
  772. min: 0,
  773. },
  774. linkageRules: {
  775. parent: '3-5',
  776. relation: 'sum',
  777. },
  778. },
  779. {
  780. id: '3-5-2',
  781. itemName: '司机',
  782. unit: '人',
  783. isCategory: false,
  784. categoryId: '3-5',
  785. seq: 9,
  786. validateRules: {
  787. required: true,
  788. type: 'number',
  789. min: 0,
  790. },
  791. linkageRules: {
  792. parent: '3-5',
  793. relation: 'sum',
  794. },
  795. },
  796. {
  797. id: '3-5-3',
  798. itemName: '清洁工',
  799. unit: '人',
  800. isCategory: false,
  801. categoryId: '3-5',
  802. seq: 10,
  803. validateRules: {
  804. required: true,
  805. type: 'number',
  806. min: 0,
  807. },
  808. linkageRules: {
  809. parent: '3-5',
  810. relation: 'sum',
  811. },
  812. },
  813. ],
  814. },
  815. {
  816. id: '3-6',
  817. itemName: '其他人员',
  818. unit: '人',
  819. isCategory: false,
  820. categoryId: 'III',
  821. seq: 11,
  822. validateRules: {
  823. required: true,
  824. type: 'number',
  825. min: 0,
  826. },
  827. linkageRules: {
  828. parent: 'III',
  829. relation: 'sum',
  830. },
  831. },
  832. ],
  833. },
  834. ]
  835. },
  836. },
  837. }
  838. </script>