initial-expert.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <div id="submit-report-layout-target" class="hc-page-box">
  3. <hc-new-card scrollbar>
  4. <template #header>
  5. <HcNewSwitch
  6. :datas="tabData" :keys="tabKey" :round="false" style="margin-right: 24px"
  7. @change="tabChange"
  8. />
  9. <HcTooltip keys="transfer_initial_expert_btn_preview">
  10. <el-button hc-btn type="primary" @click="previewClick">
  11. <HcIcon name="file-pdf" />
  12. <span>预览</span>
  13. </el-button>
  14. </HcTooltip>
  15. </template>
  16. <template #extra>
  17. <!-- transfer_initial_expert_btn_sampling -->
  18. <el-button color="#0581fe" hc-btn @click="submitReportClick">
  19. <HcIcon name="shield-check" />
  20. <span>开始抽检</span>
  21. </el-button>
  22. <HcTooltip keys="transfer_initial_expert_btn_submit_report">
  23. <el-button color="#7f83f7" hc-btn style="color: white" @click="writingConclusionClick">
  24. <HcIcon name="git-pull-request" />
  25. <span>编写结论</span>
  26. </el-button>
  27. </HcTooltip>
  28. <HcTooltip keys="transfer_initial_expert_btn_history_report">
  29. <el-button color="#38b54a" hc-btn style="color: white" @click="onSubmitReportClick">
  30. <HcIcon name="history" />
  31. <span>查看验收报告</span>
  32. </el-button>
  33. </HcTooltip>
  34. </template>
  35. <div v-if="totalData.length > 0" v-loading="totalLoaing" class="h-screen">
  36. <div v-for="(item, index) in totalData" :key="index">
  37. <div class="hc-card-table-title">{{ item?.unitInfo }}</div>
  38. <template v-for="(item1, index1) in item?.nodeLists" :key="index1">
  39. <HcCardItem v-if="item1.list && item1.list.length > 0" ui="h-half">
  40. <template #header>
  41. <span>{{ item1.nodeInfo }}</span>
  42. <!-- <span class="text-gray">(238卷)</span> -->
  43. </template>
  44. <div :style="`height: ${item1.list !== null && item1.list.length > 9 ? '300px' : 'auto'};`">
  45. <!-- <HcTable
  46. ref="tableRef" :column="tableColumn" :datas="item1.list" :loading="tableLoading"
  47. is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
  48. @selection-change="tableSelection"
  49. /> -->
  50. <visualTable :table-data="item1.list " :is-check="false" @get-table-keys="getTableKeys" />
  51. </div>
  52. </HcCardItem>
  53. </template>
  54. </div>
  55. </div>
  56. <div v-else class=" h-screen">
  57. <HcNoData />
  58. </div>
  59. </hc-new-card>
  60. <!-- 历史报告 -->
  61. <HcDrawer
  62. :show="isSubmitReportDrawer" to-id="submit-report-layout-target" uis="hc-submit-report-target"
  63. @close="onSubmitReportDrawerClose"
  64. >
  65. <template #header>
  66. <div class="hc-select-view w-52">
  67. <el-select v-model="pdfDate" placeholder="选择日期" @change="changePdfDate">
  68. <el-option v-for="item in timeData " :label="item" :value="item" />
  69. </el-select>
  70. </div>
  71. <div class="hc-title-view">{{ tableTitle }}</div>
  72. </template>
  73. <template #extra>
  74. <div class="hc-icon-view text-hover" @click="onSubmitReportDrawerClose">
  75. <HcIcon name="close" />
  76. </div>
  77. </template>
  78. <HcPdf
  79. :src="curPdf"
  80. />
  81. </HcDrawer>
  82. </div>
  83. </template>
  84. <script setup>
  85. import { onMounted, ref } from 'vue'
  86. import { useRouter } from 'vue-router'
  87. import { useAppStore } from '~src/store'
  88. import initialgApi from '~api/initial/initial'
  89. import { arrToKey, getArrValue, isObjNull } from 'js-fast-way'
  90. import visualTable from './components/visual-table.vue'
  91. //变量
  92. const router = useRouter()
  93. const useAppState = useAppStore()
  94. const projectId = ref(useAppState.getProjectId)
  95. const contractId = ref(useAppState.getContractId)
  96. const projectInfo = ref(useAppState.getProjectInfo)
  97. //渲染完成
  98. onMounted(() => {
  99. getTotalData()
  100. })
  101. //tab数据和相关处理
  102. const tabKey = ref('1')
  103. const tabData = ref([
  104. { key: '1', name: '建设单位归档资料' },
  105. { key: '2', name: '监理单位归档资料' },
  106. { key: '3', name: '施工单位归档资料' },
  107. { key: '4', name: '科研、新技术资料' },
  108. ])
  109. const tabChange = (item) => {
  110. tabKey.value = item?.key
  111. getTotalData()
  112. }
  113. //多选
  114. const tableKeys = ref([])
  115. const getTableKeys = (val)=>{
  116. tableKeys.value = val
  117. }
  118. const totalData = ref([])
  119. const totalLoaing = ref(false)
  120. const getTotalData = async ()=>{
  121. totalLoaing.value = true
  122. const { error, code, data } = await initialgApi.getUnitArchivesAutoView({
  123. projectId: projectId.value,
  124. unitType:tabKey.value,
  125. })
  126. totalLoaing.value = false
  127. if (!error && code === 200) {
  128. if (!isObjNull(data)) {
  129. totalData.value = [ data]
  130. } else {
  131. totalData.value = []
  132. }
  133. } else {
  134. totalData.value = []
  135. }
  136. }
  137. //------立项审批
  138. //搜索表单
  139. const searchForm = ref({
  140. current: 1, size: 20, total: 0,
  141. })
  142. //分页被点击
  143. const pageChange = ({ current, size }) => {
  144. searchForm.value.current = current
  145. searchForm.value.size = size
  146. getTableData()
  147. }
  148. //表头
  149. const tableRef = ref(null)
  150. const tableColumn = ref([
  151. { key:'fileNumber', name: '档号', width: 180 },
  152. { key:'name', name: '案卷题名' },
  153. { key:'pageN', name: '总页数', width: 120 },
  154. { key:'storageTimeValue', name: '保管期限', width: 120 },
  155. { key:'remark', name: '备注' },
  156. ])
  157. const tableData = ref([
  158. {
  159. id: 1,
  160. key1: 'FJZB-02-123',
  161. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  162. key3: '293',
  163. key4: '永久',
  164. key5: '备注信息',
  165. },
  166. {
  167. id: 2,
  168. key1: 'FJZB-02-123',
  169. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  170. key3: '293',
  171. key4: '永久',
  172. key5: '备注信息',
  173. },
  174. {
  175. id: 2,
  176. key1: 'FJZB-02-123',
  177. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  178. key3: '293',
  179. key4: '永久',
  180. key5: '备注信息',
  181. },
  182. ])
  183. //获取数据
  184. const tableLoading = ref(false)
  185. const getTableData = async () => {
  186. }
  187. //------勘察设计文件
  188. //搜索表单
  189. const searchFormFile = ref({
  190. current: 1, size: 20, total: 0,
  191. })
  192. //分页被点击
  193. const pageFileChange = ({ current, size }) => {
  194. searchFormFile.value.current = current
  195. searchFormFile.value.size = size
  196. getTableFileData()
  197. }
  198. //表头
  199. const tableFileRef = ref(null)
  200. const tableFileColumn = ref([
  201. { key: 'key1', name: '档号', width: 180 },
  202. { key: 'key2', name: '案卷题名' },
  203. { key: 'key3', name: '总页数', width: 120 },
  204. { key: 'key4', name: '保管期限', width: 120 },
  205. { key: 'key5', name: '备注' },
  206. ])
  207. const tableFileData = ref([
  208. {
  209. id: 1,
  210. key1: 'FJZB-02-123',
  211. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  212. key3: '293',
  213. key4: '永久',
  214. key5: '备注信息',
  215. },
  216. {
  217. id: 2,
  218. key1: 'FJZB-02-123',
  219. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  220. key3: '293',
  221. key4: '永久',
  222. key5: '备注信息',
  223. },
  224. {
  225. id: 2,
  226. key1: 'FJZB-02-123',
  227. key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  228. key3: '293',
  229. key4: '永久',
  230. key5: '备注信息',
  231. },
  232. ])
  233. //获取数据
  234. const getTableFileData = async () => {
  235. }
  236. //编写结论
  237. const writingConclusionClick = () => {
  238. router.push({
  239. name: 'transfer-writing-conclusion',
  240. })
  241. }
  242. //开始抽检
  243. const submitReportClick = async () => {
  244. const { error, code, data, msg } = await initialgApi.startInspect({
  245. projectId: projectId.value,
  246. })
  247. if (!error && code === 200) {
  248. console.log(data, 'data')
  249. if (data) {
  250. router.push({
  251. name: 'transfer-entry-sampling',
  252. })
  253. } else {
  254. router.push({
  255. name: 'transfer-preliminary-examination',
  256. })
  257. }
  258. }
  259. // router.push({
  260. // name: 'transfer-entry-sampling',
  261. // })
  262. }
  263. //历史报告
  264. //历史报告
  265. const isSubmitReportDrawer = ref(false)
  266. const reportData = ref([])
  267. const timeData = ref([])
  268. const onSubmitReportClick = async () => {
  269. const { error, code, data } = await initialgApi.getHistoryTable({
  270. projectId: projectId.value,
  271. })
  272. if (!error && code === 200) {
  273. reportData.value = getArrValue(data)
  274. const dataString = arrToKey( reportData.value, 'approveDate', ',')
  275. timeData.value = dataString.split(',')
  276. if (timeData.value.length > 0) {
  277. pdfDate.value = timeData.value[0]
  278. curPdf.value = reportData.value[0].tableUrl
  279. tableTitle.value = reportData.value[0].tableTitle
  280. isSubmitReportDrawer.value = true
  281. }
  282. } else {
  283. reportData.value = []
  284. }
  285. }
  286. const pdfDate = ref(null)
  287. const curPdf = ref('')
  288. const tableTitle = ref('')
  289. //历史报告
  290. const onSubmitReportDrawerClose = () => {
  291. isSubmitReportDrawer.value = false
  292. curPdf.value = ''
  293. }
  294. const changePdfDate = (val)=>{
  295. reportData.value.forEach((ele)=>{
  296. if (ele.approveDate === val) {
  297. curPdf.value = ele.tableUrl
  298. tableTitle.value = ele.tableTitle
  299. }
  300. })
  301. }
  302. //预览
  303. const previewClick = async ()=>{
  304. const { error, code, data, msg } = await initialgApi.getAppPreview({
  305. projectId: projectId.value,
  306. })
  307. if (!error && code === 200) {
  308. if (data) {
  309. window.open(data, '_blank')
  310. } else {
  311. window.$message?.warning('文件不存在')
  312. }
  313. }
  314. }
  315. //查看验收报告
  316. // const getReportClick = async ()=>{
  317. // const { error, code, data, msg } = await initialgApi.getTable({
  318. // projectId: projectId.value,
  319. // })
  320. // if (!error && code === 200) {
  321. // if (data) {
  322. // window.open(data, '_blank')
  323. // } else {
  324. // window.$message?.warning('文件不存在')
  325. // }
  326. // }
  327. // }
  328. </script>
  329. <style lang="scss" scoped>
  330. @import '~style/transfer/scoped/initial-expert.scss';
  331. </style>
  332. <style lang="scss">
  333. .hc-submit-report-target.el-overlay {
  334. position: absolute;
  335. margin: -24px;
  336. height: revert;
  337. background-color: transparent;
  338. .hc-drawer-box.el-drawer {
  339. --el-drawer-bg-color: transparent;
  340. .el-drawer__body {
  341. padding: 24px;
  342. overflow: hidden;
  343. .hc-card-box {
  344. padding: 10px;
  345. .el-card__header {
  346. padding: 10px;
  347. .hc-card-header-box .hc-card-header {
  348. .hc-select-view {
  349. position: absolute;
  350. z-index: 11;
  351. }
  352. .hc-title-view {
  353. font-weight: bold;
  354. font-size: 20px;
  355. text-align: center;
  356. position: relative;
  357. width: 100%;
  358. }
  359. .hc-icon-view {
  360. position: absolute;
  361. right: 0;
  362. font-size: 26px;
  363. z-index: 11;
  364. }
  365. }
  366. }
  367. .el-card__body {
  368. padding: 10px;
  369. }
  370. }
  371. }
  372. }
  373. }
  374. </style>