submitData.vue 25 KB

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