table-collect.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <HcCard scrollbar>
  3. <template #header>
  4. <HcNewSwitch :datas="tabData" :keys="tabKey" :round="false" @change="tabChange" />
  5. </template>
  6. <template #extra>
  7. <HcTooltip keys="file_collection_btn_upload_scanned_files">
  8. <el-button type="primary" hc-btn @click="reportModalClick">
  9. <HcIcon name="git-pull-request" />
  10. <span>申请验收</span>
  11. </el-button>
  12. </HcTooltip>
  13. </template>
  14. <div class="hc-card-table-title">建设单位归档资料(1200卷)</div>
  15. <HcCardItem ui="h-half">
  16. <template #header>
  17. <span>一、立项审批</span>
  18. <span class="text-gray">(238卷)</span>
  19. </template>
  20. <HcTable
  21. ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
  22. heights="auto" is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
  23. @selection-change="tableSelection"
  24. />
  25. </HcCardItem>
  26. <HcCardItem ui="h-half">
  27. <template #header>
  28. <span>二、勘察设计文件</span>
  29. <span class="text-gray">(95卷)</span>
  30. </template>
  31. <HcTable ref="tableFileRef" :column="tableFileColumn" :datas="tableFileData" :loading="tableFileLoading" heights="auto" is-check @selection-change="tableeFileSelection" />
  32. </HcCardItem>
  33. </HcCard>
  34. <!-- 批量上报审批 -->
  35. <HcReportModal
  36. title="申请验收"
  37. widths="1080px"
  38. url="informationWriteQuery/batchTask"
  39. :show="showReportModal"
  40. :project-id="projectId"
  41. :contract-id="contractId"
  42. :task-name="reportTaskName"
  43. :ids="reportIds"
  44. is-datas
  45. :datas="reportDatas"
  46. @hide="showReportModal = false"
  47. @finish="showReportFinish"
  48. @tagClose="reportTaskTagClose"
  49. />
  50. </template>
  51. <script setup>
  52. import { nextTick, onMounted, ref, watch } from 'vue'
  53. import { getArrValue, getObjValue } from 'js-fast-way'
  54. import { rowsToId } from '~uti/tools'
  55. //参数
  56. const props = defineProps({
  57. projectId: {
  58. type: [String, Number],
  59. default: '',
  60. },
  61. contractId: {
  62. type: [String, Number],
  63. default: '',
  64. },
  65. treeData: {
  66. type: Object,
  67. default: () => ({}),
  68. },
  69. })
  70. //变量
  71. const projectId = ref(props.projectId)
  72. const contractId = ref(props.contractId)
  73. const nodeData = ref(props.treeData)
  74. //监听
  75. watch(() => [
  76. props.treeData,
  77. ], ([treeData]) => {
  78. nodeData.value = treeData
  79. })
  80. //渲染完成
  81. onMounted(() => {
  82. })
  83. //tab数据和相关处理
  84. const tabKey = ref('tab1')
  85. const tabData = ref([
  86. { key:'tab1', name: '全部汇总' },
  87. { key:'tab2', name: '历史验收报告' },
  88. { key:'tab3', name: '历史整改报告' },
  89. ])
  90. const tabChange = (item) => {
  91. tabKey.value = item?.key
  92. }
  93. //------立项审批
  94. //搜索表单
  95. const searchForm = ref({
  96. current: 1, size: 20, total: 0,
  97. })
  98. //分页被点击
  99. const pageChange = ({ current, size }) => {
  100. searchForm.value.current = current
  101. searchForm.value.size = size
  102. getTableData()
  103. }
  104. //表头
  105. const tableRef = ref(null)
  106. const tableColumn = ref([
  107. { key:'key1', name: '档号', width: 180 },
  108. { key:'key2', name: '案卷题名' },
  109. { key:'key3', name: '总页数', width: 120 },
  110. { key:'key4', name: '保管期限', width: 120 },
  111. { key:'key5', name: '备注' },
  112. ])
  113. const tableData = ref([
  114. {
  115. id: 1,
  116. key1: 'FJZB-02-123',
  117. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  118. key3: '293',
  119. key4: '永久',
  120. key5: '备注信息',
  121. },
  122. {
  123. id: 2,
  124. key1: 'FJZB-02-123',
  125. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  126. key3: '293',
  127. key4: '永久',
  128. key5: '备注信息',
  129. },
  130. {
  131. id: 2,
  132. key1: 'FJZB-02-123',
  133. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  134. key3: '293',
  135. key4: '永久',
  136. key5: '备注信息',
  137. },
  138. ])
  139. //获取数据
  140. const tableLoading = ref(false)
  141. const getTableData = async () => {
  142. }
  143. //多选
  144. const tableKeys = ref([])
  145. const tableSelection = (rows) => {
  146. tableKeys.value = rows
  147. }
  148. //------勘察设计文件
  149. //搜索表单
  150. const searchFormFile = ref({
  151. current: 1, size: 20, total: 0,
  152. })
  153. //分页被点击
  154. const pageFileChange = ({ current, size }) => {
  155. searchFormFile.value.current = current
  156. searchFormFile.value.size = size
  157. getTableFileData()
  158. }
  159. //表头
  160. const tableFileRef = ref(null)
  161. const tableFileColumn = ref([
  162. { key:'key1', name: '档号', width: 180 },
  163. { key:'key2', name: '案卷题名' },
  164. { key:'key3', name: '总页数', width: 120 },
  165. { key:'key4', name: '保管期限', width: 120 },
  166. { key:'key5', name: '备注' },
  167. ])
  168. const tableFileData = ref([
  169. {
  170. id: 1,
  171. key1: 'FJZB-02-123',
  172. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  173. key3: '293',
  174. key4: '永久',
  175. key5: '备注信息',
  176. },
  177. {
  178. id: 2,
  179. key1: 'FJZB-02-123',
  180. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  181. key3: '293',
  182. key4: '永久',
  183. key5: '备注信息',
  184. },
  185. {
  186. id: 2,
  187. key1: 'FJZB-02-123',
  188. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  189. key3: '293',
  190. key4: '永久',
  191. key5: '备注信息',
  192. },
  193. ])
  194. //获取数据
  195. const tableFileLoading = ref(false)
  196. const getTableFileData = async () => {
  197. }
  198. //多选
  199. const tableFileKeys = ref([])
  200. const tableeFileSelection = (rows) => {
  201. tableFileKeys.value = rows
  202. }
  203. //上报
  204. const reportIds = ref('')
  205. const reportTaskName = ref('')
  206. const reportDatas = ref([])
  207. const showReportModal = ref(false)
  208. const reportLoading = ref(false)
  209. const reportModalClick = async () => {
  210. const rows = tableKeys.value
  211. if (rows.length > 0) {
  212. //初始ID
  213. const row = getObjValue(rows[0])
  214. reportIds.value = rowsToId(rows)
  215. //设置任务数据
  216. let reportDataArr = []
  217. rows.forEach(item => {
  218. reportDataArr.push({
  219. id: item?.id,
  220. name: item?.key2,
  221. })
  222. })
  223. reportDatas.value = reportDataArr
  224. //设置任务名称
  225. reportTaskName.value = rows.length > 1 ? `${row.key2}等${rows.length}个文件` : row.key2
  226. reportLoading.value = false
  227. showReportModal.value = true
  228. } else {
  229. window.$message?.warning('请先勾选需要申请验收的数据')
  230. }
  231. }
  232. //上报的审批内容移除
  233. const reportTaskTagClose = (index) => {
  234. //const row = tableCheckedKeys.value[index];
  235. //tableListRef.value?.toggleRowSelection(row,false)
  236. }
  237. //上报完成
  238. const showReportFinish = () => {
  239. showReportModal.value = false
  240. //getTableData()
  241. }
  242. </script>
  243. <style lang="scss" scoped>
  244. @import '~style/transfer/scoped/initial.scss';
  245. </style>