audit-issued-form.vue 29 KB

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