audit-view-change.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <template>
  2. <audit-form-top-banner :form-data="'readonly'">
  3. <a-card :class="$style.conditions">
  4. <a-form-model
  5. ref="advancedSearchForm"
  6. class="ant-advanced-search-form"
  7. :model="form"
  8. v-bind="formItemLayout"
  9. >
  10. <a-row :gutter="24" :class="$style.antformitem">
  11. <a-col :span="8">
  12. <a-form-model-item :label="'整改状态'" prop="reformStatus">
  13. <a-select v-model="form.reformStatus" placeholder="请选择整改状态" allow-clear>
  14. <a-select-option value="0">期限内已整改</a-select-option>
  15. <a-select-option value="1">逾期已整改</a-select-option>
  16. <a-select-option value="2">期限内未整改完成</a-select-option>
  17. <a-select-option value="3">逾期未整改完成</a-select-option>
  18. </a-select>
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :span="8">
  22. <a-form-model-item :label="'审核状态'" prop="endType">
  23. <a-select v-model="form.endType" placeholder="请选择审核状态" allow-clear>
  24. <a-select-option value="2">未提交审核</a-select-option>
  25. <a-select-option value="1">已提交待审核</a-select-option>
  26. <a-select-option value="5">审核通过</a-select-option>
  27. <a-select-option value="0">审核驳回</a-select-option>
  28. </a-select>
  29. </a-form-model-item>
  30. </a-col>
  31. <a-col :span="8">
  32. <a-form-model-item label="整改截止时间" prop="timeRange">
  33. <a-range-picker
  34. v-model="reformDeadline"
  35. :format="'YYYY-MM-DD'"
  36. @change="changeReformDeadline"
  37. />
  38. </a-form-model-item>
  39. </a-col>
  40. <a-col :span="8">
  41. <a-form-model-item label="问题推送时间" prop="timeRange">
  42. <a-range-picker v-model="pushDate" :format="'YYYY-MM-DD'" @change="changePushDate" />
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :span="16">
  46. <div :class="$style.buttonContent">
  47. <a-button type="primary" @click="handleAction('serach')">查询</a-button>
  48. <a-button @click="handleReset">重置</a-button>
  49. <!-- 导出 -->
  50. <a-button @click="exportExcel">导出</a-button>
  51. </div>
  52. </a-col>
  53. </a-row>
  54. </a-form-model>
  55. </a-card>
  56. <div>
  57. <a-card>
  58. <sd-data-table-ex
  59. ref="SJMXDataTable"
  60. :key="dataKey"
  61. :columns="columns"
  62. :process-req="processReq"
  63. form-id="iamModelMaintain"
  64. :scroll="{ x: 2800 }"
  65. data-url="api/xcoa-mobile/v1/iamquestionreform/iamQuestionReformListNew"
  66. :filter-expressions="expressions"
  67. show-selection
  68. >
  69. <div slot="questionFlag" slot-scope="text, record">
  70. <span>{{
  71. record.questionFlag === null ? '' : record.questionFlag === 0 ? '否' : '是'
  72. }}</span>
  73. </div>
  74. <div slot="reformStatus" slot-scope="text, record">
  75. <span v-if="record.reformStatus === 0" title="期限内已整改">期限内已整改</span>
  76. <span v-if="record.reformStatus === 1" title="逾期已整改">逾期已整改</span>
  77. <span v-if="record.reformStatus === 2" title="期限内未整改完成">期限内未整改完成</span>
  78. <span v-if="record.reformStatus === 3" title="逾期未整改完成">逾期未整改完成</span>
  79. </div>
  80. <div slot="endType" slot-scope="text, record">
  81. <span v-if="record.endType === null" title="未提交审核">未提交审核</span>
  82. <span v-if="record.endType === 1" title="已提交待审核">已提交待审核</span>
  83. <span v-if="record.endType === 5" title="审核通过">审核通过</span>
  84. <span v-if="record.endType === 0" title="审核驳回">审核驳回</span>
  85. </div>
  86. <div slot="action" slot-scope="text, record">
  87. <!-- 如果 -->
  88. <a-button type="link" @click="showModal(record)">详情</a-button>
  89. <a-button type="link" @click="exportClick(record)">下载</a-button>
  90. <a-button type="link" @click="askClick(record)">整改要求</a-button>
  91. </div>
  92. </sd-data-table-ex>
  93. </a-card>
  94. <a-modal v-model="visible" title="问题详情" :footer="null" width="1200px" @cancel="cancel">
  95. <div :class="$style.modelDetail">
  96. <span>模型编码:{{ modelDetail.batchCode }}</span>
  97. <span>模型名称:{{ modelDetail.batchName }}</span>
  98. <span>业务领域:{{ modelDetail.modelDomainName }}</span>
  99. </div>
  100. <div :class="$style.detail">
  101. <a-table
  102. :columns="columnsDetail"
  103. :data-source="dataDetail"
  104. :row-key="(_, index) => index"
  105. :scroll="{ x: 1150, y: 500 }"
  106. >
  107. </a-table>
  108. </div>
  109. </a-modal>
  110. <a-modal
  111. v-model="askvisible"
  112. class="ant-advanced-search-form"
  113. title="整改要求"
  114. :footer="null"
  115. width="700px"
  116. @ok="askFormhandleOk"
  117. @cancel="askFormCancel"
  118. >
  119. <a-form-model ref="askForm" :model="askForm" v-bind="formItemLayout">
  120. <a-form-model-item prop="reformAsk" label="整改要求说明">
  121. <a-input
  122. v-model="askForm.reformAsk"
  123. placeholder="暂无整改要求说明"
  124. read-only
  125. :auto-size="{ minRows: 5, maxRows: 5 }"
  126. type="textarea"
  127. />
  128. </a-form-model-item>
  129. </a-form-model>
  130. </a-modal>
  131. </div>
  132. </audit-form-top-banner>
  133. </template>
  134. <script>
  135. import components from './_import-components/audit-view-change-import'
  136. import { message, Modal } from 'ant-design-vue'
  137. import AuditRiskbraryService from './riskLibrary'
  138. import moment from 'moment/moment'
  139. import storeMixin, { getUserInfo } from '@/common/store-mixin'
  140. import download from '@/common/services/download'
  141. import sdDataTableEx from '@/common/components/sd-data-table-ex.vue'
  142. import auditFormTopBanner from './audit-top-banner'
  143. export default {
  144. name: 'AuditViewChange',
  145. metaInfo: {
  146. title: '审计问题明细-整改类',
  147. },
  148. components: {
  149. ...components,
  150. sdDataTableEx,
  151. auditFormTopBanner,
  152. },
  153. mixins: [storeMixin],
  154. data() {
  155. return {
  156. exportExpressions: [],
  157. modelDetail: {},
  158. // 问题标签
  159. isDescStatus: false,
  160. mainSendPersonal: [],
  161. visible: false,
  162. visibleDecide: false,
  163. visibleRectification: false,
  164. askvisible: false,
  165. exportLoading: false,
  166. dataKey: 0,
  167. ModalquestionDetail: '',
  168. form: {
  169. reformStatus: null,
  170. endType: null,
  171. },
  172. reformDeadline: [],
  173. pushDate: [],
  174. DecideForm: {
  175. questionFlag: null,
  176. nonQuestionTag: null,
  177. nonQuestionDesc: null,
  178. nonQuestionTagId: null,
  179. problemStatementId: null,
  180. // ids: [],
  181. },
  182. lockId: '',
  183. attachments: [],
  184. fileList: [],
  185. infoProperties: {},
  186. RectificationForm: {
  187. reformDesc: undefined,
  188. attachment: undefined,
  189. id: '',
  190. fileName: '',
  191. },
  192. askForm: {
  193. reformAsk: undefined,
  194. id: '',
  195. },
  196. nonQuestionList: [],
  197. reqData: {
  198. reformDeadlineSt: '',
  199. reformDeadlineEd: '',
  200. pushDateSt: '',
  201. pushDateEd: '',
  202. },
  203. queryData: {},
  204. formItemLayout: {
  205. labelCol: { span: 6 },
  206. wrapperCol: { span: 14 },
  207. },
  208. // 详情信息
  209. columnsDetail: [],
  210. dataDetail: [],
  211. columns: [
  212. {
  213. title: '序号',
  214. dataIndex: 'sortNumber',
  215. width: '70px',
  216. customRender: (text, record, index) => `${index + 1}`,
  217. },
  218. {
  219. title: '模型编码',
  220. dataIndex: 'batchCode',
  221. },
  222. {
  223. title: '模型名称',
  224. dataIndex: 'batchName',
  225. },
  226. {
  227. title: '业务领域',
  228. dataIndex: 'modelDomainName',
  229. },
  230. {
  231. title: '业务阶段',
  232. dataIndex: 'modelPhaseName',
  233. },
  234. // 模型编码 模型名称
  235. {
  236. title: '风险描述',
  237. dataIndex: 'risk',
  238. },
  239. {
  240. title: '问题推送日期',
  241. dataIndex: 'pushDate',
  242. },
  243. {
  244. title: '整改截止日期',
  245. dataIndex: 'reformDeadline',
  246. },
  247. {
  248. title: '整改期限',
  249. dataIndex: 'reformTime',
  250. },
  251. {
  252. title: '判定问题',
  253. dataIndex: 'questionFlag',
  254. scopedSlots: { customRender: 'questionFlag' },
  255. },
  256. {
  257. title: '非问题标签',
  258. dataIndex: 'nonQuestionTag',
  259. },
  260. {
  261. title: '非问题说明',
  262. dataIndex: 'nonQuestionDesc',
  263. },
  264. {
  265. title: '提交说明',
  266. dataIndex: 'reformDesc',
  267. },
  268. {
  269. dataIndex: 'fileName',
  270. sdHidden: true,
  271. },
  272. // {
  273. // title: '提交人',
  274. // dataIndex: 'viewAccount',
  275. // },
  276. {
  277. title: '整改人',
  278. dataIndex: 'reformUserAccount',
  279. },
  280. {
  281. title: '整改状态',
  282. dataIndex: 'reformStatus',
  283. scopedSlots: { customRender: 'reformStatus' },
  284. },
  285. {
  286. title: '审核状态',
  287. dataIndex: 'endType',
  288. scopedSlots: { customRender: 'endType' },
  289. },
  290. {
  291. title: '审核说明',
  292. dataIndex: 'examineDesc',
  293. },
  294. {
  295. title: '初审人',
  296. dataIndex: 'checker',
  297. },
  298. {
  299. title: '初审时间',
  300. dataIndex: 'checkDate',
  301. },
  302. {
  303. title: '复审人',
  304. dataIndex: 'reviewer',
  305. },
  306. {
  307. title: '复审时间',
  308. dataIndex: 'reviewDate',
  309. },
  310. {
  311. title: '问题性质',
  312. dataIndex: 'questionNature',
  313. },
  314. // reformUserAccount
  315. // modelId, detailGroupId,隐藏
  316. { title: '模型ID', dataIndex: 'modelId', sdHidden: true },
  317. { title: '明细组ID', dataIndex: 'detailGroupId', sdHidden: true },
  318. ],
  319. expressions: [
  320. {
  321. dataType: 'str',
  322. name: 'modelType',
  323. op: 'eq',
  324. stringValue: '1',
  325. },
  326. ],
  327. startFlowList: {},
  328. detailList: [],
  329. }
  330. },
  331. created() {
  332. this.initColumns()
  333. this.initQueryData()
  334. },
  335. methods: {
  336. //
  337. // 初始化initQueryData
  338. initQueryData() {
  339. this.queryData = this.$route.query
  340. this.queryData.modelType = '1'
  341. },
  342. // 导出
  343. exportExcel() {
  344. // 判断选中的数据,至少选中一条数据
  345. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  346. if (selectedRows.length === 0) {
  347. message.warning('请至少选择一条数据')
  348. return
  349. }
  350. // 调用导出
  351. // 导出参数
  352. const params = selectedRows.map((item) => {
  353. return {
  354. modelId: item.modelId,
  355. detailGroupId: item.detailGroupId,
  356. businessCode: item.businessCode,
  357. jmEventType: item.jmEventType,
  358. eventTagName: item.eventTagName,
  359. modelTypeName: item.modelTypeName,
  360. pushDate: item.pushDate,
  361. unitCode: item.unitCode,
  362. modelType: item.modelType,
  363. bussKey: item.bussKey || null,
  364. }
  365. })
  366. // exportQuestionDetail
  367. AuditRiskbraryService.exportQuestionDetail(params).then((res) => {
  368. if (res.status === 200) {
  369. const url = URL.createObjectURL(res.data)
  370. const filename = res.headers['content-disposition']
  371. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  372. download(url, decodeURI(fname))
  373. message.success('导出成功')
  374. } else {
  375. Modal.warning({
  376. title: '提示',
  377. content: '导出报错,请联系管理员!',
  378. })
  379. return false
  380. }
  381. })
  382. },
  383. // 时间变化
  384. changeReformDeadline(val) {
  385. this.reqData.reformDeadlineSt = moment(val[0]._d).format('YYYY-MM-DD')
  386. this.reqData.reformDeadlineEd = moment(val[1]._d).format('YYYY-MM-DD')
  387. },
  388. changePushDate(val) {
  389. this.reqData.pushDateSt = moment(val[0]._d).format('YYYY-MM-DD')
  390. this.reqData.pushDateEd = moment(val[1]._d).format('YYYY-MM-DD')
  391. },
  392. ifSaveShow(record) {
  393. const userInfo = getUserInfo()
  394. const userAccount = record.reformUserAccount.split(',')
  395. // // account是否是整改人userInfo.account
  396. return userAccount.includes(userInfo.account)
  397. },
  398. initColumns() {
  399. // resp_person
  400. const userInfo = getUserInfo()
  401. // account
  402. const roles = this.$store.state.sd.common.userInfo.default.roles
  403. const isExport = roles.map((val) => val.code).includes('G-1_RESPONSIBLE_PERSON')
  404. if (isExport) {
  405. this.columns.push({
  406. title: '责任人',
  407. dataIndex: 'respPerson',
  408. })
  409. }
  410. this.columns.push({
  411. title: '操作',
  412. dataIndex: 'sharedSetting',
  413. fixed: 'right',
  414. width: '300px',
  415. scopedSlots: { customRender: 'action' },
  416. })
  417. },
  418. processReq(req) {
  419. req.data.expressions = [
  420. { dataType: 'str', name: 'reformStatus', op: 'eq', stringValue: this.form.reformStatus },
  421. { dataType: 'str', name: 'endType', op: 'eq', stringValue: this.form.endType },
  422. {
  423. dataType: 'str',
  424. name: 'reformDeadlineSt',
  425. op: 'eq',
  426. stringValue: this.reqData.reformDeadlineSt,
  427. },
  428. {
  429. dataType: 'str',
  430. name: 'reformDeadlineEd',
  431. op: 'eq',
  432. stringValue: this.reqData.reformDeadlineEd,
  433. },
  434. { dataType: 'str', name: 'pushDateSt', op: 'eq', stringValue: this.reqData.pushDateSt },
  435. { dataType: 'str', name: 'pushDateEd', op: 'eq', stringValue: this.reqData.pushDateEd },
  436. ]
  437. Object.keys(this.queryData).map((key) => {
  438. req.data.expressions.push({
  439. dataType: 'str',
  440. name: key,
  441. op: 'eq',
  442. stringValue: this.queryData[key],
  443. })
  444. })
  445. // 过滤没有stringvalue的对象
  446. req.data.expressions = req.data.expressions.filter(
  447. (item) => item?.stringValue !== undefined || item.stringValue === ''
  448. )
  449. return req
  450. },
  451. handleReset() {
  452. this.$refs.advancedSearchForm.resetFields()
  453. this.reqData = {
  454. reformDeadlineSt: '',
  455. reformDeadlineEd: '',
  456. pushDateSt: '',
  457. pushDateEd: '',
  458. }
  459. this.reformDeadline = []
  460. this.pushDate = []
  461. this.handleSearch()
  462. },
  463. // 查询
  464. handleAction(type) {
  465. switch (type) {
  466. case 'serach':
  467. this.handleSearch()
  468. break
  469. }
  470. },
  471. handleSearch() {
  472. this.dataKey++
  473. },
  474. // 下载
  475. exportClick(row) {
  476. if (!row.attachment) {
  477. message.warning('未上传附件无法下载')
  478. return
  479. }
  480. const attachmentList = row.attachment.split(',')
  481. const fileNameList = row.fileName.split(',')
  482. for (let i = 0; i < attachmentList.length; i++) {
  483. const spliceIndex = attachmentList[i].lastIndexOf('|')
  484. const destStep = attachmentList[i].substring(spliceIndex + 1, attachmentList[i].length)
  485. download(
  486. 'api/framework/v1/task-form-process/download-attachments/' + destStep,
  487. fileNameList[i]
  488. )
  489. }
  490. },
  491. // 整改说明点击弹框
  492. askClick(row) {
  493. this.askvisible = true
  494. this.askForm.id = row.id
  495. this.askForm.reformAsk = row.reformAsk
  496. },
  497. // 整改说明提交
  498. askFormhandleOk() {
  499. const param = {
  500. reformDesc: this.askForm.reformAsk,
  501. id: this.askForm.id,
  502. }
  503. AuditRiskbraryService.saveIamQuestionReform(param).then((res) => {
  504. if (res) {
  505. message.success('提交成功')
  506. this.$refs.askForm.resetFields()
  507. this.askvisible = false
  508. this.handleSearch()
  509. }
  510. })
  511. },
  512. // 整改说明关闭
  513. askFormCancel() {
  514. this.$refs.askForm.resetFields()
  515. this.askvisible = false
  516. },
  517. changep(values) {
  518. const arr = values.map((item) => {
  519. return {
  520. attrs: { we_expanded: 'false', we_selected: 'false' },
  521. checkable: true,
  522. code: item.code,
  523. key: item.code,
  524. name: item.name,
  525. title: item.name,
  526. type: item.type,
  527. }
  528. })
  529. const spliceIndex = this.startFlowList.actionId.indexOf('.')
  530. const destStep = this.startFlowList.actionId.substring(0, spliceIndex) + '.2'
  531. this.startFlowList.participantInfos.push({ destStepId: destStep, participants: arr })
  532. AuditRiskbraryService.startDispatch(this.startFlowList).then((res) => {
  533. if (res.data.flowInstanceResult.length) {
  534. message.success('提交成功')
  535. this.RectificationForm.reformDesc = undefined
  536. this.RectificationForm.attachment = undefined
  537. this.RectificationForm.id = ''
  538. this.RectificationForm.fileName = ''
  539. this.fileList = []
  540. this.visibleRectification = false
  541. this.handleSearch()
  542. }
  543. })
  544. },
  545. showModal(row) {
  546. // this.ModalquestionDetail = JSON.parse(row.questionDetail)
  547. const params = {
  548. modelId: row.modelId,
  549. detailGroupId: row.detailGroupId,
  550. ...this.queryData,
  551. bussKey: row.bussKey || null,
  552. }
  553. const formData = new FormData()
  554. Object.keys(params).forEach((key) => {
  555. formData.append(key, params[key])
  556. })
  557. this.modelDetail = {
  558. modelDomainName: row.modelDomainName,
  559. batchName: row.batchName,
  560. batchCode: row.batchCode,
  561. riskData: row.risk,
  562. }
  563. const detailJson = JSON.stringify(this.modelDetail)
  564. const queryJson = JSON.stringify(params)
  565. window.open(
  566. `#/audit-risk-detail?queryJson=${queryJson}&modelDetail=${detailJson}&detailStatus=${this.detailStatus}`
  567. )
  568. },
  569. cancel() {
  570. this.visible = false
  571. this.dataDetail = []
  572. this.columnsDetail = []
  573. this.modelDetail = {}
  574. },
  575. },
  576. }
  577. </script>
  578. <style module lang="scss">
  579. @use '@/common/design' as *;
  580. .wrap-height {
  581. height: 100%;
  582. .row-height {
  583. display: flex;
  584. flex: auto;
  585. height: 100%;
  586. .rightcard {
  587. flex: 1;
  588. width: calc(100% - 20%);
  589. height: 100%;
  590. }
  591. }
  592. }
  593. .button-content {
  594. button {
  595. margin: 0 4px;
  596. }
  597. }
  598. .no-action {
  599. padding: 0 15px;
  600. color: $text-color-secondary;
  601. }
  602. .detail {
  603. width: 100%;
  604. overflow-x: auto;
  605. }
  606. .model-detail {
  607. display: flex;
  608. margin-bottom: 10px;
  609. span {
  610. margin-right: 20px;
  611. }
  612. }
  613. </style>