audit-issued-form.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  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-cascader :options="questionNatureList" v-model="questionNature" change-on-select placeholder="请选择问题性质" />
  300. <!-- <a-select v-model="model.questionNature" placeholder="请选择问题性质">-->
  301. <!-- <a-select-option v-for="(item, i) in questionOption" :key="i" :value="item">{{-->
  302. <!-- item-->
  303. <!-- }}</a-select-option>-->
  304. <!-- </a-select>-->
  305. </sd-form-item-td>
  306. </tr>
  307. <tr v-else-if="model.questionFlag === 1">
  308. <!-- 只读问题性质 -->
  309. <sd-form-item-td
  310. :colspan="3"
  311. :name="'questionNature'"
  312. :label="'问题性质'"
  313. :input-props="{ disabled: true }"
  314. />
  315. </tr>
  316. </template>
  317. </table>
  318. </template>
  319. </template>
  320. </sd-webflow>
  321. </template>
  322. <script>
  323. import components from './_import-components/audit-issued-form-import'
  324. import { message } from 'ant-design-vue'
  325. import auditAdvancedGroup from '../../components/audit-advanced-group.vue'
  326. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  327. import download from '@/common/services/download'
  328. import { sdLocalStorage } from '@/common/services/storage-service'
  329. import axios from '@/common/services/axios-instance'
  330. import SdQuillEditor from '@/common/components/sd-quill-editor.vue'
  331. import moment from 'moment'
  332. import AuditRiskbraryService from './riskLibrary'
  333. import { getUserInfo } from '@/common/store-mixin'
  334. const xzList = [
  335. '有业务无制度',
  336. '有制度难执行',
  337. '制度太宽泛缺乏操作细则',
  338. '制度过时不具备可操作性',
  339. '制度脱离实际难落地实施',
  340. '有制度未遵循',
  341. '特殊事项已经线下审批',
  342. '事项紧急重目标轻合规',
  343. '制度理解存在人为偏差',
  344. '工作疏忽未按制度行事',
  345. '人为规避制度管控要求',
  346. ]
  347. const baseData = [
  348. [
  349. {
  350. name: '业务编码',
  351. key: 'businessCode',
  352. },
  353. {
  354. name: '模型编码',
  355. key: 'batchCode',
  356. },
  357. ],
  358. [
  359. {
  360. name: '模型类型',
  361. key: 'modelTypeName',
  362. },
  363. {
  364. name: '模型名称',
  365. key: 'batchName',
  366. },
  367. ],
  368. [
  369. // todo 字段需要确认
  370. {
  371. name: '业务领域',
  372. key: 'modelDomainName',
  373. },
  374. {
  375. name: '业务阶段',
  376. key: 'modelPhaseName',
  377. },
  378. ],
  379. [
  380. {
  381. name: '单位',
  382. key: 'unit',
  383. },
  384. {
  385. name: '二级单位',
  386. key: 'secondUnit',
  387. },
  388. ],
  389. [
  390. {
  391. name: '问题推送时间',
  392. key: 'pushDate',
  393. },
  394. {
  395. name: '整改截至日期',
  396. key: 'reformDeadline',
  397. },
  398. ],
  399. [
  400. {
  401. name: '关注风险',
  402. key: 'risk',
  403. col: 3,
  404. },
  405. ],
  406. [
  407. {
  408. name: '整改说明',
  409. key: 'modelReformDesc',
  410. col: 3,
  411. },
  412. ],
  413. ]
  414. export default {
  415. name: 'AuditIssuedForm',
  416. metaInfo: {
  417. title: 'AuditIssuedForm',
  418. },
  419. components: {
  420. auditAdvancedGroup,
  421. SdQuillEditor,
  422. ...components,
  423. },
  424. mixins: [auditAdvancedGroupMixins],
  425. data() {
  426. return {
  427. // 流程 key
  428. key: 0,
  429. // 控制流程模块展开
  430. auditBaseGroup: false,
  431. // 审计线索信息
  432. auidtInfoGroup: false,
  433. // 判定问题
  434. auditJudgeGroup: false,
  435. // 说明
  436. auditDescGroup: false,
  437. // 附件
  438. auditAttachmentGroup: false,
  439. // 审计线索明细
  440. auditXsGroup: false,
  441. baseFormData: baseData,
  442. // 问题性质
  443. questionOption: xzList,
  444. infoSearchData: {},
  445. // 是否是整改人
  446. logInfo: 0,
  447. // 问题判定
  448. questionFormData: {
  449. questionFlag: 0,
  450. nonQuestionDesc: null,
  451. questionId: null,
  452. nonQuestionTag: null,
  453. },
  454. questionNature:[],
  455. questionNatureList: [
  456. {
  457. label: '有业务无制度',
  458. value: '有业务无制度',
  459. children: [
  460. ]
  461. },
  462. {
  463. label: '有制度难执行',
  464. value: '有制度难执行',
  465. children: [
  466. {
  467. label: '制度太宽泛缺乏操作细则',
  468. value: '制度太宽泛缺乏操作细则'
  469. },
  470. {
  471. label: '制度过时不具备可操作性',
  472. value: '制度过时不具备可操作性'
  473. },
  474. {
  475. label: '制度脱离实际难落地实施',
  476. value: '制度脱离实际难落地实施'
  477. },
  478. ]
  479. },
  480. {
  481. label: '有制度未遵循',
  482. value: '有制度未遵循',
  483. children: [{
  484. label:'特殊事项已经线下审批',
  485. value: '特殊事项已经线下审批'
  486. },{
  487. label:'事项紧急重目标轻合规',
  488. value: '事项紧急重目标轻合规'
  489. },{
  490. label:'制度理解存在人为偏差',
  491. value: '制度理解存在人为偏差'
  492. },{
  493. label:'工作疏忽未按制度行事',
  494. value: '工作疏忽未按制度行事'
  495. },{
  496. label:'人为规避制度管控要求',
  497. value: '人为规避制度管控要求'
  498. }]
  499. }
  500. ],
  501. isDescStatus: false,
  502. nonQuestionList: [],
  503. // 初始化 上传附件部分
  504. flagIs: true,
  505. fileList: [],
  506. fileListTemp: [],
  507. attachments: [],
  508. editorOption: {
  509. // 只读
  510. readOnly: true,
  511. editable: false,
  512. modules: {
  513. toolbar: {
  514. container: [
  515. ['bold', 'italic', 'underline', 'strike'], // toggled buttons
  516. ['blockquote', 'code-block'],
  517. [{ header: 1 }, { header: 2 }], // custom button values
  518. [{ list: 'ordered' }, { list: 'bullet' }],
  519. [{ script: 'sub' }, { script: 'super' }], // superscript/subscript
  520. [{ indent: '-1' }, { indent: '+1' }], // outdent/indent
  521. [{ direction: 'rtl' }], // text direction
  522. [{ size: ['small', false, 'large', 'huge'] }], // custom dropdown
  523. [{ header: [1, 2, 3, 4, 5, 6, false] }],
  524. [{ color: [] }, { background: [] }], // dropdown with defaults from theme
  525. [{ font: [] }],
  526. [{ align: [] }],
  527. ['clean'], // remove formatting button
  528. ['link', 'image'], // link and image, video
  529. ],
  530. },
  531. },
  532. },
  533. columnsDetail: [],
  534. dataDetail: [],
  535. loading: false,
  536. // 表单数据
  537. isInitData: false,
  538. webFlowData: {},
  539. // 是否只查看
  540. isWebFlow: false,
  541. lockId: 0,
  542. // 是否是关注类
  543. isFocus: false,
  544. }
  545. },
  546. computed: {
  547. actualAccept() {
  548. // 优先使用前端配置的类型限制,如未配置,则使用后端支持的类型
  549. return (
  550. this.accept || JSON.parse(sdLocalStorage.getItem('commonConfig') || '{}').attachType || ''
  551. )
  552. },
  553. },
  554. watch: {
  555. questionNature(val) {
  556. },
  557. fileList: {
  558. handler(val) {
  559. this.fileListTemp = val.map((item) => {
  560. return {
  561. name: item.name,
  562. url: item.url,
  563. }
  564. })
  565. },
  566. immediate: true,
  567. },
  568. 'questionFormData.questionFlag': {
  569. handler(val) {
  570. if (val === 0) {
  571. this.questionFormData.questionId = null
  572. this.questionFormData.nonQuestionDesc = null
  573. this.questionFormData.nonQuestionTag = null
  574. }
  575. },
  576. },
  577. isInitData: {
  578. handler: function(val) {
  579. this.$nextTick(() => {
  580. this.setInitData()
  581. })
  582. },
  583. },
  584. },
  585. mounted() {
  586. axios({ url: 'api/xcoa-mobile/v1/problem-statement/all', method: 'get' }).then((res) => {
  587. res.data.length ? (this.nonQuestionList = res.data) : (this.nonQuestionList = [])
  588. })
  589. },
  590. methods: {
  591. // 表单验证
  592. validForm(e) {
  593. return Promise.resolve(true)
  594. },
  595. actionBtnClick(evt, { button, FlowData }) {
  596. const { model } = FlowData
  597. if (button.buttonId === 'G_1_FXWTSJ.4') {
  598. }
  599. // 根据
  600. if (button.fakeId === 'save' || button.fakeId === 'workflow-push') {
  601. // 保存前先校验计划是否已经存在
  602. evt.waitUntil(
  603. new Promise((resolve, reject) => {
  604. this.saveForm(button.buttonId).then((res) => {
  605. if (!res) {
  606. evt.preventDefault()
  607. }
  608. resolve()
  609. })
  610. })
  611. )
  612. }
  613. },
  614. saveForm() {
  615. return new Promise((resolve) => {
  616. // 如果没有则提示请选择问题类型
  617. const { questionFlag, questionId, nonQuestionDesc } = this.questionFormData
  618. if (questionFlag !== 0 && questionFlag !== 1 && this.logInfo === 1) {
  619. message.warning('请选择问题类型')
  620. resolve(false)
  621. return
  622. }
  623. // 校验非问题类型参数
  624. if (questionFlag === 0 && this.logInfo === 1) {
  625. if (!questionId) {
  626. message.warning('请选择非问题标签')
  627. resolve(false)
  628. return
  629. }
  630. if (!nonQuestionDesc) {
  631. message.warning('请填写非问题说明')
  632. resolve(false)
  633. return
  634. }
  635. }
  636. this.questionFormData.questionNature = this.questionNature.join('|')
  637. // 如果是处于第一阶段则需要选择问题性质
  638. if (this.logInfo === 2 && questionFlag === 1) {
  639. // 判断问题性质是否已经选择
  640. if (!this.questionFormData.questionNature) {
  641. message.warning('请选择问题性质')
  642. resolve(false)
  643. return
  644. }
  645. }
  646. Object.keys(this.questionFormData).map((val) => {
  647. this.$refs.docform.setFieldValue(val, this.questionFormData[val])
  648. })
  649. // 校验说明是否有值
  650. // 获取reformDesc
  651. const reformDesc = this.$refs.docform.getFieldValue('reformDesc')
  652. if (!reformDesc) {
  653. message.warning('请填写整改说明')
  654. resolve(false)
  655. return
  656. }
  657. resolve(true)
  658. })
  659. },
  660. // 初始化基础信息
  661. initData(model, fields, FlowData) {
  662. this.isInitData = true
  663. this.webFlowData = {
  664. model,
  665. fields,
  666. FlowData,
  667. }
  668. return true
  669. },
  670. setInitData() {
  671. const { model, fields, FlowData } = this.webFlowData
  672. this.lockId = FlowData.lockId
  673. // 如果整改人是自己则可以上传
  674. // 显示信息
  675. // todo修改流程后更改
  676. // 2整改 3初审 4复审
  677. // http://10.104.32.30/api/framework/v1/task-form-process/inst-logs-process/17733
  678. // 给整改人G_1_FXWTSJ.7 viewAccount reformDate
  679. // ,初审人G_1_FXWTSJ.2 checker checkDate,
  680. // 复审人G_1_FXWTSJ.4 reviewer reviewDate
  681. // 现在的阶段
  682. let filedName = ''
  683. let filedDate = ''
  684. const isFlag = FlowData.processActiveLogInfo[0]
  685. if (isFlag?.stepId === 'G_1_FXWTSJ.7') {
  686. this.logInfo = 1
  687. filedName = 'viewAccount'
  688. filedDate = 'reformDate'
  689. }
  690. if (isFlag?.stepId === 'G_1_FXWTSJ.2') {
  691. this.logInfo = 2
  692. filedName = 'checker'
  693. filedDate = 'checkDate'
  694. }
  695. if (isFlag?.stepId === 'G_1_FXWTSJ.4') {
  696. this.logInfo = 3
  697. filedName = 'reviewer'
  698. filedDate = 'reviewDate'
  699. }
  700. this.$refs.docform.setFieldValue(filedName, getUserInfo().name)
  701. const strTime = moment().format('YYYY-MM-DD')
  702. this.$refs.docform.setFieldValue(filedDate, strTime)
  703. // 是否只查看
  704. this.isWebFlow = FlowData.mode !== 'EDIT'
  705. this.questionFormData.nonQuestionDesc = model.nonQuestionDesc // 将值赋值给问题
  706. this.questionFormData.nonQuestionTag = model.nonQuestionTag
  707. this.questionFormData.questionFlag = model.questionFlag
  708. this.questionFormData.questionId = model.questionId
  709. const attachmentList = (model.attachment || '').split(',')
  710. const fileNameList = (model.fileName || '').split(',')
  711. this.fileList = []
  712. if (model.attachment) {
  713. for (let i = 0; i < attachmentList.length; i++) {
  714. this.fileList.push({
  715. name: fileNameList[i],
  716. url: attachmentList[i],
  717. })
  718. }
  719. }
  720. // 初始化线索信息
  721. // 获取模型信息
  722. const data = { id: model.modelId + '' }
  723. AuditRiskbraryService.getIamModelMaintain(data).then((val) => {
  724. // this.$refs.docform.setFieldValue('modelType', val.modelType)
  725. const datas = {}
  726. val.data.pageFormData.pageFieldInfos.map((val) => {
  727. datas[val.name] = val.value
  728. })
  729. // 模型类型
  730. // isFocus
  731. this.$nextTick(() => {
  732. this.$refs.docform.setFieldValue('modelTypeName', datas.modelTypeName)
  733. this.$refs.docform.setFieldValue('batchName', datas.modelName)
  734. // 模型编码
  735. this.$refs.docform.setFieldValue('batchCode', datas.modelCode)
  736. this.$refs.docform.setFieldValue('modelDomainName', datas.modelDomainName)
  737. this.$refs.docform.setFieldValue('modelPhaseName', datas.modelPhaseName)
  738. this.$refs.docform.setFieldValue('modelReformDesc', datas.reformDesc)
  739. // modelTypeName
  740. this.isFocus = datas.modelTypeName.includes('关注类')
  741. })
  742. })
  743. this.getRiskDetail()
  744. this.auditBaseGroup = true
  745. this.auidtInfoGroup = true
  746. this.auditJudgeGroup = true
  747. this.auditDescGroup = true
  748. this.auditAttachmentGroup = true
  749. this.auditXsGroup = true
  750. },
  751. // 非问题处理
  752. questionChange(val) {
  753. const onDesc = this.nonQuestionList.find((item) => item.id === val)
  754. const { description, name } = onDesc
  755. this.questionFormData.nonQuestionDesc = description
  756. this.questionFormData.nonQuestionTag = name
  757. // 如果详情为空或者null则 isDescStatus ==false
  758. if (description === '' || description === null) {
  759. this.isDescStatus = false
  760. } else {
  761. this.isDescStatus = true
  762. }
  763. },
  764. // 附件上传
  765. // 附件自定义上传
  766. customRequest(data, catnum = 0, item) {
  767. if (data.file.size === 0) {
  768. message.warn(`不能上传大小为0的文件`)
  769. return
  770. }
  771. const file = {
  772. FileName: data.file.name,
  773. Completed: 0,
  774. CatNum: catnum,
  775. }
  776. const userInfo = getUserInfo()
  777. this.attachments = [...this.attachments]
  778. const strTime = moment().format('YYYY-MM-DD HH:mm:ss')
  779. const formData = new FormData()
  780. formData.append('file', data.file)
  781. formData.append('FileName', data.file.name)
  782. formData.append('lockId', this.lockId)
  783. formData.append('groupId', this.groupId)
  784. formData.append(
  785. 'querystring',
  786. `<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>`
  787. )
  788. const url = 'api/xcoa-mobile/v1/iam-attachment-extend/attachments-upload/indi'
  789. axios
  790. .post(url, formData, {
  791. headers: {
  792. 'Content-Type': 'multipart/form-data',
  793. },
  794. })
  795. .then((_) => {
  796. if (_.data.startsWith('false')) {
  797. message.error(`${data.file.name} 上传失败`)
  798. } else {
  799. this.fileList.push({
  800. name: data.file.name,
  801. url: _.data,
  802. })
  803. const attachment = this.fileList.map((item) => item.url).join(',')
  804. const nameList = this.fileList.map((item) => item.name).join(',')
  805. this.$refs.docform.setFieldValue('attachment', attachment)
  806. this.$refs.docform.setFieldValue('fileName', nameList)
  807. data.onSuccess(_, data.file)
  808. }
  809. })
  810. .catch((e) => {
  811. message.error(`${data.file.name} 上传失败`)
  812. throw e
  813. })
  814. },
  815. // 附件上传
  816. handleChange(info) {
  817. const status = info.file.status
  818. if (status === 'done') {
  819. message.success(`${info.file.name} 上传成功.`)
  820. } else if (status === 'error') {
  821. message.error(`${info.file.name} 上传失败.`)
  822. }
  823. },
  824. // <!-- 删除已上传附件 -->
  825. deleteFile(index) {
  826. this.fileList.splice(index, 1)
  827. const attachment = this.fileList.map((item) => item.url).join(',')
  828. const nameList = this.fileList.map((item) => item.name).join(',')
  829. this.$refs.docform.setFieldValue('attachment', attachment)
  830. this.$refs.docform.setFieldValue('fileName', nameList)
  831. },
  832. // 下载附件
  833. exportClick(row, i) {
  834. const attachmentList = row.attachment.split(',')
  835. const fileNameList = row.fileName.split(',')
  836. const spliceIndex = attachmentList[i].lastIndexOf('|')
  837. const destStep = attachmentList[i].substring(spliceIndex + 1, attachmentList[i].length)
  838. download(
  839. 'api/framework/v1/task-form-process/download-attachments/' + destStep,
  840. fileNameList[i]
  841. )
  842. },
  843. // 获取table数据
  844. getRiskDetail() {
  845. const { model } = this.webFlowData
  846. this.loading = true
  847. this.infoSearchData = {
  848. modelId: model.modelId,
  849. detailGroupId: model.detailGroupId,
  850. jmEventType: model.jmEventType,
  851. unitCode: model.unitCode,
  852. }
  853. AuditRiskbraryService.getDetailInfo(this.infoSearchData)
  854. .then((res) => {
  855. const allField = []
  856. this.columnsDetail = res.data[0].detailArr.map((item) => {
  857. allField.push(item.commit)
  858. return {
  859. title: item.commit,
  860. dataIndex: item.commit,
  861. width: item.value === 'null' ? '100px' : '240px',
  862. ellipsis: true,
  863. }
  864. })
  865. // 过滤事件标签 业务主键 业务时间 buss_key event_type buss_time
  866. this.columnsDetail = this.columnsDetail.filter((item) => {
  867. return (
  868. item.title !== 'buss_key' &&
  869. item.title !== 'event_type' &&
  870. item.title !== 'buss_time' &&
  871. item.title !== '事件标签' &&
  872. item.title !== '业务主键' &&
  873. item.title !== '业务时间'
  874. )
  875. })
  876. this.dataDetail = res.data.map((item) => {
  877. const obj = {}
  878. allField.forEach((field) => {
  879. const onfield = item.detailArr.find((i) => i.commit === field).value
  880. obj[field] = onfield !== 'null' ? onfield : ''
  881. })
  882. obj.id = item.questionId
  883. return obj
  884. })
  885. })
  886. .finally(() => {
  887. this.loading = false
  888. })
  889. },
  890. },
  891. }
  892. </script>
  893. <style module lang="scss">
  894. @use '@/common/design' as *;
  895. .upload {
  896. display: flex;
  897. min-width: 800px;
  898. min-height: 200px;
  899. .upload-list {
  900. width: calc(30% - 10px);
  901. margin-left: 10px;
  902. li {
  903. display: flex;
  904. align-items: center;
  905. justify-content: space-between;
  906. width: 100%;
  907. height: 30px;
  908. padding: 0 10px;
  909. margin-bottom: 10px;
  910. line-height: 30px;
  911. border-radius: 4px;
  912. span {
  913. display: inline-block;
  914. width: 80%;
  915. overflow: hidden;
  916. text-overflow: ellipsis;
  917. white-space: nowrap;
  918. }
  919. }
  920. }
  921. .upload-data {
  922. width: 70%;
  923. }
  924. }
  925. .model-idea {
  926. // 上下边距
  927. margin: 10px 0;
  928. }
  929. .onlydiv {
  930. position: relative;
  931. width: 90%;
  932. margin: 0 auto;
  933. .noselect {
  934. position: absolute;
  935. top: 0;
  936. z-index: 100;
  937. width: 100%;
  938. height: 100%;
  939. }
  940. }
  941. .aclick {
  942. display: block;
  943. }
  944. </style>