table-collect.vue 7.3 KB

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