inspects.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <template>
  2. <div class="hc-page-layout-box" id="carry-spot-checks-layout-target">
  3. <div class="hc-layout-left-box" :style="'width:' + leftWidth + 'px;'" v-show="!isCarrySpotChecksDrawer">
  4. <div class="hc-project-box">
  5. <div class="hc-project-icon-box">
  6. <HcIcon name="stack"/>
  7. </div>
  8. <div class="ml-2 project-name-box">
  9. <span class="text-xl text-cut project-alias">{{projectInfo['projectAlias']}}</span>
  10. <div class="text-xs text-cut project-name">{{projectInfo['name']}}</div>
  11. </div>
  12. </div>
  13. <div class="hc-tree-box" v-loading="treeLoading" element-loading-text="加载中...">
  14. <el-scrollbar>
  15. <HcTree :projectId="projectId" :contractId="contractId" @nodeTap="projectTreeClick" @nodeLoading="treeNodeLoading" :autoExpandKeys="treeAutoExpandKeys" @menuTap="ElTreeMenuClick"/>
  16. </el-scrollbar>
  17. </div>
  18. <!--左右拖动-->
  19. <div class="horizontal-drag-line" @mousedown="onmousedown"/>
  20. </div>
  21. <div class="hc-page-content-box" v-show="!isCarrySpotChecksDrawer">
  22. <HcCard title="已形成的案卷">
  23. <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" @row-click="tableRowClick">
  24. <template #name="{row}">
  25. <div class="text-link" :class="row.isReviewed === 1 ? 'text-green' : 'text-blue'">{{row?.name}}</div>
  26. </template>
  27. </HcTable>
  28. <template #action>
  29. <HcPages :pages="searchForm" @change="pageChange"/>
  30. </template>
  31. </HcCard>
  32. </div>
  33. <!--展开抽查-->
  34. <HcDrawer :show="isCarrySpotChecksDrawer" uis="hc-carry-spot-checks-target" to-id="carry-spot-checks-layout-target" @close="onCarrySpotChecksDrawerClose">
  35. <div class="hc-carry-spot-checks-pdf">
  36. <HcPdf :src="pdfUrl" v-loading="pdfLoading"/>
  37. <el-tooltip content="展开/收起 右侧目录" placement="top" :disabled="!isBubble">
  38. <div class="hc-csc-pdf-btn" @click="onCarryDataShow">
  39. <HcIcon name="arrow-right-s" v-show="isCarryDataShow"/>
  40. <HcIcon name="arrow-left-s" v-show="!isCarryDataShow"/>
  41. </div>
  42. </el-tooltip>
  43. </div>
  44. <div class="hc-carry-spot-checks-data" v-show="isCarryDataShow">
  45. <div class="hc-csc-switch">
  46. <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" size="default" :round="false"/>
  47. </div>
  48. <div class="hc-csc-info-box">
  49. <el-scrollbar>
  50. <div class="hc-info-text-item">
  51. <div class="title">案卷题名:</div>
  52. <div class="content">{{ fileInfo.name }}</div>
  53. </div>
  54. <div class="hc-info-text-item">
  55. <div class="title">
  56. <span>密</span>
  57. <span class="ml-7">级:</span>
  58. </div>
  59. <div class="content">{{ fileInfo.secretLevelValue }}</div>
  60. </div>
  61. <div class="hc-info-text-item">
  62. <div class="title">保管期限:</div>
  63. <div class="content">{{ fileInfo.storageTimeValue }}</div>
  64. </div>
  65. <div class="hc-info-text-item">
  66. <div class="title">卷内文件:</div>
  67. <div class="content">{{ fileInfo.pageNumber }}</div>
  68. </div>
  69. <div class="hc-info-text-item">
  70. <div class="title">起止日期:</div>
  71. <div class="content" v-if="fileInfo?.endDate!==''||fileInfo?.startDate!==''">{{ splitDate(fileInfo?.startDate)+"~"+ splitDate(fileInfo?.endDate)}}</div>
  72. <div class="content" v-else></div>
  73. </div>
  74. <div class="hc-info-text-item">
  75. <div class="title">立卷单位:</div>
  76. <div class="content">{{ fileInfo.unit }}</div>
  77. </div>
  78. </el-scrollbar>
  79. </div>
  80. <div class="hc-csc-data-box" :style="{height:checkId ? '' : 'calc(100% - 363px)'}">
  81. <HcTable :column="cscTableColumn1" :datas="cscTableData1" :loading="cscTableLoading" :isArrIndex="false" v-if="tabTypeKey === 'tab1'">
  82. <template #name="{row}">
  83. <div :class="row.id === checkId ? 'text-link' : 'text-hover'" @click="changePdf(row)">{{row?.fileName}}</div>
  84. </template>
  85. </HcTable>
  86. <HcTable :column="cscTableColumn2" :datas="cscTableData2" :loading="cscTableLoading" :isIndex="false" v-if="tabTypeKey === 'tab2'">
  87. <template #name="{row}">
  88. <div :class="row.id === 2 ? 'text-link' : 'text-hover'">{{row?.name}}</div>
  89. </template>
  90. </HcTable>
  91. <HcTable :column="cscTableColumn3" :datas="cscTableData3" :loading="cscTableLoading" :isIndex="false" v-if="tabTypeKey === 'tab3'">
  92. <template #name="{row}">
  93. <div :class="row.id === 2 ? 'text-link' : 'text-hover'">{{row?.name}}</div>
  94. </template>
  95. </HcTable>
  96. <HcTable :column="cscTableColumn4" :datas="cscTableData4" :loading="cscTableLoading" :isIndex="false" v-if="tabTypeKey === 'tab4'">
  97. <template #name="{row}">
  98. <div class="hc-csc-associated-row" :class="row.id === 2 ? 'text-link' : 'text-hover'">
  99. <el-tag effect="dark">{{row?.tag}}</el-tag>
  100. <span class="ml-3">{{row?.name}}</span>
  101. </div>
  102. </template>
  103. </HcTable>
  104. <MetaTable :loading="cscTableLoading" v-if="tabTypeKey === 'tab5'"/>
  105. <HcTable :column="cscTableColumn5" :datas="cscTableData5" :loading="cscTableLoading" v-if="tabTypeKey === 'tab6'"/>
  106. <el-tooltip content="使用弹窗查看数据" placement="top" :disabled="!isBubble" v-if="tabTypeKey === 'tab6' || tabTypeKey === 'tab5'">
  107. <div class="hc-table-info-btn" @click="cscTableDataModalShow">
  108. <HcIcon name="airplay"/>
  109. </div>
  110. </el-tooltip>
  111. </div>
  112. <div class="hc-csc-action-box" v-if="checkId">
  113. <div class="header-box">
  114. <div class="title">抽检意见:</div>
  115. <div class="extra">
  116. <el-checkbox class="size-xl" v-model="reform.type" >需要整改</el-checkbox>
  117. </div>
  118. </div>
  119. <div class="textarea-box">
  120. <div @click="contentClick" v-if="ishowAllopinion" >
  121. <el-input v-model="reform.content" type="textarea" :autosize="{ minRows: 5}" resize="none" placeholder="请填写抽检意见" disabled/>
  122. </div>
  123. <div v-else>
  124. <el-input v-model="reform.myOpinion" type="textarea" :autosize="{ minRows: 5}" resize="none" placeholder="请填写抽检意见" />
  125. </div>
  126. </div>
  127. <div class="btn-box">
  128. <el-button hc-btn @click="onCarrySpotChecksDrawerClose">
  129. <HcIcon name="close"/>
  130. <span>取消查阅</span>
  131. </el-button>
  132. <el-button type="primary" hc-btn @click="submitOpinion" :loading="submitLoading" :disabled="ishowAllopinion">
  133. <HcIcon name="check"/>
  134. <span>保存抽检意见</span>
  135. </el-button>
  136. </div>
  137. </div>
  138. <div class="btn-box" style="text-align: center;" v-if="checkId.length==0">
  139. <el-button hc-btn @click="onCarrySpotChecksDrawerClose">
  140. <HcIcon name="close"/>
  141. <span>取消查阅</span>
  142. </el-button>
  143. </div >
  144. </div>
  145. </HcDrawer>
  146. <!--使用弹窗查看数据-->
  147. <HcDialog :show="cscTableDataModal" :title="cscTableDataTitle" widths="1080px" isTable :footer="false" @close="cscTableDataModalClose">
  148. <MetaTable :loading="cscTableLoading" v-if="tabTypeKey === 'tab5'"/>
  149. <HcTable :column="cscTableColumn51" :datas="cscTableData5" :loading="cscTableLoading" v-if="tabTypeKey === 'tab6'"/>
  150. </HcDialog>
  151. </div>
  152. </template>
  153. <script setup>
  154. import {ref, watch, onMounted, nextTick,onActivated} from "vue";
  155. import {useAppStore} from "~src/store";
  156. import { getArrValue, getObjValue} from "js-fast-way"
  157. import HcTree from "~src/components/tree/hc-tree.vue"
  158. import MetaTable from "./components/meta-table.vue"
  159. import {getStoreValue, setStoreValue} from '~src/utils/storage'
  160. import tuningApi from "~api/archiveConfig/tuning.js";
  161. import inspectApi from "~api/transfer/inspects.js";
  162. //变量
  163. const useAppState = useAppStore()
  164. const projectId = ref(useAppState.getProjectId);
  165. const contractId = ref(useAppState.getContractId);
  166. const projectInfo = ref(useAppState.getProjectInfo);
  167. const isCollapse = ref(useAppState.getCollapse)
  168. const isBubble = ref(useAppState.getBubble);
  169. const userInfo = ref(useAppState.getUserInfo);
  170. //监听
  171. watch(() => [
  172. useAppState.getCollapse,
  173. useAppState.getBubble,
  174. ], ([Collapse, bubble]) => {
  175. isCollapse.value = Collapse
  176. isBubble.value = bubble
  177. })
  178. //渲染完成
  179. onMounted(() => {
  180. setTableColumns()
  181. })
  182. //缓存被激活时
  183. onActivated(() => {
  184. getTableData()
  185. })
  186. //树加载
  187. const treeLoading = ref(true)
  188. const treeNodeLoading = () => {
  189. treeLoading.value = false
  190. }
  191. //搜索表单
  192. const searchForm = ref({
  193. current: 1, size: 20, total: 0
  194. })
  195. //树相关的变量
  196. const primaryKeyId = ref('')
  197. //自动展开缓存
  198. const treeAutoExpandKeys = ref(getStoreValue('inspectExpandKeys') || [])
  199. const projectTreeClick = ({node, data, keys, key}) => {
  200. console.log(data)
  201. //缓存展开的节点
  202. setStoreValue('inspectExpandKeys', keys)
  203. treeAutoExpandKeys.value = keys || []
  204. searchForm.value.total = 0
  205. searchForm.value.current = 1
  206. searchForm.value.size = 20
  207. searchForm.value.nodeIds = data.id || '';
  208. getTableData()
  209. }
  210. //树菜单被点击
  211. const ElTreeMenuClick = async ({key,node,data}) => {
  212. setStoreValue('inspectExpandKeys', keys)
  213. }
  214. //分页被点击
  215. const pageChange = ({current, size}) => {
  216. searchForm.value.current = current
  217. searchForm.value.size = size
  218. getTableData()
  219. }
  220. //表格数据
  221. const tableRef = ref(null)
  222. const tableColumn = ref([])
  223. //设置表头
  224. const setTableColumns = () => {
  225. tableColumn.value = [
  226. {key: 'fileNumber', name: '档号'},
  227. {key: 'name', name: '案卷题名', width: 500},
  228. {key: 'storageTimeValue', name: '保管期限'},
  229. {key: 'pageN', name: '总页数'},
  230. {key:'unit', name: '立卷单位', width: 150},
  231. {key:'remark', name: '备注', width: 150}
  232. ]
  233. }
  234. const tableData = ref([])
  235. //获取数据
  236. const tableLoading = ref(false)
  237. const getTableData = async () => {
  238. tableLoading.value = true
  239. const {error, code, data} = await tuningApi.pageByArchive({
  240. ...searchForm.value,
  241. projectId: projectId.value,
  242. contractId: contractId.value,
  243. isArchive: 1
  244. })
  245. tableLoading.value = false
  246. if (!error && code === 200) {
  247. tableData.value = getArrValue(data?.records)
  248. searchForm.value.total = data?.total || 0
  249. } else {
  250. tableData.value = []
  251. searchForm.value.total = 0
  252. }
  253. }
  254. //截取日期
  255. const splitDate=(val)=>{
  256. return val.substring( 0,10)
  257. }
  258. //查阅案卷pdf
  259. const viewPdf = async (id) => {
  260. window.$message?.info('预览案卷需要合并pdf,需要一点时间')
  261. pdfLoading.value=true
  262. const {error, code, data, msg} = await tuningApi.printArchive({
  263. id: id
  264. })
  265. pdfLoading.value=false
  266. if (!error && code === 200) {
  267. if (data) {
  268. return data
  269. } else {
  270. window.$message?.warning('文件不存在')
  271. }
  272. }
  273. }
  274. //行被点击
  275. const isCarrySpotChecksDrawer = ref(false)
  276. const fileInfo=ref('')
  277. const tableRowClick = async({row}) => {
  278. //console.log(row)
  279. fileInfo.value=row
  280. fileInfo.value.pageNumber=row['approvalFileList'].length||0
  281. cscTableData1.value=getArrValue( row['approvalFileList'])
  282. isCarrySpotChecksDrawer.value = true
  283. ishowAllopinion.value=true
  284. checkId.value=''
  285. const url=await viewPdf(row.id)
  286. pdfUrl.value=url
  287. if(pdfUrl.value&&pdfUrl?.value.length>0&& isCarrySpotChecksDrawer.value){
  288. setTimeout(() => {
  289. serReviewFile()
  290. }, 20000);
  291. }
  292. }
  293. //设置为已查阅
  294. const serReviewFile=async()=>{
  295. const {error, code, data, msg} = await inspectApi.setreview({
  296. id: fileInfo.value.id
  297. })
  298. }
  299. const checkId=ref('')
  300. const pdfUrl=ref('')
  301. const pdfLoading=ref(false)
  302. const changePdf=(row)=>{
  303. console.log(row,'row');
  304. pdfLoading.value=false
  305. pdfUrl.value=row['pdfFileUrl']||''
  306. checkId.value=row.id
  307. ishowAllopinion.value=true
  308. getopiniondata()
  309. if(pdfUrl.value&&pdfUrl?.value.length>0&& isCarrySpotChecksDrawer.value){
  310. setTimeout(() => {
  311. serReviewFile()
  312. }, 20000);
  313. }
  314. }
  315. const opid=ref('')
  316. //获取抽检意见
  317. const getopiniondata=async()=>{
  318. const {error, code, data, msg} = await inspectApi.getOpinion({
  319. fileId: checkId.value
  320. })
  321. if (!error && code === 200) {
  322. console.log(data,'data');
  323. let opiniondata=getObjValue(data)
  324. reform.value.content=opiniondata?.allOpinion
  325. reform.value.type=opiniondata?.allOpinion?.length>0?true:false
  326. reform.value.myOpinion=opiniondata?.opinion
  327. opid.value=opiniondata?.id
  328. }
  329. }
  330. //保存抽检意见
  331. const submitLoading=ref(false)
  332. const submitOpinion=async()=>{
  333. submitLoading.value=true
  334. const {error, code, data, msg} = await inspectApi.addOpinion({
  335. fileId: checkId.value,
  336. archiveId:fileInfo.value.id,
  337. // opinion:reform.value.content,
  338. opinion:reform.value.myOpinion,
  339. projectId:projectId.value,
  340. userId:userInfo.value.user_id,
  341. archiveName:fileInfo.value.name,
  342. id: opid.value||null
  343. })
  344. submitLoading.value=false
  345. if (!error && code === 200) {
  346. window.$message.success(msg)
  347. serReviewFile()
  348. getTableData()
  349. }
  350. // addOpinion
  351. }
  352. //类型tab数据和相关处理
  353. const tabTypeKey = ref('tab1')
  354. const tabTypeTab = ref([
  355. {key:'tab1', name: '卷内文件'},
  356. {key:'tab2', name: '竣工资料'},
  357. {key:'tab3', name: '计量资料'},
  358. {key:'tab4', name: '关联资料'},
  359. {key:'tab5', name: '元数据'},
  360. {key:'tab6', name: '验签包'},
  361. ]);
  362. const tabTypeChange = ({key}) => {
  363. tabTypeKey.value = key
  364. }
  365. const cscTableLoading = ref(false)
  366. //卷内目录
  367. const cscTableColumn1 = [
  368. {key:'name', name: '卷内文件题名', align: 'center'}
  369. ];
  370. const cscTableData1 = ref([
  371. ])
  372. //竣工资料
  373. const cscTableColumn2 = [
  374. {key:'name', name: '竣工图资料', align: 'center'}
  375. ];
  376. const cscTableData2 = ref([
  377. {id: 1, name: 'S6-3-2-Q-8-32 箱梁梁底支座垫石钢筋构造图111-箱梁梁底调平垫块及支座垫石钢筋构造图.pdf'},
  378. {id: 2, name: 'J6-3-2-Q-8-34 桥墩一般构造图(1-9).pdf'},
  379. {id: 3, name: 'S6-3-2-Q-8-32 箱梁梁底支座垫石钢筋构造图111-箱梁梁底调平垫块及支座垫石钢筋构造图.pdf'},
  380. {id: 4, name: 'J6-3-2-Q-8-34 桥墩一般构造图(1-9).pdf'},
  381. {id: 5, name: 'J6-3-2-Q-8-34 桥墩一般构造图(1-9).pdf'},
  382. {id: 6, name: 'S6-3-2-Q-8-32 箱梁梁底支座垫石钢筋构造图111-箱梁梁底调平垫块及支座垫石钢筋构造图.pdf'},
  383. {id: 7, name: 'S6-3-2-Q-8-32 箱梁梁底支座垫石钢筋构造图111-箱梁梁底调平垫块及支座垫石钢筋构造图.pdf'}
  384. ])
  385. //计量资料
  386. const cscTableColumn3 = [
  387. {key:'name', name: '计量资料', align: 'center'}
  388. ];
  389. const cscTableData3 = ref([
  390. {id: 1, name: 'ZB2-17.pdf'},
  391. {id: 2, name: 'ZB2-18.pdf'},
  392. {id: 3, name: 'ZB2-19.pdf'},
  393. {id: 4, name: 'ZB2-20.pdf'},
  394. {id: 5, name: 'ZB2-21.pdf'},
  395. {id: 6, name: 'ZB2-22.pdf'},
  396. {id: 7, name: 'ZB2-23.pdf'}
  397. ])
  398. //计量资料
  399. const cscTableColumn4 = [
  400. {key:'name', name: '关联文件', align: 'center'}
  401. ];
  402. const cscTableData4 = ref([
  403. {id: 1, name: 'xxxxxxxxxxxxxxxxxxx.pdf', tag: '开工'},
  404. {id: 2, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '工序'},
  405. {id: 3, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '评定'},
  406. {id: 4, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '交工'},
  407. {id: 5, name: '', tag: '抽检'},
  408. {id: 6, name: '', tag: '隐蔽'}
  409. ])
  410. //验签包
  411. const cscTableColumn5 = [
  412. {key:'user', name: '签名者'},
  413. {key:'time', name: '签名时间'},
  414. {key:'val', name: '摘要'},
  415. ];
  416. const cscTableColumn51 = [
  417. {key:'user', name: '签名者', width: 300},
  418. {key:'time', name: '签名时间', width: 200},
  419. {key:'val', name: '摘要'},
  420. ];
  421. const cscTableData5 = ref([
  422. {id: 1, user: '051@王海军@0422431197502148151@1', time: '2022-05-13 08:54:15', val: '签名有效。由051@王海军@0422431197502148151@1签名。自应用本签名以来,文档未被修改过。签名者身份有效。'},
  423. {id: 2, user: '051@王海军@0422431197502148151@1', time: '2022-05-13 08:54:15', val: '签名有效。由051@王海军@0422431197502148151@1签名。自应用本签名以来,文档未被修改过。签名者身份有效。'},
  424. {id: 3, user: '051@王海军@0422431197502148151@1', time: '2022-05-13 08:54:15', val: '签名有效。由051@王海军@0422431197502148151@1签名。自应用本签名以来,文档未被修改过。签名者身份有效。'},
  425. {id: 4, user: '051@王海军@0422431197502148151@1', time: '2022-05-13 08:54:15', val: '签名有效。由051@王海军@0422431197502148151@1签名。自应用本签名以来,文档未被修改过。签名者身份有效。'},
  426. {id: 5, user: '051@王海军@0422431197502148151@1', time: '2022-05-13 08:54:15', val: '签名有效。由051@王海军@0422431197502148151@1签名。自应用本签名以来,文档未被修改过。签名者身份有效。'},
  427. {id: 6, user: '051@王海军@0422431197502148151@1', time: '2022-05-13 08:54:15', val: '签名有效。由051@王海军@0422431197502148151@1签名。自应用本签名以来,文档未被修改过。签名者身份有效。'}
  428. ])
  429. //抽检意见
  430. const reform = ref({
  431. type: false, content: '',myOpinion:''
  432. })
  433. const ishowAllopinion=ref(true)
  434. const contentClick=()=>{
  435. console.log(11111);
  436. ishowAllopinion.value=false
  437. }
  438. //显示右侧目录
  439. const isCarryDataShow = ref(true)
  440. const onCarryDataShow = () => {
  441. isCarryDataShow.value = !isCarryDataShow.value
  442. }
  443. //使用弹窗查看数据
  444. const cscTableDataModal = ref(false)
  445. const cscTableDataTitle = ref('')
  446. //显示弹窗
  447. const cscTableDataModalShow = () => {
  448. const key = tabTypeKey.value;
  449. if (key === 'tab5') {
  450. cscTableDataTitle.value = '元数据'
  451. } else if (key === 'tab6') {
  452. cscTableDataTitle.value = '验签包'
  453. }
  454. cscTableDataModal.value = true
  455. }
  456. //关闭弹窗
  457. const cscTableDataModalClose = () => {
  458. cscTableDataModal.value = false
  459. getTableData()
  460. }
  461. //关闭抽查
  462. const onCarrySpotChecksDrawerClose = () => {
  463. isCarrySpotChecksDrawer.value = false
  464. pdfUrl.value=''
  465. }
  466. //左右拖动,改变树形结构宽度
  467. const leftWidth = ref(382);
  468. const onmousedown = () => {
  469. const leftNum = isCollapse.value ? 142 : 272
  470. document.onmousemove = (ve) => {
  471. let diffVal = ve.clientX - leftNum;
  472. if(diffVal >= 310 && diffVal <= 900) {
  473. leftWidth.value = diffVal;
  474. }
  475. }
  476. document.onmouseup = () => {
  477. document.onmousemove = null;
  478. document.onmouseup = null;
  479. }
  480. }
  481. </script>
  482. <style lang="scss" scoped>
  483. @import '~style/transfer/scoped/inspects.scss';
  484. </style>
  485. <style lang="scss">
  486. @import '~style/transfer/inspects.scss';
  487. </style>