taskInfo.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320
  1. <template>
  2. <el-dialog
  3. :visible.sync="dialogVisible"
  4. title="任务详情"
  5. width="90%"
  6. top="5vh"
  7. :close-on-click-modal="false"
  8. :before-close="handleClose"
  9. class="task-info-dialog"
  10. >
  11. <div class="task-info-container">
  12. <!-- 标签页容器 -->
  13. <el-tabs
  14. v-model="activeTab"
  15. type="border-card"
  16. @tab-click="handleTabClick"
  17. >
  18. <!-- 立项信息 -->
  19. <el-tab-pane label="立项信息" name="projectInfo">
  20. <div v-loading="loading" element-loading-text="加载中...">
  21. <el-form
  22. :model="formData.basicInfo"
  23. label-width="180px"
  24. disabled
  25. class="readonly-form"
  26. >
  27. <el-form-item label="成本监审项目名称:">
  28. <el-input
  29. v-model="formData.basicInfo.projectName"
  30. style="width: 400px"
  31. ></el-input>
  32. </el-form-item>
  33. <el-form-item label="关联成本监审目录:">
  34. <CatalogCascader
  35. ref="catalogCascader"
  36. :key="formData.basicInfo.catalogId"
  37. :form-item="{ placeholder: '请选择监审目录' }"
  38. style="width: 100%"
  39. :value="formData.basicInfo.catalogId"
  40. :disabled="isViewMode"
  41. @change="handleCatalogChange"
  42. />
  43. </el-form-item>
  44. <el-form-item label="监审地区:">
  45. <RegionSelector
  46. :key="formData.basicInfo.areaCode"
  47. :initial-area-code="formData.basicInfo.areaCode"
  48. :disabled="isViewMode"
  49. @region-change="handleRegionChange"
  50. ></RegionSelector>
  51. </el-form-item>
  52. <el-form-item label="被监审单位:">
  53. <el-select
  54. v-if="
  55. formData.basicInfo.auditUnitId &&
  56. formData.basicInfo.auditUnitId.length > 0
  57. "
  58. v-model="formData.basicInfo.auditUnitId"
  59. placeholder="请选择单位"
  60. clearable
  61. multiple
  62. style="width: 100%"
  63. :disabled="isViewMode"
  64. >
  65. <el-option
  66. v-for="unit in unitList"
  67. :key="unit.unitId"
  68. :label="unit.unitName"
  69. :value="unit.unitId"
  70. />
  71. </el-select>
  72. <el-input
  73. v-else
  74. v-model="formData.basicInfo.auditUnitName"
  75. placeholder="请输入单位"
  76. style="width: 100%"
  77. :disabled="isViewMode"
  78. ></el-input>
  79. </el-form-item>
  80. <el-form-item label="监审主体:">
  81. <el-select
  82. v-model="formData.basicInfo.orgId"
  83. placeholder="请选择监审主体"
  84. style="width: 100%"
  85. clearable
  86. :disabled="isViewMode"
  87. >
  88. <el-option
  89. v-for="Org in OrgList"
  90. :key="Org.id"
  91. :label="Org.name"
  92. :value="Org.id"
  93. />
  94. </el-select>
  95. </el-form-item>
  96. <el-form-item label="归属年度:">
  97. <el-date-picker
  98. v-model="formData.basicInfo.projectYear"
  99. style="width: 100%"
  100. type="year"
  101. placeholder="请选择归属年度"
  102. format="yyyy"
  103. value-format="yyyy"
  104. clearable
  105. :disabled="isViewMode"
  106. ></el-date-picker>
  107. </el-form-item>
  108. <el-form-item label="立项来源:">
  109. <el-select
  110. v-model="formData.basicInfo.sourceType"
  111. placeholder="请选择立项类型"
  112. style="width: 100%"
  113. :disabled="isViewMode"
  114. >
  115. <el-option
  116. v-for="item in dictData['projectProposal']"
  117. :key="item.key"
  118. :label="item.name"
  119. :value="item.key"
  120. ></el-option>
  121. </el-select>
  122. </el-form-item>
  123. <el-form-item label="监审形式:">
  124. <el-select
  125. v-model="formData.basicInfo.auditType"
  126. placeholder="请选择监审形式"
  127. style="width: 100%"
  128. :disabled="isViewMode"
  129. >
  130. <el-option
  131. v-for="item in dictData['auditType']"
  132. :key="item.key"
  133. :label="item.name"
  134. :value="item.key"
  135. ></el-option>
  136. </el-select>
  137. </el-form-item>
  138. <el-form-item label="监审期间:">
  139. <div class="cost-period-container">
  140. <el-button
  141. type="primary"
  142. size="small"
  143. class="add-cost-year-btn"
  144. :disabled="isViewMode || true"
  145. @click="addCostYear"
  146. >
  147. +
  148. </el-button>
  149. <div class="cost-years-wrapper">
  150. <div
  151. v-for="(year, index) in formData.basicInfo
  152. .auditPeriodArray"
  153. :key="index"
  154. class="cost-year-item"
  155. >
  156. <el-date-picker
  157. v-model="year.value"
  158. style="width: 82%"
  159. type="year"
  160. placeholder="请选择年份"
  161. format="yyyy"
  162. value-format="yyyy"
  163. clearable
  164. :disabled="isViewMode"
  165. ></el-date-picker>
  166. <el-button
  167. type="danger"
  168. size="small"
  169. class="delete-cost-year-btn"
  170. :disabled="isViewMode"
  171. @click="deleteCostYear(index)"
  172. >
  173. 删除
  174. </el-button>
  175. </div>
  176. </div>
  177. </div>
  178. </el-form-item>
  179. <el-form-item label="是否参加听证:">
  180. <el-radio-group v-model="formData.basicInfo.needHearing">
  181. <el-radio :label="0">是</el-radio>
  182. <el-radio :label="1">否</el-radio>
  183. </el-radio-group>
  184. </el-form-item>
  185. <el-form-item label="是否应急项目:">
  186. <el-radio-group v-model="formData.basicInfo.isEmergency">
  187. <el-radio :label="0">是</el-radio>
  188. <el-radio :label="1">否</el-radio>
  189. </el-radio-group>
  190. </el-form-item>
  191. <el-form-item label="立项理由:">
  192. <el-input
  193. v-model="formData.basicInfo.establishmentReason"
  194. style="width: 100%"
  195. type="textarea"
  196. rows="4"
  197. ></el-input>
  198. </el-form-item>
  199. <el-form-item label="监审任务负责人:">
  200. <el-select
  201. v-model="formData.basicInfo.auditGroup"
  202. placeholder="请选择负责人"
  203. style="width: 100%"
  204. :disabled="isViewMode"
  205. >
  206. <el-option
  207. v-for="(item, index) in userList"
  208. :key="index"
  209. :label="item.fullname"
  210. :value="item.userId"
  211. ></el-option>
  212. </el-select>
  213. </el-form-item>
  214. <el-form-item label="监审任务组成员:">
  215. <el-select
  216. v-model="formData.basicInfo.auditTeamMembers"
  217. placeholder="请选择成员"
  218. multiple
  219. style="width: 100%"
  220. :disabled="isViewMode"
  221. >
  222. <el-option
  223. v-for="(item, index) in userList"
  224. :key="index"
  225. :label="item.fullname"
  226. :value="item.userId"
  227. ></el-option>
  228. </el-select>
  229. </el-form-item>
  230. <el-form-item label="其他专家:">
  231. <el-input
  232. v-model="formData.basicInfo.expertStr"
  233. style="width: 100%"
  234. ></el-input>
  235. </el-form-item>
  236. <el-form-item label="预定的监审工作起止时间:">
  237. <el-date-picker
  238. v-model="formData.basicInfo.plannedAuditStartDate"
  239. type="date"
  240. placeholder="开始日期"
  241. format="yyyy-MM-dd"
  242. value-format="yyyy-MM-dd"
  243. style="width: 150px"
  244. :disabled="isViewMode"
  245. ></el-date-picker>
  246. <span style="margin: 0 10px">—</span>
  247. <el-date-picker
  248. v-model="formData.basicInfo.plannedAuditEndDate"
  249. type="date"
  250. placeholder="结束日期"
  251. format="yyyy-MM-dd"
  252. value-format="yyyy-MM-dd"
  253. style="width: 150px"
  254. :disabled="isViewMode"
  255. ></el-date-picker>
  256. </el-form-item>
  257. </el-form>
  258. </div>
  259. </el-tab-pane>
  260. <!-- 监审文书 -->
  261. <el-tab-pane label="监审文书" name="auditDocument">
  262. <div v-loading="loading" element-loading-text="加载中...">
  263. <div style="font-size: 14px; margin-bottom: 15px; color: #606266">
  264. <strong>说明:</strong>
  265. 被监审单位接收《送达回证》后需签名并反馈监审主体。
  266. </div>
  267. <el-table
  268. style="width: 100%"
  269. border
  270. :data="formData.auditDocument"
  271. size="small"
  272. >
  273. <el-table-column prop="id" label="序号" width="80" align="center">
  274. <template slot-scope="scope">
  275. {{ scope.$index + 1 }}
  276. </template>
  277. </el-table-column>
  278. <el-table-column
  279. prop="name"
  280. label="文书类型"
  281. min-width="150"
  282. align="center"
  283. ></el-table-column>
  284. <el-table-column
  285. prop="province"
  286. label="文书文号"
  287. min-width="200"
  288. align="center"
  289. ></el-table-column>
  290. <el-table-column
  291. prop="city"
  292. label="推送时间"
  293. min-width="180"
  294. align="center"
  295. ></el-table-column>
  296. <el-table-column
  297. prop="address"
  298. label="文书状态"
  299. min-width="120"
  300. align="center"
  301. >
  302. <template slot-scope="scope">
  303. <span>{{ scope.row.address || '-' }}</span>
  304. </template>
  305. </el-table-column>
  306. </el-table>
  307. </div>
  308. </el-tab-pane>
  309. <!-- 报送资料 -->
  310. <el-tab-pane label="报送资料" name="dataRequirements">
  311. <div v-loading="loading" element-loading-text="加载中...">
  312. <el-table
  313. border
  314. :data="groupedDataRequirements"
  315. size="small"
  316. :show-header="true"
  317. :row-class-name="getRowClassName"
  318. >
  319. <el-table-column
  320. prop="seq"
  321. label="序号"
  322. width="80"
  323. align="center"
  324. >
  325. <template slot-scope="scope">
  326. <span v-if="!scope.row.isCategoryHeader">
  327. {{ scope.row.seq || scope.row.index }}
  328. </span>
  329. </template>
  330. </el-table-column>
  331. <el-table-column
  332. prop="informationName"
  333. label="报送资料"
  334. min-width="280"
  335. >
  336. <template slot-scope="scope">
  337. <div
  338. v-if="scope.row.isCategoryHeader"
  339. class="category-header-cell"
  340. >
  341. {{ scope.row.categoryName }}
  342. </div>
  343. <span v-else>{{ scope.row.informationName || '-' }}</span>
  344. </template>
  345. </el-table-column>
  346. <el-table-column
  347. prop="formatRequired"
  348. label="资料类型"
  349. width="130"
  350. align="center"
  351. >
  352. <template slot-scope="scope">
  353. <span
  354. v-if="
  355. scope.row.formatRequired !== null &&
  356. scope.row.formatRequired !== undefined
  357. "
  358. >
  359. {{
  360. getDictName(
  361. 'formatAsk',
  362. String(scope.row.formatRequired)
  363. ) || scope.row.formatRequired
  364. }}
  365. </span>
  366. </template>
  367. </el-table-column>
  368. <el-table-column
  369. prop="isRequired"
  370. label="是否必填"
  371. width="110"
  372. align="center"
  373. >
  374. <template slot-scope="scope">
  375. <span v-if="!scope.row.isCategoryHeader">
  376. {{ scope.row.isRequired === '1' ? '是' : '否' }}
  377. </span>
  378. </template>
  379. </el-table-column>
  380. <el-table-column
  381. prop="isUploaded"
  382. label="是否上传"
  383. width="110"
  384. align="center"
  385. >
  386. <template slot-scope="scope">
  387. <span v-if="!scope.row.isCategoryHeader">
  388. <span
  389. v-if="scope.row.isUploaded === true"
  390. style="color: #67c23a"
  391. >
  392. 已上传
  393. </span>
  394. <span v-else style="color: #f56c6c">未上传</span>
  395. </span>
  396. </template>
  397. </el-table-column>
  398. </el-table>
  399. </div>
  400. </el-tab-pane>
  401. <!-- 成本调查表 -->
  402. <el-tab-pane label="成本调查表" name="costSurvey">
  403. <div v-loading="loading" element-loading-text="加载中...">
  404. <el-table
  405. style="width: 100%"
  406. :data="paginatedCostSurveyData"
  407. border
  408. size="small"
  409. >
  410. <el-table-column
  411. prop="index"
  412. label="序号"
  413. width="60"
  414. align="center"
  415. ></el-table-column>
  416. <el-table-column label="成本调查表" min-width="220">
  417. <template slot-scope="scope">
  418. <span>{{ scope.row.name }}</span>
  419. </template>
  420. </el-table-column>
  421. <el-table-column
  422. prop="dataType"
  423. label="资料类型"
  424. width="120"
  425. align="center"
  426. ></el-table-column>
  427. <el-table-column
  428. prop="tableType"
  429. label="表格类型"
  430. width="120"
  431. align="center"
  432. ></el-table-column>
  433. <el-table-column
  434. prop="isRequired"
  435. label="是否必填"
  436. width="100"
  437. align="center"
  438. ></el-table-column>
  439. <el-table-column label="是否上传" width="100" align="center">
  440. <template slot-scope="scope">
  441. <span
  442. :style="{
  443. color:
  444. scope.row.isUploaded === true ? '#67c23a' : '#f56c6c',
  445. }"
  446. >
  447. {{ scope.row.isUploaded === true ? '已上传' : '未上传' }}
  448. </span>
  449. </template>
  450. </el-table-column>
  451. </el-table>
  452. <el-pagination
  453. background
  454. layout="total, sizes, prev, pager, next"
  455. :current-page="costSurveyPagination.currentPage"
  456. :page-sizes="[10, 20, 30, 50]"
  457. :page-size="costSurveyPagination.pageSize"
  458. :total="costSurveyPagination.total"
  459. style="margin-top: 20px; text-align: right"
  460. @current-change="handleCostSurveyPageChange"
  461. @size-change="handleCostSurveySizeChange"
  462. />
  463. </div>
  464. </el-tab-pane>
  465. <!-- 监审意见 -->
  466. <el-tab-pane
  467. v-if="showAuditOpinion"
  468. label="监审意见"
  469. name="auditOpinion"
  470. >
  471. <div v-loading="loading" element-loading-text="加载中...">
  472. <div class="cost-supervision-container">
  473. <div class="cost-opinion-section">
  474. <h3>成本监审意见</h3>
  475. <div class="opinion-item">
  476. <label>被监审单位基本情况及主要财务状况</label>
  477. <el-input
  478. v-model="formData.auditOpinion.basicFinancialInfo"
  479. type="textarea"
  480. rows="5"
  481. disabled
  482. />
  483. </div>
  484. <div class="opinion-item">
  485. <label>监审项目现行执行的价格标准</label>
  486. <el-input
  487. v-model="formData.auditOpinion.priceStandard"
  488. type="textarea"
  489. rows="5"
  490. disabled
  491. />
  492. </div>
  493. <div class="opinion-item">
  494. <label>
  495. 监审项目的成本构成、数据核增核减情况、依据及理由
  496. </label>
  497. <el-input
  498. v-model="formData.auditOpinion.costComposition"
  499. type="textarea"
  500. rows="5"
  501. disabled
  502. />
  503. </div>
  504. <div class="opinion-item">
  505. <label>成本审核初步意见</label>
  506. <el-input
  507. v-model="formData.auditOpinion.preliminaryOpinion"
  508. type="textarea"
  509. rows="5"
  510. disabled
  511. />
  512. </div>
  513. </div>
  514. <div class="feedback-section">
  515. <h3>被监审单位反馈意见</h3>
  516. <div class="feedback-item">
  517. <label>被监审单位反馈意见</label>
  518. <el-input
  519. v-model="formData.auditOpinion.enterpriseFeedback"
  520. type="textarea"
  521. rows="5"
  522. disabled
  523. />
  524. </div>
  525. <div class="feedback-item">
  526. <label>被监审单位反馈资料</label>
  527. <div class="file-list-display">
  528. <div
  529. v-for="(file, index) in formData.auditOpinion.fileList"
  530. :key="index"
  531. class="file-item"
  532. >
  533. <i class="el-icon-document"></i>
  534. <span>{{ file.name }}</span>
  535. </div>
  536. <div
  537. v-if="
  538. !formData.auditOpinion.fileList ||
  539. formData.auditOpinion.fileList.length === 0
  540. "
  541. style="color: #909399"
  542. >
  543. 暂无文件
  544. </div>
  545. </div>
  546. </div>
  547. </div>
  548. </div>
  549. </div>
  550. </el-tab-pane>
  551. <!-- 消息通知 -->
  552. <el-tab-pane label="消息通知" name="messageNotice">
  553. <div v-loading="loading" element-loading-text="加载中...">
  554. <el-table
  555. style="width: 100%"
  556. border
  557. :data="formData.messageNotice"
  558. size="small"
  559. >
  560. <el-table-column prop="id" label="序号" width="80" align="center">
  561. <template slot-scope="scope">
  562. {{ scope.$index + 1 }}
  563. </template>
  564. </el-table-column>
  565. <el-table-column
  566. prop="noticeTitle"
  567. label="消息主题"
  568. width="200"
  569. align="center"
  570. ></el-table-column>
  571. <el-table-column
  572. prop="noticeSource"
  573. label="消息来源"
  574. width="150"
  575. align="center"
  576. ></el-table-column>
  577. <el-table-column
  578. prop="noticeContent"
  579. label="消息内容"
  580. min-width="350"
  581. align="center"
  582. ></el-table-column>
  583. <el-table-column
  584. prop="createTime"
  585. label="发送时间"
  586. width="180"
  587. align="center"
  588. ></el-table-column>
  589. </el-table>
  590. <el-pagination
  591. background
  592. layout="total, sizes, prev, pager, next"
  593. :current-page="messageNoticePagination.currentPage"
  594. :page-sizes="[10, 20, 30, 50]"
  595. :page-size="messageNoticePagination.pageSize"
  596. :total="messageNoticePagination.total"
  597. style="margin-top: 20px; text-align: right"
  598. @current-change="handleMessageNoticePageChange"
  599. @size-change="handleMessageNoticeSizeChange"
  600. />
  601. </div>
  602. </el-tab-pane>
  603. </el-tabs>
  604. </div>
  605. <div slot="footer" class="dialog-footer">
  606. <el-button type="primary" @click="handleClose">关闭</el-button>
  607. </div>
  608. </el-dialog>
  609. </template>
  610. <script>
  611. import RegionSelector from '@/views/costAudit/projectInfo/auditProjectManage/annualReviewPlan/RegionSelector.vue'
  612. import CatalogCascader from '@/views/costAudit/projectInfo/auditProjectManage/annualReviewPlan/CatalogCascader.vue'
  613. import { getAllUnitList } from '@/api/auditEntityManage'
  614. import { getDefaultDem, getOrgListByDemId } from '@/api/annualReviewPlan'
  615. import { getAllUserList } from '@/api/uc'
  616. import { dictMixin } from '@/mixins/useDict'
  617. import {
  618. getProjectInformationInfo,
  619. getTaskRequirementList,
  620. sendMessage,
  621. } from '@/api/auditTaskProcessing'
  622. export default {
  623. name: 'TaskInfo',
  624. components: {
  625. RegionSelector,
  626. CatalogCascader,
  627. },
  628. mixins: [dictMixin],
  629. props: {
  630. visible: {
  631. type: Boolean,
  632. default: false,
  633. },
  634. taskData: {
  635. type: Object,
  636. default: () => ({}),
  637. },
  638. },
  639. data() {
  640. return {
  641. dialogVisible: false,
  642. activeTab: 'projectInfo',
  643. isViewMode: true, // 只读模式,始终为true
  644. currentTaskInfo: null, // 当前任务信息(包含projectId和taskId)
  645. loading: false, // 数据加载状态
  646. // 各个标签页的加载状态,避免重复加载
  647. tabLoadedStatus: {
  648. projectInfo: false,
  649. auditDocument: false,
  650. dataRequirements: false,
  651. costSurvey: false,
  652. auditOpinion: false,
  653. messageNotice: false,
  654. },
  655. // 成本调查表分页相关
  656. costSurveyPagination: {
  657. currentPage: 1,
  658. pageSize: 10,
  659. total: 0,
  660. },
  661. // 消息通知分页相关
  662. messageNoticePagination: {
  663. currentPage: 1,
  664. pageSize: 10,
  665. total: 0,
  666. },
  667. unitList: [],
  668. OrgList: [],
  669. userList: [],
  670. dictData: {
  671. projectProposal: [], // 立项来源
  672. auditType: [], // 监审形式
  673. attributionYear: [], // 归属年度
  674. materialType: [], // 资料类别
  675. materialCategory: [], // 资料类别
  676. formatAsk: [], // 资料类型
  677. },
  678. formData: {
  679. basicInfo: {
  680. projectName: '',
  681. catalogId: '',
  682. areaCode: '',
  683. auditUnitId: [],
  684. auditUnitName: '',
  685. orgId: '',
  686. orgName: '',
  687. projectYear: '',
  688. sourceType: '',
  689. sourceTypeText: '',
  690. auditType: '',
  691. auditTypeText: '',
  692. auditPeriod: '',
  693. auditPeriodArray: [{ value: '' }],
  694. needHearing: 1,
  695. isEmergency: 1,
  696. establishmentReason: '',
  697. auditGroup: '',
  698. auditGroupName: '',
  699. auditTeamMembers: [],
  700. auditTeamMembersText: '',
  701. expertStr: '',
  702. plannedAuditStartDate: '',
  703. plannedAuditEndDate: '',
  704. },
  705. auditDocument: [],
  706. dataRequirements: [],
  707. costSurveyData: [],
  708. auditOpinion: {
  709. basicFinancialInfo: '',
  710. priceStandard: '',
  711. costComposition: '',
  712. preliminaryOpinion: '',
  713. enterpriseFeedback: '',
  714. fileList: [],
  715. },
  716. messageNotice: [],
  717. },
  718. showAuditOpinion: true,
  719. }
  720. },
  721. computed: {
  722. groupedDataRequirements() {
  723. if (
  724. !this.formData.dataRequirements ||
  725. !Array.isArray(this.formData.dataRequirements) ||
  726. this.formData.dataRequirements.length === 0
  727. ) {
  728. return []
  729. }
  730. const groups = {}
  731. this.formData.dataRequirements.forEach((item, index) => {
  732. const categoryKey = item.informationType || 'other'
  733. let categoryName = item.informationTypeName || categoryKey
  734. if (!groups[categoryKey]) {
  735. groups[categoryKey] = {
  736. categoryKey,
  737. categoryName: categoryName,
  738. items: [],
  739. }
  740. }
  741. const itemWithSeq = {
  742. ...item,
  743. index: index + 1,
  744. seq: groups[categoryKey].items.length + 1,
  745. }
  746. groups[categoryKey].items.push(itemWithSeq)
  747. })
  748. const result = []
  749. Object.keys(groups).forEach((categoryKey) => {
  750. const group = groups[categoryKey]
  751. result.push({
  752. isCategoryHeader: true,
  753. categoryName: group.categoryName,
  754. categoryKey: group.categoryKey,
  755. })
  756. group.items.forEach((item) => {
  757. result.push({
  758. ...item,
  759. isCategoryHeader: false,
  760. })
  761. })
  762. })
  763. return result
  764. },
  765. // 分页后的成本调查表数据
  766. paginatedCostSurveyData() {
  767. const start =
  768. (this.costSurveyPagination.currentPage - 1) *
  769. this.costSurveyPagination.pageSize
  770. const end = start + this.costSurveyPagination.pageSize
  771. return this.formData.costSurveyData.slice(start, end)
  772. },
  773. },
  774. watch: {
  775. visible: {
  776. handler(val) {
  777. this.dialogVisible = val
  778. if (val) {
  779. this.loadData()
  780. }
  781. },
  782. immediate: true,
  783. },
  784. },
  785. mounted() {
  786. this.initData()
  787. },
  788. methods: {
  789. // 初始化数据
  790. initData() {
  791. this.getAllUnitList()
  792. this.getDefaultDem()
  793. this.getUser()
  794. },
  795. // 获取所有单位列表
  796. getAllUnitList() {
  797. getAllUnitList()
  798. .then((res) => {
  799. this.unitList = res.value || []
  800. })
  801. .catch(() => {})
  802. },
  803. // 获取默认维度
  804. getDefaultDem() {
  805. getDefaultDem()
  806. .then((res) => {
  807. if (res && res.code === 200) {
  808. const demId = res.value ? res.value.id : null
  809. if (demId) {
  810. this.getOrgListByDemId(demId)
  811. }
  812. }
  813. })
  814. .catch(() => {})
  815. },
  816. // 根据维度ID获取组织列表
  817. getOrgListByDemId(demId) {
  818. getOrgListByDemId({ demId })
  819. .then((res) => {
  820. if (res && res.code === 200) {
  821. this.OrgList = res.value || []
  822. }
  823. })
  824. .catch(() => {})
  825. },
  826. // 获取用户列表
  827. getUser() {
  828. getAllUserList()
  829. .then((res) => {
  830. this.userList = res.value || []
  831. })
  832. .catch(() => {})
  833. },
  834. // 对外暴露的打开方法
  835. open(data) {
  836. this.dialogVisible = true
  837. this.activeTab = 'projectInfo'
  838. // 重置加载状态
  839. Object.keys(this.tabLoadedStatus).forEach((key) => {
  840. this.tabLoadedStatus[key] = false
  841. })
  842. // 重置分页状态
  843. this.costSurveyPagination.currentPage = 1
  844. this.costSurveyPagination.total = 0
  845. this.messageNoticePagination.currentPage = 1
  846. this.messageNoticePagination.total = 0
  847. if (data) {
  848. // 保存任务信息
  849. this.currentTaskInfo = {
  850. projectId: data.projectId || data.id,
  851. taskId: data.userTask?.id || data.taskId,
  852. currentNode: data.currentNode,
  853. ...data,
  854. }
  855. // 根据状态决定是否显示监审意见标签页
  856. this.showAuditOpinion = data.currentNode !== 'jtsy'
  857. // 立即加载立项信息
  858. this.loadProjectInfo()
  859. }
  860. },
  861. // 标签页切换事件
  862. handleTabClick(tab) {
  863. const tabName = tab.name
  864. // 如果该tab还未加载过数据,则加载
  865. if (!this.tabLoadedStatus[tabName]) {
  866. this.loadTabData(tabName)
  867. }
  868. },
  869. // 根据tab名称加载对应的数据
  870. async loadTabData(tabName) {
  871. switch (tabName) {
  872. case 'projectInfo':
  873. await this.loadProjectInfo()
  874. break
  875. case 'auditDocument':
  876. await this.loadAuditDocument()
  877. break
  878. case 'dataRequirements':
  879. await this.loadDataRequirements()
  880. break
  881. case 'costSurvey':
  882. await this.loadCostSurvey()
  883. break
  884. case 'auditOpinion':
  885. await this.loadAuditOpinion()
  886. break
  887. case 'messageNotice':
  888. await this.loadMessageNotice()
  889. break
  890. }
  891. },
  892. // 加载立项信息
  893. async loadProjectInfo() {
  894. if (!this.currentTaskInfo?.projectId) {
  895. return
  896. }
  897. try {
  898. this.loading = true
  899. const res = await getProjectInformationInfo(
  900. this.currentTaskInfo.projectId
  901. )
  902. if (res && res.code === 200 && res.value) {
  903. const data = res.value
  904. // 处理监审期间数组
  905. let auditPeriodArray = [{ value: '' }]
  906. if (data.auditPeriod && typeof data.auditPeriod === 'string') {
  907. const periods = data.auditPeriod.split(',').filter(Boolean)
  908. auditPeriodArray = periods.map((p) => ({ value: p }))
  909. }
  910. // 处理被监审单位ID(可能是字符串或数组)
  911. let auditUnitId = []
  912. if (data.auditUnitId) {
  913. if (typeof data.auditUnitId === 'string') {
  914. // 如果是字符串,分割成数组
  915. auditUnitId = data.auditUnitId.split(',').filter(Boolean)
  916. } else if (Array.isArray(data.auditUnitId)) {
  917. // 如果已经是数组,直接使用
  918. auditUnitId = data.auditUnitId
  919. }
  920. }
  921. // 处理监审任务组成员(可能是字符串或数组)
  922. let auditTeamMembers = []
  923. if (data.auditTeamMembers) {
  924. if (typeof data.auditTeamMembers === 'string') {
  925. auditTeamMembers = data.auditTeamMembers
  926. .split(',')
  927. .filter(Boolean)
  928. } else if (Array.isArray(data.auditTeamMembers)) {
  929. auditTeamMembers = data.auditTeamMembers
  930. }
  931. }
  932. this.formData.basicInfo = {
  933. projectName: data.projectName || '',
  934. catalogId: data.catalogId || '',
  935. areaCode: data.areaCode || '',
  936. auditUnitId: auditUnitId,
  937. auditUnitName: data.auditUnitName || '',
  938. orgId: data.orgId || '',
  939. orgName: data.orgName || '',
  940. projectYear: data.projectYear || '',
  941. sourceType: data.sourceType || '',
  942. auditType: data.auditType || '',
  943. auditPeriod: data.auditPeriod || '',
  944. auditPeriodArray: auditPeriodArray,
  945. needHearing:
  946. data.needHearing !== undefined ? data.needHearing : 1,
  947. isEmergency:
  948. data.isEmergency !== undefined ? data.isEmergency : 1,
  949. establishmentReason: data.establishmentReason || '',
  950. auditGroup: data.auditGroup || '',
  951. auditTeamMembers: auditTeamMembers,
  952. expertStr: data.expertStr || '',
  953. plannedAuditStartDate: data.plannedAuditStartDate || '',
  954. plannedAuditEndDate: data.plannedAuditEndDate || '',
  955. }
  956. // 打印日志以便调试
  957. console.log('立项信息加载完成:', {
  958. areaCode: this.formData.basicInfo.areaCode,
  959. auditUnitId: this.formData.basicInfo.auditUnitId,
  960. auditUnitName: this.formData.basicInfo.auditUnitName,
  961. })
  962. this.tabLoadedStatus.projectInfo = true
  963. }
  964. } catch (error) {
  965. console.error('加载立项信息失败:', error)
  966. this.$message.error('加载立项信息失败')
  967. } finally {
  968. this.loading = false
  969. }
  970. },
  971. // 加载监审文书
  972. async loadAuditDocument() {
  973. try {
  974. this.loading = true
  975. // TODO: 调用监审文书接口
  976. // const res = await getAuditDocumentList(this.currentTaskInfo.taskId)
  977. // if (res && res.code === 200) {
  978. // this.formData.auditDocument = res.value || []
  979. // }
  980. // 暂时使用mock数据
  981. this.formData.auditDocument = []
  982. this.tabLoadedStatus.auditDocument = true
  983. } catch (error) {
  984. console.error('加载监审文书失败:', error)
  985. this.$message.error('加载监审文书失败')
  986. } finally {
  987. this.loading = false
  988. }
  989. },
  990. // 加载报送资料
  991. async loadDataRequirements() {
  992. if (!this.currentTaskInfo?.taskId) {
  993. return
  994. }
  995. try {
  996. this.loading = true
  997. const res = await getTaskRequirementList(this.currentTaskInfo.taskId)
  998. if (res && res.code === 200) {
  999. this.formData.dataRequirements = Array.isArray(res.value)
  1000. ? res.value
  1001. : []
  1002. this.tabLoadedStatus.dataRequirements = true
  1003. }
  1004. } catch (error) {
  1005. console.error('加载报送资料失败:', error)
  1006. this.$message.error('加载报送资料失败')
  1007. } finally {
  1008. this.loading = false
  1009. }
  1010. },
  1011. // 加载成本调查表
  1012. async loadCostSurvey() {
  1013. try {
  1014. this.loading = true
  1015. // TODO: 调用成本调查表接口
  1016. // const res = await getCostSurveyList(this.currentTaskInfo.taskId)
  1017. // if (res && res.code === 200) {
  1018. // this.formData.costSurveyData = res.value || []
  1019. // this.costSurveyPagination.total = this.formData.costSurveyData.length
  1020. // }
  1021. // 暂时使用mock数据
  1022. this.formData.costSurveyData = []
  1023. this.costSurveyPagination.total = this.formData.costSurveyData.length
  1024. this.tabLoadedStatus.costSurvey = true
  1025. } catch (error) {
  1026. console.error('加载成本调查表失败:', error)
  1027. this.$message.error('加载成本调查表失败')
  1028. this.formData.costSurveyData = []
  1029. this.costSurveyPagination.total = 0
  1030. } finally {
  1031. this.loading = false
  1032. }
  1033. },
  1034. // 加载监审意见
  1035. async loadAuditOpinion() {
  1036. try {
  1037. this.loading = true
  1038. // TODO: 调用监审意见接口
  1039. // const res = await getAuditOpinion(this.currentTaskInfo.taskId)
  1040. // if (res && res.code === 200) {
  1041. // this.formData.auditOpinion = res.value || {}
  1042. // }
  1043. // 暂时使用默认数据
  1044. this.tabLoadedStatus.auditOpinion = true
  1045. } catch (error) {
  1046. console.error('加载监审意见失败:', error)
  1047. this.$message.error('加载监审意见失败')
  1048. } finally {
  1049. this.loading = false
  1050. }
  1051. },
  1052. // 加载消息通知
  1053. async loadMessageNotice() {
  1054. if (!this.currentTaskInfo?.taskId) {
  1055. return
  1056. }
  1057. try {
  1058. this.loading = true
  1059. const params = {
  1060. taskId: this.currentTaskInfo.taskId,
  1061. currentPage: this.messageNoticePagination.currentPage,
  1062. pageSize: this.messageNoticePagination.pageSize,
  1063. }
  1064. const res = await sendMessage(params)
  1065. console.log('消息通知接口返回:', res)
  1066. if (res && res.code === 200 && res.value && res.value.value) {
  1067. this.formData.messageNotice = res.value.value.records || []
  1068. this.messageNoticePagination.total = res.value.value.total || 0
  1069. } else {
  1070. this.formData.messageNotice = []
  1071. this.messageNoticePagination.total = 0
  1072. }
  1073. this.tabLoadedStatus.messageNotice = true
  1074. } catch (error) {
  1075. console.error('加载消息通知失败:', error)
  1076. this.$message.error('加载消息通知失败')
  1077. this.formData.messageNotice = []
  1078. this.messageNoticePagination.total = 0
  1079. } finally {
  1080. this.loading = false
  1081. }
  1082. },
  1083. loadData() {
  1084. if (this.taskData && Object.keys(this.taskData).length > 0) {
  1085. // 加载传入的数据
  1086. this.formData = { ...this.formData, ...this.taskData }
  1087. // 处理监审期间数组
  1088. if (
  1089. this.formData.basicInfo.auditPeriod &&
  1090. typeof this.formData.basicInfo.auditPeriod === 'string'
  1091. ) {
  1092. const periods = this.formData.basicInfo.auditPeriod
  1093. .split(',')
  1094. .filter(Boolean)
  1095. this.formData.basicInfo.auditPeriodArray = periods.map((p) => ({
  1096. value: p,
  1097. }))
  1098. }
  1099. }
  1100. },
  1101. handleClose() {
  1102. this.dialogVisible = false
  1103. this.$emit('update:visible', false)
  1104. this.$emit('close')
  1105. },
  1106. getRowClassName({ row }) {
  1107. if (row.isCategoryHeader) {
  1108. return 'category-header-row'
  1109. }
  1110. return ''
  1111. },
  1112. // 处理监审目录变化(只读模式下不触发)
  1113. handleCatalogChange(value) {
  1114. // 只读模式,无需处理
  1115. },
  1116. // 处理地区变化(只读模式下不触发)
  1117. handleRegionChange(region) {
  1118. // 只读模式,无需处理
  1119. },
  1120. // 添加监审年份(只读模式下禁用)
  1121. addCostYear() {
  1122. // 只读模式,无需处理
  1123. },
  1124. // 删除监审年份(只读模式下禁用)
  1125. deleteCostYear(index) {
  1126. // 只读模式,无需处理
  1127. },
  1128. // 成本调查表分页 - 页码改变
  1129. handleCostSurveyPageChange(page) {
  1130. this.costSurveyPagination.currentPage = page
  1131. // 如果成本调查表数据来自API,可以在这里调用API
  1132. // this.loadCostSurvey()
  1133. },
  1134. // 成本调查表分页 - 每页条数改变
  1135. handleCostSurveySizeChange(size) {
  1136. this.costSurveyPagination.pageSize = size
  1137. this.costSurveyPagination.currentPage = 1
  1138. // 如果成本调查表数据来自API,可以在这里调用API
  1139. // this.loadCostSurvey()
  1140. },
  1141. // 消息通知分页 - 页码改变
  1142. handleMessageNoticePageChange(page) {
  1143. this.messageNoticePagination.currentPage = page
  1144. this.loadMessageNotice()
  1145. },
  1146. // 消息通知分页 - 每页条数改变
  1147. handleMessageNoticeSizeChange(size) {
  1148. this.messageNoticePagination.pageSize = size
  1149. this.messageNoticePagination.currentPage = 1
  1150. this.loadMessageNotice()
  1151. },
  1152. },
  1153. }
  1154. </script>
  1155. <style scoped lang="scss">
  1156. .task-info-dialog {
  1157. ::v-deep .el-dialog__body {
  1158. padding: 20px;
  1159. max-height: 70vh;
  1160. overflow-y: auto;
  1161. }
  1162. }
  1163. .task-info-container {
  1164. width: 100%;
  1165. }
  1166. .readonly-form {
  1167. ::v-deep .el-input.is-disabled .el-input__inner {
  1168. color: #606266;
  1169. background-color: #f5f7fa;
  1170. }
  1171. ::v-deep .el-textarea.is-disabled .el-textarea__inner {
  1172. color: #606266;
  1173. background-color: #f5f7fa;
  1174. }
  1175. ::v-deep .el-radio__input.is-disabled + span.el-radio__label {
  1176. color: #606266;
  1177. }
  1178. }
  1179. .cost-period-container {
  1180. display: flex;
  1181. align-items: flex-start;
  1182. }
  1183. .add-cost-year-btn {
  1184. margin-right: 10px;
  1185. }
  1186. .delete-cost-year-btn {
  1187. margin-left: 10px;
  1188. }
  1189. .cost-years-wrapper {
  1190. flex: 1;
  1191. }
  1192. .cost-year-item {
  1193. margin-bottom: 10px;
  1194. display: flex;
  1195. align-items: center;
  1196. }
  1197. .cost-supervision-container {
  1198. width: 100%;
  1199. h3 {
  1200. text-align: center;
  1201. margin-top: 0;
  1202. margin-bottom: 20px;
  1203. font-size: 16px;
  1204. font-weight: bold;
  1205. }
  1206. }
  1207. .cost-opinion-section,
  1208. .feedback-section {
  1209. border: 1px solid #dcdcdc;
  1210. border-radius: 4px;
  1211. padding: 20px;
  1212. margin-bottom: 20px;
  1213. background-color: #f9f9f9;
  1214. }
  1215. .opinion-item,
  1216. .feedback-item {
  1217. margin-bottom: 20px;
  1218. display: flex;
  1219. flex-direction: column;
  1220. label {
  1221. margin-bottom: 8px;
  1222. font-weight: bold;
  1223. color: #1549ad;
  1224. }
  1225. }
  1226. .file-list-display {
  1227. border: 1px solid #e9e9e9;
  1228. border-radius: 4px;
  1229. padding: 15px;
  1230. min-height: 60px;
  1231. background-color: #fff;
  1232. }
  1233. .file-item {
  1234. padding: 8px;
  1235. margin-bottom: 5px;
  1236. color: #606266;
  1237. i {
  1238. margin-right: 5px;
  1239. color: #409eff;
  1240. }
  1241. }
  1242. ::v-deep .category-header-row {
  1243. background-color: #f5f7fa !important;
  1244. td {
  1245. background-color: #f5f7fa !important;
  1246. padding: 12px 16px !important;
  1247. }
  1248. }
  1249. .category-header-cell {
  1250. font-weight: 700;
  1251. color: #303133;
  1252. padding-left: 16px;
  1253. }
  1254. .dialog-footer {
  1255. text-align: center;
  1256. padding-top: 10px;
  1257. }
  1258. </style>