cbjsInfo.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <div class="cbjs-info-container">
  3. <el-dialog
  4. :visible.sync="visible"
  5. :title="dialogTitle"
  6. width="90%"
  7. :close-on-click-modal="false"
  8. @close="handleClose"
  9. >
  10. <!-- 标签页面 - 移除了操作按钮区域 -->
  11. <el-tabs
  12. v-model="activeTab"
  13. type="card"
  14. class="audit-tabs"
  15. @tab-click="handleTabClick"
  16. >
  17. <el-tab-pane label="报送资料" name="submitData">
  18. <submit-data :id="id" :disabled="true" />
  19. </el-tab-pane>
  20. <el-tab-pane label="成本调查表" name="costSurvey">
  21. <cost-survey
  22. :id="id"
  23. ref="costSurveyRef"
  24. :disabled="true"
  25. :audited-unit-id="auditedUnitId"
  26. :catalog-id="catalogId"
  27. :task-id="taskId"
  28. />
  29. </el-tab-pane>
  30. <el-tab-pane
  31. v-if="currentNode !== 'clcs'"
  32. label="成本审核"
  33. name="costAudit"
  34. >
  35. <cost-audit
  36. :id="id"
  37. :disabled="true"
  38. :selected-project="selectedProject"
  39. />
  40. </el-tab-pane>
  41. <el-tab-pane
  42. v-if="currentNode !== 'clcs'"
  43. label="工作底稿"
  44. name="workDraft"
  45. >
  46. <work-draft :id="id" :disabled="true" />
  47. </el-tab-pane>
  48. <el-tab-pane
  49. v-if="currentNode !== 'clcs'"
  50. label="提取材料登记"
  51. name="extractMaterial"
  52. >
  53. <extract-material :id="id" :disabled="true" />
  54. </el-tab-pane>
  55. <el-tab-pane
  56. v-if="currentNode !== 'clcs'"
  57. label="成本审核意见"
  58. name="auditOpinion"
  59. >
  60. <audit-opinion
  61. :id="id"
  62. :current-node="currentNode"
  63. :status="currentStatus"
  64. :disabled="true"
  65. />
  66. </el-tab-pane>
  67. <el-tab-pane label="消息通知" name="messageNotify">
  68. <message-notify :id="id" :disabled="true" />
  69. </el-tab-pane>
  70. </el-tabs>
  71. </el-dialog>
  72. </div>
  73. </template>
  74. <script>
  75. import costAudit from './components/costAudit.vue'
  76. import costSurvey from './components/costSurvey.vue'
  77. import submitData from './components/submitData.vue'
  78. import workDraft from './components/workDraft.vue'
  79. import extractMaterial from './components/extractMaterial.vue'
  80. import auditOpinion from './components/auditOpinion.vue'
  81. import messageNotify from './components/messageNotify.vue'
  82. export default {
  83. name: 'CbjsInfo',
  84. components: {
  85. costAudit,
  86. costSurvey,
  87. submitData,
  88. workDraft,
  89. extractMaterial,
  90. auditOpinion,
  91. messageNotify,
  92. },
  93. props: {
  94. visible: {
  95. type: Boolean,
  96. default: false,
  97. },
  98. id: {
  99. type: [String, Number],
  100. default: null,
  101. },
  102. selectedProject: {
  103. type: Object,
  104. default: () => {
  105. return {}
  106. },
  107. },
  108. currentNode: {
  109. type: String,
  110. default: '',
  111. },
  112. currentStatus: {
  113. type: String,
  114. default: '',
  115. },
  116. },
  117. data() {
  118. return {
  119. activeTab: 'submitData', // 默认选中报送资料标签页
  120. }
  121. },
  122. computed: {
  123. dialogTitle() {
  124. // 根据节点类型设置标题
  125. if (
  126. this.currentNode === 'sdshenhe' &&
  127. this.currentStatus === '审核中'
  128. ) {
  129. return '审核详情'
  130. } else if (this.currentNode === 'clcs') {
  131. return '成本调查详情'
  132. } else if (
  133. this.currentNode === 'yjgaozhi' ||
  134. this.currentNode === 'yjfk'
  135. ) {
  136. return '意见告知'
  137. }
  138. return '成本审核详情'
  139. },
  140. // 从 selectedProject 中派生 auditedUnitId / catalogId,供子组件查询接口使用
  141. auditedUnitId() {
  142. return (
  143. (this.selectedProject &&
  144. (this.selectedProject.auditedUnitId ||
  145. this.selectedProject.auditedunitid)) ||
  146. ''
  147. )
  148. },
  149. catalogId() {
  150. return (
  151. (this.selectedProject &&
  152. (this.selectedProject.catalogId ||
  153. this.selectedProject.catalogid)) ||
  154. ''
  155. )
  156. },
  157. taskId() {
  158. return (
  159. (this.selectedProject &&
  160. (this.selectedProject.taskId || this.selectedProject.taskid)) ||
  161. ''
  162. )
  163. },
  164. },
  165. watch: {
  166. visible(newVal) {
  167. // 监听visible变化,弹窗打开时设置标签页
  168. if (newVal && this.id) {
  169. // 使用 $nextTick 确保 props 已更新
  170. this.$nextTick(() => {
  171. // 设置标签页
  172. this.setActiveTab()
  173. })
  174. }
  175. },
  176. // 监听currentNode变化,如果弹窗已打开,更新标签页
  177. currentNode(newVal, oldVal) {
  178. if (this.visible && this.id && newVal && newVal !== oldVal) {
  179. this.$nextTick(() => {
  180. // 设置标签页
  181. this.setActiveTab()
  182. })
  183. }
  184. },
  185. // 监听currentStatus变化,如果弹窗已打开,更新标签页
  186. currentStatus(newVal, oldVal) {
  187. if (this.visible && this.id && newVal && newVal !== oldVal) {
  188. this.$nextTick(() => {
  189. // 设置标签页
  190. this.setActiveTab()
  191. })
  192. }
  193. },
  194. // 监听id变化,如果弹窗已打开,更新标签页
  195. id(newVal) {
  196. if (this.visible && newVal) {
  197. this.$nextTick(() => {
  198. // 设置标签页
  199. this.setActiveTab()
  200. })
  201. }
  202. },
  203. },
  204. mounted() {
  205. // 设置标签页
  206. this.setActiveTab()
  207. },
  208. methods: {
  209. // 根据 currentNode 和 currentStatus 设置活动标签页
  210. setActiveTab() {
  211. if (this.currentNode === 'sdsh' && this.currentStatus === '审核中') {
  212. this.activeTab = 'costAudit'
  213. } else if (this.currentNode === 'clcs') {
  214. // 如果 currentNode 是 'clcs',显示成本调查表标签页
  215. this.activeTab = 'submitData'
  216. } else if (
  217. this.currentNode === 'yjgaozhi' ||
  218. this.currentNode === 'yjfk'
  219. ) {
  220. // 如果 currentNode 是 'yjgaozhi',显示意见告知标签页(成本审核意见)
  221. this.activeTab = 'auditOpinion'
  222. } else {
  223. // 其他情况默认显示报送资料标签页
  224. this.activeTab = 'submitData'
  225. }
  226. },
  227. // 标签切换时回调
  228. handleTabClick(tab) {
  229. if (tab && tab.name === 'costSurvey') {
  230. // 切到成本调查表时,调用子组件刷新
  231. this.$nextTick(() => {
  232. if (
  233. this.$refs &&
  234. this.$refs.costSurveyRef &&
  235. this.$refs.costSurveyRef.loadList
  236. ) {
  237. this.$refs.costSurveyRef.loadList()
  238. }
  239. })
  240. }
  241. },
  242. handleClose() {
  243. // 关闭弹窗时触发事件
  244. this.$emit('update:visible', false)
  245. this.$emit('close')
  246. },
  247. open() {
  248. // 打开弹窗方法,供父组件通过ref调用
  249. this.$emit('update:visible', true)
  250. },
  251. },
  252. }
  253. </script>
  254. <style scoped>
  255. /* 直接设置弹窗主体和内容区域,确保滚动正常工作 */
  256. .cbjs-info-container {
  257. width: 100%;
  258. height: 100%;
  259. }
  260. /* 关键修改:弹窗主体设置固定高度并隐藏溢出 */
  261. :deep(.el-dialog__body) {
  262. padding: 0 !important;
  263. height: calc(100vh - 200px);
  264. overflow: hidden;
  265. }
  266. /* 标签容器占满弹窗高度 */
  267. .audit-tabs {
  268. height: 100%;
  269. }
  270. /* 标签头保持固定位置 */
  271. .audit-tabs .el-tabs__header {
  272. margin-bottom: 0;
  273. padding: 15px 15px 0;
  274. background: #f5f7fa;
  275. border-bottom: 1px solid #ebeef5;
  276. }
  277. /* 核心修改:内容区域设置固定高度并允许垂直滚动 */
  278. .audit-tabs .el-tabs__content {
  279. height: calc(100% - 60px); /* 减去标签头的高度 */
  280. overflow-y: auto; /* 这是最重要的设置,确保内容超出时显示滚动条 */
  281. padding: 15px;
  282. box-sizing: border-box;
  283. }
  284. /* 优化滚动条样式 */
  285. .audit-tabs .el-tabs__content::-webkit-scrollbar {
  286. width: 8px;
  287. }
  288. .audit-tabs .el-tabs__content::-webkit-scrollbar-track {
  289. background: #f5f7fa;
  290. }
  291. .audit-tabs .el-tabs__content::-webkit-scrollbar-thumb {
  292. background: #ccc;
  293. border-radius: 4px;
  294. }
  295. .audit-tabs .el-tabs__content::-webkit-scrollbar-thumb:hover {
  296. background: #999;
  297. }
  298. /* 确保标签页内容不受限制 */
  299. .audit-tabs .el-tab-pane {
  300. height: auto;
  301. overflow: visible;
  302. }
  303. /* 确保子组件可以正常显示和滚动 */
  304. .audit-tabs .el-tab-pane > div {
  305. width: 100%;
  306. }
  307. /* 只读样式 */
  308. :deep(.el-form-item__content) {
  309. color: #909399;
  310. }
  311. :deep(.el-input__inner),
  312. :deep(.el-select__inner),
  313. :deep(.el-textarea__inner) {
  314. background-color: #f5f7fa;
  315. color: #909399;
  316. cursor: not-allowed;
  317. }
  318. :deep(.el-checkbox),
  319. :deep(.el-radio) {
  320. cursor: not-allowed;
  321. }
  322. :deep(.el-button) {
  323. pointer-events: none;
  324. opacity: 0.6;
  325. }
  326. </style>