audit-view-change.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  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. // 解码URL
  341. this.queryData.modelType = '1'
  342. },
  343. // 导出
  344. exportExcel() {
  345. // 判断选中的数据,至少选中一条数据
  346. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  347. if (selectedRows.length === 0) {
  348. message.warning('请至少选择一条数据')
  349. return
  350. }
  351. // 调用导出
  352. // 导出参数
  353. const params = selectedRows.map((item) => {
  354. return {
  355. modelId: item.modelId,
  356. detailGroupId: item.detailGroupId,
  357. businessCode: item.businessCode,
  358. jmEventType: item.jmEventType,
  359. eventTagName: item.eventTagName,
  360. modelTypeName: item.modelTypeName,
  361. pushDate: item.pushDate,
  362. unitCode: item.unitCode,
  363. modelType: item.modelType,
  364. bussKey: item.bussKey || null,
  365. }
  366. })
  367. // exportQuestionDetail
  368. AuditRiskbraryService.exportQuestionDetail(params).then((res) => {
  369. if (res.status === 200) {
  370. const url = URL.createObjectURL(res.data)
  371. const filename = res.headers['content-disposition']
  372. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  373. download(url, decodeURI(fname))
  374. message.success('导出成功')
  375. } else {
  376. Modal.warning({
  377. title: '提示',
  378. content: '导出报错,请联系管理员!',
  379. })
  380. return false
  381. }
  382. })
  383. },
  384. // 时间变化
  385. changeReformDeadline(val) {
  386. this.reqData.reformDeadlineSt = moment(val[0]._d).format('YYYY-MM-DD')
  387. this.reqData.reformDeadlineEd = moment(val[1]._d).format('YYYY-MM-DD')
  388. },
  389. changePushDate(val) {
  390. this.reqData.pushDateSt = moment(val[0]._d).format('YYYY-MM-DD')
  391. this.reqData.pushDateEd = moment(val[1]._d).format('YYYY-MM-DD')
  392. },
  393. ifSaveShow(record) {
  394. const userInfo = getUserInfo()
  395. const userAccount = record.reformUserAccount.split(',')
  396. // // account是否是整改人userInfo.account
  397. return userAccount.includes(userInfo.account)
  398. },
  399. initColumns() {
  400. // resp_person
  401. const userInfo = getUserInfo()
  402. // account
  403. const roles = this.$store.state.sd.common.userInfo.default.roles
  404. const isExport = roles.map((val) => val.code).includes('G-1_RESPONSIBLE_PERSON')
  405. if (isExport) {
  406. this.columns.push({
  407. title: '责任人',
  408. dataIndex: 'respPerson',
  409. })
  410. }
  411. this.columns.push({
  412. title: '操作',
  413. dataIndex: 'sharedSetting',
  414. fixed: 'right',
  415. width: '300px',
  416. scopedSlots: { customRender: 'action' },
  417. })
  418. },
  419. processReq(req) {
  420. req.data.expressions = [
  421. { dataType: 'str', name: 'reformStatus', op: 'eq', stringValue: this.form.reformStatus },
  422. { dataType: 'str', name: 'endType', op: 'eq', stringValue: this.form.endType },
  423. {
  424. dataType: 'str',
  425. name: 'reformDeadlineSt',
  426. op: 'eq',
  427. stringValue: this.reqData.reformDeadlineSt,
  428. },
  429. {
  430. dataType: 'str',
  431. name: 'reformDeadlineEd',
  432. op: 'eq',
  433. stringValue: this.reqData.reformDeadlineEd,
  434. },
  435. { dataType: 'str', name: 'pushDateSt', op: 'eq', stringValue: this.reqData.pushDateSt },
  436. { dataType: 'str', name: 'pushDateEd', op: 'eq', stringValue: this.reqData.pushDateEd },
  437. ]
  438. Object.keys(this.queryData).map((key) => {
  439. req.data.expressions.push({
  440. dataType: 'str',
  441. name: key,
  442. op: 'eq',
  443. stringValue: this.queryData[key],
  444. })
  445. })
  446. // 过滤没有stringvalue的对象
  447. req.data.expressions = req.data.expressions.filter(
  448. (item) => item?.stringValue !== undefined || item.stringValue === ''
  449. )
  450. return req
  451. },
  452. handleReset() {
  453. this.$refs.advancedSearchForm.resetFields()
  454. this.reqData = {
  455. reformDeadlineSt: '',
  456. reformDeadlineEd: '',
  457. pushDateSt: '',
  458. pushDateEd: '',
  459. }
  460. this.reformDeadline = []
  461. this.pushDate = []
  462. this.handleSearch()
  463. },
  464. // 查询
  465. handleAction(type) {
  466. switch (type) {
  467. case 'serach':
  468. this.handleSearch()
  469. break
  470. }
  471. },
  472. handleSearch() {
  473. this.dataKey++
  474. },
  475. // 下载
  476. exportClick(row) {
  477. if (!row.attachment) {
  478. message.warning('未上传附件无法下载')
  479. return
  480. }
  481. const attachmentList = row.attachment.split(',')
  482. const fileNameList = row.fileName.split(',')
  483. for (let i = 0; i < attachmentList.length; i++) {
  484. const spliceIndex = attachmentList[i].lastIndexOf('|')
  485. const destStep = attachmentList[i].substring(spliceIndex + 1, attachmentList[i].length)
  486. download(
  487. 'api/framework/v1/task-form-process/download-attachments/' + destStep,
  488. fileNameList[i]
  489. )
  490. }
  491. },
  492. // 整改说明点击弹框
  493. askClick(row) {
  494. this.askvisible = true
  495. this.askForm.id = row.id
  496. this.askForm.reformAsk = row.reformAsk
  497. },
  498. // 整改说明提交
  499. askFormhandleOk() {
  500. const param = {
  501. reformDesc: this.askForm.reformAsk,
  502. id: this.askForm.id,
  503. }
  504. AuditRiskbraryService.saveIamQuestionReform(param).then((res) => {
  505. if (res) {
  506. message.success('提交成功')
  507. this.$refs.askForm.resetFields()
  508. this.askvisible = false
  509. this.handleSearch()
  510. }
  511. })
  512. },
  513. // 整改说明关闭
  514. askFormCancel() {
  515. this.$refs.askForm.resetFields()
  516. this.askvisible = false
  517. },
  518. changep(values) {
  519. const arr = values.map((item) => {
  520. return {
  521. attrs: { we_expanded: 'false', we_selected: 'false' },
  522. checkable: true,
  523. code: item.code,
  524. key: item.code,
  525. name: item.name,
  526. title: item.name,
  527. type: item.type,
  528. }
  529. })
  530. const spliceIndex = this.startFlowList.actionId.indexOf('.')
  531. const destStep = this.startFlowList.actionId.substring(0, spliceIndex) + '.2'
  532. this.startFlowList.participantInfos.push({ destStepId: destStep, participants: arr })
  533. AuditRiskbraryService.startDispatch(this.startFlowList).then((res) => {
  534. if (res.data.flowInstanceResult.length) {
  535. message.success('提交成功')
  536. this.RectificationForm.reformDesc = undefined
  537. this.RectificationForm.attachment = undefined
  538. this.RectificationForm.id = ''
  539. this.RectificationForm.fileName = ''
  540. this.fileList = []
  541. this.visibleRectification = false
  542. this.handleSearch()
  543. }
  544. })
  545. },
  546. showModal(row) {
  547. // this.ModalquestionDetail = JSON.parse(row.questionDetail)
  548. const params = {
  549. modelId: row.modelId,
  550. detailGroupId: row.detailGroupId,
  551. ...this.queryData,
  552. bussKey: row.bussKey || null,
  553. }
  554. const formData = new FormData()
  555. Object.keys(params).forEach((key) => {
  556. formData.append(key, params[key])
  557. })
  558. this.modelDetail = {
  559. modelDomainName: row.modelDomainName,
  560. batchName: row.batchName,
  561. batchCode: row.batchCode,
  562. riskData: row.risk,
  563. }
  564. const detailJson = JSON.stringify(this.modelDetail)
  565. const queryJson = JSON.stringify(params)
  566. window.open(
  567. `#/audit-risk-detail?queryJson=${queryJson}&modelDetail=${detailJson}&detailStatus=${this.detailStatus}`
  568. )
  569. },
  570. cancel() {
  571. this.visible = false
  572. this.dataDetail = []
  573. this.columnsDetail = []
  574. this.modelDetail = {}
  575. },
  576. },
  577. }
  578. </script>
  579. <style module lang="scss">
  580. @use '@/common/design' as *;
  581. .wrap-height {
  582. height: 100%;
  583. .row-height {
  584. display: flex;
  585. flex: auto;
  586. height: 100%;
  587. .rightcard {
  588. flex: 1;
  589. width: calc(100% - 20%);
  590. height: 100%;
  591. }
  592. }
  593. }
  594. .button-content {
  595. button {
  596. margin: 0 4px;
  597. }
  598. }
  599. .no-action {
  600. padding: 0 15px;
  601. color: $text-color-secondary;
  602. }
  603. .detail {
  604. width: 100%;
  605. overflow-x: auto;
  606. }
  607. .model-detail {
  608. display: flex;
  609. margin-bottom: 10px;
  610. span {
  611. margin-right: 20px;
  612. }
  613. }
  614. </style>