table-collect.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <hc-new-card scrollbar>
  3. <template #header />
  4. <template #extra>
  5. <!-- <HcNewSwitch :datas="tabData" :keys="tabKey" :round="false" @change="tabChange" /> -->
  6. <el-button hc-btn color="#626aef">
  7. <HcIcon name="eye" />
  8. <span>历史验收报告</span>
  9. </el-button>
  10. <el-button hc-btn class=" m-1" type="warning">
  11. <HcIcon name="eye" />
  12. <span>历史整改报告</span>
  13. </el-button>
  14. <HcTooltip keys="file_collection_btn_upload_scanned_files">
  15. <el-button v-if="!showBtn" type="primary" hc-btn @click="reportModalClick">
  16. <HcIcon name="git-pull-request" />
  17. <span>申请验收</span>
  18. </el-button>
  19. <el-button v-else type="primary" hc-btn @click="cancelClick">
  20. <HcIcon name="git-pull-request" />
  21. <span>撤回验收申请</span>
  22. </el-button>
  23. </HcTooltip>
  24. </template>
  25. <div v-loading="totalLoaing" class="h-screen">
  26. <div v-for="(item) in totalData" :key="item.unitInfo">
  27. <div class="hc-card-table-title">{{ item.unitInfo }}</div>
  28. <template v-for="(item1) in item.nodeLists" :key="item1.nodeInfo">
  29. <HcCardItem v-if="item1.list !== null" ui="h-half">
  30. <template #header>
  31. <span>{{ item1.nodeInfo }}</span>
  32. <!-- <span class="text-gray">(238卷)</span> -->
  33. </template>
  34. <div :style="`height: ${item1.list !== null ? '300px' : 'auto'};`">
  35. <!-- <HcTable
  36. ref="tableRef" :column="tableColumn" :datas="item1.list" :loading="tableLoading"
  37. is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
  38. @selection-change="tableSelection"
  39. /> -->
  40. <visualTable :table-data="item1.list " />
  41. </div>
  42. </HcCardItem>
  43. </template>
  44. </div>
  45. </div>
  46. </hc-new-card>
  47. <!-- 批量上报审批 -->
  48. <HcReportModal
  49. title="申请验收"
  50. widths="1080px"
  51. url="archivesauto/saveApply"
  52. :show="showReportModal"
  53. :project-id="projectId"
  54. :contract-id="contractId"
  55. :task-name="reportTaskName"
  56. :ids="reportIds"
  57. is-datas
  58. :datas="reportDatas"
  59. @hide="showReportModal = false"
  60. @finish="showReportFinish"
  61. @tagClose="reportTaskTagClose"
  62. />
  63. </template>
  64. <script setup>
  65. import { nextTick, onMounted, ref, watch } from 'vue'
  66. import { getArrValue, getObjValue } from 'js-fast-way'
  67. import { rowsToId } from '~uti/tools'
  68. import initialgApi from '~api/initial/initial'
  69. import visualTable from './visual-table.vue'
  70. //参数
  71. const props = defineProps({
  72. projectId: {
  73. type: [String, Number],
  74. default: '',
  75. },
  76. contractId: {
  77. type: [String, Number],
  78. default: '',
  79. },
  80. treeData: {
  81. type: Object,
  82. default: () => ({}),
  83. },
  84. })
  85. //变量
  86. const projectId = ref(props.projectId)
  87. const contractId = ref(props.contractId)
  88. const nodeData = ref(props.treeData)
  89. //监听
  90. watch(() => [
  91. props.treeData,
  92. ], ([treeData]) => {
  93. nodeData.value = treeData
  94. })
  95. //渲染完成
  96. onMounted(() => {
  97. getBtnstatus()
  98. getTotalData()
  99. })
  100. //查看验收申请状态
  101. const showBtn = ref(true)
  102. const getBtnstatus = async ()=>{
  103. const { error, code, data } = await initialgApi.getApplyStatus({
  104. projectId: projectId.value,
  105. })
  106. if (!error && code === 200) {
  107. console.log(data, 'data')
  108. showBtn.value = data
  109. } else {
  110. showBtn.value = true
  111. }
  112. }
  113. const totalData = ref([])
  114. const totalLoaing = ref(false)
  115. const getTotalData = async ()=>{
  116. totalLoaing.value = true
  117. const { error, code, data } = await initialgApi.getAllUnitArchivesView({
  118. projectId: projectId.value,
  119. })
  120. totalLoaing.value = false
  121. if (!error && code === 200) {
  122. console.log(data, 'data')
  123. totalData.value = getArrValue(data)
  124. } else {
  125. totalData.value = []
  126. }
  127. }
  128. //tab数据和相关处理
  129. const tabKey = ref('tab2')
  130. const tabData = ref([
  131. // { key:'tab1', name: '全部汇总' },
  132. { key:'tab2', name: '历史验收报告' },
  133. { key:'tab3', name: '历史整改报告' },
  134. ])
  135. const tabChange = (item) => {
  136. tabKey.value = item?.key
  137. }
  138. //------立项审批
  139. //搜索表单
  140. const searchForm = ref({
  141. current: 1, size: 20, total: 0,
  142. })
  143. //分页被点击
  144. const pageChange = ({ current, size }) => {
  145. searchForm.value.current = current
  146. searchForm.value.size = size
  147. getTableData()
  148. }
  149. //表头
  150. const tableRef = ref(null)
  151. const tableColumn = ref([
  152. { key:'fileNumber', name: '档号', width: 180 },
  153. { key:'name', name: '案卷题名' },
  154. { key:'pageN', name: '总页数', width: 120 },
  155. { key:'storageTimeValue', name: '保管期限', width: 120 },
  156. { key:'remark', name: '备注' },
  157. ])
  158. const tableData = ref([])
  159. //获取数据
  160. const tableLoading = ref(false)
  161. const getTableData = async () => {
  162. }
  163. //多选
  164. const tableKeys = ref([])
  165. const tableSelection = (rows) => {
  166. tableKeys.value = rows
  167. }
  168. //------勘察设计文件
  169. //搜索表单
  170. const searchFormFile = ref({
  171. current: 1, size: 20, total: 0,
  172. })
  173. //分页被点击
  174. const pageFileChange = ({ current, size }) => {
  175. searchFormFile.value.current = current
  176. searchFormFile.value.size = size
  177. getTableFileData()
  178. }
  179. //表头
  180. const tableFileRef = ref(null)
  181. const tableFileColumn = ref([
  182. { key:'key1', name: '档号', width: 180 },
  183. { key:'key2', name: '案卷题名' },
  184. { key:'key3', name: '总页数', width: 120 },
  185. { key:'key4', name: '保管期限', width: 120 },
  186. { key:'key5', name: '备注' },
  187. ])
  188. const tableFileData = ref([
  189. {
  190. id: 1,
  191. key1: 'FJZB-02-123',
  192. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  193. key3: '293',
  194. key4: '永久',
  195. key5: '备注信息',
  196. },
  197. {
  198. id: 2,
  199. key1: 'FJZB-02-123',
  200. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  201. key3: '293',
  202. key4: '永久',
  203. key5: '备注信息',
  204. },
  205. {
  206. id: 2,
  207. key1: 'FJZB-02-123',
  208. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  209. key3: '293',
  210. key4: '永久',
  211. key5: '备注信息',
  212. },
  213. ])
  214. //获取数据
  215. const tableFileLoading = ref(false)
  216. const getTableFileData = async () => {
  217. }
  218. //多选
  219. const tableFileKeys = ref([])
  220. const tableeFileSelection = (rows) => {
  221. tableFileKeys.value = rows
  222. }
  223. //上报
  224. const reportIds = ref('')
  225. const reportTaskName = ref('')
  226. const reportDatas = ref([])
  227. const showReportModal = ref(false)
  228. const reportLoading = ref(false)
  229. const reportModalClick = async () => {
  230. const rows = tableKeys.value
  231. console.log(rows, 'rows验收申请行')
  232. if (rows.length > 0) {
  233. //初始ID
  234. const row = getObjValue(rows[0])
  235. reportIds.value = rowsToId(rows)
  236. //设置任务数据
  237. let reportDataArr = []
  238. rows.forEach(item => {
  239. reportDataArr.push({
  240. id: item?.id,
  241. name: item?.name,
  242. })
  243. })
  244. reportDatas.value = reportDataArr
  245. //设置任务名称
  246. reportTaskName.value = rows.length > 1 ? `${row.name}等${rows.length}个文件` : row.name
  247. reportLoading.value = false
  248. showReportModal.value = true
  249. } else {
  250. window.$message?.warning('请先勾选需要申请验收的数据')
  251. }
  252. }
  253. //上报的审批内容移除
  254. const reportTaskTagClose = (index) => {
  255. //const row = tableCheckedKeys.value[index];
  256. //tableListRef.value?.toggleRowSelection(row,false)
  257. }
  258. //上报完成
  259. const showReportFinish = async () => {
  260. showReportModal.value = false
  261. tableKeys.value = []
  262. await getBtnstatus()
  263. getTotalData()
  264. }
  265. //撤回验收申请
  266. const cancelClick = ()=>{
  267. window?.$messageBox?.alert('确认撤销? 撤销之后专家账号也一并清空删除', '提示', {
  268. showCancelButton: true,
  269. confirmButtonText: '确认撤销',
  270. cancelButtonText: '取消',
  271. callback: async (action, ctx ) => {
  272. if (action === 'confirm') {
  273. ctx.confirmButtonLoading = true
  274. const { code, msg, error } = await initialgApi.annulApply({
  275. projectId:projectId.value,
  276. })
  277. ctx.confirmButtonLoading = true
  278. if (!error && code === 200) {
  279. window.$message?.success(msg)
  280. getBtnstatus()
  281. getTotalData()
  282. }
  283. }
  284. },
  285. })
  286. }
  287. </script>
  288. <style lang="scss" scoped>
  289. @import '~style/transfer/scoped/initial.scss';
  290. </style>