audit-issued-form.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. <template>
  2. <sd-webflow
  3. ref="docform"
  4. :key="key"
  5. :validate-form="validForm"
  6. :removed-tabs="['sdRelatedDoc']"
  7. @actionBtnClick="actionBtnClick"
  8. >
  9. <template v-slot:form="{ model, fields, FlowData }">
  10. <!-- 初始化模型基础信息 -->
  11. <table v-if="isInitData || initData(model, fields, FlowData)">
  12. <tr>
  13. <td colspan="4" style="border:none">
  14. <audit-advanced-group
  15. :expand="auditBaseGroup"
  16. :expand-str="'auditBaseGroup'"
  17. :group-label="'风险审计信息'"
  18. @changedClick="changedClick"
  19. />
  20. </td>
  21. </tr>
  22. <template v-if="auditBaseGroup">
  23. <tr v-for="(item, i) in baseFormData" :key="i">
  24. <sd-form-item-td
  25. v-for="(child, j) in item"
  26. :key="j"
  27. :name="child.key"
  28. :label="child.name"
  29. :input-props="{ disabled: true }"
  30. />
  31. </tr>
  32. </template>
  33. </table>
  34. <div v-if="auditBaseGroup" :class="$style.onlydiv">
  35. <!--todo 模型逻辑 -->
  36. <p :class="$style.modelIdea">模型逻辑:</p>
  37. <SdQuillEditor v-model="model.configIdea" :options="editorOption" />
  38. </div>
  39. <!-- 线索信息 -->
  40. <table>
  41. <tr>
  42. <td colspan="4" style="border:none">
  43. <audit-advanced-group
  44. :expand="auidtInfoGroup"
  45. :expand-str="'auidtInfoGroup'"
  46. :group-label="'审计线索信息'"
  47. @changedClick="changedClick"
  48. />
  49. </td>
  50. </tr>
  51. </table>
  52. <div v-if="auidtInfoGroup" :class="$style.onlydiv">
  53. <AuditRiskDetail :search-data="infoSearchData" search-type="component"></AuditRiskDetail>
  54. </div>
  55. <!-- 整改人能看到的模块 -->
  56. <template v-if="isViewType === 0">
  57. <!-- 判定问题 -->
  58. <table>
  59. <tr>
  60. <td colspan="4" style="border:none">
  61. <audit-advanced-group
  62. :expand="auditJudgeGroup"
  63. :expand-str="'auditJudgeGroup'"
  64. :group-label="'判定问题'"
  65. @changedClick="changedClick"
  66. />
  67. </td>
  68. </tr>
  69. <template v-if="auditJudgeGroup">
  70. <tr>
  71. <sd-form-item-td :name="'questionFlag'" :label="'是否为问题'">
  72. <a-select v-model="questionFormData.questionFlag" placeholder="请选择问题判定">
  73. <a-select-option :value="1">是</a-select-option>
  74. <a-select-option :value="0">否</a-select-option>
  75. </a-select>
  76. </sd-form-item-td>
  77. <sd-form-item-td
  78. v-if="questionFormData.questionFlag === 0"
  79. :name="'problemStatementId'"
  80. :label="'非问题标签'"
  81. >
  82. <a-select
  83. v-model="questionFormData.problemStatementId"
  84. placeholder="请选择非问题标签"
  85. >
  86. <a-select-option
  87. v-for="(item, index) in nonQuestionList"
  88. :key="item.id"
  89. :value="item.id"
  90. >{{ item.name }}</a-select-option
  91. >
  92. </a-select>
  93. </sd-form-item-td>
  94. </tr>
  95. <tr v-if="questionFormData.questionFlag === 0">
  96. <sd-form-item-td>
  97. <a-input
  98. v-model="questionFormData.nonQuestionDesc"
  99. placeholder="请填写非问题说明"
  100. :auto-size="{ minRows: 5, maxRows: 5 }"
  101. type="textarea"
  102. :disabled="true"
  103. />
  104. </sd-form-item-td>
  105. </tr>
  106. </template>
  107. </table>
  108. <!-- 说明 -->
  109. <table>
  110. <tr>
  111. <td colspan="4" style="border:none">
  112. <audit-advanced-group
  113. :expand="auditDescGroup"
  114. :expand-str="'auditDescGroup'"
  115. :group-label="'说明'"
  116. @changedClick="changedClick"
  117. />
  118. </td>
  119. </tr>
  120. <template v-if="auditDescGroup">
  121. <tr>
  122. <sd-form-item-td>
  123. <a-input
  124. v-model="model.reformDesc"
  125. placeholder="请填写整改说明"
  126. :auto-size="{ minRows: 5, maxRows: 5 }"
  127. type="textarea"
  128. :disabled="isViewType"
  129. />
  130. </sd-form-item-td>
  131. </tr>
  132. </template>
  133. </table>
  134. <!-- 附件 -->
  135. <table>
  136. <tr>
  137. <td colspan="4" style="border:none">
  138. <audit-advanced-group
  139. :expand="auditAttachmentGroup"
  140. :expand-str="'auditAttachmentGroup'"
  141. :group-label="'附件'"
  142. @changedClick="changedClick"
  143. />
  144. </td>
  145. </tr>
  146. </table>
  147. <template v-if="auditAttachmentGroup">
  148. <div :class="$style.onlydiv">
  149. <div :class="[$style.upload]">
  150. <a-upload-dragger
  151. :class="$style.uploadData"
  152. name="RectificationFile"
  153. :file-list="fileListTemp"
  154. :accept="actualAccept"
  155. :multiple="true"
  156. :custom-request="(file) => customRequest(file, 0)"
  157. @change="handleChange"
  158. >
  159. <p class="ant-upload-drag-icon"><a-icon type="inbox"/></p>
  160. <p class="ant-upload-text">请上传整改附件</p>
  161. </a-upload-dragger>
  162. <div :class="$style.uploadList">
  163. <li v-for="(item, i) in fileList" :key="i">
  164. <span>{{ item.name }}</span>
  165. <!-- 删除 -->
  166. <a-icon type="delete" style="cursor: pointer;" @click="deleteFile(i)" />
  167. </li>
  168. </div>
  169. </div>
  170. </div>
  171. </template>
  172. </template>
  173. <template v-else>
  174. <!--审计线索明细 -->
  175. <table>
  176. <tr>
  177. <td colspan="4" style="border:none">
  178. <audit-advanced-group
  179. :expand="auditXsGroup"
  180. :expand-str="'auditXsGroup'"
  181. :group-label="'审计线索明细'"
  182. @changedClick="changedClick"
  183. />
  184. </td>
  185. </tr>
  186. <template v-if="auditXsGroup">
  187. <tr>
  188. <sd-form-item-td :name="'viewAccount'" :label="'整改人'"> </sd-form-item-td>
  189. <sd-form-item-td :name="'reviewer'" :label="'初审人'"> </sd-form-item-td>
  190. </tr>
  191. <!-- 非问题标签 非问题说明, 说明 附件 问题性质 -->
  192. <tr>
  193. <sd-form-item-td :name="'nonQuestionDesc'" :label="'非问题说明'">
  194. <a-input
  195. v-model="model.nonQuestionDesc"
  196. :auto-size="{ minRows: 5, maxRows: 5 }"
  197. type="textarea"
  198. :disabled="true"
  199. />
  200. </sd-form-item-td>
  201. </tr>
  202. <tr>
  203. <sd-form-item-td :name="'reformDesc'" :label="'说明'">
  204. <a-input
  205. v-model="model.reformDesc"
  206. :auto-size="{ minRows: 5, maxRows: 5 }"
  207. type="textarea"
  208. :disabled="true"
  209. />
  210. </sd-form-item-td>
  211. </tr>
  212. <!-- 附件 -->
  213. <tr>
  214. <sd-form-item-td :name="'attachment'" :label="'附件'">
  215. <p
  216. v-for="(item, i) in model.attachment.split(',')"
  217. :key="i"
  218. @click="exportClick(record, i)"
  219. >{{ item }}</p
  220. >
  221. </sd-form-item-td>
  222. </tr>
  223. <!-- 问题性质 -->
  224. <tr v-if="isViewType === 1">
  225. <sd-form-item-td :name="'questionNature'" :label="'问题性质'">
  226. <a-select v-model="model.questionNature" placeholder="请选择问题性质">
  227. <a-select-option v-for="(item, i) in questionOption" :key="i" :value="item">{{
  228. item
  229. }}</a-select-option>
  230. </a-select>
  231. </sd-form-item-td>
  232. </tr>
  233. <tr v-else>
  234. <!-- 只读问题性质 -->
  235. <sd-form-item-td
  236. :name="'questionNature'"
  237. :label="'问题性质'"
  238. :input-props="{ disabled: true }"
  239. />
  240. </tr>
  241. </template>
  242. </table>
  243. </template>
  244. </template>
  245. </sd-webflow>
  246. </template>
  247. <script>
  248. import components from './_import-components/audit-issued-form-import'
  249. import { message } from 'ant-design-vue'
  250. import auditAdvancedGroup from '../../components/audit-advanced-group.vue'
  251. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  252. import AuditRiskDetail from './audit-risk-detail.vue'
  253. import download from '@/common/services/download'
  254. import { sdLocalStorage } from '@/common/services/storage-service'
  255. import axios from '@/common/services/axios-instance'
  256. import SdQuillEditor from '@/common/components/sd-quill-editor.vue'
  257. import { getUserInfo } from '@/common/store-mixin'
  258. import moment from 'moment'
  259. const xzList = [
  260. '有业务无制度',
  261. '有制度难执行',
  262. '制度太宽泛缺乏操作细则',
  263. '制度过时不具备可操作性',
  264. '制度脱离实际难落地实施',
  265. '有制度未遵循',
  266. '特殊事项已经线下审批',
  267. '事项紧急重目标轻合规',
  268. '制度理解存在人为偏差',
  269. '工作疏忽未按制度行事',
  270. '人为规避制度管控要求',
  271. ]
  272. const baseData = [
  273. [
  274. {
  275. name: '业务编码',
  276. key: 'businessCode',
  277. },
  278. {
  279. name: '模型编码',
  280. key: 'modelCode',
  281. },
  282. ],
  283. [
  284. {
  285. name: '模型类型',
  286. key: 'modelType',
  287. },
  288. {
  289. name: '模型名称',
  290. key: 'modelName',
  291. },
  292. ],
  293. [
  294. // todo 字段需要确认
  295. {
  296. name: '业务领域',
  297. key: 'businessDomain',
  298. },
  299. {
  300. name: '业务阶段',
  301. key: 'businessStage',
  302. },
  303. ],
  304. [
  305. {
  306. name: '单位',
  307. key: 'unit',
  308. },
  309. {
  310. name: '二级单位',
  311. key: 'secondUnit',
  312. },
  313. ],
  314. [
  315. {
  316. name: '问题推送时间',
  317. key: 'pushDate',
  318. },
  319. {
  320. name: '整改截至日期',
  321. key: 'reformDeadline',
  322. },
  323. ],
  324. [
  325. {
  326. name: '关注风险',
  327. key: 'risk',
  328. },
  329. ],
  330. [
  331. {
  332. name: '整改说明',
  333. key: 'reformDesc',
  334. },
  335. ],
  336. ]
  337. export default {
  338. name: 'AuditIssuedForm',
  339. metaInfo: {
  340. title: 'AuditIssuedForm',
  341. },
  342. components: {
  343. auditAdvancedGroup,
  344. AuditRiskDetail,
  345. SdQuillEditor,
  346. ...components,
  347. },
  348. mixins: [auditAdvancedGroupMixins],
  349. data() {
  350. return {
  351. // 流程 key
  352. key: 0,
  353. // 控制流程模块展开
  354. auditBaseGroup: false,
  355. // 审计线索信息
  356. auidtInfoGroup: false,
  357. // 判定问题
  358. auditJudgeGroup: false,
  359. // 说明
  360. auditDescGroup: false,
  361. // 附件
  362. auditAttachmentGroup: false,
  363. // 审计线索明细
  364. auditXsGroup: false,
  365. baseFormData: baseData,
  366. // 问题性质
  367. questionOption: xzList,
  368. infoSearchData: {},
  369. // 是否是整改人
  370. isViewType: 0,
  371. // 问题判定
  372. questionFormData: {
  373. questionFlag: null,
  374. nonQuestionDesc: null,
  375. problemStatementId: null,
  376. },
  377. nonQuestionList: [],
  378. // 初始化 上传附件部分
  379. flagIs: true,
  380. fileList: [],
  381. fileListTemp: [],
  382. attachments: [],
  383. editorOption: {
  384. // 只读
  385. readOnly: true,
  386. modules: {
  387. toolbar: {
  388. container: [
  389. ['bold', 'italic', 'underline', 'strike'], // toggled buttons
  390. ['blockquote', 'code-block'],
  391. [{ header: 1 }, { header: 2 }], // custom button values
  392. [{ list: 'ordered' }, { list: 'bullet' }],
  393. [{ script: 'sub' }, { script: 'super' }], // superscript/subscript
  394. [{ indent: '-1' }, { indent: '+1' }], // outdent/indent
  395. [{ direction: 'rtl' }], // text direction
  396. [{ size: ['small', false, 'large', 'huge'] }], // custom dropdown
  397. [{ header: [1, 2, 3, 4, 5, 6, false] }],
  398. [{ color: [] }, { background: [] }], // dropdown with defaults from theme
  399. [{ font: [] }],
  400. [{ align: [] }],
  401. ['clean'], // remove formatting button
  402. ['link', 'image'], // link and image, video
  403. ],
  404. },
  405. },
  406. },
  407. // 表单数据
  408. isInitData: false,
  409. webFlowData: {},
  410. }
  411. },
  412. computed: {
  413. actualAccept() {
  414. // 优先使用前端配置的类型限制,如未配置,则使用后端支持的类型
  415. return (
  416. this.accept || JSON.parse(sdLocalStorage.getItem('commonConfig') || '{}').attachType || ''
  417. )
  418. },
  419. },
  420. watch: {
  421. fileList: {
  422. handler(val) {
  423. this.fileListTemp = val.map((item) => {
  424. return {
  425. name: item.name,
  426. url: item.url,
  427. }
  428. })
  429. },
  430. immediate: true,
  431. },
  432. isInitData: {
  433. handler: function(val) {
  434. this.$nextTick(() => {
  435. this.setInitData()
  436. })
  437. },
  438. },
  439. },
  440. methods: {
  441. // 表单验证
  442. validForm(e) {
  443. return Promise.resolve(true)
  444. },
  445. actionBtnClick(evt, { button, FlowData }) {
  446. if (button.buttonId === 'G_1_FXWTSJ.4') {
  447. // todo问题性质选择
  448. // if (
  449. // !this.classdata[0]?.questionNature &&
  450. // this.isViewType &&
  451. // !this.classdata[0]?.nonQuestionDesc
  452. // ) {
  453. // evt.preventDefault()
  454. // return Modal.warning({
  455. // title: '提示',
  456. // content: '请选择需要问题性质!',
  457. // })
  458. // }
  459. }
  460. // 如果是处于第一阶段则需要选择问题性质
  461. if (this.isViewType) {
  462. // 判断问题性质是否已经选择
  463. if (!this.model.questionNature) {
  464. evt.preventDefault()
  465. message.warning('请选择问题性质')
  466. }
  467. }
  468. if (button.fakeId === 'save' || button.fakeId === 'workflow-push') {
  469. // 保存前先校验计划是否已经存在
  470. evt.waitUntil(
  471. new Promise((resolve, reject) => {
  472. this.saveForm(button.buttonId).then((res) => {
  473. if (!res) {
  474. evt.preventDefault()
  475. }
  476. resolve()
  477. })
  478. })
  479. )
  480. }
  481. },
  482. saveForm() {
  483. return new Promise((resolve) => {
  484. // 如果没有则提示请选择问题类型
  485. if (this.questionFormData.questionFlag !== 0 || this.questionFormData.questionFlag !== 1) {
  486. message.warning('请选择问题类型')
  487. resolve(false)
  488. }
  489. // 校验非问题类型参数
  490. if (this.questionFormData.questionFlag === 0) {
  491. if (!this.questionFormData.problemStatementId) {
  492. message.warning('请选择非问题标签')
  493. resolve(false)
  494. }
  495. if (!this.questionFormData.nonQuestionDesc) {
  496. message.warning('请填写非问题说明')
  497. resolve(false)
  498. }
  499. }
  500. // 校验说明是否有值
  501. if (!this.model.reformDesc) {
  502. message.warning('请填写整改说明')
  503. resolve(false)
  504. }
  505. // if (this.isViewType) {
  506. // this.$refs.docform.setFieldValue('questionNature', this.classdata[0].questionNature)
  507. // const account = getUserInfo().name
  508. // const strTime = moment().format('YYYY-MM-DD')
  509. // // 第一次
  510. // if (!this.initType) {
  511. // // 没有初审人,设置初审人
  512. // if (!this.classdata[0].checker) {
  513. // this.$refs.docform.setFieldValue('checker', account)
  514. // this.$refs.docform.setFieldValue('checkDate', strTime)
  515. // }
  516. // // 有初审人并且没有终审人
  517. // if (this.classdata[0].checker && !this.classdata[0].reviewer) {
  518. // this.$refs.docform.setFieldValue('reviewer', account)
  519. // this.$refs.docform.setFieldValue('reviewDate', strTime)
  520. // }
  521. // }
  522. // }
  523. // if (!this.isViewType) {
  524. // const strTime = moment().format('YYYY-MM-DD')
  525. // this.$refs.docform.setFieldValue('reformDate', strTime)
  526. // this.$refs.docform.setFieldValue('title', getUserInfo().name + '风险审核')
  527. // }
  528. // 根据阶段判断赋值的类型
  529. resolve(true)
  530. })
  531. },
  532. // 初始化基础信息
  533. initData(model, fields, FlowData) {
  534. this.isInitData = true
  535. this.webFlowData = {
  536. model,
  537. fields,
  538. FlowData,
  539. }
  540. return true
  541. },
  542. setInitData() {
  543. const { model, fields, FlowData } = this.webFlowData
  544. // 获取来自路由的信息
  545. // 是否存在extParams
  546. if (this.$route.query.extParams) {
  547. const extParams = JSON.parse(this.$route.query.extParams) || []
  548. console.log('🚀 ~ initData ~ extParams:', extParams)
  549. Object.keys(extParams).forEach((val) => {
  550. if (extParams[val] === 'null') extParams[val] = null
  551. this.$refs.docform.setFieldValue(val, extParams[val])
  552. })
  553. }
  554. // 如果整改人是自己则可以上传
  555. // 显示信息
  556. // todo修改流程后更改
  557. const logInfo = FlowData.processLogInfo?.length || 0
  558. if (logInfo > 1) {
  559. this.isViewType = logInfo - 1
  560. }
  561. const account = getUserInfo().name
  562. const strTime = moment().format('YYYY-MM-DD')
  563. if (logInfo === 1) {
  564. // 给初审人赋值
  565. this.$refs.docform.setFieldValue('checker', account)
  566. this.$refs.docform.setFieldValue('checkDate', strTime)
  567. } else if (logInfo === 2) {
  568. this.$refs.docform.setFieldValue('reviewer', account)
  569. this.$refs.docform.setFieldValue('reviewDate', strTime)
  570. // 给终审人赋值
  571. } else {
  572. this.$refs.docform.setFieldValue('viewAccount', account)
  573. this.$refs.docform.setFieldValue('reformDate', strTime)
  574. this.$refs.docform.setFieldValue('title', getUserInfo().name + '风险审核')
  575. if (model.attachment && this.flagIs) {
  576. const attachmentList = model.attachment.split(',')
  577. const fileNameList = model.fileName.split(',')
  578. this.fileList = []
  579. for (let i = 0; i < attachmentList.length; i++) {
  580. this.fileList.push({
  581. name: fileNameList[i],
  582. url: attachmentList[i],
  583. })
  584. }
  585. this.flagIs = false
  586. }
  587. }
  588. // 初始化线索信息
  589. this.infoSearchData = {
  590. // modelCode: model.modelCode,
  591. // businessCode: model.businessCode,
  592. }
  593. this.auditBaseGroup = true
  594. this.auidtInfoGroup = true
  595. this.auditJudgeGroup = true
  596. this.auditDescGroup = true
  597. this.auditAttachmentGroup = true
  598. this.auditXsGroup = true
  599. },
  600. // 非问题处理
  601. // 附件上传
  602. // 附件自定义上传
  603. customRequest(data, catnum = 0, item) {
  604. if (data.file.size === 0) {
  605. message.warn(`不能上传大小为0的文件`)
  606. return
  607. }
  608. const file = {
  609. FileName: data.file.name,
  610. Completed: 0,
  611. CatNum: catnum,
  612. }
  613. this.attachments = [...this.attachments]
  614. const strTime = moment().format('YYYY-MM-DD HH:mm:ss')
  615. const formData = new FormData()
  616. formData.append('file', data.file)
  617. formData.append('FileName', data.file.name)
  618. formData.append('lockId', this.lockId)
  619. formData.append('groupId', this.groupId)
  620. Object.keys(this.infoProperties).forEach((key) => {
  621. formData.append(key, this.infoProperties[key])
  622. })
  623. formData.append(
  624. 'querystring',
  625. `<file_unid></file_unid><file_name>${data.file.name}</file_name><file_size>${data.file.size}</file_size><completed>1</completed><file_create>${strTime}</file_create><file_update>${strTime}</file_update><file_editmodel>0</file_editmodel><file_lockuser>0</file_lockuser><CreateInfo>${this.userInfo.account} ${strTime}</CreateInfo><filetype></filetype><user_name>${this.userInfo.account}</user_name><UpdateInfo>${this.userInfo.account}于${strTime}创建.</UpdateInfo><TaodaInfo></TaodaInfo><CatNum>${catnum}</CatNum><Ext></Ext>`
  626. )
  627. const url = 'api/xcoa-mobile/v1/iam-attachment-extend/attachments-upload/indi'
  628. axios
  629. .post(url, formData, {
  630. headers: {
  631. 'Content-Type': 'multipart/form-data',
  632. },
  633. })
  634. .then((_) => {
  635. if (_.data.startsWith('false')) {
  636. message.error(`${data.file.name} 上传失败`)
  637. } else {
  638. this.fileList.push({
  639. name: data.file.name,
  640. url: _.data,
  641. })
  642. const attachment = this.fileList.map((item) => item.url).join(',')
  643. const nameList = this.fileList.map((item) => item.name).join(',')
  644. this.$refs.docform.setFieldValue('attachment', attachment)
  645. this.$refs.docform.setFieldValue('fileName', nameList)
  646. data.onSuccess(_, data.file)
  647. }
  648. })
  649. .catch((e) => {
  650. message.error(`${data.file.name} 上传失败`)
  651. throw e
  652. })
  653. },
  654. // 附件上传
  655. handleChange(info) {
  656. const status = info.file.status
  657. if (status === 'done') {
  658. message.success(`${info.file.name} 上传成功.`)
  659. } else if (status === 'error') {
  660. message.error(`${info.file.name} 上传失败.`)
  661. }
  662. },
  663. // <!-- 删除已上传附件 -->
  664. deleteFile(index) {
  665. this.fileList.splice(index, 1)
  666. const attachment = this.fileList.map((item) => item.url).join(',')
  667. const nameList = this.fileList.map((item) => item.name).join(',')
  668. this.$refs.docform.setFieldValue('attachment', attachment)
  669. this.$refs.docform.setFieldValue('fileName', nameList)
  670. },
  671. // 下载附件
  672. exportClick(row, i) {
  673. const attachmentList = row.attachment.split(',')
  674. const fileNameList = row.fileName.split(',')
  675. const spliceIndex = attachmentList[i].lastIndexOf('|')
  676. const destStep = attachmentList[i].substring(spliceIndex + 1, attachmentList[i].length)
  677. download(
  678. 'api/framework/v1/task-form-process/download-attachments/' + destStep,
  679. fileNameList[i]
  680. )
  681. },
  682. },
  683. }
  684. </script>
  685. <style module lang="scss">
  686. @use '@/common/design' as *;
  687. .upload {
  688. display: flex;
  689. min-width: 800px;
  690. min-height: 200px;
  691. .upload-list {
  692. width: calc(30% - 10px);
  693. margin-left: 10px;
  694. li {
  695. display: flex;
  696. align-items: center;
  697. justify-content: space-between;
  698. width: 100%;
  699. height: 30px;
  700. padding: 0 10px;
  701. margin-bottom: 10px;
  702. line-height: 30px;
  703. border-radius: 4px;
  704. span {
  705. display: inline-block;
  706. width: 80%;
  707. overflow: hidden;
  708. text-overflow: ellipsis;
  709. white-space: nowrap;
  710. }
  711. }
  712. }
  713. .upload-data {
  714. width: 70%;
  715. }
  716. }
  717. .model-idea {
  718. // 上下边距
  719. margin: 10px 0;
  720. }
  721. .onlydiv {
  722. width: 90%;
  723. margin: 0 auto;
  724. }
  725. </style>