audit-issued-form.vue 28 KB

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