submitData.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. <template>
  2. <div class="audit-review">
  3. <div
  4. v-for="category in materialCategories"
  5. :key="category.type"
  6. class="material-category"
  7. >
  8. <h3 class="category-title">{{ category.typeName }}</h3>
  9. <el-table
  10. v-loading="loading"
  11. :data="category.items"
  12. stripe
  13. style="width: 100%"
  14. >
  15. <el-table-column
  16. prop="orderNum"
  17. label="序号"
  18. width="80"
  19. align="center"
  20. />
  21. <el-table-column
  22. prop="informationName"
  23. label="报送资料"
  24. min-width="200"
  25. header-align="center"
  26. align="left"
  27. />
  28. <el-table-column label="资料类型" width="200" align="center">
  29. <template slot-scope="scope">
  30. <span
  31. v-if="
  32. Number(scope.row.formatRequired) === 3 && scope.row.templateId
  33. "
  34. style="cursor: pointer"
  35. :title="'点击查看模板'"
  36. >
  37. {{ `预置模板(${getTemplateTypeName(scope.row.templateType)})` }}
  38. </span>
  39. <span v-else>
  40. {{ getFormatType(scope.row.formatRequired) }}
  41. </span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="是否必项" width="100" align="center">
  45. <template slot-scope="scope">
  46. {{ scope.row.isRequired === '1' ? '是' : '否' }}
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="是否上传" width="100" align="center">
  50. <template slot-scope="scope">
  51. <span
  52. :style="{
  53. color: scope.row.isUpload === '1' ? '#67C23A' : '#F56C6C',
  54. }"
  55. >
  56. {{ scope.row.isUpload === '1' ? '已上传' : '未上传' }}
  57. </span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column
  61. prop="uploadTime"
  62. label="上传时间"
  63. width="150"
  64. align="center"
  65. >
  66. <template slot-scope="scope">
  67. {{ scope.row.uploadTime ? scope.row.uploadTime : '--' }}
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="初审结果" width="100" align="center">
  71. <template slot-scope="scope">
  72. <span
  73. :class="{
  74. 'result-pending':
  75. !scope.row.auditedStatus || scope.row.auditedStatus === '0',
  76. 'result-pass': scope.row.auditedStatus === '1',
  77. 'result-fail': scope.row.auditedStatus === '2',
  78. }"
  79. >
  80. {{
  81. !scope.row.auditedStatus || scope.row.auditedStatus === '0'
  82. ? '未审核'
  83. : scope.row.auditedStatus === '1'
  84. ? '通过'
  85. : '不通过'
  86. }}
  87. </span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="操作" width="200" align="center">
  91. <template slot-scope="scope">
  92. <el-button
  93. v-if="
  94. (scope.row.auditedStatus === '0' &&
  95. (currentStatus === 200 || currentStatus === '200') &&
  96. (currentNode === 'clcs' || currentNode === 'sdsh')) ||
  97. (scope.row.taskNode === 'jtsy' &&
  98. scope.row.auditedStatus === '0')
  99. "
  100. type="text"
  101. size="small"
  102. @click="handleAuditMaterial(scope.row)"
  103. >
  104. 审核
  105. </el-button>
  106. <el-button
  107. type="text"
  108. size="small"
  109. @click="handleViewDownload(scope.row)"
  110. >
  111. 查看
  112. </el-button>
  113. </template>
  114. </el-table-column>
  115. </el-table>
  116. </div>
  117. <!-- 资料审核弹窗 -->
  118. <el-dialog
  119. title="资料审核"
  120. :visible.sync="showAuditDialog"
  121. width="400px"
  122. center
  123. :modal="false"
  124. append-to-body
  125. >
  126. <div class="audit-material-info">
  127. <p>
  128. <strong>资料名称:</strong>
  129. {{
  130. (currentAuditMaterial && currentAuditMaterial.informationName) || ''
  131. }}
  132. </p>
  133. </div>
  134. <el-form ref="auditForm" :model="auditForm" label-width="80px">
  135. <el-form-item label="审核结果" prop="auditedStatus">
  136. <el-radio-group v-model="auditForm.auditedStatus">
  137. <el-radio label="1">审核通过</el-radio>
  138. <el-radio label="2">不通过</el-radio>
  139. </el-radio-group>
  140. </el-form-item>
  141. </el-form>
  142. <div slot="footer" class="dialog-footer">
  143. <el-button @click="showAuditDialog = false">取消</el-button>
  144. <el-button type="primary" @click="handleAuditSubmit">提交</el-button>
  145. </div>
  146. </el-dialog>
  147. <survey-form-dialog
  148. :visible.sync="singleDialogVisible"
  149. :survey-data="{ ...(currentTemplateRow || {}), ...surveyDetailData }"
  150. :is-view-mode="true"
  151. :request-type="2"
  152. :audited-unit-id="
  153. auditedUnitId ||
  154. (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
  155. ''
  156. "
  157. :upload-id="
  158. (currentTemplateRow &&
  159. (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
  160. ''
  161. "
  162. :survey-template-id="
  163. (currentTemplateRow &&
  164. (currentTemplateRow.templateId ||
  165. currentTemplateRow.surveyTemplateId)) ||
  166. ''
  167. "
  168. :catalog-id="
  169. catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
  170. "
  171. />
  172. <fixed-table-dialog
  173. :visible.sync="fixedDialogVisible"
  174. :is-view-mode="true"
  175. :request-type="2"
  176. :project-id="projectId"
  177. :audited-unit-id="
  178. auditedUnitId ||
  179. (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
  180. ''
  181. "
  182. :upload-id="
  183. (currentTemplateRow &&
  184. (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
  185. ''
  186. "
  187. :survey-template-id="
  188. (currentTemplateRow &&
  189. (currentTemplateRow.templateId ||
  190. currentTemplateRow.surveyTemplateId)) ||
  191. ''
  192. "
  193. :catalog-id="
  194. catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
  195. "
  196. :project-audit-periods="projectAuditPeriods"
  197. :project-audit-period="projectAuditPeriod"
  198. :audit-periods="auditPeriods"
  199. :fixed-fields="fixedFields || ''"
  200. :fixed-fieldids="fixedFieldids || ''"
  201. :table-items="tableItems"
  202. />
  203. <dynamic-table-dialog
  204. :visible.sync="dynamicDialogVisible"
  205. :is-view-mode="true"
  206. :request-type="2"
  207. :audited-unit-id="
  208. auditedUnitId ||
  209. (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
  210. ''
  211. "
  212. :upload-id="
  213. (currentTemplateRow &&
  214. (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
  215. ''
  216. "
  217. :survey-template-id="
  218. (currentTemplateRow &&
  219. (currentTemplateRow.templateId ||
  220. currentTemplateRow.surveyTemplateId)) ||
  221. ''
  222. "
  223. :catalog-id="
  224. catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
  225. "
  226. :table-data="dynamicTableData"
  227. :table-items="tableItems"
  228. />
  229. </div>
  230. </template>
  231. <style scoped>
  232. .result-pending {
  233. color: #909399;
  234. }
  235. .result-pass {
  236. color: #67c23a;
  237. }
  238. .result-fail {
  239. color: #f56c6c;
  240. }
  241. </style>
  242. <script>
  243. import {
  244. getTaskRequirementList,
  245. addOrUpdateTaskRequirement,
  246. } from '@/api/audit/auditIndex'
  247. import {
  248. getDataPreliminaryReviewButton,
  249. doProcessBtn,
  250. } from '@/api/dataPreliminaryReview'
  251. import SurveyFormDialog from '@/views/EntDeclaration/auditTaskManagement/components/SurveyFormDialog.vue'
  252. import FixedTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/FixedTableDialog.vue'
  253. import DynamicTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/DynamicTableDialog.vue'
  254. import { getSingleRecordSurveyList } from '@/api/audit/survey'
  255. import { getDynamicTableData } from '@/api/audit/survey'
  256. import { getProjectInformationInfo } from '@/api/auditTaskProcessing'
  257. import { getSurveyDetail } from '@/api/audit/survey'
  258. export default {
  259. name: 'AuditReview',
  260. components: {
  261. SurveyFormDialog,
  262. FixedTableDialog,
  263. DynamicTableDialog,
  264. },
  265. props: {
  266. id: {
  267. type: [String, Number],
  268. default: null,
  269. },
  270. currentNode: {
  271. type: String,
  272. default: '',
  273. },
  274. currentStatus: {
  275. type: String,
  276. default: '',
  277. },
  278. materials: {
  279. type: Array,
  280. default: () => [],
  281. },
  282. auditedUnitId: {
  283. type: [String, Number],
  284. default: '',
  285. },
  286. catalogId: {
  287. type: [String, Number],
  288. default: '',
  289. },
  290. // 任务ID,用于在缺少 uploadId 时回退查询详情
  291. taskId: {
  292. type: [String, Number],
  293. default: '',
  294. },
  295. // 立项信息ID(用于获取监审期间)
  296. projectId: {
  297. type: [String, Number],
  298. default: '',
  299. },
  300. },
  301. data() {
  302. return {
  303. buttonData: [], //资料初审按钮数据
  304. activeTab: 'materials', // 当前激活的标签页
  305. showRejectDialog: false, // 初审退回弹窗显示状态
  306. showAbortDialog: false, // 中止监审弹窗显示状态
  307. loading: false, // 加载状态
  308. // 初审退回表单数据
  309. rejectForm: {
  310. opinion: '在初审阶段,需补充完善相关材料。',
  311. sendMethods: ['站内消息', '短信通知'],
  312. },
  313. // 中止监审表单数据
  314. abortForm: {
  315. opinion:
  316. '在初审阶段,该企业资料不符合审查要求,中止该单位成本监审资格。',
  317. sendMethods: ['站内消息', '短信通知'],
  318. },
  319. // 资料审核弹窗状态
  320. showAuditDialog: false,
  321. // 当前审核的资料
  322. currentAuditMaterial: null,
  323. // 模板查看相关
  324. currentTemplateRow: null,
  325. singleDialogVisible: false,
  326. fixedDialogVisible: false,
  327. dynamicDialogVisible: false,
  328. // 固定表/动态表所需的配置与数据(用于弹窗透传)
  329. fixedFields: '',
  330. fixedFieldids: '',
  331. tableItems: [],
  332. dynamicTableData: [],
  333. // 立项信息监审期间
  334. projectAuditPeriods: [],
  335. projectAuditPeriod: '',
  336. auditPeriods: [],
  337. // 详情回显数据(供单记录弹窗 survey-data 绑定使用)
  338. surveyDetailData: {},
  339. // 资料审核表单数据
  340. auditForm: {
  341. auditedStatus: '通过', // 默认审核通过
  342. },
  343. // 报送资料表格数据
  344. materialData: [],
  345. // 按类型分组的材料数据
  346. materialCategories: [],
  347. }
  348. },
  349. watch: {
  350. activeTab(newTab) {
  351. if (newTab === 'costSurvey') {
  352. this.loadCostSurveyData()
  353. }
  354. },
  355. materials: {
  356. handler(newList) {
  357. if (Array.isArray(newList) && newList.length > 0) {
  358. this.materialData = newList
  359. this.processMaterialData()
  360. }
  361. },
  362. deep: true,
  363. immediate: true,
  364. },
  365. },
  366. created() {
  367. if (Array.isArray(this.materials) && this.materials.length > 0) {
  368. this.materialData = this.materials
  369. this.processMaterialData()
  370. } else {
  371. this.loadMaterialData()
  372. }
  373. },
  374. mounted() {
  375. console.log(this.currentNode, '123')
  376. console.log(this.currentStatus, '222')
  377. },
  378. methods: {
  379. // 加载报送资料数据
  380. async loadMaterialData() {
  381. try {
  382. this.loading = true
  383. const response = await getTaskRequirementList(this.id)
  384. console.log('接口返回数据:', response)
  385. // 尝试多种可能的数据结构
  386. this.materialData = response.value || response.data || response || []
  387. // 确保 materialData 是数组
  388. if (!Array.isArray(this.materialData)) {
  389. this.materialData = []
  390. }
  391. this.processMaterialData()
  392. } catch (error) {
  393. console.error('获取报送资料数据失败:', error)
  394. // this.$message.error('获取报送资料数据失败')
  395. } finally {
  396. this.loading = false
  397. }
  398. },
  399. // 处理材料数据按类型分组
  400. processMaterialData() {
  401. // 确保 materialData 存在且为数组
  402. if (!this.materialData || !Array.isArray(this.materialData)) {
  403. this.materialCategories = []
  404. return
  405. }
  406. const typeMap = {
  407. 1: '综合性资料',
  408. 2: '财务会计资料',
  409. 3: '其他资料',
  410. }
  411. const groupedData = {}
  412. this.materialData.forEach((item) => {
  413. const type = item.informationType
  414. if (!groupedData[type]) {
  415. groupedData[type] = {
  416. type: type,
  417. typeName: typeMap[type] || '其他资料',
  418. items: [],
  419. }
  420. }
  421. groupedData[type].items.push(item)
  422. })
  423. // 按指定顺序排列并为每个分类下的材料重新分配序号
  424. this.materialCategories = []
  425. ;['1', '2', '3'].forEach((type) => {
  426. if (groupedData[type]) {
  427. // 为当前分类下的材料重新分配序号,从1开始递增
  428. groupedData[type].items.forEach((item, index) => {
  429. item.orderNum = index + 1
  430. })
  431. this.materialCategories.push(groupedData[type])
  432. }
  433. })
  434. },
  435. // 获取格式类型
  436. getFormatType(formatRequired) {
  437. const map = {
  438. 1: '文档文件',
  439. 2: 'excel',
  440. 3: '预置模板',
  441. }
  442. const k = Number(formatRequired)
  443. return map[k] || '文档文件'
  444. },
  445. getTemplateTypeName(t) {
  446. const map = {
  447. 1: '单记录',
  448. 2: '固定表',
  449. 3: '动态表',
  450. }
  451. const k = String(t || '').trim()
  452. return map[k] || map[Number(k)] || ''
  453. },
  454. // 资料初审按钮点击事件
  455. handleAuditPass(row) {
  456. this.$confirm(`确定要${row.value}吗?`, '提示', {
  457. confirmButtonText: '确定',
  458. cancelButtonText: '取消',
  459. type: 'warning',
  460. })
  461. .then(() => {
  462. // 这里可以添加初审通过的API调用逻辑
  463. doProcessBtn({
  464. taskId: this.id,
  465. key: row.key,
  466. })
  467. .then((res) => {
  468. console.log('接口返回数据:', res)
  469. if (res.code === 200 && res.value) {
  470. this.$message({ type: 'success', message: res.value })
  471. } else {
  472. this.$message({ type: 'error', message: res.message })
  473. }
  474. })
  475. .catch((err) => {
  476. this.$message({ type: 'error', message: err.message })
  477. })
  478. })
  479. .catch(() => {
  480. this.$message({ type: 'info', message: '已取消操作' })
  481. })
  482. },
  483. // 查看下载文件
  484. handleViewDownload(row) {
  485. // this.$message.info(`查看下载文件:${row.name}`)
  486. // 这里可以添加查看下载文件的逻辑
  487. if (row.fileUrl !== null) {
  488. this.handleFileView(row)
  489. } else {
  490. this.handleViewTemplate(row)
  491. }
  492. },
  493. handleFileView(row) {
  494. console.log(row, '这一行数据')
  495. try {
  496. const filePath =
  497. row?.filePath ||
  498. row?.filepath ||
  499. row?.fileUrl ||
  500. row?.url ||
  501. row?.path ||
  502. ''
  503. if (!filePath) {
  504. this.$message &&
  505. this.$message.warning &&
  506. this.$message.warning('未找到可预览的文件路径')
  507. return
  508. }
  509. const encodedUrl = encodeURIComponent(
  510. Base64.encode((window.context && window.context.form) + filePath)
  511. )
  512. window.open(`${host}:8012/onlinePreview?url=${encodedUrl}`)
  513. // 兼容保留:通知父组件
  514. this.$emit('handleFileView', row)
  515. } catch (e) {
  516. console.error('文件预览失败: ', e)
  517. // this.$message &&
  518. // this.$message.error &&
  519. // this.$message.error('文件预览失败')
  520. }
  521. },
  522. // 查看预置模板,按模板类型打开不同弹窗
  523. async handleViewTemplate(row) {
  524. this.currentTemplateRow = row || null
  525. const t = String(
  526. (row && (row.templateType || row.templatetype)) || ''
  527. ).trim()
  528. if (t === '1') {
  529. // 单记录:清理并预取详情(type=2),与 costSurvey 实现保持一致的回显逻辑
  530. this.surveyDetailData = {}
  531. await this.loadSingleRecordDetail()
  532. this.singleDialogVisible = true
  533. } else if (t === '2') {
  534. // 与 components 版本一致:先拉取固定表表头与项配置
  535. const surveyTemplateId =
  536. (row && (row.surveyTemplateId || row.templateId)) || ''
  537. Promise.all([
  538. this.initFixedTableData(surveyTemplateId),
  539. this.fetchProjectAuditPeriods(),
  540. ]).then(() => {
  541. this.fixedDialogVisible = true
  542. })
  543. } else if (t === '3') {
  544. await this.initDynamicTableData()
  545. this.dynamicDialogVisible = true
  546. } else {
  547. this.$message.warning('未知的模板类型,无法打开预置模板')
  548. }
  549. },
  550. // 预取动态表数据(type=2),与 costSurvey 一致的参数拼装,但本页使用 type=2
  551. async initDynamicTableData() {
  552. this.dynamicTableData = []
  553. const row = this.currentTemplateRow || {}
  554. const uploadId = row.uploadId || row.id || ''
  555. const auditedUnitId = row.auditedUnitId || this.auditedUnitId || ''
  556. const catalogId = row.catalogId || this.catalogId || ''
  557. const surveyTemplateId = row.templateId || row.surveyTemplateId || ''
  558. if (!uploadId) return
  559. try {
  560. const params = {
  561. uploadId,
  562. ...(auditedUnitId ? { auditedUnitId } : {}),
  563. catalogId,
  564. surveyTemplateId,
  565. type: 2,
  566. }
  567. const res = await getDynamicTableData(params)
  568. if (res && res.code === 200) {
  569. const records =
  570. (res.value && (res.value.records || res.value)) || []
  571. this.dynamicTableData = Array.isArray(records) ? records : []
  572. }
  573. } catch (e) {
  574. this.dynamicTableData = []
  575. }
  576. },
  577. // 获取立项信息监审期间,供固定表年份优先回显
  578. async fetchProjectAuditPeriods() {
  579. try {
  580. this.projectAuditPeriods = []
  581. this.projectAuditPeriod = ''
  582. const pid = this.projectId
  583. if (!pid) return
  584. const res = await getProjectInformationInfo(pid)
  585. const periodStr =
  586. (res &&
  587. res.value &&
  588. (res.value.auditPeriod || res.value.auditperiod)) ||
  589. ''
  590. if (typeof periodStr === 'string' && periodStr.trim()) {
  591. const arr = periodStr
  592. .split(',')
  593. .map((y) => String(y).trim())
  594. .filter((y) => /^(19|20)\d{2}$/.test(y))
  595. this.projectAuditPeriods = arr
  596. this.projectAuditPeriod = arr.join(',')
  597. }
  598. } catch (e) {
  599. console.error('获取立项信息监审期间失败', e)
  600. this.projectAuditPeriods = []
  601. this.projectAuditPeriod = ''
  602. }
  603. },
  604. // 预取单记录详情(type=2),将数组结果映射为 { rowid: rvalue } 的对象,供弹窗回显
  605. async loadSingleRecordDetail() {
  606. this.surveyDetailData = {}
  607. const row = this.currentTemplateRow || {}
  608. const uploadId = row.uploadId || row.id || ''
  609. const auditedUnitId = row.auditedUnitId || this.auditedUnitId || ''
  610. const hasUpload = Boolean(uploadId)
  611. const hasTask = Boolean(this.taskId)
  612. if (!hasUpload && !hasTask) return
  613. try {
  614. const params = hasUpload
  615. ? { uploadId, type: 2, ...(auditedUnitId ? { auditedUnitId } : {}) }
  616. : { taskId: this.taskId, type: 2 }
  617. const res = await getSurveyDetail(params)
  618. if (res && res.code === 200 && res.value) {
  619. const detail = {}
  620. const val = res.value
  621. if (Array.isArray(val)) {
  622. val.forEach((item) => {
  623. if (!item || typeof item !== 'object') return
  624. const key =
  625. item.rowid !== undefined
  626. ? item.rowid
  627. : item.rowId !== undefined
  628. ? item.rowId
  629. : item.id !== undefined
  630. ? item.id
  631. : undefined
  632. const value =
  633. item.rvalue !== undefined
  634. ? item.rvalue
  635. : item.rValue !== undefined
  636. ? item.rValue
  637. : item.value !== undefined
  638. ? item.value
  639. : item.val !== undefined
  640. ? item.val
  641. : ''
  642. if (key !== undefined) detail[key] = value
  643. })
  644. } else if (val && typeof val === 'object') {
  645. Object.assign(detail, val)
  646. }
  647. this.surveyDetailData = detail
  648. }
  649. } catch (e) {
  650. this.surveyDetailData = {}
  651. }
  652. },
  653. // 获取固定表配置(表头与项),与 components/task/components/submitData.vue 保持一致
  654. async initFixedTableData(surveyTemplateId) {
  655. try {
  656. this.fixedFields = ''
  657. this.fixedFieldids = ''
  658. this.tableItems = []
  659. if (!surveyTemplateId) return
  660. const params = { surveyTemplateId, type: 2 }
  661. const res = await getSingleRecordSurveyList(params)
  662. if (res && res.code === 200 && res.value) {
  663. this.fixedFields = res.value.fixedFields || ''
  664. this.fixedFieldids = res.value.fixedFieldids || ''
  665. const { itemlist } = res.value || {}
  666. if (Array.isArray(itemlist) && itemlist.length > 0) {
  667. this.tableItems = itemlist.map((item) => ({
  668. id: item.id || item.itemId || '',
  669. rowid: item.rowid || item.id || item.itemId || '',
  670. seq: item.序号,
  671. itemName: item.项目 || item.itemName || '',
  672. unit: item.unit || '',
  673. isCategory: item.isCategory || false,
  674. categorySeq: item.categorySeq || '',
  675. categoryId: item.categoryId || '',
  676. parentid:
  677. item.parentid !== undefined
  678. ? item.parentid
  679. : item.parentId !== undefined
  680. ? item.parentId
  681. : '-1',
  682. validateRules: item.validateRules || {},
  683. linkageRules: item.linkageRules || {},
  684. children: item.children || [],
  685. ...item,
  686. }))
  687. }
  688. }
  689. } catch (e) {
  690. console.error('获取固定表配置失败:', e)
  691. this.tableItems = []
  692. }
  693. },
  694. // 查看报表
  695. handleViewReport(row) {
  696. this.$message.info(`查看报表:${row.name}`)
  697. // 这里可以添加查看报表的逻辑
  698. },
  699. // 处理资料审核点击事件
  700. handleAuditMaterial(row) {
  701. this.currentAuditMaterial = { ...row } // 复制当前行数据
  702. this.auditForm = {
  703. auditedStatus:
  704. this.currentAuditMaterial.auditStatus === '1' ? '通过' : '不通过',
  705. auditOpinion: '',
  706. }
  707. this.showAuditDialog = true
  708. },
  709. // 提交资料审核结果
  710. async handleAuditSubmit() {
  711. try {
  712. this.loading = true
  713. // 更新当前审核材料的审核状态
  714. this.currentAuditMaterial.auditedStatus = this.auditForm.auditedStatus
  715. this.currentAuditMaterial.auditResult = this.auditForm.auditedStatus
  716. // 调用接口提交整个对象
  717. await addOrUpdateTaskRequirement(this.currentAuditMaterial)
  718. this.$message({ type: 'success', message: '资料审核操作已提交' })
  719. // 更新本地数据,使表格显示最新审核结果
  720. this.loadMaterialData()
  721. this.showAuditDialog = false
  722. } catch (error) {
  723. console.error('资料审核提交失败:', error)
  724. // this.$message.error('资料审核提交失败,请重试')
  725. } finally {
  726. this.loading = false
  727. }
  728. },
  729. },
  730. }
  731. </script>
  732. <style scoped>
  733. .audit-review {
  734. padding: 5px;
  735. background-color: #ffffff;
  736. }
  737. .btn-group {
  738. margin-bottom: 20px;
  739. }
  740. .btn-group .el-button {
  741. margin-right: 10px;
  742. }
  743. .material-category {
  744. margin-bottom: 30px;
  745. }
  746. .category-title {
  747. margin: 0 0 15px 0;
  748. padding: 8px 12px;
  749. background-color: #f5f7fa;
  750. border-left: 4px solid #409eff;
  751. font-size: 16px;
  752. font-weight: 600;
  753. color: #303133;
  754. }
  755. .template-tag {
  756. background-color: #e6f7ff;
  757. color: #1677ff;
  758. padding: 2px 8px;
  759. border-radius: 4px;
  760. font-size: 12px;
  761. }
  762. .result-pass {
  763. color: #67c23a;
  764. font-weight: bold;
  765. }
  766. .result-fail {
  767. color: #f56c6c;
  768. font-weight: bold;
  769. }
  770. /* 表格样式调整 */
  771. .el-table th {
  772. background-color: #fafafa;
  773. }
  774. /* 弹窗样式调整 */
  775. .el-dialog__body {
  776. padding: 20px;
  777. }
  778. .audit-material-info {
  779. margin-bottom: 15px;
  780. padding: 10px;
  781. background-color: #f5f7fa;
  782. border-radius: 4px;
  783. }
  784. .audit-material-info p {
  785. margin: 0;
  786. }
  787. </style>