filecenter.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504
  1. <template name="filecenter">
  2. <view class="file-page">
  3. <u-navbar
  4. title="文件中心"
  5. :safeAreaInsetTop="true"
  6. :fixed="true"
  7. height="50px"
  8. bgColor="transparent"
  9. titleStyle="fw600 fs-18"
  10. leftIconColor="#303133"
  11. @leftClick="goBack"
  12. >
  13. <view class="u-nav-slot" slot="left">
  14. <u-icon name="arrow-left" size="20" color="#303133"></u-icon>
  15. </view>
  16. </u-navbar>
  17. <view v-if="!menushow" class="file-page-content">
  18. <view class="file-tab-bar">
  19. <view
  20. class="file-tab-item"
  21. v-for="(item, index) in sectionList"
  22. :key="index"
  23. :class="{ active: curNow === index }"
  24. @click="sectionChange(index)"
  25. >
  26. <text class="file-tab-text">{{ item.name }}</text>
  27. <view class="file-tab-line" v-if="curNow === index"></view>
  28. </view>
  29. </view>
  30. <view class="file-main">
  31. <view class="search-card">
  32. <view class="search-row">
  33. <text class="search-label">文件名称</text>
  34. <u-input
  35. v-model="fileName"
  36. type="text"
  37. class="search-input"
  38. placeholder="请输入文件名称"
  39. border="none"
  40. ></u-input>
  41. </view>
  42. <view class="search-actions">
  43. <view
  44. class="action-btn action-btn-outline"
  45. @click="pickershow = true"
  46. >
  47. <text class="action-btn-text">{{
  48. fileType ? fileType : "选择文件类型"
  49. }}</text>
  50. </view>
  51. <view class="action-btn action-btn-primary" @click="searchFile">
  52. <text class="action-btn-text">查询</text>
  53. </view>
  54. <u-picker
  55. :show="pickershow"
  56. :columns="fileTypeList"
  57. keyName="label"
  58. @cancel="pickershow = false"
  59. @confirm="selectFileType"
  60. ></u-picker>
  61. </view>
  62. </view>
  63. <view class="file-list">
  64. <u-list>
  65. <u-list-item v-for="(item, index) in fileData" :key="index">
  66. <view class="file-card">
  67. <view class="file-card-header" @tap="openFile(item)">
  68. <text class="file-card-title">{{ item.fileName }}</text>
  69. </view>
  70. <view class="file-action-row">
  71. <view
  72. class="action-btn action-btn-primary"
  73. @click.stop="detailmodal(item)"
  74. >
  75. <text class="action-btn-text">审批详情</text>
  76. </view>
  77. <view
  78. class="action-btn action-btn-outline"
  79. @click.stop="commitmodal(item)"
  80. >
  81. <text class="action-btn-text">提交</text>
  82. </view>
  83. <view
  84. class="action-btn action-btn-outline"
  85. @click.stop="retractmodal(item)"
  86. >
  87. <text class="action-btn-text">撤回</text>
  88. </view>
  89. <view
  90. class="action-btn action-btn-outline"
  91. @click.stop="download(item)"
  92. >
  93. <text class="action-btn-text">下载</text>
  94. </view>
  95. <view
  96. class="action-btn action-btn-outline"
  97. @click.stop="showmodal(item)"
  98. >
  99. <text class="action-btn-text">删除</text>
  100. </view>
  101. </view>
  102. <view class="file-info-grid" @tap="openFile(item)">
  103. <view class="file-info-card">
  104. <view class="file-info-icon-box">
  105. <image
  106. class="file-info-icon"
  107. src="/static/filecenter/文件来源.svg"
  108. mode="aspectFit"
  109. ></image>
  110. </view>
  111. <view class="file-info-content">
  112. <text class="file-info-value">{{ item.fileSource }}</text>
  113. <text class="file-info-label">文件来源</text>
  114. </view>
  115. </view>
  116. <view class="file-info-card">
  117. <view class="file-info-icon-box">
  118. <image
  119. class="file-info-icon"
  120. src="/static/filecenter/审批状态.svg"
  121. mode="aspectFit"
  122. ></image>
  123. </view>
  124. <view class="file-info-content">
  125. <text class="file-info-value">{{ item.bpmStatus_dictText }}</text>
  126. <text class="file-info-label">审批状态</text>
  127. </view>
  128. </view>
  129. <view class="file-info-card">
  130. <view class="file-info-icon-box">
  131. <image
  132. class="file-info-icon"
  133. src="/static/filecenter/创建人.svg"
  134. mode="aspectFit"
  135. ></image>
  136. </view>
  137. <view class="file-info-content">
  138. <text class="file-info-value">{{ item.createBy }}</text>
  139. <text class="file-info-label">创建人</text>
  140. </view>
  141. </view>
  142. <view class="file-info-card">
  143. <view class="file-info-icon-box">
  144. <image
  145. class="file-info-icon"
  146. src="/static/filecenter/上传时间.svg"
  147. mode="aspectFit"
  148. ></image>
  149. </view>
  150. <view class="file-info-content">
  151. <text class="file-info-value">{{ item.createTime }}</text>
  152. <text class="file-info-label">上传时间</text>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </u-list-item>
  158. </u-list>
  159. <!-- 审批详情 -->
  160. <u-popup
  161. :show="detailShow"
  162. mode="center"
  163. :round="16"
  164. :closeable="false"
  165. @close="detailClose"
  166. >
  167. <view class="detail-modal">
  168. <view class="detail-modal-header">
  169. <text class="detail-modal-title">审批详情</text>
  170. <view class="detail-modal-close" @click="detailClose">
  171. <image
  172. class="detail-close-icon"
  173. src="/static/filecenter/关闭.svg"
  174. mode="aspectFit"
  175. />
  176. </view>
  177. </view>
  178. <view class="detail-modal-divider"></view>
  179. <scroll-view scroll-y class="detail-modal-body">
  180. <view class="detail-section">
  181. <view class="detail-section-title">
  182. <text class="detail-section-prefix">//</text>
  183. <text class="detail-section-text">流程审批进度历史</text>
  184. </view>
  185. <view class="detail-table-container">
  186. <view class="detail-table">
  187. <view class="detail-table-header">
  188. <view class="detail-table-cell">序号</view>
  189. <view class="detail-table-cell">当前环节</view>
  190. <view class="detail-table-cell">审批人</view>
  191. <view class="detail-table-cell">审批结果</view>
  192. <view class="detail-table-cell">审批开始时间</view>
  193. <view class="detail-table-cell">审批结束时间</view>
  194. <view class="detail-table-cell">处理意见</view>
  195. <view class="detail-table-cell">状态</view>
  196. </view>
  197. <view
  198. class="detail-table-row"
  199. v-for="(item, index) in tableData"
  200. :key="index"
  201. >
  202. <view class="detail-table-cell">
  203. <text>{{ index + 1 }}</text>
  204. </view>
  205. <view class="detail-table-cell">{{ item.name }}</view>
  206. <view class="detail-table-cell">
  207. <text
  208. v-if="item.assignees && item.assignees.length > 0"
  209. >
  210. {{ item.assignees[0].username }}
  211. </text>
  212. <text v-else> - </text>
  213. </view>
  214. <view class="detail-table-cell">{{
  215. item.deleteReason
  216. }}</view>
  217. <view class="detail-table-cell">{{
  218. item.createTime
  219. }}</view>
  220. <view class="detail-table-cell">{{ item.endTime }}</view>
  221. <view class="detail-table-cell">{{ item.comment }}</view>
  222. <view class="detail-table-cell">
  223. <text v-if="item.assignees[0].isExecutor">
  224. 已处理
  225. </text>
  226. <text v-else> 待处理</text>
  227. </view>
  228. </view>
  229. </view>
  230. </view>
  231. </view>
  232. <view class="detail-section">
  233. <view class="detail-section-title">
  234. <text class="detail-section-prefix">//</text>
  235. <text class="detail-section-text">实时流程图</text>
  236. </view>
  237. <view class="detail-flowchart-wrap">
  238. <image
  239. class="detail-flowchart-img"
  240. :src="imageUrl"
  241. mode="widthFix"
  242. />
  243. </view>
  244. </view>
  245. </scroll-view>
  246. </view>
  247. </u-popup>
  248. <!-- 删除 -->
  249. <u-popup
  250. :show="show"
  251. mode="center"
  252. :round="16"
  253. :closeable="false"
  254. @close="cancel"
  255. >
  256. <view class="delete-modal">
  257. <view class="delete-modal-header">
  258. <text class="delete-modal-title">删除</text>
  259. <view class="delete-modal-close" @click="cancel">
  260. <image
  261. class="delete-close-icon"
  262. src="/static/filecenter/关闭.svg"
  263. mode="aspectFit"
  264. />
  265. </view>
  266. </view>
  267. <view class="delete-modal-divider"></view>
  268. <view class="delete-modal-body">
  269. <view class="delete-confirm-box">
  270. <image
  271. class="delete-confirm-icon"
  272. src="/static/filecenter/删除.svg"
  273. mode="aspectFit"
  274. />
  275. <text class="delete-confirm-text">确定删除?</text>
  276. </view>
  277. </view>
  278. <view class="delete-modal-footer">
  279. <view class="action-btn action-btn-outline" @click="cancel">
  280. <text class="action-btn-text">取消</text>
  281. </view>
  282. <view class="action-btn action-btn-primary" @click="confirm">
  283. <text class="action-btn-text">确定</text>
  284. </view>
  285. </view>
  286. </view>
  287. </u-popup>
  288. <!-- 提交 -->
  289. <u-popup
  290. :show="commitShow"
  291. mode="center"
  292. :round="16"
  293. :closeable="false"
  294. @close="cancelCommit"
  295. >
  296. <view class="commit-modal">
  297. <view class="commit-modal-header">
  298. <text class="commit-modal-title">提交文件</text>
  299. <view class="commit-modal-close" @click="cancelCommit">
  300. <image
  301. class="commit-close-icon"
  302. src="/static/filecenter/关闭.svg"
  303. mode="aspectFit"
  304. />
  305. </view>
  306. </view>
  307. <view class="commit-modal-divider"></view>
  308. <view class="commit-modal-body">
  309. <view class="commit-form-box">
  310. <view class="commit-form-row">
  311. <view class="commit-form-label">
  312. <text class="commit-required">*</text>
  313. <text>选择审批</text>
  314. </view>
  315. <view class="commit-select" @click="openCommitPicker">
  316. <text class="commit-select-text">{{
  317. selectedCommitName
  318. }}</text>
  319. <text class="commit-select-arrow"></text>
  320. </view>
  321. </view>
  322. </view>
  323. </view>
  324. <view class="commit-modal-footer">
  325. <view class="action-btn action-btn-outline" @click="cancelCommit">
  326. <text class="action-btn-text">取消</text>
  327. </view>
  328. <view class="action-btn action-btn-primary" @click="confirmCommit">
  329. <text class="action-btn-text">确定</text>
  330. </view>
  331. </view>
  332. </view>
  333. </u-popup>
  334. <u-picker
  335. :show="commitPickerShow"
  336. :columns="[commitPickerColumns]"
  337. keyName="label"
  338. :defaultIndex="[selectedCommitIndex]"
  339. @cancel="commitPickerShow = false"
  340. @confirm="onCommitPickerConfirm"
  341. ></u-picker>
  342. <!-- 撤回 -->
  343. <u-popup
  344. :show="showretract"
  345. mode="center"
  346. :round="16"
  347. :closeable="false"
  348. @close="close"
  349. >
  350. <view class="retract-modal">
  351. <view class="retract-modal-header">
  352. <text class="retract-modal-title">撤销申请</text>
  353. <view class="retract-modal-close" @click="close">
  354. <image
  355. class="retract-close-icon"
  356. src="/static/filecenter/关闭.svg"
  357. mode="aspectFit"
  358. />
  359. </view>
  360. </view>
  361. <view class="retract-modal-divider"></view>
  362. <view class="retract-modal-body">
  363. <view class="retract-textarea-wrap">
  364. <u--textarea
  365. v-model="value1"
  366. placeholder="请输入撤回原因"
  367. border="none"
  368. ></u--textarea>
  369. </view>
  370. </view>
  371. <view class="retract-modal-footer">
  372. <view class="action-btn action-btn-outline" @click="cancelRetract">
  373. <text class="action-btn-text">取消</text>
  374. </view>
  375. <view class="action-btn action-btn-primary" @click="confirmRetract">
  376. <text class="action-btn-text">确定</text>
  377. </view>
  378. </view>
  379. </view>
  380. </u-popup>
  381. <u-notify
  382. message="只有审批中的数据才能撤回!"
  383. :show="notifyShow"
  384. :duration="1000"
  385. ></u-notify>
  386. </view>
  387. </view>
  388. </view>
  389. </view>
  390. </template>
  391. <script>
  392. import api from "@/api/api";
  393. import configService from "../../common/service/config.service";
  394. // import FileTreeMenu from "./treeMenu/fileTreeMenu.vue";
  395. export default {
  396. // components: {
  397. // FileTreeMenu,
  398. // },
  399. name: "filecenter",
  400. watch: {},
  401. data() {
  402. return {
  403. backPic0: "url(/static/topnavbar0.png)",
  404. backPic: "url(../../static/topnavbar.png)",
  405. sectionList: [
  406. { name: "全部", code: 0 },
  407. { name: "待审批", code: 1 },
  408. { name: "已审批", code: 2 },
  409. ],
  410. fileTypeList: [
  411. [
  412. { label: "全部类型", value: "" },
  413. { label: ".txt", value: "txt" },
  414. { label: ".doc", value: "doc" },
  415. { label: ".docx", value: "docx" },
  416. { label: ".xls", value: "xls" },
  417. { label: ".xlsx", value: "xlsx" },
  418. { label: ".ppt", value: "ppt" },
  419. { label: ".pptx", value: "pptx" },
  420. { label: ".jpg", value: "jpg" },
  421. { label: ".png", value: "png" },
  422. { label: ".pdf", value: "pdf" },
  423. ],
  424. ],
  425. fileType: "", //文件类型
  426. pickershow: false,
  427. curNow: 0,
  428. fileData: [],
  429. bpmStatus: 1, //1处理中 2 已完成 3 已驳回
  430. show: false, //删除modal
  431. selectItem: "", //选择文件
  432. showretract: false, //撤回popup
  433. value1: "", //撤回原因
  434. cancelItem: "", //撤回文件
  435. detailShow: false, //详情
  436. notifyShow: false, //撤回文件提示消息显示
  437. commitShow: false, //提交
  438. commitPickerShow: false,
  439. columns: [],
  440. selectedCommitIndex: 0,
  441. commitItem: "", //提交文件
  442. selectFile: [],
  443. tableData: [], //审批内容
  444. detailItem: "", //详情文件
  445. imageUrl: "",
  446. fileName: "", //文件名称搜索框
  447. menushow: false,
  448. };
  449. },
  450. mounted() {
  451. this.getFileInfo();
  452. },
  453. computed: {
  454. commitPickerColumns() {
  455. return (this.selectFile || []).map((item, index) => ({
  456. label:
  457. item.name ||
  458. item.processName ||
  459. item.procDefName ||
  460. `审批流程${index + 1}`,
  461. value: item.id,
  462. }));
  463. },
  464. selectedCommitName() {
  465. if (!this.commitPickerColumns.length) {
  466. return "请选择审批";
  467. }
  468. const item = this.commitPickerColumns[this.selectedCommitIndex];
  469. return item ? item.label : "请选择审批";
  470. },
  471. },
  472. methods: {
  473. goBack() {
  474. uni.navigateBack({
  475. delta: 1,
  476. fail() {
  477. uni.switchTab({
  478. url: "/pages/index/index",
  479. });
  480. },
  481. });
  482. },
  483. // fileTreeShow(e) {
  484. // this.menushow = !this.menushow;
  485. // },
  486. menuClick(id) {
  487. this.menushow = false;
  488. },
  489. //选择文件类型
  490. selectFileType(e) {
  491. this.pickershow = false;
  492. if (e.value[0].label === "全部类型") {
  493. this.fileType = "";
  494. } else {
  495. this.fileType = e.value[0].label;
  496. }
  497. },
  498. //根据条件查询相关文件
  499. searchFile() {
  500. this.getFileInfo();
  501. },
  502. sectionChange(newVal) {
  503. this.curNow = newVal;
  504. if (this.curNow === 0) {
  505. // 如果选择了“全部”,返回所有文件
  506. this.bpmStatus = "";
  507. this.getFileInfo();
  508. } else if (this.curNow === 1) {
  509. // 否则,根据curNow的值过滤文件
  510. this.bpmStatus = 1;
  511. this.getFileInfo();
  512. } else if (this.curNow === 2) {
  513. this.bpmStatus = 2;
  514. this.getFileInfo();
  515. }
  516. },
  517. getTreeList() {
  518. var params = { parentId: "" };
  519. new Promise((resolve, reject) => {
  520. api
  521. .getFileInfo(params)
  522. .then((response) => {
  523. if (response.data.code == 200) {
  524. let data = response.data.result.records;
  525. let datas = data.filter((v) => v.fileType == null);
  526. let list = list2trees(datas);
  527. listArr.push(...list);
  528. } else {
  529. reject(response);
  530. }
  531. })
  532. .catch((error) => {
  533. console.log("catch===>response", response);
  534. reject(error);
  535. });
  536. });
  537. },
  538. getFileInfo() {
  539. var params = {
  540. bpmStatus: this.bpmStatus,
  541. column: "createTime",
  542. fileSuffix: this.fileType,
  543. likeFileName: this.fileName,
  544. pageNo: 1,
  545. pageSize: 10000,
  546. parentId: "",
  547. selectFlag: true,
  548. sysOrgCode: "",
  549. };
  550. new Promise((resolve, reject) => {
  551. api
  552. .getFileInfo(params)
  553. .then((response) => {
  554. if (response.data.code == 200) {
  555. this.fileData = response.data.result.records;
  556. } else {
  557. reject(response);
  558. }
  559. })
  560. .catch((error) => {
  561. console.log("catch===>response", response);
  562. reject(error);
  563. });
  564. });
  565. },
  566. //查看文件内容
  567. openFile(params) {
  568. uni.downloadFile({
  569. url:
  570. configService.apiUrl +
  571. "/ventanaly-sharefile/fileServer/onlyOffice/read?id=" +
  572. params.id,
  573. success: function (res) {
  574. var filePath = res.tempFilePath;
  575. uni.openDocument({
  576. filePath: filePath,
  577. showMenu: true,
  578. success: function (res) {
  579. console.log("打开文档成功");
  580. },
  581. });
  582. },
  583. });
  584. },
  585. // //下载文件到手机
  586. download(params) {
  587. var fileiId = params.id;
  588. var params = {
  589. id: fileiId,
  590. };
  591. new Promise((resolve, reject) => {
  592. api
  593. .downloadFile(params)
  594. .then((response) => {
  595. if (response.statusCode == 200) {
  596. console.log(response, "111");
  597. // const blob = new Blob([response.data], {
  598. // type: "charset=UTF-8",
  599. // }); // 构造一个blob对象来处理数据
  600. // if ("download" in document.createElement("a")) {
  601. // // 支持a标签download的浏览器
  602. // const link = document.createElement("a"); // 创建a标签
  603. // link.href = URL.createObjectURL(blob);
  604. // document.body.appendChild(link);
  605. // link.click(); // 执行下载
  606. // URL.revokeObjectURL(link.href); //
  607. // document.body.removeChild(link); //
  608. // }
  609. } else {
  610. // console.log("请求下载文件失败:", err);
  611. }
  612. })
  613. .catch((error) => {
  614. reject(error);
  615. });
  616. });
  617. },
  618. // //删除文件
  619. showmodal(data) {
  620. this.selectItem = data;
  621. this.show = true;
  622. },
  623. confirm() {
  624. this.delatefile(this.selectItem);
  625. },
  626. cancel() {
  627. this.show = false;
  628. },
  629. delatefile(params) {
  630. var fileiId = params.id;
  631. new Promise((resolve, reject) => {
  632. api
  633. .delateFile({ id: fileiId })
  634. .then((response) => {
  635. if (response.data.code == 200) {
  636. this.show = false;
  637. this.getFileInfo();
  638. } else {
  639. // console.log("请求下载文件失败:", err);
  640. }
  641. })
  642. .catch((error) => {
  643. reject(error);
  644. });
  645. });
  646. },
  647. //撤回文件
  648. retractmodal(data) {
  649. this.value1 = "";
  650. this.showretract = true;
  651. this.cancelItem = data;
  652. },
  653. close() {
  654. this.showretract = false;
  655. },
  656. cancelRetract() {
  657. this.showretract = false;
  658. },
  659. confirmRetract() {
  660. var fileiId = this.cancelItem.id;
  661. var params = {
  662. tableId: fileiId,
  663. reason: this.value1,
  664. tableName: this.cancelItem.tableName,
  665. };
  666. if (this.cancelItem.bpmStatus == 1) {
  667. new Promise((resolve, reject) => {
  668. api
  669. .cancelFile(params)
  670. .then((response) => {
  671. if (response.data.code == 200) {
  672. this.showretract = false;
  673. this.getFileInfo();
  674. } else {
  675. // console.log("请求下载文件失败:", err);
  676. }
  677. })
  678. .catch((error) => {
  679. reject(error);
  680. });
  681. });
  682. } else {
  683. this.notifyShow = true;
  684. }
  685. },
  686. // 详情
  687. detailmodal(data) {
  688. this.detailShow = true;
  689. var fileiId = data.id;
  690. var tablename = data.tableName;
  691. var params = {
  692. tableId: fileiId,
  693. tableName: tablename,
  694. };
  695. new Promise((resolve, reject) => {
  696. api
  697. .gethistoricFlowNew(params)
  698. .then((response) => {
  699. if (response.data.code == 200) {
  700. var detailData = response.data;
  701. this.tableData = detailData.result;
  702. } else {
  703. // console.log("请求下载文件失败:", err);
  704. }
  705. })
  706. .catch((error) => {
  707. reject(error);
  708. });
  709. });
  710. this.getDetailImg(data);
  711. },
  712. getDetailImg(data) {
  713. var fileiId = data.id;
  714. var tablename = data.tableName;
  715. var params = {
  716. tableId: fileiId,
  717. tableName: tablename,
  718. };
  719. new Promise((resolve, reject) => {
  720. api
  721. .getHighlightImgNew(params)
  722. .then((response) => {
  723. if (response.statusCode == 200) {
  724. this.imageUrl = response.config.baseUrl + response.config.url;
  725. } else {
  726. // console.log("请求下载文件失败:", err);
  727. }
  728. })
  729. .catch((error) => {
  730. reject(error);
  731. });
  732. });
  733. },
  734. detailClose() {
  735. this.detailShow = false;
  736. },
  737. // 提交
  738. commitmodal(data) {
  739. this.selectedCommitIndex = 0;
  740. this.commitShow = true;
  741. this.commitItem = data;
  742. this.getListFile();
  743. },
  744. getListFile() {
  745. this.columns = [];
  746. var params = {
  747. zx: true,
  748. column: "createTime",
  749. order: "desc",
  750. status: 1,
  751. _t: Date.now(),
  752. };
  753. new Promise((resolve, reject) => {
  754. api
  755. .getListFile(params)
  756. .then((response) => {
  757. if (response.data.code == 200) {
  758. this.selectFile = response.data.result || [];
  759. this.columns = [];
  760. this.selectedCommitIndex = 0;
  761. this.selectFile.forEach((item) => {
  762. this.columns.push(item.id);
  763. });
  764. } else {
  765. // console.log("请求下载文件失败:", err);
  766. }
  767. })
  768. .catch((error) => {
  769. reject(error);
  770. });
  771. });
  772. },
  773. openCommitPicker() {
  774. if (!this.commitPickerColumns.length) {
  775. uni.showToast({
  776. title: "暂无审批流程",
  777. icon: "none",
  778. });
  779. return;
  780. }
  781. this.commitPickerShow = true;
  782. },
  783. onCommitPickerConfirm(e) {
  784. this.commitPickerShow = false;
  785. const selected = e.value && e.value[0];
  786. if (!selected) {
  787. return;
  788. }
  789. const index = this.commitPickerColumns.findIndex(
  790. (item) => item.value === selected.value
  791. );
  792. this.selectedCommitIndex =
  793. index >= 0 ? index : e.indexs && e.indexs[0] !== undefined ? e.indexs[0] : 0;
  794. },
  795. confirmCommit() {
  796. var fileiId = this.commitItem.id;
  797. const selected = this.commitPickerColumns[this.selectedCommitIndex];
  798. var reqDefId = (selected && selected.value) || this.columns[0];
  799. var params = {
  800. tableId: fileiId,
  801. procDefId: reqDefId,
  802. firstGateway: true,
  803. };
  804. new Promise((resolve, reject) => {
  805. api
  806. .commitFile(params)
  807. .then((response) => {
  808. if (response.data.code == 200) {
  809. this.commitShow = false;
  810. this.commitPickerShow = false;
  811. this.getFileInfo();
  812. } else {
  813. // console.log("请求下载文件失败:", err);
  814. }
  815. })
  816. .catch((error) => {
  817. reject(error);
  818. });
  819. });
  820. },
  821. cancelCommit() {
  822. this.commitShow = false;
  823. this.commitPickerShow = false;
  824. },
  825. },
  826. };
  827. </script>
  828. <style lang="scss" scoped>
  829. // .file-page {
  830. // min-height: 100vh;
  831. // background: linear-gradient(180deg, #c8d8f8 0%, #f4f7fd 280rpx, #f4f7fd 100%);
  832. // }
  833. .file-page-content {
  834. padding-top: 50px;
  835. // min-height: calc(100vh - 50px);
  836. }
  837. .file-tab-bar {
  838. display: flex;
  839. flex-direction: row;
  840. align-items: center;
  841. padding: 16rpx 32rpx 0;
  842. }
  843. .file-tab-item {
  844. position: relative;
  845. margin-right: 48rpx;
  846. padding-bottom: 16rpx;
  847. }
  848. .file-tab-text {
  849. font-size: 28rpx;
  850. color: #000;
  851. line-height: 1.4;
  852. }
  853. .file-tab-item.active .file-tab-text {
  854. color: #0065f8;
  855. font-weight: 600;
  856. }
  857. .file-tab-line {
  858. position: absolute;
  859. left: 0;
  860. right: 0;
  861. bottom: 0;
  862. height: 6rpx;
  863. border-radius: 3rpx;
  864. background: #0065f8;
  865. }
  866. .file-main {
  867. height: calc(100vh - 138px);
  868. padding: 20rpx 24rpx;
  869. box-sizing: border-box;
  870. // overflow-y: auto;
  871. }
  872. .search-card {
  873. background: #ffffff;
  874. border-radius: 16rpx;
  875. padding: 24rpx;
  876. margin-bottom: 20rpx;
  877. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
  878. }
  879. .search-row {
  880. display: flex;
  881. flex-direction: row;
  882. align-items: center;
  883. margin-bottom: 20rpx;
  884. }
  885. .search-label {
  886. flex-shrink: 0;
  887. width: 140rpx;
  888. font-size: 28rpx;
  889. color: #000;
  890. }
  891. .search-input {
  892. flex: 1;
  893. height: 72rpx;
  894. padding: 0 24rpx !important;
  895. border-radius: 12rpx;
  896. background: #eef5ff !important;
  897. }
  898. .search-actions {
  899. display: flex;
  900. flex-direction: row;
  901. align-items: center;
  902. justify-content: space-between;
  903. gap: 10rpx;
  904. }
  905. .file-list {
  906. width: 100%;
  907. height: calc(100% - 118px);
  908. overflow-y: auto;
  909. }
  910. .file-card {
  911. background: #f8fbff;
  912. border-radius: 16rpx;
  913. padding: 24rpx;
  914. margin-bottom: 20rpx;
  915. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
  916. }
  917. .file-card-header {
  918. margin-bottom: 16rpx;
  919. }
  920. .file-card-title {
  921. font-size: 28rpx;
  922. font-weight: 700;
  923. color: #000;
  924. line-height: 1.4;
  925. word-break: break-all;
  926. }
  927. .file-action-row {
  928. display: flex;
  929. flex-direction: row;
  930. align-items: center;
  931. justify-content: space-between;
  932. gap: 10rpx;
  933. margin-bottom: 20rpx;
  934. }
  935. .action-btn {
  936. flex: 1;
  937. min-width: 0;
  938. height: 56rpx;
  939. border-radius: 8rpx;
  940. display: flex;
  941. align-items: center;
  942. justify-content: center;
  943. box-sizing: border-box;
  944. padding: 0 8rpx;
  945. }
  946. .action-btn-text {
  947. font-size: 24rpx;
  948. font-weight: 500;
  949. line-height: 1;
  950. white-space: nowrap;
  951. overflow: hidden;
  952. text-overflow: ellipsis;
  953. max-width: 100%;
  954. }
  955. .action-btn-primary {
  956. background: #0065f8;
  957. }
  958. .action-btn-primary .action-btn-text {
  959. color: #ffffff;
  960. }
  961. .action-btn-outline {
  962. background: #ffffff;
  963. border: 1rpx solid #0065f8;
  964. }
  965. .action-btn-outline .action-btn-text {
  966. color: #0065f8;
  967. }
  968. .file-info-grid {
  969. display: flex;
  970. flex-direction: row;
  971. flex-wrap: wrap;
  972. margin: 0 -6rpx;
  973. }
  974. .file-info-card {
  975. width: calc(50% - 12rpx);
  976. margin: 6rpx;
  977. padding: 16rpx 12rpx;
  978. box-sizing: border-box;
  979. border-radius: 12rpx;
  980. display: flex;
  981. flex-direction: row;
  982. align-items: center;
  983. background: linear-gradient(
  984. 135deg,
  985. rgba(175, 195, 252, 0.55) 0%,
  986. rgba(238, 245, 255, 0.35) 100%
  987. );
  988. }
  989. .file-info-icon-box {
  990. width: 56rpx;
  991. height: 56rpx;
  992. border-radius: 10rpx;
  993. background: linear-gradient(135deg, #4d9dff 0%, #2b7cff 100%);
  994. box-shadow: 0 4rpx 10rpx rgba(43, 124, 255, 0.22);
  995. display: flex;
  996. align-items: center;
  997. justify-content: center;
  998. flex-shrink: 0;
  999. margin-right: 12rpx;
  1000. }
  1001. .file-info-icon {
  1002. width: 32rpx;
  1003. height: 32rpx;
  1004. }
  1005. .file-info-content {
  1006. flex: 1;
  1007. min-width: 0;
  1008. }
  1009. .file-info-value {
  1010. display: block;
  1011. font-size: 24rpx;
  1012. font-weight: 700;
  1013. color: #0065f8;
  1014. line-height: 1.3;
  1015. overflow: hidden;
  1016. text-overflow: ellipsis;
  1017. white-space: nowrap;
  1018. }
  1019. .file-info-label {
  1020. display: block;
  1021. margin-top: 6rpx;
  1022. font-size: 24rpx;
  1023. color: #000;
  1024. line-height: 1.3;
  1025. }
  1026. .retract-modal {
  1027. width: 620rpx;
  1028. background: #ffffff;
  1029. border-radius: 16rpx;
  1030. overflow: hidden;
  1031. padding-bottom: 28rpx;
  1032. box-sizing: border-box;
  1033. }
  1034. .retract-modal-header {
  1035. display: flex;
  1036. flex-direction: row;
  1037. align-items: center;
  1038. justify-content: space-between;
  1039. padding: 28rpx 28rpx 20rpx;
  1040. }
  1041. .retract-modal-title {
  1042. font-size: 32rpx;
  1043. font-weight: 700;
  1044. color: #1a1a1a;
  1045. }
  1046. .retract-modal-close {
  1047. width: 44rpx;
  1048. height: 44rpx;
  1049. display: flex;
  1050. align-items: center;
  1051. justify-content: center;
  1052. }
  1053. .retract-close-icon {
  1054. width: 28rpx;
  1055. height: 28rpx;
  1056. }
  1057. .retract-modal-divider {
  1058. height: 1rpx;
  1059. background: #eef0f4;
  1060. margin: 0 24rpx;
  1061. }
  1062. .retract-modal-body {
  1063. padding: 24rpx 28rpx;
  1064. }
  1065. .retract-textarea-wrap {
  1066. border: 1rpx solid #2b7cff;
  1067. border-radius: 8rpx;
  1068. overflow: hidden;
  1069. min-height: 200rpx;
  1070. background: #ffffff;
  1071. }
  1072. .retract-modal-footer {
  1073. display: flex;
  1074. flex-direction: row;
  1075. align-items: center;
  1076. justify-content: space-between;
  1077. gap: 20rpx;
  1078. padding: 0 28rpx;
  1079. }
  1080. .retract-modal-footer .action-btn {
  1081. flex: 1;
  1082. height: 64rpx;
  1083. }
  1084. .delete-modal {
  1085. width: 620rpx;
  1086. background: #ffffff;
  1087. border-radius: 16rpx;
  1088. overflow: hidden;
  1089. padding-bottom: 28rpx;
  1090. box-sizing: border-box;
  1091. }
  1092. .delete-modal-header {
  1093. display: flex;
  1094. flex-direction: row;
  1095. align-items: center;
  1096. justify-content: space-between;
  1097. padding: 28rpx 28rpx 20rpx;
  1098. }
  1099. .delete-modal-title {
  1100. font-size: 32rpx;
  1101. font-weight: 700;
  1102. color: #1a1a1a;
  1103. }
  1104. .delete-modal-close {
  1105. width: 44rpx;
  1106. height: 44rpx;
  1107. display: flex;
  1108. align-items: center;
  1109. justify-content: center;
  1110. }
  1111. .delete-close-icon {
  1112. width: 28rpx;
  1113. height: 28rpx;
  1114. }
  1115. .delete-modal-divider {
  1116. height: 1rpx;
  1117. background: #eef0f4;
  1118. margin: 0 24rpx;
  1119. }
  1120. .delete-modal-body {
  1121. padding: 24rpx 28rpx;
  1122. }
  1123. .delete-confirm-box {
  1124. display: flex;
  1125. flex-direction: row;
  1126. align-items: center;
  1127. justify-content: center;
  1128. gap: 16rpx;
  1129. padding: 40rpx 24rpx;
  1130. background: #f0f4ff;
  1131. border-radius: 8rpx;
  1132. }
  1133. .delete-confirm-icon {
  1134. width: 48rpx;
  1135. height: 52rpx;
  1136. flex-shrink: 0;
  1137. }
  1138. .delete-confirm-text {
  1139. font-size: 28rpx;
  1140. color: #1a1a1a;
  1141. }
  1142. .delete-modal-footer {
  1143. display: flex;
  1144. flex-direction: row;
  1145. align-items: center;
  1146. justify-content: space-between;
  1147. gap: 20rpx;
  1148. padding: 0 28rpx;
  1149. }
  1150. .delete-modal-footer .action-btn {
  1151. flex: 1;
  1152. height: 64rpx;
  1153. }
  1154. .commit-modal {
  1155. width: 620rpx;
  1156. background: #ffffff;
  1157. border-radius: 16rpx;
  1158. overflow: hidden;
  1159. padding-bottom: 28rpx;
  1160. box-sizing: border-box;
  1161. }
  1162. .commit-modal-header {
  1163. display: flex;
  1164. flex-direction: row;
  1165. align-items: center;
  1166. justify-content: space-between;
  1167. padding: 28rpx 28rpx 20rpx;
  1168. }
  1169. .commit-modal-title {
  1170. font-size: 32rpx;
  1171. font-weight: 700;
  1172. color: #1a1a1a;
  1173. }
  1174. .commit-modal-close {
  1175. width: 44rpx;
  1176. height: 44rpx;
  1177. display: flex;
  1178. align-items: center;
  1179. justify-content: center;
  1180. }
  1181. .commit-close-icon {
  1182. width: 28rpx;
  1183. height: 28rpx;
  1184. }
  1185. .commit-modal-divider {
  1186. height: 1rpx;
  1187. background: #eef0f4;
  1188. margin: 0 24rpx;
  1189. }
  1190. .commit-modal-body {
  1191. padding: 24rpx 28rpx;
  1192. }
  1193. .commit-form-box {
  1194. background: #f0f4ff;
  1195. border-radius: 8rpx;
  1196. padding: 32rpx 24rpx;
  1197. }
  1198. .commit-form-row {
  1199. display: flex;
  1200. flex-direction: row;
  1201. align-items: center;
  1202. gap: 16rpx;
  1203. }
  1204. .commit-form-label {
  1205. display: flex;
  1206. flex-direction: row;
  1207. align-items: center;
  1208. flex-shrink: 0;
  1209. font-size: 28rpx;
  1210. color: #1a1a1a;
  1211. }
  1212. .commit-required {
  1213. color: #ff4d4f;
  1214. margin-right: 4rpx;
  1215. }
  1216. .commit-select {
  1217. flex: 1;
  1218. display: flex;
  1219. flex-direction: row;
  1220. align-items: center;
  1221. justify-content: space-between;
  1222. height: 64rpx;
  1223. padding: 0 20rpx;
  1224. background: #ffffff;
  1225. border: 1rpx solid #2b7cff;
  1226. border-radius: 8rpx;
  1227. box-sizing: border-box;
  1228. }
  1229. .commit-select-text {
  1230. flex: 1;
  1231. font-size: 26rpx;
  1232. color: #333333;
  1233. overflow: hidden;
  1234. text-overflow: ellipsis;
  1235. white-space: nowrap;
  1236. }
  1237. .commit-select-arrow {
  1238. width: 0;
  1239. height: 0;
  1240. margin-left: 12rpx;
  1241. border-left: 10rpx solid transparent;
  1242. border-right: 10rpx solid transparent;
  1243. border-top: 12rpx solid #2b7cff;
  1244. flex-shrink: 0;
  1245. }
  1246. .commit-modal-footer {
  1247. display: flex;
  1248. flex-direction: row;
  1249. align-items: center;
  1250. justify-content: space-between;
  1251. gap: 20rpx;
  1252. padding: 0 28rpx;
  1253. }
  1254. .commit-modal-footer .action-btn {
  1255. flex: 1;
  1256. height: 64rpx;
  1257. }
  1258. .detail-modal {
  1259. width: 680rpx;
  1260. max-height: 80vh;
  1261. background: #ffffff;
  1262. border-radius: 16rpx;
  1263. overflow: hidden;
  1264. box-sizing: border-box;
  1265. display: flex;
  1266. flex-direction: column;
  1267. }
  1268. .detail-modal-header {
  1269. display: flex;
  1270. flex-direction: row;
  1271. align-items: center;
  1272. justify-content: space-between;
  1273. padding: 28rpx 28rpx 20rpx;
  1274. flex-shrink: 0;
  1275. }
  1276. .detail-modal-title {
  1277. font-size: 32rpx;
  1278. font-weight: 700;
  1279. color: #1a1a1a;
  1280. }
  1281. .detail-modal-close {
  1282. width: 44rpx;
  1283. height: 44rpx;
  1284. display: flex;
  1285. align-items: center;
  1286. justify-content: center;
  1287. }
  1288. .detail-close-icon {
  1289. width: 28rpx;
  1290. height: 28rpx;
  1291. }
  1292. .detail-modal-divider {
  1293. height: 1rpx;
  1294. background: #eef0f4;
  1295. margin: 0 24rpx;
  1296. flex-shrink: 0;
  1297. }
  1298. .detail-modal-body {
  1299. flex: 1;
  1300. max-height: calc(80vh - 100rpx);
  1301. padding: 24rpx 28rpx 28rpx;
  1302. box-sizing: border-box;
  1303. }
  1304. .detail-section {
  1305. margin-bottom: 32rpx;
  1306. }
  1307. .detail-section:last-child {
  1308. margin-bottom: 0;
  1309. }
  1310. .detail-section-title {
  1311. position: relative;
  1312. display: flex;
  1313. flex-direction: row;
  1314. align-items: center;
  1315. padding: 8rpx 0 20rpx;
  1316. }
  1317. .detail-section-title::before {
  1318. content: "";
  1319. position: absolute;
  1320. left: 0;
  1321. right: 0;
  1322. top: 50%;
  1323. transform: translateY(-50%);
  1324. height: 28rpx;
  1325. background: linear-gradient(
  1326. 90deg,
  1327. rgba(43, 124, 255, 0.18) 0%,
  1328. rgba(43, 124, 255, 0) 75%
  1329. );
  1330. border-radius: 4rpx;
  1331. z-index: 0;
  1332. }
  1333. .detail-section-prefix {
  1334. position: relative;
  1335. z-index: 1;
  1336. font-size: 28rpx;
  1337. font-weight: 700;
  1338. color: #2b7cff;
  1339. margin-right: 8rpx;
  1340. font-style: italic;
  1341. }
  1342. .detail-section-text {
  1343. position: relative;
  1344. z-index: 1;
  1345. font-size: 28rpx;
  1346. font-weight: 700;
  1347. color: #1a1a1a;
  1348. }
  1349. .detail-table-container {
  1350. overflow-x: auto;
  1351. border: 1rpx solid #b8d4ff;
  1352. border-radius: 8rpx;
  1353. }
  1354. .detail-table {
  1355. width: max-content;
  1356. min-width: 100%;
  1357. display: flex;
  1358. flex-direction: column;
  1359. }
  1360. .detail-table-header,
  1361. .detail-table-row {
  1362. display: flex;
  1363. flex-direction: row;
  1364. }
  1365. .detail-table-header {
  1366. background: #e8f1ff;
  1367. }
  1368. .detail-table-header .detail-table-cell {
  1369. color: #2b7cff;
  1370. font-weight: 600;
  1371. background: #e8f1ff;
  1372. display: flex;
  1373. align-items: center;
  1374. justify-content: center;
  1375. }
  1376. .detail-table-row {
  1377. background: #ffffff;
  1378. }
  1379. .detail-table-cell {
  1380. flex: 1;
  1381. min-width: 140rpx;
  1382. padding: 16rpx 12rpx;
  1383. font-size: 24rpx;
  1384. color: #333333;
  1385. text-align: center;
  1386. border-right: 1rpx solid #b8d4ff;
  1387. border-bottom: 1rpx solid #b8d4ff;
  1388. box-sizing: border-box;
  1389. word-break: break-all;
  1390. }
  1391. .detail-table-cell:last-child {
  1392. border-right: none;
  1393. }
  1394. .detail-table-row:last-child .detail-table-cell {
  1395. border-bottom: none;
  1396. }
  1397. .detail-flowchart-wrap {
  1398. background: #f0f5ff;
  1399. border-radius: 8rpx;
  1400. padding: 24rpx;
  1401. overflow: hidden;
  1402. }
  1403. .detail-flowchart-img {
  1404. width: 100%;
  1405. display: block;
  1406. }
  1407. </style>